@testream/junit-reporter 1.1.1 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{697.index.js → 759.index.js} +588 -1808
- package/dist/cli/{697.index.js → 759.index.js} +588 -1808
- package/dist/cli/converter.d.ts +1 -1
- package/dist/cli/converter.d.ts.map +1 -1
- package/dist/cli/index.d.ts +7 -5
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/source-snippets.d.ts +13 -0
- package/dist/cli/source-snippets.d.ts.map +1 -0
- package/dist/cli/test-locations.d.ts +11 -0
- package/dist/cli/test-locations.d.ts.map +1 -0
- package/dist/cli/types.d.ts +14 -2
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/uploader.d.ts +3 -2
- package/dist/cli/uploader.d.ts.map +1 -1
- package/dist/converter.d.ts +1 -1
- package/dist/converter.d.ts.map +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/source-snippets.d.ts +14 -0
- package/dist/source-snippets.d.ts.map +1 -0
- package/dist/test-locations.d.ts +12 -0
- package/dist/test-locations.d.ts.map +1 -0
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/uploader.d.ts +3 -2
- package/dist/uploader.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
(()=>{"use strict";var t={2406:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.detectCIContext=detectCIContext;function removePrefix(t,e){if(!t){return undefined}return t.startsWith(e)?t.slice(e.length):t}function readEnvironment(){const t=globalThis;return t.process?.env??{}}function buildGithubRepositoryUrl(t){if(!t.GITHUB_SERVER_URL||!t.GITHUB_REPOSITORY){return undefined}return`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}`}function buildGithubBuildUrl(t){if(!t.GITHUB_SERVER_URL||!t.GITHUB_REPOSITORY||!t.GITHUB_RUN_ID){return undefined}return`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}/actions/runs/${t.GITHUB_RUN_ID}`}function detectGitHubBranch(t){if(t.GITHUB_HEAD_REF){return t.GITHUB_HEAD_REF}if(t.GITHUB_REF?.startsWith("refs/heads/")){return t.GITHUB_REF_NAME??removePrefix(t.GITHUB_REF,"refs/heads/")}return undefined}function detectGitHubActionsContext(t){return{branch:detectGitHubBranch(t),commitSha:t.GITHUB_SHA,repositoryUrl:buildGithubRepositoryUrl(t),buildNumber:t.GITHUB_RUN_NUMBER,buildUrl:buildGithubBuildUrl(t)}}function detectGitLabContext(t){return{branch:t.CI_COMMIT_BRANCH||t.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,commitSha:t.CI_COMMIT_SHA,repositoryUrl:t.CI_PROJECT_URL,buildNumber:t.CI_PIPELINE_IID,buildUrl:t.CI_PIPELINE_URL}}function detectAzurePipelinesContext(t){return{branch:removePrefix(t.BUILD_SOURCEBRANCH,"refs/heads/"),commitSha:t.BUILD_SOURCEVERSION,repositoryUrl:t.BUILD_REPOSITORY_URI,buildNumber:t.BUILD_BUILDNUMBER,buildUrl:t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI&&t.SYSTEM_TEAMPROJECT&&t.BUILD_BUILDID?`${t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${t.SYSTEM_TEAMPROJECT}/_build/results?buildId=${t.BUILD_BUILDID}`:undefined}}function detectCircleCIContext(t){return{branch:t.CIRCLE_BRANCH,commitSha:t.CIRCLE_SHA1,repositoryUrl:t.CIRCLE_REPOSITORY_URL,buildNumber:t.CIRCLE_BUILD_NUM,buildUrl:t.CIRCLE_BUILD_URL}}function detectJenkinsContext(t){return{branch:removePrefix(t.GIT_BRANCH,"origin/"),commitSha:t.GIT_COMMIT,repositoryUrl:t.GIT_URL,buildNumber:t.BUILD_NUMBER,buildUrl:t.BUILD_URL}}function detectBitbucketContext(t){return{branch:t.BITBUCKET_BRANCH,commitSha:t.BITBUCKET_COMMIT,repositoryUrl:t.BITBUCKET_GIT_HTTP_ORIGIN,buildNumber:t.BITBUCKET_BUILD_NUMBER,buildUrl:t.BITBUCKET_REPO_FULL_NAME&&t.BITBUCKET_BUILD_NUMBER?`https://bitbucket.org/${t.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${t.BITBUCKET_BUILD_NUMBER}`:undefined}}const s=[{isMatch:t=>t.GITHUB_ACTIONS==="true",detect:detectGitHubActionsContext},{isMatch:t=>t.GITLAB_CI==="true",detect:detectGitLabContext},{isMatch:t=>t.TF_BUILD==="True",detect:detectAzurePipelinesContext},{isMatch:t=>t.CIRCLECI==="true",detect:detectCircleCIContext},{isMatch:t=>Boolean(t.JENKINS_URL),detect:detectJenkinsContext},{isMatch:t=>Boolean(t.BITBUCKET_BUILD_NUMBER),detect:detectBitbucketContext}];function detectCIContext(){const t=readEnvironment();for(const e of s){if(e.isMatch(t)){return e.detect(t)}}return{}}},3827:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true})},7322:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var r=Object.getOwnPropertyDescriptor(e,s);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,r)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var r=this&&this.__exportStar||function(t,e){for(var s in t)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(e,s))i(e,t,s)};Object.defineProperty(e,"__esModule",{value:true});e.ensureReportId=e.mapAttachmentsToTestResults=e.uploadArtifacts=e.uploadTestRun=e.detectCIContext=void 0;r(s(3827),e);var n=s(2406);Object.defineProperty(e,"detectCIContext",{enumerable:true,get:function(){return n.detectCIContext}});var o=s(8969);Object.defineProperty(e,"uploadTestRun",{enumerable:true,get:function(){return o.uploadTestRun}});Object.defineProperty(e,"uploadArtifacts",{enumerable:true,get:function(){return o.uploadArtifacts}});Object.defineProperty(e,"mapAttachmentsToTestResults",{enumerable:true,get:function(){return o.mapAttachmentsToTestResults}});Object.defineProperty(e,"ensureReportId",{enumerable:true,get:function(){return o.ensureReportId}})},8969:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.ensureReportId=ensureReportId;e.uploadTestRun=uploadTestRun;e.mapAttachmentsToTestResults=mapAttachmentsToTestResults;e.uploadArtifacts=uploadArtifacts;const i=s(2406);const r="https://test-manager-backend.fly.dev";function ensureReportId(t){if(typeof t.reportId==="string"&&t.reportId.trim().length>0){return t.reportId}const e=crypto.randomUUID();t.reportId=e;return e}function resolveApiUrl(t){const e=normalizeApiUrl(t);if(e){return e}const s=getEnvApiUrl();if(s){return s}return r}function getEnvApiUrl(){if(typeof process==="undefined"||!process?.env){return undefined}return normalizeApiUrl(process.env.TESTREAM_API_URL)}function normalizeApiUrl(t){if(!t){return undefined}const e=t.trim();if(!e){return undefined}return e.replace(/\/+$/,"")}function isReportAlreadyExistsConflict(t){return t.errorCode==="report_already_exists"}function formatUploadError(t){const e=t.detail||t.title||t.rawBody||"Unknown error";const s=t.errorCode?`, code=${t.errorCode}`:"";return`Upload failed (HTTP ${t.statusCode}${s}): ${e}`}async function parseHttpError(t){const e=await t.text();const s=t.headers.get("content-type")||"";if(s.toLowerCase().includes("json")&&e.trim().length>0){try{const s=JSON.parse(e);return{statusCode:t.status,title:s.title,detail:s.detail||s.details||s.error,errorCode:s.errorCode,rawBody:e}}catch{}}return{statusCode:t.status,rawBody:e}}function resolveUploadContext(t){const e=(0,i.detectCIContext)();return{commitSha:t.commitSha??e.commitSha,branch:t.branch??e.branch,repositoryUrl:t.repositoryUrl??e.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber??e.buildNumber,buildUrl:t.buildUrl??e.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType}}async function uploadTestRun(t){const{report:e,apiKey:s}=t;const i=resolveApiUrl(t.apiUrl);const r=ensureReportId(e);const n=resolveUploadContext(t);const o={report:e,reportId:r,...n};console.log("Uploading test results...");let a;try{a=await fetch(`${i}/api/v1/ingest`,{method:"POST",headers:{"X-API-KEY":s,"Content-Type":"application/json"},body:JSON.stringify(o)})}catch(t){const e=t instanceof Error?t.message:String(t);const s=`Connection failed: ${e}`;console.error(s);return{success:false,reportId:r,error:s}}if(!a.ok){const t=await parseHttpError(a);if(a.status===409&&isReportAlreadyExistsConflict(t)){console.warn("Report already exists (workflow may have been re-run)");return{success:true,reportId:r,summary:{passed:e.results.summary.passed,failed:e.results.summary.failed,skipped:e.results.summary.skipped,total:e.results.summary.tests},alreadyExists:true,statusCode:t.statusCode,errorCode:t.errorCode}}const s=formatUploadError(t);console.error(s);return{success:false,reportId:r,error:s,statusCode:t.statusCode,errorCode:t.errorCode,errorDetail:t.detail||t.rawBody}}const h=await a.json();console.log(`✓ Test results uploaded successfully`);console.log(` Report ID: ${h.reportId}`);console.log(` Test Run ID: ${h.testRunId}`);console.log(` Tests: ${h.summary.passed}/${h.summary.total} passed`);return{success:true,reportId:h.reportId,testRunId:h.testRunId,summary:{passed:h.summary.passed,failed:h.summary.failed,skipped:h.summary.skipped,total:h.summary.total},testResults:h.testResults}}function mapAttachmentsToTestResults(t,e){const s=new Map;for(const t of e){const e=s.get(t.name)??[];e.push(t.id);s.set(t.name,e)}const i=[];for(const e of t){const t=s.get(e.name);const r=t?.shift();if(!e.attachments||e.attachments.length===0){continue}if(!r){console.warn(`Skipping artifact upload: could not match test result for "${e.name}"`);continue}i.push({testResultId:r,attachments:e.attachments})}return i}async function uploadArtifacts(t){const{reportId:e,apiKey:s,testResults:i}=t;const r=resolveApiUrl(t.apiUrl);let n=0;for(const t of i){for(const i of t.attachments){try{const o=await uploadSingleArtifact({testResultId:t.testResultId,attachment:i,reportId:e,apiKey:s,apiUrl:r});if(o)n++}catch(t){const e=t instanceof Error?t.message:String(t);console.error(`Failed to upload artifact ${i.name}: ${e}`)}}}if(n>0){console.log(`✓ Uploaded ${n} artifact(s)`)}return n}async function uploadSingleArtifact(t){const{testResultId:e,attachment:i,reportId:r,apiKey:n,apiUrl:o}=t;const a=await Promise.resolve().then(s.t.bind(s,1943,23));const h=await Promise.resolve().then(s.t.bind(s,6928,23));const l=h.resolve(i.path);try{await a.access(l)}catch{console.warn(`Artifact not found: ${h.basename(l)}`);return false}let c;let u;const f=h.basename(l);const d=i.contentType||"application/octet-stream";try{c=await a.readFile(l);u=c.byteLength}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read file: ${e}`)}try{return await uploadWithPresignedUrl({testResultId:e,reportId:r,apiKey:n,apiUrl:o,attachmentName:i.name,fileName:f,contentType:d,sizeBytes:u,fileBuffer:c})}catch(t){if(!(t instanceof LegacyUploadRequiredError)){throw t}return await uploadWithLegacyEndpoint({testResultId:e,attachmentName:i.name,reportId:r,apiKey:n,apiUrl:o,fileName:f,contentType:d,fileBuffer:c})}}class LegacyUploadRequiredError extends Error{constructor(){super("Legacy upload endpoint required")}}async function uploadWithPresignedUrl(t){const{testResultId:e,reportId:s,apiKey:i,apiUrl:r,attachmentName:n,fileName:o,contentType:a,sizeBytes:h,fileBuffer:l}=t;const c={testResultId:e,ctrfAttachmentName:n,fileName:o,contentType:a,sizeBytes:h};const u=await fetch(`${r}/api/v1/artifacts/${s}/upload-url`,{method:"POST",headers:{"X-API-KEY":i,"Content-Type":"application/json"},body:JSON.stringify(c)});if(shouldFallbackToLegacyUpload(u.status)){throw new LegacyUploadRequiredError}if(!u.ok){const t=await u.text();throw new Error(`Failed to create direct upload URL (HTTP ${u.status}): ${t}`)}const f=await u.json();const d={...f.requiredHeaders??{}};if(!hasHeaderIgnoreCase(d,"Content-Type")){d["Content-Type"]=a}const p=await fetch(f.uploadUrl,{method:"PUT",headers:d,body:l});if(!p.ok){const t=await p.text();throw new Error(`Direct artifact upload failed (HTTP ${p.status}): ${t}`)}const g={testResultId:e,ctrfAttachmentName:n,fileName:o,contentType:a,sizeBytes:h,storageKey:f.storageKey};const y=await fetch(`${r}/api/v1/artifacts/${s}/complete`,{method:"POST",headers:{"X-API-KEY":i,"Content-Type":"application/json"},body:JSON.stringify(g)});if(!y.ok){const t=await y.text();throw new Error(`Failed to finalize artifact upload (HTTP ${y.status}): ${t}`)}return true}async function uploadWithLegacyEndpoint(t){const{testResultId:e,attachmentName:s,reportId:i,apiKey:r,apiUrl:n,fileName:o,contentType:a,fileBuffer:h}=t;const l=new Blob([new Uint8Array(h)],{type:a});const c=new FormData;c.append("testResultId",e);c.append("ctrfAttachmentName",s);c.append("file",l,o);const u=await fetch(`${n}/api/v1/artifacts/${i}`,{method:"POST",headers:{"X-API-KEY":r},body:c});if(!u.ok){const t=await u.text();throw new Error(`Legacy artifact upload failed (HTTP ${u.status}): ${t}`)}return true}function shouldFallbackToLegacyUpload(t){return t===404||t===405||t===501}function hasHeaderIgnoreCase(t,e){const s=e.toLowerCase();return Object.keys(t).some((t=>t.toLowerCase()===s))}},7294:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var r=Object.getOwnPropertyDescriptor(e,s);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,r)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var n=this&&this.__importStar||function(){var ownKeys=function(t){ownKeys=Object.getOwnPropertyNames||function(t){var e=[];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[e.length]=s;return e};return ownKeys(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=ownKeys(t),n=0;n<s.length;n++)if(s[n]!=="default")i(e,t,s[n]);r(e,t);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.DEFAULT_JUNIT_PATH=void 0;e.convertJUnitToCtrf=convertJUnitToCtrf;const o=n(s(1943));const a=n(s(6928));const h=s(447);const l=s(7322);e.DEFAULT_JUNIT_PATH="target/surefire-reports/TEST-*.xml";function hasGlobPattern(t){return t.includes("*")||t.includes("?")||t.includes("[")||t.includes("{")}async function resolveInputFiles(t){if(!hasGlobPattern(t)){const e=a.resolve(t);await o.access(e);return[e]}const e=await(0,h.glob)(t,{absolute:true,nodir:true});if(e.length===0){throw new Error(`No JUnit XML files found for pattern: ${t}`)}return e}async function resolveConverter(){const t=await s.e(697).then(s.bind(s,3697));const e=t.convertJUnitToCTRFReport??t.convertJUnitToCtrfReport??t.default;if(typeof e!=="function"){throw new Error("Failed to resolve junit-to-ctrf converter function. Expected 'convertJUnitToCTRFReport' export.")}return e}function normalizeNumeric(t,e){return typeof t==="number"&&Number.isFinite(t)?t:e}function normalizeNonNegativeDuration(t){if(typeof t!=="number"||!Number.isFinite(t)){return 0}return t>0?t:0}function normalizeTimestamp(t,e){return typeof t==="number"&&Number.isFinite(t)&&t>0?t:e}function normalizeText(t){if(typeof t!=="string"){return undefined}const e=t.trim();return e.length>0?e:undefined}function collectSuiteParts(t,e){const s=normalizeText(t);if(s){e.push(s);return}if(!Array.isArray(t)){return}for(const s of t){collectSuiteParts(s,e)}}function normalizeSuiteValue(t){const e=normalizeText(t);if(e){return e}if(!Array.isArray(t)){return undefined}const s=[];collectSuiteParts(t,s);return s.length>0?s.join(" > "):undefined}function normalizeJavaClassName(t){if(!t.includes(".")&&!t.includes("$")){return t}const e=t.split(".").pop()??t;return e.split("$").join(" > ")}function normalizeTestEntry(t){const e=t&&typeof t==="object"?t:{};const s={...e};const i=normalizeSuiteValue(e.suite);if(i){s.suite=normalizeJavaClassName(i)}else{delete s.suite}return s}function buildSummary(t,e){let s=0;let i=0;let r=0;let n=0;let o=0;const a=new Set;const h=Date.now();let l=Number.POSITIVE_INFINITY;let c=0;for(const e of t){const t=normalizeSuiteValue(e.suite);if(t){a.add(t)}const u=normalizeNumeric(e.start,h);const f=normalizeNonNegativeDuration(e.duration);const d=normalizeNumeric(e.stop,u+f);if(u<l){l=u}if(d>c){c=d}switch(e.status){case"passed":s++;break;case"failed":i++;break;case"skipped":r++;break;case"pending":n++;break;default:o++;break}}if(l===Number.POSITIVE_INFINITY){l=normalizeTimestamp(e?.start,h)}if(c===0){c=normalizeTimestamp(e?.stop,l)}return{tests:t.length,passed:s,failed:i,skipped:r,pending:n,other:o,start:normalizeTimestamp(e?.start,l),stop:normalizeTimestamp(e?.stop,c),suites:a.size}}function normalizeReport(t){if(!t||typeof t!=="object"){throw new Error("junit-to-ctrf returned an invalid report payload")}const e=t;if(!e.results||typeof e.results!=="object"){throw new Error("Converted report is missing results payload")}if(!Array.isArray(e.results.tests)){e.results.tests=[]}e.results.tests=e.results.tests.map((t=>normalizeTestEntry(t)));if(!e.results.tool||typeof e.results.tool!=="object"){e.results.tool={name:"junit"}}e.results.tool.name="junit";e.results.summary=buildSummary(e.results.tests,e.results.summary);e.reportFormat=e.reportFormat||"CTRF";e.specVersion=e.specVersion||"0.0.0";e.generatedBy=e.generatedBy||"@testream/junit-reporter";e.timestamp=e.timestamp||(new Date).toISOString();(0,l.ensureReportId)(e);return e}function mergeReports(t){if(t.length===0){throw new Error("No converted JUnit reports were produced")}if(t.length===1){return t[0]}const e=t[0];const s=t.flatMap((t=>t.results.tests));const i=Math.min(...t.map((t=>t.results.summary.start)));const r=Math.max(...t.map((t=>t.results.summary.stop)));const n={...e,timestamp:(new Date).toISOString(),generatedBy:"@testream/junit-reporter",results:{...e.results,tool:{...e.results.tool,name:"junit"},tests:s,summary:buildSummary(s,{start:i,stop:r})}};(0,l.ensureReportId)(n);return n}async function convertSingleFile(t,e){try{const s=await e(t);if(s===null||s===undefined){return null}return normalizeReport(s)}catch(e){const s=e instanceof Error?e.message:String(e);throw new Error(`Failed to convert JUnit XML at ${t}: ${s}`)}}async function convertJUnitToCtrf(t){const s=t.outputDir||"ctrf";const i=t.outputFile||"ctrf-report.json";const r=t.junitPath||e.DEFAULT_JUNIT_PATH;const n=await resolveInputFiles(r);const h=await resolveConverter();const l=[];let c=0;for(const t of n){const e=await convertSingleFile(t,h);if(e===null){c++}else{l.push(e)}}if(l.length===0){if(c>0){throw new Error(`No test cases found in any of the ${n.length} JUnit XML file(s). `+`All files appear to be empty stubs (e.g. @Nested parent classes with tests="0"). `+`Ensure the nested class XML files (e.g. TEST-MyTest$Inner.xml) are included in the path.`)}throw new Error("No converted JUnit reports were produced")}const u=mergeReports(l);const f=a.resolve(s,i);await o.mkdir(a.dirname(f),{recursive:true});await o.writeFile(f,JSON.stringify(u,null,2));return{report:u,reportPath:f,sourceFiles:n}}},8010:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.detectGitContext=void 0;e.uploadCtrfReport=uploadCtrfReport;const i=s(7322);async function uploadCtrfReport(t){return(0,i.uploadTestRun)({report:t.report,apiKey:t.apiKey,apiUrl:t.apiUrl,branch:t.branch,commitSha:t.commitSha,repositoryUrl:t.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType})}e.detectGitContext=i.detectCIContext},2613:t=>{t.exports=require("assert")},9140:t=>{t.exports=require("constants")},4434:t=>{t.exports=require("events")},9896:t=>{t.exports=require("fs")},1943:t=>{t.exports=require("fs/promises")},8474:t=>{t.exports=require("node:events")},3024:t=>{t.exports=require("node:fs")},1455:t=>{t.exports=require("node:fs/promises")},6760:t=>{t.exports=require("node:path")},7075:t=>{t.exports=require("node:stream")},6193:t=>{t.exports=require("node:string_decoder")},3136:t=>{t.exports=require("node:url")},6928:t=>{t.exports=require("path")},2203:t=>{t.exports=require("stream")},3557:t=>{t.exports=require("timers")},9023:t=>{t.exports=require("util")},7080:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.range=e.balanced=void 0;const balanced=(t,s,i)=>{const r=t instanceof RegExp?maybeMatch(t,i):t;const n=s instanceof RegExp?maybeMatch(s,i):s;const o=r!==null&&n!=null&&(0,e.range)(r,n,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+r.length,o[1]),post:i.slice(o[1]+n.length)}};e.balanced=balanced;const maybeMatch=(t,e)=>{const s=e.match(t);return s?s[0]:null};const range=(t,e,s)=>{let i,r,n,o=undefined,a;let h=s.indexOf(t);let l=s.indexOf(e,h+1);let c=h;if(h>=0&&l>0){if(t===e){return[h,l]}i=[];n=s.length;while(c>=0&&!a){if(c===h){i.push(c);h=s.indexOf(t,c+1)}else if(i.length===1){const t=i.pop();if(t!==undefined)a=[t,l]}else{r=i.pop();if(r!==undefined&&r<n){n=r;o=l}l=s.indexOf(e,c+1)}c=h<l&&h>=0?h:l}if(i.length&&o!==undefined){a=[n,o]}}return a};e.range=range},2339:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.expand=expand;const i=s(7080);const r="\0SLASH"+Math.random()+"\0";const n="\0OPEN"+Math.random()+"\0";const o="\0CLOSE"+Math.random()+"\0";const a="\0COMMA"+Math.random()+"\0";const h="\0PERIOD"+Math.random()+"\0";const l=new RegExp(r,"g");const c=new RegExp(n,"g");const u=new RegExp(o,"g");const f=new RegExp(a,"g");const d=new RegExp(h,"g");const p=/\\\\/g;const g=/\\{/g;const y=/\\}/g;const b=/\\,/g;const w=/\\./g;function numeric(t){return!isNaN(t)?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.replace(p,r).replace(g,n).replace(y,o).replace(b,a).replace(w,h)}function unescapeBraces(t){return t.replace(l,"\\").replace(c,"{").replace(u,"}").replace(f,",").replace(d,".")}function parseCommaParts(t){if(!t){return[""]}const e=[];const s=(0,i.balanced)("{","}",t);if(!s){return t.split(",")}const{pre:r,body:n,post:o}=s;const a=r.split(",");a[a.length-1]+="{"+n+"}";const h=parseCommaParts(o);if(o.length){a[a.length-1]+=h.shift();a.push.apply(a,h)}e.push.apply(e,a);return e}function expand(t){if(!t){return[]}if(t.slice(0,2)==="{}"){t="\\{\\}"+t.slice(2)}return expand_(escapeBraces(t),true).map(unescapeBraces)}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,e){return t<=e}function gte(t,e){return t>=e}function expand_(t,e){const s=[];const r=(0,i.balanced)("{","}",t);if(!r)return[t];const n=r.pre;const a=r.post.length?expand_(r.post,false):[""];if(/\$$/.test(r.pre)){for(let t=0;t<a.length;t++){const e=n+"{"+r.body+"}"+a[t];s.push(e)}}else{const i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body);const h=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body);const l=i||h;const c=r.body.indexOf(",")>=0;if(!l&&!c){if(r.post.match(/,(?!,).*\}/)){t=r.pre+"{"+r.body+o+r.post;return expand_(t)}return[t]}let u;if(l){u=r.body.split(/\.\./)}else{u=parseCommaParts(r.body);if(u.length===1&&u[0]!==undefined){u=expand_(u[0],false).map(embrace);if(u.length===1){return a.map((t=>r.pre+u[0]+t))}}}let f;if(l&&u[0]!==undefined&&u[1]!==undefined){const t=numeric(u[0]);const e=numeric(u[1]);const s=Math.max(u[0].length,u[1].length);let i=u.length===3&&u[2]!==undefined?Math.abs(numeric(u[2])):1;let r=lte;const n=e<t;if(n){i*=-1;r=gte}const o=u.some(isPadded);f=[];for(let n=t;r(n,e);n+=i){let t;if(h){t=String.fromCharCode(n);if(t==="\\"){t=""}}else{t=String(n);if(o){const e=s-t.length;if(e>0){const s=new Array(e+1).join("0");if(n<0){t="-"+s+t.slice(1)}else{t=s+t}}}}f.push(t)}}else{f=[];for(let t=0;t<u.length;t++){f.push.apply(f,expand_(u[t],false))}}for(let t=0;t<f.length;t++){for(let i=0;i<a.length;i++){const r=n+f[t]+a[i];if(!e||l||r){s.push(r)}}}}return s}},8809:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Glob=void 0;const i=s(6647);const r=s(3136);const n=s(5125);const o=s(2841);const a=s(6089);const h=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");this.withFileTypes=!!e.withFileTypes;this.signal=e.signal;this.follow=!!e.follow;this.dot=!!e.dot;this.dotRelative=!!e.dotRelative;this.nodir=!!e.nodir;this.mark=!!e.mark;if(!e.cwd){this.cwd=""}else if(e.cwd instanceof URL||e.cwd.startsWith("file://")){e.cwd=(0,r.fileURLToPath)(e.cwd)}this.cwd=e.cwd||"";this.root=e.root;this.magicalBraces=!!e.magicalBraces;this.nobrace=!!e.nobrace;this.noext=!!e.noext;this.realpath=!!e.realpath;this.absolute=e.absolute;this.includeChildMatches=e.includeChildMatches!==false;this.noglobstar=!!e.noglobstar;this.matchBase=!!e.matchBase;this.maxDepth=typeof e.maxDepth==="number"?e.maxDepth:Infinity;this.stat=!!e.stat;this.ignore=e.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof t==="string"){t=[t]}this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){t=t.map((t=>t.replace(/\\/g,"/")))}if(this.matchBase){if(e.noglobstar){throw new TypeError("base matching requires globstar")}t=t.map((t=>t.includes("/")?t:`./**/${t}`))}this.pattern=t;this.platform=e.platform||h;this.opts={...e,platform:this.platform};if(e.scurry){this.scurry=e.scurry;if(e.nocase!==undefined&&e.nocase!==e.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const t=e.platform==="win32"?n.PathScurryWin32:e.platform==="darwin"?n.PathScurryDarwin:e.platform?n.PathScurryPosix:n.PathScurry;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const a={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const l=this.pattern.map((t=>new i.Minimatch(t,a)));const[c,u]=l.reduce(((t,e)=>{t[0].push(...e.set);t[1].push(...e.globParts);return t}),[[],[]]);this.patterns=c.map(((t,e)=>{const s=u[e];if(!s)throw new Error("invalid pattern object");return new o.Pattern(t,s,0,this.platform)}))}async walk(){return[...await new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new a.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new a.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}e.Glob=Glob},6233:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.hasMagic=void 0;const i=s(6647);const hasMagic=(t,e={})=>{if(!Array.isArray(t)){t=[t]}for(const s of t){if(new i.Minimatch(s,e).hasMagic())return true}return false};e.hasMagic=hasMagic},6449:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Ignore=void 0;const i=s(6647);const r=s(2841);const n=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:r,platform:o=n}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=o;this.mmopts={dot:true,nobrace:e,nocase:s,noext:i,noglobstar:r,optimizationLevel:2,platform:o,nocomment:true,nonegate:true};for(const e of t)this.add(e)}add(t){const e=new i.Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const s=e.set[t];const n=e.globParts[t];if(!s||!n){throw new Error("invalid pattern object")}while(s[0]==="."&&n[0]==="."){s.shift();n.shift()}const o=new r.Pattern(s,n,0,this.platform);const a=new i.Minimatch(o.globString(),this.mmopts);const h=n[n.length-1]==="**";const l=o.isAbsolute();if(l)this.absolute.push(a);else this.relative.push(a);if(h){if(l)this.absoluteChildren.push(a);else this.relativeChildren.push(a)}}}ignored(t){const e=t.fullpath();const s=`${e}/`;const i=t.relative()||".";const r=`${i}/`;for(const t of this.relative){if(t.match(i)||t.match(r))return true}for(const t of this.absolute){if(t.match(e)||t.match(s))return true}return false}childrenIgnored(t){const e=t.fullpath()+"/";const s=(t.relative()||".")+"/";for(const t of this.relativeChildren){if(t.match(s))return true}for(const t of this.absoluteChildren){if(t.match(e))return true}return false}}e.Ignore=Ignore},447:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0;e.globStreamSync=globStreamSync;e.globStream=globStream;e.globSync=globSync;e.globIterateSync=globIterateSync;e.globIterate=globIterate;const i=s(6647);const r=s(8809);const n=s(6233);var o=s(6647);Object.defineProperty(e,"escape",{enumerable:true,get:function(){return o.escape}});Object.defineProperty(e,"unescape",{enumerable:true,get:function(){return o.unescape}});var a=s(8809);Object.defineProperty(e,"Glob",{enumerable:true,get:function(){return a.Glob}});var h=s(6233);Object.defineProperty(e,"hasMagic",{enumerable:true,get:function(){return h.hasMagic}});var l=s(6449);Object.defineProperty(e,"Ignore",{enumerable:true,get:function(){return l.Ignore}});function globStreamSync(t,e={}){return new r.Glob(t,e).streamSync()}function globStream(t,e={}){return new r.Glob(t,e).stream()}function globSync(t,e={}){return new r.Glob(t,e).walkSync()}async function glob_(t,e={}){return new r.Glob(t,e).walk()}function globIterateSync(t,e={}){return new r.Glob(t,e).iterateSync()}function globIterate(t,e={}){return new r.Glob(t,e).iterate()}e.streamSync=globStreamSync;e.stream=Object.assign(globStream,{sync:globStreamSync});e.iterateSync=globIterateSync;e.iterate=Object.assign(globIterate,{sync:globIterateSync});e.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});e.glob=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:e.sync,globStream:globStream,stream:e.stream,globStreamSync:globStreamSync,streamSync:e.streamSync,globIterate:globIterate,iterate:e.iterate,globIterateSync:globIterateSync,iterateSync:e.iterateSync,Glob:r.Glob,hasMagic:n.hasMagic,escape:i.escape,unescape:i.unescape});e.glob.glob=e.glob},2841:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Pattern=void 0;const i=s(6647);const isPatternList=t=>t.length>=1;const isGlobList=t=>t.length>=1;class Pattern{#t;#e;#s;length;#i;#r;#n;#o;#a;#h;#l=true;constructor(t,e,s,i){if(!isPatternList(t)){throw new TypeError("empty pattern list")}if(!isGlobList(e)){throw new TypeError("empty glob list")}if(e.length!==t.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=t.length;if(s<0||s>=this.length){throw new TypeError("index out of range")}this.#t=t;this.#e=e;this.#s=s;this.#i=i;if(this.#s===0){if(this.isUNC()){const[t,e,s,i,...r]=this.#t;const[n,o,a,h,...l]=this.#e;if(r[0]===""){r.shift();l.shift()}const c=[t,e,s,i,""].join("/");const u=[n,o,a,h,""].join("/");this.#t=[c,...r];this.#e=[u,...l];this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#t;const[s,...i]=this.#e;if(e[0]===""){e.shift();i.shift()}const r=t+"/";const n=s+"/";this.#t=[r,...e];this.#e=[n,...i];this.length=this.#t.length}}}pattern(){return this.#t[this.#s]}isString(){return typeof this.#t[this.#s]==="string"}isGlobstar(){return this.#t[this.#s]===i.GLOBSTAR}isRegExp(){return this.#t[this.#s]instanceof RegExp}globString(){return this.#n=this.#n||(this.#s===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){if(this.#r!==undefined)return this.#r;if(!this.hasMore())return this.#r=null;this.#r=new Pattern(this.#t,this.#e,this.#s+1,this.#i);this.#r.#h=this.#h;this.#r.#a=this.#a;this.#r.#o=this.#o;return this.#r}isUNC(){const t=this.#t;return this.#a!==undefined?this.#a:this.#a=this.#i==="win32"&&this.#s===0&&t[0]===""&&t[1]===""&&typeof t[2]==="string"&&!!t[2]&&typeof t[3]==="string"&&!!t[3]}isDrive(){const t=this.#t;return this.#o!==undefined?this.#o:this.#o=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#t;return this.#h!==undefined?this.#h:this.#h=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#t[0];return typeof t==="string"&&this.isAbsolute()&&this.#s===0?t:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){if(this.#s===0||!this.isGlobstar()||!this.#l)return false;this.#l=false;return true}}e.Pattern=Pattern},7999:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;const i=s(6647);class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath();const i=this.store.get(s);if(i)i.add(e.globString());else this.store.set(s,new Set([e.globString()]))}}e.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0);const r=this.store.get(t);this.store.set(t,r===undefined?i:i&r)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(e&2),!!(e&1)]))}}e.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(t,e){if(!t.canReaddir()){return}const s=this.store.get(t);if(s){if(!s.find((t=>t.globString()===e.globString()))){s.push(e)}}else this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e){throw new Error("attempting to walk unknown path")}return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}e.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t;this.follow=!!t.follow;this.dot=!!t.dot;this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root();const r=e.isAbsolute()&&this.opts.absolute!==false;if(s){t=t.resolve(s==="/"&&this.opts.root!==undefined?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,true,false);continue}else{e=i}}if(t.isENOENT())continue;let n;let o;let a=false;while(typeof(n=e.pattern())==="string"&&(o=e.rest())){const s=t.resolve(n);t=s;e=o;a=true}n=e.pattern();o=e.rest();if(a){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if(typeof n==="string"){const e=n===".."||n===""||n===".";this.matches.add(t.resolve(n),r,e);continue}else if(n===i.GLOBSTAR){if(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar()){this.subwalks.add(t,e)}const s=o?.pattern();const i=o?.rest();if(!o||(s===""||s===".")&&!i){this.matches.add(t,r,s===""||s===".")}else{if(s===".."){const e=t.parent||t;if(!i)this.matches.add(e,r,true);else if(!this.hasWalkedCache.hasWalked(e,i)){this.subwalks.add(e,i)}}}}else if(n instanceof RegExp){this.subwalks.add(t,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t);const r=this.child();for(const t of e){for(const e of s){const s=e.isAbsolute();const n=e.pattern();const o=e.rest();if(n===i.GLOBSTAR){r.testGlobstar(t,e,o,s)}else if(n instanceof RegExp){r.testRegExp(t,n,o,s)}else{r.testString(t,n,o,s)}}}return r}testGlobstar(t,e,s,i){if(this.dot||!t.name.startsWith(".")){if(!e.hasMore()){this.matches.add(t,i,false)}if(t.canReaddir()){if(this.follow||!t.isSymbolicLink()){this.subwalks.add(t,e)}else if(t.isSymbolicLink()){if(s&&e.checkFollowGlobstar()){this.subwalks.add(t,s)}else if(e.markFollowGlobstar()){this.subwalks.add(t,e)}}}}if(s){const e=s.pattern();if(typeof e==="string"&&e!==".."&&e!==""&&e!=="."){this.testString(t,e,s.rest(),i)}else if(e===".."){const e=t.parent||t;this.subwalks.add(e,s)}else if(e instanceof RegExp){this.testRegExp(t,e,s.rest(),i)}}}testRegExp(t,e,s,i){if(!e.test(t.name))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}testString(t,e,s,i){if(!t.isNamed(e))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}}e.Processor=Processor},6089:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;const i=s(1031);const r=s(6449);const n=s(7999);const makeIgnore=(t,e)=>typeof t==="string"?new r.Ignore([t],e):Array.isArray(t)?new r.Ignore(t,e):t;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#c=[];#u;#f;signal;maxDepth;includeChildMatches;constructor(t,e,s){this.patterns=t;this.path=e;this.opts=s;this.#f=!s.posix&&s.platform==="win32"?"\\":"/";this.includeChildMatches=s.includeChildMatches!==false;if(s.ignore||!this.includeChildMatches){this.#u=makeIgnore(s.ignore??[],s);if(!this.includeChildMatches&&typeof this.#u.add!=="function"){const t="cannot ignore child matches, ignore lacks add() method.";throw new Error(t)}}this.maxDepth=s.maxDepth||Infinity;if(s.signal){this.signal=s.signal;this.signal.addEventListener("abort",(()=>{this.#c.length=0}))}}#d(t){return this.seen.has(t)||!!this.#u?.ignored?.(t)}#p(t){return!!this.#u?.childrenIgnored?.(t)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let t=undefined;while(!this.paused&&(t=this.#c.shift())){t()}}onResume(t){if(this.signal?.aborted)return;if(!this.paused){t()}else{this.#c.push(t)}}async matchCheck(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||await t.realpath();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const r=i?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){const t=await r.realpath();if(t&&(t.isUnknown()||this.opts.stat)){await t.lstat()}}return this.matchCheckTest(r,e)}matchCheckTest(t,e){return t&&(this.maxDepth===Infinity||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#d(t)?t:undefined}matchCheckSync(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||t.realpathSync();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const r=i?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&r?.isSymbolicLink()){const t=r.realpathSync();if(t&&(t?.isUnknown()||this.opts.stat)){t.lstatSync()}}return this.matchCheckTest(r,e)}matchFinish(t,e){if(this.#d(t))return;if(!this.includeChildMatches&&this.#u?.add){const e=`${t.relativePosix()}/**`;this.#u.add(e)}const s=this.opts.absolute===undefined?e:this.opts.absolute;this.seen.add(t);const i=this.opts.mark&&t.isDirectory()?this.#f:"";if(this.opts.withFileTypes){this.matchEmit(t)}else if(s){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+i)}else{const e=this.opts.posix?t.relativePosix():t.relative();const s=this.opts.dotRelative&&!e.startsWith(".."+this.#f)?"."+this.#f:"";this.matchEmit(!e?"."+i:s+e+i)}}async match(t,e,s){const i=await this.matchCheck(t,s);if(i)this.matchFinish(i,e)}matchSync(t,e,s){const i=this.matchCheckSync(t,s);if(i)this.matchFinish(i,e)}walkCB(t,e,s){if(this.signal?.aborted)s();this.walkCB2(t,e,new n.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#p(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2(t,e,s,i)));return}s.processPatterns(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#d(t))continue;r++;this.match(t,e,i).then((()=>next()))}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}r++;const e=t.readdirCached();if(t.calledReaddir())this.walkCB3(t,e,s,next);else{t.readdirCB(((e,i)=>this.walkCB3(t,i,s,next)),true)}}next()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#d(t))continue;r++;this.match(t,e,i).then((()=>next()))}for(const[t,e]of s.subwalks.entries()){r++;this.walkCB2(t,e,s.child(),next)}next()}walkCBSync(t,e,s){if(this.signal?.aborted)s();this.walkCB2Sync(t,e,new n.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#p(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2Sync(t,e,s,i)));return}s.processPatterns(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#d(t))continue;this.matchSync(t,e,i)}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}r++;const e=t.readdirSync();this.walkCB3Sync(t,e,s,next)}next()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let r=1;const next=()=>{if(--r===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#d(t))continue;this.matchSync(t,e,i)}for(const[t,e]of s.subwalks.entries()){r++;this.walkCB2Sync(t,e,s.child(),next)}next()}}e.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){e(this.signal.reason)}else{t(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}e.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(t,e,s){super(t,e,s);this.results=new i.Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t);if(!this.results.flowing)this.pause()}stream(){const t=this.path;if(t.isUnknown()){t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(t,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}e.GlobStream=GlobStream},3481:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.LRUCache=void 0;const s=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const i=new Set;const r=typeof process==="object"&&!!process?process:{};const emitWarning=(t,e,s,i)=>{typeof r.emitWarning==="function"?r.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)};let n=globalThis.AbortController;let o=globalThis.AbortSignal;if(typeof n==="undefined"){o=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(t,e){this._onabort.push(e)}};n=class AbortController{constructor(){warnACPolyfill()}signal=new o;abort(t){if(this.signal.aborted)return;this.signal.reason=t;this.signal.aborted=true;for(const e of this.signal._onabort){e(t)}this.signal.onabort?.(t)}};let t=r.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!t)return;t=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=t=>!i.has(t);const a=Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t);const getUintArray=t=>!isPosInt(t)?null:t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(t){super(t);this.fill(0)}}class Stack{heap;length;static#m=false;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#m=true;const s=new Stack(t,e);Stack.#m=false;return s}constructor(t,e){if(!Stack.#m){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new e(t);this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#g;#y;#b;#w;#S;#v;#T;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#k;#x;#E;#C;#R;#P;#A;#I;#L;#O;#M;#U;#B;#F;#N;#j;#z;#D;#G;static unsafeExposeInternals(t){return{starts:t.#B,ttls:t.#F,autopurgeTimers:t.#N,sizes:t.#U,keyMap:t.#E,keyList:t.#C,valList:t.#R,next:t.#P,prev:t.#A,get head(){return t.#I},get tail(){return t.#L},free:t.#O,isBackgroundFetch:e=>t.#W(e),backgroundFetch:(e,s,i,r)=>t.#$(e,s,i,r),moveToTail:e=>t.#q(e),indexes:e=>t.#H(e),rindexes:e=>t.#V(e),isStale:e=>t.#J(e)}}get max(){return this.#g}get maxSize(){return this.#y}get calculatedSize(){return this.#x}get size(){return this.#k}get fetchMethod(){return this.#v}get memoMethod(){return this.#T}get dispose(){return this.#b}get onInsert(){return this.#w}get disposeAfter(){return this.#S}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:h,allowStale:l,dispose:c,onInsert:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:p,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:b,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:v,noDeleteOnStaleGet:T,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:k,ignoreFetchAbort:x,perf:E}=t;if(E!==undefined){if(typeof E?.now!=="function"){throw new TypeError("perf option must have a now() method if specified")}}this.#_=E??s;if(e!==0&&!isPosInt(e)){throw new TypeError("max option must be a nonnegative integer")}const C=e?getUintArray(e):Array;if(!C){throw new Error("invalid max value: "+e)}this.#g=e;this.#y=g;this.maxEntrySize=y||this.#y;this.sizeCalculation=b;if(this.sizeCalculation){if(!this.#y&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(S!==undefined&&typeof S!=="function"){throw new TypeError("memoMethod must be a function if defined")}this.#T=S;if(w!==undefined&&typeof w!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#v=w;this.#z=!!w;this.#E=new Map;this.#C=new Array(e).fill(undefined);this.#R=new Array(e).fill(undefined);this.#P=new C(e);this.#A=new C(e);this.#I=0;this.#L=0;this.#O=Stack.create(e);this.#k=0;this.#x=0;if(typeof c==="function"){this.#b=c}if(typeof u==="function"){this.#w=u}if(typeof f==="function"){this.#S=f;this.#M=[]}else{this.#S=undefined;this.#M=undefined}this.#j=!!this.#b;this.#G=!!this.#w;this.#D=!!this.#S;this.noDisposeOnSet=!!d;this.noUpdateTTL=!!p;this.noDeleteOnFetchRejection=!!v;this.allowStaleOnFetchRejection=!!_;this.allowStaleOnFetchAbort=!!k;this.ignoreFetchAbort=!!x;if(this.maxEntrySize!==0){if(this.#y!==0){if(!isPosInt(this.#y)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#K()}this.allowStale=!!l;this.noDeleteOnStaleGet=!!T;this.updateAgeOnGet=!!a;this.updateAgeOnHas=!!h;this.ttlResolution=isPosInt(n)||n===0?n:1;this.ttlAutopurge=!!o;this.ttl=r||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#Y()}if(this.#g===0&&this.ttl===0&&this.#y===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#y){const t="LRU_CACHE_UNBOUNDED";if(shouldWarn(t)){i.add(t);const e="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(e,"UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#E.has(t)?Infinity:0}#Y(){const t=new ZeroArray(this.#g);const e=new ZeroArray(this.#g);this.#F=t;this.#B=e;const s=this.ttlAutopurge?new Array(this.#g):undefined;this.#N=s;this.#X=(i,r,n=this.#_.now())=>{e[i]=r!==0?n:0;t[i]=r;if(s?.[i]){clearTimeout(s[i]);s[i]=undefined}if(r!==0&&s){const t=setTimeout((()=>{if(this.#J(i)){this.#Z(this.#C[i],"expire")}}),r+1);if(t.unref){t.unref()}s[i]=t}};this.#Q=s=>{e[s]=t[s]!==0?this.#_.now():0};this.#tt=(s,r)=>{if(t[r]){const n=t[r];const o=e[r];if(!n||!o)return;s.ttl=n;s.start=o;s.now=i||getNow();const a=s.now-o;s.remainingTTL=n-a}};let i=0;const getNow=()=>{const t=this.#_.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);if(e.unref){e.unref()}}return t};this.getRemainingTTL=s=>{const r=this.#E.get(s);if(r===undefined){return 0}const n=t[r];const o=e[r];if(!n||!o){return Infinity}const a=(i||getNow())-o;return n-a};this.#J=s=>{const r=e[s];const n=t[s];return!!n&&!!r&&(i||getNow())-r>n}}#Q=()=>{};#tt=()=>{};#X=()=>{};#J=()=>false;#K(){const t=new ZeroArray(this.#g);this.#x=0;this.#U=t;this.#et=e=>{this.#x-=t[e];t[e]=0};this.#st=(t,e,s,i)=>{if(this.#W(e)){return 0}if(!isPosInt(s)){if(i){if(typeof i!=="function"){throw new TypeError("sizeCalculation must be a function")}s=i(e,t);if(!isPosInt(s)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return s};this.#it=(e,s,i)=>{t[e]=s;if(this.#y){const s=this.#y-t[e];while(this.#x>s){this.#rt(true)}}this.#x+=t[e];if(i){i.entrySize=s;i.totalCalculatedSize=this.#x}}}#et=t=>{};#it=(t,e,s)=>{};#st=(t,e,s,i)=>{if(s||i){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#H({allowStale:t=this.allowStale}={}){if(this.#k){for(let e=this.#L;true;){if(!this.#nt(e)){break}if(t||!this.#J(e)){yield e}if(e===this.#I){break}else{e=this.#A[e]}}}}*#V({allowStale:t=this.allowStale}={}){if(this.#k){for(let e=this.#I;true;){if(!this.#nt(e)){break}if(t||!this.#J(e)){yield e}if(e===this.#L){break}else{e=this.#P[e]}}}}#nt(t){return t!==undefined&&this.#E.get(this.#C[t])===t}*entries(){for(const t of this.#H()){if(this.#R[t]!==undefined&&this.#C[t]!==undefined&&!this.#W(this.#R[t])){yield[this.#C[t],this.#R[t]]}}}*rentries(){for(const t of this.#V()){if(this.#R[t]!==undefined&&this.#C[t]!==undefined&&!this.#W(this.#R[t])){yield[this.#C[t],this.#R[t]]}}}*keys(){for(const t of this.#H()){const e=this.#C[t];if(e!==undefined&&!this.#W(this.#R[t])){yield e}}}*rkeys(){for(const t of this.#V()){const e=this.#C[t];if(e!==undefined&&!this.#W(this.#R[t])){yield e}}}*values(){for(const t of this.#H()){const e=this.#R[t];if(e!==undefined&&!this.#W(this.#R[t])){yield this.#R[t]}}}*rvalues(){for(const t of this.#V()){const e=this.#R[t];if(e!==undefined&&!this.#W(this.#R[t])){yield this.#R[t]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const s of this.#H()){const i=this.#R[s];const r=this.#W(i)?i.__staleWhileFetching:i;if(r===undefined)continue;if(t(r,this.#C[s],this)){return this.get(this.#C[s],e)}}}forEach(t,e=this){for(const s of this.#H()){const i=this.#R[s];const r=this.#W(i)?i.__staleWhileFetching:i;if(r===undefined)continue;t.call(e,r,this.#C[s],this)}}rforEach(t,e=this){for(const s of this.#V()){const i=this.#R[s];const r=this.#W(i)?i.__staleWhileFetching:i;if(r===undefined)continue;t.call(e,r,this.#C[s],this)}}purgeStale(){let t=false;for(const e of this.#V({allowStale:true})){if(this.#J(e)){this.#Z(this.#C[e],"expire");t=true}}return t}info(t){const e=this.#E.get(t);if(e===undefined)return undefined;const s=this.#R[e];const i=this.#W(s)?s.__staleWhileFetching:s;if(i===undefined)return undefined;const r={value:i};if(this.#F&&this.#B){const t=this.#F[e];const s=this.#B[e];if(t&&s){const e=t-(this.#_.now()-s);r.ttl=e;r.start=Date.now()}}if(this.#U){r.size=this.#U[e]}return r}dump(){const t=[];for(const e of this.#H({allowStale:true})){const s=this.#C[e];const i=this.#R[e];const r=this.#W(i)?i.__staleWhileFetching:i;if(r===undefined||s===undefined)continue;const n={value:r};if(this.#F&&this.#B){n.ttl=this.#F[e];const t=this.#_.now()-this.#B[e];n.start=Math.floor(Date.now()-t)}if(this.#U){n.size=this.#U[e]}t.unshift([s,n])}return t}load(t){this.clear();for(const[e,s]of t){if(s.start){const t=Date.now()-s.start;s.start=this.#_.now()-t}this.set(e,s.value,s)}}set(t,e,s={}){if(e===undefined){this.delete(t);return this}const{ttl:i=this.ttl,start:r,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=s;let{noUpdateTTL:h=this.noUpdateTTL}=s;const l=this.#st(t,e,s.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.#Z(t,"set");return this}let c=this.#k===0?undefined:this.#E.get(t);if(c===undefined){c=this.#k===0?this.#L:this.#O.length!==0?this.#O.pop():this.#k===this.#g?this.#rt(false):this.#k;this.#C[c]=t;this.#R[c]=e;this.#E.set(t,c);this.#P[this.#L]=c;this.#A[c]=this.#L;this.#L=c;this.#k++;this.#it(c,l,a);if(a)a.set="add";h=false;if(this.#G){this.#w?.(e,t,"add")}}else{this.#q(c);const s=this.#R[c];if(e!==s){if(this.#z&&this.#W(s)){s.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=s;if(e!==undefined&&!n){if(this.#j){this.#b?.(e,t,"set")}if(this.#D){this.#M?.push([e,t,"set"])}}}else if(!n){if(this.#j){this.#b?.(s,t,"set")}if(this.#D){this.#M?.push([s,t,"set"])}}this.#et(c);this.#it(c,l,a);this.#R[c]=e;if(a){a.set="replace";const t=s&&this.#W(s)?s.__staleWhileFetching:s;if(t!==undefined)a.oldValue=t}}else if(a){a.set="update"}if(this.#G){this.onInsert?.(e,t,e===s?"update":"replace")}}if(i!==0&&!this.#F){this.#Y()}if(this.#F){if(!h){this.#X(c,i,r)}if(a)this.#tt(a,c)}if(!n&&this.#D&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#S?.(...e)}}return this}pop(){try{while(this.#k){const t=this.#R[this.#I];this.#rt(true);if(this.#W(t)){if(t.__staleWhileFetching){return t.__staleWhileFetching}}else if(t!==undefined){return t}}}finally{if(this.#D&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#S?.(...e)}}}}#rt(t){const e=this.#I;const s=this.#C[e];const i=this.#R[e];if(this.#z&&this.#W(i)){i.__abortController.abort(new Error("evicted"))}else if(this.#j||this.#D){if(this.#j){this.#b?.(i,s,"evict")}if(this.#D){this.#M?.push([i,s,"evict"])}}this.#et(e);if(this.#N?.[e]){clearTimeout(this.#N[e]);this.#N[e]=undefined}if(t){this.#C[e]=undefined;this.#R[e]=undefined;this.#O.push(e)}if(this.#k===1){this.#I=this.#L=0;this.#O.length=0}else{this.#I=this.#P[e]}this.#E.delete(s);this.#k--;return e}has(t,e={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e;const r=this.#E.get(t);if(r!==undefined){const t=this.#R[r];if(this.#W(t)&&t.__staleWhileFetching===undefined){return false}if(!this.#J(r)){if(s){this.#Q(r)}if(i){i.has="hit";this.#tt(i,r)}return true}else if(i){i.has="stale";this.#tt(i,r)}}else if(i){i.has="miss"}return false}peek(t,e={}){const{allowStale:s=this.allowStale}=e;const i=this.#E.get(t);if(i===undefined||!s&&this.#J(i)){return}const r=this.#R[i];return this.#W(r)?r.__staleWhileFetching:r}#$(t,e,s,i){const r=e===undefined?undefined:this.#R[e];if(this.#W(r)){return r}const o=new n;const{signal:a}=s;a?.addEventListener("abort",(()=>o.abort(a.reason)),{signal:o.signal});const h={signal:o.signal,options:s,context:i};const cb=(i,r=false)=>{const{aborted:n}=o.signal;const a=s.ignoreFetchAbort&&i!==undefined;if(s.status){if(n&&!r){s.status.fetchAborted=true;s.status.fetchError=o.signal.reason;if(a)s.status.fetchAbortIgnored=true}else{s.status.fetchResolved=true}}if(n&&!a&&!r){return fetchFail(o.signal.reason)}const c=l;const u=this.#R[e];if(u===l||a&&r&&u===undefined){if(i===undefined){if(c.__staleWhileFetching!==undefined){this.#R[e]=c.__staleWhileFetching}else{this.#Z(t,"fetch")}}else{if(s.status)s.status.fetchUpdated=true;this.set(t,i,h.options)}}return i};const eb=t=>{if(s.status){s.status.fetchRejected=true;s.status.fetchError=t}return fetchFail(t)};const fetchFail=i=>{const{aborted:r}=o.signal;const n=r&&s.allowStaleOnFetchAbort;const a=n||s.allowStaleOnFetchRejection;const h=a||s.noDeleteOnFetchRejection;const c=l;if(this.#R[e]===l){const s=!h||c.__staleWhileFetching===undefined;if(s){this.#Z(t,"fetch")}else if(!n){this.#R[e]=c.__staleWhileFetching}}if(a){if(s.status&&c.__staleWhileFetching!==undefined){s.status.returnedStale=true}return c.__staleWhileFetching}else if(c.__returned===c){throw i}};const pcall=(e,i)=>{const n=this.#v?.(t,r,h);if(n&&n instanceof Promise){n.then((t=>e(t===undefined?undefined:t)),i)}o.signal.addEventListener("abort",(()=>{if(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort){e(undefined);if(s.allowStaleOnFetchAbort){e=t=>cb(t,true)}}}))};if(s.status)s.status.fetchDispatched=true;const l=new Promise(pcall).then(cb,eb);const c=Object.assign(l,{__abortController:o,__staleWhileFetching:r,__returned:undefined});if(e===undefined){this.set(t,c,{...h.options,status:undefined});e=this.#E.get(t)}else{this.#R[e]=c}return c}#W(t){if(!this.#z)return false;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof n}async fetch(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,ttl:n=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=false,status:y,signal:b}=e;if(!this.#z){if(y)y.fetch="get";return this.get(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,status:y})}const w={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:r,ttl:n,noDisposeOnSet:o,size:a,sizeCalculation:h,noUpdateTTL:l,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:d,ignoreFetchAbort:f,status:y,signal:b};let S=this.#E.get(t);if(S===undefined){if(y)y.fetch="miss";const e=this.#$(t,S,w,p);return e.__returned=e}else{const e=this.#R[S];if(this.#W(e)){const t=s&&e.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(t)y.returnedStale=true}return t?e.__staleWhileFetching:e.__returned=e}const r=this.#J(S);if(!g&&!r){if(y)y.fetch="hit";this.#q(S);if(i){this.#Q(S)}if(y)this.#tt(y,S);return e}const n=this.#$(t,S,w,p);const o=n.__staleWhileFetching!==undefined;const a=o&&s;if(y){y.fetch=r?"stale":"refresh";if(a&&r)y.returnedStale=true}return a?n.__staleWhileFetching:n.__returned=n}}async forceFetch(t,e={}){const s=await this.fetch(t,e);if(s===undefined)throw new Error("fetch() returned undefined");return s}memo(t,e={}){const s=this.#T;if(!s){throw new Error("no memoMethod provided to constructor")}const{context:i,forceRefresh:r,...n}=e;const o=this.get(t,n);if(!r&&o!==undefined)return o;const a=s(t,o,{options:n,context:i});this.set(t,a,n);return a}get(t,e={}){const{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:r=this.noDeleteOnStaleGet,status:n}=e;const o=this.#E.get(t);if(o!==undefined){const e=this.#R[o];const a=this.#W(e);if(n)this.#tt(n,o);if(this.#J(o)){if(n)n.get="stale";if(!a){if(!r){this.#Z(t,"expire")}if(n&&s)n.returnedStale=true;return s?e:undefined}else{if(n&&s&&e.__staleWhileFetching!==undefined){n.returnedStale=true}return s?e.__staleWhileFetching:undefined}}else{if(n)n.get="hit";if(a){return e.__staleWhileFetching}this.#q(o);if(i){this.#Q(o)}return e}}else if(n){n.get="miss"}}#ot(t,e){this.#A[e]=t;this.#P[t]=e}#q(t){if(t!==this.#L){if(t===this.#I){this.#I=this.#P[t]}else{this.#ot(this.#A[t],this.#P[t])}this.#ot(this.#L,t);this.#L=t}}delete(t){return this.#Z(t,"delete")}#Z(t,e){let s=false;if(this.#k!==0){const i=this.#E.get(t);if(i!==undefined){if(this.#N?.[i]){clearTimeout(this.#N?.[i]);this.#N[i]=undefined}s=true;if(this.#k===1){this.#at(e)}else{this.#et(i);const s=this.#R[i];if(this.#W(s)){s.__abortController.abort(new Error("deleted"))}else if(this.#j||this.#D){if(this.#j){this.#b?.(s,t,e)}if(this.#D){this.#M?.push([s,t,e])}}this.#E.delete(t);this.#C[i]=undefined;this.#R[i]=undefined;if(i===this.#L){this.#L=this.#A[i]}else if(i===this.#I){this.#I=this.#P[i]}else{const t=this.#A[i];this.#P[t]=this.#P[i];const e=this.#P[i];this.#A[e]=this.#A[i]}this.#k--;this.#O.push(i)}}}if(this.#D&&this.#M?.length){const t=this.#M;let e;while(e=t?.shift()){this.#S?.(...e)}}return s}clear(){return this.#at("delete")}#at(t){for(const e of this.#V({allowStale:true})){const s=this.#R[e];if(this.#W(s)){s.__abortController.abort(new Error("deleted"))}else{const i=this.#C[e];if(this.#j){this.#b?.(s,i,t)}if(this.#D){this.#M?.push([s,i,t])}}}this.#E.clear();this.#R.fill(undefined);this.#C.fill(undefined);if(this.#F&&this.#B){this.#F.fill(0);this.#B.fill(0);for(const t of this.#N??[]){if(t!==undefined)clearTimeout(t)}this.#N?.fill(undefined)}if(this.#U){this.#U.fill(0)}this.#I=0;this.#L=0;this.#O.length=0;this.#x=0;this.#k=0;if(this.#D&&this.#M){const t=this.#M;let e;while(e=t?.shift()){this.#S?.(...e)}}}}e.LRUCache=LRUCache},557:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.assertValidPattern=void 0;const s=1024*64;const assertValidPattern=t=>{if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>s){throw new TypeError("pattern is too long")}};e.assertValidPattern=assertValidPattern},8743:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.AST=void 0;const i=s(6694);const r=s(7967);const n=new Set(["!","?","+","*","@"]);const isExtglobType=t=>n.has(t);const o="(?!(?:^|/)\\.\\.?(?:$|/))";const a="(?!\\.)";const h=new Set(["[","."]);const l=new Set(["..","."]);const c=new Set("().*{}+?[]^$\\!");const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const u="[^/]";const f=u+"*?";const d=u+"+?";class AST{type;#ht;#lt;#ct=false;#ut=[];#ft;#dt;#pt;#mt=false;#gt;#yt;#bt=false;constructor(t,e,s={}){this.type=t;if(t)this.#lt=true;this.#ft=e;this.#ht=this.#ft?this.#ft.#ht:this;this.#gt=this.#ht===this?s:this.#ht.#gt;this.#pt=this.#ht===this?[]:this.#ht.#pt;if(t==="!"&&!this.#ht.#mt)this.#pt.push(this);this.#dt=this.#ft?this.#ft.#ut.length:0}get hasMagic(){if(this.#lt!==undefined)return this.#lt;for(const t of this.#ut){if(typeof t==="string")continue;if(t.type||t.hasMagic)return this.#lt=true}return this.#lt}toString(){if(this.#yt!==undefined)return this.#yt;if(!this.type){return this.#yt=this.#ut.map((t=>String(t))).join("")}else{return this.#yt=this.type+"("+this.#ut.map((t=>String(t))).join("|")+")"}}#wt(){if(this!==this.#ht)throw new Error("should only call on root");if(this.#mt)return this;this.toString();this.#mt=true;let t;while(t=this.#pt.pop()){if(t.type!=="!")continue;let e=t;let s=e.#ft;while(s){for(let i=e.#dt+1;!s.type&&i<s.#ut.length;i++){for(const e of t.#ut){if(typeof e==="string"){throw new Error("string part in extglob AST??")}e.copyIn(s.#ut[i])}}e=s;s=e.#ft}}return this}push(...t){for(const e of t){if(e==="")continue;if(typeof e!=="string"&&!(e instanceof AST&&e.#ft===this)){throw new Error("invalid part: "+e)}this.#ut.push(e)}}toJSON(){const t=this.type===null?this.#ut.slice().map((t=>typeof t==="string"?t:t.toJSON())):[this.type,...this.#ut.map((t=>t.toJSON()))];if(this.isStart()&&!this.type)t.unshift([]);if(this.isEnd()&&(this===this.#ht||this.#ht.#mt&&this.#ft?.type==="!")){t.push({})}return t}isStart(){if(this.#ht===this)return true;if(!this.#ft?.isStart())return false;if(this.#dt===0)return true;const t=this.#ft;for(let e=0;e<this.#dt;e++){const s=t.#ut[e];if(!(s instanceof AST&&s.type==="!")){return false}}return true}isEnd(){if(this.#ht===this)return true;if(this.#ft?.type==="!")return true;if(!this.#ft?.isEnd())return false;if(!this.type)return this.#ft?.isEnd();const t=this.#ft?this.#ft.#ut.length:0;return this.#dt===t-1}copyIn(t){if(typeof t==="string")this.push(t);else this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#ut){e.copyIn(t)}return e}static#St(t,e,s,i){let r=false;let n=false;let o=-1;let a=false;if(e.type===null){let h=s;let l="";while(h<t.length){const s=t.charAt(h++);if(r||s==="\\"){r=!r;l+=s;continue}if(n){if(h===o+1){if(s==="^"||s==="!"){a=true}}else if(s==="]"&&!(h===o+2&&a)){n=false}l+=s;continue}else if(s==="["){n=true;o=h;a=false;l+=s;continue}if(!i.noext&&isExtglobType(s)&&t.charAt(h)==="("){e.push(l);l="";const r=new AST(s,e);h=AST.#St(t,r,h,i);e.push(r);continue}l+=s}e.push(l);return h}let h=s+1;let l=new AST(null,e);const c=[];let u="";while(h<t.length){const s=t.charAt(h++);if(r||s==="\\"){r=!r;u+=s;continue}if(n){if(h===o+1){if(s==="^"||s==="!"){a=true}}else if(s==="]"&&!(h===o+2&&a)){n=false}u+=s;continue}else if(s==="["){n=true;o=h;a=false;u+=s;continue}if(isExtglobType(s)&&t.charAt(h)==="("){l.push(u);u="";const e=new AST(s,l);l.push(e);h=AST.#St(t,e,h,i);continue}if(s==="|"){l.push(u);u="";c.push(l);l=new AST(null,e);continue}if(s===")"){if(u===""&&e.#ut.length===0){e.#bt=true}l.push(u);u="";e.push(...c,l);return h}u+=s}e.type=null;e.#lt=undefined;e.#ut=[t.substring(s-1)];return h}static fromGlob(t,e={}){const s=new AST(null,undefined,e);AST.#St(t,s,0,e);return s}toMMPattern(){if(this!==this.#ht)return this.#ht.toMMPattern();const t=this.toString();const[e,s,i,r]=this.toRegExpSource();const n=i||this.#lt||this.#gt.nocase&&!this.#gt.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase();if(!n){return s}const o=(this.#gt.nocase?"i":"")+(r?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#gt}toRegExpSource(t){const e=t??!!this.#gt.dot;if(this.#ht===this)this.#wt();if(!this.type){const s=this.isStart()&&this.isEnd()&&!this.#ut.some((t=>typeof t!=="string"));const i=this.#ut.map((e=>{const[i,r,n,o]=typeof e==="string"?AST.#vt(e,this.#lt,s):e.toRegExpSource(t);this.#lt=this.#lt||n;this.#ct=this.#ct||o;return i})).join("");let n="";if(this.isStart()){if(typeof this.#ut[0]==="string"){const s=this.#ut.length===1&&l.has(this.#ut[0]);if(!s){const s=h;const r=e&&s.has(i.charAt(0))||i.startsWith("\\.")&&s.has(i.charAt(2))||i.startsWith("\\.\\.")&&s.has(i.charAt(4));const l=!e&&!t&&s.has(i.charAt(0));n=r?o:l?a:""}}}let c="";if(this.isEnd()&&this.#ht.#mt&&this.#ft?.type==="!"){c="(?:$|\\/)"}const u=n+i+c;return[u,(0,r.unescape)(i),this.#lt=!!this.#lt,this.#ct]}const s=this.type==="*"||this.type==="+";const i=this.type==="!"?"(?:(?!(?:":"(?:";let n=this.#Tt(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const t=this.toString();this.#ut=[t];this.type=null;this.#lt=undefined;return[t,(0,r.unescape)(this.toString()),false,false]}let c=!s||t||e||!a?"":this.#Tt(true);if(c===n){c=""}if(c){n=`(?:${n})(?:${c})*?`}let u="";if(this.type==="!"&&this.#bt){u=(this.isStart()&&!e?a:"")+d}else{const s=this.type==="!"?"))"+(this.isStart()&&!e&&!t?a:"")+f+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&c?")":this.type==="*"&&c?`)?`:`)${this.type}`;u=i+n+s}return[u,(0,r.unescape)(n),this.#lt=!!this.#lt,this.#ct]}#Tt(t){return this.#ut.map((e=>{if(typeof e==="string"){throw new Error("string type in extglob ast??")}const[s,i,r,n]=e.toRegExpSource(t);this.#ct=this.#ct||n;return s})).filter((t=>!(this.isStart()&&this.isEnd())||!!t)).join("|")}static#vt(t,e,s=false){let n=false;let o="";let a=false;for(let r=0;r<t.length;r++){const h=t.charAt(r);if(n){n=false;o+=(c.has(h)?"\\":"")+h;continue}if(h==="\\"){if(r===t.length-1){o+="\\\\"}else{n=true}continue}if(h==="["){const[s,n,h,l]=(0,i.parseClass)(t,r);if(h){o+=s;a=a||n;r+=h-1;e=e||l;continue}}if(h==="*"){o+=s&&t==="*"?d:f;e=true;continue}if(h==="?"){o+=u;e=true;continue}o+=regExpEscape(h)}return[o,(0,r.unescape)(t),!!e,a]}}e.AST=AST},6694:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.parseClass=void 0;const s={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=t=>t.join("");const parseClass=(t,e)=>{const i=e;if(t.charAt(i)!=="["){throw new Error("not in a brace expression")}const r=[];const n=[];let o=i+1;let a=false;let h=false;let l=false;let c=false;let u=i;let f="";t:while(o<t.length){const e=t.charAt(o);if((e==="!"||e==="^")&&o===i+1){c=true;o++;continue}if(e==="]"&&a&&!l){u=o+1;break}a=true;if(e==="\\"){if(!l){l=true;o++;continue}}if(e==="["&&!l){for(const[e,[a,l,c]]of Object.entries(s)){if(t.startsWith(e,o)){if(f){return["$.",false,t.length-i,true]}o+=e.length;if(c)n.push(a);else r.push(a);h=h||l;continue t}}}l=false;if(f){if(e>f){r.push(braceEscape(f)+"-"+braceEscape(e))}else if(e===f){r.push(braceEscape(e))}f="";o++;continue}if(t.startsWith("-]",o+1)){r.push(braceEscape(e+"-"));o+=2;continue}if(t.startsWith("-",o+1)){f=e;o+=2;continue}r.push(braceEscape(e));o++}if(u<o){return["",false,0,false]}if(!r.length&&!n.length){return["$.",false,t.length-i,true]}if(n.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){const t=r[0].length===2?r[0].slice(-1):r[0];return[regexpEscape(t),false,u-i,false]}const d="["+(c?"^":"")+rangesToString(r)+"]";const p="["+(c?"":"^")+rangesToString(n)+"]";const g=r.length&&n.length?"("+d+"|"+p+")":r.length?d:p;return[g,h,u-i,true]};e.parseClass=parseClass},7516:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.escape=void 0;const escape=(t,{windowsPathsNoEscape:e=false,magicalBraces:s=false}={})=>{if(s){return e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&")}return e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")};e.escape=escape},6647:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;const i=s(2339);const r=s(557);const n=s(8743);const o=s(7516);const a=s(7967);const minimatch=(t,e,s={})=>{(0,r.assertValidPattern)(e);if(!s.nocomment&&e.charAt(0)==="#"){return false}return new Minimatch(e,s).match(t)};e.minimatch=minimatch;const h=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t);const starDotExtTestDot=t=>e=>e.endsWith(t);const starDotExtTestNocase=t=>{t=t.toLowerCase();return e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)};const starDotExtTestNocaseDot=t=>{t=t.toLowerCase();return e=>e.toLowerCase().endsWith(t)};const l=/^\*+\.\*+$/;const starDotStarTest=t=>!t.startsWith(".")&&t.includes(".");const starDotStarTestDot=t=>t!=="."&&t!==".."&&t.includes(".");const c=/^\.\*+$/;const dotStarTest=t=>t!=="."&&t!==".."&&t.startsWith(".");const u=/^\*+$/;const starTest=t=>t.length!==0&&!t.startsWith(".");const starTestDot=t=>t.length!==0&&t!=="."&&t!=="..";const f=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([t,e=""])=>{const s=qmarksTestNoExt([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestNocaseDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTest=([t,e=""])=>{const s=qmarksTestNoExt([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")};const qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&t!=="."&&t!==".."};const d=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const p={win32:{sep:"\\"},posix:{sep:"/"}};e.sep=d==="win32"?p.win32.sep:p.posix.sep;e.minimatch.sep=e.sep;e.GLOBSTAR=Symbol("globstar **");e.minimatch.GLOBSTAR=e.GLOBSTAR;const g="[^/]";const y=g+"*?";const b="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const w="(?:(?!(?:\\/|^)\\.).)*?";const filter=(t,s={})=>i=>(0,e.minimatch)(i,t,s);e.filter=filter;e.minimatch.filter=e.filter;const ext=(t,e={})=>Object.assign({},t,e);const defaults=t=>{if(!t||typeof t!=="object"||!Object.keys(t).length){return e.minimatch}const s=e.minimatch;const m=(e,i,r={})=>s(e,i,ext(t,r));return Object.assign(m,{Minimatch:class Minimatch extends s.Minimatch{constructor(e,s={}){super(e,ext(t,s))}static defaults(e){return s.defaults(ext(t,e)).Minimatch}},AST:class AST extends s.AST{constructor(e,s,i={}){super(e,s,ext(t,i))}static fromGlob(e,i={}){return s.AST.fromGlob(e,ext(t,i))}},unescape:(e,i={})=>s.unescape(e,ext(t,i)),escape:(e,i={})=>s.escape(e,ext(t,i)),filter:(e,i={})=>s.filter(e,ext(t,i)),defaults:e=>s.defaults(ext(t,e)),makeRe:(e,i={})=>s.makeRe(e,ext(t,i)),braceExpand:(e,i={})=>s.braceExpand(e,ext(t,i)),match:(e,i,r={})=>s.match(e,i,ext(t,r)),sep:s.sep,GLOBSTAR:e.GLOBSTAR})};e.defaults=defaults;e.minimatch.defaults=e.defaults;const braceExpand=(t,e={})=>{(0,r.assertValidPattern)(t);if(e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return(0,i.expand)(t)};e.braceExpand=braceExpand;e.minimatch.braceExpand=e.braceExpand;const makeRe=(t,e={})=>new Minimatch(t,e).makeRe();e.makeRe=makeRe;e.minimatch.makeRe=e.makeRe;const match=(t,e,s={})=>{const i=new Minimatch(e,s);t=t.filter((t=>i.match(t)));if(i.options.nonull&&!t.length){t.push(e)}return t};e.match=match;e.minimatch.match=e.match;const S=/[?*]|[+@!]\(.*?\)|\[|\]/;const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){(0,r.assertValidPattern)(t);e=e||{};this.options=e;this.pattern=t;this.platform=e.platform||d;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!e.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!e.nonegate;this.comment=false;this.empty=false;this.partial=!!e.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=e.windowsNoMagicRoot!==undefined?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const t of this.set){for(const e of t){if(typeof e!=="string")return true}}return false}debug(...t){}make(){const t=this.pattern;const e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(e.debug){this.debug=(...t)=>console.error(...t)}this.debug(this.pattern,this.globSet);const s=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(s);this.debug(this.pattern,this.globParts);let i=this.globParts.map(((t,e,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=t[0]===""&&t[1]===""&&(t[2]==="?"||!S.test(t[2]))&&!S.test(t[3]);const s=/^[a-z]:/i.test(t[0]);if(e){return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))]}else if(s){return[t[0],...t.slice(1).map((t=>this.parse(t)))]}}return t.map((t=>this.parse(t)))}));this.debug(this.pattern,i);this.set=i.filter((t=>t.indexOf(false)===-1));if(this.isWindows){for(let t=0;t<this.set.length;t++){const e=this.set[t];if(e[0]===""&&e[1]===""&&this.globParts[t][2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3])){e[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar){for(let e=0;e<t.length;e++){for(let s=0;s<t[e].length;s++){if(t[e][s]==="**"){t[e][s]="*"}}}}const{optimizationLevel:e=1}=this.options;if(e>=2){t=this.firstPhasePreProcess(t);t=this.secondPhasePreProcess(t)}else if(e>=1){t=this.levelOneOptimize(t)}else{t=this.adjascentGlobstarOptimize(t)}return t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;while(-1!==(e=t.indexOf("**",e+1))){let s=e;while(t[s+1]==="**"){s++}if(s!==e){t.splice(e,s-e)}}return t}))}levelOneOptimize(t){return t.map((t=>{t=t.reduce(((t,e)=>{const s=t[t.length-1];if(e==="**"&&s==="**"){return t}if(e===".."){if(s&&s!==".."&&s!=="."&&s!=="**"){t.pop();return t}}t.push(e);return t}),[]);return t.length===0?[""]:t}))}levelTwoFileOptimize(t){if(!Array.isArray(t)){t=this.slashSplit(t)}let e=false;do{e=false;if(!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];if(s===1&&i===""&&t[0]==="")continue;if(i==="."||i===""){e=true;t.splice(s,1);s--}}if(t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")){e=true;t.pop()}}let s=0;while(-1!==(s=t.indexOf("..",s+1))){const i=t[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){e=true;t.splice(s-1,2);s-=2}}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let s of t){let i=-1;while(-1!==(i=s.indexOf("**",i+1))){let r=i;while(s[r+1]==="**"){r++}if(r>i){s.splice(i+1,r-i)}let n=s[i+1];const o=s[i+2];const a=s[i+3];if(n!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}e=true;s.splice(i,1);const h=s.slice(0);h[i]="**";t.push(h);i--}if(!this.preserveMultipleSlashes){for(let t=1;t<s.length-1;t++){const i=s[t];if(t===1&&i===""&&s[0]==="")continue;if(i==="."||i===""){e=true;s.splice(t,1);t--}}if(s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")){e=true;s.pop()}}let r=0;while(-1!==(r=s.indexOf("..",r+1))){const t=s[r-1];if(t&&t!=="."&&t!==".."&&t!=="**"){e=true;const t=r===1&&s[r+1]==="**";const i=t?["."]:[];s.splice(r-1,2,...i);if(s.length===0)s.push("");r-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++){for(let s=e+1;s<t.length;s++){const i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[];t[s]=i;break}}}return t.filter((t=>t.length))}partsMatch(t,e,s=false){let i=0;let r=0;let n=[];let o="";while(i<t.length&&r<e.length){if(t[i]===e[r]){n.push(o==="b"?e[r]:t[i]);i++;r++}else if(s&&t[i]==="**"&&e[r]===t[i+1]){n.push(t[i]);i++}else if(s&&e[r]==="**"&&t[i]===e[r+1]){n.push(e[r]);r++}else if(t[i]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(o==="b")return false;o="a";n.push(t[i]);i++;r++}else if(e[r]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(o==="a")return false;o="b";n.push(e[r]);i++;r++}else{return false}}return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=false;let s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++){e=!e;s++}if(s)this.pattern=t.slice(s);this.negate=e}matchOne(t,s,i=false){const r=this.options;if(this.isWindows){const e=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const i=!e&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]);const r=typeof s[0]==="string"&&/^[a-z]:$/i.test(s[0]);const n=!r&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]==="string"&&/^[a-z]:$/i.test(s[3]);const o=i?3:e?0:undefined;const a=n?3:r?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[e,i]=[t[o],s[a]];if(e.toLowerCase()===i.toLowerCase()){s[a]=e;if(a>o){s=s.slice(a)}else if(o>a){t=t.slice(o)}}}}const{optimizationLevel:n=1}=this.options;if(n>=2){t=this.levelTwoFileOptimize(t)}this.debug("matchOne",this,{file:t,pattern:s});this.debug("matchOne",t.length,s.length);for(var o=0,a=0,h=t.length,l=s.length;o<h&&a<l;o++,a++){this.debug("matchOne loop");var c=s[a];var u=t[o];this.debug(s,c,u);if(c===false){return false}if(c===e.GLOBSTAR){this.debug("GLOBSTAR",[s,c,u]);var f=o;var d=a+1;if(d===l){this.debug("** at the end");for(;o<h;o++){if(t[o]==="."||t[o]===".."||!r.dot&&t[o].charAt(0)===".")return false}return true}while(f<h){var p=t[f];this.debug("\nglobstar while",t,f,s,d,p);if(this.matchOne(t.slice(f),s.slice(d),i)){this.debug("globstar found match!",f,h,p);return true}else{if(p==="."||p===".."||!r.dot&&p.charAt(0)==="."){this.debug("dot detected!",t,f,s,d);break}this.debug("globstar swallow a segment, and continue");f++}}if(i){this.debug("\n>>> no match, partial?",t,f,s,d);if(f===h){return true}}return false}let n;if(typeof c==="string"){n=u===c;this.debug("string match",c,u,n)}else{n=c.test(u);this.debug("pattern match",c,u,n)}if(!n)return false}if(o===h&&a===l){return true}else if(o===h){return i}else if(a===l){return o===h-1&&t[o]===""}else{throw new Error("wtf?")}}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,r.assertValidPattern)(t);const s=this.options;if(t==="**")return e.GLOBSTAR;if(t==="")return"";let i;let o=null;if(i=t.match(u)){o=s.dot?starTestDot:starTest}else if(i=t.match(h)){o=(s.nocase?s.dot?starDotExtTestNocaseDot:starDotExtTestNocase:s.dot?starDotExtTestDot:starDotExtTest)(i[1])}else if(i=t.match(f)){o=(s.nocase?s.dot?qmarksTestNocaseDot:qmarksTestNocase:s.dot?qmarksTestDot:qmarksTest)(i)}else if(i=t.match(l)){o=s.dot?starDotStarTestDot:starDotStarTest}else if(i=t.match(c)){o=dotStarTest}const a=n.AST.fromGlob(t,this.options).toMMPattern();if(o&&typeof a==="object"){Reflect.defineProperty(a,"test",{value:o})}return a}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const t=this.set;if(!t.length){this.regexp=false;return this.regexp}const s=this.options;const i=s.noglobstar?y:s.dot?b:w;const r=new Set(s.nocase?["i"]:[]);let n=t.map((t=>{const s=t.map((t=>{if(t instanceof RegExp){for(const e of t.flags.split(""))r.add(e)}return typeof t==="string"?regExpEscape(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src}));s.forEach(((t,r)=>{const n=s[r+1];const o=s[r-1];if(t!==e.GLOBSTAR||o===e.GLOBSTAR){return}if(o===undefined){if(n!==undefined&&n!==e.GLOBSTAR){s[r+1]="(?:\\/|"+i+"\\/)?"+n}else{s[r]=i}}else if(n===undefined){s[r-1]=o+"(?:\\/|\\/"+i+")?"}else if(n!==e.GLOBSTAR){s[r-1]=o+"(?:\\/|\\/"+i+"\\/)"+n;s[r+1]=e.GLOBSTAR}}));const n=s.filter((t=>t!==e.GLOBSTAR));if(this.partial&&n.length>=1){const t=[];for(let e=1;e<=n.length;e++){t.push(n.slice(0,e).join("/"))}return"(?:"+t.join("|")+")"}return n.join("/")})).join("|");const[o,a]=t.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$";if(this.partial){n="^(?:\\/|"+o+n.slice(1,-1)+a+")$"}if(this.negate)n="^(?!"+n+").+$";try{this.regexp=new RegExp(n,[...r].join(""))}catch(t){this.regexp=false}return this.regexp}slashSplit(t){if(this.preserveMultipleSlashes){return t.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(t)){return["",...t.split(/\/+/)]}else{return t.split(/\/+/)}}match(t,e=this.partial){this.debug("match",t,this.pattern);if(this.comment){return false}if(this.empty){return t===""}if(t==="/"&&e){return true}const s=this.options;if(this.isWindows){t=t.split("\\").join("/")}const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const r=this.set;this.debug(this.pattern,"set",r);let n=i[i.length-1];if(!n){for(let t=i.length-2;!n&&t>=0;t--){n=i[t]}}for(let t=0;t<r.length;t++){const o=r[t];let a=i;if(s.matchBase&&o.length===1){a=[n]}const h=this.matchOne(a,o,e);if(h){if(s.flipNegate){return true}return!this.negate}}if(s.flipNegate){return false}return this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}}e.Minimatch=Minimatch;var v=s(8743);Object.defineProperty(e,"AST",{enumerable:true,get:function(){return v.AST}});var T=s(7516);Object.defineProperty(e,"escape",{enumerable:true,get:function(){return T.escape}});var _=s(7967);Object.defineProperty(e,"unescape",{enumerable:true,get:function(){return _.unescape}});e.minimatch.AST=n.AST;e.minimatch.Minimatch=Minimatch;e.minimatch.escape=o.escape;e.minimatch.unescape=a.unescape},7967:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.unescape=void 0;const unescape=(t,{windowsPathsNoEscape:e=false,magicalBraces:s=true}={})=>{if(s){return e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")}return e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1")};e.unescape=unescape},1031:function(t,e,s){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;const r=typeof process==="object"&&process?process:{stdout:null,stderr:null};const n=s(8474);const o=i(s(7075));const a=s(6193);const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof o.default||(0,e.isReadable)(t)||(0,e.isWritable)(t));e.isStream=isStream;const isReadable=t=>!!t&&typeof t==="object"&&t instanceof n.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==o.default.Writable.prototype.pipe;e.isReadable=isReadable;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof n.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";e.isWritable=isWritable;const h=Symbol("EOF");const l=Symbol("maybeEmitEnd");const c=Symbol("emittedEnd");const u=Symbol("emittingEnd");const f=Symbol("emittedError");const d=Symbol("closed");const p=Symbol("read");const g=Symbol("flush");const y=Symbol("flushChunk");const b=Symbol("encoding");const w=Symbol("decoder");const S=Symbol("flowing");const v=Symbol("paused");const T=Symbol("resume");const _=Symbol("buffer");const k=Symbol("pipes");const x=Symbol("bufferLength");const E=Symbol("bufferPush");const C=Symbol("bufferShift");const R=Symbol("objectMode");const P=Symbol("destroyed");const A=Symbol("error");const I=Symbol("emitData");const L=Symbol("emitEnd");const O=Symbol("emitEnd2");const M=Symbol("async");const U=Symbol("abort");const B=Symbol("aborted");const F=Symbol("signal");const N=Symbol("dataListeners");const j=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,e,s){this.src=t;this.dest=e;this.opts=s;this.ondrain=()=>t[T]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,e,s){super(t,e,s);this.proxyErrors=t=>e.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends n.EventEmitter{[S]=false;[v]=false;[k]=[];[_]=[];[R];[b];[M];[w];[h]=false;[c]=false;[u]=false;[d]=false;[f]=null;[x]=0;[P]=false;[F];[B]=false;[N]=0;[j]=false;writable=true;readable=true;constructor(...t){const e=t[0]||{};super();if(e.objectMode&&typeof e.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(e)){this[R]=true;this[b]=null}else if(isEncodingOptions(e)){this[b]=e.encoding;this[R]=false}else{this[R]=false;this[b]=null}this[M]=!!e.async;this[w]=this[b]?new a.StringDecoder(this[b]):null;if(e&&e.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[_]})}if(e&&e.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[k]})}const{signal:s}=e;if(s){this[F]=s;if(s.aborted){this[U]()}else{s.addEventListener("abort",(()=>this[U]()))}}}get bufferLength(){return this[x]}get encoding(){return this[b]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[R]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[M]}set["async"](t){this[M]=this[M]||!!t}[U](){this[B]=true;this.emit("abort",this[F]?.reason);this.destroy(this[F]?.reason)}get aborted(){return this[B]}set aborted(t){}write(t,e,s){if(this[B])return false;if(this[h])throw new Error("write after end");if(this[P]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof e==="function"){s=e;e="utf8"}if(!e)e="utf8";const i=this[M]?defer:nodefer;if(!this[R]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[R]){if(this[S]&&this[x]!==0)this[g](true);if(this[S])this.emit("data",t);else this[E](t);if(this[x]!==0)this.emit("readable");if(s)i(s);return this[S]}if(!t.length){if(this[x]!==0)this.emit("readable");if(s)i(s);return this[S]}if(typeof t==="string"&&!(e===this[b]&&!this[w]?.lastNeed)){t=Buffer.from(t,e)}if(Buffer.isBuffer(t)&&this[b]){t=this[w].write(t)}if(this[S]&&this[x]!==0)this[g](true);if(this[S])this.emit("data",t);else this[E](t);if(this[x]!==0)this.emit("readable");if(s)i(s);return this[S]}read(t){if(this[P])return null;this[j]=false;if(this[x]===0||t===0||t&&t>this[x]){this[l]();return null}if(this[R])t=null;if(this[_].length>1&&!this[R]){this[_]=[this[b]?this[_].join(""):Buffer.concat(this[_],this[x])]}const e=this[p](t||null,this[_][0]);this[l]();return e}[p](t,e){if(this[R])this[C]();else{const s=e;if(t===s.length||t===null)this[C]();else if(typeof s==="string"){this[_][0]=s.slice(t);e=s.slice(0,t);this[x]-=t}else{this[_][0]=s.subarray(t);e=s.subarray(0,t);this[x]-=t}}this.emit("data",e);if(!this[_].length&&!this[h])this.emit("drain");return e}end(t,e,s){if(typeof t==="function"){s=t;t=undefined}if(typeof e==="function"){s=e;e="utf8"}if(t!==undefined)this.write(t,e);if(s)this.once("end",s);this[h]=true;this.writable=false;if(this[S]||!this[v])this[l]();return this}[T](){if(this[P])return;if(!this[N]&&!this[k].length){this[j]=true}this[v]=false;this[S]=true;this.emit("resume");if(this[_].length)this[g]();else if(this[h])this[l]();else this.emit("drain")}resume(){return this[T]()}pause(){this[S]=false;this[v]=true;this[j]=false}get destroyed(){return this[P]}get flowing(){return this[S]}get paused(){return this[v]}[E](t){if(this[R])this[x]+=1;else this[x]+=t.length;this[_].push(t)}[C](){if(this[R])this[x]-=1;else this[x]-=this[_][0].length;return this[_].shift()}[g](t=false){do{}while(this[y](this[C]())&&this[_].length);if(!t&&!this[_].length&&!this[h])this.emit("drain")}[y](t){this.emit("data",t);return this[S]}pipe(t,e){if(this[P])return t;this[j]=false;const s=this[c];e=e||{};if(t===r.stdout||t===r.stderr)e.end=false;else e.end=e.end!==false;e.proxyErrors=!!e.proxyErrors;if(s){if(e.end)t.end()}else{this[k].push(!e.proxyErrors?new Pipe(this,t,e):new PipeProxyErrors(this,t,e));if(this[M])defer((()=>this[T]()));else this[T]()}return t}unpipe(t){const e=this[k].find((e=>e.dest===t));if(e){if(this[k].length===1){if(this[S]&&this[N]===0){this[S]=false}this[k]=[]}else this[k].splice(this[k].indexOf(e),1);e.unpipe()}}addListener(t,e){return this.on(t,e)}on(t,e){const s=super.on(t,e);if(t==="data"){this[j]=false;this[N]++;if(!this[k].length&&!this[S]){this[T]()}}else if(t==="readable"&&this[x]!==0){super.emit("readable")}else if(isEndish(t)&&this[c]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[f]){const t=e;if(this[M])defer((()=>t.call(this,this[f])));else t.call(this,this[f])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){const s=super.off(t,e);if(t==="data"){this[N]=this.listeners("data").length;if(this[N]===0&&!this[j]&&!this[k].length){this[S]=false}}return s}removeAllListeners(t){const e=super.removeAllListeners(t);if(t==="data"||t===undefined){this[N]=0;if(!this[j]&&!this[k].length){this[S]=false}}return e}get emittedEnd(){return this[c]}[l](){if(!this[u]&&!this[c]&&!this[P]&&this[_].length===0&&this[h]){this[u]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[d])this.emit("close");this[u]=false}}emit(t,...e){const s=e[0];if(t!=="error"&&t!=="close"&&t!==P&&this[P]){return false}else if(t==="data"){return!this[R]&&!s?false:this[M]?(defer((()=>this[I](s))),true):this[I](s)}else if(t==="end"){return this[L]()}else if(t==="close"){this[d]=true;if(!this[c]&&!this[P])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[f]=s;super.emit(A,s);const t=!this[F]||this.listeners("error").length?super.emit("error",s):false;this[l]();return t}else if(t==="resume"){const t=super.emit("resume");this[l]();return t}else if(t==="finish"||t==="prefinish"){const e=super.emit(t);this.removeAllListeners(t);return e}const i=super.emit(t,...e);this[l]();return i}[I](t){for(const e of this[k]){if(e.dest.write(t)===false)this.pause()}const e=this[j]?false:super.emit("data",t);this[l]();return e}[L](){if(this[c])return false;this[c]=true;this.readable=false;return this[M]?(defer((()=>this[O]())),true):this[O]()}[O](){if(this[w]){const t=this[w].end();if(t){for(const e of this[k]){e.dest.write(t)}if(!this[j])super.emit("data",t)}}for(const t of this[k]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[R])t.dataLength=0;const e=this.promise();this.on("data",(e=>{t.push(e);if(!this[R])t.dataLength+=e.length}));await e;return t}async concat(){if(this[R]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[b]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(P,(()=>e(new Error("stream destroyed"))));this.on("error",(t=>e(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[j]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[h])return stop();let s;let i;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(P,ondestroy);stop();i(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(P,ondestroy);this.pause();s({value:t,done:!!this[h]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(P,ondestroy);stop();s({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,e)=>{i=e;s=t;this.once(P,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[j]=false;let t=false;const stop=()=>{this.pause();this.off(A,stop);this.off(P,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const e=this.read();return e===null?stop():{done:false,value:e}};this.once("end",stop);this.once(A,stop);this.once(P,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(t){if(this[P]){if(t)this.emit("error",t);else this.emit(P);return this}this[P]=true;this[j]=true;this[_].length=0;this[x]=0;const e=this;if(typeof e.close==="function"&&!this[d])e.close();if(t)this.emit("error",t);else this.emit(P);return this}static get isStream(){return e.isStream}}e.Minipass=Minipass},5125:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var r=Object.getOwnPropertyDescriptor(e,s);if(!r||("get"in r?!e.__esModule:r.writable||r.configurable)){r={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,r)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s))i(e,t,s);r(e,t);return e};Object.defineProperty(e,"__esModule",{value:true});e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;const o=s(3481);const a=s(6760);const h=s(3136);const l=s(9896);const c=n(s(3024));const u=l.realpathSync.native;const f=s(1455);const d=s(1031);const p={lstatSync:l.lstatSync,readdir:l.readdir,readdirSync:l.readdirSync,readlinkSync:l.readlinkSync,realpathSync:u,promises:{lstat:f.lstat,readdir:f.readdir,readlink:f.readlink,realpath:f.realpath}};const fsFromOption=t=>!t||t===p||t===c?p:{...p,...t,promises:{...p.promises,...t.promises||{}}};const g=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=t=>t.replace(/\//g,"\\").replace(g,"$1\\");const y=/[\\\/]/;const b=0;const w=1;const S=2;const v=4;const T=6;const _=8;const k=10;const x=12;const E=15;const C=~E;const R=16;const P=32;const A=64;const I=128;const L=256;const O=512;const M=A|I|O;const U=1023;const entToType=t=>t.isFile()?_:t.isDirectory()?v:t.isSymbolicLink()?k:t.isCharacterDevice()?S:t.isBlockDevice()?T:t.isSocket()?x:t.isFIFO()?w:b;const B=new o.LRUCache({max:2**12});const normalize=t=>{const e=B.get(t);if(e)return e;const s=t.normalize("NFKD");B.set(t,s);return s};const F=new o.LRUCache({max:2**12});const normalizeNocase=t=>{const e=F.get(t);if(e)return e;const s=normalize(t.toLowerCase());F.set(t,s);return s};class ResolveCache extends o.LRUCache{constructor(){super({max:256})}}e.ResolveCache=ResolveCache;class ChildrenCache extends o.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:t=>t.length+1})}}e.ChildrenCache=ChildrenCache;const N=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#_t;#kt;get dev(){return this.#kt}#xt;get mode(){return this.#xt}#Et;get nlink(){return this.#Et}#Ct;get uid(){return this.#Ct}#Rt;get gid(){return this.#Rt}#Pt;get rdev(){return this.#Pt}#At;get blksize(){return this.#At}#It;get ino(){return this.#It}#k;get size(){return this.#k}#Lt;get blocks(){return this.#Lt}#Ot;get atimeMs(){return this.#Ot}#Mt;get mtimeMs(){return this.#Mt}#Ut;get ctimeMs(){return this.#Ut}#Bt;get birthtimeMs(){return this.#Bt}#Ft;get atime(){return this.#Ft}#Nt;get mtime(){return this.#Nt}#jt;get ctime(){return this.#jt}#zt;get birthtime(){return this.#zt}#Dt;#Gt;#Wt;#$t;#qt;#Ht;#Vt;#Jt;#Kt;#Yt;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=b,s,i,r,n,o){this.name=t;this.#Dt=r?normalizeNocase(t):normalize(t);this.#Vt=e&U;this.nocase=r;this.roots=i;this.root=s||this;this.#Jt=n;this.#Wt=o.fullpath;this.#qt=o.relative;this.#Ht=o.relativePosix;this.parent=o.parent;if(this.parent){this.#_t=this.parent.#_t}else{this.#_t=fsFromOption(o.fs)}}depth(){if(this.#Gt!==undefined)return this.#Gt;if(!this.parent)return this.#Gt=0;return this.#Gt=this.parent.depth()+1}childrenCache(){return this.#Jt}resolve(t){if(!t){return this}const e=this.getRootString(t);const s=t.substring(e.length);const i=s.split(this.splitSep);const r=e?this.getRoot(e).#Xt(i):this.#Xt(i);return r}#Xt(t){let e=this;for(const s of t){e=e.child(s)}return e}children(){const t=this.#Jt.get(this);if(t){return t}const e=Object.assign([],{provisional:0});this.#Jt.set(this,e);this.#Vt&=~R;return e}child(t,e){if(t===""||t==="."){return this}if(t===".."){return this.parent||this}const s=this.children();const i=this.nocase?normalizeNocase(t):normalize(t);for(const t of s){if(t.#Dt===i){return t}}const r=this.parent?this.sep:"";const n=this.#Wt?this.#Wt+r+t:undefined;const o=this.newChild(t,b,{...e,parent:this,fullpath:n});if(!this.canReaddir()){o.#Vt|=I}s.push(o);return o}relative(){if(this.isCWD)return"";if(this.#qt!==undefined){return this.#qt}const t=this.name;const e=this.parent;if(!e){return this.#qt=this.name}const s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#Ht!==undefined)return this.#Ht;const t=this.name;const e=this.parent;if(!e){return this.#Ht=this.fullpathPosix()}const s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#Wt!==undefined){return this.#Wt}const t=this.name;const e=this.parent;if(!e){return this.#Wt=this.name}const s=e.fullpath();const i=s+(!e.parent?"":this.sep)+t;return this.#Wt=i}fullpathPosix(){if(this.#$t!==undefined)return this.#$t;if(this.sep==="/")return this.#$t=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(t)){return this.#$t=`//?/${t}`}else{return this.#$t=t}}const t=this.parent;const e=t.fullpathPosix();const s=e+(!e||!t.parent?"":"/")+this.name;return this.#$t=s}isUnknown(){return(this.#Vt&E)===b}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Vt&E)===_}isDirectory(){return(this.#Vt&E)===v}isCharacterDevice(){return(this.#Vt&E)===S}isBlockDevice(){return(this.#Vt&E)===T}isFIFO(){return(this.#Vt&E)===w}isSocket(){return(this.#Vt&E)===x}isSymbolicLink(){return(this.#Vt&k)===k}lstatCached(){return this.#Vt&P?this:undefined}readlinkCached(){return this.#Kt}realpathCached(){return this.#Yt}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#Kt)return true;if(!this.parent)return false;const t=this.#Vt&E;return!(t!==b&&t!==k||this.#Vt&L||this.#Vt&I)}calledReaddir(){return!!(this.#Vt&R)}isENOENT(){return!!(this.#Vt&I)}isNamed(t){return!this.nocase?this.#Dt===normalize(t):this.#Dt===normalizeNocase(t)}async readlink(){const t=this.#Kt;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=await this.#_t.promises.readlink(this.fullpath());const e=(await this.parent.realpath())?.resolve(t);if(e){return this.#Kt=e}}catch(t){this.#Zt(t.code);return undefined}}readlinkSync(){const t=this.#Kt;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=this.#_t.readlinkSync(this.fullpath());const e=this.parent.realpathSync()?.resolve(t);if(e){return this.#Kt=e}}catch(t){this.#Zt(t.code);return undefined}}#Qt(t){this.#Vt|=R;for(let e=t.provisional;e<t.length;e++){const s=t[e];if(s)s.#te()}}#te(){if(this.#Vt&I)return;this.#Vt=(this.#Vt|I)&C;this.#ee()}#ee(){const t=this.children();t.provisional=0;for(const e of t){e.#te()}}#se(){this.#Vt|=O;this.#ie()}#ie(){if(this.#Vt&A)return;let t=this.#Vt;if((t&E)===v)t&=C;this.#Vt=t|A;this.#ee()}#re(t=""){if(t==="ENOTDIR"||t==="EPERM"){this.#ie()}else if(t==="ENOENT"){this.#te()}else{this.children().provisional=0}}#ne(t=""){if(t==="ENOTDIR"){const t=this.parent;t.#ie()}else if(t==="ENOENT"){this.#te()}}#Zt(t=""){let e=this.#Vt;e|=L;if(t==="ENOENT")e|=I;if(t==="EINVAL"||t==="UNKNOWN"){e&=C}this.#Vt=e;if(t==="ENOTDIR"&&this.parent){this.parent.#ie()}}#oe(t,e){return this.#ae(t,e)||this.#he(t,e)}#he(t,e){const s=entToType(t);const i=this.newChild(t.name,s,{parent:this});const r=i.#Vt&E;if(r!==v&&r!==k&&r!==b){i.#Vt|=A}e.unshift(i);e.provisional++;return i}#ae(t,e){for(let s=e.provisional;s<e.length;s++){const i=e[s];const r=this.nocase?normalizeNocase(t.name):normalize(t.name);if(r!==i.#Dt){continue}return this.#le(t,i,s,e)}}#le(t,e,s,i){const r=e.name;e.#Vt=e.#Vt&C|entToType(t);if(r!==t.name)e.name=t.name;if(s!==i.provisional){if(s===i.length-1)i.pop();else i.splice(s,1);i.unshift(e)}i.provisional++;return e}async lstat(){if((this.#Vt&I)===0){try{this.#ce(await this.#_t.promises.lstat(this.fullpath()));return this}catch(t){this.#ne(t.code)}}}lstatSync(){if((this.#Vt&I)===0){try{this.#ce(this.#_t.lstatSync(this.fullpath()));return this}catch(t){this.#ne(t.code)}}}#ce(t){const{atime:e,atimeMs:s,birthtime:i,birthtimeMs:r,blksize:n,blocks:o,ctime:a,ctimeMs:h,dev:l,gid:c,ino:u,mode:f,mtime:d,mtimeMs:p,nlink:g,rdev:y,size:w,uid:S}=t;this.#Ft=e;this.#Ot=s;this.#zt=i;this.#Bt=r;this.#At=n;this.#Lt=o;this.#jt=a;this.#Ut=h;this.#kt=l;this.#Rt=c;this.#It=u;this.#xt=f;this.#Nt=d;this.#Mt=p;this.#Et=g;this.#Pt=y;this.#k=w;this.#Ct=S;const T=entToType(t);this.#Vt=this.#Vt&C|T|P;if(T!==b&&T!==v&&T!==k){this.#Vt|=A}}#ue=[];#fe=false;#de(t){this.#fe=false;const e=this.#ue.slice();this.#ue.length=0;e.forEach((e=>e(null,t)))}readdirCB(t,e=false){if(!this.canReaddir()){if(e)t(null,[]);else queueMicrotask((()=>t(null,[])));return}const s=this.children();if(this.calledReaddir()){const i=s.slice(0,s.provisional);if(e)t(null,i);else queueMicrotask((()=>t(null,i)));return}this.#ue.push(t);if(this.#fe){return}this.#fe=true;const i=this.fullpath();this.#_t.readdir(i,{withFileTypes:true},((t,e)=>{if(t){this.#re(t.code);s.provisional=0}else{for(const t of e){this.#oe(t,s)}this.#Qt(s)}this.#de(s.slice(0,s.provisional));return}))}#pe;async readdir(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();if(this.#pe){await this.#pe}else{let resolve=()=>{};this.#pe=new Promise((t=>resolve=t));try{for(const s of await this.#_t.promises.readdir(e,{withFileTypes:true})){this.#oe(s,t)}this.#Qt(t)}catch(e){this.#re(e.code);t.provisional=0}this.#pe=undefined;resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();try{for(const s of this.#_t.readdirSync(e,{withFileTypes:true})){this.#oe(s,t)}this.#Qt(t)}catch(e){this.#re(e.code);t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#Vt&M)return false;const t=E&this.#Vt;if(!(t===b||t===v||t===k)){return false}return true}shouldWalk(t,e){return(this.#Vt&v)===v&&!(this.#Vt&M)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#Yt)return this.#Yt;if((O|L|I)&this.#Vt)return undefined;try{const t=await this.#_t.promises.realpath(this.fullpath());return this.#Yt=this.resolve(t)}catch(t){this.#se()}}realpathSync(){if(this.#Yt)return this.#Yt;if((O|L|I)&this.#Vt)return undefined;try{const t=this.#_t.realpathSync(this.fullpath());return this.#Yt=this.resolve(t)}catch(t){this.#se()}}[N](t){if(t===this)return;t.isCWD=false;this.isCWD=true;const e=new Set([]);let s=[];let i=this;while(i&&i.parent){e.add(i);i.#qt=s.join(this.sep);i.#Ht=s.join("/");i=i.parent;s.push("..")}i=t;while(i&&i.parent&&!e.has(i)){i.#qt=undefined;i.#Ht=undefined;i=i.parent}}}e.PathBase=PathBase;class PathWin32 extends PathBase{sep="\\";splitSep=y;constructor(t,e=b,s,i,r,n,o){super(t,e,s,i,r,n,o)}newChild(t,e=b,s={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return a.win32.parse(t).root}getRoot(t){t=uncToDrive(t.toUpperCase());if(t===this.root.name){return this.root}for(const[e,s]of Object.entries(this.roots)){if(this.sameRoot(t,e)){return this.roots[t]=s}}return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){t=t.toUpperCase().replace(/\//g,"\\").replace(g,"$1\\");return t===e}}e.PathWin32=PathWin32;class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=b,s,i,r,n,o){super(t,e,s,i,r,n,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=b,s={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}}e.PathPosix=PathPosix;class PathScurryBase{root;rootPath;roots;cwd;#me;#ge;#Jt;nocase;#_t;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:r=16*1024,fs:n=p}={}){this.#_t=fsFromOption(n);if(t instanceof URL||t.startsWith("file://")){t=(0,h.fileURLToPath)(t)}const o=e.resolve(t);this.roots=Object.create(null);this.rootPath=this.parseRootPath(o);this.#me=new ResolveCache;this.#ge=new ResolveCache;this.#Jt=new ChildrenCache(r);const a=o.substring(this.rootPath.length).split(s);if(a.length===1&&!a[0]){a.pop()}if(i===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=i;this.root=this.newRoot(this.#_t);this.roots[this.rootPath]=this.root;let l=this.root;let c=a.length-1;const u=e.sep;let f=this.rootPath;let d=false;for(const t of a){const e=c--;l=l.child(t,{relative:new Array(e).fill("..").join(u),relativePosix:new Array(e).fill("..").join("/"),fullpath:f+=(d?"":u)+t});d=true}this.cwd=l}depth(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.depth()}childrenCache(){return this.#Jt}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#me.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpath();this.#me.set(e,i);return i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#ge.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpathPosix();this.#ge.set(e,i);return i}relative(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relative()}relativePosix(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relativePosix()}basename(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.name}dirname(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s}=e;if(!t.canReaddir()){return[]}else{const e=await t.readdir();return s?e:e.map((t=>t.name))}}readdirSync(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true}=e;if(!t.canReaddir()){return[]}else if(s){return t.readdirSync()}else{return t.readdirSync().map((t=>t.name))}}async lstat(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstat()}lstatSync(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=[];if(!r||r(t)){o.push(s?t:t.fullpath())}const a=new Set;const walk=(t,e)=>{a.add(t);t.readdirCB(((t,h)=>{if(t){return e(t)}let l=h.length;if(!l)return e();const next=()=>{if(--l===0){e()}};for(const t of h){if(!r||r(t)){o.push(s?t:t.fullpath())}if(i&&t.isSymbolicLink()){t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(a,n)?walk(t,next):next()))}else{if(t.shouldWalk(a,n)){walk(t,next)}else{next()}}}}),true)};const h=t;return new Promise(((t,e)=>{walk(h,(s=>{if(s)return e(s);t(o)}))}))}walkSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=[];if(!r||r(t)){o.push(s?t:t.fullpath())}const a=new Set([t]);for(const t of a){const e=t.readdirSync();for(const t of e){if(!r||r(t)){o.push(s?t:t.fullpath())}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,n)){a.add(e)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}return this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;if(!r||r(t)){yield s?t:t.fullpath()}const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){if(!r||r(t)){yield s?t:t.fullpath()}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(o,n)){o.add(e)}}}}stream(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=new d.Minipass({objectMode:true});if(!r||r(t)){o.write(s?t:t.fullpath())}const a=new Set;const h=[t];let l=0;const process=()=>{let t=false;while(!t){const e=h.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const onReaddir=(e,u,f=false)=>{if(e)return o.emit("error",e);if(i&&!f){const t=[];for(const e of u){if(e.isSymbolicLink()){t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)))}}if(t.length){Promise.all(t).then((()=>onReaddir(null,u,true)));return}}for(const e of u){if(e&&(!r||r(e))){if(!o.write(s?e:e.fullpath())){t=true}}}l--;for(const t of u){const e=t.realpathCached()||t;if(e.shouldWalk(a,n)){h.push(e)}}if(t&&!o.flowing){o.once("drain",process)}else if(!c){process()}};let c=true;e.readdirCB(onReaddir,true);c=false}};process();return o}streamSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:r,walkFilter:n}=e;const o=new d.Minipass({objectMode:true});const a=new Set;if(!r||r(t)){o.write(s?t:t.fullpath())}const h=[t];let l=0;const process=()=>{let t=false;while(!t){const e=h.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const c=e.readdirSync();for(const e of c){if(!r||r(e)){if(!o.write(s?e:e.fullpath())){t=true}}}l--;for(const t of c){let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,n)){h.push(e)}}}if(t&&!o.flowing)o.once("drain",process)};process();return o}chdir(t=this.cwd){const e=this.cwd;this.cwd=typeof t==="string"?this.cwd.resolve(t):t;this.cwd[N](e)}}e.PathScurryBase=PathScurryBase;class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,a.win32,"\\",{...e,nocase:s});this.nocase=s;for(let t=this.cwd;t;t=t.parent){t.nocase=this.nocase}}parseRootPath(t){return a.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,v,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}e.PathScurryWin32=PathScurryWin32;class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:s=false}=e;super(t,a.posix,"/",{...e,nocase:s});this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,v,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}e.PathScurryPosix=PathScurryPosix;class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,{...e,nocase:s})}}e.PathScurryDarwin=PathScurryDarwin;e.Path=process.platform==="win32"?PathWin32:PathPosix;e.PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix}};var e={};function __nccwpck_require__(s){var i=e[s];if(i!==undefined){return i.exports}var r=e[s]={exports:{}};var n=true;try{t[s].call(r.exports,r,r.exports,__nccwpck_require__);n=false}finally{if(n)delete e[s]}return r.exports}__nccwpck_require__.m=t;(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var e;__nccwpck_require__.t=function(s,i){if(i&1)s=this(s);if(i&8)return s;if(typeof s==="object"&&s){if(i&4&&s.__esModule)return s;if(i&16&&typeof s.then==="function")return s}var r=Object.create(null);__nccwpck_require__.r(r);var n={};e=e||[null,t({}),t([]),t(t)];for(var o=i&2&&s;typeof o=="object"&&!~e.indexOf(o);o=t(o)){Object.getOwnPropertyNames(o).forEach((t=>n[t]=()=>s[t]))}n["default"]=()=>s;__nccwpck_require__.d(r,n);return r}})();(()=>{__nccwpck_require__.d=(t,e)=>{for(var s in e){if(__nccwpck_require__.o(e,s)&&!__nccwpck_require__.o(t,s)){Object.defineProperty(t,s,{enumerable:true,get:e[s]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=t=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((e,s)=>{__nccwpck_require__.f[s](t,e);return e}),[]))})();(()=>{__nccwpck_require__.u=t=>""+t+".index.js"})();(()=>{__nccwpck_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";(()=>{var t={792:1};var installChunk=e=>{var s=e.modules,i=e.ids,r=e.runtime;for(var n in s){if(__nccwpck_require__.o(s,n)){__nccwpck_require__.m[n]=s[n]}}if(r)r(__nccwpck_require__);for(var o=0;o<i.length;o++)t[i[o]]=1};__nccwpck_require__.f.require=(e,s)=>{if(!t[e]){if(true){installChunk(require("./"+__nccwpck_require__.u(e)))}else t[e]=1}}})();var s={};(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:true});const e=__nccwpck_require__(7294);const i=__nccwpck_require__(8010);function getRequiredArgValue(t,e,s){const i=t[e+1];if(!i||i.startsWith("-")){console.error(`Error: Missing value for argument ${s}`);return null}return i}function printUsage(){console.log(`\n@testream/junit-reporter - Convert JUnit XML to CTRF and upload to Testream\n\nUsage:\n npx @testream/junit-reporter [options]\n\nUpload arguments (required unless --no-upload):\n --api-key, -k API key for authentication\n\nConversion options:\n --junit-path, -j Path or glob to JUnit XML file(s) (default: ${e.DEFAULT_JUNIT_PATH})\n --output-dir Output directory for CTRF report (default: ctrf)\n --output-file CTRF file name (default: ctrf-report.json)\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading CTRF results\n --fail-on-error Fail process if upload fails\n\nOther:\n --help, -h Show help message\n\nExamples:\n # Convert and upload using the default Maven path\n npx @testream/junit-reporter -k your-api-key\n\n # Convert only (no upload) with a custom XML path\n npx @testream/junit-reporter -j ./reports/junit.xml --no-upload\n`)}function parseArgs(t){const s={junitPath:e.DEFAULT_JUNIT_PATH,uploadEnabled:true,failOnUploadError:false};for(let e=0;e<t.length;e++){const i=t[e];switch(i){case"--help":case"-h":printUsage();process.exit(0);break;case"--junit-path":case"-j":{const i=getRequiredArgValue(t,e,"--junit-path");if(!i){return null}s.junitPath=i;e++;break}case"--api-key":case"-k":{const i=getRequiredArgValue(t,e,"--api-key");if(!i){return null}s.apiKey=i;e++;break}case"--output-dir":{const i=getRequiredArgValue(t,e,"--output-dir");if(!i){return null}s.outputDir=i;e++;break}case"--output-file":{const i=getRequiredArgValue(t,e,"--output-file");if(!i){return null}s.outputFile=i;e++;break}case"--branch":{const i=getRequiredArgValue(t,e,"--branch");if(!i){return null}s.branch=i;e++;break}case"--commit-sha":{const i=getRequiredArgValue(t,e,"--commit-sha");if(!i){return null}s.commitSha=i;e++;break}case"--repository-url":{const i=getRequiredArgValue(t,e,"--repository-url");if(!i){return null}s.repositoryUrl=i;e++;break}case"--build-name":{const i=getRequiredArgValue(t,e,"--build-name");if(!i){return null}s.buildName=i;e++;break}case"--build-number":{const i=getRequiredArgValue(t,e,"--build-number");if(!i){return null}s.buildNumber=i;e++;break}case"--build-url":{const i=getRequiredArgValue(t,e,"--build-url");if(!i){return null}s.buildUrl=i;e++;break}case"--test-environment":{const i=getRequiredArgValue(t,e,"--test-environment");if(!i){return null}s.testEnvironment=i;e++;break}case"--app-name":{const i=getRequiredArgValue(t,e,"--app-name");if(!i){return null}s.appName=i;e++;break}case"--app-version":{const i=getRequiredArgValue(t,e,"--app-version");if(!i){return null}s.appVersion=i;e++;break}case"--test-type":{const i=getRequiredArgValue(t,e,"--test-type");if(!i){return null}s.testType=i;e++;break}case"--no-upload":s.uploadEnabled=false;break;case"--fail-on-error":s.failOnUploadError=true;break;default:if(i.startsWith("-")){console.error(`Unknown argument: ${i}`);return null}break}}if(s.uploadEnabled&&!s.apiKey){console.error("Error: Missing required argument: --api-key (unless --no-upload is set)");return null}return s}async function main(){const t=process.argv.slice(2);if(t.length===0){printUsage();process.exit(1)}const s=parseArgs(t);if(!s){process.exit(1)}try{console.info("Converting JUnit XML to CTRF...");const t=await(0,e.convertJUnitToCtrf)({junitPath:s.junitPath,outputDir:s.outputDir,outputFile:s.outputFile});console.info(` Source files: ${t.sourceFiles.length}`);console.info(` CTRF output: ${t.reportPath}`);console.info(` Tests: ${t.report.results.summary.tests}`);console.info(` Passed: ${t.report.results.summary.passed}`);console.info(` Failed: ${t.report.results.summary.failed}`);console.info(` Skipped: ${t.report.results.summary.skipped}`);if(!s.uploadEnabled){console.info("Upload disabled, skipping upload");return}console.info("Uploading CTRF report to Testream...");const r=await(0,i.uploadCtrfReport)({report:t.report,apiKey:s.apiKey,apiUrl:s.apiUrl,branch:s.branch,commitSha:s.commitSha,repositoryUrl:s.repositoryUrl,buildName:s.buildName,buildNumber:s.buildNumber,buildUrl:s.buildUrl,testEnvironment:s.testEnvironment,appName:s.appName,appVersion:s.appVersion,testType:s.testType});if(!r.success){console.error(`Upload failed: ${r.error||"Unknown upload error"}`);if(s.failOnUploadError){process.exit(1)}return}if(r.alreadyExists){console.info(`Report already exists (reportId: ${r.reportId})`);return}console.info("Upload complete");console.info(` Report ID: ${r.reportId}`);if(r.testRunId){console.info(` Test Run ID: ${r.testRunId}`)}}catch(t){const e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`);process.exit(1)}}main()})();module.exports=s})();
|
|
2
|
+
(()=>{"use strict";var t={2406:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.detectCIContext=detectCIContext;function removePrefix(t,e){if(!t){return undefined}return t.startsWith(e)?t.slice(e.length):t}function readEnvironment(){const t=globalThis;return t.process?.env??{}}function buildGithubRepositoryUrl(t){if(!t.GITHUB_SERVER_URL||!t.GITHUB_REPOSITORY){return undefined}return`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}`}function buildGithubBuildUrl(t){if(!t.GITHUB_SERVER_URL||!t.GITHUB_REPOSITORY||!t.GITHUB_RUN_ID){return undefined}return`${t.GITHUB_SERVER_URL}/${t.GITHUB_REPOSITORY}/actions/runs/${t.GITHUB_RUN_ID}`}function detectGitHubBranch(t){if(t.GITHUB_HEAD_REF){return t.GITHUB_HEAD_REF}if(t.GITHUB_REF?.startsWith("refs/heads/")){return t.GITHUB_REF_NAME??removePrefix(t.GITHUB_REF,"refs/heads/")}return undefined}function detectGitHubActionsContext(t){return{branch:detectGitHubBranch(t),commitSha:t.GITHUB_SHA,repositoryUrl:buildGithubRepositoryUrl(t),buildNumber:t.GITHUB_RUN_NUMBER,buildUrl:buildGithubBuildUrl(t)}}function detectGitLabContext(t){return{branch:t.CI_COMMIT_BRANCH||t.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME,commitSha:t.CI_COMMIT_SHA,repositoryUrl:t.CI_PROJECT_URL,buildNumber:t.CI_PIPELINE_IID,buildUrl:t.CI_PIPELINE_URL}}function detectAzurePipelinesContext(t){return{branch:removePrefix(t.BUILD_SOURCEBRANCH,"refs/heads/"),commitSha:t.BUILD_SOURCEVERSION,repositoryUrl:t.BUILD_REPOSITORY_URI,buildNumber:t.BUILD_BUILDNUMBER,buildUrl:t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI&&t.SYSTEM_TEAMPROJECT&&t.BUILD_BUILDID?`${t.SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${t.SYSTEM_TEAMPROJECT}/_build/results?buildId=${t.BUILD_BUILDID}`:undefined}}function detectCircleCIContext(t){return{branch:t.CIRCLE_BRANCH,commitSha:t.CIRCLE_SHA1,repositoryUrl:t.CIRCLE_REPOSITORY_URL,buildNumber:t.CIRCLE_BUILD_NUM,buildUrl:t.CIRCLE_BUILD_URL}}function detectJenkinsContext(t){return{branch:removePrefix(t.GIT_BRANCH,"origin/"),commitSha:t.GIT_COMMIT,repositoryUrl:t.GIT_URL,buildNumber:t.BUILD_NUMBER,buildUrl:t.BUILD_URL}}function detectBitbucketContext(t){return{branch:t.BITBUCKET_BRANCH,commitSha:t.BITBUCKET_COMMIT,repositoryUrl:t.BITBUCKET_GIT_HTTP_ORIGIN,buildNumber:t.BITBUCKET_BUILD_NUMBER,buildUrl:t.BITBUCKET_REPO_FULL_NAME&&t.BITBUCKET_BUILD_NUMBER?`https://bitbucket.org/${t.BITBUCKET_REPO_FULL_NAME}/pipelines/results/${t.BITBUCKET_BUILD_NUMBER}`:undefined}}const s=[{isMatch:t=>t.GITHUB_ACTIONS==="true",detect:detectGitHubActionsContext},{isMatch:t=>t.GITLAB_CI==="true",detect:detectGitLabContext},{isMatch:t=>t.TF_BUILD==="True",detect:detectAzurePipelinesContext},{isMatch:t=>t.CIRCLECI==="true",detect:detectCircleCIContext},{isMatch:t=>Boolean(t.JENKINS_URL),detect:detectJenkinsContext},{isMatch:t=>Boolean(t.BITBUCKET_BUILD_NUMBER),detect:detectBitbucketContext}];function detectCIContext(){const t=readEnvironment();for(const e of s){if(e.isMatch(t)){return e.detect(t)}}return{}}},3827:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true})},7322:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var n=Object.getOwnPropertyDescriptor(e,s);if(!n||("get"in n?!e.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,n)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var n=this&&this.__exportStar||function(t,e){for(var s in t)if(s!=="default"&&!Object.prototype.hasOwnProperty.call(e,s))i(e,t,s)};Object.defineProperty(e,"__esModule",{value:true});e.createTestLocationCollector=e.enrichReportWithJsTestNameSourceSnippets=e.resolveSourceSnippetOptions=e.enrichReportWithSourceSnippets=e.ensureReportId=e.mapAttachmentsToTestResults=e.uploadArtifacts=e.uploadTestRun=e.detectCIContext=void 0;n(s(3827),e);var a=s(2406);Object.defineProperty(e,"detectCIContext",{enumerable:true,get:function(){return a.detectCIContext}});var l=s(8969);Object.defineProperty(e,"uploadTestRun",{enumerable:true,get:function(){return l.uploadTestRun}});Object.defineProperty(e,"uploadArtifacts",{enumerable:true,get:function(){return l.uploadArtifacts}});Object.defineProperty(e,"mapAttachmentsToTestResults",{enumerable:true,get:function(){return l.mapAttachmentsToTestResults}});Object.defineProperty(e,"ensureReportId",{enumerable:true,get:function(){return l.ensureReportId}});var h=s(9304);Object.defineProperty(e,"enrichReportWithSourceSnippets",{enumerable:true,get:function(){return h.enrichReportWithSourceSnippets}});Object.defineProperty(e,"resolveSourceSnippetOptions",{enumerable:true,get:function(){return h.resolveSourceSnippetOptions}});var u=s(6913);Object.defineProperty(e,"enrichReportWithJsTestNameSourceSnippets",{enumerable:true,get:function(){return u.enrichReportWithJsTestNameSourceSnippets}});var f=s(2293);Object.defineProperty(e,"createTestLocationCollector",{enumerable:true,get:function(){return f.createTestLocationCollector}})},6913:function(t,e,s){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.enrichReportWithJsTestNameSourceSnippets=enrichReportWithJsTestNameSourceSnippets;const n=s(1455);const a=i(s(6760));const l=s(9304);const h=3;const u=/\b(describe|it|test)(?:\.(only|skip))?\s*\(\s*(['"`])/g;async function enrichReportWithJsTestNameSourceSnippets(t,e){const s=(0,l.resolveSourceSnippetOptions)(e);const i=new Map;await Promise.all(t.results.tests.map((async t=>{if(t.snippet||!t.filePath){return}const e=a.default.resolve(s.sourceRoot,t.filePath);if(!isInsideSourceRoot(e,s.sourceRoot)){return}const n=await getCachedJsTestCandidates(e,i);if(!n){return}const l=rankCandidatesForTest(t,n).slice(0,h);if(l.length===0){return}t.line??(t.line=l[0].line);t.snippet=formatCandidateSnippet(l,s)})))}function getCachedJsTestCandidates(t,e){let s=e.get(t);if(!s){s=(0,n.readFile)(t,"utf-8").then((t=>scanJsTestCandidates(t))).catch((()=>undefined));e.set(t,s)}return s}function scanJsTestCandidates(t){const e=buildLineOffsets(t);const s=scanJsTestBlocks(t,e);const i=s.filter((t=>t.kind==="describe"));return s.filter((t=>t.kind==="test")).map((t=>{const e=i.filter((e=>e.startIndex<t.startIndex&&e.endIndex>=t.endIndex)).sort(((t,e)=>t.startIndex-e.startIndex)).map((t=>t.title));return{title:t.title,describeTitles:e,fullName:[...e,t.title].join(" ").trim(),line:t.startLine,snippet:t.snippet}}))}function scanJsTestBlocks(t,e){const s=[];u.lastIndex=0;let i;while((i=u.exec(t))!==null){if(isCommentedLine(t,i.index)){continue}const n=readQuotedTitle(t,i.index+i[0].length,i[3]);if(!n){continue}const a=skipWhitespaceAndFindComma(t,n.endIndex+1);if(a==null){continue}const l=i[1]==="describe"?"describe":"test";const h=i.index;const u=findCallbackOpenBrace(t,a+1);if(u==null){continue}const f=findMatchingBrace(t,u);if(f==null){continue}const p=findSnippetEndIndex(t,f);const g=t.slice(h,p).trim();if(!g){continue}s.push({kind:l,title:n.value.trim(),startIndex:h,endIndex:p,startLine:getLineNumber(e,h),snippet:g})}return s}function rankCandidatesForTest(t,e){const s=normalizeWhitespace(t.name);const i=normalizeDescribeChain(t.suite);const n=e.filter((t=>normalizeWhitespace(t.fullName)===s));if(n.length>0){return n}if(i){const t=e.filter((t=>normalizeWhitespace(t.title)===s&&normalizeWhitespace(t.describeTitles.join(" "))===i));if(t.length>0){return t}}const a=e.filter((t=>normalizeWhitespace(t.title)===s));if(a.length>0){return a}return e.filter((t=>{const e=normalizeWhitespace(t.title);if(!s.endsWith(e)){return false}const i=s.slice(0,s.length-e.length).trim();return i.length>0&&normalizeWhitespace(t.describeTitles.join(" "))===i}))}function formatCandidateSnippet(t,e){const s=t.length===1?t[0].snippet:t.map(((t,e)=>`Candidate ${e+1} (line ${t.line})\n${t.snippet}`)).join("\n\n");const i=s.split(/\r?\n/).slice(0,e.maxLines).join("\n").trim();if(i.length<=e.maxChars){return i}return i.slice(0,e.maxChars)}function findCallbackOpenBrace(t,e){for(let s=e;s<t.length;s++){const e=t[s];if(e==="'"||e==='"'||e==="`"){s=skipQuotedString(t,s);continue}if(e==="/"&&t[s+1]==="/"){s=skipLineComment(t,s+2);continue}if(e==="/"&&t[s+1]==="*"){s=skipBlockComment(t,s+2);continue}if(t.startsWith("=>",s)){return findNextBlockBrace(t,s+2)}if(startsWithWord(t,s,"function")){return findNextBlockBrace(t,s+"function".length)}if(e===";"){return undefined}}return undefined}function findNextBlockBrace(t,e){for(let s=e;s<t.length;s++){const e=t[s];if(e==="'"||e==='"'||e==="`"){s=skipQuotedString(t,s);continue}if(e==="{"){return s}if(e==="\n"&&looksLikeLineTerminator(t,s+1)){return undefined}}return undefined}function findMatchingBrace(t,e){let s=0;for(let i=e;i<t.length;i++){const e=t[i];if(e==="'"||e==='"'||e==="`"){i=skipQuotedString(t,i);continue}if(e==="/"&&t[i+1]==="/"){i=skipLineComment(t,i+2);continue}if(e==="/"&&t[i+1]==="*"){i=skipBlockComment(t,i+2);continue}if(e==="{"){s++;continue}if(e==="}"){s--;if(s===0){return i}}}return undefined}function readQuotedTitle(t,e,s){let i="";for(let n=e;n<t.length;n++){const e=t[n];if(e==="\\"){i+=e;if(n+1<t.length){n++;i+=t[n]}continue}if(e===s){return{value:i,endIndex:n}}if(e==="\n"&&s!=="`"){return undefined}i+=e}return undefined}function skipWhitespaceAndFindComma(t,e){for(let s=e;s<t.length;s++){const e=t[s];if(/\s/.test(e)){continue}return e===","?s:undefined}return undefined}function findSnippetEndIndex(t,e){let s=e+1;while(s<t.length){const e=t[s];if(e==="\r"||e==="\n"){return s}s++}return t.length}function skipQuotedString(t,e){const s=t[e];for(let i=e+1;i<t.length;i++){const e=t[i];if(e==="\\"){i++;continue}if(e===s){return i}}return t.length-1}function skipLineComment(t,e){for(let s=e;s<t.length;s++){if(t[s]==="\n"){return s}}return t.length-1}function skipBlockComment(t,e){for(let s=e;s<t.length-1;s++){if(t[s]==="*"&&t[s+1]==="/"){return s+1}}return t.length-1}function looksLikeLineTerminator(t,e){for(let s=e;s<t.length;s++){const e=t[s];if(!/\s/.test(e)){return e!=="."&&e!=="("}}return false}function buildLineOffsets(t){const e=[0];for(let s=0;s<t.length;s++){if(t[s]==="\n"){e.push(s+1)}}return e}function getLineNumber(t,e){let s=0;for(let i=0;i<t.length;i++){if(t[i]>e){break}s=i}return s+1}function isCommentedLine(t,e){const s=t.lastIndexOf("\n",e-1)+1;const i=t.slice(s,e).trimStart();return i.startsWith("//")||i.startsWith("*")}function startsWithWord(t,e,s){if(!t.startsWith(s,e)){return false}const i=e===0?"":t[e-1];const n=t[e+s.length]??"";return!isIdentifierChar(i)&&!isIdentifierChar(n)}function isIdentifierChar(t){return/[A-Za-z0-9_$]/.test(t)}function normalizeWhitespace(t){return(t??"").trim().replace(/\s+/g," ")}function normalizeDescribeChain(t){if(!t){return""}const e=t.split(">").map((t=>t.trim())).filter(Boolean);if(e.length===0){return""}const s=e[0].includes(".");const i=s?e.slice(1):e;return normalizeWhitespace(i.join(" "))}function isInsideSourceRoot(t,e){const s=a.default.relative(e,t);return s.length>0&&!s.startsWith("..")&&!a.default.isAbsolute(s)}},9304:function(t,e,s){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.resolveSourceSnippetOptions=resolveSourceSnippetOptions;e.enrichReportWithSourceSnippets=enrichReportWithSourceSnippets;const n=s(1455);const a=i(s(6760));const l=2e3;const h=40;function resolveSourceSnippetOptions(t){return{sourceRoot:a.default.resolve(t?.sourceRoot??process.cwd()),maxChars:normalizePositiveInt(t?.maxChars,l),maxLines:normalizePositiveInt(t?.maxLines,h)}}async function enrichReportWithSourceSnippets(t,e){const s=resolveSourceSnippetOptions(e);const i=new Map;await Promise.all(t.results.tests.map((async t=>{if(t.snippet||!t.filePath||!t.line){return}const e=await tryExtractSnippet(t,s,i);if(e){t.snippet=e}})))}async function tryExtractSnippet(t,e,s){const i=a.default.resolve(e.sourceRoot,t.filePath);if(!isInsideSourceRoot(i,e.sourceRoot)){return undefined}const n=await getCachedFileContent(i,s);if(!n){return undefined}return extractEnclosingTestBlock(n,t.line,e)}function getCachedFileContent(t,e){let s=e.get(t);if(!s){s=(0,n.readFile)(t,"utf-8").catch((()=>undefined));e.set(t,s)}return s}function extractEnclosingTestBlock(t,e,s){const i=t.split(/\r?\n/);const n=Math.max(0,Math.min(i.length-1,e-1));const a=findTestStart(i,n);if(a==null){return undefined}const l=[];let h=0;let u=false;for(let t=a;t<i.length&&l.length<s.maxLines;t++){const e=i[t];l.push(e);for(const t of e){if(t==="{"){h++;u=true}else if(t==="}"){h--}}if(u&&h<=0&&isJsTestBlockTerminator(e)){break}}const f=l.join("\n").trim();if(!f){return undefined}return f.length<=s.maxChars?f:f.slice(0,s.maxChars)}function findTestStart(t,e){for(let s=e;s>=0;s--){if(/\b(?:test|it)(?:\.(?:only|skip|fixme|slow))?\s*\(/.test(t[s])){return s}}return undefined}function isJsTestBlockTerminator(t){let e=t.length-1;while(e>=0&&/\s/.test(t[e])){e--}if(e>=0&&t[e]===";"){e--}while(e>=0&&/\s/.test(t[e])){e--}if(e<1||t[e]!==")"){return false}e--;while(e>=0&&/\s/.test(t[e])){e--}return e>=0&&t[e]==="}"}function isInsideSourceRoot(t,e){const s=a.default.relative(e,t);return s.length>0&&!s.startsWith("..")&&!a.default.isAbsolute(s)}function normalizePositiveInt(t,e){return typeof t==="number"&&Number.isInteger(t)&&t>0?t:e}},2293:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.createTestLocationCollector=createTestLocationCollector;function createTestLocationCollector(){const t=new Map;return{add(e,s){if(!e||!isValidLocation(s)){return}const i=t.get(e)??[];i.push(s);t.set(e,i)},applyToReport(e){const s=new Map([...t.entries()].map((([t,e])=>[t,[...e]])));for(const t of e.results.tests){const e=s.get(t.name);const i=e?.shift();if(!i){continue}t.filePath??(t.filePath=i.filePath);t.line??(t.line=i.line)}}}}function isValidLocation(t){return Boolean(t.filePath)&&Number.isInteger(t.line)&&t.line>0}},8969:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.ensureReportId=ensureReportId;e.uploadTestRun=uploadTestRun;e.mapAttachmentsToTestResults=mapAttachmentsToTestResults;e.uploadArtifacts=uploadArtifacts;const i=s(2406);const n=s(9304);const a="https://api.testream.app";function ensureReportId(t){if(typeof t.reportId==="string"&&t.reportId.trim().length>0){return t.reportId}const e=crypto.randomUUID();t.reportId=e;return e}function resolveApiUrl(t){const e=normalizeApiUrl(t);if(e){return e}const s=getEnvApiUrl();if(s){return s}return a}function getEnvApiUrl(){if(typeof process==="undefined"||!process?.env){return undefined}return normalizeApiUrl(process.env.TESTREAM_API_URL)}function normalizeApiUrl(t){if(!t){return undefined}const e=t.trim();if(!e){return undefined}let s=e;while(s.endsWith("/")){s=s.slice(0,-1)}return s}function isReportAlreadyExistsConflict(t){return t.errorCode==="report_already_exists"}function formatUploadError(t){const e=t.detail||t.title||t.rawBody||"Unknown error";const s=t.errorCode?`, code=${t.errorCode}`:"";return`Upload failed (HTTP ${t.statusCode}${s}): ${e}`}async function parseHttpError(t){const e=await t.text();const s=t.headers.get("content-type")||"";if(s.toLowerCase().includes("json")&&e.trim().length>0){try{const s=JSON.parse(e);return{statusCode:t.status,title:s.title,detail:s.detail||s.details||s.error,errorCode:s.errorCode,rawBody:e}}catch{}}return{statusCode:t.status,rawBody:e}}function resolveUploadContext(t){const e=(0,i.detectCIContext)();return{commitSha:t.commitSha??e.commitSha,branch:t.branch??e.branch,repositoryUrl:t.repositoryUrl??e.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber??e.buildNumber,buildUrl:t.buildUrl??e.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType}}async function uploadTestRun(t){const{report:e,apiKey:s}=t;const i=resolveApiUrl(t.apiUrl);const a=ensureReportId(e);const l=resolveUploadContext(t);await(0,n.enrichReportWithSourceSnippets)(e);const h={report:e,reportId:a,...l};console.log("Uploading test results...");let u;try{u=await fetch(`${i}/api/v1/ingest`,{method:"POST",headers:{"X-API-KEY":s,"Content-Type":"application/json"},body:JSON.stringify(h)})}catch(t){const e=t instanceof Error?t.message:String(t);const s=`Connection failed: ${e}`;console.error(s);return{success:false,reportId:a,error:s}}if(!u.ok){const t=await parseHttpError(u);if(u.status===409&&isReportAlreadyExistsConflict(t)){console.warn("Report already exists (workflow may have been re-run)");return{success:true,reportId:a,summary:{passed:e.results.summary.passed,failed:e.results.summary.failed,skipped:e.results.summary.skipped,total:e.results.summary.tests},alreadyExists:true,statusCode:t.statusCode,errorCode:t.errorCode}}const s=formatUploadError(t);console.error(s);return{success:false,reportId:a,error:s,statusCode:t.statusCode,errorCode:t.errorCode,errorDetail:t.detail||t.rawBody}}const f=await u.json();console.log(`✓ Test results uploaded successfully`);console.log(` Report ID: ${f.reportId}`);console.log(` Test Run ID: ${f.testRunId}`);console.log(` Tests: ${f.summary.passed}/${f.summary.total} passed`);return{success:true,reportId:f.reportId,testRunId:f.testRunId,summary:{passed:f.summary.passed,failed:f.summary.failed,skipped:f.summary.skipped,total:f.summary.total},testResults:f.testResults}}function mapAttachmentsToTestResults(t,e){const s=new Map;for(const t of e){const e=s.get(t.name)??[];e.push(t.id);s.set(t.name,e)}const i=[];for(const e of t){const t=s.get(e.name);const n=t?.shift();if(!e.attachments||e.attachments.length===0){continue}if(!n){console.warn(`Skipping artifact upload: could not match test result for "${e.name}"`);continue}i.push({testResultId:n,attachments:e.attachments})}return i}async function uploadArtifacts(t){const{reportId:e,apiKey:s,testResults:i}=t;const n=resolveApiUrl(t.apiUrl);let a=0;for(const t of i){for(const i of t.attachments){try{const l=await uploadSingleArtifact({testResultId:t.testResultId,attachment:i,reportId:e,apiKey:s,apiUrl:n});if(l)a++}catch(t){const e=t instanceof Error?t.message:String(t);console.error(`Failed to upload artifact ${i.name}: ${e}`)}}}if(a>0){console.log(`✓ Uploaded ${a} artifact(s)`)}return a}async function uploadSingleArtifact(t){const{testResultId:e,attachment:i,reportId:n,apiKey:a,apiUrl:l}=t;const h=await Promise.resolve().then(s.t.bind(s,1455,23));const u=await Promise.resolve().then(s.t.bind(s,6760,23));const f=u.resolve(i.path);try{await h.access(f)}catch{console.warn(`Artifact not found: ${u.basename(f)}`);return false}let p;let g;const b=u.basename(f);const w=i.contentType||"application/octet-stream";try{p=await h.readFile(f);g=p.byteLength}catch(t){const e=t instanceof Error?t.message:String(t);throw new Error(`Failed to read file: ${e}`)}try{return await uploadWithPresignedUrl({testResultId:e,reportId:n,apiKey:a,apiUrl:l,attachmentName:i.name,fileName:b,contentType:w,sizeBytes:g,fileBuffer:p})}catch(t){if(!(t instanceof LegacyUploadRequiredError)){throw t}return await uploadWithLegacyEndpoint({testResultId:e,attachmentName:i.name,reportId:n,apiKey:a,apiUrl:l,fileName:b,contentType:w,fileBuffer:p})}}class LegacyUploadRequiredError extends Error{constructor(){super("Legacy upload endpoint required")}}async function uploadWithPresignedUrl(t){const{testResultId:e,reportId:s,apiKey:i,apiUrl:n,attachmentName:a,fileName:l,contentType:h,sizeBytes:u,fileBuffer:f}=t;const p={testResultId:e,ctrfAttachmentName:a,fileName:l,contentType:h,sizeBytes:u};const g=await fetch(`${n}/api/v1/artifacts/${s}/upload-url`,{method:"POST",headers:{"X-API-KEY":i,"Content-Type":"application/json"},body:JSON.stringify(p)});if(shouldFallbackToLegacyUpload(g.status)){throw new LegacyUploadRequiredError}if(!g.ok){const t=await g.text();throw new Error(`Failed to create direct upload URL (HTTP ${g.status}): ${t}`)}const b=await g.json();const w={...b.requiredHeaders};if(!hasHeaderIgnoreCase(w,"Content-Type")){w["Content-Type"]=h}const S=await fetch(b.uploadUrl,{method:"PUT",headers:w,body:f});if(!S.ok){const t=await S.text();throw new Error(`Direct artifact upload failed (HTTP ${S.status}): ${t}`)}const v={testResultId:e,ctrfAttachmentName:a,fileName:l,contentType:h,sizeBytes:u,storageKey:b.storageKey};const x=await fetch(`${n}/api/v1/artifacts/${s}/complete`,{method:"POST",headers:{"X-API-KEY":i,"Content-Type":"application/json"},body:JSON.stringify(v)});if(!x.ok){const t=await x.text();throw new Error(`Failed to finalize artifact upload (HTTP ${x.status}): ${t}`)}return true}async function uploadWithLegacyEndpoint(t){const{testResultId:e,attachmentName:s,reportId:i,apiKey:n,apiUrl:a,fileName:l,contentType:h,fileBuffer:u}=t;const f=new Blob([new Uint8Array(u)],{type:h});const p=new FormData;p.append("testResultId",e);p.append("ctrfAttachmentName",s);p.append("file",f,l);const g=await fetch(`${a}/api/v1/artifacts/${i}`,{method:"POST",headers:{"X-API-KEY":n},body:p});if(!g.ok){const t=await g.text();throw new Error(`Legacy artifact upload failed (HTTP ${g.status}): ${t}`)}return true}function shouldFallbackToLegacyUpload(t){return t===404||t===405||t===501}function hasHeaderIgnoreCase(t,e){const s=e.toLowerCase();return Object.keys(t).some((t=>t.toLowerCase()===s))}},7294:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var n=Object.getOwnPropertyDescriptor(e,s);if(!n||("get"in n?!e.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,n)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var a=this&&this.__importStar||function(){var ownKeys=function(t){ownKeys=Object.getOwnPropertyNames||function(t){var e=[];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[e.length]=s;return e};return ownKeys(t)};return function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s=ownKeys(t),a=0;a<s.length;a++)if(s[a]!=="default")i(e,t,s[a]);n(e,t);return e}}();Object.defineProperty(e,"__esModule",{value:true});e.DEFAULT_JUNIT_PATH=void 0;e.convertJUnitToCtrf=convertJUnitToCtrf;const l=a(s(1455));const h=a(s(6760));const u=s(447);const f=s(7322);const p=s(148);e.DEFAULT_JUNIT_PATH="target/surefire-reports/TEST-*.xml";function hasGlobPattern(t){return t.includes("*")||t.includes("?")||t.includes("[")||t.includes("{")}async function resolveInputFiles(t){if(!hasGlobPattern(t)){const e=h.resolve(t);await l.access(e);return[e]}const e=await(0,u.glob)(t,{absolute:true,nodir:true});if(e.length===0){throw new Error(`No JUnit XML files found for pattern: ${t}`)}return e}async function resolveConverter(){const t=await s.e(759).then(s.bind(s,3759));const e=t.convertJUnitToCTRFReport??t.convertJUnitToCtrfReport??t.default;if(typeof e!=="function"){throw new TypeError("Failed to resolve junit-to-ctrf converter function. Expected 'convertJUnitToCTRFReport' export.")}return e}function normalizeNumeric(t,e){return typeof t==="number"&&Number.isFinite(t)?t:e}function normalizeNonNegativeDuration(t){if(typeof t!=="number"||!Number.isFinite(t)){return 0}return t>0?t:0}function normalizeTimestamp(t,e){return typeof t==="number"&&Number.isFinite(t)&&t>0?t:e}function normalizeText(t){if(typeof t!=="string"){return undefined}const e=t.trim();return e.length>0?e:undefined}function collectSuiteParts(t,e){const s=normalizeText(t);if(s){e.push(s);return}if(!Array.isArray(t)){return}for(const s of t){collectSuiteParts(s,e)}}function normalizeSuiteValue(t){const e=normalizeText(t);if(e){return e}if(!Array.isArray(t)){return undefined}const s=[];collectSuiteParts(t,s);return s.length>0?s.join(" > "):undefined}function normalizeJavaClassName(t){if(!t.includes(".")&&!t.includes("$")){return t}const e=t.split(".").pop()??t;return e.split("$").join(" > ")}function normalizeTestEntry(t){const e=t&&typeof t==="object"?t:{};const s={...e};const i=normalizeSuiteValue(e.suite);if(i){s.suite=normalizeJavaClassName(i)}else{delete s.suite}return s}function buildSummary(t,e){let s=0;let i=0;let n=0;let a=0;let l=0;const h=new Set;const u=Date.now();let f=Number.POSITIVE_INFINITY;let p=0;for(const e of t){const t=normalizeSuiteValue(e.suite);if(t){h.add(t)}const g=normalizeNumeric(e.start,u);const b=normalizeNonNegativeDuration(e.duration);const w=normalizeNumeric(e.stop,g+b);if(g<f){f=g}if(w>p){p=w}switch(e.status){case"passed":s++;break;case"failed":i++;break;case"skipped":n++;break;case"pending":a++;break;default:l++;break}}if(f===Number.POSITIVE_INFINITY){f=normalizeTimestamp(e?.start,u)}if(p===0){p=normalizeTimestamp(e?.stop,f)}return{tests:t.length,passed:s,failed:i,skipped:n,pending:a,other:l,start:normalizeTimestamp(e?.start,f),stop:normalizeTimestamp(e?.stop,p),suites:h.size}}function normalizeReport(t){if(!t||typeof t!=="object"){throw new Error("junit-to-ctrf returned an invalid report payload")}const e=t;if(!e.results||typeof e.results!=="object"){throw new Error("Converted report is missing results payload")}if(!Array.isArray(e.results.tests)){e.results.tests=[]}e.results.tests=e.results.tests.map((t=>normalizeTestEntry(t)));if(!e.results.tool||typeof e.results.tool!=="object"){e.results.tool={name:"junit"}}e.results.tool.name="junit";e.results.summary=buildSummary(e.results.tests,e.results.summary);e.reportFormat=e.reportFormat||"CTRF";e.specVersion=e.specVersion||"0.0.0";e.generatedBy=e.generatedBy||"@testream/junit-reporter";e.timestamp=e.timestamp||(new Date).toISOString();(0,f.ensureReportId)(e);return e}function mergeReports(t){if(t.length===0){throw new Error("No converted JUnit reports were produced")}if(t.length===1){return t[0]}const e=t[0];const s=t.flatMap((t=>t.results.tests));const i=Math.min(...t.map((t=>t.results.summary.start)));const n=Math.max(...t.map((t=>t.results.summary.stop)));const a={...e,timestamp:(new Date).toISOString(),generatedBy:"@testream/junit-reporter",results:{...e.results,tool:{...e.results.tool,name:"junit"},tests:s,summary:buildSummary(s,{start:i,stop:n})}};(0,f.ensureReportId)(a);return a}async function convertSingleFile(t,e){try{const s=await e(t);if(s===null||s===undefined){return null}const i=normalizeReport(s);const n=await l.readFile(t,"utf-8");const a=(0,p.extractJUnitBasedir)(n)??process.cwd();await(0,p.enrichReportWithJUnitSourceSnippets)(i,(0,p.extractJUnitTestCaseSources)(n),{sourceRoot:a});return i}catch(e){const s=e instanceof Error?e.message:String(e);throw new Error(`Failed to convert JUnit XML at ${t}: ${s}`)}}async function convertJUnitToCtrf(t){const s=t.outputDir||"ctrf";const i=t.outputFile||"ctrf-report.json";const n=t.junitPath||e.DEFAULT_JUNIT_PATH;const a=await resolveInputFiles(n);const u=await resolveConverter();const f=[];let p=0;for(const t of a){const e=await convertSingleFile(t,u);if(e===null){p++}else{f.push(e)}}if(f.length===0){if(p>0){throw new Error(`No test cases found in any of the ${a.length} JUnit XML file(s). `+`All files appear to be empty stubs (e.g. @Nested parent classes with tests="0"). `+`Ensure the nested class XML files (e.g. TEST-MyTest$Inner.xml) are included in the path.`)}throw new Error("No converted JUnit reports were produced")}const g=mergeReports(f);const b=h.resolve(s,i);await l.mkdir(h.dirname(b),{recursive:true});await l.writeFile(b,JSON.stringify(g,null,2));return{report:g,reportPath:b,sourceFiles:a}}},148:function(t,e,s){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.extractJUnitTestCaseSources=extractJUnitTestCaseSources;e.extractJUnitBasedir=extractJUnitBasedir;e.enrichReportWithJUnitSourceSnippets=enrichReportWithJUnitSourceSnippets;const n=s(1455);const a=i(s(6760));const l=2e3;const h=40;function extractJUnitTestCaseSources(t){const e=[];const s=/<testcase\b([^>]*)>/g;for(const i of t.matchAll(s)){const t=parseXmlAttributes(i[1]);const s=t.name?.trim();const n=t.classname?.trim();if(s&&n){e.push({testName:s,className:n})}}return e}function extractJUnitBasedir(t){const e=/<property\b([^>]*)>/g;for(const s of t.matchAll(e)){const t=parseXmlAttributes(s[1]);if(t.name==="basedir"){return t.value?.trim()||undefined}}return undefined}async function enrichReportWithJUnitSourceSnippets(t,e,s){const i=resolveOptions(s);const n=new Map;const a={sourceFilesByClassName:new Map,fileContentByPath:new Map};for(const t of e){const e=n.get(t.testName)??[];e.push(t);n.set(t.testName,e)}for(const e of t.results.tests){if(e.snippet){continue}const t=n.get(e.name)?.shift();if(!t){continue}const s=await resolveJavaSourceSnippet(t,i,a);if(!s){continue}e.filePath??=s.filePath;e.line??=s.line;e.snippet=s.snippet}}async function resolveJavaSourceSnippet(t,e,s){const i=await getCachedJavaSourceFiles(t.className,e,s);for(const n of i){const i=await tryExtractJavaMethod(n,t.testName,e,s);if(i){return i}}return undefined}function getCachedJavaSourceFiles(t,e,s){const i=`${e.sourceRoot}\0${t}`;let n=s.sourceFilesByClassName.get(i);if(!n){n=findJavaSourceFiles(t,e.sourceRoot);s.sourceFilesByClassName.set(i,n)}return n}async function findJavaSourceFiles(t,e){const s=t.split("$")[0];const i=s.split(".");const l=`${i.pop()}.java`;const h=i.join(a.default.sep);const u=[a.default.join(e,"src","test","java",h,l),a.default.join(e,"src","main","java",h,l)];const f=u.filter((t=>a.default.isAbsolute(t)));for(const t of f){try{await(0,n.readFile)(t,"utf-8");return[t]}catch{}}return findJavaFilesByName(e,l)}async function findJavaFilesByName(t,e){const s=[];async function visit(t){let i;try{i=await(0,n.readdir)(t,{withFileTypes:true})}catch{return}for(const n of i){const i=a.default.join(t,n.name);if(n.isDirectory()){const t=n.name.toLowerCase();if(t==="target"||t==="build"||t===".gradle"){continue}await visit(i);continue}if(n.isFile()&&n.name===e){s.push(i)}}}await visit(t);return s}async function tryExtractJavaMethod(t,e,s,i){const n=await getCachedJavaSourceContent(t,i);if(!n){return undefined}const a=extractJavaMethodBlock(n,e,s);return a?{filePath:t,...a}:undefined}function getCachedJavaSourceContent(t,e){let s=e.fileContentByPath.get(t);if(!s){s=(0,n.readFile)(t,"utf-8").catch((()=>undefined));e.fileContentByPath.set(t,s)}return s}function extractJavaMethodBlock(t,e,s){const i=t.split(/\r?\n/);const n=i.findIndex((t=>containsMethodSignatureName(t,e)));if(n<0){return undefined}const a=includeJavaAnnotations(i,n);const l=[];let h=0;let u=false;for(let t=a;t<i.length&&l.length<s.maxLines;t++){const e=i[t];l.push(e);for(const t of e){if(t==="{"){h++;u=true}else if(t==="}"){h--}}if(u&&h<=0){break}}const f=l.join("\n").trim();if(!f){return undefined}return{line:a+1,snippet:f.length<=s.maxChars?f:f.slice(0,s.maxChars)}}function includeJavaAnnotations(t,e){let s=e;while(s>0){const e=t[s-1].trim();if(!e.startsWith("@")){break}s--}return s}function containsMethodSignatureName(t,e){const s=t.indexOf(e);if(s<0){return false}const i=s===0?"":t[s-1];if(i&&isIdentifierChar(i)){return false}let n=s+e.length;while(n<t.length&&/\s/.test(t[n])){n++}if(t[n]!=="("){return false}const a=t.slice(0,s).trim();return a.length>0&&!a.endsWith(".")&&!a.endsWith("(")&&!a.endsWith("=")&&a!=="return"}function parseXmlAttributes(t){const e={};let s=0;while(s<t.length){while(s<t.length&&/\s/.test(t[s])){s++}const i=s;if(i>=t.length||!isXmlAttributeNameStart(t[i])){s++;continue}s++;while(s<t.length&&isXmlAttributeNameChar(t[s])){s++}const n=t.slice(i,s);while(s<t.length&&/\s/.test(t[s])){s++}if(t[s]!=="="){continue}s++;while(s<t.length&&/\s/.test(t[s])){s++}const a=t[s];if(a!=='"'&&a!=="'"){continue}s++;const l=s;while(s<t.length&&t[s]!==a){s++}if(s>=t.length){break}e[n]=decodeXmlEntity(t.slice(l,s));s++}return e}function resolveOptions(t){return{sourceRoot:a.default.resolve(t?.sourceRoot??process.cwd()),maxChars:normalizePositiveInt(t?.maxChars,l),maxLines:normalizePositiveInt(t?.maxLines,h)}}function normalizePositiveInt(t,e){return typeof t==="number"&&Number.isInteger(t)&&t>0?t:e}function isIdentifierChar(t){return/[A-Za-z0-9_]/.test(t)}function isXmlAttributeNameStart(t){return t!=null&&/[A-Za-z_]/.test(t)}function isXmlAttributeNameChar(t){return t!=null&&/[\w:.-]/.test(t)}function decodeXmlEntity(t){return t.replaceAll(""",'"').replaceAll("'","'").replaceAll("<","<").replaceAll(">",">").replaceAll("&","&")}},8010:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.detectGitContext=e.detectCIContext=void 0;e.uploadCtrfReport=uploadCtrfReport;const i=s(7322);Object.defineProperty(e,"detectCIContext",{enumerable:true,get:function(){return i.detectCIContext}});async function uploadCtrfReport(t){return(0,i.uploadTestRun)({report:t.report,apiKey:t.apiKey,apiUrl:t.apiUrl,branch:t.branch,commitSha:t.commitSha,repositoryUrl:t.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType})}e.detectGitContext=i.detectCIContext},2613:t=>{t.exports=require("assert")},9140:t=>{t.exports=require("constants")},4434:t=>{t.exports=require("events")},9896:t=>{t.exports=require("fs")},3053:t=>{t.exports=require("node:diagnostics_channel")},8474:t=>{t.exports=require("node:events")},3024:t=>{t.exports=require("node:fs")},1455:t=>{t.exports=require("node:fs/promises")},6760:t=>{t.exports=require("node:path")},7075:t=>{t.exports=require("node:stream")},6193:t=>{t.exports=require("node:string_decoder")},3136:t=>{t.exports=require("node:url")},6928:t=>{t.exports=require("path")},2203:t=>{t.exports=require("stream")},3557:t=>{t.exports=require("timers")},9023:t=>{t.exports=require("util")},8809:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Glob=void 0;const i=s(6647);const n=s(3136);const a=s(5125);const l=s(2841);const h=s(6089);const u=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,e){if(!e)throw new TypeError("glob options required");this.withFileTypes=!!e.withFileTypes;this.signal=e.signal;this.follow=!!e.follow;this.dot=!!e.dot;this.dotRelative=!!e.dotRelative;this.nodir=!!e.nodir;this.mark=!!e.mark;if(!e.cwd){this.cwd=""}else if(e.cwd instanceof URL||e.cwd.startsWith("file://")){e.cwd=(0,n.fileURLToPath)(e.cwd)}this.cwd=e.cwd||"";this.root=e.root;this.magicalBraces=!!e.magicalBraces;this.nobrace=!!e.nobrace;this.noext=!!e.noext;this.realpath=!!e.realpath;this.absolute=e.absolute;this.includeChildMatches=e.includeChildMatches!==false;this.noglobstar=!!e.noglobstar;this.matchBase=!!e.matchBase;this.maxDepth=typeof e.maxDepth==="number"?e.maxDepth:Infinity;this.stat=!!e.stat;this.ignore=e.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof t==="string"){t=[t]}this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){t=t.map((t=>t.replace(/\\/g,"/")))}if(this.matchBase){if(e.noglobstar){throw new TypeError("base matching requires globstar")}t=t.map((t=>t.includes("/")?t:`./**/${t}`))}this.pattern=t;this.platform=e.platform||u;this.opts={...e,platform:this.platform};if(e.scurry){this.scurry=e.scurry;if(e.nocase!==undefined&&e.nocase!==e.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const t=e.platform==="win32"?a.PathScurryWin32:e.platform==="darwin"?a.PathScurryDarwin:e.platform?a.PathScurryPosix:a.PathScurry;this.scurry=new t(this.cwd,{nocase:e.nocase,fs:e.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const h={...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const f=this.pattern.map((t=>new i.Minimatch(t,h)));const[p,g]=f.reduce(((t,e)=>{t[0].push(...e.set);t[1].push(...e.globParts);return t}),[[],[]]);this.patterns=p.map(((t,e)=>{const s=g[e];if(!s)throw new Error("invalid pattern object");return new l.Pattern(t,s,0,this.platform)}))}async walk(){return[...await new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new h.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new h.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}e.Glob=Glob},6233:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.hasMagic=void 0;const i=s(6647);const hasMagic=(t,e={})=>{if(!Array.isArray(t)){t=[t]}for(const s of t){if(new i.Minimatch(s,e).hasMagic())return true}return false};e.hasMagic=hasMagic},6449:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Ignore=void 0;const i=s(6647);const n=s(2841);const a=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:s,noext:i,noglobstar:n,platform:l=a}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=l;this.mmopts={dot:true,nobrace:e,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:l,nocomment:true,nonegate:true};for(const e of t)this.add(e)}add(t){const e=new i.Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const s=e.set[t];const a=e.globParts[t];if(!s||!a){throw new Error("invalid pattern object")}while(s[0]==="."&&a[0]==="."){s.shift();a.shift()}const l=new n.Pattern(s,a,0,this.platform);const h=new i.Minimatch(l.globString(),this.mmopts);const u=a[a.length-1]==="**";const f=l.isAbsolute();if(f)this.absolute.push(h);else this.relative.push(h);if(u){if(f)this.absoluteChildren.push(h);else this.relativeChildren.push(h)}}}ignored(t){const e=t.fullpath();const s=`${e}/`;const i=t.relative()||".";const n=`${i}/`;for(const t of this.relative){if(t.match(i)||t.match(n))return true}for(const t of this.absolute){if(t.match(e)||t.match(s))return true}return false}childrenIgnored(t){const e=t.fullpath()+"/";const s=(t.relative()||".")+"/";for(const t of this.relativeChildren){if(t.match(s))return true}for(const t of this.absoluteChildren){if(t.match(e))return true}return false}}e.Ignore=Ignore},447:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.glob=e.sync=e.iterate=e.iterateSync=e.stream=e.streamSync=e.Ignore=e.hasMagic=e.Glob=e.unescape=e.escape=void 0;e.globStreamSync=globStreamSync;e.globStream=globStream;e.globSync=globSync;e.globIterateSync=globIterateSync;e.globIterate=globIterate;const i=s(6647);const n=s(8809);const a=s(6233);var l=s(6647);Object.defineProperty(e,"escape",{enumerable:true,get:function(){return l.escape}});Object.defineProperty(e,"unescape",{enumerable:true,get:function(){return l.unescape}});var h=s(8809);Object.defineProperty(e,"Glob",{enumerable:true,get:function(){return h.Glob}});var u=s(6233);Object.defineProperty(e,"hasMagic",{enumerable:true,get:function(){return u.hasMagic}});var f=s(6449);Object.defineProperty(e,"Ignore",{enumerable:true,get:function(){return f.Ignore}});function globStreamSync(t,e={}){return new n.Glob(t,e).streamSync()}function globStream(t,e={}){return new n.Glob(t,e).stream()}function globSync(t,e={}){return new n.Glob(t,e).walkSync()}async function glob_(t,e={}){return new n.Glob(t,e).walk()}function globIterateSync(t,e={}){return new n.Glob(t,e).iterateSync()}function globIterate(t,e={}){return new n.Glob(t,e).iterate()}e.streamSync=globStreamSync;e.stream=Object.assign(globStream,{sync:globStreamSync});e.iterateSync=globIterateSync;e.iterate=Object.assign(globIterate,{sync:globIterateSync});e.sync=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});e.glob=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:e.sync,globStream:globStream,stream:e.stream,globStreamSync:globStreamSync,streamSync:e.streamSync,globIterate:globIterate,iterate:e.iterate,globIterateSync:globIterateSync,iterateSync:e.iterateSync,Glob:n.Glob,hasMagic:a.hasMagic,escape:i.escape,unescape:i.unescape});e.glob.glob=e.glob},2841:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Pattern=void 0;const i=s(6647);const isPatternList=t=>t.length>=1;const isGlobList=t=>t.length>=1;class Pattern{#t;#e;#s;length;#i;#r;#n;#o;#a;#l;#h=true;constructor(t,e,s,i){if(!isPatternList(t)){throw new TypeError("empty pattern list")}if(!isGlobList(e)){throw new TypeError("empty glob list")}if(e.length!==t.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=t.length;if(s<0||s>=this.length){throw new TypeError("index out of range")}this.#t=t;this.#e=e;this.#s=s;this.#i=i;if(this.#s===0){if(this.isUNC()){const[t,e,s,i,...n]=this.#t;const[a,l,h,u,...f]=this.#e;if(n[0]===""){n.shift();f.shift()}const p=[t,e,s,i,""].join("/");const g=[a,l,h,u,""].join("/");this.#t=[p,...n];this.#e=[g,...f];this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#t;const[s,...i]=this.#e;if(e[0]===""){e.shift();i.shift()}const n=t+"/";const a=s+"/";this.#t=[n,...e];this.#e=[a,...i];this.length=this.#t.length}}}pattern(){return this.#t[this.#s]}isString(){return typeof this.#t[this.#s]==="string"}isGlobstar(){return this.#t[this.#s]===i.GLOBSTAR}isRegExp(){return this.#t[this.#s]instanceof RegExp}globString(){return this.#n=this.#n||(this.#s===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#s).join("/"))}hasMore(){return this.length>this.#s+1}rest(){if(this.#r!==undefined)return this.#r;if(!this.hasMore())return this.#r=null;this.#r=new Pattern(this.#t,this.#e,this.#s+1,this.#i);this.#r.#l=this.#l;this.#r.#a=this.#a;this.#r.#o=this.#o;return this.#r}isUNC(){const t=this.#t;return this.#a!==undefined?this.#a:this.#a=this.#i==="win32"&&this.#s===0&&t[0]===""&&t[1]===""&&typeof t[2]==="string"&&!!t[2]&&typeof t[3]==="string"&&!!t[3]}isDrive(){const t=this.#t;return this.#o!==undefined?this.#o:this.#o=this.#i==="win32"&&this.#s===0&&this.length>1&&typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#t;return this.#l!==undefined?this.#l:this.#l=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#t[0];return typeof t==="string"&&this.isAbsolute()&&this.#s===0?t:""}checkFollowGlobstar(){return!(this.#s===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){if(this.#s===0||!this.isGlobstar()||!this.#h)return false;this.#h=false;return true}}e.Pattern=Pattern},7999:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;const i=s(6647);class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const s=t.fullpath();const i=this.store.get(s);if(i)i.add(e.globString());else this.store.set(s,new Set([e.globString()]))}}e.HasWalkedCache=HasWalkedCache;class MatchRecord{store=new Map;add(t,e,s){const i=(e?2:0)|(s?1:0);const n=this.store.get(t);this.store.set(t,n===undefined?i:i&n)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(e&2),!!(e&1)]))}}e.MatchRecord=MatchRecord;class SubWalks{store=new Map;add(t,e){if(!t.canReaddir()){return}const s=this.store.get(t);if(s){if(!s.find((t=>t.globString()===e.globString()))){s.push(e)}}else this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e){throw new Error("attempting to walk unknown path")}return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}e.SubWalks=SubWalks;class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t;this.follow=!!t.follow;this.dot=!!t.dot;this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const s=e.map((e=>[t,e]));for(let[t,e]of s){this.hasWalkedCache.storeWalked(t,e);const s=e.root();const n=e.isAbsolute()&&this.opts.absolute!==false;if(s){t=t.resolve(s==="/"&&this.opts.root!==undefined?this.opts.root:s);const i=e.rest();if(!i){this.matches.add(t,true,false);continue}else{e=i}}if(t.isENOENT())continue;let a;let l;let h=false;while(typeof(a=e.pattern())==="string"&&(l=e.rest())){const s=t.resolve(a);t=s;e=l;h=true}a=e.pattern();l=e.rest();if(h){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if(typeof a==="string"){const e=a===".."||a===""||a===".";this.matches.add(t.resolve(a),n,e);continue}else if(a===i.GLOBSTAR){if(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar()){this.subwalks.add(t,e)}const s=l?.pattern();const i=l?.rest();if(!l||(s===""||s===".")&&!i){this.matches.add(t,n,s===""||s===".")}else{if(s===".."){const e=t.parent||t;if(!i)this.matches.add(e,n,true);else if(!this.hasWalkedCache.hasWalked(e,i)){this.subwalks.add(e,i)}}}}else if(a instanceof RegExp){this.subwalks.add(t,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const s=this.subwalks.get(t);const n=this.child();for(const t of e){for(const e of s){const s=e.isAbsolute();const a=e.pattern();const l=e.rest();if(a===i.GLOBSTAR){n.testGlobstar(t,e,l,s)}else if(a instanceof RegExp){n.testRegExp(t,a,l,s)}else{n.testString(t,a,l,s)}}}return n}testGlobstar(t,e,s,i){if(this.dot||!t.name.startsWith(".")){if(!e.hasMore()){this.matches.add(t,i,false)}if(t.canReaddir()){if(this.follow||!t.isSymbolicLink()){this.subwalks.add(t,e)}else if(t.isSymbolicLink()){if(s&&e.checkFollowGlobstar()){this.subwalks.add(t,s)}else if(e.markFollowGlobstar()){this.subwalks.add(t,e)}}}}if(s){const e=s.pattern();if(typeof e==="string"&&e!==".."&&e!==""&&e!=="."){this.testString(t,e,s.rest(),i)}else if(e===".."){const e=t.parent||t;this.subwalks.add(e,s)}else if(e instanceof RegExp){this.testRegExp(t,e,s.rest(),i)}}}testRegExp(t,e,s,i){if(!e.test(t.name))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}testString(t,e,s,i){if(!t.isNamed(e))return;if(!s){this.matches.add(t,i,false)}else{this.subwalks.add(t,s)}}}e.Processor=Processor},6089:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;const i=s(1031);const n=s(6449);const a=s(7999);const makeIgnore=(t,e)=>typeof t==="string"?new n.Ignore([t],e):Array.isArray(t)?new n.Ignore(t,e):t;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#c=[];#u;#f;signal;maxDepth;includeChildMatches;constructor(t,e,s){this.patterns=t;this.path=e;this.opts=s;this.#f=!s.posix&&s.platform==="win32"?"\\":"/";this.includeChildMatches=s.includeChildMatches!==false;if(s.ignore||!this.includeChildMatches){this.#u=makeIgnore(s.ignore??[],s);if(!this.includeChildMatches&&typeof this.#u.add!=="function"){const t="cannot ignore child matches, ignore lacks add() method.";throw new Error(t)}}this.maxDepth=s.maxDepth||Infinity;if(s.signal){this.signal=s.signal;this.signal.addEventListener("abort",(()=>{this.#c.length=0}))}}#p(t){return this.seen.has(t)||!!this.#u?.ignored?.(t)}#d(t){return!!this.#u?.childrenIgnored?.(t)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let t=undefined;while(!this.paused&&(t=this.#c.shift())){t()}}onResume(t){if(this.signal?.aborted)return;if(!this.paused){t()}else{this.#c.push(t)}}async matchCheck(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||await t.realpath();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const n=i?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=await n.realpath();if(t&&(t.isUnknown()||this.opts.stat)){await t.lstat()}}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===Infinity||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#p(t)?t:undefined}matchCheckSync(t,e){if(e&&this.opts.nodir)return undefined;let s;if(this.opts.realpath){s=t.realpathCached()||t.realpathSync();if(!s)return undefined;t=s}const i=t.isUnknown()||this.opts.stat;const n=i?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=n.realpathSync();if(t&&(t?.isUnknown()||this.opts.stat)){t.lstatSync()}}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#p(t))return;if(!this.includeChildMatches&&this.#u?.add){const e=`${t.relativePosix()}/**`;this.#u.add(e)}const s=this.opts.absolute===undefined?e:this.opts.absolute;this.seen.add(t);const i=this.opts.mark&&t.isDirectory()?this.#f:"";if(this.opts.withFileTypes){this.matchEmit(t)}else if(s){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+i)}else{const e=this.opts.posix?t.relativePosix():t.relative();const s=this.opts.dotRelative&&!e.startsWith(".."+this.#f)?"."+this.#f:"";this.matchEmit(!e?"."+i:s+e+i)}}async match(t,e,s){const i=await this.matchCheck(t,s);if(i)this.matchFinish(i,e)}matchSync(t,e,s){const i=this.matchCheckSync(t,s);if(i)this.matchFinish(i,e)}walkCB(t,e,s){if(this.signal?.aborted)s();this.walkCB2(t,e,new a.Processor(this.opts),s)}walkCB2(t,e,s,i){if(this.#d(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2(t,e,s,i)));return}s.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#p(t))continue;n++;this.match(t,e,i).then((()=>next()))}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirCached();if(t.calledReaddir())this.walkCB3(t,e,s,next);else{t.readdirCB(((e,i)=>this.walkCB3(t,i,s,next)),true)}}next()}walkCB3(t,e,s,i){s=s.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#p(t))continue;n++;this.match(t,e,i).then((()=>next()))}for(const[t,e]of s.subwalks.entries()){n++;this.walkCB2(t,e,s.child(),next)}next()}walkCBSync(t,e,s){if(this.signal?.aborted)s();this.walkCB2Sync(t,e,new a.Processor(this.opts),s)}walkCB2Sync(t,e,s,i){if(this.#d(t))return i();if(this.signal?.aborted)i();if(this.paused){this.onResume((()=>this.walkCB2Sync(t,e,s,i)));return}s.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#p(t))continue;this.matchSync(t,e,i)}for(const t of s.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirSync();this.walkCB3Sync(t,e,s,next)}next()}walkCB3Sync(t,e,s,i){s=s.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)i()};for(const[t,e,i]of s.matches.entries()){if(this.#p(t))continue;this.matchSync(t,e,i)}for(const[t,e]of s.subwalks.entries()){n++;this.walkCB2Sync(t,e,s.child(),next)}next()}}e.GlobUtil=GlobUtil;class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,s){super(t,e,s)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){e(this.signal.reason)}else{t(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}e.GlobWalker=GlobWalker;class GlobStream extends GlobUtil{results;constructor(t,e,s){super(t,e,s);this.results=new i.Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t);if(!this.results.flowing)this.pause()}stream(){const t=this.path;if(t.isUnknown()){t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(t,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}e.GlobStream=GlobStream},8548:(t,e,s)=>{var j=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var i=j((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.tracing=t.metrics=void 0;var e=s(3053);t.metrics=(0,e.channel)("lru-cache:metrics");t.tracing=(0,e.tracingChannel)("lru-cache")}));var n=j((t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.defaultPerf=void 0;t.defaultPerf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date}));Object.defineProperty(e,"__esModule",{value:!0});e.LRUCache=void 0;var a=i(),l=n(),C=()=>a.metrics.hasSubscribers||a.tracing.hasSubscribers,h=new Set,u=typeof process=="object"&&process?process:{},V=(t,e,s,i)=>{typeof u.emitWarning=="function"?u.emitWarning(t,e,s,i):console.error(`[${s}] ${e}: ${t}`)},q=t=>!h.has(t);var T=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),H=t=>T(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?f:null:null,f=class extends Array{constructor(t){super(t),this.fill(0)}},p=class c{heap;length;static#m=!1;static create(t){let e=H(t);if(!e)return[];c.#m=!0;let s=new c(t,e);return c.#m=!1,s}constructor(t,e){if(!c.#m)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},g=class c{#m;#g;#y;#b;#w;#S;#v;#_;get perf(){return this.#_}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#C;#x;#T;#E;#R;#P;#k;#O;#I;#A;#M;#U;#N;#B;#L;#F;#j;#W;#D;static unsafeExposeInternals(t){return{starts:t.#N,ttls:t.#B,autopurgeTimers:t.#L,sizes:t.#U,keyMap:t.#T,keyList:t.#E,valList:t.#R,next:t.#P,prev:t.#k,get head(){return t.#O},get tail(){return t.#I},free:t.#A,isBackgroundFetch:e=>t.#G(e),backgroundFetch:(e,s,i,n)=>t.#z(e,s,i,n),moveToTail:e=>t.#$(e),indexes:e=>t.#J(e),rindexes:e=>t.#q(e),isStale:e=>t.#H(e)}}get max(){return this.#m}get maxSize(){return this.#g}get calculatedSize(){return this.#x}get size(){return this.#C}get fetchMethod(){return this.#S}get memoMethod(){return this.#v}get dispose(){return this.#y}get onInsert(){return this.#b}get disposeAfter(){return this.#w}constructor(t){let{max:e=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:u,allowStale:f,dispose:g,onInsert:b,disposeAfter:w,noDisposeOnSet:S,noUpdateTTL:v,maxSize:x=0,maxEntrySize:E=0,sizeCalculation:R,fetchMethod:P,memoMethod:k,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:A,allowStaleOnFetchAbort:M,ignoreFetchAbort:U,backgroundFetchSize:N=1,perf:B}=t;if(this.backgroundFetchSize=N,B!==void 0&&typeof B?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#_=B??l.defaultPerf,e!==0&&!T(e))throw new TypeError("max option must be a nonnegative integer");let L=e?H(e):Array;if(!L)throw new Error("invalid max value: "+e);if(this.#m=e,this.#g=x,this.maxEntrySize=E||this.#g,this.sizeCalculation=R,this.sizeCalculation){if(!this.#g&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(k!==void 0&&typeof k!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=k,P!==void 0&&typeof P!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#S=P,this.#j=!!P,this.#T=new Map,this.#E=Array.from({length:e}).fill(void 0),this.#R=Array.from({length:e}).fill(void 0),this.#P=new L(e),this.#k=new L(e),this.#O=0,this.#I=0,this.#A=p.create(e),this.#C=0,this.#x=0,typeof g=="function"&&(this.#y=g),typeof b=="function"&&(this.#b=b),typeof w=="function"?(this.#w=w,this.#M=[]):(this.#w=void 0,this.#M=void 0),this.#F=!!this.#y,this.#D=!!this.#b,this.#W=!!this.#w,this.noDisposeOnSet=!!S,this.noUpdateTTL=!!v,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!A,this.allowStaleOnFetchAbort=!!M,this.ignoreFetchAbort=!!U,this.maxEntrySize!==0){if(this.#g!==0&&!T(this.#g))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!u,this.ttlResolution=T(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#K()}if(this.#m===0&&this.ttl===0&&this.#g===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#m&&!this.#g){let t="LRU_CACHE_UNBOUNDED";q(t)&&(h.add(t),V("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,c))}}getRemainingTTL(t){return this.#T.has(t)?1/0:0}#K(){let t=new f(this.#m),e=new f(this.#m);this.#B=t,this.#N=e;let s=this.ttlAutopurge?Array.from({length:this.#m}):void 0;this.#L=s,this.#X=(s,n,a=this.#_.now())=>{e[s]=n!==0?a:0,t[s]=n,i(s,n)},this.#Y=s=>{e[s]=t[s]!==0?this.#_.now():0,i(s,t[s])};let i=this.ttlAutopurge?(t,e)=>{if(s?.[t]&&(clearTimeout(s[t]),s[t]=void 0),e&&e!==0&&s){let i=setTimeout((()=>{this.#H(t)&&this.#Q(this.#E[t],"expire")}),e+1);i.unref&&i.unref(),s[t]=i}}:()=>{};this.#Z=(s,i)=>{if(t[i]){let a=t[i],l=e[i];if(!a||!l)return;s.ttl=a,s.start=l,s.now=n||r();let h=s.now-l;s.remainingTTL=a-h}};let n=0,r=()=>{let t=this.#_.now();if(this.ttlResolution>0){n=t;let e=setTimeout((()=>n=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=s=>{let i=this.#T.get(s);if(i===void 0)return 0;let a=t[i],l=e[i];if(!a||!l)return 1/0;let h=(n||r())-l;return a-h},this.#H=s=>{let i=e[s],a=t[s];return!!a&&!!i&&(n||r())-i>a}}#Y=()=>{};#Z=()=>{};#X=()=>{};#H=()=>!1;#V(){let t=new f(this.#m);this.#x=0,this.#U=t,this.#tt=e=>{this.#x-=t[e],t[e]=0},this.#et=(t,e,s,i)=>{if(!T(s)){if(this.#G(e))return this.backgroundFetchSize;if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(e,t),!T(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return s},this.#st=(e,s,i)=>{if(t[e]=s,this.#g){let s=this.#g-t[e];for(;this.#x>s;)this.#it(!0)}this.#x+=t[e],i&&(i.entrySize=s,i.totalCalculatedSize=this.#x)}}#tt=t=>{};#st=(t,e,s)=>{};#et=(t,e,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#J({allowStale:t=this.allowStale}={}){if(this.#C)for(let e=this.#I;this.#rt(e)&&((t||!this.#H(e))&&(yield e),e!==this.#O);)e=this.#k[e]}*#q({allowStale:t=this.allowStale}={}){if(this.#C)for(let e=this.#O;this.#rt(e)&&((t||!this.#H(e))&&(yield e),e!==this.#I);)e=this.#P[e]}#rt(t){return t!==void 0&&this.#T.get(this.#E[t])===t}*entries(){for(let t of this.#J())this.#R[t]!==void 0&&this.#E[t]!==void 0&&!this.#G(this.#R[t])&&(yield[this.#E[t],this.#R[t]])}*rentries(){for(let t of this.#q())this.#R[t]!==void 0&&this.#E[t]!==void 0&&!this.#G(this.#R[t])&&(yield[this.#E[t],this.#R[t]])}*keys(){for(let t of this.#J()){let e=this.#E[t];e!==void 0&&!this.#G(this.#R[t])&&(yield e)}}*rkeys(){for(let t of this.#q()){let e=this.#E[t];e!==void 0&&!this.#G(this.#R[t])&&(yield e)}}*values(){for(let t of this.#J())this.#R[t]!==void 0&&!this.#G(this.#R[t])&&(yield this.#R[t])}*rvalues(){for(let t of this.#q())this.#R[t]!==void 0&&!this.#G(this.#R[t])&&(yield this.#R[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(let s of this.#J()){let i=this.#R[s],n=this.#G(i)?i.__staleWhileFetching:i;if(n!==void 0&&t(n,this.#E[s],this))return this.#nt(this.#E[s],e)}}forEach(t,e=this){for(let s of this.#J()){let i=this.#R[s],n=this.#G(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#E[s],this)}}rforEach(t,e=this){for(let s of this.#q()){let i=this.#R[s],n=this.#G(i)?i.__staleWhileFetching:i;n!==void 0&&t.call(e,n,this.#E[s],this)}}purgeStale(){let t=!1;for(let e of this.#q({allowStale:!0}))this.#H(e)&&(this.#Q(this.#E[e],"expire"),t=!0);return t}info(t){let e=this.#T.get(t);if(e===void 0)return;let s=this.#R[e],i=this.#G(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#B&&this.#N){let t=this.#B[e],s=this.#N[e];if(t&&s){let e=t-(this.#_.now()-s);n.ttl=e,n.start=Date.now()}}return this.#U&&(n.size=this.#U[e]),n}dump(){let t=[];for(let e of this.#J({allowStale:!0})){let s=this.#E[e],i=this.#R[e],n=this.#G(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let a={value:n};if(this.#B&&this.#N){a.ttl=this.#B[e];let t=this.#_.now()-this.#N[e];a.start=Math.floor(Date.now()-t)}this.#U&&(a.size=this.#U[e]),t.unshift([s,a])}return t}load(t){this.clear();for(let[e,s]of t){if(s.start){let t=Date.now()-s.start;s.start=this.#_.now()-t}this.#ot(e,s.value,s)}}set(t,e,s={}){let{status:i=(a.metrics.hasSubscribers?{}:void 0)}=s;s.status=i,i&&(i.op="set",i.key=t,e!==void 0&&(i.value=e),i.cache=this);let n=this.#ot(t,e,s);return i&&a.metrics.hasSubscribers&&a.metrics.publish(i),n}#ot(t,e,s,i){let{ttl:n=this.ttl,start:a,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:h=this.sizeCalculation,status:u}=s,f=this.#G(e);if(e===void 0)return u&&(u.set="deleted"),this.delete(t),this;let{noUpdateTTL:p=this.noUpdateTTL}=s;u&&!f&&(u.value=e);let g=this.#et(t,e,s.size||0,h,u);if(this.maxEntrySize&&g>this.maxEntrySize)return this.#Q(t,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let b=this.#C===0?void 0:this.#T.get(t);if(b===void 0)b=this.#C===0?this.#I:this.#A.length!==0?this.#A.pop():this.#C===this.#m?this.#it(!1):this.#C,this.#E[b]=t,this.#R[b]=e,this.#T.set(t,b),this.#P[this.#I]=b,this.#k[b]=this.#I,this.#I=b,this.#C++,this.#st(b,g,u),u&&(u.set="add"),p=!1,this.#D&&!f&&this.#b?.(e,t,"add");else{this.#$(b);let s=this.#R[b];if(e!==s){if(!l)if(this.#G(s)){s!==i&&s.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:n}=s;n!==void 0&&n!==e&&(this.#F&&this.#y?.(n,t,"set"),this.#W&&this.#M?.push([n,t,"set"]))}else this.#F&&this.#y?.(s,t,"set"),this.#W&&this.#M?.push([s,t,"set"]);if(this.#tt(b),this.#st(b,g,u),this.#R[b]=e,!f){let i=s&&this.#G(s)?s.__staleWhileFetching:s,n=i===void 0?"add":e!==i?"replace":"update";u&&(u.set=n,i!==void 0&&(u.oldValue=i)),this.#D&&this.onInsert?.(e,t,n)}}else f||(u&&(u.set="update"),this.#D&&this.onInsert?.(e,t,"update"))}if(n!==0&&!this.#B&&this.#K(),this.#B&&(p||this.#X(b,n,a),u&&this.#Z(u,b)),!l&&this.#W&&this.#M){let t=this.#M,e;for(;e=t?.shift();)this.#w?.(...e)}return this}pop(){try{for(;this.#C;){let t=this.#R[this.#O];if(this.#it(!0),this.#G(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(this.#W&&this.#M){let t=this.#M,e;for(;e=t?.shift();)this.#w?.(...e)}}}#it(t){let e=this.#O,s=this.#E[e],i=this.#R[e],n=this.#G(i);n&&i.__abortController.abort(new Error("evicted"));let a=n?i.__staleWhileFetching:i;return(this.#F||this.#W)&&a!==void 0&&(this.#F&&this.#y?.(a,s,"evict"),this.#W&&this.#M?.push([a,s,"evict"])),this.#tt(e),this.#L?.[e]&&(clearTimeout(this.#L[e]),this.#L[e]=void 0),t&&(this.#E[e]=void 0,this.#R[e]=void 0,this.#A.push(e)),this.#C===1?(this.#O=this.#I=0,this.#A.length=0):this.#O=this.#P[e],this.#T.delete(s),this.#C--,e}has(t,e={}){let{status:s=(a.metrics.hasSubscribers?{}:void 0)}=e;e.status=s,s&&(s.op="has",s.key=t,s.cache=this);let i=this.#at(t,e);return a.metrics.hasSubscribers&&a.metrics.publish(s),i}#at(t,e={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=e,n=this.#T.get(t);if(n!==void 0){let t=this.#R[n];if(this.#G(t)&&t.__staleWhileFetching===void 0)return!1;if(this.#H(n))i&&(i.has="stale",this.#Z(i,n));else return s&&this.#Y(n),i&&(i.has="hit",this.#Z(i,n)),!0}else i&&(i.has="miss");return!1}peek(t,e={}){let{status:s=(C()?{}:void 0)}=e;s&&(s.op="peek",s.key=t,s.cache=this),e.status=s;let i=this.#lt(t,e);return a.metrics.hasSubscribers&&a.metrics.publish(s),i}#lt(t,e){let{status:s,allowStale:i=this.allowStale}=e,n=this.#T.get(t);if(n===void 0||!i&&this.#H(n)){s&&(s.peek=n===void 0?"miss":"stale");return}let a=this.#R[n],l=this.#G(a)?a.__staleWhileFetching:a;return s&&(l!==void 0?(s.peek="hit",s.value=l):s.peek="miss"),l}#z(t,e,s,i){let n=e===void 0?void 0:this.#R[e];if(this.#G(n))return n;let a=new AbortController,{signal:l}=s;l?.addEventListener("abort",(()=>a.abort(l.reason)),{signal:a.signal});let h={signal:a.signal,options:s,context:i},o=(i,n=!1)=>{let{aborted:l}=a.signal,f=s.ignoreFetchAbort&&i!==void 0,p=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&i!==void 0);if(s.status&&(l&&!n?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,f&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),l&&!f&&!n)return _(a.signal.reason,p);let g=u,b=this.#R[e];return(b===u||b===void 0&&f&&n)&&(i===void 0?g.__staleWhileFetching!==void 0?this.#R[e]=g.__staleWhileFetching:this.#Q(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.#ot(t,i,h.options,g))),i},d=t=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=t),_(t,!1)),_=(i,n)=>{let{aborted:l}=a.signal,h=l&&s.allowStaleOnFetchAbort,f=h||s.allowStaleOnFetchRejection,p=f||s.noDeleteOnFetchRejection,g=u;if(this.#R[e]===u&&(!p||!n&&g.__staleWhileFetching===void 0?this.#Q(t,"fetch"):h||(this.#R[e]=g.__staleWhileFetching)),f)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),g.__staleWhileFetching;if(g.__returned===g)throw i},y=(e,i)=>{let l=this.#S?.(t,n,h);a.signal.addEventListener("abort",(()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(e(void 0),s.allowStaleOnFetchAbort&&(e=t=>o(t,!0)))})),l&&l instanceof Promise?l.then((t=>e(t===void 0?void 0:t)),i):l!==void 0&&e(l)};s.status&&(s.status.fetchDispatched=!0);let u=new Promise(y).then(o,d),f=Object.assign(u,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return e===void 0?(this.#ot(t,f,{...h.options,status:void 0}),e=this.#T.get(t)):this.#R[e]=f,f}#G(t){if(!this.#j)return!1;let e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof AbortController}fetch(t,e={}){let s=a.tracing.hasSubscribers,{status:i=(C()?{}:void 0)}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#ht(t,e);return i&&s&&(i.trace=!0,a.tracing.tracePromise((()=>n),i).catch((()=>{}))),n}async#ht(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:h=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:S,forceRefresh:v=!1,status:x,signal:E}=e;if(x&&(x.op="fetch",x.key=t,v&&(x.forceRefresh=!0),x.cache=this),!this.#j)return x&&(x.fetch="get"),this.#nt(t,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:x});let R={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:l,size:h,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:w,ignoreFetchAbort:b,status:x,signal:E},P=this.#T.get(t);if(P===void 0){x&&(x.fetch="miss");let e=this.#z(t,P,R,S);return e.__returned=e}else{let e=this.#R[P];if(this.#G(e)){let t=s&&e.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",t&&(x.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}let n=this.#H(P);if(!v&&!n)return x&&(x.fetch="hit"),this.#$(P),i&&this.#Y(P),x&&this.#Z(x,P),e;let a=this.#z(t,P,R,S),l=a.__staleWhileFetching!==void 0&&s;return x&&(x.fetch=n?"stale":"refresh",l&&n&&(x.returnedStale=!0)),l?a.__staleWhileFetching:a.__returned=a}}forceFetch(t,e={}){let s=a.tracing.hasSubscribers,{status:i=(C()?{}:void 0)}=e;e.status=i,i&&e.context&&(i.context=e.context);let n=this.#ct(t,e);return i&&s&&(i.trace=!0,a.tracing.tracePromise((()=>n),i).catch((()=>{}))),n}async#ct(t,e={}){let s=await this.#ht(t,e);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,e={}){let{status:s=(a.metrics.hasSubscribers?{}:void 0)}=e;e.status=s,s&&(s.op="memo",s.key=t,e.context&&(s.context=e.context),s.cache=this);let i=this.#ut(t,e);return s&&(s.value=i),a.metrics.hasSubscribers&&a.metrics.publish(s),i}#ut(t,e={}){let s=this.#v;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,status:n,forceRefresh:a,...l}=e;n&&a&&(n.forceRefresh=!0);let h=this.#nt(t,l),u=a||h===void 0;if(n&&(n.memo=u?"miss":"hit",u||(n.value=h)),!u)return h;let f=s(t,h,{options:l,context:i});return n&&(n.value=f),this.#ot(t,f,l),f}get(t,e={}){let{status:s=(a.metrics.hasSubscribers?{}:void 0)}=e;e.status=s,s&&(s.op="get",s.key=t,s.cache=this);let i=this.#nt(t,e);return s&&(i!==void 0&&(s.value=i),a.metrics.hasSubscribers&&a.metrics.publish(s)),i}#nt(t,e={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=e,l=this.#T.get(t);if(l===void 0){a&&(a.get="miss");return}let h=this.#R[l],u=this.#G(h);return a&&this.#Z(a,l),this.#H(l)?u?(a&&(a.get="stale-fetching"),s&&h.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),h.__staleWhileFetching):void 0):(n||this.#Q(t,"expire"),a&&(a.get="stale"),s?(a&&(a.returnedStale=!0),h):void 0):(a&&(a.get=u?"fetching":"hit"),this.#$(l),i&&this.#Y(l),u?h.__staleWhileFetching:h)}#ft(t,e){this.#k[e]=t,this.#P[t]=e}#$(t){t!==this.#I&&(t===this.#O?this.#O=this.#P[t]:this.#ft(this.#k[t],this.#P[t]),this.#ft(this.#I,t),this.#I=t)}delete(t){return this.#Q(t,"delete")}#Q(t,e){a.metrics.hasSubscribers&&a.metrics.publish({op:"delete",delete:e,key:t,cache:this});let s=!1;if(this.#C!==0){let i=this.#T.get(t);if(i!==void 0)if(this.#L?.[i]&&(clearTimeout(this.#L?.[i]),this.#L[i]=void 0),s=!0,this.#C===1)this.#pt(e);else{this.#tt(i);let s=this.#R[i];if(this.#G(s)?s.__abortController.abort(new Error("deleted")):(this.#F||this.#W)&&(this.#F&&this.#y?.(s,t,e),this.#W&&this.#M?.push([s,t,e])),this.#T.delete(t),this.#E[i]=void 0,this.#R[i]=void 0,i===this.#I)this.#I=this.#k[i];else if(i===this.#O)this.#O=this.#P[i];else{let t=this.#k[i];this.#P[t]=this.#P[i];let e=this.#P[i];this.#k[e]=this.#k[i]}this.#C--,this.#A.push(i)}}if(this.#W&&this.#M?.length){let t=this.#M,e;for(;e=t?.shift();)this.#w?.(...e)}return s}clear(){return this.#pt("delete")}#pt(t){for(let e of this.#q({allowStale:!0})){let s=this.#R[e];if(this.#G(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#E[e];this.#F&&this.#y?.(s,i,t),this.#W&&this.#M?.push([s,i,t])}}if(this.#T.clear(),this.#R.fill(void 0),this.#E.fill(void 0),this.#B&&this.#N){this.#B.fill(0),this.#N.fill(0);for(let t of this.#L??[])t!==void 0&&clearTimeout(t);this.#L?.fill(void 0)}if(this.#U&&this.#U.fill(0),this.#O=0,this.#I=0,this.#A.length=0,this.#x=0,this.#C=0,this.#W&&this.#M){let t=this.#M,e;for(;e=t?.shift();)this.#w?.(...e)}}};e.LRUCache=g},557:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.assertValidPattern=void 0;const s=1024*64;const assertValidPattern=t=>{if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>s){throw new TypeError("pattern is too long")}};e.assertValidPattern=assertValidPattern},8743:(t,e,s)=>{var i;Object.defineProperty(e,"__esModule",{value:true});e.AST=void 0;const n=s(6694);const a=s(7967);const l=new Set(["!","?","+","*","@"]);const isExtglobType=t=>l.has(t);const isExtglobAST=t=>isExtglobType(t.type);const h=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]);const u=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]);const f=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]);const p=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]);const g="(?!(?:^|/)\\.\\.?(?:$|/))";const b="(?!\\.)";const w=new Set(["[","."]);const S=new Set(["..","."]);const v=new Set("().*{}+?[]^$\\!");const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const x="[^/]";const E=x+"*?";const R=x+"+?";let P=0;class AST{type;#dt;#mt;#gt=false;#yt=[];#bt;#wt;#St;#vt=false;#_t;#Ct;#xt=false;id=++P;get depth(){return(this.#bt?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#dt.id,parent:this.#bt?.id,depth:this.depth,partsLength:this.#yt.length,parts:this.#yt}}constructor(t,e,s={}){this.type=t;if(t)this.#mt=true;this.#bt=e;this.#dt=this.#bt?this.#bt.#dt:this;this.#_t=this.#dt===this?s:this.#dt.#_t;this.#St=this.#dt===this?[]:this.#dt.#St;if(t==="!"&&!this.#dt.#vt)this.#St.push(this);this.#wt=this.#bt?this.#bt.#yt.length:0}get hasMagic(){if(this.#mt!==undefined)return this.#mt;for(const t of this.#yt){if(typeof t==="string")continue;if(t.type||t.hasMagic)return this.#mt=true}return this.#mt}toString(){return this.#Ct!==undefined?this.#Ct:!this.type?this.#Ct=this.#yt.map((t=>String(t))).join(""):this.#Ct=this.type+"("+this.#yt.map((t=>String(t))).join("|")+")"}#Tt(){if(this!==this.#dt)throw new Error("should only call on root");if(this.#vt)return this;this.toString();this.#vt=true;let t;while(t=this.#St.pop()){if(t.type!=="!")continue;let e=t;let s=e.#bt;while(s){for(let i=e.#wt+1;!s.type&&i<s.#yt.length;i++){for(const e of t.#yt){if(typeof e==="string"){throw new Error("string part in extglob AST??")}e.copyIn(s.#yt[i])}}e=s;s=e.#bt}}return this}push(...t){for(const e of t){if(e==="")continue;if(typeof e!=="string"&&!(e instanceof i&&e.#bt===this)){throw new Error("invalid part: "+e)}this.#yt.push(e)}}toJSON(){const t=this.type===null?this.#yt.slice().map((t=>typeof t==="string"?t:t.toJSON())):[this.type,...this.#yt.map((t=>t.toJSON()))];if(this.isStart()&&!this.type)t.unshift([]);if(this.isEnd()&&(this===this.#dt||this.#dt.#vt&&this.#bt?.type==="!")){t.push({})}return t}isStart(){if(this.#dt===this)return true;if(!this.#bt?.isStart())return false;if(this.#wt===0)return true;const t=this.#bt;for(let e=0;e<this.#wt;e++){const s=t.#yt[e];if(!(s instanceof i&&s.type==="!")){return false}}return true}isEnd(){if(this.#dt===this)return true;if(this.#bt?.type==="!")return true;if(!this.#bt?.isEnd())return false;if(!this.type)return this.#bt?.isEnd();const t=this.#bt?this.#bt.#yt.length:0;return this.#wt===t-1}copyIn(t){if(typeof t==="string")this.push(t);else this.push(t.clone(this))}clone(t){const e=new i(this.type,t);for(const t of this.#yt){e.copyIn(t)}return e}static#Et(t,e,s,n,a){const l=n.maxExtglobRecursion??2;let h=false;let u=false;let f=-1;let p=false;if(e.type===null){let g=s;let b="";while(g<t.length){const s=t.charAt(g++);if(h||s==="\\"){h=!h;b+=s;continue}if(u){if(g===f+1){if(s==="^"||s==="!"){p=true}}else if(s==="]"&&!(g===f+2&&p)){u=false}b+=s;continue}else if(s==="["){u=true;f=g;p=false;b+=s;continue}const w=!n.noext&&isExtglobType(s)&&t.charAt(g)==="("&&a<=l;if(w){e.push(b);b="";const l=new i(s,e);g=i.#Et(t,l,g,n,a+1);e.push(l);continue}b+=s}e.push(b);return g}let g=s+1;let b=new i(null,e);const w=[];let S="";while(g<t.length){const s=t.charAt(g++);if(h||s==="\\"){h=!h;S+=s;continue}if(u){if(g===f+1){if(s==="^"||s==="!"){p=true}}else if(s==="]"&&!(g===f+2&&p)){u=false}S+=s;continue}else if(s==="["){u=true;f=g;p=false;S+=s;continue}const v=!n.noext&&isExtglobType(s)&&t.charAt(g)==="("&&(a<=l||e&&e.#Rt(s));if(v){const l=e&&e.#Rt(s)?0:1;b.push(S);S="";const h=new i(s,b);b.push(h);g=i.#Et(t,h,g,n,a+l);continue}if(s==="|"){b.push(S);S="";w.push(b);b=new i(null,e);continue}if(s===")"){if(S===""&&e.#yt.length===0){e.#xt=true}b.push(S);S="";e.push(...w,b);return g}S+=s}e.type=null;e.#mt=undefined;e.#yt=[t.substring(s-1)];return g}#Pt(t){return this.#kt(t,u)}#kt(t,e=h){if(!t||typeof t!=="object"||t.type!==null||t.#yt.length!==1||this.type===null){return false}const s=t.#yt[0];if(!s||typeof s!=="object"||s.type===null){return false}return this.#Rt(s.type,e)}#Rt(t,e=f){return!!e.get(this.type)?.includes(t)}#Ot(t,e){const s=t.#yt[0];const n=new i(null,s,this.options);n.#yt.push("");s.push(n);this.#It(t,e)}#It(t,e){const s=t.#yt[0];this.#yt.splice(e,1,...s.#yt);for(const t of s.#yt){if(typeof t==="object")t.#bt=this}this.#Ct=undefined}#At(t){const e=p.get(this.type);return!!e?.has(t)}#Mt(t){if(!t||typeof t!=="object"||t.type!==null||t.#yt.length!==1||this.type===null||this.#yt.length!==1){return false}const e=t.#yt[0];if(!e||typeof e!=="object"||e.type===null){return false}return this.#At(e.type)}#Ut(t){const e=p.get(this.type);const s=t.#yt[0];const i=e?.get(s.type);if(!i)return false;this.#yt=s.#yt;for(const t of this.#yt){if(typeof t==="object"){t.#bt=this}}this.type=i;this.#Ct=undefined;this.#xt=false}static fromGlob(t,e={}){const s=new i(null,undefined,e);i.#Et(t,s,0,e,0);return s}toMMPattern(){if(this!==this.#dt)return this.#dt.toMMPattern();const t=this.toString();const[e,s,i,n]=this.toRegExpSource();const a=i||this.#mt||this.#_t.nocase&&!this.#_t.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase();if(!a){return s}const l=(this.#_t.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,l),{_src:e,_glob:t})}get options(){return this.#_t}toRegExpSource(t){const e=t??!!this.#_t.dot;if(this.#dt===this){this.#Nt();this.#Tt()}if(!isExtglobAST(this)){const s=this.isStart()&&this.isEnd()&&!this.#yt.some((t=>typeof t!=="string"));const n=this.#yt.map((e=>{const[n,a,l,h]=typeof e==="string"?i.#Bt(e,this.#mt,s):e.toRegExpSource(t);this.#mt=this.#mt||l;this.#gt=this.#gt||h;return n})).join("");let l="";if(this.isStart()){if(typeof this.#yt[0]==="string"){const s=this.#yt.length===1&&S.has(this.#yt[0]);if(!s){const s=w;const i=e&&s.has(n.charAt(0))||n.startsWith("\\.")&&s.has(n.charAt(2))||n.startsWith("\\.\\.")&&s.has(n.charAt(4));const a=!e&&!t&&s.has(n.charAt(0));l=i?g:a?b:""}}}let h="";if(this.isEnd()&&this.#dt.#vt&&this.#bt?.type==="!"){h="(?:$|\\/)"}const u=l+n+h;return[u,(0,a.unescape)(n),this.#mt=!!this.#mt,this.#gt]}const s=this.type==="*"||this.type==="+";const n=this.type==="!"?"(?:(?!(?:":"(?:";let l=this.#Lt(e);if(this.isStart()&&this.isEnd()&&!l&&this.type!=="!"){const t=this.toString();const e=this;e.#yt=[t];e.type=null;e.#mt=undefined;return[t,(0,a.unescape)(this.toString()),false,false]}let h=!s||t||e||!b?"":this.#Lt(true);if(h===l){h=""}if(h){l=`(?:${l})(?:${h})*?`}let u="";if(this.type==="!"&&this.#xt){u=(this.isStart()&&!e?b:"")+R}else{const s=this.type==="!"?"))"+(this.isStart()&&!e&&!t?b:"")+E+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&h?")":this.type==="*"&&h?`)?`:`)${this.type}`;u=n+l+s}return[u,(0,a.unescape)(l),this.#mt=!!this.#mt,this.#gt]}#Nt(){if(!isExtglobAST(this)){for(const t of this.#yt){if(typeof t==="object"){t.#Nt()}}}else{let t=0;let e=false;do{e=true;for(let t=0;t<this.#yt.length;t++){const s=this.#yt[t];if(typeof s==="object"){s.#Nt();if(this.#kt(s)){e=false;this.#It(s,t)}else if(this.#Pt(s)){e=false;this.#Ot(s,t)}else if(this.#Mt(s)){e=false;this.#Ut(s)}}}}while(!e&&++t<10)}this.#Ct=undefined}#Lt(t){return this.#yt.map((e=>{if(typeof e==="string"){throw new Error("string type in extglob ast??")}const[s,i,n,a]=e.toRegExpSource(t);this.#gt=this.#gt||a;return s})).filter((t=>!(this.isStart()&&this.isEnd())||!!t)).join("|")}static#Bt(t,e,s=false){let i=false;let l="";let h=false;let u=false;for(let a=0;a<t.length;a++){const f=t.charAt(a);if(i){i=false;l+=(v.has(f)?"\\":"")+f;continue}if(f==="*"){if(u)continue;u=true;l+=s&&/^[*]+$/.test(t)?R:E;e=true;continue}else{u=false}if(f==="\\"){if(a===t.length-1){l+="\\\\"}else{i=true}continue}if(f==="["){const[s,i,u,f]=(0,n.parseClass)(t,a);if(u){l+=s;h=h||i;a+=u-1;e=e||f;continue}}if(f==="?"){l+=x;e=true;continue}l+=regExpEscape(f)}return[l,(0,a.unescape)(t),!!e,h]}}e.AST=AST;i=AST},6694:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.parseClass=void 0;const s={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=t=>t.join("");const parseClass=(t,e)=>{const i=e;if(t.charAt(i)!=="["){throw new Error("not in a brace expression")}const n=[];const a=[];let l=i+1;let h=false;let u=false;let f=false;let p=false;let g=i;let b="";t:while(l<t.length){const e=t.charAt(l);if((e==="!"||e==="^")&&l===i+1){p=true;l++;continue}if(e==="]"&&h&&!f){g=l+1;break}h=true;if(e==="\\"){if(!f){f=true;l++;continue}}if(e==="["&&!f){for(const[e,[h,f,p]]of Object.entries(s)){if(t.startsWith(e,l)){if(b){return["$.",false,t.length-i,true]}l+=e.length;if(p)a.push(h);else n.push(h);u=u||f;continue t}}}f=false;if(b){if(e>b){n.push(braceEscape(b)+"-"+braceEscape(e))}else if(e===b){n.push(braceEscape(e))}b="";l++;continue}if(t.startsWith("-]",l+1)){n.push(braceEscape(e+"-"));l+=2;continue}if(t.startsWith("-",l+1)){b=e;l+=2;continue}n.push(braceEscape(e));l++}if(g<l){return["",false,0,false]}if(!n.length&&!a.length){return["$.",false,t.length-i,true]}if(a.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!p){const t=n[0].length===2?n[0].slice(-1):n[0];return[regexpEscape(t),false,g-i,false]}const w="["+(p?"^":"")+rangesToString(n)+"]";const S="["+(p?"":"^")+rangesToString(a)+"]";const v=n.length&&a.length?"("+w+"|"+S+")":n.length?w:S;return[v,u,g-i,true]};e.parseClass=parseClass},7516:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.escape=void 0;const escape=(t,{windowsPathsNoEscape:e=false,magicalBraces:s=false}={})=>{if(s){return e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&")}return e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&")};e.escape=escape},6647:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;const i=s(470);const n=s(557);const a=s(8743);const l=s(7516);const h=s(7967);const minimatch=(t,e,s={})=>{(0,n.assertValidPattern)(e);if(!s.nocomment&&e.charAt(0)==="#"){return false}return new Minimatch(e,s).match(t)};e.minimatch=minimatch;const u=/^\*+([^+@!?*[(]*)$/;const starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t);const starDotExtTestDot=t=>e=>e.endsWith(t);const starDotExtTestNocase=t=>{t=t.toLowerCase();return e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)};const starDotExtTestNocaseDot=t=>{t=t.toLowerCase();return e=>e.toLowerCase().endsWith(t)};const f=/^\*+\.\*+$/;const starDotStarTest=t=>!t.startsWith(".")&&t.includes(".");const starDotStarTestDot=t=>t!=="."&&t!==".."&&t.includes(".");const p=/^\.\*+$/;const dotStarTest=t=>t!=="."&&t!==".."&&t.startsWith(".");const g=/^\*+$/;const starTest=t=>t.length!==0&&!t.startsWith(".");const starTestDot=t=>t.length!==0&&t!=="."&&t!=="..";const b=/^\?+([^+@!?*[(]*)?$/;const qmarksTestNocase=([t,e=""])=>{const s=qmarksTestNoExt([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestNocaseDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);if(!e)return s;e=e.toLowerCase();return t=>s(t)&&t.toLowerCase().endsWith(e)};const qmarksTestDot=([t,e=""])=>{const s=qmarksTestNoExtDot([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTest=([t,e=""])=>{const s=qmarksTestNoExt([t]);return!e?s:t=>s(t)&&t.endsWith(e)};const qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")};const qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&t!=="."&&t!==".."};const w=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const S={win32:{sep:"\\"},posix:{sep:"/"}};e.sep=w==="win32"?S.win32.sep:S.posix.sep;e.minimatch.sep=e.sep;e.GLOBSTAR=Symbol("globstar **");e.minimatch.GLOBSTAR=e.GLOBSTAR;const v="[^/]";const x=v+"*?";const E="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const R="(?:(?!(?:\\/|^)\\.).)*?";const filter=(t,s={})=>i=>(0,e.minimatch)(i,t,s);e.filter=filter;e.minimatch.filter=e.filter;const ext=(t,e={})=>Object.assign({},t,e);const defaults=t=>{if(!t||typeof t!=="object"||!Object.keys(t).length){return e.minimatch}const s=e.minimatch;const m=(e,i,n={})=>s(e,i,ext(t,n));return Object.assign(m,{Minimatch:class Minimatch extends s.Minimatch{constructor(e,s={}){super(e,ext(t,s))}static defaults(e){return s.defaults(ext(t,e)).Minimatch}},AST:class AST extends s.AST{constructor(e,s,i={}){super(e,s,ext(t,i))}static fromGlob(e,i={}){return s.AST.fromGlob(e,ext(t,i))}},unescape:(e,i={})=>s.unescape(e,ext(t,i)),escape:(e,i={})=>s.escape(e,ext(t,i)),filter:(e,i={})=>s.filter(e,ext(t,i)),defaults:e=>s.defaults(ext(t,e)),makeRe:(e,i={})=>s.makeRe(e,ext(t,i)),braceExpand:(e,i={})=>s.braceExpand(e,ext(t,i)),match:(e,i,n={})=>s.match(e,i,ext(t,n)),sep:s.sep,GLOBSTAR:e.GLOBSTAR})};e.defaults=defaults;e.minimatch.defaults=e.defaults;const braceExpand=(t,e={})=>{(0,n.assertValidPattern)(t);if(e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return(0,i.expand)(t,{max:e.braceExpandMax})};e.braceExpand=braceExpand;e.minimatch.braceExpand=e.braceExpand;const makeRe=(t,e={})=>new Minimatch(t,e).makeRe();e.makeRe=makeRe;e.minimatch.makeRe=e.makeRe;const match=(t,e,s={})=>{const i=new Minimatch(e,s);t=t.filter((t=>i.match(t)));if(i.options.nonull&&!t.length){t.push(e)}return t};e.match=match;e.minimatch.match=e.match;const P=/[?*]|[+@!]\(.*?\)|\[|\]/;const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,e={}){(0,n.assertValidPattern)(t);e=e||{};this.options=e;this.maxGlobstarRecursion=e.maxGlobstarRecursion??200;this.pattern=t;this.platform=e.platform||w;this.isWindows=this.platform==="win32";const s="allowWindow"+"sEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[s]===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!e.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!e.nonegate;this.comment=false;this.empty=false;this.partial=!!e.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=e.windowsNoMagicRoot!==undefined?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const t of this.set){for(const e of t){if(typeof e!=="string")return true}}return false}debug(...t){}make(){const t=this.pattern;const e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(e.debug){this.debug=(...t)=>console.error(...t)}this.debug(this.pattern,this.globSet);const s=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(s);this.debug(this.pattern,this.globParts);let i=this.globParts.map(((t,e,s)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=t[0]===""&&t[1]===""&&(t[2]==="?"||!P.test(t[2]))&&!P.test(t[3]);const s=/^[a-z]:/i.test(t[0]);if(e){return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))]}else if(s){return[t[0],...t.slice(1).map((t=>this.parse(t)))]}}return t.map((t=>this.parse(t)))}));this.debug(this.pattern,i);this.set=i.filter((t=>t.indexOf(false)===-1));if(this.isWindows){for(let t=0;t<this.set.length;t++){const e=this.set[t];if(e[0]===""&&e[1]===""&&this.globParts[t][2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3])){e[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar){for(const e of t){for(let t=0;t<e.length;t++){if(e[t]==="**"){e[t]="*"}}}}const{optimizationLevel:e=1}=this.options;if(e>=2){t=this.firstPhasePreProcess(t);t=this.secondPhasePreProcess(t)}else if(e>=1){t=this.levelOneOptimize(t)}else{t=this.adjascentGlobstarOptimize(t)}return t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;while(-1!==(e=t.indexOf("**",e+1))){let s=e;while(t[s+1]==="**"){s++}if(s!==e){t.splice(e,s-e)}}return t}))}levelOneOptimize(t){return t.map((t=>{t=t.reduce(((t,e)=>{const s=t[t.length-1];if(e==="**"&&s==="**"){return t}if(e===".."){if(s&&s!==".."&&s!=="."&&s!=="**"){t.pop();return t}}t.push(e);return t}),[]);return t.length===0?[""]:t}))}levelTwoFileOptimize(t){if(!Array.isArray(t)){t=this.slashSplit(t)}let e=false;do{e=false;if(!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const i=t[s];if(s===1&&i===""&&t[0]==="")continue;if(i==="."||i===""){e=true;t.splice(s,1);s--}}if(t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")){e=true;t.pop()}}let s=0;while(-1!==(s=t.indexOf("..",s+1))){const i=t[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))){e=true;t.splice(s-1,2);s-=2}}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let s of t){let i=-1;while(-1!==(i=s.indexOf("**",i+1))){let n=i;while(s[n+1]==="**"){n++}if(n>i){s.splice(i+1,n-i)}let a=s[i+1];const l=s[i+2];const h=s[i+3];if(a!=="..")continue;if(!l||l==="."||l===".."||!h||h==="."||h===".."){continue}e=true;s.splice(i,1);const u=s.slice(0);u[i]="**";t.push(u);i--}if(!this.preserveMultipleSlashes){for(let t=1;t<s.length-1;t++){const i=s[t];if(t===1&&i===""&&s[0]==="")continue;if(i==="."||i===""){e=true;s.splice(t,1);t--}}if(s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")){e=true;s.pop()}}let n=0;while(-1!==(n=s.indexOf("..",n+1))){const t=s[n-1];if(t&&t!=="."&&t!==".."&&t!=="**"){e=true;const t=n===1&&s[n+1]==="**";const i=t?["."]:[];s.splice(n-1,2,...i);if(s.length===0)s.push("");n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++){for(let s=e+1;s<t.length;s++){const i=this.partsMatch(t[e],t[s],!this.preserveMultipleSlashes);if(i){t[e]=[];t[s]=i;break}}}return t.filter((t=>t.length))}partsMatch(t,e,s=false){let i=0;let n=0;let a=[];let l="";while(i<t.length&&n<e.length){if(t[i]===e[n]){a.push(l==="b"?e[n]:t[i]);i++;n++}else if(s&&t[i]==="**"&&e[n]===t[i+1]){a.push(t[i]);i++}else if(s&&e[n]==="**"&&t[i]===e[n+1]){a.push(e[n]);n++}else if(t[i]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(l==="b")return false;l="a";a.push(t[i]);i++;n++}else if(e[n]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return false;l="b";a.push(e[n]);i++;n++}else{return false}}return t.length===e.length&&a}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=false;let s=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++){e=!e;s++}if(s)this.pattern=t.slice(s);this.negate=e}matchOne(t,s,i=false){let n=0;let a=0;if(this.isWindows){const e=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const i=!e&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]);const l=typeof s[0]==="string"&&/^[a-z]:$/i.test(s[0]);const h=!l&&s[0]===""&&s[1]===""&&s[2]==="?"&&typeof s[3]==="string"&&/^[a-z]:$/i.test(s[3]);const u=i?3:e?0:undefined;const f=h?3:l?0:undefined;if(typeof u==="number"&&typeof f==="number"){const[e,i]=[t[u],s[f]];if(e.toLowerCase()===i.toLowerCase()){s[f]=e;a=f;n=u}}}const{optimizationLevel:l=1}=this.options;if(l>=2){t=this.levelTwoFileOptimize(t)}if(s.includes(e.GLOBSTAR)){return this.#Ft(t,s,i,n,a)}return this.#jt(t,s,i,n,a)}#Ft(t,s,i,n,a){const l=s.indexOf(e.GLOBSTAR,a);const h=s.lastIndexOf(e.GLOBSTAR);const[u,f,p]=i?[s.slice(a,l),s.slice(l+1),[]]:[s.slice(a,l),s.slice(l+1,h),s.slice(h+1)];if(u.length){const e=t.slice(n,n+u.length);if(!this.#jt(e,u,i,0,0)){return false}n+=u.length;a+=u.length}let g=0;if(p.length){if(p.length+n>t.length)return false;let e=t.length-p.length;if(this.#jt(t,p,i,e,0)){g=p.length}else{if(t[t.length-1]!==""||n+p.length===t.length){return false}e--;if(!this.#jt(t,p,i,e,0)){return false}g=p.length+1}}if(!f.length){let e=!!g;for(let s=n;s<t.length-g;s++){const i=String(t[s]);e=true;if(i==="."||i===".."||!this.options.dot&&i.startsWith(".")){return false}}return i||e}const b=[[[],0]];let w=b[0];let S=0;const v=[0];for(const t of f){if(t===e.GLOBSTAR){v.push(S);w=[[],0];b.push(w)}else{w[0].push(t);S++}}let x=b.length-1;const E=t.length-g;for(const t of b){t[1]=E-(v[x--]+t[0].length)}return!!this.#Wt(t,b,n,0,i,0,!!g)}#Wt(t,e,s,i,n,a,l){const h=e[i];if(!h){for(let e=s;e<t.length;e++){l=true;const s=t[e];if(s==="."||s===".."||!this.options.dot&&s.startsWith(".")){return false}}return l}const[u,f]=h;while(s<=f){const h=this.#jt(t.slice(0,s+u.length),u,n,s,0);if(h&&a<this.maxGlobstarRecursion){const h=this.#Wt(t,e,s+u.length,i+1,n,a+1,l);if(h!==false){return h}}const f=t[s];if(f==="."||f===".."||!this.options.dot&&f.startsWith(".")){return false}s++}return n||null}#jt(t,s,i,n,a){let l;let h;let u;let f;for(l=n,h=a,f=t.length,u=s.length;l<f&&h<u;l++,h++){this.debug("matchOne loop");let i=s[h];let n=t[l];this.debug(s,i,n);if(i===false||i===e.GLOBSTAR){return false}let a;if(typeof i==="string"){a=n===i;this.debug("string match",i,n,a)}else{a=i.test(n);this.debug("pattern match",i,n,a)}if(!a)return false}if(l===f&&h===u){return true}else if(l===f){return i}else if(h===u){return l===f-1&&t[l]===""}else{throw new Error("wtf?")}}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(t){(0,n.assertValidPattern)(t);const s=this.options;if(t==="**")return e.GLOBSTAR;if(t==="")return"";let i;let l=null;if(i=t.match(g)){l=s.dot?starTestDot:starTest}else if(i=t.match(u)){l=(s.nocase?s.dot?starDotExtTestNocaseDot:starDotExtTestNocase:s.dot?starDotExtTestDot:starDotExtTest)(i[1])}else if(i=t.match(b)){l=(s.nocase?s.dot?qmarksTestNocaseDot:qmarksTestNocase:s.dot?qmarksTestDot:qmarksTest)(i)}else if(i=t.match(f)){l=s.dot?starDotStarTestDot:starDotStarTest}else if(i=t.match(p)){l=dotStarTest}const h=a.AST.fromGlob(t,this.options).toMMPattern();if(l&&typeof h==="object"){Reflect.defineProperty(h,"test",{value:l})}return h}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const t=this.set;if(!t.length){this.regexp=false;return this.regexp}const s=this.options;const i=s.noglobstar?x:s.dot?E:R;const n=new Set(s.nocase?["i"]:[]);let a=t.map((t=>{const s=t.map((t=>{if(t instanceof RegExp){for(const e of t.flags.split(""))n.add(e)}return typeof t==="string"?regExpEscape(t):t===e.GLOBSTAR?e.GLOBSTAR:t._src}));s.forEach(((t,n)=>{const a=s[n+1];const l=s[n-1];if(t!==e.GLOBSTAR||l===e.GLOBSTAR){return}if(l===undefined){if(a!==undefined&&a!==e.GLOBSTAR){s[n+1]="(?:\\/|"+i+"\\/)?"+a}else{s[n]=i}}else if(a===undefined){s[n-1]=l+"(?:\\/|\\/"+i+")?"}else if(a!==e.GLOBSTAR){s[n-1]=l+"(?:\\/|\\/"+i+"\\/)"+a;s[n+1]=e.GLOBSTAR}}));const a=s.filter((t=>t!==e.GLOBSTAR));if(this.partial&&a.length>=1){const t=[];for(let e=1;e<=a.length;e++){t.push(a.slice(0,e).join("/"))}return"(?:"+t.join("|")+")"}return a.join("/")})).join("|");const[l,h]=t.length>1?["(?:",")"]:["",""];a="^"+l+a+h+"$";if(this.partial){a="^(?:\\/|"+l+a.slice(1,-1)+h+")$"}if(this.negate)a="^(?!"+a+").+$";try{this.regexp=new RegExp(a,[...n].join(""))}catch{this.regexp=false}return this.regexp}slashSplit(t){if(this.preserveMultipleSlashes){return t.split("/")}else if(this.isWindows&&/^\/\/[^/]+/.test(t)){return["",...t.split(/\/+/)]}else{return t.split(/\/+/)}}match(t,e=this.partial){this.debug("match",t,this.pattern);if(this.comment){return false}if(this.empty){return t===""}if(t==="/"&&e){return true}const s=this.options;if(this.isWindows){t=t.split("\\").join("/")}const i=this.slashSplit(t);this.debug(this.pattern,"split",i);const n=this.set;this.debug(this.pattern,"set",n);let a=i[i.length-1];if(!a){for(let t=i.length-2;!a&&t>=0;t--){a=i[t]}}for(const t of n){let n=i;if(s.matchBase&&t.length===1){n=[a]}const l=this.matchOne(n,t,e);if(l){if(s.flipNegate){return true}return!this.negate}}if(s.flipNegate){return false}return this.negate}static defaults(t){return e.minimatch.defaults(t).Minimatch}}e.Minimatch=Minimatch;var k=s(8743);Object.defineProperty(e,"AST",{enumerable:true,get:function(){return k.AST}});var O=s(7516);Object.defineProperty(e,"escape",{enumerable:true,get:function(){return O.escape}});var I=s(7967);Object.defineProperty(e,"unescape",{enumerable:true,get:function(){return I.unescape}});e.minimatch.AST=a.AST;e.minimatch.Minimatch=Minimatch;e.minimatch.escape=l.escape;e.minimatch.unescape=h.unescape},7967:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.unescape=void 0;const unescape=(t,{windowsPathsNoEscape:e=false,magicalBraces:s=true}={})=>{if(s){return e?t.replace(/\[([^/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1")}return e?t.replace(/\[([^/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1")};e.unescape=unescape},1935:(t,e)=>{Object.defineProperty(e,"__esModule",{value:true});e.range=e.balanced=void 0;const balanced=(t,s,i)=>{const n=t instanceof RegExp?maybeMatch(t,i):t;const a=s instanceof RegExp?maybeMatch(s,i):s;const l=n!==null&&a!=null&&(0,e.range)(n,a,i);return l&&{start:l[0],end:l[1],pre:i.slice(0,l[0]),body:i.slice(l[0]+n.length,l[1]),post:i.slice(l[1]+a.length)}};e.balanced=balanced;const maybeMatch=(t,e)=>{const s=e.match(t);return s?s[0]:null};const range=(t,e,s)=>{let i,n,a,l=undefined,h;let u=s.indexOf(t);let f=s.indexOf(e,u+1);let p=u;if(u>=0&&f>0){if(t===e){return[u,f]}i=[];a=s.length;while(p>=0&&!h){if(p===u){i.push(p);u=s.indexOf(t,p+1)}else if(i.length===1){const t=i.pop();if(t!==undefined)h=[t,f]}else{n=i.pop();if(n!==undefined&&n<a){a=n;l=f}f=s.indexOf(e,p+1)}p=u<f&&u>=0?u:f}if(i.length&&l!==undefined){h=[a,l]}}return h};e.range=range},470:(t,e,s)=>{Object.defineProperty(e,"__esModule",{value:true});e.EXPANSION_MAX=void 0;e.expand=expand;const i=s(1935);const n="\0SLASH"+Math.random()+"\0";const a="\0OPEN"+Math.random()+"\0";const l="\0CLOSE"+Math.random()+"\0";const h="\0COMMA"+Math.random()+"\0";const u="\0PERIOD"+Math.random()+"\0";const f=new RegExp(n,"g");const p=new RegExp(a,"g");const g=new RegExp(l,"g");const b=new RegExp(h,"g");const w=new RegExp(u,"g");const S=/\\\\/g;const v=/\\{/g;const x=/\\}/g;const E=/\\,/g;const R=/\\\./g;e.EXPANSION_MAX=1e5;function numeric(t){return!isNaN(t)?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.replace(S,n).replace(v,a).replace(x,l).replace(E,h).replace(R,u)}function unescapeBraces(t){return t.replace(f,"\\").replace(p,"{").replace(g,"}").replace(b,",").replace(w,".")}function parseCommaParts(t){if(!t){return[""]}const e=[];const s=(0,i.balanced)("{","}",t);if(!s){return t.split(",")}const{pre:n,body:a,post:l}=s;const h=n.split(",");h[h.length-1]+="{"+a+"}";const u=parseCommaParts(l);if(l.length){h[h.length-1]+=u.shift();h.push.apply(h,u)}e.push.apply(e,h);return e}function expand(t,s={}){if(!t){return[]}const{max:i=e.EXPANSION_MAX}=s;if(t.slice(0,2)==="{}"){t="\\{\\}"+t.slice(2)}return expand_(escapeBraces(t),i,true).map(unescapeBraces)}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,e){return t<=e}function gte(t,e){return t>=e}function expand_(t,e,s){const n=[];const a=(0,i.balanced)("{","}",t);if(!a)return[t];const h=a.pre;const u=a.post.length?expand_(a.post,e,false):[""];if(/\$$/.test(a.pre)){for(let t=0;t<u.length&&t<e;t++){const e=h+"{"+a.body+"}"+u[t];n.push(e)}}else{const i=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body);const f=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body);const p=i||f;const g=a.body.indexOf(",")>=0;if(!p&&!g){if(a.post.match(/,(?!,).*\}/)){t=a.pre+"{"+a.body+l+a.post;return expand_(t,e,true)}return[t]}let b;if(p){b=a.body.split(/\.\./)}else{b=parseCommaParts(a.body);if(b.length===1&&b[0]!==undefined){b=expand_(b[0],e,false).map(embrace);if(b.length===1){return u.map((t=>a.pre+b[0]+t))}}}let w;if(p&&b[0]!==undefined&&b[1]!==undefined){const t=numeric(b[0]);const s=numeric(b[1]);const i=Math.max(b[0].length,b[1].length);let n=b.length===3&&b[2]!==undefined?Math.max(Math.abs(numeric(b[2])),1):1;let a=lte;const l=s<t;if(l){n*=-1;a=gte}const h=b.some(isPadded);w=[];for(let l=t;a(l,s)&&w.length<e;l+=n){let t;if(f){t=String.fromCharCode(l);if(t==="\\"){t=""}}else{t=String(l);if(h){const e=i-t.length;if(e>0){const s=new Array(e+1).join("0");if(l<0){t="-"+s+t.slice(1)}else{t=s+t}}}}w.push(t)}}else{w=[];for(let t=0;t<b.length;t++){w.push.apply(w,expand_(b[t],e,false))}}for(let t=0;t<w.length;t++){for(let i=0;i<u.length&&n.length<e;i++){const e=h+w[t]+u[i];if(!s||p||e){n.push(e)}}}}return n}},1031:function(t,e,s){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:true});e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;const n=typeof process==="object"&&process?process:{stdout:null,stderr:null};const a=s(8474);const l=i(s(7075));const h=s(6193);const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof l.default||(0,e.isReadable)(t)||(0,e.isWritable)(t));e.isStream=isStream;const isReadable=t=>!!t&&typeof t==="object"&&t instanceof a.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==l.default.Writable.prototype.pipe;e.isReadable=isReadable;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof a.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";e.isWritable=isWritable;const u=Symbol("EOF");const f=Symbol("maybeEmitEnd");const p=Symbol("emittedEnd");const g=Symbol("emittingEnd");const b=Symbol("emittedError");const w=Symbol("closed");const S=Symbol("read");const v=Symbol("flush");const x=Symbol("flushChunk");const E=Symbol("encoding");const R=Symbol("decoder");const P=Symbol("flowing");const k=Symbol("paused");const O=Symbol("resume");const I=Symbol("buffer");const A=Symbol("pipes");const M=Symbol("bufferLength");const U=Symbol("bufferPush");const N=Symbol("bufferShift");const B=Symbol("objectMode");const L=Symbol("destroyed");const F=Symbol("error");const W=Symbol("emitData");const D=Symbol("emitEnd");const G=Symbol("emitEnd2");const z=Symbol("async");const $=Symbol("abort");const J=Symbol("aborted");const K=Symbol("signal");const X=Symbol("dataListeners");const Y=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,e,s){this.src=t;this.dest=e;this.opts=s;this.ondrain=()=>t[O]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,e,s){super(t,e,s);this.proxyErrors=t=>this.dest.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends a.EventEmitter{[P]=false;[k]=false;[A]=[];[I]=[];[B];[E];[z];[R];[u]=false;[p]=false;[g]=false;[w]=false;[b]=null;[M]=0;[L]=false;[K];[J]=false;[X]=0;[Y]=false;writable=true;readable=true;constructor(...t){const e=t[0]||{};super();if(e.objectMode&&typeof e.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(e)){this[B]=true;this[E]=null}else if(isEncodingOptions(e)){this[E]=e.encoding;this[B]=false}else{this[B]=false;this[E]=null}this[z]=!!e.async;this[R]=this[E]?new h.StringDecoder(this[E]):null;if(e&&e.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[I]})}if(e&&e.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[A]})}const{signal:s}=e;if(s){this[K]=s;if(s.aborted){this[$]()}else{s.addEventListener("abort",(()=>this[$]()))}}}get bufferLength(){return this[M]}get encoding(){return this[E]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[B]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[z]}set["async"](t){this[z]=this[z]||!!t}[$](){this[J]=true;this.emit("abort",this[K]?.reason);this.destroy(this[K]?.reason)}get aborted(){return this[J]}set aborted(t){}write(t,e,s){if(this[J])return false;if(this[u])throw new Error("write after end");if(this[L]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof e==="function"){s=e;e="utf8"}if(!e)e="utf8";const i=this[z]?defer:nodefer;if(!this[B]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[B]){if(this[P]&&this[M]!==0)this[v](true);if(this[P])this.emit("data",t);else this[U](t);if(this[M]!==0)this.emit("readable");if(s)i(s);return this[P]}if(!t.length){if(this[M]!==0)this.emit("readable");if(s)i(s);return this[P]}if(typeof t==="string"&&!(e===this[E]&&!this[R]?.lastNeed)){t=Buffer.from(t,e)}if(Buffer.isBuffer(t)&&this[E]){t=this[R].write(t)}if(this[P]&&this[M]!==0)this[v](true);if(this[P])this.emit("data",t);else this[U](t);if(this[M]!==0)this.emit("readable");if(s)i(s);return this[P]}read(t){if(this[L])return null;this[Y]=false;if(this[M]===0||t===0||t&&t>this[M]){this[f]();return null}if(this[B])t=null;if(this[I].length>1&&!this[B]){this[I]=[this[E]?this[I].join(""):Buffer.concat(this[I],this[M])]}const e=this[S](t||null,this[I][0]);this[f]();return e}[S](t,e){if(this[B])this[N]();else{const s=e;if(t===s.length||t===null)this[N]();else if(typeof s==="string"){this[I][0]=s.slice(t);e=s.slice(0,t);this[M]-=t}else{this[I][0]=s.subarray(t);e=s.subarray(0,t);this[M]-=t}}this.emit("data",e);if(!this[I].length&&!this[u])this.emit("drain");return e}end(t,e,s){if(typeof t==="function"){s=t;t=undefined}if(typeof e==="function"){s=e;e="utf8"}if(t!==undefined)this.write(t,e);if(s)this.once("end",s);this[u]=true;this.writable=false;if(this[P]||!this[k])this[f]();return this}[O](){if(this[L])return;if(!this[X]&&!this[A].length){this[Y]=true}this[k]=false;this[P]=true;this.emit("resume");if(this[I].length)this[v]();else if(this[u])this[f]();else this.emit("drain")}resume(){return this[O]()}pause(){this[P]=false;this[k]=true;this[Y]=false}get destroyed(){return this[L]}get flowing(){return this[P]}get paused(){return this[k]}[U](t){if(this[B])this[M]+=1;else this[M]+=t.length;this[I].push(t)}[N](){if(this[B])this[M]-=1;else this[M]-=this[I][0].length;return this[I].shift()}[v](t=false){do{}while(this[x](this[N]())&&this[I].length);if(!t&&!this[I].length&&!this[u])this.emit("drain")}[x](t){this.emit("data",t);return this[P]}pipe(t,e){if(this[L])return t;this[Y]=false;const s=this[p];e=e||{};if(t===n.stdout||t===n.stderr)e.end=false;else e.end=e.end!==false;e.proxyErrors=!!e.proxyErrors;if(s){if(e.end)t.end()}else{this[A].push(!e.proxyErrors?new Pipe(this,t,e):new PipeProxyErrors(this,t,e));if(this[z])defer((()=>this[O]()));else this[O]()}return t}unpipe(t){const e=this[A].find((e=>e.dest===t));if(e){if(this[A].length===1){if(this[P]&&this[X]===0){this[P]=false}this[A]=[]}else this[A].splice(this[A].indexOf(e),1);e.unpipe()}}addListener(t,e){return this.on(t,e)}on(t,e){const s=super.on(t,e);if(t==="data"){this[Y]=false;this[X]++;if(!this[A].length&&!this[P]){this[O]()}}else if(t==="readable"&&this[M]!==0){super.emit("readable")}else if(isEndish(t)&&this[p]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[b]){const t=e;if(this[z])defer((()=>t.call(this,this[b])));else t.call(this,this[b])}return s}removeListener(t,e){return this.off(t,e)}off(t,e){const s=super.off(t,e);if(t==="data"){this[X]=this.listeners("data").length;if(this[X]===0&&!this[Y]&&!this[A].length){this[P]=false}}return s}removeAllListeners(t){const e=super.removeAllListeners(t);if(t==="data"||t===undefined){this[X]=0;if(!this[Y]&&!this[A].length){this[P]=false}}return e}get emittedEnd(){return this[p]}[f](){if(!this[g]&&!this[p]&&!this[L]&&this[I].length===0&&this[u]){this[g]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[w])this.emit("close");this[g]=false}}emit(t,...e){const s=e[0];if(t!=="error"&&t!=="close"&&t!==L&&this[L]){return false}else if(t==="data"){return!this[B]&&!s?false:this[z]?(defer((()=>this[W](s))),true):this[W](s)}else if(t==="end"){return this[D]()}else if(t==="close"){this[w]=true;if(!this[p]&&!this[L])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[b]=s;super.emit(F,s);const t=!this[K]||this.listeners("error").length?super.emit("error",s):false;this[f]();return t}else if(t==="resume"){const t=super.emit("resume");this[f]();return t}else if(t==="finish"||t==="prefinish"){const e=super.emit(t);this.removeAllListeners(t);return e}const i=super.emit(t,...e);this[f]();return i}[W](t){for(const e of this[A]){if(e.dest.write(t)===false)this.pause()}const e=this[Y]?false:super.emit("data",t);this[f]();return e}[D](){if(this[p])return false;this[p]=true;this.readable=false;return this[z]?(defer((()=>this[G]())),true):this[G]()}[G](){if(this[R]){const t=this[R].end();if(t){for(const e of this[A]){e.dest.write(t)}if(!this[Y])super.emit("data",t)}}for(const t of this[A]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[B])t.dataLength=0;const e=this.promise();this.on("data",(e=>{t.push(e);if(!this[B])t.dataLength+=e.length}));await e;return t}async concat(){if(this[B]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[E]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(L,(()=>e(new Error("stream destroyed"))));this.on("error",(t=>e(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[Y]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[u])return stop();let s;let i;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(L,ondestroy);stop();i(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(L,ondestroy);this.pause();s({value:t,done:!!this[u]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(L,ondestroy);stop();s({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,e)=>{i=e;s=t;this.once(L,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Y]=false;let t=false;const stop=()=>{this.pause();this.off(F,stop);this.off(L,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const e=this.read();return e===null?stop():{done:false,value:e}};this.once("end",stop);this.once(F,stop);this.once(L,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[L]){if(t)this.emit("error",t);else this.emit(L);return this}this[L]=true;this[Y]=true;this[I].length=0;this[M]=0;const e=this;if(typeof e.close==="function"&&!this[w])e.close();if(t)this.emit("error",t);else this.emit(L);return this}static get isStream(){return e.isStream}}e.Minipass=Minipass},5125:function(t,e,s){var i=this&&this.__createBinding||(Object.create?function(t,e,s,i){if(i===undefined)i=s;var n=Object.getOwnPropertyDescriptor(e,s);if(!n||("get"in n?!e.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return e[s]}}}Object.defineProperty(t,i,n)}:function(t,e,s,i){if(i===undefined)i=s;t[i]=e[s]});var n=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:true,value:e})}:function(t,e){t["default"]=e});var a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var s in t)if(s!=="default"&&Object.prototype.hasOwnProperty.call(t,s))i(e,t,s);n(e,t);return e};Object.defineProperty(e,"__esModule",{value:true});e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;const l=s(8548);const h=s(6760);const u=s(3136);const f=s(9896);const p=a(s(3024));const g=f.realpathSync.native;const b=s(1455);const w=s(1031);const S={lstatSync:f.lstatSync,readdir:f.readdir,readdirSync:f.readdirSync,readlinkSync:f.readlinkSync,realpathSync:g,promises:{lstat:b.lstat,readdir:b.readdir,readlink:b.readlink,realpath:b.realpath}};const fsFromOption=t=>!t||t===S||t===p?S:{...S,...t,promises:{...S.promises,...t.promises||{}}};const v=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=t=>t.replace(/\//g,"\\").replace(v,"$1\\");const x=/[\\\/]/;const E=0;const R=1;const P=2;const k=4;const O=6;const I=8;const A=10;const M=12;const U=15;const N=~U;const B=16;const L=32;const F=64;const W=128;const D=256;const G=512;const z=F|W|G;const $=1023;const entToType=t=>t.isFile()?I:t.isDirectory()?k:t.isSymbolicLink()?A:t.isCharacterDevice()?P:t.isBlockDevice()?O:t.isSocket()?M:t.isFIFO()?R:E;const J=new l.LRUCache({max:2**12});const normalize=t=>{const e=J.get(t);if(e)return e;const s=t.normalize("NFKD");J.set(t,s);return s};const K=new l.LRUCache({max:2**12});const normalizeNocase=t=>{const e=K.get(t);if(e)return e;const s=normalize(t.toLowerCase());K.set(t,s);return s};class ResolveCache extends l.LRUCache{constructor(){super({max:256})}}e.ResolveCache=ResolveCache;class ChildrenCache extends l.LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:t=>t.length+1})}}e.ChildrenCache=ChildrenCache;const X=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#Dt;#Gt;get dev(){return this.#Gt}#zt;get mode(){return this.#zt}#$t;get nlink(){return this.#$t}#Jt;get uid(){return this.#Jt}#qt;get gid(){return this.#qt}#Ht;get rdev(){return this.#Ht}#Vt;get blksize(){return this.#Vt}#Kt;get ino(){return this.#Kt}#Xt;get size(){return this.#Xt}#Yt;get blocks(){return this.#Yt}#Qt;get atimeMs(){return this.#Qt}#Zt;get mtimeMs(){return this.#Zt}#te;get ctimeMs(){return this.#te}#ee;get birthtimeMs(){return this.#ee}#se;get atime(){return this.#se}#ie;get mtime(){return this.#ie}#re;get ctime(){return this.#re}#ne;get birthtime(){return this.#ne}#oe;#ae;#le;#he;#ce;#ue;#fe;#pe;#de;#me;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=E,s,i,n,a,l){this.name=t;this.#oe=n?normalizeNocase(t):normalize(t);this.#fe=e&$;this.nocase=n;this.roots=i;this.root=s||this;this.#pe=a;this.#le=l.fullpath;this.#ce=l.relative;this.#ue=l.relativePosix;this.parent=l.parent;if(this.parent){this.#Dt=this.parent.#Dt}else{this.#Dt=fsFromOption(l.fs)}}depth(){if(this.#ae!==undefined)return this.#ae;if(!this.parent)return this.#ae=0;return this.#ae=this.parent.depth()+1}childrenCache(){return this.#pe}resolve(t){if(!t){return this}const e=this.getRootString(t);const s=t.substring(e.length);const i=s.split(this.splitSep);const n=e?this.getRoot(e).#ge(i):this.#ge(i);return n}#ge(t){let e=this;for(const s of t){e=e.child(s)}return e}children(){const t=this.#pe.get(this);if(t){return t}const e=Object.assign([],{provisional:0});this.#pe.set(this,e);this.#fe&=~B;return e}child(t,e){if(t===""||t==="."){return this}if(t===".."){return this.parent||this}const s=this.children();const i=this.nocase?normalizeNocase(t):normalize(t);for(const t of s){if(t.#oe===i){return t}}const n=this.parent?this.sep:"";const a=this.#le?this.#le+n+t:undefined;const l=this.newChild(t,E,{...e,parent:this,fullpath:a});if(!this.canReaddir()){l.#fe|=W}s.push(l);return l}relative(){if(this.isCWD)return"";if(this.#ce!==undefined){return this.#ce}const t=this.name;const e=this.parent;if(!e){return this.#ce=this.name}const s=e.relative();return s+(!s||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#ue!==undefined)return this.#ue;const t=this.name;const e=this.parent;if(!e){return this.#ue=this.fullpathPosix()}const s=e.relativePosix();return s+(!s||!e.parent?"":"/")+t}fullpath(){if(this.#le!==undefined){return this.#le}const t=this.name;const e=this.parent;if(!e){return this.#le=this.name}const s=e.fullpath();const i=s+(!e.parent?"":this.sep)+t;return this.#le=i}fullpathPosix(){if(this.#he!==undefined)return this.#he;if(this.sep==="/")return this.#he=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(t)){return this.#he=`//?/${t}`}else{return this.#he=t}}const t=this.parent;const e=t.fullpathPosix();const s=e+(!e||!t.parent?"":"/")+this.name;return this.#he=s}isUnknown(){return(this.#fe&U)===E}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#fe&U)===I}isDirectory(){return(this.#fe&U)===k}isCharacterDevice(){return(this.#fe&U)===P}isBlockDevice(){return(this.#fe&U)===O}isFIFO(){return(this.#fe&U)===R}isSocket(){return(this.#fe&U)===M}isSymbolicLink(){return(this.#fe&A)===A}lstatCached(){return this.#fe&L?this:undefined}readlinkCached(){return this.#de}realpathCached(){return this.#me}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#de)return true;if(!this.parent)return false;const t=this.#fe&U;return!(t!==E&&t!==A||this.#fe&D||this.#fe&W)}calledReaddir(){return!!(this.#fe&B)}isENOENT(){return!!(this.#fe&W)}isNamed(t){return!this.nocase?this.#oe===normalize(t):this.#oe===normalizeNocase(t)}async readlink(){const t=this.#de;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=await this.#Dt.promises.readlink(this.fullpath());const e=(await this.parent.realpath())?.resolve(t);if(e){return this.#de=e}}catch(t){this.#ye(t.code);return undefined}}readlinkSync(){const t=this.#de;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=this.#Dt.readlinkSync(this.fullpath());const e=this.parent.realpathSync()?.resolve(t);if(e){return this.#de=e}}catch(t){this.#ye(t.code);return undefined}}#be(t){this.#fe|=B;for(let e=t.provisional;e<t.length;e++){const s=t[e];if(s)s.#we()}}#we(){if(this.#fe&W)return;this.#fe=(this.#fe|W)&N;this.#Se()}#Se(){const t=this.children();t.provisional=0;for(const e of t){e.#we()}}#ve(){this.#fe|=G;this.#_e()}#_e(){if(this.#fe&F)return;let t=this.#fe;if((t&U)===k)t&=N;this.#fe=t|F;this.#Se()}#Ce(t=""){if(t==="ENOTDIR"||t==="EPERM"){this.#_e()}else if(t==="ENOENT"){this.#we()}else{this.children().provisional=0}}#xe(t=""){if(t==="ENOTDIR"){const t=this.parent;t.#_e()}else if(t==="ENOENT"){this.#we()}}#ye(t=""){let e=this.#fe;e|=D;if(t==="ENOENT")e|=W;if(t==="EINVAL"||t==="UNKNOWN"){e&=N}this.#fe=e;if(t==="ENOTDIR"&&this.parent){this.parent.#_e()}}#Te(t,e){return this.#Ee(t,e)||this.#Re(t,e)}#Re(t,e){const s=entToType(t);const i=this.newChild(t.name,s,{parent:this});const n=i.#fe&U;if(n!==k&&n!==A&&n!==E){i.#fe|=F}e.unshift(i);e.provisional++;return i}#Ee(t,e){for(let s=e.provisional;s<e.length;s++){const i=e[s];const n=this.nocase?normalizeNocase(t.name):normalize(t.name);if(n!==i.#oe){continue}return this.#Pe(t,i,s,e)}}#Pe(t,e,s,i){const n=e.name;e.#fe=e.#fe&N|entToType(t);if(n!==t.name)e.name=t.name;if(s!==i.provisional){if(s===i.length-1)i.pop();else i.splice(s,1);i.unshift(e)}i.provisional++;return e}async lstat(){if((this.#fe&W)===0){try{this.#ke(await this.#Dt.promises.lstat(this.fullpath()));return this}catch(t){this.#xe(t.code)}}}lstatSync(){if((this.#fe&W)===0){try{this.#ke(this.#Dt.lstatSync(this.fullpath()));return this}catch(t){this.#xe(t.code)}}}#ke(t){const{atime:e,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:a,blocks:l,ctime:h,ctimeMs:u,dev:f,gid:p,ino:g,mode:b,mtime:w,mtimeMs:S,nlink:v,rdev:x,size:R,uid:P}=t;this.#se=e;this.#Qt=s;this.#ne=i;this.#ee=n;this.#Vt=a;this.#Yt=l;this.#re=h;this.#te=u;this.#Gt=f;this.#qt=p;this.#Kt=g;this.#zt=b;this.#ie=w;this.#Zt=S;this.#$t=v;this.#Ht=x;this.#Xt=R;this.#Jt=P;const O=entToType(t);this.#fe=this.#fe&N|O|L;if(O!==E&&O!==k&&O!==A){this.#fe|=F}}#Oe=[];#Ie=false;#Ae(t){this.#Ie=false;const e=this.#Oe.slice();this.#Oe.length=0;e.forEach((e=>e(null,t)))}readdirCB(t,e=false){if(!this.canReaddir()){if(e)t(null,[]);else queueMicrotask((()=>t(null,[])));return}const s=this.children();if(this.calledReaddir()){const i=s.slice(0,s.provisional);if(e)t(null,i);else queueMicrotask((()=>t(null,i)));return}this.#Oe.push(t);if(this.#Ie){return}this.#Ie=true;const i=this.fullpath();this.#Dt.readdir(i,{withFileTypes:true},((t,e)=>{if(t){this.#Ce(t.code);s.provisional=0}else{for(const t of e){this.#Te(t,s)}this.#be(s)}this.#Ae(s.slice(0,s.provisional));return}))}#Me;async readdir(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();if(this.#Me){await this.#Me}else{let resolve=()=>{};this.#Me=new Promise((t=>resolve=t));try{for(const s of await this.#Dt.promises.readdir(e,{withFileTypes:true})){this.#Te(s,t)}this.#be(t)}catch(e){this.#Ce(e.code);t.provisional=0}this.#Me=undefined;resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();try{for(const s of this.#Dt.readdirSync(e,{withFileTypes:true})){this.#Te(s,t)}this.#be(t)}catch(e){this.#Ce(e.code);t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#fe&z)return false;const t=U&this.#fe;if(!(t===E||t===k||t===A)){return false}return true}shouldWalk(t,e){return(this.#fe&k)===k&&!(this.#fe&z)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#me)return this.#me;if((G|D|W)&this.#fe)return undefined;try{const t=await this.#Dt.promises.realpath(this.fullpath());return this.#me=this.resolve(t)}catch(t){this.#ve()}}realpathSync(){if(this.#me)return this.#me;if((G|D|W)&this.#fe)return undefined;try{const t=this.#Dt.realpathSync(this.fullpath());return this.#me=this.resolve(t)}catch(t){this.#ve()}}[X](t){if(t===this)return;t.isCWD=false;this.isCWD=true;const e=new Set([]);let s=[];let i=this;while(i&&i.parent){e.add(i);i.#ce=s.join(this.sep);i.#ue=s.join("/");i=i.parent;s.push("..")}i=t;while(i&&i.parent&&!e.has(i)){i.#ce=undefined;i.#ue=undefined;i=i.parent}}}e.PathBase=PathBase;class PathWin32 extends PathBase{sep="\\";splitSep=x;constructor(t,e=E,s,i,n,a,l){super(t,e,s,i,n,a,l)}newChild(t,e=E,s={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return h.win32.parse(t).root}getRoot(t){t=uncToDrive(t.toUpperCase());if(t===this.root.name){return this.root}for(const[e,s]of Object.entries(this.roots)){if(this.sameRoot(t,e)){return this.roots[t]=s}}return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){t=t.toUpperCase().replace(/\//g,"\\").replace(v,"$1\\");return t===e}}e.PathWin32=PathWin32;class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=E,s,i,n,a,l){super(t,e,s,i,n,a,l)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=E,s={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),s)}}e.PathPosix=PathPosix;class PathScurryBase{root;rootPath;roots;cwd;#Ue;#Ne;#pe;nocase;#Dt;constructor(t=process.cwd(),e,s,{nocase:i,childrenCacheSize:n=16*1024,fs:a=S}={}){this.#Dt=fsFromOption(a);if(t instanceof URL||t.startsWith("file://")){t=(0,u.fileURLToPath)(t)}const l=e.resolve(t);this.roots=Object.create(null);this.rootPath=this.parseRootPath(l);this.#Ue=new ResolveCache;this.#Ne=new ResolveCache;this.#pe=new ChildrenCache(n);const h=l.substring(this.rootPath.length).split(s);if(h.length===1&&!h[0]){h.pop()}if(i===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=i;this.root=this.newRoot(this.#Dt);this.roots[this.rootPath]=this.root;let f=this.root;let p=h.length-1;const g=e.sep;let b=this.rootPath;let w=false;for(const t of h){const e=p--;f=f.child(t,{relative:new Array(e).fill("..").join(g),relativePosix:new Array(e).fill("..").join("/"),fullpath:b+=(w?"":g)+t});w=true}this.cwd=f}depth(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.depth()}childrenCache(){return this.#pe}resolve(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#Ue.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpath();this.#Ue.set(e,i);return i}resolvePosix(...t){let e="";for(let s=t.length-1;s>=0;s--){const i=t[s];if(!i||i===".")continue;e=e?`${i}/${e}`:i;if(this.isAbsolute(i)){break}}const s=this.#Ne.get(e);if(s!==undefined){return s}const i=this.cwd.resolve(e).fullpathPosix();this.#Ne.set(e,i);return i}relative(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relative()}relativePosix(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relativePosix()}basename(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.name}dirname(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s}=e;if(!t.canReaddir()){return[]}else{const e=await t.readdir();return s?e:e.map((t=>t.name))}}readdirSync(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true}=e;if(!t.canReaddir()){return[]}else if(s){return t.readdirSync()}else{return t.readdirSync().map((t=>t.name))}}async lstat(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstat()}lstatSync(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.readlink();return e?s:s?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.readlinkSync();return e?s:s?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=await t.realpath();return e?s:s?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const s=t.realpathSync();return e?s:s?.fullpath()}async walk(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:a}=e;const l=[];if(!n||n(t)){l.push(s?t:t.fullpath())}const h=new Set;const walk=(t,e)=>{h.add(t);t.readdirCB(((t,u)=>{if(t){return e(t)}let f=u.length;if(!f)return e();const next=()=>{if(--f===0){e()}};for(const t of u){if(!n||n(t)){l.push(s?t:t.fullpath())}if(i&&t.isSymbolicLink()){t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(h,a)?walk(t,next):next()))}else{if(t.shouldWalk(h,a)){walk(t,next)}else{next()}}}}),true)};const u=t;return new Promise(((t,e)=>{walk(u,(s=>{if(s)return e(s);t(l)}))}))}walkSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:a}=e;const l=[];if(!n||n(t)){l.push(s?t:t.fullpath())}const h=new Set([t]);for(const t of h){const e=t.readdirSync();for(const t of e){if(!n||n(t)){l.push(s?t:t.fullpath())}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(h,a)){h.add(e)}}}return l}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}return this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:a}=e;if(!n||n(t)){yield s?t:t.fullpath()}const l=new Set([t]);for(const t of l){const e=t.readdirSync();for(const t of e){if(!n||n(t)){yield s?t:t.fullpath()}let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(l,a)){l.add(e)}}}}stream(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:a}=e;const l=new w.Minipass({objectMode:true});if(!n||n(t)){l.write(s?t:t.fullpath())}const h=new Set;const u=[t];let f=0;const process=()=>{let t=false;while(!t){const e=u.shift();if(!e){if(f===0)l.end();return}f++;h.add(e);const onReaddir=(e,g,b=false)=>{if(e)return l.emit("error",e);if(i&&!b){const t=[];for(const e of g){if(e.isSymbolicLink()){t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)))}}if(t.length){Promise.all(t).then((()=>onReaddir(null,g,true)));return}}for(const e of g){if(e&&(!n||n(e))){if(!l.write(s?e:e.fullpath())){t=true}}}f--;for(const t of g){const e=t.realpathCached()||t;if(e.shouldWalk(h,a)){u.push(e)}}if(t&&!l.flowing){l.once("drain",process)}else if(!p){process()}};let p=true;e.readdirCB(onReaddir,true);p=false}};process();return l}streamSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:s=true,follow:i=false,filter:n,walkFilter:a}=e;const l=new w.Minipass({objectMode:true});const h=new Set;if(!n||n(t)){l.write(s?t:t.fullpath())}const u=[t];let f=0;const process=()=>{let t=false;while(!t){const e=u.shift();if(!e){if(f===0)l.end();return}f++;h.add(e);const p=e.readdirSync();for(const e of p){if(!n||n(e)){if(!l.write(s?e:e.fullpath())){t=true}}}f--;for(const t of p){let e=t;if(t.isSymbolicLink()){if(!(i&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(h,a)){u.push(e)}}}if(t&&!l.flowing)l.once("drain",process)};process();return l}chdir(t=this.cwd){const e=this.cwd;this.cwd=typeof t==="string"?this.cwd.resolve(t):t;this.cwd[X](e)}}e.PathScurryBase=PathScurryBase;class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,h.win32,"\\",{...e,nocase:s});this.nocase=s;for(let t=this.cwd;t;t=t.parent){t.nocase=this.nocase}}parseRootPath(t){return h.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,k,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}e.PathScurryWin32=PathScurryWin32;class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:s=false}=e;super(t,h.posix,"/",{...e,nocase:s});this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,k,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}e.PathScurryPosix=PathScurryPosix;class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:s=true}=e;super(t,{...e,nocase:s})}}e.PathScurryDarwin=PathScurryDarwin;e.Path=process.platform==="win32"?PathWin32:PathPosix;e.PathScurry=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix}};var e={};function __nccwpck_require__(s){var i=e[s];if(i!==undefined){return i.exports}var n=e[s]={exports:{}};var a=true;try{t[s].call(n.exports,n,n.exports,__nccwpck_require__);a=false}finally{if(a)delete e[s]}return n.exports}__nccwpck_require__.m=t;(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var e;__nccwpck_require__.t=function(s,i){if(i&1)s=this(s);if(i&8)return s;if(typeof s==="object"&&s){if(i&4&&s.__esModule)return s;if(i&16&&typeof s.then==="function")return s}var n=Object.create(null);__nccwpck_require__.r(n);var a={};e=e||[null,t({}),t([]),t(t)];for(var l=i&2&&s;typeof l=="object"&&!~e.indexOf(l);l=t(l)){Object.getOwnPropertyNames(l).forEach((t=>a[t]=()=>s[t]))}a["default"]=()=>s;__nccwpck_require__.d(n,a);return n}})();(()=>{__nccwpck_require__.d=(t,e)=>{for(var s in e){if(__nccwpck_require__.o(e,s)&&!__nccwpck_require__.o(t,s)){Object.defineProperty(t,s,{enumerable:true,get:e[s]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=t=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((e,s)=>{__nccwpck_require__.f[s](t,e);return e}),[]))})();(()=>{__nccwpck_require__.u=t=>""+t+".index.js"})();(()=>{__nccwpck_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";(()=>{var t={792:1};var installChunk=e=>{var s=e.modules,i=e.ids,n=e.runtime;for(var a in s){if(__nccwpck_require__.o(s,a)){__nccwpck_require__.m[a]=s[a]}}if(n)n(__nccwpck_require__);for(var l=0;l<i.length;l++)t[i[l]]=1};__nccwpck_require__.f.require=(e,s)=>{if(!t[e]){if(true){installChunk(require("./"+__nccwpck_require__.u(e)))}else t[e]=1}}})();var s={};(()=>{var t=s;Object.defineProperty(t,"__esModule",{value:true});const e=__nccwpck_require__(7294);const i=__nccwpck_require__(8010);function getRequiredArgValue(t,e,s){const i=t[e+1];if(!i||i.startsWith("-")){console.error(`Error: Missing value for argument ${s}`);return null}return i}function printUsage(){console.log(`\n@testream/junit-reporter - Convert JUnit XML to CTRF and upload to Testream\n\nUsage:\n npx @testream/junit-reporter [options]\n\nUpload arguments (required unless --no-upload):\n --api-key, -k API key for authentication\n\nConversion options:\n --junit-path, -j Path or glob to JUnit XML file(s) (default: ${e.DEFAULT_JUNIT_PATH})\n --output-dir Output directory for CTRF report (default: ctrf)\n --output-file CTRF file name (default: ctrf-report.json)\n\nGit context (auto-detected in CI):\n --branch Git branch name\n --commit-sha Git commit SHA\n --repository-url Git repository URL\n\nBuild metadata (auto-detected in CI):\n --build-name Build name/identifier\n --build-number Build number\n --build-url Build URL (CI pipeline URL)\n\nEnvironment metadata:\n --test-environment Test environment (e.g., staging, production, ci)\n --app-name Application name under test\n --app-version Application version under test\n --test-type Test type (e.g., unit, integration, e2e)\n\nUpload options:\n --no-upload Skip uploading CTRF results\n --fail-on-error Fail process if upload fails\n\nOther:\n --help, -h Show help message\n\nExamples:\n # Convert and upload using the default Maven path\n npx @testream/junit-reporter -k your-api-key\n\n # Convert only (no upload) with a custom XML path\n npx @testream/junit-reporter -j ./reports/junit.xml --no-upload\n`)}function parseArgs(t){const s={junitPath:e.DEFAULT_JUNIT_PATH,uploadEnabled:true,failOnUploadError:false};for(let e=0;e<t.length;e++){const i=t[e];switch(i){case"--help":case"-h":printUsage();process.exit(0);break;case"--junit-path":case"-j":{const i=getRequiredArgValue(t,e,"--junit-path");if(!i){return null}s.junitPath=i;e++;break}case"--api-key":case"-k":{const i=getRequiredArgValue(t,e,"--api-key");if(!i){return null}s.apiKey=i;e++;break}case"--output-dir":{const i=getRequiredArgValue(t,e,"--output-dir");if(!i){return null}s.outputDir=i;e++;break}case"--output-file":{const i=getRequiredArgValue(t,e,"--output-file");if(!i){return null}s.outputFile=i;e++;break}case"--branch":{const i=getRequiredArgValue(t,e,"--branch");if(!i){return null}s.branch=i;e++;break}case"--commit-sha":{const i=getRequiredArgValue(t,e,"--commit-sha");if(!i){return null}s.commitSha=i;e++;break}case"--repository-url":{const i=getRequiredArgValue(t,e,"--repository-url");if(!i){return null}s.repositoryUrl=i;e++;break}case"--build-name":{const i=getRequiredArgValue(t,e,"--build-name");if(!i){return null}s.buildName=i;e++;break}case"--build-number":{const i=getRequiredArgValue(t,e,"--build-number");if(!i){return null}s.buildNumber=i;e++;break}case"--build-url":{const i=getRequiredArgValue(t,e,"--build-url");if(!i){return null}s.buildUrl=i;e++;break}case"--test-environment":{const i=getRequiredArgValue(t,e,"--test-environment");if(!i){return null}s.testEnvironment=i;e++;break}case"--app-name":{const i=getRequiredArgValue(t,e,"--app-name");if(!i){return null}s.appName=i;e++;break}case"--app-version":{const i=getRequiredArgValue(t,e,"--app-version");if(!i){return null}s.appVersion=i;e++;break}case"--test-type":{const i=getRequiredArgValue(t,e,"--test-type");if(!i){return null}s.testType=i;e++;break}case"--no-upload":s.uploadEnabled=false;break;case"--fail-on-error":s.failOnUploadError=true;break;default:if(i.startsWith("-")){console.error(`Unknown argument: ${i}`);return null}break}}if(s.uploadEnabled&&!s.apiKey){console.error("Error: Missing required argument: --api-key (unless --no-upload is set)");return null}return s}async function main(){const t=process.argv.slice(2);if(t.length===0){printUsage();process.exit(1)}const e=parseArgs(t);if(!e){process.exit(1)}try{const t=await runConversion(e);if(!e.uploadEnabled){console.info("Upload disabled, skipping upload");return}await runUpload(e,t)}catch(t){const e=t instanceof Error?t.message:String(t);console.error(`Error: ${e}`);process.exit(1)}}async function runConversion(t){console.info("Converting JUnit XML to CTRF...");const s=await(0,e.convertJUnitToCtrf)({junitPath:t.junitPath,outputDir:t.outputDir,outputFile:t.outputFile});console.info(` Source files: ${s.sourceFiles.length}`);console.info(` CTRF output: ${s.reportPath}`);console.info(` Tests: ${s.report.results.summary.tests}`);console.info(` Passed: ${s.report.results.summary.passed}`);console.info(` Failed: ${s.report.results.summary.failed}`);console.info(` Skipped: ${s.report.results.summary.skipped}`);return s}async function runUpload(t,e){console.info("Uploading CTRF report to Testream...");const s=await(0,i.uploadCtrfReport)({report:e.report,apiKey:t.apiKey,apiUrl:t.apiUrl,branch:t.branch,commitSha:t.commitSha,repositoryUrl:t.repositoryUrl,buildName:t.buildName,buildNumber:t.buildNumber,buildUrl:t.buildUrl,testEnvironment:t.testEnvironment,appName:t.appName,appVersion:t.appVersion,testType:t.testType});if(!s.success){console.error(`Upload failed: ${s.error||"Unknown upload error"}`);if(t.failOnUploadError){process.exit(1)}return}if(s.alreadyExists){console.info(`Report already exists (reportId: ${s.reportId})`);return}console.info("Upload complete");console.info(` Report ID: ${s.reportId}`);if(s.testRunId){console.info(` Test Run ID: ${s.testRunId}`)}}main()})();module.exports=s})();
|