create-turbo 2.0.1 → 2.0.2-canary.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cli.js +2 -2
- package/package.json +2 -2
package/dist/cli.js
CHANGED
@@ -51,9 +51,9 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);m(y)}return}
|
|
51
51
|
`,`1. Your spelling of example ${Zr.default.red(`"${e}"`)} might be incorrect.
|
52
52
|
`,"2. You might not be connected to the internet or you are behind a proxy."),process.exit(1))}let o=Ms.default.resolve(t);await ky(Ms.default.dirname(o))||(Mt("The application path is not writable, please check folder permissions and try again."),Mt("It is likely you do not have write permissions for this folder."),process.exit(1));let a=Ms.default.basename(o);try{await(0,qs.mkdir)(o,{recursive:!0})}catch(p){Mt("Unable to create project directory"),Mt(p),process.exit(1)}let{isEmpty:u,conflicts:c}=Co(o);u||(Mt(`${Zr.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);let h=ld("Downloading files...");try{!r&&n?(Nt(`
|
53
53
|
Downloading files from repo ${Zr.default.cyan(e)}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ry(o,n),{retries:3})):(Nt(`
|
54
|
-
Downloading files${r?"":` for example ${Zr.default.cyan(e)}`}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ty(o,e),{retries:3}))}catch(p){throw new js(Hq(p)?p.message:String(p))}finally{h.stop()}let f=Ms.default.join(o,"package.json"),d=(0,qs.existsSync)(f),m=[];if(d){let p;try{p=(0,qs.readJsonSync)(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Ms.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:n}}var Js=require("fs");var aR=ae(require("chalk"));var M1=ae(require("crypto")),yl=new Uint8Array(256),ml=yl.length;function Py(){return ml>yl.length-16&&(M1.default.randomFillSync(yl),ml=0),yl.slice(ml,ml+=16)}var Qe=[];for(let t=0;t<256;++t)Qe.push((t+256).toString(16).slice(1));function j1(t,e=0){return Qe[t[e+0]]+Qe[t[e+1]]+Qe[t[e+2]]+Qe[t[e+3]]+"-"+Qe[t[e+4]]+Qe[t[e+5]]+"-"+Qe[t[e+6]]+Qe[t[e+7]]+"-"+Qe[t[e+8]]+Qe[t[e+9]]+"-"+Qe[t[e+10]]+Qe[t[e+11]]+Qe[t[e+12]]+Qe[t[e+13]]+Qe[t[e+14]]+Qe[t[e+15]]}var q1=ae(require("crypto")),Iy={randomUUID:q1.default.randomUUID};function $q(t,e,r){if(Iy.randomUUID&&!e&&!t)return Iy.randomUUID();t=t||{};let i=t.random||(t.rng||Py)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(let n=0;n<16;++n)e[r+n]=i[n];return e}return j1(i)}var dn=$q;var Re;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let o of n)s[o]=o;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of s)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.push(o);return s},t.find=(n,s)=>{for(let o of n)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Re||(Re={}));var By;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(By||(By={}));var oe=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map!="undefined"&&t instanceof Map?oe.map:typeof Set!="undefined"&&t instanceof Set?oe.set:typeof Date!="undefined"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},ie=Re.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"]),zq=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},n=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(r(o));else{let a=i,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 n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Tt.create=t=>new Tt(t);var sa=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===oe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Re.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Re.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}"`:Re.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,Re.assertNever(t)}return{message:r}},$1=sa;function Gq(t){$1=t}function _l(){return $1}var bl=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],o={...n,path:s},a="",u=i.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...n,path:s,message:n.message||a}},Wq=[];function ce(t,e){let r=bl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_l(),sa].filter(i=>!!i)});t.common.issues.push(r)}var Ze=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return be;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Ze.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:o}=n;if(s.status==="aborted"||o.status==="aborted")return be;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||n.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}},be=Object.freeze({status:"aborted"}),z1=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),Ny=t=>t.status==="aborted",My=t=>t.status==="dirty",oa=t=>t.status==="valid",El=t=>typeof Promise!="undefined"&&t instanceof Promise,me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var Yt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}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}},U1=(t,e)=>{if(oa(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 Tt(t.common.issues);return this._error=r,this._error}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:i!=null?i:a.defaultError}:{message:r!=null?r:a.defaultError},description:n}}var ve=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 Oi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(El(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 i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},s=this._parseSync({data:e,path:n.path,parent:n});return U1(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={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:Oi(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(El(n)?n:Promise.resolve(n));return U1(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:ie.custom,...i(n)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Ot({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return rr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Ii.create(this,this._def)}or(e){return gn.create([this,e],this._def)}and(e){return _n.create(this,e,this._def)}transform(e){return new Ot({...Ee(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Sn({...Ee(this._def),innerType:this,defaultValue:r,typeName:ge.ZodDefault})}brand(){return new vl({typeName:ge.ZodBranded,type:this,...Ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ws({...Ee(this._def),innerType:this,catchValue:r,typeName:ge.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xn.create(this,e)}readonly(){return Ys.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vq=/^c[^\s-]{8,}$/i,Yq=/^[a-z][a-z0-9]*$/,Kq=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zq=/^[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,Jq=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ly,Qq=/^(((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}))$/,eU=/^(([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})))$/,tU=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 rU(t,e){return!!((e==="v4"||!e)&&Qq.test(t)||(e==="v6"||!e)&&eU.test(t))}var Rt=class extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.string,received:s.parsedType}),be}let i=new Ze,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?ce(n,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ce(n,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Jq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"email",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ly||(Ly=new RegExp(Xq,"u")),Ly.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"emoji",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"uuid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Vq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid2",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Kq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ulid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ce(n,{validation:"url",code:ie.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"regex",code:ie.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.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)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?tU(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?rU(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ip",code:ie.invalid_string,message:s.message}),i.dirty()):Re.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:ie.invalid_string,...me.errToObj(i)})}_addCheck(e){return new Rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.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,...me.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...me.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...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}};Rt.create=t=>{var e;return new Rt({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function iU(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),o=parseInt(e.toFixed(n).replace(".",""));return s%o/Math.pow(10,n)}var Er=class extends ve{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)!==oe.number){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.number,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="int"?Re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?iU(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_finite,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new Er({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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"&&Re.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Er.create=t=>new Er({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var vr=class extends ve{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)!==oe.bigint){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.bigint,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.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}};vr.create=t=>{var e;return new vr({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};var pn=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.boolean,received:i.parsedType}),be}return ft(e.data)}};pn.create=t=>new pn({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var Xr=class extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.date,received:s.parsedType}),be}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_date}),be}let i=new Ze,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Re.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.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}};Xr.create=t=>new Xr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Ee(t)});var Hs=class extends ve{_parse(e){if(this._getType(e)!==oe.symbol){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.symbol,received:i.parsedType}),be}return ft(e.data)}};Hs.create=t=>new Hs({typeName:ge.ZodSymbol,...Ee(t)});var mn=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.undefined,received:i.parsedType}),be}return ft(e.data)}};mn.create=t=>new mn({typeName:ge.ZodUndefined,...Ee(t)});var yn=class extends ve{_parse(e){if(this._getType(e)!==oe.null){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.null,received:i.parsedType}),be}return ft(e.data)}};yn.create=t=>new yn({typeName:ge.ZodNull,...Ee(t)});var Pi=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};Pi.create=t=>new Pi({typeName:ge.ZodAny,...Ee(t)});var Jr=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Jr.create=t=>new Jr({typeName:ge.ZodUnknown,...Ee(t)});var ir=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:oe.never,received:r.parsedType}),be}};ir.create=t=>new ir({typeName:ge.ZodNever,...Ee(t)});var $s=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.void,received:i.parsedType}),be}return ft(e.data)}};$s.create=t=>new $s({typeName:ge.ZodVoid,...Ee(t)});var kt=class extends ve{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==oe.array)return ce(r,{code:ie.invalid_type,expected:oe.array,received:r.parsedType}),be;if(n.exactLength!==null){let o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(ce(r,{code:o?ie.too_big:ie.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(ce(r,{code:ie.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(ce(r,{code:ie.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Yt(r,o,r.path,a)))).then(o=>Ze.mergeArray(i,o));let s=[...r.data].map((o,a)=>n.type._parseSync(new Yt(r,o,r.path,a)));return Ze.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new kt({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new kt({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new kt({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};kt.create=(t,e)=>new kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Ee(e)});function Us(t){if(t instanceof Ie){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=rr.create(Us(i))}return new Ie({...t._def,shape:()=>e})}else return t instanceof kt?new kt({...t._def,type:Us(t.element)}):t instanceof rr?rr.create(Us(t.unwrap())):t instanceof ei?ei.create(Us(t.unwrap())):t instanceof Kt?Kt.create(t.items.map(e=>Us(e))):t}var Ie=class extends ve{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=Re.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==oe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ie.invalid_type,expected:oe.object,received:c.parsedType}),be}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let c in n.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yt(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ir){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(c==="strict")a.length>0&&(ce(n,{code:ie.unrecognized_keys,keys:a}),i.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=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yt(n,h,n.path,l)),alwaysSet:l in n.data})}}return n.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=>Ze.mergeObjectSync(i,c)):Ze.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new Ie({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,o,a;let u=(o=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&o!==void 0?o:i.defaultError;return r.code==="unrecognized_keys"?{message:(a=me.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){let r={};return Re.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}omit(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}deepPartial(){return Us(this)}partial(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new Ie({...this._def,shape:()=>r})}required(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof rr;)s=s._def.innerType;r[i]=s}}),new Ie({...this._def,shape:()=>r})}keyof(){return G1(Re.objectKeys(this.shape))}};Ie.create=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.strictCreate=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strict",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.lazycreate=(t,e)=>new Ie({shape:t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});var gn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(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 Tt(a.ctx.common.issues));return ce(r,{code:ie.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(i.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(n);{let s,o=[];for(let u of i){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 Tt(u));return ce(r,{code:ie.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}};gn.create=(t,e)=>new gn({options:t,typeName:ge.ZodUnion,...Ee(e)});var gl=t=>t instanceof En?gl(t.schema):t instanceof Ot?gl(t.innerType()):t instanceof vn?[t.value]:t instanceof wr?t.options:t instanceof wn?Object.keys(t.enum):t instanceof Sn?gl(t._def.innerType):t instanceof mn?[void 0]:t instanceof yn?[null]:null,zs=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return ce(r,{code:ie.invalid_type,expected:oe.object,received:r.parsedType}),be;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);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}):(ce(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let o=gl(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(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new zs({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Ee(i)})}};function jy(t,e){let r=Oi(t),i=Oi(e);if(t===e)return{valid:!0,data:t};if(r===oe.object&&i===oe.object){let n=Re.objectKeys(e),s=Re.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=jy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=jy(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _n=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,o)=>{if(Ny(s)||Ny(o))return be;let a=jy(s.value,o.value);return a.valid?((My(s)||My(o))&&r.dirty(),{status:r.value,value:a.data}):(ce(i,{code:ie.invalid_intersection_types}),be)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>n(s,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};_n.create=(t,e,r)=>new _n({left:t,right:e,typeName:ge.ZodIntersection,...Ee(r)});var Kt=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return ce(i,{code:ie.invalid_type,expected:oe.array,received:i.parsedType}),be;if(i.data.length<this._def.items.length)return ce(i,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Yt(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ze.mergeArray(r,o)):Ze.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Kt({...this._def,rest:e})}};Kt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kt({items:t,typeName:ge.ZodTuple,rest:null,...Ee(e)})};var bn=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return ce(i,{code:ie.invalid_type,expected:oe.object,received:i.parsedType}),be;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:s._parse(new Yt(i,a,i.path,a)),value:o._parse(new Yt(i,i.data[a],i.path,a))});return i.common.async?Ze.mergeObjectAsync(r,n):Ze.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ve?new bn({keyType:e,valueType:r,typeName:ge.ZodRecord,...Ee(i)}):new bn({keyType:Rt.create(),valueType:e,typeName:ge.ZodRecord,...Ee(r)})}},Gs=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return ce(i,{code:ie.invalid_type,expected:oe.map,received:i.parsedType}),be;let n=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,u],c)=>({key:n._parse(new Yt(i,a,i.path,[c,"key"])),value:s._parse(new Yt(i,u,i.path,[c,"value"]))}));if(i.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 be;(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 be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};Gs.create=(t,e,r)=>new Gs({valueType:e,keyType:t,typeName:ge.ZodMap,...Ee(r)});var Qr=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return ce(i,{code:ie.invalid_type,expected:oe.set,received:i.parsedType}),be;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(ce(i,{code:ie.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(ce(i,{code:ie.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.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 be;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...i.data.values()].map((u,c)=>s._parse(new Yt(i,u,i.path,c)));return i.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new Qr({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new Qr({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Ee(e)});var Fi=class extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.function)return ce(r,{code:ie.invalid_type,expected:oe.function,received:r.parsedType}),be;function i(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function n(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].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 Ii){let a=this;return ft(async function(...u){let c=new Tt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(i(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(n(h,d)),c})})}else{let a=this;return ft(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Tt([i(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Tt([n(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Fi({...this._def,args:Kt.create(e).rest(Jr.create())})}returns(e){return new Fi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new Fi({args:e||Kt.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:ge.ZodFunction,...Ee(i)})}},En=class extends ve{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})}};En.create=(t,e)=>new En({getter:t,typeName:ge.ZodLazy,...Ee(e)});var vn=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ce(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}};vn.create=(t,e)=>new vn({value:t,typeName:ge.ZodLiteral,...Ee(e)});function G1(t,e){return new wr({values:t,typeName:ge.ZodEnum,...Ee(e)})}var wr=class extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{expected:Re.joinValues(i),received:r.parsedType,code:ie.invalid_type}),be}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{received:r.data,code:ie.invalid_enum_value,options:i}),be}return ft(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 wr.create(e)}exclude(e){return wr.create(this.options.filter(r=>!e.includes(r)))}};wr.create=G1;var wn=class extends ve{_parse(e){let r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){let n=Re.objectValues(r);return ce(i,{expected:Re.joinValues(n),received:i.parsedType,code:ie.invalid_type}),be}if(r.indexOf(e.data)===-1){let n=Re.objectValues(r);return ce(i,{received:i.data,code:ie.invalid_enum_value,options:n}),be}return ft(e.data)}get enum(){return this._def.values}};wn.create=(t,e)=>new wn({values:t,typeName:ge.ZodNativeEnum,...Ee(e)});var Ii=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.promise&&r.common.async===!1)return ce(r,{code:ie.invalid_type,expected:oe.promise,received:r.parsedType}),be;let i=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ii.create=(t,e)=>new Ii({type:t,typeName:ge.ZodPromise,...Ee(e)});var Ot=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:o=>{ce(i,o),o.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:o,path:i.path,parent:i})}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,s);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oa(o))return o;let a=n.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:i.data,path:i.path,parent:i}).then(o=>oa(o)?Promise.resolve(n.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Re.assertNever(n)}};Ot.create=(t,e,r)=>new Ot({schema:t,typeName:ge.ZodEffects,effect:e,...Ee(r)});Ot.createWithPreprocess=(t,e,r)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Ee(r)});var rr=class extends ve{_parse(e){return this._getType(e)===oe.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(t,e)=>new rr({innerType:t,typeName:ge.ZodOptional,...Ee(e)});var ei=class extends ve{_parse(e){return this._getType(e)===oe.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ei.create=(t,e)=>new ei({innerType:t,typeName:ge.ZodNullable,...Ee(e)});var Sn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});var Ws=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return El(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ws.create=(t,e)=>new Ws({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});var Vs=class extends ve{_parse(e){if(this._getType(e)!==oe.nan){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.nan,received:i.parsedType}),be}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:ge.ZodNaN,...Ee(t)});var nU=Symbol("zod_brand"),vl=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},xn=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?be:s.status==="dirty"?(r.dirty(),z1(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?be:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new xn({in:e,out:r,typeName:ge.ZodPipeline})}},Ys=class extends ve{_parse(e){let r=this._def.innerType._parse(e);return oa(r)&&(r.value=Object.freeze(r.value)),r}};Ys.create=(t,e)=>new Ys({innerType:t,typeName:ge.ZodReadonly,...Ee(e)});var W1=(t,e={},r)=>t?Pi.create().superRefine((i,n)=>{var s,o;if(!t(i)){let a=typeof e=="function"?e(i):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;n.addIssue({code:"custom",...c,fatal:u})}}):Pi.create(),sU={object:Ie.lazycreate},ge;(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"})(ge||(ge={}));var oU=(t,e={message:`Input not instance of ${t.name}`})=>W1(r=>r instanceof t,e),V1=Rt.create,Y1=Er.create,aU=Vs.create,uU=vr.create,K1=pn.create,cU=Xr.create,lU=Hs.create,hU=mn.create,fU=yn.create,dU=Pi.create,pU=Jr.create,mU=ir.create,yU=$s.create,gU=kt.create,_U=Ie.create,bU=Ie.strictCreate,EU=gn.create,vU=zs.create,wU=_n.create,SU=Kt.create,xU=bn.create,DU=Gs.create,AU=Qr.create,CU=Fi.create,RU=En.create,TU=vn.create,kU=wr.create,OU=wn.create,FU=Ii.create,H1=Ot.create,PU=rr.create,IU=ei.create,LU=Ot.createWithPreprocess,BU=xn.create,NU=()=>V1().optional(),MU=()=>Y1().optional(),jU=()=>K1().optional(),qU={string:t=>Rt.create({...t,coerce:!0}),number:t=>Er.create({...t,coerce:!0}),boolean:t=>pn.create({...t,coerce:!0}),bigint:t=>vr.create({...t,coerce:!0}),date:t=>Xr.create({...t,coerce:!0})},UU=be,Ks=Object.freeze({__proto__:null,defaultErrorMap:sa,setErrorMap:Gq,getErrorMap:_l,makeIssue:bl,EMPTY_PATH:Wq,addIssueToContext:ce,ParseStatus:Ze,INVALID:be,DIRTY:z1,OK:ft,isAborted:Ny,isDirty:My,isValid:oa,isAsync:El,get util(){return Re},get objectUtil(){return By},ZodParsedType:oe,getParsedType:Oi,ZodType:ve,ZodString:Rt,ZodNumber:Er,ZodBigInt:vr,ZodBoolean:pn,ZodDate:Xr,ZodSymbol:Hs,ZodUndefined:mn,ZodNull:yn,ZodAny:Pi,ZodUnknown:Jr,ZodNever:ir,ZodVoid:$s,ZodArray:kt,ZodObject:Ie,ZodUnion:gn,ZodDiscriminatedUnion:zs,ZodIntersection:_n,ZodTuple:Kt,ZodRecord:bn,ZodMap:Gs,ZodSet:Qr,ZodFunction:Fi,ZodLazy:En,ZodLiteral:vn,ZodEnum:wr,ZodNativeEnum:wn,ZodPromise:Ii,ZodEffects:Ot,ZodTransformer:Ot,ZodOptional:rr,ZodNullable:ei,ZodDefault:Sn,ZodCatch:Ws,ZodNaN:Vs,BRAND:nU,ZodBranded:vl,ZodPipeline:xn,ZodReadonly:Ys,custom:W1,Schema:ve,ZodSchema:ve,late:sU,get ZodFirstPartyTypeKind(){return ge},coerce:qU,any:dU,array:gU,bigint:uU,boolean:K1,date:cU,discriminatedUnion:vU,effect:H1,enum:kU,function:CU,instanceof:oU,intersection:wU,lazy:RU,literal:TU,map:DU,nan:aU,nativeEnum:OU,never:mU,null:fU,nullable:IU,number:Y1,object:_U,oboolean:jU,onumber:MU,optional:PU,ostring:NU,pipeline:BU,preprocess:LU,promise:FU,record:xU,set:AU,strictObject:bU,string:V1,symbol:lU,transformer:H1,tuple:SU,undefined:hU,union:EU,unknown:pU,void:yU,NEVER:UU,ZodIssueCode:ie,quotelessJson:zq,ZodError:Tt});var Gy=ae(require("os")),nR=ae(require("crypto")),sR=ae(require("path")),oR=ae(iR());function JU(t){let e=process.version,r=Gy.default.type(),i=Gy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${i}`}async function XU(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,oR.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return sR.default.join(t,"turborepo","telemetry.json")}function QU({input:t,salt:e}){return nR.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var Zs={buildUserAgent:JU,oneWayHashWithSalt:QU,defaultConfigPath:XU};var eH="TURBO_TELEMETRY_DEBUG",tH="TURBO_TELEMETRY_DISABLED",rH="TURBO_TELEMETRY_MESSAGE_DISABLED",iH="DO_NOT_TRACK",nH=Ks.object({telemetry_enabled:Ks.boolean(),telemetry_id:Ks.string(),telemetry_salt:Ks.string(),telemetry_alerted:Ks.string().optional()}),Et=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,Js.readFileSync)(e,"utf-8"),i=JSON.parse(r),n=Et.validateConfig(i);return new Et({configPath:e,config:n})}catch{return Et.tryRemove({configPath:e})?Et.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await Zs.defaultConfigPath();return Et.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return nH.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=dn(),i=dn(),n=Zs.oneWayHashWithSalt({input:r,salt:i}),s=new Et({configPath:e,config:{telemetry_enabled:!0,telemetry_id:n,telemetry_salt:i}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,Js.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,Js.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[iH]||"0",r=process.env[tH]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[rH]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(ue.log(),ue.bold("Attention:"),ue.grey("Turborepo now collects completely anonymous telemetry regarding usage."),ue.grey("This information is used to shape the Turborepo roadmap and prioritize features."),ue.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:"),ue.underline(aR.default.grey("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 Zs.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[eH]||"0";return e==="1"||e.toLowerCase()==="true"}};var uR=ae(Sy());var sH=20,oH="/api/turborepo/v1/events",Dn=class{constructor({api:e,packageInfo:r,config:i,opts:n}){this.batchSize=sH;this.timeout=250;this.sessionId=dn();this.eventBatches=[];this.events=[];let s=new URL(oH,e);this.api=s.toString(),this.packageInfo=r,this.config=i,n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.batchSize&&(this.batchSize=n.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(uR.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":Zs.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:i,isSensitive:n}){let s={id:dn(),key:e,value:n?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:i};return Et.isDebug()&&(ue.log(),ue.bold("[telemetry event]"),ue.dimmed(JSON.stringify(s,null,2)),ue.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 aa=class extends Dn{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 dR=ae(fR());var uH=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ua=class extends Dn{trackCI(){var e;return this.track({key:"ci",value:(e=dR.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:uH.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 cH={"create-turbo":aa,"turbo-ignore":ua},lH="https://telemetry.vercel.com";async function Wy({packageInfo:t,opts:e}){let r=cH[t.name],i=await Et.fromDefaultConfig();return i?(i.showAlert(),{telemetry:new r({api:lH,packageInfo:t,config:i,opts:e})}):{telemetry:void 0}}var ca=ae(require("chalk"));var pR=require("commander"),mR="status",hH=["enable","disable",mR];function fH(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();ue.log(`Status: ${e?ca.default.bold(ca.default.green("Enabled")):ca.default.bold(ca.default.red("Disabled"))}`),ue.log(),e?ue.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):ue.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),ue.log("Learn more: https://turbo.build/repo/docs/telemetry")}function dH(t,e){if(!e.telemetry){ue.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),ue.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),ue.bold("Success!")),ue.log(),fH(e)}function Vy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new pR.Argument("[action]","Action to perform").choices(hH).default(mR)).action(dH)}var FT=require("proxy-agent");var An={name:"create-turbo",version:"2.0.1",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/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:{chalk:"4.1.2",commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0","proxy-agent":"^6.2.2",rimraf:"^3.0.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@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/jest":"^27.4.0","@types/node":"^18.17.2","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]};var yR=ae(require("chalk")),gR=ae(require("update-check"));var mH=(0,gR.default)(An).catch(()=>null);async function Yy(){try{let t=await mH;t!=null&&t.latest&&(ue.log(),ue.log(yR.default.yellow.bold("A new version of `create-turbo` is available!")),ue.log()),process.exit()}catch{}}var ba=ae(require("path")),et=ae(require("chalk"));var Ni=ae(require("chalk"),1),PR=ae(vu(),1),IR=ae(xu(),1),jR=ae(require("os"),1),qR=ae(is(),1),zW=require("fs-extra");var KW=ae(ou(),1),JW=require("fs-extra"),QW=require("fs-extra"),tV=require("chalk"),HR=require("stream"),$R=require("util"),sV=require("fs-extra"),cV=require("chalk"),hV=require("fs-extra"),Cn=ae(require("path"),1),dt=require("fs-extra"),zR=ae(is(),1),GR=ae(require("path"),1),WR=require("fs-extra"),VR=ae(require("chalk"),1),ri=ae(require("path"),1),YR=ae(is(),1),It=require("fs-extra"),KR=ae(ou(),1);var ha=ae(require("path"),1),xr=require("fs-extra"),ro=ae(require("path"),1),Dr=require("fs-extra"),fa=ae(require("path"),1),Ar=require("fs-extra"),Pt=ae(require("chalk"),1),tT=ae(xu(),1),rT=ae(is(),1),iT=ae(vu(),1),nT=require("semver"),sT=ae(require("chalk"),1),yH=Object.create,Jy=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,_H=Object.getOwnPropertyNames,bH=Object.getPrototypeOf,EH=Object.prototype.hasOwnProperty,ye=(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')}),vH=(t,e)=>()=>(t&&(e=t(t=0)),e),de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wH=(t,e)=>{for(var r in e)Jy(t,r,{get:e[r],enumerable:!0})},SH=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _H(e))!EH.call(t,n)&&n!==r&&Jy(t,n,{get:()=>e[n],enumerable:!(i=gH(e,n))||i.enumerable});return t},Al=(t,e,r)=>(r=t!=null?yH(bH(t)):{},SH(e||!t||!t.__esModule?Jy(r,"default",{value:t,enumerable:!0}):r,t)),Q=vH(()=>{}),xH=de((t,e)=>{Q();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),DH=de((t,e)=>{Q();var r=xH().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,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 m(q,g,_,E){var R=g&&g.prototype instanceof F?g:F,x=Object.create(R.prototype),H=new z(E||[]);return u(x,"_invoke",{value:ne(q,_,H)}),x}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(E){return{type:"throw",arg:E}}}s.wrap=m;var p="suspendedStart",v="suspendedYield",C="executing",k="completed",P={};function F(){}function M(){}function S(){}var D={};d(D,l,function(){return this});var j=Object.getPrototypeOf,W=j&&j(j(Z([])));W&&W!==o&&a.call(W,l)&&(D=W);var N=S.prototype=F.prototype=Object.create(D);function K(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function te(q,g){function _(R,x,H,$){var re=y(q[R],q,x);if(re.type!=="throw"){var V=re.arg,he=V.value;return he&&r(he)=="object"&&a.call(he,"__await")?g.resolve(he.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(he).then(function(J){V.value=J,H(V)},function(J){return _("throw",J,H,$)})}$(re.arg)}var E;u(this,"_invoke",{value:function(R,x){function H(){return new g(function($,re){_(R,x,$,re)})}return E=E?E.then(H,H):H()}})}function ne(q,g,_){var E=p;return function(R,x){if(E===C)throw new Error("Generator is already running");if(E===k){if(R==="throw")throw x;return{value:n,done:!0}}for(_.method=R,_.arg=x;;){var H=_.delegate;if(H){var $=U(H,_);if($){if($===P)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(E===p)throw E=k,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);E=C;var re=y(q,g,_);if(re.type==="normal"){if(E=_.done?k:v,re.arg===P)continue;return{value:re.arg,done:_.done}}re.type==="throw"&&(E=k,_.method="throw",_.arg=re.arg)}}}function U(q,g){var _=g.method,E=q.iterator[_];if(E===n)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=n,U(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),P;var R=y(E,q.iterator,g.arg);if(R.type==="throw")return g.method="throw",g.arg=R.arg,g.delegate=null,P;var x=R.arg;return x?x.done?(g[q.resultName]=x.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=n),g.delegate=null,P):x:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,P)}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 z(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,E=function R(){for(;++_<q.length;)if(a.call(q,_))return R.value=q[_],R.done=!1,R;return R.value=n,R.done=!0,R};return E.next=E}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=S,u(N,"constructor",{value:S,configurable:!0}),u(S,"constructor",{value:M,configurable:!0}),M.displayName=d(S,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,S):(q.__proto__=S,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},K(te.prototype),d(te.prototype,h,function(){return this}),s.AsyncIterator=te,s.async=function(q,g,_,E,R){R===void 0&&(R=Promise);var x=new te(m(q,g,_,E),R);return s.isGeneratorFunction(g)?x:x.next().then(function(H){return H.done?H.value:x.next()})},K(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var E in g)_.push(E);return _.reverse(),function R(){for(;_.length;){var x=_.pop();if(x in g)return R.value=x,R.done=!1,R}return R.done=!0,R}},s.values=Z,z.prototype={constructor:z,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=n)},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,V){return x.type="throw",x.arg=q,g.next=re,V&&(g.method="next",g.arg=n),!!V}for(var E=this.tryEntries.length-1;E>=0;--E){var R=this.tryEntries[E],x=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var H=a.call(R,"catchLoc"),$=a.call(R,"finallyLoc");if(H&&$){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(H){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc<=this.prev&&a.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var R=E;break}}R&&(q==="break"||q==="continue")&&R.tryLoc<=g&&g<=R.finallyLoc&&(R=null);var x=R?R.completion:{};return x.type=q,x.arg=g,R?(this.method="next",this.next=R.finallyLoc,P):this.complete(x)},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),P},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(_),P}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var E=_.completion;if(E.type==="throw"){var R=E.arg;L(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=n),P}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),AH=de((t,e)=>{Q();var r=DH()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),CH=de((t,e)=>{"use strict";Q();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),RH=de((t,e)=>{"use strict";Q();var r=CH(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>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 m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<n?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=i,e.exports.default=i}),TH=de((t,e)=>{"use strict";Q();var r=RH(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(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(n,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof i)return d.value;throw d}};e.exports=o,e.exports.default=o}),kH=de((t,e)=>{"use strict";Q();var r=ye("path"),i=ye("fs"),{promisify:n}=ye("util"),s=TH(),o=n(i.stat),a=n(i.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 m=>{try{let y=await d(r.resolve(f.cwd,m));return l(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?i.statSync:i.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),OH=de((t,e)=>{"use strict";Q();var r=ye("fs"),{promisify:i}=ye("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),FH=de((t,e)=>{"use strict";Q();var r=ye("path"),i=kH(),n=OH(),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 i(l,f);let d=await o(f.cwd);return typeof d=="string"?i([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 i.sync(l,f);let d=o(f.cwd);return typeof d=="string"?i.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=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),da=de((t,e)=>{"use strict";Q();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=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Xy=de((t,e)=>{"use strict";Q();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("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"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),k=Symbol("resume"),P=Symbol("buffer"),F=Symbol("pipes"),M=Symbol("bufferLength"),S=Symbol("bufferPush"),D=Symbol("bufferShift"),j=Symbol("objectMode"),W=Symbol("destroyed"),N=Symbol("emitData"),K=Symbol("emitEnd"),te=Symbol("emitEnd2"),ne=Symbol("async"),U=R=>Promise.resolve().then(R),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),z=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=R=>R==="end"||R==="finish"||R==="prefinish",q=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,g=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),_=class{constructor(R,x,H){this.src=R,this.dest=x,this.opts=H,this.ondrain=()=>R[k](),x.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},E=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,x,H){super(R,x,H),this.proxyErrors=$=>x.emit("error",$),R.on("error",this.proxyErrors)}};e.exports=class ER extends n{constructor(x){super(),this[v]=!1,this[C]=!1,this[F]=[],this[P]=[],this[j]=x&&x.objectMode||!1,this[j]?this[y]=null:this[y]=x&&x.encoding||null,this[y]==="buffer"&&(this[y]=null),this[ne]=x&&!!x.async||!1,this[p]=this[y]?new s(this[y]):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[W]=!1,x&&x.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[P]}),x&&x.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(x){if(this[j])throw new Error("cannot set encoding in objectMode");if(this[y]&&x!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==x&&(this[p]=x?new s(x):null,this[P].length&&(this[P]=this[P].map(H=>this[p].write(H)))),this[y]=x}setEncoding(x){this.encoding=x}get objectMode(){return this[j]}set objectMode(x){this[j]=this[j]||!!x}get async(){return this[ne]}set async(x){this[ne]=this[ne]||!!x}write(x,H,$){if(this[o])throw new Error("write after end");if(this[W])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]?U:V=>V();return!this[j]&&!Buffer.isBuffer(x)&&(g(x)?x=Buffer.from(x.buffer,x.byteOffset,x.byteLength):q(x)?x=Buffer.from(x):typeof x!="string"&&(this.objectMode=!0)),this[j]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):x.length?(typeof x=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(x=Buffer.from(x,H)),Buffer.isBuffer(x)&&this[y]&&(x=this[p].write(x)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&re($),this.flowing)}read(x){if(this[W])return null;if(this[M]===0||x===0||x>this[M])return this[a](),null;this[j]&&(x=null),this[P].length>1&&!this[j]&&(this.encoding?this[P]=[this[P].join("")]:this[P]=[Buffer.concat(this[P],this[M])]);let H=this[f](x||null,this[P][0]);return this[a](),H}[f](x,H){return x===H.length||x===null?this[D]():(this[P][0]=H.slice(x),H=H.slice(0,x),this[M]-=x),this.emit("data",H),!this[P].length&&!this[o]&&this.emit("drain"),H}end(x,H,$){return typeof x=="function"&&($=x,x=null),typeof H=="function"&&($=H,H="utf8"),x&&this.write(x,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[k](){this[W]||(this[C]=!1,this[v]=!0,this.emit("resume"),this[P].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[k]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[W]}get flowing(){return this[v]}get paused(){return this[C]}[S](x){this[j]?this[M]+=1:this[M]+=x.length,this[P].push(x)}[D](){return this[P].length&&(this[j]?this[M]-=1:this[M]-=this[P][0].length),this[P].shift()}[d](x){do;while(this[m](this[D]()));!x&&!this[P].length&&!this[o]&&this.emit("drain")}[m](x){return x?(this.emit("data",x),this.flowing):!1}pipe(x,H){if(this[W])return;let $=this[u];return H=H||{},x===r.stdout||x===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&x.end():(this[F].push(H.proxyErrors?new E(this,x,H):new _(this,x,H)),this[ne]?U(()=>this[k]()):this[k]()),x}unpipe(x){let H=this[F].find($=>$.dest===x);H&&(this[F].splice(this[F].indexOf(H),1),H.unpipe())}addListener(x,H){return this.on(x,H)}on(x,H){let $=super.on(x,H);return x==="data"&&!this[F].length&&!this.flowing?this[k]():x==="readable"&&this[M]!==0?super.emit("readable"):Z(x)&&this[u]?(super.emit(x),this.removeAllListeners(x)):x==="error"&&this[l]&&(this[ne]?U(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[W]&&this[P].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(x,H,...$){if(x!=="error"&&x!=="close"&&x!==W&&this[W])return;if(x==="data")return H?this[ne]?U(()=>this[N](H)):this[N](H):!1;if(x==="end")return this[K]();if(x==="close"){if(this[h]=!0,!this[u]&&!this[W])return;let V=super.emit("close");return this.removeAllListeners("close"),V}else if(x==="error"){this[l]=H;let V=super.emit("error",H);return this[a](),V}else if(x==="resume"){let V=super.emit("resume");return this[a](),V}else if(x==="finish"||x==="prefinish"){let V=super.emit(x);return this.removeAllListeners(x),V}let re=super.emit(x,H,...$);return this[a](),re}[N](x){for(let $ of this[F])$.dest.write(x)===!1&&this.pause();let H=super.emit("data",x);return this[a](),H}[K](){this[u]||(this[u]=!0,this.readable=!1,this[ne]?U(()=>this[te]()):this[te]())}[te](){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 x=super.emit("end");return this.removeAllListeners("end"),x}collect(){let x=[];this[j]||(x.dataLength=0);let H=this.promise();return this.on("data",$=>{x.push($),this[j]||(x.dataLength+=$.length)}),H.then(()=>x)}concat(){return this[j]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(x=>this[j]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?x.join(""):Buffer.concat(x,x.dataLength))}promise(){return new Promise((x,H)=>{this.on(W,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>x())})}[L](){return{next:()=>{let x=this.read();if(x!==null)return Promise.resolve({done:!1,value:x});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,re=w=>{this.removeListener("data",V),this.removeListener("end",he),$(w)},V=w=>{this.removeListener("error",re),this.removeListener("end",he),this.pause(),H({value:w,done:!!this[o]})},he=()=>{this.removeListener("error",re),this.removeListener("data",V),H({done:!0})},J=()=>re(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(W,J),this.once("error",re),this.once("end",he),this.once("data",V)})}}}[z](){return{next:()=>{let x=this.read();return{value:x,done:x===null}}}}destroy(x){return this[W]?(x?this.emit("error",x):this.emit(W),this):(this[W]=!0,this[P].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),x?this.emit("error",x):this.emit(W),this)}static isStream(x){return!!x&&(x instanceof ER||x instanceof n||x instanceof i&&(typeof x.pipe=="function"||typeof x.write=="function"&&typeof x.end=="function"))}}}),PH=de((t,e)=>{Q();var r=ye("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))}),vR=de((t,e)=>{"use strict";Q();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("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"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),k=Symbol("resume"),P=Symbol("bufferLength"),F=Symbol("bufferPush"),M=Symbol("bufferShift"),S=Symbol("objectMode"),D=Symbol("destroyed"),j=Symbol("emitData"),W=Symbol("emitEnd"),N=Symbol("emitEnd2"),K=Symbol("async"),te=_=>Promise.resolve().then(_),ne=global._MP_NO_ITERATOR_SYMBOLS_!=="1",U=ne&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=ne&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",z=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,E,R){this.src=_,this.dest=E,this.opts=R,this.ondrain=()=>_[k](),E.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(_,E,R){super(_,E,R),this.proxyErrors=x=>E.emit("error",x),_.on("error",this.proxyErrors)}};e.exports=class wR extends n{constructor(E){super(),this[v]=!1,this[C]=!1,this.pipes=[],this.buffer=[],this[S]=E&&E.objectMode||!1,this[S]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[K]=E&&!!E.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[P]=0,this[D]=!1}get bufferLength(){return this[P]}get encoding(){return this[y]}set encoding(E){if(this[S])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[p]&&this[p].lastNeed||this[P]))throw new Error("cannot change encoding");this[y]!==E&&(this[p]=E?new s(E):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[p].write(R)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[S]}set objectMode(E){this[S]=this[S]||!!E}get async(){return this[K]}set async(E){this[K]=this[K]||!!E}write(E,R,x){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 R=="function"&&(x=R,R="utf8"),R||(R="utf8");let H=this[K]?te:$=>$();return!this[S]&&!Buffer.isBuffer(E)&&(Z(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):z(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[S]?(this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[F](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):E.length?(typeof E=="string"&&!(R===this[y]&&!this[p].lastNeed)&&(E=Buffer.from(E,R)),Buffer.isBuffer(E)&&this[y]&&(E=this[p].write(E)),this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[F](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):(this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing)}read(E){if(this[D])return null;if(this[P]===0||E===0||E>this[P])return this[a](),null;this[S]&&(E=null),this.buffer.length>1&&!this[S]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[P])]);let R=this[f](E||null,this.buffer[0]);return this[a](),R}[f](E,R){return E===R.length||E===null?this[M]():(this.buffer[0]=R.slice(E),R=R.slice(0,E),this[P]-=E),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(E,R,x){return typeof E=="function"&&(x=E,E=null),typeof R=="function"&&(x=R,R="utf8"),E&&this.write(E,R),x&&this.once("end",x),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[k](){this[D]||(this[C]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[k]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[C]}[F](E){this[S]?this[P]+=1:this[P]+=E.length,this.buffer.push(E)}[M](){return this.buffer.length&&(this[S]?this[P]-=1:this[P]-=this.buffer[0].length),this.buffer.shift()}[d](E){do;while(this[m](this[M]()));!E&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,R){if(this[D])return;let x=this[u];return R=R||{},E===r.stdout||E===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,x?R.end&&E.end():(this.pipes.push(R.proxyErrors?new g(this,E,R):new q(this,E,R)),this[K]?te(()=>this[k]()):this[k]()),E}unpipe(E){let R=this.pipes.find(x=>x.dest===E);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(E,R){return this.on(E,R)}on(E,R){let x=super.on(E,R);return E==="data"&&!this.pipes.length&&!this.flowing?this[k]():E==="readable"&&this[P]!==0?super.emit("readable"):L(E)&&this[u]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[l]&&(this[K]?te(()=>R.call(this,this[l])):R.call(this,this[l])),x}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(E,R,...x){if(E!=="error"&&E!=="close"&&E!==D&&this[D])return;if(E==="data")return R?this[K]?te(()=>this[j](R)):this[j](R):!1;if(E==="end")return this[W]();if(E==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(E==="error"){this[l]=R;let $=super.emit("error",R);return this[a](),$}else if(E==="resume"){let $=super.emit("resume");return this[a](),$}else if(E==="finish"||E==="prefinish"){let $=super.emit(E);return this.removeAllListeners(E),$}let H=super.emit(E,R,...x);return this[a](),H}[j](E){for(let x of this.pipes)x.dest.write(E)===!1&&this.pause();let R=super.emit("data",E);return this[a](),R}[W](){this[u]||(this[u]=!0,this.readable=!1,this[K]?te(()=>this[N]()):this[N]())}[N](){if(this[p]){let R=this[p].end();if(R){for(let x of this.pipes)x.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[S]||(E.dataLength=0);let R=this.promise();return this.on("data",x=>{E.push(x),this[S]||(E.dataLength+=x.length)}),R.then(()=>E)}concat(){return this[S]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[S]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,R)=>{this.on(D,()=>R(new Error("stream destroyed"))),this.on("error",x=>R(x)),this.on("end",()=>E())})}[U](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let R=null,x=null,H=he=>{this.removeListener("data",$),this.removeListener("end",re),x(he)},$=he=>{this.removeListener("error",H),this.removeListener("end",re),this.pause(),R({value:he,done:!!this[o]})},re=()=>{this.removeListener("error",H),this.removeListener("data",$),R({done:!0})},V=()=>H(new Error("stream destroyed"));return new Promise((he,J)=>{x=J,R=he,this.once(D,V),this.once("error",H),this.once("end",re),this.once("data",$)})}}}[I](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[D]?(E?this.emit("error",E):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[P]=0,typeof this.close=="function"&&!this[h]&&this.close(),E?this.emit("error",E):this.emit(D),this)}static isStream(E){return!!E&&(E instanceof wR||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),SR=de(t=>{"use strict";Q();var e=ye("assert"),r=ye("buffer").Buffer,i=ye("zlib"),n=t.constants=PH(),s=vR(),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"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),v=Symbol("strategy"),C=Symbol("ended"),k=Symbol("_defaultFullFlush"),P=class extends s{constructor(L,z){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[C]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new i[z](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])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,z,Z){return L&&this.write(L,z),this.flush(this[h]),this[C]=!0,super.end(null,null,Z)}get ended(){return this[C]}write(L,z,Z){if(typeof z=="function"&&(Z=z,z="utf8"),typeof L=="string"&&(L=r.from(L,z)),this[y])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=x=>x;let E;try{let x=typeof L[l]=="number"?L[l]:this[l];E=this[d]._processChunk(L,x),r.concat=o}catch(x){r.concat=o,this[m](new u(x))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",x=>this[m](new u(x)));let R;if(E)if(Array.isArray(E)&&E.length>0){R=this[a](r.from(E[0]));for(let x=1;x<E.length;x++)R=this[a](E[x])}else R=this[a](r.from(E));return Z&&Z(),R}[a](L){return super.write(L)}},F=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,z),this[f]=n.Z_FULL_FLUSH,this[p]=L.level,this[v]=L.strategy}params(L,z){if(!this[y]){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[v]!==z){this.flush(n.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,z)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[v]=z)}}}},M=class extends F{constructor(L){super(L,"Deflate")}},S=class extends F{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),j=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)}},W=class extends F{constructor(L){super(L,"Gunzip")}},N=class extends F{constructor(L){super(L,"DeflateRaw")}},K=class extends F{constructor(L){super(L,"InflateRaw")}},te=class extends F{constructor(L){super(L,"Unzip")}},ne=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,z),this[f]=n.BROTLI_OPERATION_FLUSH}},U=class extends ne{constructor(L){super(L,"BrotliCompress")}},I=class extends ne{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=S,t.Gzip=j,t.Gunzip=W,t.DeflateRaw=N,t.InflateRaw=K,t.Unzip=te,typeof i.BrotliCompress=="function"?(t.BrotliCompress=U,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),pa=de((t,e)=>{Q();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Qy=de((t,e)=>{"use strict";Q();var r=Xy(),i=pa(),n=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=i(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=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](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))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),xR=de(t=>{"use strict";Q(),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]]))}),IH=de((t,e)=>{"use strict";Q();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?n(l,h):i(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},i=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},n=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},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,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*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}}),ma=de((t,e)=>{"use strict";Q();var r=xR(),i=ye("path").posix,n=IH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(S,D,j,W){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(S)?this.decode(S,D||0,j,W):S&&this.set(S)}decode(S,D,j,W){if(D||(D=0),!S||!(S.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(S,D,100),this.mode=f(S,D+100,8),this.uid=f(S,D+108,8),this.gid=f(S,D+116,8),this.size=f(S,D+124,12),this.mtime=l(S,D+136,12),this.cksum=f(S,D+148,12),this[s](j),this[s](W,!0),this[o]=c(S,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(S,D+157,100),S.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(S,D+265,32),this.gname=c(S,D+297,32),this.devmaj=f(S,D+329,8),this.devmin=f(S,D+337,8),S[D+475]!==0){let K=c(S,D+345,155);this.path=K+"/"+this.path}else{let K=c(S,D+345,130);K&&(this.path=K+"/"+this.path),this.atime=l(S,D+476,12),this.ctime=l(S,D+488,12)}let N=8*32;for(let K=D;K<D+148;K++)N+=S[K];for(let K=D+156;K<D+512;K++)N+=S[K];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](S,D){for(let j in S)S[j]!==null&&S[j]!==void 0&&!(D&&j==="path")&&(this[j]=S[j])}encode(S,D){if(S||(S=this.block=Buffer.alloc(512),D=0),D||(D=0),!(S.length>=D+512))throw new Error("need 512 bytes for header");let j=this.ctime||this.atime?130:155,W=u(this.path||"",j),N=W[0],K=W[1];this.needPax=W[2],this.needPax=M(S,D,100,N)||this.needPax,this.needPax=p(S,D+100,8,this.mode)||this.needPax,this.needPax=p(S,D+108,8,this.uid)||this.needPax,this.needPax=p(S,D+116,8,this.gid)||this.needPax,this.needPax=p(S,D+124,12,this.size)||this.needPax,this.needPax=P(S,D+136,12,this.mtime)||this.needPax,S[D+156]=this[o].charCodeAt(0),this.needPax=M(S,D+157,100,this.linkpath)||this.needPax,S.write("ustar\x0000",D+257,8),this.needPax=M(S,D+265,32,this.uname)||this.needPax,this.needPax=M(S,D+297,32,this.gname)||this.needPax,this.needPax=p(S,D+329,8,this.devmaj)||this.needPax,this.needPax=p(S,D+337,8,this.devmin)||this.needPax,this.needPax=M(S,D+345,j,K)||this.needPax,S[D+475]!==0?this.needPax=M(S,D+345,155,K)||this.needPax:(this.needPax=M(S,D+345,130,K)||this.needPax,this.needPax=P(S,D+476,12,this.atime)||this.needPax,this.needPax=P(S,D+488,12,this.ctime)||this.needPax);let te=8*32;for(let ne=D;ne<D+148;ne++)te+=S[ne];for(let ne=D+156;ne<D+512;ne++)te+=S[ne];return this.cksum=te,p(S,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(S){for(let D in S)S[D]!==null&&S[D]!==void 0&&(this[D]=S[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(S){r.code.has(S)?this[o]=r.code.get(S):this[o]=S}},u=(S,D)=>{let j=S,W="",N,K=i.parse(S).root||".";if(Buffer.byteLength(j)<100)N=[j,W,!1];else{W=i.dirname(j),j=i.basename(j);do Buffer.byteLength(j)<=100&&Buffer.byteLength(W)<=D?N=[j,W,!1]:Buffer.byteLength(j)>100&&Buffer.byteLength(W)<=D?N=[j.slice(0,100-1),W,!0]:(j=i.join(i.basename(W),j),W=i.dirname(W));while(W!==K&&!N);N||(N=[S.slice(0,100-1),"",!0])}return N},c=(S,D,j)=>S.slice(D,D+j).toString("utf8").replace(/\0.*/,""),l=(S,D,j)=>h(f(S,D,j)),h=S=>S===null?null:new Date(S*1e3),f=(S,D,j)=>S[D]&128?n.parse(S.slice(D,D+j)):m(S,D,j),d=S=>isNaN(S)?null:S,m=(S,D,j)=>d(parseInt(S.slice(D,D+j).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(S,D,j,W)=>W===null?!1:W>y[j]||W<0?(n.encode(W,S.slice(D,D+j)),!0):(v(S,D,j,W),!1),v=(S,D,j,W)=>S.write(C(W,j),D,j,"ascii"),C=(S,D)=>k(Math.floor(S).toString(8),D),k=(S,D)=>(S.length===D-1?S:new Array(D-S.length-1).join("0")+S+" ")+"\0",P=(S,D,j,W)=>W===null?!1:p(S,D,j,W.getTime()/1e3),F=new Array(156).join("\0"),M=(S,D,j,W)=>W===null?!1:(S.write(W+F,D,j,"utf8"),W.length!==Buffer.byteLength(W)||W.length>j);e.exports=a}),e0=de((t,e)=>{"use strict";Q();var r=ma(),i=ye("path"),n=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/"+i.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+`
|
54
|
+
Downloading files${r?"":` for example ${Zr.default.cyan(e)}`}. This might take a moment.`),Nt(),h.start(),await(0,Oy.default)(()=>Ty(o,e),{retries:3}))}catch(p){throw new js(Hq(p)?p.message:String(p))}finally{h.stop()}let f=Ms.default.join(o,"package.json"),d=(0,qs.existsSync)(f),m=[];if(d){let p;try{p=(0,qs.readJsonSync)(f)}catch{}p&&m.push(...Object.keys(p.scripts||{}))}let y=t;return Ms.default.join(l,a)===t&&(y=a),{cdPath:y,hasPackageJson:d,availableScripts:m,repoInfo:n}}var Js=require("fs");var aR=ae(require("chalk"));var M1=ae(require("crypto")),yl=new Uint8Array(256),ml=yl.length;function Py(){return ml>yl.length-16&&(M1.default.randomFillSync(yl),ml=0),yl.slice(ml,ml+=16)}var Qe=[];for(let t=0;t<256;++t)Qe.push((t+256).toString(16).slice(1));function j1(t,e=0){return Qe[t[e+0]]+Qe[t[e+1]]+Qe[t[e+2]]+Qe[t[e+3]]+"-"+Qe[t[e+4]]+Qe[t[e+5]]+"-"+Qe[t[e+6]]+Qe[t[e+7]]+"-"+Qe[t[e+8]]+Qe[t[e+9]]+"-"+Qe[t[e+10]]+Qe[t[e+11]]+Qe[t[e+12]]+Qe[t[e+13]]+Qe[t[e+14]]+Qe[t[e+15]]}var q1=ae(require("crypto")),Iy={randomUUID:q1.default.randomUUID};function $q(t,e,r){if(Iy.randomUUID&&!e&&!t)return Iy.randomUUID();t=t||{};let i=t.random||(t.rng||Py)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){r=r||0;for(let n=0;n<16;++n)e[r+n]=i[n];return e}return j1(i)}var dn=$q;var Re;(function(t){t.assertEqual=n=>n;function e(n){}t.assertIs=e;function r(n){throw new Error}t.assertNever=r,t.arrayToEnum=n=>{let s={};for(let o of n)s[o]=o;return s},t.getValidEnumValues=n=>{let s=t.objectKeys(n).filter(a=>typeof n[n[a]]!="number"),o={};for(let a of s)o[a]=n[a];return t.objectValues(o)},t.objectValues=n=>t.objectKeys(n).map(function(s){return n[s]}),t.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let s=[];for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&s.push(o);return s},t.find=(n,s)=>{for(let o of n)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function i(n,s=" | "){return n.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=i,t.jsonStringifyReplacer=(n,s)=>typeof s=="bigint"?s.toString():s})(Re||(Re={}));var By;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(By||(By={}));var oe=Re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Oi=t=>{switch(typeof t){case"undefined":return oe.undefined;case"string":return oe.string;case"number":return isNaN(t)?oe.nan:oe.number;case"boolean":return oe.boolean;case"function":return oe.function;case"bigint":return oe.bigint;case"symbol":return oe.symbol;case"object":return Array.isArray(t)?oe.array:t===null?oe.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?oe.promise:typeof Map!="undefined"&&t instanceof Map?oe.map:typeof Set!="undefined"&&t instanceof Set?oe.set:typeof Date!="undefined"&&t instanceof Date?oe.date:oe.object;default:return oe.unknown}},ie=Re.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"]),zq=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};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},i={_errors:[]},n=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)i._errors.push(r(o));else{let a=i,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 n(this),i}toString(){return this.message}get message(){return JSON.stringify(this.issues,Re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},i=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}get formErrors(){return this.flatten()}};Tt.create=t=>new Tt(t);var sa=(t,e)=>{let r;switch(t.code){case ie.invalid_type:t.received===oe.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Re.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${Re.joinValues(t.keys,", ")}`;break;case ie.invalid_union:r="Invalid input";break;case ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Re.joinValues(t.options)}`;break;case ie.invalid_enum_value:r=`Invalid enum value. Expected ${Re.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}"`:Re.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,Re.assertNever(t)}return{message:r}},$1=sa;function Gq(t){$1=t}function _l(){return $1}var bl=t=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,s=[...r,...n.path||[]],o={...n,path:s},a="",u=i.filter(c=>!!c).slice().reverse();for(let c of u)a=c(o,{data:e,defaultError:a}).message;return{...n,path:s,message:n.message||a}},Wq=[];function ce(t,e){let r=bl({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_l(),sa].filter(i=>!!i)});t.common.issues.push(r)}var Ze=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let i=[];for(let n of r){if(n.status==="aborted")return be;n.status==="dirty"&&e.dirty(),i.push(n.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,r){let i=[];for(let n of r)i.push({key:await n.key,value:await n.value});return Ze.mergeObjectSync(e,i)}static mergeObjectSync(e,r){let i={};for(let n of r){let{key:s,value:o}=n;if(s.status==="aborted"||o.status==="aborted")return be;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value!="undefined"||n.alwaysSet)&&(i[s.value]=o.value)}return{status:e.value,value:i}}},be=Object.freeze({status:"aborted"}),z1=t=>({status:"dirty",value:t}),ft=t=>({status:"valid",value:t}),Ny=t=>t.status==="aborted",My=t=>t.status==="dirty",oa=t=>t.status==="valid",El=t=>typeof Promise!="undefined"&&t instanceof Promise,me;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(me||(me={}));var Yt=class{constructor(e,r,i,n){this._cachedPath=[],this.parent=e,this.data=r,this._path=i,this._key=n}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}},U1=(t,e)=>{if(oa(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 Tt(t.common.issues);return this._error=r,this._error}}};function Ee(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data=="undefined"?{message:i!=null?i:a.defaultError}:{message:r!=null?r:a.defaultError},description:n}}var ve=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 Oi(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ze,ctx:{common:e.parent.common,data:e.data,parsedType:Oi(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(El(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 i=this.safeParse(e,r);if(i.success)return i.data;throw i.error}safeParse(e,r){var i;let n={common:{issues:[],async:(i=r==null?void 0:r.async)!==null&&i!==void 0?i:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Oi(e)},s=this._parseSync({data:e,path:n.path,parent:n});return U1(n,s)}async parseAsync(e,r){let i=await this.safeParseAsync(e,r);if(i.success)return i.data;throw i.error}async safeParseAsync(e,r){let i={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:Oi(e)},n=this._parse({data:e,path:i.path,parent:i}),s=await(El(n)?n:Promise.resolve(n));return U1(i,s)}refine(e,r){let i=n=>typeof r=="string"||typeof r=="undefined"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,s)=>{let o=e(n),a=()=>s.addIssue({code:ie.custom,...i(n)});return typeof Promise!="undefined"&&o instanceof Promise?o.then(u=>u?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((i,n)=>e(i)?!0:(n.addIssue(typeof r=="function"?r(i,n):r),!1))}_refinement(e){return new Ot({schema:this,typeName:ge.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return rr.create(this,this._def)}nullable(){return ei.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kt.create(this,this._def)}promise(){return Ii.create(this,this._def)}or(e){return gn.create([this,e],this._def)}and(e){return _n.create(this,e,this._def)}transform(e){return new Ot({...Ee(this._def),schema:this,typeName:ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Sn({...Ee(this._def),innerType:this,defaultValue:r,typeName:ge.ZodDefault})}brand(){return new vl({typeName:ge.ZodBranded,type:this,...Ee(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ws({...Ee(this._def),innerType:this,catchValue:r,typeName:ge.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return xn.create(this,e)}readonly(){return Ys.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Vq=/^c[^\s-]{8,}$/i,Yq=/^[a-z][a-z0-9]*$/,Kq=/^[0-9A-HJKMNP-TV-Z]{26}$/,Zq=/^[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,Jq=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xq="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ly,Qq=/^(((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}))$/,eU=/^(([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})))$/,tU=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 rU(t,e){return!!((e==="v4"||!e)&&Qq.test(t)||(e==="v6"||!e)&&eU.test(t))}var Rt=class extends ve{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==oe.string){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.string,received:s.parsedType}),be}let i=new Ze,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(n=this._getOrReturnCtx(e,n),o?ce(n,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&ce(n,{code:ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")Jq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"email",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")Ly||(Ly=new RegExp(Xq,"u")),Ly.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"emoji",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"uuid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Vq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"cuid2",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Kq.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ulid",code:ie.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),ce(n,{validation:"url",code:ie.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"regex",code:ie.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.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)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?tU(s).test(e.data)||(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="ip"?rU(e.data,s.version)||(n=this._getOrReturnCtx(e,n),ce(n,{validation:"ip",code:ie.invalid_string,message:s.message}),i.dirty()):Re.assertNever(s);return{status:i.value,value:e.data}}_regex(e,r,i){return this.refinement(n=>e.test(n),{validation:r,code:ie.invalid_string,...me.errToObj(i)})}_addCheck(e){return new Rt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...me.errToObj(e)})}url(e){return this._addCheck({kind:"url",...me.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...me.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...me.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...me.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...me.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...me.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...me.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,...me.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...me.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...me.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...me.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...me.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...me.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...me.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...me.errToObj(r)})}nonempty(e){return this.min(1,me.errToObj(e))}trim(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rt({...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}};Rt.create=t=>{var e;return new Rt({checks:[],typeName:ge.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};function iU(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,s=parseInt(t.toFixed(n).replace(".","")),o=parseInt(e.toFixed(n).replace(".",""));return s%o/Math.pow(10,n)}var Er=class extends ve{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)!==oe.number){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.number,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="int"?Re.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?iU(e.data,s.value)!==0&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_finite,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new Er({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new Er({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:me.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:me.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:me.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:me.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"&&Re.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(r===null||i.value>r)&&(r=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Er.create=t=>new Er({checks:[],typeName:ge.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var vr=class extends ve{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)!==oe.bigint){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.bigint,received:s.parsedType}),be}let i,n=new Ze;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),ce(i,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):Re.assertNever(s);return{status:n.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,me.toString(r))}gt(e,r){return this.setLimit("min",e,!1,me.toString(r))}lte(e,r){return this.setLimit("max",e,!0,me.toString(r))}lt(e,r){return this.setLimit("max",e,!1,me.toString(r))}setLimit(e,r,i,n){return new vr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:i,message:me.toString(n)}]})}_addCheck(e){return new vr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:me.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:me.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:me.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:me.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:me.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}};vr.create=t=>{var e;return new vr({checks:[],typeName:ge.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Ee(t)})};var pn=class extends ve{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==oe.boolean){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.boolean,received:i.parsedType}),be}return ft(e.data)}};pn.create=t=>new pn({typeName:ge.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Ee(t)});var Xr=class extends ve{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==oe.date){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_type,expected:oe.date,received:s.parsedType}),be}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return ce(s,{code:ie.invalid_date}),be}let i=new Ze,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),ce(n,{code:ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Re.assertNever(s);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:me.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:me.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}};Xr.create=t=>new Xr({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ge.ZodDate,...Ee(t)});var Hs=class extends ve{_parse(e){if(this._getType(e)!==oe.symbol){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.symbol,received:i.parsedType}),be}return ft(e.data)}};Hs.create=t=>new Hs({typeName:ge.ZodSymbol,...Ee(t)});var mn=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.undefined,received:i.parsedType}),be}return ft(e.data)}};mn.create=t=>new mn({typeName:ge.ZodUndefined,...Ee(t)});var yn=class extends ve{_parse(e){if(this._getType(e)!==oe.null){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.null,received:i.parsedType}),be}return ft(e.data)}};yn.create=t=>new yn({typeName:ge.ZodNull,...Ee(t)});var Pi=class extends ve{constructor(){super(...arguments),this._any=!0}_parse(e){return ft(e.data)}};Pi.create=t=>new Pi({typeName:ge.ZodAny,...Ee(t)});var Jr=class extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ft(e.data)}};Jr.create=t=>new Jr({typeName:ge.ZodUnknown,...Ee(t)});var ir=class extends ve{_parse(e){let r=this._getOrReturnCtx(e);return ce(r,{code:ie.invalid_type,expected:oe.never,received:r.parsedType}),be}};ir.create=t=>new ir({typeName:ge.ZodNever,...Ee(t)});var $s=class extends ve{_parse(e){if(this._getType(e)!==oe.undefined){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.void,received:i.parsedType}),be}return ft(e.data)}};$s.create=t=>new $s({typeName:ge.ZodVoid,...Ee(t)});var kt=class extends ve{_parse(e){let{ctx:r,status:i}=this._processInputParams(e),n=this._def;if(r.parsedType!==oe.array)return ce(r,{code:ie.invalid_type,expected:oe.array,received:r.parsedType}),be;if(n.exactLength!==null){let o=r.data.length>n.exactLength.value,a=r.data.length<n.exactLength.value;(o||a)&&(ce(r,{code:o?ie.too_big:ie.too_small,minimum:a?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),i.dirty())}if(n.minLength!==null&&r.data.length<n.minLength.value&&(ce(r,{code:ie.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),i.dirty()),n.maxLength!==null&&r.data.length>n.maxLength.value&&(ce(r,{code:ie.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),i.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>n.type._parseAsync(new Yt(r,o,r.path,a)))).then(o=>Ze.mergeArray(i,o));let s=[...r.data].map((o,a)=>n.type._parseSync(new Yt(r,o,r.path,a)));return Ze.mergeArray(i,s)}get element(){return this._def.type}min(e,r){return new kt({...this._def,minLength:{value:e,message:me.toString(r)}})}max(e,r){return new kt({...this._def,maxLength:{value:e,message:me.toString(r)}})}length(e,r){return new kt({...this._def,exactLength:{value:e,message:me.toString(r)}})}nonempty(e){return this.min(1,e)}};kt.create=(t,e)=>new kt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ge.ZodArray,...Ee(e)});function Us(t){if(t instanceof Ie){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=rr.create(Us(i))}return new Ie({...t._def,shape:()=>e})}else return t instanceof kt?new kt({...t._def,type:Us(t.element)}):t instanceof rr?rr.create(Us(t.unwrap())):t instanceof ei?ei.create(Us(t.unwrap())):t instanceof Kt?Kt.create(t.items.map(e=>Us(e))):t}var Ie=class extends ve{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=Re.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==oe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ie.invalid_type,expected:oe.object,received:c.parsedType}),be}let{status:i,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof ir&&this._def.unknownKeys==="strip"))for(let c in n.data)o.includes(c)||a.push(c);let u=[];for(let c of o){let l=s[c],h=n.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Yt(n,h,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof ir){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of a)u.push({key:{status:"valid",value:l},value:{status:"valid",value:n.data[l]}});else if(c==="strict")a.length>0&&(ce(n,{code:ie.unrecognized_keys,keys:a}),i.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=n.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Yt(n,h,n.path,l)),alwaysSet:l in n.data})}}return n.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=>Ze.mergeObjectSync(i,c)):Ze.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(e){return me.errToObj,new Ie({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,i)=>{var n,s,o,a;let u=(o=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,r,i).message)!==null&&o!==void 0?o:i.defaultError;return r.code==="unrecognized_keys"?{message:(a=me.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ge.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){let r={};return Re.objectKeys(e).forEach(i=>{e[i]&&this.shape[i]&&(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}omit(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{e[i]||(r[i]=this.shape[i])}),new Ie({...this._def,shape:()=>r})}deepPartial(){return Us(this)}partial(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{let n=this.shape[i];e&&!e[i]?r[i]=n:r[i]=n.optional()}),new Ie({...this._def,shape:()=>r})}required(e){let r={};return Re.objectKeys(this.shape).forEach(i=>{if(e&&!e[i])r[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof rr;)s=s._def.innerType;r[i]=s}}),new Ie({...this._def,shape:()=>r})}keyof(){return G1(Re.objectKeys(this.shape))}};Ie.create=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.strictCreate=(t,e)=>new Ie({shape:()=>t,unknownKeys:"strict",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});Ie.lazycreate=(t,e)=>new Ie({shape:t,unknownKeys:"strip",catchall:ir.create(),typeName:ge.ZodObject,...Ee(e)});var gn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=this._def.options;function n(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 Tt(a.ctx.common.issues));return ce(r,{code:ie.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(i.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(n);{let s,o=[];for(let u of i){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 Tt(u));return ce(r,{code:ie.invalid_union,unionErrors:a}),be}}get options(){return this._def.options}};gn.create=(t,e)=>new gn({options:t,typeName:ge.ZodUnion,...Ee(e)});var gl=t=>t instanceof En?gl(t.schema):t instanceof Ot?gl(t.innerType()):t instanceof vn?[t.value]:t instanceof wr?t.options:t instanceof wn?Object.keys(t.enum):t instanceof Sn?gl(t._def.innerType):t instanceof mn?[void 0]:t instanceof yn?[null]:null,zs=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.object)return ce(r,{code:ie.invalid_type,expected:oe.object,received:r.parsedType}),be;let i=this.discriminator,n=r.data[i],s=this.optionsMap.get(n);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}):(ce(r,{code:ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,i){let n=new Map;for(let s of r){let o=gl(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(n.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);n.set(a,s)}}return new zs({typeName:ge.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:n,...Ee(i)})}};function jy(t,e){let r=Oi(t),i=Oi(e);if(t===e)return{valid:!0,data:t};if(r===oe.object&&i===oe.object){let n=Re.objectKeys(e),s=Re.objectKeys(t).filter(a=>n.indexOf(a)!==-1),o={...t,...e};for(let a of s){let u=jy(t[a],e[a]);if(!u.valid)return{valid:!1};o[a]=u.data}return{valid:!0,data:o}}else if(r===oe.array&&i===oe.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],u=jy(o,a);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return r===oe.date&&i===oe.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var _n=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=(s,o)=>{if(Ny(s)||Ny(o))return be;let a=jy(s.value,o.value);return a.valid?((My(s)||My(o))&&r.dirty(),{status:r.value,value:a.data}):(ce(i,{code:ie.invalid_intersection_types}),be)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,o])=>n(s,o)):n(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};_n.create=(t,e,r)=>new _n({left:t,right:e,typeName:ge.ZodIntersection,...Ee(r)});var Kt=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.array)return ce(i,{code:ie.invalid_type,expected:oe.array,received:i.parsedType}),be;if(i.data.length<this._def.items.length)return ce(i,{code:ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&i.data.length>this._def.items.length&&(ce(i,{code:ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...i.data].map((o,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new Yt(i,o,i.path,a)):null}).filter(o=>!!o);return i.common.async?Promise.all(s).then(o=>Ze.mergeArray(r,o)):Ze.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Kt({...this._def,rest:e})}};Kt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Kt({items:t,typeName:ge.ZodTuple,rest:null,...Ee(e)})};var bn=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.object)return ce(i,{code:ie.invalid_type,expected:oe.object,received:i.parsedType}),be;let n=[],s=this._def.keyType,o=this._def.valueType;for(let a in i.data)n.push({key:s._parse(new Yt(i,a,i.path,a)),value:o._parse(new Yt(i,i.data[a],i.path,a))});return i.common.async?Ze.mergeObjectAsync(r,n):Ze.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(e,r,i){return r instanceof ve?new bn({keyType:e,valueType:r,typeName:ge.ZodRecord,...Ee(i)}):new bn({keyType:Rt.create(),valueType:e,typeName:ge.ZodRecord,...Ee(r)})}},Gs=class extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.map)return ce(i,{code:ie.invalid_type,expected:oe.map,received:i.parsedType}),be;let n=this._def.keyType,s=this._def.valueType,o=[...i.data.entries()].map(([a,u],c)=>({key:n._parse(new Yt(i,a,i.path,[c,"key"])),value:s._parse(new Yt(i,u,i.path,[c,"value"]))}));if(i.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 be;(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 be;(c.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(c.value,l.value)}return{status:r.value,value:a}}}};Gs.create=(t,e,r)=>new Gs({valueType:e,keyType:t,typeName:ge.ZodMap,...Ee(r)});var Qr=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.parsedType!==oe.set)return ce(i,{code:ie.invalid_type,expected:oe.set,received:i.parsedType}),be;let n=this._def;n.minSize!==null&&i.data.size<n.minSize.value&&(ce(i,{code:ie.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),r.dirty()),n.maxSize!==null&&i.data.size>n.maxSize.value&&(ce(i,{code:ie.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.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 be;l.status==="dirty"&&r.dirty(),c.add(l.value)}return{status:r.value,value:c}}let a=[...i.data.values()].map((u,c)=>s._parse(new Yt(i,u,i.path,c)));return i.common.async?Promise.all(a).then(u=>o(u)):o(a)}min(e,r){return new Qr({...this._def,minSize:{value:e,message:me.toString(r)}})}max(e,r){return new Qr({...this._def,maxSize:{value:e,message:me.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qr.create=(t,e)=>new Qr({valueType:t,minSize:null,maxSize:null,typeName:ge.ZodSet,...Ee(e)});var Fi=class extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.function)return ce(r,{code:ie.invalid_type,expected:oe.function,received:r.parsedType}),be;function i(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].filter(c=>!!c),issueData:{code:ie.invalid_arguments,argumentsError:u}})}function n(a,u){return bl({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,_l(),sa].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 Ii){let a=this;return ft(async function(...u){let c=new Tt([]),l=await a._def.args.parseAsync(u,s).catch(d=>{throw c.addIssue(i(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(n(h,d)),c})})}else{let a=this;return ft(function(...u){let c=a._def.args.safeParse(u,s);if(!c.success)throw new Tt([i(u,c.error)]);let l=Reflect.apply(o,this,c.data),h=a._def.returns.safeParse(l,s);if(!h.success)throw new Tt([n(l,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Fi({...this._def,args:Kt.create(e).rest(Jr.create())})}returns(e){return new Fi({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,i){return new Fi({args:e||Kt.create([]).rest(Jr.create()),returns:r||Jr.create(),typeName:ge.ZodFunction,...Ee(i)})}},En=class extends ve{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})}};En.create=(t,e)=>new En({getter:t,typeName:ge.ZodLazy,...Ee(e)});var vn=class extends ve{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return ce(r,{received:r.data,code:ie.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:e.data}}get value(){return this._def.value}};vn.create=(t,e)=>new vn({value:t,typeName:ge.ZodLiteral,...Ee(e)});function G1(t,e){return new wr({values:t,typeName:ge.ZodEnum,...Ee(e)})}var wr=class extends ve{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{expected:Re.joinValues(i),received:r.parsedType,code:ie.invalid_type}),be}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),i=this._def.values;return ce(r,{received:r.data,code:ie.invalid_enum_value,options:i}),be}return ft(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 wr.create(e)}exclude(e){return wr.create(this.options.filter(r=>!e.includes(r)))}};wr.create=G1;var wn=class extends ve{_parse(e){let r=Re.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==oe.string&&i.parsedType!==oe.number){let n=Re.objectValues(r);return ce(i,{expected:Re.joinValues(n),received:i.parsedType,code:ie.invalid_type}),be}if(r.indexOf(e.data)===-1){let n=Re.objectValues(r);return ce(i,{received:i.data,code:ie.invalid_enum_value,options:n}),be}return ft(e.data)}get enum(){return this._def.values}};wn.create=(t,e)=>new wn({values:t,typeName:ge.ZodNativeEnum,...Ee(e)});var Ii=class extends ve{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==oe.promise&&r.common.async===!1)return ce(r,{code:ie.invalid_type,expected:oe.promise,received:r.parsedType}),be;let i=r.parsedType===oe.promise?r.data:Promise.resolve(r.data);return ft(i.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ii.create=(t,e)=>new Ii({type:t,typeName:ge.ZodPromise,...Ee(e)});var Ot=class extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:i}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:o=>{ce(i,o),o.fatal?r.abort():r.dirty()},get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(i.data,s);return i.common.issues.length?{status:"dirty",value:i.data}:i.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:i.path,parent:i})):this._def.schema._parseSync({data:o,path:i.path,parent:i})}if(n.type==="refinement"){let o=a=>{let u=n.refinement(a,s);if(i.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(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>a.status==="aborted"?be:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(n.type==="transform")if(i.common.async===!1){let o=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!oa(o))return o;let a=n.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:i.data,path:i.path,parent:i}).then(o=>oa(o)?Promise.resolve(n.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);Re.assertNever(n)}};Ot.create=(t,e,r)=>new Ot({schema:t,typeName:ge.ZodEffects,effect:e,...Ee(r)});Ot.createWithPreprocess=(t,e,r)=>new Ot({schema:e,effect:{type:"preprocess",transform:t},typeName:ge.ZodEffects,...Ee(r)});var rr=class extends ve{_parse(e){return this._getType(e)===oe.undefined?ft(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};rr.create=(t,e)=>new rr({innerType:t,typeName:ge.ZodOptional,...Ee(e)});var ei=class extends ve{_parse(e){return this._getType(e)===oe.null?ft(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ei.create=(t,e)=>new ei({innerType:t,typeName:ge.ZodNullable,...Ee(e)});var Sn=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return r.parsedType===oe.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Sn.create=(t,e)=>new Sn({innerType:t,typeName:ge.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ee(e)});var Ws=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return El(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new Tt(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Ws.create=(t,e)=>new Ws({innerType:t,typeName:ge.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ee(e)});var Vs=class extends ve{_parse(e){if(this._getType(e)!==oe.nan){let i=this._getOrReturnCtx(e);return ce(i,{code:ie.invalid_type,expected:oe.nan,received:i.parsedType}),be}return{status:"valid",value:e.data}}};Vs.create=t=>new Vs({typeName:ge.ZodNaN,...Ee(t)});var nU=Symbol("zod_brand"),vl=class extends ve{_parse(e){let{ctx:r}=this._processInputParams(e),i=r.data;return this._def.type._parse({data:i,path:r.path,parent:r})}unwrap(){return this._def.type}},xn=class extends ve{_parse(e){let{status:r,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?be:s.status==="dirty"?(r.dirty(),z1(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})})();{let n=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return n.status==="aborted"?be:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:i.path,parent:i})}}static create(e,r){return new xn({in:e,out:r,typeName:ge.ZodPipeline})}},Ys=class extends ve{_parse(e){let r=this._def.innerType._parse(e);return oa(r)&&(r.value=Object.freeze(r.value)),r}};Ys.create=(t,e)=>new Ys({innerType:t,typeName:ge.ZodReadonly,...Ee(e)});var W1=(t,e={},r)=>t?Pi.create().superRefine((i,n)=>{var s,o;if(!t(i)){let a=typeof e=="function"?e(i):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;n.addIssue({code:"custom",...c,fatal:u})}}):Pi.create(),sU={object:Ie.lazycreate},ge;(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"})(ge||(ge={}));var oU=(t,e={message:`Input not instance of ${t.name}`})=>W1(r=>r instanceof t,e),V1=Rt.create,Y1=Er.create,aU=Vs.create,uU=vr.create,K1=pn.create,cU=Xr.create,lU=Hs.create,hU=mn.create,fU=yn.create,dU=Pi.create,pU=Jr.create,mU=ir.create,yU=$s.create,gU=kt.create,_U=Ie.create,bU=Ie.strictCreate,EU=gn.create,vU=zs.create,wU=_n.create,SU=Kt.create,xU=bn.create,DU=Gs.create,AU=Qr.create,CU=Fi.create,RU=En.create,TU=vn.create,kU=wr.create,OU=wn.create,FU=Ii.create,H1=Ot.create,PU=rr.create,IU=ei.create,LU=Ot.createWithPreprocess,BU=xn.create,NU=()=>V1().optional(),MU=()=>Y1().optional(),jU=()=>K1().optional(),qU={string:t=>Rt.create({...t,coerce:!0}),number:t=>Er.create({...t,coerce:!0}),boolean:t=>pn.create({...t,coerce:!0}),bigint:t=>vr.create({...t,coerce:!0}),date:t=>Xr.create({...t,coerce:!0})},UU=be,Ks=Object.freeze({__proto__:null,defaultErrorMap:sa,setErrorMap:Gq,getErrorMap:_l,makeIssue:bl,EMPTY_PATH:Wq,addIssueToContext:ce,ParseStatus:Ze,INVALID:be,DIRTY:z1,OK:ft,isAborted:Ny,isDirty:My,isValid:oa,isAsync:El,get util(){return Re},get objectUtil(){return By},ZodParsedType:oe,getParsedType:Oi,ZodType:ve,ZodString:Rt,ZodNumber:Er,ZodBigInt:vr,ZodBoolean:pn,ZodDate:Xr,ZodSymbol:Hs,ZodUndefined:mn,ZodNull:yn,ZodAny:Pi,ZodUnknown:Jr,ZodNever:ir,ZodVoid:$s,ZodArray:kt,ZodObject:Ie,ZodUnion:gn,ZodDiscriminatedUnion:zs,ZodIntersection:_n,ZodTuple:Kt,ZodRecord:bn,ZodMap:Gs,ZodSet:Qr,ZodFunction:Fi,ZodLazy:En,ZodLiteral:vn,ZodEnum:wr,ZodNativeEnum:wn,ZodPromise:Ii,ZodEffects:Ot,ZodTransformer:Ot,ZodOptional:rr,ZodNullable:ei,ZodDefault:Sn,ZodCatch:Ws,ZodNaN:Vs,BRAND:nU,ZodBranded:vl,ZodPipeline:xn,ZodReadonly:Ys,custom:W1,Schema:ve,ZodSchema:ve,late:sU,get ZodFirstPartyTypeKind(){return ge},coerce:qU,any:dU,array:gU,bigint:uU,boolean:K1,date:cU,discriminatedUnion:vU,effect:H1,enum:kU,function:CU,instanceof:oU,intersection:wU,lazy:RU,literal:TU,map:DU,nan:aU,nativeEnum:OU,never:mU,null:fU,nullable:IU,number:Y1,object:_U,oboolean:jU,onumber:MU,optional:PU,ostring:NU,pipeline:BU,preprocess:LU,promise:FU,record:xU,set:AU,strictObject:bU,string:V1,symbol:lU,transformer:H1,tuple:SU,undefined:hU,union:EU,unknown:pU,void:yU,NEVER:UU,ZodIssueCode:ie,quotelessJson:zq,ZodError:Tt});var Gy=ae(require("os")),nR=ae(require("crypto")),sR=ae(require("path")),oR=ae(iR());function JU(t){let e=process.version,r=Gy.default.type(),i=Gy.default.arch();return`${t.name} ${t.version} ${e} ${r} ${i}`}async function XU(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,oR.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return sR.default.join(t,"turborepo","telemetry.json")}function QU({input:t,salt:e}){return nR.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var Zs={buildUserAgent:JU,oneWayHashWithSalt:QU,defaultConfigPath:XU};var eH="TURBO_TELEMETRY_DEBUG",tH="TURBO_TELEMETRY_DISABLED",rH="TURBO_TELEMETRY_MESSAGE_DISABLED",iH="DO_NOT_TRACK",nH=Ks.object({telemetry_enabled:Ks.boolean(),telemetry_id:Ks.string(),telemetry_salt:Ks.string(),telemetry_alerted:Ks.string().optional()}),Et=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,Js.readFileSync)(e,"utf-8"),i=JSON.parse(r),n=Et.validateConfig(i);return new Et({configPath:e,config:n})}catch{return Et.tryRemove({configPath:e})?Et.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await Zs.defaultConfigPath();return Et.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return nH.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=dn(),i=dn(),n=Zs.oneWayHashWithSalt({input:r,salt:i}),s=new Et({configPath:e,config:{telemetry_enabled:!0,telemetry_id:n,telemetry_salt:i}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,Js.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,Js.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[iH]||"0",r=process.env[tH]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[rH]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(ue.log(),ue.bold("Attention:"),ue.grey("Turborepo now collects completely anonymous telemetry regarding usage."),ue.grey("This information is used to shape the Turborepo roadmap and prioritize features."),ue.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:"),ue.underline(aR.default.grey("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 Zs.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[eH]||"0";return e==="1"||e.toLowerCase()==="true"}};var uR=ae(Sy());var sH=20,oH="/api/turborepo/v1/events",Dn=class{constructor({api:e,packageInfo:r,config:i,opts:n}){this.batchSize=sH;this.timeout=250;this.sessionId=dn();this.eventBatches=[];this.events=[];let s=new URL(oH,e);this.api=s.toString(),this.packageInfo=r,this.config=i,n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.batchSize&&(this.batchSize=n.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(uR.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":Zs.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:i,isSensitive:n}){let s={id:dn(),key:e,value:n?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:i};return Et.isDebug()&&(ue.log(),ue.bold("[telemetry event]"),ue.dimmed(JSON.stringify(s,null,2)),ue.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 aa=class extends Dn{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 dR=ae(fR());var uH=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],ua=class extends Dn{trackCI(){var e;return this.track({key:"ci",value:(e=dR.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:uH.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 cH={"create-turbo":aa,"turbo-ignore":ua},lH="https://telemetry.vercel.com";async function Wy({packageInfo:t,opts:e}){let r=cH[t.name],i=await Et.fromDefaultConfig();return i?(i.showAlert(),{telemetry:new r({api:lH,packageInfo:t,config:i,opts:e})}):{telemetry:void 0}}var ca=ae(require("chalk"));var pR=require("commander"),mR="status",hH=["enable","disable",mR];function fH(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();ue.log(`Status: ${e?ca.default.bold(ca.default.green("Enabled")):ca.default.bold(ca.default.red("Disabled"))}`),ue.log(),e?ue.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):ue.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),ue.log("Learn more: https://turbo.build/repo/docs/telemetry")}function dH(t,e){if(!e.telemetry){ue.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),ue.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),ue.bold("Success!")),ue.log(),fH(e)}function Vy(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new pR.Argument("[action]","Action to perform").choices(hH).default(mR)).action(dH)}var FT=require("proxy-agent");var An={name:"create-turbo",version:"2.0.2-canary.1",description:"Create a new Turborepo",homepage:"https://turbo.build/repo",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/create-turbo"},bugs:{url:"https://github.com/vercel/turbo/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:{chalk:"4.1.2",commander:"^11.0.0","fs-extra":"^11.1.1",inquirer:"^8.0.0","proxy-agent":"^6.2.2",rimraf:"^3.0.2",semver:"^7.3.8","update-check":"^1.5.4"},devDependencies:{"@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/jest":"^27.4.0","@types/node":"^18.17.2","@types/rimraf":"^3.0.2","@types/semver":"^7.3.9",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^6.7.0",typescript:"^5.2.2"},files:["dist"]};var yR=ae(require("chalk")),gR=ae(require("update-check"));var mH=(0,gR.default)(An).catch(()=>null);async function Yy(){try{let t=await mH;t!=null&&t.latest&&(ue.log(),ue.log(yR.default.yellow.bold("A new version of `create-turbo` is available!")),ue.log()),process.exit()}catch{}}var ba=ae(require("path")),et=ae(require("chalk"));var Ni=ae(require("chalk"),1),PR=ae(vu(),1),IR=ae(xu(),1),jR=ae(require("os"),1),qR=ae(is(),1),zW=require("fs-extra");var KW=ae(ou(),1),JW=require("fs-extra"),QW=require("fs-extra"),tV=require("chalk"),HR=require("stream"),$R=require("util"),sV=require("fs-extra"),cV=require("chalk"),hV=require("fs-extra"),Cn=ae(require("path"),1),dt=require("fs-extra"),zR=ae(is(),1),GR=ae(require("path"),1),WR=require("fs-extra"),VR=ae(require("chalk"),1),ri=ae(require("path"),1),YR=ae(is(),1),It=require("fs-extra"),KR=ae(ou(),1);var ha=ae(require("path"),1),xr=require("fs-extra"),ro=ae(require("path"),1),Dr=require("fs-extra"),fa=ae(require("path"),1),Ar=require("fs-extra"),Pt=ae(require("chalk"),1),tT=ae(xu(),1),rT=ae(is(),1),iT=ae(vu(),1),nT=require("semver"),sT=ae(require("chalk"),1),yH=Object.create,Jy=Object.defineProperty,gH=Object.getOwnPropertyDescriptor,_H=Object.getOwnPropertyNames,bH=Object.getPrototypeOf,EH=Object.prototype.hasOwnProperty,ye=(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')}),vH=(t,e)=>()=>(t&&(e=t(t=0)),e),de=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),wH=(t,e)=>{for(var r in e)Jy(t,r,{get:e[r],enumerable:!0})},SH=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _H(e))!EH.call(t,n)&&n!==r&&Jy(t,n,{get:()=>e[n],enumerable:!(i=gH(e,n))||i.enumerable});return t},Al=(t,e,r)=>(r=t!=null?yH(bH(t)):{},SH(e||!t||!t.__esModule?Jy(r,"default",{value:t,enumerable:!0}):r,t)),Q=vH(()=>{}),xH=de((t,e)=>{Q();function r(i){return e.exports=r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},e.exports.__esModule=!0,e.exports.default=e.exports,r(i)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}),DH=de((t,e)=>{Q();var r=xH().default;function i(){"use strict";e.exports=i=function(){return s},e.exports.__esModule=!0,e.exports.default=e.exports;var n,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 m(q,g,_,E){var R=g&&g.prototype instanceof F?g:F,x=Object.create(R.prototype),H=new z(E||[]);return u(x,"_invoke",{value:ne(q,_,H)}),x}function y(q,g,_){try{return{type:"normal",arg:q.call(g,_)}}catch(E){return{type:"throw",arg:E}}}s.wrap=m;var p="suspendedStart",v="suspendedYield",C="executing",k="completed",P={};function F(){}function M(){}function S(){}var D={};d(D,l,function(){return this});var j=Object.getPrototypeOf,W=j&&j(j(Z([])));W&&W!==o&&a.call(W,l)&&(D=W);var N=S.prototype=F.prototype=Object.create(D);function K(q){["next","throw","return"].forEach(function(g){d(q,g,function(_){return this._invoke(g,_)})})}function te(q,g){function _(R,x,H,$){var re=y(q[R],q,x);if(re.type!=="throw"){var V=re.arg,he=V.value;return he&&r(he)=="object"&&a.call(he,"__await")?g.resolve(he.__await).then(function(J){_("next",J,H,$)},function(J){_("throw",J,H,$)}):g.resolve(he).then(function(J){V.value=J,H(V)},function(J){return _("throw",J,H,$)})}$(re.arg)}var E;u(this,"_invoke",{value:function(R,x){function H(){return new g(function($,re){_(R,x,$,re)})}return E=E?E.then(H,H):H()}})}function ne(q,g,_){var E=p;return function(R,x){if(E===C)throw new Error("Generator is already running");if(E===k){if(R==="throw")throw x;return{value:n,done:!0}}for(_.method=R,_.arg=x;;){var H=_.delegate;if(H){var $=U(H,_);if($){if($===P)continue;return $}}if(_.method==="next")_.sent=_._sent=_.arg;else if(_.method==="throw"){if(E===p)throw E=k,_.arg;_.dispatchException(_.arg)}else _.method==="return"&&_.abrupt("return",_.arg);E=C;var re=y(q,g,_);if(re.type==="normal"){if(E=_.done?k:v,re.arg===P)continue;return{value:re.arg,done:_.done}}re.type==="throw"&&(E=k,_.method="throw",_.arg=re.arg)}}}function U(q,g){var _=g.method,E=q.iterator[_];if(E===n)return g.delegate=null,_==="throw"&&q.iterator.return&&(g.method="return",g.arg=n,U(q,g),g.method==="throw")||_!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+_+"' method")),P;var R=y(E,q.iterator,g.arg);if(R.type==="throw")return g.method="throw",g.arg=R.arg,g.delegate=null,P;var x=R.arg;return x?x.done?(g[q.resultName]=x.value,g.next=q.nextLoc,g.method!=="return"&&(g.method="next",g.arg=n),g.delegate=null,P):x:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,P)}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 z(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,E=function R(){for(;++_<q.length;)if(a.call(q,_))return R.value=q[_],R.done=!1,R;return R.value=n,R.done=!0,R};return E.next=E}}throw new TypeError(r(q)+" is not iterable")}return M.prototype=S,u(N,"constructor",{value:S,configurable:!0}),u(S,"constructor",{value:M,configurable:!0}),M.displayName=d(S,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,S):(q.__proto__=S,d(q,f,"GeneratorFunction")),q.prototype=Object.create(N),q},s.awrap=function(q){return{__await:q}},K(te.prototype),d(te.prototype,h,function(){return this}),s.AsyncIterator=te,s.async=function(q,g,_,E,R){R===void 0&&(R=Promise);var x=new te(m(q,g,_,E),R);return s.isGeneratorFunction(g)?x:x.next().then(function(H){return H.done?H.value:x.next()})},K(N),d(N,f,"Generator"),d(N,l,function(){return this}),d(N,"toString",function(){return"[object Generator]"}),s.keys=function(q){var g=Object(q),_=[];for(var E in g)_.push(E);return _.reverse(),function R(){for(;_.length;){var x=_.pop();if(x in g)return R.value=x,R.done=!1,R}return R.done=!0,R}},s.values=Z,z.prototype={constructor:z,reset:function(q){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!q)for(var g in this)g.charAt(0)==="t"&&a.call(this,g)&&!isNaN(+g.slice(1))&&(this[g]=n)},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,V){return x.type="throw",x.arg=q,g.next=re,V&&(g.method="next",g.arg=n),!!V}for(var E=this.tryEntries.length-1;E>=0;--E){var R=this.tryEntries[E],x=R.completion;if(R.tryLoc==="root")return _("end");if(R.tryLoc<=this.prev){var H=a.call(R,"catchLoc"),$=a.call(R,"finallyLoc");if(H&&$){if(this.prev<R.catchLoc)return _(R.catchLoc,!0);if(this.prev<R.finallyLoc)return _(R.finallyLoc)}else if(H){if(this.prev<R.catchLoc)return _(R.catchLoc,!0)}else{if(!$)throw new Error("try statement without catch or finally");if(this.prev<R.finallyLoc)return _(R.finallyLoc)}}}},abrupt:function(q,g){for(var _=this.tryEntries.length-1;_>=0;--_){var E=this.tryEntries[_];if(E.tryLoc<=this.prev&&a.call(E,"finallyLoc")&&this.prev<E.finallyLoc){var R=E;break}}R&&(q==="break"||q==="continue")&&R.tryLoc<=g&&g<=R.finallyLoc&&(R=null);var x=R?R.completion:{};return x.type=q,x.arg=g,R?(this.method="next",this.next=R.finallyLoc,P):this.complete(x)},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),P},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(_),P}},catch:function(q){for(var g=this.tryEntries.length-1;g>=0;--g){var _=this.tryEntries[g];if(_.tryLoc===q){var E=_.completion;if(E.type==="throw"){var R=E.arg;L(_)}return R}}throw new Error("illegal catch attempt")},delegateYield:function(q,g,_){return this.delegate={iterator:Z(q),resultName:g,nextLoc:_},this.method==="next"&&(this.arg=n),P}},s}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}),AH=de((t,e)=>{Q();var r=DH()();e.exports=r;try{regeneratorRuntime=r}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),CH=de((t,e)=>{"use strict";Q();var r=(i,...n)=>new Promise(s=>{s(i(...n))});e.exports=r,e.exports.default=r}),RH=de((t,e)=>{"use strict";Q();var r=CH(),i=n=>{if(!((Number.isInteger(n)||n===1/0)&&n>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 m=r(h,...d);f(m),m.then(a,a)},c=(h,f,...d)=>{o<n?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=i,e.exports.default=i}),TH=de((t,e)=>{"use strict";Q();var r=RH(),i=class extends Error{constructor(a){super(),this.value=a}},n=async(a,u)=>u(await a),s=async a=>{let u=await Promise.all(a);if(u[1]===!0)throw new i(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(n,d,u)]),f=r(c.preserveOrder?1:1/0);try{await Promise.all(h.map(d=>f(s,d)))}catch(d){if(d instanceof i)return d.value;throw d}};e.exports=o,e.exports.default=o}),kH=de((t,e)=>{"use strict";Q();var r=ye("path"),i=ye("fs"),{promisify:n}=ye("util"),s=TH(),o=n(i.stat),a=n(i.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 m=>{try{let y=await d(r.resolve(f.cwd,m));return l(f.type,y)}catch{return!1}},f)},e.exports.sync=(h,f)=>{f={cwd:process.cwd(),allowSymlinks:!0,type:"file",...f},c(f);let d=f.allowSymlinks?i.statSync:i.lstatSync;for(let m of h)try{let y=d(r.resolve(f.cwd,m));if(l(f.type,y))return m}catch{}}}),OH=de((t,e)=>{"use strict";Q();var r=ye("fs"),{promisify:i}=ye("util"),n=i(r.access);e.exports=async s=>{try{return await n(s),!0}catch{return!1}},e.exports.sync=s=>{try{return r.accessSync(s),!0}catch{return!1}}}),FH=de((t,e)=>{"use strict";Q();var r=ye("path"),i=kH(),n=OH(),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 i(l,f);let d=await o(f.cwd);return typeof d=="string"?i([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 i.sync(l,f);let d=o(f.cwd);return typeof d=="string"?i.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=n,e.exports.sync.exists=n.sync,e.exports.stop=s}),da=de((t,e)=>{"use strict";Q();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=i=>i?Object.keys(i).map(n=>[r.has(n)?r.get(n):n,i[n]]).reduce((n,s)=>(n[s[0]]=s[1],n),Object.create(null)):{}}),Xy=de((t,e)=>{"use strict";Q();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("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"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),k=Symbol("resume"),P=Symbol("buffer"),F=Symbol("pipes"),M=Symbol("bufferLength"),S=Symbol("bufferPush"),D=Symbol("bufferShift"),j=Symbol("objectMode"),W=Symbol("destroyed"),N=Symbol("emitData"),K=Symbol("emitEnd"),te=Symbol("emitEnd2"),ne=Symbol("async"),U=R=>Promise.resolve().then(R),I=global._MP_NO_ITERATOR_SYMBOLS_!=="1",L=I&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),z=I&&Symbol.iterator||Symbol("iterator not implemented"),Z=R=>R==="end"||R==="finish"||R==="prefinish",q=R=>R instanceof ArrayBuffer||typeof R=="object"&&R.constructor&&R.constructor.name==="ArrayBuffer"&&R.byteLength>=0,g=R=>!Buffer.isBuffer(R)&&ArrayBuffer.isView(R),_=class{constructor(R,x,H){this.src=R,this.dest=x,this.opts=H,this.ondrain=()=>R[k](),x.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},E=class extends _{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(R,x,H){super(R,x,H),this.proxyErrors=$=>x.emit("error",$),R.on("error",this.proxyErrors)}};e.exports=class ER extends n{constructor(x){super(),this[v]=!1,this[C]=!1,this[F]=[],this[P]=[],this[j]=x&&x.objectMode||!1,this[j]?this[y]=null:this[y]=x&&x.encoding||null,this[y]==="buffer"&&(this[y]=null),this[ne]=x&&!!x.async||!1,this[p]=this[y]?new s(this[y]):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[W]=!1,x&&x.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[P]}),x&&x.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[F]})}get bufferLength(){return this[M]}get encoding(){return this[y]}set encoding(x){if(this[j])throw new Error("cannot set encoding in objectMode");if(this[y]&&x!==this[y]&&(this[p]&&this[p].lastNeed||this[M]))throw new Error("cannot change encoding");this[y]!==x&&(this[p]=x?new s(x):null,this[P].length&&(this[P]=this[P].map(H=>this[p].write(H)))),this[y]=x}setEncoding(x){this.encoding=x}get objectMode(){return this[j]}set objectMode(x){this[j]=this[j]||!!x}get async(){return this[ne]}set async(x){this[ne]=this[ne]||!!x}write(x,H,$){if(this[o])throw new Error("write after end");if(this[W])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]?U:V=>V();return!this[j]&&!Buffer.isBuffer(x)&&(g(x)?x=Buffer.from(x.buffer,x.byteOffset,x.byteLength):q(x)?x=Buffer.from(x):typeof x!="string"&&(this.objectMode=!0)),this[j]?(this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):x.length?(typeof x=="string"&&!(H===this[y]&&!this[p].lastNeed)&&(x=Buffer.from(x,H)),Buffer.isBuffer(x)&&this[y]&&(x=this[p].write(x)),this.flowing&&this[M]!==0&&this[d](!0),this.flowing?this.emit("data",x):this[S](x),this[M]!==0&&this.emit("readable"),$&&re($),this.flowing):(this[M]!==0&&this.emit("readable"),$&&re($),this.flowing)}read(x){if(this[W])return null;if(this[M]===0||x===0||x>this[M])return this[a](),null;this[j]&&(x=null),this[P].length>1&&!this[j]&&(this.encoding?this[P]=[this[P].join("")]:this[P]=[Buffer.concat(this[P],this[M])]);let H=this[f](x||null,this[P][0]);return this[a](),H}[f](x,H){return x===H.length||x===null?this[D]():(this[P][0]=H.slice(x),H=H.slice(0,x),this[M]-=x),this.emit("data",H),!this[P].length&&!this[o]&&this.emit("drain"),H}end(x,H,$){return typeof x=="function"&&($=x,x=null),typeof H=="function"&&($=H,H="utf8"),x&&this.write(x,H),$&&this.once("end",$),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[k](){this[W]||(this[C]=!1,this[v]=!0,this.emit("resume"),this[P].length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[k]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[W]}get flowing(){return this[v]}get paused(){return this[C]}[S](x){this[j]?this[M]+=1:this[M]+=x.length,this[P].push(x)}[D](){return this[P].length&&(this[j]?this[M]-=1:this[M]-=this[P][0].length),this[P].shift()}[d](x){do;while(this[m](this[D]()));!x&&!this[P].length&&!this[o]&&this.emit("drain")}[m](x){return x?(this.emit("data",x),this.flowing):!1}pipe(x,H){if(this[W])return;let $=this[u];return H=H||{},x===r.stdout||x===r.stderr?H.end=!1:H.end=H.end!==!1,H.proxyErrors=!!H.proxyErrors,$?H.end&&x.end():(this[F].push(H.proxyErrors?new E(this,x,H):new _(this,x,H)),this[ne]?U(()=>this[k]()):this[k]()),x}unpipe(x){let H=this[F].find($=>$.dest===x);H&&(this[F].splice(this[F].indexOf(H),1),H.unpipe())}addListener(x,H){return this.on(x,H)}on(x,H){let $=super.on(x,H);return x==="data"&&!this[F].length&&!this.flowing?this[k]():x==="readable"&&this[M]!==0?super.emit("readable"):Z(x)&&this[u]?(super.emit(x),this.removeAllListeners(x)):x==="error"&&this[l]&&(this[ne]?U(()=>H.call(this,this[l])):H.call(this,this[l])),$}get emittedEnd(){return this[u]}[a](){!this[c]&&!this[u]&&!this[W]&&this[P].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(x,H,...$){if(x!=="error"&&x!=="close"&&x!==W&&this[W])return;if(x==="data")return H?this[ne]?U(()=>this[N](H)):this[N](H):!1;if(x==="end")return this[K]();if(x==="close"){if(this[h]=!0,!this[u]&&!this[W])return;let V=super.emit("close");return this.removeAllListeners("close"),V}else if(x==="error"){this[l]=H;let V=super.emit("error",H);return this[a](),V}else if(x==="resume"){let V=super.emit("resume");return this[a](),V}else if(x==="finish"||x==="prefinish"){let V=super.emit(x);return this.removeAllListeners(x),V}let re=super.emit(x,H,...$);return this[a](),re}[N](x){for(let $ of this[F])$.dest.write(x)===!1&&this.pause();let H=super.emit("data",x);return this[a](),H}[K](){this[u]||(this[u]=!0,this.readable=!1,this[ne]?U(()=>this[te]()):this[te]())}[te](){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 x=super.emit("end");return this.removeAllListeners("end"),x}collect(){let x=[];this[j]||(x.dataLength=0);let H=this.promise();return this.on("data",$=>{x.push($),this[j]||(x.dataLength+=$.length)}),H.then(()=>x)}concat(){return this[j]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(x=>this[j]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?x.join(""):Buffer.concat(x,x.dataLength))}promise(){return new Promise((x,H)=>{this.on(W,()=>H(new Error("stream destroyed"))),this.on("error",$=>H($)),this.on("end",()=>x())})}[L](){return{next:()=>{let x=this.read();if(x!==null)return Promise.resolve({done:!1,value:x});if(this[o])return Promise.resolve({done:!0});let H=null,$=null,re=w=>{this.removeListener("data",V),this.removeListener("end",he),$(w)},V=w=>{this.removeListener("error",re),this.removeListener("end",he),this.pause(),H({value:w,done:!!this[o]})},he=()=>{this.removeListener("error",re),this.removeListener("data",V),H({done:!0})},J=()=>re(new Error("stream destroyed"));return new Promise((w,B)=>{$=B,H=w,this.once(W,J),this.once("error",re),this.once("end",he),this.once("data",V)})}}}[z](){return{next:()=>{let x=this.read();return{value:x,done:x===null}}}}destroy(x){return this[W]?(x?this.emit("error",x):this.emit(W),this):(this[W]=!0,this[P].length=0,this[M]=0,typeof this.close=="function"&&!this[h]&&this.close(),x?this.emit("error",x):this.emit(W),this)}static isStream(x){return!!x&&(x instanceof ER||x instanceof n||x instanceof i&&(typeof x.pipe=="function"||typeof x.write=="function"&&typeof x.end=="function"))}}}),PH=de((t,e)=>{Q();var r=ye("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))}),vR=de((t,e)=>{"use strict";Q();var r=typeof process=="object"&&process?process:{stdout:null,stderr:null},i=ye("events"),n=ye("stream"),s=ye("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"),m=Symbol("flushChunk"),y=Symbol("encoding"),p=Symbol("decoder"),v=Symbol("flowing"),C=Symbol("paused"),k=Symbol("resume"),P=Symbol("bufferLength"),F=Symbol("bufferPush"),M=Symbol("bufferShift"),S=Symbol("objectMode"),D=Symbol("destroyed"),j=Symbol("emitData"),W=Symbol("emitEnd"),N=Symbol("emitEnd2"),K=Symbol("async"),te=_=>Promise.resolve().then(_),ne=global._MP_NO_ITERATOR_SYMBOLS_!=="1",U=ne&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),I=ne&&Symbol.iterator||Symbol("iterator not implemented"),L=_=>_==="end"||_==="finish"||_==="prefinish",z=_=>_ instanceof ArrayBuffer||typeof _=="object"&&_.constructor&&_.constructor.name==="ArrayBuffer"&&_.byteLength>=0,Z=_=>!Buffer.isBuffer(_)&&ArrayBuffer.isView(_),q=class{constructor(_,E,R){this.src=_,this.dest=E,this.opts=R,this.ondrain=()=>_[k](),E.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(_,E,R){super(_,E,R),this.proxyErrors=x=>E.emit("error",x),_.on("error",this.proxyErrors)}};e.exports=class wR extends n{constructor(E){super(),this[v]=!1,this[C]=!1,this.pipes=[],this.buffer=[],this[S]=E&&E.objectMode||!1,this[S]?this[y]=null:this[y]=E&&E.encoding||null,this[y]==="buffer"&&(this[y]=null),this[K]=E&&!!E.async||!1,this[p]=this[y]?new s(this[y]):null,this[o]=!1,this[u]=!1,this[c]=!1,this[h]=!1,this[l]=null,this.writable=!0,this.readable=!0,this[P]=0,this[D]=!1}get bufferLength(){return this[P]}get encoding(){return this[y]}set encoding(E){if(this[S])throw new Error("cannot set encoding in objectMode");if(this[y]&&E!==this[y]&&(this[p]&&this[p].lastNeed||this[P]))throw new Error("cannot change encoding");this[y]!==E&&(this[p]=E?new s(E):null,this.buffer.length&&(this.buffer=this.buffer.map(R=>this[p].write(R)))),this[y]=E}setEncoding(E){this.encoding=E}get objectMode(){return this[S]}set objectMode(E){this[S]=this[S]||!!E}get async(){return this[K]}set async(E){this[K]=this[K]||!!E}write(E,R,x){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 R=="function"&&(x=R,R="utf8"),R||(R="utf8");let H=this[K]?te:$=>$();return!this[S]&&!Buffer.isBuffer(E)&&(Z(E)?E=Buffer.from(E.buffer,E.byteOffset,E.byteLength):z(E)?E=Buffer.from(E):typeof E!="string"&&(this.objectMode=!0)),this[S]?(this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[F](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):E.length?(typeof E=="string"&&!(R===this[y]&&!this[p].lastNeed)&&(E=Buffer.from(E,R)),Buffer.isBuffer(E)&&this[y]&&(E=this[p].write(E)),this.flowing&&this[P]!==0&&this[d](!0),this.flowing?this.emit("data",E):this[F](E),this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing):(this[P]!==0&&this.emit("readable"),x&&H(x),this.flowing)}read(E){if(this[D])return null;if(this[P]===0||E===0||E>this[P])return this[a](),null;this[S]&&(E=null),this.buffer.length>1&&!this[S]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[P])]);let R=this[f](E||null,this.buffer[0]);return this[a](),R}[f](E,R){return E===R.length||E===null?this[M]():(this.buffer[0]=R.slice(E),R=R.slice(0,E),this[P]-=E),this.emit("data",R),!this.buffer.length&&!this[o]&&this.emit("drain"),R}end(E,R,x){return typeof E=="function"&&(x=E,E=null),typeof R=="function"&&(x=R,R="utf8"),E&&this.write(E,R),x&&this.once("end",x),this[o]=!0,this.writable=!1,(this.flowing||!this[C])&&this[a](),this}[k](){this[D]||(this[C]=!1,this[v]=!0,this.emit("resume"),this.buffer.length?this[d]():this[o]?this[a]():this.emit("drain"))}resume(){return this[k]()}pause(){this[v]=!1,this[C]=!0}get destroyed(){return this[D]}get flowing(){return this[v]}get paused(){return this[C]}[F](E){this[S]?this[P]+=1:this[P]+=E.length,this.buffer.push(E)}[M](){return this.buffer.length&&(this[S]?this[P]-=1:this[P]-=this.buffer[0].length),this.buffer.shift()}[d](E){do;while(this[m](this[M]()));!E&&!this.buffer.length&&!this[o]&&this.emit("drain")}[m](E){return E?(this.emit("data",E),this.flowing):!1}pipe(E,R){if(this[D])return;let x=this[u];return R=R||{},E===r.stdout||E===r.stderr?R.end=!1:R.end=R.end!==!1,R.proxyErrors=!!R.proxyErrors,x?R.end&&E.end():(this.pipes.push(R.proxyErrors?new g(this,E,R):new q(this,E,R)),this[K]?te(()=>this[k]()):this[k]()),E}unpipe(E){let R=this.pipes.find(x=>x.dest===E);R&&(this.pipes.splice(this.pipes.indexOf(R),1),R.unpipe())}addListener(E,R){return this.on(E,R)}on(E,R){let x=super.on(E,R);return E==="data"&&!this.pipes.length&&!this.flowing?this[k]():E==="readable"&&this[P]!==0?super.emit("readable"):L(E)&&this[u]?(super.emit(E),this.removeAllListeners(E)):E==="error"&&this[l]&&(this[K]?te(()=>R.call(this,this[l])):R.call(this,this[l])),x}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(E,R,...x){if(E!=="error"&&E!=="close"&&E!==D&&this[D])return;if(E==="data")return R?this[K]?te(()=>this[j](R)):this[j](R):!1;if(E==="end")return this[W]();if(E==="close"){if(this[h]=!0,!this[u]&&!this[D])return;let $=super.emit("close");return this.removeAllListeners("close"),$}else if(E==="error"){this[l]=R;let $=super.emit("error",R);return this[a](),$}else if(E==="resume"){let $=super.emit("resume");return this[a](),$}else if(E==="finish"||E==="prefinish"){let $=super.emit(E);return this.removeAllListeners(E),$}let H=super.emit(E,R,...x);return this[a](),H}[j](E){for(let x of this.pipes)x.dest.write(E)===!1&&this.pause();let R=super.emit("data",E);return this[a](),R}[W](){this[u]||(this[u]=!0,this.readable=!1,this[K]?te(()=>this[N]()):this[N]())}[N](){if(this[p]){let R=this[p].end();if(R){for(let x of this.pipes)x.dest.write(R);super.emit("data",R)}}for(let R of this.pipes)R.end();let E=super.emit("end");return this.removeAllListeners("end"),E}collect(){let E=[];this[S]||(E.dataLength=0);let R=this.promise();return this.on("data",x=>{E.push(x),this[S]||(E.dataLength+=x.length)}),R.then(()=>E)}concat(){return this[S]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(E=>this[S]?Promise.reject(new Error("cannot concat in objectMode")):this[y]?E.join(""):Buffer.concat(E,E.dataLength))}promise(){return new Promise((E,R)=>{this.on(D,()=>R(new Error("stream destroyed"))),this.on("error",x=>R(x)),this.on("end",()=>E())})}[U](){return{next:()=>{let E=this.read();if(E!==null)return Promise.resolve({done:!1,value:E});if(this[o])return Promise.resolve({done:!0});let R=null,x=null,H=he=>{this.removeListener("data",$),this.removeListener("end",re),x(he)},$=he=>{this.removeListener("error",H),this.removeListener("end",re),this.pause(),R({value:he,done:!!this[o]})},re=()=>{this.removeListener("error",H),this.removeListener("data",$),R({done:!0})},V=()=>H(new Error("stream destroyed"));return new Promise((he,J)=>{x=J,R=he,this.once(D,V),this.once("error",H),this.once("end",re),this.once("data",$)})}}}[I](){return{next:()=>{let E=this.read();return{value:E,done:E===null}}}}destroy(E){return this[D]?(E?this.emit("error",E):this.emit(D),this):(this[D]=!0,this.buffer.length=0,this[P]=0,typeof this.close=="function"&&!this[h]&&this.close(),E?this.emit("error",E):this.emit(D),this)}static isStream(E){return!!E&&(E instanceof wR||E instanceof n||E instanceof i&&(typeof E.pipe=="function"||typeof E.write=="function"&&typeof E.end=="function"))}}}),SR=de(t=>{"use strict";Q();var e=ye("assert"),r=ye("buffer").Buffer,i=ye("zlib"),n=t.constants=PH(),s=vR(),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"),m=Symbol("onError"),y=Symbol("sawError"),p=Symbol("level"),v=Symbol("strategy"),C=Symbol("ended"),k=Symbol("_defaultFullFlush"),P=class extends s{constructor(L,z){if(!L||typeof L!="object")throw new TypeError("invalid options for ZlibBase constructor");super(L),this[y]=!1,this[C]=!1,this[c]=L,this[l]=L.flush,this[h]=L.finishFlush;try{this[d]=new i[z](L)}catch(Z){throw new u(Z)}this[m]=Z=>{this[y]||(this[y]=!0,this.close(),this.emit("error",Z))},this[d].on("error",Z=>this[m](new u(Z))),this.once("end",()=>this.close)}close(){this[d]&&(this[d].close(),this[d]=null,this.emit("close"))}reset(){if(!this[y])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,z,Z){return L&&this.write(L,z),this.flush(this[h]),this[C]=!0,super.end(null,null,Z)}get ended(){return this[C]}write(L,z,Z){if(typeof z=="function"&&(Z=z,z="utf8"),typeof L=="string"&&(L=r.from(L,z)),this[y])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=x=>x;let E;try{let x=typeof L[l]=="number"?L[l]:this[l];E=this[d]._processChunk(L,x),r.concat=o}catch(x){r.concat=o,this[m](new u(x))}finally{this[d]&&(this[d]._handle=q,q.close=g,this[d].close=_,this[d].removeAllListeners("error"))}this[d]&&this[d].on("error",x=>this[m](new u(x)));let R;if(E)if(Array.isArray(E)&&E.length>0){R=this[a](r.from(E[0]));for(let x=1;x<E.length;x++)R=this[a](E[x])}else R=this[a](r.from(E));return Z&&Z(),R}[a](L){return super.write(L)}},F=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.Z_NO_FLUSH,L.finishFlush=L.finishFlush||n.Z_FINISH,super(L,z),this[f]=n.Z_FULL_FLUSH,this[p]=L.level,this[v]=L.strategy}params(L,z){if(!this[y]){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[v]!==z){this.flush(n.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,z)}finally{this[d].flush=Z}this[d]&&(this[p]=L,this[v]=z)}}}},M=class extends F{constructor(L){super(L,"Deflate")}},S=class extends F{constructor(L){super(L,"Inflate")}},D=Symbol("_portable"),j=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)}},W=class extends F{constructor(L){super(L,"Gunzip")}},N=class extends F{constructor(L){super(L,"DeflateRaw")}},K=class extends F{constructor(L){super(L,"InflateRaw")}},te=class extends F{constructor(L){super(L,"Unzip")}},ne=class extends P{constructor(L,z){L=L||{},L.flush=L.flush||n.BROTLI_OPERATION_PROCESS,L.finishFlush=L.finishFlush||n.BROTLI_OPERATION_FINISH,super(L,z),this[f]=n.BROTLI_OPERATION_FLUSH}},U=class extends ne{constructor(L){super(L,"BrotliCompress")}},I=class extends ne{constructor(L){super(L,"BrotliDecompress")}};t.Deflate=M,t.Inflate=S,t.Gzip=j,t.Gunzip=W,t.DeflateRaw=N,t.InflateRaw=K,t.Unzip=te,typeof i.BrotliCompress=="function"?(t.BrotliCompress=U,t.BrotliDecompress=I):t.BrotliCompress=t.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}}),pa=de((t,e)=>{Q();var r=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform;e.exports=r!=="win32"?i=>i:i=>i&&i.replace(/\\/g,"/")}),Qy=de((t,e)=>{"use strict";Q();var r=Xy(),i=pa(),n=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=i(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=i(s.linkpath),this.uname=s.uname,this.gname=s.gname,o&&this[n](o),a&&this[n](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))}[n](s,o){for(let a in s)s[a]!==null&&s[a]!==void 0&&!(o&&a==="path")&&(this[a]=a==="path"||a==="linkpath"?i(s[a]):s[a])}}}),xR=de(t=>{"use strict";Q(),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]]))}),IH=de((t,e)=>{"use strict";Q();var r=(l,h)=>{if(Number.isSafeInteger(l))l<0?n(l,h):i(l,h);else throw Error("cannot encode number outside of javascript safe integer range");return h},i=(l,h)=>{h[0]=128;for(var f=h.length;f>1;f--)h[f-1]=l&255,l=Math.floor(l/256)},n=(l,h)=>{h[0]=255;var f=!1;l=l*-1;for(var d=h.length;d>1;d--){var m=l&255;l=Math.floor(l/256),f?h[d-1]=u(m):m===0?h[d-1]=0:(f=!0,h[d-1]=c(m))}},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,m=h-1;m>-1;m--){var y=l[m],p;d?p=u(y):y===0?p=y:(d=!0,p=c(y)),p!==0&&(f-=p*Math.pow(256,h-m-1))}return f},a=l=>{for(var h=l.length,f=0,d=h-1;d>-1;d--){var m=l[d];m!==0&&(f+=m*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}}),ma=de((t,e)=>{"use strict";Q();var r=xR(),i=ye("path").posix,n=IH(),s=Symbol("slurp"),o=Symbol("type"),a=class{constructor(S,D,j,W){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(S)?this.decode(S,D||0,j,W):S&&this.set(S)}decode(S,D,j,W){if(D||(D=0),!S||!(S.length>=D+512))throw new Error("need 512 bytes for header");if(this.path=c(S,D,100),this.mode=f(S,D+100,8),this.uid=f(S,D+108,8),this.gid=f(S,D+116,8),this.size=f(S,D+124,12),this.mtime=l(S,D+136,12),this.cksum=f(S,D+148,12),this[s](j),this[s](W,!0),this[o]=c(S,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(S,D+157,100),S.slice(D+257,D+265).toString()==="ustar\x0000")if(this.uname=c(S,D+265,32),this.gname=c(S,D+297,32),this.devmaj=f(S,D+329,8),this.devmin=f(S,D+337,8),S[D+475]!==0){let K=c(S,D+345,155);this.path=K+"/"+this.path}else{let K=c(S,D+345,130);K&&(this.path=K+"/"+this.path),this.atime=l(S,D+476,12),this.ctime=l(S,D+488,12)}let N=8*32;for(let K=D;K<D+148;K++)N+=S[K];for(let K=D+156;K<D+512;K++)N+=S[K];this.cksumValid=N===this.cksum,this.cksum===null&&N===8*32&&(this.nullBlock=!0)}[s](S,D){for(let j in S)S[j]!==null&&S[j]!==void 0&&!(D&&j==="path")&&(this[j]=S[j])}encode(S,D){if(S||(S=this.block=Buffer.alloc(512),D=0),D||(D=0),!(S.length>=D+512))throw new Error("need 512 bytes for header");let j=this.ctime||this.atime?130:155,W=u(this.path||"",j),N=W[0],K=W[1];this.needPax=W[2],this.needPax=M(S,D,100,N)||this.needPax,this.needPax=p(S,D+100,8,this.mode)||this.needPax,this.needPax=p(S,D+108,8,this.uid)||this.needPax,this.needPax=p(S,D+116,8,this.gid)||this.needPax,this.needPax=p(S,D+124,12,this.size)||this.needPax,this.needPax=P(S,D+136,12,this.mtime)||this.needPax,S[D+156]=this[o].charCodeAt(0),this.needPax=M(S,D+157,100,this.linkpath)||this.needPax,S.write("ustar\x0000",D+257,8),this.needPax=M(S,D+265,32,this.uname)||this.needPax,this.needPax=M(S,D+297,32,this.gname)||this.needPax,this.needPax=p(S,D+329,8,this.devmaj)||this.needPax,this.needPax=p(S,D+337,8,this.devmin)||this.needPax,this.needPax=M(S,D+345,j,K)||this.needPax,S[D+475]!==0?this.needPax=M(S,D+345,155,K)||this.needPax:(this.needPax=M(S,D+345,130,K)||this.needPax,this.needPax=P(S,D+476,12,this.atime)||this.needPax,this.needPax=P(S,D+488,12,this.ctime)||this.needPax);let te=8*32;for(let ne=D;ne<D+148;ne++)te+=S[ne];for(let ne=D+156;ne<D+512;ne++)te+=S[ne];return this.cksum=te,p(S,D+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(S){for(let D in S)S[D]!==null&&S[D]!==void 0&&(this[D]=S[D])}get type(){return r.name.get(this[o])||this[o]}get typeKey(){return this[o]}set type(S){r.code.has(S)?this[o]=r.code.get(S):this[o]=S}},u=(S,D)=>{let j=S,W="",N,K=i.parse(S).root||".";if(Buffer.byteLength(j)<100)N=[j,W,!1];else{W=i.dirname(j),j=i.basename(j);do Buffer.byteLength(j)<=100&&Buffer.byteLength(W)<=D?N=[j,W,!1]:Buffer.byteLength(j)>100&&Buffer.byteLength(W)<=D?N=[j.slice(0,100-1),W,!0]:(j=i.join(i.basename(W),j),W=i.dirname(W));while(W!==K&&!N);N||(N=[S.slice(0,100-1),"",!0])}return N},c=(S,D,j)=>S.slice(D,D+j).toString("utf8").replace(/\0.*/,""),l=(S,D,j)=>h(f(S,D,j)),h=S=>S===null?null:new Date(S*1e3),f=(S,D,j)=>S[D]&128?n.parse(S.slice(D,D+j)):m(S,D,j),d=S=>isNaN(S)?null:S,m=(S,D,j)=>d(parseInt(S.slice(D,D+j).toString("utf8").replace(/\0.*$/,"").trim(),8)),y={12:8589934591,8:2097151},p=(S,D,j,W)=>W===null?!1:W>y[j]||W<0?(n.encode(W,S.slice(D,D+j)),!0):(v(S,D,j,W),!1),v=(S,D,j,W)=>S.write(C(W,j),D,j,"ascii"),C=(S,D)=>k(Math.floor(S).toString(8),D),k=(S,D)=>(S.length===D-1?S:new Array(D-S.length-1).join("0")+S+" ")+"\0",P=(S,D,j,W)=>W===null?!1:p(S,D,j,W.getTime()/1e3),F=new Array(156).join("\0"),M=(S,D,j,W)=>W===null?!1:(S.write(W+F,D,j,"utf8"),W.length!==Buffer.byteLength(W)||W.length>j);e.exports=a}),e0=de((t,e)=>{"use strict";Q();var r=ma(),i=ye("path"),n=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/"+i.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+`
|
55
55
|
`,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}};n.parse=(u,c,l)=>new n(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(`
|
56
|
-
`).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=n}),ya=de((t,e)=>{Q(),e.exports=r=>{let i=r.length-1,n=-1;for(;i>-1&&r.charAt(i)==="/";)n=i,i--;return n===-1?r:r.slice(0,n)}}),t0=de((t,e)=>{"use strict";Q(),e.exports=r=>class extends r{warn(i,n,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=n instanceof Error&&n.code||i,s.tarCode=i,!this.strict&&s.recoverable!==!1?(n instanceof Error&&(s=Object.assign(n,s),n=n.message),this.emit("warn",s.tarCode,n,s)):n instanceof Error?this.emit("error",Object.assign(n,s)):this.emit("error",Object.assign(new Error(`${i}: ${n}`),s))}}}),DR=de((t,e)=>{"use strict";Q();var r=["|","<",">","?",":"],i=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),n=new Map(r.map((o,a)=>[o,i[a]])),s=new Map(i.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(n.get(u)),o),decode:o=>i.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),AR=de((t,e)=>{Q();var{isAbsolute:r,parse:i}=ye("path").win32;e.exports=n=>{let s="",o=i(n);for(;r(n)||o.root;){let a=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":o.root;n=n.slice(a.length),s+=a,o=i(n)}return[s,n]}}),LH=de((t,e)=>{"use strict";Q(),e.exports=(r,i,n)=>(r&=4095,n&&(r=(r|384)&-19),i&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),CR=de((t,e)=>{"use strict";Q();var r=Xy(),i=e0(),n=ma(),s=ye("fs"),o=ye("path"),a=pa(),u=ya(),c=(_,E)=>E?(_=a(_).replace(/^\.(\/|$)/,""),u(E)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),m=Symbol("symlink"),y=Symbol("hardlink"),p=Symbol("header"),v=Symbol("read"),C=Symbol("lstat"),k=Symbol("onlstat"),P=Symbol("onread"),F=Symbol("onreadlink"),M=Symbol("openfile"),S=Symbol("onopenfile"),D=Symbol("close"),j=Symbol("mode"),W=Symbol("awaitDrain"),N=Symbol("ondrain"),K=Symbol("prefix"),te=Symbol("hadError"),ne=t0(),U=DR(),I=AR(),L=LH(),z=ne(class extends r{constructor(_,E){if(E=E||{},super(E),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!E.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=E.maxReadSize||l,this.linkCache=E.linkCache||new Map,this.statCache=E.statCache||new Map,this.preservePaths=!!E.preservePaths,this.cwd=a(E.cwd||process.cwd()),this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.mtime=E.mtime||null,this.prefix=E.prefix?a(E.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 E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.win32=!!E.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(E.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.statCache.has(this.absolute)?this[k](this.statCache.get(this.absolute)):this[C]()}emit(_,...E){return _==="error"&&(this[te]=!0),super.emit(_,...E)}[C](){s.lstat(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[k](E)})}[k](_){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[m]();default:return this.end()}}[j](_){return L(_,this.type==="Directory",this.portable)}[K](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,mode:this[j](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 i({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()}[m](){s.readlink(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[F](E)})}[F](_){this.linkpath=a(_),this[p](),this.end()}[y](_){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 E=this.linkCache.get(_);if(E.indexOf(this.cwd)===0)return this[y](E)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,E)=>{if(_)return this.emit("error",_);this[S](E)})}[S](_){if(this.fd=_,this[te])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let E=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(E),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[v]()}[v](){let{fd:_,buf:E,offset:R,length:x,pos:H}=this;s.read(_,E,R,x,H,($,re)=>{if($)return this[D](()=>this.emit("error",$));this[P](re)})}[D](_){s.close(this.fd,_)}[P](_){if(_<=0&&this.remain>0){let R=new Error("encountered unexpected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_>this.remain){let R=new Error("did not encounter expected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_===this.remain)for(let R=_;R<this.length&&_<this.blockRemain;R++)this.buf[R+this.offset]=0,_++,this.remain++;let E=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(E)?this[N]():this[W](()=>this[N]())}[W](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let E=new Error("writing more data than expected");return E.path=this.absolute,this.emit("error",E)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[N](){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[v]()}}),Z=class extends z{[C](){this[k](s.lstatSync(this.absolute))}[m](){this[F](s.readlinkSync(this.absolute))}[M](){this[S](s.openSync(this.absolute,"r"))}[v](){let _=!0;try{let{fd:E,buf:R,offset:x,length:H,pos:$}=this,re=s.readSync(E,R,x,H,$);this[P](re),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[W](_){_()}[D](_){s.closeSync(this.fd),_()}},q=ne(class extends r{constructor(_,E){E=E||{},super(E),this.preservePaths=!!E.preservePaths,this.portable=!!E.portable,this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=E.prefix||null,this.path=a(_.path),this.mode=this[j](_.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:E.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new n({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}),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.header.encode()&&!this.noPax&&super.write(new i({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)}[j](_){return L(_,this.type==="Directory",this.portable)}write(_){let E=_.length;if(E>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=E,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});z.Sync=Z,z.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=z}),BH=de((t,e)=>{"use strict";Q(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let i=this.head;i;i=i.next)yield i.value}}}),RR=de((t,e)=>{"use strict";Q(),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++)n(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=i(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 i(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 n(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{BH()(r)}catch{}}),r0=de((t,e)=>{"use strict";Q();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}},i=Xy(),n=SR(),s=Qy(),o=CR(),a=o.Sync,u=o.Tar,c=RR(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),p=Symbol("processing"),v=Symbol("processJob"),C=Symbol("jobs"),k=Symbol("jobDone"),P=Symbol("addFSEntry"),F=Symbol("addTarEntry"),M=Symbol("stat"),S=Symbol("readdir"),D=Symbol("onreaddir"),j=Symbol("pipe"),W=Symbol("entry"),N=Symbol("entryOpt"),K=Symbol("writeEntryClass"),te=Symbol("write"),ne=Symbol("ondrain"),U=ye("fs"),I=ye("path"),L=t0(),z=pa(),Z=L(class extends i{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=z(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 n.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[C]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[te](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[y](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[F](g):this[P](g),this.flowing}[F](g){let _=z(I.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let E=new r(g.path,_,!1);E.entry=new u(g,this[N](E)),E.entry.on("end",R=>this[k](E)),this[C]+=1,this[d].push(E)}this[y]()}[P](g){let _=z(I.resolve(this.cwd,g));this[d].push(new r(g,_)),this[y]()}[M](g){g.pending=!0,this[C]+=1;let _=this.follow?"stat":"lstat";U[_](g.absolute,(E,R)=>{g.pending=!1,this[C]-=1,E?this.emit("error",E):this[h](g,R)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[y]()}[S](g){g.pending=!0,this[C]+=1,U.readdir(g.absolute,(_,E)=>{if(g.pending=!1,this[C]-=1,_)return this.emit("error",_);this[D](g,E)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[y]()}[y](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[C]<this.jobs;g=g.next)if(this[v](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[C]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[m](){return this[d]&&this[d].head&&this[d].head.value}[k](g){this[d].shift(),this[C]-=1,this[y]()}[v](g){if(!g.pending){if(g.entry){g===this[m]&&!g.piped&&this[j](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[S](g),!g.readdir))){if(g.entry=this[W](g),!g.entry){g.ignore=!0;return}g===this[m]&&!g.piped&&this[j](g)}}}[N](g){return{onwarn:(_,E,R)=>this.warn(_,E,R),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}}[W](g){this[C]+=1;try{return new this[K](g.path,this[N](g)).on("end",()=>this[k](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[ne](){this[m]&&this[m].entry&&this[m].entry.resume()}[j](g){g.piped=!0,g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)});let _=g.entry,E=this.zip;E?_.on("data",R=>{E.write(R)||_.pause()}):_.on("data",R=>{super.write(R)||_.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,U[_](g.absolute))}[S](g,_){this[D](g,U.readdirSync(g.absolute))}[j](g){let _=g.entry,E=this.zip;g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)}),E?_.on("data",R=>{E.write(R)}):_.on("data",R=>{super[te](R)})}};Z.Sync=q,e.exports=Z}),ga=de(t=>{"use strict";Q();var e=vR(),r=ye("events").EventEmitter,i=ye("fs"),n=i.writev;if(!n){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;n=(E,R,x,H)=>{let $=(V,he)=>H(V,he,R),re=new _;re.oncomplete=$,g.writeBuffers(E,R,x,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"),m=Symbol("_mode"),y=Symbol("_needDrain"),p=Symbol("_onerror"),v=Symbol("_onopen"),C=Symbol("_onread"),k=Symbol("_onwrite"),P=Symbol("_open"),F=Symbol("_path"),M=Symbol("_pos"),S=Symbol("_queue"),D=Symbol("_read"),j=Symbol("_readSize"),W=Symbol("_reading"),N=Symbol("_remain"),K=Symbol("_size"),te=Symbol("_write"),ne=Symbol("_writing"),U=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[j]=_.readSize||16*1024*1024,this[W]=!1,this[K]=typeof _.size=="number"?_.size:1/0,this[N]=this[K],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[P]()}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")}[P](){i.open(this[F],"r",(g,_)=>this[v](g,_))}[v](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[j],this[N]))}[D](){if(!this[W]){this[W]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[C](null,0,g));i.read(this[u],g,0,g.length,null,(_,E,R)=>this[C](_,E,R))}}[C](g,_,E){this[W]=!1,g?this[p](g):this[f](_,E)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[W]=!0,this[o](),this.emit("error",g)}[f](g,_){let E=!1;return this[N]-=g,g>0&&(E=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[N]<=0)&&(E=!1,this[o](),super.end()),E}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,_)}}},z=class extends L{[P](){let g=!0;try{this[v](null,i.openSync(this[F],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[W]){this[W]=!0;do{let _=this[d](),E=_.length===0?0:i.readSync(this[u],_,0,_.length,null);if(!this[f](E,_))break}while(!0);this[W]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.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[y]=!1,this[S]=[],this[F]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[m]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let E=this[M]!==null?"r+":"w";this[U]=_.flags===void 0,this[l]=this[U]?E:_.flags,this[u]===null&&this[P]()}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)}[P](){i.open(this[F],this[l],this[m],(g,_)=>this[v](g,_))}[v](g,_){this[U]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[P]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[ne]&&!this[S].length&&typeof this[u]=="number"&&this[k](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[S].length?(this[S].push(g),this[y]=!0,!1):(this[ne]=!0,this[te](g),!0)}[te](g){i.write(this[u],g,0,g.length,this[M],(_,E)=>this[k](_,E))}[k](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[S].length?this[h]():(this[ne]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[S].length===0)this[a]&&this[k](null,0);else if(this[S].length===1)this[te](this[S].pop());else{let g=this[S];this[S]=[],n(this[u],g,this[M],(_,E)=>this[k](_,E))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[P](){let g;if(this[U]&&this[l]==="r+")try{g=i.openSync(this[F],this[l],this[m])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[P]();throw _}else g=i.openSync(this[F],this[l],this[m]);this[v](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.closeSync(g),this.emit("close")}}[te](g){let _=!0;try{this[k](null,i.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=z,t.WriteStream=Z,t.WriteStreamSync=q}),i0=de((t,e)=>{"use strict";Q();var r=t0(),i=ma(),n=ye("events"),s=RR(),o=1024*1024,a=Qy(),u=e0(),c=SR(),{nextTick:l}=ye("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),m=Symbol("readEntry"),y=Symbol("nextEntry"),p=Symbol("processEntry"),v=Symbol("extendedHeader"),C=Symbol("globalExtendedHeader"),k=Symbol("meta"),P=Symbol("emitMeta"),F=Symbol("buffer"),M=Symbol("queue"),S=Symbol("ended"),D=Symbol("emittedEnd"),j=Symbol("emit"),W=Symbol("unzip"),N=Symbol("consumeChunk"),K=Symbol("consumeChunkSub"),te=Symbol("consumeBody"),ne=Symbol("consumeMeta"),U=Symbol("consumeHeader"),I=Symbol("consuming"),L=Symbol("bufferConcat"),z=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),E=Symbol("sawNullBlock"),R=Symbol("sawEOF"),x=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends n{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[m]=null,this[d]=null,this[f]="begin",this[k]="",this[v]=null,this[C]=null,this[S]=!1,this[W]=null,this[q]=!1,this[E]=!1,this[R]=!1,this.on("end",()=>this[x]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,re){this[_]===null&&(this[_]=!1);let V;try{V=new i($,re,this[v],this[C])}catch(he){return this.warn("TAR_ENTRY_INVALID",he)}if(V.nullBlock)this[E]?(this[R]=!0,this[f]==="begin"&&(this[f]="header"),this[j]("eof")):(this[E]=!0,this[j]("nullBlock"));else if(this[E]=!1,!V.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:V});else if(!V.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:V});else{let he=V.type;if(/^(Symbolic)?Link$/.test(he)&&!V.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:V});else if(!/^(Symbolic)?Link$/.test(he)&&V.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:V});else{let J=this[d]=new a(V,this[v],this[C]);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[j]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[k]="",J.on("data",w=>this[k]+=w),this[f]="meta"):(this[v]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[j]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[m]?this[M].push(J):(this[M].push(J),this[y]())))}}}[x](){l(()=>this.emit("close"))}[p]($){let re=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[m]=$,this.emit("entry",$),$.emittedEnd||($.on("end",V=>this[y]()),re=!1)):(this[m]=null,re=!1),re}[y](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[m];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",re=>this.emit("drain"))}}[te]($,re){let V=this[d],he=V.blockRemain,J=he>=$.length&&re===0?$:$.slice(re,re+he);return V.write(J),V.blockRemain||(this[f]="header",this[d]=null,V.end()),J.length}[ne]($,re){let V=this[d],he=this[te]($,re);return this[d]||this[P](V),he}[j]($,re,V){!this[M].length&&!this[m]?this.emit($,re,V):this[M].push([$,re,V])}[P]($){switch(this[j]("meta",this[k]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[v]=u.parse(this[k],this[v],!1);break;case"GlobalExtendedHeader":this[C]=u.parse(this[k],this[C],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[v]=this[v]||Object.create(null),this[v].path=this[k].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[v]=this[v]||Object.create(null),this[v].linkpath=this[k].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[W]===null&&$){if(this[F]&&($=Buffer.concat([this[F],$]),this[F]=null),$.length<h.length)return this[F]=$,!0;for(let V=0;this[W]===null&&V<h.length;V++)$[V]!==h[V]&&(this[W]=!1);if(this[W]===null){let V=this[S];this[S]=!1,this[W]=new c.Unzip,this[W].on("data",J=>this[N](J)),this[W].on("error",J=>this.abort(J)),this[W].on("end",J=>{this[S]=!0,this[N]()}),this[Z]=!0;let he=this[W][V?"end":"write"]($);return this[Z]=!1,he}}this[Z]=!0,this[W]?this[W].write($):this[N]($),this[Z]=!1;let re=this[M].length?!1:this[m]?this[m].flowing:!0;return!re&&!this[M].length&&this[m].once("drain",V=>this.emit("drain")),re}[L]($){$&&!this[q]&&(this[F]=this[F]?Buffer.concat([this[F],$]):$)}[z](){if(this[S]&&!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[j](g)}}[N]($){if(this[I])this[L]($);else if(!$&&!this[F])this[z]();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[R];){let re=this[F];this[F]=null,this[K](re)}this[I]=!1}(!this[F]||this[S])&&this[z]()}[K]($){let re=0,V=$.length;for(;re+512<=V&&!this[q]&&!this[R];)switch(this[f]){case"begin":case"header":this[U]($,re),re+=512;break;case"ignore":case"body":re+=this[te]($,re);break;case"meta":re+=this[ne]($,re);break;default:throw new Error("invalid state: "+this[f])}re<V&&(this[F]?this[F]=Buffer.concat([$.slice(re),this[F]]):this[F]=$.slice(re))}end($){this[q]||(this[W]?this[W].end($):(this[S]=!0,this.write($)))}})}),n0=de((t,e)=>{"use strict";Q();var r=da(),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&c(p,m),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,y):f(p)};var u=d=>{let m=d.onentry;d.onentry=m?y=>{m(y),y.resume()}:y=>y.resume()},c=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,k)=>{let P=k||o.parse(C).root||".",F=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,F),F};d.filter=p?(C,k)=>p(C,k)&&v(a(C)):C=>v(a(C))},l=d=>{let m=f(d),y=d.file,p=!0,v;try{let C=n.statSync(y),k=d.maxReadSize||16*1024*1024;if(C.size<k)m.end(n.readFileSync(y));else{let P=0,F=Buffer.allocUnsafe(k);for(v=n.openSync(y,"r");P<C.size;){let M=n.readSync(v,F,0,k,P);P+=M,m.write(F.slice(0,M))}m.end()}p=!1}finally{if(p&&v)try{n.closeSync(v)}catch{}}},h=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((k,P)=>{y.on("error",P),y.on("end",k),n.stat(v,(F,M)=>{if(F)P(F);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},f=d=>new i(d)}),NH=de((t,e)=>{"use strict";Q();var r=da(),i=r0(),n=ga(),s=n0(),o=ye("path");e.exports=(d,m,y)=>{if(typeof m=="function"&&(y=m),Array.isArray(d)&&(m=d,d={}),!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");m=Array.from(m);let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,m):p.file?u(p,m,y):p.sync?h(p,m):f(p,m)};var a=(d,m)=>{let y=new i.Sync(d),p=new n.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(p),c(y,m)},u=(d,m,y)=>{let p=new i(d),v=new n.WriteStream(d.file,{mode:d.mode||438});p.pipe(v);let C=new Promise((k,P)=>{v.on("error",P),v.on("close",k),p.on("error",P)});return l(p,m),y?C.then(y,y):C},c=(d,m)=>{m.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(y)}),d.end()},l=(d,m)=>{for(;m.length;){let y=m.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,m));d.add(y)}d.end()},h=(d,m)=>{let y=new i.Sync(d);return c(y,m),y},f=(d,m)=>{let y=new i(d);return l(y,m),y}}),TR=de((t,e)=>{"use strict";Q();var r=da(),i=r0(),n=ye("fs"),s=ga(),o=n0(),a=ye("path"),u=ma();e.exports=(m,y,p)=>{let v=r(m);if(!v.file)throw new TypeError("file is required");if(v.gzip)throw new TypeError("cannot append to compressed archives");if(!y||!Array.isArray(y)||!y.length)throw new TypeError("no files or directories specified");return y=Array.from(y),v.sync?c(v,y):h(v,y,p)};var c=(m,y)=>{let p=new i.Sync(m),v=!0,C,k;try{try{C=n.openSync(m.file,"r+")}catch(M){if(M.code==="ENOENT")C=n.openSync(m.file,"w+");else throw M}let P=n.fstatSync(C),F=Buffer.alloc(512);e:for(k=0;k<P.size;k+=512){for(let D=0,j=0;D<512;D+=j){if(j=n.readSync(C,F,D,F.length-D,k+D),k===0&&F[0]===31&&F[1]===139)throw new Error("cannot append to compressed archives");if(!j)break e}let M=new u(F);if(!M.cksumValid)break;let S=512*Math.ceil(M.size/512);if(k+S+512>P.size)break;k+=S,m.mtimeCache&&m.mtimeCache.set(M.path,M.mtime)}v=!1,l(m,p,k,C,y)}finally{if(v)try{n.closeSync(C)}catch{}}},l=(m,y,p,v,C)=>{let k=new s.WriteStreamSync(m.file,{fd:v,start:p});y.pipe(k),f(y,C)},h=(m,y,p)=>{y=Array.from(y);let v=new i(m),C=(P,F,M)=>{let S=(K,te)=>{K?n.close(P,ne=>M(K)):M(null,te)},D=0;if(F===0)return S(null,0);let j=0,W=Buffer.alloc(512),N=(K,te)=>{if(K)return S(K);if(j+=te,j<512&&te)return n.read(P,W,j,W.length-j,D+j,N);if(D===0&&W[0]===31&&W[1]===139)return S(new Error("cannot append to compressed archives"));if(j<512)return S(null,D);let ne=new u(W);if(!ne.cksumValid)return S(null,D);let U=512*Math.ceil(ne.size/512);if(D+U+512>F||(D+=U+512,D>=F))return S(null,D);m.mtimeCache&&m.mtimeCache.set(ne.path,ne.mtime),j=0,n.read(P,W,0,512,D,N)};n.read(P,W,0,512,D,N)},k=new Promise((P,F)=>{v.on("error",F);let M="r+",S=(D,j)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",n.open(m.file,M,S);if(D)return F(D);n.fstat(j,(W,N)=>{if(W)return n.close(j,()=>F(W));C(j,N.size,(K,te)=>{if(K)return F(K);let ne=new s.WriteStream(m.file,{fd:j,start:te});v.pipe(ne),ne.on("error",F),ne.on("close",P),d(v,y)})})};n.open(m.file,M,S)});return p?k.then(p,p):k},f=(m,y)=>{y.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(m.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:v=>m.add(v)}):m.add(p)}),m.end()},d=(m,y)=>{for(;y.length;){let p=y.shift();if(p.charAt(0)==="@")return o({file:a.resolve(m.cwd,p.slice(1)),noResume:!0,onentry:v=>m.add(v)}).then(v=>d(m,y));m.add(p)}m.end()}}),MH=de((t,e)=>{"use strict";Q();var r=da(),i=TR();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),n(u),i(u,o,a)};var n=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)}}),jH=de((t,e)=>{Q();var{promisify:r}=ye("util"),i=ye("fs"),n=s=>{if(!s)s={mode:511,fs:i};else if(typeof s=="object")s={mode:511,fs:i,...s};else if(typeof s=="number")s={mode:s,fs:i};else if(typeof s=="string")s={mode:parseInt(s,8),fs:i};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||i.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||i.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||i.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||i.mkdirSync,s};e.exports=n}),qH=de((t,e)=>{Q();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=ye("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=i(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=n(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}),UH=de((t,e)=>{Q();var{dirname:r}=ye("path"),i=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?i(s,r(o),o):void 0),n=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?n(s,r(o),o):void 0}};e.exports={findMade:i,findMadeSync:n}}),kR=de((t,e)=>{Q();var{dirname:r}=ye("path"),i=(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 i(u,o).then(l=>i(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})})},n=(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 n(s,o,n(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:i,mkdirpManualSync:n}}),HH=de((t,e)=>{Q();var{dirname:r}=ye("path"),{findMade:i,findMadeSync:n}=UH(),{mkdirpManual:s,mkdirpManualSync:o}=kR(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):i(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=n(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}}),$H=de((t,e)=>{Q();var r=ye("fs"),i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n=i.replace(/^v/,"").split("."),s=+n[0]>10||+n[0]==10&&+n[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),zH=de((t,e)=>{Q();var r=jH(),i=qH(),{mkdirpNative:n,mkdirpNativeSync:s}=HH(),{mkdirpManual:o,mkdirpManualSync:a}=kR(),{useNative:u,useNativeSync:c}=$H(),l=(f,d)=>(f=i(f),d=r(d),u(d)?n(f,d):o(f,d)),h=(f,d)=>(f=i(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>n(i(f),r(d)),l.manual=(f,d)=>o(i(f),r(d)),l.nativeSync=(f,d)=>s(i(f),r(d)),l.manualSync=(f,d)=>a(i(f),r(d)),e.exports=l}),GH=de((t,e)=>{"use strict";Q();var r=ye("fs"),i=ye("path"),n=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=(k,P,F)=>{try{return r[s](k,P,F)}catch(M){if(M.code!=="ENOENT")throw M}},u=(k,P,F)=>{try{return r.chownSync(k,P,F)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(k,P,F,M)=>S=>{!S||S.code!=="EISDIR"?M(S):r.chown(k,P,F,M)}:(k,P,F,M)=>M,l=o?(k,P,F)=>{try{return a(k,P,F)}catch(M){if(M.code!=="EISDIR")throw M;u(k,P,F)}}:(k,P,F)=>a(k,P,F),h=process.version,f=(k,P,F)=>r.readdir(k,P,F),d=(k,P)=>r.readdirSync(k,P);/^v4\./.test(h)&&(f=(k,P,F)=>r.readdir(k,F));var m=(k,P,F,M)=>{r[n](k,P,F,c(k,P,F,S=>{M(S&&S.code!=="ENOENT"?S:null)}))},y=(k,P,F,M,S)=>{if(typeof P=="string")return r.lstat(i.resolve(k,P),(D,j)=>{if(D)return S(D.code!=="ENOENT"?D:null);j.name=P,y(k,j,F,M,S)});if(P.isDirectory())p(i.resolve(k,P.name),F,M,D=>{if(D)return S(D);let j=i.resolve(k,P.name);m(j,F,M,S)});else{let D=i.resolve(k,P.name);m(D,F,M,S)}},p=(k,P,F,M)=>{f(k,{withFileTypes:!0},(S,D)=>{if(S){if(S.code==="ENOENT")return M();if(S.code!=="ENOTDIR"&&S.code!=="ENOTSUP")return M(S)}if(S||!D.length)return m(k,P,F,M);let j=D.length,W=null,N=K=>{if(!W){if(K)return M(W=K);if(--j===0)return m(k,P,F,M)}};D.forEach(K=>y(k,K,P,F,N))})},v=(k,P,F,M)=>{if(typeof P=="string")try{let S=r.lstatSync(i.resolve(k,P));S.name=P,P=S}catch(S){if(S.code==="ENOENT")return;throw S}P.isDirectory()&&C(i.resolve(k,P.name),F,M),l(i.resolve(k,P.name),F,M)},C=(k,P,F)=>{let M;try{M=d(k,{withFileTypes:!0})}catch(S){if(S.code==="ENOENT")return;if(S.code==="ENOTDIR"||S.code==="ENOTSUP")return l(k,P,F);throw S}return M&&M.length&&M.forEach(S=>v(k,S,P,F)),l(k,P,F)};e.exports=p,p.sync=C}),WH=de((t,e)=>{"use strict";Q();var r=zH(),i=ye("fs"),n=ye("path"),s=GH(),o=pa(),a=class extends Error{constructor(y,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,p){super(p+": Cannot cd into '"+y+"'"),this.path=y,this.code=p}get name(){return"CwdError"}},c=(y,p)=>y.get(o(p)),l=(y,p,v)=>y.set(o(p),v),h=(y,p)=>{i.stat(y,(v,C)=>{(v||!C.isDirectory())&&(v=new u(y,v&&v.code||"ENOTDIR")),p(v)})};e.exports=(y,p,v)=>{y=o(y);let C=p.umask,k=p.mode|448,P=(k&C)!==0,F=p.uid,M=p.gid,S=typeof F=="number"&&typeof M=="number"&&(F!==p.processUid||M!==p.processGid),D=p.preserve,j=p.unlink,W=p.cache,N=o(p.cwd),K=(ne,U)=>{ne?v(ne):(l(W,y,!0),U&&S?s(U,F,M,I=>K(I)):P?i.chmod(y,k,v):v())};if(W&&c(W,y)===!0)return K();if(y===N)return h(y,K);if(D)return r(y,{mode:k}).then(ne=>K(null,ne),K);let te=o(n.relative(N,y)).split("/");f(N,te,k,W,j,N,null,K)};var f=(y,p,v,C,k,P,F,M)=>{if(!p.length)return M(null,F);let S=p.shift(),D=o(n.resolve(y+"/"+S));if(c(C,D))return f(D,p,v,C,k,P,F,M);i.mkdir(D,v,d(D,p,v,C,k,P,F,M))},d=(y,p,v,C,k,P,F,M)=>S=>{S?i.lstat(y,(D,j)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(j.isDirectory())f(y,p,v,C,k,P,F,M);else if(k)i.unlink(y,W=>{if(W)return M(W);i.mkdir(y,v,d(y,p,v,C,k,P,F,M))});else{if(j.isSymbolicLink())return M(new a(y,y+"/"+p.join("/")));M(S)}}):(F=F||y,f(y,p,v,C,k,P,F,M))},m=y=>{let p=!1,v="ENOTDIR";try{p=i.statSync(y).isDirectory()}catch(C){v=C.code}finally{if(!p)throw new u(y,v)}};e.exports.sync=(y,p)=>{y=o(y);let v=p.umask,C=p.mode|448,k=(C&v)!==0,P=p.uid,F=p.gid,M=typeof P=="number"&&typeof F=="number"&&(P!==p.processUid||F!==p.processGid),S=p.preserve,D=p.unlink,j=p.cache,W=o(p.cwd),N=ne=>{l(j,y,!0),ne&&M&&s.sync(ne,P,F),k&&i.chmodSync(y,C)};if(j&&c(j,y)===!0)return N();if(y===W)return m(W),N();if(S)return N(r.sync(y,C));let K=o(n.relative(W,y)).split("/"),te=null;for(let ne=K.shift(),U=W;ne&&(U+="/"+ne);ne=K.shift())if(U=o(n.resolve(U)),!c(j,U))try{i.mkdirSync(U,C),te=te||U,l(j,U,!0)}catch{let I=i.lstatSync(U);if(I.isDirectory()){l(j,U,!0);continue}else if(D){i.unlinkSync(U),i.mkdirSync(U,C),te=te||U,l(j,U,!0);continue}else if(I.isSymbolicLink())return new a(U,U+"/"+K.join("/"))}return N(te)}}),OR=de((t,e)=>{Q();var r=Object.create(null),{hasOwnProperty:i}=Object.prototype;e.exports=n=>(i.call(r,n)||(r[n]=n.normalize("NFKD")),r[n])}),VH=de((t,e)=>{Q();var r=ye("assert"),i=OR(),n=ya(),{join:s}=ye("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((v,C)=>(v.length&&(C=s(v[v.length-1],C)),v.push(C||"/"),v),[]),h=new Set,f=p=>{let v=c.get(p);if(!v)throw new Error("function does not have any path reservations");return{paths:v.paths.map(C=>u.get(C)),dirs:[...v.dirs].map(C=>u.get(C))}},d=p=>{let{paths:v,dirs:C}=f(p);return v.every(k=>k[0]===p)&&C.every(k=>k[0]instanceof Set&&k[0].has(p))},m=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>y(p)),!0),y=p=>{if(!h.has(p))return!1;let{paths:v,dirs:C}=c.get(p),k=new Set;return v.forEach(P=>{let F=u.get(P);r.equal(F[0],p),F.length===1?u.delete(P):(F.shift(),typeof F[0]=="function"?k.add(F[0]):F[0].forEach(M=>k.add(M)))}),C.forEach(P=>{let F=u.get(P);r(F[0]instanceof Set),F[0].size===1&&F.length===1?u.delete(P):F[0].size===1?(F.shift(),k.add(F[0])):F[0].delete(p)}),h.delete(p),k.forEach(P=>m(P)),!0};return{check:d,reserve:(p,v)=>{p=a?["win32 parallelization disabled"]:p.map(k=>i(n(s(k))).toLowerCase());let C=new Set(p.map(k=>l(k)).reduce((k,P)=>k.concat(P)));return c.set(v,{dirs:C,paths:p}),p.forEach(k=>{let P=u.get(k);P?P.push(v):u.set(k,[v])}),C.forEach(k=>{let P=u.get(k);P?P[P.length-1]instanceof Set?P[P.length-1].add(v):P.push(new Set([v])):u.set(k,[new Set([v])])}),m(v)}}}}),YH=de((t,e)=>{Q();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||ye("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=n.constants,c=i&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),FR=de((t,e)=>{"use strict";Q();var r=ye("assert"),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=WH(),u=DR(),c=VH(),l=AR(),h=pa(),f=ya(),d=OR(),m=Symbol("onEntry"),y=Symbol("checkFs"),p=Symbol("checkFs2"),v=Symbol("pruneCache"),C=Symbol("isReusable"),k=Symbol("makeFs"),P=Symbol("file"),F=Symbol("directory"),M=Symbol("link"),S=Symbol("symlink"),D=Symbol("hardlink"),j=Symbol("unsupported"),W=Symbol("checkPath"),N=Symbol("mkdir"),K=Symbol("onError"),te=Symbol("pending"),ne=Symbol("pend"),U=Symbol("unpend"),I=Symbol("ended"),L=Symbol("maybeClose"),z=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),E=ye("crypto"),R=YH(),x=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=x==="win32",$=(b,G)=>{if(!H)return n.unlink(b,G);let ee=b+".DELETE."+E.randomBytes(16).toString("hex");n.rename(b,ee,le=>{if(le)return G(le);n.unlink(ee,G)})},re=b=>{if(!H)return n.unlinkSync(b);let G=b+".DELETE."+E.randomBytes(16).toString("hex");n.renameSync(b,G),n.unlinkSync(G)},V=(b,G,ee)=>b===b>>>0?b:G===G>>>0?G:ee,he=b=>d(f(h(b))).toLowerCase(),J=(b,G)=>{G=he(G);for(let ee of b.keys()){let le=he(ee);(le===G||le.indexOf(G+"/")===0)&&b.delete(ee)}},w=b=>{for(let G of b.keys())b.delete(G)},B=class extends i{constructor(b){if(b||(b={}),b.ondone=G=>{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[te]=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",G=>this[m](G))}warn(b,G,ee={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(ee.recoverable=!1),super.warn(b,G,ee)}[L](){this[I]&&this[te]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[W](b){if(this.strip){let G=h(b.path).split("/");if(G.length<this.strip)return!1;if(b.path=G.slice(this.strip).join("/"),b.type==="Link"){let ee=h(b.linkpath).split("/");if(ee.length>=this.strip)b.linkpath=ee.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let G=h(b.path),ee=G.split("/");if(ee.includes("..")||H&&/^[a-z]:\.\.$/i.test(ee[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:G}),!1;let[le,pe]=l(G);le&&(b.path=pe,this.warn("TAR_ENTRY_INFO",`stripping ${le} from absolute path`,{entry:b,path:G}))}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:G}=o.win32.parse(b.absolute);b.absolute=G+u.encode(b.absolute.slice(G.length));let{root:ee}=o.win32.parse(b.path);b.path=ee+u.encode(b.path.slice(ee.length))}return!0}[m](b){if(!this[W](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[y](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[j](b)}}[K](b,G){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:G}),this[U](),G.resume())}[N](b,G,ee){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:G,noChmod:this.noChmod},ee)}[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 V(this.uid,b.uid,this.processUid)}[g](b){return V(this.gid,b.gid,this.processGid)}[P](b,G){let ee=b.mode&4095||this.fmode,le=new s.WriteStream(b.absolute,{flags:R(b.size),mode:ee,autoClose:!1});le.on("error",we=>{le.fd&&n.close(le.fd,()=>{}),le.write=()=>!0,this[K](we,b),G()});let pe=1,Se=we=>{if(we){le.fd&&n.close(le.fd,()=>{}),this[K](we,b),G();return}--pe===0&&n.close(le.fd,He=>{He?this[K](He,b):this[U](),G()})};le.on("finish",we=>{let He=b.absolute,Zt=le.fd;if(b.mtime&&!this.noMtime){pe++;let Jt=b.atime||new Date,no=b.mtime;n.futimes(Zt,Jt,no,so=>so?n.utimes(He,Jt,no,Nl=>Se(Nl&&so)):Se())}if(this[Z](b)){pe++;let Jt=this[q](b),no=this[g](b);n.fchown(Zt,Jt,no,so=>so?n.chown(He,Jt,no,Nl=>Se(Nl&&so)):Se())}Se()});let xe=this.transform&&this.transform(b)||b;xe!==b&&(xe.on("error",we=>{this[K](we,b),G()}),b.pipe(xe)),xe.pipe(le)}[F](b,G){let ee=b.mode&4095||this.dmode;this[N](b.absolute,ee,le=>{if(le){this[K](le,b),G();return}let pe=1,Se=xe=>{--pe===0&&(G(),this[U](),b.resume())};b.mtime&&!this.noMtime&&(pe++,n.utimes(b.absolute,b.atime||new Date,b.mtime,Se)),this[Z](b)&&(pe++,n.chown(b.absolute,this[q](b),this[g](b),Se)),Se()})}[j](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[S](b,G){this[M](b,b.linkpath,"symlink",G)}[D](b,G){let ee=h(o.resolve(this.cwd,b.linkpath));this[M](b,ee,"link",G)}[ne](){this[te]++}[U](){this[te]--,this[L]()}[z](b){this[U](),b.resume()}[C](b,G){return b.type==="File"&&!this.unlink&&G.isFile()&&G.nlink<=1&&!H}[y](b){this[ne]();let G=[b.path];b.linkpath&&G.push(b.linkpath),this.reservations.reserve(G,ee=>this[p](b,ee))}[v](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,G){this[v](b);let ee=xe=>{this[v](b),G(xe)},le=()=>{this[N](this.cwd,this.dmode,xe=>{if(xe){this[K](xe,b),ee();return}this[_]=!0,pe()})},pe=()=>{if(b.absolute!==this.cwd){let xe=h(o.dirname(b.absolute));if(xe!==this.cwd)return this[N](xe,this.dmode,we=>{if(we){this[K](we,b),ee();return}Se()})}Se()},Se=()=>{n.lstat(b.absolute,(xe,we)=>{if(we&&(this.keep||this.newer&&we.mtime>b.mtime)){this[z](b),ee();return}if(xe||this[C](b,we))return this[k](null,b,ee);if(we.isDirectory()){if(b.type==="Directory"){let He=!this.noChmod&&b.mode&&(we.mode&4095)!==b.mode,Zt=Jt=>this[k](Jt,b,ee);return He?n.chmod(b.absolute,b.mode,Zt):Zt()}if(b.absolute!==this.cwd)return n.rmdir(b.absolute,He=>this[k](He,b,ee))}if(b.absolute===this.cwd)return this[k](null,b,ee);$(b.absolute,He=>this[k](He,b,ee))})};this[_]?pe():le()}[k](b,G,ee){if(b){this[K](b,G),ee();return}switch(G.type){case"File":case"OldFile":case"ContiguousFile":return this[P](G,ee);case"Link":return this[D](G,ee);case"SymbolicLink":return this[S](G,ee);case"Directory":case"GNUDumpDir":return this[F](G,ee)}}[M](b,G,ee,le){n[ee](G,b.absolute,pe=>{pe?this[K](pe,b):(this[U](),b.resume()),le()})}},A=b=>{try{return[null,b()]}catch(G){return[G,null]}},X=class extends B{[k](b,G){return super[k](b,G,()=>{})}[y](b){if(this[v](b),!this[_]){let pe=this[N](this.cwd,this.dmode);if(pe)return this[K](pe,b);this[_]=!0}if(b.absolute!==this.cwd){let pe=h(o.dirname(b.absolute));if(pe!==this.cwd){let Se=this[N](pe,this.dmode);if(Se)return this[K](Se,b)}}let[G,ee]=A(()=>n.lstatSync(b.absolute));if(ee&&(this.keep||this.newer&&ee.mtime>b.mtime))return this[z](b);if(G||this[C](b,ee))return this[k](null,b);if(ee.isDirectory()){if(b.type==="Directory"){let Se=!this.noChmod&&b.mode&&(ee.mode&4095)!==b.mode,[xe]=Se?A(()=>{n.chmodSync(b.absolute,b.mode)}):[];return this[k](xe,b)}let[pe]=A(()=>n.rmdirSync(b.absolute));this[k](pe,b)}let[le]=b.absolute===this.cwd?[]:A(()=>re(b.absolute));this[k](le,b)}[P](b,G){let ee=b.mode&4095||this.fmode,le=xe=>{let we;try{n.closeSync(pe)}catch(He){we=He}(xe||we)&&this[K](xe||we,b),G()},pe;try{pe=n.openSync(b.absolute,R(b.size),ee)}catch(xe){return le(xe)}let Se=this.transform&&this.transform(b)||b;Se!==b&&(Se.on("error",xe=>this[K](xe,b)),b.pipe(Se)),Se.on("data",xe=>{try{n.writeSync(pe,xe,0,xe.length)}catch(we){le(we)}}),Se.on("end",xe=>{let we=null;if(b.mtime&&!this.noMtime){let He=b.atime||new Date,Zt=b.mtime;try{n.futimesSync(pe,He,Zt)}catch(Jt){try{n.utimesSync(b.absolute,He,Zt)}catch{we=Jt}}}if(this[Z](b)){let He=this[q](b),Zt=this[g](b);try{n.fchownSync(pe,He,Zt)}catch(Jt){try{n.chownSync(b.absolute,He,Zt)}catch{we=we||Jt}}}le(we)})}[F](b,G){let ee=b.mode&4095||this.dmode,le=this[N](b.absolute,ee);if(le){this[K](le,b),G();return}if(b.mtime&&!this.noMtime)try{n.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{n.chownSync(b.absolute,this[q](b),this[g](b))}catch{}G(),b.resume()}[N](b,G){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:G})}catch(ee){return ee}}[M](b,G,ee,le){try{n[ee+"Sync"](G,b.absolute),le(),b.resume()}catch(pe){return this[K](pe,b)}}};B.Sync=X,e.exports=B}),KH=de((t,e)=>{"use strict";Q();var r=da(),i=FR(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&u(p,m),p.file&&p.sync?c(p):p.file?l(p,y):p.sync?h(p):f(p)};var u=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,k)=>{let P=k||o.parse(C).root||".",F=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,F),F};d.filter=p?(C,k)=>p(C,k)&&v(a(C)):C=>v(a(C))},c=d=>{let m=new i.Sync(d),y=d.file,p=n.statSync(y),v=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:v,size:p.size}).pipe(m)},l=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((k,P)=>{y.on("error",P),y.on("close",k),n.stat(v,(F,M)=>{if(F)P(F);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},h=d=>new i.Sync(d),f=d=>new i(d)}),ZH=de(t=>{"use strict";Q(),t.c=t.create=NH(),t.r=t.replace=TR(),t.t=t.list=n0(),t.u=t.update=MH(),t.x=t.extract=KH(),t.Pack=r0(),t.Unpack=FR(),t.Parse=i0(),t.ReadEntry=Qy(),t.WriteEntry=CR(),t.Header=ma(),t.Pax=e0(),t.types=xR()}),JH=de((t,e)=>{Q();function r(i,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=n||{},this._maxRetryTime=n&&n.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(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var n=new Date().getTime();if(i&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);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(i,n){this._fn=i,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.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(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)},r.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)},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 i={},n=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(i[u]||0)+1;i[u]=c,c>=s&&(n=a,s=c)}return n}}),XH=de(t=>{Q();var e=JH();t.operation=function(r){var i=t.timeouts(r);return new e(i,{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 i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in r)i[n]=r[n];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<i.retries;o++)s.push(this.createTimeout(o,i));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,i)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,i){var n=i.randomize?Math.random()+1:1,s=Math.round(n*Math.max(i.minTimeout,1)*Math.pow(i.factor,r));return s=Math.min(s,i.maxTimeout),s},t.wrap=function(r,i,n){if(i instanceof Array&&(n=i,i=null),!n){n=[];for(var s in r)typeof r[s]=="function"&&n.push(s)}for(var o=0;o<n.length;o++){var a=n[o],u=r[a];r[a]=function(c){var l=t.operation(i),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=i}}}),QH=de((t,e)=>{Q(),e.exports=XH()}),e6=de((t,e)=>{Q();var r=QH();function i(n,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(m){u(m||new Error("Aborted"))}function f(m,y){if(m.bail){h(m);return}l.retry(m)?c.onRetry&&c.onRetry(m,y):u(l.mainError())}function d(m){var y;try{y=n(h,m)}catch(p){f(p,m);return}Promise.resolve(y).then(a).catch(function(p){f(p,m)})}l.attempt(d)}return new Promise(o)}e.exports=i}),t6={};wH(t6,{bold:()=>o6,dimmed:()=>u6,error:()=>f6,grey:()=>c6,info:()=>s6,item:()=>l6,log:()=>Tn,turboBlue:()=>eo,turboGradient:()=>i6,turboLoader:()=>n6,turboRed:()=>NR,underline:()=>a6,warn:()=>h6,yellow:()=>MR});Q();var LR="#0099F7",BR="#F11712",r6="#FFFF00",i6=(0,IR.default)(LR,BR),eo=Ni.default.hex(LR),NR=Ni.default.hex(BR),MR=Ni.default.hex(r6),n6=t=>(0,PR.default)({text:t,spinner:{frames:[" ",eo("> "),eo(">> "),eo(">>>")]}}),s6=(...t)=>{Tn(eo.bold(">>>"),...t)},o6=(...t)=>{Tn(Ni.default.bold(...t))},a6=(...t)=>{Tn(Ni.default.underline(...t))},u6=(...t)=>{Tn(Ni.default.dim(...t))},c6=(...t)=>{Tn(Ni.default.grey(...t))},l6=(...t)=>{Tn(eo.bold(" \u2022"),...t)},Tn=(...t)=>{console.log(...t)},h6=(...t)=>{console.error(MR.bold(">>>"),...t)},f6=(...t)=>{console.error(NR.bold(">>>"),...t)};Q();async function Sl(t,e=[],r){let i={cwd:jR.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,qR.default)(t,e,i);return n.trim()}catch{return}}async function UR(){let[t,e,r,i]=await Promise.all([Sl("yarnpkg",["--version"]),Sl("npm",["--version"]),Sl("pnpm",["--version"]),Sl("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}Q();Q();Q();var HW=Al(AH());Q();Q();function d6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Q();Q();function Ky(t){return Ky=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},Ky(t)}Q();function p6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m6(t,e){if(e&&(Ky(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p6(t)}Q();function Dl(t){return Dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dl(t)}Q();Q();function la(t,e){return la=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},la(t,e)}function y6(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&&la(t,e)}Q();Q();function g6(t){return Function.toString.call(t).indexOf("[native code]")!==-1}Q();Q();function _6(){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 xl(t,e,r){return _6()?xl=Reflect.construct.bind():xl=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),u=new a;return s&&la(u,s.prototype),u},xl.apply(null,arguments)}function Zy(t){var e=typeof Map=="function"?new Map:void 0;return Zy=function(r){if(r===null||!g6(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,i)}function i(){return xl(r,arguments,Dl(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),la(i,r)},Zy(t)}var $W=Al(FH()),WW=function(t){y6(e,t);function e(r){var i;return d6(this,e),i=m6(this,Dl(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Zy(Error));Q();Q();Q();Q();Q();Q();var iV=Al(ZH()),nV=(0,$R.promisify)(HR.Stream.pipeline);Q();Q();var uV=Al(e6());Q();Q();Q();var qe=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,qe)}};Q();Q();Q();Q();var b6=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function vt({workspaceRoot:t}){let e=ri.default.join(t,"package.json");try{return(0,It.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new qe(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new qe(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function Cl({workspaceRoot:t}){let{packageManager:e}=vt({workspaceRoot:t});if(e)try{let r=b6.exec(e);if(r){let[i,n]=r;return n}}catch{}}function _a({workspaceRoot:t}){let e=vt({workspaceRoot:t}),r=ri.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function _R({workspaceRoot:t}){let e=ri.default.join(t,"pnpm-workspace.yaml");if((0,It.existsSync)(e))try{let r=fh.load((0,It.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new qe(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function Rl({root:t,lockFile:e,workspaceConfig:r}){let i=s=>ri.default.join(t,s),n={root:t,lockfile:i(e),packageJson:i("package.json"),nodeModules:i("node_modules")};return r&&(n.workspaceConfig=i(r)),n}function s0({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function Tl({workspaceRoot:t,workspaceGlobs:e}){return e?e.flatMap(r=>{let i=[`${r}/package.json`];return(0,KR.sync)(i,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**"]})}).map(r=>{let i=ri.default.dirname(r),{name:n,description:s}=_a({workspaceRoot:i});return{name:n,description:s,paths:{root:i,packageJson:r,nodeModules:ri.default.join(i,"node_modules")}}}):[]}function E6({directory:t}){let e=ri.default.resolve(process.cwd(),t);return{exists:(0,It.existsSync)(e),absolute:e}}function Mi({packageManager:t,action:e,project:r}){let i=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${i?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function v6({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(i=>r.includes(i)));return t.workspaceData.globs.every(e)}function ti({project:t,options:e}){e!=null&&e.dry||(0,It.rmSync)(t.paths.lockfile,{force:!0})}async function ZR({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,It.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,YR.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,It.writeFile)(ri.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,It.rmSync)(t.paths.lockfile,{force:!0})}}function w6({dependencyList:t,project:e,to:r}){let i=[];return e.workspaceData.workspaces.forEach(n=>{let{name:s}=n;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,i.push(s)}}),{dependencyList:t,updated:i}}function Li({project:t,workspace:e,to:r,logger:i,options:n}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=vt({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:m}=w6({dependencyList:f,project:t,to:r});s[h]=m,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${VR.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${GR.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}, `}),i.workspaceStep(h)}else i.workspaceStep(`no workspace dependencies found in ${l}`);n!=null&&n.dry||(0,WR.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var Bi={name:"pnpm",lock:"pnpm-lock.yaml"};async function JR(t){let e=Cn.default.join(t.workspaceRoot,Bi.lock),r=Cn.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=Cl({workspaceRoot:t.workspaceRoot});return(0,dt.existsSync)(e)||(0,dt.existsSync)(r)||i===Bi.name}async function S6(t){if(!await JR(t))throw new qe("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=_a(t);return{name:e,description:r,packageManager:Bi.name,paths:Rl({root:t.workspaceRoot,lockFile:Bi.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:_R(t),workspaces:Tl({workspaceGlobs:_R(t),...t})}}}async function x6(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Mi({action:"create",packageManager:Bi.name,project:e}));let o=vt({workspaceRoot:e.paths.root});i.rootHeader(),o.packageManager=`${r.name}@${r.version}`,i.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),n!=null&&n.dry||((0,dt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,dt.writeFileSync)(Cn.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
56
|
+
`).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=n}),ya=de((t,e)=>{Q(),e.exports=r=>{let i=r.length-1,n=-1;for(;i>-1&&r.charAt(i)==="/";)n=i,i--;return n===-1?r:r.slice(0,n)}}),t0=de((t,e)=>{"use strict";Q(),e.exports=r=>class extends r{warn(i,n,s={}){this.file&&(s.file=this.file),this.cwd&&(s.cwd=this.cwd),s.code=n instanceof Error&&n.code||i,s.tarCode=i,!this.strict&&s.recoverable!==!1?(n instanceof Error&&(s=Object.assign(n,s),n=n.message),this.emit("warn",s.tarCode,n,s)):n instanceof Error?this.emit("error",Object.assign(n,s)):this.emit("error",Object.assign(new Error(`${i}: ${n}`),s))}}}),DR=de((t,e)=>{"use strict";Q();var r=["|","<",">","?",":"],i=r.map(o=>String.fromCharCode(61440+o.charCodeAt(0))),n=new Map(r.map((o,a)=>[o,i[a]])),s=new Map(i.map((o,a)=>[o,r[a]]));e.exports={encode:o=>r.reduce((a,u)=>a.split(u).join(n.get(u)),o),decode:o=>i.reduce((a,u)=>a.split(u).join(s.get(u)),o)}}),AR=de((t,e)=>{Q();var{isAbsolute:r,parse:i}=ye("path").win32;e.exports=n=>{let s="",o=i(n);for(;r(n)||o.root;){let a=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":o.root;n=n.slice(a.length),s+=a,o=i(n)}return[s,n]}}),LH=de((t,e)=>{"use strict";Q(),e.exports=(r,i,n)=>(r&=4095,n&&(r=(r|384)&-19),i&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)}),CR=de((t,e)=>{"use strict";Q();var r=Xy(),i=e0(),n=ma(),s=ye("fs"),o=ye("path"),a=pa(),u=ya(),c=(_,E)=>E?(_=a(_).replace(/^\.(\/|$)/,""),u(E)+"/"+_):a(_),l=16*1024*1024,h=Symbol("process"),f=Symbol("file"),d=Symbol("directory"),m=Symbol("symlink"),y=Symbol("hardlink"),p=Symbol("header"),v=Symbol("read"),C=Symbol("lstat"),k=Symbol("onlstat"),P=Symbol("onread"),F=Symbol("onreadlink"),M=Symbol("openfile"),S=Symbol("onopenfile"),D=Symbol("close"),j=Symbol("mode"),W=Symbol("awaitDrain"),N=Symbol("ondrain"),K=Symbol("prefix"),te=Symbol("hadError"),ne=t0(),U=DR(),I=AR(),L=LH(),z=ne(class extends r{constructor(_,E){if(E=E||{},super(E),typeof _!="string")throw new TypeError("path is required");this.path=a(_),this.portable=!!E.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=E.maxReadSize||l,this.linkCache=E.linkCache||new Map,this.statCache=E.statCache||new Map,this.preservePaths=!!E.preservePaths,this.cwd=a(E.cwd||process.cwd()),this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.mtime=E.mtime||null,this.prefix=E.prefix?a(E.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 E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.win32=!!E.win32||process.platform==="win32",this.win32&&(this.path=U.decode(this.path.replace(/\\/g,"/")),_=_.replace(/\\/g,"/")),this.absolute=a(E.absolute||o.resolve(this.cwd,_)),this.path===""&&(this.path="./"),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.statCache.has(this.absolute)?this[k](this.statCache.get(this.absolute)):this[C]()}emit(_,...E){return _==="error"&&(this[te]=!0),super.emit(_,...E)}[C](){s.lstat(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[k](E)})}[k](_){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[m]();default:return this.end()}}[j](_){return L(_,this.type==="Directory",this.portable)}[K](_){return c(_,this.prefix)}[p](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new n({path:this[K](this.path),linkpath:this.type==="Link"?this[K](this.linkpath):this.linkpath,mode:this[j](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 i({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()}[m](){s.readlink(this.absolute,(_,E)=>{if(_)return this.emit("error",_);this[F](E)})}[F](_){this.linkpath=a(_),this[p](),this.end()}[y](_){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 E=this.linkCache.get(_);if(E.indexOf(this.cwd)===0)return this[y](E)}this.linkCache.set(_,this.absolute)}if(this[p](),this.stat.size===0)return this.end();this[M]()}[M](){s.open(this.absolute,"r",(_,E)=>{if(_)return this.emit("error",_);this[S](E)})}[S](_){if(this.fd=_,this[te])return this[D]();this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let E=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(E),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[v]()}[v](){let{fd:_,buf:E,offset:R,length:x,pos:H}=this;s.read(_,E,R,x,H,($,re)=>{if($)return this[D](()=>this.emit("error",$));this[P](re)})}[D](_){s.close(this.fd,_)}[P](_){if(_<=0&&this.remain>0){let R=new Error("encountered unexpected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_>this.remain){let R=new Error("did not encounter expected EOF");return R.path=this.absolute,R.syscall="read",R.code="EOF",this[D](()=>this.emit("error",R))}if(_===this.remain)for(let R=_;R<this.length&&_<this.blockRemain;R++)this.buf[R+this.offset]=0,_++,this.remain++;let E=this.offset===0&&_===this.buf.length?this.buf:this.buf.slice(this.offset,this.offset+_);this.write(E)?this[N]():this[W](()=>this[N]())}[W](_){this.once("drain",_)}write(_){if(this.blockRemain<_.length){let E=new Error("writing more data than expected");return E.path=this.absolute,this.emit("error",E)}return this.remain-=_.length,this.blockRemain-=_.length,this.pos+=_.length,this.offset+=_.length,super.write(_)}[N](){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[v]()}}),Z=class extends z{[C](){this[k](s.lstatSync(this.absolute))}[m](){this[F](s.readlinkSync(this.absolute))}[M](){this[S](s.openSync(this.absolute,"r"))}[v](){let _=!0;try{let{fd:E,buf:R,offset:x,length:H,pos:$}=this,re=s.readSync(E,R,x,H,$);this[P](re),_=!1}finally{if(_)try{this[D](()=>{})}catch{}}}[W](_){_()}[D](_){s.closeSync(this.fd),_()}},q=ne(class extends r{constructor(_,E){E=E||{},super(E),this.preservePaths=!!E.preservePaths,this.portable=!!E.portable,this.strict=!!E.strict,this.noPax=!!E.noPax,this.noMtime=!!E.noMtime,this.readEntry=_,this.type=_.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=E.prefix||null,this.path=a(_.path),this.mode=this[j](_.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:E.mtime||_.mtime,this.atime=this.portable?null:_.atime,this.ctime=this.portable?null:_.ctime,this.linkpath=a(_.linkpath),typeof E.onwarn=="function"&&this.on("warn",E.onwarn);let R=!1;if(!this.preservePaths){let[x,H]=I(this.path);x&&(this.path=H,R=x)}this.remain=_.size,this.blockRemain=_.startBlockSize,this.header=new n({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}),R&&this.warn("TAR_ENTRY_INFO",`stripping ${R} from absolute path`,{entry:this,path:R+this.path}),this.header.encode()&&!this.noPax&&super.write(new i({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)}[j](_){return L(_,this.type==="Directory",this.portable)}write(_){let E=_.length;if(E>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=E,super.write(_)}end(){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),super.end()}});z.Sync=Z,z.Tar=q;var g=_=>_.isFile()?"File":_.isDirectory()?"Directory":_.isSymbolicLink()?"SymbolicLink":"Unsupported";e.exports=z}),BH=de((t,e)=>{"use strict";Q(),e.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let i=this.head;i;i=i.next)yield i.value}}}),RR=de((t,e)=>{"use strict";Q(),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++)n(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=i(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 i(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 n(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{BH()(r)}catch{}}),r0=de((t,e)=>{"use strict";Q();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}},i=Xy(),n=SR(),s=Qy(),o=CR(),a=o.Sync,u=o.Tar,c=RR(),l=Buffer.alloc(1024),h=Symbol("onStat"),f=Symbol("ended"),d=Symbol("queue"),m=Symbol("current"),y=Symbol("process"),p=Symbol("processing"),v=Symbol("processJob"),C=Symbol("jobs"),k=Symbol("jobDone"),P=Symbol("addFSEntry"),F=Symbol("addTarEntry"),M=Symbol("stat"),S=Symbol("readdir"),D=Symbol("onreaddir"),j=Symbol("pipe"),W=Symbol("entry"),N=Symbol("entryOpt"),K=Symbol("writeEntryClass"),te=Symbol("write"),ne=Symbol("ondrain"),U=ye("fs"),I=ye("path"),L=t0(),z=pa(),Z=L(class extends i{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=z(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 n.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[C]=0,this.jobs=+g.jobs||4,this[p]=!1,this[f]=!1}[te](g){return super.write(g)}add(g){return this.write(g),this}end(g){return g&&this.write(g),this[f]=!0,this[y](),this}write(g){if(this[f])throw new Error("write after end");return g instanceof s?this[F](g):this[P](g),this.flowing}[F](g){let _=z(I.resolve(this.cwd,g.path));if(!this.filter(g.path,g))g.resume();else{let E=new r(g.path,_,!1);E.entry=new u(g,this[N](E)),E.entry.on("end",R=>this[k](E)),this[C]+=1,this[d].push(E)}this[y]()}[P](g){let _=z(I.resolve(this.cwd,g));this[d].push(new r(g,_)),this[y]()}[M](g){g.pending=!0,this[C]+=1;let _=this.follow?"stat":"lstat";U[_](g.absolute,(E,R)=>{g.pending=!1,this[C]-=1,E?this.emit("error",E):this[h](g,R)})}[h](g,_){this.statCache.set(g.absolute,_),g.stat=_,this.filter(g.path,_)||(g.ignore=!0),this[y]()}[S](g){g.pending=!0,this[C]+=1,U.readdir(g.absolute,(_,E)=>{if(g.pending=!1,this[C]-=1,_)return this.emit("error",_);this[D](g,E)})}[D](g,_){this.readdirCache.set(g.absolute,_),g.readdir=_,this[y]()}[y](){if(!this[p]){this[p]=!0;for(let g=this[d].head;g!==null&&this[C]<this.jobs;g=g.next)if(this[v](g.value),g.value.ignore){let _=g.next;this[d].removeNode(g),g.next=_}this[p]=!1,this[f]&&!this[d].length&&this[C]===0&&(this.zip?this.zip.end(l):(super.write(l),super.end()))}}get[m](){return this[d]&&this[d].head&&this[d].head.value}[k](g){this[d].shift(),this[C]-=1,this[y]()}[v](g){if(!g.pending){if(g.entry){g===this[m]&&!g.piped&&this[j](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[S](g),!g.readdir))){if(g.entry=this[W](g),!g.entry){g.ignore=!0;return}g===this[m]&&!g.piped&&this[j](g)}}}[N](g){return{onwarn:(_,E,R)=>this.warn(_,E,R),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}}[W](g){this[C]+=1;try{return new this[K](g.path,this[N](g)).on("end",()=>this[k](g)).on("error",_=>this.emit("error",_))}catch(_){this.emit("error",_)}}[ne](){this[m]&&this[m].entry&&this[m].entry.resume()}[j](g){g.piped=!0,g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)});let _=g.entry,E=this.zip;E?_.on("data",R=>{E.write(R)||_.pause()}):_.on("data",R=>{super.write(R)||_.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,U[_](g.absolute))}[S](g,_){this[D](g,U.readdirSync(g.absolute))}[j](g){let _=g.entry,E=this.zip;g.readdir&&g.readdir.forEach(R=>{let x=g.path,H=x==="./"?"":x.replace(/\/*$/,"/");this[P](H+R)}),E?_.on("data",R=>{E.write(R)}):_.on("data",R=>{super[te](R)})}};Z.Sync=q,e.exports=Z}),ga=de(t=>{"use strict";Q();var e=vR(),r=ye("events").EventEmitter,i=ye("fs"),n=i.writev;if(!n){let g=process.binding("fs"),_=g.FSReqWrap||g.FSReqCallback;n=(E,R,x,H)=>{let $=(V,he)=>H(V,he,R),re=new _;re.oncomplete=$,g.writeBuffers(E,R,x,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"),m=Symbol("_mode"),y=Symbol("_needDrain"),p=Symbol("_onerror"),v=Symbol("_onopen"),C=Symbol("_onread"),k=Symbol("_onwrite"),P=Symbol("_open"),F=Symbol("_path"),M=Symbol("_pos"),S=Symbol("_queue"),D=Symbol("_read"),j=Symbol("_readSize"),W=Symbol("_reading"),N=Symbol("_remain"),K=Symbol("_size"),te=Symbol("_write"),ne=Symbol("_writing"),U=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[j]=_.readSize||16*1024*1024,this[W]=!1,this[K]=typeof _.size=="number"?_.size:1/0,this[N]=this[K],this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0,typeof this[u]=="number"?this[D]():this[P]()}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")}[P](){i.open(this[F],"r",(g,_)=>this[v](g,_))}[v](g,_){g?this[p](g):(this[u]=_,this.emit("open",_),this[D]())}[d](){return Buffer.allocUnsafe(Math.min(this[j],this[N]))}[D](){if(!this[W]){this[W]=!0;let g=this[d]();if(g.length===0)return process.nextTick(()=>this[C](null,0,g));i.read(this[u],g,0,g.length,null,(_,E,R)=>this[C](_,E,R))}}[C](g,_,E){this[W]=!1,g?this[p](g):this[f](_,E)&&this[D]()}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}[p](g){this[W]=!0,this[o](),this.emit("error",g)}[f](g,_){let E=!1;return this[N]-=g,g>0&&(E=super.write(g<_.length?_.slice(0,g):_)),(g===0||this[N]<=0)&&(E=!1,this[o](),super.end()),E}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,_)}}},z=class extends L{[P](){let g=!0;try{this[v](null,i.openSync(this[F],"r")),g=!1}finally{g&&this[o]()}}[D](){let g=!0;try{if(!this[W]){this[W]=!0;do{let _=this[d](),E=_.length===0?0:i.readSync(this[u],_,0,_.length,null);if(!this[f](E,_))break}while(!0);this[W]=!1}g=!1}finally{g&&this[o]()}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.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[y]=!1,this[S]=[],this[F]=g,this[u]=typeof _.fd=="number"?_.fd:null,this[m]=_.mode===void 0?438:_.mode,this[M]=typeof _.start=="number"?_.start:null,this[s]=typeof _.autoClose=="boolean"?_.autoClose:!0;let E=this[M]!==null?"r+":"w";this[U]=_.flags===void 0,this[l]=this[U]?E:_.flags,this[u]===null&&this[P]()}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)}[P](){i.open(this[F],this[l],this[m],(g,_)=>this[v](g,_))}[v](g,_){this[U]&&this[l]==="r+"&&g&&g.code==="ENOENT"?(this[l]="w",this[P]()):g?this[p](g):(this[u]=_,this.emit("open",_),this[h]())}end(g,_){return g&&this.write(g,_),this[a]=!0,!this[ne]&&!this[S].length&&typeof this[u]=="number"&&this[k](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[S].length?(this[S].push(g),this[y]=!0,!1):(this[ne]=!0,this[te](g),!0)}[te](g){i.write(this[u],g,0,g.length,this[M],(_,E)=>this[k](_,E))}[k](g,_){g?this[p](g):(this[M]!==null&&(this[M]+=_),this[S].length?this[h]():(this[ne]=!1,this[a]&&!this[c]?(this[c]=!0,this[o](),this.emit("finish")):this[y]&&(this[y]=!1,this.emit("drain"))))}[h](){if(this[S].length===0)this[a]&&this[k](null,0);else if(this[S].length===1)this[te](this[S].pop());else{let g=this[S];this[S]=[],n(this[u],g,this[M],(_,E)=>this[k](_,E))}}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.close(g,_=>_?this.emit("error",_):this.emit("close"))}}},q=class extends Z{[P](){let g;if(this[U]&&this[l]==="r+")try{g=i.openSync(this[F],this[l],this[m])}catch(_){if(_.code==="ENOENT")return this[l]="w",this[P]();throw _}else g=i.openSync(this[F],this[l],this[m]);this[v](null,g)}[o](){if(this[s]&&typeof this[u]=="number"){let g=this[u];this[u]=null,i.closeSync(g),this.emit("close")}}[te](g){let _=!0;try{this[k](null,i.writeSync(this[u],g,0,g.length,this[M])),_=!1}finally{if(_)try{this[o]()}catch{}}}};t.ReadStream=L,t.ReadStreamSync=z,t.WriteStream=Z,t.WriteStreamSync=q}),i0=de((t,e)=>{"use strict";Q();var r=t0(),i=ma(),n=ye("events"),s=RR(),o=1024*1024,a=Qy(),u=e0(),c=SR(),{nextTick:l}=ye("process"),h=Buffer.from([31,139]),f=Symbol("state"),d=Symbol("writeEntry"),m=Symbol("readEntry"),y=Symbol("nextEntry"),p=Symbol("processEntry"),v=Symbol("extendedHeader"),C=Symbol("globalExtendedHeader"),k=Symbol("meta"),P=Symbol("emitMeta"),F=Symbol("buffer"),M=Symbol("queue"),S=Symbol("ended"),D=Symbol("emittedEnd"),j=Symbol("emit"),W=Symbol("unzip"),N=Symbol("consumeChunk"),K=Symbol("consumeChunkSub"),te=Symbol("consumeBody"),ne=Symbol("consumeMeta"),U=Symbol("consumeHeader"),I=Symbol("consuming"),L=Symbol("bufferConcat"),z=Symbol("maybeEnd"),Z=Symbol("writing"),q=Symbol("aborted"),g=Symbol("onDone"),_=Symbol("sawValidEntry"),E=Symbol("sawNullBlock"),R=Symbol("sawEOF"),x=Symbol("closeStream"),H=$=>!0;e.exports=r(class extends n{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[m]=null,this[d]=null,this[f]="begin",this[k]="",this[v]=null,this[C]=null,this[S]=!1,this[W]=null,this[q]=!1,this[E]=!1,this[R]=!1,this.on("end",()=>this[x]()),typeof $.onwarn=="function"&&this.on("warn",$.onwarn),typeof $.onentry=="function"&&this.on("entry",$.onentry)}[U]($,re){this[_]===null&&(this[_]=!1);let V;try{V=new i($,re,this[v],this[C])}catch(he){return this.warn("TAR_ENTRY_INVALID",he)}if(V.nullBlock)this[E]?(this[R]=!0,this[f]==="begin"&&(this[f]="header"),this[j]("eof")):(this[E]=!0,this[j]("nullBlock"));else if(this[E]=!1,!V.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:V});else if(!V.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:V});else{let he=V.type;if(/^(Symbolic)?Link$/.test(he)&&!V.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:V});else if(!/^(Symbolic)?Link$/.test(he)&&V.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:V});else{let J=this[d]=new a(V,this[v],this[C]);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[j]("ignoredEntry",J),this[f]="ignore",J.resume()):J.size>0&&(this[k]="",J.on("data",w=>this[k]+=w),this[f]="meta"):(this[v]=null,J.ignore=J.ignore||!this.filter(J.path,J),J.ignore?(this[j]("ignoredEntry",J),this[f]=J.remain?"ignore":"header",J.resume()):(J.remain?this[f]="body":(this[f]="header",J.end()),this[m]?this[M].push(J):(this[M].push(J),this[y]())))}}}[x](){l(()=>this.emit("close"))}[p]($){let re=!0;return $?Array.isArray($)?this.emit.apply(this,$):(this[m]=$,this.emit("entry",$),$.emittedEnd||($.on("end",V=>this[y]()),re=!1)):(this[m]=null,re=!1),re}[y](){do;while(this[p](this[M].shift()));if(!this[M].length){let $=this[m];!$||$.flowing||$.size===$.remain?this[Z]||this.emit("drain"):$.once("drain",re=>this.emit("drain"))}}[te]($,re){let V=this[d],he=V.blockRemain,J=he>=$.length&&re===0?$:$.slice(re,re+he);return V.write(J),V.blockRemain||(this[f]="header",this[d]=null,V.end()),J.length}[ne]($,re){let V=this[d],he=this[te]($,re);return this[d]||this[P](V),he}[j]($,re,V){!this[M].length&&!this[m]?this.emit($,re,V):this[M].push([$,re,V])}[P]($){switch(this[j]("meta",this[k]),$.type){case"ExtendedHeader":case"OldExtendedHeader":this[v]=u.parse(this[k],this[v],!1);break;case"GlobalExtendedHeader":this[C]=u.parse(this[k],this[C],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[v]=this[v]||Object.create(null),this[v].path=this[k].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[v]=this[v]||Object.create(null),this[v].linkpath=this[k].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[W]===null&&$){if(this[F]&&($=Buffer.concat([this[F],$]),this[F]=null),$.length<h.length)return this[F]=$,!0;for(let V=0;this[W]===null&&V<h.length;V++)$[V]!==h[V]&&(this[W]=!1);if(this[W]===null){let V=this[S];this[S]=!1,this[W]=new c.Unzip,this[W].on("data",J=>this[N](J)),this[W].on("error",J=>this.abort(J)),this[W].on("end",J=>{this[S]=!0,this[N]()}),this[Z]=!0;let he=this[W][V?"end":"write"]($);return this[Z]=!1,he}}this[Z]=!0,this[W]?this[W].write($):this[N]($),this[Z]=!1;let re=this[M].length?!1:this[m]?this[m].flowing:!0;return!re&&!this[M].length&&this[m].once("drain",V=>this.emit("drain")),re}[L]($){$&&!this[q]&&(this[F]=this[F]?Buffer.concat([this[F],$]):$)}[z](){if(this[S]&&!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[j](g)}}[N]($){if(this[I])this[L]($);else if(!$&&!this[F])this[z]();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[R];){let re=this[F];this[F]=null,this[K](re)}this[I]=!1}(!this[F]||this[S])&&this[z]()}[K]($){let re=0,V=$.length;for(;re+512<=V&&!this[q]&&!this[R];)switch(this[f]){case"begin":case"header":this[U]($,re),re+=512;break;case"ignore":case"body":re+=this[te]($,re);break;case"meta":re+=this[ne]($,re);break;default:throw new Error("invalid state: "+this[f])}re<V&&(this[F]?this[F]=Buffer.concat([$.slice(re),this[F]]):this[F]=$.slice(re))}end($){this[q]||(this[W]?this[W].end($):(this[S]=!0,this.write($)))}})}),n0=de((t,e)=>{"use strict";Q();var r=da(),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&c(p,m),p.noResume||u(p),p.file&&p.sync?l(p):p.file?h(p,y):f(p)};var u=d=>{let m=d.onentry;d.onentry=m?y=>{m(y),y.resume()}:y=>y.resume()},c=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,k)=>{let P=k||o.parse(C).root||".",F=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,F),F};d.filter=p?(C,k)=>p(C,k)&&v(a(C)):C=>v(a(C))},l=d=>{let m=f(d),y=d.file,p=!0,v;try{let C=n.statSync(y),k=d.maxReadSize||16*1024*1024;if(C.size<k)m.end(n.readFileSync(y));else{let P=0,F=Buffer.allocUnsafe(k);for(v=n.openSync(y,"r");P<C.size;){let M=n.readSync(v,F,0,k,P);P+=M,m.write(F.slice(0,M))}m.end()}p=!1}finally{if(p&&v)try{n.closeSync(v)}catch{}}},h=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((k,P)=>{y.on("error",P),y.on("end",k),n.stat(v,(F,M)=>{if(F)P(F);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},f=d=>new i(d)}),NH=de((t,e)=>{"use strict";Q();var r=da(),i=r0(),n=ga(),s=n0(),o=ye("path");e.exports=(d,m,y)=>{if(typeof m=="function"&&(y=m),Array.isArray(d)&&(m=d,d={}),!m||!Array.isArray(m)||!m.length)throw new TypeError("no files or directories specified");m=Array.from(m);let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return p.file&&p.sync?a(p,m):p.file?u(p,m,y):p.sync?h(p,m):f(p,m)};var a=(d,m)=>{let y=new i.Sync(d),p=new n.WriteStreamSync(d.file,{mode:d.mode||438});y.pipe(p),c(y,m)},u=(d,m,y)=>{let p=new i(d),v=new n.WriteStream(d.file,{mode:d.mode||438});p.pipe(v);let C=new Promise((k,P)=>{v.on("error",P),v.on("close",k),p.on("error",P)});return l(p,m),y?C.then(y,y):C},c=(d,m)=>{m.forEach(y=>{y.charAt(0)==="@"?s({file:o.resolve(d.cwd,y.slice(1)),sync:!0,noResume:!0,onentry:p=>d.add(p)}):d.add(y)}),d.end()},l=(d,m)=>{for(;m.length;){let y=m.shift();if(y.charAt(0)==="@")return s({file:o.resolve(d.cwd,y.slice(1)),noResume:!0,onentry:p=>d.add(p)}).then(p=>l(d,m));d.add(y)}d.end()},h=(d,m)=>{let y=new i.Sync(d);return c(y,m),y},f=(d,m)=>{let y=new i(d);return l(y,m),y}}),TR=de((t,e)=>{"use strict";Q();var r=da(),i=r0(),n=ye("fs"),s=ga(),o=n0(),a=ye("path"),u=ma();e.exports=(m,y,p)=>{let v=r(m);if(!v.file)throw new TypeError("file is required");if(v.gzip)throw new TypeError("cannot append to compressed archives");if(!y||!Array.isArray(y)||!y.length)throw new TypeError("no files or directories specified");return y=Array.from(y),v.sync?c(v,y):h(v,y,p)};var c=(m,y)=>{let p=new i.Sync(m),v=!0,C,k;try{try{C=n.openSync(m.file,"r+")}catch(M){if(M.code==="ENOENT")C=n.openSync(m.file,"w+");else throw M}let P=n.fstatSync(C),F=Buffer.alloc(512);e:for(k=0;k<P.size;k+=512){for(let D=0,j=0;D<512;D+=j){if(j=n.readSync(C,F,D,F.length-D,k+D),k===0&&F[0]===31&&F[1]===139)throw new Error("cannot append to compressed archives");if(!j)break e}let M=new u(F);if(!M.cksumValid)break;let S=512*Math.ceil(M.size/512);if(k+S+512>P.size)break;k+=S,m.mtimeCache&&m.mtimeCache.set(M.path,M.mtime)}v=!1,l(m,p,k,C,y)}finally{if(v)try{n.closeSync(C)}catch{}}},l=(m,y,p,v,C)=>{let k=new s.WriteStreamSync(m.file,{fd:v,start:p});y.pipe(k),f(y,C)},h=(m,y,p)=>{y=Array.from(y);let v=new i(m),C=(P,F,M)=>{let S=(K,te)=>{K?n.close(P,ne=>M(K)):M(null,te)},D=0;if(F===0)return S(null,0);let j=0,W=Buffer.alloc(512),N=(K,te)=>{if(K)return S(K);if(j+=te,j<512&&te)return n.read(P,W,j,W.length-j,D+j,N);if(D===0&&W[0]===31&&W[1]===139)return S(new Error("cannot append to compressed archives"));if(j<512)return S(null,D);let ne=new u(W);if(!ne.cksumValid)return S(null,D);let U=512*Math.ceil(ne.size/512);if(D+U+512>F||(D+=U+512,D>=F))return S(null,D);m.mtimeCache&&m.mtimeCache.set(ne.path,ne.mtime),j=0,n.read(P,W,0,512,D,N)};n.read(P,W,0,512,D,N)},k=new Promise((P,F)=>{v.on("error",F);let M="r+",S=(D,j)=>{if(D&&D.code==="ENOENT"&&M==="r+")return M="w+",n.open(m.file,M,S);if(D)return F(D);n.fstat(j,(W,N)=>{if(W)return n.close(j,()=>F(W));C(j,N.size,(K,te)=>{if(K)return F(K);let ne=new s.WriteStream(m.file,{fd:j,start:te});v.pipe(ne),ne.on("error",F),ne.on("close",P),d(v,y)})})};n.open(m.file,M,S)});return p?k.then(p,p):k},f=(m,y)=>{y.forEach(p=>{p.charAt(0)==="@"?o({file:a.resolve(m.cwd,p.slice(1)),sync:!0,noResume:!0,onentry:v=>m.add(v)}):m.add(p)}),m.end()},d=(m,y)=>{for(;y.length;){let p=y.shift();if(p.charAt(0)==="@")return o({file:a.resolve(m.cwd,p.slice(1)),noResume:!0,onentry:v=>m.add(v)}).then(v=>d(m,y));m.add(p)}m.end()}}),MH=de((t,e)=>{"use strict";Q();var r=da(),i=TR();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),n(u),i(u,o,a)};var n=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)}}),jH=de((t,e)=>{Q();var{promisify:r}=ye("util"),i=ye("fs"),n=s=>{if(!s)s={mode:511,fs:i};else if(typeof s=="object")s={mode:511,fs:i,...s};else if(typeof s=="number")s={mode:s,fs:i};else if(typeof s=="string")s={mode:parseInt(s,8),fs:i};else throw new TypeError("invalid options argument");return s.mkdir=s.mkdir||s.fs.mkdir||i.mkdir,s.mkdirAsync=r(s.mkdir),s.stat=s.stat||s.fs.stat||i.stat,s.statAsync=r(s.stat),s.statSync=s.statSync||s.fs.statSync||i.statSync,s.mkdirSync=s.mkdirSync||s.fs.mkdirSync||i.mkdirSync,s};e.exports=n}),qH=de((t,e)=>{Q();var r=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:i,parse:n}=ye("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=i(o),r==="win32"){let a=/[*|"<>?:]/,{root:u}=n(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}),UH=de((t,e)=>{Q();var{dirname:r}=ye("path"),i=(s,o,a=void 0)=>a===o?Promise.resolve():s.statAsync(o).then(u=>u.isDirectory()?a:void 0,u=>u.code==="ENOENT"?i(s,r(o),o):void 0),n=(s,o,a=void 0)=>{if(a!==o)try{return s.statSync(o).isDirectory()?a:void 0}catch(u){return u.code==="ENOENT"?n(s,r(o),o):void 0}};e.exports={findMade:i,findMadeSync:n}}),kR=de((t,e)=>{Q();var{dirname:r}=ye("path"),i=(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 i(u,o).then(l=>i(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})})},n=(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 n(s,o,n(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:i,mkdirpManualSync:n}}),HH=de((t,e)=>{Q();var{dirname:r}=ye("path"),{findMade:i,findMadeSync:n}=UH(),{mkdirpManual:s,mkdirpManualSync:o}=kR(),a=(c,l)=>(l.recursive=!0,r(c)===c?l.mkdirAsync(c,l):i(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=n(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}}),$H=de((t,e)=>{Q();var r=ye("fs"),i=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,n=i.replace(/^v/,"").split("."),s=+n[0]>10||+n[0]==10&&+n[1]>=12,o=s?u=>u.mkdir===r.mkdir:()=>!1,a=s?u=>u.mkdirSync===r.mkdirSync:()=>!1;e.exports={useNative:o,useNativeSync:a}}),zH=de((t,e)=>{Q();var r=jH(),i=qH(),{mkdirpNative:n,mkdirpNativeSync:s}=HH(),{mkdirpManual:o,mkdirpManualSync:a}=kR(),{useNative:u,useNativeSync:c}=$H(),l=(f,d)=>(f=i(f),d=r(d),u(d)?n(f,d):o(f,d)),h=(f,d)=>(f=i(f),d=r(d),c(d)?s(f,d):a(f,d));l.sync=h,l.native=(f,d)=>n(i(f),r(d)),l.manual=(f,d)=>o(i(f),r(d)),l.nativeSync=(f,d)=>s(i(f),r(d)),l.manualSync=(f,d)=>a(i(f),r(d)),e.exports=l}),GH=de((t,e)=>{"use strict";Q();var r=ye("fs"),i=ye("path"),n=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=(k,P,F)=>{try{return r[s](k,P,F)}catch(M){if(M.code!=="ENOENT")throw M}},u=(k,P,F)=>{try{return r.chownSync(k,P,F)}catch(M){if(M.code!=="ENOENT")throw M}},c=o?(k,P,F,M)=>S=>{!S||S.code!=="EISDIR"?M(S):r.chown(k,P,F,M)}:(k,P,F,M)=>M,l=o?(k,P,F)=>{try{return a(k,P,F)}catch(M){if(M.code!=="EISDIR")throw M;u(k,P,F)}}:(k,P,F)=>a(k,P,F),h=process.version,f=(k,P,F)=>r.readdir(k,P,F),d=(k,P)=>r.readdirSync(k,P);/^v4\./.test(h)&&(f=(k,P,F)=>r.readdir(k,F));var m=(k,P,F,M)=>{r[n](k,P,F,c(k,P,F,S=>{M(S&&S.code!=="ENOENT"?S:null)}))},y=(k,P,F,M,S)=>{if(typeof P=="string")return r.lstat(i.resolve(k,P),(D,j)=>{if(D)return S(D.code!=="ENOENT"?D:null);j.name=P,y(k,j,F,M,S)});if(P.isDirectory())p(i.resolve(k,P.name),F,M,D=>{if(D)return S(D);let j=i.resolve(k,P.name);m(j,F,M,S)});else{let D=i.resolve(k,P.name);m(D,F,M,S)}},p=(k,P,F,M)=>{f(k,{withFileTypes:!0},(S,D)=>{if(S){if(S.code==="ENOENT")return M();if(S.code!=="ENOTDIR"&&S.code!=="ENOTSUP")return M(S)}if(S||!D.length)return m(k,P,F,M);let j=D.length,W=null,N=K=>{if(!W){if(K)return M(W=K);if(--j===0)return m(k,P,F,M)}};D.forEach(K=>y(k,K,P,F,N))})},v=(k,P,F,M)=>{if(typeof P=="string")try{let S=r.lstatSync(i.resolve(k,P));S.name=P,P=S}catch(S){if(S.code==="ENOENT")return;throw S}P.isDirectory()&&C(i.resolve(k,P.name),F,M),l(i.resolve(k,P.name),F,M)},C=(k,P,F)=>{let M;try{M=d(k,{withFileTypes:!0})}catch(S){if(S.code==="ENOENT")return;if(S.code==="ENOTDIR"||S.code==="ENOTSUP")return l(k,P,F);throw S}return M&&M.length&&M.forEach(S=>v(k,S,P,F)),l(k,P,F)};e.exports=p,p.sync=C}),WH=de((t,e)=>{"use strict";Q();var r=zH(),i=ye("fs"),n=ye("path"),s=GH(),o=pa(),a=class extends Error{constructor(y,p){super("Cannot extract through symbolic link"),this.path=p,this.symlink=y}get name(){return"SylinkError"}},u=class extends Error{constructor(y,p){super(p+": Cannot cd into '"+y+"'"),this.path=y,this.code=p}get name(){return"CwdError"}},c=(y,p)=>y.get(o(p)),l=(y,p,v)=>y.set(o(p),v),h=(y,p)=>{i.stat(y,(v,C)=>{(v||!C.isDirectory())&&(v=new u(y,v&&v.code||"ENOTDIR")),p(v)})};e.exports=(y,p,v)=>{y=o(y);let C=p.umask,k=p.mode|448,P=(k&C)!==0,F=p.uid,M=p.gid,S=typeof F=="number"&&typeof M=="number"&&(F!==p.processUid||M!==p.processGid),D=p.preserve,j=p.unlink,W=p.cache,N=o(p.cwd),K=(ne,U)=>{ne?v(ne):(l(W,y,!0),U&&S?s(U,F,M,I=>K(I)):P?i.chmod(y,k,v):v())};if(W&&c(W,y)===!0)return K();if(y===N)return h(y,K);if(D)return r(y,{mode:k}).then(ne=>K(null,ne),K);let te=o(n.relative(N,y)).split("/");f(N,te,k,W,j,N,null,K)};var f=(y,p,v,C,k,P,F,M)=>{if(!p.length)return M(null,F);let S=p.shift(),D=o(n.resolve(y+"/"+S));if(c(C,D))return f(D,p,v,C,k,P,F,M);i.mkdir(D,v,d(D,p,v,C,k,P,F,M))},d=(y,p,v,C,k,P,F,M)=>S=>{S?i.lstat(y,(D,j)=>{if(D)D.path=D.path&&o(D.path),M(D);else if(j.isDirectory())f(y,p,v,C,k,P,F,M);else if(k)i.unlink(y,W=>{if(W)return M(W);i.mkdir(y,v,d(y,p,v,C,k,P,F,M))});else{if(j.isSymbolicLink())return M(new a(y,y+"/"+p.join("/")));M(S)}}):(F=F||y,f(y,p,v,C,k,P,F,M))},m=y=>{let p=!1,v="ENOTDIR";try{p=i.statSync(y).isDirectory()}catch(C){v=C.code}finally{if(!p)throw new u(y,v)}};e.exports.sync=(y,p)=>{y=o(y);let v=p.umask,C=p.mode|448,k=(C&v)!==0,P=p.uid,F=p.gid,M=typeof P=="number"&&typeof F=="number"&&(P!==p.processUid||F!==p.processGid),S=p.preserve,D=p.unlink,j=p.cache,W=o(p.cwd),N=ne=>{l(j,y,!0),ne&&M&&s.sync(ne,P,F),k&&i.chmodSync(y,C)};if(j&&c(j,y)===!0)return N();if(y===W)return m(W),N();if(S)return N(r.sync(y,C));let K=o(n.relative(W,y)).split("/"),te=null;for(let ne=K.shift(),U=W;ne&&(U+="/"+ne);ne=K.shift())if(U=o(n.resolve(U)),!c(j,U))try{i.mkdirSync(U,C),te=te||U,l(j,U,!0)}catch{let I=i.lstatSync(U);if(I.isDirectory()){l(j,U,!0);continue}else if(D){i.unlinkSync(U),i.mkdirSync(U,C),te=te||U,l(j,U,!0);continue}else if(I.isSymbolicLink())return new a(U,U+"/"+K.join("/"))}return N(te)}}),OR=de((t,e)=>{Q();var r=Object.create(null),{hasOwnProperty:i}=Object.prototype;e.exports=n=>(i.call(r,n)||(r[n]=n.normalize("NFKD")),r[n])}),VH=de((t,e)=>{Q();var r=ye("assert"),i=OR(),n=ya(),{join:s}=ye("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((v,C)=>(v.length&&(C=s(v[v.length-1],C)),v.push(C||"/"),v),[]),h=new Set,f=p=>{let v=c.get(p);if(!v)throw new Error("function does not have any path reservations");return{paths:v.paths.map(C=>u.get(C)),dirs:[...v.dirs].map(C=>u.get(C))}},d=p=>{let{paths:v,dirs:C}=f(p);return v.every(k=>k[0]===p)&&C.every(k=>k[0]instanceof Set&&k[0].has(p))},m=p=>h.has(p)||!d(p)?!1:(h.add(p),p(()=>y(p)),!0),y=p=>{if(!h.has(p))return!1;let{paths:v,dirs:C}=c.get(p),k=new Set;return v.forEach(P=>{let F=u.get(P);r.equal(F[0],p),F.length===1?u.delete(P):(F.shift(),typeof F[0]=="function"?k.add(F[0]):F[0].forEach(M=>k.add(M)))}),C.forEach(P=>{let F=u.get(P);r(F[0]instanceof Set),F[0].size===1&&F.length===1?u.delete(P):F[0].size===1?(F.shift(),k.add(F[0])):F[0].delete(p)}),h.delete(p),k.forEach(P=>m(P)),!0};return{check:d,reserve:(p,v)=>{p=a?["win32 parallelization disabled"]:p.map(k=>i(n(s(k))).toLowerCase());let C=new Set(p.map(k=>l(k)).reduce((k,P)=>k.concat(P)));return c.set(v,{dirs:C,paths:p}),p.forEach(k=>{let P=u.get(k);P?P.push(v):u.set(k,[v])}),C.forEach(k=>{let P=u.get(k);P?P[P.length-1]instanceof Set?P[P.length-1].add(v):P.push(new Set([v])):u.set(k,[new Set([v])])}),m(v)}}}}),YH=de((t,e)=>{Q();var r=process.env.__FAKE_PLATFORM__||process.platform,i=r==="win32",n=global.__FAKE_TESTING_FS__||ye("fs"),{O_CREAT:s,O_TRUNC:o,O_WRONLY:a,UV_FS_O_FILEMAP:u=0}=n.constants,c=i&&!!u,l=512*1024,h=u|o|s|a;e.exports=c?f=>f<l?h:"w":()=>"w"}),FR=de((t,e)=>{"use strict";Q();var r=ye("assert"),i=i0(),n=ye("fs"),s=ga(),o=ye("path"),a=WH(),u=DR(),c=VH(),l=AR(),h=pa(),f=ya(),d=OR(),m=Symbol("onEntry"),y=Symbol("checkFs"),p=Symbol("checkFs2"),v=Symbol("pruneCache"),C=Symbol("isReusable"),k=Symbol("makeFs"),P=Symbol("file"),F=Symbol("directory"),M=Symbol("link"),S=Symbol("symlink"),D=Symbol("hardlink"),j=Symbol("unsupported"),W=Symbol("checkPath"),N=Symbol("mkdir"),K=Symbol("onError"),te=Symbol("pending"),ne=Symbol("pend"),U=Symbol("unpend"),I=Symbol("ended"),L=Symbol("maybeClose"),z=Symbol("skip"),Z=Symbol("doChown"),q=Symbol("uid"),g=Symbol("gid"),_=Symbol("checkedCwd"),E=ye("crypto"),R=YH(),x=process.env.TESTING_TAR_FAKE_PLATFORM||process.platform,H=x==="win32",$=(b,G)=>{if(!H)return n.unlink(b,G);let ee=b+".DELETE."+E.randomBytes(16).toString("hex");n.rename(b,ee,le=>{if(le)return G(le);n.unlink(ee,G)})},re=b=>{if(!H)return n.unlinkSync(b);let G=b+".DELETE."+E.randomBytes(16).toString("hex");n.renameSync(b,G),n.unlinkSync(G)},V=(b,G,ee)=>b===b>>>0?b:G===G>>>0?G:ee,he=b=>d(f(h(b))).toLowerCase(),J=(b,G)=>{G=he(G);for(let ee of b.keys()){let le=he(ee);(le===G||le.indexOf(G+"/")===0)&&b.delete(ee)}},w=b=>{for(let G of b.keys())b.delete(G)},B=class extends i{constructor(b){if(b||(b={}),b.ondone=G=>{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[te]=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",G=>this[m](G))}warn(b,G,ee={}){return(b==="TAR_BAD_ARCHIVE"||b==="TAR_ABORT")&&(ee.recoverable=!1),super.warn(b,G,ee)}[L](){this[I]&&this[te]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[W](b){if(this.strip){let G=h(b.path).split("/");if(G.length<this.strip)return!1;if(b.path=G.slice(this.strip).join("/"),b.type==="Link"){let ee=h(b.linkpath).split("/");if(ee.length>=this.strip)b.linkpath=ee.slice(this.strip).join("/");else return!1}}if(!this.preservePaths){let G=h(b.path),ee=G.split("/");if(ee.includes("..")||H&&/^[a-z]:\.\.$/i.test(ee[0]))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:b,path:G}),!1;let[le,pe]=l(G);le&&(b.path=pe,this.warn("TAR_ENTRY_INFO",`stripping ${le} from absolute path`,{entry:b,path:G}))}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:G}=o.win32.parse(b.absolute);b.absolute=G+u.encode(b.absolute.slice(G.length));let{root:ee}=o.win32.parse(b.path);b.path=ee+u.encode(b.path.slice(ee.length))}return!0}[m](b){if(!this[W](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[y](b);case"CharacterDevice":case"BlockDevice":case"FIFO":default:return this[j](b)}}[K](b,G){b.name==="CwdError"?this.emit("error",b):(this.warn("TAR_ENTRY_ERROR",b,{entry:G}),this[U](),G.resume())}[N](b,G,ee){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:G,noChmod:this.noChmod},ee)}[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 V(this.uid,b.uid,this.processUid)}[g](b){return V(this.gid,b.gid,this.processGid)}[P](b,G){let ee=b.mode&4095||this.fmode,le=new s.WriteStream(b.absolute,{flags:R(b.size),mode:ee,autoClose:!1});le.on("error",we=>{le.fd&&n.close(le.fd,()=>{}),le.write=()=>!0,this[K](we,b),G()});let pe=1,Se=we=>{if(we){le.fd&&n.close(le.fd,()=>{}),this[K](we,b),G();return}--pe===0&&n.close(le.fd,He=>{He?this[K](He,b):this[U](),G()})};le.on("finish",we=>{let He=b.absolute,Zt=le.fd;if(b.mtime&&!this.noMtime){pe++;let Jt=b.atime||new Date,no=b.mtime;n.futimes(Zt,Jt,no,so=>so?n.utimes(He,Jt,no,Nl=>Se(Nl&&so)):Se())}if(this[Z](b)){pe++;let Jt=this[q](b),no=this[g](b);n.fchown(Zt,Jt,no,so=>so?n.chown(He,Jt,no,Nl=>Se(Nl&&so)):Se())}Se()});let xe=this.transform&&this.transform(b)||b;xe!==b&&(xe.on("error",we=>{this[K](we,b),G()}),b.pipe(xe)),xe.pipe(le)}[F](b,G){let ee=b.mode&4095||this.dmode;this[N](b.absolute,ee,le=>{if(le){this[K](le,b),G();return}let pe=1,Se=xe=>{--pe===0&&(G(),this[U](),b.resume())};b.mtime&&!this.noMtime&&(pe++,n.utimes(b.absolute,b.atime||new Date,b.mtime,Se)),this[Z](b)&&(pe++,n.chown(b.absolute,this[q](b),this[g](b),Se)),Se()})}[j](b){b.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${b.type}`,{entry:b}),b.resume()}[S](b,G){this[M](b,b.linkpath,"symlink",G)}[D](b,G){let ee=h(o.resolve(this.cwd,b.linkpath));this[M](b,ee,"link",G)}[ne](){this[te]++}[U](){this[te]--,this[L]()}[z](b){this[U](),b.resume()}[C](b,G){return b.type==="File"&&!this.unlink&&G.isFile()&&G.nlink<=1&&!H}[y](b){this[ne]();let G=[b.path];b.linkpath&&G.push(b.linkpath),this.reservations.reserve(G,ee=>this[p](b,ee))}[v](b){b.type==="SymbolicLink"?w(this.dirCache):b.type!=="Directory"&&J(this.dirCache,b.absolute)}[p](b,G){this[v](b);let ee=xe=>{this[v](b),G(xe)},le=()=>{this[N](this.cwd,this.dmode,xe=>{if(xe){this[K](xe,b),ee();return}this[_]=!0,pe()})},pe=()=>{if(b.absolute!==this.cwd){let xe=h(o.dirname(b.absolute));if(xe!==this.cwd)return this[N](xe,this.dmode,we=>{if(we){this[K](we,b),ee();return}Se()})}Se()},Se=()=>{n.lstat(b.absolute,(xe,we)=>{if(we&&(this.keep||this.newer&&we.mtime>b.mtime)){this[z](b),ee();return}if(xe||this[C](b,we))return this[k](null,b,ee);if(we.isDirectory()){if(b.type==="Directory"){let He=!this.noChmod&&b.mode&&(we.mode&4095)!==b.mode,Zt=Jt=>this[k](Jt,b,ee);return He?n.chmod(b.absolute,b.mode,Zt):Zt()}if(b.absolute!==this.cwd)return n.rmdir(b.absolute,He=>this[k](He,b,ee))}if(b.absolute===this.cwd)return this[k](null,b,ee);$(b.absolute,He=>this[k](He,b,ee))})};this[_]?pe():le()}[k](b,G,ee){if(b){this[K](b,G),ee();return}switch(G.type){case"File":case"OldFile":case"ContiguousFile":return this[P](G,ee);case"Link":return this[D](G,ee);case"SymbolicLink":return this[S](G,ee);case"Directory":case"GNUDumpDir":return this[F](G,ee)}}[M](b,G,ee,le){n[ee](G,b.absolute,pe=>{pe?this[K](pe,b):(this[U](),b.resume()),le()})}},A=b=>{try{return[null,b()]}catch(G){return[G,null]}},X=class extends B{[k](b,G){return super[k](b,G,()=>{})}[y](b){if(this[v](b),!this[_]){let pe=this[N](this.cwd,this.dmode);if(pe)return this[K](pe,b);this[_]=!0}if(b.absolute!==this.cwd){let pe=h(o.dirname(b.absolute));if(pe!==this.cwd){let Se=this[N](pe,this.dmode);if(Se)return this[K](Se,b)}}let[G,ee]=A(()=>n.lstatSync(b.absolute));if(ee&&(this.keep||this.newer&&ee.mtime>b.mtime))return this[z](b);if(G||this[C](b,ee))return this[k](null,b);if(ee.isDirectory()){if(b.type==="Directory"){let Se=!this.noChmod&&b.mode&&(ee.mode&4095)!==b.mode,[xe]=Se?A(()=>{n.chmodSync(b.absolute,b.mode)}):[];return this[k](xe,b)}let[pe]=A(()=>n.rmdirSync(b.absolute));this[k](pe,b)}let[le]=b.absolute===this.cwd?[]:A(()=>re(b.absolute));this[k](le,b)}[P](b,G){let ee=b.mode&4095||this.fmode,le=xe=>{let we;try{n.closeSync(pe)}catch(He){we=He}(xe||we)&&this[K](xe||we,b),G()},pe;try{pe=n.openSync(b.absolute,R(b.size),ee)}catch(xe){return le(xe)}let Se=this.transform&&this.transform(b)||b;Se!==b&&(Se.on("error",xe=>this[K](xe,b)),b.pipe(Se)),Se.on("data",xe=>{try{n.writeSync(pe,xe,0,xe.length)}catch(we){le(we)}}),Se.on("end",xe=>{let we=null;if(b.mtime&&!this.noMtime){let He=b.atime||new Date,Zt=b.mtime;try{n.futimesSync(pe,He,Zt)}catch(Jt){try{n.utimesSync(b.absolute,He,Zt)}catch{we=Jt}}}if(this[Z](b)){let He=this[q](b),Zt=this[g](b);try{n.fchownSync(pe,He,Zt)}catch(Jt){try{n.chownSync(b.absolute,He,Zt)}catch{we=we||Jt}}}le(we)})}[F](b,G){let ee=b.mode&4095||this.dmode,le=this[N](b.absolute,ee);if(le){this[K](le,b),G();return}if(b.mtime&&!this.noMtime)try{n.utimesSync(b.absolute,b.atime||new Date,b.mtime)}catch{}if(this[Z](b))try{n.chownSync(b.absolute,this[q](b),this[g](b))}catch{}G(),b.resume()}[N](b,G){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:G})}catch(ee){return ee}}[M](b,G,ee,le){try{n[ee+"Sync"](G,b.absolute),le(),b.resume()}catch(pe){return this[K](pe,b)}}};B.Sync=X,e.exports=B}),KH=de((t,e)=>{"use strict";Q();var r=da(),i=FR(),n=ye("fs"),s=ga(),o=ye("path"),a=ya();e.exports=(d,m,y)=>{typeof d=="function"?(y=d,m=null,d={}):Array.isArray(d)&&(m=d,d={}),typeof m=="function"&&(y=m,m=null),m?m=Array.from(m):m=[];let p=r(d);if(p.sync&&typeof y=="function")throw new TypeError("callback not supported for sync tar functions");if(!p.file&&typeof y=="function")throw new TypeError("callback only supported with file option");return m.length&&u(p,m),p.file&&p.sync?c(p):p.file?l(p,y):p.sync?h(p):f(p)};var u=(d,m)=>{let y=new Map(m.map(C=>[a(C),!0])),p=d.filter,v=(C,k)=>{let P=k||o.parse(C).root||".",F=C===P?!1:y.has(C)?y.get(C):v(o.dirname(C),P);return y.set(C,F),F};d.filter=p?(C,k)=>p(C,k)&&v(a(C)):C=>v(a(C))},c=d=>{let m=new i.Sync(d),y=d.file,p=n.statSync(y),v=d.maxReadSize||16*1024*1024;new s.ReadStreamSync(y,{readSize:v,size:p.size}).pipe(m)},l=(d,m)=>{let y=new i(d),p=d.maxReadSize||16*1024*1024,v=d.file,C=new Promise((k,P)=>{y.on("error",P),y.on("close",k),n.stat(v,(F,M)=>{if(F)P(F);else{let S=new s.ReadStream(v,{readSize:p,size:M.size});S.on("error",P),S.pipe(y)}})});return m?C.then(m,m):C},h=d=>new i.Sync(d),f=d=>new i(d)}),ZH=de(t=>{"use strict";Q(),t.c=t.create=NH(),t.r=t.replace=TR(),t.t=t.list=n0(),t.u=t.update=MH(),t.x=t.extract=KH(),t.Pack=r0(),t.Unpack=FR(),t.Parse=i0(),t.ReadEntry=Qy(),t.WriteEntry=CR(),t.Header=ma(),t.Pax=e0(),t.types=xR()}),JH=de((t,e)=>{Q();function r(i,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=n||{},this._maxRetryTime=n&&n.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(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var n=new Date().getTime();if(i&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);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(i,n){this._fn=i,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.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(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)},r.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)},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 i={},n=null,s=0,o=0;o<this._errors.length;o++){var a=this._errors[o],u=a.message,c=(i[u]||0)+1;i[u]=c,c>=s&&(n=a,s=c)}return n}}),XH=de(t=>{Q();var e=JH();t.operation=function(r){var i=t.timeouts(r);return new e(i,{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 i={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in r)i[n]=r[n];if(i.minTimeout>i.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<i.retries;o++)s.push(this.createTimeout(o,i));return r&&r.forever&&!s.length&&s.push(this.createTimeout(o,i)),s.sort(function(a,u){return a-u}),s},t.createTimeout=function(r,i){var n=i.randomize?Math.random()+1:1,s=Math.round(n*Math.max(i.minTimeout,1)*Math.pow(i.factor,r));return s=Math.min(s,i.maxTimeout),s},t.wrap=function(r,i,n){if(i instanceof Array&&(n=i,i=null),!n){n=[];for(var s in r)typeof r[s]=="function"&&n.push(s)}for(var o=0;o<n.length;o++){var a=n[o],u=r[a];r[a]=function(c){var l=t.operation(i),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=i}}}),QH=de((t,e)=>{Q(),e.exports=XH()}),e6=de((t,e)=>{Q();var r=QH();function i(n,s){function o(a,u){var c=s||{},l;"randomize"in c||(c.randomize=!0),l=r.operation(c);function h(m){u(m||new Error("Aborted"))}function f(m,y){if(m.bail){h(m);return}l.retry(m)?c.onRetry&&c.onRetry(m,y):u(l.mainError())}function d(m){var y;try{y=n(h,m)}catch(p){f(p,m);return}Promise.resolve(y).then(a).catch(function(p){f(p,m)})}l.attempt(d)}return new Promise(o)}e.exports=i}),t6={};wH(t6,{bold:()=>o6,dimmed:()=>u6,error:()=>f6,grey:()=>c6,info:()=>s6,item:()=>l6,log:()=>Tn,turboBlue:()=>eo,turboGradient:()=>i6,turboLoader:()=>n6,turboRed:()=>NR,underline:()=>a6,warn:()=>h6,yellow:()=>MR});Q();var LR="#0099F7",BR="#F11712",r6="#FFFF00",i6=(0,IR.default)(LR,BR),eo=Ni.default.hex(LR),NR=Ni.default.hex(BR),MR=Ni.default.hex(r6),n6=t=>(0,PR.default)({text:t,spinner:{frames:[" ",eo("> "),eo(">> "),eo(">>>")]}}),s6=(...t)=>{Tn(eo.bold(">>>"),...t)},o6=(...t)=>{Tn(Ni.default.bold(...t))},a6=(...t)=>{Tn(Ni.default.underline(...t))},u6=(...t)=>{Tn(Ni.default.dim(...t))},c6=(...t)=>{Tn(Ni.default.grey(...t))},l6=(...t)=>{Tn(eo.bold(" \u2022"),...t)},Tn=(...t)=>{console.log(...t)},h6=(...t)=>{console.error(MR.bold(">>>"),...t)},f6=(...t)=>{console.error(NR.bold(">>>"),...t)};Q();async function Sl(t,e=[],r){let i={cwd:jR.default.tmpdir(),env:{COREPACK_ENABLE_STRICT:"0"},...r};try{let{stdout:n}=await(0,qR.default)(t,e,i);return n.trim()}catch{return}}async function UR(){let[t,e,r,i]=await Promise.all([Sl("yarnpkg",["--version"]),Sl("npm",["--version"]),Sl("pnpm",["--version"]),Sl("bun",["--version"])]);return{yarn:t,pnpm:r,npm:e,bun:i}}Q();Q();Q();var HW=Al(AH());Q();Q();function d6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Q();Q();function Ky(t){return Ky=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},Ky(t)}Q();function p6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m6(t,e){if(e&&(Ky(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p6(t)}Q();function Dl(t){return Dl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dl(t)}Q();Q();function la(t,e){return la=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},la(t,e)}function y6(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&&la(t,e)}Q();Q();function g6(t){return Function.toString.call(t).indexOf("[native code]")!==-1}Q();Q();function _6(){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 xl(t,e,r){return _6()?xl=Reflect.construct.bind():xl=function(i,n,s){var o=[null];o.push.apply(o,n);var a=Function.bind.apply(i,o),u=new a;return s&&la(u,s.prototype),u},xl.apply(null,arguments)}function Zy(t){var e=typeof Map=="function"?new Map:void 0;return Zy=function(r){if(r===null||!g6(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,i)}function i(){return xl(r,arguments,Dl(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),la(i,r)},Zy(t)}var $W=Al(FH()),WW=function(t){y6(e,t);function e(r){var i;return d6(this,e),i=m6(this,Dl(e).call(this,"No package.json could be found upwards from the directory ".concat(r))),i.directory=r,i}return e}(Zy(Error));Q();Q();Q();Q();Q();Q();var iV=Al(ZH()),nV=(0,$R.promisify)(HR.Stream.pipeline);Q();Q();var uV=Al(e6());Q();Q();Q();var qe=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,qe)}};Q();Q();Q();Q();var b6=/^(?!_)(?<manager>.+)@(?<version>.+)$/;function vt({workspaceRoot:t}){let e=ri.default.join(t,"package.json");try{return(0,It.readJsonSync)(e,"utf8")}catch(r){if(r&&typeof r=="object"&&"code"in r){if(r.code==="ENOENT")throw new qe(`no "package.json" found at ${t}`,{type:"package_json-missing"});if(r.code==="EJSONPARSE")throw new qe(`failed to parse "package.json" at ${t}`,{type:"package_json-parse_error"})}throw new Error(`unexpected error reading "package.json" at ${t}`)}}function Cl({workspaceRoot:t}){let{packageManager:e}=vt({workspaceRoot:t});if(e)try{let r=b6.exec(e);if(r){let[i,n]=r;return n}}catch{}}function _a({workspaceRoot:t}){let e=vt({workspaceRoot:t}),r=ri.default.basename(t),{name:i=r,description:n}=e;return{name:i,description:n}}function _R({workspaceRoot:t}){let e=ri.default.join(t,"pnpm-workspace.yaml");if((0,It.existsSync)(e))try{let r=fh.load((0,It.readFileSync)(e,"utf8"));if(r instanceof Object&&"packages"in r&&Array.isArray(r.packages))return r.packages}catch{throw new qe(`failed to parse ${e}`,{type:"pnpm-workspace_parse_error"})}return[]}function Rl({root:t,lockFile:e,workspaceConfig:r}){let i=s=>ri.default.join(t,s),n={root:t,lockfile:i(e),packageJson:i("package.json"),nodeModules:i("node_modules")};return r&&(n.workspaceConfig=i(r)),n}function s0({workspaces:t}){var e;return t?Array.isArray(t)?t:"packages"in t?(e=t.packages)!=null?e:[]:[]:[]}function Tl({workspaceRoot:t,workspaceGlobs:e}){if(!e)return[];let r=e.filter(i=>i.startsWith("!")).map(i=>i.slice(1));return e.filter(i=>!i.startsWith("!")).flatMap(i=>{let n=[`${i}/package.json`];return(0,KR.sync)(n,{onlyFiles:!0,absolute:!0,cwd:t,ignore:["**/node_modules/**",...r]})}).map(i=>{let n=ri.default.dirname(i),{name:s,description:o}=_a({workspaceRoot:n});return{name:s,description:o,paths:{root:n,packageJson:i,nodeModules:ri.default.join(n,"node_modules")}}})}function E6({directory:t}){let e=ri.default.resolve(process.cwd(),t);return{exists:(0,It.existsSync)(e),absolute:e}}function Mi({packageManager:t,action:e,project:r}){let i=r.workspaceData.globs.length>0;return`${e==="remove"?"Removing":"Adding"} ${t} ${i?"workspaces":""} ${e==="remove"?"from":"to"} ${r.name}`}function v6({project:t}){let e=r=>!(r.includes("*")&&(r.includes("**")||r.split("/").slice(0,-1).join("/").includes("*"))||["!","[","]","{","}"].some(i=>r.includes(i)));return t.workspaceData.globs.every(e)}function ti({project:t,options:e}){e!=null&&e.dry||(0,It.rmSync)(t.paths.lockfile,{force:!0})}async function ZR({project:t,options:e}){if(!(e!=null&&e.dry)&&(0,It.existsSync)(t.paths.lockfile))try{let{stdout:r}=await(0,YR.default)("bun",["bun.lockb"],{stdin:"ignore",cwd:t.paths.root});await(0,It.writeFile)(ri.default.join(t.paths.root,"yarn.lock"),r)}catch{}finally{(0,It.rmSync)(t.paths.lockfile,{force:!0})}}function w6({dependencyList:t,project:e,to:r}){let i=[];return e.workspaceData.workspaces.forEach(n=>{let{name:s}=n;if(t[s]){let o=t[s],a=o.startsWith("workspace:")?o.slice(10):o;t[s]=r.name==="pnpm"?`workspace:${a}`:a,i.push(s)}}),{dependencyList:t,updated:i}}function Li({project:t,workspace:e,to:r,logger:i,options:n}){if(["yarn","npm","bun"].includes(r.name)&&["yarn","npm","bun"].includes(t.packageManager))return;let s=vt({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:m}=w6({dependencyList:f,project:t,to:r});s[h]=m,o[h]=d}});let u=h=>{let f=o[h].length;if(f>0)return`${VR.default.green(f.toString())} ${h}`},c=a.map(u).filter(Boolean),l=`./${GR.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}, `}),i.workspaceStep(h)}else i.workspaceStep(`no workspace dependencies found in ${l}`);n!=null&&n.dry||(0,WR.writeJSONSync)(e.paths.packageJson,s,{spaces:2})}var Bi={name:"pnpm",lock:"pnpm-lock.yaml"};async function JR(t){let e=Cn.default.join(t.workspaceRoot,Bi.lock),r=Cn.default.join(t.workspaceRoot,"pnpm-workspace.yaml"),i=Cl({workspaceRoot:t.workspaceRoot});return(0,dt.existsSync)(e)||(0,dt.existsSync)(r)||i===Bi.name}async function S6(t){if(!await JR(t))throw new qe("Not a pnpm project",{type:"package_manager-unexpected"});let{name:e,description:r}=_a(t);return{name:e,description:r,packageManager:Bi.name,paths:Rl({root:t.workspaceRoot,lockFile:Bi.lock,workspaceConfig:"pnpm-workspace.yaml"}),workspaceData:{globs:_R(t),workspaces:Tl({workspaceGlobs:_R(t),...t})}}}async function x6(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Mi({action:"create",packageManager:Bi.name,project:e}));let o=vt({workspaceRoot:e.paths.root});i.rootHeader(),o.packageManager=`${r.name}@${r.version}`,i.rootStep(`adding "packageManager" field to ${e.name} root "package.json"`),n!=null&&n.dry||((0,dt.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),s&&(i.rootStep('adding "pnpm-workspace.yaml"'),(0,dt.writeFileSync)(Cn.default.join(e.paths.root,"pnpm-workspace.yaml"),`packages:
|
57
57
|
${e.workspaceData.globs.map(a=>` - "${a}"`).join(`
|
58
58
|
`)}`))),s&&(Li({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Li({workspace:a,project:e,to:r,logger:i,options:n})}))}async function D6(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Mi({action:"remove",packageManager:Bi.name,project:e}));let s=vt({workspaceRoot:e.paths.root});if(e.paths.workspaceConfig&&n&&(r.subStep('removing "pnpm-workspace.yaml"'),i!=null&&i.dry||(0,dt.rmSync)(e.paths.workspaceConfig,{force:!0})),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,dt.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,dt.rm)(a,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function A6(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${Cn.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,dt.rmSync)(e.paths.lockfile,{force:!0})}async function C6(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${Cn.default.relative(e.paths.root,e.paths.lockfile)} to ${Bi.lock}`)},s=async()=>{if(!(r!=null&&r.dry)&&(0,dt.existsSync)(e.paths.lockfile))try{await(0,zR.default)(Bi.name,["import"],{stdio:"ignore",cwd:e.paths.root})}catch{}finally{ti({project:e,options:r})}};switch(e.packageManager){case"pnpm":break;case"bun":n(),await ZR({project:e,options:r}),await s(),(0,dt.rmSync)(Cn.default.join(e.paths.root,"yarn.lock"),{force:!0});break;case"npm":n(),await s();break;case"yarn":n(),await s();break}}var R6={detect:JR,read:S6,create:x6,remove:D6,clean:A6,convertLock:C6};Q();var to={name:"npm",lock:"package-lock.json"};async function XR(t){let e=ha.default.join(t.workspaceRoot,to.lock),r=Cl({workspaceRoot:t.workspaceRoot});return(0,xr.existsSync)(e)||r===to.name}async function T6(t){if(!await XR(t))throw new qe("Not an npm project",{type:"package_manager-unexpected"});let e=vt(t),{name:r,description:i}=_a(t),n=s0({workspaces:e.workspaces});return{name:r,description:i,packageManager:to.name,paths:Rl({root:t.workspaceRoot,lockFile:to.lock}),workspaceData:{globs:n,workspaces:Tl({workspaceGlobs:n,...t})}}}async function k6(t){let{project:e,options:r,to:i,logger:n}=t,s=e.workspaceData.globs.length>0;n.mainStep(Mi({packageManager:to.name,action:"create",project:e}));let o=vt({workspaceRoot:e.paths.root});n.rootHeader(),n.rootStep(`adding "packageManager" field to ${ha.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${i.name}@${i.version}`,s?(n.rootStep(`adding "workspaces" field to ${ha.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,r!=null&&r.dry||(0,xr.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Li({workspace:{name:"root",paths:e.paths},project:e,to:i,logger:n,options:r}),n.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Li({workspace:a,project:e,to:i,logger:n,options:r})})):r!=null&&r.dry||(0,xr.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function O6(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Mi({packageManager:to.name,action:"remove",project:e}));let s=vt({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,xr.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,xr.rm)(a,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function F6(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${ha.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,xr.rmSync)(e.paths.lockfile,{force:!0})}async function P6(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":ti({project:e,options:r});break;case"bun":ti({project:e,options:r});break;case"npm":break;case"yarn":ti({project:e,options:r});break}}var I6={detect:XR,read:T6,create:k6,remove:O6,clean:F6,convertLock:P6};Q();var Rn={name:"yarn",lock:"yarn.lock"};async function QR(t){let e=ro.default.join(t.workspaceRoot,Rn.lock),r=Cl({workspaceRoot:t.workspaceRoot});return(0,Dr.existsSync)(e)||r===Rn.name}async function L6(t){if(!await QR(t))throw new qe("Not a yarn project",{type:"package_manager-unexpected"});let e=vt(t),{name:r,description:i}=_a(t),n=s0({workspaces:e.workspaces});return{name:r,description:i,packageManager:Rn.name,paths:Rl({root:t.workspaceRoot,lockFile:Rn.lock}),workspaceData:{globs:n,workspaces:Tl({workspaceGlobs:n,...t})}}}async function B6(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;i.mainStep(Mi({packageManager:Rn.name,action:"create",project:e}));let o=vt({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${ro.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${ro.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,Dr.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Li({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Li({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,Dr.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function N6(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Mi({packageManager:Rn.name,action:"remove",project:e}));let s=vt({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,Dr.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Dr.rm)(a,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function M6(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${ro.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Dr.rmSync)(e.paths.lockfile,{force:!0})}async function j6(t){let{project:e,options:r,logger:i}=t,n=()=>{i.subStep(`converting ${ro.default.relative(e.paths.root,e.paths.lockfile)} to ${Rn.lock}`)};switch(e.packageManager){case"pnpm":ti({project:e,options:r});break;case"bun":n(),await ZR({project:e,options:r});break;case"npm":ti({project:e,options:r});break;case"yarn":break}}var q6={detect:QR,read:L6,create:B6,remove:N6,clean:M6,convertLock:j6};Q();var io={name:"bun",lock:"bun.lockb"};async function eT(t){let e=fa.default.join(t.workspaceRoot,io.lock),r=Cl({workspaceRoot:t.workspaceRoot});return(0,Ar.existsSync)(e)||r===io.name}async function U6(t){if(!await eT(t))throw new qe("Not a bun project",{type:"package_manager-unexpected"});let e=vt(t),{name:r,description:i}=_a(t),n=s0({workspaces:e.workspaces});return{name:r,description:i,packageManager:io.name,paths:Rl({root:t.workspaceRoot,lockFile:io.lock}),workspaceData:{globs:n,workspaces:Tl({workspaceGlobs:n,...t})}}}async function H6(t){let{project:e,to:r,logger:i,options:n}=t,s=e.workspaceData.globs.length>0;if(!v6({project:e}))throw new qe("Unable to convert project to bun - workspace globs unsupported",{type:"bun-workspace_glob_error"});i.mainStep(Mi({packageManager:io.name,action:"create",project:e}));let o=vt({workspaceRoot:e.paths.root});i.rootHeader(),i.rootStep(`adding "packageManager" field to ${fa.default.relative(e.paths.root,e.paths.packageJson)}`),o.packageManager=`${r.name}@${r.version}`,s?(i.rootStep(`adding "workspaces" field to ${fa.default.relative(e.paths.root,e.paths.packageJson)}`),o.workspaces=e.workspaceData.globs,n!=null&&n.dry||(0,Ar.writeJSONSync)(e.paths.packageJson,o,{spaces:2}),Li({workspace:{name:"root",paths:e.paths},project:e,to:r,logger:i,options:n}),i.workspaceHeader(),e.workspaceData.workspaces.forEach(a=>{Li({workspace:a,project:e,to:r,logger:i,options:n})})):n!=null&&n.dry||(0,Ar.writeJSONSync)(e.paths.packageJson,o,{spaces:2})}async function $6(t){let{project:e,logger:r,options:i}=t,n=e.workspaceData.globs.length>0;r.mainStep(Mi({packageManager:io.name,action:"remove",project:e}));let s=vt({workspaceRoot:e.paths.root});if(n&&(r.subStep(`removing "workspaces" field in ${e.name} root "package.json"`),delete s.workspaces),r.subStep(`removing "packageManager" field in ${e.name} root "package.json"`),delete s.packageManager,!(i!=null&&i.dry)){(0,Ar.writeJSONSync)(e.paths.packageJson,s,{spaces:2});let o=[e.paths.nodeModules,...e.workspaceData.workspaces.map(a=>a.paths.nodeModules)];try{r.subStep('removing "node_modules"'),await Promise.all(o.map(a=>(0,Ar.rm)(a,{recursive:!0,force:!0})))}catch{throw new qe("Failed to remove node_modules",{type:"error_removing_node_modules"})}}}async function z6(t){let{project:e,logger:r,options:i}=t;r.subStep(`removing ${fa.default.relative(e.paths.root,e.paths.lockfile)}`),i!=null&&i.dry||(0,Ar.rmSync)(e.paths.lockfile,{force:!0})}async function G6(t){let{project:e,options:r}=t;switch(e.packageManager){case"pnpm":ti({project:e,options:r});break;case"bun":break;case"npm":ti({project:e,options:r});break;case"yarn":ti({project:e,options:r});break}}var W6={detect:eT,read:U6,create:H6,remove:$6,clean:z6,convertLock:G6},Qs={pnpm:R6,yarn:q6,npm:I6,bun:W6};Q();async function kl({root:t}){let{exists:e,absolute:r}=E6({directory:t});if(!e)throw new qe(`Could not find directory at ${r}. Ensure the directory exists.`,{type:"invalid_directory"});for(let{detect:i,read:n}of Object.values(Qs))if(await i({workspaceRoot:r}))return n({workspaceRoot:r});throw new qe("Could not determine package manager. Add `packageManager` to `package.json` or ensure a lockfile is present.",{type:"package_manager-unable_to_detect"})}Q();var Xs=2,o0=class{constructor({interactive:t,dry:e}={}){this.interactive=t!=null?t:!0,this.dry=e!=null?e:!1,this.step=1}logger(...t){this.interactive&&console.log(...t)}indented(t,...e){this.logger(" ".repeat(Xs*t),...e)}header(t){this.blankLine(),this.logger(Pt.default.bold(t))}installerFrames(){let t=`${" ".repeat(Xs)} - ${this.dry?Pt.default.yellow("SKIPPED | "):Pt.default.green("OK | ")}`;return[`${t} `,`${t}> `,`${t}>> `,`${t}>>>`]}gradient(t){return(0,tT.default)("#0099F7","#F11712")(t.toString())}hero(){this.logger(Pt.default.bold(this.gradient(`
|
59
59
|
>>> TURBOREPO
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "create-turbo",
|
3
|
-
"version": "2.0.1",
|
3
|
+
"version": "2.0.2-canary.1",
|
4
4
|
"description": "Create a new Turborepo",
|
5
5
|
"homepage": "https://turbo.build/repo",
|
6
6
|
"license": "MIT",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"@turbo/test-utils": "0.0.0",
|
42
42
|
"@turbo/tsconfig": "0.0.0",
|
43
43
|
"@turbo/utils": "0.0.0",
|
44
|
-
"@turbo/workspaces": "2.0.1"
|
44
|
+
"@turbo/workspaces": "2.0.2-canary.1"
|
45
45
|
},
|
46
46
|
"files": [
|
47
47
|
"dist"
|