@cmflow/atlas 3.4.0-beta.18 → 3.4.0-beta.19

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.
@@ -0,0 +1,4 @@
1
+ import { fileURLToPath as __atlasFileURLToPath } from "node:url";
2
+ const __filename = __atlasFileURLToPath(import.meta.url);
3
+ import{t as e}from"./taskProgressService-Qw3ExHJI.mjs";const t=new class{async fetch(e,t){let n={accept:`application/json`,...t?.headers},r=await fetch(e,{...t,headers:n});if(!r.ok)throw Error(`Unable to fetch ${e}: ${r.status} ${r.statusText}`);if(t?.onProgress){let e=r.body?.getReader();if(!e)return r.json();let n=new TextDecoder,i=``;for(;;){let{done:r,value:a}=await e.read();if(r)break;i+=n.decode(a,{stream:!0}),t.onProgress(i)}return i+n.decode()}return r}async get(e,t){return(await this.fetch(e,t)).json()}};async function n(n,r){try{let i=await t.fetch(n,{signal:r?AbortSignal.timeout(r):void 0,onProgress(t){e.log(`Downloading (${(t.length/1048576).toFixed(1)} MB)`)}});return!i||typeof i==`object`?i:(e.log(`Parsing document`),JSON.parse(i))}catch(e){throw e instanceof Error&&(e.name===`AbortError`||e.name===`TimeoutError`)?Error(`OpenAPI download timed out after ${r}ms: ${n}`):Error(`Unable to fetch OpenAPI document from ${n}: ${e instanceof Error?e.message:String(e)}`)}}function r(e,t){if(!e||typeof e!=`object`||typeof e.$ref!=`string`||!e.$ref.startsWith(`#/`))return e;let n=t;for(let t of e.$ref.replace(`#/`,``).split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)))if(n=n?.[t],n===void 0)return e;return n}function i(e){return/^\d+$/.test(e)&&Number(e)>=200&&Number(e)<=299}function a(e,t){if(!e||typeof e!=`object`)return;if(e[`application/json`]?.schema)return r(e[`application/json`].schema,t);let n=Object.values(e).find(e=>e?.schema);return n?r(n.schema,t):void 0}function o(e,t,n=``){let i=r(e,t);if(!i||typeof i!=`object`)return[];if(Array.isArray(i.allOf))return i.allOf.flatMap(e=>o(e,t,n));if(i.type===`array`||i.items){let e=n?`${n}[]`:`[]`;return o(i.items,t,e)}let a=i.properties||{};return Object.keys(a).length?Object.entries(a).flatMap(([e,r])=>o(r,t,n?`${n}.${e}`:e)):n?[{path:n,description:i.description,deprecated:i.deprecated}]:[]}function s(e){return e===`query`?`QUERY`:e===`path`?`PATH`:e===`header`?`HEADER`:null}function c(e,t){let n=new Map,i=Array.isArray(e.parameters)?e.parameters:[];for(let e of i){let i=r(e,t),a=s(i?.in);if(!i||!a||!i.name)continue;let c=o(i.schema,t,i.name),l=c.length?c:[{path:i.name,description:i.description,deprecated:i.deprecated}];for(let e of l)n.set(`${a}:${e.path}`,{path:e.path,description:e.description||i.description,deprecated:e.deprecated??i.deprecated??!1,type:a})}let c=r(e.requestBody,t);if(c?.content){let e=a(c.content,t);for(let r of o(e,t))n.set(`BODY:${r.path}`,{path:r.path,description:r.description||c.description,deprecated:r.deprecated??!1,type:`BODY`})}return[...n.values()]}function l(e,t){let n=new Map,s=e?.responses||{};for(let[e,c]of Object.entries(s)){if(!i(e))continue;let s=r(c,t),l=a(s?.content,t);for(let e of o(l,t))n.set(e.path,{path:e.path,description:e.description||s?.description,deprecated:e.deprecated??!1,type:`RESPONSE_BODY`})}return[...n.values()]}function u(e){let t=new Map;for(let[n,r]of Object.entries(e.paths||{}))for(let[i,a]of Object.entries(r||{})){if(!/^(get|post|put|patch|delete|head|options)$/i.test(i))continue;let r=i.toUpperCase();for(let i of[...c(a,e),...l(a,e)]){let e=`${r}:${n}:${i.path}`;t.has(e)||t.set(e,{route:n,method:r,field:i.path,description:i.description})}}return[...t.values()]}export{t as a,n as i,c as n,l as r,u as t};
4
+ //# sourceMappingURL=propertyExtractionService-Bg6xKCTu.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propertyExtractionService-Bg6xKCTu.mjs","names":[],"sources":["../src/services/http/httpClient.ts","../src/services/openapi/loadOpenApiDocument.ts","../src/services/openapi/schemaService.ts","../src/services/openapi/propertyExtractionService.ts"],"sourcesContent":["class HttpClient {\n async fetch(url: string, init: RequestInit & { onProgress: (content: string) => void }): Promise<string | unknown>;\n async fetch(url: string, init?: RequestInit): Promise<Response>;\n async fetch(url: string, init?: RequestInit & { onProgress?: (content: string) => void }): Promise<Response | string | unknown> {\n const headers = { accept: \"application/json\", ...init?.headers };\n\n const response = await fetch(url, {\n ...init,\n headers\n });\n\n if (!response.ok) {\n throw new Error(`Unable to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n\n if (init?.onProgress) {\n const reader = response.body?.getReader();\n\n if (!reader) {\n return response.json() as unknown;\n }\n\n const decoder = new TextDecoder();\n let content = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n content += decoder.decode(value, { stream: true });\n\n init.onProgress(content);\n }\n\n return content + decoder.decode();\n }\n\n return response;\n }\n\n async get<T>(url: string, init?: RequestInit): Promise<T> {\n const response = await this.fetch(url, init);\n return response.json() as Promise<T>;\n }\n}\n\nexport const httpClient = new HttpClient();\n","import { httpClient } from \"../http/httpClient\";\nimport { taskProgressService } from \"../tasks/taskProgressService\";\n\nexport type OpenApiDocument = {\n info?: { version?: string };\n paths?: Record<string, Record<string, any>>;\n components?: Record<string, any>;\n};\n\nexport async function loadOpenApiDocument(url: string, timeoutMs?: number): Promise<OpenApiDocument> {\n try {\n const content = await httpClient.fetch(url, {\n signal: timeoutMs ? AbortSignal.timeout(timeoutMs) : undefined,\n onProgress(content) {\n taskProgressService.log(`Downloading (${(content.length / 1_048_576).toFixed(1)} MB)`);\n }\n });\n\n if (!content || typeof content === \"object\") {\n return content as OpenApiDocument;\n }\n\n taskProgressService.log(\"Parsing document\");\n\n return JSON.parse(content as string) as OpenApiDocument;\n } catch (error) {\n if (error instanceof Error && (error.name === \"AbortError\" || error.name === \"TimeoutError\")) {\n throw new Error(`OpenAPI download timed out after ${timeoutMs}ms: ${url}`);\n }\n\n throw new Error(`Unable to fetch OpenAPI document from ${url}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n","import type { OpenApiDocument } from \"./loadOpenApiDocument\";\n\nexport function resolveOpenApiReference(value: any, swagger: OpenApiDocument): any {\n if (!value || typeof value !== \"object\" || typeof value.$ref !== \"string\" || !value.$ref.startsWith(\"#/\")) {\n return value;\n }\n let current: any = swagger;\n for (const segment of value.$ref\n .replace(\"#/\", \"\")\n .split(\"/\")\n .map((part: string) => part.replace(/~1/g, \"/\").replace(/~0/g, \"~\"))) {\n current = current?.[segment];\n if (current === undefined) {\n return value;\n }\n }\n return current;\n}\n","import type { BackendProperty, ExtractedApiProperty } from \"../../models/types\";\nimport type { OpenApiDocument } from \"./loadOpenApiDocument\";\nimport { resolveOpenApiReference } from \"./schemaService\";\n\ntype OpenApiLeafProperty = {\n path: string;\n description?: string;\n deprecated?: boolean;\n};\n\nfunction isSuccessStatusCode(statusCode: string): boolean {\n return /^\\d+$/.test(statusCode) && Number(statusCode) >= 200 && Number(statusCode) <= 299;\n}\n\nfunction selectPreferredSchema(content: any, swagger: OpenApiDocument): any {\n if (!content || typeof content !== \"object\") {\n return undefined;\n }\n\n if (content[\"application/json\"]?.schema) {\n return resolveOpenApiReference(content[\"application/json\"].schema, swagger);\n }\n\n const firstSchema = Object.values(content).find((entry: any) => entry?.schema) as any;\n return firstSchema ? resolveOpenApiReference(firstSchema.schema, swagger) : undefined;\n}\n\nfunction extractLeafProperties(schema: any, swagger: OpenApiDocument, currentPath = \"\"): OpenApiLeafProperty[] {\n const resolvedSchema = resolveOpenApiReference(schema, swagger);\n\n if (!resolvedSchema || typeof resolvedSchema !== \"object\") {\n return [];\n }\n\n if (Array.isArray(resolvedSchema.allOf)) {\n return resolvedSchema.allOf.flatMap((item: any) => extractLeafProperties(item, swagger, currentPath));\n }\n\n if (resolvedSchema.type === \"array\" || resolvedSchema.items) {\n const arrayPath = currentPath ? `${currentPath}[]` : \"[]\";\n return extractLeafProperties(resolvedSchema.items, swagger, arrayPath);\n }\n\n const properties = resolvedSchema.properties || {};\n if (!Object.keys(properties).length) {\n return currentPath\n ? [\n {\n path: currentPath,\n description: resolvedSchema.description,\n deprecated: resolvedSchema.deprecated\n }\n ]\n : [];\n }\n\n return Object.entries(properties).flatMap(([propertyName, propertySchema]: [string, any]) => {\n const nextPath = currentPath ? `${currentPath}.${propertyName}` : propertyName;\n return extractLeafProperties(propertySchema, swagger, nextPath);\n });\n}\n\nfunction mapInputType(inType?: string): ExtractedApiProperty[\"type\"] | null {\n if (inType === \"query\") {\n return \"QUERY\";\n }\n if (inType === \"path\") {\n return \"PATH\";\n }\n if (inType === \"header\") {\n return \"HEADER\";\n }\n return null;\n}\n\nexport function extractOpenApiInputProperties(operation: any, swagger: OpenApiDocument): ExtractedApiProperty[] {\n const map = new Map<string, ExtractedApiProperty>();\n const parameters = Array.isArray(operation.parameters) ? operation.parameters : [];\n\n for (const rawParameter of parameters) {\n const parameter = resolveOpenApiReference(rawParameter, swagger);\n const inputType = mapInputType(parameter?.in);\n if (!parameter || !inputType || !parameter.name) {\n continue;\n }\n\n const properties = extractLeafProperties(parameter.schema, swagger, parameter.name);\n const resolvedProperties = properties.length\n ? properties\n : [\n {\n path: parameter.name,\n description: parameter.description,\n deprecated: parameter.deprecated\n }\n ];\n\n for (const property of resolvedProperties) {\n map.set(`${inputType}:${property.path}`, {\n path: property.path,\n description: property.description || parameter.description,\n deprecated: property.deprecated ?? parameter.deprecated ?? false,\n type: inputType\n });\n }\n }\n\n const requestBody = resolveOpenApiReference(operation.requestBody, swagger);\n if (requestBody?.content) {\n const schema = selectPreferredSchema(requestBody.content, swagger);\n for (const property of extractLeafProperties(schema, swagger)) {\n map.set(`BODY:${property.path}`, {\n path: property.path,\n description: property.description || requestBody.description,\n deprecated: property.deprecated ?? false,\n type: \"BODY\"\n });\n }\n }\n\n return [...map.values()];\n}\n\nexport function extractOpenApiOutputProperties(operation: any, swagger: OpenApiDocument): ExtractedApiProperty[] {\n const map = new Map<string, ExtractedApiProperty>();\n const responses = operation?.responses || {};\n\n for (const [statusCode, rawResponse] of Object.entries(responses)) {\n if (!isSuccessStatusCode(statusCode)) {\n continue;\n }\n\n const response = resolveOpenApiReference(rawResponse, swagger);\n const schema = selectPreferredSchema(response?.content, swagger);\n for (const property of extractLeafProperties(schema, swagger)) {\n map.set(property.path, {\n path: property.path,\n description: property.description || response?.description,\n deprecated: property.deprecated ?? false,\n type: \"RESPONSE_BODY\"\n });\n }\n }\n\n return [...map.values()];\n}\n\nexport function extractOpenApiBackendProperties(swagger: OpenApiDocument): BackendProperty[] {\n const properties = new Map<string, BackendProperty>();\n for (const [route, pathItem] of Object.entries(swagger.paths || {})) {\n for (const [rawMethod, operation] of Object.entries(pathItem || {})) {\n if (!/^(get|post|put|patch|delete|head|options)$/i.test(rawMethod)) {\n continue;\n }\n const method = rawMethod.toUpperCase();\n for (const property of [\n ...extractOpenApiInputProperties(operation, swagger),\n ...extractOpenApiOutputProperties(operation, swagger)\n ]) {\n const key = `${method}:${route}:${property.path}`;\n if (!properties.has(key)) {\n properties.set(key, {\n route,\n method,\n field: property.path,\n description: property.description\n });\n }\n }\n }\n }\n return [...properties.values()];\n}\n"],"mappings":";;uDAgDA,MAAa,EAAa,IAAI,KAhDb,CAGf,MAAM,MAAM,EAAa,EAAuG,CAC9H,IAAM,EAAU,CAAE,OAAQ,mBAAoB,GAAG,GAAM,OAAQ,EAEzD,EAAW,MAAM,MAAM,EAAK,CAChC,GAAG,EACH,SACF,CAAC,EAED,GAAI,CAAC,EAAS,GACZ,MAAU,MAAM,mBAAmB,EAAI,IAAI,EAAS,OAAO,GAAG,EAAS,YAAY,EAGrF,GAAI,GAAM,WAAY,CACpB,IAAM,EAAS,EAAS,MAAM,UAAU,EAExC,GAAI,CAAC,EACH,OAAO,EAAS,KAAK,EAGvB,IAAM,EAAU,IAAI,YAChB,EAAU,GAEd,OAAa,CACX,GAAM,CAAE,OAAM,SAAU,MAAM,EAAO,KAAK,EAC1C,GAAI,EACF,MAGF,GAAW,EAAQ,OAAO,EAAO,CAAE,OAAQ,EAAK,CAAC,EAEjD,EAAK,WAAW,CAAO,CACzB,CAEA,OAAO,EAAU,EAAQ,OAAO,CAClC,CAEA,OAAO,CACT,CAEA,MAAM,IAAO,EAAa,EAAgC,CAExD,OAAO,MADgB,KAAK,MAAM,EAAK,CAAI,EAAA,CAC3B,KAAK,CACvB,CACF,ECrCA,eAAsB,EAAoB,EAAa,EAA8C,CACnG,GAAI,CACF,IAAM,EAAU,MAAM,EAAW,MAAM,EAAK,CAC1C,OAAQ,EAAY,YAAY,QAAQ,CAAS,EAAI,IAAA,GACrD,WAAW,EAAS,CAClB,EAAoB,IAAI,iBAAiB,EAAQ,OAAS,QAAA,CAAW,QAAQ,CAAC,EAAE,KAAK,CACvF,CACF,CAAC,EAQD,MANI,CAAC,GAAW,OAAO,GAAY,SAC1B,GAGT,EAAoB,IAAI,kBAAkB,EAEnC,KAAK,MAAM,CAAiB,EACrC,OAAS,EAAO,CAKd,MAJI,aAAiB,QAAU,EAAM,OAAS,cAAgB,EAAM,OAAS,gBACjE,MAAM,oCAAoC,EAAU,MAAM,GAAK,EAGjE,MAAM,yCAAyC,EAAI,IAAI,aAAiB,MAAQ,EAAM,QAAU,OAAO,CAAK,GAAG,CAC3H,CACF,CC9BA,SAAgB,EAAwB,EAAY,EAA+B,CACjF,GAAI,CAAC,GAAS,OAAO,GAAU,UAAY,OAAO,EAAM,MAAS,UAAY,CAAC,EAAM,KAAK,WAAW,IAAI,EACtG,OAAO,EAET,IAAI,EAAe,EACnB,IAAK,IAAM,KAAW,EAAM,KACzB,QAAQ,KAAM,EAAE,CAAC,CACjB,MAAM,GAAG,CAAC,CACV,IAAK,GAAiB,EAAK,QAAQ,MAAO,GAAG,CAAC,CAAC,QAAQ,MAAO,GAAG,CAAC,EAEnE,GADA,EAAU,IAAU,GAChB,IAAY,IAAA,GACd,OAAO,EAGX,OAAO,CACT,CCPA,SAAS,EAAoB,EAA6B,CACxD,MAAO,QAAQ,KAAK,CAAU,GAAK,OAAO,CAAU,GAAK,KAAO,OAAO,CAAU,GAAK,GACxF,CAEA,SAAS,EAAsB,EAAc,EAA+B,CAC1E,GAAI,CAAC,GAAW,OAAO,GAAY,SACjC,OAGF,GAAI,EAAQ,mBAAmB,EAAE,OAC/B,OAAO,EAAwB,EAAQ,mBAAmB,CAAC,OAAQ,CAAO,EAG5E,IAAM,EAAc,OAAO,OAAO,CAAO,CAAC,CAAC,KAAM,GAAe,GAAO,MAAM,EAC7E,OAAO,EAAc,EAAwB,EAAY,OAAQ,CAAO,EAAI,IAAA,EAC9E,CAEA,SAAS,EAAsB,EAAa,EAA0B,EAAc,GAA2B,CAC7G,IAAM,EAAiB,EAAwB,EAAQ,CAAO,EAE9D,GAAI,CAAC,GAAkB,OAAO,GAAmB,SAC/C,MAAO,CAAC,EAGV,GAAI,MAAM,QAAQ,EAAe,KAAK,EACpC,OAAO,EAAe,MAAM,QAAS,GAAc,EAAsB,EAAM,EAAS,CAAW,CAAC,EAGtG,GAAI,EAAe,OAAS,SAAW,EAAe,MAAO,CAC3D,IAAM,EAAY,EAAc,GAAG,EAAY,IAAM,KACrD,OAAO,EAAsB,EAAe,MAAO,EAAS,CAAS,CACvE,CAEA,IAAM,EAAa,EAAe,YAAc,CAAC,EAajD,OAZK,OAAO,KAAK,CAAU,CAAC,CAAC,OAYtB,OAAO,QAAQ,CAAU,CAAC,CAAC,SAAS,CAAC,EAAc,KAEjD,EAAsB,EAAgB,EAD5B,EAAc,GAAG,EAAY,GAAG,IAAiB,CACJ,CAC/D,EAdQ,EACH,CACE,CACE,KAAM,EACN,YAAa,EAAe,YAC5B,WAAY,EAAe,UAC7B,CACF,EACA,CAAC,CAOT,CAEA,SAAS,EAAa,EAAsD,CAU1E,OATI,IAAW,QACN,QAEL,IAAW,OACN,OAEL,IAAW,SACN,SAEF,IACT,CAEA,SAAgB,EAA8B,EAAgB,EAAkD,CAC9G,IAAM,EAAM,IAAI,IACV,EAAa,MAAM,QAAQ,EAAU,UAAU,EAAI,EAAU,WAAa,CAAC,EAEjF,IAAK,IAAM,KAAgB,EAAY,CACrC,IAAM,EAAY,EAAwB,EAAc,CAAO,EACzD,EAAY,EAAa,GAAW,EAAE,EAC5C,GAAI,CAAC,GAAa,CAAC,GAAa,CAAC,EAAU,KACzC,SAGF,IAAM,EAAa,EAAsB,EAAU,OAAQ,EAAS,EAAU,IAAI,EAC5E,EAAqB,EAAW,OAClC,EACA,CACE,CACE,KAAM,EAAU,KAChB,YAAa,EAAU,YACvB,WAAY,EAAU,UACxB,CACF,EAEJ,IAAK,IAAM,KAAY,EACrB,EAAI,IAAI,GAAG,EAAU,GAAG,EAAS,OAAQ,CACvC,KAAM,EAAS,KACf,YAAa,EAAS,aAAe,EAAU,YAC/C,WAAY,EAAS,YAAc,EAAU,YAAc,GAC3D,KAAM,CACR,CAAC,CAEL,CAEA,IAAM,EAAc,EAAwB,EAAU,YAAa,CAAO,EAC1E,GAAI,GAAa,QAAS,CACxB,IAAM,EAAS,EAAsB,EAAY,QAAS,CAAO,EACjE,IAAK,IAAM,KAAY,EAAsB,EAAQ,CAAO,EAC1D,EAAI,IAAI,QAAQ,EAAS,OAAQ,CAC/B,KAAM,EAAS,KACf,YAAa,EAAS,aAAe,EAAY,YACjD,WAAY,EAAS,YAAc,GACnC,KAAM,MACR,CAAC,CAEL,CAEA,MAAO,CAAC,GAAG,EAAI,OAAO,CAAC,CACzB,CAEA,SAAgB,EAA+B,EAAgB,EAAkD,CAC/G,IAAM,EAAM,IAAI,IACV,EAAY,GAAW,WAAa,CAAC,EAE3C,IAAK,GAAM,CAAC,EAAY,KAAgB,OAAO,QAAQ,CAAS,EAAG,CACjE,GAAI,CAAC,EAAoB,CAAU,EACjC,SAGF,IAAM,EAAW,EAAwB,EAAa,CAAO,EACvD,EAAS,EAAsB,GAAU,QAAS,CAAO,EAC/D,IAAK,IAAM,KAAY,EAAsB,EAAQ,CAAO,EAC1D,EAAI,IAAI,EAAS,KAAM,CACrB,KAAM,EAAS,KACf,YAAa,EAAS,aAAe,GAAU,YAC/C,WAAY,EAAS,YAAc,GACnC,KAAM,eACR,CAAC,CAEL,CAEA,MAAO,CAAC,GAAG,EAAI,OAAO,CAAC,CACzB,CAEA,SAAgB,EAAgC,EAA6C,CAC3F,IAAM,EAAa,IAAI,IACvB,IAAK,GAAM,CAAC,EAAO,KAAa,OAAO,QAAQ,EAAQ,OAAS,CAAC,CAAC,EAChE,IAAK,GAAM,CAAC,EAAW,KAAc,OAAO,QAAQ,GAAY,CAAC,CAAC,EAAG,CACnE,GAAI,CAAC,8CAA8C,KAAK,CAAS,EAC/D,SAEF,IAAM,EAAS,EAAU,YAAY,EACrC,IAAK,IAAM,IAAY,CACrB,GAAG,EAA8B,EAAW,CAAO,EACnD,GAAG,EAA+B,EAAW,CAAO,CACtD,EAAG,CACD,IAAM,EAAM,GAAG,EAAO,GAAG,EAAM,GAAG,EAAS,OACtC,EAAW,IAAI,CAAG,GACrB,EAAW,IAAI,EAAK,CAClB,QACA,SACA,MAAO,EAAS,KAChB,YAAa,EAAS,WACxB,CAAC,CAEL,CACF,CAEF,MAAO,CAAC,GAAG,EAAW,OAAO,CAAC,CAChC"}
@@ -0,0 +1,3 @@
1
+ import { fileURLToPath as __atlasFileURLToPath } from "node:url";
2
+ const __filename = __atlasFileURLToPath(import.meta.url);
3
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=e(import.meta.url);export{u as n,l as r,s as t};
@@ -0,0 +1,44 @@
1
+ import { fileURLToPath as __atlasFileURLToPath } from "node:url";
2
+ const __filename = __atlasFileURLToPath(import.meta.url);
3
+ import{n as e,r as t,t as n}from"./rolldown-runtime-tLoeUGlk.mjs";import{t as r,u as i}from"./taskProgressService-Qw3ExHJI.mjs";import"node:events";import{execFile as a}from"node:child_process";import o from"node:path";import s from"node:fs";import c from"node:process";import{fileURLToPath as l}from"node:url";import{Node as u,Project as d,SyntaxKind as f}from"ts-morph";import{promisify as p}from"node:util";import m from"node:fs/promises";import"node:stream";import"node:stream/promises";import{Worker as h}from"node:worker_threads";var g=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),_=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),v=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),y=n((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.convertPosixPathToPattern=t.convertWindowsPathToPattern=t.convertPathToPattern=t.escapePosixPath=t.escapeWindowsPath=t.escape=t.removeLeadingDotSegment=t.makeAbsolute=t.unixify=void 0;let n=e(`os`),r=e(`path`),i=n.platform()===`win32`,a=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,o=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,s=/^\\\\([.?])/,c=/\\(?![!()+@[\]{}])/g;function l(e){return e.replace(/\\/g,`/`)}t.unixify=l;function u(e,t){return r.resolve(e,t)}t.makeAbsolute=u;function d(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(2)}return e}t.removeLeadingDotSegment=d,t.escape=i?f:p;function f(e){return e.replace(o,`\\$2`)}t.escapeWindowsPath=f;function p(e){return e.replace(a,`\\$2`)}t.escapePosixPath=p,t.convertPathToPattern=i?m:h;function m(e){return f(e).replace(s,`//$1`).replace(c,`/`)}t.convertWindowsPathToPattern=m;function h(e){return p(e)}t.convertPosixPathToPattern=h})),b=n(((e,t)=>{
4
+ /*!
5
+ * is-extglob <https://github.com/jonschlinkert/is-extglob>
6
+ *
7
+ * Copyright (c) 2014-2016, Jon Schlinkert.
8
+ * Licensed under the MIT License.
9
+ */
10
+ t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),x=n(((e,t)=>{
11
+ /*!
12
+ * is-glob <https://github.com/jonschlinkert/is-glob>
13
+ *
14
+ * Copyright (c) 2014-2017, Jon Schlinkert.
15
+ * Released under the MIT License.
16
+ */
17
+ var n=b(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),S=n(((t,n)=>{var r=x(),i=e(`path`).posix.dirname,a=e(`os`).platform()===`win32`,o=`/`,s=/\\/g,c=/[\{\[].*[\}\]]$/,l=/(^|[^\\])([\{\[]|\([^\)]+$)/,u=/\\([\!\*\?\|\[\]\(\)\{\}])/g;n.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&a&&e.indexOf(o)<0&&(e=e.replace(s,o)),c.test(e)&&(e+=o),e+=`a`;do e=i(e);while(r(e)||l.test(e));return e.replace(u,`$1`)}})),C=n((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``&&Number.isInteger(Number(e)),e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`||e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),w=n(((e,t)=>{let n=C();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),T=n(((e,t)=>{
18
+ /*!
19
+ * is-number <https://github.com/jonschlinkert/is-number>
20
+ *
21
+ * Copyright (c) 2014-present, Jon Schlinkert.
22
+ * Released under the MIT License.
23
+ */
24
+ t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),E=n(((e,t)=>{
25
+ /*!
26
+ * to-regex-range <https://github.com/micromatch/to-regex-range>
27
+ *
28
+ * Copyright (c) 2015-present, Jon Schlinkert.
29
+ * Released under the MIT License.
30
+ */
31
+ let n=T(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),D=n(((t,n)=>{
32
+ /*!
33
+ * fill-range <https://github.com/jonschlinkert/fill-range>
34
+ *
35
+ * Copyright (c) 2014-present, Jon Schlinkert.
36
+ * Licensed under the MIT License.
37
+ */
38
+ let r=e(`util`),i=E(),a=e=>typeof e==`object`&&!!e&&!Array.isArray(e),o=e=>t=>e===!0?Number(t):String(t),s=e=>typeof e==`number`||typeof e==`string`&&e!==``,c=e=>Number.isInteger(+e),l=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},u=(e,t,n)=>typeof e==`string`||typeof t==`string`||n.stringify===!0,d=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},f=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},p=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:+(e>t)),e.positives.sort((e,t)=>e<t?-1:+(e>t));let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>f(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>f(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},m=(e,t,n,r)=>{if(n)return i(e,t,{wrap:!1,...r});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},h=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return i(e,t,n)},g=(...e)=>RangeError(`Invalid range arguments: `+r.inspect(...e)),_=(e,t,n)=>{if(n.strictRanges===!0)throw g([e,t]);return[]},v=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},y=(e,t,n=1,r={})=>{let i=Number(e),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(r.strictRanges===!0)throw g([e,t]);return[]}i===0&&(i=0),a===0&&(a=0);let s=i>a,c=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=l(c)||l(_)||l(v),b=y?Math.max(c.length,_.length,v.length):0,x=y===!1&&u(e,t,r)===!1,S=r.transform||o(x);if(r.toRegex&&n===1)return m(f(e,b),f(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=a:i<=a;)r.toRegex===!0&&n>1?w(i):T.push(d(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?p(C,r,b):h(T,null,{wrap:!1,...r}):T},b=(e,t,n=1,r={})=>{if(!c(e)&&e.length>1||!c(t)&&t.length>1)return _(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return m(l,u,!1,r);let d=[],f=0;for(;s?a>=o:a<=o;)d.push(i(a,f)),a=s?a-n:a+n,f++;return r.toRegex===!0?h(d,null,{wrap:!1,options:r}):d},x=(e,t,n,r={})=>{if(t==null&&s(e))return[e];if(!s(e)||!s(t))return _(e,t,r);if(typeof n==`function`)return x(e,t,1,{transform:n});if(a(n))return x(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,c(n)?c(e)&&c(t)?y(e,t,n,i):b(e,t,Math.max(Math.abs(n),1),i):n!=null&&!a(n)?v(n,i):x(e,t,1,n)};n.exports=x})),O=n(((e,t)=>{let n=D(),r=C();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),k=n(((e,t)=>{let n=D(),r=w(),i=C(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),A=n(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
39
+ `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),j=n(((e,t)=>{let n=w(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=A();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),O!==_&&O!==g){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),M=n(((e,t)=>{let n=w(),r=O(),i=k(),a=j(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),N=n(((t,n)=>{let r=e(`path`),i=`[^\\\\/]`,a=`[^/]`,o=`(?:\\/|$)`,s=`(?:^|\\/)`,c=`\\.{1,2}${o}`,l={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:a,END_ANCHOR:o,DOTS_SLASH:c,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${s}${c})`,NO_DOT_SLASH:`(?!\\.{0,1}${o})`,NO_DOTS_SLASH:`(?!${c})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${a}*?`,START_ANCHOR:s},u={...l,SLASH_LITERAL:`[\\\\/]`,QMARK:i,STAR:`${i}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`};n.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:r.sep,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?u:l}}})),P=n((t=>{let n=e(`path`),r=process.platform===`win32`,{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:a,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:s}=N();t.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),t.hasRegexChars=e=>o.test(e),t.isRegexChar=e=>e.length===1&&t.hasRegexChars(e),t.escapeRegex=e=>e.replace(s,`\\$1`),t.toPosixSlashes=e=>e.replace(i,`/`),t.removeBackslashes=e=>e.replace(a,e=>e===`\\`?``:e),t.supportsLookbehinds=()=>{let e=process.version.slice(1).split(`.`).map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10},t.isWindows=e=>e&&typeof e.windows==`boolean`?e.windows:r===!0||n.sep===`\\`,t.escapeLast=(e,n,r)=>{let i=e.lastIndexOf(n,r);return i===-1?e:e[i-1]===`\\`?t.escapeLast(e,n,i-1):`${e.slice(0,i)}\\${e.slice(i)}`},t.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},t.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r}})),F=n(((e,t)=>{let n=P(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=N(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,z=!1,B=0,ee,V,H={value:``,depth:0,isGlob:!1},U=()=>D>=x,W=()=>E.charCodeAt(D+1),G=()=>(ee=V,E.charCodeAt(++D));for(;D<x;){V=G();let e;if(V===a){I=H.backslashes=!0,V=G(),V===u&&(F=!0);continue}if(F===!0||V===u){for(B++;U()!==!0&&(V=G());){if(V===a){I=H.backslashes=!0,G();continue}if(V===u){B++;continue}if(F!==!0&&V===s&&(V=G())===s){if(A=H.isBrace=!0,M=H.isGlob=!0,z=!0,S===!0)continue;break}if(F!==!0&&V===o){if(A=H.isBrace=!0,M=H.isGlob=!0,z=!0,S===!0)continue;break}if(V===h&&(B--,B===0)){F=!1,A=H.isBrace=!0,z=!0;break}}if(S===!0)continue;break}if(V===l){if(C.push(D),w.push(H),H={value:``,depth:0,isGlob:!1},z===!0)continue;if(ee===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(V===p||V===i||V===r||V===m||V===c)&&W()===d){if(M=H.isGlob=!0,N=H.isExtglob=!0,z=!0,V===c&&D===O&&(R=!0),S===!0){for(;U()!==!0&&(V=G());){if(V===a){I=H.backslashes=!0,V=G();continue}if(V===g){M=H.isGlob=!0,z=!0;break}}continue}break}if(V===r){if(ee===r&&(P=H.isGlobstar=!0),M=H.isGlob=!0,z=!0,S===!0)continue;break}if(V===m){if(M=H.isGlob=!0,z=!0,S===!0)continue;break}if(V===f){for(;U()!==!0&&(e=G());){if(e===a){I=H.backslashes=!0,G();continue}if(e===_){j=H.isBracket=!0,M=H.isGlob=!0,z=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&V===c&&D===O){L=H.negated=!0,O++;continue}if(b.noparen!==!0&&V===d){if(M=H.isGlob=!0,S===!0){for(;U()!==!0&&(V=G());){if(V===d){I=H.backslashes=!0,V=G();continue}if(V===g){z=!0;break}}continue}break}if(M===!0){if(z=!0,S===!0)continue;break}}b.noext===!0&&(N=!1,M=!1);let K=E,q=``,te=``;O>0&&(q=E.slice(0,O),E=E.slice(O),k-=O),K&&M===!0&&k>0?(K=E.slice(0,k),te=E.slice(k)):M===!0?(K=``,te=E):K=E,K&&K!==``&&K!==`/`&&K!==E&&v(K.charCodeAt(K.length-1))&&(K=K.slice(0,-1)),b.unescape===!0&&(te&&=n.removeBackslashes(te),K&&I===!0&&(K=n.removeBackslashes(K)));let J={prefix:q,input:e,start:O,base:K,glob:te,isBrace:A,isBracket:j,isGlob:M,isExtglob:N,isGlobstar:P,negated:L,negatedExtglob:R};if(b.tokens===!0&&(J.maxDepth=0,v(V)||w.push(H),J.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=q):w[n].value=a,y(w[n]),J.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),J.maxDepth+=w[w.length-1].depth)}J.slashes=C,J.parts=T}return J}})),I=n(((e,t)=>{let n=N(),r=P(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(!(!a||r!==a.repeat(r.length)||i!==a.repeat(i.length))&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return`${n.length===1?r.escapeRegex(n[0]):`[${n.map(e=>r.escapeRegex(e)).join(``)}]`}*`},_=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},v=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};for(let e of i){let t=g(e);if(t)return{risky:!0,safeOutput:t};if(_(e)>r)return{risky:!0}}return{risky:!1}},y=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=r.isWindows(t),b=n.globChars(_),x=n.extglobChars(b),{DOT_LITERAL:S,PLUS_LITERAL:C,SLASH_LITERAL:w,ONE_CHAR:T,DOTS_SLASH:E,NO_DOT:D,NO_DOT_SLASH:O,NO_DOTS_SLASH:k,QMARK:A,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:N}=b,P=e=>`(${g}(?:(?!${N}${e.dot?E:S}).)*?)`,F=d.dot?``:D,I=d.dot?A:j,L=d.bash===!0?P(d):M;d.capture&&(L=`(${L})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let R={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,R),p=e.length;let z=[],B=[],ee=[],V=m,H,U=()=>R.index===p-1,W=R.peek=(t=1)=>e[R.index+t],G=R.advance=()=>e[++R.index]||``,K=()=>e.slice(R.index+1),q=(e=``,t=0)=>{R.consumed+=e,R.index+=t},te=e=>{R.output+=e.output==null?e.value:e.output,q(e.value)},J=()=>{let e=1;for(;W()===`!`&&(W(2)!==`(`||W(3)===`?`);)G(),R.start++,e++;return e%2!=0&&(R.negated=!0,R.start++,!0)},ne=e=>{R[e]++,ee.push(e)},re=e=>{R[e]--,ee.pop()},Y=e=>{if(V.type===`globstar`){let t=R.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||z.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(R.output=R.output.slice(0,-V.output.length),V.type=`star`,V.value=`*`,V.output=L,R.output+=V.output)}if(z.length&&e.type!==`paren`&&(z[z.length-1].inner+=e.value),(e.value||e.output)&&te(e),V&&V.type===`text`&&e.type===`text`){V.value+=e.value,V.output=(V.output||``)+e.value;return}e.prev=V,h.push(e),V=e},ie=(e,t)=>{let n={...x[t],conditions:1,inner:``};n.prev=V,n.parens=R.parens,n.output=R.output,n.startIndex=R.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ne(`parens`),Y({type:e,value:t,output:R.output?``:T}),Y({type:`paren`,extglob:!0,value:G(),output:r}),z.push(n)},ae=n=>{let i=e.slice(n.startIndex,R.index+1),a=e.slice(n.startIndex+2,R.index),o=v(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:T)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;R.output=n.output+t.output,R.backtrack=!0,Y({type:`paren`,extglob:!0,value:H,output:``}),re(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=L;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=P(d)),(e!==L||U()||/^\)+$/.test(K()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=K())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${y(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(R.negatedExtglob=!0)}Y({type:`paren`,extglob:!0,value:H,output:s}),re(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?A.repeat(a.length):``):o===0?I+(a?A.repeat(a.length):``):A.repeat(r.length):i===`.`?S.repeat(r.length):i===`*`?t?t+i+(a?L:``):L:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(R.output=e,R):(R.output=r.wrapOutput(i,R,t),R)}for(;!U();){if(H=G(),H===`\0`)continue;if(H===`\\`){let e=W();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){H+=`\\`,Y({type:`text`,value:H});continue}let t=/^\\+/.exec(K()),n=0;if(t&&t[0].length>2&&(n=t[0].length,R.index+=n,n%2!=0&&(H+=`\\`)),d.unescape===!0?H=G():H+=G(),R.brackets===0){Y({type:`text`,value:H});continue}}if(R.brackets>0&&(H!==`]`||V.value===`[`||V.value===`[^`)){if(d.posix!==!1&&H===`:`){let e=V.value.slice(1);if(e.includes(`[`)&&(V.posix=!0,e.includes(`:`))){let e=V.value.lastIndexOf(`[`),t=V.value.slice(0,e),n=V.value.slice(e+2),r=a[n];if(r){V.value=t+r,R.backtrack=!0,G(),!m.output&&h.indexOf(V)===1&&(m.output=T);continue}}}(H===`[`&&W()!==`:`||H===`-`&&W()===`]`)&&(H=`\\${H}`),H===`]`&&(V.value===`[`||V.value===`[^`)&&(H=`\\${H}`),d.posix===!0&&H===`!`&&V.value===`[`&&(H=`^`),V.value+=H,te({value:H});continue}if(R.quotes===1&&H!==`"`){H=r.escapeRegex(H),V.value+=H,te({value:H});continue}if(H===`"`){R.quotes=R.quotes===1?0:1,d.keepQuotes===!0&&Y({type:`text`,value:H});continue}if(H===`(`){ne(`parens`),Y({type:`paren`,value:H});continue}if(H===`)`){if(R.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=z[z.length-1];if(e&&R.parens===e.parens+1){ae(z.pop());continue}Y({type:`paren`,value:H,output:R.parens?`)`:`\\)`}),re(`parens`);continue}if(H===`[`){if(d.nobracket===!0||!K().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));H=`\\${H}`}else ne(`brackets`);Y({type:`bracket`,value:H});continue}if(H===`]`){if(d.nobracket===!0||V&&V.type===`bracket`&&V.value.length===1){Y({type:`text`,value:H,output:`\\${H}`});continue}if(R.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));Y({type:`text`,value:H,output:`\\${H}`});continue}re(`brackets`);let e=V.value.slice(1);if(V.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(H=`/${H}`),V.value+=H,te({value:H}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(V.value);if(R.output=R.output.slice(0,-V.value.length),d.literalBrackets===!0){R.output+=t,V.value=t;continue}V.value=`(${g}${t}|${V.value})`,R.output+=V.value;continue}if(H===`{`&&d.nobrace!==!0){ne(`braces`);let e={type:`brace`,value:H,output:`(`,outputIndex:R.output.length,tokensIndex:R.tokens.length};B.push(e),Y(e);continue}if(H===`}`){let e=B[B.length-1];if(d.nobrace===!0||!e){Y({type:`text`,value:H,output:H});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),R.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=R.output.slice(0,e.outputIndex),r=R.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,H=t=`\\}`,R.output=n;for(let e of r)R.output+=e.output||e.value}Y({type:`brace`,value:H,output:t}),re(`braces`),B.pop();continue}if(H===`|`){z.length>0&&z[z.length-1].conditions++,Y({type:`text`,value:H});continue}if(H===`,`){let e=H,t=B[B.length-1];t&&ee[ee.length-1]===`braces`&&(t.comma=!0,e=`|`),Y({type:`comma`,value:H,output:e});continue}if(H===`/`){if(V.type===`dot`&&R.index===R.start+1){R.start=R.index+1,R.consumed=``,R.output=``,h.pop(),V=m;continue}Y({type:`slash`,value:H,output:w});continue}if(H===`.`){if(R.braces>0&&V.type===`dot`){V.value===`.`&&(V.output=S);let e=B[B.length-1];V.type=`dots`,V.output+=H,V.value+=H,e.dots=!0;continue}if(R.braces+R.parens===0&&V.type!==`bos`&&V.type!==`slash`){Y({type:`text`,value:H,output:S});continue}Y({type:`dot`,value:H,output:S});continue}if(H===`?`){if(!(V&&V.value===`(`)&&d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){ie(`qmark`,H);continue}if(V&&V.type===`paren`){let e=W(),t=H;if(e===`<`&&!r.supportsLookbehinds())throw Error(`Node.js v10 or higher is required for regex lookbehinds`);(V.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(K()))&&(t=`\\${H}`),Y({type:`text`,value:H,output:t});continue}if(d.dot!==!0&&(V.type===`slash`||V.type===`bos`)){Y({type:`qmark`,value:H,output:j});continue}Y({type:`qmark`,value:H,output:A});continue}if(H===`!`){if(d.noextglob!==!0&&W()===`(`&&(W(2)!==`?`||!/[!=<:]/.test(W(3)))){ie(`negate`,H);continue}if(d.nonegate!==!0&&R.index===0){J();continue}}if(H===`+`){if(d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){ie(`plus`,H);continue}if(V&&V.value===`(`||d.regex===!1){Y({type:`plus`,value:H,output:C});continue}if(V&&(V.type===`bracket`||V.type===`paren`||V.type===`brace`)||R.parens>0){Y({type:`plus`,value:H});continue}Y({type:`plus`,value:C});continue}if(H===`@`){if(d.noextglob!==!0&&W()===`(`&&W(2)!==`?`){Y({type:`at`,extglob:!0,value:H,output:``});continue}Y({type:`text`,value:H});continue}if(H!==`*`){(H===`$`||H===`^`)&&(H=`\\${H}`);let e=o.exec(K());e&&(H+=e[0],R.index+=e[0].length),Y({type:`text`,value:H});continue}if(V&&(V.type===`globstar`||V.star===!0)){V.type=`star`,V.star=!0,V.value+=H,V.output=L,R.backtrack=!0,R.globstar=!0,q(H);continue}let t=K();if(d.noextglob!==!0&&/^\([^?]/.test(t)){ie(`star`,H);continue}if(V.type===`star`){if(d.noglobstar===!0){q(H);continue}let n=V.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){Y({type:`star`,value:H,output:``});continue}let o=R.braces>0&&(n.type===`comma`||n.type===`brace`),s=z.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){Y({type:`star`,value:H,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[R.index+4];if(n&&n!==`/`)break;t=t.slice(3),q(`/**`,3)}if(n.type===`bos`&&U()){V.type=`globstar`,V.value+=H,V.output=P(d),R.output=V.output,R.globstar=!0,q(H);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&U()){R.output=R.output.slice(0,-(n.output+V.output).length),n.output=`(?:${n.output}`,V.type=`globstar`,V.output=P(d)+(d.strictSlashes?`)`:`|$)`),V.value+=H,R.globstar=!0,R.output+=n.output+V.output,q(H);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;R.output=R.output.slice(0,-(n.output+V.output).length),n.output=`(?:${n.output}`,V.type=`globstar`,V.output=`${P(d)}${w}|${w}${e})`,V.value+=H,R.output+=n.output+V.output,R.globstar=!0,q(H+G()),Y({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){V.type=`globstar`,V.value+=H,V.output=`(?:^|${w}|${P(d)}${w})`,R.output=V.output,R.globstar=!0,q(H+G()),Y({type:`slash`,value:`/`,output:``});continue}R.output=R.output.slice(0,-V.output.length),V.type=`globstar`,V.output=P(d),V.value+=H,R.output+=V.output,R.globstar=!0,q(H);continue}let n={type:`star`,value:H,output:L};if(d.bash===!0){n.output=`.*?`,(V.type===`bos`||V.type===`slash`)&&(n.output=F+n.output),Y(n);continue}if(V&&(V.type===`bracket`||V.type===`paren`)&&d.regex===!0){n.output=H,Y(n);continue}(R.index===R.start||V.type===`slash`||V.type===`dot`)&&(V.type===`dot`?(R.output+=O,V.output+=O):d.dot===!0?(R.output+=k,V.output+=k):(R.output+=F,V.output+=F),W()!==`*`&&(R.output+=T,V.output+=T)),Y(n)}for(;R.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));R.output=r.escapeLast(R.output,`[`),re(`brackets`)}for(;R.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));R.output=r.escapeLast(R.output,`(`),re(`parens`)}for(;R.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));R.output=r.escapeLast(R.output,`{`),re(`braces`)}if(d.strictSlashes!==!0&&(V.type===`star`||V.type===`bracket`)&&Y({type:`maybe_slash`,value:``,output:`${w}?`}),R.backtrack===!0){R.output=``;for(let e of R.tokens)R.output+=e.output==null?e.value:e.output,e.suffix&&(R.output+=e.suffix)}return R};y.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let l=r.isWindows(t),{DOT_LITERAL:u,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:p,NO_DOT:m,NO_DOTS:h,NO_DOTS_SLASH:g,STAR:_,START_ANCHOR:v}=n.globChars(l),y=a.dot?h:m,b=a.dot?g:m,x=a.capture?``:`?:`,S={negated:!1,prefix:``},C=a.bash===!0?`.*?`:_;a.capture&&(C=`(${C})`);let w=e=>e.noglobstar===!0?C:`(${x}(?:(?!${v}${e.dot?p:u}).)*?)`,T=e=>{switch(e){case`*`:return`${y}${f}${C}`;case`.*`:return`${u}${f}${C}`;case`*.*`:return`${y}${C}${u}${f}${C}`;case`*/*`:return`${y}${C}${d}${f}${b}${C}`;case`**`:return y+w(a);case`**/*`:return`(?:${y}${w(a)}${d})?${b}${f}${C}`;case`**/*.*`:return`(?:${y}${w(a)}${d})?${b}${C}${u}${f}${C}`;case`**/.*`:return`(?:${y}${w(a)}${d})?${u}${f}${C}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=T(t[1]);return n?n+u+t[2]:void 0}}},E=T(r.removePrefix(e,S));return E&&a.strictSlashes!==!0&&(E+=`${d}?`),E},t.exports=y})),L=n(((t,n)=>{let r=e(`path`),i=F(),a=I(),o=P(),s=N(),c=e=>e&&typeof e==`object`&&!Array.isArray(e),l=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>l(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=c(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=o.isWindows(t),s=r?l.compileRe(e,t):l.makeRe(e,t,!1,!0),u=s.state;delete s.state;let d=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};d=l(i.ignore,e,n)}let f=(n,r=!1)=>{let{isMatch:o,match:c,output:f}=l.test(n,s,t,{glob:e,posix:a}),p={glob:e,state:u,regex:s,posix:a,input:n,output:f,match:c,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):d(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(f.state=u),f};l.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let a=n||{},s=a.format||(i?o.toPosixSlashes:null),c=e===r,u=c&&s?s(e):e;return c===!1&&(u=s?s(e):e,c=u===r),(c===!1||a.capture===!0)&&(c=a.matchBase===!0||a.basename===!0?l.matchBase(e,t,n,i):t.exec(u)),{isMatch:!!c,match:c,output:u}},l.matchBase=(e,t,n,i=o.isWindows(n))=>(t instanceof RegExp?t:l.makeRe(t,n)).test(r.basename(e)),l.isMatch=(e,t,n)=>l(t,n)(e),l.parse=(e,t)=>Array.isArray(e)?e.map(e=>l.parse(e,t)):a(e,{...t,fastpaths:!1}),l.scan=(e,t)=>i(e,t),l.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);let c=l.toRegex(s,t);return r===!0&&(c.state=e),c},l.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(i.output=a.fastpaths(e,t)),i.output||(i=a(e,t)),l.compileRe(i,t,n,r)},l.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},l.constants=s,n.exports=l})),R=n(((e,t)=>{t.exports=L()})),z=n(((t,n)=>{let r=e(`util`),i=M(),a=R(),o=P(),s=e=>e===``||e===`./`,c=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},l=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=a(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),i.add(e.output)))}}let l=(s===t.length?[...o]:[...i]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};l.match=l,l.matcher=(e,t)=>a(e,t),l.isMatch=(e,t,n)=>a(t,n)(e),l.any=l.isMatch,l.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(l(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},l.contains=(e,t,n)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${r.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>l.contains(e,t,n));if(typeof t==`string`){if(s(e)||s(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return l.isMatch(e,t,{...n,contains:!0})},l.matchKeys=(e,t,n)=>{if(!o.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=l(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},l.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(r.some(e=>t(e)))return!0}return!1},l.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=a(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},l.all=(e,t,n)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${r.inspect(e)}"`);return[].concat(t).every(t=>a(t,n)(e))},l.capture=(e,t,n)=>{let r=o.isWindows(n),i=a.makeRe(String(e),{...n,capture:!0}).exec(r?o.toPosixSlashes(t):t);if(i)return i.slice(1).map(e=>e===void 0?``:e)},l.makeRe=(...e)=>a.makeRe(...e),l.scan=(...e)=>a.scan(...e),l.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let e of i(String(r),t))n.push(a.parse(e,t));return n},l.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!c(e)?[e]:i(e,t)},l.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return l.braces(e,{...t,expand:!0})},l.hasBraces=c,n.exports=l})),B=n((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isAbsolute=t.partitionAbsoluteAndRelative=t.removeDuplicateSlashes=t.matchAny=t.convertPatternsToRe=t.makeRe=t.getPatternParts=t.expandBraceExpansion=t.expandPatternsWithBraceExpansion=t.isAffectDepthOfReadingPattern=t.endsWithSlashGlobStar=t.hasGlobStar=t.getBaseDirectory=t.isPatternRelatedToParentDirectory=t.getPatternsOutsideCurrentDirectory=t.getPatternsInsideCurrentDirectory=t.getPositivePatterns=t.getNegativePatterns=t.isPositivePattern=t.isNegativePattern=t.convertToNegativePattern=t.convertToPositivePattern=t.isDynamicPattern=t.isStaticPattern=void 0;let n=e(`path`),r=S(),i=z(),a=/[*?]|^!/,o=/\[[^[]*]/,s=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,c=/[!*+?@]\([^(]*\)/,l=/,|\.\./,u=/(?!^)\/{2,}/g;function d(e,t={}){return!f(e,t)}t.isStaticPattern=d;function f(e,t={}){return e!==``&&!!(t.caseSensitiveMatch===!1||e.includes(`\\`)||a.test(e)||o.test(e)||s.test(e)||t.extglob!==!1&&c.test(e)||t.braceExpansion!==!1&&p(e))}t.isDynamicPattern=f;function p(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return l.test(r)}function m(e){return g(e)?e.slice(1):e}t.convertToPositivePattern=m;function h(e){return`!`+e}t.convertToNegativePattern=h;function g(e){return e.startsWith(`!`)&&e[1]!==`(`}t.isNegativePattern=g;function _(e){return!g(e)}t.isPositivePattern=_;function v(e){return e.filter(g)}t.getNegativePatterns=v;function y(e){return e.filter(_)}t.getPositivePatterns=y;function b(e){return e.filter(e=>!C(e))}t.getPatternsInsideCurrentDirectory=b;function x(e){return e.filter(C)}t.getPatternsOutsideCurrentDirectory=x;function C(e){return e.startsWith(`..`)||e.startsWith(`./..`)}t.isPatternRelatedToParentDirectory=C;function w(e){return r(e,{flipBackslashes:!1})}t.getBaseDirectory=w;function T(e){return e.includes(`**`)}t.hasGlobStar=T;function E(e){return e.endsWith(`/**`)}t.endsWithSlashGlobStar=E;function D(e){let t=n.basename(e);return E(e)||d(t)}t.isAffectDepthOfReadingPattern=D;function O(e){return e.reduce((e,t)=>e.concat(k(t)),[])}t.expandPatternsWithBraceExpansion=O;function k(e){let t=i.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}t.expandBraceExpansion=k;function A(e,t){let{parts:n}=i.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}t.getPatternParts=A;function j(e,t){return i.makeRe(e,t)}t.makeRe=j;function M(e,t){return e.map(e=>j(e,t))}t.convertPatternsToRe=M;function N(e,t){return t.some(t=>t.test(e))}t.matchAny=N;function P(e){return e.replace(u,`/`)}t.removeDuplicateSlashes=P;function F(e){let t=[],n=[];for(let r of e)I(r)?t.push(r):n.push(r);return[t,n]}t.partitionAbsoluteAndRelative=F;function I(e){return n.isAbsolute(e)}t.isAbsolute=I})),ee=n(((t,n)=>{let r=e(`stream`).PassThrough,i=Array.prototype.slice;n.exports=a;function a(){let e=[],t=i.call(arguments),n=!1,a=t[t.length-1];a&&!Array.isArray(a)&&a.pipe==null?t.pop():a={};let s=a.end!==!1,c=a.pipeError===!0;a.objectMode??(a.objectMode=!0),a.highWaterMark??(a.highWaterMark=65536);let l=r(a);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(o(arguments[t],a));return d(),this}function d(){if(n)return;n=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let r=t.length+1;function i(){--r>0||(n=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),i()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return i();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);i()}function f(){n=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function o(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=o(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(r(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),V=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.merge=void 0;let t=ee();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),H=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),U=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=g(),e.errno=_(),e.fs=v(),e.path=y(),e.pattern=B(),e.stream=V(),e.string=H()})),W=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;let t=U();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),G=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),K=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),q=n((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;let n=e(`fs`);t.FILE_SYSTEM_ADAPTER={lstat:n.lstat,stat:n.stat,lstatSync:n.lstatSync,statSync:n.statSync};function r(e){return e===void 0?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}t.createFileSystemAdapter=r})),te=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=q();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),J=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.statSync=e.stat=e.Settings=void 0;let t=G(),n=K(),r=te();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),ne=n(((e,t)=>{
40
+ /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
41
+ let n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),re=n(((e,t)=>{
42
+ /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
43
+ t.exports=r;let n=ne();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),Y=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10);e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>10||n===10&&r>=10})),ie=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),ae=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.fs=void 0,e.fs=ie()})),oe=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),se=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=J(),n=re(),r=Y(),i=ae(),a=oe();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}let l=s.map(e=>c(e,t));n(l,(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}let l=c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}});n(l,(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),ce=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=J(),n=Y(),r=ae(),i=oe();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),le=n((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;let n=e(`fs`);t.FILE_SYSTEM_ADAPTER={lstat:n.lstat,stat:n.stat,lstatSync:n.lstatSync,statSync:n.statSync,readdir:n.readdir,readdirSync:n.readdirSync};function r(e){return e===void 0?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),e)}t.createFileSystemAdapter=r})),ue=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`path`),r=J(),i=le();t.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=i.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new r.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),de=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=se(),n=ce(),r=ue();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),fe=n(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),pe=n(((e,t)=>{var n=fe();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),me=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null||!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),he=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=me();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),ge=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`events`),r=de(),i=pe(),a=me(),o=he();t.default=class extends o.default{constructor(e,t){super(e,t),this._settings=t,this._scandir=r.scandir,this._emitter=new n.EventEmitter,this._queue=i(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!a.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=a.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),a.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&a.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),_e=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ge();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),ve=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`stream`),r=ge();t.default=class{constructor(e,t){this._root=e,this._settings=t,this._reader=new r.default(this._root,this._settings),this._stream=new n.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),ye=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),n=me(),r=he();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),be=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),xe=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`path`),r=de();t.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,n.sep),this.fsScandirSettings=new r.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Se=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=_e(),n=ve(),r=be(),i=xe();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),Ce=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`path`),r=J(),i=U();t.default=class{constructor(e){this._settings=e,this._fsStatSettings=new r.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return n.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:i.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!i.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),we=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`stream`),r=J(),i=Se(),a=Ce();t.default=class extends a.default{constructor(){super(...arguments),this._walkStream=i.walkStream,this._stat=r.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,t){let r=e.map(this._getFullEntryPath,this),i=new n.PassThrough({objectMode:!0});i._write=(n,a,o)=>this._getEntry(r[n],e[n],t).then(e=>{e!==null&&t.entryFilter(e)&&i.push(e),n===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),Te=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Se(),n=Ce(),r=we();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),Ee=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),De=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ee();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),Oe=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U(),n=De();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return!this._isSkippedByPositivePatterns(a,r)&&this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep!==1/0&&this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),ke=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),Ae=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),je=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=U();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),Me=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`path`),r=Oe(),i=ke(),a=Ae(),o=je();t.default=class{constructor(e){this._settings=e,this.errorFilter=new a.default(this._settings),this.entryFilter=new i.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new r.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new o.default(this._settings)}_getRootDirectory(e){return n.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),Ne=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Te(),n=Me();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Pe=n((t=>{Object.defineProperty(t,"__esModule",{value:!0});let n=e(`stream`),r=we(),i=Me();t.default=class extends i.default{constructor(){super(...arguments),this._reader=new r.default(this._settings)}read(e){let t=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(t,e,r),a=new n.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Fe=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=J(),n=Se(),r=Ce();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),Ie=n((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Fe(),n=Me();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),Le=n((t=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let n=e(`fs`),r=e(`os`),i=Math.max(r.cpus().length,1);t.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:n.lstat,lstatSync:n.lstatSync,stat:n.stat,statSync:n.statSync,readdir:n.readdir,readdirSync:n.readdirSync},t.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,i),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(e={}){return Object.assign(Object.assign({},t.DEFAULT_FILE_SYSTEM_ADAPTER),e)}}})),Re=t(n(((e,t)=>{let n=W(),r=Ne(),i=Pe(),a=Ie(),o=Le(),s=U();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}))(),1);async function ze(e,t,n){if(typeof n!=`string`)throw TypeError(`Expected a string, got ${typeof n}`);try{return(await m[e](n))[t]()}catch(e){if(e.code===`ENOENT`)return!1;throw e}}function Be(e,t,n){if(typeof n!=`string`)throw TypeError(`Expected a string, got ${typeof n}`);try{return s[e](n)[t]()}catch(e){if(e.code===`ENOENT`)return!1;throw e}}ze.bind(void 0,`stat`,`isFile`);const Ve=ze.bind(void 0,`stat`,`isDirectory`);ze.bind(void 0,`lstat`,`isSymbolicLink`),Be.bind(void 0,`statSync`,`isFile`),Be.bind(void 0,`statSync`,`isDirectory`),Be.bind(void 0,`lstatSync`,`isSymbolicLink`),p(a);function He(e){return e instanceof URL?l(e):e}var Ue=t(n(((e,t)=>{function n(e){return Array.isArray(e)?e:[e]}let r=/^\s+$/,i=/(?:[^\\]|^)\\$/,a=/^\\!/,o=/^\\#/,s=/\r?\n/g,c=/^\.{0,2}\/|^\.{1,2}$/,l=/\/$/,u=`node-ignore`;typeof Symbol<`u`&&(u=Symbol.for(`node-ignore`));let d=u,f=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),p=/([0-z])-([0-z])/g,m=()=>!1,h=e=>e.replace(p,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:``),g=e=>e.startsWith(`!`)||e.startsWith(`\\^`)?`^${e.slice(e[0]===`!`?1:2)}`:e,_=e=>{let{length:t}=e;return e.slice(0,t-t%2)},v=[[/^\uFEFF/,()=>``],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf(`\\`)===0?` `:``)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+` `}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*(?:\\\*\\\*\\\/)+/,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>`\\`],[/\\\\/g,()=>`\\`],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===`\\`?`\\[${n}${_(r)}${i}`:i===`]`&&r.length%2==0?`[${g(h(n))}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`]],y=/(^|\\\/)?\\\*$/,b=`regex`,x=`checkRegex`,S={[b](e,t){return`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`},[x](e,t){return`${t?`${t}[^/]*`:`[^/]*`}(?=$|\\/$)`}},C=e=>v.reduce((t,[n,r])=>t.replace(n,r.bind(e)),e),w=e=>typeof e==`string`,T=e=>e&&w(e)&&!r.test(e)&&!i.test(e)&&e.indexOf(`#`)!==0,E=e=>e.split(s).filter(Boolean);var D=class{constructor(e,t,n,r,i,a){this.pattern=e,this.mark=t,this.negative=i,f(this,`body`,n),f(this,`ignoreCase`,r),f(this,`regexPrefix`,a)}get regex(){let e=`_regex`;return this[e]?this[e]:this._make(b,e)}get checkRegex(){let e=`_checkRegex`;return this[e]?this[e]:this._make(x,e)}_make(e,t){let n=this.regexPrefix.replace(y,S[e]),r=this.ignoreCase?new RegExp(n,`i`):new RegExp(n);return f(this,t,r)}};let O=({pattern:e,mark:t},n)=>{let r=!1,i=e;i.indexOf(`!`)===0&&(r=!0,i=i.substr(1)),i=i.replace(a,`!`).replace(o,`#`);let s=C(i);return new D(e,t,i,n,r,s)};var k=class{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[d]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(w(e)&&(e={pattern:e}),T(e.pattern)){let t=O(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(w(e)?E(e):e).forEach(this._add,this),this._added}test(e,t,n){let r=!1,i=!1,a;this._rules.forEach(o=>{let{negative:s}=o;i===s&&r!==i||s&&!r&&!i&&!t||o[n].test(e)&&(r=!s,i=s,a=s?void 0:o)});let o={ignored:r,unignored:i};return a&&(o.rule=a),o}};let A=(e,t)=>{throw new t(e)},j=(e,t,n)=>w(e)?e?!j.isNotRelative(e)||n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),M=e=>c.test(e);j.isNotRelative=M,j.convert=e=>e;var N=class{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){f(this,d,!0),this._rules=new k(t),this._strictPathCheck=!n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,t,n,r){let i=e&&j.convert(e);return j(i,e,this._strictPathCheck?A:m),this._t(i,t,n,r)}checkIgnore(e){if(!l.test(e))return this.test(e);let t=e.split(`/`).filter(Boolean);if(t.pop(),t.length){let e=this._t(t.join(`/`)+`/`,this._testCache,!0,t);if(e.ignored)return e}return this._rules.test(e,!1,x)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(`/`).filter(Boolean),r.pop(),!r.length)return t[e]=this._rules.test(e,n,b);let i=this._t(r.join(`/`)+`/`,t,n,r);return t[e]=i.ignored?i:this._rules.test(e,n,b)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};let P=e=>new N(e),F=e=>j(e&&j.convert(e),e,m),I=()=>{j.convert=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`);let e=/^[a-z]:\//i;j.isNotRelative=t=>e.test(t)||M(t)};typeof process<`u`&&process.platform===`win32`&&I(),t.exports=P,P.default=P,t.exports.isPathValid=F,f(t.exports,Symbol.for(`setupWindows`),I)}))(),1);function We(e){return e.startsWith(`\\\\?\\`)?e:e.replace(/\\/g,`/`)}const Ge=e=>e[0]===`!`,Ke=[`**/node_modules`,`**/flow-typed`,`**/coverage`,`**/.git`],qe={absolute:!0,dot:!0},Je=(e,t)=>Ge(e)?`!`+o.posix.join(t,e.slice(1)):o.posix.join(t,e),Ye=(e,t)=>{let n=We(o.relative(t,o.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(e=>e&&!e.startsWith(`#`)).map(e=>Je(e,n))},Xe=(e,t)=>{if(t=We(t),o.isAbsolute(e)){if(We(e).startsWith(t))return o.relative(t,e);throw Error(`Path ${e} is not in cwd ${t}`)}return e},Ze=(e,t)=>{let n=e.flatMap(e=>Ye(e,t)),r=(0,Ue.default)().add(n);return e=>(e=He(e),e=Xe(e,t),e?r.ignores(We(e)):!1)},Qe=(e={})=>({cwd:He(e.cwd)??c.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep==`number`?e.deep:1/0,ignore:[...e.ignore??[],...Ke]}),$e=async(e,t)=>{let{cwd:n,suppressErrors:r,deep:i,ignore:a}=Qe(t),o=await(0,Re.default)(e,{cwd:n,suppressErrors:r,deep:i,ignore:a,...qe}),s=await Promise.all(o.map(async e=>({filePath:e,content:await m.readFile(e,`utf8`)})));return Ze(s,n)},et=e=>{if(e.some(e=>typeof e!=`string`))throw TypeError(`Patterns must be a string or an array of strings`)},tt=(e,t)=>{let n=Ge(e)?e.slice(1):e;return o.isAbsolute(n)?n:o.join(t,n)},nt=({directoryPath:e,files:t,extensions:n})=>{let r=n?.length>0?`.${n.length>1?`{${n.join(`,`)}}`:n[0]}`:``;return t?t.map(t=>o.posix.join(e,`**/${o.extname(t)?t:`${t}${r}`}`)):[o.posix.join(e,`**${r?`/*${r}`:``}`)]},rt=async(e,{cwd:t=c.cwd(),files:n,extensions:r}={})=>(await Promise.all(e.map(async e=>await Ve(tt(e,t))?nt({directoryPath:e,files:n,extensions:r}):e))).flat(),it=e=>(e=[...new Set([e].flat())],et(e),e),at=e=>{if(!e)return;let t;try{t=s.statSync(e)}catch{return}if(!t.isDirectory())throw Error("The `cwd` option must be a path to a directory")},ot=(e={})=>(e={...e,ignore:e.ignore??[],expandDirectories:e.expandDirectories??!0,cwd:He(e.cwd)},at(e.cwd),e),st=e=>async(t,n)=>e(it(t),ot(n)),ct=e=>{let{ignoreFiles:t,gitignore:n}=e,r=t?it(t):[];return n&&r.push(`**/.gitignore`),r},lt=async e=>{let t=ct(e);return ut(t.length>0&&await $e(t,e))},ut=e=>{let t=new Set;return n=>{let r=o.normalize(n.path??n);return t.has(r)||e&&e(r)?!1:(t.add(r),!0)}},dt=(e,t)=>e.flat().filter(e=>t(e)),ft=(e,t)=>{let n=[];for(;e.length>0;){let r=e.findIndex(e=>Ge(e));if(r===-1){n.push({patterns:e,options:t});break}let i=e[r].slice(1);for(let e of n)e.options.ignore.push(i);r!==0&&n.push({patterns:e.slice(0,r),options:{...t,ignore:[...t.ignore,i]}}),e=e.slice(r+1)}return n},pt=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),mt=async(e,t)=>{let n=ft(e,t),{cwd:r,expandDirectories:i}=t;if(!i)return n;let a=pt(i,r);return Promise.all(n.map(async e=>{let{patterns:t,options:n}=e;return[t,n.ignore]=await Promise.all([rt(t,a),rt(n.ignore,{cwd:r})]),{patterns:t,options:n}}))},ht=st(async(e,t)=>{let[n,r]=await Promise.all([mt(e,t),lt(t)]),i=await Promise.all(n.map(e=>(0,Re.default)(e.patterns,e.options)));return dt(i,r)}),{convertPathToPattern:gt}=Re.default,_t=(e,t,n)=>{let r=e instanceof RegExp?vt(e,n):e,i=t instanceof RegExp?vt(t,n):t,a=r!==null&&i!=null&&yt(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},vt=(e,t)=>{let n=t.match(e);return n?n[0]:null},yt=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},bt=`\0SLASH`+Math.random()+`\0`,xt=`\0OPEN`+Math.random()+`\0`,St=`\0CLOSE`+Math.random()+`\0`,Ct=`\0COMMA`+Math.random()+`\0`,wt=`\0PERIOD`+Math.random()+`\0`,Tt=new RegExp(bt,`g`),Et=new RegExp(xt,`g`),Dt=new RegExp(St,`g`),Ot=new RegExp(Ct,`g`),kt=new RegExp(wt,`g`),At=/\\\\/g,jt=/\\{/g,Mt=/\\}/g,Nt=/\\,/g,Pt=/\\\./g;function Ft(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function It(e){return e.replace(At,bt).replace(jt,xt).replace(Mt,St).replace(Nt,Ct).replace(Pt,wt)}function Lt(e){return e.replace(Tt,`\\`).replace(Et,`{`).replace(Dt,`}`).replace(Ot,`,`).replace(kt,`.`)}function Rt(e){if(!e)return[``];let t=[],n=_t(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=Rt(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function zt(e,t={}){if(!e)return[];let{max:n=1e5,maxLength:r=4e6}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),Kt(It(e),n,r,!0).map(Lt)}function Bt(e){return`{`+e+`}`}function Vt(e){return/^-?0\d/.test(e)}function Ht(e,t){return e<=t}function Ut(e,t){return e>=t}function Wt(e,t,n,r,i,a){let o=[],s=0;for(let c=0;c<e.length;c++)for(let l=0;l<n.length;l++){if(o.length>=r)return o;let u=e[c]+t+n[l];if(!(a&&!u)){if(s+u.length>i)return o;o.push(u),s+=u.length}}return o}function Gt(e,t,n,r){let i=e.split(/\.\./),a=[];if(i[0]===void 0||i[1]===void 0)return a;let o=Ft(i[0]),s=Ft(i[1]),c=Math.max(i[0].length,i[1].length),l=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Ft(i[2])),1):1,u=Ht;s<o&&(l*=-1,u=Ut);let d=i.some(Vt),f=0;for(let e=o;u(e,s)&&a.length<n;e+=l){let n;if(t)n=String.fromCharCode(e),n===`\\`&&(n=``);else if(n=String(e),d){let t=c-n.length;if(t>0){let r=Array(t+1).join(`0`);n=e<0?`-`+r+n.slice(1):r+n}}if(f+n.length>r)break;a.push(n),f+=n.length}return a}function Kt(e,t,n,r){let i=[``],a=!1,o=!0;for(;;){let s=_t(`{`,`}`,e);if(!s)return Wt(i,e,[``],t,n,a);let c=s.pre;if(/\$$/.test(c)){if(i=Wt(i,c+`{`+s.body+`}`,[``],t,n,a&&!s.post.length),o=!1,!s.post.length)break;e=s.post;continue}let l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),d=l||u,f=s.body.indexOf(`,`)>=0;if(!d&&!f){if(s.post.match(/,(?!,).*\}/)){e=s.pre+`{`+s.body+St+s.post,r=!0;continue}return Wt(i,c+`{`+s.body+`}`+s.post,[``],t,n,a)}o&&=(a=r&&!d,!1);let p;if(d)p=Gt(s.body,u,t,n);else{let r=Rt(s.body);if(r.length===1&&r[0]!==void 0&&(r=Kt(r[0],t,n,!1).map(Bt),r.length===1)){if(i=Wt(i,c+r[0],[``],t,n,a&&!s.post.length),!s.post.length)break;e=s.post;continue}let o=a&&!s.post.length&&!c;for(let e=0;o&&e<i.length;e++)i[e]&&(o=!1);p=[];let l=0;outer:for(let e=0;e<r.length;e++){let i=Kt(r[e],t,n,!1);for(let e=0;e<i.length;e++){let r=i[e];if(!(o&&!r)){if(p.length>=t||l+r.length>n)break outer;p.push(r),l+=r.length}}}}if(i=Wt(i,c,p,t,n,a&&!s.post.length),!s.post.length)break;e=s.post}return i}const qt=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},Jt={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},Yt=e=>e.replace(/[[\]\\-]/g,`\\$&`),Xt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),Zt=e=>e.join(``),Qt=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Jt))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(Yt(d)+`-`+Yt(t)):t===d&&r.push(Yt(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(Yt(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(Yt(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){let e=r[0].length===2?r[0].slice(-1):r[0];return[Xt(e),!1,u-n,!1]}let f=`[`+(l?`^`:``)+Zt(r)+`]`,p=`[`+(l?``:`^`)+Zt(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},$t=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var X;const en=new Set([`!`,`?`,`+`,`*`,`@`]),tn=e=>en.has(e),nn=e=>tn(e.type),rn=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),an=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),on=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),sn=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),cn=`(?!\\.)`,ln=new Set([`[`,`.`]),un=new Set([`..`,`.`]),dn=new Set(`().*{}+?[]^$\\!`),fn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),pn=`[^/]+?`;let mn=0;var hn=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++mn;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.#l=this.type?this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof X&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof X&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new X(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&tn(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new X(n,t);u=X.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new X(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&tn(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new X(n,d);d.push(o),u=X.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new X(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,an)}#m(e,t=rn){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=on){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new X(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!sn.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=sn.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new X(null,void 0,t);return X.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!nn(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?X.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&un.has(this.#r[0]))){let n=ln,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?cn:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,$t(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,$t(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?cn:``)+pn;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?cn:``)+`[^/]*?)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,$t(i),this.#t=!!this.#t,this.#n]}#x(){if(nn(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(dn.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?pn:`[^/]*?`,t=!0;continue}if(o=!1,c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=Qt(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=`[^/]`,t=!0;continue}i+=fn(c)}return[i,$t(e),!!t,a]}};X=hn;const gn=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),Z=(e,t,n={})=>(qt(t),!n.nocomment&&t.charAt(0)===`#`?!1:new Hn(t,n).match(e)),_n=/^\*+([^+@!?*[(]*)$/,vn=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),yn=e=>t=>t.endsWith(e),bn=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),xn=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Sn=/^\*+\.\*+$/,Cn=e=>!e.startsWith(`.`)&&e.includes(`.`),wn=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Tn=/^\.\*+$/,En=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Dn=/^\*+$/,On=e=>e.length!==0&&!e.startsWith(`.`),kn=e=>e.length!==0&&e!==`.`&&e!==`..`,An=/^\?+([^+@!?*[(]*)?$/,jn=([e,t=``])=>{let n=Fn([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Mn=([e,t=``])=>{let n=In([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Nn=([e,t=``])=>{let n=In([e]);return t?e=>n(e)&&e.endsWith(t):n},Pn=([e,t=``])=>{let n=Fn([e]);return t?e=>n(e)&&e.endsWith(t):n},Fn=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},In=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},Ln=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,Rn={win32:{sep:`\\`},posix:{sep:`/`}};Z.sep=Ln===`win32`?Rn.win32.sep:Rn.posix.sep;const Q=Symbol(`globstar **`);Z.GLOBSTAR=Q,Z.filter=(e,t={})=>n=>Z(n,e,t);const $=(e,t={})=>Object.assign({},e,t);Z.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return Z;let t=Z;return Object.assign((n,r,i={})=>t(n,r,$(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,$(e,n))}static defaults(n){return t.defaults($(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,$(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,$(e,r))}},unescape:(n,r={})=>t.unescape(n,$(e,r)),escape:(n,r={})=>t.escape(n,$(e,r)),filter:(n,r={})=>t.filter(n,$(e,r)),defaults:n=>t.defaults($(e,n)),makeRe:(n,r={})=>t.makeRe(n,$(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,$(e,r)),match:(n,r,i={})=>t.match(n,r,$(e,i)),sep:t.sep,GLOBSTAR:Q})};const zn=(e,t={})=>(qt(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:zt(e,{max:t.braceExpandMax}));Z.braceExpand=zn,Z.makeRe=(e,t={})=>new Hn(e,t).makeRe(),Z.match=(e,t,n={})=>{let r=new Hn(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const Bn=/[?*]|[+@!]\(.*?\)|\[|\]/,Vn=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var Hn=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){qt(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||Ln,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!Bn.test(e[2]))&&!Bn.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];(n!==1||r!==``||e[0]!==``)&&(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];(e!==1||r!==``||n[0]!==``)&&(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Q)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(Q,i),o=t.lastIndexOf(Q),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===Q?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===Q)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return zn(this.pattern,this.options)}parse(e){qt(e);let t=this.options;if(e===`**`)return Q;if(e===``)return``;let n,r=null;(n=e.match(Dn))?r=t.dot?kn:On:(n=e.match(_n))?r=(t.nocase?t.dot?xn:bn:t.dot?yn:vn)(n[1]):(n=e.match(An))?r=(t.nocase?t.dot?Mn:jn:t.dot?Nn:Pn)(n):(n=e.match(Sn))?r=t.dot?wn:Cn:(n=e.match(Tn))&&(r=En);let i=hn.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?Vn(e):e===Q?Q:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e===Q&&a!==Q&&(a===void 0?i!==void 0&&i!==Q?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==Q&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=Q))});let i=t.filter(e=>e!==Q);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return Z.defaults(e).Minimatch}};Z.AST=hn,Z.Minimatch=Hn,Z.escape=gn,Z.unescape=$t;function Un(e){let t=e.replaceAll(o.sep,`/`).replace(/^.*?(app\/)/,`app/`);return!i().analysis.excluded.some(e=>Z(t,e,{dot:!0}))}function Wn(e){return e.filter(Un)}function Gn(e){return i().analysis.backends.some(t=>t.name===e)}function Kn(e){let t=e.getFullText().match(/BackendTypes\.([A-Z0-9_]+)/)?.[1];if(t)return Gn(t)?t:null;let n=e.getFilePath().split(o.sep),r=n.lastIndexOf(`back`),i=n.lastIndexOf(`_infra`),a=r>=0?n[r+1]:i>=0?n[i+2]:void 0;return a&&Gn(a.toUpperCase())?a.toUpperCase():null}function qn(e,t,n){for(let[r,i]of Object.entries(t)){if(e!==r&&!e.startsWith(`${r}/`))continue;let t=e.slice(r.length).replace(/^\//,``);return o.join(n,i,t)}return null}function Jn(e){let t=o.extname(e),n=t?e.slice(0,-t.length):e,r=[e,t===`.js`?`${n}.ts`:null,t===`.ts`?`${n}.js`:null,t===`.mjs`?`${n}.mts`:null,t===`.mts`?`${n}.mjs`:null,`${e}.ts`,`${e}.js`,`${e}.mts`,`${e}.mjs`,o.join(n,`index.ts`),o.join(n,`index.js`),o.join(e,`index.ts`),o.join(e,`index.js`)].filter(e=>!!e);for(let e of r)try{let t=o.normalize(e);if(s.existsSync(t))return t}catch{continue}return null}function Yn(e,t,n,r){if(t.startsWith(`.`))return Jn(o.resolve(o.dirname(e),t));let i=qn(t,n,r);return i?Jn(i):null}const Xn={local_call:1,imported_call:2,local_callback:2,imported_callback:3};function Zn(e,t){let n=o.relative(e,t);return n.startsWith(`..`)?t:n.replaceAll(o.sep,`/`)}function Qn(e){try{return s.statSync(e).isFile()}catch{return!1}}function $n(e){return e.declaration?.getStartLineNumber()||1}function er(e){return`${e.sourceFile.getFilePath()}:${e.symbol}:${$n(e)}`}function tr(e){let t=e.getInitializer();return!!(t&&(u.isArrowFunction(t)||u.isFunctionExpression(t)||u.isCallExpression(t)||u.isNewExpression(t)))}function nr(e,t){return e.getFunctions().find(e=>e.getName()===t)||e.getVariableDeclarations().find(e=>e.getName()===t&&tr(e))||e.getDescendantsOfKind(f.MethodDeclaration).find(e=>e.getName()===t)}function rr(e,t,n,r){let i=r(t.getFilePath(),n);return i?e.getSourceFile(i)||(Qn(i)?e.addSourceFileAtPathIfExists(i):void 0):void 0}function ir(e,t,n,r,i=new Set){let a=`${t.getFilePath()}:${n}`;if(i.has(a))return;i.add(a);let o=nr(t,n);if(o)return{declaration:o,sourceFile:t,symbol:n,imported:!0};for(let a of t.getExportDeclarations()){let o=a.getModuleSpecifierValue();if(!o)continue;let s=a.getNamedExports().find(e=>(e.getAliasNode()?.getText()||e.getName())===n);if(a.getNamedExports().length&&!s)continue;let c=rr(e,t,o,r);if(!c)continue;let l=ir(e,c,s?.getName()||n,r,i);if(l)return l}}function ar(e,t,n,r,i){let a=t.getVariableDeclaration(n)?.getInitializer();if(!a||!u.isNewExpression(a))return;let o=a.getExpression().getText(),s=t.getClass(o)?.getInstanceMethod(r);if(s)return{declaration:s,sourceFile:t,symbol:r,imported:!0};for(let n of t.getImportDeclarations()){let a=n.getNamedImports().find(e=>(e.getAliasNode()?.getText()||e.getName())===o);if(!a)continue;let s=rr(e,t,n.getModuleSpecifierValue(),i),c=s?.getClass(a.getName())?.getInstanceMethod(r);if(s&&c)return{declaration:c,sourceFile:s,symbol:r,imported:!0}}}function or(e,t,n,r){let[i,a]=n.split(`.`);for(let o of t.getImportDeclarations()){let s=rr(e,t,o.getModuleSpecifierValue(),r);if(!s)continue;if(o.getNamespaceImport()?.getText()===i&&a)return ir(e,s,a,r)||{sourceFile:s,symbol:n,imported:!0};let c=o.getNamedImports().find(e=>(e.getAliasNode()?.getText()||e.getName())===i);if(c){let t=c.getName();if(a){if(Kn(s))return{sourceFile:s,symbol:n,imported:!0};let i=ar(e,s,t,a,r);if(i)return i}return ir(e,s,a||t,r)||{sourceFile:s,symbol:n,imported:!0}}if(o.getDefaultImport()?.getText()===i)return ir(e,s,a||`default`,r)||{sourceFile:s,symbol:n,imported:!0}}}function sr(e,t,n,r){let i=n.getExpression();if(!u.isPropertyAccessExpression(i)||i.getExpression().getText()!==`this`)return;let a=n.getFirstAncestorByKind(f.ClassDeclaration)?.getProperty(i.getName())?.getTypeNode()?.getText().match(/[A-Za-z_$][A-Za-z0-9_$]*/)?.[0];if(a)for(let i of t.getImportDeclarations()){let o=i.getNamedImports().find(e=>(e.getAliasNode()?.getText()||e.getName())===a);if(!o)continue;let s=rr(e,t,i.getModuleSpecifierValue(),r);if(!s)continue;let c=o.getName(),l=s.getClasses().find(e=>e.getName()===c)?.getInstanceMethod(n.getName());if(l)return{declaration:l,sourceFile:s,symbol:n.getText(),imported:!0}}}function cr(e,t,n,r){let i=n.getText(),a=u.isPropertyAccessExpression(n)?n.getName():u.isIdentifier(n)?n.getText():void 0;if(u.isPropertyAccessExpression(n)){let a=or(e,t,i,r);if(a)return a;let o=sr(e,t,n,r);if(o)return o}if(a){let e=nr(t,a);if(e)return{declaration:e,sourceFile:t,symbol:a,imported:!1}}let o=or(e,t,i,r);if(o)return o;let s=n.getSymbol()?.getAliasedSymbol()?.getDeclarations()[0]||n.getSymbol()?.getDeclarations()[0];if(!s)return;let c=u.isFunctionDeclaration(s)||u.isMethodDeclaration(s)||u.isVariableDeclaration(s)?s:void 0;if(!c||u.isVariableDeclaration(c)&&!tr(c))return;let l=c.getSourceFile();return{declaration:c,sourceFile:l,symbol:a||i,imported:l.getFilePath()!==t.getFilePath()}}function lr(e){let t=[{expression:e.getExpression(),type:`call`}];for(let n of e.getArguments())(u.isIdentifier(n)||u.isPropertyAccessExpression(n))&&t.push({expression:n,type:`callback`});return t}function ur(e,t){return e===`callback`?t?Xn.imported_callback:Xn.local_callback:t?Xn.imported_call:Xn.local_call}function dr(e){return e.declaration?.getDescendantsOfKind(f.CallExpression)||[]}function fr(e,t){let n=i().analysis.mapperNaming;if(t===`api`)return n.inputPatterns.some(t=>t.test(e))?`input`:n.outputPatterns.some(t=>t.test(e))?`output`:void 0;if(n.domainToBackendPattern.test(e))return`input`;if(n.domainNameFromToDomainPattern.test(e)||/(?:From(?:Back|Backend)ToDomain|ToDomain)$/i.test(e))return`output`}function pr(e,t,n){let r=o.resolve(e,n.source),i=t.getSourceFile(r)||t.addSourceFileAtPathIfExists(r);if(!i)return;let a=[...i.getFunctions(),...i.getDescendantsOfKind(f.MethodDeclaration),...i.getVariableDeclarations().filter(tr)].find(e=>e.getStartLineNumber()===n.line);return a?{declaration:a,sourceFile:i,symbol:n.symbol,imported:!0}:void 0}function mr(e){let t=nr(e.handlerFile,e.handlerName);if(!t)return[];let n={declaration:t,sourceFile:e.handlerFile,symbol:e.handlerName,imported:!1},r=[],i=new Set,a=(t,n,o,s,c)=>{let l=[er(t),n,o,s,c].join(`:`);if(i.has(l))return;i.add(l),r.push({layer:n,direction:o,symbol:t.declaration?.getSymbol()?.getName()||t.symbol.split(`.`).at(-1),source:Zn(e.cwd,t.sourceFile.getFilePath()),line:$n(t),backend_path:s,backend_type:c});let u=n===`api`?`app/_api/`:`app/_infra/back/`;for(let r of dr(t)){let i=cr(e.project,t.sourceFile,r.getExpression(),e.resolvePath);!i?.declaration||!Zn(e.cwd,i.sourceFile.getFilePath()).includes(u)||a(i,n,o,s,c)}},o=(t,n,r,i)=>{for(let o of dr(t)){let s=cr(e.project,t.sourceFile,o.getExpression(),e.resolvePath);if(!s?.declaration)continue;let c=fr(s.declaration.getSymbol()?.getName()||s.symbol.split(`.`).at(-1),n);c&&a(s,n,c,r,i)}};for(let[t,r]of e.backendPaths.entries()){o(n,`api`,t,r.backend_type);for(let n of r.nodes){if(!n.source.includes(`app/_infra/back/`))continue;let i=pr(e.cwd,e.project,n);i&&o(i,`backend`,t,r.backend_type)}}return[...new Map(r.map(e=>[[e.layer,e.direction,e.symbol,e.source,e.line,e.backend_path,e.backend_type].join(`:`),e])).values()]}function hr(e){let t=nr(e.handlerFile,e.handlerName);if(!t)throw Error(`Handler declaration not found: ${e.handlerName} in ${e.handlerFile.getFilePath()}`);let n={declaration:t,sourceFile:e.handlerFile,symbol:e.handlerName,imported:!1},r=[{callable:n,weight:0,nodes:[{symbol:n.symbol,source:Zn(e.cwd,n.sourceFile.getFilePath()),line:$n(n),depth:0}],edges:[],visited:new Set([er(n)])}],i=[],a=new Map([[er(n),0]]),o=new Map;for(;r.length;){r.sort((e,t)=>e.weight-t.weight);let t=r.shift();for(let n of dr(t.callable))for(let s of lr(n)){let c=cr(e.project,t.callable.sourceFile,s.expression,e.resolvePath);if(!c)continue;let l=er(c);if(t.visited.has(l))continue;let u=ur(s.type,c.imported),d=t.weight+u,f=Kn(c.sourceFile)||void 0,p={symbol:c.symbol,source:Zn(e.cwd,c.sourceFile.getFilePath()),line:$n(c),depth:d,backend_type:f},m={type:s.type,from:t.callable.symbol,to:c.symbol,source:Zn(e.cwd,t.callable.sourceFile.getFilePath()),line:n.getStartLineNumber(),weight:u},h=[...t.nodes,p],g=[...t.edges,m];if(f){let e=`${f}:${p.source}:${p.symbol}:${p.line}`,t=o.get(e);if(t!==void 0&&d>t)continue;o.set(e,d),i.push({backend_type:f,total_weight:d,status:`resolved`,nodes:h,edges:g});continue}if(!c.declaration)continue;let _=a.get(l);_!==void 0&&d>=_||(a.set(l,d),r.push({callable:c,weight:d,nodes:h,edges:g,visited:new Set([...t.visited,l])}))}}let s=new Map;for(let e of i.filter(e=>{let t=e.nodes.at(-1),n=`${e.backend_type}:${t.source}:${t.symbol}:${t.line}`;return e.total_weight===o.get(n)})){let t=`${e.backend_type}:${e.nodes.map(e=>`${e.source}:${e.symbol}:${e.line}`).join(`->`)}`,n=s.get(t);(!n||e.total_weight<n.total_weight)&&s.set(t,e)}return[...s.values()].sort((e,t)=>e.total_weight-t.total_weight||e.backend_type.localeCompare(t.backend_type))}function gr(e,t){let n=e.getProperty(t);if(!n||!u.isPropertyAssignment(n))return;let r=n.getInitializer();return r&&(u.isStringLiteral(r)||u.isNoSubstitutionTemplateLiteral(r))?r.getLiteralValue():void 0}function _r(e){let t=e.getProperty(`handler`);if(!t||!u.isPropertyAssignment(t))return;let n=t.getInitializer();return n&&(u.isIdentifier(n)||u.isPropertyAccessExpression(n))?n.getText():void 0}function vr(e){let t=e.getVariableDeclaration(`routes`)?.getInitializer(),n=t;return t&&(u.isAsExpression(t)||u.isSatisfiesExpression(t))&&(n=t.getExpression()),!n||!u.isArrayLiteralExpression(n)?[]:n.getElements().flatMap(t=>{if(!u.isObjectLiteralExpression(t))return[];let n=gr(t,`method`),r=gr(t,`path`),i=_r(t);return n&&r&&i?[{method:n.toUpperCase(),path:r,sourceFile:e,handlerRef:i}]:[]})}function yr(e,t,n){let r=or(e,t.sourceFile,t.handlerRef,n);if(r)return r;let i=nr(t.sourceFile,t.handlerRef);return i?{declaration:i,sourceFile:t.sourceFile,symbol:t.handlerRef,imported:!1}:void 0}async function br(e,t,n){let r=[t],i=new Set;for(;r.length;){let t=r.shift();if(i.has(t))continue;i.add(t);let a=e.getSourceFile(t)||(Qn(t)?e.addSourceFileAtPathIfExists(t):void 0);if(!a)continue;let o=[...a.getImportDeclarations().map(e=>e.getModuleSpecifierValue()),...a.getExportDeclarations().map(e=>e.getModuleSpecifierValue()).filter(e=>!!e)];for(let e of o){let t=n(a.getFilePath(),e);t&&!i.has(t)&&Un(t)&&r.push(t)}}return[...i]}async function xr(e){let t=(t,n)=>Yn(t,n,i().resolver.alias,e.cwd),n=new d({skipAddingFilesFromTsConfig:!0,compilerOptions:{allowJs:!0,checkJs:!1,target:99,module:99}});r.report(`Discovering route files`);let a=await ht([`app/_api/**/routes.@(js|ts)`,`app/legacy/**/routes.@(js|ts)`],{cwd:e.cwd,absolute:!0});r.log(`${a.length} route file${a.length===1?``:`s`} discovered`),r.report(`Extracting route declarations`);let o=a.flatMap(e=>vr(n.addSourceFileAtPath(e))).filter(t=>e.routeSelector?t.method===e.routeSelector.method&&t.path===e.routeSelector.path:!e.routeSelectors||e.routeSelectors.some(e=>t.method===e.method&&t.path===e.path));if(e.routeSelector&&!o.length)throw Error(`Route not found: ${e.routeSelector.method} ${e.routeSelector.path}`);e.onRoutesDiscovered?.(o.length),e.onRoutesDiscovered||r.log(`${o.length} API route${o.length===1?``:`s`} selected`);let s=[];for(let[i,a]of o.entries()){let c=t=>e.onRouteProgress?.({current:i+1,total:o.length,route:{method:a.method,path:a.path},stage:t});e.onRouteProgress||(r.report(`Tracing route ${i+1}/${o.length}: ${a.method} ${a.path}`),await new Promise(e=>setImmediate(e)));let l=yr(n,a,t);if(!l?.declaration){r.log(`Warning: handler not resolved for ${a.method} ${a.path} (${a.handlerRef}); route skipped`),c(`completed`);continue}c(`collecting_dependencies`),e.onRouteProgress||r.log(`${a.method} ${a.path} ... Collecting dependencies`);let u=await br(n,l.sourceFile.getFilePath(),t);c(`tracing_paths`),e.onRouteProgress||r.log(`${a.method} ${a.path} ... Tracing callable paths`);let d=hr({cwd:e.cwd,project:n,handlerFile:l.sourceFile,handlerName:l.symbol,resolvePath:t}),f=mr({cwd:e.cwd,project:n,handlerFile:l.sourceFile,handlerName:l.symbol,backendPaths:d,resolvePath:t});e.onRouteProgress||r.log(`${a.method} ${a.path} ... ${d.length} backend path${d.length===1?``:`s`}`);let p={schema_version:3,generated_at:new Date().toISOString(),route:{method:a.method,path:a.path,source:Zn(e.cwd,a.sourceFile.getFilePath()),handler:{symbol:l.symbol,source:Zn(e.cwd,l.sourceFile.getFilePath()),line:$n(l)}},analysis_files:[...new Set([...u.map(t=>Zn(e.cwd,t)),...d.flatMap(e=>e.nodes.map(e=>e.source))])].sort(),mapping_context:f,weights:Xn,backend_paths:d};s.push(p),await e.onArtifact?.(p),c(`completed`)}return s}async function Sr(e){let t=new d({skipAddingFilesFromTsConfig:!0,compilerOptions:{allowJs:!0,checkJs:!1}});return(await ht([`app/_api/**/routes.@(js|ts)`,`app/legacy/**/routes.@(js|ts)`],{cwd:e,absolute:!0})).flatMap(e=>vr(t.addSourceFileAtPath(e))).map(e=>({method:e.method,path:e.path}))}async function Cr(e){let t=e.routeSelector?[e.routeSelector]:await Sr(e.cwd);e.onRoutesDiscovered?.(t.length);let n=Math.min(e.workers||2,t.length),r=Array.from({length:n},()=>[]);t.forEach((e,t)=>r[t%n].push(e));let i=[],a=0,o=Promise.resolve(),s=[];try{return await Promise.all(r.map(n=>new Promise((r,c)=>{let l=import.meta.url.endsWith(`.ts`)?`../workers/routeBackendTopologyWorker.ts`:`./workers/routeBackendTopologyWorker.mjs`,u=new h(new URL(l,import.meta.url),{workerData:{cwd:e.cwd,routeSelectors:n},execArgv:process.execArgv});s.push(u),u.on(`message`,n=>{if(n.type===`error`){c(Error(n.message));return}o=o.then(async()=>{if(n.type===`artifact`){await e.onArtifact(n.artifact),i.push(n.artifact);return}a+=1,e.onRouteProgress?.({current:a,total:t.length,route:n.route,stage:`completed`})}).catch(c)}),u.once(`error`,c),u.once(`exit`,e=>e===0?r():c(Error(`Topology worker exited with code ${e}`)))}))),await o,i}catch(e){throw await Promise.all(s.map(e=>e.terminate().catch(()=>void 0))),e}}export{Gn as a,ht as c,Kn as i,Cr as n,Wn as o,Yn as r,Un as s,xr as t};
44
+ //# sourceMappingURL=routeBackendTopologyService-_ebE4-LV.mjs.map