ortedErrors.has(n)||(this.reportedErrors.add(n),this.reportError(e,r),(s=i==null?void 0:i.reportExtra)==null||s.call(i,this))}reportExceptionOnce(e){lke(e)?this.reportErrorOnce(e.reportCode,e.message,{key:e,reportExtra:e.reportExtra}):this.reportErrorOnce($.EXCEPTION,e.stack||e.message,{key:e})}createStreamReporter(e=null){let r=new $8.PassThrough,i=new e4.StringDecoder,n="";return r.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(`
`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",e!==null?this.reportInfo(null,`${e} ${l}`):this.reportInfo(null,l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&(e!==null?this.reportInfo(null,`${e} ${s}`):this.reportInfo(null,s))}),r}};var wd=class{constructor(e){this.fetchers=e}supports(e,r){return!!this.tryFetcher(e,r)}getLocalPath(e,r){return this.getFetcher(e,r).getLocalPath(e,r)}async fetch(e,r){return await this.getFetcher(e,r).fetch(e,r)}tryFetcher(e,r){let i=this.fetchers.find(n=>n.supports(e,r));return i||null}getFetcher(e,r){let i=this.fetchers.find(n=>n.supports(e,r));if(!i)throw new ct($.FETCHER_NOT_FOUND,`${Bt(r.project.configuration,e)} isn't supported by any available fetcher`);return i}};var Bd=class{constructor(e){this.resolvers=e.filter(r=>r)}supportsDescriptor(e,r){return!!this.tryResolverByDescriptor(e,r)}supportsLocator(e,r){return!!this.tryResolverByLocator(e,r)}shouldPersistResolution(e,r){return this.getResolverByLocator(e,r).shouldPersistResolution(e,r)}bindDescriptor(e,r,i){return this.getResolverByDescriptor(e,i).bindDescriptor(e,r,i)}getResolutionDependencies(e,r){return this.getResolverByDescriptor(e,r).getResolutionDependencies(e,r)}async getCandidates(e,r,i){return await this.getResolverByDescriptor(e,i).getCandidates(e,r,i)}async getSatisfying(e,r,i){return this.getResolverByDescriptor(e,i).getSatisfying(e,r,i)}async resolve(e,r){return await this.getResolverByLocator(e,r).resolve(e,r)}tryResolverByDescriptor(e,r){let i=this.resolvers.find(n=>n.supportsDescriptor(e,r));return i||null}getResolverByDescriptor(e,r){let i=this.resolvers.find(n=>n.supportsDescriptor(e,r));if(!i)throw new Error(`${sr(r.project.configuration,e)} isn't supported by any available resolver`);return i}tryResolverByLocator(e,r){let i=this.resolvers.find(n=>n.supportsLocator(e,r));return i||null}getResolverByLocator(e,r){let i=this.resolvers.find(n=>n.supportsLocator(e,r));if(!i)throw new Error(`${Bt(r.project.configuration,e)} isn't supported by any available resolver`);return i}};var t4=ge(ri());var qg=/^(?!v)[a-z0-9._-]+$/i,dx=class{supportsDescriptor(e,r){return!!(ho(e.range)||qg.test(e.range))}supportsLocator(e,r){return!!(t4.default.valid(e.reference)||qg.test(e.reference))}shouldPersistResolution(e,r){return r.resolver.shouldPersistResolution(this.forwardLocator(e,r),r)}bindDescriptor(e,r,i){return i.resolver.bindDescriptor(this.forwardDescriptor(e,i),r,i)}getResolutionDependencies(e,r){return r.resolver.getResolutionDependencies(this.forwardDescriptor(e,r),r)}async getCandidates(e,r,i){return await i.resolver.getCandidates(this.forwardDescriptor(e,i),r,i)}async getSatisfying(e,r,i){return await i.resolver.getSatisfying(this.forwardDescriptor(e,i),r,i)}async resolve(e,r){let i=await r.resolver.resolve(this.forwardLocator(e,r),r);return cd(i,e)}forwardDescriptor(e,r){return rr(e,`${r.project.configuration.get("defaultProtocol")}${e.range}`)}forwardLocator(e,r){return cn(e,`${r.project.configuration.get("defaultProtocol")}${e.reference}`)}};var bd=class{supports(e){return!!e.reference.startsWith("virtual:")}getLocalPath(e,r){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n);return r.fetcher.getLocalPath(s,r)}async fetch(e,r){let i=e.reference.indexOf("#");if(i===-1)throw new Error("Invalid virtual package reference");let n=e.reference.slice(i+1),s=cn(e,n),o=await r.fetcher.fetch(s,r);return await this.ensureVirtualLink(e,o,r)}getLocatorFilename(e){return jg(e)}async ensureVirtualLink(e,r,i){let n=r.packageFs.getRealPath(),s=i.project.configuration.get("virtualFolder"),o=this.getLocatorFilename(e),a=Wr.makeVirtualPath(s,o,n),l=new Da(a,{baseFs:r.packageFs,pathUtils:x});return ie(N({},r),{packageFs:l})}};var Jg=class{static isVirtualDescriptor(e){return!!e.range.startsWith(Jg.protocol)}static isVirtualLocator(e){return!!e.reference.startsWith(Jg.protocol)}supportsDescriptor(e,r){return Jg.isVirtualDescriptor(e)}supportsLocator(e,r){return Jg.isVirtualLocator(e)}shouldPersistResolution(e,r){return!1}bindDescriptor(e,r,i){throw new Error('Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported')}getResolutionDependencies(e,r){throw new Error('Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported')}async getCandidates(e,r,i){throw new Error('Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported')}async getSatisfying(e,r,i){throw new Error('Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported')}async resolve(e,r){throw new Error('Assertion failed: calling "resolve" on a virtual locator is unsupported')}},Ew=Jg;Ew.protocol="virtual:";var Qd=class{supports(e){return!!e.reference.startsWith(oi.protocol)}getLocalPath(e,r){return this.getWorkspace(e,r).cwd}async fetch(e,r){let i=this.getWorkspace(e,r).cwd;return{packageFs:new _t(i),prefixPath:Ke.dot,localPath:i}}getWorkspace(e,r){return r.project.getWorkspaceByCwd(e.reference.slice(oi.protocol.length))}};var Cx={};ft(Cx,{getDefaultGlobalFolder:()=>Ex,getHomeFolder:()=>vd,isFolderInside:()=>Ix});var mx=ge(require("os"));function Ex(){if(process.platform==="win32"){let t=H.toPortablePath(process.env.LOCALAPPDATA||H.join((0,mx.homedir)(),"AppData","Local"));return x.resolve(t,"Yarn/Berry")}if(process.env.XDG_DATA_HOME){let t=H.toPortablePath(process.env.XDG_DATA_HOME);return x.resolve(t,"yarn/berry")}return x.resolve(vd(),".yarn/berry")}function vd(){return H.toPortablePath((0,mx.homedir)()||"/usr/local/share")}function Ix(t,e){let r=x.relative(e,t);return r&&!r.startsWith("..")&&!x.isAbsolute(r)}var Wg={};ft(Wg,{builtinModules:()=>yx,getArchitecture:()=>Sd,getArchitectureName:()=>uke,getArchitectureSet:()=>wx});var r4=ge(require("module"));function yx(){return new Set(r4.default.builtinModules||Object.keys(process.binding("natives")))}function cke(){var i,n,s,o;if(process.platform==="win32")return null;let e=(s=((n=(i=process.report)==null?void 0:i.getReport())!=null?n:{}).sharedObjects)!=null?s:[],r=/\/(?:(ld-linux-|[^/]+-linux-gnu\/)|(libc.musl-|ld-musl-))/;return(o=ed(e,a=>{let l=a.match(r);if(!l)return ed.skip;if(l[1])return"glibc";if(l[2])return"musl";throw new Error("Assertion failed: Expected the libc variant to have been detected")}))!=null?o:null}var Iw,yw;function Sd(){return Iw=Iw!=null?Iw:{os:process.platform,cpu:process.arch,libc:cke()}}function uke(t=Sd()){return t.libc?`${t.os}-${t.cpu}-${t.libc}`:`${t.os}-${t.cpu}`}function wx(){let t=Sd();return yw=yw!=null?yw:{os:[t.os],cpu:[t.cpu],libc:t.libc?[t.libc]:[]}}var gke=new Set(["binFolder","version","flags","profile","gpg","ignoreNode","wrapOutput","home","confDir"]),Bw="yarn_",bx=".yarnrc.yml",Qx="yarn.lock",fke="********",ye;(function(u){u.ANY="ANY",u.BOOLEAN="BOOLEAN",u.ABSOLUTE_PATH="ABSOLUTE_PATH",u.LOCATOR="LOCATOR",u.LOCATOR_LOOSE="LOCATOR_LOOSE",u.NUMBER="NUMBER",u.STRING="STRING",u.SECRET="SECRET",u.SHAPE="SHAPE",u.MAP="MAP"})(ye||(ye={}));var Di=Ye,vx={lastUpdateCheck:{description:"Last timestamp we checked whether new Yarn versions were available",type:ye.STRING,default:null},yarnPath:{description:"Path to the local executable that must be used over the global one",type:ye.ABSOLUTE_PATH,default:null},ignorePath:{description:"If true, the local executable will be ignored when using the global one",type:ye.BOOLEAN,default:!1},ignoreCwd:{description:"If true, the `--cwd` flag will be ignored",type:ye.BOOLEAN,default:!1},cacheKeyOverride:{description:"A global cache key override; used only for test purposes",type:ye.STRING,default:null},globalFolder:{description:"Folder where all system-global files are stored",type:ye.ABSOLUTE_PATH,default:Ex()},cacheFolder:{description:"Folder where the cache files must be written",type:ye.ABSOLUTE_PATH,default:"./.yarn/cache"},compressionLevel:{description:"Zip files compression level, from 0 to 9 or mixed (a variant of 9, which stores some files uncompressed, when compression doesn't yield good results)",type:ye.NUMBER,values:["mixed",0,1,2,3,4,5,6,7,8,9],default:nc},virtualFolder:{description:"Folder where the virtual packages (cf doc) will be mapped on the disk (must be named __virtual__)",type:ye.ABSOLUTE_PATH,default:"./.yarn/__virtual__"},lockfileFilename:{description:"Name of the files where the Yarn dependency tree entries must be stored",type:ye.STRING,default:Qx},installStatePath:{description:"Path of the file where the install state will be persisted",type:ye.ABSOLUTE_PATH,default:"./.yarn/install-state.gz"},immutablePatterns:{description:"Array of glob patterns; files matching them won't be allowed to change during immutable installs",type:ye.STRING,default:[],isArray:!0},rcFilename:{description:"Name of the files where the configuration can be found",type:ye.STRING,default:bw()},enableGlobalCache:{description:"If true, the system-wide cache folder will be used regardless of `cache-folder`",type:ye.BOOLEAN,default:!1},enableColors:{description:"If true, the CLI is allowed to use colors in its output",type:ye.BOOLEAN,default:Ny,defaultText:"<dynamic>"},enableHyperlinks:{description:"If true, the CLI is allowed to use hyperlinks in its output",type:ye.BOOLEAN,default:VS,defaultText:"<dynamic>"},enableInlineBuilds:{description:"If true, the CLI will print the build output on the command line",type:ye.BOOLEAN,default:ww.isCI,defaultText:"<dynamic>"},enableMessageNames:{description:"If true, the CLI will prefix most messages with codes suitable for search engines",type:ye.BOOLEAN,default:!0},enableProgressBars:{description:"If true, the CLI is allowed to show a progress bar for long-running events",type:ye.BOOLEAN,default:!ww.isCI,defaultText:"<dynamic>"},enableTimers:{description:"If true, the CLI is allowed to print the time spent executing commands",type:ye.BOOLEAN,default:!0},preferAggregateCacheInfo:{description:"If true, the CLI will only print a one-line report of any cache changes",type:ye.BOOLEAN,default:ww.isCI},preferInteractive:{description:"If true, the CLI will automatically use the interactive mode when called from a TTY",type:ye.BOOLEAN,default:!1},preferTruncatedLines:{description:"If true, the CLI will truncate lines that would go beyond the size of the terminal",type:ye.BOOLEAN,default:!1},progressBarStyle:{description:"Which style of progress bar should be used (only when progress bars are enabled)",type:ye.STRING,default:void 0,defaultText:"<dynamic>"},defaultLanguageName:{description:"Default language mode that should be used when a package doesn't offer any insight",type:ye.STRING,default:"node"},defaultProtocol:{description:"Default resolution protocol used when resolving pure semver and tag ranges",type:ye.STRING,default:"npm:"},enableTransparentWorkspaces:{description:"If false, Yarn won't automatically resolve workspace dependencies unless they use the `workspace:` protocol",type:ye.BOOLEAN,default:!0},supportedArchitectures:{description:"Architectures that Yarn will fetch and inject into the resolver",type:ye.SHAPE,properties:{os:{description:"Array of supported process.platform strings, or null to target them all",type:ye.STRING,isArray:!0,isNullable:!0,default:["current"]},cpu:{description:"Array of supported process.arch strings, or null to target them all",type:ye.STRING,isArray:!0,isNullable:!0,default:["current"]},libc:{description:"Array of supported libc libraries, or null to target them all",type:ye.STRING,isArray:!0,isNullable:!0,default:["current"]}}},enableMirror:{description:"If true, the downloaded packages will be retrieved and stored in both the local and global folders",type:ye.BOOLEAN,default:!0},enableNetwork:{description:"If false, the package manager will refuse to use the network if required to",type:ye.BOOLEAN,default:!0},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:ye.STRING,default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:ye.STRING,default:null},unsafeHttpWhitelist:{description:"List of the hostnames for which http queries are allowed (glob patterns are supported)",type:ye.STRING,default:[],isArray:!0},httpTimeout:{description:"Timeout of each http request in milliseconds",type:ye.NUMBER,default:6e4},httpRetry:{description:"Retry times on http failure",type:ye.NUMBER,default:3},networkConcurrency:{description:"Maximal number of concurrent requests",type:ye.NUMBER,default:50},networkSettings:{description:"Network settings per hostname (glob patterns are supported)",type:ye.MAP,valueDefinition:{description:"",type:ye.SHAPE,properties:{caFilePath:{description:"Path to file containing one or multiple Certificate Authority signing certificates",type:ye.ABSOLUTE_PATH,default:null},enableNetwork:{description:"If false, the package manager will refuse to use the network if required to",type:ye.BOOLEAN,default:null},httpProxy:{description:"URL of the http proxy that must be used for outgoing http requests",type:ye.STRING,default:null},httpsProxy:{description:"URL of the http proxy that must be used for outgoing https requests",type:ye.STRING,default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:ye.ABSOLUTE_PATH,default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:ye.ABSOLUTE_PATH,default:null}}}},caFilePath:{description:"A path to a file containing one or multiple Certificate Authority signing certificates",type:ye.ABSOLUTE_PATH,default:null},httpsKeyFilePath:{description:"Path to file containing private key in PEM format",type:ye.ABSOLUTE_PATH,default:null},httpsCertFilePath:{description:"Path to file containing certificate chain in PEM format",type:ye.ABSOLUTE_PATH,default:null},enableStrictSsl:{description:"If false, SSL certificate errors will be ignored",type:ye.BOOLEAN,default:!0},logFilters:{description:"Overrides for log levels",type:ye.SHAPE,isArray:!0,concatenateValues:!0,properties:{code:{description:"Code of the messages covered by this override",type:ye.STRING,default:void 0},text:{description:"Code of the texts covered by this override",type:ye.STRING,default:void 0},pattern:{description:"Code of the patterns covered by this override",type:ye.STRING,default:void 0},level:{description:"Log level override, set to null to remove override",type:ye.STRING,values:Object.values(fo),isNullable:!0,default:void 0}}},enableTelemetry:{description:"If true, telemetry will be periodically sent, following the rules in https://yarnpkg.com/advanced/telemetry",type:ye.BOOLEAN,default:!0},telemetryInterval:{description:"Minimal amount of time between two telemetry uploads, in days",type:ye.NUMBER,default:7},telemetryUserId:{description:"If you desire to tell us which project you are, you can set this field. Completely optional and opt-in.",type:ye.STRING,default:null},enableScripts:{description:"If true, packages are allowed to have install scripts by default",type:ye.BOOLEAN,default:!0},enableStrictSettings:{description:"If true, unknown settings will cause Yarn to abort",type:ye.BOOLEAN,default:!0},enableImmutableCache:{description:"If true, the cache is reputed immutable and actions that would modify it will throw",type:ye.BOOLEAN,default:!1},checksumBehavior:{description:"Enumeration defining what to do when a checksum doesn't match expectations",type:ye.STRING,default:"throw"},packageExtensions:{description:"Map of package corrections to apply on the dependency tree",type:ye.MAP,valueDefinition:{description:"The extension that will be applied to any package whose version matches the specified range",type:ye.SHAPE,properties:{dependencies:{description:"The set of dependencies that must be made available to the current package in order for it to work properly",type:ye.MAP,valueDefinition:{description:"A range",type:ye.STRING}},peerDependencies:{description:"Inherited dependencies - the consumer of the package will be tasked to provide them",type:ye.MAP,valueDefinition:{description:"A semver range",type:ye.STRING}},peerDependenciesMeta:{description:"Extra information related to the dependencies listed in the peerDependencies field",type:ye.MAP,valueDefinition:{description:"The peerDependency meta",type:ye.SHAPE,properties:{optional:{description:"If true, the selected peer dependency will be marked as optional by the package manager and the consumer omitting it won't be reported as an error",type:ye.BOOLEAN,default:!1}}}}}}}};function kx(t,e,r,i,n){if(i.isArray||i.type===ye.ANY&&Array.isArray(r))return Array.isArray(r)?r.map((s,o)=>Sx(t,`${e}[${o}]`,s,i,n)):String(r).split(/,/).map(s=>Sx(t,e,s,i,n));if(Array.isArray(r))throw new Error(`Non-array configuration settings "${e}" cannot be an array`);return Sx(t,e,r,i,n)}function Sx(t,e,r,i,n){var a;switch(i.type){case ye.ANY:return r;case ye.SHAPE:return hke(t,e,r,i,n);case ye.MAP:return pke(t,e,r,i,n)}if(r===null&&!i.isNullable&&i.default!==null)throw new Error(`Non-nullable configuration settings "${e}" cannot be set to null`);if((a=i.values)==null?void 0:a.includes(r))return r;let o=(()=>{if(i.type===ye.BOOLEAN&&typeof r!="string")return rd(r);if(typeof r!="string")throw new Error(`Expected value (${r}) to be a string`);let l=qS(r,{env:process.env});switch(i.type){case ye.ABSOLUTE_PATH:return x.resolve(n,H.toPortablePath(l));case ye.LOCATOR_LOOSE:return Kc(l,!1);case ye.NUMBER:return parseInt(l);case ye.LOCATOR:return Kc(l);case ye.BOOLEAN:return rd(l);default:return l}})();if(i.values&&!i.values.includes(o))throw new Error(`Invalid value, expected one of ${i.values.join(", ")}`);return o}function hke(t,e,r,i,n){if(typeof r!="object"||Array.isArray(r))throw new Pe(`Object configuration settings "${e}" must be an object`);let s=xx(t,i,{ignoreArrays:!0});if(r===null)return s;for(let[o,a]of Object.entries(r)){let l=`${e}.${o}`;if(!i.properties[o])throw new Pe(`Unrecognized configuration settings found: ${e}.${o} - run "yarn config -v" to see the list of settings supported in Yarn`);s.set(o,kx(t,l,a,i.properties[o],n))}return s}function pke(t,e,r,i,n){let s=new Map;if(typeof r!="object"||Array.isArray(r))throw new Pe(`Map configuration settings "${e}" must be an object`);if(r===null)return s;for(let[o,a]of Object.entries(r)){let l=i.normalizeKeys?i.normalizeKeys(o):o,c=`${e}['${l}']`,u=i.valueDefinition;s.set(l,kx(t,c,a,u,n))}return s}function xx(t,e,{ignoreArrays:r=!1}={}){switch(e.type){case ye.SHAPE:{if(e.isArray&&!r)return[];let i=new Map;for(let[n,s]of Object.entries(e.properties))i.set(n,xx(t,s));return i}break;case ye.MAP:return e.isArray&&!r?[]:new Map;case ye.ABSOLUTE_PATH:return e.default===null?null:t.projectCwd===null?x.isAbsolute(e.default)?x.normalize(e.default):e.isNullable?null:void 0:Array.isArray(e.default)?e.default.map(i=>x.resolve(t.projectCwd,i)):x.resolve(t.projectCwd,e.default);default:return e.default}}function Qw(t,e,r){if(e.type===ye.SECRET&&typeof t=="string"&&r.hideSecrets)return fke;if(e.type===ye.ABSOLUTE_PATH&&typeof t=="string"&&r.getNativePaths)return H.fromPortablePath(t);if(e.isArray&&Array.isArray(t)){let i=[];for(let n of t)i.push(Qw(n,e,r));return i}if(e.type===ye.MAP&&t instanceof Map){let i=new Map;for(let[n,s]of t.entries())i.set(n,Qw(s,e.valueDefinition,r));return i}if(e.type===ye.SHAPE&&t instanceof Map){let i=new Map;for(let[n,s]of t.entries()){let o=e.properties[n];i.set(n,Qw(s,o,r))}return i}return t}function dke(){let t={};for(let[e,r]of Object.entries(process.env))e=e.toLowerCase(),!!e.startsWith(Bw)&&(e=(0,i4.default)(e.slice(Bw.length)),t[e]=r);return t}function bw(){let t=`${Bw}rc_filename`;for(let[e,r]of Object.entries(process.env))if(e.toLowerCase()===t&&typeof r=="string")return r;return bx}var al;(function(i){i[i.LOCKFILE=0]="LOCKFILE",i[i.MANIFEST=1]="MANIFEST",i[i.NONE=2]="NONE"})(al||(al={}));var Za=class{constructor(e){this.projectCwd=null;this.plugins=new Map;this.settings=new Map;this.values=new Map;this.sources=new Map;this.invalid=new Map;this.packageExtensions=new Map;this.limits=new Map;this.startingCwd=e}static create(e,r,i){let n=new Za(e);typeof r!="undefined"&&!(r instanceof Map)&&(n.projectCwd=r),n.importSettings(vx);let s=typeof i!="undefined"?i:r instanceof Map?r:new Map;for(let[o,a]of s)n.activatePlugin(o,a);return n}static async find(e,r,{lookup:i=0,strict:n=!0,usePath:s=!1,useRc:o=!0}={}){let a=dke();delete a.rcFilename;let l=await Za.findRcFiles(e),c=await Za.findHomeRcFile();if(c){let b=l.find(S=>S.path===c.path);b?b.strict=!1:l.push(ie(N({},c),{strict:!1}))}let u=({ignoreCwd:b,yarnPath:S,ignorePath:k,lockfileFilename:T})=>({ignoreCwd:b,yarnPath:S,ignorePath:k,lockfileFilename:T}),g=j=>{var Z=j,{ignoreCwd:b,yarnPath:S,ignorePath:k,lockfileFilename:T}=Z,Y=Tr(Z,["ignoreCwd","yarnPath","ignorePath","lockfileFilename"]);return Y},f=new Za(e);f.importSettings(u(vx)),f.useWithSource("<environment>",u(a),e,{strict:!1});for(let{path:b,cwd:S,data:k}of l)f.useWithSource(b,u(k),S,{strict:!1});if(s){let b=f.get("yarnPath"),S=f.get("ignorePath");if(b!==null&&!S)return f}let h=f.get("lockfileFilename"),p;switch(i){case 0:p=await Za.findProjectCwd(e,h);break;case 1:p=await Za.findProjectCwd(e,null);break;case 2:K.existsSync(x.join(e,"package.json"))?p=x.resolve(e):p=null;break}f.startingCwd=e,f.projectCwd=p,f.importSettings(g(vx));let m=new Map([["@@core",h8]]),y=b=>"default"in b?b.default:b;if(r!==null){for(let T of r.plugins.keys())m.set(T,y(r.modules.get(T)));let b=new Map;for(let T of yx())b.set(T,()=>Ng(T));for(let[T,Y]of r.modules)b.set(T,()=>Y);let S=new Set,k=async(T,Y)=>{let{factory:j,name:Z}=Ng(T);if(S.has(Z))return;let J=new Map(b),re=A=>{if(J.has(A))return J.get(A)();throw new Pe(`This plugin cannot access the package referenced via ${A} which is neither a builtin, nor an exposed entry`)},ee=await Rg(async()=>y(await j(re)),A=>`${A} (when initializing ${Z}, defined in ${Y})`);b.set(Z,()=>ee),S.add(Z),m.set(Z,ee)};if(a.plugins)for(let T of a.plugins.split(";")){let Y=x.resolve(e,H.toPortablePath(T));await k(Y,"<environment>")}for(let{path:T,cwd:Y,data:j}of l)if(!!o&&!!Array.isArray(j.plugins))for(let Z of j.plugins){let J=typeof Z!="string"?Z.path:Z,re=x.resolve(Y,H.toPortablePath(J));await k(re,T)}}for(let[b,S]of m)f.activatePlugin(b,S);f.useWithSource("<environment>",g(a),e,{strict:n});for(let{path:b,cwd:S,data:k,strict:T}of l)f.useWithSource(b,g(k),S,{strict:T!=null?T:n});return f.get("enableGlobalCache")&&(f.values.set("cacheFolder",`${f.get("globalFolder")}/cache`),f.sources.set("cacheFolder","<internal>")),await f.refreshPackageExtensions(),f}static async findRcFiles(e){let r=bw(),i=[],n=e,s=null;for(;n!==s;){s=n;let o=x.join(s,r);if(K.existsSync(o)){let a=await K.readFilePromise(o,"utf8"),l;try{l=Qi(a)}catch(c){let u="";throw a.match(/^\s+(?!-)[^:]+\s+\S+/m)&&(u=" (in particular, make sure you list the colons after each key name)"),new Pe(`Parse error when loading ${o}; please check it's proper Yaml${u}`)}i.push({path:o,cwd:s,data:l})}n=x.dirname(s)}return i}static async findHomeRcFile(){let e=bw(),r=vd(),i=x.join(r,e);if(K.existsSync(i)){let n=await K.readFilePromise(i,"utf8"),s=Qi(n);return{path:i,cwd:r,data:s}}return null}static async findProjectCwd(e,r){let i=null,n=e,s=null;for(;n!==s;){if(s=n,K.existsSync(x.join(s,"package.json"))&&(i=s),r!==null){if(K.existsSync(x.join(s,r))){i=s;break}}else if(i!==null)break;n=x.dirname(s)}return i}static async updateConfiguration(e,r){let i=bw(),n=x.join(e,i),s=K.existsSync(n)?Qi(await K.readFilePromise(n,"utf8")):{},o=!1,a;if(typeof r=="function"){try{a=r(s)}catch{a=r({})}if(a===s)return}else{a=s;for(let l of Object.keys(r)){let c=s[l],u=r[l],g;if(typeof u=="function")try{g=u(c)}catch{g=u(void 0)}else g=u;c!==g&&(a[l]=g,o=!0)}if(!o)return}await K.changeFilePromise(n,La(a),{automaticNewlines:!0})}static async updateHomeConfiguration(e){let r=vd();return await Za.updateConfiguration(r,e)}activatePlugin(e,r){this.plugins.set(e,r),typeof r.configuration!="undefined"&&this.importSettings(r.configuration)}importSettings(e){for(let[r,i]of Object.entries(e))if(i!=null){if(this.settings.has(r))throw new Error(`Cannot redefine settings "${r}"`);this.settings.set(r,i),this.values.set(r,xx(this,i))}}useWithSource(e,r,i,n){try{this.use(e,r,i,n)}catch(s){throw s.message+=` (in ${et(this,e,Ye.PATH)})`,s}}use(e,r,i,{strict:n=!0,overwrite:s=!1}={}){n=n&&this.get("enableStrictSettings");for(let o of["enableStrictSettings",...Object.keys(r)]){if(typeof r[o]=="undefined"||o==="plugins"||e==="<environment>"&&gke.has(o))continue;if(o==="rcFilename")throw new Pe(`The rcFilename settings can only be set via ${`${Bw}RC_FILENAME`.toUpperCase()}, not via a rc file`);let l=this.settings.get(o);if(!l){if(n)throw new Pe(`Unrecognized or legacy configuration settings found: ${o} - run "yarn config -v" to see the list of settings supported in Yarn`);this.invalid.set(o,e);continue}if(this.sources.has(o)&&!(s||l.type===ye.MAP||l.isArray&&l.concatenateValues))continue;let c;try{c=kx(this,o,r[o],l,i)}catch(u){throw u.message+=` in ${et(this,e,Ye.PATH)}`,u}if(o==="enableStrictSettings"&&e!=="<environment>"){n=c;continue}if(l.type===ye.MAP){let u=this.values.get(o);this.values.set(o,new Map(s?[...u,...c]:[...c,...u])),this.sources.set(o,`${this.sources.get(o)}, ${e}`)}else if(l.isArray&&l.concatenateValues){let u=this.values.get(o);this.values.set(o,s?[...u,...c]:[...c,...u]),this.sources.set(o,`${this.sources.get(o)}, ${e}`)}else this.values.set(o,c),this.sources.set(o,e)}}get(e){if(!this.values.has(e))throw new Error(`Invalid configuration key "${e}"`);return this.values.get(e)}getSpecial(e,{hideSecrets:r=!1,getNativePaths:i=!1}){let n=this.get(e),s=this.settings.get(e);if(typeof s=="undefined")throw new Pe(`Couldn't find a configuration settings named "${e}"`);return Qw(n,s,{hideSecrets:r,getNativePaths:i})}getSubprocessStreams(e,{header:r,prefix:i,report:n}){let s,o,a=K.createWriteStream(e);if(this.get("enableInlineBuilds")){let l=n.createStreamReporter(`${i} ${et(this,"STDOUT","green")}`),c=n.createStreamReporter(`${i} ${et(this,"STDERR","red")}`);s=new Bx.PassThrough,s.pipe(l),s.pipe(a),o=new Bx.PassThrough,o.pipe(c),o.pipe(a)}else s=a,o=a,typeof r!="undefined"&&s.write(`${r}
`);return{stdout:s,stderr:o}}makeResolver(){let e=[];for(let r of this.plugins.values())for(let i of r.resolvers||[])e.push(new i);return new Bd([new Ew,new oi,new dx,...e])}makeFetcher(){let e=[];for(let r of this.plugins.values())for(let i of r.fetchers||[])e.push(new i);return new wd([new bd,new Qd,...e])}getLinkers(){let e=[];for(let r of this.plugins.values())for(let i of r.linkers||[])e.push(new i);return e}getSupportedArchitectures(){let e=Sd(),r=this.get("supportedArchitectures"),i=r.get("os");i!==null&&(i=i.map(o=>o==="current"?e.os:o));let n=r.get("cpu");n!==null&&(n=n.map(o=>o==="current"?e.cpu:o));let s=r.get("libc");return s!==null&&(s=qo(s,o=>{var a;return o==="current"?(a=e.libc)!=null?a:qo.skip:o})),{os:i,cpu:n,libc:s}}async refreshPackageExtensions(){this.packageExtensions=new Map;let e=this.packageExtensions,r=(i,n,{userProvided:s=!1}={})=>{if(!ho(i.range))throw new Error("Only semver ranges are allowed as keys for the packageExtensions setting");let o=new At;o.load(n,{yamlCompatibilityMode:!0});let a=Pg(e,i.identHash),l=[];a.push([i.range,l]);let c={status:qi.Inactive,userProvided:s,parentDescriptor:i};for(let u of o.dependencies.values())l.push(ie(N({},c),{type:yi.Dependency,descriptor:u}));for(let u of o.peerDependencies.values())l.push(ie(N({},c),{type:yi.PeerDependency,descriptor:u}));for(let[u,g]of o.peerDependenciesMeta)for(let[f,h]of Object.entries(g))l.push(ie(N({},c),{type:yi.PeerDependencyMeta,selector:u,key:f,value:h}))};await this.triggerHook(i=>i.registerPackageExtensions,this,r);for(let[i,n]of this.get("packageExtensions"))r(sl(i,!0),Fy(n),{userProvided:!0})}normalizePackage(e){let r=ud(e);if(this.packageExtensions==null)throw new Error("refreshPackageExtensions has to be called before normalizing packages");let i=this.packageExtensions.get(e.identHash);if(typeof i!="undefined"){let s=e.version;if(s!==null){for(let[o,a]of i)if(!!Uc(s,o))for(let l of a)switch(l.status===qi.Inactive&&(l.status=qi.Redundant),l.type){case yi.Dependency:typeof r.dependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,r.dependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependency:typeof r.peerDependencies.get(l.descriptor.identHash)=="undefined"&&(l.status=qi.Active,r.peerDependencies.set(l.descriptor.identHash,l.descriptor));break;case yi.PeerDependencyMeta:{let c=r.peerDependenciesMeta.get(l.selector);(typeof c=="undefined"||!Object.prototype.hasOwnProperty.call(c,l.key)||c[l.key]!==l.value)&&(l.status=qi.Active,Ja(r.peerDependenciesMeta,l.selector,()=>({}))[l.key]=l.value)}break;default:GS(l);break}}}let n=s=>s.scope?`${s.scope}__${s.name}`:`${s.name}`;for(let s of r.peerDependenciesMeta.keys()){let o=An(s);r.peerDependencies.has(o.identHash)||r.peerDependencies.set(o.identHash,rr(o,"*"))}for(let s of r.peerDependencies.values()){if(s.scope==="types")continue;let o=n(s),a=Vo("types",o),l=Ot(a);r.peerDependencies.has(a.identHash)||r.peerDependenciesMeta.has(l)||(r.peerDependencies.set(a.identHash,rr(a,"*")),r.peerDependenciesMeta.set(l,{optional:!0}))}return r.dependencies=new Map(xn(r.dependencies,([,s])=>Pn(s))),r.peerDependencies=new Map(xn(r.peerDependencies,([,s])=>Pn(s))),r}getLimit(e){return Ja(this.limits,e,()=>(0,n4.default)(this.get(e)))}async triggerHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);!s||await s(...r)}}async triggerMultipleHooks(e,r){for(let i of r)await this.triggerHook(e,...i)}async reduceHook(e,r,...i){let n=r;for(let s of this.plugins.values()){let o=s.hooks;if(!o)continue;let a=e(o);!a||(n=await a(n,...i))}return n}async firstHook(e,...r){for(let i of this.plugins.values()){let n=i.hooks;if(!n)continue;let s=e(n);if(!s)continue;let o=await s(...r);if(typeof o!="undefined")return o}return null}},we=Za;we.telemetry=null;var ns;(function(i){i[i.Never=0]="Never",i[i.ErrorCode=1]="ErrorCode",i[i.Always=2]="Always"})(ns||(ns={}));var vw=class extends ct{constructor({fileName:e,code:r,signal:i}){let n=we.create(x.cwd()),s=et(n,e,Ye.PATH);super($.EXCEPTION,`Child ${s} reported an error`,o=>{Cke(r,i,{configuration:n,report:o})});this.code=Dx(r,i)}},Rx=class extends vw{constructor({fileName:e,code:r,signal:i,stdout:n,stderr:s}){super({fileName:e,code:r,signal:i});this.stdout=n,this.stderr=s}};function jc(t){return t!==null&&typeof t.fd=="number"}var Yc=new Set;function Fx(){}function Nx(){for(let t of Yc)t.kill()}async function $o(t,e,{cwd:r,env:i=process.env,strict:n=!1,stdin:s=null,stdout:o,stderr:a,end:l=2}){let c=["pipe","pipe","pipe"];s===null?c[0]="ignore":jc(s)&&(c[0]=s),jc(o)&&(c[1]=o),jc(a)&&(c[2]=a);let u=(0,Px.default)(t,e,{cwd:H.fromPortablePath(r),env:ie(N({},i),{PWD:H.fromPortablePath(r)}),stdio:c});Yc.add(u),Yc.size===1&&(process.on("SIGINT",Fx),process.on("SIGTERM",Nx)),!jc(s)&&s!==null&&s.pipe(u.stdin),jc(o)||u.stdout.pipe(o,{end:!1}),jc(a)||u.stderr.pipe(a,{end:!1});let g=()=>{for(let f of new Set([o,a]))jc(f)||f.end()};return new Promise((f,h)=>{u.on("error",p=>{Yc.delete(u),Yc.size===0&&(process.off("SIGINT",Fx),process.off("SIGTERM",Nx)),(l===2||l===1)&&g(),h(p)}),u.on("close",(p,m)=>{Yc.delete(u),Yc.size===0&&(process.off("SIGINT",Fx),process.off("SIGTERM",Nx)),(l===2||l===1&&p>0)&&g(),p===0||!n?f({code:Dx(p,m)}):h(new vw({fileName:t,code:p,signal:m}))})})}async function mke(t,e,{cwd:r,env:i=process.env,encoding:n="utf8",strict:s=!1}){let o=["ignore","pipe","pipe"],a=[],l=[],c=H.fromPortablePath(r);typeof i.PWD!="undefined"&&(i=ie(N({},i),{PWD:c}));let u=(0,Px.default)(t,e,{cwd:c,env:i,stdio:o});return u.stdout.on("data",g=>{a.push(g)}),u.stderr.on("data",g=>{l.push(g)}),await new Promise((g,f)=>{u.on("error",h=>{let p=we.create(r),m=et(p,t,Ye.PATH);f(new ct($.EXCEPTION,`Process ${m} failed to spawn`,y=>{y.reportError($.EXCEPTION,`  ${Jo(p,{label:"Thrown Error",value:go(Ye.NO_HINT,h.message)})}`)}))}),u.on("close",(h,p)=>{let m=n==="buffer"?Buffer.concat(a):Buffer.concat(a).toString(n),y=n==="buffer"?Buffer.concat(l):Buffer.concat(l).toString(n);h===0||!s?g({code:Dx(h,p),stdout:m,stderr:y}):f(new Rx({fileName:t,code:h,signal:p,stdout:m,stderr:y}))})})}var Eke=new Map([["SIGINT",2],["SIGQUIT",3],["SIGKILL",9],["SIGTERM",15]]);function Dx(t,e){let r=Eke.get(e);return typeof r!="undefined"?128+r:t!=null?t:1}function Cke(t,e,{configuration:r,report:i}){i.reportError($.EXCEPTION,`  ${Jo(r,t!==null?{label:"Exit Code",value:go(Ye.NUMBER,t)}:{label:"Exit Signal",value:go(Ye.CODE,e)})}`)}var ir={};ft(ir,{Method:()=>fl,RequestError:()=>j5.RequestError,del:()=>DDe,get:()=>xDe,getNetworkSettings:()=>W5,post:()=>$P,put:()=>PDe,request:()=>Md});var U5=ge(Yw()),H5=ge(require("https")),G5=ge(require("http")),VP=ge(rs()),XP=ge(K5()),qw=ge(require("url"));var j5=ge(Yw()),Y5=new Map,q5=new Map,QDe=new G5.Agent({keepAlive:!0}),vDe=new H5.Agent({keepAlive:!0});function J5(t){let e=new qw.URL(t),r={host:e.hostname,headers:{}};return e.port&&(r.port=Number(e.port)),{proxy:r}}async function ZP(t){return Ja(q5,t,()=>K.readFilePromise(t).then(e=>(q5.set(t,e),e)))}function SDe({statusCode:t,statusMessage:e},r){let i=et(r,t,Ye.NUMBER),n=`https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/${t}`;return Lg(r,`${i}${e?` (${e})`:""}`,n)}async function Jw(t,{configuration:e,customErrorMessage:r}){var i,n;try{return await t}catch(s){if(s.name!=="HTTPError")throw s;let o=(n=r==null?void 0:r(s))!=null?n:(i=s.response.body)==null?void 0:i.error;o==null&&(s.message.startsWith("Response code")?o="The remote server failed to provide the requested resource":o=s.message),s instanceof U5.TimeoutError&&s.event==="socket"&&(o+=`(can be increased via ${et(e,"httpTimeout",Ye.SETTING)})`);let a=new ct($.NETWORK_ERROR,o,l=>{s.response&&l.reportError($.NETWORK_ERROR,`  ${Jo(e,{label:"Response Code",value:go(Ye.NO_HINT,SDe(s.response,e))})}`),s.request&&(l.reportError($.NETWORK_ERROR,`  ${Jo(e,{label:"Request Method",value:go(Ye.NO_HINT,s.request.options.method)})}`),l.reportError($.NETWORK_ERROR,`  ${Jo(e,{label:"Request URL",value:go(Ye.URL,s.request.requestUrl)})}`)),s.request.redirects.length>0&&l.reportError($.NETWORK_ERROR,`  ${Jo(e,{label:"Request Redirects",value:go(Ye.NO_HINT,ZS(e,s.request.redirects,Ye.URL))})}`),s.request.retryCount===s.request.options.retry.limit&&l.reportError($.NETWORK_ERROR,`  ${Jo(e,{label:"Request Retry Count",value:go(Ye.NO_HINT,`${et(e,s.request.retryCount,Ye.NUMBER)} (can be increased via ${et(e,"httpRetry",Ye.SETTING)})`)})}`)});throw a.originalError=s,a}}function W5(t,e){let r=[...e.configuration.get("networkSettings")].sort(([o],[a])=>a.length-o.length),i={enableNetwork:void 0,caFilePath:void 0,httpProxy:void 0,httpsProxy:void 0,httpsKeyFilePath:void 0,httpsCertFilePath:void 0},n=Object.keys(i),s=typeof t=="string"?new qw.URL(t):t;for(let[o,a]of r)if(VP.default.isMatch(s.hostname,o))for(let l of n){let c=a.get(l);c!==null&&typeof i[l]=="undefined"&&(i[l]=c)}for(let o of n)typeof i[o]=="undefined"&&(i[o]=e.configuration.get(o));return i}var fl;(function(n){n.GET="GET",n.PUT="PUT",n.POST="POST",n.DELETE="DELETE"})(fl||(fl={}));async function Md(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o=fl.GET}){let a=async()=>await kDe(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o});return await(await r.reduceHook(c=>c.wrapNetworkRequest,a,{target:t,body:e,configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o}))()}async function xDe(t,n){var s=n,{configuration:e,jsonResponse:r}=s,i=Tr(s,["configuration","jsonResponse"]);let o=Ja(Y5,t,()=>Jw(Md(t,null,N({configuration:e},i)),{configuration:e}).then(a=>(Y5.set(t,a.body),a.body)));return Buffer.isBuffer(o)===!1&&(o=await o),r?JSON.parse(o.toString()):o}async function PDe(t,e,n){var s=n,{customErrorMessage:r}=s,i=Tr(s,["customErrorMessage"]);return(await Jw(Md(t,e,ie(N({},i),{method:fl.PUT})),i)).body}async function $P(t,e,n){var s=n,{customErrorMessage:r}=s,i=Tr(s,["customErrorMessage"]);return(await Jw(Md(t,e,ie(N({},i),{method:fl.POST})),i)).body}async function DDe(t,i){var n=i,{customErrorMessage:e}=n,r=Tr(n,["customErrorMessage"]);return(await Jw(Md(t,null,ie(N({},r),{method:fl.DELETE})),r)).body}async function kDe(t,e,{configuration:r,headers:i,jsonRequest:n,jsonResponse:s,method:o=fl.GET}){let a=typeof t=="string"?new qw.URL(t):t,l=W5(a,{configuration:r});if(l.enableNetwork===!1)throw new Error(`Request to '${a.href}' has been blocked because of your configuration settings`);if(a.protocol==="http:"&&!VP.default.isMatch(a.hostname,r.get("unsafeHttpWhitelist")))throw new Error(`Unsafe http requests must be explicitly whitelisted in your configuration (${a.hostname})`);let u={agent:{http:l.httpProxy?XP.default.httpOverHttp(J5(l.httpProxy)):QDe,https:l.httpsProxy?XP.default.httpsOverHttp(J5(l.httpsProxy)):vDe},headers:i,method:o};u.responseType=s?"json":"buffer",e!==null&&(Buffer.isBuffer(e)||!n&&typeof e=="string"?u.body=e:u.json=e);let g=r.get("httpTimeout"),f=r.get("httpRetry"),h=r.get("enableStrictSsl"),p=l.caFilePath,m=l.httpsCertFilePath,y=l.httpsKeyFilePath,{default:b}=await Promise.resolve().then(()=>ge(Yw())),S=p?await ZP(p):void 0,k=m?await ZP(m):void 0,T=y?await ZP(y):void 0,Y=b.extend(N({timeout:{socket:g},retry:f,https:{rejectUnauthorized:h,certificateAuthority:S,certificate:k,key:T}},u));return r.getLimit("networkConcurrency")(()=>Y(a))}var Zt={};ft(Zt,{PackageManager:()=>hn,detectPackageManager:()=>o6,executePackageAccessibleBinary:()=>u6,executePackageScript:()=>AB,executePackageShellcode:()=>hD,executeWorkspaceAccessibleBinary:()=>VRe,executeWorkspaceLifecycleScript:()=>c6,executeWorkspaceScript:()=>l6,getPackageAccessibleBinaries:()=>lB,getWorkspaceAccessibleBinaries:()=>A6,hasPackageScript:()=>WRe,hasWorkspaceScript:()=>fD,makeScriptEnv:()=>qd,maybeExecuteWorkspaceLifecycleScript:()=>_Re,prepareExternalProject:()=>JRe});var Kd={};ft(Kd,{getLibzipPromise:()=>fn,getLibzipSync:()=>Z5});var X5=ge(_5());var hl=["number","number"],rD;(function(L){L[L.ZIP_ER_OK=0]="ZIP_ER_OK",L[L.ZIP_ER_MULTIDISK=1]="ZIP_ER_MULTIDISK",L[L.ZIP_ER_RENAME=2]="ZIP_ER_RENAME",L[L.ZIP_ER_CLOSE=3]="ZIP_ER_CLOSE",L[L.ZIP_ER_SEEK=4]="ZIP_ER_SEEK",L[L.ZIP_ER_READ=5]="ZIP_ER_READ",L[L.ZIP_ER_WRITE=6]="ZIP_ER_WRITE",L[L.ZIP_ER_CRC=7]="ZIP_ER_CRC",L[L.ZIP_ER_ZIPCLOSED=8]="ZIP_ER_ZIPCLOSED",L[L.ZIP_ER_NOENT=9]="ZIP_ER_NOENT",L[L.ZIP_ER_EXISTS=10]="ZIP_ER_EXISTS",L[L.ZIP_ER_OPEN=11]="ZIP_ER_OPEN",L[L.ZIP_ER_TMPOPEN=12]="ZIP_ER_TMPOPEN",L[L.ZIP_ER_ZLIB=13]="ZIP_ER_ZLIB",L[L.ZIP_ER_MEMORY=14]="ZIP_ER_MEMORY",L[L.ZIP_ER_CHANGED=15]="ZIP_ER_CHANGED",L[L.ZIP_ER_COMPNOTSUPP=16]="ZIP_ER_COMPNOTSUPP",L[L.ZIP_ER_EOF=17]="ZIP_ER_EOF",L[L.ZIP_ER_INVAL=18]="ZIP_ER_INVAL",L[L.ZIP_ER_NOZIP=19]="ZIP_ER_NOZIP",L[L.ZIP_ER_INTERNAL=20]="ZIP_ER_INTERNAL",L[L.ZIP_ER_INCONS=21]="ZIP_ER_INCONS",L[L.ZIP_ER_REMOVE=22]="ZIP_ER_REMOVE",L[L.ZIP_ER_DELETED=23]="ZIP_ER_DELETED",L[L.ZIP_ER_ENCRNOTSUPP=24]="ZIP_ER_ENCRNOTSUPP",L[L.ZIP_ER_RDONLY=25]="ZIP_ER_RDONLY",L[L.ZIP_ER_NOPASSWD=26]="ZIP_ER_NOPASSWD",L[L.ZIP_ER_WRONGPASSWD=27]="ZIP_ER_WRONGPASSWD",L[L.ZIP_ER_OPNOTSUPP=28]="ZIP_ER_OPNOTSUPP",L[L.ZIP_ER_INUSE=29]="ZIP_ER_INUSE",L[L.ZIP_ER_TELL=30]="ZIP_ER_TELL",L[L.ZIP_ER_COMPRESSED_DATA=31]="ZIP_ER_COMPRESSED_DATA"})(rD||(rD={}));var V5=t=>({get HEAP8(){return t.HEAP8},get HEAPU8(){return t.HEAPU8},errors:rD,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,ZIP_CHECKCONS:4,ZIP_CREATE:1,ZIP_EXCL:2,ZIP_TRUNCATE:8,ZIP_RDONLY:16,ZIP_FL_OVERWRITE:8192,ZIP_FL_COMPRESSED:4,ZIP_OPSYS_DOS:0,ZIP_OPSYS_AMIGA:1,ZIP_OPSYS_OPENVMS:2,ZIP_OPSYS_UNIX:3,ZIP_OPSYS_VM_CMS:4,ZIP_OPSYS_ATARI_ST:5,ZIP_OPSYS_OS_2:6,ZIP_OPSYS_MACINTOSH:7,ZIP_OPSYS_Z_SYSTEM:8,ZIP_OPSYS_CPM:9,ZIP_OPSYS_WINDOWS_NTFS:10,ZIP_OPSYS_MVS:11,ZIP_OPSYS_VSE:12,ZIP_OPSYS_ACORN_RISC:13,ZIP_OPSYS_VFAT:14,ZIP_OPSYS_ALTERNATE_MVS:15,ZIP_OPSYS_BEOS:16,ZIP_OPSYS_TANDEM:17,ZIP_OPSYS_OS_400:18,ZIP_OPSYS_OS_X:19,ZIP_CM_DEFAULT:-1,ZIP_CM_STORE:0,ZIP_CM_DEFLATE:8,uint08S:t._malloc(1),uint16S:t._malloc(2),uint32S:t._malloc(4),uint64S:t._malloc(8),malloc:t._malloc,free:t._free,getValue:t.getValue,open:t.cwrap("zip_open","number",["string","number","number"]),openFromSource:t.cwrap("zip_open_from_source","number",["number","number","number"]),close:t.cwrap("zip_close","number",["number"]),discard:t.cwrap("zip_discard",null,["number"]),getError:t.cwrap("zip_get_error","number",["number"]),getName:t.cwrap("zip_get_name","string",["number","number","number"]),getNumEntries:t.cwrap("zip_get_num_entries","number",["number","number"]),delete:t.cwrap("zip_delete","number",["number","number"]),stat:t.cwrap("zip_stat","number",["number","string","number","number"]),statIndex:t.cwrap("zip_stat_index","number",["number",...hl,"number","number"]),fopen:t.cwrap("zip_fopen","number",["number","string","number"]),fopenIndex:t.cwrap("zip_fopen_index","number",["number",...hl,"number"]),fread:t.cwrap("zip_fread","number",["number","number","number","number"]),fclose:t.cwrap("zip_fclose","number",["number"]),dir:{add:t.cwrap("zip_dir_add","number",["number","string"])},file:{add:t.cwrap("zip_file_add","number",["number","string","number","number"]),getError:t.cwrap("zip_file_get_error","number",["number"]),getExternalAttributes:t.cwrap("zip_file_get_external_attributes","number",["number",...hl,"number","number","number"]),setExternalAttributes:t.cwrap("zip_file_set_external_attributes","number",["number",...hl,"number","number","number"]),setMtime:t.cwrap("zip_file_set_mtime","number",["number",...hl,"number","number"]),setCompression:t.cwrap("zip_set_file_compression","number",["number",...hl,"number","number"])},ext:{countSymlinks:t.cwrap("zip_ext_count_symlinks","number",["number"])},error:{initWithCode:t.cwrap("zip_error_init_with_code",null,["number","number"]),strerror:t.cwrap("zip_error_strerror","string",["number"])},name:{locate:t.cwrap("zip_name_locate","number",["number","string","number"])},source:{fromUnattachedBuffer:t.cwrap("zip_source_buffer_create","number",["number","number","number","number"]),fromBuffer:t.cwrap("zip_source_buffer","number",["number","number",...hl,"number"]),free:t.cwrap("zip_source_free",null,["number"]),keep:t.cwrap("zip_source_keep",null,["number"]),open:t.cwrap("zip_source_open","number",["number"]),close:t.cwrap("zip_source_close","number",["number"]),seek:t.cwrap("zip_source_seek","number",["number",...hl,"number"]),tell:t.cwrap("zip_source_tell","number",["number"]),read:t.cwrap("zip_source_read","number",["number","number","number"]),error:t.cwrap("zip_source_error","number",["number"]),setMtime:t.cwrap("zip_source_set_mtime","number",["number","number"])},struct:{stat:t.cwrap("zipstruct_stat","number",[]),statS:t.cwrap("zipstruct_statS","number",[]),statName:t.cwrap("zipstruct_stat_name","string",["number"]),statIndex:t.cwrap("zipstruct_stat_index","number",["number"]),statSize:t.cwrap("zipstruct_stat_size","number",["number"]),statCompSize:t.cwrap("zipstruct_stat_comp_size","number",["number"]),statCompMethod:t.cwrap("zipstruct_stat_comp_method","number",["number"]),statMtime:t.cwrap("zipstruct_stat_mtime","number",["number"]),statCrc:t.cwrap("zipstruct_stat_crc","number",["number"]),error:t.cwrap("zipstruct_error","number",[]),errorS:t.cwrap("zipstruct_errorS","number",[]),errorCodeZip:t.cwrap("zipstruct_error_code_zip","number",["number"])}});var iD=null;function Z5(){return iD===null&&(iD=V5((0,X5.default)())),iD}async function fn(){return Z5()}var Hd={};ft(Hd,{ShellError:()=>Os,execute:()=>tB,globUtils:()=>zw});var c_=ge(BS()),u_=ge(require("os")),ss=ge(require("stream")),g_=ge(require("util"));var Os=class extends Error{constructor(e){super(e);this.name="ShellError"}};var zw={};ft(zw,{fastGlobOptions:()=>t_,isBraceExpansion:()=>r_,isGlobPattern:()=>RDe,match:()=>FDe,micromatchOptions:()=>Vw});var $5=ge(rw()),e_=ge(require("fs")),_w=ge(rs()),Vw={strictBrackets:!0},t_={onlyDirectories:!1,onlyFiles:!1};function RDe(t){if(!_w.default.scan(t,Vw).isGlob)return!1;try{_w.default.parse(t,Vw)}catch{return!1}return!0}function FDe(t,{cwd:e,baseFs:r}){return(0,$5.default)(t,ie(N({},t_),{cwd:H.fromPortablePath(e),fs:XE(e_.default,new Xh(r))}))}function r_(t){return _w.default.scan(t,Vw).isBrace}var i_=ge(MQ()),ta=ge(require("stream")),n_=ge(require("string_decoder")),Fn;(function(i){i[i.STDIN=0]="STDIN",i[i.STDOUT=1]="STDOUT",i[i.STDERR=2]="STDERR"})(Fn||(Fn={}));var Jc=new Set;function nD(){}function sD(){for(let t of Jc)t.kill()}function s_(t,e,r,i){return n=>{let s=n[0]instanceof ta.Transform?"pipe":n[0],o=n[1]instanceof ta.Transform?"pipe":n[1],a=n[2]instanceof ta.Transform?"pipe":n[2],l=(0,i_.default)(t,e,ie(N({},i),{stdio:[s,o,a]}));return Jc.add(l),Jc.size===1&&(process.on("SIGINT",nD),process.on("SIGTERM",sD)),n[0]instanceof ta.Transform&&n[0].pipe(l.stdin),n[1]instanceof ta.Transform&&l.stdout.pipe(n[1],{end:!1}),n[2]instanceof ta.Transform&&l.stderr.pipe(n[2],{end:!1}),{stdin:l.stdin,promise:new Promise(c=>{l.on("error",u=>{switch(Jc.delete(l),Jc.size===0&&(process.off("SIGINT",nD),process.off("SIGTERM",sD)),u.code){case"ENOENT":n[2].write(`command not found: ${t}
`),c(127);break;case"EACCES":n[2].write(`permission denied: ${t}
`),c(128);break;default:n[2].write(`uncaught error: ${u.message}
`),c(1);break}}),l.on("exit",u=>{Jc.delete(l),Jc.size===0&&(process.off("SIGINT",nD),process.off("SIGTERM",sD)),c(u!==null?u:129)})})}}}function o_(t){return e=>{let r=e[0]==="pipe"?new ta.PassThrough:e[0];return{stdin:r,promise:Promise.resolve().then(()=>t({stdin:r,stdout:e[1],stderr:e[2]}))}}}var Co=class{constructor(e){this.stream=e}close(){}get(){return this.stream}},a_=class{constructor(){this.stream=null}close(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");this.stream.end()}attach(e){this.stream=e}get(){if(this.stream===null)throw new Error("Assertion failed: No stream attached");return this.stream}},Ud=class{constructor(e,r){this.stdin=null;this.stdout=null;this.stderr=null;this.pipe=null;this.ancestor=e,this.implementation=r}static start(e,{stdin:r,stdout:i,stderr:n}){let s=new Ud(null,e);return s.stdin=r,s.stdout=i,s.stderr=n,s}pipeTo(e,r=1){let i=new Ud(this,e),n=new a_;return i.pipe=n,i.stdout=this.stdout,i.stderr=this.stderr,(r&1)==1?this.stdout=n:this.ancestor!==null&&(this.stderr=this.ancestor.stdout),(r&2)==2?this.stderr=n:this.ancestor!==null&&(this.stderr=this.ancestor.stderr),i}async exec(){let e=["ignore","ignore","ignore"];if(this.pipe)e[0]="pipe";else{if(this.stdin===null)throw new Error("Assertion failed: No input stream registered");e[0]=this.stdin.get()}let r;if(this.stdout===null)throw new Error("Assertion failed: No output stream registered");r=this.stdout,e[1]=r.get();let i;if(this.stderr===null)throw new Error("Assertion failed: No error stream registered");i=this.stderr,e[2]=i.get();let n=this.implementation(e);return this.pipe&&this.pipe.attach(n.stdin),await n.promise.then(s=>(r.close(),i.close(),s))}async run(){let e=[];for(let i=this;i;i=i.ancestor)e.push(i.exec());return(await Promise.all(e))[0]}};function Xw(t,e){return Ud.start(t,e)}function A_(t,e=null){let r=new ta.PassThrough,i=new n_.StringDecoder,n="";return r.on("data",s=>{let o=i.write(s),a;do if(a=o.indexOf(`
`),a!==-1){let l=n+o.substring(0,a);o=o.substring(a+1),n="",t(e!==null?`${e} ${l}`:l)}while(a!==-1);n+=o}),r.on("end",()=>{let s=i.end();s!==""&&t(e!==null?`${e} ${s}`:s)}),r}function l_(t,{prefix:e}){return{stdout:A_(r=>t.stdout.write(`${r}
`),t.stdout.isTTY?e:null),stderr:A_(r=>t.stderr.write(`${r}
`),t.stderr.isTTY?e:null)}}var NDe=(0,g_.promisify)(setTimeout);var zi;(function(r){r[r.Readable=1]="Readable",r[r.Writable=2]="Writable"})(zi||(zi={}));function f_(t,e,r){let i=new ss.PassThrough({autoDestroy:!0});switch(t){case Fn.STDIN:(e&1)==1&&r.stdin.pipe(i,{end:!1}),(e&2)==2&&r.stdin instanceof ss.Writable&&i.pipe(r.stdin,{end:!1});break;case Fn.STDOUT:(e&1)==1&&r.stdout.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stdout,{end:!1});break;case Fn.STDERR:(e&1)==1&&r.stderr.pipe(i,{end:!1}),(e&2)==2&&i.pipe(r.stderr,{end:!1});break;default:throw new Os(`Bad file descriptor: "${t}"`)}return i}function Zw(t,e={}){let r=N(N({},t),e);return r.environment=N(N({},t.environment),e.environment),r.variables=N(N({},t.variables),e.variables),r}var LDe=new Map([["cd",async([t=(0,u_.homedir)(),...e],r,i)=>{let n=x.resolve(i.cwd,H.toPortablePath(t));if(!(await r.baseFs.statPromise(n).catch(o=>{throw o.code==="ENOENT"?new Os(`cd: no such file or directory: ${t}`):o})).isDirectory())throw new Os(`cd: not a directory: ${t}`);return i.cwd=n,0}],["pwd",async(t,e,r)=>(r.stdout.write(`${H.fromPortablePath(r.cwd)}
`),0)],[":",async(t,e,r)=>0],["true",async(t,e,r)=>0],["false",async(t,e,r)=>1],["exit",async([t,...e],r,i)=>i.exitCode=parseInt(t!=null?t:i.variables["?"],10)],["echo",async(t,e,r)=>(r.stdout.write(`${t.join(" ")}
`),0)],["sleep",async([t],e,r)=>{if(typeof t=="undefined")throw new Os("sleep: missing operand");let i=Number(t);if(Number.isNaN(i))throw new Os(`sleep: invalid time interval '${t}'`);return await NDe(1e3*i,0)}],["__ysh_run_procedure",async(t,e,r)=>{let i=r.procedures[t[0]];return await Xw(i,{stdin:new Co(r.stdin),stdout:new Co(r.stdout),stderr:new Co(r.stderr)}).run()}],["__ysh_set_redirects",async(t,e,r)=>{let i=r.stdin,n=r.stdout,s=r.stderr,o=[],a=[],l=[],c=0;for(;t[c]!=="--";){let g=t[c++],{type:f,fd:h}=JSON.parse(g),p=S=>{switch(h){case null:case 0:o.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},m=S=>{switch(h){case null:case 1:a.push(S);break;case 2:l.push(S);break;default:throw new Error(`Unsupported file descriptor: "${h}"`)}},y=Number(t[c++]),b=c+y;for(let S=c;S<b;++c,++S)switch(f){case"<":p(()=>e.baseFs.createReadStream(x.resolve(r.cwd,H.toPortablePath(t[S]))));break;case"<<<":p(()=>{let k=new ss.PassThrough;return process.nextTick(()=>{k.write(`${t[S]}
`),k.end()}),k});break;case"<&":p(()=>f_(Number(t[S]),1,r));break;case">":case">>":{let k=x.resolve(r.cwd,H.toPortablePath(t[S]));m(k==="/dev/null"?new ss.Writable({autoDestroy:!0,emitClose:!0,write(T,Y,j){setImmediate(j)}}):e.baseFs.createWriteStream(k,f===">>"?{flags:"a"}:void 0))}break;case">&":m(f_(Number(t[S]),2,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${f}"`)}}if(o.length>0){let g=new ss.PassThrough;i=g;let f=h=>{if(h===o.length)g.end();else{let p=o[h]();p.pipe(g,{end:!1}),p.on("end",()=>{f(h+1)})}};f(0)}if(a.length>0){let g=new ss.PassThrough;n=g;for(let f of a)g.pipe(f)}if(l.length>0){let g=new ss.PassThrough;s=g;for(let f of l)g.pipe(f)}let u=await Xw(Gd(t.slice(c+1),e,r),{stdin:new Co(i),stdout:new Co(n),stderr:new Co(s)}).run();return await Promise.all(a.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),await Promise.all(l.map(g=>new Promise((f,h)=>{g.on("error",p=>{h(p)}),g.on("close",()=>{f()}),g.end()}))),u}]]);async function TDe(t,e,r){let i=[],n=new ss.PassThrough;return n.on("data",s=>i.push(s)),await $w(t,e,Zw(r,{stdout:n})),Buffer.concat(i).toString().replace(/[\r\n]+$/,"")}async function h_(t,e,r){let i=t.map(async s=>{let o=await nA(s.args,e,r);return{name:s.name,value:o.join(" ")}});return(await Promise.all(i)).reduce((s,o)=>(s[o.name]=o.value,s),{})}function eB(t){return t.match(/[^ \r\n\t]+/g)||[]}async function p_(t,e,r,i,n=i){switch(t.name){case"$":i(String(process.pid));break;case"#":i(String(e.args.length));break;case"@":if(t.quoted)for(let s of e.args)n(s);else for(let s of e.args){let o=eB(s);for(let a=0;a<o.length-1;++a)n(o[a]);i(o[o.length-1])}break;case"*":{let s=e.args.join(" ");if(t.quoted)i(s);else for(let o of eB(s))n(o)}break;case"PPID":i(String(process.ppid));break;case"RANDOM":i(String(Math.floor(Math.random()*32768)));break;default:{let s=parseInt(t.name,10),o;if(Number.isFinite(s))if(s>=0&&s<e.args.length)o=e.args[s];else if(t.defaultValue)o=(await nA(t.defaultValue,e,r)).join(" ");else if(t.alternativeValue)o=(await nA(t.alternativeValue,e,r)).join(" ");else throw new Os(`Unbound argument #${s}`);else if(Object.prototype.hasOwnProperty.call(r.variables,t.name))o=r.variables[t.name];else if(Object.prototype.hasOwnProperty.call(r.environment,t.name))o=r.environment[t.name];else if(t.defaultValue)o=(await nA(t.defaultValue,e,r)).join(" ");else throw new Os(`Unbound variable "${t.name}"`);if(typeof o!="undefined"&&t.alternativeValue&&(o=(await nA(t.alternativeValue,e,r)).join(" ")),t.quoted)i(o);else{let a=eB(o);for(let c=0;c<a.length-1;++c)n(a[c]);let l=a[a.length-1];typeof l!="undefined"&&i(l)}}break}}var ODe={addition:(t,e)=>t+e,subtraction:(t,e)=>t-e,multiplication:(t,e)=>t*e,division:(t,e)=>Math.trunc(t/e)};async function jd(t,e,r){if(t.type==="number"){if(Number.isInteger(t.value))return t.value;throw new Error(`Invalid number: "${t.value}", only integers are allowed`)}else if(t.type==="variable"){let i=[];await p_(ie(N({},t),{quoted:!0}),e,r,s=>i.push(s));let n=Number(i.join(" "));return Number.isNaN(n)?jd({type:"variable",name:i.join(" ")},e,r):jd({type:"number",value:n},e,r)}else return ODe[t.type](await jd(t.left,e,r),await jd(t.right,e,r))}async function nA(t,e,r){let i=new Map,n=[],s=[],o=u=>{s.push(u)},a=()=>{s.length>0&&n.push(s.join("")),s=[]},l=u=>{o(u),a()},c=(u,g,f)=>{let h=JSON.stringify({type:u,fd:g}),p=i.get(h);typeof p=="undefined"&&i.set(h,p=[]),p.push(f)};for(let u of t){let g=!1;switch(u.type){case"redirection":{let f=await nA(u.args,e,r);for(let h of f)c(u.subtype,u.fd,h)}break;case"argument":for(let f of u.segments)switch(f.type){case"text":o(f.text);break;case"glob":o(f.pattern),g=!0;break;case"shell":{let h=await TDe(f.shell,e,r);if(f.quoted)o(h);else{let p=eB(h);for(let m=0;m<p.length-1;++m)l(p[m]);o(p[p.length-1])}}break;case"variable":await p_(f,e,r,o,l);break;case"arithmetic":o(String(await jd(f.arithmetic,e,r)));break}break}if(a(),g){let f=n.pop();if(typeof f=="undefined")throw new Error("Assertion failed: Expected a glob pattern to have been set");let h=await e.glob.match(f,{cwd:r.cwd,baseFs:e.baseFs});if(h.length===0){let p=r_(f)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22":"";throw new Os(`No matches found: "${f}"${p}`)}for(let p of h.sort())l(p)}}if(i.size>0){let u=[];for(let[g,f]of i.entries())u.splice(u.length,0,g,String(f.length),...f);n.splice(0,0,"__ysh_set_redirects",...u,"--")}return n}function Gd(t,e,r){e.builtins.has(t[0])||(t=["command",...t]);let i=H.fromPortablePath(r.cwd),n=r.environment;typeof n.PWD!="undefined"&&(n=ie(N({},n),{PWD:i}));let[s,...o]=t;if(s==="command")return s_(o[0],o.slice(1),e,{cwd:i,env:n});let a=e.builtins.get(s);if(typeof a=="undefined")throw new Error(`Assertion failed: A builtin should exist for "${s}"`);return o_(async({stdin:l,stdout:c,stderr:u})=>{let{stdin:g,stdout:f,stderr:h}=r;r.stdin=l,r.stdout=c,r.stderr=u;try{return await a(o,e,r)}finally{r.stdin=g,r.stdout=f,r.stderr=h}})}function MDe(t,e,r){return i=>{let n=new ss.PassThrough,s=$w(t,e,Zw(r,{stdin:n}));return{stdin:n,promise:s}}}function KDe(t,e,r){return i=>{let n=new ss.PassThrough,s=$w(t,e,r);return{stdin:n,promise:s}}}function d_(t,e,r,i){if(e.length===0)return t;{let n;do n=String(Math.random());while(Object.prototype.hasOwnProperty.call(i.procedures,n));return i.procedures=N({},i.procedures),i.procedures[n]=t,Gd([...e,"__ysh_run_procedure",n],r,i)}}async function C_(t,e,r){let i=t,n=null,s=null;for(;i;){let o=i.then?N({},r):r,a;switch(i.type){case"command":{let l=await nA(i.args,e,r),c=await h_(i.envs,e,r);a=i.envs.length?Gd(l,e,Zw(o,{environment:c})):Gd(l,e,o)}break;case"subshell":{let l=await nA(i.args,e,r),c=MDe(i.subshell,e,o);a=d_(c,l,e,o)}break;case"group":{let l=await nA(i.args,e,r),c=KDe(i.group,e,o);a=d_(c,l,e,o)}break;case"envs":{let l=await h_(i.envs,e,r);o.environment=N(N({},o.environment),l),a=Gd(["true"],e,o)}break}if(typeof a=="undefined")throw new Error("Assertion failed: An action should have been generated");if(n===null)s=Xw(a,{stdin:new Co(o.stdin),stdout:new Co(o.stdout),stderr:new Co(o.stderr)});else{if(s===null)throw new Error("Assertion failed: The execution pipeline should have been setup");switch(n){case"|":s=s.pipeTo(a,Fn.STDOUT);break;case"|&":s=s.pipeTo(a,Fn.STDOUT|Fn.STDERR);break}}i.then?(n=i.then.type,i=i.then.chain):i=null}if(s===null)throw new Error("Assertion failed: The execution pipeline should have been setup");return await s.run()}async function UDe(t,e,r,{background:i=!1}={}){function n(s){let o=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],a=o[s%o.length];return c_.default.hex(a)}if(i){let s=r.nextBackgroundJobIndex++,o=n(s),a=`[${s}]`,l=o(a),{stdout:c,stderr:u}=l_(r,{prefix:l});return r.backgroundJobs.push(C_(t,e,Zw(r,{stdout:c,stderr:u})).catch(g=>u.write(`${g.message}
`)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${l}, '${o(Xu(t))}' has ended
`)})),0}return await C_(t,e,r)}async function HDe(t,e,r,{background:i=!1}={}){let n,s=a=>{n=a,r.variables["?"]=String(a)},o=async a=>{try{return await UDe(a.chain,e,r,{background:i&&typeof a.then=="undefined"})}catch(l){if(!(l instanceof Os))throw l;return r.stderr.write(`${l.message}
`),1}};for(s(await o(t));t.then;){if(r.exitCode!==null)return r.exitCode;switch(t.then.type){case"&&":n===0&&s(await o(t.then.line));break;case"||":n!==0&&s(await o(t.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${t.then.type}"`)}t=t.then.line}return n}async function $w(t,e,r){let i=r.backgroundJobs;r.backgroundJobs=[];let n=0;for(let{command:s,type:o}of t){if(n=await HDe(s,e,r,{background:o==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(n)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=i,n}function m_(t){switch(t.type){case"variable":return t.name==="@"||t.name==="#"||t.name==="*"||Number.isFinite(parseInt(t.name,10))||"defaultValue"in t&&!!t.defaultValue&&t.defaultValue.some(e=>Yd(e))||"alternativeValue"in t&&!!t.alternativeValue&&t.alternativeValue.some(e=>Yd(e));case"arithmetic":return oD(t.arithmetic);case"shell":return aD(t.shell);default:return!1}}function Yd(t){switch(t.type){case"redirection":return t.args.some(e=>Yd(e));case"argument":return t.segments.some(e=>m_(e));default:throw new Error(`Assertion failed: Unsupported argument type: "${t.type}"`)}}function oD(t){switch(t.type){case"variable":return m_(t);case"number":return!1;default:return oD(t.left)||oD(t.right)}}function aD(t){return t.some(({command:e})=>{for(;e;){let r=e.chain;for(;r;){let i;switch(r.type){case"subshell":i=aD(r.subshell);break;case"command":i=r.envs.some(n=>n.args.some(s=>Yd(s)))||r.args.some(n=>Yd(n));break}if(i)return!0;if(!r.then)break;r=r.then.chain}if(!e.then)break;e=e.then.line}return!1})}async function tB(t,e=[],{baseFs:r=new ar,builtins:i={},cwd:n=H.toPortablePath(process.cwd()),env:s=process.env,stdin:o=process.stdin,stdout:a=process.stdout,stderr:l=process.stderr,variables:c={},glob:u=zw}={}){let g={};for(let[p,m]of Object.entries(s))typeof m!="undefined"&&(g[p]=m);let f=new Map(LDe);for(let[p,m]of Object.entries(i))f.set(p,m);o===null&&(o=new ss.PassThrough,o.end());let h=$E(t,u);if(!aD(h)&&h.length>0&&e.length>0){let{command:p}=h[h.length-1];for(;p.then;)p=p.then.line;let m=p.chain;for(;m.then;)m=m.then.chain;m.type==="command"&&(m.args=m.args.concat(e.map(y=>({type:"argument",segments:[{type:"text",text:y}]}))))}return await $w(h,{args:e,baseFs:r,builtins:f,initialStdin:o,initialStdout:a,initialStderr:l,glob:u},{cwd:n,environment:g,exitCode:null,procedures:{},stdin:o,stdout:a,stderr:l,variables:Object.assign({},c,{["?"]:0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}var n6=ge(rB()),s6=ge(lg()),Wc=ge(require("stream"));var $_=ge(Z_()),sB=ge(pc());var e6=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],t6=80,KRe=new Set([$.FETCH_NOT_CACHED,$.UNUSED_CACHE_ENTRY]),URe=5,oB=sB.default.GITHUB_ACTIONS?{start:t=>`::group::${t}
`,end:t=>`::endgroup::
`}:sB.default.TRAVIS?{start:t=>`travis_fold:start:${t}
`,end:t=>`travis_fold:end:${t}
`}:sB.default.GITLAB?{start:t=>`section_start:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}[collapsed=true]\r