cdktn-cli 0.25.0-pre.2 → 0.25.0-pre.3

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.
@@ -71,7 +71,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
71
71
  ${i.join(`
72
72
  `)}`);let s={...n.context,...n.targetVersions?{[x9.TARGET_VERSIONS_CONTEXT_KEY]:n.targetVersions}:{}};return Object.keys(s).length>0&&(Awt.env[hwt]=JSON.stringify(s)),n};Ot.parseConfig=mwt;function Iwt(e=zye.join(process.cwd(),qye)){let t;return $ye.existsSync(e)&&(t=$ye.readFileSync(e).toString()),(0,Ot.parseConfig)(t)}Ot.readConfigSync=Iwt;function ywt(e){return tD(e.terraformModules)||tD(e.terraformProviders)}Ot.shouldCheckCodeMakerOutput=ywt;function Cwt(e){jye.logger.debug(`Start timer for ${e}...`);let t=Date.now();return function(){let i=Date.now()-t;jye.logger.debug(`${e} took ${i}ms`)}}Ot.logTimespan=Cwt});var Kye=p((jyr,Xye)=>{"use strict";Xye.exports=({onlyFirst:e=!1}={})=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")}});var _f=p((zyr,eCe)=>{"use strict";var bwt=Kye();eCe.exports=e=>typeof e=="string"?e.replace(bwt(),""):e});var Z0=p(Wt=>{"use strict";var Ewt=Wt&&Wt.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Bwt=Wt&&Wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),aD=Wt&&Wt.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Ewt(t,e,r);return Bwt(t,e),t},vwt=Wt&&Wt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.hasNoColorFlagOrEnv=Wt.ensureAllSettledBeforeThrowing=Wt.downloadFile=Wt.HttpError=Wt.downcaseFirst=Wt.readCDKTFManifest=Wt.readCDKTFVersion=Wt.exec=Wt.mkdtemp=Wt.withTempDir=Wt.shell=void 0;var Swt=aV(),Pa=aD(Br()),tCe=epe(),rCe=aD(require("os")),SB=aD(require("path")),sD=xg(),wwt=require("cdktn"),_wt=aD(iD()),vB=vwt(_f());function xwt(e,t,r){e.stderr=t,e.stdout=r;let n=[t,r].filter(Boolean).join(`
73
73
  `);if(n){let i=e.message;e.toString=()=>`Error: ${i}
74
- ${n}`}}async function Rwt(e,t=[],r={}){return(0,Wt.exec)(e,t,r,n=>{let i=r.noColor?(0,vB.default)(n.toLocaleString()):n.toLocaleString();console.log(i)},()=>{})}Wt.shell=Rwt;async function Dwt(e,t){let r=process.cwd(),n=await Pa.mkdtemp(SB.join(rCe.tmpdir(),"cdktf.")),i=SB.join(n,e);await Pa.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(r),await Pa.remove(n)}}Wt.withTempDir=Dwt;async function Qwt(e){let t=await Pa.mkdtemp(SB.join(rCe.tmpdir(),"cdktf."));try{await e(t)}finally{await Pa.remove(t)}}Wt.mkdtemp=Qwt;var Nwt=async(e,t,r,n,i,s=!0)=>{typeof r.noColor!="boolean"&&nCe()&&(r.noColor=!0);let{signal:o,...a}=r;return new Promise((c,u)=>{var l,d,f,A;let g=(0,Swt.spawn)(e,t,a),h=new Array,m=new Array;n!==void 0?(l=g.stdout)===null||l===void 0||l.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerDebug)(C),h.push(C),n(C)}):(d=g.stdout)===null||d===void 0||d.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerDebug)(C),h.push(C)}),i!==void 0?(f=g.stderr)===null||f===void 0||f.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerError)(C),s&&i(C),m.push(C)}):(A=g.stderr)===null||A===void 0||A.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerError)(C),s&&process.stderr.write(C),m.push(C)}),g.once("error",I=>u(I)),g.once("close",I=>{if(I!==0){let C=new Error(`${e} ${t.join(" ")} exited with code ${I}`);return xwt(C,m.join(""),h.join("")),u(C)}return c(h.join(""))})})};Wt.exec=Nwt;async function Twt(e){let t=SB.join(e,"cdk.tf.json");if(Pa.existsSync(t)){let r=Pa.readFileSync(t,"utf8");return JSON.parse(r)["//"].metadata.version}return""}Wt.readCDKTFVersion=Twt;async function kwt(){let{output:e}=_wt.readConfigSync(),t=await Pa.readFile(SB.join(e,wwt.Manifest.fileName));return JSON.parse(t.toString())}Wt.readCDKTFManifest=kwt;function Fwt(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}Wt.downcaseFirst=Fwt;var oD=class extends Error{constructor(t,r){super(t),this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}};Wt.HttpError=oD;async function Gwt(e,t){let r=e.startsWith("http://")?tCe.http:tCe.https,n=Pa.createWriteStream(t);return new Promise((i,s)=>{let o=r.get(e,a=>{if(a.statusCode!==200){s(new oD(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(n)});n.on("finish",()=>i()),o.on("error",a=>{Pa.unlink(t,()=>s(a))}),n.on("error",a=>{Pa.unlink(t,()=>s(a))}),o.end()})}Wt.downloadFile=Gwt;async function Zwt(e,t){try{await e}catch(r){throw await Promise.allSettled(t),r}}Wt.ensureAllSettledBeforeThrowing=Zwt;function nCe(){return Uwt("no-color")||process.env.FORCE_COLOR==="0"}Wt.hasNoColorFlagOrEnv=nCe;function Uwt(e){let t=e.startsWith("-")?"":e.length===1?"-":"--",r=process.argv.indexOf(t+e),n=process.argv.indexOf("--");return r!==-1&&(n===-1||r<n)}});var xg=p(Ci=>{"use strict";var Owt=Ci&&Ci.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Mwt=Ci&&Ci.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),D9=Ci&&Ci.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Owt(t,e,r);return Mwt(t,e),t};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.logFileName=Ci.processLoggerError=Ci.processLoggerDebug=Ci.logger=void 0;var R9=Voe(),iCe=D9(Br()),Lwt=D9(require("path")),U0=D9(vR()),Wwt=Z0(),nd=(0,R9.getLogger)(),Q9={trace(e,...t){nd.trace(e,...t),U0.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){nd.debug(e,...t),U0.addBreadcrumb({message:e,level:"debug"})},info(e,...t){nd.info(e,...t),U0.addBreadcrumb({message:e,level:"info"})},warn(e,...t){nd.warn(e,...t),U0.addBreadcrumb({message:e,level:"warning"})},error(e,...t){nd.error(e,...t),U0.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){nd.fatal(e,...t),U0.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){nd.level=e},useDefaultLevel(){nd.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};Ci.logger=Q9;nd.level=process.env.CDKTF_LOG_LEVEL||"INFO";var sCe="cdktf.log";Ci.logFileName=sCe;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&iCe.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&iCe.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,R9.configure)({appenders:{cdktf:{type:"file",filename:Lwt.join(process.env.CDKTF_LOG_FILE_DIRECTORY,sCe)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,Wwt.hasNoColorFlagOrEnv)()?"basic":"colored";(0,R9.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var Vwt=e=>{Q9.debug(e.toString())};Ci.processLoggerDebug=Vwt;var Hwt=e=>{Q9.error(e.toString())};Ci.processLoggerError=Hwt});var oCe=p((Xyr,Pwt)=>{Pwt.exports={name:"@cdktn/commons",version:"0.25.0-pre.2",publishConfig:{access:"public"},description:"CDK Terrain Common utilities",scripts:{build:"tsc",watch:"tsc -w","watch-preserve-output":"tsc -w --preserveWatchOutput","test:update":"jest -u",package:"./package.sh","dist-clean":"rm -rf dist","package:js":"./package.sh"},main:"build/index.js",types:"build/index.d.ts",nx:{tags:["unit-test"]},repository:{type:"git",url:"git://github.com/open-constructs/cdk-terrain.git",directory:"packages/@cdktn/commons"},author:{name:"OpenConstructs",url:"https://github.com/open-constructs"},keywords:["cdk","cdktf","cdktn","terraform"],license:"MPL-2.0",dependencies:{"@sentry/node":"7.120.4",cdktn:"workspace:*","ci-info":"4.4.0",codemaker:"1.128.0","cross-spawn":"7.0.6","follow-redirects":"1.16.0","fs-extra":"11.3.6",log4js:"6.9.1",semver:"7.8.5","strip-ansi":"6.0.1",validator:"13.15.35"},devDependencies:{"@types/cross-spawn":"6.0.6","@types/follow-redirects":"1.14.4","@types/fs-extra":"11.0.4","@types/semver":"7.7.1","@types/validator":"13.15.10","tsc-files":"1.1.4",typescript:"^5.0.4"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var wB=p(cD=>{"use strict";Object.defineProperty(cD,"__esModule",{value:!0});cD.DISPLAY_VERSION=void 0;cD.DISPLAY_VERSION=`${Ywt()}`;function Ywt(){return oCe().version.replace(/\+[0-9a-f]+$/,"")}});var T9=p(Un=>{"use strict";var $wt=Un&&Un.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),jwt=Un&&Un.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),dD=Un&&Un.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&$wt(t,e,r);return jwt(t,e),t},zwt=Un&&Un.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Un,"__esModule",{value:!0});Un.ReportRequest=Un.getUserId=Un.getProjectId=Un.sendTelemetry=void 0;var qwt=dD(require("https")),Jwt=require("url"),uCe=require("node:crypto"),lD=dD(require("os")),aCe=zwt(n_()),N9=xg(),_B=dD(require("path")),uD=dD(Br()),Xwt=wB(),Kwt="https://checkpoint-api.hashicorp.com/v1/",e_t=[200,201],cCe=8192;function t_t(){var e;return process.env.CDKTF_HOME?_B.resolve(process.env.CDKTF_HOME):_B.join(((e=lD.userInfo().homedir)!==null&&e!==void 0?e:lD.homedir()).trim()||"/",".cdktf")}async function r_t(e,t){return new Promise((r,n)=>{let i=qwt.request((0,Jwt.format)(e),{headers:{Accept:"application/json","Content-Length":t.length,"User-Agent":"OpenConstructs/cdktn-cli"},method:"POST"},s=>{if(s.statusCode){let a=s.statusCode;if(!e_t.includes(a))return n(new Error(s.statusMessage))}let o=new Array;s.on("data",a=>o.push(a)),s.on("error",a=>n(a)),s.on("end",()=>r())});i.setTimeout(1e3,()=>n(new Error("request timeout"))),i.write(t),i.end(),i.on("error",s=>n(s))})}async function n_t(e,t){let r={command:e,product:"cdktn",version:`${Xwt.DISPLAY_VERSION}`,dateTime:new Date,language:t.language,payload:t};try{await ACe(r)}catch(n){N9.logger.error(`Could not send telemetry data: ${n}`)}}Un.sendTelemetry=n_t;function lCe(e,t,r=!1,n){let i=(0,uCe.randomUUID)(),s;try{s=JSON.parse(uD.readFileSync(e,"utf-8"))}catch{if(r){let a={};n&&(a["//"]=n.replace(/\n/g," ")),a[t]=i,uD.ensureDirSync(_B.dirname(e)),uD.writeFileSync(e,JSON.stringify(a,null,2))}return i}return s[t]?s[t]:(uD.writeFileSync(e,JSON.stringify({...s,[t]:i},null,2)),i)}function dCe(e=process.cwd()){return lCe(_B.resolve(e,"cdktf.json"),"projectId")}Un.getProjectId=dCe;function fCe(){return lCe(_B.resolve(t_t(),"config.json"),"userId",!0,`This signature is a randomly generated UUID used to anonymously differentiate users in telemetry data order to inform product direction.
74
+ ${n}`}}async function Rwt(e,t=[],r={}){return(0,Wt.exec)(e,t,r,n=>{let i=r.noColor?(0,vB.default)(n.toLocaleString()):n.toLocaleString();console.log(i)},()=>{})}Wt.shell=Rwt;async function Dwt(e,t){let r=process.cwd(),n=await Pa.mkdtemp(SB.join(rCe.tmpdir(),"cdktf.")),i=SB.join(n,e);await Pa.mkdirp(i);try{process.chdir(i),await t()}finally{process.chdir(r),await Pa.remove(n)}}Wt.withTempDir=Dwt;async function Qwt(e){let t=await Pa.mkdtemp(SB.join(rCe.tmpdir(),"cdktf."));try{await e(t)}finally{await Pa.remove(t)}}Wt.mkdtemp=Qwt;var Nwt=async(e,t,r,n,i,s=!0)=>{typeof r.noColor!="boolean"&&nCe()&&(r.noColor=!0);let{signal:o,...a}=r;return new Promise((c,u)=>{var l,d,f,A;let g=(0,Swt.spawn)(e,t,a),h=new Array,m=new Array;n!==void 0?(l=g.stdout)===null||l===void 0||l.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerDebug)(C),h.push(C),n(C)}):(d=g.stdout)===null||d===void 0||d.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerDebug)(C),h.push(C)}),i!==void 0?(f=g.stderr)===null||f===void 0||f.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerError)(C),s&&i(C),m.push(C)}):(A=g.stderr)===null||A===void 0||A.on("data",I=>{let C=r.noColor?(0,vB.default)(I.toLocaleString()):I.toLocaleString();(0,sD.processLoggerError)(C),s&&process.stderr.write(C),m.push(C)}),g.once("error",I=>u(I)),g.once("close",I=>{if(I!==0){let C=new Error(`${e} ${t.join(" ")} exited with code ${I}`);return xwt(C,m.join(""),h.join("")),u(C)}return c(h.join(""))})})};Wt.exec=Nwt;async function Twt(e){let t=SB.join(e,"cdk.tf.json");if(Pa.existsSync(t)){let r=Pa.readFileSync(t,"utf8");return JSON.parse(r)["//"].metadata.version}return""}Wt.readCDKTFVersion=Twt;async function kwt(){let{output:e}=_wt.readConfigSync(),t=await Pa.readFile(SB.join(e,wwt.Manifest.fileName));return JSON.parse(t.toString())}Wt.readCDKTFManifest=kwt;function Fwt(e){return e===""?e:`${e[0].toLocaleLowerCase()}${e.slice(1)}`}Wt.downcaseFirst=Fwt;var oD=class extends Error{constructor(t,r){super(t),this.statusCode=r,Object.setPrototypeOf(this,new.target.prototype)}};Wt.HttpError=oD;async function Gwt(e,t){let r=e.startsWith("http://")?tCe.http:tCe.https,n=Pa.createWriteStream(t);return new Promise((i,s)=>{let o=r.get(e,a=>{if(a.statusCode!==200){s(new oD(`Failed to get '${e}' (${a.statusCode})`,a.statusCode));return}a.pipe(n)});n.on("finish",()=>i()),o.on("error",a=>{Pa.unlink(t,()=>s(a))}),n.on("error",a=>{Pa.unlink(t,()=>s(a))}),o.end()})}Wt.downloadFile=Gwt;async function Zwt(e,t){try{await e}catch(r){throw await Promise.allSettled(t),r}}Wt.ensureAllSettledBeforeThrowing=Zwt;function nCe(){return Uwt("no-color")||process.env.FORCE_COLOR==="0"}Wt.hasNoColorFlagOrEnv=nCe;function Uwt(e){let t=e.startsWith("-")?"":e.length===1?"-":"--",r=process.argv.indexOf(t+e),n=process.argv.indexOf("--");return r!==-1&&(n===-1||r<n)}});var xg=p(Ci=>{"use strict";var Owt=Ci&&Ci.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Mwt=Ci&&Ci.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),D9=Ci&&Ci.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&Owt(t,e,r);return Mwt(t,e),t};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.logFileName=Ci.processLoggerError=Ci.processLoggerDebug=Ci.logger=void 0;var R9=Voe(),iCe=D9(Br()),Lwt=D9(require("path")),U0=D9(vR()),Wwt=Z0(),nd=(0,R9.getLogger)(),Q9={trace(e,...t){nd.trace(e,...t),U0.addBreadcrumb({message:e,level:"debug"})},debug(e,...t){nd.debug(e,...t),U0.addBreadcrumb({message:e,level:"debug"})},info(e,...t){nd.info(e,...t),U0.addBreadcrumb({message:e,level:"info"})},warn(e,...t){nd.warn(e,...t),U0.addBreadcrumb({message:e,level:"warning"})},error(e,...t){nd.error(e,...t),U0.addBreadcrumb({message:e,level:"error"})},fatal(e,...t){nd.fatal(e,...t),U0.addBreadcrumb({message:e,level:"fatal"})},setLevel(e){nd.level=e},useDefaultLevel(){nd.level=process.env.CDKTF_LOG_LEVEL||"INFO"}};Ci.logger=Q9;nd.level=process.env.CDKTF_LOG_LEVEL||"INFO";var sCe="cdktf.log";Ci.logFileName=sCe;if(process.env.CDKTF_LOG_FILE_DIRECTORY&&iCe.existsSync(process.env.CDKTF_LOG_FILE_DIRECTORY)&&iCe.statSync(process.env.CDKTF_LOG_FILE_DIRECTORY).isDirectory())(0,R9.configure)({appenders:{cdktf:{type:"file",filename:Lwt.join(process.env.CDKTF_LOG_FILE_DIRECTORY,sCe)}},categories:{default:{appenders:["cdktf"],level:"debug"}}});else{let e=(0,Wwt.hasNoColorFlagOrEnv)()?"basic":"colored";(0,R9.configure)({appenders:{out:{type:"stdout",layout:{type:e}}},categories:{default:{appenders:["out"],level:"info"}}})}var Vwt=e=>{Q9.debug(e.toString())};Ci.processLoggerDebug=Vwt;var Hwt=e=>{Q9.error(e.toString())};Ci.processLoggerError=Hwt});var oCe=p((Xyr,Pwt)=>{Pwt.exports={name:"@cdktn/commons",version:"0.25.0-pre.3",publishConfig:{access:"public"},description:"CDK Terrain Common utilities",scripts:{build:"tsc",watch:"tsc -w","watch-preserve-output":"tsc -w --preserveWatchOutput","test:update":"jest -u",package:"bash package.sh","dist-clean":"rm -rf dist","package:js":"bash package.sh"},main:"build/index.js",types:"build/index.d.ts",nx:{tags:["unit-test"]},repository:{type:"git",url:"git://github.com/open-constructs/cdk-terrain.git",directory:"packages/@cdktn/commons"},author:{name:"OpenConstructs",url:"https://github.com/open-constructs"},keywords:["cdk","cdktf","cdktn","terraform"],license:"MPL-2.0",dependencies:{"@sentry/node":"7.120.4",cdktn:"workspace:*","ci-info":"4.4.0",codemaker:"1.128.0","cross-spawn":"7.0.6","follow-redirects":"1.16.0","fs-extra":"11.3.6",log4js:"6.9.1",semver:"7.8.5","strip-ansi":"6.0.1",validator:"13.15.35"},devDependencies:{"@types/cross-spawn":"6.0.6","@types/follow-redirects":"1.14.4","@types/fs-extra":"11.0.4","@types/semver":"7.7.1","@types/validator":"13.15.10","tsc-files":"1.1.4",typescript:"^5.0.4"},"lint-staged":{"src/**/*.{ts,tsx}":"tsc-files ambient.d.ts --noEmit"}}});var wB=p(cD=>{"use strict";Object.defineProperty(cD,"__esModule",{value:!0});cD.DISPLAY_VERSION=void 0;cD.DISPLAY_VERSION=`${Ywt()}`;function Ywt(){return oCe().version.replace(/\+[0-9a-f]+$/,"")}});var T9=p(Un=>{"use strict";var $wt=Un&&Un.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),jwt=Un&&Un.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),dD=Un&&Un.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&$wt(t,e,r);return jwt(t,e),t},zwt=Un&&Un.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Un,"__esModule",{value:!0});Un.ReportRequest=Un.getUserId=Un.getProjectId=Un.sendTelemetry=void 0;var qwt=dD(require("https")),Jwt=require("url"),uCe=require("node:crypto"),lD=dD(require("os")),aCe=zwt(n_()),N9=xg(),_B=dD(require("path")),uD=dD(Br()),Xwt=wB(),Kwt="https://checkpoint-api.hashicorp.com/v1/",e_t=[200,201],cCe=8192;function t_t(){var e;return process.env.CDKTF_HOME?_B.resolve(process.env.CDKTF_HOME):_B.join(((e=lD.userInfo().homedir)!==null&&e!==void 0?e:lD.homedir()).trim()||"/",".cdktf")}async function r_t(e,t){return new Promise((r,n)=>{let i=qwt.request((0,Jwt.format)(e),{headers:{Accept:"application/json","Content-Length":t.length,"User-Agent":"OpenConstructs/cdktn-cli"},method:"POST"},s=>{if(s.statusCode){let a=s.statusCode;if(!e_t.includes(a))return n(new Error(s.statusMessage))}let o=new Array;s.on("data",a=>o.push(a)),s.on("error",a=>n(a)),s.on("end",()=>r())});i.setTimeout(1e3,()=>n(new Error("request timeout"))),i.write(t),i.end(),i.on("error",s=>n(s))})}async function n_t(e,t){let r={command:e,product:"cdktn",version:`${Xwt.DISPLAY_VERSION}`,dateTime:new Date,language:t.language,payload:t};try{await ACe(r)}catch(n){N9.logger.error(`Could not send telemetry data: ${n}`)}}Un.sendTelemetry=n_t;function lCe(e,t,r=!1,n){let i=(0,uCe.randomUUID)(),s;try{s=JSON.parse(uD.readFileSync(e,"utf-8"))}catch{if(r){let a={};n&&(a["//"]=n.replace(/\n/g," ")),a[t]=i,uD.ensureDirSync(_B.dirname(e)),uD.writeFileSync(e,JSON.stringify(a,null,2))}return i}return s[t]?s[t]:(uD.writeFileSync(e,JSON.stringify({...s,[t]:i},null,2)),i)}function dCe(e=process.cwd()){return lCe(_B.resolve(e,"cdktf.json"),"projectId")}Un.getProjectId=dCe;function fCe(){return lCe(_B.resolve(t_t(),"config.json"),"userId",!0,`This signature is a randomly generated UUID used to anonymously differentiate users in telemetry data order to inform product direction.
75
75
  This signature is random, it is not based on any personally identifiable information.
76
76
  To create a new signature, you can simply delete this file at any time.
77
77
  See https://cdktn.io/docs/telemetry for more
