create-turbo 2.5.0 → 2.5.1-canary.0

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.
Files changed (2) hide show
  1. package/dist/cli.js +2 -2
  2. package/package.json +4 -4
package/dist/cli.js CHANGED
@@ -27,7 +27,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);y(m)}return}
27
27
  `).reverse(),u=r.stack.slice(r.stack.indexOf(r.message)+r.message.length).split(`
28
28
  `).reverse();for(;u.length!==0&&u[0]===a[0];)a.shift();this.stack=`${this.stack.slice(0,o)}${a.reverse().join(`
29
29
  `)}${u.reverse().join(`
30
- `)}`}}};ke.RequestError=Ue;var Bl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Bl;var Nl=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Nl;var Ml=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=jl;var ql=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=ql;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Ul=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Ul;var qq=["socket","connect","continue","information","upgrade","timeout"],Hl=class extends _R.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Pl]=new Set,this.redirects=[],this[Xs]=!1,this[Il]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof dy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){Y.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof bq.ReadStream&&await Nq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(Y.default.object(e)&&!Y.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),Y.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),Y.assert.any([Y.default.string,Y.default.undefined],r.method),Y.assert.any([Y.default.object,Y.default.undefined],r.headers),Y.assert.any([Y.default.string,Y.default.urlInstance,Y.default.undefined],r.prefixUrl),Y.assert.any([Y.default.object,Y.default.undefined],r.cookieJar),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.searchParams),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.cache),Y.assert.any([Y.default.object,Y.default.number,Y.default.undefined],r.timeout),Y.assert.any([Y.default.object,Y.default.undefined],r.context),Y.assert.any([Y.default.object,Y.default.undefined],r.hooks),Y.assert.any([Y.default.boolean,Y.default.undefined],r.decompress),Y.assert.any([Y.default.boolean,Y.default.undefined],r.ignoreInvalidCookies),Y.assert.any([Y.default.boolean,Y.default.undefined],r.followRedirect),Y.assert.any([Y.default.number,Y.default.undefined],r.maxRedirects),Y.assert.any([Y.default.boolean,Y.default.undefined],r.throwHttpErrors),Y.assert.any([Y.default.boolean,Y.default.undefined],r.http2),Y.assert.any([Y.default.boolean,Y.default.undefined],r.allowGetBody),Y.assert.any([Y.default.string,Y.default.undefined],r.localAddress),Y.assert.any([SR.isDnsLookupIpVersion,Y.default.undefined],r.dnsLookupIpVersion),Y.assert.any([Y.default.object,Y.default.undefined],r.https),Y.assert.any([Y.default.boolean,Y.default.undefined],r.rejectUnauthorized),r.https&&(Y.assert.any([Y.default.boolean,Y.default.undefined],r.https.rejectUnauthorized),Y.assert.any([Y.default.function_,Y.default.undefined],r.https.checkServerIdentity),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificateAuthority),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.key),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificate),Y.assert.any([Y.default.string,Y.default.undefined],r.https.passphrase),Y.assert.any([Y.default.string,Y.default.buffer,Y.default.array,Y.default.undefined],r.https.pfx)),Y.assert.any([Y.default.object,Y.default.undefined],r.cacheOptions),Y.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Aq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(Y.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Lq(r.searchParams),d=new Pn.URLSearchParams;for(let y in r.searchParams){let m=r.searchParams[y];m===null?d.append(y,""):m!==void 0&&d.append(y,m)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((y,m)=>{d.has(m)||d.append(m,y)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",Y.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),Y.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=xR.default(r.prefixUrl+r.url,r)}else(Y.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=xR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:m=>{let p=r.url;if(!p.href.startsWith(m))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${m}: ${p.href}`);r.url=new Pn.URL(m+p.href.slice(d.length)),d=m},get:()=>d});let{protocol:y}=r.url;if(y==="unix:"&&(y="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),y!=="http:"&&y!=="https:")throw new Ul(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:y}=l;Y.assert.function_(d),Y.assert.function_(y),d.length===4&&y.length===0&&(d=gR.promisify(d.bind(r.cookieJar)),y=gR.promisify(y.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:y})}let{cache:h}=r;if(h&&(yy.has(h)||yy.set(h,new vR((d,y)=>{let m=d[nt](d,y);return Y.default.promise(m)&&(m.once=(p,E)=>{if(p==="error")m.catch(E);else if(p==="abort")(async()=>{try{(await m).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return m}),m},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)py||(py=new wq.default),r.dnsCache=py;else if(!Y.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${Y.default(r.dnsCache)}`);Y.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(Y.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${Y.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Fq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!Y.default.undefined(e.form),i=!Y.default.undefined(e.json),s=!Y.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof _R.Readable)&&!Y.default.string(e.body)&&!Y.default.buffer(e.body)&&!ER.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!Y.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!Y.default.string(r["content-type"]);s?(ER.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await Dq.default(this[Ln],e.headers);Y.default.undefined(r["content-length"])&&Y.default.undefined(r["transfer-encoding"])&&!a&&!Y.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[RR]=e,r.decompress&&(e=xq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:bR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[DR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Ll]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(Y.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Mq.has(i)){if(e.resume(),this[nt]&&(this[my](),delete this[nt],this[AR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Bl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Oq.isResponseOk(s)){this._beforeError(new Nl(s));return}e.on("readable",()=>{this[Il]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Pl])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Eq.default(e),this[my]=wR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof wR.TimeoutError?new ql(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[AR]=Cq.default(e,this,qq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;Y.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new jl(u,this))})):(this._unlockWrite(),Y.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Rq.default(e)),delete r.url;let s,o=yy.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(Y.default.undefined(a[E]))delete a[E];else if(Y.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&Y.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Iq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());Y.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!Y.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:P}=E.groups;Object.assign(o,{socketPath:R,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Sq.auto:d=f?vq.request:bR.request;let y=(e=o.request)!==null&&e!==void 0?e:d,m=o.cache?this._createCacheableRequest:y;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=y,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=SR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await m(h,p);Y.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Bq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof vR.CacheError?new Ml(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Tq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Pq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[kR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Il]=!0;let e=this[Ll];if(e&&!this[Xs]){e.readableLength&&(this[Il]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[CR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[kR]),nt in this&&(this[my](),!((n=this[Ll])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!Y.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[RR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[DR]}pipe(e,r){if(this[CR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof dy.ServerResponse&&this[Pl].add(e),super.pipe(e,r)}unpipe(e){return e instanceof dy.ServerResponse&&this[Pl].delete(e),super.unpipe(e),this}};ke.default=Hl});var Sa=A(ur=>{"use strict";var Uq=ur&&ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hq=ur&&ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uq(e,t,r)};Object.defineProperty(ur,"__esModule",{value:!0});ur.CancelError=ur.ParseError=void 0;var TR=xa(),gy=class extends TR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};ur.ParseError=gy;var _y=class extends TR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};ur.CancelError=_y;Hq(xa(),ur)});var FR=A(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var OR=Sa(),$q=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new OR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new OR.ParseError(s,t)}};by.default=$q});var vy=A(Bn=>{"use strict";var Gq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Vq=require("events"),Wq=en(),Yq=TC(),$l=Sa(),PR=FR(),IR=xa(),Kq=ry(),Zq=cy(),LR=ly(),Jq=["request","response","redirect","uploadProgress","downloadProgress"];function BR(t){let e,r,n=new Vq.EventEmitter,i=new Yq((o,a,u)=>{let c=l=>{let h=new IR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new $l.CancelError(h))),e=h,h.once("response",async y=>{var m;if(y.retryCount=l,y.request.aborted)return;let p;try{p=await Zq.default(h),y.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((m=y.headers["content-encoding"])!==null&&m!==void 0?m:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:P}=h;if(R&&!P.decompress)y.body=p;else try{y.body=PR.default(y,P.responseType,P.parseJson,P.encoding)}catch(O){if(y.body=p.toString(),LR.isResponseOk(y)){h._beforeError(O);return}}try{for(let[O,F]of P.hooks.afterResponse.entries())y=await F(y,async M=>{let x=IR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,O);for(let U of x.hooks.beforeRetry)await U(x);let D=BR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(O){h._beforeError(new $l.RequestError(O.message,O,h));return}if(r=y,!LR.isResponseOk(y)){h._beforeError(new $l.HTTPError(y));return}h.destroy(),o(h.options.resolveBodyOnly?y.body:y)});let f=y=>{if(i.isCanceled)return;let{options:m}=h;if(y instanceof $l.HTTPError&&!m.throwHttpErrors){let{response:p}=y;o(h.options.resolveBodyOnly?p.body:p);return}a(y)};h.once("error",f);let d=h.options.body;h.once("retry",(y,m)=>{var p,E;if(d===((p=m.request)===null||p===void 0?void 0:p.options.body)&&Wq.default.nodeStream((E=m.request)===null||E===void 0?void 0:E.options.body)){f(m);return}c(y)}),Kq.default(h,n,Jq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return PR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=BR;zq(Sa(),Bn)});var NR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var Xq=Sa();function Qq(t,...e){let r=(async()=>{if(t instanceof Xq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Ey.default=Qq});var qR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var MR=en();function jR(t){for(let e of Object.values(t))(MR.default.plainObject(e)||MR.default.array(e))&&jR(e);return Object.freeze(t)}wy.default=jR});var HR=A(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0})});var xy=A(Xt=>{"use strict";var eU=Xt&&Xt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tU=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eU(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.defaultHandler=void 0;var $R=en(),Jt=vy(),rU=NR(),zl=xa(),nU=qR(),iU={RequestError:Jt.RequestError,CacheError:Jt.CacheError,ReadError:Jt.ReadError,HTTPError:Jt.HTTPError,MaxRedirectsError:Jt.MaxRedirectsError,TimeoutError:Jt.TimeoutError,ParseError:Jt.ParseError,CancelError:Jt.CancelError,UnsupportedProtocolError:Jt.UnsupportedProtocolError,UploadError:Jt.UploadError},sU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:Gl}=zl.default,GR=(...t)=>{let e;for(let r of t)e=Gl(void 0,r,e);return e},oU=t=>t.isStream?new zl.default(void 0,t):Jt.default(t),aU=t=>"defaults"in t&&"options"in t.defaults,uU=["get","post","put","patch","head","delete"];Xt.defaultHandler=(t,e)=>e(t);var zR=(t,e)=>{if(t)for(let r of t)r(e)},VR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?oU:c);if($R.default.plainObject(n)){let l={...n,...i};zl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{zR(t.options.hooks.init,i),zR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=Gl(n,i,s!=null?s:t.options);if(h[zl.kIsNormalizedAlready]=!0,l)throw new Jt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return rU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)aU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Xt.defaultHandler),s.length===0&&s.push(Xt.defaultHandler),VR({options:GR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=Gl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!$R.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await sU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let y of h)if(o.filter(y,a,f)&&(!o.shouldContinue(y,a,f)||(yield y,o.stackAllItems&&a.push(y),f.push(y),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=Gl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of uU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,iU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:nU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=GR,e};Xt.default=VR;tU(HR(),Xt)});var Ay=A((tn,Vl)=>{"use strict";var cU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var lU=require("url"),YR=xy(),hU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new lU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[YR.defaultHandler],mutableDefaults:!1},Sy=YR.default(hU);tn.default=Sy;Vl.exports=Sy;Vl.exports.default=Sy;Vl.exports.__esModule=!0;WR(xy(),tn);WR(vy(),tn)});var tk=A((xK,ek)=>{function Qt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}ek.exports=Qt;Qt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Qt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Qt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};Qt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Qt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Qt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Qt.prototype.start=Qt.prototype.try;Qt.prototype.errors=function(){return this._errors};Qt.prototype.attempts=function(){return this._attempts};Qt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var rk=A(yi=>{var dU=tk();yi.operation=function(t){var e=yi.timeouts(t);return new dU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ik=A((AK,nk)=>{nk.exports=rk()});var ok=A((DK,sk)=>{var pU=ik();function mU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=pU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}sk.exports=mU});var wk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function m7(t){return t&&t.__esModule?t:{default:t}}var _k=Object.defineProperty,yk=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,gk=(t,e,r)=>e in t?_k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_7=(t,e)=>{for(var r in e||(e={}))y7.call(e,r)&&gk(t,r,e[r]);if(yk)for(var r of yk(e))g7.call(e,r)&&gk(t,r,e[r]);return t},b7=(t,e)=>{for(var r in e)_k(t,r,{get:e[r],enumerable:!0})},v7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),bk={};b7(bk,{configDir:()=>Ek,darwinConfig:()=>Hy,getPathForPlatform:()=>Gy,getPlatform:()=>Uy,linuxConfig:()=>th,winConfig:()=>$y});var E7=require("fs/promises"),w7=require("path"),vk=m7(w7);function Uy(){return process.platform}function th(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,".config")}function Hy(){if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,"/Library/Application Support")}function $y(){return process.env.APPDATA}function Gy({platform:t}){switch(t){case"linux":return th();case"darwin":return Hy();case"win32":return $y();default:return th()}}function Ek(){return v7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Uy(),n=Gy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield E7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=_7;Or.getPlatform=Uy;Or.linuxConfig=th;Or.darwinConfig=Hy;Or.winConfig=$y;Or.getPathForPlatform=Gy;Or.configDir=Ek;Or.config_dir_exports=bk});var xk=A(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var x7=wk();zy.configDir=x7.configDir});var kk=A((cZ,I7)=>{I7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Fk=A(jt=>{"use strict";var Ok=kk(),Ye=process.env;Object.defineProperty(jt,"_vendors",{value:Ok.map(function(t){return t.constant})});jt.name=null;jt.isPR=null;Ok.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Tk(n)});if(jt[t.constant]=r,!!r)switch(jt.name=t.name,typeof t.pr){case"string":jt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?jt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?jt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):jt.isPR=Tk(t.pr);break;default:jt.isPR=null}});jt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||jt.name));function Tk(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var rh=A((DZ,U7)=>{U7.exports={name:"create-turbo",version:"2.5.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.5.0",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/node":"^18.17.2","@types/semver":"^7.3.9",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^6.7.0",typescript:"5.5.4"},files:["dist"]}});var KT=oe(require("http")),ZT=oe(require("https")),wg=oe(require("picocolors")),Ha=require("commander");var pO=oe(Tg());function bh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(t)}function vh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Eh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Ir(t,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ir(t,e)}function wh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ir(t,e)}function xh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Sh(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bi(t,e,r){return Sh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Ir(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!xh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ir(i,n)},xo(t)}var Yg=oe(Wg());var mO=oe(require("fs-extra")),_G=function(t){wh(e,t);function e(r){var n;return bh(this,e),n=Eh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var yO=oe(require("fs")),gO=oe(require("path"));var P3=oe(require("fs")),I3=oe(require("path"));function l_(t){return typeof t=="undefined"||t===null}function vO(t){return typeof t=="object"&&t!==null}function EO(t){return Array.isArray(t)?t:l_(t)?[]:[t]}function wO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function xO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function SO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var AO=l_,DO=vO,CO=EO,RO=xO,kO=SO,TO=wO,Ve={isNothing:AO,isObject:DO,toArray:CO,repeat:RO,isNegativeZero:kO,extend:TO};function h_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
30
+ `)}`}}};ke.RequestError=Ue;var Bl=class extends Ue{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e),this.name="MaxRedirectsError",this.code="ERR_TOO_MANY_REDIRECTS"}};ke.MaxRedirectsError=Bl;var Nl=class extends Ue{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request),this.name="HTTPError",this.code="ERR_NON_2XX_3XX_RESPONSE"}};ke.HTTPError=Nl;var Ml=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="CacheError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_CACHE_ACCESS":this.code}};ke.CacheError=Ml;var jl=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="UploadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_UPLOAD":this.code}};ke.UploadError=jl;var ql=class extends Ue{constructor(e,r,n){super(e.message,e,n),this.name="TimeoutError",this.event=e.event,this.timings=r}};ke.TimeoutError=ql;var wa=class extends Ue{constructor(e,r){super(e.message,e,r),this.name="ReadError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_READING_RESPONSE_STREAM":this.code}};ke.ReadError=wa;var Ul=class extends Ue{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e),this.name="UnsupportedProtocolError",this.code="ERR_UNSUPPORTED_PROTOCOL"}};ke.UnsupportedProtocolError=Ul;var qq=["socket","connect","continue","information","upgrade","timeout"],Hl=class extends _R.Duplex{constructor(e,r={},n){super({autoDestroy:!1,highWaterMark:0}),this[Ks]=0,this[Js]=0,this.requestInitialized=!1,this[Pl]=new Set,this.redirects=[],this[Xs]=!1,this[Il]=!1,this[Ea]=[],this.retryCount=0,this._progressCallbacks=[];let i=()=>this._unlockWrite(),s=()=>this._lockWrite();this.on("pipe",c=>{c.prependListener("data",i),c.on("data",s),c.prependListener("end",i),c.on("end",s)}),this.on("unpipe",c=>{c.off("data",i),c.off("data",s),c.off("end",i),c.off("end",s)}),this.on("pipe",c=>{c instanceof dy.IncomingMessage&&(this.options.headers={...c.headers,...this.options.headers})});let{json:o,body:a,form:u}=r;if((o||a||u)&&this._lockWrite(),ke.kIsNormalizedAlready in r)this.options=r;else try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(c){Y.default.nodeStream(r.body)&&r.body.destroy(),this.destroy(c);return}(async()=>{var c;try{this.options.body instanceof bq.ReadStream&&await Nq(this.options.body);let{url:l}=this.options;if(!l)throw new TypeError("Missing `url` property");if(this.requestUrl=l.toString(),decodeURI(this.requestUrl),await this._finalizeBody(),await this._makeRequest(),this.destroyed){(c=this[nt])===null||c===void 0||c.destroy();return}for(let h of this[Ea])h();this[Ea].length=0,this.requestInitialized=!0}catch(l){if(l instanceof Ue){this._beforeError(l);return}this.destroyed||this.destroy(l)}})()}static normalizeArguments(e,r,n){var i,s,o,a,u;let c=r;if(Y.default.object(e)&&!Y.default.urlInstance(e))r={...n,...e,...r};else{if(e&&r&&r.url!==void 0)throw new TypeError("The `url` option is mutually exclusive with the `input` argument");r={...n,...r},e!==void 0&&(r.url=e),Y.default.urlInstance(r.url)&&(r.url=new Pn.URL(r.url.toString()))}if(r.cache===!1&&(r.cache=void 0),r.dnsCache===!1&&(r.dnsCache=void 0),Y.assert.any([Y.default.string,Y.default.undefined],r.method),Y.assert.any([Y.default.object,Y.default.undefined],r.headers),Y.assert.any([Y.default.string,Y.default.urlInstance,Y.default.undefined],r.prefixUrl),Y.assert.any([Y.default.object,Y.default.undefined],r.cookieJar),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.searchParams),Y.assert.any([Y.default.object,Y.default.string,Y.default.undefined],r.cache),Y.assert.any([Y.default.object,Y.default.number,Y.default.undefined],r.timeout),Y.assert.any([Y.default.object,Y.default.undefined],r.context),Y.assert.any([Y.default.object,Y.default.undefined],r.hooks),Y.assert.any([Y.default.boolean,Y.default.undefined],r.decompress),Y.assert.any([Y.default.boolean,Y.default.undefined],r.ignoreInvalidCookies),Y.assert.any([Y.default.boolean,Y.default.undefined],r.followRedirect),Y.assert.any([Y.default.number,Y.default.undefined],r.maxRedirects),Y.assert.any([Y.default.boolean,Y.default.undefined],r.throwHttpErrors),Y.assert.any([Y.default.boolean,Y.default.undefined],r.http2),Y.assert.any([Y.default.boolean,Y.default.undefined],r.allowGetBody),Y.assert.any([Y.default.string,Y.default.undefined],r.localAddress),Y.assert.any([SR.isDnsLookupIpVersion,Y.default.undefined],r.dnsLookupIpVersion),Y.assert.any([Y.default.object,Y.default.undefined],r.https),Y.assert.any([Y.default.boolean,Y.default.undefined],r.rejectUnauthorized),r.https&&(Y.assert.any([Y.default.boolean,Y.default.undefined],r.https.rejectUnauthorized),Y.assert.any([Y.default.function_,Y.default.undefined],r.https.checkServerIdentity),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificateAuthority),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.key),Y.assert.any([Y.default.string,Y.default.object,Y.default.array,Y.default.undefined],r.https.certificate),Y.assert.any([Y.default.string,Y.default.undefined],r.https.passphrase),Y.assert.any([Y.default.string,Y.default.buffer,Y.default.array,Y.default.undefined],r.https.pfx)),Y.assert.any([Y.default.object,Y.default.undefined],r.cacheOptions),Y.default.string(r.method)?r.method=r.method.toUpperCase():r.method="GET",r.headers===(n==null?void 0:n.headers)?r.headers={...r.headers}:r.headers=Aq({...n==null?void 0:n.headers,...r.headers}),"slashes"in r)throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.");if("auth"in r)throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.");if("searchParams"in r&&r.searchParams&&r.searchParams!==(n==null?void 0:n.searchParams)){let d;if(Y.default.string(r.searchParams)||r.searchParams instanceof Pn.URLSearchParams)d=new Pn.URLSearchParams(r.searchParams);else{Lq(r.searchParams),d=new Pn.URLSearchParams;for(let y in r.searchParams){let m=r.searchParams[y];m===null?d.append(y,""):m!==void 0&&d.append(y,m)}}(i=n==null?void 0:n.searchParams)===null||i===void 0||i.forEach((y,m)=>{d.has(m)||d.append(m,y)}),r.searchParams=d}if(r.username=(s=r.username)!==null&&s!==void 0?s:"",r.password=(o=r.password)!==null&&o!==void 0?o:"",Y.default.undefined(r.prefixUrl)?r.prefixUrl=(a=n==null?void 0:n.prefixUrl)!==null&&a!==void 0?a:"":(r.prefixUrl=r.prefixUrl.toString(),r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")&&(r.prefixUrl+="/")),Y.default.string(r.url)){if(r.url.startsWith("/"))throw new Error("`input` must not start with a slash when using `prefixUrl`");r.url=xR.default(r.prefixUrl+r.url,r)}else(Y.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol)&&(r.url=xR.default(r.prefixUrl,r));if(r.url){"port"in r&&delete r.port;let{prefixUrl:d}=r;Object.defineProperty(r,"prefixUrl",{set:m=>{let p=r.url;if(!p.href.startsWith(m))throw new Error(`Cannot change \`prefixUrl\` from ${d} to ${m}: ${p.href}`);r.url=new Pn.URL(m+p.href.slice(d.length)),d=m},get:()=>d});let{protocol:y}=r.url;if(y==="unix:"&&(y="http:",r.url=new Pn.URL(`http://unix${r.url.pathname}${r.url.search}`)),r.searchParams&&(r.url.search=r.searchParams.toString()),y!=="http:"&&y!=="https:")throw new Ul(r);r.username===""?r.username=r.url.username:r.url.username=r.username,r.password===""?r.password=r.url.password:r.url.password=r.password}let{cookieJar:l}=r;if(l){let{setCookie:d,getCookieString:y}=l;Y.assert.function_(d),Y.assert.function_(y),d.length===4&&y.length===0&&(d=gR.promisify(d.bind(r.cookieJar)),y=gR.promisify(y.bind(r.cookieJar)),r.cookieJar={setCookie:d,getCookieString:y})}let{cache:h}=r;if(h&&(yy.has(h)||yy.set(h,new vR((d,y)=>{let m=d[nt](d,y);return Y.default.promise(m)&&(m.once=(p,E)=>{if(p==="error")m.catch(E);else if(p==="abort")(async()=>{try{(await m).once("abort",E)}catch{}})();else throw new Error(`Unknown HTTP2 promise event: ${p}`);return m}),m},h))),r.cacheOptions={...r.cacheOptions},r.dnsCache===!0)py||(py=new wq.default),r.dnsCache=py;else if(!Y.default.undefined(r.dnsCache)&&!r.dnsCache.lookup)throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${Y.default(r.dnsCache)}`);Y.default.number(r.timeout)?r.timeout={request:r.timeout}:n&&r.timeout!==n.timeout?r.timeout={...n.timeout,...r.timeout}:r.timeout={...r.timeout},r.context||(r.context={});let f=r.hooks===(n==null?void 0:n.hooks);r.hooks={...r.hooks};for(let d of ke.knownHookEvents)if(d in r.hooks)if(Y.default.array(r.hooks[d]))r.hooks[d]=[...r.hooks[d]];else throw new TypeError(`Parameter \`${d}\` must be an Array, got ${Y.default(r.hooks[d])}`);else r.hooks[d]=[];if(n&&!f)for(let d of ke.knownHookEvents)n.hooks[d].length>0&&(r.hooks[d]=[...n.hooks[d],...r.hooks[d]]);if("family"in r&&In.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"'),n!=null&&n.https&&(r.https={...n.https,...r.https}),"rejectUnauthorized"in r&&In.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"'),"checkServerIdentity"in r&&In.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"'),"ca"in r&&In.default('"options.ca" was never documented, please use "options.https.certificateAuthority"'),"key"in r&&In.default('"options.key" was never documented, please use "options.https.key"'),"cert"in r&&In.default('"options.cert" was never documented, please use "options.https.certificate"'),"passphrase"in r&&In.default('"options.passphrase" was never documented, please use "options.https.passphrase"'),"pfx"in r&&In.default('"options.pfx" was never documented, please use "options.https.pfx"'),"followRedirects"in r)throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.");if(r.agent){for(let d in r.agent)if(d!=="http"&&d!=="https"&&d!=="http2")throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${d}\``)}return r.maxRedirects=(u=r.maxRedirects)!==null&&u!==void 0?u:0,ke.setNonEnumerableProperties([n,c],r),Fq.default(r,n)}_lockWrite(){let e=()=>{throw new TypeError("The payload has been already provided")};this.write=e,this.end=e}_unlockWrite(){this.write=super.write,this.end=super.end}async _finalizeBody(){let{options:e}=this,{headers:r}=e,n=!Y.default.undefined(e.form),i=!Y.default.undefined(e.json),s=!Y.default.undefined(e.body),o=n||i||s,a=ke.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);if(this._cannotHaveBody=a,o){if(a)throw new TypeError(`The \`${e.method}\` method cannot be used with a body`);if([s,n,i].filter(u=>u).length>1)throw new TypeError("The `body`, `json` and `form` options are mutually exclusive");if(s&&!(e.body instanceof _R.Readable)&&!Y.default.string(e.body)&&!Y.default.buffer(e.body)&&!ER.default(e.body))throw new TypeError("The `body` option must be a stream.Readable, string or Buffer");if(n&&!Y.default.object(e.form))throw new TypeError("The `form` option must be an Object");{let u=!Y.default.string(r["content-type"]);s?(ER.default(e.body)&&u&&(r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`),this[Ln]=e.body):n?(u&&(r["content-type"]="application/x-www-form-urlencoded"),this[Ln]=new Pn.URLSearchParams(e.form).toString()):(u&&(r["content-type"]="application/json"),this[Ln]=e.stringifyJson(e.json));let c=await Dq.default(this[Ln],e.headers);Y.default.undefined(r["content-length"])&&Y.default.undefined(r["transfer-encoding"])&&!a&&!Y.default.undefined(c)&&(r["content-length"]=String(c))}}else a?this._lockWrite():this._unlockWrite();this[Zs]=Number(r["content-length"])||void 0}async _onResponseBase(e){let{options:r}=this,{url:n}=r;this[RR]=e,r.decompress&&(e=xq(e));let i=e.statusCode,s=e;s.statusMessage=s.statusMessage?s.statusMessage:bR.STATUS_CODES[i],s.url=r.url.toString(),s.requestUrl=this.requestUrl,s.redirectUrls=this.redirects,s.request=this,s.isFromCache=e.fromCache||!1,s.ip=this.ip,s.retryCount=this.retryCount,this[DR]=s.isFromCache,this[Ys]=Number(e.headers["content-length"])||void 0,this[Ll]=e,e.once("end",()=>{this[Ys]=this[Ks],this.emit("downloadProgress",this.downloadProgress)}),e.once("error",a=>{e.destroy(),this._beforeError(new wa(a,this))}),e.once("aborted",()=>{this._beforeError(new wa({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))}),this.emit("downloadProgress",this.downloadProgress);let o=e.headers["set-cookie"];if(Y.default.object(r.cookieJar)&&o){let a=o.map(async u=>r.cookieJar.setCookie(u,n.toString()));r.ignoreInvalidCookies&&(a=a.map(async u=>u.catch(()=>{})));try{await Promise.all(a)}catch(u){this._beforeError(u);return}}if(r.followRedirect&&e.headers.location&&Mq.has(i)){if(e.resume(),this[nt]&&(this[my](),delete this[nt],this[AR]()),(i===303&&r.method!=="GET"&&r.method!=="HEAD"||!r.methodRewriting)&&(r.method="GET","body"in r&&delete r.body,"json"in r&&delete r.json,"form"in r&&delete r.form,this[Ln]=void 0,delete r.headers["content-length"]),this.redirects.length>=r.maxRedirects){this._beforeError(new Bl(this));return}try{let h=function(f){return f.protocol==="unix:"||f.hostname==="unix"},u=Buffer.from(e.headers.location,"binary").toString(),c=new Pn.URL(u,n),l=c.toString();if(decodeURI(l),!h(n)&&h(c)){this._beforeError(new Ue("Cannot redirect to UNIX socket",{},this));return}c.hostname!==n.hostname||c.port!==n.port?("host"in r.headers&&delete r.headers.host,"cookie"in r.headers&&delete r.headers.cookie,"authorization"in r.headers&&delete r.headers.authorization,(r.username||r.password)&&(r.username="",r.password="")):(c.username=r.username,c.password=r.password),this.redirects.push(l),r.url=c;for(let f of r.hooks.beforeRedirect)await f(r,s);this.emit("redirect",s,r),await this._makeRequest()}catch(u){this._beforeError(u);return}return}if(r.isStream&&r.throwHttpErrors&&!Oq.isResponseOk(s)){this._beforeError(new Nl(s));return}e.on("readable",()=>{this[Il]&&this._read()}),this.on("resume",()=>{e.resume()}),this.on("pause",()=>{e.pause()}),e.once("end",()=>{this.push(null)}),this.emit("response",e);for(let a of this[Pl])if(!a.headersSent){for(let u in e.headers){let c=r.decompress?u!=="content-encoding":!0,l=e.headers[u];c&&a.setHeader(u,l)}a.statusCode=i}}async _onResponse(e){try{await this._onResponseBase(e)}catch(r){this._beforeError(r)}}_onRequest(e){let{options:r}=this,{timeout:n,url:i}=r;Eq.default(e),this[my]=wR.default(e,n,i);let s=r.cache?"cacheableResponse":"response";e.once(s,u=>{this._onResponse(u)}),e.once("error",u=>{var c;e.destroy(),(c=e.res)===null||c===void 0||c.removeAllListeners("end"),u=u instanceof wR.TimeoutError?new ql(u,this.timings,this):new Ue(u.message,u,this),this._beforeError(u)}),this[AR]=Cq.default(e,this,qq),this[nt]=e,this.emit("uploadProgress",this.uploadProgress);let o=this[Ln],a=this.redirects.length===0?this:e;Y.default.nodeStream(o)?(o.pipe(a),o.once("error",u=>{this._beforeError(new jl(u,this))})):(this._unlockWrite(),Y.default.undefined(o)?(this._cannotHaveBody||this._noPipe)&&(a.end(),this._lockWrite()):(this._writeRequest(o,void 0,()=>{}),a.end(),this._lockWrite())),this.emit("request",e)}async _createCacheableRequest(e,r){return new Promise((n,i)=>{Object.assign(r,Rq.default(e)),delete r.url;let s,o=yy.get(r.cache)(r,async a=>{a._readableState.autoDestroy=!1,s&&(await s).emit("cacheableResponse",a),n(a)});r.url=e,o.once("error",i),o.once("request",async a=>{s=a,n(s)})})}async _makeRequest(){var e,r,n,i,s;let{options:o}=this,{headers:a}=o;for(let E in a)if(Y.default.undefined(a[E]))delete a[E];else if(Y.default.null_(a[E]))throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${E}\` header`);if(o.decompress&&Y.default.undefined(a["accept-encoding"])&&(a["accept-encoding"]=Iq?"gzip, deflate, br":"gzip, deflate"),o.cookieJar){let E=await o.cookieJar.getCookieString(o.url.toString());Y.default.nonEmptyString(E)&&(o.headers.cookie=E)}for(let E of o.hooks.beforeRequest){let R=await E(o);if(!Y.default.undefined(R)){o.request=()=>R;break}}o.body&&this[Ln]!==o.body&&(this[Ln]=o.body);let{agent:u,request:c,timeout:l,url:h}=o;if(o.dnsCache&&!("lookup"in o)&&(o.lookup=o.dnsCache.lookup),h.hostname==="unix"){let E=/(?<socketPath>.+?):(?<path>.+)/.exec(`${h.pathname}${h.search}`);if(E!=null&&E.groups){let{socketPath:R,path:P}=E.groups;Object.assign(o,{socketPath:R,path:P,host:""})}}let f=h.protocol==="https:",d;o.http2?d=Sq.auto:d=f?vq.request:bR.request;let y=(e=o.request)!==null&&e!==void 0?e:d,m=o.cache?this._createCacheableRequest:y;u&&!o.http2&&(o.agent=u[f?"https":"http"]),o[nt]=y,delete o.request,delete o.timeout;let p=o;if(p.shared=(r=o.cacheOptions)===null||r===void 0?void 0:r.shared,p.cacheHeuristic=(n=o.cacheOptions)===null||n===void 0?void 0:n.cacheHeuristic,p.immutableMinTimeToLive=(i=o.cacheOptions)===null||i===void 0?void 0:i.immutableMinTimeToLive,p.ignoreCargoCult=(s=o.cacheOptions)===null||s===void 0?void 0:s.ignoreCargoCult,o.dnsLookupIpVersion!==void 0)try{p.family=SR.dnsLookupIpVersionToFamily(o.dnsLookupIpVersion)}catch{throw new Error("Invalid `dnsLookupIpVersion` option value")}o.https&&("rejectUnauthorized"in o.https&&(p.rejectUnauthorized=o.https.rejectUnauthorized),o.https.checkServerIdentity&&(p.checkServerIdentity=o.https.checkServerIdentity),o.https.certificateAuthority&&(p.ca=o.https.certificateAuthority),o.https.certificate&&(p.cert=o.https.certificate),o.https.key&&(p.key=o.https.key),o.https.passphrase&&(p.passphrase=o.https.passphrase),o.https.pfx&&(p.pfx=o.https.pfx));try{let E=await m(h,p);Y.default.undefined(E)&&(E=d(h,p)),o.request=c,o.timeout=l,o.agent=u,o.https&&("rejectUnauthorized"in o.https&&delete p.rejectUnauthorized,o.https.checkServerIdentity&&delete p.checkServerIdentity,o.https.certificateAuthority&&delete p.ca,o.https.certificate&&delete p.cert,o.https.key&&delete p.key,o.https.passphrase&&delete p.passphrase,o.https.pfx&&delete p.pfx),Bq(E)?this._onRequest(E):this.writable?(this.once("finish",()=>{this._onResponse(E)}),this._unlockWrite(),this.end(),this._lockWrite()):this._onResponse(E)}catch(E){throw E instanceof vR.CacheError?new Ml(E,this):new Ue(E.message,E,this)}}async _error(e){try{for(let r of this.options.hooks.beforeError)e=await r(e)}catch(r){e=new Ue(r.message,r,this)}this.destroy(e)}_beforeError(e){if(this[Xs])return;let{options:r}=this,n=this.retryCount+1;this[Xs]=!0,e instanceof Ue||(e=new Ue(e.message,e,this));let i=e,{response:s}=i;(async()=>{if(s&&!s.body){s.setEncoding(this._readableState.encoding);try{s.rawBody=await Tq.default(s),s.body=s.rawBody.toString()}catch{}}if(this.listenerCount("retry")!==0){let o;try{let a;s&&"retry-after"in s.headers&&(a=Number(s.headers["retry-after"]),Number.isNaN(a)?(a=Date.parse(s.headers["retry-after"])-Date.now(),a<=0&&(a=1)):a*=1e3),o=await r.retry.calculateDelay({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:Pq.default({attemptCount:n,retryOptions:r.retry,error:i,retryAfter:a,computedValue:0})})}catch(a){this._error(new Ue(a.message,a,this));return}if(o){let a=async()=>{try{for(let u of this.options.hooks.beforeRetry)await u(this.options,i,n)}catch(u){this._error(new Ue(u.message,e,this));return}this.destroyed||(this.destroy(),this.emit("retry",n,e))};this[kR]=setTimeout(a,o);return}}this._error(i)})()}_read(){this[Il]=!0;let e=this[Ll];if(e&&!this[Xs]){e.readableLength&&(this[Il]=!1);let r;for(;(r=e.read())!==null;){this[Ks]+=r.length,this[CR]=!0;let n=this.downloadProgress;n.percent<1&&this.emit("downloadProgress",n),this.push(r)}}}_write(e,r,n){let i=()=>{this._writeRequest(e,r,n)};this.requestInitialized?i():this[Ea].push(i)}_writeRequest(e,r,n){this[nt].destroyed||(this._progressCallbacks.push(()=>{this[Js]+=Buffer.byteLength(e,r);let i=this.uploadProgress;i.percent<1&&this.emit("uploadProgress",i)}),this[nt].write(e,r,i=>{!i&&this._progressCallbacks.length>0&&this._progressCallbacks.shift()(),n(i)}))}_final(e){let r=()=>{for(;this._progressCallbacks.length!==0;)this._progressCallbacks.shift()();if(!(nt in this)){e();return}if(this[nt].destroyed){e();return}this[nt].end(n=>{n||(this[Zs]=this[Js],this.emit("uploadProgress",this.uploadProgress),this[nt].emit("upload-complete")),e(n)})};this.requestInitialized?r():this[Ea].push(r)}_destroy(e,r){var n;this[Xs]=!0,clearTimeout(this[kR]),nt in this&&(this[my](),!((n=this[Ll])===null||n===void 0)&&n.complete||this[nt].destroy()),e!==null&&!Y.default.undefined(e)&&!(e instanceof Ue)&&(e=new Ue(e.message,e,this)),r(e)}get _isAboutToError(){return this[Xs]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,r,n;return((r=(e=this[nt])===null||e===void 0?void 0:e.destroyed)!==null&&r!==void 0?r:this.destroyed)&&!(!((n=this[RR])===null||n===void 0)&&n.complete)}get socket(){var e,r;return(r=(e=this[nt])===null||e===void 0?void 0:e.socket)!==null&&r!==void 0?r:void 0}get downloadProgress(){let e;return this[Ys]?e=this[Ks]/this[Ys]:this[Ys]===this[Ks]?e=1:e=0,{percent:e,transferred:this[Ks],total:this[Ys]}}get uploadProgress(){let e;return this[Zs]?e=this[Js]/this[Zs]:this[Zs]===this[Js]?e=1:e=0,{percent:e,transferred:this[Js],total:this[Zs]}}get timings(){var e;return(e=this[nt])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[DR]}pipe(e,r){if(this[CR])throw new Error("Failed to pipe. The response has been emitted already.");return e instanceof dy.ServerResponse&&this[Pl].add(e),super.pipe(e,r)}unpipe(e){return e instanceof dy.ServerResponse&&this[Pl].delete(e),super.unpipe(e),this}};ke.default=Hl});var Sa=A(ur=>{"use strict";var Uq=ur&&ur.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hq=ur&&ur.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uq(e,t,r)};Object.defineProperty(ur,"__esModule",{value:!0});ur.CancelError=ur.ParseError=void 0;var TR=xa(),gy=class extends TR.RequestError{constructor(e,r){let{options:n}=r.request;super(`${e.message} in "${n.url.toString()}"`,e,r.request),this.name="ParseError",this.code=this.code==="ERR_GOT_REQUEST_ERROR"?"ERR_BODY_PARSE_FAILURE":this.code}};ur.ParseError=gy;var _y=class extends TR.RequestError{constructor(e){super("Promise was canceled",{},e),this.name="CancelError",this.code="ERR_CANCELED"}get isCanceled(){return!0}};ur.CancelError=_y;Hq(xa(),ur)});var FR=A(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});var OR=Sa(),$q=(t,e,r,n)=>{let{rawBody:i}=t;try{if(e==="text")return i.toString(n);if(e==="json")return i.length===0?"":r(i.toString());if(e==="buffer")return i;throw new OR.ParseError({message:`Unknown body type '${e}'`,name:"Error"},t)}catch(s){throw new OR.ParseError(s,t)}};by.default=$q});var vy=A(Bn=>{"use strict";var Gq=Bn&&Bn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zq=Bn&&Bn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gq(e,t,r)};Object.defineProperty(Bn,"__esModule",{value:!0});var Vq=require("events"),Wq=en(),Yq=TC(),$l=Sa(),PR=FR(),IR=xa(),Kq=ry(),Zq=cy(),LR=ly(),Jq=["request","response","redirect","uploadProgress","downloadProgress"];function BR(t){let e,r,n=new Vq.EventEmitter,i=new Yq((o,a,u)=>{let c=l=>{let h=new IR.default(void 0,t);h.retryCount=l,h._noPipe=!0,u(()=>h.destroy()),u.shouldReject=!1,u(()=>a(new $l.CancelError(h))),e=h,h.once("response",async y=>{var m;if(y.retryCount=l,y.request.aborted)return;let p;try{p=await Zq.default(h),y.rawBody=p}catch{return}if(h._isAboutToError)return;let E=((m=y.headers["content-encoding"])!==null&&m!==void 0?m:"").toLowerCase(),R=["gzip","deflate","br"].includes(E),{options:P}=h;if(R&&!P.decompress)y.body=p;else try{y.body=PR.default(y,P.responseType,P.parseJson,P.encoding)}catch(O){if(y.body=p.toString(),LR.isResponseOk(y)){h._beforeError(O);return}}try{for(let[O,F]of P.hooks.afterResponse.entries())y=await F(y,async M=>{let x=IR.default.normalizeArguments(void 0,{...M,retry:{calculateDelay:()=>0},throwHttpErrors:!1,resolveBodyOnly:!1},P);x.hooks.afterResponse=x.hooks.afterResponse.slice(0,O);for(let U of x.hooks.beforeRetry)await U(x);let D=BR(x);return u(()=>{D.catch(()=>{}),D.cancel()}),D})}catch(O){h._beforeError(new $l.RequestError(O.message,O,h));return}if(r=y,!LR.isResponseOk(y)){h._beforeError(new $l.HTTPError(y));return}h.destroy(),o(h.options.resolveBodyOnly?y.body:y)});let f=y=>{if(i.isCanceled)return;let{options:m}=h;if(y instanceof $l.HTTPError&&!m.throwHttpErrors){let{response:p}=y;o(h.options.resolveBodyOnly?p.body:p);return}a(y)};h.once("error",f);let d=h.options.body;h.once("retry",(y,m)=>{var p,E;if(d===((p=m.request)===null||p===void 0?void 0:p.options.body)&&Wq.default.nodeStream((E=m.request)===null||E===void 0?void 0:E.options.body)){f(m);return}c(y)}),Kq.default(h,n,Jq)};c(0)});i.on=(o,a)=>(n.on(o,a),i);let s=o=>{let a=(async()=>{await i;let{options:u}=r.request;return PR.default(r,o,u.parseJson,u.encoding)})();return Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)),a};return i.json=()=>{let{headers:o}=e.options;return!e.writableFinished&&o.accept===void 0&&(o.accept="application/json"),s("json")},i.buffer=()=>s("buffer"),i.text=()=>s("text"),i}Bn.default=BR;zq(Sa(),Bn)});var NR=A(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});var Xq=Sa();function Qq(t,...e){let r=(async()=>{if(t instanceof Xq.RequestError)try{for(let i of e)if(i)for(let s of i)t=await s(t)}catch(i){t=i}throw t})(),n=()=>r;return r.json=n,r.text=n,r.buffer=n,r.on=n,r}Ey.default=Qq});var qR=A(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});var MR=en();function jR(t){for(let e of Object.values(t))(MR.default.plainObject(e)||MR.default.array(e))&&jR(e);return Object.freeze(t)}wy.default=jR});var HR=A(UR=>{"use strict";Object.defineProperty(UR,"__esModule",{value:!0})});var xy=A(Xt=>{"use strict";var eU=Xt&&Xt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tU=Xt&&Xt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eU(e,t,r)};Object.defineProperty(Xt,"__esModule",{value:!0});Xt.defaultHandler=void 0;var $R=en(),Jt=vy(),rU=NR(),zl=xa(),nU=qR(),iU={RequestError:Jt.RequestError,CacheError:Jt.CacheError,ReadError:Jt.ReadError,HTTPError:Jt.HTTPError,MaxRedirectsError:Jt.MaxRedirectsError,TimeoutError:Jt.TimeoutError,ParseError:Jt.ParseError,CancelError:Jt.CancelError,UnsupportedProtocolError:Jt.UnsupportedProtocolError,UploadError:Jt.UploadError},sU=async t=>new Promise(e=>{setTimeout(e,t)}),{normalizeArguments:Gl}=zl.default,GR=(...t)=>{let e;for(let r of t)e=Gl(void 0,r,e);return e},oU=t=>t.isStream?new zl.default(void 0,t):Jt.default(t),aU=t=>"defaults"in t&&"options"in t.defaults,uU=["get","post","put","patch","head","delete"];Xt.defaultHandler=(t,e)=>e(t);var zR=(t,e)=>{if(t)for(let r of t)r(e)},VR=t=>{t._rawHandlers=t.handlers,t.handlers=t.handlers.map(n=>(i,s)=>{let o,a=n(i,u=>(o=s(u),o));if(a!==o&&!i.isStream&&o){let u=a,{then:c,catch:l,finally:h}=u;Object.setPrototypeOf(u,Object.getPrototypeOf(o)),Object.defineProperties(u,Object.getOwnPropertyDescriptors(o)),u.then=c,u.catch=l,u.finally=h}return a});let e=(n,i={},s)=>{var o,a;let u=0,c=l=>t.handlers[u++](l,u===t.handlers.length?oU:c);if($R.default.plainObject(n)){let l={...n,...i};zl.setNonEnumerableProperties([n,i],l),i=l,n=void 0}try{let l;try{zR(t.options.hooks.init,i),zR((o=i.hooks)===null||o===void 0?void 0:o.init,i)}catch(f){l=f}let h=Gl(n,i,s!=null?s:t.options);if(h[zl.kIsNormalizedAlready]=!0,l)throw new Jt.RequestError(l.message,l,h);return c(h)}catch(l){if(i.isStream)throw l;return rU.default(l,t.options.hooks.beforeError,(a=i.hooks)===null||a===void 0?void 0:a.beforeError)}};e.extend=(...n)=>{let i=[t.options],s=[...t._rawHandlers],o;for(let a of n)aU(a)?(i.push(a.defaults.options),s.push(...a.defaults._rawHandlers),o=a.defaults.mutableDefaults):(i.push(a),"handlers"in a&&s.push(...a.handlers),o=a.mutableDefaults);return s=s.filter(a=>a!==Xt.defaultHandler),s.length===0&&s.push(Xt.defaultHandler),VR({options:GR(...i),handlers:s,mutableDefaults:!!o})};let r=async function*(n,i){let s=Gl(n,i,t.options);s.resolveBodyOnly=!1;let o=s.pagination;if(!$R.default.object(o))throw new TypeError("`options.pagination` must be implemented");let a=[],{countLimit:u}=o,c=0;for(;c<o.requestLimit;){c!==0&&await sU(o.backoff);let l=await e(void 0,void 0,s),h=await o.transform(l),f=[];for(let y of h)if(o.filter(y,a,f)&&(!o.shouldContinue(y,a,f)||(yield y,o.stackAllItems&&a.push(y),f.push(y),--u<=0)))return;let d=o.paginate(l,a,f);if(d===!1)return;d===l.request.options?s=l.request.options:d!==void 0&&(s=Gl(void 0,d,s)),c++}};e.paginate=r,e.paginate.all=async(n,i)=>{let s=[];for await(let o of r(n,i))s.push(o);return s},e.paginate.each=r,e.stream=(n,i)=>e(n,{...i,isStream:!0});for(let n of uU)e[n]=(i,s)=>e(i,{...s,method:n}),e.stream[n]=(i,s)=>e(i,{...s,method:n,isStream:!0});return Object.assign(e,iU),Object.defineProperty(e,"defaults",{value:t.mutableDefaults?t:nU.default(t),writable:t.mutableDefaults,configurable:t.mutableDefaults,enumerable:!0}),e.mergeOptions=GR,e};Xt.default=VR;tU(HR(),Xt)});var Ay=A((tn,Vl)=>{"use strict";var cU=tn&&tn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WR=tn&&tn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cU(e,t,r)};Object.defineProperty(tn,"__esModule",{value:!0});var lU=require("url"),YR=xy(),hU={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:void 0,calculateDelay:({computedValue:t})=>t},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:void 0,dnsCache:void 0,decompress:!0,throwHttpErrors:!0,followRedirect:!0,isStream:!1,responseType:"text",resolveBodyOnly:!1,maxRedirects:10,prefixUrl:"",methodRewriting:!0,ignoreInvalidCookies:!1,context:{},http2:!1,allowGetBody:!1,https:void 0,pagination:{transform:t=>t.request.options.responseType==="json"?t.body:JSON.parse(t.body),paginate:t=>{if(!Reflect.has(t.headers,"link"))return!1;let e=t.headers.link.split(","),r;for(let n of e){let i=n.split(";");if(i[1].includes("next")){r=i[0].trimStart().trim(),r=r.slice(1,-1);break}}return r?{url:new lU.URL(r)}:!1},filter:()=>!0,shouldContinue:()=>!0,countLimit:1/0,backoff:0,requestLimit:1e4,stackAllItems:!0},parseJson:t=>JSON.parse(t),stringifyJson:t=>JSON.stringify(t),cacheOptions:{}},handlers:[YR.defaultHandler],mutableDefaults:!1},Sy=YR.default(hU);tn.default=Sy;Vl.exports=Sy;Vl.exports.default=Sy;Vl.exports.__esModule=!0;WR(xy(),tn);WR(vy(),tn)});var tk=A((xK,ek)=>{function Qt(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}ek.exports=Qt;Qt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Qt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Qt.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};Qt.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Qt.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};Qt.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};Qt.prototype.start=Qt.prototype.try;Qt.prototype.errors=function(){return this._errors};Qt.prototype.attempts=function(){return this._attempts};Qt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=r&&(e=i,r=o)}return e}});var rk=A(yi=>{var dU=tk();yi.operation=function(t){var e=yi.timeouts(t);return new dU(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};yi.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<e.retries;i++)n.push(this.createTimeout(i,e));return t&&t.forever&&!n.length&&n.push(this.createTimeout(i,e)),n.sort(function(s,o){return s-o}),n};yi.createTimeout=function(t,e){var r=e.randomize?Math.random()+1:1,n=Math.round(r*Math.max(e.minTimeout,1)*Math.pow(e.factor,t));return n=Math.min(n,e.maxTimeout),n};yi.wrap=function(t,e,r){if(e instanceof Array&&(r=e,e=null),!r){r=[];for(var n in t)typeof t[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var s=r[i],o=t[s];t[s]=function(u){var c=yi.operation(e),l=Array.prototype.slice.call(arguments,1),h=l.pop();l.push(function(f){c.retry(f)||(f&&(arguments[0]=c.mainError()),h.apply(this,arguments))}),c.attempt(function(){u.apply(t,l)})}.bind(t,o),t[s].options=e}}});var ik=A((AK,nk)=>{nk.exports=rk()});var ok=A((DK,sk)=>{var pU=ik();function mU(t,e){function r(n,i){var s=e||{},o;"randomize"in s||(s.randomize=!0),o=pU.operation(s);function a(l){i(l||new Error("Aborted"))}function u(l,h){if(l.bail){a(l);return}o.retry(l)?s.onRetry&&s.onRetry(l,h):i(o.mainError())}function c(l){var h;try{h=t(a,l)}catch(f){u(f,l);return}Promise.resolve(h).then(n).catch(function(d){u(d,l)})}o.attempt(c)}return new Promise(r)}sk.exports=mU});var wk=A(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});function m7(t){return t&&t.__esModule?t:{default:t}}var _k=Object.defineProperty,yk=Object.getOwnPropertySymbols,y7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,gk=(t,e,r)=>e in t?_k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_7=(t,e)=>{for(var r in e||(e={}))y7.call(e,r)&&gk(t,r,e[r]);if(yk)for(var r of yk(e))g7.call(e,r)&&gk(t,r,e[r]);return t},b7=(t,e)=>{for(var r in e)_k(t,r,{get:e[r],enumerable:!0})},v7=(t,e,r)=>new Promise((n,i)=>{var s=u=>{try{a(r.next(u))}catch(c){i(c)}},o=u=>{try{a(r.throw(u))}catch(c){i(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,o);a((r=r.apply(t,e)).next())}),bk={};b7(bk,{configDir:()=>Ek,darwinConfig:()=>Hy,getPathForPlatform:()=>Gy,getPlatform:()=>Uy,linuxConfig:()=>th,winConfig:()=>$y});var E7=require("fs/promises"),w7=require("path"),vk=m7(w7);function Uy(){return process.platform}function th(){if(process.env.XDG_CONFIG_HOME!==void 0)return process.env.XDG_CONFIG_HOME;if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,".config")}function Hy(){if(process.env.HOME!==void 0)return vk.default.join(process.env.HOME,"/Library/Application Support")}function $y(){return process.env.APPDATA}function Gy({platform:t}){switch(t){case"linux":return th();case"darwin":return Hy();case"win32":return $y();default:return th()}}function Ek(){return v7(this,arguments,function*(t={}){var e;let r=(e=t.platform)!=null?e:Uy(),n=Gy({platform:r});if(n!==void 0){if(t.validate===!1)return n;try{return yield E7.stat.call(void 0,n),n}catch{return}}})}Or.__spreadValues=_7;Or.getPlatform=Uy;Or.linuxConfig=th;Or.darwinConfig=Hy;Or.winConfig=$y;Or.getPathForPlatform=Gy;Or.configDir=Ek;Or.config_dir_exports=bk});var xk=A(zy=>{"use strict";Object.defineProperty(zy,"__esModule",{value:!0});var x7=wk();zy.configDir=x7.configDir});var kk=A((cZ,I7)=>{I7.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE"},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN"},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Fk=A(jt=>{"use strict";var Ok=kk(),Ye=process.env;Object.defineProperty(jt,"_vendors",{value:Ok.map(function(t){return t.constant})});jt.name=null;jt.isPR=null;Ok.forEach(function(t){let r=(Array.isArray(t.env)?t.env:[t.env]).every(function(n){return Tk(n)});if(jt[t.constant]=r,!!r)switch(jt.name=t.name,typeof t.pr){case"string":jt.isPR=!!Ye[t.pr];break;case"object":"env"in t.pr?jt.isPR=t.pr.env in Ye&&Ye[t.pr.env]!==t.pr.ne:"any"in t.pr?jt.isPR=t.pr.any.some(function(n){return!!Ye[n]}):jt.isPR=Tk(t.pr);break;default:jt.isPR=null}});jt.isCI=!!(Ye.CI!=="false"&&(Ye.BUILD_ID||Ye.BUILD_NUMBER||Ye.CI||Ye.CI_APP_ID||Ye.CI_BUILD_ID||Ye.CI_BUILD_NUMBER||Ye.CI_NAME||Ye.CONTINUOUS_INTEGRATION||Ye.RUN_ID||jt.name));function Tk(t){return typeof t=="string"?!!Ye[t]:"env"in t?Ye[t.env]&&Ye[t.env].includes(t.includes):"any"in t?t.any.some(function(e){return!!Ye[e]}):Object.keys(t).every(function(e){return Ye[e]===t[e]})}});var rh=A((DZ,U7)=>{U7.exports={name:"create-turbo",version:"2.5.1-canary.0",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turborepo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turborepo/issues"},bin:{"create-turbo":"dist/cli.js"},scripts:{build:"tsup",test:"jest",lint:"eslint src/","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0",picocolors:"1.0.1","proxy-agent":"^6.5.0",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@jest/globals":"^29.7.0","@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/utils":"workspace:*","@turbo/workspaces":"workspace:*","@types/fs-extra":"^9.0.13","@types/inquirer":"^7.3.1","@types/node":"^18.17.2","@types/semver":"^7.3.9",jest:"^29.7.0","ts-jest":"^29.2.5",tsup:"^6.7.0",typescript:"5.5.4"},files:["dist"]}});var KT=oe(require("http")),ZT=oe(require("https")),wg=oe(require("picocolors")),Ha=require("commander");var pO=oe(Tg());function bh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wo(t){return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(t)}function vh(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Eh(t,e){if(e&&(wo(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return vh(t)}function zn(t){return zn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zn(t)}function Ir(t,e){return Ir=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},Ir(t,e)}function wh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ir(t,e)}function xh(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Sh(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bi(t,e,r){return Sh()?Bi=Reflect.construct.bind():Bi=function(i,s,o){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(i,a),c=new u;return o&&Ir(c,o.prototype),c},Bi.apply(null,arguments)}function xo(t){var e=typeof Map=="function"?new Map:void 0;return xo=function(n){if(n===null||!xh(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Bi(n,arguments,zn(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ir(i,n)},xo(t)}var Yg=oe(Wg());var mO=oe(require("fs-extra")),_G=function(t){wh(e,t);function e(r){var n;return bh(this,e),n=Eh(this,zn(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(xo(Error));var yO=oe(require("fs")),gO=oe(require("path"));var P3=oe(require("fs")),I3=oe(require("path"));function l_(t){return typeof t=="undefined"||t===null}function vO(t){return typeof t=="object"&&t!==null}function EO(t){return Array.isArray(t)?t:l_(t)?[]:[t]}function wO(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function xO(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function SO(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var AO=l_,DO=vO,CO=EO,RO=xO,kO=SO,TO=wO,Ve={isNothing:AO,isObject:DO,toArray:CO,repeat:RO,isNegativeZero:kO,extend:TO};function h_(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
31
31
 
32
32
  `+t.mark.snippet),n+" "+r):n}function Ao(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=h_(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ao.prototype=Object.create(Error.prototype);Ao.prototype.constructor=Ao;Ao.prototype.toString=function(e){return this.name+": "+h_(this,e)};var pt=Ao;function Oh(t,e,r,n,i){var s="",o="",a=Math.floor(i/2)-1;return n-e>a&&(s=" ... ",e=n-a+s.length),r-n>a&&(o=" ...",r=n+a-o.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function Fh(t,e){return Ve.repeat(" ",e-t.length)+t}function OO(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,o=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=n.length-2);o<0&&(o=n.length-1);var a="",u,c,l=Math.min(t.line+e.linesAfter,i.length).toString().length,h=e.maxLength-(e.indent+l+3);for(u=1;u<=e.linesBefore&&!(o-u<0);u++)c=Oh(t.buffer,n[o-u],i[o-u],t.position-(n[o]-n[o-u]),h),a=Ve.repeat(" ",e.indent)+Fh((t.line-u+1).toString(),l)+" | "+c.str+`
33
33
  `+a;for(c=Oh(t.buffer,n[o],i[o],t.position,h),a+=Ve.repeat(" ",e.indent)+Fh((t.line+1).toString(),l)+" | "+c.str+`
@@ -60,7 +60,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);y(m)}return}
60
60
  `+t.slice(o+1):u+=t.slice(i),u.slice(1)}function g5(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=So(t,i),n=it[r],!n&&Ro(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||u5(r);return e}function _5(t,e,r){var n="",i=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(Lr(t,e,a,!1,!1)||typeof a=="undefined"&&Lr(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function u_(t,e,r,n){var i="",s=t.tag,o,a,u;for(o=0,a=r.length;o<a;o+=1)u=r[o],t.replacer&&(u=t.replacer.call(r,String(o),u)),(Lr(t,e+1,u,!0,!0,!1,!0)||typeof u=="undefined"&&Lr(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Bh(t,e)),t.dump&&Do===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function b5(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,u,c,l;for(o=0,a=s.length;o<a;o+=1)l="",n!==""&&(l+=", "),t.condenseFlow&&(l+='"'),u=s[o],c=r[u],t.replacer&&(c=t.replacer.call(r,u,c)),Lr(t,e,u,!1,!1)&&(t.dump.length>1024&&(l+="? "),l+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Lr(t,e,c,!1,!1)&&(l+=t.dump,n+=l));t.tag=i,t.dump="{"+n+"}"}function v5(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,u,c,l,h,f;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new pt("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)f="",(!n||i!=="")&&(f+=Bh(t,e)),c=o[a],l=r[c],t.replacer&&(l=t.replacer.call(r,c,l)),Lr(t,e+1,c,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Do===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,h&&(f+=Bh(t,e)),Lr(t,e+1,l,!0,h)&&(t.dump&&Do===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,i+=f));t.tag=s,t.dump=i||"{}"}function c_(t,e,r){var n,i,s,o,a,u;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(u=t.styleMap[a.tag]||a.defaultStyle,q_.call(a.represent)==="[object Function]")n=a.represent(e,u);else if(U_.call(a.represent,u))n=a.represent[u](e,u);else throw new pt("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');t.dump=n}return!0}return!1}function Lr(t,e,r,n,i,s,o){t.tag=null,t.dump=r,c_(t,r,!1)||c_(t,r,!0);var a=q_.call(t.dump),u=n,c;n&&(n=t.flowLevel<0||t.flowLevel>e);var l=a==="[object Object]"||a==="[object Array]",h,f;if(l&&(h=t.duplicates.indexOf(r),f=h!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(i=!1),f&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(l&&f&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(v5(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(b5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?u_(t,e-1,t.dump,i):u_(t,e,t.dump,i),f&&(t.dump="&ref_"+h+t.dump)):(_5(t,e,t.dump),f&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&m5(t,t.dump,e,s,u);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new pt("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function E5(t,e){var r=[],n=[],i,s;for(Mh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function Mh(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)Mh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)Mh(t[n[i]],e,r)}function w5(t,e){e=e||{};var r=new l5(e);r.noRefs||E5(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Lr(r,0,n,!0,!0)?r.dump+`
61
61
  `:""}var x5=w5,S5={dump:x5};function Gh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var A5=rt,D5=f_,C5=y_,R5=E_,k5=w_,T5=qh,O5=j_.load,F5=j_.loadAll,P5=S5.dump,I5=pt,L5={binary:C_,float:v_,map:m_,null:g_,pairs:k_,set:T_,timestamp:A_,bool:__,int:b_,merge:D_,omap:R_,seq:p_,str:d_},B5=Gh("safeLoad","load"),N5=Gh("safeLoadAll","loadAll"),M5=Gh("safeDump","dump"),j5={Type:A5,Schema:D5,FAILSAFE_SCHEMA:C5,JSON_SCHEMA:R5,CORE_SCHEMA:k5,DEFAULT_SCHEMA:T5,load:O5,loadAll:F5,dump:P5,YAMLException:I5,types:L5,safeLoad:B5,safeLoadAll:N5,safeDump:M5},zh=j5;var L3=oe(Cu());var de={};iO(de,{bold:()=>D3,dimmed:()=>R3,error:()=>Tt,grey:()=>k3,info:()=>A3,item:()=>T3,log:()=>jr,turboBlue:()=>fs,turboGradient:()=>S3,turboLoader:()=>fp,turboRed:()=>Jw,underline:()=>C3,warn:()=>Qw,yellow:()=>Xw});var vt=require("picocolors"),Ww=oe(Xu()),Yw=oe(sc()),Kw="#0099F7",Zw="#F11712",x3="#FFFF00",hp=t=>{let e=O3(t);return r=>`\x1B[38;5;${e}m${r}${(0,vt.reset)("")}`},S3=(0,Yw.default)(Kw,Zw),fs=hp(Kw),Jw=hp(Zw),Xw=hp(x3),fp=t=>(0,Ww.default)({text:t,spinner:{frames:[" ",fs("> "),fs(">> "),fs(">>>")]}}),A3=(...t)=>{jr(fs((0,vt.bold)(">>>")),t.join(" "))},D3=(...t)=>{jr((0,vt.bold)(t.join(" ")))},C3=(...t)=>{jr((0,vt.underline)(t.join(" ")))},R3=(...t)=>{jr((0,vt.dim)(t.join(" ")))},k3=(...t)=>{jr((0,vt.gray)(t.join(" ")))},T3=(...t)=>{jr(fs((0,vt.bold)(" \u2022")),t.join(" "))},jr=(...t)=>{console.log(...t)},Qw=(...t)=>{console.error(Xw((0,vt.bold)(">>>")),t.join(" "))},Tt=(...t)=>{console.error(Jw((0,vt.bold)(">>>")),t.join(" "))};function O3(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}var DS=oe(require("os")),CS=oe(_s());async function dc(t,e=[],r){let n={cwd:DS.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,CS.default)(t,e,n);return i.trim()}catch{return}}async function Wo(){let[t,e,r,n]=await Promise.all([dc("yarnpkg",["--version"],{cwd:"."}),dc("npm",["--version"]),dc("pnpm",["--version"]),dc("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}var RS=oe(require("fs-extra")),R8=[".DS_Store",".git",".gitattributes",".gitignore",".gitlab-ci.yml",".hg",".hgcheck",".hgignore",".idea",".npmignore",".travis.yml","LICENSE","Thumbs.db","docs","mkdocs.yml","npm-debug.log","yarn-debug.log","yarn-error.log","yarnrc.yml",".yarn"];function Yo(t){let e=RS.default.readdirSync(t).filter(r=>!R8.includes(r)).filter(r=>!r.endsWith(".iml"));return{isEmpty:e.length===0,conflicts:e}}var kp=oe(require("path")),Tp=oe(require("fs-extra")),Op=oe(require("picocolors"));function pc(t){let e=kp.default.resolve(t),r=kp.default.basename(e),n=Tp.default.existsSync(e),i=Tp.default.lstatSync(e,{throwIfNoEntry:!1});if(i&&!i.isDirectory())return{valid:!1,root:e,projectName:r,error:`${Op.default.dim(r)} is not a directory - please try a different location`};if(n){let{isEmpty:s,conflicts:o}=Yo(e);if(!s)return{valid:!1,root:e,projectName:r,error:`${Op.default.dim(r)} (${e}) has ${o.length} conflicting ${o.length===1?"file":"files"} - please try a different location`}}return{valid:!0,root:e,projectName:r}}var KR=require("stream"),ZR=require("util"),JR=require("path"),XR=require("os"),Aa=require("fs"),Dy=oe(AC()),Yl=oe(Ay()),fU=(0,ZR.promisify)(KR.Stream.pipeline);async function Wl(t){try{return(await Yl.default.head(t)).statusCode===200}catch{return!1}}async function Cy(t,e){let[,r,n,i,s,...o]=t.pathname.split("/"),a=e?e.replace(/^\//,""):o.join("/");if(i===void 0||i===""&&s===void 0)try{let c=await(0,Yl.default)(`https://api.github.com/repos/${r}/${n}`),l=JSON.parse(c.body);return{username:r,name:n,branch:l.default_branch,filePath:a}}catch{return}let u=e?`${s}/${o.join("/")}`.replace(new RegExp(`/${a}|/$`),""):s;if(r&&n&&u&&i==="tree")return{username:r,name:n,branch:u,filePath:a}}function Ry({username:t,name:e,branch:r,filePath:n}){let i=`https://api.github.com/repos/${t}/${e}/contents`,s=`${n?`/${n}`:""}/package.json`;return Wl(`${i+s}?ref=${r}`)}function ky(t){try{let e=new URL(t);return Wl(e.href)}catch{return Wl(`https://api.github.com/repos/vercel/turborepo/contents/examples/${encodeURIComponent(t)}`)}}async function QR(t,e){let r=(0,JR.join)((0,XR.tmpdir)(),`${e}.temp-${Date.now()}`);return await fU(Yl.default.stream(t),(0,Aa.createWriteStream)(r)),r}async function Ty(t,{username:e,name:r,branch:n,filePath:i}){let s=await QR(`https://codeload.github.com/${e}/${r}/tar.gz/${n}`,"turbo-ct-example"),o=null;await(0,Dy.x)({file:s,cwd:t,strip:i?i.split("/").length+1:1,filter:a=>{if(o===null){let u=a.split("/");o=u.length?u[0]:null}return a.startsWith(`${o}${i?`/${i}/`:"/"}`)}}),await Aa.promises.unlink(s)}async function Oy(t,e){let r=await QR("https://codeload.github.com/vercel/turborepo/tar.gz/main","turbo-ct-example"),n=null;await(0,Dy.x)({file:r,cwd:t,strip:2+e.split("/").length,filter:i=>{if(n===null){let s=i.split("/");n=s.length?s[0]:null}return i.includes(`${n}/examples/${e}/`)}}),await Aa.promises.unlink(r)}var Fy=oe(require("fs-extra"));async function Py(t){try{return await Fy.default.access(t,Fy.default.constants.W_OK),!0}catch{return!1}}var Qs=oe(require("path")),Iy=oe(ok()),gi=oe(require("picocolors")),Kl=oe(require("fs-extra"));function yU(t){return typeof t=="object"&&t!==null&&typeof t.message=="string"}var eo=class extends Error{};async function Ly({appPath:t,example:e,isDefaultExample:r,examplePath:n}){let i,s;if(r)i={username:"vercel",name:"turborepo",branch:"main",filePath:"examples/basic"};else{try{s=new URL(e)}catch(p){p.code!=="ERR_INVALID_URL"&&(Tt(p),process.exit(1))}s?(s.origin!=="https://github.com"&&(Tt(`Invalid URL: ${gi.default.red(`"${e}"`)}. Only GitHub repositories are supported. Please use a GitHub URL and try again.`),process.exit(1)),i=await Cy(s,n),i||(Tt(`Unable to fetch repository information from: ${gi.default.red(`"${e}"`)}. Please fix the URL and try again.`),process.exit(1)),await Ry(i)||(Tt(`Could not locate the repository for ${gi.default.red(`"${e}"`)}. Please check that the repository exists and try again.`),process.exit(1))):await ky(e)||(Tt(`Could not locate an example named ${gi.default.red(`"${e}"`)}. It could be due to the following:
62
62
  `,`1. Your spelling of example ${gi.default.red(`"${e}"`)} might be incorrect.
63
- `,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Qs.default.resolve(t);await Py(Qs.default.dirname(o))||(Tt("The application path is not writable, please check folder permissions and try again."),Tt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Qs.default.basename(o);try{await Kl.default.mkdir(o,{recursive:!0})}catch(p){Tt("Unable to create project directory"),Tt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Yo(o);u||(Tt(`${gi.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o),jr();let h=fp("Downloading files... (This might take a moment)");try{!r&&i?(h.start(),await(0,Iy.default)(()=>Ty(o,i),{retries:3})):(h.start(),await(0,Iy.default)(()=>Oy(o,e),{retries:3}))}catch(p){throw new eo(yU(p)?p.message:String(p))}finally{h.stop()}let f=Qs.default.join(o,"package.json"),d=Kl.default.existsSync(f),y=[];if(d){let p;try{p=Kl.default.readJsonSync(f)}catch{}p&&y.push(...Object.keys(p.scripts||{}))}let m=t;return Qs.default.join(l,a)===t&&(m=a),{cdPath:m,hasPackageJson:d,availableScripts:y,repoInfo:i}}var ho=require("fs"),Wy=require("crypto");var Ck=oe(require("picocolors"));var Te;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Te||(Te={}));var Ny;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ny||(Ny={}));var ae=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map!="undefined"&&t instanceof Map?ae.map:typeof Set!="undefined"&&t instanceof Set?ae.set:typeof Date!="undefined"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gU=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var Da=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Te.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,Te.assertNever(t)}return{message:r}},ck=Da;function _U(t){ck=t}function Jl(){return ck}var Xl=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},bU=[];function ue(t,e){let r=Xl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jl(),Da].filter(n=>!!n)});t.common.issues.push(r)}var et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ee;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return et.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ee;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Ee=Object.freeze({status:"aborted"}),lk=t=>({status:"dirty",value:t}),gt=t=>({status:"valid",value:t}),My=t=>t.status==="aborted",jy=t=>t.status==="dirty",Ca=t=>t.status==="valid",Ql=t=>typeof Promise!="undefined"&&t instanceof Promise,ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));var er=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ak=(t,e)=>{if(Ca(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function we(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ql(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ak(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Ql(i)?i:Promise.resolve(i));return ak(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:ie.custom,...n(i)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mt({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cr.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new Mt({...we(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ci({...we(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new eh({typeName:be.ZodBranded,type:this,...we(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oo({...we(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ri.create(this,e)}readonly(){return uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vU=/^c[^\s-]{8,}$/i,EU=/^[a-z][a-z0-9]*$/,wU=/^[0-9A-HJKMNP-TV-Z]{26}$/,xU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,SU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",By,DU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,CU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function kU(t,e){return!!((e==="v4"||!e)&&DU.test(t)||(e==="v6"||!e)&&CU.test(t))}var Lt=class extends xe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.string,received:s.parsedType}),Ee}let n=new et,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")SU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"email",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")By||(By=new RegExp(AU,"u")),By.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")vU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")EU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")wU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ue(i,{validation:"url",code:ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"regex",code:ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?RU(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?kU(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ip",code:ie.invalid_string,message:s.message}),n.dirty()):Te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ie.invalid_string,...ge.errToObj(n)})}_addCheck(e){return new Lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ge.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ge.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ge.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ge.errToObj(r)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lt.create=t=>{var e;return new Lt({checks:[],typeName:be.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function TU(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Rr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="int"?Te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?TU(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_finite,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new Rr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new Rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Rr.create=t=>new Rr({checks:[],typeName:be.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var kr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.bigint,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};kr.create=t=>{var e;return new kr({checks:[],typeName:be.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};var _i=class extends xe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.boolean,received:n.parsedType}),Ee}return gt(e.data)}};_i.create=t=>new _i({typeName:be.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var nn=class extends xe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_date}),Ee}let n=new et,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};nn.create=t=>new nn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:be.ZodDate,...we(t)});var ro=class extends xe{_parse(e){if(this._getType(e)!==ae.symbol){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.symbol,received:n.parsedType}),Ee}return gt(e.data)}};ro.create=t=>new ro({typeName:be.ZodSymbol,...we(t)});var bi=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.undefined,received:n.parsedType}),Ee}return gt(e.data)}};bi.create=t=>new bi({typeName:be.ZodUndefined,...we(t)});var vi=class extends xe{_parse(e){if(this._getType(e)!==ae.null){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.null,received:n.parsedType}),Ee}return gt(e.data)}};vi.create=t=>new vi({typeName:be.ZodNull,...we(t)});var jn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}};jn.create=t=>new jn({typeName:be.ZodAny,...we(t)});var rn=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}};rn.create=t=>new rn({typeName:be.ZodUnknown,...we(t)});var lr=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:ae.never,received:r.parsedType}),Ee}};lr.create=t=>new lr({typeName:be.ZodNever,...we(t)});var no=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.void,received:n.parsedType}),Ee}return gt(e.data)}};no.create=t=>new no({typeName:be.ZodVoid,...we(t)});var Nt=class extends xe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ue(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(ue(r,{code:o?ie.too_big:ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ue(r,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ue(r,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new er(r,o,r.path,a)))).then(o=>et.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new er(r,o,r.path,a)));return et.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Nt({...this._def,minLength:{value:e,message:ge.toString(r)}})}max(e,r){return new Nt({...this._def,maxLength:{value:e,message:ge.toString(r)}})}length(e,r){return new Nt({...this._def,exactLength:{value:e,message:ge.toString(r)}})}nonempty(e){return this.min(1,e)}};Nt.create=(t,e)=>new Nt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...we(e)});function to(t){if(t instanceof Be){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=cr.create(to(n))}return new Be({...t._def,shape:()=>e})}else return t instanceof Nt?new Nt({...t._def,type:to(t.element)}):t instanceof cr?cr.create(to(t.unwrap())):t instanceof on?on.create(to(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>to(e))):t}var Be=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){let c=this._getOrReturnCtx(e);return ue(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Ee}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof lr&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new er(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof lr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new er(i,h,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>et.mergeObjectSync(n,c)):et.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){let r={};return Te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}omit(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}deepPartial(){return to(this)}partial(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Be({...this._def,shape:()=>r})}required(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof cr;)s=s._def.innerType;r[n]=s}}),new Be({...this._def,shape:()=>r})}keyof(){return hk(Te.objectKeys(this.shape))}};Be.create=(t,e)=>new Be({shape:()=>t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.strictCreate=(t,e)=>new Be({shape:()=>t,unknownKeys:"strict",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.lazycreate=(t,e)=>new Be({shape:t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});var Ei=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Ee}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Bt(u));return ue(r,{code:ie.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}};Ei.create=(t,e)=>new Ei({options:t,typeName:be.ZodUnion,...we(e)});var Zl=t=>t instanceof Si?Zl(t.schema):t instanceof Mt?Zl(t.innerType()):t instanceof Ai?[t.value]:t instanceof Tr?t.options:t instanceof Di?Object.keys(t.enum):t instanceof Ci?Zl(t._def.innerType):t instanceof bi?[void 0]:t instanceof vi?[null]:null,io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ue(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Ee;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ue(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Zl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new io({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...we(n)})}};function qy(t,e){let r=Nn(t),n=Nn(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&n===ae.object){let i=Te.objectKeys(e),s=Te.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=qy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ae.array&&n===ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=qy(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ae.date&&n===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var wi=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(My(s)||My(o))return Ee;let a=qy(s.value,o.value);return a.valid?((jy(s)||jy(o))&&r.dirty(),{status:r.value,value:a.data}):(ue(n,{code:ie.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wi.create=(t,e,r)=>new wi({left:t,right:e,typeName:be.ZodIntersection,...we(r)});var tr=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.array)return ue(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return ue(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new er(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>et.mergeArray(r,o)):et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new tr({...this._def,rest:e})}};tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:t,typeName:be.ZodTuple,rest:null,...we(e)})};var xi=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ue(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Ee;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new er(n,a,n.path,a)),value:o._parse(new er(n,n.data[a],n.path,a))});return n.common.async?et.mergeObjectAsync(r,i):et.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xe?new xi({keyType:e,valueType:r,typeName:be.ZodRecord,...we(n)}):new xi({keyType:Lt.create(),valueType:e,typeName:be.ZodRecord,...we(r)})}},so=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.map)return ue(n,{code:ie.invalid_type,expected:ae.map,received:n.parsedType}),Ee;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:i._parse(new er(n,a,n.path,[c,"key"])),value:s._parse(new er(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};so.create=(t,e,r)=>new so({valueType:e,keyType:t,typeName:be.ZodMap,...we(r)});var sn=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.set)return ue(n,{code:ie.invalid_type,expected:ae.set,received:n.parsedType}),Ee;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(ue(n,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(ue(n,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return Ee;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>s._parse(new er(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new sn({...this._def,minSize:{value:e,message:ge.toString(r)}})}max(e,r){return new sn({...this._def,maxSize:{value:e,message:ge.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};sn.create=(t,e)=>new sn({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...we(e)});var Mn=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ue(r,{code:ie.invalid_type,expected:ae.function,received:r.parsedType}),Ee;function n(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof qn){let a=this;return gt(async function(...u){let c=new Bt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(n(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(i(h,d)),c})})}else{let a=this;return gt(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Bt([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Bt([i(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:tr.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mn({args:e||tr.create([]).rest(rn.create()),returns:r||rn.create(),typeName:be.ZodFunction,...we(n)})}},Si=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Si.create=(t,e)=>new Si({getter:t,typeName:be.ZodLazy,...we(e)});var Ai=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:be.ZodLiteral,...we(e)});function hk(t,e){return new Tr({values:t,typeName:be.ZodEnum,...we(e)})}var Tr=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{expected:Te.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ee}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ee}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Tr.create(e)}exclude(e){return Tr.create(this.options.filter(r=>!e.includes(r)))}};Tr.create=hk;var Di=class extends xe{_parse(e){let r=Te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let i=Te.objectValues(r);return ue(n,{expected:Te.joinValues(i),received:n.parsedType,code:ie.invalid_type}),Ee}if(r.indexOf(e.data)===-1){let i=Te.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:i}),Ee}return gt(e.data)}get enum(){return this._def.values}};Di.create=(t,e)=>new Di({values:t,typeName:be.ZodNativeEnum,...we(e)});var qn=class extends xe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ae.promise,received:r.parsedType}),Ee;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return gt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qn.create=(t,e)=>new qn({type:t,typeName:be.ZodPromise,...we(e)});var Mt=class extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ca(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ca(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Te.assertNever(i)}};Mt.create=(t,e,r)=>new Mt({schema:t,typeName:be.ZodEffects,effect:e,...we(r)});Mt.createWithPreprocess=(t,e,r)=>new Mt({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...we(r)});var cr=class extends xe{_parse(e){return this._getType(e)===ae.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cr.create=(t,e)=>new cr({innerType:t,typeName:be.ZodOptional,...we(e)});var on=class extends xe{_parse(e){return this._getType(e)===ae.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:be.ZodNullable,...we(e)});var Ci=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});var oo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ql(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oo.create=(t,e)=>new oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});var ao=class extends xe{_parse(e){if(this._getType(e)!==ae.nan){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.nan,received:n.parsedType}),Ee}return{status:"valid",value:e.data}}};ao.create=t=>new ao({typeName:be.ZodNaN,...we(t)});var OU=Symbol("zod_brand"),eh=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ri=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),lk(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Ri({in:e,out:r,typeName:be.ZodPipeline})}},uo=class extends xe{_parse(e){let r=this._def.innerType._parse(e);return Ca(r)&&(r.value=Object.freeze(r.value)),r}};uo.create=(t,e)=>new uo({innerType:t,typeName:be.ZodReadonly,...we(e)});var fk=(t,e={},r)=>t?jn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):jn.create(),FU={object:Be.lazycreate},be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));var PU=(t,e={message:`Input not instance of ${t.name}`})=>fk(r=>r instanceof t,e),dk=Lt.create,pk=Rr.create,IU=ao.create,LU=kr.create,mk=_i.create,BU=nn.create,NU=ro.create,MU=bi.create,jU=vi.create,qU=jn.create,UU=rn.create,HU=lr.create,$U=no.create,GU=Nt.create,zU=Be.create,VU=Be.strictCreate,WU=Ei.create,YU=io.create,KU=wi.create,ZU=tr.create,JU=xi.create,XU=so.create,QU=sn.create,e7=Mn.create,t7=Si.create,r7=Ai.create,n7=Tr.create,i7=Di.create,s7=qn.create,uk=Mt.create,o7=cr.create,a7=on.create,u7=Mt.createWithPreprocess,c7=Ri.create,l7=()=>dk().optional(),h7=()=>pk().optional(),f7=()=>mk().optional(),d7={string:t=>Lt.create({...t,coerce:!0}),number:t=>Rr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>kr.create({...t,coerce:!0}),date:t=>nn.create({...t,coerce:!0})},p7=Ee,co=Object.freeze({__proto__:null,defaultErrorMap:Da,setErrorMap:_U,getErrorMap:Jl,makeIssue:Xl,EMPTY_PATH:bU,addIssueToContext:ue,ParseStatus:et,INVALID:Ee,DIRTY:lk,OK:gt,isAborted:My,isDirty:jy,isValid:Ca,isAsync:Ql,get util(){return Te},get objectUtil(){return Ny},ZodParsedType:ae,getParsedType:Nn,ZodType:xe,ZodString:Lt,ZodNumber:Rr,ZodBigInt:kr,ZodBoolean:_i,ZodDate:nn,ZodSymbol:ro,ZodUndefined:bi,ZodNull:vi,ZodAny:jn,ZodUnknown:rn,ZodNever:lr,ZodVoid:no,ZodArray:Nt,ZodObject:Be,ZodUnion:Ei,ZodDiscriminatedUnion:io,ZodIntersection:wi,ZodTuple:tr,ZodRecord:xi,ZodMap:so,ZodSet:sn,ZodFunction:Mn,ZodLazy:Si,ZodLiteral:Ai,ZodEnum:Tr,ZodNativeEnum:Di,ZodPromise:qn,ZodEffects:Mt,ZodTransformer:Mt,ZodOptional:cr,ZodNullable:on,ZodDefault:Ci,ZodCatch:oo,ZodNaN:ao,BRAND:OU,ZodBranded:eh,ZodPipeline:Ri,ZodReadonly:uo,custom:fk,Schema:xe,ZodSchema:xe,late:FU,get ZodFirstPartyTypeKind(){return be},coerce:d7,any:qU,array:GU,bigint:LU,boolean:mk,date:BU,discriminatedUnion:YU,effect:uk,enum:n7,function:e7,instanceof:PU,intersection:KU,lazy:t7,literal:r7,map:XU,nan:IU,nativeEnum:i7,never:HU,null:jU,nullable:a7,number:pk,object:zU,oboolean:f7,onumber:h7,optional:o7,ostring:l7,pipeline:c7,preprocess:u7,promise:s7,record:JU,set:QU,strictObject:VU,string:dk,symbol:NU,transformer:uk,tuple:ZU,undefined:MU,union:WU,unknown:UU,void:$U,NEVER:p7,ZodIssueCode:ie,quotelessJson:gU,ZodError:Bt});var Vy=oe(require("os")),Sk=oe(require("crypto")),Ak=oe(require("path")),Dk=oe(xk());function S7(t){let e=process.version,r=Vy.default.type(),n=Vy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function A7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,Dk.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return Ak.default.join(t,"turborepo","telemetry.json")}function D7({input:t,salt:e}){return Sk.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var lo={buildUserAgent:S7,oneWayHashWithSalt:D7,defaultConfigPath:A7};var C7="TURBO_TELEMETRY_DEBUG",R7="TURBO_TELEMETRY_DISABLED",k7="TURBO_TELEMETRY_MESSAGE_DISABLED",T7="DO_NOT_TRACK",O7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),At=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,ho.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=At.validateConfig(n);return new At({configPath:e,config:i})}catch{return At.tryRemove({configPath:e})?At.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await lo.defaultConfigPath();return At.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return O7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,Wy.randomUUID)(),n=(0,Wy.randomUUID)(),i=lo.oneWayHashWithSalt({input:r,salt:n}),s=new At({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,ho.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,ho.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[T7]||"0",r=process.env[R7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[k7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(de.log(),de.bold("Attention:"),de.grey("Turborepo now collects completely anonymous telemetry regarding usage."),de.grey("This information is used to shape the Turborepo roadmap and prioritize features."),de.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),de.underline(Ck.default.gray("https://turbo.build/repo/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return lo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[C7]||"0";return e==="1"||e.toLowerCase()==="true"}};var Yy=require("crypto"),Rk=oe(Ay());var F7=20,P7="/api/turborepo/v1/events",ki=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=F7;this.timeout=250;this.sessionId=(0,Yy.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(P7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(Rk.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":lo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,Yy.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return At.isDebug()&&(de.log(),de.bold("[telemetry event]"),de.dimmed(JSON.stringify(s,null,2)),de.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ra=class extends ki{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var Pk=oe(Fk());var L7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ka=class extends ki{trackCI(){var e;return this.track({key:"ci",value:(e=Pk.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:L7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var B7={"create-turbo":Ra,"turbo-ignore":ka},N7="https://telemetry.vercel.com";async function Ky({packageInfo:t,opts:e}){let r=B7[t.name],n=await At.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:N7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}var Ta=oe(require("picocolors"));var Ik=require("commander"),Lk="status",M7=["enable","disable",Lk];function j7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();de.log(`Status: ${e?Ta.default.bold(Ta.default.green("Enabled")):Ta.default.bold(Ta.default.red("Disabled"))}`),de.log(),e?de.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):de.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),de.log("Learn more: https://turbo.build/repo/docs/telemetry")}function q7(t,e){if(!e.telemetry){de.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),de.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),de.bold("Success!")),de.log(),j7(e)}function Zy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new Ik.Argument("[action]","Action to perform").choices(M7).default(Lk)).action(q7)}var JT=require("proxy-agent"),xg=oe(rh());var Jy=oe(require("picocolors")),Bk=oe(require("update-check"));var Nk=oe(rh()),H7=(0,Bk.default)(Nk.default).catch(()=>null);async function Xy(){try{let t=await H7;t!=null&&t.latest&&(de.log(),de.log(Jy.default.yellow(Jy.default.bold("A new version of `create-turbo` is available!"))),de.log()),process.exit()}catch{}}var qa=oe(require("path")),tt=oe(require("picocolors"));var Dt=require("picocolors"),Qk=oe(Xu(),1),eT=oe(sc(),1),sT=oe(require("os"),1),oT=oe(_s(),1),OZ=require("fs-extra");var BZ=oe(Cu(),1),MZ=require("fs-extra"),qZ=require("fs-extra"),HZ=require("picocolors"),uT=require("stream"),cT=require("util"),VZ=require("fs-extra"),KZ=require("picocolors"),JZ=require("fs-extra"),Ti=oe(require("path"),1),hr=oe(require("fs-extra"),1),lT=oe(_s(),1),hT=oe(require("path"),1),fT=oe(require("fs-extra"),1),dT=oe(require("picocolors"),1),un=oe(require("path"),1),pT=oe(_s(),1),Ut=require("fs-extra"),mT=oe(Cu(),1);var Fa=oe(require("path"),1),Oi=oe(require("fs-extra"),1),go=oe(require("path"),1),Fi=oe(require("fs-extra"),1),Pa=oe(require("path"),1),Ii=oe(require("fs-extra"),1),qt=oe(require("picocolors"),1),ET=oe(sc(),1),wT=oe(_s(),1),xT=oe(Xu(),1),ST=require("semver"),AT=oe(require("picocolors"),1),$7=Object.create,tg=Object.defineProperty,G7=Object.getOwnPropertyDescriptor,z7=Object.getOwnPropertyNames,V7=Object.getPrototypeOf,W7=Object.prototype.hasOwnProperty,_e=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Y7=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K7=(t,e)=>{for(var r in e)tg(t,r,{get:e[r],enumerable:!0})},Z7=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of z7(e))!W7.call(t,i)&&i!==r&&tg(t,i,{get:()=>e[i],enumerable:!(n=G7(e,i))||n.enumerable});return t},oh=(t,e,r)=>(r=t!=null?$7(V7(t)):{},Z7(e||!t||!t.__esModule?tg(r,"default",{value:t,enumerable:!0}):r,t)),ee=Y7(()=>{}),J7=me((t,e)=>{ee();function r(n){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),X7=me((t,e)=>{ee();var r=J7().default;function n(){"use strict";e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var i,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function y(q,g,_,v){var k=g&&g.prototype instanceof F?g:F,S=Object.create(k.prototype),H=new G(v||[]);return u(S,"_invoke",{value:ne(q,_,H)}),S}function m(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(v){return{type:"throw",arg:v}}}s.wrap=y;var p="suspendedStart",E="suspendedYield",R="executing",P="completed",O={};function F(){}function M(){}function x(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,V=U&&U(U(Z([])));V&&V!==o&&a.call(V,l)&&(D=V);var B=x.prototype=F.prototype=Object.create(D);function K(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(k,S,H,$){var re=m(q[k],q,S);if(re.type!=="throw"){var W=re.arg,fe=W.value;return fe&&r(fe)=="object"&&a.call(fe,"__await")?g.resolve(fe.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(fe).then(function(J){W.value=J,H(W)},function(J){return _("throw",J,H,$)})}$(re.arg)}var v;u(this,"_invoke",{value:function(k,S){function H(){return new g(function($,re){_(k,S,$,re)})}return v=v?v.then(H,H):H()}})}function ne(q,g,_){var v=p;return function(k,S){if(v===R)throw new Error("Generator is already running");if(v===P){if(k==="throw")throw S;return{value:i,done:!0}}for(_.method=k,_.arg=S;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===O)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(v===p)throw v=P,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);v=R;var re=m(q,g,_);if(re.type==="normal"){if(v=_.done?P:E,re.arg===O)continue;return{value:re.arg,done:_.done}}re.type==="throw"&&(v=P,_.method="throw",_.arg=re.arg)}}}function j(q,g){var _=g.method,v=q.iterator[_];if(v===i)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=i,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),O;var k=m(v,q.iterator,g.arg);if(k.type==="throw")return g.method="throw",g.arg=k.arg,g.delegate=null,O;var S=k.arg;return S?S.done?(g[q.resultName]=S.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=i),g.delegate=null,O):S:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,O)}function I(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function G(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(I,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,v=function k(){for(;++_<q.length;)if(a.call(q,_))return k.value=q[_],k.done=!1,k;return k.value=i,k.done=!0,k};return v.next=v}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=x,u(B,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:M,configurable:!0}),M.displayName=d(x,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,x):(q.__proto__=x,d(q,f,"GeneratorFunction")),q.prototype=Object.create(B),q},s.awrap=function(q){return{__await:q}},K(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,v,k){k===void 0&&(k=Promise);var S=new Q(y(q,g,_,v),k);return s.isGeneratorFunction(g)?S:S.next().then(function(H){return H.done?H.value:S.next()})},K(B),d(B,f,"Generator"),d(B,l,function(){return this}),d(B,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var v in g)_.push(v);return _.reverse(),function k(){for(;_.length;){var S=_.pop();if(S in g)return k.value=S,k.done=!1,k}return k.done=!0,k}},s.values=Z,G.prototype={constructor:G,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(re,W){return S.type="throw",S.arg=q,g.next=re,W&&(g.method="next",g.arg=i),!!W}for(var v=this.tryEntries.length-1;v>=0;--v){var k=this.tryEntries[v],S=k.completion;if(k.tryLoc==="root")return _("end");if(k.tryLoc<=this.prev){var H=a.call(k,"catchLoc"),$=a.call(k,"finallyLoc");if(H&&$){if(this.prev<k.catchLoc)return _(k.catchLoc,!0);if(this.prev<k.finallyLoc)return _(k.finallyLoc)}else if(H){if(this.prev<k.catchLoc)return _(k.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<k.finallyLoc)return _(k.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var v=this.tryEntries[_];if(v.tryLoc<=this.prev&&a.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var k=v;break}}k&&(q==="break"||q==="continue")&&k.tryLoc<=g&&g<=k.finallyLoc&&(k=null);var S=k?k.completion:{};return S.type=q,S.arg=g,k?(this.method="next",this.next=k.finallyLoc,O):this.complete(S)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),O},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),O}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var v=_.completion;if(v.type==="throw"){var k=v.arg;L(_)}return k}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=i),O}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),Q7=me((t,e)=>{ee();var r=X7()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),eH=me((t,e)=>{"use strict";ee();var r=(n,...i)=>new Promise(s=>{s(n(...i))});e.exports=r,e.exports.default=r}),tH=me((t,e)=>{"use strict";ee();var r=eH(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let y=r(h,...d);f(y),y.then(a,a)},c=(h,f,...d)=>{o<i?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=n,e.exports.default=n}),rH=me((t,e)=>{"use strict";ee();var r=tH(),n=class extends Error{constructor(a){super(),this.value=a}},i=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new n(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(i,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof n)return d.value;throw d}};e.exports=o,e.exports.default=o}),nH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=_e("fs"),{promisify:i}=_e("util"),s=rH(),o=i(n.stat),a=i(n.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async y=>{try{let m=await d(r.resolve(f.cwd,y));return l(f.type,m)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?n.statSync:n.lstatSync;for(let y of h)try{let m=d(r.resolve(f.cwd,y));if(l(f.type,m))return y}catch{}}}),iH=me((t,e)=>{"use strict";ee();var r=_e("fs"),{promisify:n}=_e("util"),i=n(r.access);e.exports=async s=>{try{return await i(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),sH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=nH(),i=iH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return n(l,f);let d=await o(f.cwd);return typeof d=="string"?n([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return n.sync(l,f);let d=o(f.cwd);return typeof d=="string"?n.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=i,e.exports.sync.exists=i.sync,e.exports.stop=s}),Ia=me((t,e)=>{"use strict";ee();var r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);e.exports=n=>n?Object.keys(n).map(i=>[r.has(i)?r.get(i):i,n[i]]).reduce((i,s)=>(i[s[0]]=s[1],i),Object.create(null)):{}}),rg=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),y=Symbol("flushChunk"),m=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),O=Symbol("buffer"),F=Symbol("pipes"),M=Symbol("bufferLength"),x=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),V=Symbol("destroyed"),B=Symbol("emitData"),K=Symbol("emitEnd"),Q=Symbol("emitEnd2"),ne=Symbol("async"),j=k=>Promise.resolve().then(k),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=k=>k==="end"||k==="finish"||k==="prefinish",q=k=>k instanceof ArrayBuffer||typeof k=="object"&&k.constructor&&k.constructor.name==="ArrayBuffer"&&k.byteLength>=0,g=k=>!Buffer.isBuffer(k)&&ArrayBuffer.isView(k),_=class{constructor(k,S,H){this.src=k,this.dest=S,this.opts=H,this.ondrain=()=>k[P](),S.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},v=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(k,S,H){super(k,S,H),this.proxyErrors=$=>S.emit("error",$),k.on("error",this.proxyErrors)}};e.exports=class qk extends i{constructor(S){super(),this[E]=!1,this[R]=!1,this[F]=[],this[O]=[],this[U]=S&&S.objectMode||!1,this[U]?this[m]=null:this[m]=S&&S.encoding||null,this[m]==="buffer"&&(this[m]=null),this[ne]=S&&!!S.async||!1,this[p]=this[m]?new s(this[m]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[V]=!1,S&&S.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),S&&S.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]})}get bufferLength(){return this[M]}get encoding(){return this[m]}set encoding(S){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[m]&&S!==this[m]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[m]!==S&&(this[p]=S?new s(S):null,this[O].length&&(this[O]=this[O].map(H=>this[p].write(H)))),this[m]=S}setEncoding(S){this.encoding=S}get objectMode(){return this[U]}set objectMode(S){this[U]=this[U]||!!S}get async(){return this[ne]}set async(S){this[ne]=this[ne]||!!S}write(S,H,$){if(this[o])throw new Error("write after end");if(this[V])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof H=="function"&&($=H,H="utf8"),H||(H="utf8");let re=this[ne]?j:W=>W();return!this[U]&&!Buffer.isBuffer(S)&&(g(S)?S=Buffer.from(S.buffer,S.byteOffset,S.byteLength):q(S)?S=Buffer.from(S):typeof S!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):S.length?(typeof S=="string"&&!(H===this[m]&&!this[p].lastNeed)&&(S=Buffer.from(S,H)),Buffer.isBuffer(S)&&this[m]&&(S=this[p].write(S)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&re($),this.flowing)}read(S){if(this[V])return null;if(this[M]===0||S===0||S>this[M])return this[a](),null;this[U]&&(S=null),this[O].length>1&&!this[U]&&(this.encoding?this[O]=[this[O].join("")]:this[O]=[Buffer.concat(this[O],this[M])]);let H=this[f](S||null,this[O][0]);return this[a](),H}[f](S,H){return S===H.length||S===null?this[D]():(this[O][0]=H.slice(S),H=H.slice(0,S),this[M]-=S),this.emit("data",H),!this[O].length&&!this[o]&&this.emit("drain"),H}end(S,H,$){return typeof S=="function"&&($=S,S=null),typeof H=="function"&&($=H,H="utf8"),S&&this.write(S,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[V]||(this[R]=!1,this[E]=!0,this.emit("resume"),this[O].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[V]}get flowing(){return this[E]}get paused(){return this[R]}[x](S){this[U]?this[M]+=1:this[M]+=S.length,this[O].push(S)}[D](){return this[O].length&&(this[U]?this[M]-=1:this[M]-=this[O][0].length),this[O].shift()}[d](S){do;while(this[y](this[D]()));!S&&!this[O].length&&!this[o]&&this.emit("drain")}[y](S){return S?(this.emit("data",S),this.flowing):!1}pipe(S,H){if(this[V])return;let $=this[u];return H=H||{},S===r.stdout||S===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&S.end():(this[F].push(H.proxyErrors?new v(this,S,H):new _(this,S,H)),this[ne]?j(()=>this[P]()):this[P]()),S}unpipe(S){let H=this[F].find($=>$.dest===S);H&&(this[F].splice(this[F].indexOf(H),1),H.unpipe())}addListener(S,H){return this.on(S,H)}on(S,H){let $=super.on(S,H);return S==="data"&&!this[F].length&&!this.flowing?this[P]():S==="readable"&&this[M]!==0?super.emit("readable"):Z(S)&&this[u]?(super.emit(S),this.removeAllListeners(S)):S==="error"&&this[l]&&(this[ne]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[V]&&this[O].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(S,H,...$){if(S!=="error"&&S!=="close"&&S!==V&&this[V])return;if(S==="data")return H?this[ne]?j(()=>this[B](H)):this[B](H):!1;if(S==="end")return this[K]();if(S==="close"){if(this[h]=!0,!this[u]&&!this[V])return;let W=super.emit("close");return this.removeAllListeners("close"),W}else if(S==="error"){this[l]=H;let W=super.emit("error",H);return this[a](),W}else if(S==="resume"){let W=super.emit("resume");return this[a](),W}else if(S==="finish"||S==="prefinish"){let W=super.emit(S);return this.removeAllListeners(S),W}let re=super.emit(S,H,...$);return this[a](),re}[B](S){for(let $ of this[F])$.dest.write(S)===!1&&this.pause();let H=super.emit("data",S);return this[a](),H}[K](){this[u]||(this[u]=!0,this.readable=!1,this[ne]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[F])$.dest.write(H);super.emit("data",H)}}for(let H of this[F])H.end();let S=super.emit("end");return this.removeAllListeners("end"),S}collect(){let S=[];this[U]||(S.dataLength=0);let H=this.promise();return this.on("data",$=>{S.push($),this[U]||(S.dataLength+=$.length)}),H.then(()=>S)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(S=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?S.join(""):Buffer.concat(S,S.dataLength))}promise(){return new Promise((S,H)=>{this.on(V,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>S())})}[L](){return{next:()=>{let S=this.read();if(S!==null)return Promise.resolve({done:!1,value:S});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,re=w=>{this.removeListener("data",W),this.removeListener("end",fe),$(w)},W=w=>{this.removeListener("error",re),this.removeListener("end",fe),this.pause(),H({value:w,done:!!this[o]})},fe=()=>{this.removeListener("error",re),this.removeListener("data",W),H({done:!0})},J=()=>re(new Error("stream destroyed"));return new Promise((w,N)=>{$=N,H=w,this.once(V,J),this.once("error",re),this.once("end",fe),this.once("data",W)})}}}[G](){return{next:()=>{let S=this.read();return{value:S,done:S===null}}}}destroy(S){return this[V]?(S?this.emit("error",S):this.emit(V),this):(this[V]=!0,this[O].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),S?this.emit("error",S):this.emit(V),this)}static isStream(S){return!!S&&(S instanceof qk||S instanceof i||S instanceof n&&(typeof S.pipe=="function"||typeof S.write=="function"&&typeof S.end=="function"))}}}),oH=me((t,e)=>{ee();var r=_e("zlib").constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},r))}),Uk=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),y=Symbol("flushChunk"),m=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),O=Symbol("bufferLength"),F=Symbol("bufferPush"),M=Symbol("bufferShift"),x=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),V=Symbol("emitEnd"),B=Symbol("emitEnd2"),K=Symbol("async"),Q=_=>Promise.resolve().then(_),ne=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=ne&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=ne&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",G=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,v,k){this.src=_,this.dest=v,this.opts=k,this.ondrain=()=>_[P](),v.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,v,k){super(_,v,k),this.proxyErrors=S=>v.emit("error",S),_.on("error",this.proxyErrors)}};e.exports=class Hk extends i{constructor(v){super(),this[E]=!1,this[R]=!1,this.pipes=[],this.buffer=[],this[x]=v&&v.objectMode||!1,this[x]?this[m]=null:this[m]=v&&v.encoding||null,this[m]==="buffer"&&(this[m]=null),this[K]=v&&!!v.async||!1,this[p]=this[m]?new s(this[m]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[O]=0,this[D]=!1}get bufferLength(){return this[O]}get encoding(){return this[m]}set encoding(v){if(this[x])throw new Error("cannot set encoding in objectMode");if(this[m]&&v!==this[m]&&(this[p]&&this[p].lastNeed||this[O]))throw new Error("cannot change encoding");this[m]!==v&&(this[p]=v?new s(v):null,this.buffer.length&&(this.buffer=this.buffer.map(k=>this[p].write(k)))),this[m]=v}setEncoding(v){this.encoding=v}get objectMode(){return this[x]}set objectMode(v){this[x]=this[x]||!!v}get async(){return this[K]}set async(v){this[K]=this[K]||!!v}write(v,k,S){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof k=="function"&&(S=k,k="utf8"),k||(k="utf8");let H=this[K]?Q:$=>$();return!this[x]&&!Buffer.isBuffer(v)&&(Z(v)?v=Buffer.from(v.buffer,v.byteOffset,v.byteLength):G(v)?v=Buffer.from(v):typeof v!="string"&&(this.objectMode=!0)),this[x]?(this.flowing&&this[O]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[F](v),this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing):v.length?(typeof v=="string"&&!(k===this[m]&&!this[p].lastNeed)&&(v=Buffer.from(v,k)),Buffer.isBuffer(v)&&this[m]&&(v=this[p].write(v)),this.flowing&&this[O]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[F](v),this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing):(this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing)}read(v){if(this[D])return null;if(this[O]===0||v===0||v>this[O])return this[a](),null;this[x]&&(v=null),this.buffer.length>1&&!this[x]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[O])]);let k=this[f](v||null,this.buffer[0]);return this[a](),k}[f](v,k){return v===k.length||v===null?this[M]():(this.buffer[0]=k.slice(v),k=k.slice(0,v),this[O]-=v),this.emit("data",k),!this.buffer.length&&!this[o]&&this.emit("drain"),k}end(v,k,S){return typeof v=="function"&&(S=v,v=null),typeof k=="function"&&(S=k,k="utf8"),v&&this.write(v,k),S&&this.once("end",S),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[D]||(this[R]=!1,this[E]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[D]}get flowing(){return this[E]}get paused(){return this[R]}[F](v){this[x]?this[O]+=1:this[O]+=v.length,this.buffer.push(v)}[M](){return this.buffer.length&&(this[x]?this[O]-=1:this[O]-=this.buffer[0].length),this.buffer.shift()}[d](v){do;while(this[y](this[M]()));!v&&!this.buffer.length&&!this[o]&&this.emit("drain")}[y](v){return v?(this.emit("data",v),this.flowing):!1}pipe(v,k){if(this[D])return;let S=this[u];return k=k||{},v===r.stdout||v===r.stderr?k.end=!1:k.end=k.end!==!1,k.proxyErrors=!!k.proxyErrors,S?k.end&&v.end():(this.pipes.push(k.proxyErrors?new g(this,v,k):new q(this,v,k)),this[K]?Q(()=>this[P]()):this[P]()),v}unpipe(v){let k=this.pipes.find(S=>S.dest===v);k&&(this.pipes.splice(this.pipes.indexOf(k),1),k.unpipe())}addListener(v,k){return this.on(v,k)}on(v,k){let S=super.on(v,k);return v==="data"&&!this.pipes.length&&!this.flowing?this[P]():v==="readable"&&this[O]!==0?super.emit("readable"):L(v)&&this[u]?(super.emit(v),this.removeAllListeners(v)):v==="error"&&this[l]&&(this[K]?Q(()=>k.call(this,this[l])):k.call(this,this[l])),S}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(v,k,...S){if(v!=="error"&&v!=="close"&&v!==D&&this[D])return;if(v==="data")return k?this[K]?Q(()=>this[U](k)):this[U](k):!1;if(v==="end")return this[V]();if(v==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(v==="error"){this[l]=k;let $=super.emit("error",k);return this[a](),$}else if(v==="resume"){let $=super.emit("resume");return this[a](),$}else if(v==="finish"||v==="prefinish"){let $=super.emit(v);return this.removeAllListeners(v),$}let H=super.emit(v,k,...S);return this[a](),H}[U](v){for(let S of this.pipes)S.dest.write(v)===!1&&this.pause();let k=super.emit("data",v);return this[a](),k}[V](){this[u]||(this[u]=!0,this.readable=!1,this[K]?Q(()=>this[B]()):this[B]())}[B](){if(this[p]){let k=this[p].end();if(k){for(let S of this.pipes)S.dest.write(k);super.emit("data",k)}}for(let k of this.pipes)k.end();let v=super.emit("end");return this.removeAllListeners("end"),v}collect(){let v=[];this[x]||(v.dataLength=0);let k=this.promise();return this.on("data",S=>{v.push(S),this[x]||(v.dataLength+=S.length)}),k.then(()=>v)}concat(){return this[x]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(v=>this[x]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?v.join(""):Buffer.concat(v,v.dataLength))}promise(){return new Promise((v,k)=>{this.on(D,()=>k(new Error("stream destroyed"))),this.on("error",S=>k(S)),this.on("end",()=>v())})}[j](){return{next:()=>{let v=this.read();if(v!==null)return Promise.resolve({done:!1,value:v});if(this[o])return Promise.resolve({done:!0});let k=null,S=null,H=fe=>{this.removeListener("data",$),this.removeListener("end",re),S(fe)},$=fe=>{this.removeListener("error",H),this.removeListener("end",re),this.pause(),k({value:fe,done:!!this[o]})},re=()=>{this.removeListener("error",H),this.removeListener("data",$),k({done:!0})},W=()=>H(new Error("stream destroyed"));return new Promise((fe,J)=>{S=J,k=fe,this.once(D,W),this.once("error",H),this.once("end",re),this.once("data",$)})}}}[I](){return{next:()=>{let v=this.read();return{value:v,done:v===null}}}}destroy(v){return this[D]?(v?this.emit("error",v):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[O]=0,typeof this.close=="function"&&!this[h]&&this.close(),v?this.emit("error",v):this.emit(D),this)}static isStream(v){return!!v&&(v instanceof Hk||v instanceof i||v instanceof n&&(typeof v.pipe=="function"||typeof v.write=="function"&&typeof v.end=="function"))}}}),$k=me(t=>{"use strict";ee();var e=_e("assert"),r=_e("buffer").Buffer,n=_e("zlib"),i=t.constants=oH(),s=Uk(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),y=Symbol("onError"),m=Symbol("sawError"),p=Symbol("level"),E=Symbol("strategy"),R=Symbol("ended"),P=Symbol("_defaultFullFlush"),O=class extends s{constructor(L,G){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[m]=!1,this[R]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new n[G](L)}catch(Z){throw new u(Z)}this[y]=Z=>{this[m]||(this[m]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[y](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[m])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[l]:L})))}end(L,G,Z){return L&&this.write(L,G),this.flush(this[h]),this[R]=!0,super.end(null,null,Z)}get ended(){return this[R]}write(L,G,Z){if(typeof G=="function"&&(Z=G,G="utf8"),typeof L=="string"&&(L=r.from(L,G)),this[m])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=S=>S;let v;try{let S=typeof L[l]=="number"?L[l]:this[l];v=this[d]._processChunk(L,S),r.concat=o}catch(S){r.concat=o,this[y](new u(S))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",S=>this[y](new u(S)));let k;if(v)if(Array.isArray(v)&&v.length>0){k=this[a](r.from(v[0]));for(let S=1;S<v.length;S++)k=this[a](v[S])}else k=this[a](r.from(v));return Z&&Z(),k}[a](L){return super.write(L)}},F=class extends O{constructor(L,G){L=L||{},L.flush=L.flush||i.Z_NO_FLUSH,L.finishFlush=L.finishFlush||i.Z_FINISH,super(L,G),this[f]=i.Z_FULL_FLUSH,this[p]=L.level,this[E]=L.strategy}params(L,G){if(!this[m]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[p]!==L||this[E]!==G){this.flush(i.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,G)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[E]=G)}}}},M=class extends F{constructor(L){super(L,"Deflate")}},x=class extends F{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends F{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},V=class extends F{constructor(L){super(L,"Gunzip")}},B=class extends F{constructor(L){super(L,"DeflateRaw")}},K=class extends F{constructor(L){super(L,"InflateRaw")}},Q=class extends F{constructor(L){super(L,"Unzip")}},ne=class extends O{constructor(L,G){L=L||{},L.flush=L.flush||i.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||i.BROTLI_OPERATION_FINISH,super(L,G),this[f]=i.BROTLI_OPERATION_FLUSH}},j=class extends ne{constructor(L){super(L,"BrotliCompress")}},I=class extends ne{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=x,t.Gzip=U,t.Gunzip=V,t.DeflateRaw=B,t.InflateRaw=K,t.Unzip=Q,typeof n.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),La=me((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?n=>n:n=>n&&n.replace(/\\/g,"/")}),ng=me((t,e)=>{"use strict";ee();var r=rg(),n=La(),i=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=n(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=n(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[i](o),a&&this[i](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[i](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?n(s[a]):s[a])}}}),Gk=me(t=>{"use strict";ee(),t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),aH=me((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?i(l,h):n(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},n=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},i=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var y=l&255;l=Math.floor(l/256),f?h[d-1]=u(y):y===0?h[d-1]=0:(f=!0,h[d-1]=c(y))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=l=>{for(var h=l.length,f=0,d=!1,y=h-1;y>-1;y--){var m=l[y],p;d?p=u(m):m===0?p=m:(d=!0,p=c(m)),p!==0&&(f-=p*Math.pow(256,h-y-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var y=l[d];y!==0&&(f+=y*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),Ba=me((t,e)=>{"use strict";ee();var r=Gk(),n=_e("path").posix,i=aH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(x,D,U,V){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(x)?this.decode(x,D||0,U,V):x&&this.set(x)}decode(x,D,U,V){if(D||(D=0),!x||!(x.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(x,D,100),this.mode=f(x,D+100,8),this.uid=f(x,D+108,8),this.gid=f(x,D+116,8),this.size=f(x,D+124,12),this.mtime=l(x,D+136,12),this.cksum=f(x,D+148,12),this[s](U),this[s](V,!0),this[o]=c(x,D+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=c(x,D+157,100),x.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(x,D+265,32),this.gname=c(x,D+297,32),this.devmaj=f(x,D+329,8),this.devmin=f(x,D+337,8),x[D+475]!==0){let K=c(x,D+345,155);this.path=K+"/"+this.path}else{let K=c(x,D+345,130);K&&(this.path=K+"/"+this.path),this.atime=l(x,D+476,12),this.ctime=l(x,D+488,12)}let B=8*32;for(let K=D;K<D+148;K++)B+=x[K];for(let K=D+156;K<D+512;K++)B+=x[K];this.cksumValid=B===this.cksum,this.cksum===null&&B===8*32&&(this.nullBlock=!0)}[s](x,D){for(let U in x)x[U]!==null&&x[U]!==void 0&&!(D&&U==="path")&&(this[U]=x[U])}encode(x,D){if(x||(x=this.block=Buffer.alloc(512),D=0),D||(D=0),!(x.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,V=u(this.path||"",U),B=V[0],K=V[1];this.needPax=V[2],this.needPax=M(x,D,100,B)||this.needPax,this.needPax=p(x,D+100,8,this.mode)||this.needPax,this.needPax=p(x,D+108,8,this.uid)||this.needPax,this.needPax=p(x,D+116,8,this.gid)||this.needPax,this.needPax=p(x,D+124,12,this.size)||this.needPax,this.needPax=O(x,D+136,12,this.mtime)||this.needPax,x[D+156]=this[o].charCodeAt(0),this.needPax=M(x,D+157,100,this.linkpath)||this.needPax,x.write("ustar\x0000",D+257,8),this.needPax=M(x,D+265,32,this.uname)||this.needPax,this.needPax=M(x,D+297,32,this.gname)||this.needPax,this.needPax=p(x,D+329,8,this.devmaj)||this.needPax,this.needPax=p(x,D+337,8,this.devmin)||this.needPax,this.needPax=M(x,D+345,U,K)||this.needPax,x[D+475]!==0?this.needPax=M(x,D+345,155,K)||this.needPax:(this.needPax=M(x,D+345,130,K)||this.needPax,this.needPax=O(x,D+476,12,this.atime)||this.needPax,this.needPax=O(x,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let ne=D;ne<D+148;ne++)Q+=x[ne];for(let ne=D+156;ne<D+512;ne++)Q+=x[ne];return this.cksum=Q,p(x,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(x){for(let D in x)x[D]!==null&&x[D]!==void 0&&(this[D]=x[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(x){r.code.has(x)?this[o]=r.code.get(x):this[o]=x}},u=(x,D)=>{let U=x,V="",B,K=n.parse(x).root||".";if(Buffer.byteLength(U)<100)B=[U,V,!1];else{V=n.dirname(U),U=n.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(V)<=D?B=[U,V,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(V)<=D?B=[U.slice(0,100-1),V,!0]:(U=n.join(n.basename(V),U),V=n.dirname(V));while(V!==K&&!B);B||(B=[x.slice(0,100-1),"",!0])}return B},c=(x,D,U)=>x.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(x,D,U)=>h(f(x,D,U)),h=x=>x===null?null:new Date(x*1e3),f=(x,D,U)=>x[D]&128?i.parse(x.slice(D,D+U)):y(x,D,U),d=x=>isNaN(x)?null:x,y=(x,D,U)=>d(parseInt(x.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),m={12:8589934591,8:2097151},p=(x,D,U,V)=>V===null?!1:V>m[U]||V<0?(i.encode(V,x.slice(D,D+U)),!0):(E(x,D,U,V),!1),E=(x,D,U,V)=>x.write(R(V,U),D,U,"ascii"),R=(x,D)=>P(Math.floor(x).toString(8),D),P=(x,D)=>(x.length===D-1?x:new Array(D-x.length-1).join("0")+x+" ")+"\0",O=(x,D,U,V)=>V===null?!1:p(x,D,U,V.getTime()/1e3),F=new Array(156).join("\0"),M=(x,D,U,V)=>V===null?!1:(x.write(V+F,D,U,"utf8"),V.length!==Buffer.byteLength(V)||V.length>U);e.exports=a}),ig=me((t,e)=>{"use strict";ee();var r=Ba(),n=_e("path"),i=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+n.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:c,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(h),h.write(u,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
63
+ `,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Qs.default.resolve(t);await Py(Qs.default.dirname(o))||(Tt("The application path is not writable, please check folder permissions and try again."),Tt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Qs.default.basename(o);try{await Kl.default.mkdir(o,{recursive:!0})}catch(p){Tt("Unable to create project directory"),Tt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Yo(o);u||(Tt(`${gi.default.dim(o)} has ${c.length} conflicting ${c.length===1?"file":"files"} - please try a different location`),process.exit(1));let l=process.cwd();process.chdir(o),jr();let h=fp("Downloading files... (This might take a moment)");try{!r&&i?(h.start(),await(0,Iy.default)(()=>Ty(o,i),{retries:3})):(h.start(),await(0,Iy.default)(()=>Oy(o,e),{retries:3}))}catch(p){throw new eo(yU(p)?p.message:String(p))}finally{h.stop()}let f=Qs.default.join(o,"package.json"),d=Kl.default.existsSync(f),y=[];if(d){let p;try{p=Kl.default.readJsonSync(f)}catch{}p&&y.push(...Object.keys(p.scripts||{}))}let m=t;return Qs.default.join(l,a)===t&&(m=a),{cdPath:m,hasPackageJson:d,availableScripts:y,repoInfo:i}}var ho=require("fs"),Wy=require("crypto");var Ck=oe(require("picocolors"));var Te;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Te||(Te={}));var Ny;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Ny||(Ny={}));var ae=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Nn=t=>{switch(typeof t){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return isNaN(t)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(t)?ae.array:t===null?ae.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ae.promise:typeof Map!="undefined"&&t instanceof Map?ae.map:typeof Set!="undefined"&&t instanceof Set?ae.set:typeof Date!="undefined"&&t instanceof Date?ae.date:ae.object;default:return ae.unknown}},ie=Te.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gU=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,u=0;for(;u<o.path.length;){let c=o.path[u];u===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(r(o))):a[c]=a[c]||{_errors:[]},a=a[c],u++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var Da=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===ae.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Te.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Te.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Te.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Te.joinValues(t.options)}, received '${t.received}'`;break;case ie.invalid_arguments:r="Invalid function arguments";break;case ie.invalid_return_type:r="Invalid function return type";break;case ie.invalid_date:r="Invalid date";break;case ie.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case ie.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case ie.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case ie.custom:r="Invalid input";break;case ie.invalid_intersection_types:r="Intersection results could not be merged";break;case ie.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:r="Number must be finite";break;default:r=e.defaultError,Te.assertNever(t)}return{message:r}},ck=Da;function _U(t){ck=t}function Jl(){return ck}var Xl=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},bU=[];function ue(t,e){let r=Xl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Jl(),Da].filter(n=>!!n)});t.common.issues.push(r)}var et=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ee;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return et.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Ee;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},Ee=Object.freeze({status:"aborted"}),lk=t=>({status:"dirty",value:t}),gt=t=>({status:"valid",value:t}),My=t=>t.status==="aborted",jy=t=>t.status==="dirty",Ca=t=>t.status==="valid",Ql=t=>typeof Promise!="undefined"&&t instanceof Promise,ge;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ge||(ge={}));var er=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ak=(t,e)=>{if(Ca(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function we(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var xe=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Nn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new et,ctx:{common:e.parent.common,data:e.data,parsedType:Nn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Ql(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return ak(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Nn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Ql(i)?i:Promise.resolve(i));return ak(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:ie.custom,...n(i)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Mt({schema:this,typeName:be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return cr.create(this,this._def)}nullable(){return on.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nt.create(this,this._def)}promise(){return qn.create(this,this._def)}or(e){return Ei.create([this,e],this._def)}and(e){return wi.create(this,e,this._def)}transform(e){return new Mt({...we(this._def),schema:this,typeName:be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Ci({...we(this._def),innerType:this,defaultValue:r,typeName:be.ZodDefault})}brand(){return new eh({typeName:be.ZodBranded,type:this,...we(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new oo({...we(this._def),innerType:this,catchValue:r,typeName:be.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ri.create(this,e)}readonly(){return uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},vU=/^c[^\s-]{8,}$/i,EU=/^[a-z][a-z0-9]*$/,wU=/^[0-9A-HJKMNP-TV-Z]{26}$/,xU=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,SU=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AU="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",By,DU=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,CU=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,RU=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function kU(t,e){return!!((e==="v4"||!e)&&DU.test(t)||(e==="v6"||!e)&&CU.test(t))}var Lt=class extends xe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ae.string){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.string,received:s.parsedType}),Ee}let n=new et,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?ue(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ue(i,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")SU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"email",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")By||(By=new RegExp(AU,"u")),By.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"uuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")vU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")EU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")wU.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ue(i,{validation:"url",code:ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"regex",code:ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?RU(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?kU(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ue(i,{validation:"ip",code:ie.invalid_string,message:s.message}),n.dirty()):Te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:ie.invalid_string,...ge.errToObj(n)})}_addCheck(e){return new Lt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ge.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ge.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ge.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ge.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ge.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ge.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ge.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ge.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...ge.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ge.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ge.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ge.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ge.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ge.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ge.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ge.errToObj(r)})}nonempty(e){return this.min(1,ge.errToObj(e))}trim(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Lt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Lt.create=t=>{var e;return new Lt({checks:[],typeName:be.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};function TU(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Rr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ae.number){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="int"?Te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?TU(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_finite,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new Rr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new Rr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ge.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ge.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Rr.create=t=>new Rr({checks:[],typeName:be.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var kr=class extends xe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ae.bigint){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.bigint,received:s.parsedType}),Ee}let n,i=new et;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),ue(n,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Te.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ge.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ge.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ge.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ge.toString(r))}setLimit(e,r,n,i){return new kr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ge.toString(i)}]})}_addCheck(e){return new kr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ge.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};kr.create=t=>{var e;return new kr({checks:[],typeName:be.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...we(t)})};var _i=class extends xe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ae.boolean){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.boolean,received:n.parsedType}),Ee}return gt(e.data)}};_i.create=t=>new _i({typeName:be.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...we(t)});var nn=class extends xe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ae.date){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ue(s,{code:ie.invalid_date}),Ee}let n=new et,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ue(i,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):Te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ge.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ge.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};nn.create=t=>new nn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:be.ZodDate,...we(t)});var ro=class extends xe{_parse(e){if(this._getType(e)!==ae.symbol){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.symbol,received:n.parsedType}),Ee}return gt(e.data)}};ro.create=t=>new ro({typeName:be.ZodSymbol,...we(t)});var bi=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.undefined,received:n.parsedType}),Ee}return gt(e.data)}};bi.create=t=>new bi({typeName:be.ZodUndefined,...we(t)});var vi=class extends xe{_parse(e){if(this._getType(e)!==ae.null){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.null,received:n.parsedType}),Ee}return gt(e.data)}};vi.create=t=>new vi({typeName:be.ZodNull,...we(t)});var jn=class extends xe{constructor(){super(...arguments),this._any=!0}_parse(e){return gt(e.data)}};jn.create=t=>new jn({typeName:be.ZodAny,...we(t)});var rn=class extends xe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return gt(e.data)}};rn.create=t=>new rn({typeName:be.ZodUnknown,...we(t)});var lr=class extends xe{_parse(e){let r=this._getOrReturnCtx(e);return ue(r,{code:ie.invalid_type,expected:ae.never,received:r.parsedType}),Ee}};lr.create=t=>new lr({typeName:be.ZodNever,...we(t)});var no=class extends xe{_parse(e){if(this._getType(e)!==ae.undefined){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.void,received:n.parsedType}),Ee}return gt(e.data)}};no.create=t=>new no({typeName:be.ZodVoid,...we(t)});var Nt=class extends xe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==ae.array)return ue(r,{code:ie.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(ue(r,{code:o?ie.too_big:ie.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(ue(r,{code:ie.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(ue(r,{code:ie.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new er(r,o,r.path,a)))).then(o=>et.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new er(r,o,r.path,a)));return et.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Nt({...this._def,minLength:{value:e,message:ge.toString(r)}})}max(e,r){return new Nt({...this._def,maxLength:{value:e,message:ge.toString(r)}})}length(e,r){return new Nt({...this._def,exactLength:{value:e,message:ge.toString(r)}})}nonempty(e){return this.min(1,e)}};Nt.create=(t,e)=>new Nt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:be.ZodArray,...we(e)});function to(t){if(t instanceof Be){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=cr.create(to(n))}return new Be({...t._def,shape:()=>e})}else return t instanceof Nt?new Nt({...t._def,type:to(t.element)}):t instanceof cr?cr.create(to(t.unwrap())):t instanceof on?on.create(to(t.unwrap())):t instanceof tr?tr.create(t.items.map(e=>to(e))):t}var Be=class extends xe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==ae.object){let c=this._getOrReturnCtx(e);return ue(c,{code:ie.invalid_type,expected:ae.object,received:c.parsedType}),Ee}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof lr&&this._def.unknownKeys==="strip"))for(let c in i.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new er(i,h,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof lr){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:i.data[l]}});else if(c==="strict")a.length>0&&(ue(i,{code:ie.unrecognized_keys,keys:a}),n.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of a){let h=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new er(i,h,i.path,l)),alwaysSet:l in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let l of u){let h=await l.key;c.push({key:h,value:await l.value,alwaysSet:l.alwaysSet})}return c}).then(c=>et.mergeObjectSync(n,c)):et.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return ge.errToObj,new Be({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let u=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=ge.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(e){return new Be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:be.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Be({...this._def,catchall:e})}pick(e){let r={};return Te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}omit(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Be({...this._def,shape:()=>r})}deepPartial(){return to(this)}partial(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Be({...this._def,shape:()=>r})}required(e){let r={};return Te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof cr;)s=s._def.innerType;r[n]=s}}),new Be({...this._def,shape:()=>r})}keyof(){return hk(Te.objectKeys(this.shape))}};Be.create=(t,e)=>new Be({shape:()=>t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.strictCreate=(t,e)=>new Be({shape:()=>t,unknownKeys:"strict",catchall:lr.create(),typeName:be.ZodObject,...we(e)});Be.lazycreate=(t,e)=>new Be({shape:t,unknownKeys:"strip",catchall:lr.create(),typeName:be.ZodObject,...we(e)});var Ei=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return ue(r,{code:ie.invalid_union,unionErrors:o}),Ee}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},l=u._parseSync({data:r.data,path:r.path,parent:c});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(u=>new Bt(u));return ue(r,{code:ie.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}};Ei.create=(t,e)=>new Ei({options:t,typeName:be.ZodUnion,...we(e)});var Zl=t=>t instanceof Si?Zl(t.schema):t instanceof Mt?Zl(t.innerType()):t instanceof Ai?[t.value]:t instanceof Tr?t.options:t instanceof Di?Object.keys(t.enum):t instanceof Ci?Zl(t._def.innerType):t instanceof bi?[void 0]:t instanceof vi?[null]:null,io=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.object)return ue(r,{code:ie.invalid_type,expected:ae.object,received:r.parsedType}),Ee;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(ue(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Zl(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new io({typeName:be.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...we(n)})}};function qy(t,e){let r=Nn(t),n=Nn(e);if(t===e)return{valid:!0,data:t};if(r===ae.object&&n===ae.object){let i=Te.objectKeys(e),s=Te.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=qy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===ae.array&&n===ae.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=qy(o,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===ae.date&&n===ae.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var wi=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(My(s)||My(o))return Ee;let a=qy(s.value,o.value);return a.valid?((jy(s)||jy(o))&&r.dirty(),{status:r.value,value:a.data}):(ue(n,{code:ie.invalid_intersection_types}),Ee)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wi.create=(t,e,r)=>new wi({left:t,right:e,typeName:be.ZodIntersection,...we(r)});var tr=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.array)return ue(n,{code:ie.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(n.data.length<this._def.items.length)return ue(n,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&n.data.length>this._def.items.length&&(ue(n,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new er(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>et.mergeArray(r,o)):et.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new tr({...this._def,rest:e})}};tr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tr({items:t,typeName:be.ZodTuple,rest:null,...we(e)})};var xi=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.object)return ue(n,{code:ie.invalid_type,expected:ae.object,received:n.parsedType}),Ee;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new er(n,a,n.path,a)),value:o._parse(new er(n,n.data[a],n.path,a))});return n.common.async?et.mergeObjectAsync(r,i):et.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof xe?new xi({keyType:e,valueType:r,typeName:be.ZodRecord,...we(n)}):new xi({keyType:Lt.create(),valueType:e,typeName:be.ZodRecord,...we(r)})}},so=class extends xe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.map)return ue(n,{code:ie.invalid_type,expected:ae.map,received:n.parsedType}),Ee;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,u],c)=>({key:i._parse(new er(n,a,n.path,[c,"key"])),value:s._parse(new er(n,u,n.path,[c,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,l=await u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of o){let c=u.key,l=u.value;if(c.status==="aborted"||l.status==="aborted")return Ee;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};so.create=(t,e,r)=>new so({valueType:e,keyType:t,typeName:be.ZodMap,...we(r)});var sn=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==ae.set)return ue(n,{code:ie.invalid_type,expected:ae.set,received:n.parsedType}),Ee;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(ue(n,{code:ie.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(ue(n,{code:ie.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let l of u){if(l.status==="aborted")return Ee;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...n.data.values()].map((u,c)=>s._parse(new er(n,u,n.path,c)));return n.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new sn({...this._def,minSize:{value:e,message:ge.toString(r)}})}max(e,r){return new sn({...this._def,maxSize:{value:e,message:ge.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};sn.create=(t,e)=>new sn({valueType:t,minSize:null,maxSize:null,typeName:be.ZodSet,...we(e)});var Mn=class extends xe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.function)return ue(r,{code:ie.invalid_type,expected:ae.function,received:r.parsedType}),Ee;function n(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function i(a,u){return Xl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Jl(),Da].filter(c=>!!c),issueData:{code:ie.invalid_return_type,returnTypeError:u}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof qn){let a=this;return gt(async function(...u){let c=new Bt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(n(u,d)),c}),h=await Reflect.apply(o,this,l);return await a._def.returns._def.type.parseAsync(h,s).catch(d=>{throw c.addIssue(i(h,d)),c})})}else{let a=this;return gt(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Bt([n(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Bt([i(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Mn({...this._def,args:tr.create(e).rest(rn.create())})}returns(e){return new Mn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Mn({args:e||tr.create([]).rest(rn.create()),returns:r||rn.create(),typeName:be.ZodFunction,...we(n)})}},Si=class extends xe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Si.create=(t,e)=>new Si({getter:t,typeName:be.ZodLazy,...we(e)});var Ai=class extends xe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ue(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ai.create=(t,e)=>new Ai({value:t,typeName:be.ZodLiteral,...we(e)});function hk(t,e){return new Tr({values:t,typeName:be.ZodEnum,...we(e)})}var Tr=class extends xe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{expected:Te.joinValues(n),received:r.parsedType,code:ie.invalid_type}),Ee}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return ue(r,{received:r.data,code:ie.invalid_enum_value,options:n}),Ee}return gt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return Tr.create(e)}exclude(e){return Tr.create(this.options.filter(r=>!e.includes(r)))}};Tr.create=hk;var Di=class extends xe{_parse(e){let r=Te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==ae.string&&n.parsedType!==ae.number){let i=Te.objectValues(r);return ue(n,{expected:Te.joinValues(i),received:n.parsedType,code:ie.invalid_type}),Ee}if(r.indexOf(e.data)===-1){let i=Te.objectValues(r);return ue(n,{received:n.data,code:ie.invalid_enum_value,options:i}),Ee}return gt(e.data)}get enum(){return this._def.values}};Di.create=(t,e)=>new Di({values:t,typeName:be.ZodNativeEnum,...we(e)});var qn=class extends xe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==ae.promise&&r.common.async===!1)return ue(r,{code:ie.invalid_type,expected:ae.promise,received:r.parsedType}),Ee;let n=r.parsedType===ae.promise?r.data:Promise.resolve(r.data);return gt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};qn.create=(t,e)=>new qn({type:t,typeName:be.ZodPromise,...we(e)});var Mt=class extends xe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{ue(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let u=i.refinement(a,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ca(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ca(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Te.assertNever(i)}};Mt.create=(t,e,r)=>new Mt({schema:t,typeName:be.ZodEffects,effect:e,...we(r)});Mt.createWithPreprocess=(t,e,r)=>new Mt({schema:e,effect:{type:"preprocess",transform:t},typeName:be.ZodEffects,...we(r)});var cr=class extends xe{_parse(e){return this._getType(e)===ae.undefined?gt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};cr.create=(t,e)=>new cr({innerType:t,typeName:be.ZodOptional,...we(e)});var on=class extends xe{_parse(e){return this._getType(e)===ae.null?gt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:be.ZodNullable,...we(e)});var Ci=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===ae.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ci.create=(t,e)=>new Ci({innerType:t,typeName:be.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...we(e)});var oo=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ql(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};oo.create=(t,e)=>new oo({innerType:t,typeName:be.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...we(e)});var ao=class extends xe{_parse(e){if(this._getType(e)!==ae.nan){let n=this._getOrReturnCtx(e);return ue(n,{code:ie.invalid_type,expected:ae.nan,received:n.parsedType}),Ee}return{status:"valid",value:e.data}}};ao.create=t=>new ao({typeName:be.ZodNaN,...we(t)});var OU=Symbol("zod_brand"),eh=class extends xe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Ri=class extends xe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ee:s.status==="dirty"?(r.dirty(),lk(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ee:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new Ri({in:e,out:r,typeName:be.ZodPipeline})}},uo=class extends xe{_parse(e){let r=this._def.innerType._parse(e);return Ca(r)&&(r.value=Object.freeze(r.value)),r}};uo.create=(t,e)=>new uo({innerType:t,typeName:be.ZodReadonly,...we(e)});var fk=(t,e={},r)=>t?jn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,u=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:u})}}):jn.create(),FU={object:Be.lazycreate},be;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(be||(be={}));var PU=(t,e={message:`Input not instance of ${t.name}`})=>fk(r=>r instanceof t,e),dk=Lt.create,pk=Rr.create,IU=ao.create,LU=kr.create,mk=_i.create,BU=nn.create,NU=ro.create,MU=bi.create,jU=vi.create,qU=jn.create,UU=rn.create,HU=lr.create,$U=no.create,GU=Nt.create,zU=Be.create,VU=Be.strictCreate,WU=Ei.create,YU=io.create,KU=wi.create,ZU=tr.create,JU=xi.create,XU=so.create,QU=sn.create,e7=Mn.create,t7=Si.create,r7=Ai.create,n7=Tr.create,i7=Di.create,s7=qn.create,uk=Mt.create,o7=cr.create,a7=on.create,u7=Mt.createWithPreprocess,c7=Ri.create,l7=()=>dk().optional(),h7=()=>pk().optional(),f7=()=>mk().optional(),d7={string:t=>Lt.create({...t,coerce:!0}),number:t=>Rr.create({...t,coerce:!0}),boolean:t=>_i.create({...t,coerce:!0}),bigint:t=>kr.create({...t,coerce:!0}),date:t=>nn.create({...t,coerce:!0})},p7=Ee,co=Object.freeze({__proto__:null,defaultErrorMap:Da,setErrorMap:_U,getErrorMap:Jl,makeIssue:Xl,EMPTY_PATH:bU,addIssueToContext:ue,ParseStatus:et,INVALID:Ee,DIRTY:lk,OK:gt,isAborted:My,isDirty:jy,isValid:Ca,isAsync:Ql,get util(){return Te},get objectUtil(){return Ny},ZodParsedType:ae,getParsedType:Nn,ZodType:xe,ZodString:Lt,ZodNumber:Rr,ZodBigInt:kr,ZodBoolean:_i,ZodDate:nn,ZodSymbol:ro,ZodUndefined:bi,ZodNull:vi,ZodAny:jn,ZodUnknown:rn,ZodNever:lr,ZodVoid:no,ZodArray:Nt,ZodObject:Be,ZodUnion:Ei,ZodDiscriminatedUnion:io,ZodIntersection:wi,ZodTuple:tr,ZodRecord:xi,ZodMap:so,ZodSet:sn,ZodFunction:Mn,ZodLazy:Si,ZodLiteral:Ai,ZodEnum:Tr,ZodNativeEnum:Di,ZodPromise:qn,ZodEffects:Mt,ZodTransformer:Mt,ZodOptional:cr,ZodNullable:on,ZodDefault:Ci,ZodCatch:oo,ZodNaN:ao,BRAND:OU,ZodBranded:eh,ZodPipeline:Ri,ZodReadonly:uo,custom:fk,Schema:xe,ZodSchema:xe,late:FU,get ZodFirstPartyTypeKind(){return be},coerce:d7,any:qU,array:GU,bigint:LU,boolean:mk,date:BU,discriminatedUnion:YU,effect:uk,enum:n7,function:e7,instanceof:PU,intersection:KU,lazy:t7,literal:r7,map:XU,nan:IU,nativeEnum:i7,never:HU,null:jU,nullable:a7,number:pk,object:zU,oboolean:f7,onumber:h7,optional:o7,ostring:l7,pipeline:c7,preprocess:u7,promise:s7,record:JU,set:QU,strictObject:VU,string:dk,symbol:NU,transformer:uk,tuple:ZU,undefined:MU,union:WU,unknown:UU,void:$U,NEVER:p7,ZodIssueCode:ie,quotelessJson:gU,ZodError:Bt});var Vy=oe(require("os")),Sk=oe(require("crypto")),Ak=oe(require("path")),Dk=oe(xk());function S7(t){let e=process.version,r=Vy.default.type(),n=Vy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function A7(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,Dk.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return Ak.default.join(t,"turborepo","telemetry.json")}function D7({input:t,salt:e}){return Sk.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var lo={buildUserAgent:S7,oneWayHashWithSalt:D7,defaultConfigPath:A7};var C7="TURBO_TELEMETRY_DEBUG",R7="TURBO_TELEMETRY_DISABLED",k7="TURBO_TELEMETRY_MESSAGE_DISABLED",T7="DO_NOT_TRACK",O7=co.object({telemetry_enabled:co.boolean(),telemetry_id:co.string(),telemetry_salt:co.string(),telemetry_alerted:co.string().optional()}),At=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,ho.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=At.validateConfig(n);return new At({configPath:e,config:i})}catch{return At.tryRemove({configPath:e})?At.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await lo.defaultConfigPath();return At.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return O7.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=(0,Wy.randomUUID)(),n=(0,Wy.randomUUID)(),i=lo.oneWayHashWithSalt({input:r,salt:n}),s=new At({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,ho.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,ho.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[T7]||"0",r=process.env[R7]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[k7]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(de.log(),de.bold("Attention:"),de.grey("Turborepo now collects completely anonymous telemetry regarding usage."),de.grey("This information is used to shape the Turborepo roadmap and prioritize features."),de.grey("You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:"),de.underline(Ck.default.gray("https://turbo.build/docs/telemetry"))),this.alertShown()}enable(){this.config.telemetry_enabled=!0,this.tryWrite()}disable(){this.config.telemetry_enabled=!1,this.tryWrite()}alertShown(){return this.hasSeenAlert()||(this.config.telemetry_alerted=new Date().toISOString(),this.tryWrite()),!0}oneWayHash(e){return lo.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[C7]||"0";return e==="1"||e.toLowerCase()==="true"}};var Yy=require("crypto"),Rk=oe(Ay());var F7=20,P7="/api/turborepo/v1/events",ki=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=F7;this.timeout=250;this.sessionId=(0,Yy.randomUUID)();this.eventBatches=[];this.events=[];let s=new URL(P7,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(Rk.default.post(this.api,{timeout:this.timeout,json:e,headers:{"x-turbo-telemetry-id":this.config.id,"x-turbo-session-id":this.sessionId,"User-Agent":lo.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:(0,Yy.randomUUID)(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return At.isDebug()&&(de.log(),de.bold("[telemetry event]"),de.dimmed(JSON.stringify(s,null,2)),de.log()),this.config.isEnabled()&&(this.events.push({package:s}),this.events.length>=this.batchSize&&this.flushEvents()),s}async close(){for(;this.hasPendingEvents();)this.flushEvents();try{await this.waitForFlush()}catch{}}trackCliOption({option:e,value:r}){return this.track({key:`option:${e}`,value:r})}trackCliArgument({argument:e,value:r}){return this.track({key:`argument:${e}`,value:r})}trackCliCommand({command:e,value:r}){return this.track({key:`command:${e}`,value:r})}trackCommandStatus({command:e,status:r}){return this.trackCliCommand({command:e,value:r})}trackCommandWarning(e){return this.track({key:"warning",value:e})}trackCommandError(e){return this.track({key:"error",value:e})}};var Ra=class extends ki{trackOptionExample(e){if(e)return this.trackCliOption({option:"example",value:e})}trackOptionPackageManager(e){if(e)return this.trackCliOption({option:"package_manager",value:e})}trackOptionSkipInstall(e){if(e)return this.trackCliOption({option:"skip_install",value:e.toString()})}trackOptionSkipTransforms(e){if(e)return this.trackCliOption({option:"skip_transforms",value:e.toString()})}trackOptionTurboVersion(e){if(e)return this.trackCliOption({option:"turbo_version",value:e})}trackOptionExamplePath(e){if(e)return this.trackCliOption({option:"example_path",value:e})}trackArgumentDirectory(e){if(e)return this.trackCliArgument({argument:"project_directory",value:"provided"})}trackArgumentPackageManager(e){if(e)return this.trackCliArgument({argument:"package_manager",value:e})}};var Pk=oe(Fk());var L7=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ka=class extends ki{trackCI(){var e;return this.track({key:"ci",value:(e=Pk.name)!=null?e:"unknown"})}trackArgumentWorkspace(e){if(e)return this.trackCliArgument({argument:"workspace",value:"provided"})}trackOptionTask(e){if(e)return this.trackCliOption({option:"task",value:L7.includes(e)?e:"other"})}trackOptionFallback(e){if(e)return this.trackCliOption({option:"fallback",value:e})}trackOptionDirectory(e){if(e)return this.trackCliOption({option:"directory",value:"custom"})}trackOptionMaxBuffer(e){if(e!==void 0)return this.trackCliOption({option:"max_buffer",value:e.toString()})}};var B7={"create-turbo":Ra,"turbo-ignore":ka},N7="https://telemetry.vercel.com";async function Ky({packageInfo:t,opts:e}){let r=B7[t.name],n=await At.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:N7,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}var Ta=oe(require("picocolors"));var Ik=require("commander"),Lk="status",M7=["enable","disable",Lk];function j7(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();de.log(`Status: ${e?Ta.default.bold(Ta.default.green("Enabled")):Ta.default.bold(Ta.default.red("Disabled"))}`),de.log(),e?de.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):de.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),de.log("Learn more: https://turbo.build/docs/telemetry")}function q7(t,e){if(!e.telemetry){de.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),de.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),de.bold("Success!")),de.log(),j7(e)}function Zy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new Ik.Argument("[action]","Action to perform").choices(M7).default(Lk)).action(q7)}var JT=require("proxy-agent"),xg=oe(rh());var Jy=oe(require("picocolors")),Bk=oe(require("update-check"));var Nk=oe(rh()),H7=(0,Bk.default)(Nk.default).catch(()=>null);async function Xy(){try{let t=await H7;t!=null&&t.latest&&(de.log(),de.log(Jy.default.yellow(Jy.default.bold("A new version of `create-turbo` is available!"))),de.log()),process.exit()}catch{}}var qa=oe(require("path")),tt=oe(require("picocolors"));var Dt=require("picocolors"),Qk=oe(Xu(),1),eT=oe(sc(),1),sT=oe(require("os"),1),oT=oe(_s(),1),OZ=require("fs-extra");var BZ=oe(Cu(),1),MZ=require("fs-extra"),qZ=require("fs-extra"),HZ=require("picocolors"),uT=require("stream"),cT=require("util"),VZ=require("fs-extra"),KZ=require("picocolors"),JZ=require("fs-extra"),Ti=oe(require("path"),1),hr=oe(require("fs-extra"),1),lT=oe(_s(),1),hT=oe(require("path"),1),fT=oe(require("fs-extra"),1),dT=oe(require("picocolors"),1),un=oe(require("path"),1),pT=oe(_s(),1),Ut=require("fs-extra"),mT=oe(Cu(),1);var Fa=oe(require("path"),1),Oi=oe(require("fs-extra"),1),go=oe(require("path"),1),Fi=oe(require("fs-extra"),1),Pa=oe(require("path"),1),Ii=oe(require("fs-extra"),1),qt=oe(require("picocolors"),1),ET=oe(sc(),1),wT=oe(_s(),1),xT=oe(Xu(),1),ST=require("semver"),AT=oe(require("picocolors"),1),$7=Object.create,tg=Object.defineProperty,G7=Object.getOwnPropertyDescriptor,z7=Object.getOwnPropertyNames,V7=Object.getPrototypeOf,W7=Object.prototype.hasOwnProperty,_e=(t=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(t,{get:(e,r)=>(typeof require!="undefined"?require:e)[r]}):t)(function(t){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),Y7=(t,e)=>()=>(t&&(e=t(t=0)),e),me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K7=(t,e)=>{for(var r in e)tg(t,r,{get:e[r],enumerable:!0})},Z7=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of z7(e))!W7.call(t,i)&&i!==r&&tg(t,i,{get:()=>e[i],enumerable:!(n=G7(e,i))||n.enumerable});return t},oh=(t,e,r)=>(r=t!=null?$7(V7(t)):{},Z7(e||!t||!t.__esModule?tg(r,"default",{value:t,enumerable:!0}):r,t)),ee=Y7(()=>{}),J7=me((t,e)=>{ee();function r(n){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,r(n)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),X7=me((t,e)=>{ee();var r=J7().default;function n(){"use strict";e.exports=n=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var i,s={},o=Object.prototype,a=o.hasOwnProperty,u=Object.defineProperty||function(q,g,_){q[g]=_.value},c=typeof Symbol=="function"?Symbol:{},l=c.iterator||"@@iterator",h=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function d(q,g,_){return Object.defineProperty(q,g,{value:_,enumerable:!0,configurable:!0,writable:!0}),q[g]}try{d({},"")}catch{d=function(q,g,_){return q[g]=_}}function y(q,g,_,v){var k=g&&g.prototype instanceof F?g:F,S=Object.create(k.prototype),H=new G(v||[]);return u(S,"_invoke",{value:ne(q,_,H)}),S}function m(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(v){return{type:"throw",arg:v}}}s.wrap=y;var p="suspendedStart",E="suspendedYield",R="executing",P="completed",O={};function F(){}function M(){}function x(){}var D={};d(D,l,function(){return this});var U=Object.getPrototypeOf,V=U&&U(U(Z([])));V&&V!==o&&a.call(V,l)&&(D=V);var B=x.prototype=F.prototype=Object.create(D);function K(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function Q(q,g){function _(k,S,H,$){var re=m(q[k],q,S);if(re.type!=="throw"){var W=re.arg,fe=W.value;return fe&&r(fe)=="object"&&a.call(fe,"__await")?g.resolve(fe.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(fe).then(function(J){W.value=J,H(W)},function(J){return _("throw",J,H,$)})}$(re.arg)}var v;u(this,"_invoke",{value:function(k,S){function H(){return new g(function($,re){_(k,S,$,re)})}return v=v?v.then(H,H):H()}})}function ne(q,g,_){var v=p;return function(k,S){if(v===R)throw new Error("Generator is already running");if(v===P){if(k==="throw")throw S;return{value:i,done:!0}}for(_.method=k,_.arg=S;;){var H=_.delegate;if(H){var $=j(H,_);if($){if($===O)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(v===p)throw v=P,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);v=R;var re=m(q,g,_);if(re.type==="normal"){if(v=_.done?P:E,re.arg===O)continue;return{value:re.arg,done:_.done}}re.type==="throw"&&(v=P,_.method="throw",_.arg=re.arg)}}}function j(q,g){var _=g.method,v=q.iterator[_];if(v===i)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=i,j(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),O;var k=m(v,q.iterator,g.arg);if(k.type==="throw")return g.method="throw",g.arg=k.arg,g.delegate=null,O;var S=k.arg;return S?S.done?(g[q.resultName]=S.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=i),g.delegate=null,O):S:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,O)}function I(q){var g={tryLoc:q[0]};1 in q&&(g.catchLoc=q[1]),2 in q&&(g.finallyLoc=q[2],g.afterLoc=q[3]),this.tryEntries.push(g)}function L(q){var g=q.completion||{};g.type="normal",delete g.arg,q.completion=g}function G(q){this.tryEntries=[{tryLoc:"root"}],q.forEach(I,this),this.reset(!0)}function Z(q){if(q||q===""){var g=q[l];if(g)return g.call(q);if(typeof q.next=="function")return q;if(!isNaN(q.length)){var _=-1,v=function k(){for(;++_<q.length;)if(a.call(q,_))return k.value=q[_],k.done=!1,k;return k.value=i,k.done=!0,k};return v.next=v}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=x,u(B,"constructor",{value:x,configurable:!0}),u(x,"constructor",{value:M,configurable:!0}),M.displayName=d(x,f,"GeneratorFunction"),s.isGeneratorFunction=function(q){var g=typeof q=="function"&&q.constructor;return!!g&&(g===M||(g.displayName||g.name)==="GeneratorFunction")},s.mark=function(q){return Object.setPrototypeOf?Object.setPrototypeOf(q,x):(q.__proto__=x,d(q,f,"GeneratorFunction")),q.prototype=Object.create(B),q},s.awrap=function(q){return{__await:q}},K(Q.prototype),d(Q.prototype,h,function(){return this}),s.AsyncIterator=Q,s.async=function(q,g,_,v,k){k===void 0&&(k=Promise);var S=new Q(y(q,g,_,v),k);return s.isGeneratorFunction(g)?S:S.next().then(function(H){return H.done?H.value:S.next()})},K(B),d(B,f,"Generator"),d(B,l,function(){return this}),d(B,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var v in g)_.push(v);return _.reverse(),function k(){for(;_.length;){var S=_.pop();if(S in g)return k.value=S,k.done=!1,k}return k.done=!0,k}},s.values=Z,G.prototype={constructor:G,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=i)},stop:function(){this.done=!0;var q=this.tryEntries[0].completion;if(q.type==="throw")throw q.arg;return this.rval},dispatchException:function(q){if(this.done)throw q;var g=this;function _(re,W){return S.type="throw",S.arg=q,g.next=re,W&&(g.method="next",g.arg=i),!!W}for(var v=this.tryEntries.length-1;v>=0;--v){var k=this.tryEntries[v],S=k.completion;if(k.tryLoc==="root")return _("end");if(k.tryLoc<=this.prev){var H=a.call(k,"catchLoc"),$=a.call(k,"finallyLoc");if(H&&$){if(this.prev<k.catchLoc)return _(k.catchLoc,!0);if(this.prev<k.finallyLoc)return _(k.finallyLoc)}else if(H){if(this.prev<k.catchLoc)return _(k.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<k.finallyLoc)return _(k.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var v=this.tryEntries[_];if(v.tryLoc<=this.prev&&a.call(v,"finallyLoc")&&this.prev<v.finallyLoc){var k=v;break}}k&&(q==="break"||q==="continue")&&k.tryLoc<=g&&g<=k.finallyLoc&&(k=null);var S=k?k.completion:{};return S.type=q,S.arg=g,k?(this.method="next",this.next=k.finallyLoc,O):this.complete(S)},complete:function(q,g){if(q.type==="throw")throw q.arg;return q.type==="break"||q.type==="continue"?this.next=q.arg:q.type==="return"?(this.rval=this.arg=q.arg,this.method="return",this.next="end"):q.type==="normal"&&g&&(this.next=g),O},finish:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.finallyLoc===q)return this.complete(_.completion,_.afterLoc),L(_),O}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var v=_.completion;if(v.type==="throw"){var k=v.arg;L(_)}return k}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=i),O}},s}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}),Q7=me((t,e)=>{ee();var r=X7()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),eH=me((t,e)=>{"use strict";ee();var r=(n,...i)=>new Promise(s=>{s(n(...i))});e.exports=r,e.exports.default=r}),tH=me((t,e)=>{"use strict";ee();var r=eH(),n=i=>{if(!((Number.isInteger(i)||i===1/0)&&i>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));let s=[],o=0,a=()=>{o--,s.length>0&&s.shift()()},u=(h,f,...d)=>{o++;let y=r(h,...d);f(y),y.then(a,a)},c=(h,f,...d)=>{o<i?u(h,f,...d):s.push(u.bind(null,h,f,...d))},l=(h,...f)=>new Promise(d=>c(h,d,...f));return Object.defineProperties(l,{activeCount:{get:()=>o},pendingCount:{get:()=>s.length},clearQueue:{value:()=>{s.length=0}}}),l};e.exports=n,e.exports.default=n}),rH=me((t,e)=>{"use strict";ee();var r=tH(),n=class extends Error{constructor(a){super(),this.value=a}},i=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new n(u[0]);return!1},o=async(a,u,c)=>{c={concurrency:1/0,preserveOrder:!0,...c};let l=r(c.concurrency),h=[...a].map(d=>[d,l(i,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof n)return d.value;throw d}};e.exports=o,e.exports.default=o}),nH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=_e("fs"),{promisify:i}=_e("util"),s=rH(),o=i(n.stat),a=i(n.lstat),u={directory:"isDirectory",file:"isFile"};function c({type:h}){if(!(h in u))throw new Error(`Invalid type specified: ${h}`)}var l=(h,f)=>h===void 0||f[u[h]]();e.exports=async(h,f)=>{f={cwd:process.cwd(),type:"file",allowSymlinks:!0,...f},c(f);let d=f.allowSymlinks?o:a;return s(h,async y=>{try{let m=await d(r.resolve(f.cwd,y));return l(f.type,m)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?n.statSync:n.lstatSync;for(let y of h)try{let m=d(r.resolve(f.cwd,y));if(l(f.type,m))return y}catch{}}}),iH=me((t,e)=>{"use strict";ee();var r=_e("fs"),{promisify:n}=_e("util"),i=n(r.access);e.exports=async s=>{try{return await i(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),sH=me((t,e)=>{"use strict";ee();var r=_e("path"),n=nH(),i=iH(),s=Symbol("findUp.stop");e.exports=async(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=async f=>{if(typeof o!="function")return n(l,f);let d=await o(f.cwd);return typeof d=="string"?n([d],f):d};for(;;){let f=await h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.sync=(o,a={})=>{let u=r.resolve(a.cwd||""),{root:c}=r.parse(u),l=[].concat(o),h=f=>{if(typeof o!="function")return n.sync(l,f);let d=o(f.cwd);return typeof d=="string"?n.sync([d],f):d};for(;;){let f=h({...a,cwd:u});if(f===s)return;if(f)return r.resolve(u,f);if(u===c)return;u=r.dirname(u)}},e.exports.exists=i,e.exports.sync.exists=i.sync,e.exports.stop=s}),Ia=me((t,e)=>{"use strict";ee();var r=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]);e.exports=n=>n?Object.keys(n).map(i=>[r.has(i)?r.get(i):i,n[i]]).reduce((i,s)=>(i[s[0]]=s[1],i),Object.create(null)):{}}),rg=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),y=Symbol("flushChunk"),m=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),O=Symbol("buffer"),F=Symbol("pipes"),M=Symbol("bufferLength"),x=Symbol("bufferPush"),D=Symbol("bufferShift"),U=Symbol("objectMode"),V=Symbol("destroyed"),B=Symbol("emitData"),K=Symbol("emitEnd"),Q=Symbol("emitEnd2"),ne=Symbol("async"),j=k=>Promise.resolve().then(k),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),G=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=k=>k==="end"||k==="finish"||k==="prefinish",q=k=>k instanceof ArrayBuffer||typeof k=="object"&&k.constructor&&k.constructor.name==="ArrayBuffer"&&k.byteLength>=0,g=k=>!Buffer.isBuffer(k)&&ArrayBuffer.isView(k),_=class{constructor(k,S,H){this.src=k,this.dest=S,this.opts=H,this.ondrain=()=>k[P](),S.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},v=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(k,S,H){super(k,S,H),this.proxyErrors=$=>S.emit("error",$),k.on("error",this.proxyErrors)}};e.exports=class qk extends i{constructor(S){super(),this[E]=!1,this[R]=!1,this[F]=[],this[O]=[],this[U]=S&&S.objectMode||!1,this[U]?this[m]=null:this[m]=S&&S.encoding||null,this[m]==="buffer"&&(this[m]=null),this[ne]=S&&!!S.async||!1,this[p]=this[m]?new s(this[m]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[M]=0,this[V]=!1,S&&S.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[O]}),S&&S.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]})}get bufferLength(){return this[M]}get encoding(){return this[m]}set encoding(S){if(this[U])throw new Error("cannot set encoding in objectMode");if(this[m]&&S!==this[m]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[m]!==S&&(this[p]=S?new s(S):null,this[O].length&&(this[O]=this[O].map(H=>this[p].write(H)))),this[m]=S}setEncoding(S){this.encoding=S}get objectMode(){return this[U]}set objectMode(S){this[U]=this[U]||!!S}get async(){return this[ne]}set async(S){this[ne]=this[ne]||!!S}write(S,H,$){if(this[o])throw new Error("write after end");if(this[V])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof H=="function"&&($=H,H="utf8"),H||(H="utf8");let re=this[ne]?j:W=>W();return!this[U]&&!Buffer.isBuffer(S)&&(g(S)?S=Buffer.from(S.buffer,S.byteOffset,S.byteLength):q(S)?S=Buffer.from(S):typeof S!="string"&&(this.objectMode=!0)),this[U]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):S.length?(typeof S=="string"&&!(H===this[m]&&!this[p].lastNeed)&&(S=Buffer.from(S,H)),Buffer.isBuffer(S)&&this[m]&&(S=this[p].write(S)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",S):this[x](S),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&re($),this.flowing)}read(S){if(this[V])return null;if(this[M]===0||S===0||S>this[M])return this[a](),null;this[U]&&(S=null),this[O].length>1&&!this[U]&&(this.encoding?this[O]=[this[O].join("")]:this[O]=[Buffer.concat(this[O],this[M])]);let H=this[f](S||null,this[O][0]);return this[a](),H}[f](S,H){return S===H.length||S===null?this[D]():(this[O][0]=H.slice(S),H=H.slice(0,S),this[M]-=S),this.emit("data",H),!this[O].length&&!this[o]&&this.emit("drain"),H}end(S,H,$){return typeof S=="function"&&($=S,S=null),typeof H=="function"&&($=H,H="utf8"),S&&this.write(S,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[V]||(this[R]=!1,this[E]=!0,this.emit("resume"),this[O].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[V]}get flowing(){return this[E]}get paused(){return this[R]}[x](S){this[U]?this[M]+=1:this[M]+=S.length,this[O].push(S)}[D](){return this[O].length&&(this[U]?this[M]-=1:this[M]-=this[O][0].length),this[O].shift()}[d](S){do;while(this[y](this[D]()));!S&&!this[O].length&&!this[o]&&this.emit("drain")}[y](S){return S?(this.emit("data",S),this.flowing):!1}pipe(S,H){if(this[V])return;let $=this[u];return H=H||{},S===r.stdout||S===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&S.end():(this[F].push(H.proxyErrors?new v(this,S,H):new _(this,S,H)),this[ne]?j(()=>this[P]()):this[P]()),S}unpipe(S){let H=this[F].find($=>$.dest===S);H&&(this[F].splice(this[F].indexOf(H),1),H.unpipe())}addListener(S,H){return this.on(S,H)}on(S,H){let $=super.on(S,H);return S==="data"&&!this[F].length&&!this.flowing?this[P]():S==="readable"&&this[M]!==0?super.emit("readable"):Z(S)&&this[u]?(super.emit(S),this.removeAllListeners(S)):S==="error"&&this[l]&&(this[ne]?j(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[V]&&this[O].length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(S,H,...$){if(S!=="error"&&S!=="close"&&S!==V&&this[V])return;if(S==="data")return H?this[ne]?j(()=>this[B](H)):this[B](H):!1;if(S==="end")return this[K]();if(S==="close"){if(this[h]=!0,!this[u]&&!this[V])return;let W=super.emit("close");return this.removeAllListeners("close"),W}else if(S==="error"){this[l]=H;let W=super.emit("error",H);return this[a](),W}else if(S==="resume"){let W=super.emit("resume");return this[a](),W}else if(S==="finish"||S==="prefinish"){let W=super.emit(S);return this.removeAllListeners(S),W}let re=super.emit(S,H,...$);return this[a](),re}[B](S){for(let $ of this[F])$.dest.write(S)===!1&&this.pause();let H=super.emit("data",S);return this[a](),H}[K](){this[u]||(this[u]=!0,this.readable=!1,this[ne]?j(()=>this[Q]()):this[Q]())}[Q](){if(this[p]){let H=this[p].end();if(H){for(let $ of this[F])$.dest.write(H);super.emit("data",H)}}for(let H of this[F])H.end();let S=super.emit("end");return this.removeAllListeners("end"),S}collect(){let S=[];this[U]||(S.dataLength=0);let H=this.promise();return this.on("data",$=>{S.push($),this[U]||(S.dataLength+=$.length)}),H.then(()=>S)}concat(){return this[U]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(S=>this[U]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?S.join(""):Buffer.concat(S,S.dataLength))}promise(){return new Promise((S,H)=>{this.on(V,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>S())})}[L](){return{next:()=>{let S=this.read();if(S!==null)return Promise.resolve({done:!1,value:S});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,re=w=>{this.removeListener("data",W),this.removeListener("end",fe),$(w)},W=w=>{this.removeListener("error",re),this.removeListener("end",fe),this.pause(),H({value:w,done:!!this[o]})},fe=()=>{this.removeListener("error",re),this.removeListener("data",W),H({done:!0})},J=()=>re(new Error("stream destroyed"));return new Promise((w,N)=>{$=N,H=w,this.once(V,J),this.once("error",re),this.once("end",fe),this.once("data",W)})}}}[G](){return{next:()=>{let S=this.read();return{value:S,done:S===null}}}}destroy(S){return this[V]?(S?this.emit("error",S):this.emit(V),this):(this[V]=!0,this[O].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),S?this.emit("error",S):this.emit(V),this)}static isStream(S){return!!S&&(S instanceof qk||S instanceof i||S instanceof n&&(typeof S.pipe=="function"||typeof S.write=="function"&&typeof S.end=="function"))}}}),oH=me((t,e)=>{ee();var r=_e("zlib").constants||{ZLIB_VERNUM:4736};e.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},r))}),Uk=me((t,e)=>{"use strict";ee();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},n=_e("events"),i=_e("stream"),s=_e("string_decoder").StringDecoder,o=Symbol("EOF"),a=Symbol("maybeEmitEnd"),u=Symbol("emittedEnd"),c=Symbol("emittingEnd"),l=Symbol("emittedError"),h=Symbol("closed"),f=Symbol("read"),d=Symbol("flush"),y=Symbol("flushChunk"),m=Symbol("encoding"),p=Symbol("decoder"),E=Symbol("flowing"),R=Symbol("paused"),P=Symbol("resume"),O=Symbol("bufferLength"),F=Symbol("bufferPush"),M=Symbol("bufferShift"),x=Symbol("objectMode"),D=Symbol("destroyed"),U=Symbol("emitData"),V=Symbol("emitEnd"),B=Symbol("emitEnd2"),K=Symbol("async"),Q=_=>Promise.resolve().then(_),ne=global._MP_NO_ITERATOR_SYMBOLS_!=="1",j=ne&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=ne&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",G=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,v,k){this.src=_,this.dest=v,this.opts=k,this.ondrain=()=>_[P](),v.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},g=class extends q{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(_,v,k){super(_,v,k),this.proxyErrors=S=>v.emit("error",S),_.on("error",this.proxyErrors)}};e.exports=class Hk extends i{constructor(v){super(),this[E]=!1,this[R]=!1,this.pipes=[],this.buffer=[],this[x]=v&&v.objectMode||!1,this[x]?this[m]=null:this[m]=v&&v.encoding||null,this[m]==="buffer"&&(this[m]=null),this[K]=v&&!!v.async||!1,this[p]=this[m]?new s(this[m]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[O]=0,this[D]=!1}get bufferLength(){return this[O]}get encoding(){return this[m]}set encoding(v){if(this[x])throw new Error("cannot set encoding in objectMode");if(this[m]&&v!==this[m]&&(this[p]&&this[p].lastNeed||this[O]))throw new Error("cannot change encoding");this[m]!==v&&(this[p]=v?new s(v):null,this.buffer.length&&(this.buffer=this.buffer.map(k=>this[p].write(k)))),this[m]=v}setEncoding(v){this.encoding=v}get objectMode(){return this[x]}set objectMode(v){this[x]=this[x]||!!v}get async(){return this[K]}set async(v){this[K]=this[K]||!!v}write(v,k,S){if(this[o])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof k=="function"&&(S=k,k="utf8"),k||(k="utf8");let H=this[K]?Q:$=>$();return!this[x]&&!Buffer.isBuffer(v)&&(Z(v)?v=Buffer.from(v.buffer,v.byteOffset,v.byteLength):G(v)?v=Buffer.from(v):typeof v!="string"&&(this.objectMode=!0)),this[x]?(this.flowing&&this[O]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[F](v),this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing):v.length?(typeof v=="string"&&!(k===this[m]&&!this[p].lastNeed)&&(v=Buffer.from(v,k)),Buffer.isBuffer(v)&&this[m]&&(v=this[p].write(v)),this.flowing&&this[O]!==0&&this[d](!0),this.flowing?this.emit("data",v):this[F](v),this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing):(this[O]!==0&&this.emit("readable"),S&&H(S),this.flowing)}read(v){if(this[D])return null;if(this[O]===0||v===0||v>this[O])return this[a](),null;this[x]&&(v=null),this.buffer.length>1&&!this[x]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[O])]);let k=this[f](v||null,this.buffer[0]);return this[a](),k}[f](v,k){return v===k.length||v===null?this[M]():(this.buffer[0]=k.slice(v),k=k.slice(0,v),this[O]-=v),this.emit("data",k),!this.buffer.length&&!this[o]&&this.emit("drain"),k}end(v,k,S){return typeof v=="function"&&(S=v,v=null),typeof k=="function"&&(S=k,k="utf8"),v&&this.write(v,k),S&&this.once("end",S),this[o]=!0,this.writable=!1,(this.flowing||!this[R])&&this[a](),this}[P](){this[D]||(this[R]=!1,this[E]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[P]()}pause(){this[E]=!1,this[R]=!0}get destroyed(){return this[D]}get flowing(){return this[E]}get paused(){return this[R]}[F](v){this[x]?this[O]+=1:this[O]+=v.length,this.buffer.push(v)}[M](){return this.buffer.length&&(this[x]?this[O]-=1:this[O]-=this.buffer[0].length),this.buffer.shift()}[d](v){do;while(this[y](this[M]()));!v&&!this.buffer.length&&!this[o]&&this.emit("drain")}[y](v){return v?(this.emit("data",v),this.flowing):!1}pipe(v,k){if(this[D])return;let S=this[u];return k=k||{},v===r.stdout||v===r.stderr?k.end=!1:k.end=k.end!==!1,k.proxyErrors=!!k.proxyErrors,S?k.end&&v.end():(this.pipes.push(k.proxyErrors?new g(this,v,k):new q(this,v,k)),this[K]?Q(()=>this[P]()):this[P]()),v}unpipe(v){let k=this.pipes.find(S=>S.dest===v);k&&(this.pipes.splice(this.pipes.indexOf(k),1),k.unpipe())}addListener(v,k){return this.on(v,k)}on(v,k){let S=super.on(v,k);return v==="data"&&!this.pipes.length&&!this.flowing?this[P]():v==="readable"&&this[O]!==0?super.emit("readable"):L(v)&&this[u]?(super.emit(v),this.removeAllListeners(v)):v==="error"&&this[l]&&(this[K]?Q(()=>k.call(this,this[l])):k.call(this,this[l])),S}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[D]&&this.buffer.length===0&&this[o]&&(this[c]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[h]&&this.emit("close"),this[c]=!1)}emit(v,k,...S){if(v!=="error"&&v!=="close"&&v!==D&&this[D])return;if(v==="data")return k?this[K]?Q(()=>this[U](k)):this[U](k):!1;if(v==="end")return this[V]();if(v==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(v==="error"){this[l]=k;let $=super.emit("error",k);return this[a](),$}else if(v==="resume"){let $=super.emit("resume");return this[a](),$}else if(v==="finish"||v==="prefinish"){let $=super.emit(v);return this.removeAllListeners(v),$}let H=super.emit(v,k,...S);return this[a](),H}[U](v){for(let S of this.pipes)S.dest.write(v)===!1&&this.pause();let k=super.emit("data",v);return this[a](),k}[V](){this[u]||(this[u]=!0,this.readable=!1,this[K]?Q(()=>this[B]()):this[B]())}[B](){if(this[p]){let k=this[p].end();if(k){for(let S of this.pipes)S.dest.write(k);super.emit("data",k)}}for(let k of this.pipes)k.end();let v=super.emit("end");return this.removeAllListeners("end"),v}collect(){let v=[];this[x]||(v.dataLength=0);let k=this.promise();return this.on("data",S=>{v.push(S),this[x]||(v.dataLength+=S.length)}),k.then(()=>v)}concat(){return this[x]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(v=>this[x]?Promise.reject(new Error("cannot concat in objectMode")):this[m]?v.join(""):Buffer.concat(v,v.dataLength))}promise(){return new Promise((v,k)=>{this.on(D,()=>k(new Error("stream destroyed"))),this.on("error",S=>k(S)),this.on("end",()=>v())})}[j](){return{next:()=>{let v=this.read();if(v!==null)return Promise.resolve({done:!1,value:v});if(this[o])return Promise.resolve({done:!0});let k=null,S=null,H=fe=>{this.removeListener("data",$),this.removeListener("end",re),S(fe)},$=fe=>{this.removeListener("error",H),this.removeListener("end",re),this.pause(),k({value:fe,done:!!this[o]})},re=()=>{this.removeListener("error",H),this.removeListener("data",$),k({done:!0})},W=()=>H(new Error("stream destroyed"));return new Promise((fe,J)=>{S=J,k=fe,this.once(D,W),this.once("error",H),this.once("end",re),this.once("data",$)})}}}[I](){return{next:()=>{let v=this.read();return{value:v,done:v===null}}}}destroy(v){return this[D]?(v?this.emit("error",v):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[O]=0,typeof this.close=="function"&&!this[h]&&this.close(),v?this.emit("error",v):this.emit(D),this)}static isStream(v){return!!v&&(v instanceof Hk||v instanceof i||v instanceof n&&(typeof v.pipe=="function"||typeof v.write=="function"&&typeof v.end=="function"))}}}),$k=me(t=>{"use strict";ee();var e=_e("assert"),r=_e("buffer").Buffer,n=_e("zlib"),i=t.constants=oH(),s=Uk(),o=r.concat,a=Symbol("_superWrite"),u=class extends Error{constructor(L){super("zlib: "+L.message),this.code=L.code,this.errno=L.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+L.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},c=Symbol("opts"),l=Symbol("flushFlag"),h=Symbol("finishFlushFlag"),f=Symbol("fullFlushFlag"),d=Symbol("handle"),y=Symbol("onError"),m=Symbol("sawError"),p=Symbol("level"),E=Symbol("strategy"),R=Symbol("ended"),P=Symbol("_defaultFullFlush"),O=class extends s{constructor(L,G){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[m]=!1,this[R]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new n[G](L)}catch(Z){throw new u(Z)}this[y]=Z=>{this[m]||(this[m]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[y](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[m])return e(this[d],"zlib binding closed"),this[d].reset()}flush(L){this.ended||(typeof L!="number"&&(L=this[f]),this.write(Object.assign(r.alloc(0),{[l]:L})))}end(L,G,Z){return L&&this.write(L,G),this.flush(this[h]),this[R]=!0,super.end(null,null,Z)}get ended(){return this[R]}write(L,G,Z){if(typeof G=="function"&&(Z=G,G="utf8"),typeof L=="string"&&(L=r.from(L,G)),this[m])return;e(this[d],"zlib binding closed");let q=this[d]._handle,g=q.close;q.close=()=>{};let _=this[d].close;this[d].close=()=>{},r.concat=S=>S;let v;try{let S=typeof L[l]=="number"?L[l]:this[l];v=this[d]._processChunk(L,S),r.concat=o}catch(S){r.concat=o,this[y](new u(S))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",S=>this[y](new u(S)));let k;if(v)if(Array.isArray(v)&&v.length>0){k=this[a](r.from(v[0]));for(let S=1;S<v.length;S++)k=this[a](v[S])}else k=this[a](r.from(v));return Z&&Z(),k}[a](L){return super.write(L)}},F=class extends O{constructor(L,G){L=L||{},L.flush=L.flush||i.Z_NO_FLUSH,L.finishFlush=L.finishFlush||i.Z_FINISH,super(L,G),this[f]=i.Z_FULL_FLUSH,this[p]=L.level,this[E]=L.strategy}params(L,G){if(!this[m]){if(!this[d])throw new Error("cannot switch params when binding is closed");if(!this[d].params)throw new Error("not supported in this implementation");if(this[p]!==L||this[E]!==G){this.flush(i.Z_SYNC_FLUSH),e(this[d],"zlib binding closed");let Z=this[d].flush;this[d].flush=(q,g)=>{this.flush(q),g()};try{this[d].params(L,G)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[E]=G)}}}},M=class extends F{constructor(L){super(L,"Deflate")}},x=class extends F{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),U=class extends F{constructor(L){super(L,"Gzip"),this[D]=L&&!!L.portable}[a](L){return this[D]?(this[D]=!1,L[9]=255,super[a](L)):super[a](L)}},V=class extends F{constructor(L){super(L,"Gunzip")}},B=class extends F{constructor(L){super(L,"DeflateRaw")}},K=class extends F{constructor(L){super(L,"InflateRaw")}},Q=class extends F{constructor(L){super(L,"Unzip")}},ne=class extends O{constructor(L,G){L=L||{},L.flush=L.flush||i.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||i.BROTLI_OPERATION_FINISH,super(L,G),this[f]=i.BROTLI_OPERATION_FLUSH}},j=class extends ne{constructor(L){super(L,"BrotliCompress")}},I=class extends ne{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=x,t.Gzip=U,t.Gunzip=V,t.DeflateRaw=B,t.InflateRaw=K,t.Unzip=Q,typeof n.BrotliCompress=="function"?(t.BrotliCompress=j,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),La=me((t,e)=>{ee();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?n=>n:n=>n&&n.replace(/\\/g,"/")}),ng=me((t,e)=>{"use strict";ee();var r=rg(),n=La(),i=Symbol("slurp");e.exports=class extends r{constructor(s,o,a){switch(super(),this.pause(),this.extended=o,this.globalExtended=a,this.header=s,this.startBlockSize=512*Math.ceil(s.size/512),this.blockRemain=this.startBlockSize,this.remain=s.size,this.type=s.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=n(s.path),this.mode=s.mode,this.mode&&(this.mode=this.mode&4095),this.uid=s.uid,this.gid=s.gid,this.uname=s.uname,this.gname=s.gname,this.size=s.size,this.mtime=s.mtime,this.atime=s.atime,this.ctime=s.ctime,this.linkpath=n(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[i](o),a&&this[i](a,!0)}write(s){let o=s.length;if(o>this.blockRemain)throw new Error("writing more to entry than is appropriate");let a=this.remain,u=this.blockRemain;return this.remain=Math.max(0,a-o),this.blockRemain=Math.max(0,u-o),this.ignore?!0:a>=o?super.write(s):super.write(s.slice(0,a))}[i](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?n(s[a]):s[a])}}}),Gk=me(t=>{"use strict";ee(),t.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),t.code=new Map(Array.from(t.name).map(e=>[e[1],e[0]]))}),aH=me((t,e)=>{"use strict";ee();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?i(l,h):n(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},n=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},i=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var y=l&255;l=Math.floor(l/256),f?h[d-1]=u(y):y===0?h[d-1]=0:(f=!0,h[d-1]=c(y))}},s=l=>{let h=l[0],f=h===128?a(l.slice(1,l.length)):h===255?o(l):null;if(f===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(f))throw Error("parsed number outside of javascript safe integer range");return f},o=l=>{for(var h=l.length,f=0,d=!1,y=h-1;y>-1;y--){var m=l[y],p;d?p=u(m):m===0?p=m:(d=!0,p=c(m)),p!==0&&(f-=p*Math.pow(256,h-y-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var y=l[d];y!==0&&(f+=y*Math.pow(256,h-d-1))}return f},u=l=>(255^l)&255,c=l=>(255^l)+1&255;e.exports={encode:r,parse:s}}),Ba=me((t,e)=>{"use strict";ee();var r=Gk(),n=_e("path").posix,i=aH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(x,D,U,V){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[o]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(x)?this.decode(x,D||0,U,V):x&&this.set(x)}decode(x,D,U,V){if(D||(D=0),!x||!(x.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(x,D,100),this.mode=f(x,D+100,8),this.uid=f(x,D+108,8),this.gid=f(x,D+116,8),this.size=f(x,D+124,12),this.mtime=l(x,D+136,12),this.cksum=f(x,D+148,12),this[s](U),this[s](V,!0),this[o]=c(x,D+156,1),this[o]===""&&(this[o]="0"),this[o]==="0"&&this.path.slice(-1)==="/"&&(this[o]="5"),this[o]==="5"&&(this.size=0),this.linkpath=c(x,D+157,100),x.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(x,D+265,32),this.gname=c(x,D+297,32),this.devmaj=f(x,D+329,8),this.devmin=f(x,D+337,8),x[D+475]!==0){let K=c(x,D+345,155);this.path=K+"/"+this.path}else{let K=c(x,D+345,130);K&&(this.path=K+"/"+this.path),this.atime=l(x,D+476,12),this.ctime=l(x,D+488,12)}let B=8*32;for(let K=D;K<D+148;K++)B+=x[K];for(let K=D+156;K<D+512;K++)B+=x[K];this.cksumValid=B===this.cksum,this.cksum===null&&B===8*32&&(this.nullBlock=!0)}[s](x,D){for(let U in x)x[U]!==null&&x[U]!==void 0&&!(D&&U==="path")&&(this[U]=x[U])}encode(x,D){if(x||(x=this.block=Buffer.alloc(512),D=0),D||(D=0),!(x.length>=D+512))throw new Error("need 512 bytes for header");let U=this.ctime||this.atime?130:155,V=u(this.path||"",U),B=V[0],K=V[1];this.needPax=V[2],this.needPax=M(x,D,100,B)||this.needPax,this.needPax=p(x,D+100,8,this.mode)||this.needPax,this.needPax=p(x,D+108,8,this.uid)||this.needPax,this.needPax=p(x,D+116,8,this.gid)||this.needPax,this.needPax=p(x,D+124,12,this.size)||this.needPax,this.needPax=O(x,D+136,12,this.mtime)||this.needPax,x[D+156]=this[o].charCodeAt(0),this.needPax=M(x,D+157,100,this.linkpath)||this.needPax,x.write("ustar\x0000",D+257,8),this.needPax=M(x,D+265,32,this.uname)||this.needPax,this.needPax=M(x,D+297,32,this.gname)||this.needPax,this.needPax=p(x,D+329,8,this.devmaj)||this.needPax,this.needPax=p(x,D+337,8,this.devmin)||this.needPax,this.needPax=M(x,D+345,U,K)||this.needPax,x[D+475]!==0?this.needPax=M(x,D+345,155,K)||this.needPax:(this.needPax=M(x,D+345,130,K)||this.needPax,this.needPax=O(x,D+476,12,this.atime)||this.needPax,this.needPax=O(x,D+488,12,this.ctime)||this.needPax);let Q=8*32;for(let ne=D;ne<D+148;ne++)Q+=x[ne];for(let ne=D+156;ne<D+512;ne++)Q+=x[ne];return this.cksum=Q,p(x,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(x){for(let D in x)x[D]!==null&&x[D]!==void 0&&(this[D]=x[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(x){r.code.has(x)?this[o]=r.code.get(x):this[o]=x}},u=(x,D)=>{let U=x,V="",B,K=n.parse(x).root||".";if(Buffer.byteLength(U)<100)B=[U,V,!1];else{V=n.dirname(U),U=n.basename(U);do Buffer.byteLength(U)<=100&&Buffer.byteLength(V)<=D?B=[U,V,!1]:Buffer.byteLength(U)>100&&Buffer.byteLength(V)<=D?B=[U.slice(0,100-1),V,!0]:(U=n.join(n.basename(V),U),V=n.dirname(V));while(V!==K&&!B);B||(B=[x.slice(0,100-1),"",!0])}return B},c=(x,D,U)=>x.slice(D,D+U).toString("utf8").replace(/\0.*/,""),l=(x,D,U)=>h(f(x,D,U)),h=x=>x===null?null:new Date(x*1e3),f=(x,D,U)=>x[D]&128?i.parse(x.slice(D,D+U)):y(x,D,U),d=x=>isNaN(x)?null:x,y=(x,D,U)=>d(parseInt(x.slice(D,D+U).toString("utf8").replace(/\0.*$/,"").trim(),8)),m={12:8589934591,8:2097151},p=(x,D,U,V)=>V===null?!1:V>m[U]||V<0?(i.encode(V,x.slice(D,D+U)),!0):(E(x,D,U,V),!1),E=(x,D,U,V)=>x.write(R(V,U),D,U,"ascii"),R=(x,D)=>P(Math.floor(x).toString(8),D),P=(x,D)=>(x.length===D-1?x:new Array(D-x.length-1).join("0")+x+" ")+"\0",O=(x,D,U,V)=>V===null?!1:p(x,D,U,V.getTime()/1e3),F=new Array(156).join("\0"),M=(x,D,U,V)=>V===null?!1:(x.write(V+F,D,U,"utf8"),V.length!==Buffer.byteLength(V)||V.length>U);e.exports=a}),ig=me((t,e)=>{"use strict";ee();var r=Ba(),n=_e("path"),i=class{constructor(u,c){this.atime=u.atime||null,this.charset=u.charset||null,this.comment=u.comment||null,this.ctime=u.ctime||null,this.gid=u.gid||null,this.gname=u.gname||null,this.linkpath=u.linkpath||null,this.mtime=u.mtime||null,this.path=u.path||null,this.size=u.size||null,this.uid=u.uid||null,this.uname=u.uname||null,this.dev=u.dev||null,this.ino=u.ino||null,this.nlink=u.nlink||null,this.global=c||!1}encode(){let u=this.encodeBody();if(u==="")return null;let c=Buffer.byteLength(u),l=512*Math.ceil(1+c/512),h=Buffer.allocUnsafe(l);for(let f=0;f<512;f++)h[f]=0;new r({path:("PaxHeader/"+n.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:c,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(h),h.write(u,512,c,"utf8");for(let f=c+512;f<h.length;f++)h[f]=0;return h}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(u){if(this[u]===null||this[u]===void 0)return"";let c=this[u]instanceof Date?this[u].getTime()/1e3:this[u],l=" "+(u==="dev"||u==="ino"||u==="nlink"?"SCHILY.":"")+u+"="+c+`
64
64
  `,h=Buffer.byteLength(l),f=Math.floor(Math.log(h)/Math.log(10))+1;return h+f>=Math.pow(10,f)&&(f+=1),f+h+l}};i.parse=(u,c,l)=>new i(s(o(u),c),l);var s=(u,c)=>c?Object.keys(u).reduce((l,h)=>(l[h]=u[h],l),c):u,o=u=>u.replace(/\n$/,"").split(`
65
65
  `).reduce(a,Object.create(null)),a=(u,c)=>{let l=parseInt(c,10);if(l!==Buffer.byteLength(c)+1)return u;c=c.slice((l+" ").length);let h=c.split("="),f=h.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!f)return u;let d=h.join("=");return u[f]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(f)?new Date(d*1e3):/^[0-9]+$/.test(d)?+d:d,u};e.exports=i}),Na=me((t,e)=>{ee(),e.exports=r=>{let n=r.length-1,i=-1;for(;n>-1&&r.charAt(n)==="/";)i=n,n--;return i===-1?r:r.slice(0,i)}}),sg=me((t,e)=>{"use strict";ee(),e.exports=r=>class extends r{warn(n,i,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=i instanceof Error&&i.code||n,s.tarCode=n,!this.strict&&s.recoverable!==!1?(i instanceof Error&&(s=Object.assign(i,s),i=i.message),this.emit("warn",s.tarCode,i,s)):i instanceof Error?this.emit("error",Object.assign(i,s)):this.emit("error",Object.assign(new Error(`${n}: ${i}`),s))}}}),zk=me((t,e)=>{"use strict";ee();var r=["|","<",">","?",":"],n=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),i=new Map(r.map((o,a)=>[o,n[a]])),s=new Map(n.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(i.get(u)),o),decode:o=>n.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),Vk=me((t,e)=>{ee();var{isAbsolute:r,parse:n}=_e("path").win32;e.exports=i=>{let s="",o=n(i);for(;r(i)||o.root;){let a=i.charAt(0)==="/"&&i.slice(0,4)!=="//?/"?"/":o.root;i=i.slice(a.length),s+=a,o=n(i)}return[s,i]}}),uH=me((t,e)=>{"use strict";ee(),e.exports=(r,n,i)=>(r&=4095,i&&(r=(r|384)&-19),n&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),Wk=me((t,e)=>{"use strict";ee();var r=rg(),n=ig(),i=Ba(),s=_e("fs"),o=_e("path"),a=La(),u=Na(),c=(_,v)=>v?(_=a(_).replace(/^\.(\/|$)/,""),u(v)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),y=Symbol("symlink"),m=Symbol("hardlink"),p=Symbol("header"),E=Symbol("read"),R=Symbol("lstat"),P=Symbol("onlstat"),O=Symbol("onread"),F=Symbol("onreadlink"),M=Symbol("openfile"),x=Symbol("onopenfile"),D=Symbol("close"),U=Symbol("mode"),V=Symbol("awaitDrain"),B=Symbol("ondrain"),K=Symbol("prefix"),Q=Symbol("hadError"),ne=sg(),j=zk(),I=Vk(),L=uH(),G=ne(class extends r{constructor(_,v){if(v=v||{},super(v),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!v.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=v.maxReadSize||l,this.linkCache=v.linkCache||new Map,this.statCache=v.statCache||new Map,this.preservePaths=!!v.preservePaths,this.cwd=a(v.cwd||process.cwd()),this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.mtime=v.mtime||null,this.prefix=v.prefix?a(v.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=I(this.path);S&&(this.path=H,k=S)}this.win32=!!v.win32||process.platform==="win32",this.win32&&(this.path=j.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(v.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.statCache.has(this.absolute)?this[P](this.statCache.get(this.absolute)):this[R]()}emit(_,...v){return _==="error"&&(this[Q]=!0),super.emit(_,...v)}[R](){s.lstat(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[P](v)})}[P](_){this.statCache.set(this.absolute,_),this.stat=_,_.isFile()||(_.size=0),this.type=g(_),this.emit("stat",_),this[h]()}[h](){switch(this.type){case"File":return this[f]();case"Directory":return this[d]();case"SymbolicLink":return this[y]();default:return this.end()}}[U](_){return L(_,this.type==="Directory",this.portable)}[K](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new i({path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,mode:this[U](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new n({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),super.write(this.header.block)}[d](){this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[p](),this.end()}[y](){s.readlink(this.absolute,(_,v)=>{if(_)return this.emit("error",_);this[F](v)})}[F](_){this.linkpath=a(_),this[p](),this.end()}[m](_){this.type="Link",this.linkpath=a(o.relative(this.cwd,_)),this.stat.size=0,this[p](),this.end()}[f](){if(this.stat.nlink>1){let _=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(_)){let v=this.linkCache.get(_);if(v.indexOf(this.cwd)===0)return this[m](v)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,v)=>{if(_)return this.emit("error",_);this[x](v)})}[x](_){if(this.fd=_,this[Q])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let v=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(v),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[E]()}[E](){let{fd:_,buf:v,offset:k,length:S,pos:H}=this;s.read(_,v,k,S,H,($,re)=>{if($)return this[D](()=>this.emit("error",$));this[O](re)})}[D](_){s.close(this.fd,_)}[O](_){if(_<=0&&this.remain>0){let k=new Error("encountered unexpected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_>this.remain){let k=new Error("did not encounter expected EOF");return k.path=this.absolute,k.syscall="read",k.code="EOF",this[D](()=>this.emit("error",k))}if(_===this.remain)for(let k=_;k<this.length&&_<this.blockRemain;k++)this.buf[k+this.offset]=0,_++,this.remain++;let v=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(v)?this[B]():this[V](()=>this[B]())}[V](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let v=new Error("writing more data than expected");return v.path=this.absolute,this.emit("error",v)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[B](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[D](_=>_?this.emit("error",_):this.end());this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[E]()}}),Z=class extends G{[R](){this[P](s.lstatSync(this.absolute))}[y](){this[F](s.readlinkSync(this.absolute))}[M](){this[x](s.openSync(this.absolute,"r"))}[E](){let _=!0;try{let{fd:v,buf:k,offset:S,length:H,pos:$}=this,re=s.readSync(v,k,S,H,$);this[O](re),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[V](_){_()}[D](_){s.closeSync(this.fd),_()}},q=ne(class extends r{constructor(_,v){v=v||{},super(v),this.preservePaths=!!v.preservePaths,this.portable=!!v.portable,this.strict=!!v.strict,this.noPax=!!v.noPax,this.noMtime=!!v.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=v.prefix||null,this.path=a(_.path),this.mode=this[U](_.mode),this.uid=this.portable?null:_.uid,this.gid=this.portable?null:_.gid,this.uname=this.portable?null:_.uname,this.gname=this.portable?null:_.gname,this.size=_.size,this.mtime=this.noMtime?null:v.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof v.onwarn=="function"&&this.on("warn",v.onwarn);let k=!1;if(!this.preservePaths){let[S,H]=I(this.path);S&&(this.path=H,k=S)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new i({path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),k&&this.warn("TAR_ENTRY_INFO",`stripping ${k} from absolute path`,{entry:this,path:k+this.path}),this.header.encode()&&!this.noPax&&super.write(new n({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),_.pipe(this)}[K](_){return c(_,this.prefix)}[U](_){return L(_,this.type==="Directory",this.portable)}write(_){let v=_.length;if(v>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=v,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});G.Sync=Z,G.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=G}),cH=me((t,e)=>{"use strict";ee(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let n=this.head;n;n=n.next)yield n.value}}}),Yk=me((t,e)=>{"use strict";ee(),e.exports=r,r.Node=o,r.create=r;function r(a){var u=this;if(u instanceof r||(u=new r),u.tail=null,u.head=null,u.length=0,a&&typeof a.forEach=="function")a.forEach(function(h){u.push(h)});else if(arguments.length>0)for(var c=0,l=arguments.length;c<l;c++)u.push(arguments[c]);return u}r.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var u=a.next,c=a.prev;return u&&(u.prev=c),c&&(c.next=u),a===this.head&&(this.head=u),a===this.tail&&(this.tail=c),a.list.length--,a.next=null,a.prev=null,a.list=null,u},r.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var u=this.head;a.list=this,a.next=u,u&&(u.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},r.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var u=this.tail;a.list=this,a.prev=u,u&&(u.next=a),this.tail=a,this.head||(this.head=a),this.length++}},r.prototype.push=function(){for(var a=0,u=arguments.length;a<u;a++)i(this,arguments[a]);return this.length},r.prototype.unshift=function(){for(var a=0,u=arguments.length;a<u;a++)s(this,arguments[a]);return this.length},r.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},r.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},r.prototype.forEach=function(a,u){u=u||this;for(var c=this.head,l=0;c!==null;l++)a.call(u,c.value,l,this),c=c.next},r.prototype.forEachReverse=function(a,u){u=u||this;for(var c=this.tail,l=this.length-1;c!==null;l--)a.call(u,c.value,l,this),c=c.prev},r.prototype.get=function(a){for(var u=0,c=this.head;c!==null&&u<a;u++)c=c.next;if(u===a&&c!==null)return c.value},r.prototype.getReverse=function(a){for(var u=0,c=this.tail;c!==null&&u<a;u++)c=c.prev;if(u===a&&c!==null)return c.value},r.prototype.map=function(a,u){u=u||this;for(var c=new r,l=this.head;l!==null;)c.push(a.call(u,l.value,this)),l=l.next;return c},r.prototype.mapReverse=function(a,u){u=u||this;for(var c=new r,l=this.tail;l!==null;)c.push(a.call(u,l.value,this)),l=l.prev;return c},r.prototype.reduce=function(a,u){var c,l=this.head;if(arguments.length>1)c=u;else if(this.head)l=this.head.next,c=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=0;l!==null;h++)c=a(c,l.value,h),l=l.next;return c},r.prototype.reduceReverse=function(a,u){var c,l=this.tail;if(arguments.length>1)c=u;else if(this.tail)l=this.tail.prev,c=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var h=this.length-1;l!==null;h--)c=a(c,l.value,h),l=l.prev;return c},r.prototype.toArray=function(){for(var a=new Array(this.length),u=0,c=this.head;c!==null;u++)a[u]=c.value,c=c.next;return a},r.prototype.toArrayReverse=function(){for(var a=new Array(this.length),u=0,c=this.tail;c!==null;u++)a[u]=c.value,c=c.prev;return a},r.prototype.slice=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(;h!==null&&l<u;l++,h=h.next)c.push(h.value);return c},r.prototype.sliceReverse=function(a,u){u=u||this.length,u<0&&(u+=this.length),a=a||0,a<0&&(a+=this.length);var c=new r;if(u<a||u<0)return c;a<0&&(a=0),u>this.length&&(u=this.length);for(var l=this.length,h=this.tail;h!==null&&l>u;l--)h=h.prev;for(;h!==null&&l>a;l--,h=h.prev)c.push(h.value);return c},r.prototype.splice=function(a,u,...c){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var l=0,h=this.head;h!==null&&l<a;l++)h=h.next;for(var f=[],l=0;h&&l<u;l++)f.push(h.value),h=this.removeNode(h);h===null&&(h=this.tail),h!==this.head&&h!==this.tail&&(h=h.prev);for(var l=0;l<c.length;l++)h=n(this,h,c[l]);return f},r.prototype.reverse=function(){for(var a=this.head,u=this.tail,c=a;c!==null;c=c.prev){var l=c.prev;c.prev=c.next,c.next=l}return this.head=u,this.tail=a,this};function n(a,u,c){var l=u===a.head?new o(c,null,u,a):new o(c,u,u.next,a);return l.next===null&&(a.tail=l),l.prev===null&&(a.head=l),a.length++,l}function i(a,u){a.tail=new o(u,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function s(a,u){a.head=new o(u,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,u,c,l){if(!(this instanceof o))return new o(a,u,c,l);this.list=l,this.value=a,u?(u.next=this,this.prev=u):this.prev=null,c?(c.prev=this,this.next=c):this.next=null}try{cH()(r)}catch{}}),og=me((t,e)=>{"use strict";ee();var r=class{constructor(g,_){this.path=g||"./",this.absolute=_,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},n=rg(),i=$k(),s=ng(),o=Wk(),a=o.Sync,u=o.Tar,c=Yk(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),y=Symbol("current"),m=Symbol("process"),p=Symbol("processing"),E=Symbol("processJob"),R=Symbol("jobs"),P=Symbol("jobDone"),O=Symbol("addFSEntry"),F=Symbol("addTarEntry"),M=Symbol("stat"),x=Symbol("readdir"),D=Symbol("onreaddir"),U=Symbol("pipe"),V=Symbol("entry"),B=Symbol("entryOpt"),K=Symbol("writeEntryClass"),Q=Symbol("write"),ne=Symbol("ondrain"),j=_e("fs"),I=_e("path"),L=sg(),G=La(),Z=L(class extends n{constructor(g){super(g),g=g||Object.create(null),this.opt=g,this.file=g.file||"",this.cwd=g.cwd||process.cwd(),this.maxReadSize=g.maxReadSize,this.preservePaths=!!g.preservePaths,this.strict=!!g.strict,this.noPax=!!g.noPax,this.prefix=G(g.prefix||""),this.linkCache=g.linkCache||new Map,this.statCache=g.statCache||new Map,this.readdirCache=g.readdirCache||new Map,this[K]=o,typeof g.onwarn=="function"&&this.on("warn",g.onwarn),this.portable=!!g.portable,this.zip=null,g.gzip?(typeof g.gzip!="object"&&(g.gzip={}),this.portable&&(g.gzip.portable=!0),this.zip=new i.Gzip(g.gzip),this.zip.on("data",_=>super.write(_)),this.zip.on("end",_=>super.end()),this.zip.on("drain",_=>this[ne]()),this.on("resume",_=>this.zip.resume())):this.on("drain",this[ne]),this.noDirRecurse=!!g.noDirRecurse,this.follow=!!g.follow,this.noMtime=!!g.noMtime,this.mtime=g.mtime||null,this.filter=typeof g.filter=="function"?g.filter:_=>!0,this[d]=new c,this[R]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[Q](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[m](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[F](g):this[O](g),this.flowing}[F](g){let _=G(I.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let v=new r(g.path,_,!1);v.entry=new u(g,this[B](v)),v.entry.on("end",k=>this[P](v)),this[R]+=1,this[d].push(v)}this[m]()}[O](g){let _=G(I.resolve(this.cwd,g));this[d].push(new r(g,_)),this[m]()}[M](g){g.pending=!0,this[R]+=1;let _=this.follow?"stat":"lstat";j[_](g.absolute,(v,k)=>{g.pending=!1,this[R]-=1,v?this.emit("error",v):this[h](g,k)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[m]()}[x](g){g.pending=!0,this[R]+=1,j.readdir(g.absolute,(_,v)=>{if(g.pending=!1,this[R]-=1,_)return this.emit("error",_);this[D](g,v)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[m]()}[m](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[R]<this.jobs;g=g.next)if(this[E](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[R]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[y](){return this[d]&&this[d].head&&this[d].head.value}[P](g){this[d].shift(),this[R]-=1,this[m]()}[E](g){if(!g.pending){if(g.entry){g===this[y]&&!g.piped&&this[U](g);return}if(g.stat||(this.statCache.has(g.absolute)?this[h](g,this.statCache.get(g.absolute)):this[M](g)),!!g.stat&&!g.ignore&&!(!this.noDirRecurse&&g.stat.isDirectory()&&!g.readdir&&(this.readdirCache.has(g.absolute)?this[D](g,this.readdirCache.get(g.absolute)):this[x](g),!g.readdir))){if(g.entry=this[V](g),!g.entry){g.ignore=!0;return}g===this[y]&&!g.piped&&this[U](g)}}}[B](g){return{onwarn:(_,v,k)=>this.warn(_,v,k),noPax:this.noPax,cwd:this.cwd,absolute:g.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix}}[V](g){this[R]+=1;try{return new this[K](g.path,this[B](g)).on("end",()=>this[P](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[ne](){this[y]&&this[y].entry&&this[y].entry.resume()}[U](g){g.piped=!0,g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[O](H+k)});let _=g.entry,v=this.zip;v?_.on("data",k=>{v.write(k)||_.pause()}):_.on("data",k=>{super.write(k)||_.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),q=class extends Z{constructor(g){super(g),this[K]=a}pause(){}resume(){}[M](g){let _=this.follow?"statSync":"lstatSync";this[h](g,j[_](g.absolute))}[x](g,_){this[D](g,j.readdirSync(g.absolute))}[U](g){let _=g.entry,v=this.zip;g.readdir&&g.readdir.forEach(k=>{let S=g.path,H=S==="./"?"":S.replace(/\/*$/,"/");this[O](H+k)}),v?_.on("data",k=>{v.write(k)}):_.on("data",k=>{super[Q](k)})}};Z.Sync=q,e.exports=Z}),Ma=me(t=>{"use strict";ee();var e=Uk(),r=_e("events").EventEmitter,n=_e("fs"),i=n.writev;if(!i){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;i=(v,k,S,H)=>{let $=(W,fe)=>H(W,fe,k),re=new _;re.oncomplete=$,g.writeBuffers(v,k,S,re)}}var s=Symbol("_autoClose"),o=Symbol("_close"),a=Symbol("_ended"),u=Symbol("_fd"),c=Symbol("_finished"),l=Symbol("_flags"),h=Symbol("_flush"),f=Symbol("_handleChunk"),d=Symbol("_makeBuf"),y=Symbol("_mode"),m=Symbol("_needDrain"),p=Symbol("_onerror"),E=Symbol("_onopen"),R=Symbol("_onread"),P=Symbol("_onwrite"),O=Symbol("_open"),F=Symbol("_path"),M=Symbol("_pos"),x=Symbol("_queue"),D=Symbol("_read"),U=Symbol("_readSize"),V=Symbol("_reading"),B=Symbol("_remain"),K=Symbol("_size"),Q=Symbol("_write"),ne=Symbol("_writing"),j=Symbol("_defaultFlag"),I=Symbol("_errored"),L=class extends e{constructor(g,_){if(_=_||{},super(_),this.readable=!0,this.writable=!1,typeof g!="string")throw new TypeError("path must be a string");this[I]=!1,this[u]=typeof _.fd=="number"?_.fd:null,this[F]=g,this[U]=_.readSize||16*1024*1024,this[V]=!1,this[K]=typeof _.size=="number"?_.size:1/0,this[B]=this[K],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[O]()}get fd(){return this[u]}get path(){return this[F]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[O](){n.open(this[F],"r",(g,_)=>this[E](g,_))}[E](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[U],this[B]))}[D](){if(!this[V]){this[V]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[R](null,0,g));n.read(this[u],g,0,g.length,null,(_,v,k)=>this[R](_,v,k))}}[R](g,_,v){this[V]=!1,g?this[p](g):this[f](_,v)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[V]=!0,this[o](),this.emit("error",g)}[f](g,_){let v=!1;return this[B]-=g,g>0&&(v=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[B]<=0)&&(v=!1,this[o](),super.end()),v}emit(g,_){switch(g){case"prefinish":case"finish":break;case"drain":typeof this[u]=="number"&&this[D]();break;case"error":return this[I]?void 0:(this[I]=!0,super.emit(g,_));default:return super.emit(g,_)}}},G=class extends L{[O](){let g=!0;try{this[E](null,n.openSync(this[F],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[V]){this[V]=!0;do{let _=this[d](),v=_.length===0?0:n.readSync(this[u],_,0,_.length,null);if(!this[f](v,_))break}while(!0);this[V]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}},Z=class extends r{constructor(g,_){_=_||{},super(_),this.readable=!1,this.writable=!0,this[I]=!1,this[ne]=!1,this[a]=!1,this[m]=!1,this[x]=[],this[F]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[y]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let v=this[M]!==null?"r+":"w";this[j]=_.flags===void 0,this[l]=this[j]?v:_.flags,this[u]===null&&this[O]()}emit(g,_){if(g==="error"){if(this[I])return;this[I]=!0}return super.emit(g,_)}get fd(){return this[u]}get path(){return this[F]}[p](g){this[o](),this[ne]=!0,this.emit("error",g)}[O](){n.open(this[F],this[l],this[y],(g,_)=>this[E](g,_))}[E](g,_){this[j]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[O]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[ne]&&!this[x].length&&typeof this[u]=="number"&&this[P](null,0),this}write(g,_){return typeof g=="string"&&(g=Buffer.from(g,_)),this[a]?(this.emit("error",new Error("write() after end()")),!1):this[u]===null||this[ne]||this[x].length?(this[x].push(g),this[m]=!0,!1):(this[ne]=!0,this[Q](g),!0)}[Q](g){n.write(this[u],g,0,g.length,this[M],(_,v)=>this[P](_,v))}[P](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[x].length?this[h]():(this[ne]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[m]&&(this[m]=!1,this.emit("drain"))))}[h](){if(this[x].length===0)this[a]&&this[P](null,0);else if(this[x].length===1)this[Q](this[x].pop());else{let g=this[x];this[x]=[],i(this[u],g,this[M],(_,v)=>this[P](_,v))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[O](){let g;if(this[j]&&this[l]==="r+")try{g=n.openSync(this[F],this[l],this[y])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[O]();throw _}else g=n.openSync(this[F],this[l],this[y]);this[E](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,n.closeSync(g),this.emit("close")}}[Q](g){let _=!0;try{this[P](null,n.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=G,t.WriteStream=Z,t.WriteStreamSync=q}),ag=me((t,e)=>{"use strict";ee();var r=sg(),n=Ba(),i=_e("events"),s=Yk(),o=1024*1024,a=ng(),u=ig(),c=$k(),{nextTick:l}=_e("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),y=Symbol("readEntry"),m=Symbol("nextEntry"),p=Symbol("processEntry"),E=Symbol("extendedHeader"),R=Symbol("globalExtendedHeader"),P=Symbol("meta"),O=Symbol("emitMeta"),F=Symbol("buffer"),M=Symbol("queue"),x=Symbol("ended"),D=Symbol("emittedEnd"),U=Symbol("emit"),V=Symbol("unzip"),B=Symbol("consumeChunk"),K=Symbol("consumeChunkSub"),Q=Symbol("consumeBody"),ne=Symbol("consumeMeta"),j=Symbol("consumeHeader"),I=Symbol("consuming"),L=Symbol("bufferConcat"),G=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),v=Symbol("sawNullBlock"),k=Symbol("sawEOF"),S=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends i{constructor($){$=$||{},super($),this.file=$.file||"",this[_]=null,this.on(g,re=>{(this[f]==="begin"||this[_]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),$.ondone?this.on(g,$.ondone):this.on(g,re=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!$.strict,this.maxMetaEntrySize=$.maxMetaEntrySize||o,this.filter=typeof $.filter=="function"?$.filter:H,this.writable=!0,this.readable=!1,this[M]=new s,this[F]=null,this[y]=null,this[d]=null,this[f]="begin",this[P]="",this[E]=null,this[R]=null,this[x]=!1,this[V]=null,this[q]=!1,this[v]=!1,this[k]=!1,this.on("end",()=>this[S]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[j]($,re){this[_]===null&&(this[_]=!1);let W;try{W=new n($,re,this[E],this[R])}catch(fe){return this.warn("TAR_ENTRY_INVALID",fe)}if(W.nullBlock)this[v]?(this[k]=!0,this[f]==="begin"&&(this[f]="header"),this[U]("eof")):(this[v]=!0,this[U]("nullBlock"));else if(this[v]=!1,!W.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:W});else if(!W.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:W});else{let fe=W.type;if(/^(Symbolic)?Link$/.test(fe)&&!W.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:W});else if(!/^(Symbolic)?Link$/.test(fe)&&W.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:W});else{let J=this[d]=new a(W,this[E],this[R]);if(!this[_])if(J.remain){let w=()=>{J.invalid||(this[_]=!0)};J.on("end",w)}else this[_]=!0;J.meta?J.size>this.maxMetaEntrySize?(J.ignore=!0,this[U]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[P]="",J.on("data",w=>this[P]+=w),this[f]="meta"):(this[E]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[U]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[y]?this[M].push(J):(this[M].push(J),this[m]())))}}}[S](){l(()=>this.emit("close"))}[p]($){let re=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[y]=$,this.emit("entry",$),$.emittedEnd||($.on("end",W=>this[m]()),re=!1)):(this[y]=null,re=!1),re}[m](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[y];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",re=>this.emit("drain"))}}[Q]($,re){let W=this[d],fe=W.blockRemain,J=fe>=$.length&&re===0?$:$.slice(re,re+fe);return W.write(J),W.blockRemain||(this[f]="header",this[d]=null,W.end()),J.length}[ne]($,re){let W=this[d],fe=this[Q]($,re);return this[d]||this[O](W),fe}[U]($,re,W){!this[M].length&&!this[y]?this.emit($,re,W):this[M].push([$,re,W])}[O]($){switch(this[U]("meta",this[P]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[E]=u.parse(this[P],this[E],!1);break;case"GlobalExtendedHeader":this[R]=u.parse(this[P],this[R],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[E]=this[E]||Object.create(null),this[E].path=this[P].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[E]=this[E]||Object.create(null),this[E].linkpath=this[P].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+$.type)}}abort($){this[q]=!0,this.emit("abort",$),this.warn("TAR_ABORT",$,{recoverable:!1})}write($){if(this[q])return;if(this[V]===null&&$){if(this[F]&&($=Buffer.concat([this[F],$]),this[F]=null),$.length<h.length)return this[F]=$,!0;for(let W=0;this[V]===null&&W<h.length;W++)$[W]!==h[W]&&(this[V]=!1);if(this[V]===null){let W=this[x];this[x]=!1,this[V]=new c.Unzip,this[V].on("data",J=>this[B](J)),this[V].on("error",J=>this.abort(J)),this[V].on("end",J=>{this[x]=!0,this[B]()}),this[Z]=!0;let fe=this[V][W?"end":"write"]($);return this[Z]=!1,fe}}this[Z]=!0,this[V]?this[V].write($):this[B]($),this[Z]=!1;let re=this[M].length?!1:this[y]?this[y].flowing:!0;return!re&&!this[M].length&&this[y].once("drain",W=>this.emit("drain")),re}[L]($){$&&!this[q]&&(this[F]=this[F]?Buffer.concat([this[F],$]):$)}[G](){if(this[x]&&!this[D]&&!this[q]&&!this[I]){this[D]=!0;let $=this[d];if($&&$.blockRemain){let re=this[F]?this[F].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${$.blockRemain} more bytes, only ${re} available)`,{entry:$}),this[F]&&$.write(this[F]),$.end()}this[U](g)}}[B]($){if(this[I])this[L]($);else if(!$&&!this[F])this[G]();else{if(this[I]=!0,this[F]){this[L]($);let re=this[F];this[F]=null,this[K](re)}else this[K]($);for(;this[F]&&this[F].length>=512&&!this[q]&&!this[k];){let re=this[F];this[F]=null,this[K](re)}this[I]=!1}(!this[F]||this[x])&&this[G]()}[K]($){let re=0,W=$.length;for(;re+512<=W&&!this[q]&&!this[k];)switch(this[f]){case"begin":case"header":this[j]($,re),re+=512;break;case"ignore":case"body":re+=this[Q]($,re);break;case"meta":re+=this[ne]($,re);break;default:throw new Error("invalid state: "+this[f])}re<W&&(this[F]?this[F]=Buffer.concat([$.slice(re),this[F]]):this[F]=$.slice(re))}end($){this[q]||(this[V]?this[V].end($):(this[x]=!0,this.write($)))}})}),ug=me((t,e)=>{"use strict";ee();var r=Ia(),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,y,m)=>{typeof d=="function"?(m=d,y=null,d={}):Array.isArray(d)&&(y=d,d={}),typeof y=="function"&&(m=y,y=null),y?y=Array.from(y):y=[];let p=r(d);if(p.sync&&typeof m=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof m=="function")throw new TypeError("callback only supported with file option");return y.length&&c(p,y),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,m):f(p)};var u=d=>{let y=d.onentry;d.onentry=y?m=>{y(m),m.resume()}:m=>m.resume()},c=(d,y)=>{let m=new Map(y.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let O=P||o.parse(R).root||".",F=R===O?!1:m.has(R)?m.get(R):E(o.dirname(R),O);return m.set(R,F),F};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},l=d=>{let y=f(d),m=d.file,p=!0,E;try{let R=i.statSync(m),P=d.maxReadSize||16*1024*1024;if(R.size<P)y.end(i.readFileSync(m));else{let O=0,F=Buffer.allocUnsafe(P);for(E=i.openSync(m,"r");O<R.size;){let M=i.readSync(E,F,0,P,O);O+=M,y.write(F.slice(0,M))}y.end()}p=!1}finally{if(p&&E)try{i.closeSync(E)}catch{}}},h=(d,y)=>{let m=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,O)=>{m.on("error",O),m.on("end",P),i.stat(E,(F,M)=>{if(F)O(F);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",O),x.pipe(m)}})});return y?R.then(y,y):R},f=d=>new n(d)}),lH=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=Ma(),s=ug(),o=_e("path");e.exports=(d,y,m)=>{if(typeof y=="function"&&(m=y),Array.isArray(d)&&(y=d,d={}),!y||!Array.isArray(y)||!y.length)throw new TypeError("no files or directories specified");y=Array.from(y);let p=r(d);if(p.sync&&typeof m=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof m=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,y):p.file?u(p,y,m):p.sync?h(p,y):f(p,y)};var a=(d,y)=>{let m=new n.Sync(d),p=new i.WriteStreamSync(d.file,{mode:d.mode||438});m.pipe(p),c(m,y)},u=(d,y,m)=>{let p=new n(d),E=new i.WriteStream(d.file,{mode:d.mode||438});p.pipe(E);let R=new Promise((P,O)=>{E.on("error",O),E.on("close",P),p.on("error",O)});return l(p,y),m?R.then(m,m):R},c=(d,y)=>{y.forEach(m=>{m.charAt(0)==="@"?s({file:o.resolve(d.cwd,m.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(m)}),d.end()},l=(d,y)=>{for(;y.length;){let m=y.shift();if(m.charAt(0)==="@")return s({file:o.resolve(d.cwd,m.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,y));d.add(m)}d.end()},h=(d,y)=>{let m=new n.Sync(d);return c(m,y),m},f=(d,y)=>{let m=new n(d);return l(m,y),m}}),Kk=me((t,e)=>{"use strict";ee();var r=Ia(),n=og(),i=_e("fs"),s=Ma(),o=ug(),a=_e("path"),u=Ba();e.exports=(y,m,p)=>{let E=r(y);if(!E.file)throw new TypeError("file is required");if(E.gzip)throw new TypeError("cannot append to compressed archives");if(!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");return m=Array.from(m),E.sync?c(E,m):h(E,m,p)};var c=(y,m)=>{let p=new n.Sync(y),E=!0,R,P;try{try{R=i.openSync(y.file,"r+")}catch(M){if(M.code==="ENOENT")R=i.openSync(y.file,"w+");else throw M}let O=i.fstatSync(R),F=Buffer.alloc(512);e:for(P=0;P<O.size;P+=512){for(let D=0,U=0;D<512;D+=U){if(U=i.readSync(R,F,D,F.length-D,P+D),P===0&&F[0]===31&&F[1]===139)throw new Error("cannot append to compressed archives");if(!U)break e}let M=new u(F);if(!M.cksumValid)break;let x=512*Math.ceil(M.size/512);if(P+x+512>O.size)break;P+=x,y.mtimeCache&&y.mtimeCache.set(M.path,M.mtime)}E=!1,l(y,p,P,R,m)}finally{if(E)try{i.closeSync(R)}catch{}}},l=(y,m,p,E,R)=>{let P=new s.WriteStreamSync(y.file,{fd:E,start:p});m.pipe(P),f(m,R)},h=(y,m,p)=>{m=Array.from(m);let E=new n(y),R=(O,F,M)=>{let x=(K,Q)=>{K?i.close(O,ne=>M(K)):M(null,Q)},D=0;if(F===0)return x(null,0);let U=0,V=Buffer.alloc(512),B=(K,Q)=>{if(K)return x(K);if(U+=Q,U<512&&Q)return i.read(O,V,U,V.length-U,D+U,B);if(D===0&&V[0]===31&&V[1]===139)return x(new Error("cannot append to compressed archives"));if(U<512)return x(null,D);let ne=new u(V);if(!ne.cksumValid)return x(null,D);let j=512*Math.ceil(ne.size/512);if(D+j+512>F||(D+=j+512,D>=F))return x(null,D);y.mtimeCache&&y.mtimeCache.set(ne.path,ne.mtime),U=0,i.read(O,V,0,512,D,B)};i.read(O,V,0,512,D,B)},P=new Promise((O,F)=>{E.on("error",F);let M="r+",x=(D,U)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",i.open(y.file,M,x);if(D)return F(D);i.fstat(U,(V,B)=>{if(V)return i.close(U,()=>F(V));R(U,B.size,(K,Q)=>{if(K)return F(K);let ne=new s.WriteStream(y.file,{fd:U,start:Q});E.pipe(ne),ne.on("error",F),ne.on("close",O),d(E,m)})})};i.open(y.file,M,x)});return p?P.then(p,p):P},f=(y,m)=>{m.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(y.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:E=>y.add(E)}):y.add(p)}),y.end()},d=(y,m)=>{for(;m.length;){let p=m.shift();if(p.charAt(0)==="@")return o({file:a.resolve(y.cwd,p.slice(1)),noResume:!0,onentry:E=>y.add(E)}).then(E=>d(y,m));y.add(p)}y.end()}}),hH=me((t,e)=>{"use strict";ee();var r=Ia(),n=Kk();e.exports=(s,o,a)=>{let u=r(s);if(!u.file)throw new TypeError("file is required");if(u.gzip)throw new TypeError("cannot append to compressed archives");if(!o||!Array.isArray(o)||!o.length)throw new TypeError("no files or directories specified");return o=Array.from(o),i(u),n(u,o,a)};var i=s=>{let o=s.filter;s.mtimeCache||(s.mtimeCache=new Map),s.filter=o?(a,u)=>o(a,u)&&!(s.mtimeCache.get(a)>u.mtime):(a,u)=>!(s.mtimeCache.get(a)>u.mtime)}}),fH=me((t,e)=>{ee();var{promisify:r}=_e("util"),n=_e("fs"),i=s=>{if(!s)s={mode:511,fs:n};else if(typeof s=="object")s={mode:511,fs:n,...s};else if(typeof s=="number")s={mode:s,fs:n};else if(typeof s=="string")s={mode:parseInt(s,8),fs:n};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||n.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||n.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||n.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||n.mkdirSync,s};e.exports=i}),dH=me((t,e)=>{ee();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:n,parse:i}=_e("path"),s=o=>{if(/\0/.test(o))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:o,code:"ERR_INVALID_ARG_VALUE"});if(o=n(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=i(o);if(a.test(o.substr(u.length)))throw Object.assign(new Error("Illegal characters in path."),{path:o,code:"EINVAL"})}return o};e.exports=s}),pH=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?n(s,r(o),o):void 0),i=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?i(s,r(o),o):void 0}};e.exports={findMade:n,findMadeSync:i}}),Zk=me((t,e)=>{ee();var{dirname:r}=_e("path"),n=(s,o,a)=>{o.recursive=!1;let u=r(s);return u===s?o.mkdirAsync(s,o).catch(c=>{if(c.code!=="EISDIR")throw c}):o.mkdirAsync(s,o).then(()=>a||s,c=>{if(c.code==="ENOENT")return n(u,o).then(l=>n(s,o,l));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;return o.statAsync(s).then(l=>{if(l.isDirectory())return a;throw c},()=>{throw c})})},i=(s,o,a)=>{let u=r(s);if(o.recursive=!1,u===s)try{return o.mkdirSync(s,o)}catch(c){if(c.code!=="EISDIR")throw c;return}try{return o.mkdirSync(s,o),a||s}catch(c){if(c.code==="ENOENT")return i(s,o,i(u,o,a));if(c.code!=="EEXIST"&&c.code!=="EROFS")throw c;try{if(!o.statSync(s).isDirectory())throw c}catch{throw c}}};e.exports={mkdirpManual:n,mkdirpManualSync:i}}),mH=me((t,e)=>{ee();var{dirname:r}=_e("path"),{findMade:n,findMadeSync:i}=pH(),{mkdirpManual:s,mkdirpManualSync:o}=Zk(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):n(l,c).then(h=>l.mkdirAsync(c,l).then(()=>h).catch(f=>{if(f.code==="ENOENT")return s(c,l);throw f}))),u=(c,l)=>{if(l.recursive=!0,r(c)===c)return l.mkdirSync(c,l);let h=i(l,c);try{return l.mkdirSync(c,l),h}catch(f){if(f.code==="ENOENT")return o(c,l);throw f}};e.exports={mkdirpNative:a,mkdirpNativeSync:u}}),yH=me((t,e)=>{ee();var r=_e("fs"),n=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,i=n.replace(/^v/,"").split("."),s=+i[0]>10||+i[0]==10&&+i[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),gH=me((t,e)=>{ee();var r=fH(),n=dH(),{mkdirpNative:i,mkdirpNativeSync:s}=mH(),{mkdirpManual:o,mkdirpManualSync:a}=Zk(),{useNative:u,useNativeSync:c}=yH(),l=(f,d)=>(f=n(f),d=r(d),u(d)?i(f,d):o(f,d)),h=(f,d)=>(f=n(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>i(n(f),r(d)),l.manual=(f,d)=>o(n(f),r(d)),l.nativeSync=(f,d)=>s(n(f),r(d)),l.manualSync=(f,d)=>a(n(f),r(d)),e.exports=l}),_H=me((t,e)=>{"use strict";ee();var r=_e("fs"),n=_e("path"),i=r.lchown?"lchown":"chown",s=r.lchownSync?"lchownSync":"chownSync",o=r.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),a=(P,O,F)=>{try{return r[s](P,O,F)}catch(M){if(M.code!=="ENOENT")throw M}},u=(P,O,F)=>{try{return r.chownSync(P,O,F)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(P,O,F,M)=>x=>{!x||x.code!=="EISDIR"?M(x):r.chown(P,O,F,M)}:(P,O,F,M)=>M,l=o?(P,O,F)=>{try{return a(P,O,F)}catch(M){if(M.code!=="EISDIR")throw M;u(P,O,F)}}:(P,O,F)=>a(P,O,F),h=process.version,f=(P,O,F)=>r.readdir(P,O,F),d=(P,O)=>r.readdirSync(P,O);/^v4\./.test(h)&&(f=(P,O,F)=>r.readdir(P,F));var y=(P,O,F,M)=>{r[i](P,O,F,c(P,O,F,x=>{M(x&&x.code!=="ENOENT"?x:null)}))},m=(P,O,F,M,x)=>{if(typeof O=="string")return r.lstat(n.resolve(P,O),(D,U)=>{if(D)return x(D.code!=="ENOENT"?D:null);U.name=O,m(P,U,F,M,x)});if(O.isDirectory())p(n.resolve(P,O.name),F,M,D=>{if(D)return x(D);let U=n.resolve(P,O.name);y(U,F,M,x)});else{let D=n.resolve(P,O.name);y(D,F,M,x)}},p=(P,O,F,M)=>{f(P,{withFileTypes:!0},(x,D)=>{if(x){if(x.code==="ENOENT")return M();if(x.code!=="ENOTDIR"&&x.code!=="ENOTSUP")return M(x)}if(x||!D.length)return y(P,O,F,M);let U=D.length,V=null,B=K=>{if(!V){if(K)return M(V=K);if(--U===0)return y(P,O,F,M)}};D.forEach(K=>m(P,K,O,F,B))})},E=(P,O,F,M)=>{if(typeof O=="string")try{let x=r.lstatSync(n.resolve(P,O));x.name=O,O=x}catch(x){if(x.code==="ENOENT")return;throw x}O.isDirectory()&&R(n.resolve(P,O.name),F,M),l(n.resolve(P,O.name),F,M)},R=(P,O,F)=>{let M;try{M=d(P,{withFileTypes:!0})}catch(x){if(x.code==="ENOENT")return;if(x.code==="ENOTDIR"||x.code==="ENOTSUP")return l(P,O,F);throw x}return M&&M.length&&M.forEach(x=>E(P,x,O,F)),l(P,O,F)};e.exports=p,p.sync=R}),bH=me((t,e)=>{"use strict";ee();var r=gH(),n=_e("fs"),i=_e("path"),s=_H(),o=La(),a=class extends Error{constructor(m,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=m}get name(){return"SylinkError"}},u=class extends Error{constructor(m,p){super(p+": Cannot cd into '"+m+"'"),this.path=m,this.code=p}get name(){return"CwdError"}},c=(m,p)=>m.get(o(p)),l=(m,p,E)=>m.set(o(p),E),h=(m,p)=>{n.stat(m,(E,R)=>{(E||!R.isDirectory())&&(E=new u(m,E&&E.code||"ENOTDIR")),p(E)})};e.exports=(m,p,E)=>{m=o(m);let R=p.umask,P=p.mode|448,O=(P&R)!==0,F=p.uid,M=p.gid,x=typeof F=="number"&&typeof M=="number"&&(F!==p.processUid||M!==p.processGid),D=p.preserve,U=p.unlink,V=p.cache,B=o(p.cwd),K=(ne,j)=>{ne?E(ne):(l(V,m,!0),j&&x?s(j,F,M,I=>K(I)):O?n.chmod(m,P,E):E())};if(V&&c(V,m)===!0)return K();if(m===B)return h(m,K);if(D)return r(m,{mode:P}).then(ne=>K(null,ne),K);let Q=o(i.relative(B,m)).split("/");f(B,Q,P,V,U,B,null,K)};var f=(m,p,E,R,P,O,F,M)=>{if(!p.length)return M(null,F);let x=p.shift(),D=o(i.resolve(m+"/"+x));if(c(R,D))return f(D,p,E,R,P,O,F,M);n.mkdir(D,E,d(D,p,E,R,P,O,F,M))},d=(m,p,E,R,P,O,F,M)=>x=>{x?n.lstat(m,(D,U)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(U.isDirectory())f(m,p,E,R,P,O,F,M);else if(P)n.unlink(m,V=>{if(V)return M(V);n.mkdir(m,E,d(m,p,E,R,P,O,F,M))});else{if(U.isSymbolicLink())return M(new a(m,m+"/"+p.join("/")));M(x)}}):(F=F||m,f(m,p,E,R,P,O,F,M))},y=m=>{let p=!1,E="ENOTDIR";try{p=n.statSync(m).isDirectory()}catch(R){E=R.code}finally{if(!p)throw new u(m,E)}};e.exports.sync=(m,p)=>{m=o(m);let E=p.umask,R=p.mode|448,P=(R&E)!==0,O=p.uid,F=p.gid,M=typeof O=="number"&&typeof F=="number"&&(O!==p.processUid||F!==p.processGid),x=p.preserve,D=p.unlink,U=p.cache,V=o(p.cwd),B=ne=>{l(U,m,!0),ne&&M&&s.sync(ne,O,F),P&&n.chmodSync(m,R)};if(U&&c(U,m)===!0)return B();if(m===V)return y(V),B();if(x)return B(r.sync(m,R));let K=o(i.relative(V,m)).split("/"),Q=null;for(let ne=K.shift(),j=V;ne&&(j+="/"+ne);ne=K.shift())if(j=o(i.resolve(j)),!c(U,j))try{n.mkdirSync(j,R),Q=Q||j,l(U,j,!0)}catch{let I=n.lstatSync(j);if(I.isDirectory()){l(U,j,!0);continue}else if(D){n.unlinkSync(j),n.mkdirSync(j,R),Q=Q||j,l(U,j,!0);continue}else if(I.isSymbolicLink())return new a(j,j+"/"+K.join("/"))}return B(Q)}}),Jk=me((t,e)=>{ee();var r=Object.create(null),{hasOwnProperty:n}=Object.prototype;e.exports=i=>(n.call(r,i)||(r[i]=i.normalize("NFKD")),r[i])}),vH=me((t,e)=>{ee();var r=_e("assert"),n=Jk(),i=Na(),{join:s}=_e("path"),o=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,a=o==="win32";e.exports=()=>{let u=new Map,c=new Map,l=p=>p.split("/").slice(0,-1).reduce((E,R)=>(E.length&&(R=s(E[E.length-1],R)),E.push(R||"/"),E),[]),h=new Set,f=p=>{let E=c.get(p);if(!E)throw new Error("function does not have any path reservations");return{paths:E.paths.map(R=>u.get(R)),dirs:[...E.dirs].map(R=>u.get(R))}},d=p=>{let{paths:E,dirs:R}=f(p);return E.every(P=>P[0]===p)&&R.every(P=>P[0]instanceof Set&&P[0].has(p))},y=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>m(p)),!0),m=p=>{if(!h.has(p))return!1;let{paths:E,dirs:R}=c.get(p),P=new Set;return E.forEach(O=>{let F=u.get(O);r.equal(F[0],p),F.length===1?u.delete(O):(F.shift(),typeof F[0]=="function"?P.add(F[0]):F[0].forEach(M=>P.add(M)))}),R.forEach(O=>{let F=u.get(O);r(F[0]instanceof Set),F[0].size===1&&F.length===1?u.delete(O):F[0].size===1?(F.shift(),P.add(F[0])):F[0].delete(p)}),h.delete(p),P.forEach(O=>y(O)),!0};return{check:d,reserve:(p,E)=>{p=a?["win32 parallelization disabled"]:p.map(P=>n(i(s(P))).toLowerCase());let R=new Set(p.map(P=>l(P)).reduce((P,O)=>P.concat(O)));return c.set(E,{dirs:R,paths:p}),p.forEach(P=>{let O=u.get(P);O?O.push(E):u.set(P,[E])}),R.forEach(P=>{let O=u.get(P);O?O[O.length-1]instanceof Set?O[O.length-1].add(E):O.push(new Set([E])):u.set(P,[new Set([E])])}),y(E)}}}}),EH=me((t,e)=>{ee();var r=process.env.__FAKE_PLATFORM__||process.platform,n=r==="win32",i=global.__FAKE_TESTING_FS__||_e("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=i.constants,c=n&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),Xk=me((t,e)=>{"use strict";ee();var r=_e("assert"),n=ag(),i=_e("fs"),s=Ma(),o=_e("path"),a=bH(),u=zk(),c=vH(),l=Vk(),h=La(),f=Na(),d=Jk(),y=Symbol("onEntry"),m=Symbol("checkFs"),p=Symbol("checkFs2"),E=Symbol("pruneCache"),R=Symbol("isReusable"),P=Symbol("makeFs"),O=Symbol("file"),F=Symbol("directory"),M=Symbol("link"),x=Symbol("symlink"),D=Symbol("hardlink"),U=Symbol("unsupported"),V=Symbol("checkPath"),B=Symbol("mkdir"),K=Symbol("onError"),Q=Symbol("pending"),ne=Symbol("pend"),j=Symbol("unpend"),I=Symbol("ended"),L=Symbol("maybeClose"),G=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),v=_e("crypto"),k=EH(),S=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=S==="win32",$=(b,z)=>{if(!H)return i.unlink(b,z);let te=b+".DELETE."+v.randomBytes(16).toString("hex");i.rename(b,te,ce=>{if(ce)return z(ce);i.unlink(te,z)})},re=b=>{if(!H)return i.unlinkSync(b);let z=b+".DELETE."+v.randomBytes(16).toString("hex");i.renameSync(b,z),i.unlinkSync(z)},W=(b,z,te)=>b===b>>>0?b:z===z>>>0?z:te,fe=b=>d(f(h(b))).toLowerCase(),J=(b,z)=>{z=fe(z);for(let te of b.keys()){let ce=fe(te);(ce===z||ce.indexOf(z+"/")===0)&&b.delete(te)}},w=b=>{for(let z of b.keys())b.delete(z)},N=class extends n{constructor(b){if(b||(b={}),b.ondone=z=>{this[I]=!0,this[L]()},super(b),this[_]=!1,this.reservations=c(),this.transform=typeof b.transform=="function"?b.transform:null,this.writable=!0,this.readable=!1,this[Q]=0,this[I]=!1,this.dirCache=b.dirCache||new Map,typeof b.uid=="number"||typeof b.gid=="number"){if(typeof b.uid!="number"||typeof b.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(b.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=b.uid,this.gid=b.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;b.preserveOwner===void 0&&typeof b.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!b.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=b.forceChown===!0,this.win32=!!b.win32||H,this.newer=!!b.newer,this.keep=!!b.keep,this.noMtime=!!b.noMtime,this.preservePaths=!!b.preservePaths,this.unlink=!!b.unlink,this.cwd=h(o.resolve(b.cwd||process.cwd())),this.strip=+b.strip||0,this.processUmask=b.noChmod?0:process.umask(),this.umask=typeof b.umask=="number"?b.umask:this.processUmask,this.dmode=b.dmode||511&~this.umask,this.fmode=b.fmode||438&~this.umask,this.on("entry",z=>this[y](z))}warn(b,z,te={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(te.recoverable=!1),super.warn(b,z,te)}[L](){this[I]&&this[Q]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[V](b){if(this.strip){let z=h(b.path).split("/");if(z.length<this.strip)return!1;if(b.path=z.slice(this.strip).join("/"),b.type==="Link"){let te=h(b.linkpath).split("/");if(te.length>=this.strip)b.linkpath=te.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let z=h(b.path),te=z.split("/");if(te.includes("..")||H&&/^[a-z]:\.\.$/i.test(te[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:z}),!1;let[ce,ye]=l(z);ce&&(b.path=ye,this.warn("TAR_ENTRY_INFO",`stripping ${ce} from absolute path`,{entry:b,path:z}))}if(o.isAbsolute(b.path)?b.absolute=h(o.resolve(b.path)):b.absolute=h(o.resolve(this.cwd,b.path)),!this.preservePaths&&b.absolute.indexOf(this.cwd+"/")!==0&&b.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:b,path:h(b.path),resolvedPath:b.absolute,cwd:this.cwd}),!1;if(b.absolute===this.cwd&&b.type!=="Directory"&&b.type!=="GNUDumpDir")return!1;if(this.win32){let{root:z}=o.win32.parse(b.absolute);b.absolute=z+u.encode(b.absolute.slice(z.length));let{root:te}=o.win32.parse(b.path);b.path=te+u.encode(b.path.slice(te.length))}return!0}[y](b){if(!this[V](b))return b.resume();switch(r.equal(typeof b.absolute,"string"),b.type){case"Directory":case"GNUDumpDir":b.mode&&(b.mode=b.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[m](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[U](b)}}[K](b,z){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:z}),this[j](),z.resume())}[B](b,z,te){a(h(b),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:z,noChmod:this.noChmod},te)}[Z](b){return this.forceChown||this.preserveOwner&&(typeof b.uid=="number"&&b.uid!==this.processUid||typeof b.gid=="number"&&b.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[q](b){return W(this.uid,b.uid,this.processUid)}[g](b){return W(this.gid,b.gid,this.processGid)}[O](b,z){let te=b.mode&4095||this.fmode,ce=new s.WriteStream(b.absolute,{flags:k(b.size),mode:te,autoClose:!1});ce.on("error",Se=>{ce.fd&&i.close(ce.fd,()=>{}),ce.write=()=>!0,this[K](Se,b),z()});let ye=1,Ae=Se=>{if(Se){ce.fd&&i.close(ce.fd,()=>{}),this[K](Se,b),z();return}--ye===0&&i.close(ce.fd,ze=>{ze?this[K](ze,b):this[j](),z()})};ce.on("finish",Se=>{let ze=b.absolute,rr=ce.fd;if(b.mtime&&!this.noMtime){ye++;let nr=b.atime||new Date,vo=b.mtime;i.futimes(rr,nr,vo,Eo=>Eo?i.utimes(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}if(this[Z](b)){ye++;let nr=this[q](b),vo=this[g](b);i.fchown(rr,nr,vo,Eo=>Eo?i.chown(ze,nr,vo,yh=>Ae(yh&&Eo)):Ae())}Ae()});let De=this.transform&&this.transform(b)||b;De!==b&&(De.on("error",Se=>{this[K](Se,b),z()}),b.pipe(De)),De.pipe(ce)}[F](b,z){let te=b.mode&4095||this.dmode;this[B](b.absolute,te,ce=>{if(ce){this[K](ce,b),z();return}let ye=1,Ae=De=>{--ye===0&&(z(),this[j](),b.resume())};b.mtime&&!this.noMtime&&(ye++,i.utimes(b.absolute,b.atime||new Date,b.mtime,Ae)),this[Z](b)&&(ye++,i.chown(b.absolute,this[q](b),this[g](b),Ae)),Ae()})}[U](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[x](b,z){this[M](b,b.linkpath,"symlink",z)}[D](b,z){let te=h(o.resolve(this.cwd,b.linkpath));this[M](b,te,"link",z)}[ne](){this[Q]++}[j](){this[Q]--,this[L]()}[G](b){this[j](),b.resume()}[R](b,z){return b.type==="File"&&!this.unlink&&z.isFile()&&z.nlink<=1&&!H}[m](b){this[ne]();let z=[b.path];b.linkpath&&z.push(b.linkpath),this.reservations.reserve(z,te=>this[p](b,te))}[E](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,z){this[E](b);let te=De=>{this[E](b),z(De)},ce=()=>{this[B](this.cwd,this.dmode,De=>{if(De){this[K](De,b),te();return}this[_]=!0,ye()})},ye=()=>{if(b.absolute!==this.cwd){let De=h(o.dirname(b.absolute));if(De!==this.cwd)return this[B](De,this.dmode,Se=>{if(Se){this[K](Se,b),te();return}Ae()})}Ae()},Ae=()=>{i.lstat(b.absolute,(De,Se)=>{if(Se&&(this.keep||this.newer&&Se.mtime>b.mtime)){this[G](b),te();return}if(De||this[R](b,Se))return this[P](null,b,te);if(Se.isDirectory()){if(b.type==="Directory"){let ze=!this.noChmod&&b.mode&&(Se.mode&4095)!==b.mode,rr=nr=>this[P](nr,b,te);return ze?i.chmod(b.absolute,b.mode,rr):rr()}if(b.absolute!==this.cwd)return i.rmdir(b.absolute,ze=>this[P](ze,b,te))}if(b.absolute===this.cwd)return this[P](null,b,te);$(b.absolute,ze=>this[P](ze,b,te))})};this[_]?ye():ce()}[P](b,z,te){if(b){this[K](b,z),te();return}switch(z.type){case"File":case"OldFile":case"ContiguousFile":return this[O](z,te);case"Link":return this[D](z,te);case"SymbolicLink":return this[x](z,te);case"Directory":case"GNUDumpDir":return this[F](z,te)}}[M](b,z,te,ce){i[te](z,b.absolute,ye=>{ye?this[K](ye,b):(this[j](),b.resume()),ce()})}},C=b=>{try{return[null,b()]}catch(z){return[z,null]}},X=class extends N{[P](b,z){return super[P](b,z,()=>{})}[m](b){if(this[E](b),!this[_]){let ye=this[B](this.cwd,this.dmode);if(ye)return this[K](ye,b);this[_]=!0}if(b.absolute!==this.cwd){let ye=h(o.dirname(b.absolute));if(ye!==this.cwd){let Ae=this[B](ye,this.dmode);if(Ae)return this[K](Ae,b)}}let[z,te]=C(()=>i.lstatSync(b.absolute));if(te&&(this.keep||this.newer&&te.mtime>b.mtime))return this[G](b);if(z||this[R](b,te))return this[P](null,b);if(te.isDirectory()){if(b.type==="Directory"){let Ae=!this.noChmod&&b.mode&&(te.mode&4095)!==b.mode,[De]=Ae?C(()=>{i.chmodSync(b.absolute,b.mode)}):[];return this[P](De,b)}let[ye]=C(()=>i.rmdirSync(b.absolute));this[P](ye,b)}let[ce]=b.absolute===this.cwd?[]:C(()=>re(b.absolute));this[P](ce,b)}[O](b,z){let te=b.mode&4095||this.fmode,ce=De=>{let Se;try{i.closeSync(ye)}catch(ze){Se=ze}(De||Se)&&this[K](De||Se,b),z()},ye;try{ye=i.openSync(b.absolute,k(b.size),te)}catch(De){return ce(De)}let Ae=this.transform&&this.transform(b)||b;Ae!==b&&(Ae.on("error",De=>this[K](De,b)),b.pipe(Ae)),Ae.on("data",De=>{try{i.writeSync(ye,De,0,De.length)}catch(Se){ce(Se)}}),Ae.on("end",De=>{let Se=null;if(b.mtime&&!this.noMtime){let ze=b.atime||new Date,rr=b.mtime;try{i.futimesSync(ye,ze,rr)}catch(nr){try{i.utimesSync(b.absolute,ze,rr)}catch{Se=nr}}}if(this[Z](b)){let ze=this[q](b),rr=this[g](b);try{i.fchownSync(ye,ze,rr)}catch(nr){try{i.chownSync(b.absolute,ze,rr)}catch{Se=Se||nr}}}ce(Se)})}[F](b,z){let te=b.mode&4095||this.dmode,ce=this[B](b.absolute,te);if(ce){this[K](ce,b),z();return}if(b.mtime&&!this.noMtime)try{i.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{i.chownSync(b.absolute,this[q](b),this[g](b))}catch{}z(),b.resume()}[B](b,z){try{return a.sync(h(b),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:z})}catch(te){return te}}[M](b,z,te,ce){try{i[te+"Sync"](z,b.absolute),ce(),b.resume()}catch(ye){return this[K](ye,b)}}};N.Sync=X,e.exports=N}),wH=me((t,e)=>{"use strict";ee();var r=Ia(),n=Xk(),i=_e("fs"),s=Ma(),o=_e("path"),a=Na();e.exports=(d,y,m)=>{typeof d=="function"?(m=d,y=null,d={}):Array.isArray(d)&&(y=d,d={}),typeof y=="function"&&(m=y,y=null),y?y=Array.from(y):y=[];let p=r(d);if(p.sync&&typeof m=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof m=="function")throw new TypeError("callback only supported with file option");return y.length&&u(p,y),p.file&&p.sync?c(p):p.file?l(p,m):p.sync?h(p):f(p)};var u=(d,y)=>{let m=new Map(y.map(R=>[a(R),!0])),p=d.filter,E=(R,P)=>{let O=P||o.parse(R).root||".",F=R===O?!1:m.has(R)?m.get(R):E(o.dirname(R),O);return m.set(R,F),F};d.filter=p?(R,P)=>p(R,P)&&E(a(R)):R=>E(a(R))},c=d=>{let y=new n.Sync(d),m=d.file,p=i.statSync(m),E=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(m,{readSize:E,size:p.size}).pipe(y)},l=(d,y)=>{let m=new n(d),p=d.maxReadSize||16*1024*1024,E=d.file,R=new Promise((P,O)=>{m.on("error",O),m.on("close",P),i.stat(E,(F,M)=>{if(F)O(F);else{let x=new s.ReadStream(E,{readSize:p,size:M.size});x.on("error",O),x.pipe(m)}})});return y?R.then(y,y):R},h=d=>new n.Sync(d),f=d=>new n(d)}),xH=me(t=>{"use strict";ee(),t.c=t.create=lH(),t.r=t.replace=Kk(),t.t=t.list=ug(),t.u=t.update=hH(),t.x=t.extract=wH(),t.Pack=og(),t.Unpack=Xk(),t.Parse=ag(),t.ReadEntry=ng(),t.WriteEntry=Wk(),t.Header=Ba(),t.Pax=ig(),t.types=Gk()}),SH=me((t,e)=>{ee();function r(n,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=r,r.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},r.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},r.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var i=new Date().getTime();if(n&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var s=this._timeouts.shift();if(s===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),s=this._cachedTimeouts.slice(-1);else return!1;var o=this;return this._timer=setTimeout(function(){o._attempts++,o._operationTimeoutCb&&(o._timeout=setTimeout(function(){o._operationTimeoutCb(o._attempts)},o._operationTimeout),o._options.unref&&o._timeout.unref()),o._fn(o._attempts)},s),this._options.unref&&this._timer.unref(),!0},r.prototype.attempt=function(n,i){this._fn=n,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var s=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){s._operationTimeoutCb()},s._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},r.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)},r.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)},r.prototype.start=r.prototype.try,r.prototype.errors=function(){return this._errors},r.prototype.attempts=function(){return this._attempts},r.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},i=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(n[u]||0)+1;n[u]=c,c>=s&&(i=a,s=c)}return i}}),AH=me(t=>{ee();var e=SH();t.operation=function(r){var n=t.timeouts(r);return new e(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},t.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in r)n[i]=r[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<n.retries;o++)s.push(this.createTimeout(o,n));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,n)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,n){var i=n.randomize?Math.random()+1:1,s=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return s=Math.min(s,n.maxTimeout),s},t.wrap=function(r,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var s in r)typeof r[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],u=r[a];r[a]=function(c){var l=t.operation(n),h=Array.prototype.slice.call(arguments,1),f=h.pop();h.push(function(d){l.retry(d)||(d&&(arguments[0]=l.mainError()),f.apply(this,arguments))}),l.attempt(function(){c.apply(r,h)})}.bind(r,u),r[a].options=n}}}),DH=me((t,e)=>{ee(),e.exports=AH()}),CH=me((t,e)=>{ee();var r=DH();function n(i,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(y){u(y||new Error("Aborted"))}function f(y,m){if(y.bail){h(y);return}l.retry(y)?c.onRetry&&c.onRetry(y,m):u(l.mainError())}function d(y){var m;try{m=i(h,y)}catch(p){f(p,y);return}Promise.resolve(m).then(a).catch(function(p){f(p,y)})}l.attempt(d)}return new Promise(o)}e.exports=n}),RH={};K7(RH,{bold:()=>PH,dimmed:()=>LH,error:()=>jH,grey:()=>BH,info:()=>FH,item:()=>NH,log:()=>Li,turboBlue:()=>mo,turboGradient:()=>TH,turboLoader:()=>OH,turboRed:()=>nT,underline:()=>IH,warn:()=>MH,yellow:()=>iT});ee();var tT="#0099F7",rT="#F11712",kH="#FFFF00",cg=t=>{let e=qH(t);return r=>`\x1B[38;5;${e}m${r}${(0,Dt.reset)("")}`},TH=(0,eT.default)(tT,rT),mo=cg(tT),nT=cg(rT),iT=cg(kH),OH=t=>(0,Qk.default)({text:t,spinner:{frames:[" ",mo("> "),mo(">> "),mo(">>>")]}}),FH=(...t)=>{Li(mo((0,Dt.bold)(">>>")),t.join(" "))},PH=(...t)=>{Li((0,Dt.bold)(t.join(" ")))},IH=(...t)=>{Li((0,Dt.underline)(t.join(" ")))},LH=(...t)=>{Li((0,Dt.dim)(t.join(" ")))},BH=(...t)=>{Li((0,Dt.gray)(t.join(" ")))},NH=(...t)=>{Li(mo((0,Dt.bold)(" \u2022")),t.join(" "))},Li=(...t)=>{console.log(...t)},MH=(...t)=>{console.error(iT((0,Dt.bold)(">>>")),t.join(" "))},jH=(...t)=>{console.error(nT((0,Dt.bold)(">>>")),t.join(" "))};function qH(t){let e=parseInt(t.slice(1),16),r=Math.floor(e/(256*256))%256,n=Math.floor(e/256)%256,i=e%256;return 16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)}ee();async function nh(t,e=[],r){let n={cwd:sT.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:i}=await(0,oT.default)(t,e,n);return i.trim()}catch{return}}async function aT(){let[t,e,r,n]=await Promise.all([nh("yarnpkg",["--version"],{cwd:"."}),nh("npm",["--version"]),nh("pnpm",["--version"]),nh("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:n}}ee();ee();ee();var kZ=oh(Q7());ee();ee();function UH(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}ee();ee();function Qy(t){return Qy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qy(t)}ee();function HH(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function $H(t,e){if(e&&(Qy(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HH(t)}ee();function sh(t){return sh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sh(t)}ee();ee();function Oa(t,e){return Oa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Oa(t,e)}function GH(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Oa(t,e)}ee();ee();function zH(t){return Function.toString.call(t).indexOf("[native code]")!==-1}ee();ee();function VH(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ih(t,e,r){return VH()?ih=Reflect.construct.bind():ih=function(n,i,s){var o=[null];o.push.apply(o,i);var a=Function.bind.apply(n,o),u=new a;return s&&Oa(u,s.prototype),u},ih.apply(null,arguments)}function eg(t){var e=typeof Map=="function"?new Map:void 0;return eg=function(r){if(r===null||!zH(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return ih(r,arguments,sh(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Oa(n,r)},eg(t)}var TZ=oh(sH()),PZ=function(t){GH(e,t);function e(r){var n;return UH(this,e),n=$H(this,sh(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),n.directory=r,n}return e}(eg(Error));ee();ee();ee();ee();ee();ee();var GZ=oh(xH()),zZ=(0,cT.promisify)(uT.Stream.pipeline);ee();ee();var YZ=oh(CH());ee();ee();ee();var He=class extends Error{constructor(t,e){var r;super(t),this.name="ConvertError",this.type=(r=e==null?void 0:e.type)!=null?r:"unknown",Error.captureStackTrace(this,He)}};ee();ee();ee();ee();var WH=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function Ct({workspaceRoot:t}){let e=un.default.join(t,"package.json");try{return(0,Ut.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new He(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new He(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function ah({workspaceRoot:t}){let{packageManager:e}=Ct({workspaceRoot:t});if(e)try{let r=WH.exec(e);if(r){let[n,i]=r;return i}}catch{}}function ja({workspaceRoot:t}){let e=Ct({workspaceRoot:t}),r=un.default.basename(t),{name:n=r,description:i}=e;return{name:n,description:i}}function Mk({workspaceRoot:t}){let e=un.default.join(t,"pnpm-workspace.yaml");if((0,Ut.existsSync)(e))try{let r=zh.load((0,Ut.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new He(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function uh({root:t,lockFile:e,workspaceConfig:r}){let n=s=>un.default.join(t,s),i={root:t,lockfile:n(e),packageJson:n("package.json"),nodeModules:n("node_modules")};return r&&(i.workspaceConfig=n(r)),i}function lg({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function ch({workspaceRoot:t,workspaceGlobs:e}){if(!e)return[];let r=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return e.filter(n=>!n.startsWith("!")).flatMap(n=>{let i=[`${n}/package.json`];return(0,mT.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**",...r]})}).map(n=>{let i=un.default.dirname(n),{name:s,description:o}=ja({workspaceRoot:i});return{name:s,description:o,paths:{root:i,packageJson:n,nodeModules:un.default.join(i,"node_modules")}}})}function YH({directory:t}){let e=un.default.resolve(process.cwd(),t);return{exists:(0,Ut.existsSync)(e),absolute:e}}function $n({packageManager:t,action:e,project:r}){let n=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${n?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function KH({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(n=>r.includes(n)));return t.workspaceData.globs.every(e)}function an({project:t,options:e}){e!=null&&e.dry||(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}async function yT({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,Ut.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,pT.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,Ut.writeFile)(un.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,Ut.rmSync)(t.paths.lockfile,{force:!0})}}function ZH({dependencyList:t,project:e,to:r}){let n=[];return e.workspaceData.workspaces.forEach(i=>{let{name:s}=i;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,n.push(s)}}),{dependencyList:t,updated:n}}function Un({project:t,workspace:e,to:r,logger:n,options:i}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=Ct({workspaceRoot:e.paths.root}),o={dependencies:[],devDependencies:[],peerDependencies:[],optionalDependencies:[]},a=["dependencies","devDependencies","peerDependencies","optionalDependencies"];a.forEach(h=>{let f=s[h];if(f){let{updated:d,dependencyList:y}=ZH({dependencyList:f,project:t,to:r});s[h]=y,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${dT.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${hT.default.relative(t.paths.root,e.paths.packageJson)}`;if(c.length>=1){let h="updating";c.forEach((f,d)=>{c.length===1?h+=` ${f} in ${l}`:d===c.length-1?h+=`and ${f} in ${l}`:h+=` ${f}, `}),n.workspaceStep(h)}else n.workspaceStep(`no workspace dependencies found in ${l}`);i!=null&&i.dry||fT.default.writeJSONSync(e.paths.packageJson,s,{spaces:2})}var Hn={name:"pnpm",lock:"pnpm-lock.yaml"};async function gT(t){let e=Ti.default.join(t.workspaceRoot,Hn.lock),r=Ti.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),n=ah({workspaceRoot:t.workspaceRoot});return hr.default.existsSync(e)||hr.default.existsSync(r)||n===Hn.name}async function JH(t){if(!await gT(t))throw new He("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=ja(t);return{name:e,description:r,packageManager:Hn.name,paths:uh({root:t.workspaceRoot,lockFile:Hn.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:Mk(t),workspaces:ch({workspaceGlobs:Mk(t),...t})}}}async function XH(t){let{project:e,to:r,logger:n,options:i}=t,s=e.workspaceData.globs.length>0;n.mainStep($n({action:"create",packageManager:Hn.name,project:e}));let o=Ct({workspaceRoot:e.paths.root});n.rootHeader(),o.packageManager=`${r.name}@${r.version}`,n.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),i!=null&&i.dry||(hr.default.writeJSONSync(e.paths.packageJson,o,{spaces:2}),s&&(n.rootStep('adding "pnpm-workspace.yaml"'),hr.default.writeFileSync(Ti.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
66
66
  ${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-turbo",
3
- "version": "2.5.0",
3
+ "version": "2.5.1-canary.0",
4
4
  "description": "Create a new Turborepo",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "license": "MIT",
@@ -36,10 +36,10 @@
36
36
  "typescript": "5.5.4",
37
37
  "@turbo/eslint-config": "0.0.0",
38
38
  "@turbo/telemetry": "0.0.0",
39
- "@turbo/test-utils": "0.0.0",
40
- "@turbo/tsconfig": "0.0.0",
41
39
  "@turbo/utils": "0.0.0",
42
- "@turbo/workspaces": "2.5.0"
40
+ "@turbo/tsconfig": "0.0.0",
41
+ "@turbo/workspaces": "2.5.1-canary.0",
42
+ "@turbo/test-utils": "0.0.0"
43
43
  },
44
44
  "files": [
45
45
  "dist"