@@ -84,7 +84,7 @@ information on how to disable it.`)}Un.getUserId=fCe;async function ACe(e){if(pr
84
84
  `)} } from './${h}${this.importExtension}';`)}),l.forEach(A=>{A instanceof GD.ConfigStruct?this.emitInterface(t,A):(this.emitInterface(t,A),A.isProvider||this.emitClass(A))}),this.code.closeFile(f)}let a=ZD.join(t.structsFolderPath,"index.ts");this.code.openFile(a),o.forEach(c=>{let u=ZD.basename(c,".ts");this.code.line(`export * from './${u}${this.importExtension}';`)}),this.code.closeFile(a)}emitClass(t){this.code.openBlock(`export class ${t.outputReferenceName} extends cdktn.ComplexObject`),this.code.line("private isEmptyObject = false;"),t.isClass||this.code.line("private resolvableValue?: cdktn.IResolvable;"),this.code.line();let r=(0,zo.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),t.isSingleItem?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false, 0);"),this.code.closeBlock()):t.nestingMode==="single"||t.nestingMode==="object"?(r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute, false);"),this.code.closeBlock()):t.nestingMode.startsWith("map")?(this.code.line("* @param complexObjectKey the key of this item in the map"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectKey: string)"),this.code.line("super(terraformResource, terraformAttribute, false, complexObjectKey);"),this.code.closeBlock()):(r.line("@param complexObjectIndex the index of this item in the list"),r.line("@param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("public constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, complexObjectIndex: number, complexObjectIsFromSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);"),this.code.closeBlock()),this.code.line(),this.emitInternalValueGetter(t),this.code.line(),this.emitInternalValueSetter(t);for(let n of t.attributes)this.attributesEmitter.emit(n,this.attributesEmitter.needsResetEscape(n,t.attributes),this.attributesEmitter.needsInputEscape(n,t.attributes));this.code.closeBlock(),!t.isSingleItem&&(t.nestingMode==="list"||t.nestingMode==="set")?this.emitComplexListClass(t):t.nestingMode==="map"?this.emitComplexMapClass(t):t.nestingMode==="maplist"?this.emitComplexMapListClasses(t):t.nestingMode==="mapset"?this.emitComplexMapListClasses(t):t.nestingMode==="listmap"?this.emitComplexListMapClasses(t,!1):t.nestingMode==="setmap"?this.emitComplexListMapClasses(t,!0):(t.nestingMode==="listlist"||t.nestingMode==="listset"||t.nestingMode==="setlist"||t.nestingMode==="setset")&&this.emitComplexListListClasses(t)}emitComplexListClass(t){this.code.line(),this.code.openBlock(`export class ${t.listName} extends cdktn.ComplexList`),t.assignable&&this.code.line(`public internalValue? : ${t.name}[] | cdktn.IResolvable`),this.code.line();let r=(0,zo.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,zo.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${t.outputReferenceName}`),this.code.line(`return new ${t.outputReferenceName}(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapClass(t){this.code.line(),this.code.openBlock(`export class ${t.mapName} extends cdktn.ComplexMap`),t.assignable&&this.code.line(`public internalValue? : { [key: string]: ${t.name} } | cdktn.IResolvable`),this.code.line();let r=(0,zo.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let n=(0,zo.sanitizedComment)(this.code);n.line("@param key the key of the item to return"),n.end(),this.code.openBlock(`public get(key: string): ${t.outputReferenceName}`),this.code.line(`return new ${t.outputReferenceName}(this.terraformResource, this.terraformAttribute, key);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexMapListClasses(t){this.emitComplexMapListClass(t),this.emitComplexMapClass(t)}emitComplexMapListClass(t){this.code.line(),this.code.openBlock(`export class ${t.mapListName} extends cdktn.MapList`),t.assignable&&this.code.line(`public internalValue? : ${t.mapName}[] | cdktn.IResolvable`),this.code.line();let r=(0,zo.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,zo.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${t.mapName}`),this.code.line(`return new ${t.mapName}(this, \`[\${index}]\`);`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListMapClasses(t,r){this.emitComplexListMapClass(t,r),this.emitComplexListClass(t)}emitComplexListMapClass(t,r){this.code.line(),this.code.openBlock(`export class ${t.listMapName} extends cdktn.ComplexMap`),t.assignable&&this.code.line(`public internalValue? : { [key: string]: ${t.name}[] } | cdktn.IResolvable`),this.code.line();let n=(0,zo.sanitizedComment)(this.code);n.line("@param terraformResource The parent resource"),n.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),n.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string)"),this.code.line("super(terraformResource, terraformAttribute);"),this.code.closeBlock(),this.code.line();let i=(0,zo.sanitizedComment)(this.code);i.line("@param key the key of the item to return"),i.end(),this.code.openBlock(`public get(key: string): ${t.listName}`),this.code.line(`return new ${t.listName}(this, \`[\${key}]\`, ${r});`),this.code.closeBlock(),this.code.closeBlock()}emitComplexListListClasses(t){this.emitComplexListListClass(t),this.emitComplexListClass(t)}emitComplexListListClass(t){this.code.line(),this.code.openBlock(`export class ${t.listListName} extends cdktn.MapList`),t.assignable&&this.code.line(`public internalValue? : ${t.name}[][] | cdktn.IResolvable`),this.code.line();let r=(0,zo.sanitizedComment)(this.code);r.line("@param terraformResource The parent resource"),r.line("@param terraformAttribute The attribute on the parent resource this class is referencing"),r.line("@param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)"),r.end(),this.code.openBlock("constructor(terraformResource: cdktn.IInterpolatingParent, terraformAttribute: string, wrapsSet: boolean)"),this.code.line("super(terraformResource, terraformAttribute, wrapsSet);"),this.code.closeBlock(),this.code.line();let n=(0,zo.sanitizedComment)(this.code);n.line("@param index the index of the item to return"),n.end(),this.code.openBlock(`public get(index: number): ${t.listName}`),this.code.line(`return new ${t.listName}(this, \`[\${index}]\`, ${t.nestingMode==="setlist"||t.nestingMode==="setset"});`),this.code.closeBlock(),this.code.closeBlock()}emitInternalValueGetter(t){this.code.openBlock(`public get internalValue(): ${t.name}${t.isClass?"":" | cdktn.IResolvable"} | undefined`),t.isClass||(this.code.openBlock("if (this.resolvableValue)"),this.code.line("return this.resolvableValue;"),this.code.closeBlock()),this.code.line("let hasAnyValues = this.isEmptyObject;"),this.code.line("const internalValueResult: any = {};");for(let r of t.attributes)r.isStored&&(r.getterType._type==="stored_class"?this.code.openBlock(`if (this.${r.storageName}?.internalValue !== undefined)`):this.code.openBlock(`if (this.${r.storageName} !== undefined)`),this.code.line("hasAnyValues = true;"),r.getterType._type==="stored_class"?this.code.line(`internalValueResult.${r.name} = this.${r.storageName}?.internalValue;`):this.code.line(`internalValueResult.${r.name} = this.${r.storageName};`),this.code.closeBlock());this.code.line("return hasAnyValues ? internalValueResult : undefined;"),this.code.closeBlock()}emitInternalValueSetter(t){this.code.openBlock(`public set internalValue(value: ${t.name}${t.isClass?"":" | cdktn.IResolvable"} | undefined)`),this.code.openBlock("if (value === undefined)"),this.code.line("this.isEmptyObject = false;"),t.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of t.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = undefined;`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = undefined;`));this.code.closeBlock(),t.isClass||(this.code.openBlock("else if (cdktn.Tokenization.isResolvable(value))"),this.code.line("this.isEmptyObject = false;"),this.code.line("this.resolvableValue = value;"),this.code.closeBlock()),this.code.openBlock("else"),this.code.line("this.isEmptyObject = Object.keys(value).length === 0;"),t.isClass||this.code.line("this.resolvableValue = undefined;");for(let r of t.attributes)r.isStored&&(r.setterType._type==="stored_class"?this.code.line(`this.${r.storageName}.internalValue = value.${r.name};`):r.setterType._type!=="none"&&this.code.line(`this.${r.storageName} = value.${r.name};`));this.code.closeBlock(),this.code.closeBlock()}emitToHclTerraformFunction(t){this.code.line(),this.code.openBlock(`export function ${(0,Ebe.downcaseFirst)(t.name)}ToHclTerraform(struct?: ${t.isSingleItem&&!t.isProvider?`${t.name}OutputReference | `:""}${t.name}${t.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");'),this.code.closeBlock(),this.code.open("const attrs = {");for(let r of t.assignableAttributes)this.attributesEmitter.emitToHclTerraform(r,!0);this.code.close("};"),t.assignableAttributes.length>0?(this.code.line(),this.code.line("// remove undefined attributes"),this.code.line("return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));")):this.code.line("return attrs;"),this.code.closeBlock(),this.code.line()}emitToTerraformFunction(t){this.code.line(),this.code.openBlock(`export function ${(0,Ebe.downcaseFirst)(t.name)}ToTerraform(struct?: ${t.isSingleItem&&!t.isProvider?`${t.name}OutputReference | `:""}${t.name}${t.isClass?"":" | cdktn.IResolvable"}): any`),this.code.line("if (!cdktn.canInspect(struct) || cdktn.Tokenization.isResolvable(struct)) { return struct; }"),this.code.openBlock("if (cdktn.isComplexElement(struct))"),this.code.line('throw new Error("A complex element was used as configuration, this is not supported: https://cdktn.io/docs/concepts/resources#references");'),this.code.closeBlock(),this.code.openBlock("return");for(let r of t.assignableAttributes)this.attributesEmitter.emitToTerraform(r,!0);this.code.closeBlock(";"),this.code.closeBlock(),this.code.line()}};Yc.StructEmitter=hY});var vbe=p($c=>{"use strict";var f2t=$c&&$c.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),UD=$c&&$c.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&f2t(t,e,r)};Object.defineProperty($c,"__esModule",{value:!0});UD(ND(),$c);UD(Cbe(),$c);UD(bbe(),$c);UD(Bbe(),$c)});var IY=p(MD=>{"use strict";Object.defineProperty(MD,"__esModule",{value:!0});MD.TerraformProviderGenerator=void 0;var Sbe=fc(),OD=tt(),A2t=Qf(),wbe=Rg(),g2t=cY(),pY=vbe(),h2t=(e,t)=>{if(e.isModule)return!1;let r=t.split("/");if(r.length===1)return e.source===t;{let[n,i,s]=r;if(!n||!i||!s)throw new Error(`can't handle ${t}`);if(e.source){let o={hostname:"registry.terraform.io",namespace:"hashicorp",name:""},a=e.source.split("/"),c=a.length===3;switch(a.length){case 1:o.name=a[0].toLowerCase();break;case 2:o.namespace=a[0].toLowerCase(),o.name=a[1].toLowerCase();break;case 3:o.hostname=a[0].toLowerCase(),o.namespace=a[1].toLowerCase(),o.name=a[2].toLowerCase();break;default:throw new Error(`can't handle ${e.source}. Expected string with 1, 2 or 3 elements separated by '/'`)}return(!c||o.hostname===n)&&o.namespace===i&&o.name===s}return e.name===s}},mY=class{constructor(t,r,n={}){var i;this.code=t,this.schema=r,this.resourceParser=new g2t.ResourceParser,this.versions={},this.code.indentation=2,this.importExtension=(i=n.importExtension)!==null&&i!==void 0?i:"",this.resourceEmitter=new pY.ResourceEmitter(this.code,this.importExtension),this.structEmitter=new pY.StructEmitter(this.code,this.importExtension),this.providerFunctionsEmitter=new pY.ProviderFunctionsEmitter(this.code)}getProviderByConstraint(t){return Object.keys(this.schema.provider_schemas||{}).find(r=>h2t(t,r))}generate(t){var r;let n=this.getProviderByConstraint(t);if(!n)throw OD.logger.debug(`Could not find provider constraint for ${t} in schema: ${JSON.stringify(this.schema,null,2)}`),new Error(`Could not find provider with constraint ${JSON.stringify(t)}`);let i=(r=this.schema.provider_versions)===null||r===void 0?void 0:r[n];this.emitProvider(n,i,t),this.versions[n]=i}generateAll(){for(let t of Object.keys(this.schema.provider_schemas||{}))this.generate(new OD.ConstructsMakerProviderTarget(new OD.TerraformProviderConstraint(t),OD.LANGUAGES[0]))}async save(t){await this.code.save(t)}buildResourceModels(t,r){var n;let i=(n=this.schema.provider_schemas)===null||n===void 0?void 0:n[t];if(!i)throw new Error(`Can not find provider '${t}' in schema`);let s=Object.entries(i.resource_schemas||{}).map(([c,u])=>this.resourceParser.parse(t,c,u,"resource",r)),o=Object.entries(i.data_source_schemas||{}).map(([c,u])=>this.resourceParser.parse(t,`data_${c}`,u,"data_source",r)),a=Object.entries(i.ephemeral_resource_schemas||{}).map(([c,u])=>this.resourceParser.parse(t,`ephemeral_${c}`,u,"ephemeral_resource",r));return[].concat(...s,...o,...a)}getClassNameForResource(t){return this.resourceParser.getClassNameForResource(t)}getNamespaceNameForResource(t){return this.resourceParser.getNamespaceNameForResource(t)}emitProvider(t,r,n){var i;let s=n?.name?n.name:(0,A2t.parseFQPN)(t).name,o=(i=this.schema.provider_schemas)===null||i===void 0?void 0:i[t];if(!o)throw new Error(`Can not find provider '${t}' in schema`);let a=[];this.buildResourceModels(t,n).forEach(u=>{n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source),u.providerVersion=r,u.structsRequireSharding?a.push(this.emitResourceWithComplexStruct(u)):a.push(this.emitResource(u)),this.emitResourceReadme(u)});let c=(0,wbe.buildProviderFunctionsModel)(s,o.functions);if(o.provider){let u=this.resourceParser.parse(t,"provider",o.provider,"provider",n);n&&(u.providerVersionConstraint=n.version,u.terraformProviderSource=n.source,u.terraformProviderName=n.name),u.providerVersion=r,c&&((0,wbe.assertNoFunctionsGetterCollision)(s,u.attributes.map(l=>l.name)),u.providerFunctionsModel=c),a.push(this.emitResource(u)),this.emitResourceReadme(u)}c&&a.push(this.emitProviderFunctions(s,c)),this.emitIndexFile(s,a),this.emitLazyIndexFile(s,a)}emitProviderFunctions(t,r){let n=`providers/${t}/provider-functions/index.ts`;return this.code.openFile(n),this.code.line("// generated from provider function schema"),this.code.line(),this.providerFunctionsEmitter.emit(r),this.code.closeFile(n),n}emitResourceReadme(t){let r=`${t.namespaceFolderPath}/README.md`;this.code.openFile(r),this.code.line(`# \`${t.terraformType}\``),this.code.line();let n=t.isProvider?t.provider:t.terraformType;this.code.line(`Refer to the Terraform Registry for docs: [\`${n}\`](${t.linkToDocs}).`),this.code.closeFile(r)}emitIndexFile(t,r){let n=`providers/${t}`,i=`${n}/index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let s of r){let o=s.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`export * as ${(0,Sbe.toCamelCase)(o)} from './${o}/index${this.importExtension}';`)}this.code.line(),this.code.closeFile(i)}emitLazyIndexFile(t,r){let n=`providers/${t}`,i=`${n}/lazy-index.ts`;this.code.openFile(i),this.code.line("// generated by cdktn get");for(let s of r){let o=s.replace(`${n}/`,"").replace("/index.ts","");this.code.line(`Object.defineProperty(exports, '${(0,Sbe.toCamelCase)(o)}', { get: function () { return require('./${o}'); } });`)}this.code.line(),this.code.closeFile(i)}emitResource(t){return this.code.openFile(t.filePath),this.emitFileHeader(t),this.structEmitter.emit(t),this.resourceEmitter.emit(t),this.code.closeFile(t.filePath),t.filePath}emitResourceWithComplexStruct(t){let r=[],n=t.filePath;if(this.code.openFile(n),this.code.line("// generated from terraform resource schema"),this.code.line(),t.structsRequireSharding){let i=`./${t.structsFolderName}/index${this.importExtension}`;t.referencedTypes.length>0&&this.code.line(`import { ${t.referencedTypes.join(`,
85
85
  `)}} from '${i}';`),this.code.line(`export * from '${i}';`),t.importStatements.forEach(s=>this.code.line(s)),this.structEmitter.emitInterface(t,t.configStruct),this.resourceEmitter.emit(t),this.code.closeFile(n),this.structEmitter.emit(t),r.push(t.fileName),r.push(t.structsFolderName)}else t.importStatements.forEach(i=>this.code.line(i)),this.structEmitter.emit(t),this.resourceEmitter.emit(t),this.code.closeFile(n),r.push(t.fileName);return n}emitFileHeader(t){this.code.line(`// ${t.linkToDocs}`),this.code.line("// generated from terraform resource schema"),this.code.line(),t.importStatements.forEach(r=>this.code.line(r)),this.code.line(),this.code.line("// Configuration"),this.code.line()}};MD.TerraformProviderGenerator=mY});var xbe=p(VD=>{"use strict";Object.defineProperty(VD,"__esModule",{value:!0});VD.ModuleGenerator=void 0;var LD=fc(),yY=Rg(),_be=z0(),CY=class{constructor(t,r){this.code=t,this.targets=r,this.code.indentation=2;for(let n of this.targets)this.emitSubmodule(n)}emitSubmodule(t){let r=t.spec;if(!r)throw new Error(`missing spec for ${t.fqn}`);this.code.openFile(t.fileName),this.code.line("// generated by cdktn get"),this.code.line(`// ${t.source}`),this.code.line("import { TerraformModule, type TerraformModuleUserConfig } from 'cdktn';"),this.code.line("import { Construct } from 'constructs';");let n=this.code.toPascalCase(t.name.replace(/[-/.]/g,"_")),i=`${n}Config`;this.code.openBlock(`export interface ${i} extends TerraformModuleUserConfig`);for(let u of r.inputs){let l=u.required&&u.default===void 0?"":"?",d=(0,_be.sanitizedComment)(this.code);u.description&&d.line(u.description),u.default&&d.line(u.default),u.type.includes("map(")&&d.line("The property type contains a map, they have special handling, please see {@link cdk.tf/module-map-inputs the docs}"),d.end(),this.code.line(`readonly ${yY.AttributeModel.escapeName((0,LD.toCamelCase)(u.name))}${l}: ${WD(u.type)};`)}this.code.closeBlock();let s=t.source.includes("."),o;t.source.includes("//")?o=t.source.replace("//modules",`/${t.version||"latest"}/submodules`):o=`${t.source}/${t.version||"latest"}`;let a=(0,_be.sanitizedComment)(this.code);a.line(`Defines an ${n} based on a Terraform module`),a.line(""),a.line(s?`Source at ${t.source}`:`Docs at Terraform Registry: {@link https://registry.terraform.io/modules/${o} ${t.source}}`),a.end(),this.code.openBlock(`export class ${n} extends TerraformModule`),this.code.line("private readonly inputs: { [name: string]: any } = { };");let c=r.inputs.find(u=>u.required)?"":" = {}";this.code.open(`public constructor(scope: Construct, id: string, config: ${i}${c}) {`),this.code.open("super(scope, id, {"),this.code.line("...config,"),this.code.line(`source: '${t.source}',`),t.version&&this.code.line(`version: '${t.version}',`),this.code.close("});");for(let u of r.inputs){let l=yY.AttributeModel.escapeName((0,LD.toCamelCase)(u.name));this.code.line(`this.${l} = config.${l};`)}this.code.close("}");for(let u of r.inputs){let l=yY.AttributeModel.escapeName((0,LD.toCamelCase)(u.name)),d=WD(u.type)+(u.required&&u.default===void 0?"":" | undefined");this.code.openBlock(`public get ${l}(): ${d}`),this.code.line(`return this.inputs['${u.name}'] as ${d};`),this.code.closeBlock(),this.code.openBlock(`public set ${l}(value: ${d})`),this.code.line(`this.inputs['${u.name}'] = value;`),this.code.closeBlock()}for(let u of r.outputs){let l=(0,LD.toCamelCase)(u.name);this.code.openBlock(`public get ${l}Output()`),this.code.line(`return this.getString('${u.name}');`),this.code.closeBlock()}this.code.openBlock("protected synthesizeAttributes()"),this.code.line("return this.inputs;"),this.code.closeBlock(),this.code.openBlock("protected synthesizeHclAttributes(): { [name: string]: any }"),this.code.line("return Object.fromEntries("),this.code.line(" Object.entries(this.inputs)"),this.code.line(" .filter(([, val]) => val !== undefined)"),this.code.line(" .map(([key, val]) => {"),this.code.line(" return ["),this.code.line(" key,"),this.code.line(" {"),this.code.line(" value: val,"),this.code.line(' type: "any",'),this.code.line(" },"),this.code.line(" ];"),this.code.line(" })"),this.code.line(");"),this.code.closeBlock(),this.code.closeBlock(),this.code.closeFile(t.fileName)}};VD.ModuleGenerator=CY;function WD(e){if(e==="string")return"string";if(e==="number")return"number";if(e==="bool")return"boolean";if(e==="list")return"string[]";if(e==="map")return"{ [key: string]: string }";if(e==="tuple")return"string[]";if(e==="any")return"any";let t=p2t(e);if(t)return t;throw new Error(`unknown type ${e}`)}function p2t(e){let r=/^(object|list|map|set|tuple)\(([\s\S]+)\)/.exec(e);if(!r)return;let[,n,i]=r;if(n==="object")return"any";if(n==="list"||n==="set")return`${WD(i)}[]`;if(n==="tuple")return"any[]";if(n==="map")return`{ [key: string]: ${WD(i)} }`;throw new Error(`unexpected kind ${n}`)}});var Pbe=p(Tt=>{"use strict";var ii=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),m2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.range=e.balanced=void 0;var t=(i,s,o)=>{let a=i instanceof RegExp?r(i,o):i,c=s instanceof RegExp?r(s,o):s,u=a!==null&&c!=null&&(0,e.range)(a,c,o);return u&&{start:u[0],end:u[1],pre:o.slice(0,u[0]),body:o.slice(u[0]+a.length,u[1]),post:o.slice(u[1]+c.length)}};e.balanced=t;var r=(i,s)=>{let o=s.match(i);return o?o[0]:null},n=(i,s,o)=>{let a,c,u,l,d,f=o.indexOf(i),A=o.indexOf(s,f+1),g=f;if(f>=0&&A>0){if(i===s)return[f,A];for(a=[],u=o.length;g>=0&&!d;){if(g===f)a.push(g),f=o.indexOf(i,g+1);else if(a.length===1){let h=a.pop();h!==void 0&&(d=[h,A])}else c=a.pop(),c!==void 0&&c<u&&(u=c,l=A),A=o.indexOf(s,g+1);g=f<A&&f>=0?f:A}a.length&&l!==void 0&&(d=[u,l])}return d};e.range=n}),I2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EXPANSION_MAX=void 0,e.expand=R;var t=m2t(),r="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",o="\0PERIOD"+Math.random()+"\0",a=new RegExp(r,"g"),c=new RegExp(n,"g"),u=new RegExp(i,"g"),l=new RegExp(s,"g"),d=new RegExp(o,"g"),f=/\\\\/g,A=/\\{/g,g=/\\}/g,h=/\\,/g,m=/\\./g;e.EXPANSION_MAX=1e5;function I(N){return isNaN(N)?N.charCodeAt(0):parseInt(N,10)}function C(N){return N.replace(f,r).replace(A,n).replace(g,i).replace(h,s).replace(m,o)}function b(N){return N.replace(a,"\\").replace(c,"{").replace(u,"}").replace(l,",").replace(d,".")}function S(N){if(!N)return[""];let Y=[],K=(0,t.balanced)("{","}",N);if(!K)return N.split(",");let{pre:ie,body:Z,post:O}=K,ne=ie.split(",");ne[ne.length-1]+="{"+Z+"}";let te=S(O);return O.length&&(ne[ne.length-1]+=te.shift(),ne.push.apply(ne,te)),Y.push.apply(Y,ne),Y}function R(N,Y={}){if(!N)return[];let{max:K=e.EXPANSION_MAX}=Y;return N.slice(0,2)==="{}"&&(N="\\{\\}"+N.slice(2)),H(C(N),K,!0).map(b)}function Q(N){return"{"+N+"}"}function k(N){return/^-?0\d/.test(N)}function v(N,Y){return N<=Y}function T(N,Y){return N>=Y}function H(N,Y,K){let ie=[],Z=(0,t.balanced)("{","}",N);if(!Z)return[N];let O=Z.pre,ne=Z.post.length?H(Z.post,Y,!1):[""];if(/\$$/.test(Z.pre))for(let te=0;te<ne.length&&te<Y;te++){let Ce=O+"{"+Z.body+"}"+ne[te];ie.push(Ce)}else{let te=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(Z.body),Ce=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(Z.body),qe=te||Ce,it=Z.body.indexOf(",")>=0;if(!qe&&!it)return Z.post.match(/,(?!,).*\}/)?(N=Z.pre+"{"+Z.body+i+Z.post,H(N,Y,!0)):[N];let Ue;if(qe)Ue=Z.body.split(/\.\./);else if(Ue=S(Z.body),Ue.length===1&&Ue[0]!==void 0&&(Ue=H(Ue[0],Y,!1).map(Q),Ue.length===1))return ne.map(Qt=>Z.pre+Ue[0]+Qt);let At;if(qe&&Ue[0]!==void 0&&Ue[1]!==void 0){let Qt=I(Ue[0]),tr=I(Ue[1]),x=Math.max(Ue[0].length,Ue[1].length),w=Ue.length===3&&Ue[2]!==void 0?Math.abs(I(Ue[2])):1,ue=v;tr<Qt&&(w*=-1,ue=T);let E=Ue.some(k);At=[];for(let W=Qt;ue(W,tr);W+=w){let U;if(Ce)U=String.fromCharCode(W),U==="\\"&&(U="");else if(U=String(W),E){let $=x-U.length;if($>0){let se=new Array($+1).join("0");W<0?U="-"+se+U.slice(1):U=se+U}}At.push(U)}}else{At=[];for(let Qt=0;Qt<Ue.length;Qt++)At.push.apply(At,H(Ue[Qt],Y,!1))}for(let Qt=0;Qt<At.length;Qt++)for(let tr=0;tr<ne.length&&ie.length<Y;tr++){let x=O+At[Qt]+ne[tr];(!K||qe||x)&&ie.push(x)}}return ie}}),y2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assertValidPattern=void 0;var t=1024*64,r=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>t)throw new TypeError("pattern is too long")};e.assertValidPattern=r}),C2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseClass=void 0;var t={"[: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]},r=o=>o.replace(/[[\]\\-]/g,"\\$&"),n=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),i=o=>o.join(""),s=(o,a)=>{let c=a;if(o.charAt(c)!=="[")throw new Error("not in a brace expression");let u=[],l=[],d=c+1,f=!1,A=!1,g=!1,h=!1,m=c,I="";e:for(;d<o.length;){let S=o.charAt(d);if((S==="!"||S==="^")&&d===c+1){h=!0,d++;continue}if(S==="]"&&f&&!g){m=d+1;break}if(f=!0,S==="\\"&&!g){g=!0,d++;continue}if(S==="["&&!g){for(let[R,[Q,k,v]]of Object.entries(t))if(o.startsWith(R,d)){if(I)return["$.",!1,o.length-c,!0];d+=R.length,v?l.push(Q):u.push(Q),A=A||k;continue e}}if(g=!1,I){S>I?u.push(r(I)+"-"+r(S)):S===I&&u.push(r(S)),I="",d++;continue}if(o.startsWith("-]",d+1)){u.push(r(S+"-")),d+=2;continue}if(o.startsWith("-",d+1)){I=S,d+=2;continue}u.push(r(S)),d++}if(m<d)return["",!1,0,!1];if(!u.length&&!l.length)return["$.",!1,o.length-c,!0];if(l.length===0&&u.length===1&&/^\\?.$/.test(u[0])&&!h){let S=u[0].length===2?u[0].slice(-1):u[0];return[n(S),!1,m-c,!1]}let C="["+(h?"^":"")+i(u)+"]",b="["+(h?"":"^")+i(l)+"]";return[u.length&&l.length?"("+C+"|"+b+")":u.length?C:b,A,m-c,!0]};e.parseClass=s}),bY=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=void 0;var t=(r,{windowsPathsNoEscape:n=!1,magicalBraces:i=!0}={})=>i?n?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):n?r.replace(/\[([^\/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");e.unescape=t}),Rbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AST=void 0;var t=C2t(),r=bY(),n=new Set(["!","?","+","*","@"]),i=h=>n.has(h),s="(?!(?:^|/)\\.\\.?(?:$|/))",o="(?!\\.)",a=new Set(["[","."]),c=new Set(["..","."]),u=new Set("().*{}+?[]^$\\!"),l=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d="[^/]",f=d+"*?",A=d+"+?",g=class so{type;#e;#t;#r=!1;#n=[];#i;#s;#l;#a=!1;#o;#d;#A=!1;constructor(m,I,C={}){this.type=m,m&&(this.#t=!0),this.#i=I,this.#e=this.#i?this.#i.#e:this,this.#o=this.#e===this?C:this.#e.#o,this.#l=this.#e===this?[]:this.#e.#l,m==="!"&&!this.#e.#a&&this.#l.push(this),this.#s=this.#i?this.#i.#n.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let m of this.#n)if(typeof m!="string"&&(m.type||m.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#d!==void 0?this.#d:this.type?this.#d=this.type+"("+this.#n.map(m=>String(m)).join("|")+")":this.#d=this.#n.map(m=>String(m)).join("")}#f(){if(this!==this.#e)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let m;for(;m=this.#l.pop();){if(m.type!=="!")continue;let I=m,C=I.#i;for(;C;){for(let b=I.#s+1;!C.type&&b<C.#n.length;b++)for(let S of m.#n){if(typeof S=="string")throw new Error("string part in extglob AST??");S.copyIn(C.#n[b])}I=C,C=I.#i}}return this}push(...m){for(let I of m)if(I!==""){if(typeof I!="string"&&!(I instanceof so&&I.#i===this))throw new Error("invalid part: "+I);this.#n.push(I)}}toJSON(){let m=this.type===null?this.#n.slice().map(I=>typeof I=="string"?I:I.toJSON()):[this.type,...this.#n.map(I=>I.toJSON())];return this.isStart()&&!this.type&&m.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#a&&this.#i?.type==="!")&&m.push({}),m}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let m=this.#i;for(let I=0;I<this.#s;I++){let C=m.#n[I];if(!(C instanceof so&&C.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 m=this.#i?this.#i.#n.length:0;return this.#s===m-1}copyIn(m){typeof m=="string"?this.push(m):this.push(m.clone(this))}clone(m){let I=new so(this.type,m);for(let C of this.#n)I.copyIn(C);return I}static#u(m,I,C,b){let S=!1,R=!1,Q=-1,k=!1;if(I.type===null){let Y=C,K="";for(;Y<m.length;){let ie=m.charAt(Y++);if(S||ie==="\\"){S=!S,K+=ie;continue}if(R){Y===Q+1?(ie==="^"||ie==="!")&&(k=!0):ie==="]"&&!(Y===Q+2&&k)&&(R=!1),K+=ie;continue}else if(ie==="["){R=!0,Q=Y,k=!1,K+=ie;continue}if(!b.noext&&i(ie)&&m.charAt(Y)==="("){I.push(K),K="";let Z=new so(ie,I);Y=so.#u(m,Z,Y,b),I.push(Z);continue}K+=ie}return I.push(K),Y}let v=C+1,T=new so(null,I),H=[],N="";for(;v<m.length;){let Y=m.charAt(v++);if(S||Y==="\\"){S=!S,N+=Y;continue}if(R){v===Q+1?(Y==="^"||Y==="!")&&(k=!0):Y==="]"&&!(v===Q+2&&k)&&(R=!1),N+=Y;continue}else if(Y==="["){R=!0,Q=v,k=!1,N+=Y;continue}if(i(Y)&&m.charAt(v)==="("){T.push(N),N="";let K=new so(Y,T);T.push(K),v=so.#u(m,K,v,b);continue}if(Y==="|"){T.push(N),N="",H.push(T),T=new so(null,I);continue}if(Y===")")return N===""&&I.#n.length===0&&(I.#A=!0),T.push(N),N="",I.push(...H,T),v;N+=Y}return I.type=null,I.#t=void 0,I.#n=[m.substring(C-1)],v}static fromGlob(m,I={}){let C=new so(null,void 0,I);return so.#u(m,C,0,I),C}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let m=this.toString(),[I,C,b,S]=this.toRegExpSource();if(!(b||this.#t||this.#o.nocase&&!this.#o.nocaseMagicOnly&&m.toUpperCase()!==m.toLowerCase()))return C;let R=(this.#o.nocase?"i":"")+(S?"u":"");return Object.assign(new RegExp(`^${I}$`,R),{_src:I,_glob:m})}get options(){return this.#o}toRegExpSource(m){let I=m??!!this.#o.dot;if(this.#e===this&&this.#f(),!this.type){let k=this.isStart()&&this.isEnd()&&!this.#n.some(N=>typeof N!="string"),v=this.#n.map(N=>{let[Y,K,ie,Z]=typeof N=="string"?so.#y(N,this.#t,k):N.toRegExpSource(m);return this.#t=this.#t||ie,this.#r=this.#r||Z,Y}).join(""),T="";if(this.isStart()&&typeof this.#n[0]=="string"&&!(this.#n.length===1&&c.has(this.#n[0]))){let N=a,Y=I&&N.has(v.charAt(0))||v.startsWith("\\.")&&N.has(v.charAt(2))||v.startsWith("\\.\\.")&&N.has(v.charAt(4)),K=!I&&!m&&N.has(v.charAt(0));T=Y?s:K?o:""}let H="";return this.isEnd()&&this.#e.#a&&this.#i?.type==="!"&&(H="(?:$|\\/)"),[T+v+H,(0,r.unescape)(v),this.#t=!!this.#t,this.#r]}let C=this.type==="*"||this.type==="+",b=this.type==="!"?"(?:(?!(?:":"(?:",S=this.#h(I);if(this.isStart()&&this.isEnd()&&!S&&this.type!=="!"){let k=this.toString();return this.#n=[k],this.type=null,this.#t=void 0,[k,(0,r.unescape)(this.toString()),!1,!1]}let R=!C||m||I||!o?"":this.#h(!0);R===S&&(R=""),R&&(S=`(?:${S})(?:${R})*?`);let Q="";if(this.type==="!"&&this.#A)Q=(this.isStart()&&!I?o:"")+A;else{let k=this.type==="!"?"))"+(this.isStart()&&!I&&!m?o:"")+f+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&R?")":this.type==="*"&&R?")?":`)${this.type}`;Q=b+S+k}return[Q,(0,r.unescape)(S),this.#t=!!this.#t,this.#r]}#h(m){return this.#n.map(I=>{if(typeof I=="string")throw new Error("string type in extglob ast??");let[C,b,S,R]=I.toRegExpSource(m);return this.#r=this.#r||R,C}).filter(I=>!(this.isStart()&&this.isEnd())||!!I).join("|")}static#y(m,I,C=!1){let b=!1,S="",R=!1,Q=!1;for(let k=0;k<m.length;k++){let v=m.charAt(k);if(b){b=!1,S+=(u.has(v)?"\\":"")+v;continue}if(v==="*"){if(Q)continue;Q=!0,S+=C&&/^[*]+$/.test(m)?A:f,I=!0;continue}else Q=!1;if(v==="\\"){k===m.length-1?S+="\\\\":b=!0;continue}if(v==="["){let[T,H,N,Y]=(0,t.parseClass)(m,k);if(N){S+=T,R=R||H,k+=N-1,I=I||Y;continue}}if(v==="?"){S+=d,I=!0;continue}S+=l(v)}return[S,(0,r.unescape)(m),!!I,R]}};e.AST=g}),Dbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.escape=void 0;var t=(r,{windowsPathsNoEscape:n=!1,magicalBraces:i=!1}={})=>i?n?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):n?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");e.escape=t}),Dg=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unescape=e.escape=e.AST=e.Minimatch=e.match=e.makeRe=e.braceExpand=e.defaults=e.filter=e.GLOBSTAR=e.sep=e.minimatch=void 0;var t=I2t(),r=y2t(),n=Rbe(),i=Dbe(),s=bY(),o=(E,W,U={})=>((0,r.assertValidPattern)(W),!U.nocomment&&W.charAt(0)==="#"?!1:new tr(W,U).match(E));e.minimatch=o;var a=/^\*+([^+@!?\*\[\(]*)$/,c=E=>W=>!W.startsWith(".")&&W.endsWith(E),u=E=>W=>W.endsWith(E),l=E=>(E=E.toLowerCase(),W=>!W.startsWith(".")&&W.toLowerCase().endsWith(E)),d=E=>(E=E.toLowerCase(),W=>W.toLowerCase().endsWith(E)),f=/^\*+\.\*+$/,A=E=>!E.startsWith(".")&&E.includes("."),g=E=>E!=="."&&E!==".."&&E.includes("."),h=/^\.\*+$/,m=E=>E!=="."&&E!==".."&&E.startsWith("."),I=/^\*+$/,C=E=>E.length!==0&&!E.startsWith("."),b=E=>E.length!==0&&E!=="."&&E!=="..",S=/^\?+([^+@!?\*\[\(]*)?$/,R=([E,W=""])=>{let U=T([E]);return W?(W=W.toLowerCase(),$=>U($)&&$.toLowerCase().endsWith(W)):U},Q=([E,W=""])=>{let U=H([E]);return W?(W=W.toLowerCase(),$=>U($)&&$.toLowerCase().endsWith(W)):U},k=([E,W=""])=>{let U=H([E]);return W?$=>U($)&&$.endsWith(W):U},v=([E,W=""])=>{let U=T([E]);return W?$=>U($)&&$.endsWith(W):U},T=([E])=>{let W=E.length;return U=>U.length===W&&!U.startsWith(".")},H=([E])=>{let W=E.length;return U=>U.length===W&&U!=="."&&U!==".."},N=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Y={win32:{sep:"\\"},posix:{sep:"/"}};e.sep=N==="win32"?Y.win32.sep:Y.posix.sep,e.minimatch.sep=e.sep,e.GLOBSTAR=Symbol("globstar **"),e.minimatch.GLOBSTAR=e.GLOBSTAR;var K="[^/]",ie=K+"*?",Z="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",O="(?:(?!(?:\\/|^)\\.).)*?",ne=(E,W={})=>U=>(0,e.minimatch)(U,E,W);e.filter=ne,e.minimatch.filter=e.filter;var te=(E,W={})=>Object.assign({},E,W),Ce=E=>{if(!E||typeof E!="object"||!Object.keys(E).length)return e.minimatch;let W=e.minimatch;return Object.assign((U,$,se={})=>W(U,$,te(E,se)),{Minimatch:class extends W.Minimatch{constructor(U,$={}){super(U,te(E,$))}static defaults(U){return W.defaults(te(E,U)).Minimatch}},AST:class extends W.AST{constructor(U,$,se={}){super(U,$,te(E,se))}static fromGlob(U,$={}){return W.AST.fromGlob(U,te(E,$))}},unescape:(U,$={})=>W.unescape(U,te(E,$)),escape:(U,$={})=>W.escape(U,te(E,$)),filter:(U,$={})=>W.filter(U,te(E,$)),defaults:U=>W.defaults(te(E,U)),makeRe:(U,$={})=>W.makeRe(U,te(E,$)),braceExpand:(U,$={})=>W.braceExpand(U,te(E,$)),match:(U,$,se={})=>W.match(U,$,te(E,se)),sep:W.sep,GLOBSTAR:e.GLOBSTAR})};e.defaults=Ce,e.minimatch.defaults=e.defaults;var qe=(E,W={})=>((0,r.assertValidPattern)(E),W.nobrace||!/\{(?:(?!\{).)*\}/.test(E)?[E]:(0,t.expand)(E,{max:W.braceExpandMax}));e.braceExpand=qe,e.minimatch.braceExpand=e.braceExpand;var it=(E,W={})=>new tr(E,W).makeRe();e.makeRe=it,e.minimatch.makeRe=e.makeRe;var Ue=(E,W,U={})=>{let $=new tr(W,U);return E=E.filter(se=>$.match(se)),$.options.nonull&&!E.length&&E.push(W),E};e.match=Ue,e.minimatch.match=e.match;var At=/[?*]|[+@!]\(.*?\)|\[|\]/,Qt=E=>E.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),tr=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(E,W={}){(0,r.assertValidPattern)(E),W=W||{},this.options=W,this.pattern=E,this.platform=W.platform||N,this.isWindows=this.platform==="win32";let U="allowWindowsEscape";this.windowsPathsNoEscape=!!W.windowsPathsNoEscape||W[U]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!W.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!W.nonegate,this.comment=!1,this.empty=!1,this.partial=!!W.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=W.windowsNoMagicRoot!==void 0?W.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let E of this.set)for(let W of E)if(typeof W!="string")return!0;return!1}debug(...E){}make(){let E=this.pattern,W=this.options;if(!W.nocomment&&E.charAt(0)==="#"){this.comment=!0;return}if(!E){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],W.debug&&(this.debug=(...se)=>console.error(...se)),this.debug(this.pattern,this.globSet);let U=this.globSet.map(se=>this.slashSplit(se));this.globParts=this.preprocess(U),this.debug(this.pattern,this.globParts);let $=this.globParts.map((se,y,_)=>{if(this.isWindows&&this.windowsNoMagicRoot){let M=se[0]===""&&se[1]===""&&(se[2]==="?"||!At.test(se[2]))&&!At.test(se[3]),ee=/^[a-z]:/i.test(se[0]);if(M)return[...se.slice(0,4),...se.slice(4).map(he=>this.parse(he))];if(ee)return[se[0],...se.slice(1).map(he=>this.parse(he))]}return se.map(M=>this.parse(M))});if(this.debug(this.pattern,$),this.set=$.filter(se=>se.indexOf(!1)===-1),this.isWindows)for(let se=0;se<this.set.length;se++){let y=this.set[se];y[0]===""&&y[1]===""&&this.globParts[se][2]==="?"&&typeof y[3]=="string"&&/^[a-z]:$/i.test(y[3])&&(y[2]="?")}this.debug(this.pattern,this.set)}preprocess(E){if(this.options.noglobstar)for(let U=0;U<E.length;U++)for(let $=0;$<E[U].length;$++)E[U][$]==="**"&&(E[U][$]="*");let{optimizationLevel:W=1}=this.options;return W>=2?(E=this.firstPhasePreProcess(E),E=this.secondPhasePreProcess(E)):W>=1?E=this.levelOneOptimize(E):E=this.adjascentGlobstarOptimize(E),E}adjascentGlobstarOptimize(E){return E.map(W=>{let U=-1;for(;(U=W.indexOf("**",U+1))!==-1;){let $=U;for(;W[$+1]==="**";)$++;$!==U&&W.splice(U,$-U)}return W})}levelOneOptimize(E){return E.map(W=>(W=W.reduce((U,$)=>{let se=U[U.length-1];return $==="**"&&se==="**"?U:$===".."&&se&&se!==".."&&se!=="."&&se!=="**"?(U.pop(),U):(U.push($),U)},[]),W.length===0?[""]:W))}levelTwoFileOptimize(E){Array.isArray(E)||(E=this.slashSplit(E));let W=!1;do{if(W=!1,!this.preserveMultipleSlashes){for(let $=1;$<E.length-1;$++){let se=E[$];$===1&&se===""&&E[0]===""||(se==="."||se==="")&&(W=!0,E.splice($,1),$--)}E[0]==="."&&E.length===2&&(E[1]==="."||E[1]==="")&&(W=!0,E.pop())}let U=0;for(;(U=E.indexOf("..",U+1))!==-1;){let $=E[U-1];$&&$!=="."&&$!==".."&&$!=="**"&&(W=!0,E.splice(U-1,2),U-=2)}}while(W);return E.length===0?[""]:E}firstPhasePreProcess(E){let W=!1;do{W=!1;for(let U of E){let $=-1;for(;($=U.indexOf("**",$+1))!==-1;){let y=$;for(;U[y+1]==="**";)y++;y>$&&U.splice($+1,y-$);let _=U[$+1],M=U[$+2],ee=U[$+3];if(_!==".."||!M||M==="."||M===".."||!ee||ee==="."||ee==="..")continue;W=!0,U.splice($,1);let he=U.slice(0);he[$]="**",E.push(he),$--}if(!this.preserveMultipleSlashes){for(let y=1;y<U.length-1;y++){let _=U[y];y===1&&_===""&&U[0]===""||(_==="."||_==="")&&(W=!0,U.splice(y,1),y--)}U[0]==="."&&U.length===2&&(U[1]==="."||U[1]==="")&&(W=!0,U.pop())}let se=0;for(;(se=U.indexOf("..",se+1))!==-1;){let y=U[se-1];if(y&&y!=="."&&y!==".."&&y!=="**"){W=!0;let _=se===1&&U[se+1]==="**"?["."]:[];U.splice(se-1,2,..._),U.length===0&&U.push(""),se-=2}}}}while(W);return E}secondPhasePreProcess(E){for(let W=0;W<E.length-1;W++)for(let U=W+1;U<E.length;U++){let $=this.partsMatch(E[W],E[U],!this.preserveMultipleSlashes);if($){E[W]=[],E[U]=$;break}}return E.filter(W=>W.length)}partsMatch(E,W,U=!1){let $=0,se=0,y=[],_="";for(;$<E.length&&se<W.length;)if(E[$]===W[se])y.push(_==="b"?W[se]:E[$]),$++,se++;else if(U&&E[$]==="**"&&W[se]===E[$+1])y.push(E[$]),$++;else if(U&&W[se]==="**"&&E[$]===W[se+1])y.push(W[se]),se++;else if(E[$]==="*"&&W[se]&&(this.options.dot||!W[se].startsWith("."))&&W[se]!=="**"){if(_==="b")return!1;_="a",y.push(E[$]),$++,se++}else if(W[se]==="*"&&E[$]&&(this.options.dot||!E[$].startsWith("."))&&E[$]!=="**"){if(_==="a")return!1;_="b",y.push(W[se]),$++,se++}else return!1;return E.length===W.length&&y}parseNegate(){if(this.nonegate)return;let E=this.pattern,W=!1,U=0;for(let $=0;$<E.length&&E.charAt($)==="!";$++)W=!W,U++;U&&(this.pattern=E.slice(U)),this.negate=W}matchOne(E,W,U=!1){let $=this.options;if(this.isWindows){let Bt=typeof E[0]=="string"&&/^[a-z]:$/i.test(E[0]),Nt=!Bt&&E[0]===""&&E[1]===""&&E[2]==="?"&&/^[a-z]:$/i.test(E[3]),rr=typeof W[0]=="string"&&/^[a-z]:$/i.test(W[0]),Nr=!rr&&W[0]===""&&W[1]===""&&W[2]==="?"&&typeof W[3]=="string"&&/^[a-z]:$/i.test(W[3]),Zr=Nt?3:Bt?0:void 0,Ar=Nr?3:rr?0:void 0;if(typeof Zr=="number"&&typeof Ar=="number"){let[Xr,vn]=[E[Zr],W[Ar]];Xr.toLowerCase()===vn.toLowerCase()&&(W[Ar]=Xr,Ar>Zr?W=W.slice(Ar):Zr>Ar&&(E=E.slice(Zr)))}}let{optimizationLevel:se=1}=this.options;se>=2&&(E=this.levelTwoFileOptimize(E)),this.debug("matchOne",this,{file:E,pattern:W}),this.debug("matchOne",E.length,W.length);for(var y=0,_=0,M=E.length,ee=W.length;y<M&&_<ee;y++,_++){this.debug("matchOne loop");var he=W[_],ke=E[y];if(this.debug(W,he,ke),he===!1)return!1;if(he===e.GLOBSTAR){this.debug("GLOBSTAR",[W,he,ke]);var we=y,Je=_+1;if(Je===ee){for(this.debug("** at the end");y<M;y++)if(E[y]==="."||E[y]===".."||!$.dot&&E[y].charAt(0)===".")return!1;return!0}for(;we<M;){var vt=E[we];if(this.debug(`
86
86
  globstar while`,E,we,W,Je,vt),this.matchOne(E.slice(we),W.slice(Je),U))return this.debug("globstar found match!",we,M,vt),!0;if(vt==="."||vt===".."||!$.dot&&vt.charAt(0)==="."){this.debug("dot detected!",E,we,W,Je);break}this.debug("globstar swallow a segment, and continue"),we++}return!!(U&&(this.debug(`
87
- >>> no match, partial?`,E,we,W,Je),we===M))}let Bt;if(typeof he=="string"?(Bt=ke===he,this.debug("string match",he,ke,Bt)):(Bt=he.test(ke),this.debug("pattern match",he,ke,Bt)),!Bt)return!1}if(y===M&&_===ee)return!0;if(y===M)return U;if(_===ee)return y===M-1&&E[y]==="";throw new Error("wtf?")}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(E){(0,r.assertValidPattern)(E);let W=this.options;if(E==="**")return e.GLOBSTAR;if(E==="")return"";let U,$=null;(U=E.match(I))?$=W.dot?b:C:(U=E.match(a))?$=(W.nocase?W.dot?d:l:W.dot?u:c)(U[1]):(U=E.match(S))?$=(W.nocase?W.dot?Q:R:W.dot?k:v)(U):(U=E.match(f))?$=W.dot?g:A:(U=E.match(h))&&($=m);let se=n.AST.fromGlob(E,this.options).toMMPattern();return $&&typeof se=="object"&&Reflect.defineProperty(se,"test",{value:$}),se}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let E=this.set;if(!E.length)return this.regexp=!1,this.regexp;let W=this.options,U=W.noglobstar?ie:W.dot?Z:O,$=new Set(W.nocase?["i"]:[]),se=E.map(M=>{let ee=M.map(ke=>{if(ke instanceof RegExp)for(let we of ke.flags.split(""))$.add(we);return typeof ke=="string"?Qt(ke):ke===e.GLOBSTAR?e.GLOBSTAR:ke._src});ee.forEach((ke,we)=>{let Je=ee[we+1],vt=ee[we-1];ke!==e.GLOBSTAR||vt===e.GLOBSTAR||(vt===void 0?Je!==void 0&&Je!==e.GLOBSTAR?ee[we+1]="(?:\\/|"+U+"\\/)?"+Je:ee[we]=U:Je===void 0?ee[we-1]=vt+"(?:\\/|\\/"+U+")?":Je!==e.GLOBSTAR&&(ee[we-1]=vt+"(?:\\/|\\/"+U+"\\/)"+Je,ee[we+1]=e.GLOBSTAR))});let he=ee.filter(ke=>ke!==e.GLOBSTAR);if(this.partial&&he.length>=1){let ke=[];for(let we=1;we<=he.length;we++)ke.push(he.slice(0,we).join("/"));return"(?:"+ke.join("|")+")"}return he.join("/")}).join("|"),[y,_]=E.length>1?["(?:",")"]:["",""];se="^"+y+se+_+"$",this.partial&&(se="^(?:\\/|"+y+se.slice(1,-1)+_+")$"),this.negate&&(se="^(?!"+se+").+$");try{this.regexp=new RegExp(se,[...$].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,W=this.partial){if(this.debug("match",E,this.pattern),this.comment)return!1;if(this.empty)return E==="";if(E==="/"&&W)return!0;let U=this.options;this.isWindows&&(E=E.split("\\").join("/"));let $=this.slashSplit(E);this.debug(this.pattern,"split",$);let se=this.set;this.debug(this.pattern,"set",se);let y=$[$.length-1];if(!y)for(let _=$.length-2;!y&&_>=0;_--)y=$[_];for(let _=0;_<se.length;_++){let M=se[_],ee=$;if(U.matchBase&&M.length===1&&(ee=[y]),this.matchOne(ee,M,W))return U.flipNegate?!0:!this.negate}return U.flipNegate?!1:this.negate}static defaults(E){return e.minimatch.defaults(E).Minimatch}};e.Minimatch=tr;var x=Rbe();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return x.AST}});var w=Dbe();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return w.escape}});var ue=bY();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return ue.unescape}}),e.minimatch.AST=n.AST,e.minimatch.Minimatch=tr,e.minimatch.escape=i.escape,e.minimatch.unescape=s.unescape}),b2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,n=typeof process=="object"&&process?process:{},i=(A,g,h,m)=>{typeof n.emitWarning=="function"?n.emitWarning(A,g,h,m):console.error(`[${h}] ${g}: ${A}`)},s=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof s>"u"){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(h,m){this._onabort.push(m)}},s=class{constructor(){g()}signal=new o;abort(h){if(!this.signal.aborted){this.signal.reason=h,this.signal.aborted=!0;for(let m of this.signal._onabort)m(h);this.signal.onabort?.(h)}}};let A=n.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",g=()=>{A&&(A=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",g))}}var a=A=>!r.has(A),c=A=>A&&A===Math.floor(A)&&A>0&&isFinite(A),u=A=>c(A)?A<=Math.pow(2,8)?Uint8Array:A<=Math.pow(2,16)?Uint16Array:A<=Math.pow(2,32)?Uint32Array:A<=Number.MAX_SAFE_INTEGER?l:null:null,l=class extends Array{constructor(A){super(A),this.fill(0)}},d=class FB{heap;length;static#e=!1;static create(g){let h=u(g);if(!h)return[];FB.#e=!0;let m=new FB(g,h);return FB.#e=!1,m}constructor(g,h){if(!FB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new h(g),this.length=0}push(g){this.heap[this.length++]=g}pop(){return this.heap[--this.length]}},f=class Tbe{#e;#t;#r;#n;#i;#s;#l;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#d;#A;#f;#u;#h;#y;#I;#p;#w;#C;#B;#S;#m;#b;#E;#_;#c;#k;static unsafeExposeInternals(g){return{starts:g.#S,ttls:g.#m,autopurgeTimers:g.#b,sizes:g.#B,keyMap:g.#A,keyList:g.#f,valList:g.#u,next:g.#h,prev:g.#y,get head(){return g.#I},get tail(){return g.#p},free:g.#w,isBackgroundFetch:h=>g.#g(h),backgroundFetch:(h,m,I,C)=>g.#W(h,m,I,C),moveToTail:h=>g.#G(h),indexes:h=>g.#D(h),rindexes:h=>g.#Q(h),isStale:h=>g.#v(h)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#o}get fetchMethod(){return this.#s}get memoMethod(){return this.#l}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(g){let{max:h=0,ttl:m,ttlResolution:I=1,ttlAutopurge:C,updateAgeOnGet:b,updateAgeOnHas:S,allowStale:R,dispose:Q,onInsert:k,disposeAfter:v,noDisposeOnSet:T,noUpdateTTL:H,maxSize:N=0,maxEntrySize:Y=0,sizeCalculation:K,fetchMethod:ie,memoMethod:Z,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:ne,allowStaleOnFetchRejection:te,allowStaleOnFetchAbort:Ce,ignoreFetchAbort:qe,perf:it}=g;if(it!==void 0&&typeof it?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=it??t,h!==0&&!c(h))throw new TypeError("max option must be a nonnegative integer");let Ue=h?u(h):Array;if(!Ue)throw new Error("invalid max value: "+h);if(this.#e=h,this.#t=N,this.maxEntrySize=Y||this.#t,this.sizeCalculation=K,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Z!==void 0&&typeof Z!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=Z,ie!==void 0&&typeof ie!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=ie,this.#_=!!ie,this.#A=new Map,this.#f=new Array(h).fill(void 0),this.#u=new Array(h).fill(void 0),this.#h=new Ue(h),this.#y=new Ue(h),this.#I=0,this.#p=0,this.#w=d.create(h),this.#o=0,this.#d=0,typeof Q=="function"&&(this.#r=Q),typeof k=="function"&&(this.#n=k),typeof v=="function"?(this.#i=v,this.#C=[]):(this.#i=void 0,this.#C=void 0),this.#E=!!this.#r,this.#k=!!this.#n,this.#c=!!this.#i,this.noDisposeOnSet=!!T,this.noUpdateTTL=!!H,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!te,this.allowStaleOnFetchAbort=!!Ce,this.ignoreFetchAbort=!!qe,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H()}if(this.allowStale=!!R,this.noDeleteOnStaleGet=!!ne,this.updateAgeOnGet=!!b,this.updateAgeOnHas=!!S,this.ttlResolution=c(I)||I===0?I:1,this.ttlAutopurge=!!C,this.ttl=m||0,this.ttl){if(!c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let At="LRU_CACHE_UNBOUNDED";a(At)&&(r.add(At),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",At,Tbe))}}getRemainingTTL(g){return this.#A.has(g)?1/0:0}#N(){let g=new l(this.#e),h=new l(this.#e);this.#m=g,this.#S=h;let m=this.ttlAutopurge?new Array(this.#e):void 0;this.#b=m,this.#U=(b,S,R=this.#a.now())=>{if(h[b]=S!==0?R:0,g[b]=S,m?.[b]&&(clearTimeout(m[b]),m[b]=void 0),S!==0&&m){let Q=setTimeout(()=>{this.#v(b)&&this.#R(this.#f[b],"expire")},S+1);Q.unref&&Q.unref(),m[b]=Q}},this.#x=b=>{h[b]=g[b]!==0?this.#a.now():0},this.#T=(b,S)=>{if(g[S]){let R=g[S],Q=h[S];if(!R||!Q)return;b.ttl=R,b.start=Q,b.now=I||C();let k=b.now-Q;b.remainingTTL=R-k}};let I=0,C=()=>{let b=this.#a.now();if(this.ttlResolution>0){I=b;let S=setTimeout(()=>I=0,this.ttlResolution);S.unref&&S.unref()}return b};this.getRemainingTTL=b=>{let S=this.#A.get(b);if(S===void 0)return 0;let R=g[S],Q=h[S];if(!R||!Q)return 1/0;let k=(I||C())-Q;return R-k},this.#v=b=>{let S=h[b],R=g[b];return!!R&&!!S&&(I||C())-S>R}}#x=()=>{};#T=()=>{};#U=()=>{};#v=()=>!1;#H(){let g=new l(this.#e);this.#d=0,this.#B=g,this.#Z=h=>{this.#d-=g[h],g[h]=0},this.#O=(h,m,I,C)=>{if(this.#g(m))return 0;if(!c(I))if(C){if(typeof C!="function")throw new TypeError("sizeCalculation must be a function");if(I=C(m,h),!c(I))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return I},this.#F=(h,m,I)=>{if(g[h]=m,this.#t){let C=this.#t-g[h];for(;this.#d>C;)this.#L(!0)}this.#d+=g[h],I&&(I.entrySize=m,I.totalCalculatedSize=this.#d)}}#Z=g=>{};#F=(g,h,m)=>{};#O=(g,h,m,I)=>{if(m||I)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:g=this.allowStale}={}){if(this.#o)for(let h=this.#p;!(!this.#M(h)||((g||!this.#v(h))&&(yield h),h===this.#I));)h=this.#y[h]}*#Q({allowStale:g=this.allowStale}={}){if(this.#o)for(let h=this.#I;!(!this.#M(h)||((g||!this.#v(h))&&(yield h),h===this.#p));)h=this.#h[h]}#M(g){return g!==void 0&&this.#A.get(this.#f[g])===g}*entries(){for(let g of this.#D())this.#u[g]!==void 0&&this.#f[g]!==void 0&&!this.#g(this.#u[g])&&(yield[this.#f[g],this.#u[g]])}*rentries(){for(let g of this.#Q())this.#u[g]!==void 0&&this.#f[g]!==void 0&&!this.#g(this.#u[g])&&(yield[this.#f[g],this.#u[g]])}*keys(){for(let g of this.#D()){let h=this.#f[g];h!==void 0&&!this.#g(this.#u[g])&&(yield h)}}*rkeys(){for(let g of this.#Q()){let h=this.#f[g];h!==void 0&&!this.#g(this.#u[g])&&(yield h)}}*values(){for(let g of this.#D())this.#u[g]!==void 0&&!this.#g(this.#u[g])&&(yield this.#u[g])}*rvalues(){for(let g of this.#Q())this.#u[g]!==void 0&&!this.#g(this.#u[g])&&(yield this.#u[g])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(g,h={}){for(let m of this.#D()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;if(C!==void 0&&g(C,this.#f[m],this))return this.get(this.#f[m],h)}}forEach(g,h=this){for(let m of this.#D()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;C!==void 0&&g.call(h,C,this.#f[m],this)}}rforEach(g,h=this){for(let m of this.#Q()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;C!==void 0&&g.call(h,C,this.#f[m],this)}}purgeStale(){let g=!1;for(let h of this.#Q({allowStale:!0}))this.#v(h)&&(this.#R(this.#f[h],"expire"),g=!0);return g}info(g){let h=this.#A.get(g);if(h===void 0)return;let m=this.#u[h],I=this.#g(m)?m.__staleWhileFetching:m;if(I===void 0)return;let C={value:I};if(this.#m&&this.#S){let b=this.#m[h],S=this.#S[h];if(b&&S){let R=b-(this.#a.now()-S);C.ttl=R,C.start=Date.now()}}return this.#B&&(C.size=this.#B[h]),C}dump(){let g=[];for(let h of this.#D({allowStale:!0})){let m=this.#f[h],I=this.#u[h],C=this.#g(I)?I.__staleWhileFetching:I;if(C===void 0||m===void 0)continue;let b={value:C};if(this.#m&&this.#S){b.ttl=this.#m[h];let S=this.#a.now()-this.#S[h];b.start=Math.floor(Date.now()-S)}this.#B&&(b.size=this.#B[h]),g.unshift([m,b])}return g}load(g){this.clear();for(let[h,m]of g){if(m.start){let I=Date.now()-m.start;m.start=this.#a.now()-I}this.set(h,m.value,m)}}set(g,h,m={}){if(h===void 0)return this.delete(g),this;let{ttl:I=this.ttl,start:C,noDisposeOnSet:b=this.noDisposeOnSet,sizeCalculation:S=this.sizeCalculation,status:R}=m,{noUpdateTTL:Q=this.noUpdateTTL}=m,k=this.#O(g,h,m.size||0,S);if(this.maxEntrySize&&k>this.maxEntrySize)return R&&(R.set="miss",R.maxEntrySizeExceeded=!0),this.#R(g,"set"),this;let v=this.#o===0?void 0:this.#A.get(g);if(v===void 0)v=this.#o===0?this.#p:this.#w.length!==0?this.#w.pop():this.#o===this.#e?this.#L(!1):this.#o,this.#f[v]=g,this.#u[v]=h,this.#A.set(g,v),this.#h[this.#p]=v,this.#y[v]=this.#p,this.#p=v,this.#o++,this.#F(v,k,R),R&&(R.set="add"),Q=!1,this.#k&&this.#n?.(h,g,"add");else{this.#G(v);let T=this.#u[v];if(h!==T){if(this.#_&&this.#g(T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:H}=T;H!==void 0&&!b&&(this.#E&&this.#r?.(H,g,"set"),this.#c&&this.#C?.push([H,g,"set"]))}else b||(this.#E&&this.#r?.(T,g,"set"),this.#c&&this.#C?.push([T,g,"set"]));if(this.#Z(v),this.#F(v,k,R),this.#u[v]=h,R){R.set="replace";let H=T&&this.#g(T)?T.__staleWhileFetching:T;H!==void 0&&(R.oldValue=H)}}else R&&(R.set="update");this.#k&&this.onInsert?.(h,g,h===T?"update":"replace")}if(I!==0&&!this.#m&&this.#N(),this.#m&&(Q||this.#U(v,I,C),R&&this.#T(R,v)),!b&&this.#c&&this.#C){let T=this.#C,H;for(;H=T?.shift();)this.#i?.(...H)}return this}pop(){try{for(;this.#o;){let g=this.#u[this.#I];if(this.#L(!0),this.#g(g)){if(g.__staleWhileFetching)return g.__staleWhileFetching}else if(g!==void 0)return g}}finally{if(this.#c&&this.#C){let g=this.#C,h;for(;h=g?.shift();)this.#i?.(...h)}}}#L(g){let h=this.#I,m=this.#f[h],I=this.#u[h];return this.#_&&this.#g(I)?I.__abortController.abort(new Error("evicted")):(this.#E||this.#c)&&(this.#E&&this.#r?.(I,m,"evict"),this.#c&&this.#C?.push([I,m,"evict"])),this.#Z(h),this.#b?.[h]&&(clearTimeout(this.#b[h]),this.#b[h]=void 0),g&&(this.#f[h]=void 0,this.#u[h]=void 0,this.#w.push(h)),this.#o===1?(this.#I=this.#p=0,this.#w.length=0):this.#I=this.#h[h],this.#A.delete(m),this.#o--,h}has(g,h={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:I}=h,C=this.#A.get(g);if(C!==void 0){let b=this.#u[C];if(this.#g(b)&&b.__staleWhileFetching===void 0)return!1;if(this.#v(C))I&&(I.has="stale",this.#T(I,C));else return m&&this.#x(C),I&&(I.has="hit",this.#T(I,C)),!0}else I&&(I.has="miss");return!1}peek(g,h={}){let{allowStale:m=this.allowStale}=h,I=this.#A.get(g);if(I===void 0||!m&&this.#v(I))return;let C=this.#u[I];return this.#g(C)?C.__staleWhileFetching:C}#W(g,h,m,I){let C=h===void 0?void 0:this.#u[h];if(this.#g(C))return C;let b=new s,{signal:S}=m;S?.addEventListener("abort",()=>b.abort(S.reason),{signal:b.signal});let R={signal:b.signal,options:m,context:I},Q=(Y,K=!1)=>{let{aborted:ie}=b.signal,Z=m.ignoreFetchAbort&&Y!==void 0,O=m.ignoreFetchAbort||!!(m.allowStaleOnFetchAbort&&Y!==void 0);if(m.status&&(ie&&!K?(m.status.fetchAborted=!0,m.status.fetchError=b.signal.reason,Z&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),ie&&!Z&&!K)return v(b.signal.reason,O);let ne=H,te=this.#u[h];return(te===H||Z&&K&&te===void 0)&&(Y===void 0?ne.__staleWhileFetching!==void 0?this.#u[h]=ne.__staleWhileFetching:this.#R(g,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(g,Y,R.options))),Y},k=Y=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=Y),v(Y,!1)),v=(Y,K)=>{let{aborted:ie}=b.signal,Z=ie&&m.allowStaleOnFetchAbort,O=Z||m.allowStaleOnFetchRejection,ne=O||m.noDeleteOnFetchRejection,te=H;if(this.#u[h]===H&&(!ne||!K&&te.__staleWhileFetching===void 0?this.#R(g,"fetch"):Z||(this.#u[h]=te.__staleWhileFetching)),O)return m.status&&te.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),te.__staleWhileFetching;if(te.__returned===te)throw Y},T=(Y,K)=>{let ie=this.#s?.(g,C,R);ie&&ie instanceof Promise&&ie.then(Z=>Y(Z===void 0?void 0:Z),K),b.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(Y(void 0),m.allowStaleOnFetchAbort&&(Y=Z=>Q(Z,!0)))})};m.status&&(m.status.fetchDispatched=!0);let H=new Promise(T).then(Q,k),N=Object.assign(H,{__abortController:b,__staleWhileFetching:C,__returned:void 0});return h===void 0?(this.set(g,N,{...R.options,status:void 0}),h=this.#A.get(g)):this.#u[h]=N,N}#g(g){if(!this.#_)return!1;let h=g;return!!h&&h instanceof Promise&&h.hasOwnProperty("__staleWhileFetching")&&h.__abortController instanceof s}async fetch(g,h={}){let{allowStale:m=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,ttl:b=this.ttl,noDisposeOnSet:S=this.noDisposeOnSet,size:R=0,sizeCalculation:Q=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:T=this.allowStaleOnFetchRejection,ignoreFetchAbort:H=this.ignoreFetchAbort,allowStaleOnFetchAbort:N=this.allowStaleOnFetchAbort,context:Y,forceRefresh:K=!1,status:ie,signal:Z}=h;if(!this.#_)return ie&&(ie.fetch="get"),this.get(g,{allowStale:m,updateAgeOnGet:I,noDeleteOnStaleGet:C,status:ie});let O={allowStale:m,updateAgeOnGet:I,noDeleteOnStaleGet:C,ttl:b,noDisposeOnSet:S,size:R,sizeCalculation:Q,noUpdateTTL:k,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:N,ignoreFetchAbort:H,status:ie,signal:Z},ne=this.#A.get(g);if(ne===void 0){ie&&(ie.fetch="miss");let te=this.#W(g,ne,O,Y);return te.__returned=te}else{let te=this.#u[ne];if(this.#g(te)){let Ue=m&&te.__staleWhileFetching!==void 0;return ie&&(ie.fetch="inflight",Ue&&(ie.returnedStale=!0)),Ue?te.__staleWhileFetching:te.__returned=te}let Ce=this.#v(ne);if(!K&&!Ce)return ie&&(ie.fetch="hit"),this.#G(ne),I&&this.#x(ne),ie&&this.#T(ie,ne),te;let qe=this.#W(g,ne,O,Y),it=qe.__staleWhileFetching!==void 0&&m;return ie&&(ie.fetch=Ce?"stale":"refresh",it&&Ce&&(ie.returnedStale=!0)),it?qe.__staleWhileFetching:qe.__returned=qe}}async forceFetch(g,h={}){let m=await this.fetch(g,h);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(g,h={}){let m=this.#l;if(!m)throw new Error("no memoMethod provided to constructor");let{context:I,forceRefresh:C,...b}=h,S=this.get(g,b);if(!C&&S!==void 0)return S;let R=m(g,S,{options:b,context:I});return this.set(g,R,b),R}get(g,h={}){let{allowStale:m=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,status:b}=h,S=this.#A.get(g);if(S!==void 0){let R=this.#u[S],Q=this.#g(R);return b&&this.#T(b,S),this.#v(S)?(b&&(b.get="stale"),Q?(b&&m&&R.__staleWhileFetching!==void 0&&(b.returnedStale=!0),m?R.__staleWhileFetching:void 0):(C||this.#R(g,"expire"),b&&m&&(b.returnedStale=!0),m?R:void 0)):(b&&(b.get="hit"),Q?R.__staleWhileFetching:(this.#G(S),I&&this.#x(S),R))}else b&&(b.get="miss")}#V(g,h){this.#y[h]=g,this.#h[g]=h}#G(g){g!==this.#p&&(g===this.#I?this.#I=this.#h[g]:this.#V(this.#y[g],this.#h[g]),this.#V(this.#p,g),this.#p=g)}delete(g){return this.#R(g,"delete")}#R(g,h){let m=!1;if(this.#o!==0){let I=this.#A.get(g);if(I!==void 0)if(this.#b?.[I]&&(clearTimeout(this.#b?.[I]),this.#b[I]=void 0),m=!0,this.#o===1)this.#P(h);else{this.#Z(I);let C=this.#u[I];if(this.#g(C)?C.__abortController.abort(new Error("deleted")):(this.#E||this.#c)&&(this.#E&&this.#r?.(C,g,h),this.#c&&this.#C?.push([C,g,h])),this.#A.delete(g),this.#f[I]=void 0,this.#u[I]=void 0,I===this.#p)this.#p=this.#y[I];else if(I===this.#I)this.#I=this.#h[I];else{let b=this.#y[I];this.#h[b]=this.#h[I];let S=this.#h[I];this.#y[S]=this.#y[I]}this.#o--,this.#w.push(I)}}if(this.#c&&this.#C?.length){let I=this.#C,C;for(;C=I?.shift();)this.#i?.(...C)}return m}clear(){return this.#P("delete")}#P(g){for(let h of this.#Q({allowStale:!0})){let m=this.#u[h];if(this.#g(m))m.__abortController.abort(new Error("deleted"));else{let I=this.#f[h];this.#E&&this.#r?.(m,I,g),this.#c&&this.#C?.push([m,I,g])}}if(this.#A.clear(),this.#u.fill(void 0),this.#f.fill(void 0),this.#m&&this.#S){this.#m.fill(0),this.#S.fill(0);for(let h of this.#b??[])h!==void 0&&clearTimeout(h);this.#b?.fill(void 0)}if(this.#B&&this.#B.fill(0),this.#I=0,this.#p=0,this.#w.length=0,this.#d=0,this.#o=0,this.#c&&this.#C){let h=this.#C,m;for(;m=h?.shift();)this.#i?.(...m)}}};e.LRUCache=f}),kbe=ii(e=>{"use strict";var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=require("node:events"),i=t(require("node:stream")),s=require("node:string_decoder"),o=y=>!!y&&typeof y=="object"&&(y instanceof se||y instanceof i.default||(0,e.isReadable)(y)||(0,e.isWritable)(y));e.isStream=o;var a=y=>!!y&&typeof y=="object"&&y instanceof n.EventEmitter&&typeof y.pipe=="function"&&y.pipe!==i.default.Writable.prototype.pipe;e.isReadable=a;var c=y=>!!y&&typeof y=="object"&&y instanceof n.EventEmitter&&typeof y.write=="function"&&typeof y.end=="function";e.isWritable=c;var u=Symbol("EOF"),l=Symbol("maybeEmitEnd"),d=Symbol("emittedEnd"),f=Symbol("emittingEnd"),A=Symbol("emittedError"),g=Symbol("closed"),h=Symbol("read"),m=Symbol("flush"),I=Symbol("flushChunk"),C=Symbol("encoding"),b=Symbol("decoder"),S=Symbol("flowing"),R=Symbol("paused"),Q=Symbol("resume"),k=Symbol("buffer"),v=Symbol("pipes"),T=Symbol("bufferLength"),H=Symbol("bufferPush"),N=Symbol("bufferShift"),Y=Symbol("objectMode"),K=Symbol("destroyed"),ie=Symbol("error"),Z=Symbol("emitData"),O=Symbol("emitEnd"),ne=Symbol("emitEnd2"),te=Symbol("async"),Ce=Symbol("abort"),qe=Symbol("aborted"),it=Symbol("signal"),Ue=Symbol("dataListeners"),At=Symbol("discarded"),Qt=y=>Promise.resolve().then(y),tr=y=>y(),x=y=>y==="end"||y==="finish"||y==="prefinish",w=y=>y instanceof ArrayBuffer||!!y&&typeof y=="object"&&y.constructor&&y.constructor.name==="ArrayBuffer"&&y.byteLength>=0,ue=y=>!Buffer.isBuffer(y)&&ArrayBuffer.isView(y),E=class{src;dest;opts;ondrain;constructor(y,_,M){this.src=y,this.dest=_,this.opts=M,this.ondrain=()=>y[Q](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(y){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},W=class extends E{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(y,_,M){super(y,_,M),this.proxyErrors=ee=>this.dest.emit("error",ee),y.on("error",this.proxyErrors)}},U=y=>!!y.objectMode,$=y=>!y.objectMode&&!!y.encoding&&y.encoding!=="buffer",se=class extends n.EventEmitter{[S]=!1;[R]=!1;[v]=[];[k]=[];[Y];[C];[te];[b];[u]=!1;[d]=!1;[f]=!1;[g]=!1;[A]=null;[T]=0;[K]=!1;[it];[qe]=!1;[Ue]=0;[At]=!1;writable=!0;readable=!0;constructor(...y){let _=y[0]||{};if(super(),_.objectMode&&typeof _.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");U(_)?(this[Y]=!0,this[C]=null):$(_)?(this[C]=_.encoding,this[Y]=!1):(this[Y]=!1,this[C]=null),this[te]=!!_.async,this[b]=this[C]?new s.StringDecoder(this[C]):null,_&&_.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),_&&_.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[v]});let{signal:M}=_;M&&(this[it]=M,M.aborted?this[Ce]():M.addEventListener("abort",()=>this[Ce]()))}get bufferLength(){return this[T]}get encoding(){return this[C]}set encoding(y){throw new Error("Encoding must be set at instantiation time")}setEncoding(y){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Y]}set objectMode(y){throw new Error("objectMode must be set at instantiation time")}get async(){return this[te]}set async(y){this[te]=this[te]||!!y}[Ce](){this[qe]=!0,this.emit("abort",this[it]?.reason),this.destroy(this[it]?.reason)}get aborted(){return this[qe]}set aborted(y){}write(y,_,M){if(this[qe])return!1;if(this[u])throw new Error("write after end");if(this[K])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof _=="function"&&(M=_,_="utf8"),_||(_="utf8");let ee=this[te]?Qt:tr;if(!this[Y]&&!Buffer.isBuffer(y)){if(ue(y))y=Buffer.from(y.buffer,y.byteOffset,y.byteLength);else if(w(y))y=Buffer.from(y);else if(typeof y!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Y]?(this[S]&&this[T]!==0&&this[m](!0),this[S]?this.emit("data",y):this[H](y),this[T]!==0&&this.emit("readable"),M&&ee(M),this[S]):y.length?(typeof y=="string"&&!(_===this[C]&&!this[b]?.lastNeed)&&(y=Buffer.from(y,_)),Buffer.isBuffer(y)&&this[C]&&(y=this[b].write(y)),this[S]&&this[T]!==0&&this[m](!0),this[S]?this.emit("data",y):this[H](y),this[T]!==0&&this.emit("readable"),M&&ee(M),this[S]):(this[T]!==0&&this.emit("readable"),M&&ee(M),this[S])}read(y){if(this[K])return null;if(this[At]=!1,this[T]===0||y===0||y&&y>this[T])return this[l](),null;this[Y]&&(y=null),this[k].length>1&&!this[Y]&&(this[k]=[this[C]?this[k].join(""):Buffer.concat(this[k],this[T])]);let _=this[h](y||null,this[k][0]);return this[l](),_}[h](y,_){if(this[Y])this[N]();else{let M=_;y===M.length||y===null?this[N]():typeof M=="string"?(this[k][0]=M.slice(y),_=M.slice(0,y),this[T]-=y):(this[k][0]=M.subarray(y),_=M.subarray(0,y),this[T]-=y)}return this.emit("data",_),!this[k].length&&!this[u]&&this.emit("drain"),_}end(y,_,M){return typeof y=="function"&&(M=y,y=void 0),typeof _=="function"&&(M=_,_="utf8"),y!==void 0&&this.write(y,_),M&&this.once("end",M),this[u]=!0,this.writable=!1,(this[S]||!this[R])&&this[l](),this}[Q](){this[K]||(!this[Ue]&&!this[v].length&&(this[At]=!0),this[R]=!1,this[S]=!0,this.emit("resume"),this[k].length?this[m]():this[u]?this[l]():this.emit("drain"))}resume(){return this[Q]()}pause(){this[S]=!1,this[R]=!0,this[At]=!1}get destroyed(){return this[K]}get flowing(){return this[S]}get paused(){return this[R]}[H](y){this[Y]?this[T]+=1:this[T]+=y.length,this[k].push(y)}[N](){return this[Y]?this[T]-=1:this[T]-=this[k][0].length,this[k].shift()}[m](y=!1){do;while(this[I](this[N]())&&this[k].length);!y&&!this[k].length&&!this[u]&&this.emit("drain")}[I](y){return this.emit("data",y),this[S]}pipe(y,_){if(this[K])return y;this[At]=!1;let M=this[d];return _=_||{},y===r.stdout||y===r.stderr?_.end=!1:_.end=_.end!==!1,_.proxyErrors=!!_.proxyErrors,M?_.end&&y.end():(this[v].push(_.proxyErrors?new W(this,y,_):new E(this,y,_)),this[te]?Qt(()=>this[Q]()):this[Q]()),y}unpipe(y){let _=this[v].find(M=>M.dest===y);_&&(this[v].length===1?(this[S]&&this[Ue]===0&&(this[S]=!1),this[v]=[]):this[v].splice(this[v].indexOf(_),1),_.unpipe())}addListener(y,_){return this.on(y,_)}on(y,_){let M=super.on(y,_);if(y==="data")this[At]=!1,this[Ue]++,!this[v].length&&!this[S]&&this[Q]();else if(y==="readable"&&this[T]!==0)super.emit("readable");else if(x(y)&&this[d])super.emit(y),this.removeAllListeners(y);else if(y==="error"&&this[A]){let ee=_;this[te]?Qt(()=>ee.call(this,this[A])):ee.call(this,this[A])}return M}removeListener(y,_){return this.off(y,_)}off(y,_){let M=super.off(y,_);return y==="data"&&(this[Ue]=this.listeners("data").length,this[Ue]===0&&!this[At]&&!this[v].length&&(this[S]=!1)),M}removeAllListeners(y){let _=super.removeAllListeners(y);return(y==="data"||y===void 0)&&(this[Ue]=0,!this[At]&&!this[v].length&&(this[S]=!1)),_}get emittedEnd(){return this[d]}[l](){!this[f]&&!this[d]&&!this[K]&&this[k].length===0&&this[u]&&(this[f]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[g]&&this.emit("close"),this[f]=!1)}emit(y,..._){let M=_[0];if(y!=="error"&&y!=="close"&&y!==K&&this[K])return!1;if(y==="data")return!this[Y]&&!M?!1:this[te]?(Qt(()=>this[Z](M)),!0):this[Z](M);if(y==="end")return this[O]();if(y==="close"){if(this[g]=!0,!this[d]&&!this[K])return!1;let he=super.emit("close");return this.removeAllListeners("close"),he}else if(y==="error"){this[A]=M,super.emit(ie,M);let he=!this[it]||this.listeners("error").length?super.emit("error",M):!1;return this[l](),he}else if(y==="resume"){let he=super.emit("resume");return this[l](),he}else if(y==="finish"||y==="prefinish"){let he=super.emit(y);return this.removeAllListeners(y),he}let ee=super.emit(y,..._);return this[l](),ee}[Z](y){for(let M of this[v])M.dest.write(y)===!1&&this.pause();let _=this[At]?!1:super.emit("data",y);return this[l](),_}[O](){return this[d]?!1:(this[d]=!0,this.readable=!1,this[te]?(Qt(()=>this[ne]()),!0):this[ne]())}[ne](){if(this[b]){let _=this[b].end();if(_){for(let M of this[v])M.dest.write(_);this[At]||super.emit("data",_)}}for(let _ of this[v])_.end();let y=super.emit("end");return this.removeAllListeners("end"),y}async collect(){let y=Object.assign([],{dataLength:0});this[Y]||(y.dataLength=0);let _=this.promise();return this.on("data",M=>{y.push(M),this[Y]||(y.dataLength+=M.length)}),await _,y}async concat(){if(this[Y])throw new Error("cannot concat in objectMode");let y=await this.collect();return this[C]?y.join(""):Buffer.concat(y,y.dataLength)}async promise(){return new Promise((y,_)=>{this.on(K,()=>_(new Error("stream destroyed"))),this.on("error",M=>_(M)),this.on("end",()=>y())})}[Symbol.asyncIterator](){this[At]=!1;let y=!1,_=async()=>(this.pause(),y=!0,{value:void 0,done:!0});return{next:()=>{if(y)return _();let M=this.read();if(M!==null)return Promise.resolve({done:!1,value:M});if(this[u])return _();let ee,he,ke=Bt=>{this.off("data",we),this.off("end",Je),this.off(K,vt),_(),he(Bt)},we=Bt=>{this.off("error",ke),this.off("end",Je),this.off(K,vt),this.pause(),ee({value:Bt,done:!!this[u]})},Je=()=>{this.off("error",ke),this.off("data",we),this.off(K,vt),_(),ee({done:!0,value:void 0})},vt=()=>ke(new Error("stream destroyed"));return new Promise((Bt,Nt)=>{he=Nt,ee=Bt,this.once(K,vt),this.once("error",ke),this.once("end",Je),this.once("data",we)})},throw:_,return:_,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[At]=!1;let y=!1,_=()=>(this.pause(),this.off(ie,_),this.off(K,_),this.off("end",_),y=!0,{done:!0,value:void 0}),M=()=>{if(y)return _();let ee=this.read();return ee===null?_():{done:!1,value:ee}};return this.once("end",_),this.once(ie,_),this.once(K,_),{next:M,throw:_,return:_,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(y){if(this[K])return y?this.emit("error",y):this.emit(K),this;this[K]=!0,this[At]=!0,this[k].length=0,this[T]=0;let _=this;return typeof _.close=="function"&&!this[g]&&_.close(),y?this.emit("error",y):this.emit(K),this}static get isStream(){return e.isStream}};e.Minipass=se}),E2t=ii(e=>{"use strict";var t=e&&e.__createBinding||(Object.create?(function(y,_,M,ee){ee===void 0&&(ee=M);var he=Object.getOwnPropertyDescriptor(_,M);(!he||("get"in he?!_.__esModule:he.writable||he.configurable))&&(he={enumerable:!0,get:function(){return _[M]}}),Object.defineProperty(y,ee,he)}):(function(y,_,M,ee){ee===void 0&&(ee=M),y[ee]=_[M]})),r=e&&e.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),n=e&&e.__importStar||function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var M in y)M!=="default"&&Object.prototype.hasOwnProperty.call(y,M)&&t(_,y,M);return r(_,y),_};Object.defineProperty(e,"__esModule",{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;var i=b2t(),s=require("node:path"),o=require("node:url"),a=require("fs"),c=n(require("node:fs")),u=a.realpathSync.native,l=require("node:fs/promises"),d=kbe(),f={lstatSync:a.lstatSync,readdir:a.readdir,readdirSync:a.readdirSync,readlinkSync:a.readlinkSync,realpathSync:u,promises:{lstat:l.lstat,readdir:l.readdir,readlink:l.readlink,realpath:l.realpath}},A=y=>!y||y===f||y===c?f:{...f,...y,promises:{...f.promises,...y.promises||{}}},g=/^\\\\\?\\([a-z]:)\\?$/i,h=y=>y.replace(/\//g,"\\").replace(g,"$1\\"),m=/[\\\/]/,I=0,C=1,b=2,S=4,R=6,Q=8,k=10,v=12,T=15,H=~T,N=16,Y=32,K=64,ie=128,Z=256,O=512,ne=K|ie|O,te=1023,Ce=y=>y.isFile()?Q:y.isDirectory()?S:y.isSymbolicLink()?k:y.isCharacterDevice()?b:y.isBlockDevice()?R:y.isSocket()?v:y.isFIFO()?C:I,qe=new i.LRUCache({max:2**12}),it=y=>{let _=qe.get(y);if(_)return _;let M=y.normalize("NFKD");return qe.set(y,M),M},Ue=new i.LRUCache({max:2**12}),At=y=>{let _=Ue.get(y);if(_)return _;let M=it(y.toLowerCase());return Ue.set(y,M),M},Qt=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=Qt;var tr=class extends i.LRUCache{constructor(y=16*1024){super({maxSize:y,sizeCalculation:_=>_.length+1})}};e.ChildrenCache=tr;var x=Symbol("PathScurry setAsCwd"),w=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#s;get gid(){return this.#s}#l;get rdev(){return this.#l}#a;get blksize(){return this.#a}#o;get ino(){return this.#o}#d;get size(){return this.#d}#A;get blocks(){return this.#A}#f;get atimeMs(){return this.#f}#u;get mtimeMs(){return this.#u}#h;get ctimeMs(){return this.#h}#y;get birthtimeMs(){return this.#y}#I;get atime(){return this.#I}#p;get mtime(){return this.#p}#w;get ctime(){return this.#w}#C;get birthtime(){return this.#C}#B;#S;#m;#b;#E;#_;#c;#k;#N;#x;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(y,_=I,M,ee,he,ke,we){this.name=y,this.#B=he?At(y):it(y),this.#c=_&te,this.nocase=he,this.roots=ee,this.root=M||this,this.#k=ke,this.#m=we.fullpath,this.#E=we.relative,this.#_=we.relativePosix,this.parent=we.parent,this.parent?this.#e=this.parent.#e:this.#e=A(we.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#k}resolve(y){if(!y)return this;let _=this.getRootString(y),M=y.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#T(M):this.#T(M)}#T(y){let _=this;for(let M of y)_=_.child(M);return _}children(){let y=this.#k.get(this);if(y)return y;let _=Object.assign([],{provisional:0});return this.#k.set(this,_),this.#c&=~N,_}child(y,_){if(y===""||y===".")return this;if(y==="..")return this.parent||this;let M=this.children(),ee=this.nocase?At(y):it(y);for(let Je of M)if(Je.#B===ee)return Je;let he=this.parent?this.sep:"",ke=this.#m?this.#m+he+y:void 0,we=this.newChild(y,I,{..._,parent:this,fullpath:ke});return this.canReaddir()||(we.#c|=ie),M.push(we),we}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let y=this.name,_=this.parent;if(!_)return this.#E=this.name;let M=_.relative();return M+(!M||!_.parent?"":this.sep)+y}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let y=this.name,_=this.parent;if(!_)return this.#_=this.fullpathPosix();let M=_.relativePosix();return M+(!M||!_.parent?"":"/")+y}fullpath(){if(this.#m!==void 0)return this.#m;let y=this.name,_=this.parent;if(!_)return this.#m=this.name;let M=_.fullpath()+(_.parent?this.sep:"")+y;return this.#m=M}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let ee=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(ee)?this.#b=`//?/${ee}`:this.#b=ee}let y=this.parent,_=y.fullpathPosix(),M=_+(!_||!y.parent?"":"/")+this.name;return this.#b=M}isUnknown(){return(this.#c&T)===I}isType(y){return this[`is${y}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#c&T)===Q}isDirectory(){return(this.#c&T)===S}isCharacterDevice(){return(this.#c&T)===b}isBlockDevice(){return(this.#c&T)===R}isFIFO(){return(this.#c&T)===C}isSocket(){return(this.#c&T)===v}isSymbolicLink(){return(this.#c&k)===k}lstatCached(){return this.#c&Y?this:void 0}readlinkCached(){return this.#N}realpathCached(){return this.#x}readdirCached(){let y=this.children();return y.slice(0,y.provisional)}canReadlink(){if(this.#N)return!0;if(!this.parent)return!1;let y=this.#c&T;return!(y!==I&&y!==k||this.#c&Z||this.#c&ie)}calledReaddir(){return!!(this.#c&N)}isENOENT(){return!!(this.#c&ie)}isNamed(y){return this.nocase?this.#B===At(y):this.#B===it(y)}async readlink(){let y=this.#N;if(y)return y;if(this.canReadlink()&&this.parent)try{let _=await this.#e.promises.readlink(this.fullpath()),M=(await this.parent.realpath())?.resolve(_);if(M)return this.#N=M}catch(_){this.#Q(_.code);return}}readlinkSync(){let y=this.#N;if(y)return y;if(this.canReadlink()&&this.parent)try{let _=this.#e.readlinkSync(this.fullpath()),M=this.parent.realpathSync()?.resolve(_);if(M)return this.#N=M}catch(_){this.#Q(_.code);return}}#U(y){this.#c|=N;for(let _=y.provisional;_<y.length;_++){let M=y[_];M&&M.#v()}}#v(){this.#c&ie||(this.#c=(this.#c|ie)&H,this.#H())}#H(){let y=this.children();y.provisional=0;for(let _ of y)_.#v()}#Z(){this.#c|=O,this.#F()}#F(){if(this.#c&K)return;let y=this.#c;(y&T)===S&&(y&=H),this.#c=y|K,this.#H()}#O(y=""){y==="ENOTDIR"||y==="EPERM"?this.#F():y==="ENOENT"?this.#v():this.children().provisional=0}#D(y=""){y==="ENOTDIR"?this.parent.#F():y==="ENOENT"&&this.#v()}#Q(y=""){let _=this.#c;_|=Z,y==="ENOENT"&&(_|=ie),(y==="EINVAL"||y==="UNKNOWN")&&(_&=H),this.#c=_,y==="ENOTDIR"&&this.parent&&this.parent.#F()}#M(y,_){return this.#W(y,_)||this.#L(y,_)}#L(y,_){let M=Ce(y),ee=this.newChild(y.name,M,{parent:this}),he=ee.#c&T;return he!==S&&he!==k&&he!==I&&(ee.#c|=K),_.unshift(ee),_.provisional++,ee}#W(y,_){for(let M=_.provisional;M<_.length;M++){let ee=_[M];if((this.nocase?At(y.name):it(y.name))===ee.#B)return this.#g(y,ee,M,_)}}#g(y,_,M,ee){let he=_.name;return _.#c=_.#c&H|Ce(y),he!==y.name&&(_.name=y.name),M!==ee.provisional&&(M===ee.length-1?ee.pop():ee.splice(M,1),ee.unshift(_)),ee.provisional++,_}async lstat(){if((this.#c&ie)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(y){this.#D(y.code)}}lstatSync(){if((this.#c&ie)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(y){this.#D(y.code)}}#V(y){let{atime:_,atimeMs:M,birthtime:ee,birthtimeMs:he,blksize:ke,blocks:we,ctime:Je,ctimeMs:vt,dev:Bt,gid:Nt,ino:rr,mode:Nr,mtime:Zr,mtimeMs:Ar,nlink:Xr,rdev:vn,size:$s,uid:li}=y;this.#I=_,this.#f=M,this.#C=ee,this.#y=he,this.#a=ke,this.#A=we,this.#w=Je,this.#h=vt,this.#t=Bt,this.#s=Nt,this.#o=rr,this.#r=Nr,this.#p=Zr,this.#u=Ar,this.#n=Xr,this.#l=vn,this.#d=$s,this.#i=li;let js=Ce(y);this.#c=this.#c&H|js|Y,js!==I&&js!==S&&js!==k&&(this.#c|=K)}#G=[];#R=!1;#P(y){this.#R=!1;let _=this.#G.slice();this.#G.length=0,_.forEach(M=>M(null,y))}readdirCB(y,_=!1){if(!this.canReaddir()){_?y(null,[]):queueMicrotask(()=>y(null,[]));return}let M=this.children();if(this.calledReaddir()){let he=M.slice(0,M.provisional);_?y(null,he):queueMicrotask(()=>y(null,he));return}if(this.#G.push(y),this.#R)return;this.#R=!0;let ee=this.fullpath();this.#e.readdir(ee,{withFileTypes:!0},(he,ke)=>{if(he)this.#O(he.code),M.provisional=0;else{for(let we of ke)this.#M(we,M);this.#U(M)}this.#P(M.slice(0,M.provisional))})}#Y;async readdir(){if(!this.canReaddir())return[];let y=this.children();if(this.calledReaddir())return y.slice(0,y.provisional);let _=this.fullpath();if(this.#Y)await this.#Y;else{let M=()=>{};this.#Y=new Promise(ee=>M=ee);try{for(let ee of await this.#e.promises.readdir(_,{withFileTypes:!0}))this.#M(ee,y);this.#U(y)}catch(ee){this.#O(ee.code),y.provisional=0}this.#Y=void 0,M()}return y.slice(0,y.provisional)}readdirSync(){if(!this.canReaddir())return[];let y=this.children();if(this.calledReaddir())return y.slice(0,y.provisional);let _=this.fullpath();try{for(let M of this.#e.readdirSync(_,{withFileTypes:!0}))this.#M(M,y);this.#U(y)}catch(M){this.#O(M.code),y.provisional=0}return y.slice(0,y.provisional)}canReaddir(){if(this.#c&ne)return!1;let y=T&this.#c;return y===I||y===S||y===k}shouldWalk(y,_){return(this.#c&S)===S&&!(this.#c&ne)&&!y.has(this)&&(!_||_(this))}async realpath(){if(this.#x)return this.#x;if(!((O|Z|ie)&this.#c))try{let y=await this.#e.promises.realpath(this.fullpath());return this.#x=this.resolve(y)}catch{this.#Z()}}realpathSync(){if(this.#x)return this.#x;if(!((O|Z|ie)&this.#c))try{let y=this.#e.realpathSync(this.fullpath());return this.#x=this.resolve(y)}catch{this.#Z()}}[x](y){if(y===this)return;y.isCWD=!1,this.isCWD=!0;let _=new Set([]),M=[],ee=this;for(;ee&&ee.parent;)_.add(ee),ee.#E=M.join(this.sep),ee.#_=M.join("/"),ee=ee.parent,M.push("..");for(ee=y;ee&&ee.parent&&!_.has(ee);)ee.#E=void 0,ee.#_=void 0,ee=ee.parent}};e.PathBase=w;var ue=class Fbe extends w{sep="\\";splitSep=m;constructor(_,M=I,ee,he,ke,we,Je){super(_,M,ee,he,ke,we,Je)}newChild(_,M=I,ee={}){return new Fbe(_,M,this.root,this.roots,this.nocase,this.childrenCache(),ee)}getRootString(_){return s.win32.parse(_).root}getRoot(_){if(_=h(_.toUpperCase()),_===this.root.name)return this.root;for(let[M,ee]of Object.entries(this.roots))if(this.sameRoot(_,M))return this.roots[_]=ee;return this.roots[_]=new U(_,this).root}sameRoot(_,M=this.root.name){return _=_.toUpperCase().replace(/\//g,"\\").replace(g,"$1\\"),_===M}};e.PathWin32=ue;var E=class Gbe extends w{splitSep="/";sep="/";constructor(_,M=I,ee,he,ke,we,Je){super(_,M,ee,he,ke,we,Je)}getRootString(_){return _.startsWith("/")?"/":""}getRoot(_){return this.root}newChild(_,M=I,ee={}){return new Gbe(_,M,this.root,this.roots,this.nocase,this.childrenCache(),ee)}};e.PathPosix=E;var W=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(y=process.cwd(),_,M,{nocase:ee,childrenCacheSize:he=16*1024,fs:ke=f}={}){this.#n=A(ke),(y instanceof URL||y.startsWith("file://"))&&(y=(0,o.fileURLToPath)(y));let we=_.resolve(y);this.roots=Object.create(null),this.rootPath=this.parseRootPath(we),this.#e=new Qt,this.#t=new Qt,this.#r=new tr(he);let Je=we.substring(this.rootPath.length).split(M);if(Je.length===1&&!Je[0]&&Je.pop(),ee===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=ee,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let vt=this.root,Bt=Je.length-1,Nt=_.sep,rr=this.rootPath,Nr=!1;for(let Zr of Je){let Ar=Bt--;vt=vt.child(Zr,{relative:new Array(Ar).fill("..").join(Nt),relativePosix:new Array(Ar).fill("..").join("/"),fullpath:rr+=(Nr?"":Nt)+Zr}),Nr=!0}this.cwd=vt}depth(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.depth()}childrenCache(){return this.#r}resolve(...y){let _="";for(let he=y.length-1;he>=0;he--){let ke=y[he];if(!(!ke||ke===".")&&(_=_?`${ke}/${_}`:ke,this.isAbsolute(ke)))break}let M=this.#e.get(_);if(M!==void 0)return M;let ee=this.cwd.resolve(_).fullpath();return this.#e.set(_,ee),ee}resolvePosix(...y){let _="";for(let he=y.length-1;he>=0;he--){let ke=y[he];if(!(!ke||ke===".")&&(_=_?`${ke}/${_}`:ke,this.isAbsolute(ke)))break}let M=this.#t.get(_);if(M!==void 0)return M;let ee=this.cwd.resolve(_).fullpathPosix();return this.#t.set(_,ee),ee}relative(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.relative()}relativePosix(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.relativePosix()}basename(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.name}dirname(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),(y.parent||y).fullpath()}async readdir(y=this.cwd,_={withFileTypes:!0}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M}=_;if(y.canReaddir()){let ee=await y.readdir();return M?ee:ee.map(he=>he.name)}else return[]}readdirSync(y=this.cwd,_={withFileTypes:!0}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0}=_;return y.canReaddir()?M?y.readdirSync():y.readdirSync().map(ee=>ee.name):[]}async lstat(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.lstat()}lstatSync(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.lstatSync()}async readlink(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=await y.readlink();return _?M:M?.fullpath()}readlinkSync(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=y.readlinkSync();return _?M:M?.fullpath()}async realpath(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=await y.realpath();return _?M:M?.fullpath()}realpathSync(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=y.realpathSync();return _?M:M?.fullpath()}async walk(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=[];(!he||he(y))&&we.push(M?y:y.fullpath());let Je=new Set,vt=(Nt,rr)=>{Je.add(Nt),Nt.readdirCB((Nr,Zr)=>{if(Nr)return rr(Nr);let Ar=Zr.length;if(!Ar)return rr();let Xr=()=>{--Ar===0&&rr()};for(let vn of Zr)(!he||he(vn))&&we.push(M?vn:vn.fullpath()),ee&&vn.isSymbolicLink()?vn.realpath().then($s=>$s?.isUnknown()?$s.lstat():$s).then($s=>$s?.shouldWalk(Je,ke)?vt($s,Xr):Xr()):vn.shouldWalk(Je,ke)?vt(vn,Xr):Xr()},!0)},Bt=y;return new Promise((Nt,rr)=>{vt(Bt,Nr=>{if(Nr)return rr(Nr);Nt(we)})})}walkSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=[];(!he||he(y))&&we.push(M?y:y.fullpath());let Je=new Set([y]);for(let vt of Je){let Bt=vt.readdirSync();for(let Nt of Bt){(!he||he(Nt))&&we.push(M?Nt:Nt.fullpath());let rr=Nt;if(Nt.isSymbolicLink()){if(!(ee&&(rr=Nt.realpathSync())))continue;rr.isUnknown()&&rr.lstatSync()}rr.shouldWalk(Je,ke)&&Je.add(rr)}}return we}[Symbol.asyncIterator](){return this.iterate()}iterate(y=this.cwd,_={}){return typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd),this.stream(y,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_;(!he||he(y))&&(yield M?y:y.fullpath());let we=new Set([y]);for(let Je of we){let vt=Je.readdirSync();for(let Bt of vt){(!he||he(Bt))&&(yield M?Bt:Bt.fullpath());let Nt=Bt;if(Bt.isSymbolicLink()){if(!(ee&&(Nt=Bt.realpathSync())))continue;Nt.isUnknown()&&Nt.lstatSync()}Nt.shouldWalk(we,ke)&&we.add(Nt)}}}stream(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=new d.Minipass({objectMode:!0});(!he||he(y))&&we.write(M?y:y.fullpath());let Je=new Set,vt=[y],Bt=0,Nt=()=>{let rr=!1;for(;!rr;){let Nr=vt.shift();if(!Nr){Bt===0&&we.end();return}Bt++,Je.add(Nr);let Zr=(Xr,vn,$s=!1)=>{if(Xr)return we.emit("error",Xr);if(ee&&!$s){let li=[];for(let js of vn)js.isSymbolicLink()&&li.push(js.realpath().then(fp=>fp?.isUnknown()?fp.lstat():fp));if(li.length){Promise.all(li).then(()=>Zr(null,vn,!0));return}}for(let li of vn)li&&(!he||he(li))&&(we.write(M?li:li.fullpath())||(rr=!0));Bt--;for(let li of vn){let js=li.realpathCached()||li;js.shouldWalk(Je,ke)&&vt.push(js)}rr&&!we.flowing?we.once("drain",Nt):Ar||Nt()},Ar=!0;Nr.readdirCB(Zr,!0),Ar=!1}};return Nt(),we}streamSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=new d.Minipass({objectMode:!0}),Je=new Set;(!he||he(y))&&we.write(M?y:y.fullpath());let vt=[y],Bt=0,Nt=()=>{let rr=!1;for(;!rr;){let Nr=vt.shift();if(!Nr){Bt===0&&we.end();return}Bt++,Je.add(Nr);let Zr=Nr.readdirSync();for(let Ar of Zr)(!he||he(Ar))&&(we.write(M?Ar:Ar.fullpath())||(rr=!0));Bt--;for(let Ar of Zr){let Xr=Ar;if(Ar.isSymbolicLink()){if(!(ee&&(Xr=Ar.realpathSync())))continue;Xr.isUnknown()&&Xr.lstatSync()}Xr.shouldWalk(Je,ke)&&vt.push(Xr)}}rr&&!we.flowing&&we.once("drain",Nt)};return Nt(),we}chdir(y=this.cwd){let _=this.cwd;this.cwd=typeof y=="string"?this.cwd.resolve(y):y,this.cwd[x](_)}};e.PathScurryBase=W;var U=class extends W{sep="\\";constructor(y=process.cwd(),_={}){let{nocase:M=!0}=_;super(y,s.win32,"\\",{..._,nocase:M}),this.nocase=M;for(let ee=this.cwd;ee;ee=ee.parent)ee.nocase=this.nocase}parseRootPath(y){return s.win32.parse(y).root.toUpperCase()}newRoot(y){return new ue(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:y})}isAbsolute(y){return y.startsWith("/")||y.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(y)}};e.PathScurryWin32=U;var $=class extends W{sep="/";constructor(y=process.cwd(),_={}){let{nocase:M=!1}=_;super(y,s.posix,"/",{..._,nocase:M}),this.nocase=M}parseRootPath(y){return"/"}newRoot(y){return new E(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:y})}isAbsolute(y){return y.startsWith("/")}};e.PathScurryPosix=$;var se=class extends ${constructor(y=process.cwd(),_={}){let{nocase:M=!0}=_;super(y,{..._,nocase:M})}};e.PathScurryDarwin=se,e.Path=process.platform==="win32"?ue:E,e.PathScurry=process.platform==="win32"?U:process.platform==="darwin"?se:$}),Zbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pattern=void 0;var t=Dg(),r=o=>o.length>=1,n=o=>o.length>=1,i=Symbol.for("nodejs.util.inspect.custom"),s=class Ube{#e;#t;#r;length;#n;#i;#s;#l;#a;#o;#d=!0;constructor(a,c,u,l){if(!r(a))throw new TypeError("empty pattern list");if(!n(c))throw new TypeError("empty glob list");if(c.length!==a.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=a.length,u<0||u>=this.length)throw new TypeError("index out of range");if(this.#e=a,this.#t=c,this.#r=u,this.#n=l,this.#r===0){if(this.isUNC()){let[d,f,A,g,...h]=this.#e,[m,I,C,b,...S]=this.#t;h[0]===""&&(h.shift(),S.shift());let R=[d,f,A,g,""].join("/"),Q=[m,I,C,b,""].join("/");this.#e=[R,...h],this.#t=[Q,...S],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[d,...f]=this.#e,[A,...g]=this.#t;f[0]===""&&(f.shift(),g.shift());let h=d+"/",m=A+"/";this.#e=[h,...f],this.#t=[m,...g],this.length=this.#e.length}}}[i](){return"Pattern <"+this.#t.slice(this.#r).join("/")+">"}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===t.GLOBSTAR}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#s=this.#s||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new Ube(this.#e,this.#t,this.#r+1,this.#n),this.#i.#o=this.#o,this.#i.#a=this.#a,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let a=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&a[0]===""&&a[1]===""&&typeof a[2]=="string"&&!!a[2]&&typeof a[3]=="string"&&!!a[3]}isDrive(){let a=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof a[0]=="string"&&/^[a-z]:$/i.test(a[0])}isAbsolute(){let a=this.#e;return this.#o!==void 0?this.#o:this.#o=a[0]===""&&a.length>1||this.isDrive()||this.isUNC()}root(){let a=this.#e[0];return typeof a=="string"&&this.isAbsolute()&&this.#r===0?a:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}};e.Pattern=s}),Obe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ignore=void 0;var t=Dg(),r=Zbe(),n=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",i=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:o,nocase:a,noext:c,noglobstar:u,platform:l=n}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=l,this.mmopts={dot:!0,nobrace:o,nocase:a,noext:c,noglobstar:u,optimizationLevel:2,platform:l,nocomment:!0,nonegate:!0};for(let d of s)this.add(d)}add(s){let o=new t.Minimatch(s,this.mmopts);for(let a=0;a<o.set.length;a++){let c=o.set[a],u=o.globParts[a];if(!c||!u)throw new Error("invalid pattern object");for(;c[0]==="."&&u[0]===".";)c.shift(),u.shift();let l=new r.Pattern(c,u,0,this.platform),d=new t.Minimatch(l.globString(),this.mmopts),f=u[u.length-1]==="**",A=l.isAbsolute();A?this.absolute.push(d):this.relative.push(d),f&&(A?this.absoluteChildren.push(d):this.relativeChildren.push(d))}}ignored(s){let o=s.fullpath(),a=`${o}/`,c=s.relative()||".",u=`${c}/`;for(let l of this.relative)if(l.match(c)||l.match(u))return!0;for(let l of this.absolute)if(l.match(o)||l.match(a))return!0;return!1}childrenIgnored(s){let o=s.fullpath()+"/",a=(s.relative()||".")+"/";for(let c of this.relativeChildren)if(c.match(a))return!0;for(let c of this.absoluteChildren)if(c.match(o))return!0;return!1}};e.Ignore=i}),B2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;var t=Dg(),r=class Mbe{store;constructor(a=new Map){this.store=a}copy(){return new Mbe(new Map(this.store))}hasWalked(a,c){return this.store.get(a.fullpath())?.has(c.globString())}storeWalked(a,c){let u=a.fullpath(),l=this.store.get(u);l?l.add(c.globString()):this.store.set(u,new Set([c.globString()]))}};e.HasWalkedCache=r;var n=class{store=new Map;add(o,a,c){let u=(a?2:0)|(c?1:0),l=this.store.get(o);this.store.set(o,l===void 0?u:u&l)}entries(){return[...this.store.entries()].map(([o,a])=>[o,!!(a&2),!!(a&1)])}};e.MatchRecord=n;var i=class{store=new Map;add(o,a){if(!o.canReaddir())return;let c=this.store.get(o);c?c.find(u=>u.globString()===a.globString())||c.push(a):this.store.set(o,[a])}get(o){let a=this.store.get(o);if(!a)throw new Error("attempting to walk unknown path");return a}entries(){return this.keys().map(o=>[o,this.store.get(o)])}keys(){return[...this.store.keys()].filter(o=>o.canReaddir())}};e.SubWalks=i;var s=class Lbe{hasWalkedCache;matches=new n;subwalks=new i;patterns;follow;dot;opts;constructor(a,c){this.opts=a,this.follow=!!a.follow,this.dot=!!a.dot,this.hasWalkedCache=c?c.copy():new r}processPatterns(a,c){this.patterns=c;let u=c.map(l=>[a,l]);for(let[l,d]of u){this.hasWalkedCache.storeWalked(l,d);let f=d.root(),A=d.isAbsolute()&&this.opts.absolute!==!1;if(f){l=l.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let I=d.rest();if(I)d=I;else{this.matches.add(l,!0,!1);continue}}if(l.isENOENT())continue;let g,h,m=!1;for(;typeof(g=d.pattern())=="string"&&(h=d.rest());)l=l.resolve(g),d=h,m=!0;if(g=d.pattern(),h=d.rest(),m){if(this.hasWalkedCache.hasWalked(l,d))continue;this.hasWalkedCache.storeWalked(l,d)}if(typeof g=="string"){let I=g===".."||g===""||g===".";this.matches.add(l.resolve(g),A,I);continue}else if(g===t.GLOBSTAR){(!l.isSymbolicLink()||this.follow||d.checkFollowGlobstar())&&this.subwalks.add(l,d);let I=h?.pattern(),C=h?.rest();if(!h||(I===""||I===".")&&!C)this.matches.add(l,A,I===""||I===".");else if(I===".."){let b=l.parent||l;C?this.hasWalkedCache.hasWalked(b,C)||this.subwalks.add(b,C):this.matches.add(b,A,!0)}}else g instanceof RegExp&&this.subwalks.add(l,d)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Lbe(this.opts,this.hasWalkedCache)}filterEntries(a,c){let u=this.subwalks.get(a),l=this.child();for(let d of c)for(let f of u){let A=f.isAbsolute(),g=f.pattern(),h=f.rest();g===t.GLOBSTAR?l.testGlobstar(d,f,h,A):g instanceof RegExp?l.testRegExp(d,g,h,A):l.testString(d,g,h,A)}return l}testGlobstar(a,c,u,l){if((this.dot||!a.name.startsWith("."))&&(c.hasMore()||this.matches.add(a,l,!1),a.canReaddir()&&(this.follow||!a.isSymbolicLink()?this.subwalks.add(a,c):a.isSymbolicLink()&&(u&&c.checkFollowGlobstar()?this.subwalks.add(a,u):c.markFollowGlobstar()&&this.subwalks.add(a,c)))),u){let d=u.pattern();if(typeof d=="string"&&d!==".."&&d!==""&&d!==".")this.testString(a,d,u.rest(),l);else if(d===".."){let f=a.parent||a;this.subwalks.add(f,u)}else d instanceof RegExp&&this.testRegExp(a,d,u.rest(),l)}}testRegExp(a,c,u,l){c.test(a.name)&&(u?this.subwalks.add(a,u):this.matches.add(a,l,!1))}testString(a,c,u,l){a.isNamed(c)&&(u?this.subwalks.add(a,u):this.matches.add(a,l,!1))}};e.Processor=s}),v2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;var t=kbe(),r=Obe(),n=B2t(),i=(c,u)=>typeof c=="string"?new r.Ignore([c],u):Array.isArray(c)?new r.Ignore(c,u):c,s=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(c,u,l){if(this.patterns=c,this.path=u,this.opts=l,this.#r=!l.posix&&l.platform==="win32"?"\\":"/",this.includeChildMatches=l.includeChildMatches!==!1,(l.ignore||!this.includeChildMatches)&&(this.#t=i(l.ignore??[],l),!this.includeChildMatches&&typeof this.#t.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=l.maxDepth||1/0,l.signal&&(this.signal=l.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(c){return this.seen.has(c)||!!this.#t?.ignored?.(c)}#i(c){return!!this.#t?.childrenIgnored?.(c)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let c;for(;!this.paused&&(c=this.#e.shift());)c()}onResume(c){this.signal?.aborted||(this.paused?this.#e.push(c):c())}async matchCheck(c,u){if(u&&this.opts.nodir)return;let l;if(this.opts.realpath){if(l=c.realpathCached()||await c.realpath(),!l)return;c=l}let d=c.isUnknown()||this.opts.stat?await c.lstat():c;if(this.opts.follow&&this.opts.nodir&&d?.isSymbolicLink()){let f=await d.realpath();f&&(f.isUnknown()||this.opts.stat)&&await f.lstat()}return this.matchCheckTest(d,u)}matchCheckTest(c,u){return c&&(this.maxDepth===1/0||c.depth()<=this.maxDepth)&&(!u||c.canReaddir())&&(!this.opts.nodir||!c.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!c.isSymbolicLink()||!c.realpathCached()?.isDirectory())&&!this.#n(c)?c:void 0}matchCheckSync(c,u){if(u&&this.opts.nodir)return;let l;if(this.opts.realpath){if(l=c.realpathCached()||c.realpathSync(),!l)return;c=l}let d=c.isUnknown()||this.opts.stat?c.lstatSync():c;if(this.opts.follow&&this.opts.nodir&&d?.isSymbolicLink()){let f=d.realpathSync();f&&(f?.isUnknown()||this.opts.stat)&&f.lstatSync()}return this.matchCheckTest(d,u)}matchFinish(c,u){if(this.#n(c))return;if(!this.includeChildMatches&&this.#t?.add){let f=`${c.relativePosix()}/**`;this.#t.add(f)}let l=this.opts.absolute===void 0?u:this.opts.absolute;this.seen.add(c);let d=this.opts.mark&&c.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(c);else if(l){let f=this.opts.posix?c.fullpathPosix():c.fullpath();this.matchEmit(f+d)}else{let f=this.opts.posix?c.relativePosix():c.relative(),A=this.opts.dotRelative&&!f.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(f?A+f+d:"."+d)}}async match(c,u,l){let d=await this.matchCheck(c,l);d&&this.matchFinish(d,u)}matchSync(c,u,l){let d=this.matchCheckSync(c,l);d&&this.matchFinish(d,u)}walkCB(c,u,l){this.signal?.aborted&&l(),this.walkCB2(c,u,new n.Processor(this.opts),l)}walkCB2(c,u,l,d){if(this.#i(c))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(c,u,l,d));return}l.processPatterns(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||(f++,this.match(g,h,m).then(()=>A()));for(let g of l.subwalkTargets()){if(this.maxDepth!==1/0&&g.depth()>=this.maxDepth)continue;f++;let h=g.readdirCached();g.calledReaddir()?this.walkCB3(g,h,l,A):g.readdirCB((m,I)=>this.walkCB3(g,I,l,A),!0)}A()}walkCB3(c,u,l,d){l=l.filterEntries(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||(f++,this.match(g,h,m).then(()=>A()));for(let[g,h]of l.subwalks.entries())f++,this.walkCB2(g,h,l.child(),A);A()}walkCBSync(c,u,l){this.signal?.aborted&&l(),this.walkCB2Sync(c,u,new n.Processor(this.opts),l)}walkCB2Sync(c,u,l,d){if(this.#i(c))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(c,u,l,d));return}l.processPatterns(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||this.matchSync(g,h,m);for(let g of l.subwalkTargets()){if(this.maxDepth!==1/0&&g.depth()>=this.maxDepth)continue;f++;let h=g.readdirSync();this.walkCB3Sync(g,h,l,A)}A()}walkCB3Sync(c,u,l,d){l=l.filterEntries(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||this.matchSync(g,h,m);for(let[g,h]of l.subwalks.entries())f++,this.walkCB2Sync(g,h,l.child(),A);A()}};e.GlobUtil=s;var o=class extends s{matches=new Set;constructor(c,u,l){super(c,u,l)}matchEmit(c){this.matches.add(c)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((c,u)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?u(this.signal.reason):c(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};e.GlobWalker=o;var a=class extends s{results;constructor(c,u,l){super(c,u,l),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(c){this.results.write(c),this.results.flowing||this.pause()}stream(){let c=this.path;return c.isUnknown()?c.lstat().then(()=>{this.walkCB(c,this.patterns,()=>this.results.end())}):this.walkCB(c,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};e.GlobStream=a}),Wbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Glob=void 0;var t=Dg(),r=require("node:url"),n=E2t(),i=Zbe(),s=v2t(),o=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",a=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(c,u){if(!u)throw new TypeError("glob options required");if(this.withFileTypes=!!u.withFileTypes,this.signal=u.signal,this.follow=!!u.follow,this.dot=!!u.dot,this.dotRelative=!!u.dotRelative,this.nodir=!!u.nodir,this.mark=!!u.mark,u.cwd?(u.cwd instanceof URL||u.cwd.startsWith("file://"))&&(u.cwd=(0,r.fileURLToPath)(u.cwd)):this.cwd="",this.cwd=u.cwd||"",this.root=u.root,this.magicalBraces=!!u.magicalBraces,this.nobrace=!!u.nobrace,this.noext=!!u.noext,this.realpath=!!u.realpath,this.absolute=u.absolute,this.includeChildMatches=u.includeChildMatches!==!1,this.noglobstar=!!u.noglobstar,this.matchBase=!!u.matchBase,this.maxDepth=typeof u.maxDepth=="number"?u.maxDepth:1/0,this.stat=!!u.stat,this.ignore=u.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof c=="string"&&(c=[c]),this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(c=c.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(u.noglobstar)throw new TypeError("base matching requires globstar");c=c.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=c,this.platform=u.platform||o,this.opts={...u,platform:this.platform},u.scurry){if(this.scurry=u.scurry,u.nocase!==void 0&&u.nocase!==u.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=u.platform==="win32"?n.PathScurryWin32:u.platform==="darwin"?n.PathScurryDarwin:u.platform?n.PathScurryPosix:n.PathScurry;this.scurry=new h(this.cwd,{nocase:u.nocase,fs:u.fs})}this.nocase=this.scurry.nocase;let l=this.platform==="darwin"||this.platform==="win32",d={braceExpandMax:1e4,...u,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:l,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},f=this.pattern.map(h=>new t.Minimatch(h,d)),[A,g]=f.reduce((h,m)=>(h[0].push(...m.set),h[1].push(...m.globParts),h),[[],[]]);this.patterns=A.map((h,m)=>{let I=g[m];if(!I)throw new Error("invalid pattern object");return new i.Pattern(h,I,0,this.platform)})}async walk(){return[...await new s.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new s.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new s.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new s.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};e.Glob=a}),Vbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMagic=void 0;var t=Dg(),r=(n,i={})=>{Array.isArray(n)||(n=[n]);for(let s of n)if(new t.Minimatch(s,i).hasMagic())return!0;return!1};e.hasMagic=r});Object.defineProperty(Tt,"__esModule",{value:!0});Tt.glob=Tt.sync=Tt.iterate=Tt.iterateSync=Tt.stream=Tt.streamSync=Tt.Ignore=Tt.hasMagic=Tt.Glob=Tt.unescape=Tt.escape=void 0;Tt.globStreamSync=GB;Tt.globStream=EY;Tt.globSync=BY;Tt.globIterateSync=ZB;Tt.globIterate=vY;var Qbe=Dg(),Qg=Wbe(),S2t=Vbe(),Hbe=Dg();Object.defineProperty(Tt,"escape",{enumerable:!0,get:function(){return Hbe.escape}});Object.defineProperty(Tt,"unescape",{enumerable:!0,get:function(){return Hbe.unescape}});var w2t=Wbe();Object.defineProperty(Tt,"Glob",{enumerable:!0,get:function(){return w2t.Glob}});var _2t=Vbe();Object.defineProperty(Tt,"hasMagic",{enumerable:!0,get:function(){return _2t.hasMagic}});var x2t=Obe();Object.defineProperty(Tt,"Ignore",{enumerable:!0,get:function(){return x2t.Ignore}});function GB(e,t={}){return new Qg.Glob(e,t).streamSync()}function EY(e,t={}){return new Qg.Glob(e,t).stream()}function BY(e,t={}){return new Qg.Glob(e,t).walkSync()}async function Nbe(e,t={}){return new Qg.Glob(e,t).walk()}function ZB(e,t={}){return new Qg.Glob(e,t).iterateSync()}function vY(e,t={}){return new Qg.Glob(e,t).iterate()}Tt.streamSync=GB;Tt.stream=Object.assign(EY,{sync:GB});Tt.iterateSync=ZB;Tt.iterate=Object.assign(vY,{sync:ZB});Tt.sync=Object.assign(BY,{stream:GB,iterate:ZB});Tt.glob=Object.assign(Nbe,{glob:Nbe,globSync:BY,sync:Tt.sync,globStream:EY,stream:Tt.stream,globStreamSync:GB,streamSync:Tt.streamSync,globIterate:vY,iterate:Tt.iterate,globIterateSync:ZB,iterateSync:Tt.iterateSync,Glob:Qg.Glob,hasMagic:S2t.hasMagic,escape:Qbe.escape,unescape:Qbe.unescape});Tt.glob.glob=Tt.glob});var wY=p(Yi=>{"use strict";var R2t=Yi&&Yi.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),D2t=Yi&&Yi.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Ybe=Yi&&Yi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&R2t(t,e,r);return D2t(t,e),t};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.determineGoModuleName=Yi.ConstructsMaker=Yi.generateJsiiLanguage=void 0;var hr=Ybe(Br()),st=Ybe(require("path")),Q2t=fc(),HD=tt(),ir=tt(),oo=tt(),N2t=IY(),T2t=xbe(),$be=Pbe(),k2t=Qf(),F2t=require.resolve("jsii-pacmak/bin/jsii-pacmak"),G2t=require.resolve("jsii/bin/jsii");async function Z2t(e){let t=await(0,HD.exec)("npm",["pack","--dry-run","--json"],{cwd:e});return JSON.parse(t)[0].files.map(n=>n.path).filter(n=>!n.includes(".."))}async function jbe(e,t,r,n=[]){await(0,HD.mkdtemp)(async i=>{await e.save(i);let s=n.flatMap(m=>$be.glob.sync(m,{cwd:i}));await Promise.all(s.map(m=>hr.remove(st.join(i,m))));let o=["--silence-warnings","reserved-word"],a=t.entrypoint,c=st.join(st.dirname(a),st.basename(a,".ts")),u=t.moduleKey.replace(/\./g,"").replace(/\//g,""),l=t.deps,d={},f={};for(let m of l){let I=await hr.readJson(st.join(m,"package.json")),C=I.name,b=I.version,S=st.join(st.join(i,"node_modules"),C);await hr.mkdirp(S);for(let R of await Z2t(m)){let Q=st.join(m,R),k=st.join(S,R);await hr.mkdirp(st.dirname(k)),await hr.copy(Q,k,{dereference:!0})}C.startsWith("@types/")||(f[C]=b)}let A={name:u,version:"0.0.0",author:"generated@generated.com",main:`${c}.js`,types:`${c}.d.ts`,license:"UNLICENSED",repository:{url:"http://generated",type:"git"},jsii:{outdir:"dist",targets:d},dependencies:f,peerDependencies:f};t.exports&&(A.exports=t.exports),t.python&&(d.python={distName:"generated",module:t.python.moduleName}),t.java&&(d.java={package:t.java.package,maven:{groupId:"generated",artifactId:"generated"}}),t.csharp&&(d.dotnet={namespace:t.csharp.namespace,packageId:t.csharp.namespace}),t.golang&&(d.go={moduleName:t.golang.moduleName,packageName:t.golang.packageName}),await hr.writeFile(st.join(i,"package.json"),JSON.stringify(A,void 0,2));let g=(0,ir.logTimespan)("jsii");await(0,HD.exec)(G2t,o,{cwd:i}),g(),t.jsii&&await hr.copy(st.join(i,".jsii"),t.jsii.path);let h=(0,ir.logTimespan)("jsii-pacmak");if(await(0,HD.exec)(F2t,["--code-only"],{cwd:i}),h(),t.python){let m=t.python.moduleName.replace(/\./g,"/"),I=st.resolve(st.join(i,"dist/python/src",m)),C=st.join(t.python.outdir,m);await hr.move(I,C,{overwrite:!0})}if(t.java){let m=st.resolve(st.join(i,"dist/java/src/")),I=st.join(t.java.outdir,"src/"),C=t.java.package.replace(/\./g,"/");await hr.mkdirp(st.join(I,"main/java",C)),await hr.mkdirp(st.join(I,"main/resources",C)),await hr.copy(m,I,{overwrite:!1})}if(t.csharp){let m=t.csharp.namespace,I=st.resolve(st.join(i,"dist/dotnet/",m)),C=st.join(t.csharp.outdir,m);await hr.move(I,C,{overwrite:!0})}if(t.golang){let m=t.golang.packageName,I=st.resolve(st.join(i,"dist/go/",m)),C=st.join(t.golang.outdir,m);await hr.move(I,C,{overwrite:!0}),await hr.remove(st.join(C,"go.mod"))}["versions.json","constraints.json"].forEach(m=>{try{hr.copySync(st.resolve(i,m),st.resolve(r,m))}catch(I){ir.logger.debug(`Failed to copy ${m}: ${I}`)}})})}Yi.generateJsiiLanguage=jbe;var SY=class{constructor(t,r,n=async()=>{}){this.options=t,this.schemaCachePath=r,this.reportTelemetry=n,this.codeMakerOutdir=st.resolve(this.options.codeMakerOutput),hr.mkdirpSync(this.codeMakerOutdir),this.code=new Q2t.CodeMaker,this.versions={}}async generateTypescriptProvider(t,r){var n;let i=(0,ir.logTimespan)(`Generate Typescript for ${t.name}`),s=new N2t.TerraformProviderGenerator(this.code,r,{importExtension:(n=this.options.languageOptions)===null||n===void 0?void 0:n.importExtension});s.generate(t),this.versions={...this.versions,...s.versions},i()}async filterAlreadyGenerated(t){let r="{}";try{r=await hr.readFile(st.join(this.codeMakerOutdir,"constraints.json"),"utf8")}catch(s){return ir.logger.debug(`Could not find constraints.json file while filtering: ${s}. This means no providers were generated, so all constraints need to be generated.`),t}ir.logger.debug(`Found constraints.json file: ${r}`);let n={};try{n=JSON.parse(r)}catch(s){return ir.logger.info(`Could not parse constraints.json file while filtering: ${s}. Generating all constraints.`),t}if(ir.logger.debug(`Found previous constraints: ${JSON.stringify(n,null,2)}`),!n.providers||typeof n.providers!="object")return ir.logger.info(`Could not find providers in constraints.json file, generating all constraints. The constraints file was ${JSON.stringify(n,null,2)}`),t;if(n.cdktf!==oo.DISPLAY_VERSION)return ir.logger.info(`The CDKTN version has changed, generating all constraints. The previous version was ${n.cdktf}, the current version is ${oo.DISPLAY_VERSION}`),t;let i=t.filter(s=>{let o=n.providers[s.fqn]===s.version,a=!1;switch(this.options.targetLanguage){case oo.Language.TYPESCRIPT:a=hr.existsSync(st.join(this.codeMakerOutdir,"providers",s.name));break;case oo.Language.PYTHON:case oo.Language.JAVA:case oo.Language.CSHARP:a=hr.existsSync(st.join(this.codeMakerOutdir,s.name));break;case oo.Language.GO:a=hr.existsSync(st.join(this.codeMakerOutdir,s.namespace||"hashicorp",s.name));break}return!(o&&a)});return ir.logger.debug(`Constraints to generate: ${JSON.stringify(i,null,2)}`),i}async generateTypescriptModule(t,r){let n=(0,ir.logTimespan)(`Generate Typescript for ${t.name}`);t.spec=r,new T2t.ModuleGenerator(this.code,[t]),n()}async generateTypescript(t,r){var n;if(t.isModule){let i=(n=r.moduleSchema)===null||n===void 0?void 0:n[t.moduleKey];if(!i)throw ir.Errors.Internal(`Could not generate schema for module ${t.moduleKey}`);await this.generateTypescriptModule(t,i)}else if(t.isProvider){if(!r.providerSchema)throw ir.Errors.Internal("Could not generate schema for providers");await this.generateTypescriptProvider(t,r.providerSchema)}else throw new Error(`Unknown target type used to generate bindings: ${t.name}`)}updateVersionsFile(t){ir.logger.debug(`Updating versions file with generated versions ${JSON.stringify(this.versions,null,2)} with allowed constraints ${JSON.stringify(t,null,2)}`);let r="versions.json",n={};try{n=JSON.parse(hr.readFileSync(st.resolve(this.codeMakerOutdir,r),"utf8")),ir.logger.debug(`Read existing versions file: ${JSON.stringify(n,null,2)}`)}catch(s){ir.logger.debug(`Could not read versions file, this is expected if there are no pre-existing local providers: ${s}`)}let i=t.reduce((s,o)=>{let a=Object.entries(n).find(([c])=>c.endsWith(o.fqn));if(a){let[c,u]=a;return{...s,[c]:u}}return s},{});return ir.logger.debug(`Writing versions file (${r}): ${JSON.stringify(i,null,2)}`),this.code.openFile(r),this.code.line(JSON.stringify({...i,...this.versions},null,2)),this.code.closeFile(r),r}async removeFoldersThatShouldNotExist(t){if(ir.logger.debug(`Removing providers except for ${JSON.stringify(t,null,2)}`),!this.isJavascriptTarget)return;let r=[],n=st.resolve(this.codeMakerOutdir,"providers");try{r=await hr.readdir(n)}catch(s){ir.logger.debug(`Error listing files in providers folder '${n}': ${s}`)}return r.filter(s=>hr.statSync(st.resolve(this.codeMakerOutdir,"providers",s)).isDirectory()).forEach(s=>{t.some(a=>a.name===s)||(ir.logger.debug(`Removing folder ${s} from providers`),hr.removeSync(st.resolve(this.codeMakerOutdir,"providers",s)))})}emitConstraintsFile(t,r){let n="constraints.json",i={cdktf:oo.DISPLAY_VERSION,providers:t.sort((s,o)=>s.fqn.localeCompare(o.fqn)).reduce((s,o)=>({...s,[o.fqn]:o.version}),{})};return this.options.targetVersions&&(i.targetVersions=this.options.targetVersions),(r?.cli_name||r?.cli_version)&&(i.cli={name:r.cli_name,version:r.cli_version}),this.code.openFile(n),this.code.line(JSON.stringify(i,null,2)),this.code.closeFile(n),n}async generateJsiiLanguage(t){var r;let n=[st.dirname(require.resolve("@types/node/package.json")),st.dirname(require.resolve("constructs/package.json")),st.dirname(require.resolve("cdktn/package.json"))],i={entrypoint:t.fileName,deps:n,moduleKey:t.moduleKey,exports:t.isProvider?{".":{import:`./providers/${t.name}/index.js`,require:`./providers/${t.name}/lazy-index.js`}}:void 0};if(this.options.outputJsii&&(i.jsii={path:this.options.outputJsii}),this.isPythonTarget&&(i.python={outdir:this.codeMakerOutdir,moduleName:t.srcMakName}),this.isJavaTarget){if(this.options.codeMakerOutput.includes("/")||this.options.codeMakerOutput.includes("\\"))throw ir.Errors.Usage('When using Java the "codeMakerOutput" option in the cdktf.json must be the organization identifier for your project (e.g. com.my-company), not a path. The generated Java code will be placed in a subdirectory of the given directory. If you are migrating from a < 0.19 version of cdktf you want to change the codemakerOutput to "imports".');i.java={outdir:".",package:`${this.options.codeMakerOutput}.${t.srcMakName}`}}if(this.isCsharpTarget&&(i.csharp={outdir:this.codeMakerOutdir,namespace:t.srcMakName}),this.isGoTarget){let o=st.join(this.codeMakerOutdir,(r=t.namespace)!==null&&r!==void 0?r:"");i.golang={outdir:o,moduleName:await(0,Yi.determineGoModuleName)(o),packageName:t.srcMakName}}process.env.NODE_OPTIONS&&!process.env.NODE_OPTIONS.includes("--max-old-space-size")?ir.logger.warn(`found NODE_OPTIONS environment variable without a setting for --max-old-space-size.
87
+ >>> no match, partial?`,E,we,W,Je),we===M))}let Bt;if(typeof he=="string"?(Bt=ke===he,this.debug("string match",he,ke,Bt)):(Bt=he.test(ke),this.debug("pattern match",he,ke,Bt)),!Bt)return!1}if(y===M&&_===ee)return!0;if(y===M)return U;if(_===ee)return y===M-1&&E[y]==="";throw new Error("wtf?")}braceExpand(){return(0,e.braceExpand)(this.pattern,this.options)}parse(E){(0,r.assertValidPattern)(E);let W=this.options;if(E==="**")return e.GLOBSTAR;if(E==="")return"";let U,$=null;(U=E.match(I))?$=W.dot?b:C:(U=E.match(a))?$=(W.nocase?W.dot?d:l:W.dot?u:c)(U[1]):(U=E.match(S))?$=(W.nocase?W.dot?Q:R:W.dot?k:v)(U):(U=E.match(f))?$=W.dot?g:A:(U=E.match(h))&&($=m);let se=n.AST.fromGlob(E,this.options).toMMPattern();return $&&typeof se=="object"&&Reflect.defineProperty(se,"test",{value:$}),se}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let E=this.set;if(!E.length)return this.regexp=!1,this.regexp;let W=this.options,U=W.noglobstar?ie:W.dot?Z:O,$=new Set(W.nocase?["i"]:[]),se=E.map(M=>{let ee=M.map(ke=>{if(ke instanceof RegExp)for(let we of ke.flags.split(""))$.add(we);return typeof ke=="string"?Qt(ke):ke===e.GLOBSTAR?e.GLOBSTAR:ke._src});ee.forEach((ke,we)=>{let Je=ee[we+1],vt=ee[we-1];ke!==e.GLOBSTAR||vt===e.GLOBSTAR||(vt===void 0?Je!==void 0&&Je!==e.GLOBSTAR?ee[we+1]="(?:\\/|"+U+"\\/)?"+Je:ee[we]=U:Je===void 0?ee[we-1]=vt+"(?:\\/|\\/"+U+")?":Je!==e.GLOBSTAR&&(ee[we-1]=vt+"(?:\\/|\\/"+U+"\\/)"+Je,ee[we+1]=e.GLOBSTAR))});let he=ee.filter(ke=>ke!==e.GLOBSTAR);if(this.partial&&he.length>=1){let ke=[];for(let we=1;we<=he.length;we++)ke.push(he.slice(0,we).join("/"));return"(?:"+ke.join("|")+")"}return he.join("/")}).join("|"),[y,_]=E.length>1?["(?:",")"]:["",""];se="^"+y+se+_+"$",this.partial&&(se="^(?:\\/|"+y+se.slice(1,-1)+_+")$"),this.negate&&(se="^(?!"+se+").+$");try{this.regexp=new RegExp(se,[...$].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,W=this.partial){if(this.debug("match",E,this.pattern),this.comment)return!1;if(this.empty)return E==="";if(E==="/"&&W)return!0;let U=this.options;this.isWindows&&(E=E.split("\\").join("/"));let $=this.slashSplit(E);this.debug(this.pattern,"split",$);let se=this.set;this.debug(this.pattern,"set",se);let y=$[$.length-1];if(!y)for(let _=$.length-2;!y&&_>=0;_--)y=$[_];for(let _=0;_<se.length;_++){let M=se[_],ee=$;if(U.matchBase&&M.length===1&&(ee=[y]),this.matchOne(ee,M,W))return U.flipNegate?!0:!this.negate}return U.flipNegate?!1:this.negate}static defaults(E){return e.minimatch.defaults(E).Minimatch}};e.Minimatch=tr;var x=Rbe();Object.defineProperty(e,"AST",{enumerable:!0,get:function(){return x.AST}});var w=Dbe();Object.defineProperty(e,"escape",{enumerable:!0,get:function(){return w.escape}});var ue=bY();Object.defineProperty(e,"unescape",{enumerable:!0,get:function(){return ue.unescape}}),e.minimatch.AST=n.AST,e.minimatch.Minimatch=tr,e.minimatch.escape=i.escape,e.minimatch.unescape=s.unescape}),b2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,r=new Set,n=typeof process=="object"&&process?process:{},i=(A,g,h,m)=>{typeof n.emitWarning=="function"?n.emitWarning(A,g,h,m):console.error(`[${h}] ${g}: ${A}`)},s=globalThis.AbortController,o=globalThis.AbortSignal;if(typeof s>"u"){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(h,m){this._onabort.push(m)}},s=class{constructor(){g()}signal=new o;abort(h){if(!this.signal.aborted){this.signal.reason=h,this.signal.aborted=!0;for(let m of this.signal._onabort)m(h);this.signal.onabort?.(h)}}};let A=n.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",g=()=>{A&&(A=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",g))}}var a=A=>!r.has(A),c=A=>A&&A===Math.floor(A)&&A>0&&isFinite(A),u=A=>c(A)?A<=Math.pow(2,8)?Uint8Array:A<=Math.pow(2,16)?Uint16Array:A<=Math.pow(2,32)?Uint32Array:A<=Number.MAX_SAFE_INTEGER?l:null:null,l=class extends Array{constructor(A){super(A),this.fill(0)}},d=class FB{heap;length;static#e=!1;static create(g){let h=u(g);if(!h)return[];FB.#e=!0;let m=new FB(g,h);return FB.#e=!1,m}constructor(g,h){if(!FB.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new h(g),this.length=0}push(g){this.heap[this.length++]=g}pop(){return this.heap[--this.length]}},f=class Tbe{#e;#t;#r;#n;#i;#s;#l;#a;get perf(){return this.#a}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#d;#A;#f;#u;#h;#y;#I;#p;#w;#C;#B;#S;#m;#b;#E;#_;#c;#k;static unsafeExposeInternals(g){return{starts:g.#S,ttls:g.#m,autopurgeTimers:g.#b,sizes:g.#B,keyMap:g.#A,keyList:g.#f,valList:g.#u,next:g.#h,prev:g.#y,get head(){return g.#I},get tail(){return g.#p},free:g.#w,isBackgroundFetch:h=>g.#g(h),backgroundFetch:(h,m,I,C)=>g.#W(h,m,I,C),moveToTail:h=>g.#G(h),indexes:h=>g.#D(h),rindexes:h=>g.#Q(h),isStale:h=>g.#v(h)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#d}get size(){return this.#o}get fetchMethod(){return this.#s}get memoMethod(){return this.#l}get dispose(){return this.#r}get onInsert(){return this.#n}get disposeAfter(){return this.#i}constructor(g){let{max:h=0,ttl:m,ttlResolution:I=1,ttlAutopurge:C,updateAgeOnGet:b,updateAgeOnHas:S,allowStale:R,dispose:Q,onInsert:k,disposeAfter:v,noDisposeOnSet:T,noUpdateTTL:H,maxSize:N=0,maxEntrySize:Y=0,sizeCalculation:K,fetchMethod:ie,memoMethod:Z,noDeleteOnFetchRejection:O,noDeleteOnStaleGet:ne,allowStaleOnFetchRejection:te,allowStaleOnFetchAbort:Ce,ignoreFetchAbort:qe,perf:it}=g;if(it!==void 0&&typeof it?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#a=it??t,h!==0&&!c(h))throw new TypeError("max option must be a nonnegative integer");let Ue=h?u(h):Array;if(!Ue)throw new Error("invalid max value: "+h);if(this.#e=h,this.#t=N,this.maxEntrySize=Y||this.#t,this.sizeCalculation=K,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Z!==void 0&&typeof Z!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#l=Z,ie!==void 0&&typeof ie!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#s=ie,this.#_=!!ie,this.#A=new Map,this.#f=new Array(h).fill(void 0),this.#u=new Array(h).fill(void 0),this.#h=new Ue(h),this.#y=new Ue(h),this.#I=0,this.#p=0,this.#w=d.create(h),this.#o=0,this.#d=0,typeof Q=="function"&&(this.#r=Q),typeof k=="function"&&(this.#n=k),typeof v=="function"?(this.#i=v,this.#C=[]):(this.#i=void 0,this.#C=void 0),this.#E=!!this.#r,this.#k=!!this.#n,this.#c=!!this.#i,this.noDisposeOnSet=!!T,this.noUpdateTTL=!!H,this.noDeleteOnFetchRejection=!!O,this.allowStaleOnFetchRejection=!!te,this.allowStaleOnFetchAbort=!!Ce,this.ignoreFetchAbort=!!qe,this.maxEntrySize!==0){if(this.#t!==0&&!c(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!c(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#H()}if(this.allowStale=!!R,this.noDeleteOnStaleGet=!!ne,this.updateAgeOnGet=!!b,this.updateAgeOnHas=!!S,this.ttlResolution=c(I)||I===0?I:1,this.ttlAutopurge=!!C,this.ttl=m||0,this.ttl){if(!c(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#N()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let At="LRU_CACHE_UNBOUNDED";a(At)&&(r.add(At),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",At,Tbe))}}getRemainingTTL(g){return this.#A.has(g)?1/0:0}#N(){let g=new l(this.#e),h=new l(this.#e);this.#m=g,this.#S=h;let m=this.ttlAutopurge?new Array(this.#e):void 0;this.#b=m,this.#U=(b,S,R=this.#a.now())=>{if(h[b]=S!==0?R:0,g[b]=S,m?.[b]&&(clearTimeout(m[b]),m[b]=void 0),S!==0&&m){let Q=setTimeout(()=>{this.#v(b)&&this.#R(this.#f[b],"expire")},S+1);Q.unref&&Q.unref(),m[b]=Q}},this.#x=b=>{h[b]=g[b]!==0?this.#a.now():0},this.#T=(b,S)=>{if(g[S]){let R=g[S],Q=h[S];if(!R||!Q)return;b.ttl=R,b.start=Q,b.now=I||C();let k=b.now-Q;b.remainingTTL=R-k}};let I=0,C=()=>{let b=this.#a.now();if(this.ttlResolution>0){I=b;let S=setTimeout(()=>I=0,this.ttlResolution);S.unref&&S.unref()}return b};this.getRemainingTTL=b=>{let S=this.#A.get(b);if(S===void 0)return 0;let R=g[S],Q=h[S];if(!R||!Q)return 1/0;let k=(I||C())-Q;return R-k},this.#v=b=>{let S=h[b],R=g[b];return!!R&&!!S&&(I||C())-S>R}}#x=()=>{};#T=()=>{};#U=()=>{};#v=()=>!1;#H(){let g=new l(this.#e);this.#d=0,this.#B=g,this.#Z=h=>{this.#d-=g[h],g[h]=0},this.#O=(h,m,I,C)=>{if(this.#g(m))return 0;if(!c(I))if(C){if(typeof C!="function")throw new TypeError("sizeCalculation must be a function");if(I=C(m,h),!c(I))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return I},this.#F=(h,m,I)=>{if(g[h]=m,this.#t){let C=this.#t-g[h];for(;this.#d>C;)this.#L(!0)}this.#d+=g[h],I&&(I.entrySize=m,I.totalCalculatedSize=this.#d)}}#Z=g=>{};#F=(g,h,m)=>{};#O=(g,h,m,I)=>{if(m||I)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:g=this.allowStale}={}){if(this.#o)for(let h=this.#p;!(!this.#M(h)||((g||!this.#v(h))&&(yield h),h===this.#I));)h=this.#y[h]}*#Q({allowStale:g=this.allowStale}={}){if(this.#o)for(let h=this.#I;!(!this.#M(h)||((g||!this.#v(h))&&(yield h),h===this.#p));)h=this.#h[h]}#M(g){return g!==void 0&&this.#A.get(this.#f[g])===g}*entries(){for(let g of this.#D())this.#u[g]!==void 0&&this.#f[g]!==void 0&&!this.#g(this.#u[g])&&(yield[this.#f[g],this.#u[g]])}*rentries(){for(let g of this.#Q())this.#u[g]!==void 0&&this.#f[g]!==void 0&&!this.#g(this.#u[g])&&(yield[this.#f[g],this.#u[g]])}*keys(){for(let g of this.#D()){let h=this.#f[g];h!==void 0&&!this.#g(this.#u[g])&&(yield h)}}*rkeys(){for(let g of this.#Q()){let h=this.#f[g];h!==void 0&&!this.#g(this.#u[g])&&(yield h)}}*values(){for(let g of this.#D())this.#u[g]!==void 0&&!this.#g(this.#u[g])&&(yield this.#u[g])}*rvalues(){for(let g of this.#Q())this.#u[g]!==void 0&&!this.#g(this.#u[g])&&(yield this.#u[g])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(g,h={}){for(let m of this.#D()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;if(C!==void 0&&g(C,this.#f[m],this))return this.get(this.#f[m],h)}}forEach(g,h=this){for(let m of this.#D()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;C!==void 0&&g.call(h,C,this.#f[m],this)}}rforEach(g,h=this){for(let m of this.#Q()){let I=this.#u[m],C=this.#g(I)?I.__staleWhileFetching:I;C!==void 0&&g.call(h,C,this.#f[m],this)}}purgeStale(){let g=!1;for(let h of this.#Q({allowStale:!0}))this.#v(h)&&(this.#R(this.#f[h],"expire"),g=!0);return g}info(g){let h=this.#A.get(g);if(h===void 0)return;let m=this.#u[h],I=this.#g(m)?m.__staleWhileFetching:m;if(I===void 0)return;let C={value:I};if(this.#m&&this.#S){let b=this.#m[h],S=this.#S[h];if(b&&S){let R=b-(this.#a.now()-S);C.ttl=R,C.start=Date.now()}}return this.#B&&(C.size=this.#B[h]),C}dump(){let g=[];for(let h of this.#D({allowStale:!0})){let m=this.#f[h],I=this.#u[h],C=this.#g(I)?I.__staleWhileFetching:I;if(C===void 0||m===void 0)continue;let b={value:C};if(this.#m&&this.#S){b.ttl=this.#m[h];let S=this.#a.now()-this.#S[h];b.start=Math.floor(Date.now()-S)}this.#B&&(b.size=this.#B[h]),g.unshift([m,b])}return g}load(g){this.clear();for(let[h,m]of g){if(m.start){let I=Date.now()-m.start;m.start=this.#a.now()-I}this.set(h,m.value,m)}}set(g,h,m={}){if(h===void 0)return this.delete(g),this;let{ttl:I=this.ttl,start:C,noDisposeOnSet:b=this.noDisposeOnSet,sizeCalculation:S=this.sizeCalculation,status:R}=m,{noUpdateTTL:Q=this.noUpdateTTL}=m,k=this.#O(g,h,m.size||0,S);if(this.maxEntrySize&&k>this.maxEntrySize)return R&&(R.set="miss",R.maxEntrySizeExceeded=!0),this.#R(g,"set"),this;let v=this.#o===0?void 0:this.#A.get(g);if(v===void 0)v=this.#o===0?this.#p:this.#w.length!==0?this.#w.pop():this.#o===this.#e?this.#L(!1):this.#o,this.#f[v]=g,this.#u[v]=h,this.#A.set(g,v),this.#h[this.#p]=v,this.#y[v]=this.#p,this.#p=v,this.#o++,this.#F(v,k,R),R&&(R.set="add"),Q=!1,this.#k&&this.#n?.(h,g,"add");else{this.#G(v);let T=this.#u[v];if(h!==T){if(this.#_&&this.#g(T)){T.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:H}=T;H!==void 0&&!b&&(this.#E&&this.#r?.(H,g,"set"),this.#c&&this.#C?.push([H,g,"set"]))}else b||(this.#E&&this.#r?.(T,g,"set"),this.#c&&this.#C?.push([T,g,"set"]));if(this.#Z(v),this.#F(v,k,R),this.#u[v]=h,R){R.set="replace";let H=T&&this.#g(T)?T.__staleWhileFetching:T;H!==void 0&&(R.oldValue=H)}}else R&&(R.set="update");this.#k&&this.onInsert?.(h,g,h===T?"update":"replace")}if(I!==0&&!this.#m&&this.#N(),this.#m&&(Q||this.#U(v,I,C),R&&this.#T(R,v)),!b&&this.#c&&this.#C){let T=this.#C,H;for(;H=T?.shift();)this.#i?.(...H)}return this}pop(){try{for(;this.#o;){let g=this.#u[this.#I];if(this.#L(!0),this.#g(g)){if(g.__staleWhileFetching)return g.__staleWhileFetching}else if(g!==void 0)return g}}finally{if(this.#c&&this.#C){let g=this.#C,h;for(;h=g?.shift();)this.#i?.(...h)}}}#L(g){let h=this.#I,m=this.#f[h],I=this.#u[h];return this.#_&&this.#g(I)?I.__abortController.abort(new Error("evicted")):(this.#E||this.#c)&&(this.#E&&this.#r?.(I,m,"evict"),this.#c&&this.#C?.push([I,m,"evict"])),this.#Z(h),this.#b?.[h]&&(clearTimeout(this.#b[h]),this.#b[h]=void 0),g&&(this.#f[h]=void 0,this.#u[h]=void 0,this.#w.push(h)),this.#o===1?(this.#I=this.#p=0,this.#w.length=0):this.#I=this.#h[h],this.#A.delete(m),this.#o--,h}has(g,h={}){let{updateAgeOnHas:m=this.updateAgeOnHas,status:I}=h,C=this.#A.get(g);if(C!==void 0){let b=this.#u[C];if(this.#g(b)&&b.__staleWhileFetching===void 0)return!1;if(this.#v(C))I&&(I.has="stale",this.#T(I,C));else return m&&this.#x(C),I&&(I.has="hit",this.#T(I,C)),!0}else I&&(I.has="miss");return!1}peek(g,h={}){let{allowStale:m=this.allowStale}=h,I=this.#A.get(g);if(I===void 0||!m&&this.#v(I))return;let C=this.#u[I];return this.#g(C)?C.__staleWhileFetching:C}#W(g,h,m,I){let C=h===void 0?void 0:this.#u[h];if(this.#g(C))return C;let b=new s,{signal:S}=m;S?.addEventListener("abort",()=>b.abort(S.reason),{signal:b.signal});let R={signal:b.signal,options:m,context:I},Q=(Y,K=!1)=>{let{aborted:ie}=b.signal,Z=m.ignoreFetchAbort&&Y!==void 0,O=m.ignoreFetchAbort||!!(m.allowStaleOnFetchAbort&&Y!==void 0);if(m.status&&(ie&&!K?(m.status.fetchAborted=!0,m.status.fetchError=b.signal.reason,Z&&(m.status.fetchAbortIgnored=!0)):m.status.fetchResolved=!0),ie&&!Z&&!K)return v(b.signal.reason,O);let ne=H,te=this.#u[h];return(te===H||Z&&K&&te===void 0)&&(Y===void 0?ne.__staleWhileFetching!==void 0?this.#u[h]=ne.__staleWhileFetching:this.#R(g,"fetch"):(m.status&&(m.status.fetchUpdated=!0),this.set(g,Y,R.options))),Y},k=Y=>(m.status&&(m.status.fetchRejected=!0,m.status.fetchError=Y),v(Y,!1)),v=(Y,K)=>{let{aborted:ie}=b.signal,Z=ie&&m.allowStaleOnFetchAbort,O=Z||m.allowStaleOnFetchRejection,ne=O||m.noDeleteOnFetchRejection,te=H;if(this.#u[h]===H&&(!ne||!K&&te.__staleWhileFetching===void 0?this.#R(g,"fetch"):Z||(this.#u[h]=te.__staleWhileFetching)),O)return m.status&&te.__staleWhileFetching!==void 0&&(m.status.returnedStale=!0),te.__staleWhileFetching;if(te.__returned===te)throw Y},T=(Y,K)=>{let ie=this.#s?.(g,C,R);ie&&ie instanceof Promise&&ie.then(Z=>Y(Z===void 0?void 0:Z),K),b.signal.addEventListener("abort",()=>{(!m.ignoreFetchAbort||m.allowStaleOnFetchAbort)&&(Y(void 0),m.allowStaleOnFetchAbort&&(Y=Z=>Q(Z,!0)))})};m.status&&(m.status.fetchDispatched=!0);let H=new Promise(T).then(Q,k),N=Object.assign(H,{__abortController:b,__staleWhileFetching:C,__returned:void 0});return h===void 0?(this.set(g,N,{...R.options,status:void 0}),h=this.#A.get(g)):this.#u[h]=N,N}#g(g){if(!this.#_)return!1;let h=g;return!!h&&h instanceof Promise&&h.hasOwnProperty("__staleWhileFetching")&&h.__abortController instanceof s}async fetch(g,h={}){let{allowStale:m=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,ttl:b=this.ttl,noDisposeOnSet:S=this.noDisposeOnSet,size:R=0,sizeCalculation:Q=this.sizeCalculation,noUpdateTTL:k=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:T=this.allowStaleOnFetchRejection,ignoreFetchAbort:H=this.ignoreFetchAbort,allowStaleOnFetchAbort:N=this.allowStaleOnFetchAbort,context:Y,forceRefresh:K=!1,status:ie,signal:Z}=h;if(!this.#_)return ie&&(ie.fetch="get"),this.get(g,{allowStale:m,updateAgeOnGet:I,noDeleteOnStaleGet:C,status:ie});let O={allowStale:m,updateAgeOnGet:I,noDeleteOnStaleGet:C,ttl:b,noDisposeOnSet:S,size:R,sizeCalculation:Q,noUpdateTTL:k,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:N,ignoreFetchAbort:H,status:ie,signal:Z},ne=this.#A.get(g);if(ne===void 0){ie&&(ie.fetch="miss");let te=this.#W(g,ne,O,Y);return te.__returned=te}else{let te=this.#u[ne];if(this.#g(te)){let Ue=m&&te.__staleWhileFetching!==void 0;return ie&&(ie.fetch="inflight",Ue&&(ie.returnedStale=!0)),Ue?te.__staleWhileFetching:te.__returned=te}let Ce=this.#v(ne);if(!K&&!Ce)return ie&&(ie.fetch="hit"),this.#G(ne),I&&this.#x(ne),ie&&this.#T(ie,ne),te;let qe=this.#W(g,ne,O,Y),it=qe.__staleWhileFetching!==void 0&&m;return ie&&(ie.fetch=Ce?"stale":"refresh",it&&Ce&&(ie.returnedStale=!0)),it?qe.__staleWhileFetching:qe.__returned=qe}}async forceFetch(g,h={}){let m=await this.fetch(g,h);if(m===void 0)throw new Error("fetch() returned undefined");return m}memo(g,h={}){let m=this.#l;if(!m)throw new Error("no memoMethod provided to constructor");let{context:I,forceRefresh:C,...b}=h,S=this.get(g,b);if(!C&&S!==void 0)return S;let R=m(g,S,{options:b,context:I});return this.set(g,R,b),R}get(g,h={}){let{allowStale:m=this.allowStale,updateAgeOnGet:I=this.updateAgeOnGet,noDeleteOnStaleGet:C=this.noDeleteOnStaleGet,status:b}=h,S=this.#A.get(g);if(S!==void 0){let R=this.#u[S],Q=this.#g(R);return b&&this.#T(b,S),this.#v(S)?(b&&(b.get="stale"),Q?(b&&m&&R.__staleWhileFetching!==void 0&&(b.returnedStale=!0),m?R.__staleWhileFetching:void 0):(C||this.#R(g,"expire"),b&&m&&(b.returnedStale=!0),m?R:void 0)):(b&&(b.get="hit"),Q?R.__staleWhileFetching:(this.#G(S),I&&this.#x(S),R))}else b&&(b.get="miss")}#V(g,h){this.#y[h]=g,this.#h[g]=h}#G(g){g!==this.#p&&(g===this.#I?this.#I=this.#h[g]:this.#V(this.#y[g],this.#h[g]),this.#V(this.#p,g),this.#p=g)}delete(g){return this.#R(g,"delete")}#R(g,h){let m=!1;if(this.#o!==0){let I=this.#A.get(g);if(I!==void 0)if(this.#b?.[I]&&(clearTimeout(this.#b?.[I]),this.#b[I]=void 0),m=!0,this.#o===1)this.#P(h);else{this.#Z(I);let C=this.#u[I];if(this.#g(C)?C.__abortController.abort(new Error("deleted")):(this.#E||this.#c)&&(this.#E&&this.#r?.(C,g,h),this.#c&&this.#C?.push([C,g,h])),this.#A.delete(g),this.#f[I]=void 0,this.#u[I]=void 0,I===this.#p)this.#p=this.#y[I];else if(I===this.#I)this.#I=this.#h[I];else{let b=this.#y[I];this.#h[b]=this.#h[I];let S=this.#h[I];this.#y[S]=this.#y[I]}this.#o--,this.#w.push(I)}}if(this.#c&&this.#C?.length){let I=this.#C,C;for(;C=I?.shift();)this.#i?.(...C)}return m}clear(){return this.#P("delete")}#P(g){for(let h of this.#Q({allowStale:!0})){let m=this.#u[h];if(this.#g(m))m.__abortController.abort(new Error("deleted"));else{let I=this.#f[h];this.#E&&this.#r?.(m,I,g),this.#c&&this.#C?.push([m,I,g])}}if(this.#A.clear(),this.#u.fill(void 0),this.#f.fill(void 0),this.#m&&this.#S){this.#m.fill(0),this.#S.fill(0);for(let h of this.#b??[])h!==void 0&&clearTimeout(h);this.#b?.fill(void 0)}if(this.#B&&this.#B.fill(0),this.#I=0,this.#p=0,this.#w.length=0,this.#d=0,this.#o=0,this.#c&&this.#C){let h=this.#C,m;for(;m=h?.shift();)this.#i?.(...m)}}};e.LRUCache=f}),kbe=ii(e=>{"use strict";var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.Minipass=e.isWritable=e.isReadable=e.isStream=void 0;var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=require("node:events"),i=t(require("node:stream")),s=require("node:string_decoder"),o=y=>!!y&&typeof y=="object"&&(y instanceof se||y instanceof i.default||(0,e.isReadable)(y)||(0,e.isWritable)(y));e.isStream=o;var a=y=>!!y&&typeof y=="object"&&y instanceof n.EventEmitter&&typeof y.pipe=="function"&&y.pipe!==i.default.Writable.prototype.pipe;e.isReadable=a;var c=y=>!!y&&typeof y=="object"&&y instanceof n.EventEmitter&&typeof y.write=="function"&&typeof y.end=="function";e.isWritable=c;var u=Symbol("EOF"),l=Symbol("maybeEmitEnd"),d=Symbol("emittedEnd"),f=Symbol("emittingEnd"),A=Symbol("emittedError"),g=Symbol("closed"),h=Symbol("read"),m=Symbol("flush"),I=Symbol("flushChunk"),C=Symbol("encoding"),b=Symbol("decoder"),S=Symbol("flowing"),R=Symbol("paused"),Q=Symbol("resume"),k=Symbol("buffer"),v=Symbol("pipes"),T=Symbol("bufferLength"),H=Symbol("bufferPush"),N=Symbol("bufferShift"),Y=Symbol("objectMode"),K=Symbol("destroyed"),ie=Symbol("error"),Z=Symbol("emitData"),O=Symbol("emitEnd"),ne=Symbol("emitEnd2"),te=Symbol("async"),Ce=Symbol("abort"),qe=Symbol("aborted"),it=Symbol("signal"),Ue=Symbol("dataListeners"),At=Symbol("discarded"),Qt=y=>Promise.resolve().then(y),tr=y=>y(),x=y=>y==="end"||y==="finish"||y==="prefinish",w=y=>y instanceof ArrayBuffer||!!y&&typeof y=="object"&&y.constructor&&y.constructor.name==="ArrayBuffer"&&y.byteLength>=0,ue=y=>!Buffer.isBuffer(y)&&ArrayBuffer.isView(y),E=class{src;dest;opts;ondrain;constructor(y,_,M){this.src=y,this.dest=_,this.opts=M,this.ondrain=()=>y[Q](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(y){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},W=class extends E{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(y,_,M){super(y,_,M),this.proxyErrors=ee=>this.dest.emit("error",ee),y.on("error",this.proxyErrors)}},U=y=>!!y.objectMode,$=y=>!y.objectMode&&!!y.encoding&&y.encoding!=="buffer",se=class extends n.EventEmitter{[S]=!1;[R]=!1;[v]=[];[k]=[];[Y];[C];[te];[b];[u]=!1;[d]=!1;[f]=!1;[g]=!1;[A]=null;[T]=0;[K]=!1;[it];[qe]=!1;[Ue]=0;[At]=!1;writable=!0;readable=!0;constructor(...y){let _=y[0]||{};if(super(),_.objectMode&&typeof _.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");U(_)?(this[Y]=!0,this[C]=null):$(_)?(this[C]=_.encoding,this[Y]=!1):(this[Y]=!1,this[C]=null),this[te]=!!_.async,this[b]=this[C]?new s.StringDecoder(this[C]):null,_&&_.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[k]}),_&&_.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[v]});let{signal:M}=_;M&&(this[it]=M,M.aborted?this[Ce]():M.addEventListener("abort",()=>this[Ce]()))}get bufferLength(){return this[T]}get encoding(){return this[C]}set encoding(y){throw new Error("Encoding must be set at instantiation time")}setEncoding(y){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Y]}set objectMode(y){throw new Error("objectMode must be set at instantiation time")}get async(){return this[te]}set async(y){this[te]=this[te]||!!y}[Ce](){this[qe]=!0,this.emit("abort",this[it]?.reason),this.destroy(this[it]?.reason)}get aborted(){return this[qe]}set aborted(y){}write(y,_,M){if(this[qe])return!1;if(this[u])throw new Error("write after end");if(this[K])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof _=="function"&&(M=_,_="utf8"),_||(_="utf8");let ee=this[te]?Qt:tr;if(!this[Y]&&!Buffer.isBuffer(y)){if(ue(y))y=Buffer.from(y.buffer,y.byteOffset,y.byteLength);else if(w(y))y=Buffer.from(y);else if(typeof y!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Y]?(this[S]&&this[T]!==0&&this[m](!0),this[S]?this.emit("data",y):this[H](y),this[T]!==0&&this.emit("readable"),M&&ee(M),this[S]):y.length?(typeof y=="string"&&!(_===this[C]&&!this[b]?.lastNeed)&&(y=Buffer.from(y,_)),Buffer.isBuffer(y)&&this[C]&&(y=this[b].write(y)),this[S]&&this[T]!==0&&this[m](!0),this[S]?this.emit("data",y):this[H](y),this[T]!==0&&this.emit("readable"),M&&ee(M),this[S]):(this[T]!==0&&this.emit("readable"),M&&ee(M),this[S])}read(y){if(this[K])return null;if(this[At]=!1,this[T]===0||y===0||y&&y>this[T])return this[l](),null;this[Y]&&(y=null),this[k].length>1&&!this[Y]&&(this[k]=[this[C]?this[k].join(""):Buffer.concat(this[k],this[T])]);let _=this[h](y||null,this[k][0]);return this[l](),_}[h](y,_){if(this[Y])this[N]();else{let M=_;y===M.length||y===null?this[N]():typeof M=="string"?(this[k][0]=M.slice(y),_=M.slice(0,y),this[T]-=y):(this[k][0]=M.subarray(y),_=M.subarray(0,y),this[T]-=y)}return this.emit("data",_),!this[k].length&&!this[u]&&this.emit("drain"),_}end(y,_,M){return typeof y=="function"&&(M=y,y=void 0),typeof _=="function"&&(M=_,_="utf8"),y!==void 0&&this.write(y,_),M&&this.once("end",M),this[u]=!0,this.writable=!1,(this[S]||!this[R])&&this[l](),this}[Q](){this[K]||(!this[Ue]&&!this[v].length&&(this[At]=!0),this[R]=!1,this[S]=!0,this.emit("resume"),this[k].length?this[m]():this[u]?this[l]():this.emit("drain"))}resume(){return this[Q]()}pause(){this[S]=!1,this[R]=!0,this[At]=!1}get destroyed(){return this[K]}get flowing(){return this[S]}get paused(){return this[R]}[H](y){this[Y]?this[T]+=1:this[T]+=y.length,this[k].push(y)}[N](){return this[Y]?this[T]-=1:this[T]-=this[k][0].length,this[k].shift()}[m](y=!1){do;while(this[I](this[N]())&&this[k].length);!y&&!this[k].length&&!this[u]&&this.emit("drain")}[I](y){return this.emit("data",y),this[S]}pipe(y,_){if(this[K])return y;this[At]=!1;let M=this[d];return _=_||{},y===r.stdout||y===r.stderr?_.end=!1:_.end=_.end!==!1,_.proxyErrors=!!_.proxyErrors,M?_.end&&y.end():(this[v].push(_.proxyErrors?new W(this,y,_):new E(this,y,_)),this[te]?Qt(()=>this[Q]()):this[Q]()),y}unpipe(y){let _=this[v].find(M=>M.dest===y);_&&(this[v].length===1?(this[S]&&this[Ue]===0&&(this[S]=!1),this[v]=[]):this[v].splice(this[v].indexOf(_),1),_.unpipe())}addListener(y,_){return this.on(y,_)}on(y,_){let M=super.on(y,_);if(y==="data")this[At]=!1,this[Ue]++,!this[v].length&&!this[S]&&this[Q]();else if(y==="readable"&&this[T]!==0)super.emit("readable");else if(x(y)&&this[d])super.emit(y),this.removeAllListeners(y);else if(y==="error"&&this[A]){let ee=_;this[te]?Qt(()=>ee.call(this,this[A])):ee.call(this,this[A])}return M}removeListener(y,_){return this.off(y,_)}off(y,_){let M=super.off(y,_);return y==="data"&&(this[Ue]=this.listeners("data").length,this[Ue]===0&&!this[At]&&!this[v].length&&(this[S]=!1)),M}removeAllListeners(y){let _=super.removeAllListeners(y);return(y==="data"||y===void 0)&&(this[Ue]=0,!this[At]&&!this[v].length&&(this[S]=!1)),_}get emittedEnd(){return this[d]}[l](){!this[f]&&!this[d]&&!this[K]&&this[k].length===0&&this[u]&&(this[f]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[g]&&this.emit("close"),this[f]=!1)}emit(y,..._){let M=_[0];if(y!=="error"&&y!=="close"&&y!==K&&this[K])return!1;if(y==="data")return!this[Y]&&!M?!1:this[te]?(Qt(()=>this[Z](M)),!0):this[Z](M);if(y==="end")return this[O]();if(y==="close"){if(this[g]=!0,!this[d]&&!this[K])return!1;let he=super.emit("close");return this.removeAllListeners("close"),he}else if(y==="error"){this[A]=M,super.emit(ie,M);let he=!this[it]||this.listeners("error").length?super.emit("error",M):!1;return this[l](),he}else if(y==="resume"){let he=super.emit("resume");return this[l](),he}else if(y==="finish"||y==="prefinish"){let he=super.emit(y);return this.removeAllListeners(y),he}let ee=super.emit(y,..._);return this[l](),ee}[Z](y){for(let M of this[v])M.dest.write(y)===!1&&this.pause();let _=this[At]?!1:super.emit("data",y);return this[l](),_}[O](){return this[d]?!1:(this[d]=!0,this.readable=!1,this[te]?(Qt(()=>this[ne]()),!0):this[ne]())}[ne](){if(this[b]){let _=this[b].end();if(_){for(let M of this[v])M.dest.write(_);this[At]||super.emit("data",_)}}for(let _ of this[v])_.end();let y=super.emit("end");return this.removeAllListeners("end"),y}async collect(){let y=Object.assign([],{dataLength:0});this[Y]||(y.dataLength=0);let _=this.promise();return this.on("data",M=>{y.push(M),this[Y]||(y.dataLength+=M.length)}),await _,y}async concat(){if(this[Y])throw new Error("cannot concat in objectMode");let y=await this.collect();return this[C]?y.join(""):Buffer.concat(y,y.dataLength)}async promise(){return new Promise((y,_)=>{this.on(K,()=>_(new Error("stream destroyed"))),this.on("error",M=>_(M)),this.on("end",()=>y())})}[Symbol.asyncIterator](){this[At]=!1;let y=!1,_=async()=>(this.pause(),y=!0,{value:void 0,done:!0});return{next:()=>{if(y)return _();let M=this.read();if(M!==null)return Promise.resolve({done:!1,value:M});if(this[u])return _();let ee,he,ke=Bt=>{this.off("data",we),this.off("end",Je),this.off(K,vt),_(),he(Bt)},we=Bt=>{this.off("error",ke),this.off("end",Je),this.off(K,vt),this.pause(),ee({value:Bt,done:!!this[u]})},Je=()=>{this.off("error",ke),this.off("data",we),this.off(K,vt),_(),ee({done:!0,value:void 0})},vt=()=>ke(new Error("stream destroyed"));return new Promise((Bt,Nt)=>{he=Nt,ee=Bt,this.once(K,vt),this.once("error",ke),this.once("end",Je),this.once("data",we)})},throw:_,return:_,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[At]=!1;let y=!1,_=()=>(this.pause(),this.off(ie,_),this.off(K,_),this.off("end",_),y=!0,{done:!0,value:void 0}),M=()=>{if(y)return _();let ee=this.read();return ee===null?_():{done:!1,value:ee}};return this.once("end",_),this.once(ie,_),this.once(K,_),{next:M,throw:_,return:_,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(y){if(this[K])return y?this.emit("error",y):this.emit(K),this;this[K]=!0,this[At]=!0,this[k].length=0,this[T]=0;let _=this;return typeof _.close=="function"&&!this[g]&&_.close(),y?this.emit("error",y):this.emit(K),this}static get isStream(){return e.isStream}};e.Minipass=se}),E2t=ii(e=>{"use strict";var t=e&&e.__createBinding||(Object.create?(function(y,_,M,ee){ee===void 0&&(ee=M);var he=Object.getOwnPropertyDescriptor(_,M);(!he||("get"in he?!_.__esModule:he.writable||he.configurable))&&(he={enumerable:!0,get:function(){return _[M]}}),Object.defineProperty(y,ee,he)}):(function(y,_,M,ee){ee===void 0&&(ee=M),y[ee]=_[M]})),r=e&&e.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),n=e&&e.__importStar||function(y){if(y&&y.__esModule)return y;var _={};if(y!=null)for(var M in y)M!=="default"&&Object.prototype.hasOwnProperty.call(y,M)&&t(_,y,M);return r(_,y),_};Object.defineProperty(e,"__esModule",{value:!0}),e.PathScurry=e.Path=e.PathScurryDarwin=e.PathScurryPosix=e.PathScurryWin32=e.PathScurryBase=e.PathPosix=e.PathWin32=e.PathBase=e.ChildrenCache=e.ResolveCache=void 0;var i=b2t(),s=require("node:path"),o=require("node:url"),a=require("fs"),c=n(require("node:fs")),u=a.realpathSync.native,l=require("node:fs/promises"),d=kbe(),f={lstatSync:a.lstatSync,readdir:a.readdir,readdirSync:a.readdirSync,readlinkSync:a.readlinkSync,realpathSync:u,promises:{lstat:l.lstat,readdir:l.readdir,readlink:l.readlink,realpath:l.realpath}},A=y=>!y||y===f||y===c?f:{...f,...y,promises:{...f.promises,...y.promises||{}}},g=/^\\\\\?\\([a-z]:)\\?$/i,h=y=>y.replace(/\//g,"\\").replace(g,"$1\\"),m=/[\\\/]/,I=0,C=1,b=2,S=4,R=6,Q=8,k=10,v=12,T=15,H=~T,N=16,Y=32,K=64,ie=128,Z=256,O=512,ne=K|ie|O,te=1023,Ce=y=>y.isFile()?Q:y.isDirectory()?S:y.isSymbolicLink()?k:y.isCharacterDevice()?b:y.isBlockDevice()?R:y.isSocket()?v:y.isFIFO()?C:I,qe=new i.LRUCache({max:2**12}),it=y=>{let _=qe.get(y);if(_)return _;let M=y.normalize("NFKD");return qe.set(y,M),M},Ue=new i.LRUCache({max:2**12}),At=y=>{let _=Ue.get(y);if(_)return _;let M=it(y.toLowerCase());return Ue.set(y,M),M},Qt=class extends i.LRUCache{constructor(){super({max:256})}};e.ResolveCache=Qt;var tr=class extends i.LRUCache{constructor(y=16*1024){super({maxSize:y,sizeCalculation:_=>_.length+1})}};e.ChildrenCache=tr;var x=Symbol("PathScurry setAsCwd"),w=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#n;get nlink(){return this.#n}#i;get uid(){return this.#i}#s;get gid(){return this.#s}#l;get rdev(){return this.#l}#a;get blksize(){return this.#a}#o;get ino(){return this.#o}#d;get size(){return this.#d}#A;get blocks(){return this.#A}#f;get atimeMs(){return this.#f}#u;get mtimeMs(){return this.#u}#h;get ctimeMs(){return this.#h}#y;get birthtimeMs(){return this.#y}#I;get atime(){return this.#I}#p;get mtime(){return this.#p}#w;get ctime(){return this.#w}#C;get birthtime(){return this.#C}#B;#S;#m;#b;#E;#_;#c;#k;#N;#x;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(y,_=I,M,ee,he,ke,we){this.name=y,this.#B=he?At(y):it(y),this.#c=_&te,this.nocase=he,this.roots=ee,this.root=M||this,this.#k=ke,this.#m=we.fullpath,this.#E=we.relative,this.#_=we.relativePosix,this.parent=we.parent,this.parent?this.#e=this.parent.#e:this.#e=A(we.fs)}depth(){return this.#S!==void 0?this.#S:this.parent?this.#S=this.parent.depth()+1:this.#S=0}childrenCache(){return this.#k}resolve(y){if(!y)return this;let _=this.getRootString(y),M=y.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#T(M):this.#T(M)}#T(y){let _=this;for(let M of y)_=_.child(M);return _}children(){let y=this.#k.get(this);if(y)return y;let _=Object.assign([],{provisional:0});return this.#k.set(this,_),this.#c&=~N,_}child(y,_){if(y===""||y===".")return this;if(y==="..")return this.parent||this;let M=this.children(),ee=this.nocase?At(y):it(y);for(let Je of M)if(Je.#B===ee)return Je;let he=this.parent?this.sep:"",ke=this.#m?this.#m+he+y:void 0,we=this.newChild(y,I,{..._,parent:this,fullpath:ke});return this.canReaddir()||(we.#c|=ie),M.push(we),we}relative(){if(this.isCWD)return"";if(this.#E!==void 0)return this.#E;let y=this.name,_=this.parent;if(!_)return this.#E=this.name;let M=_.relative();return M+(!M||!_.parent?"":this.sep)+y}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#_!==void 0)return this.#_;let y=this.name,_=this.parent;if(!_)return this.#_=this.fullpathPosix();let M=_.relativePosix();return M+(!M||!_.parent?"":"/")+y}fullpath(){if(this.#m!==void 0)return this.#m;let y=this.name,_=this.parent;if(!_)return this.#m=this.name;let M=_.fullpath()+(_.parent?this.sep:"")+y;return this.#m=M}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let ee=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(ee)?this.#b=`//?/${ee}`:this.#b=ee}let y=this.parent,_=y.fullpathPosix(),M=_+(!_||!y.parent?"":"/")+this.name;return this.#b=M}isUnknown(){return(this.#c&T)===I}isType(y){return this[`is${y}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#c&T)===Q}isDirectory(){return(this.#c&T)===S}isCharacterDevice(){return(this.#c&T)===b}isBlockDevice(){return(this.#c&T)===R}isFIFO(){return(this.#c&T)===C}isSocket(){return(this.#c&T)===v}isSymbolicLink(){return(this.#c&k)===k}lstatCached(){return this.#c&Y?this:void 0}readlinkCached(){return this.#N}realpathCached(){return this.#x}readdirCached(){let y=this.children();return y.slice(0,y.provisional)}canReadlink(){if(this.#N)return!0;if(!this.parent)return!1;let y=this.#c&T;return!(y!==I&&y!==k||this.#c&Z||this.#c&ie)}calledReaddir(){return!!(this.#c&N)}isENOENT(){return!!(this.#c&ie)}isNamed(y){return this.nocase?this.#B===At(y):this.#B===it(y)}async readlink(){let y=this.#N;if(y)return y;if(this.canReadlink()&&this.parent)try{let _=await this.#e.promises.readlink(this.fullpath()),M=(await this.parent.realpath())?.resolve(_);if(M)return this.#N=M}catch(_){this.#Q(_.code);return}}readlinkSync(){let y=this.#N;if(y)return y;if(this.canReadlink()&&this.parent)try{let _=this.#e.readlinkSync(this.fullpath()),M=this.parent.realpathSync()?.resolve(_);if(M)return this.#N=M}catch(_){this.#Q(_.code);return}}#U(y){this.#c|=N;for(let _=y.provisional;_<y.length;_++){let M=y[_];M&&M.#v()}}#v(){this.#c&ie||(this.#c=(this.#c|ie)&H,this.#H())}#H(){let y=this.children();y.provisional=0;for(let _ of y)_.#v()}#Z(){this.#c|=O,this.#F()}#F(){if(this.#c&K)return;let y=this.#c;(y&T)===S&&(y&=H),this.#c=y|K,this.#H()}#O(y=""){y==="ENOTDIR"||y==="EPERM"?this.#F():y==="ENOENT"?this.#v():this.children().provisional=0}#D(y=""){y==="ENOTDIR"?this.parent.#F():y==="ENOENT"&&this.#v()}#Q(y=""){let _=this.#c;_|=Z,y==="ENOENT"&&(_|=ie),(y==="EINVAL"||y==="UNKNOWN")&&(_&=H),this.#c=_,y==="ENOTDIR"&&this.parent&&this.parent.#F()}#M(y,_){return this.#W(y,_)||this.#L(y,_)}#L(y,_){let M=Ce(y),ee=this.newChild(y.name,M,{parent:this}),he=ee.#c&T;return he!==S&&he!==k&&he!==I&&(ee.#c|=K),_.unshift(ee),_.provisional++,ee}#W(y,_){for(let M=_.provisional;M<_.length;M++){let ee=_[M];if((this.nocase?At(y.name):it(y.name))===ee.#B)return this.#g(y,ee,M,_)}}#g(y,_,M,ee){let he=_.name;return _.#c=_.#c&H|Ce(y),he!==y.name&&(_.name=y.name),M!==ee.provisional&&(M===ee.length-1?ee.pop():ee.splice(M,1),ee.unshift(_)),ee.provisional++,_}async lstat(){if((this.#c&ie)===0)try{return this.#V(await this.#e.promises.lstat(this.fullpath())),this}catch(y){this.#D(y.code)}}lstatSync(){if((this.#c&ie)===0)try{return this.#V(this.#e.lstatSync(this.fullpath())),this}catch(y){this.#D(y.code)}}#V(y){let{atime:_,atimeMs:M,birthtime:ee,birthtimeMs:he,blksize:ke,blocks:we,ctime:Je,ctimeMs:vt,dev:Bt,gid:Nt,ino:rr,mode:Nr,mtime:Zr,mtimeMs:Ar,nlink:Xr,rdev:vn,size:$s,uid:li}=y;this.#I=_,this.#f=M,this.#C=ee,this.#y=he,this.#a=ke,this.#A=we,this.#w=Je,this.#h=vt,this.#t=Bt,this.#s=Nt,this.#o=rr,this.#r=Nr,this.#p=Zr,this.#u=Ar,this.#n=Xr,this.#l=vn,this.#d=$s,this.#i=li;let js=Ce(y);this.#c=this.#c&H|js|Y,js!==I&&js!==S&&js!==k&&(this.#c|=K)}#G=[];#R=!1;#P(y){this.#R=!1;let _=this.#G.slice();this.#G.length=0,_.forEach(M=>M(null,y))}readdirCB(y,_=!1){if(!this.canReaddir()){_?y(null,[]):queueMicrotask(()=>y(null,[]));return}let M=this.children();if(this.calledReaddir()){let he=M.slice(0,M.provisional);_?y(null,he):queueMicrotask(()=>y(null,he));return}if(this.#G.push(y),this.#R)return;this.#R=!0;let ee=this.fullpath();this.#e.readdir(ee,{withFileTypes:!0},(he,ke)=>{if(he)this.#O(he.code),M.provisional=0;else{for(let we of ke)this.#M(we,M);this.#U(M)}this.#P(M.slice(0,M.provisional))})}#Y;async readdir(){if(!this.canReaddir())return[];let y=this.children();if(this.calledReaddir())return y.slice(0,y.provisional);let _=this.fullpath();if(this.#Y)await this.#Y;else{let M=()=>{};this.#Y=new Promise(ee=>M=ee);try{for(let ee of await this.#e.promises.readdir(_,{withFileTypes:!0}))this.#M(ee,y);this.#U(y)}catch(ee){this.#O(ee.code),y.provisional=0}this.#Y=void 0,M()}return y.slice(0,y.provisional)}readdirSync(){if(!this.canReaddir())return[];let y=this.children();if(this.calledReaddir())return y.slice(0,y.provisional);let _=this.fullpath();try{for(let M of this.#e.readdirSync(_,{withFileTypes:!0}))this.#M(M,y);this.#U(y)}catch(M){this.#O(M.code),y.provisional=0}return y.slice(0,y.provisional)}canReaddir(){if(this.#c&ne)return!1;let y=T&this.#c;return y===I||y===S||y===k}shouldWalk(y,_){return(this.#c&S)===S&&!(this.#c&ne)&&!y.has(this)&&(!_||_(this))}async realpath(){if(this.#x)return this.#x;if(!((O|Z|ie)&this.#c))try{let y=await this.#e.promises.realpath(this.fullpath());return this.#x=this.resolve(y)}catch{this.#Z()}}realpathSync(){if(this.#x)return this.#x;if(!((O|Z|ie)&this.#c))try{let y=this.#e.realpathSync(this.fullpath());return this.#x=this.resolve(y)}catch{this.#Z()}}[x](y){if(y===this)return;y.isCWD=!1,this.isCWD=!0;let _=new Set([]),M=[],ee=this;for(;ee&&ee.parent;)_.add(ee),ee.#E=M.join(this.sep),ee.#_=M.join("/"),ee=ee.parent,M.push("..");for(ee=y;ee&&ee.parent&&!_.has(ee);)ee.#E=void 0,ee.#_=void 0,ee=ee.parent}};e.PathBase=w;var ue=class Fbe extends w{sep="\\";splitSep=m;constructor(_,M=I,ee,he,ke,we,Je){super(_,M,ee,he,ke,we,Je)}newChild(_,M=I,ee={}){return new Fbe(_,M,this.root,this.roots,this.nocase,this.childrenCache(),ee)}getRootString(_){return s.win32.parse(_).root}getRoot(_){if(_=h(_.toUpperCase()),_===this.root.name)return this.root;for(let[M,ee]of Object.entries(this.roots))if(this.sameRoot(_,M))return this.roots[_]=ee;return this.roots[_]=new U(_,this).root}sameRoot(_,M=this.root.name){return _=_.toUpperCase().replace(/\//g,"\\").replace(g,"$1\\"),_===M}};e.PathWin32=ue;var E=class Gbe extends w{splitSep="/";sep="/";constructor(_,M=I,ee,he,ke,we,Je){super(_,M,ee,he,ke,we,Je)}getRootString(_){return _.startsWith("/")?"/":""}getRoot(_){return this.root}newChild(_,M=I,ee={}){return new Gbe(_,M,this.root,this.roots,this.nocase,this.childrenCache(),ee)}};e.PathPosix=E;var W=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#n;constructor(y=process.cwd(),_,M,{nocase:ee,childrenCacheSize:he=16*1024,fs:ke=f}={}){this.#n=A(ke),(y instanceof URL||y.startsWith("file://"))&&(y=(0,o.fileURLToPath)(y));let we=_.resolve(y);this.roots=Object.create(null),this.rootPath=this.parseRootPath(we),this.#e=new Qt,this.#t=new Qt,this.#r=new tr(he);let Je=we.substring(this.rootPath.length).split(M);if(Je.length===1&&!Je[0]&&Je.pop(),ee===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=ee,this.root=this.newRoot(this.#n),this.roots[this.rootPath]=this.root;let vt=this.root,Bt=Je.length-1,Nt=_.sep,rr=this.rootPath,Nr=!1;for(let Zr of Je){let Ar=Bt--;vt=vt.child(Zr,{relative:new Array(Ar).fill("..").join(Nt),relativePosix:new Array(Ar).fill("..").join("/"),fullpath:rr+=(Nr?"":Nt)+Zr}),Nr=!0}this.cwd=vt}depth(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.depth()}childrenCache(){return this.#r}resolve(...y){let _="";for(let he=y.length-1;he>=0;he--){let ke=y[he];if(!(!ke||ke===".")&&(_=_?`${ke}/${_}`:ke,this.isAbsolute(ke)))break}let M=this.#e.get(_);if(M!==void 0)return M;let ee=this.cwd.resolve(_).fullpath();return this.#e.set(_,ee),ee}resolvePosix(...y){let _="";for(let he=y.length-1;he>=0;he--){let ke=y[he];if(!(!ke||ke===".")&&(_=_?`${ke}/${_}`:ke,this.isAbsolute(ke)))break}let M=this.#t.get(_);if(M!==void 0)return M;let ee=this.cwd.resolve(_).fullpathPosix();return this.#t.set(_,ee),ee}relative(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.relative()}relativePosix(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.relativePosix()}basename(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.name}dirname(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),(y.parent||y).fullpath()}async readdir(y=this.cwd,_={withFileTypes:!0}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M}=_;if(y.canReaddir()){let ee=await y.readdir();return M?ee:ee.map(he=>he.name)}else return[]}readdirSync(y=this.cwd,_={withFileTypes:!0}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0}=_;return y.canReaddir()?M?y.readdirSync():y.readdirSync().map(ee=>ee.name):[]}async lstat(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.lstat()}lstatSync(y=this.cwd){return typeof y=="string"&&(y=this.cwd.resolve(y)),y.lstatSync()}async readlink(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=await y.readlink();return _?M:M?.fullpath()}readlinkSync(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=y.readlinkSync();return _?M:M?.fullpath()}async realpath(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=await y.realpath();return _?M:M?.fullpath()}realpathSync(y=this.cwd,{withFileTypes:_}={withFileTypes:!1}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y.withFileTypes,y=this.cwd);let M=y.realpathSync();return _?M:M?.fullpath()}async walk(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=[];(!he||he(y))&&we.push(M?y:y.fullpath());let Je=new Set,vt=(Nt,rr)=>{Je.add(Nt),Nt.readdirCB((Nr,Zr)=>{if(Nr)return rr(Nr);let Ar=Zr.length;if(!Ar)return rr();let Xr=()=>{--Ar===0&&rr()};for(let vn of Zr)(!he||he(vn))&&we.push(M?vn:vn.fullpath()),ee&&vn.isSymbolicLink()?vn.realpath().then($s=>$s?.isUnknown()?$s.lstat():$s).then($s=>$s?.shouldWalk(Je,ke)?vt($s,Xr):Xr()):vn.shouldWalk(Je,ke)?vt(vn,Xr):Xr()},!0)},Bt=y;return new Promise((Nt,rr)=>{vt(Bt,Nr=>{if(Nr)return rr(Nr);Nt(we)})})}walkSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=[];(!he||he(y))&&we.push(M?y:y.fullpath());let Je=new Set([y]);for(let vt of Je){let Bt=vt.readdirSync();for(let Nt of Bt){(!he||he(Nt))&&we.push(M?Nt:Nt.fullpath());let rr=Nt;if(Nt.isSymbolicLink()){if(!(ee&&(rr=Nt.realpathSync())))continue;rr.isUnknown()&&rr.lstatSync()}rr.shouldWalk(Je,ke)&&Je.add(rr)}}return we}[Symbol.asyncIterator](){return this.iterate()}iterate(y=this.cwd,_={}){return typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd),this.stream(y,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_;(!he||he(y))&&(yield M?y:y.fullpath());let we=new Set([y]);for(let Je of we){let vt=Je.readdirSync();for(let Bt of vt){(!he||he(Bt))&&(yield M?Bt:Bt.fullpath());let Nt=Bt;if(Bt.isSymbolicLink()){if(!(ee&&(Nt=Bt.realpathSync())))continue;Nt.isUnknown()&&Nt.lstatSync()}Nt.shouldWalk(we,ke)&&we.add(Nt)}}}stream(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=new d.Minipass({objectMode:!0});(!he||he(y))&&we.write(M?y:y.fullpath());let Je=new Set,vt=[y],Bt=0,Nt=()=>{let rr=!1;for(;!rr;){let Nr=vt.shift();if(!Nr){Bt===0&&we.end();return}Bt++,Je.add(Nr);let Zr=(Xr,vn,$s=!1)=>{if(Xr)return we.emit("error",Xr);if(ee&&!$s){let li=[];for(let js of vn)js.isSymbolicLink()&&li.push(js.realpath().then(fp=>fp?.isUnknown()?fp.lstat():fp));if(li.length){Promise.all(li).then(()=>Zr(null,vn,!0));return}}for(let li of vn)li&&(!he||he(li))&&(we.write(M?li:li.fullpath())||(rr=!0));Bt--;for(let li of vn){let js=li.realpathCached()||li;js.shouldWalk(Je,ke)&&vt.push(js)}rr&&!we.flowing?we.once("drain",Nt):Ar||Nt()},Ar=!0;Nr.readdirCB(Zr,!0),Ar=!1}};return Nt(),we}streamSync(y=this.cwd,_={}){typeof y=="string"?y=this.cwd.resolve(y):y instanceof w||(_=y,y=this.cwd);let{withFileTypes:M=!0,follow:ee=!1,filter:he,walkFilter:ke}=_,we=new d.Minipass({objectMode:!0}),Je=new Set;(!he||he(y))&&we.write(M?y:y.fullpath());let vt=[y],Bt=0,Nt=()=>{let rr=!1;for(;!rr;){let Nr=vt.shift();if(!Nr){Bt===0&&we.end();return}Bt++,Je.add(Nr);let Zr=Nr.readdirSync();for(let Ar of Zr)(!he||he(Ar))&&(we.write(M?Ar:Ar.fullpath())||(rr=!0));Bt--;for(let Ar of Zr){let Xr=Ar;if(Ar.isSymbolicLink()){if(!(ee&&(Xr=Ar.realpathSync())))continue;Xr.isUnknown()&&Xr.lstatSync()}Xr.shouldWalk(Je,ke)&&vt.push(Xr)}}rr&&!we.flowing&&we.once("drain",Nt)};return Nt(),we}chdir(y=this.cwd){let _=this.cwd;this.cwd=typeof y=="string"?this.cwd.resolve(y):y,this.cwd[x](_)}};e.PathScurryBase=W;var U=class extends W{sep="\\";constructor(y=process.cwd(),_={}){let{nocase:M=!0}=_;super(y,s.win32,"\\",{..._,nocase:M}),this.nocase=M;for(let ee=this.cwd;ee;ee=ee.parent)ee.nocase=this.nocase}parseRootPath(y){return s.win32.parse(y).root.toUpperCase()}newRoot(y){return new ue(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:y})}isAbsolute(y){return y.startsWith("/")||y.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(y)}};e.PathScurryWin32=U;var $=class extends W{sep="/";constructor(y=process.cwd(),_={}){let{nocase:M=!1}=_;super(y,s.posix,"/",{..._,nocase:M}),this.nocase=M}parseRootPath(y){return"/"}newRoot(y){return new E(this.rootPath,S,void 0,this.roots,this.nocase,this.childrenCache(),{fs:y})}isAbsolute(y){return y.startsWith("/")}};e.PathScurryPosix=$;var se=class extends ${constructor(y=process.cwd(),_={}){let{nocase:M=!0}=_;super(y,{..._,nocase:M})}};e.PathScurryDarwin=se,e.Path=process.platform==="win32"?ue:E,e.PathScurry=process.platform==="win32"?U:process.platform==="darwin"?se:$}),Zbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Pattern=void 0;var t=Dg(),r=o=>o.length>=1,n=o=>o.length>=1,i=Symbol.for("nodejs.util.inspect.custom"),s=class Ube{#e;#t;#r;length;#n;#i;#s;#l;#a;#o;#d=!0;constructor(a,c,u,l){if(!r(a))throw new TypeError("empty pattern list");if(!n(c))throw new TypeError("empty glob list");if(c.length!==a.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=a.length,u<0||u>=this.length)throw new TypeError("index out of range");if(this.#e=a,this.#t=c,this.#r=u,this.#n=l,this.#r===0){if(this.isUNC()){let[d,f,A,g,...h]=this.#e,[m,I,C,b,...S]=this.#t;h[0]===""&&(h.shift(),S.shift());let R=[d,f,A,g,""].join("/"),Q=[m,I,C,b,""].join("/");this.#e=[R,...h],this.#t=[Q,...S],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[d,...f]=this.#e,[A,...g]=this.#t;f[0]===""&&(f.shift(),g.shift());let h=d+"/",m=A+"/";this.#e=[h,...f],this.#t=[m,...g],this.length=this.#e.length}}}[i](){return"Pattern <"+this.#t.slice(this.#r).join("/")+">"}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===t.GLOBSTAR}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#s=this.#s||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new Ube(this.#e,this.#t,this.#r+1,this.#n),this.#i.#o=this.#o,this.#i.#a=this.#a,this.#i.#l=this.#l,this.#i):this.#i=null}isUNC(){let a=this.#e;return this.#a!==void 0?this.#a:this.#a=this.#n==="win32"&&this.#r===0&&a[0]===""&&a[1]===""&&typeof a[2]=="string"&&!!a[2]&&typeof a[3]=="string"&&!!a[3]}isDrive(){let a=this.#e;return this.#l!==void 0?this.#l:this.#l=this.#n==="win32"&&this.#r===0&&this.length>1&&typeof a[0]=="string"&&/^[a-z]:$/i.test(a[0])}isAbsolute(){let a=this.#e;return this.#o!==void 0?this.#o:this.#o=a[0]===""&&a.length>1||this.isDrive()||this.isUNC()}root(){let a=this.#e[0];return typeof a=="string"&&this.isAbsolute()&&this.#r===0?a:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#d)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#d?!1:(this.#d=!1,!0)}};e.Pattern=s}),Obe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Ignore=void 0;var t=Dg(),r=Zbe(),n=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",i=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(s,{nobrace:o,nocase:a,noext:c,noglobstar:u,platform:l=n}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=l,this.mmopts={dot:!0,nobrace:o,nocase:a,noext:c,noglobstar:u,optimizationLevel:2,platform:l,nocomment:!0,nonegate:!0};for(let d of s)this.add(d)}add(s){let o=new t.Minimatch(s,this.mmopts);for(let a=0;a<o.set.length;a++){let c=o.set[a],u=o.globParts[a];if(!c||!u)throw new Error("invalid pattern object");for(;c[0]==="."&&u[0]===".";)c.shift(),u.shift();let l=new r.Pattern(c,u,0,this.platform),d=new t.Minimatch(l.globString(),this.mmopts),f=u[u.length-1]==="**",A=l.isAbsolute();A?this.absolute.push(d):this.relative.push(d),f&&(A?this.absoluteChildren.push(d):this.relativeChildren.push(d))}}ignored(s){let o=s.fullpath(),a=`${o}/`,c=s.relative()||".",u=`${c}/`;for(let l of this.relative)if(l.match(c)||l.match(u))return!0;for(let l of this.absolute)if(l.match(o)||l.match(a))return!0;return!1}childrenIgnored(s){let o=s.fullpath()+"/",a=(s.relative()||".")+"/";for(let c of this.relativeChildren)if(c.match(a))return!0;for(let c of this.absoluteChildren)if(c.match(o))return!0;return!1}};e.Ignore=i}),B2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Processor=e.SubWalks=e.MatchRecord=e.HasWalkedCache=void 0;var t=Dg(),r=class Mbe{store;constructor(a=new Map){this.store=a}copy(){return new Mbe(new Map(this.store))}hasWalked(a,c){return this.store.get(a.fullpath())?.has(c.globString())}storeWalked(a,c){let u=a.fullpath(),l=this.store.get(u);l?l.add(c.globString()):this.store.set(u,new Set([c.globString()]))}};e.HasWalkedCache=r;var n=class{store=new Map;add(o,a,c){let u=(a?2:0)|(c?1:0),l=this.store.get(o);this.store.set(o,l===void 0?u:u&l)}entries(){return[...this.store.entries()].map(([o,a])=>[o,!!(a&2),!!(a&1)])}};e.MatchRecord=n;var i=class{store=new Map;add(o,a){if(!o.canReaddir())return;let c=this.store.get(o);c?c.find(u=>u.globString()===a.globString())||c.push(a):this.store.set(o,[a])}get(o){let a=this.store.get(o);if(!a)throw new Error("attempting to walk unknown path");return a}entries(){return this.keys().map(o=>[o,this.store.get(o)])}keys(){return[...this.store.keys()].filter(o=>o.canReaddir())}};e.SubWalks=i;var s=class Lbe{hasWalkedCache;matches=new n;subwalks=new i;patterns;follow;dot;opts;constructor(a,c){this.opts=a,this.follow=!!a.follow,this.dot=!!a.dot,this.hasWalkedCache=c?c.copy():new r}processPatterns(a,c){this.patterns=c;let u=c.map(l=>[a,l]);for(let[l,d]of u){this.hasWalkedCache.storeWalked(l,d);let f=d.root(),A=d.isAbsolute()&&this.opts.absolute!==!1;if(f){l=l.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let I=d.rest();if(I)d=I;else{this.matches.add(l,!0,!1);continue}}if(l.isENOENT())continue;let g,h,m=!1;for(;typeof(g=d.pattern())=="string"&&(h=d.rest());)l=l.resolve(g),d=h,m=!0;if(g=d.pattern(),h=d.rest(),m){if(this.hasWalkedCache.hasWalked(l,d))continue;this.hasWalkedCache.storeWalked(l,d)}if(typeof g=="string"){let I=g===".."||g===""||g===".";this.matches.add(l.resolve(g),A,I);continue}else if(g===t.GLOBSTAR){(!l.isSymbolicLink()||this.follow||d.checkFollowGlobstar())&&this.subwalks.add(l,d);let I=h?.pattern(),C=h?.rest();if(!h||(I===""||I===".")&&!C)this.matches.add(l,A,I===""||I===".");else if(I===".."){let b=l.parent||l;C?this.hasWalkedCache.hasWalked(b,C)||this.subwalks.add(b,C):this.matches.add(b,A,!0)}}else g instanceof RegExp&&this.subwalks.add(l,d)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Lbe(this.opts,this.hasWalkedCache)}filterEntries(a,c){let u=this.subwalks.get(a),l=this.child();for(let d of c)for(let f of u){let A=f.isAbsolute(),g=f.pattern(),h=f.rest();g===t.GLOBSTAR?l.testGlobstar(d,f,h,A):g instanceof RegExp?l.testRegExp(d,g,h,A):l.testString(d,g,h,A)}return l}testGlobstar(a,c,u,l){if((this.dot||!a.name.startsWith("."))&&(c.hasMore()||this.matches.add(a,l,!1),a.canReaddir()&&(this.follow||!a.isSymbolicLink()?this.subwalks.add(a,c):a.isSymbolicLink()&&(u&&c.checkFollowGlobstar()?this.subwalks.add(a,u):c.markFollowGlobstar()&&this.subwalks.add(a,c)))),u){let d=u.pattern();if(typeof d=="string"&&d!==".."&&d!==""&&d!==".")this.testString(a,d,u.rest(),l);else if(d===".."){let f=a.parent||a;this.subwalks.add(f,u)}else d instanceof RegExp&&this.testRegExp(a,d,u.rest(),l)}}testRegExp(a,c,u,l){c.test(a.name)&&(u?this.subwalks.add(a,u):this.matches.add(a,l,!1))}testString(a,c,u,l){a.isNamed(c)&&(u?this.subwalks.add(a,u):this.matches.add(a,l,!1))}};e.Processor=s}),v2t=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GlobStream=e.GlobWalker=e.GlobUtil=void 0;var t=kbe(),r=Obe(),n=B2t(),i=(c,u)=>typeof c=="string"?new r.Ignore([c],u):Array.isArray(c)?new r.Ignore(c,u):c,s=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(c,u,l){if(this.patterns=c,this.path=u,this.opts=l,this.#r=!l.posix&&l.platform==="win32"?"\\":"/",this.includeChildMatches=l.includeChildMatches!==!1,(l.ignore||!this.includeChildMatches)&&(this.#t=i(l.ignore??[],l),!this.includeChildMatches&&typeof this.#t.add!="function")){let d="cannot ignore child matches, ignore lacks add() method.";throw new Error(d)}this.maxDepth=l.maxDepth||1/0,l.signal&&(this.signal=l.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#n(c){return this.seen.has(c)||!!this.#t?.ignored?.(c)}#i(c){return!!this.#t?.childrenIgnored?.(c)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let c;for(;!this.paused&&(c=this.#e.shift());)c()}onResume(c){this.signal?.aborted||(this.paused?this.#e.push(c):c())}async matchCheck(c,u){if(u&&this.opts.nodir)return;let l;if(this.opts.realpath){if(l=c.realpathCached()||await c.realpath(),!l)return;c=l}let d=c.isUnknown()||this.opts.stat?await c.lstat():c;if(this.opts.follow&&this.opts.nodir&&d?.isSymbolicLink()){let f=await d.realpath();f&&(f.isUnknown()||this.opts.stat)&&await f.lstat()}return this.matchCheckTest(d,u)}matchCheckTest(c,u){return c&&(this.maxDepth===1/0||c.depth()<=this.maxDepth)&&(!u||c.canReaddir())&&(!this.opts.nodir||!c.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!c.isSymbolicLink()||!c.realpathCached()?.isDirectory())&&!this.#n(c)?c:void 0}matchCheckSync(c,u){if(u&&this.opts.nodir)return;let l;if(this.opts.realpath){if(l=c.realpathCached()||c.realpathSync(),!l)return;c=l}let d=c.isUnknown()||this.opts.stat?c.lstatSync():c;if(this.opts.follow&&this.opts.nodir&&d?.isSymbolicLink()){let f=d.realpathSync();f&&(f?.isUnknown()||this.opts.stat)&&f.lstatSync()}return this.matchCheckTest(d,u)}matchFinish(c,u){if(this.#n(c))return;if(!this.includeChildMatches&&this.#t?.add){let f=`${c.relativePosix()}/**`;this.#t.add(f)}let l=this.opts.absolute===void 0?u:this.opts.absolute;this.seen.add(c);let d=this.opts.mark&&c.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(c);else if(l){let f=this.opts.posix?c.fullpathPosix():c.fullpath();this.matchEmit(f+d)}else{let f=this.opts.posix?c.relativePosix():c.relative(),A=this.opts.dotRelative&&!f.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(f?A+f+d:"."+d)}}async match(c,u,l){let d=await this.matchCheck(c,l);d&&this.matchFinish(d,u)}matchSync(c,u,l){let d=this.matchCheckSync(c,l);d&&this.matchFinish(d,u)}walkCB(c,u,l){this.signal?.aborted&&l(),this.walkCB2(c,u,new n.Processor(this.opts),l)}walkCB2(c,u,l,d){if(this.#i(c))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2(c,u,l,d));return}l.processPatterns(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||(f++,this.match(g,h,m).then(()=>A()));for(let g of l.subwalkTargets()){if(this.maxDepth!==1/0&&g.depth()>=this.maxDepth)continue;f++;let h=g.readdirCached();g.calledReaddir()?this.walkCB3(g,h,l,A):g.readdirCB((m,I)=>this.walkCB3(g,I,l,A),!0)}A()}walkCB3(c,u,l,d){l=l.filterEntries(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||(f++,this.match(g,h,m).then(()=>A()));for(let[g,h]of l.subwalks.entries())f++,this.walkCB2(g,h,l.child(),A);A()}walkCBSync(c,u,l){this.signal?.aborted&&l(),this.walkCB2Sync(c,u,new n.Processor(this.opts),l)}walkCB2Sync(c,u,l,d){if(this.#i(c))return d();if(this.signal?.aborted&&d(),this.paused){this.onResume(()=>this.walkCB2Sync(c,u,l,d));return}l.processPatterns(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||this.matchSync(g,h,m);for(let g of l.subwalkTargets()){if(this.maxDepth!==1/0&&g.depth()>=this.maxDepth)continue;f++;let h=g.readdirSync();this.walkCB3Sync(g,h,l,A)}A()}walkCB3Sync(c,u,l,d){l=l.filterEntries(c,u);let f=1,A=()=>{--f===0&&d()};for(let[g,h,m]of l.matches.entries())this.#n(g)||this.matchSync(g,h,m);for(let[g,h]of l.subwalks.entries())f++,this.walkCB2Sync(g,h,l.child(),A);A()}};e.GlobUtil=s;var o=class extends s{matches=new Set;constructor(c,u,l){super(c,u,l)}matchEmit(c){this.matches.add(c)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((c,u)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?u(this.signal.reason):c(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}};e.GlobWalker=o;var a=class extends s{results;constructor(c,u,l){super(c,u,l),this.results=new t.Minipass({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(c){this.results.write(c),this.results.flowing||this.pause()}stream(){let c=this.path;return c.isUnknown()?c.lstat().then(()=>{this.walkCB(c,this.patterns,()=>this.results.end())}):this.walkCB(c,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};e.GlobStream=a}),Wbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Glob=void 0;var t=Dg(),r=require("node:url"),n=E2t(),i=Zbe(),s=v2t(),o=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",a=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(c,u){if(!u)throw new TypeError("glob options required");if(this.withFileTypes=!!u.withFileTypes,this.signal=u.signal,this.follow=!!u.follow,this.dot=!!u.dot,this.dotRelative=!!u.dotRelative,this.nodir=!!u.nodir,this.mark=!!u.mark,u.cwd?(u.cwd instanceof URL||u.cwd.startsWith("file://"))&&(u.cwd=(0,r.fileURLToPath)(u.cwd)):this.cwd="",this.cwd=u.cwd||"",this.root=u.root,this.magicalBraces=!!u.magicalBraces,this.nobrace=!!u.nobrace,this.noext=!!u.noext,this.realpath=!!u.realpath,this.absolute=u.absolute,this.includeChildMatches=u.includeChildMatches!==!1,this.noglobstar=!!u.noglobstar,this.matchBase=!!u.matchBase,this.maxDepth=typeof u.maxDepth=="number"?u.maxDepth:1/0,this.stat=!!u.stat,this.ignore=u.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof c=="string"&&(c=[c]),this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(c=c.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(u.noglobstar)throw new TypeError("base matching requires globstar");c=c.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=c,this.platform=u.platform||o,this.opts={...u,platform:this.platform},u.scurry){if(this.scurry=u.scurry,u.nocase!==void 0&&u.nocase!==u.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=u.platform==="win32"?n.PathScurryWin32:u.platform==="darwin"?n.PathScurryDarwin:u.platform?n.PathScurryPosix:n.PathScurry;this.scurry=new h(this.cwd,{nocase:u.nocase,fs:u.fs})}this.nocase=this.scurry.nocase;let l=this.platform==="darwin"||this.platform==="win32",d={braceExpandMax:1e4,...u,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:l,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},f=this.pattern.map(h=>new t.Minimatch(h,d)),[A,g]=f.reduce((h,m)=>(h[0].push(...m.set),h[1].push(...m.globParts),h),[[],[]]);this.patterns=A.map((h,m)=>{let I=g[m];if(!I)throw new Error("invalid pattern object");return new i.Pattern(h,I,0,this.platform)})}async walk(){return[...await new s.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new s.GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new s.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new s.GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};e.Glob=a}),Vbe=ii(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasMagic=void 0;var t=Dg(),r=(n,i={})=>{Array.isArray(n)||(n=[n]);for(let s of n)if(new t.Minimatch(s,i).hasMagic())return!0;return!1};e.hasMagic=r});Object.defineProperty(Tt,"__esModule",{value:!0});Tt.glob=Tt.sync=Tt.iterate=Tt.iterateSync=Tt.stream=Tt.streamSync=Tt.Ignore=Tt.hasMagic=Tt.Glob=Tt.unescape=Tt.escape=void 0;Tt.globStreamSync=GB;Tt.globStream=EY;Tt.globSync=BY;Tt.globIterateSync=ZB;Tt.globIterate=vY;var Qbe=Dg(),Qg=Wbe(),S2t=Vbe(),Hbe=Dg();Object.defineProperty(Tt,"escape",{enumerable:!0,get:function(){return Hbe.escape}});Object.defineProperty(Tt,"unescape",{enumerable:!0,get:function(){return Hbe.unescape}});var w2t=Wbe();Object.defineProperty(Tt,"Glob",{enumerable:!0,get:function(){return w2t.Glob}});var _2t=Vbe();Object.defineProperty(Tt,"hasMagic",{enumerable:!0,get:function(){return _2t.hasMagic}});var x2t=Obe();Object.defineProperty(Tt,"Ignore",{enumerable:!0,get:function(){return x2t.Ignore}});function GB(e,t={}){return new Qg.Glob(e,t).streamSync()}function EY(e,t={}){return new Qg.Glob(e,t).stream()}function BY(e,t={}){return new Qg.Glob(e,t).walkSync()}async function Nbe(e,t={}){return new Qg.Glob(e,t).walk()}function ZB(e,t={}){return new Qg.Glob(e,t).iterateSync()}function vY(e,t={}){return new Qg.Glob(e,t).iterate()}Tt.streamSync=GB;Tt.stream=Object.assign(EY,{sync:GB});Tt.iterateSync=ZB;Tt.iterate=Object.assign(vY,{sync:ZB});Tt.sync=Object.assign(BY,{stream:GB,iterate:ZB});Tt.glob=Object.assign(Nbe,{glob:Nbe,globSync:BY,sync:Tt.sync,globStream:EY,stream:Tt.stream,globStreamSync:GB,streamSync:Tt.streamSync,globIterate:vY,iterate:Tt.iterate,globIterateSync:ZB,iterateSync:Tt.iterateSync,Glob:Qg.Glob,hasMagic:S2t.hasMagic,escape:Qbe.escape,unescape:Qbe.unescape});Tt.glob.glob=Tt.glob});var wY=p(Yi=>{"use strict";var R2t=Yi&&Yi.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),D2t=Yi&&Yi.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),Ybe=Yi&&Yi.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&R2t(t,e,r);return D2t(t,e),t};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.determineGoModuleName=Yi.ConstructsMaker=Yi.generateJsiiLanguage=void 0;var hr=Ybe(Br()),st=Ybe(require("path")),Q2t=fc(),HD=tt(),ir=tt(),oo=tt(),N2t=IY(),T2t=xbe(),$be=Pbe(),k2t=Qf(),F2t=require.resolve("jsii-pacmak/bin/jsii-pacmak"),G2t=require.resolve("jsii/bin/jsii");async function Z2t(e){let t=await(0,HD.exec)("npm",["pack","--dry-run","--json"],{cwd:e}),r=JSON.parse(t);return(Array.isArray(r)?r[0]:Object.values(r)[0]).files.map(i=>i.path).filter(i=>!i.includes(".."))}async function jbe(e,t,r,n=[]){await(0,HD.mkdtemp)(async i=>{await e.save(i);let s=n.flatMap(m=>$be.glob.sync(m,{cwd:i}));await Promise.all(s.map(m=>hr.remove(st.join(i,m))));let o=["--silence-warnings","reserved-word"],a=t.entrypoint,c=st.join(st.dirname(a),st.basename(a,".ts")),u=t.moduleKey.replace(/\./g,"").replace(/\//g,""),l=t.deps,d={},f={};for(let m of l){let I=await hr.readJson(st.join(m,"package.json")),C=I.name,b=I.version,S=st.join(st.join(i,"node_modules"),C);await hr.mkdirp(S);for(let R of await Z2t(m)){let Q=st.join(m,R),k=st.join(S,R);await hr.mkdirp(st.dirname(k)),await hr.copy(Q,k,{dereference:!0})}C.startsWith("@types/")||(f[C]=b)}let A={name:u,version:"0.0.0",author:"generated@generated.com",main:`${c}.js`,types:`${c}.d.ts`,license:"UNLICENSED",repository:{url:"http://generated",type:"git"},jsii:{outdir:"dist",targets:d},dependencies:f,peerDependencies:f};t.exports&&(A.exports=t.exports),t.python&&(d.python={distName:"generated",module:t.python.moduleName}),t.java&&(d.java={package:t.java.package,maven:{groupId:"generated",artifactId:"generated"}}),t.csharp&&(d.dotnet={namespace:t.csharp.namespace,packageId:t.csharp.namespace}),t.golang&&(d.go={moduleName:t.golang.moduleName,packageName:t.golang.packageName}),await hr.writeFile(st.join(i,"package.json"),JSON.stringify(A,void 0,2));let g=(0,ir.logTimespan)("jsii");await(0,HD.exec)(G2t,o,{cwd:i}),g(),t.jsii&&await hr.copy(st.join(i,".jsii"),t.jsii.path);let h=(0,ir.logTimespan)("jsii-pacmak");if(await(0,HD.exec)(F2t,["--code-only"],{cwd:i}),h(),t.python){let m=t.python.moduleName.replace(/\./g,"/"),I=st.resolve(st.join(i,"dist/python/src",m)),C=st.join(t.python.outdir,m);await hr.move(I,C,{overwrite:!0})}if(t.java){let m=st.resolve(st.join(i,"dist/java/src/")),I=st.join(t.java.outdir,"src/"),C=t.java.package.replace(/\./g,"/");await hr.mkdirp(st.join(I,"main/java",C)),await hr.mkdirp(st.join(I,"main/resources",C)),await hr.copy(m,I,{overwrite:!1})}if(t.csharp){let m=t.csharp.namespace,I=st.resolve(st.join(i,"dist/dotnet/",m)),C=st.join(t.csharp.outdir,m);await hr.move(I,C,{overwrite:!0})}if(t.golang){let m=t.golang.packageName,I=st.resolve(st.join(i,"dist/go/",m)),C=st.join(t.golang.outdir,m);await hr.move(I,C,{overwrite:!0}),await hr.remove(st.join(C,"go.mod"))}["versions.json","constraints.json"].forEach(m=>{try{hr.copySync(st.resolve(i,m),st.resolve(r,m))}catch(I){ir.logger.debug(`Failed to copy ${m}: ${I}`)}})})}Yi.generateJsiiLanguage=jbe;var SY=class{constructor(t,r,n=async()=>{}){this.options=t,this.schemaCachePath=r,this.reportTelemetry=n,this.codeMakerOutdir=st.resolve(this.options.codeMakerOutput),hr.mkdirpSync(this.codeMakerOutdir),this.code=new Q2t.CodeMaker,this.versions={}}async generateTypescriptProvider(t,r){var n;let i=(0,ir.logTimespan)(`Generate Typescript for ${t.name}`),s=new N2t.TerraformProviderGenerator(this.code,r,{importExtension:(n=this.options.languageOptions)===null||n===void 0?void 0:n.importExtension});s.generate(t),this.versions={...this.versions,...s.versions},i()}async filterAlreadyGenerated(t){let r="{}";try{r=await hr.readFile(st.join(this.codeMakerOutdir,"constraints.json"),"utf8")}catch(s){return ir.logger.debug(`Could not find constraints.json file while filtering: ${s}. This means no providers were generated, so all constraints need to be generated.`),t}ir.logger.debug(`Found constraints.json file: ${r}`);let n={};try{n=JSON.parse(r)}catch(s){return ir.logger.info(`Could not parse constraints.json file while filtering: ${s}. Generating all constraints.`),t}if(ir.logger.debug(`Found previous constraints: ${JSON.stringify(n,null,2)}`),!n.providers||typeof n.providers!="object")return ir.logger.info(`Could not find providers in constraints.json file, generating all constraints. The constraints file was ${JSON.stringify(n,null,2)}`),t;if(n.cdktf!==oo.DISPLAY_VERSION)return ir.logger.info(`The CDKTN version has changed, generating all constraints. The previous version was ${n.cdktf}, the current version is ${oo.DISPLAY_VERSION}`),t;let i=t.filter(s=>{let o=n.providers[s.fqn]===s.version,a=!1;switch(this.options.targetLanguage){case oo.Language.TYPESCRIPT:a=hr.existsSync(st.join(this.codeMakerOutdir,"providers",s.name));break;case oo.Language.PYTHON:case oo.Language.JAVA:case oo.Language.CSHARP:a=hr.existsSync(st.join(this.codeMakerOutdir,s.name));break;case oo.Language.GO:a=hr.existsSync(st.join(this.codeMakerOutdir,s.namespace||"hashicorp",s.name));break}return!(o&&a)});return ir.logger.debug(`Constraints to generate: ${JSON.stringify(i,null,2)}`),i}async generateTypescriptModule(t,r){let n=(0,ir.logTimespan)(`Generate Typescript for ${t.name}`);t.spec=r,new T2t.ModuleGenerator(this.code,[t]),n()}async generateTypescript(t,r){var n;if(t.isModule){let i=(n=r.moduleSchema)===null||n===void 0?void 0:n[t.moduleKey];if(!i)throw ir.Errors.Internal(`Could not generate schema for module ${t.moduleKey}`);await this.generateTypescriptModule(t,i)}else if(t.isProvider){if(!r.providerSchema)throw ir.Errors.Internal("Could not generate schema for providers");await this.generateTypescriptProvider(t,r.providerSchema)}else throw new Error(`Unknown target type used to generate bindings: ${t.name}`)}updateVersionsFile(t){ir.logger.debug(`Updating versions file with generated versions ${JSON.stringify(this.versions,null,2)} with allowed constraints ${JSON.stringify(t,null,2)}`);let r="versions.json",n={};try{n=JSON.parse(hr.readFileSync(st.resolve(this.codeMakerOutdir,r),"utf8")),ir.logger.debug(`Read existing versions file: ${JSON.stringify(n,null,2)}`)}catch(s){ir.logger.debug(`Could not read versions file, this is expected if there are no pre-existing local providers: ${s}`)}let i=t.reduce((s,o)=>{let a=Object.entries(n).find(([c])=>c.endsWith(o.fqn));if(a){let[c,u]=a;return{...s,[c]:u}}return s},{});return ir.logger.debug(`Writing versions file (${r}): ${JSON.stringify(i,null,2)}`),this.code.openFile(r),this.code.line(JSON.stringify({...i,...this.versions},null,2)),this.code.closeFile(r),r}async removeFoldersThatShouldNotExist(t){if(ir.logger.debug(`Removing providers except for ${JSON.stringify(t,null,2)}`),!this.isJavascriptTarget)return;let r=[],n=st.resolve(this.codeMakerOutdir,"providers");try{r=await hr.readdir(n)}catch(s){ir.logger.debug(`Error listing files in providers folder '${n}': ${s}`)}return r.filter(s=>hr.statSync(st.resolve(this.codeMakerOutdir,"providers",s)).isDirectory()).forEach(s=>{t.some(a=>a.name===s)||(ir.logger.debug(`Removing folder ${s} from providers`),hr.removeSync(st.resolve(this.codeMakerOutdir,"providers",s)))})}emitConstraintsFile(t,r){let n="constraints.json",i={cdktf:oo.DISPLAY_VERSION,providers:t.sort((s,o)=>s.fqn.localeCompare(o.fqn)).reduce((s,o)=>({...s,[o.fqn]:o.version}),{})};return this.options.targetVersions&&(i.targetVersions=this.options.targetVersions),(r?.cli_name||r?.cli_version)&&(i.cli={name:r.cli_name,version:r.cli_version}),this.code.openFile(n),this.code.line(JSON.stringify(i,null,2)),this.code.closeFile(n),n}async generateJsiiLanguage(t){var r;let n=[st.dirname(require.resolve("@types/node/package.json")),st.dirname(require.resolve("constructs/package.json")),st.dirname(require.resolve("cdktn/package.json"))],i={entrypoint:t.fileName,deps:n,moduleKey:t.moduleKey,exports:t.isProvider?{".":{import:`./providers/${t.name}/index.js`,require:`./providers/${t.name}/lazy-index.js`}}:void 0};if(this.options.outputJsii&&(i.jsii={path:this.options.outputJsii}),this.isPythonTarget&&(i.python={outdir:this.codeMakerOutdir,moduleName:t.srcMakName}),this.isJavaTarget){if(this.options.codeMakerOutput.includes("/")||this.options.codeMakerOutput.includes("\\"))throw ir.Errors.Usage('When using Java the "codeMakerOutput" option in the cdktf.json must be the organization identifier for your project (e.g. com.my-company), not a path. The generated Java code will be placed in a subdirectory of the given directory. If you are migrating from a < 0.19 version of cdktf you want to change the codemakerOutput to "imports".');i.java={outdir:".",package:`${this.options.codeMakerOutput}.${t.srcMakName}`}}if(this.isCsharpTarget&&(i.csharp={outdir:this.codeMakerOutdir,namespace:t.srcMakName}),this.isGoTarget){let o=st.join(this.codeMakerOutdir,(r=t.namespace)!==null&&r!==void 0?r:"");i.golang={outdir:o,moduleName:await(0,Yi.determineGoModuleName)(o),packageName:t.srcMakName}}process.env.NODE_OPTIONS&&!process.env.NODE_OPTIONS.includes("--max-old-space-size")?ir.logger.warn(`found NODE_OPTIONS environment variable without a setting for --max-old-space-size.
88
88
  The provider generation needs a substantial amount of memory (~13GB) for some providers and languages.
89
89
  So cdktn-cli sets it to NODE_OPTIONS="--max-old-space-size=16384" by default. As your environment already contains
90
90
  a NODE_OPTIONS variable, we won't override it. Hence, the provider generation might fail with an out of memory error.`):process.env.NODE_OPTIONS="--max-old-space-size=16384";let s=(0,ir.logTimespan)("JSII");await jbe(this.code,i,this.codeMakerOutdir,[t.isModule?"providers/**":"modules/**"]),s()}async getSchemas(t){return await(0,k2t.readSchema)(t,this.schemaCachePath,this.options.targetVersions)}async generate(t,r=t){let n=r.map(a=>ir.ConstructsMakerTarget.from(a,this.options.targetLanguage)),i=(0,ir.logTimespan)("Gathering schema"),s=await this.getSchemas(r);i();let o=(0,ir.logTimespan)("Generate TS");if(await Promise.all(n.map(a=>this.generateTypescript(a,s))),o(),this.updateVersionsFile(t),this.emitConstraintsFile(t,s.providerSchema),this.isJavascriptTarget&&await this.save(),!this.isJavascriptTarget||this.options.outputJsii){let a=Math.max(1,this.options.jsiiParallelism===-1?n.length:this.options.jsiiParallelism||1),c=[...n],u=new Array(a).fill(async()=>{let l;for(;l=c.pop();){let d=(0,ir.logTimespan)(`Generating JSII bindings for ${l.name}`);await this.generateJsiiLanguage(l),d()}});await Promise.all(u.map(l=>l()))}for(let a of n)await this.reportTelemetry({trackingPayload:a.trackingPayload,targetLanguage:a.targetLanguage});if(this.isPythonTarget){let a=(0,ir.logTimespan)("Python post-processing"),c=$be.glob.sync("**/__init__.py",{cwd:this.codeMakerOutdir}).sort((l,d)=>l.split("/").length-d.split("/").length),u=[];for(let l of c){let d=st.dirname(l);if(u.some(h=>d.startsWith(h)))continue;u.push(d);let f=st.join(this.codeMakerOutdir,l),g=(await hr.readFile(f,"utf8")).replace(/from \. import .*\n/g,"");await hr.writeFile(f,g)}a()}}async save(t=this.codeMakerOutdir){await this.code.save(t)}get isJavascriptTarget(){return this.options.targetLanguage===oo.Language.TYPESCRIPT}get isPythonTarget(){return this.options.targetLanguage===oo.Language.PYTHON}get isJavaTarget(){return this.options.targetLanguage===oo.Language.JAVA}get isCsharpTarget(){return this.options.targetLanguage===oo.Language.CSHARP}get isGoTarget(){return this.options.targetLanguage===oo.Language.GO}};Yi.ConstructsMaker=SY;var U2t=async e=>{let t,r=st.resolve(e);do{let n=[];try{n=await hr.readdir(r)}catch(i){if(i.code!=="ENOENT")throw i}if(n.includes("go.mod")){let i=st.resolve(r,"go.mod"),s=await hr.readFile(i),o=/^module\s*(\S*)\s*$/m.exec(s.toString());if(o&&o[1]){let a=st.relative(r,e).replace(/\\/g,"/");return a.length>0?`${o[1]}/${a}`:o[1]}throw new Error(`Could not determine the root Go module name. Found ${i} but failed to regex match the module name directive`)}t=r,r=st.dirname(r)}while(r!==t);throw new Error(`Could not determine the root Go module name. No go.mod found in ${e} and any parent directories`)};Yi.determineGoModuleName=U2t});var UB=p(Sr=>{"use strict";var O2t=Sr&&Sr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),M2t=Sr&&Sr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&O2t(t,e,r)};Object.defineProperty(Sr,"__esModule",{value:!0});Sr.generateProviderBindingsFromSchema=Sr.CodeMaker=Sr.TerraformProviderGenerator=Sr.escapeAttributeName=Sr.sanitizeClassOrNamespaceName=Sr.isLocalModule=Sr.TerraformProviderConstraint=Sr.TerraformModuleConstraint=Sr.isRegistryModule=void 0;M2t(wY(),Sr);var PD=tt();Object.defineProperty(Sr,"isRegistryModule",{enumerable:!0,get:function(){return PD.isRegistryModule}});Object.defineProperty(Sr,"TerraformModuleConstraint",{enumerable:!0,get:function(){return PD.TerraformModuleConstraint}});Object.defineProperty(Sr,"TerraformProviderConstraint",{enumerable:!0,get:function(){return PD.TerraformProviderConstraint}});Object.defineProperty(Sr,"isLocalModule",{enumerable:!0,get:function(){return PD.isLocalModule}});var L2t=cY();Object.defineProperty(Sr,"sanitizeClassOrNamespaceName",{enumerable:!0,get:function(){return L2t.sanitizeClassOrNamespaceName}});var zbe=fc();Object.defineProperty(Sr,"CodeMaker",{enumerable:!0,get:function(){return zbe.CodeMaker}});var W2t=wY(),V2t=Rg();Object.defineProperty(Sr,"escapeAttributeName",{enumerable:!0,get:function(){return V2t.escapeAttributeName}});var qbe=IY();Object.defineProperty(Sr,"TerraformProviderGenerator",{enumerable:!0,get:function(){return qbe.TerraformProviderGenerator}});async function H2t(e,t,r){let n=new zbe.CodeMaker;new qbe.TerraformProviderGenerator(n,t).generateAll(),await n.save(e),r&&await(0,W2t.generateJsiiLanguage)(n,r,e)}Sr.generateProviderBindingsFromSchema=H2t});var Nf=p((mbr,tEe)=>{"use strict";var Y2t=require("node:tty"),$2t=Y2t?.WriteStream?.prototype?.hasColors?.()??!1,bt=(e,t)=>{if(!$2t)return i=>i;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return i=>{let s=i+"",o=s.indexOf(n);if(o===-1)return r+s+n;let a=r,c=0,l=(t===22?n:"")+r;for(;o!==-1;)a+=s.slice(c,o)+l,c=o+n.length,o=s.indexOf(n,c);return a+=s.slice(c)+n,a}},yt={};yt.reset=bt(0,0);yt.bold=bt(1,22);yt.dim=bt(2,22);yt.italic=bt(3,23);yt.underline=bt(4,24);yt.overline=bt(53,55);yt.inverse=bt(7,27);yt.hidden=bt(8,28);yt.strikethrough=bt(9,29);yt.black=bt(30,39);yt.red=bt(31,39);yt.green=bt(32,39);yt.yellow=bt(33,39);yt.blue=bt(34,39);yt.magenta=bt(35,39);yt.cyan=bt(36,39);yt.white=bt(37,39);yt.gray=bt(90,39);yt.bgBlack=bt(40,49);yt.bgRed=bt(41,49);yt.bgGreen=bt(42,49);yt.bgYellow=bt(43,49);yt.bgBlue=bt(44,49);yt.bgMagenta=bt(45,49);yt.bgCyan=bt(46,49);yt.bgWhite=bt(47,49);yt.bgGray=bt(100,49);yt.redBright=bt(91,39);yt.greenBright=bt(92,39);yt.yellowBright=bt(93,39);yt.blueBright=bt(94,39);yt.magentaBright=bt(95,39);yt.cyanBright=bt(96,39);yt.whiteBright=bt(97,39);yt.bgRedBright=bt(101,49);yt.bgGreenBright=bt(102,49);yt.bgYellowBright=bt(103,49);yt.bgBlueBright=bt(104,49);yt.bgMagentaBright=bt(105,49);yt.bgCyanBright=bt(106,49);yt.bgWhiteBright=bt(107,49);tEe.exports=yt});var cEe=p((Gbr,aEe)=>{"use strict";aEe.exports=tRt;function eRt(e){let t={defaultWidth:0,output:process.stdout,tty:require("tty")};return e?(Object.keys(t).forEach(function(r){e[r]||(e[r]=t[r])}),e):t}function tRt(e){let t=eRt(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let r=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(r)&&r!==0)return r}return t.defaultWidth}});var lEe=p((Zbr,DY)=>{"use strict";var uEe=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);DY.exports=uEe;DY.exports.default=uEe});var fEe=p((Ubr,dEe)=>{"use strict";dEe.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var NY=p((Obr,QY)=>{"use strict";var rRt=_f(),nRt=lEe(),iRt=fEe(),AEe=e=>{if(typeof e!="string"||e.length===0||(e=rRt(e),e.length===0))return 0;e=e.replace(iRt()," ");let t=0;for(let r=0;r<e.length;r++){let n=e.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,t+=nRt(n)?2:1)}return t};QY.exports=AEe;QY.exports.default=AEe});var pEe=p((Mbr,hEe)=>{"use strict";var LB=NY(),sRt=_f(),oRt=UG(),kY=new Set(["\x1B","\x9B"]),aRt=39,gEe=e=>`${kY.values().next().value}[${e}m`,cRt=e=>e.split(" ").map(t=>LB(t)),TY=(e,t,r)=>{let n=[...t],i=!1,s=LB(sRt(e[e.length-1]));for(let[o,a]of n.entries()){let c=LB(a);if(s+c<=r?e[e.length-1]+=a:(e.push(a),s=0),kY.has(a))i=!0;else if(i&&a==="m"){i=!1;continue}i||(s+=c,s===r&&o<n.length-1&&(e.push(""),s=0))}!s&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},uRt=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(LB(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},lRt=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i="",s,o=cRt(e),a=[""];for(let[c,u]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimLeft());let l=LB(a[a.length-1]);if(c!==0&&(l>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),l=0),(l>0||r.trim===!1)&&(a[a.length-1]+=" ",l++)),r.hard&&o[c]>t){let d=t-l,f=1+Math.floor((o[c]-d-1)/t);Math.floor((o[c]-1)/t)<f&&a.push(""),TY(a,u,t);continue}if(l+o[c]>t&&l>0&&o[c]>0){if(r.wordWrap===!1&&l<t){TY(a,u,t);continue}a.push("")}if(l+o[c]>t&&r.wordWrap===!1){TY(a,u,t);continue}a[a.length-1]+=u}r.trim!==!1&&(a=a.map(uRt)),n=a.join(`
@@ -390,7 +390,7 @@ Command output on stdout:
390
390
  `),h="";return c&&(h=l.style.error(c)),[`${d} ${A} ${o}`,[g,h].filter(Boolean).join(`
391
391
  `)]});var p6=an((e,t)=>{let{validate:r=()=>!0}=e,n=kr(e.theme),[i,s]=rt("idle"),[o,a]=rt(),[c,u]=rt(""),l=sn({status:i,theme:n});on(async(h,m)=>{if(i==="idle")if(nn(h)){let I=c;s("loading");let C=await r(I);C===!0?(u(I),s("done"),t(I)):(m.write(c),a(C||"You must provide a valid value"),s("idle"))}else u(m.line),a(void 0)});let d=n.style.message(e.message,i),f="",A;e.mask?f=(typeof e.mask=="string"?e.mask:"*").repeat(c.length):i!=="done"&&(A=`${n.style.help("[input is masked]")}${J0}`),i==="done"&&(f=n.style.answer(f));let g="";return o&&(g=n.style.error(o)),[[l,d,e.mask?f:A].join(" "),g]});var Hg=ve(Nf(),1);var pDt={icon:{cursor:qo.pointer},style:{disabled:e=>Hg.default.dim(`- ${e}`),searchTerm:e=>Hg.default.cyan(e),description:e=>Hg.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${Hg.default.bold(t)} ${Hg.default.dim(r)}`).join(Hg.default.dim(" \u2022 "))},helpMode:"always"};function m6(e){return!Ft.isSeparator(e)&&!e.disabled}function mDt(e){return e.map(t=>{if(Ft.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var IDt=an((e,t)=>{let{pageSize:r=7,validate:n=()=>!0}=e,i=kr(pDt,e.theme),[s,o]=rt("loading"),[a,c]=rt(""),[u,l]=rt([]),[d,f]=rt(),A=sn({status:s,theme:i}),g=Rs(()=>{let H=u.findIndex(m6),N=u.findLastIndex(m6);return{first:H,last:N}},[u]),[h=g.first,m]=rt();ao(()=>{let H=new AbortController;return o("loading"),f(void 0),(async()=>{try{let Y=await e.source(a||void 0,{signal:H.signal});H.signal.aborted||(m(void 0),f(void 0),l(mDt(Y)),o("idle"))}catch(Y){!H.signal.aborted&&Y instanceof Error&&f(Y.message)}})(),()=>{H.abort()}},[a]);let I=u[h];on(async(H,N)=>{if(nn(H))if(I){o("loading");let Y=await n(I.value);o("idle"),Y===!0?(o("done"),t(I.value)):I.name===a?f(Y||"You must provide a valid value"):(N.write(I.name),c(I.name))}else N.write(a);else if(od(H)&&I)N.clearLine(0),N.write(I.name),c(I.name);else if(s!=="loading"&&(si(H)||xs(H))){if(N.clearLine(0),si(H)&&h!==g.first||xs(H)&&h!==g.last){let Y=si(H)?-1:1,K=h;do K=(K+Y+u.length)%u.length;while(!m6(u[K]));m(K)}}else c(N.line)});let C=i.style.message(e.message,s),b;if(i.helpMode!=="never")if(e.instructions){let{pager:H,navigation:N}=e.instructions;b=i.style.help(u.length>r?H:N)}else b=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let S=Gg({items:u,active:h,renderItem({item:H,isActive:N}){if(Ft.isSeparator(H))return` ${H.separator}`;if(H.disabled){let ie=typeof H.disabled=="string"?H.disabled:"(disabled)";return i.style.disabled(`${H.name} ${ie}`)}let Y=N?i.style.highlight:ie=>ie,K=N?i.icon.cursor:" ";return Y(`${K} ${H.name}`)},pageSize:r,loop:!1}),R;d?R=i.style.error(d):u.length===0&&a!==""&&s==="idle"&&(R=i.style.error("No results found"));let Q;if(s==="done"&&I)return[A,C,i.style.answer(I.short)].filter(Boolean).join(" ").trimEnd();Q=i.style.searchTerm(a);let k=I?.description,v=[A,C,Q].filter(Boolean).join(" ").trimEnd(),T=[R??S," ",k?i.style.description(k):"",b].filter(Boolean).join(`
392
392
  `).trimEnd();return[v,T]});var nm=ve(Nf(),1);var yDt={icon:{cursor:qo.pointer},style:{disabled:e=>nm.default.dim(`- ${e}`),description:e=>nm.default.cyan(e),keysHelpTip:e=>e.map(([t,r])=>`${nm.default.bold(t)} ${nm.default.dim(r)}`).join(nm.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function rm(e){return!Ft.isSeparator(e)&&!e.disabled}function CDt(e){return e.map(t=>{if(Ft.isSeparator(t))return t;if(typeof t=="string")return{value:t,name:t,short:t,disabled:!1};let r=t.name??String(t.value),n={value:t.value,name:r,short:t.short??r,disabled:t.disabled??!1};return t.description&&(n.description=t.description),n})}var Pg=an((e,t)=>{let{loop:r=!0,pageSize:n=7}=e,i=kr(yDt,e.theme),{keybindings:s}=i,[o,a]=rt("idle"),c=sn({status:o,theme:i}),u=Fg(),l=!s.includes("vim"),d=Rs(()=>CDt(e.choices),[e.choices]),f=Rs(()=>{let k=d.findIndex(rm),v=d.findLastIndex(rm);if(k===-1)throw new jc("[select prompt] No selectable choices. All choices are disabled.");return{first:k,last:v}},[d]),A=Rs(()=>"default"in e?d.findIndex(k=>rm(k)&&k.value===e.default):-1,[e.default,d]),[g,h]=rt(A===-1?f.first:A),m=d[g];on((k,v)=>{if(clearTimeout(u.current),nn(k))a("done"),t(m.value);else if(si(k,s)||xs(k,s)){if(v.clearLine(0),r||si(k,s)&&g!==f.first||xs(k,s)&&g!==f.last){let T=si(k,s)?-1:1,H=g;do H=(H+T+d.length)%d.length;while(!rm(d[H]));h(H)}}else if(OB(k)&&!Number.isNaN(Number(v.line))){let T=Number(v.line)-1,H=-1,N=d.findIndex(K=>Ft.isSeparator(K)?!1:(H++,H===T)),Y=d[N];Y!=null&&rm(Y)&&h(N),u.current=setTimeout(()=>{v.clearLine(0)},700)}else if(Ng(k))v.clearLine(0);else if(l){let T=v.line.toLowerCase(),H=d.findIndex(N=>Ft.isSeparator(N)||!rm(N)?!1:N.name.toLowerCase().startsWith(T));H!==-1&&h(H),u.current=setTimeout(()=>{v.clearLine(0)},700)}}),ao(()=>()=>{clearTimeout(u.current)},[]);let I=i.style.message(e.message,o),C;if(i.helpMode!=="never")if(e.instructions){let{pager:k,navigation:v}=e.instructions;C=i.style.help(d.length>n?k:v)}else C=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let b=0,S=Gg({items:d,active:g,renderItem({item:k,isActive:v,index:T}){if(Ft.isSeparator(k))return b++,` ${k.separator}`;let H=i.indexMode==="number"?`${T+1-b}. `:"";if(k.disabled){let K=typeof k.disabled=="string"?k.disabled:"(disabled)";return i.style.disabled(`${H}${k.name} ${K}`)}let N=v?i.style.highlight:K=>K,Y=v?i.icon.cursor:" ";return N(`${Y} ${H}${k.name}`)},pageSize:n,loop:r});if(o==="done")return[c,I,i.style.answer(m.short)].filter(Boolean).join(" ");let{description:R}=m;return`${[[c,I].filter(Boolean).join(" "),S," ",R?i.style.description(R):"",C].filter(Boolean).join(`
393
- `).trimEnd()}${J0}`});var RLe=ve(hve());var um=ve(require("fs")),Dve=ve(require("os"));var Qve=ve(Sve()),Nve=ve(Md());var F6=ve(require("https")),wve=ve(require("querystring")),k6=require("path");var MQ;async function uQt(e){return MQ||new Promise((t,r)=>{F6.default.request(new URL(`https://${e}/.well-known/terraform.json`).toString(),i=>{if(i.statusCode!==200){let o=new Error(i.statusMessage);return o.statusCode=i.statusCode,r(o)}let s=new Array;i.on("data",o=>s.push(o)),i.once("error",o=>r(o)),i.once("end",()=>(MQ=JSON.parse(Buffer.concat(s).toString("utf-8")),t(MQ)))}).end()})}async function G6(e,t){return new Promise((r,n)=>{F6.default.request(new URL(e).toString(),{headers:{Authorization:`Bearer ${t}`,"User-Agent":"OpenConstructs/cdktn-cli"}},s=>{if(s.statusCode!==200){s.statusCode===401&&console.log("ERROR: Your existing token for Terraform Cloud is invalid.");let a=new Error(s.statusMessage);return a.statusCode=s.statusCode,n(a)}let o=new Array;s.on("data",a=>o.push(a)),s.once("error",a=>n(a)),s.once("end",()=>{let a=JSON.parse(Buffer.concat(o).toString("utf-8"));return r(a)})}).end()})}async function Z6(e,t){let n=(await uQt(e))["tfe.v2"];return/^https?:/.test(n)?(0,k6.join)(n,t):`https://${(0,k6.join)(e,n,t)}`}async function LQ(e,t){return await G6(await Z6(e,"/account/details"),t)}async function _ve(e,t){return(await G6(await Z6(e,"/organizations"),t)).data.map(n=>n.id)}async function xve(e,t,r,n){let i=await Z6(e,`/organizations/${t}/workspaces`),s=wve.default.stringify({"search[name]":r}),o=await G6(`${i}?${s}`,n);return o.data.length>0&&o.data[0].attributes.name===r}var nv=ve(tt()),Rve=new Nve.Instance,lQt=Dve.homedir(),rv=`${lQt}/.terraform.d/credentials.tfrc.json`,dQt=e=>nv.Errors.Usage(`You are trying to use terraform init in a non-interactive mode while ${e?"having an invalid token for":"not being logged in to"} Terraform Cloud. This can also happen when running cdktn convert against a project not using Typescript, since we need to create a temporary cdktn project for an accurate translation. Please run 'cdktn login' to log in.`),cm=class{constructor(t){this.tfeHostname=t}get terraformLoginURL(){return`https://${this.tfeHostname}/app/settings/tokens?source=terraform-login`}async askToContinue(){console.log(Rve`{greenBright Welcome to CDK Terrain!}
393
+ `).trimEnd()}${J0}`});var RLe=ve(hve());var um=ve(require("fs")),Dve=ve(require("os"));var Qve=ve(Sve()),Nve=ve(Md());var F6=ve(require("https")),wve=ve(require("querystring")),k6=require("path");var MQ;async function uQt(e){return MQ||new Promise((t,r)=>{F6.default.request(new URL(`https://${e}/.well-known/terraform.json`).toString(),i=>{if(i.statusCode!==200){let o=new Error(i.statusMessage);return o.statusCode=i.statusCode,r(o)}let s=new Array;i.on("data",o=>s.push(o)),i.once("error",o=>r(o)),i.once("end",()=>(MQ=JSON.parse(Buffer.concat(s).toString("utf-8")),t(MQ)))}).end()})}async function G6(e,t){return new Promise((r,n)=>{F6.default.request(new URL(e).toString(),{headers:{Authorization:`Bearer ${t}`,"User-Agent":"OpenConstructs/cdktn-cli"}},s=>{if(s.statusCode!==200){s.statusCode===401&&console.log("ERROR: Your existing token for Terraform Cloud is invalid.");let a=new Error(s.statusMessage);return a.statusCode=s.statusCode,n(a)}let o=new Array;s.on("data",a=>o.push(a)),s.once("error",a=>n(a)),s.once("end",()=>{let a=JSON.parse(Buffer.concat(o).toString("utf-8"));return r(a)})}).end()})}async function Z6(e,t){let n=(await uQt(e))["tfe.v2"];return/^https?:/.test(n)?k6.posix.join(n,t):`https://${k6.posix.join(e,n,t)}`}async function LQ(e,t){return await G6(await Z6(e,"/account/details"),t)}async function _ve(e,t){return(await G6(await Z6(e,"/organizations"),t)).data.map(n=>n.id)}async function xve(e,t,r,n){let i=await Z6(e,`/organizations/${t}/workspaces`),s=wve.default.stringify({"search[name]":r}),o=await G6(`${i}?${s}`,n);return o.data.length>0&&o.data[0].attributes.name===r}var nv=ve(tt()),Rve=new Nve.Instance,lQt=Dve.homedir(),rv=`${lQt}/.terraform.d/credentials.tfrc.json`,dQt=e=>nv.Errors.Usage(`You are trying to use terraform init in a non-interactive mode while ${e?"having an invalid token for":"not being logged in to"} Terraform Cloud. This can also happen when running cdktn convert against a project not using Typescript, since we need to create a temporary cdktn project for an accurate translation. Please run 'cdktn login' to log in.`),cm=class{constructor(t){this.tfeHostname=t}get terraformLoginURL(){return`https://${this.tfeHostname}/app/settings/tokens?source=terraform-login`}async askToContinue(){console.log(Rve`{greenBright Welcome to CDK Terrain!}
394
394
 
395
395
  By default, cdktn allows you to manage the state of your stacks using Terraform Cloud for free.
396
396
  cdktn will request an API token for ${this.tfeHostname} using your browser.