turbo-ignore 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +1 -1
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -84,7 +84,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);g(E)}return}
84
84
  `+t.slice(i,s),i=s+1),o=a;return c+=`
85
85
  `,t.length-i>e&&o>i?c+=t.slice(i,o)+`
86
86
  `+t.slice(o+1):c+=t.slice(i),c.slice(1)}function cF(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=Fo(t,i),n=st[r],!n&&Ho(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||QM(r);return e}function uF(t,e,r){var n="",i=t.tag,s,o,a;for(s=0,o=r.length;s<o;s+=1)a=r[s],t.replacer&&(a=t.replacer.call(r,String(s),a)),(Ur(t,e,a,!1,!1)||typeof a>"u"&&Ur(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function oE(t,e,r,n){var i="",s=t.tag,o,a,c;for(o=0,a=r.length;o<a;o+=1)c=r[o],t.replacer&&(c=t.replacer.call(r,String(o),c)),(Ur(t,e+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ur(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=Mh(t,e)),t.dump&&Bo===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function lF(t,e,r){var n="",i=t.tag,s=Object.keys(r),o,a,c,l,f;for(o=0,a=s.length;o<a;o+=1)f="",n!==""&&(f+=", "),t.condenseFlow&&(f+='"'),c=s[o],l=r[c],t.replacer&&(l=t.replacer.call(r,c,l)),Ur(t,e,c,!1,!1)&&(t.dump.length>1024&&(f+="? "),f+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),Ur(t,e,l,!1,!1)&&(f+=t.dump,n+=f));t.tag=i,t.dump="{"+n+"}"}function fF(t,e,r,n){var i="",s=t.tag,o=Object.keys(r),a,c,l,f,h,d;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new wt("sortKeys must be a boolean or a function");for(a=0,c=o.length;a<c;a+=1)d="",(!n||i!=="")&&(d+=Mh(t,e)),l=o[a],f=r[l],t.replacer&&(f=t.replacer.call(r,l,f)),Ur(t,e+1,l,!0,!0,!0)&&(h=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,h&&(t.dump&&Bo===t.dump.charCodeAt(0)?d+="?":d+="? "),d+=t.dump,h&&(d+=Mh(t,e)),Ur(t,e+1,f,!0,h)&&(t.dump&&Bo===t.dump.charCodeAt(0)?d+=":":d+=": ",d+=t.dump,i+=d));t.tag=s,t.dump=i||"{}"}function aE(t,e,r){var n,i,s,o,a,c;for(i=r?t.explicitTypes:t.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(r?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(c=t.styleMap[a.tag]||a.defaultStyle,wE.call(a.represent)==="[object Function]")n=a.represent(e,c);else if(xE.call(a.represent,c))n=a.represent[c](e,c);else throw new wt("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');t.dump=n}return!0}return!1}function Ur(t,e,r,n,i,s,o){t.tag=null,t.dump=r,aE(t,r,!1)||aE(t,r,!0);var a=wE.call(t.dump),c=n,l;n&&(n=t.flowLevel<0||t.flowLevel>e);var f=a==="[object Object]"||a==="[object Array]",h,d;if(f&&(h=t.duplicates.indexOf(r),d=h!==-1),(t.tag!==null&&t.tag!=="?"||d||t.indent!==2&&e>0)&&(i=!1),d&&t.usedDuplicates[h])t.dump="*ref_"+h;else{if(f&&d&&!t.usedDuplicates[h]&&(t.usedDuplicates[h]=!0),a==="[object Object]")n&&Object.keys(t.dump).length!==0?(fF(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(lF(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?oE(t,e-1,t.dump,i):oE(t,e,t.dump,i),d&&(t.dump="&ref_"+h+t.dump)):(uF(t,e,t.dump),d&&(t.dump="&ref_"+h+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&oF(t,t.dump,e,s,c);else{if(a==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new wt("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(l=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?l="!"+l:l.slice(0,18)==="tag:yaml.org,2002:"?l="!!"+l.slice(18):l="!<"+l+">",t.dump=l+" "+t.dump)}return!0}function hF(t,e){var r=[],n=[],i,s;for(qh(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function qh(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)qh(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)qh(t[n[i]],e,r)}function dF(t,e){e=e||{};var r=new tF(e);r.noRefs||hF(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),Ur(r,0,n,!0,!0)?r.dump+`
87
- `:""}var pF=dF,mF={dump:pF};function Uh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var FK=EE.load,qK=EE.loadAll,BK=mF.dump;var jK=Uh("safeLoad","load"),HK=Uh("safeLoadAll","loadAll"),$K=Uh("safeDump","dump");var u6=le(v1()),l6=le(require("json5"));var Se={};sL(Se,{bold:()=>r6,dimmed:()=>i6,error:()=>qA,grey:()=>s6,info:()=>t6,item:()=>o6,log:()=>Tn,turboBlue:()=>vs,turboGradient:()=>e6,turboLoader:()=>MA,turboRed:()=>NA,underline:()=>n6,warn:()=>FA,yellow:()=>DA});u();var On=le(Yo()),kA=le(nA()),PA=le(TA()),IA="#0099F7",LA="#F11712",QH="#FFFF00",e6=(0,PA.default)(IA,LA),vs=On.default.hex(IA),NA=On.default.hex(LA),DA=On.default.hex(QH),MA=t=>(0,kA.default)({text:t,spinner:{frames:[" ",vs("> "),vs(">> "),vs(">>>")]}}),t6=(...t)=>{Tn(vs.bold(">>>"),...t)},r6=(...t)=>{Tn(On.default.bold(...t))},n6=(...t)=>{Tn(On.default.underline(...t))},i6=(...t)=>{Tn(On.default.dim(...t))},s6=(...t)=>{Tn(On.default.grey(...t))},o6=(...t)=>{Tn(vs.bold(" \u2022"),...t)},Tn=(...t)=>{console.log(...t)},FA=(...t)=>{console.error(DA.bold(">>>"),...t)},qA=(...t)=>{console.error(NA.bold(">>>"),...t)};u();var nU=le(require("os")),iU=le(fC());u();u();var sU=le(require("path"));var oU=le(Yo());u();var NP=require("stream"),DP=require("util"),G7=require("path"),V7=require("os"),MP=require("fs"),W7=le(uk());var Fee=(0,DP.promisify)(NP.Stream.pipeline);u();u();var rV=le(require("path")),nV=le(UP()),iV=le(Yo());u();u();var TI=le(Eu());u();var Lr=le(cI(),1),Lte=Lr.default.v1,Nte=Lr.default.v3,so=Lr.default.v4,Dte=Lr.default.v5,Mte=Lr.default.NIL,Fte=Lr.default.version,qte=Lr.default.validate,Bte=Lr.default.stringify,jte=Lr.default.parse;u();var me;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(me||(me={}));var A0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(A0||(A0={}));var U=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},N=me.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"]),pW=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var ja=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.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}"`:me.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.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 N.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 N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},fI=ja;function mW(t){fI=t}function Af(){return fI}var Rf=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},gW=[];function G(t,e){let r=Rf({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Af(),ja].filter(n=>!!n)});t.common.issues.push(r)}var Xe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Xe.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return oe;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},oe=Object.freeze({status:"aborted"}),hI=t=>({status:"dirty",value:t}),vt=t=>({status:"valid",value:t}),R0=t=>t.status==="aborted",C0=t=>t.status==="dirty",Ha=t=>t.status==="valid",Cf=t=>typeof Promise<"u"&&t instanceof Promise,X;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(X||(X={}));var ir=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},uI=(t,e)=>{if(Ha(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var ce=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 zn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xe,ctx:{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Cf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return uI(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Cf(i)?i:Promise.resolve(i));return uI(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ht({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return mr.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Zn.create(this,this._def)}or(e){return Pi.create([this,e],this._def)}and(e){return Ii.create(this,e,this._def)}transform(e){return new Ht({...ae(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Fi({...ae(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Of({typeName:te.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fo({...ae(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qi.create(this,e)}readonly(){return po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yW=/^c[^\s-]{8,}$/i,_W=/^[a-z][a-z0-9]*$/,vW=/^[0-9A-HJKMNP-TV-Z]{26}$/,bW=/^[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,EW=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",S0,xW=/^(((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}))$/,SW=/^(([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})))$/,AW=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 RW(t,e){return!!((e==="v4"||!e)&&xW.test(t)||(e==="v6"||!e)&&SW.test(t))}var qt=class extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.string,received:s.parsedType}),oe}let n=new Xe,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")EW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")S0||(S0=new RegExp(wW,"u")),S0.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")bW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")yW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")_W.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")vW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),G(i,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?AW(s).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?RW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):me.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...X.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.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)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...X.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...X.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...X.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...X.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...X.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...X.errToObj(r)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new qt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qt({...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}};qt.create=t=>{var e;return new qt({checks:[],typeName:te.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};function CW(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Nr=class extends ce{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)!==U.number){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.number,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?CW(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_finite,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Nr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.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"&&me.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Nr.create=t=>new Nr({checks:[],typeName:te.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var Dr=class extends ce{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)!==U.bigint){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.bigint,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Dr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.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}};Dr.create=t=>{var e;return new Dr({checks:[],typeName:te.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};var Oi=class extends ce{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.boolean,received:n.parsedType}),oe}return vt(e.data)}};Oi.create=t=>new Oi({typeName:te.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var hn=class extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.date,received:s.parsedType}),oe}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_date}),oe}let n=new Xe,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):me.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new hn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:X.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:X.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}};hn.create=t=>new hn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:te.ZodDate,...ae(t)});var ao=class extends ce{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.symbol,received:n.parsedType}),oe}return vt(e.data)}};ao.create=t=>new ao({typeName:te.ZodSymbol,...ae(t)});var Ti=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.undefined,received:n.parsedType}),oe}return vt(e.data)}};Ti.create=t=>new Ti({typeName:te.ZodUndefined,...ae(t)});var ki=class extends ce{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.null,received:n.parsedType}),oe}return vt(e.data)}};ki.create=t=>new ki({typeName:te.ZodNull,...ae(t)});var Kn=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return vt(e.data)}};Kn.create=t=>new Kn({typeName:te.ZodAny,...ae(t)});var fn=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vt(e.data)}};fn.create=t=>new fn({typeName:te.ZodUnknown,...ae(t)});var gr=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return G(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),oe}};gr.create=t=>new gr({typeName:te.ZodNever,...ae(t)});var co=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.void,received:n.parsedType}),oe}return vt(e.data)}};co.create=t=>new co({typeName:te.ZodVoid,...ae(t)});var jt=class extends ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return G(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),oe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(G(r,{code:o?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(G(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(G(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new ir(r,o,r.path,a)))).then(o=>Xe.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new ir(r,o,r.path,a)));return Xe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new jt({...this._def,minLength:{value:e,message:X.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:X.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:X.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ae(e)});function oo(t){if(t instanceof Oe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=mr.create(oo(n))}return new Oe({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:oo(t.element)}):t instanceof mr?mr.create(oo(t.unwrap())):t instanceof pn?pn.create(oo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>oo(e))):t}var Oe=class extends ce{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=me.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==U.object){let l=this._getOrReturnCtx(e);return G(l,{code:N.invalid_type,expected:U.object,received:l.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof gr&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let f=s[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new ir(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof gr){let l=this._def.unknownKeys;if(l==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(l==="strict")a.length>0&&(G(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let f of a){let h=i.data[f];c.push({key:{status:"valid",value:f},value:l._parse(new ir(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let f of c){let h=await f.key;l.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return l}).then(l=>Xe.mergeObjectSync(n,l)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return X.errToObj,new Oe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=X.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Oe({...this._def,unknownKeys:"strip"})}passthrough(){return new Oe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Oe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Oe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Oe({...this._def,catchall:e})}pick(e){let r={};return me.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}deepPartial(){return oo(this)}partial(e){let r={};return me.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Oe({...this._def,shape:()=>r})}required(e){let r={};return me.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof mr;)s=s._def.innerType;r[n]=s}}),new Oe({...this._def,shape:()=>r})}keyof(){return dI(me.objectKeys(this.shape))}};Oe.create=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strip",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});Oe.strictCreate=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strict",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});Oe.lazycreate=(t,e)=>new Oe({shape:t,unknownKeys:"strip",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});var Pi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return G(r,{code:N.invalid_union,unionErrors:o}),oe}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:l});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(c=>new Bt(c));return G(r,{code:N.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};Pi.create=(t,e)=>new Pi({options:t,typeName:te.ZodUnion,...ae(e)});var Sf=t=>t instanceof Ni?Sf(t.schema):t instanceof Ht?Sf(t.innerType()):t instanceof Di?[t.value]:t instanceof Mr?t.options:t instanceof Mi?Object.keys(t.enum):t instanceof Fi?Sf(t._def.innerType):t instanceof Ti?[void 0]:t instanceof ki?[null]:null,uo=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return G(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Sf(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new uo({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ae(n)})}};function O0(t,e){let r=zn(t),n=zn(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=me.objectKeys(e),s=me.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let c=O0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],c=O0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ii=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(R0(s)||R0(o))return oe;let a=O0(s.value,o.value);return a.valid?((C0(s)||C0(o))&&r.dirty(),{status:r.value,value:a.data}):(G(n,{code:N.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ii.create=(t,e,r)=>new Ii({left:t,right:e,typeName:te.ZodIntersection,...ae(r)});var sr=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return G(n,{code:N.invalid_type,expected:U.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return G(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ir(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Xe.mergeArray(r,o)):Xe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};sr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sr({items:t,typeName:te.ZodTuple,rest:null,...ae(e)})};var Li=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return G(n,{code:N.invalid_type,expected:U.object,received:n.parsedType}),oe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new ir(n,a,n.path,a)),value:o._parse(new ir(n,n.data[a],n.path,a))});return n.common.async?Xe.mergeObjectAsync(r,i):Xe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ce?new Li({keyType:e,valueType:r,typeName:te.ZodRecord,...ae(n)}):new Li({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ae(r)})}},lo=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return G(n,{code:N.invalid_type,expected:U.map,received:n.parsedType}),oe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:i._parse(new ir(n,a,n.path,[l,"key"])),value:s._parse(new ir(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,f=await c.value;if(l.status==="aborted"||f.status==="aborted")return oe;(l.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(l.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,f=c.value;if(l.status==="aborted"||f.status==="aborted")return oe;(l.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(l.value,f.value)}return{status:r.value,value:a}}}};lo.create=(t,e,r)=>new lo({valueType:e,keyType:t,typeName:te.ZodMap,...ae(r)});var dn=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return G(n,{code:N.invalid_type,expected:U.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(G(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(G(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(c){let l=new Set;for(let f of c){if(f.status==="aborted")return oe;f.status==="dirty"&&r.dirty(),l.add(f.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((c,l)=>s._parse(new ir(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new dn({...this._def,minSize:{value:e,message:X.toString(r)}})}max(e,r){return new dn({...this._def,maxSize:{value:e,message:X.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};dn.create=(t,e)=>new dn({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ae(e)});var Yn=class extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return G(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),oe;function n(a,c){return Rf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),ja].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function i(a,c){return Rf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),ja].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Zn){let a=this;return vt(async function(...c){let l=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(y=>{throw l.addIssue(n(c,y)),l}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(y=>{throw l.addIssue(i(h,y)),l})})}else{let a=this;return vt(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new Bt([n(c,l.error)]);let f=Reflect.apply(o,this,l.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new Bt([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Yn({...this._def,args:sr.create(e).rest(fn.create())})}returns(e){return new Yn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Yn({args:e||sr.create([]).rest(fn.create()),returns:r||fn.create(),typeName:te.ZodFunction,...ae(n)})}},Ni=class extends ce{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})}};Ni.create=(t,e)=>new Ni({getter:t,typeName:te.ZodLazy,...ae(e)});var Di=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return G(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:e.data}}get value(){return this._def.value}};Di.create=(t,e)=>new Di({value:t,typeName:te.ZodLiteral,...ae(e)});function dI(t,e){return new Mr({values:t,typeName:te.ZodEnum,...ae(e)})}var Mr=class extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{expected:me.joinValues(n),received:r.parsedType,code:N.invalid_type}),oe}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{received:r.data,code:N.invalid_enum_value,options:n}),oe}return vt(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 Mr.create(e)}exclude(e){return Mr.create(this.options.filter(r=>!e.includes(r)))}};Mr.create=dI;var Mi=class extends ce{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=me.objectValues(r);return G(n,{expected:me.joinValues(i),received:n.parsedType,code:N.invalid_type}),oe}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return G(n,{received:n.data,code:N.invalid_enum_value,options:i}),oe}return vt(e.data)}get enum(){return this._def.values}};Mi.create=(t,e)=>new Mi({values:t,typeName:te.ZodNativeEnum,...ae(e)});var Zn=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return G(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),oe;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return vt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Zn.create=(t,e)=>new Zn({type:t,typeName:te.ZodPromise,...ae(e)});var Ht=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{G(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ha(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ha(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);me.assertNever(i)}};Ht.create=(t,e,r)=>new Ht({schema:t,typeName:te.ZodEffects,effect:e,...ae(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ae(r)});var mr=class extends ce{_parse(e){return this._getType(e)===U.undefined?vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:te.ZodOptional,...ae(e)});var pn=class extends ce{_parse(e){return this._getType(e)===U.null?vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pn.create=(t,e)=>new pn({innerType:t,typeName:te.ZodNullable,...ae(e)});var Fi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Fi.create=(t,e)=>new Fi({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var fo=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};fo.create=(t,e)=>new fo({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var ho=class extends ce{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.nan,received:n.parsedType}),oe}return{status:"valid",value:e.data}}};ho.create=t=>new ho({typeName:te.ZodNaN,...ae(t)});var OW=Symbol("zod_brand"),Of=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},qi=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?oe:s.status==="dirty"?(r.dirty(),hI(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new qi({in:e,out:r,typeName:te.ZodPipeline})}},po=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return Ha(r)&&(r.value=Object.freeze(r.value)),r}};po.create=(t,e)=>new po({innerType:t,typeName:te.ZodReadonly,...ae(e)});var pI=(t,e={},r)=>t?Kn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):Kn.create(),TW={object:Oe.lazycreate},te;(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"})(te||(te={}));var kW=(t,e={message:`Input not instance of ${t.name}`})=>pI(r=>r instanceof t,e),mI=qt.create,gI=Nr.create,PW=ho.create,IW=Dr.create,yI=Oi.create,LW=hn.create,NW=ao.create,DW=Ti.create,MW=ki.create,FW=Kn.create,qW=fn.create,BW=gr.create,jW=co.create,HW=jt.create,$W=Oe.create,UW=Oe.strictCreate,GW=Pi.create,VW=uo.create,WW=Ii.create,zW=sr.create,YW=Li.create,KW=lo.create,ZW=dn.create,JW=Yn.create,XW=Ni.create,QW=Di.create,ez=Mr.create,tz=Mi.create,rz=Zn.create,lI=Ht.create,nz=mr.create,iz=pn.create,sz=Ht.createWithPreprocess,oz=qi.create,az=()=>mI().optional(),cz=()=>gI().optional(),uz=()=>yI().optional(),lz={string:t=>qt.create({...t,coerce:!0}),number:t=>Nr.create({...t,coerce:!0}),boolean:t=>Oi.create({...t,coerce:!0}),bigint:t=>Dr.create({...t,coerce:!0}),date:t=>hn.create({...t,coerce:!0})},fz=oe,mo=Object.freeze({__proto__:null,defaultErrorMap:ja,setErrorMap:mW,getErrorMap:Af,makeIssue:Rf,EMPTY_PATH:gW,addIssueToContext:G,ParseStatus:Xe,INVALID:oe,DIRTY:hI,OK:vt,isAborted:R0,isDirty:C0,isValid:Ha,isAsync:Cf,get util(){return me},get objectUtil(){return A0},ZodParsedType:U,getParsedType:zn,ZodType:ce,ZodString:qt,ZodNumber:Nr,ZodBigInt:Dr,ZodBoolean:Oi,ZodDate:hn,ZodSymbol:ao,ZodUndefined:Ti,ZodNull:ki,ZodAny:Kn,ZodUnknown:fn,ZodNever:gr,ZodVoid:co,ZodArray:jt,ZodObject:Oe,ZodUnion:Pi,ZodDiscriminatedUnion:uo,ZodIntersection:Ii,ZodTuple:sr,ZodRecord:Li,ZodMap:lo,ZodSet:dn,ZodFunction:Yn,ZodLazy:Ni,ZodLiteral:Di,ZodEnum:Mr,ZodNativeEnum:Mi,ZodPromise:Zn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:mr,ZodNullable:pn,ZodDefault:Fi,ZodCatch:fo,ZodNaN:ho,BRAND:OW,ZodBranded:Of,ZodPipeline:qi,ZodReadonly:po,custom:pI,Schema:ce,ZodSchema:ce,late:TW,get ZodFirstPartyTypeKind(){return te},coerce:lz,any:FW,array:HW,bigint:IW,boolean:yI,date:LW,discriminatedUnion:VW,effect:lI,enum:ez,function:JW,instanceof:kW,intersection:WW,lazy:XW,literal:QW,map:KW,nan:PW,nativeEnum:tz,never:BW,null:MW,nullable:iz,number:gI,object:$W,oboolean:uz,onumber:cz,optional:nz,ostring:az,pipeline:oz,preprocess:sz,promise:rz,record:YW,set:ZW,strictObject:UW,string:mI,symbol:NW,transformer:lI,tuple:zW,undefined:DW,union:GW,unknown:qW,void:jW,NEVER:fz,ZodIssueCode:N,quotelessJson:pW,ZodError:Bt});u();var N0=le(require("os")),RI=le(require("crypto")),CI=le(require("path")),OI=le(AI());function Ez(t){let e=process.version,r=N0.default.type(),n=N0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function wz(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,OI.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return CI.default.join(t,"turborepo","telemetry.json")}function xz({input:t,salt:e}){return RI.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var go={buildUserAgent:Ez,oneWayHashWithSalt:xz,defaultConfigPath:wz};var Sz="TURBO_TELEMETRY_DEBUG",Az="TURBO_TELEMETRY_DISABLED",Rz="TURBO_TELEMETRY_MESSAGE_DISABLED",Cz="DO_NOT_TRACK",Oz=mo.object({telemetry_enabled:mo.boolean(),telemetry_id:mo.string(),telemetry_salt:mo.string(),telemetry_alerted:mo.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,yo.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=Tt.validateConfig(n);return new Tt({configPath:e,config:i})}catch{return Tt.tryRemove({configPath:e})?Tt.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await go.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return Oz.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=so(),n=so(),i=go.oneWayHashWithSalt({input:r,salt:n}),s=new Tt({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,yo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,yo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[Cz]||"0",r=process.env[Az]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[Rz]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(Se.log(),Se.bold("Attention:"),Se.grey("Turborepo now collects completely anonymous telemetry regarding usage."),Se.grey("This information is used to shape the Turborepo roadmap and prioritize features."),Se.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:"),Se.underline(TI.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 go.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[Sz]||"0";return e==="1"||e.toLowerCase()==="true"}};u();u();var kI=le(LP());var Tz=20,kz="/api/turborepo/v1/events",Bi=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=Tz;this.timeout=250;this.sessionId=so();this.eventBatches=[];this.events=[];let s=new URL(kz,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(kI.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":go.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:so(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return Tt.isDebug()&&(Se.log(),Se.bold("[telemetry event]"),Se.dimmed(JSON.stringify(s,null,2)),Se.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 $a=class extends Bi{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})}};u();var DI=le(NI());var Iz=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],Ua=class extends Bi{trackCI(){var e;return this.track({key:"ci",value:(e=DI.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:Iz.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 Lz={"create-turbo":$a,"turbo-ignore":Ua},Nz="https://telemetry.vercel.com";async function D0({packageInfo:t,opts:e}){let r=Lz[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:Nz,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}u();var Ga=le(Eu());var MI="status",Dz=["enable","disable",MI];function Mz(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();Se.log(`Status: ${e?Ga.default.bold(Ga.default.green("Enabled")):Ga.default.bold(Ga.default.red("Disabled"))}`),Se.log(),e?Se.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):Se.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),Se.log("Learn more: https://turbo.build/repo/docs/telemetry")}function Fz(t,e){if(!e.telemetry){Se.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),Se.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),Se.bold("Success!")),Se.log(),Mz(e)}function M0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new a_("[action]","Action to perform").choices(Dz).default(MI)).action(Fz)}var kf={name:"turbo-ignore",version:"2.0.5",description:"",homepage:"https://turbo.build/repo",keywords:[],author:"Jared Palmer",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turbo/issues"},files:["dist"],bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src __tests__","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{json5:"^2.2.3"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@types/jest":"^27.4.0","@types/node":"^18.17.2",commander:"^11.0.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^5.12.1",typescript:"5.3.3"}};u();var KI=require("child_process"),ZI=le(require("path")),JI=require("fs");u();var FI=require("child_process");u();var F0="\u226B ";function xe(...t){console.log(F0,...t)}function or(...t){console.error(F0,...t)}function q0(...t){console.warn(F0,...t)}function B0(...t){console.log(...t)}function Bz(t){try{return(0,FI.execSync)(`git cat-file -t ${t}`,{stdio:"ignore"}),!0}catch{return!1}}function j0(t){return t.fallback?(xe(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function qI(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?Bz(process.env.VERCEL_GIT_PREVIOUS_SHA)?(xe(`Found previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),{ref:process.env.VERCEL_GIT_PREVIOUS_SHA,type:"previousDeploy"}):(xe(`Previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""} is unreachable.`),j0(t)):(xe(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),j0(t)):t.fallback?j0(t):{ref:"HEAD^",type:"headRelative"}}u();function BI(t){return t.task?(xe(`Using "${t.task}" as the task from the arguments`),`"${t.task}"`):(xe('Using "build" as the task as it was unspecified'),"build")}u();var jI=le(require("fs")),HI=le(require("path"));function $I(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return xe(`Using "${r}" as workspace from arguments`),r;let n=HI.default.join(e,"package.json");try{let i=jI.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(xe(`Inferred "${s.name}" as workspace from "package.json"`),s.name):(or(`"${n}" is missing the "name" field (required).`),null)}catch{return or(`"${n}" could not be found. turbo-ignore inferencing failed`),null}}u();var H0=le(require("fs")),$0=le(require("path")),UI=require("json5");function GI(t,e){var s,o;let{turboVersion:r}=t;if(r)return xe(`Using turbo version "${r}" from arguments`),r;let n=$0.default.join(e,"package.json");try{let a=H0.default.readFileSync(n,"utf8"),c=JSON.parse(a),l=(s=c.dependencies)==null?void 0:s.turbo,f=(o=c.devDependencies)==null?void 0:o.turbo;if(r=l||f,r!==void 0)return xe(`Inferred turbo version "${r}" from "package.json"`),r}catch{return or(`"${n}" could not be read. turbo-ignore turbo version inference failed`),null}let i=$0.default.join(e,"turbo.json");try{let a=H0.default.readFileSync(i,"utf8"),c=(0,UI.parse)(a);return"tasks"in c?(xe('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(xe('Inferred turbo version ^1 based on "pipeline" in "turbo.json"'),"^1"):null}catch{return or(`"${i}" could not be read. turbo-ignore turbo version inference failed`),null}}u();var U0={MISSING_LOCKFILE:{regex:[/reading (?:yarn.lock|package-lock.json|pnpm-lock.yaml):.*?no such file or directory/i],message:"turbo-ignore could not complete - no lockfile found, please commit one to your repository"},NO_PACKAGE_MANAGER:{regex:[/run failed: We did not detect an in-use package manager for your project/i],message:'turbo-ignore could not complete - no package manager detected, please commit a lockfile, or set "packageManager" in your root "package.json"'},UNREACHABLE_PARENT:{regex:[/failed to resolve packages to run: commit HEAD\^ does not exist/i],message:"turbo-ignore could not complete - parent commit does not exist or is unreachable"},INVALID_COMPARISON:{regex:[/commit \S+ does not exist/i,/unknown revision/i,/invalid symmetric difference expression/i],message:"turbo-ignore could not complete - a ref or SHA is invalid. It could have been removed from the branch history via a force push, or this could be a shallow clone with insufficient history"}};function VI({err:t}){let e=Object.keys(U0).find(r=>{let{regex:n}=U0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:U0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}u();var WI=require("child_process"),jz=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],Hz=["[vercel deploy]","[vercel build]"];function $z({workspace:t}){return[`[vercel skip ${t}]`]}function Uz({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Gz=/\[vercel only .+\]/;function Vz({workspace:t}){return[`[vercel only ${t}]`]}function Wz(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,WI.execSync)("git show -s --format=%B").toString()}function zI({workspace:t}){var c;let e=Wz(),r=l=>e.includes(l),n=(c=Gz.exec(e))==null?void 0:c[0];if(n)return Vz({workspace:t}).find(l=>l===n)?{result:"deploy",scope:"workspace",reason:`Found commit message: ${n}`}:{result:"skip",scope:"workspace",reason:`Found commit message: ${n}`};let i=Uz({workspace:t}).find(r),s=$z({workspace:t}).find(r);if(i&&s)return{result:"conflict",scope:"workspace",reason:`Conflicting commit messages found: ${i} and ${s}`};if(i)return{result:"deploy",scope:"workspace",reason:`Found commit message: ${i}`};if(s)return{result:"skip",scope:"workspace",reason:`Found commit message: ${s}`};let o=Hz.find(r),a=jz.find(r);return o&&a?{result:"conflict",scope:"global",reason:`Conflicting commit messages found: ${o} and ${a}`}:o?{result:"deploy",scope:"global",reason:`Found commit message: ${o}`}:a?{result:"skip",scope:"global",reason:`Found commit message: ${a}`}:{result:"continue",scope:"global",reason:"No deploy or skip string found in commit message."}}function zz(t){var e,r,n,i;(e=t.telemetry)==null||e.trackOptionTask(t.task),(r=t.telemetry)==null||r.trackOptionFallback(t.fallback),(n=t.telemetry)==null||n.trackOptionDirectory(t.directory),(i=t.telemetry)==null||i.trackOptionMaxBuffer(t.maxBuffer)}function YI(){return B0("\u23ED Ignoring the change"),process.exit(0)}function qr(){return B0("\u2713 Proceeding with deployment"),process.exit(1)}function XI(t,e){var d,y;(d=e.telemetry)==null||d.trackCommandStatus({command:"ignore",status:"start"}),(y=e.telemetry)==null||y.trackArgumentWorkspace(t!==void 0),zz(e);let r={workspace:t,...e};if(xe(`Using Turborepo to determine if this project is affected by the commit...
87
+ `:""}var pF=dF,mF={dump:pF};function Uh(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var FK=EE.load,qK=EE.loadAll,BK=mF.dump;var jK=Uh("safeLoad","load"),HK=Uh("safeLoadAll","loadAll"),$K=Uh("safeDump","dump");var u6=le(v1()),l6=le(require("json5"));var Se={};sL(Se,{bold:()=>r6,dimmed:()=>i6,error:()=>qA,grey:()=>s6,info:()=>t6,item:()=>o6,log:()=>Tn,turboBlue:()=>vs,turboGradient:()=>e6,turboLoader:()=>MA,turboRed:()=>NA,underline:()=>n6,warn:()=>FA,yellow:()=>DA});u();var On=le(Yo()),kA=le(nA()),PA=le(TA()),IA="#0099F7",LA="#F11712",QH="#FFFF00",e6=(0,PA.default)(IA,LA),vs=On.default.hex(IA),NA=On.default.hex(LA),DA=On.default.hex(QH),MA=t=>(0,kA.default)({text:t,spinner:{frames:[" ",vs("> "),vs(">> "),vs(">>>")]}}),t6=(...t)=>{Tn(vs.bold(">>>"),...t)},r6=(...t)=>{Tn(On.default.bold(...t))},n6=(...t)=>{Tn(On.default.underline(...t))},i6=(...t)=>{Tn(On.default.dim(...t))},s6=(...t)=>{Tn(On.default.grey(...t))},o6=(...t)=>{Tn(vs.bold(" \u2022"),...t)},Tn=(...t)=>{console.log(...t)},FA=(...t)=>{console.error(DA.bold(">>>"),...t)},qA=(...t)=>{console.error(NA.bold(">>>"),...t)};u();var nU=le(require("os")),iU=le(fC());u();u();var sU=le(require("path"));var oU=le(Yo());u();var NP=require("stream"),DP=require("util"),G7=require("path"),V7=require("os"),MP=require("fs"),W7=le(uk());var Fee=(0,DP.promisify)(NP.Stream.pipeline);u();u();var rV=le(require("path")),nV=le(UP()),iV=le(Yo());u();u();var TI=le(Eu());u();var Lr=le(cI(),1),Lte=Lr.default.v1,Nte=Lr.default.v3,so=Lr.default.v4,Dte=Lr.default.v5,Mte=Lr.default.NIL,Fte=Lr.default.version,qte=Lr.default.validate,Bte=Lr.default.stringify,jte=Lr.default.parse;u();var me;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},t.getValidEnumValues=i=>{let s=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of s)o[a]=i[a];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},t.find=(i,s)=>{for(let o of i)if(s(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(me||(me={}));var A0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(A0||(A0={}));var U=me.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=t=>{switch(typeof t){case"undefined":return U.undefined;case"string":return U.string;case"number":return isNaN(t)?U.nan:U.number;case"boolean":return U.boolean;case"function":return U.function;case"bigint":return U.bigint;case"symbol":return U.symbol;case"object":return Array.isArray(t)?U.array:t===null?U.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?U.promise:typeof Map<"u"&&t instanceof Map?U.map:typeof Set<"u"&&t instanceof Set?U.set:typeof Date<"u"&&t instanceof Date?U.date:U.object;default:return U.unknown}},N=me.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"]),pW=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bt=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_errors:[]},i=s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,me.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Bt.create=t=>new Bt(t);var ja=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===U.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,me.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${me.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${me.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${me.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.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}"`:me.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.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 N.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 N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,me.assertNever(t)}return{message:r}},fI=ja;function mW(t){fI=t}function Af(){return fI}var Rf=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,s=[...r,...i.path||[]],o={...i,path:s},a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:s,message:i.message||a}},gW=[];function G(t,e){let r=Rf({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Af(),ja].filter(n=>!!n)});t.common.issues.push(r)}var Xe=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return oe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r)n.push({key:await i.key,value:await i.value});return Xe.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return oe;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:e.value,value:n}}},oe=Object.freeze({status:"aborted"}),hI=t=>({status:"dirty",value:t}),vt=t=>({status:"valid",value:t}),R0=t=>t.status==="aborted",C0=t=>t.status==="dirty",Ha=t=>t.status==="valid",Cf=t=>typeof Promise<"u"&&t instanceof Promise,X;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(X||(X={}));var ir=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},uI=(t,e)=>{if(Ha(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bt(t.common.issues);return this._error=r,this._error}}};function ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n!=null?n:a.defaultError}:{message:r!=null?r:a.defaultError},description:i}}var ce=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 zn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xe,ctx:{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Cf(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},s=this._parseSync({data:e,path:i.path,parent:i});return uI(i,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},i=this._parse({data:e,path:n.path,parent:n}),s=await(Cf(i)?i:Promise.resolve(i));return uI(n,s)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,s)=>{let o=e(i),a=()=>s.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Ht({schema:this,typeName:te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return mr.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return jt.create(this,this._def)}promise(){return Zn.create(this,this._def)}or(e){return Pi.create([this,e],this._def)}and(e){return Ii.create(this,e,this._def)}transform(e){return new Ht({...ae(this._def),schema:this,typeName:te.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Fi({...ae(this._def),innerType:this,defaultValue:r,typeName:te.ZodDefault})}brand(){return new Of({typeName:te.ZodBranded,type:this,...ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new fo({...ae(this._def),innerType:this,catchValue:r,typeName:te.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return qi.create(this,e)}readonly(){return po.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yW=/^c[^\s-]{8,}$/i,_W=/^[a-z][a-z0-9]*$/,vW=/^[0-9A-HJKMNP-TV-Z]{26}$/,bW=/^[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,EW=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",S0,xW=/^(((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}))$/,SW=/^(([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})))$/,AW=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 RW(t,e){return!!((e==="v4"||!e)&&xW.test(t)||(e==="v6"||!e)&&SW.test(t))}var qt=class extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==U.string){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.string,received:s.parsedType}),oe}let n=new Xe,i;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,a=e.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?G(i,{code:N.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&G(i,{code:N.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")EW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"email",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")S0||(S0=new RegExp(wW,"u")),S0.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"emoji",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")bW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"uuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")yW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")_W.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"cuid2",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")vW.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ulid",code:N.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),G(i,{validation:"url",code:N.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"regex",code:N.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?AW(s).test(e.data)||(i=this._getOrReturnCtx(e,i),G(i,{code:N.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?RW(e.data,s.version)||(i=this._getOrReturnCtx(e,i),G(i,{validation:"ip",code:N.invalid_string,message:s.message}),n.dirty()):me.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...X.errToObj(n)})}_addCheck(e){return new qt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...X.errToObj(e)})}url(e){return this._addCheck({kind:"url",...X.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...X.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...X.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...X.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...X.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...X.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)>"u"?null:e==null?void 0:e.precision,offset:(r=e==null?void 0:e.offset)!==null&&r!==void 0?r:!1,...X.errToObj(e==null?void 0:e.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...X.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...X.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...X.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...X.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...X.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...X.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...X.errToObj(r)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new qt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new qt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new qt({...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}};qt.create=t=>{var e;return new qt({checks:[],typeName:te.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};function CW(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,s=parseInt(t.toFixed(i).replace(".","")),o=parseInt(e.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}var Nr=class extends ce{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)!==U.number){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.number,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="int"?me.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?CW(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_finite,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Nr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:X.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:X.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:X.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:X.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"&&me.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Nr.create=t=>new Nr({checks:[],typeName:te.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var Dr=class extends ce{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)!==U.bigint){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.bigint,received:s.parsedType}),oe}let n,i=new Xe;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),G(n,{code:N.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):me.assertNever(s);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,X.toString(r))}gt(e,r){return this.setLimit("min",e,!1,X.toString(r))}lte(e,r){return this.setLimit("max",e,!0,X.toString(r))}lt(e,r){return this.setLimit("max",e,!1,X.toString(r))}setLimit(e,r,n,i){return new Dr({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:X.toString(i)}]})}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:X.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}};Dr.create=t=>{var e;return new Dr({checks:[],typeName:te.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...ae(t)})};var Oi=class extends ce{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==U.boolean){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.boolean,received:n.parsedType}),oe}return vt(e.data)}};Oi.create=t=>new Oi({typeName:te.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...ae(t)});var hn=class extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==U.date){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_type,expected:U.date,received:s.parsedType}),oe}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return G(s,{code:N.invalid_date}),oe}let n=new Xe,i;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),G(i,{code:N.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):me.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new hn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:X.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:X.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}};hn.create=t=>new hn({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:te.ZodDate,...ae(t)});var ao=class extends ce{_parse(e){if(this._getType(e)!==U.symbol){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.symbol,received:n.parsedType}),oe}return vt(e.data)}};ao.create=t=>new ao({typeName:te.ZodSymbol,...ae(t)});var Ti=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.undefined,received:n.parsedType}),oe}return vt(e.data)}};Ti.create=t=>new Ti({typeName:te.ZodUndefined,...ae(t)});var ki=class extends ce{_parse(e){if(this._getType(e)!==U.null){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.null,received:n.parsedType}),oe}return vt(e.data)}};ki.create=t=>new ki({typeName:te.ZodNull,...ae(t)});var Kn=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return vt(e.data)}};Kn.create=t=>new Kn({typeName:te.ZodAny,...ae(t)});var fn=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return vt(e.data)}};fn.create=t=>new fn({typeName:te.ZodUnknown,...ae(t)});var gr=class extends ce{_parse(e){let r=this._getOrReturnCtx(e);return G(r,{code:N.invalid_type,expected:U.never,received:r.parsedType}),oe}};gr.create=t=>new gr({typeName:te.ZodNever,...ae(t)});var co=class extends ce{_parse(e){if(this._getType(e)!==U.undefined){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.void,received:n.parsedType}),oe}return vt(e.data)}};co.create=t=>new co({typeName:te.ZodVoid,...ae(t)});var jt=class extends ce{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==U.array)return G(r,{code:N.invalid_type,expected:U.array,received:r.parsedType}),oe;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(o||a)&&(G(r,{code:o?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(G(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(G(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>i.type._parseAsync(new ir(r,o,r.path,a)))).then(o=>Xe.mergeArray(n,o));let s=[...r.data].map((o,a)=>i.type._parseSync(new ir(r,o,r.path,a)));return Xe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new jt({...this._def,minLength:{value:e,message:X.toString(r)}})}max(e,r){return new jt({...this._def,maxLength:{value:e,message:X.toString(r)}})}length(e,r){return new jt({...this._def,exactLength:{value:e,message:X.toString(r)}})}nonempty(e){return this.min(1,e)}};jt.create=(t,e)=>new jt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:te.ZodArray,...ae(e)});function oo(t){if(t instanceof Oe){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=mr.create(oo(n))}return new Oe({...t._def,shape:()=>e})}else return t instanceof jt?new jt({...t._def,type:oo(t.element)}):t instanceof mr?mr.create(oo(t.unwrap())):t instanceof pn?pn.create(oo(t.unwrap())):t instanceof sr?sr.create(t.items.map(e=>oo(e))):t}var Oe=class extends ce{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=me.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==U.object){let l=this._getOrReturnCtx(e);return G(l,{code:N.invalid_type,expected:U.object,received:l.parsedType}),oe}let{status:n,ctx:i}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof gr&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let f=s[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:f._parse(new ir(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof gr){let l=this._def.unknownKeys;if(l==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(l==="strict")a.length>0&&(G(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let f of a){let h=i.data[f];c.push({key:{status:"valid",value:f},value:l._parse(new ir(i,h,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let f of c){let h=await f.key;l.push({key:h,value:await f.value,alwaysSet:f.alwaysSet})}return l}).then(l=>Xe.mergeObjectSync(n,l)):Xe.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return X.errToObj,new Oe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,s,o,a;let c=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=X.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}strip(){return new Oe({...this._def,unknownKeys:"strip"})}passthrough(){return new Oe({...this._def,unknownKeys:"passthrough"})}extend(e){return new Oe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Oe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:te.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Oe({...this._def,catchall:e})}pick(e){let r={};return me.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}omit(e){let r={};return me.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new Oe({...this._def,shape:()=>r})}deepPartial(){return oo(this)}partial(e){let r={};return me.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new Oe({...this._def,shape:()=>r})}required(e){let r={};return me.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof mr;)s=s._def.innerType;r[n]=s}}),new Oe({...this._def,shape:()=>r})}keyof(){return dI(me.objectKeys(this.shape))}};Oe.create=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strip",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});Oe.strictCreate=(t,e)=>new Oe({shape:()=>t,unknownKeys:"strict",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});Oe.lazycreate=(t,e)=>new Oe({shape:t,unknownKeys:"strip",catchall:gr.create(),typeName:te.ZodObject,...ae(e)});var Pi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let o=s.map(a=>new Bt(a.ctx.common.issues));return G(r,{code:N.invalid_union,unionErrors:o}),oe}if(r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},f=c._parseSync({data:r.data,path:r.path,parent:l});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=o.map(c=>new Bt(c));return G(r,{code:N.invalid_union,unionErrors:a}),oe}}get options(){return this._def.options}};Pi.create=(t,e)=>new Pi({options:t,typeName:te.ZodUnion,...ae(e)});var Sf=t=>t instanceof Ni?Sf(t.schema):t instanceof Ht?Sf(t.innerType()):t instanceof Di?[t.value]:t instanceof Mr?t.options:t instanceof Mi?Object.keys(t.enum):t instanceof Fi?Sf(t._def.innerType):t instanceof Ti?[void 0]:t instanceof ki?[null]:null,uo=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.object)return G(r,{code:N.invalid_type,expected:U.object,received:r.parsedType}),oe;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(G(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),oe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let s of r){let o=Sf(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,s)}}return new uo({typeName:te.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ae(n)})}};function O0(t,e){let r=zn(t),n=zn(e);if(t===e)return{valid:!0,data:t};if(r===U.object&&n===U.object){let i=me.objectKeys(e),s=me.objectKeys(t).filter(a=>i.indexOf(a)!==-1),o={...t,...e};for(let a of s){let c=O0(t[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(r===U.array&&n===U.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let s=0;s<t.length;s++){let o=t[s],a=e[s],c=O0(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===U.date&&n===U.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ii=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(s,o)=>{if(R0(s)||R0(o))return oe;let a=O0(s.value,o.value);return a.valid?((C0(s)||C0(o))&&r.dirty(),{status:r.value,value:a.data}):(G(n,{code:N.invalid_intersection_types}),oe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ii.create=(t,e,r)=>new Ii({left:t,right:e,typeName:te.ZodIntersection,...ae(r)});var sr=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.array)return G(n,{code:N.invalid_type,expected:U.array,received:n.parsedType}),oe;if(n.data.length<this._def.items.length)return G(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),oe;!this._def.rest&&n.data.length>this._def.items.length&&(G(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ir(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(s).then(o=>Xe.mergeArray(r,o)):Xe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new sr({...this._def,rest:e})}};sr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new sr({items:t,typeName:te.ZodTuple,rest:null,...ae(e)})};var Li=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.object)return G(n,{code:N.invalid_type,expected:U.object,received:n.parsedType}),oe;let i=[],s=this._def.keyType,o=this._def.valueType;for(let a in n.data)i.push({key:s._parse(new ir(n,a,n.path,a)),value:o._parse(new ir(n,n.data[a],n.path,a))});return n.common.async?Xe.mergeObjectAsync(r,i):Xe.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ce?new Li({keyType:e,valueType:r,typeName:te.ZodRecord,...ae(n)}):new Li({keyType:qt.create(),valueType:e,typeName:te.ZodRecord,...ae(r)})}},lo=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.map)return G(n,{code:N.invalid_type,expected:U.map,received:n.parsedType}),oe;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([a,c],l)=>({key:i._parse(new ir(n,a,n.path,[l,"key"])),value:s._parse(new ir(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,f=await c.value;if(l.status==="aborted"||f.status==="aborted")return oe;(l.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(l.value,f.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,f=c.value;if(l.status==="aborted"||f.status==="aborted")return oe;(l.status==="dirty"||f.status==="dirty")&&r.dirty(),a.set(l.value,f.value)}return{status:r.value,value:a}}}};lo.create=(t,e,r)=>new lo({valueType:e,keyType:t,typeName:te.ZodMap,...ae(r)});var dn=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==U.set)return G(n,{code:N.invalid_type,expected:U.set,received:n.parsedType}),oe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(G(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(G(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(c){let l=new Set;for(let f of c){if(f.status==="aborted")return oe;f.status==="dirty"&&r.dirty(),l.add(f.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((c,l)=>s._parse(new ir(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,r){return new dn({...this._def,minSize:{value:e,message:X.toString(r)}})}max(e,r){return new dn({...this._def,maxSize:{value:e,message:X.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};dn.create=(t,e)=>new dn({valueType:t,minSize:null,maxSize:null,typeName:te.ZodSet,...ae(e)});var Yn=class extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.function)return G(r,{code:N.invalid_type,expected:U.function,received:r.parsedType}),oe;function n(a,c){return Rf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),ja].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:c}})}function i(a,c){return Rf({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Af(),ja].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Zn){let a=this;return vt(async function(...c){let l=new Bt([]),f=await a._def.args.parseAsync(c,s).catch(y=>{throw l.addIssue(n(c,y)),l}),h=await Reflect.apply(o,this,f);return await a._def.returns._def.type.parseAsync(h,s).catch(y=>{throw l.addIssue(i(h,y)),l})})}else{let a=this;return vt(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new Bt([n(c,l.error)]);let f=Reflect.apply(o,this,l.data),h=a._def.returns.safeParse(f,s);if(!h.success)throw new Bt([i(f,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Yn({...this._def,args:sr.create(e).rest(fn.create())})}returns(e){return new Yn({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new Yn({args:e||sr.create([]).rest(fn.create()),returns:r||fn.create(),typeName:te.ZodFunction,...ae(n)})}},Ni=class extends ce{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})}};Ni.create=(t,e)=>new Ni({getter:t,typeName:te.ZodLazy,...ae(e)});var Di=class extends ce{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return G(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),oe}return{status:"valid",value:e.data}}get value(){return this._def.value}};Di.create=(t,e)=>new Di({value:t,typeName:te.ZodLiteral,...ae(e)});function dI(t,e){return new Mr({values:t,typeName:te.ZodEnum,...ae(e)})}var Mr=class extends ce{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{expected:me.joinValues(n),received:r.parsedType,code:N.invalid_type}),oe}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return G(r,{received:r.data,code:N.invalid_enum_value,options:n}),oe}return vt(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 Mr.create(e)}exclude(e){return Mr.create(this.options.filter(r=>!e.includes(r)))}};Mr.create=dI;var Mi=class extends ce{_parse(e){let r=me.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==U.string&&n.parsedType!==U.number){let i=me.objectValues(r);return G(n,{expected:me.joinValues(i),received:n.parsedType,code:N.invalid_type}),oe}if(r.indexOf(e.data)===-1){let i=me.objectValues(r);return G(n,{received:n.data,code:N.invalid_enum_value,options:i}),oe}return vt(e.data)}get enum(){return this._def.values}};Mi.create=(t,e)=>new Mi({values:t,typeName:te.ZodNativeEnum,...ae(e)});var Zn=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==U.promise&&r.common.async===!1)return G(r,{code:N.invalid_type,expected:U.promise,received:r.parsedType}),oe;let n=r.parsedType===U.promise?r.data:Promise.resolve(r.data);return vt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Zn.create=(t,e)=>new Zn({type:t,typeName:te.ZodPromise,...ae(e)});var Ht=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:o=>{G(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:o,path:n.path,parent:n})}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?oe:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ha(o))return o;let a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Ha(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:r.value,value:a})):o);me.assertNever(i)}};Ht.create=(t,e,r)=>new Ht({schema:t,typeName:te.ZodEffects,effect:e,...ae(r)});Ht.createWithPreprocess=(t,e,r)=>new Ht({schema:e,effect:{type:"preprocess",transform:t},typeName:te.ZodEffects,...ae(r)});var mr=class extends ce{_parse(e){return this._getType(e)===U.undefined?vt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mr.create=(t,e)=>new mr({innerType:t,typeName:te.ZodOptional,...ae(e)});var pn=class extends ce{_parse(e){return this._getType(e)===U.null?vt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pn.create=(t,e)=>new pn({innerType:t,typeName:te.ZodNullable,...ae(e)});var Fi=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===U.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Fi.create=(t,e)=>new Fi({innerType:t,typeName:te.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ae(e)});var fo=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Cf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};fo.create=(t,e)=>new fo({innerType:t,typeName:te.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ae(e)});var ho=class extends ce{_parse(e){if(this._getType(e)!==U.nan){let n=this._getOrReturnCtx(e);return G(n,{code:N.invalid_type,expected:U.nan,received:n.parsedType}),oe}return{status:"valid",value:e.data}}};ho.create=t=>new ho({typeName:te.ZodNaN,...ae(t)});var OW=Symbol("zod_brand"),Of=class extends ce{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},qi=class extends ce{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?oe:s.status==="dirty"?(r.dirty(),hI(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?oe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new qi({in:e,out:r,typeName:te.ZodPipeline})}},po=class extends ce{_parse(e){let r=this._def.innerType._parse(e);return Ha(r)&&(r.value=Object.freeze(r.value)),r}};po.create=(t,e)=>new po({innerType:t,typeName:te.ZodReadonly,...ae(e)});var pI=(t,e={},r)=>t?Kn.create().superRefine((n,i)=>{var s,o;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(o=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&o!==void 0?o:!0,l=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...l,fatal:c})}}):Kn.create(),TW={object:Oe.lazycreate},te;(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"})(te||(te={}));var kW=(t,e={message:`Input not instance of ${t.name}`})=>pI(r=>r instanceof t,e),mI=qt.create,gI=Nr.create,PW=ho.create,IW=Dr.create,yI=Oi.create,LW=hn.create,NW=ao.create,DW=Ti.create,MW=ki.create,FW=Kn.create,qW=fn.create,BW=gr.create,jW=co.create,HW=jt.create,$W=Oe.create,UW=Oe.strictCreate,GW=Pi.create,VW=uo.create,WW=Ii.create,zW=sr.create,YW=Li.create,KW=lo.create,ZW=dn.create,JW=Yn.create,XW=Ni.create,QW=Di.create,ez=Mr.create,tz=Mi.create,rz=Zn.create,lI=Ht.create,nz=mr.create,iz=pn.create,sz=Ht.createWithPreprocess,oz=qi.create,az=()=>mI().optional(),cz=()=>gI().optional(),uz=()=>yI().optional(),lz={string:t=>qt.create({...t,coerce:!0}),number:t=>Nr.create({...t,coerce:!0}),boolean:t=>Oi.create({...t,coerce:!0}),bigint:t=>Dr.create({...t,coerce:!0}),date:t=>hn.create({...t,coerce:!0})},fz=oe,mo=Object.freeze({__proto__:null,defaultErrorMap:ja,setErrorMap:mW,getErrorMap:Af,makeIssue:Rf,EMPTY_PATH:gW,addIssueToContext:G,ParseStatus:Xe,INVALID:oe,DIRTY:hI,OK:vt,isAborted:R0,isDirty:C0,isValid:Ha,isAsync:Cf,get util(){return me},get objectUtil(){return A0},ZodParsedType:U,getParsedType:zn,ZodType:ce,ZodString:qt,ZodNumber:Nr,ZodBigInt:Dr,ZodBoolean:Oi,ZodDate:hn,ZodSymbol:ao,ZodUndefined:Ti,ZodNull:ki,ZodAny:Kn,ZodUnknown:fn,ZodNever:gr,ZodVoid:co,ZodArray:jt,ZodObject:Oe,ZodUnion:Pi,ZodDiscriminatedUnion:uo,ZodIntersection:Ii,ZodTuple:sr,ZodRecord:Li,ZodMap:lo,ZodSet:dn,ZodFunction:Yn,ZodLazy:Ni,ZodLiteral:Di,ZodEnum:Mr,ZodNativeEnum:Mi,ZodPromise:Zn,ZodEffects:Ht,ZodTransformer:Ht,ZodOptional:mr,ZodNullable:pn,ZodDefault:Fi,ZodCatch:fo,ZodNaN:ho,BRAND:OW,ZodBranded:Of,ZodPipeline:qi,ZodReadonly:po,custom:pI,Schema:ce,ZodSchema:ce,late:TW,get ZodFirstPartyTypeKind(){return te},coerce:lz,any:FW,array:HW,bigint:IW,boolean:yI,date:LW,discriminatedUnion:VW,effect:lI,enum:ez,function:JW,instanceof:kW,intersection:WW,lazy:XW,literal:QW,map:KW,nan:PW,nativeEnum:tz,never:BW,null:MW,nullable:iz,number:gI,object:$W,oboolean:uz,onumber:cz,optional:nz,ostring:az,pipeline:oz,preprocess:sz,promise:rz,record:YW,set:ZW,strictObject:UW,string:mI,symbol:NW,transformer:lI,tuple:zW,undefined:DW,union:GW,unknown:qW,void:jW,NEVER:fz,ZodIssueCode:N,quotelessJson:pW,ZodError:Bt});u();var N0=le(require("os")),RI=le(require("crypto")),CI=le(require("path")),OI=le(AI());function Ez(t){let e=process.version,r=N0.default.type(),n=N0.default.arch();return`${t.name} ${t.version} ${e} ${r} ${n}`}async function wz(){let t=process.env.TURBO_CONFIG_DIR_PATH?process.env.TURBO_CONFIG_DIR_PATH:await(0,OI.configDir)();if(!t)throw new Error("Could not find telemetry config directory");return CI.default.join(t,"turborepo","telemetry.json")}function xz({input:t,salt:e}){return RI.default.createHash("sha256").update(`${e}${t}`).digest("hex")}var go={buildUserAgent:Ez,oneWayHashWithSalt:xz,defaultConfigPath:wz};var Sz="TURBO_TELEMETRY_DEBUG",Az="TURBO_TELEMETRY_DISABLED",Rz="TURBO_TELEMETRY_MESSAGE_DISABLED",Cz="DO_NOT_TRACK",Oz=mo.object({telemetry_enabled:mo.boolean(),telemetry_id:mo.string(),telemetry_salt:mo.string(),telemetry_alerted:mo.string().optional()}),Tt=class{constructor({configPath:e,config:r}){this.config=r,this.configPath=e}static fromConfigPath(e){try{let r=(0,yo.readFileSync)(e,"utf-8"),n=JSON.parse(r),i=Tt.validateConfig(n);return new Tt({configPath:e,config:i})}catch{return Tt.tryRemove({configPath:e})?Tt.create({configPath:e}):void 0}}static async fromDefaultConfig(){try{let e=await go.defaultConfigPath();return Tt.fromConfigPath(e)}catch{return}}static validateConfig(e){try{return Oz.parse(e)}catch{throw new Error("Config is invalid.")}}static create({configPath:e}){let r=so(),n=so(),i=go.oneWayHashWithSalt({input:r,salt:n}),s=new Tt({configPath:e,config:{telemetry_enabled:!0,telemetry_id:i,telemetry_salt:n}});if(s.tryWrite())return s}tryWrite(){try{let e=JSON.stringify(this.config,null,2);return(0,yo.writeFileSync)(this.configPath,e),!0}catch{return!1}}static tryRemove({configPath:e}){try{return(0,yo.rmSync)(e,{force:!0}),!0}catch{return!1}}hasSeenAlert(){return this.config.telemetry_alerted!==void 0}isEnabled(){let e=process.env[Cz]||"0",r=process.env[Az]||"0";return e==="1"||e.toLowerCase()==="true"||r==="1"||r.toLowerCase()==="true"?!1:this.config.telemetry_enabled}isTelemetryWarningEnabled(){let e=process.env[Rz]||"0";return!(e==="1"||e.toLowerCase()==="true")}get id(){return this.config.telemetry_id}showAlert(){!this.hasSeenAlert()&&this.isEnabled()&&this.isTelemetryWarningEnabled()&&(Se.log(),Se.bold("Attention:"),Se.grey("Turborepo now collects completely anonymous telemetry regarding usage."),Se.grey("This information is used to shape the Turborepo roadmap and prioritize features."),Se.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:"),Se.underline(TI.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 go.oneWayHashWithSalt({input:e,salt:this.config.telemetry_salt})}static isDebug(){let e=process.env[Sz]||"0";return e==="1"||e.toLowerCase()==="true"}};u();u();var kI=le(LP());var Tz=20,kz="/api/turborepo/v1/events",Bi=class{constructor({api:e,packageInfo:r,config:n,opts:i}){this.batchSize=Tz;this.timeout=250;this.sessionId=so();this.eventBatches=[];this.events=[];let s=new URL(kz,e);this.api=s.toString(),this.packageInfo=r,this.config=n,i!=null&&i.timeout&&(this.timeout=i.timeout),i!=null&&i.batchSize&&(this.batchSize=i.batchSize)}hasPendingEvents(){return this.events.length!==0}async waitForFlush(){await Promise.all(this.eventBatches)}flushEvents(){let e=this.events.splice(0,this.batchSize);this.config.isEnabled()&&this.eventBatches.push(kI.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":go.buildUserAgent(this.packageInfo)}}))}track({key:e,value:r,parentId:n,isSensitive:i}){let s={id:so(),key:e,value:i?this.config.oneWayHash(r):r,package_name:this.packageInfo.name,package_version:this.packageInfo.version,parent_id:n};return Tt.isDebug()&&(Se.log(),Se.bold("[telemetry event]"),Se.dimmed(JSON.stringify(s,null,2)),Se.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 $a=class extends Bi{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})}};u();var DI=le(NI());var Iz=["build","test","lint","typecheck","checktypes","check-types","type-check","check"],Ua=class extends Bi{trackCI(){var e;return this.track({key:"ci",value:(e=DI.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:Iz.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 Lz={"create-turbo":$a,"turbo-ignore":Ua},Nz="https://telemetry.vercel.com";async function D0({packageInfo:t,opts:e}){let r=Lz[t.name],n=await Tt.fromDefaultConfig();return n?(n.showAlert(),{telemetry:new r({api:Nz,packageInfo:t,config:n,opts:e})}):{telemetry:void 0}}u();var Ga=le(Eu());var MI="status",Dz=["enable","disable",MI];function Mz(t){var r;let e=(r=t.telemetry)==null?void 0:r.config.isEnabled();Se.log(`Status: ${e?Ga.default.bold(Ga.default.green("Enabled")):Ga.default.bold(Ga.default.red("Disabled"))}`),Se.log(),e?Se.log("Turborepo telemetry is completely anonymous. Thank you for participating!"):Se.log("You have opted-out of Turborepo anonymous telemetry. No data will be collected from your machine."),Se.log("Learn more: https://turbo.build/repo/docs/telemetry")}function Fz(t,e){if(!e.telemetry){Se.error("Telemetry could not be initialized");return}t==="enable"?(e.telemetry.config.enable(),Se.bold("Success!")):t==="disable"&&(e.telemetry.config.disable(),Se.bold("Success!")),Se.log(),Mz(e)}function M0(t){t.command("telemetry").description("Manage telemetry settings").addArgument(new a_("[action]","Action to perform").choices(Dz).default(MI)).action(Fz)}var kf={name:"turbo-ignore",version:"2.0.6",description:"",homepage:"https://turbo.build/repo",keywords:[],author:"Jared Palmer",license:"MIT",repository:{type:"git",url:"https://github.com/vercel/turbo",directory:"packages/turbo-ignore"},bugs:{url:"https://github.com/vercel/turbo/issues"},files:["dist"],bin:"dist/cli.js",scripts:{build:"tsup",test:"jest",lint:"eslint src __tests__","check-types":"tsc --noEmit","lint:prettier":"prettier -c . --cache --ignore-path=../../.prettierignore"},dependencies:{json5:"^2.2.3"},devDependencies:{"@turbo/eslint-config":"workspace:*","@turbo/telemetry":"workspace:*","@turbo/test-utils":"workspace:*","@turbo/tsconfig":"workspace:*","@turbo/types":"workspace:*","@turbo/utils":"workspace:*","@types/jest":"^27.4.0","@types/node":"^18.17.2",commander:"^11.0.0",jest:"^27.4.3","ts-jest":"^27.1.1",tsup:"^5.12.1",typescript:"5.3.3"}};u();var KI=require("child_process"),ZI=le(require("path")),JI=require("fs");u();var FI=require("child_process");u();var F0="\u226B ";function xe(...t){console.log(F0,...t)}function or(...t){console.error(F0,...t)}function q0(...t){console.warn(F0,...t)}function B0(...t){console.log(...t)}function Bz(t){try{return(0,FI.execSync)(`git cat-file -t ${t}`,{stdio:"ignore"}),!0}catch{return!1}}function j0(t){return t.fallback?(xe(`Falling back to ref ${t.fallback}`),{ref:t.fallback,type:"customFallback"}):null}function qI(t){let{workspace:e}=t;return process.env.VERCEL==="1"?process.env.VERCEL_GIT_PREVIOUS_SHA?Bz(process.env.VERCEL_GIT_PREVIOUS_SHA)?(xe(`Found previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),{ref:process.env.VERCEL_GIT_PREVIOUS_SHA,type:"previousDeploy"}):(xe(`Previous deployment ("${process.env.VERCEL_GIT_PREVIOUS_SHA}") for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""} is unreachable.`),j0(t)):(xe(`No previous deployments found for "${e}"${process.env.VERCEL_GIT_COMMIT_REF?` on branch "${process.env.VERCEL_GIT_COMMIT_REF}"`:""}`),j0(t)):t.fallback?j0(t):{ref:"HEAD^",type:"headRelative"}}u();function BI(t){return t.task?(xe(`Using "${t.task}" as the task from the arguments`),`"${t.task}"`):(xe('Using "build" as the task as it was unspecified'),"build")}u();var jI=le(require("fs")),HI=le(require("path"));function $I(t){let{directory:e=process.cwd(),workspace:r}=t;if(r)return xe(`Using "${r}" as workspace from arguments`),r;let n=HI.default.join(e,"package.json");try{let i=jI.default.readFileSync(n,"utf8"),s=JSON.parse(i);return s.name?(xe(`Inferred "${s.name}" as workspace from "package.json"`),s.name):(or(`"${n}" is missing the "name" field (required).`),null)}catch{return or(`"${n}" could not be found. turbo-ignore inferencing failed`),null}}u();var H0=le(require("fs")),$0=le(require("path")),UI=require("json5");function GI(t,e){var s,o;let{turboVersion:r}=t;if(r)return xe(`Using turbo version "${r}" from arguments`),r;let n=$0.default.join(e,"package.json");try{let a=H0.default.readFileSync(n,"utf8"),c=JSON.parse(a),l=(s=c.dependencies)==null?void 0:s.turbo,f=(o=c.devDependencies)==null?void 0:o.turbo;if(r=l||f,r!==void 0)return xe(`Inferred turbo version "${r}" from "package.json"`),r}catch{return or(`"${n}" could not be read. turbo-ignore turbo version inference failed`),null}let i=$0.default.join(e,"turbo.json");try{let a=H0.default.readFileSync(i,"utf8"),c=(0,UI.parse)(a);return"tasks"in c?(xe('Inferred turbo version ^2 based on "tasks" in "turbo.json"'),"^2"):"pipeline"in c?(xe('Inferred turbo version ^1 based on "pipeline" in "turbo.json"'),"^1"):null}catch{return or(`"${i}" could not be read. turbo-ignore turbo version inference failed`),null}}u();var U0={MISSING_LOCKFILE:{regex:[/reading (?:yarn.lock|package-lock.json|pnpm-lock.yaml):.*?no such file or directory/i],message:"turbo-ignore could not complete - no lockfile found, please commit one to your repository"},NO_PACKAGE_MANAGER:{regex:[/run failed: We did not detect an in-use package manager for your project/i],message:'turbo-ignore could not complete - no package manager detected, please commit a lockfile, or set "packageManager" in your root "package.json"'},UNREACHABLE_PARENT:{regex:[/failed to resolve packages to run: commit HEAD\^ does not exist/i],message:"turbo-ignore could not complete - parent commit does not exist or is unreachable"},INVALID_COMPARISON:{regex:[/commit \S+ does not exist/i,/unknown revision/i,/invalid symmetric difference expression/i],message:"turbo-ignore could not complete - a ref or SHA is invalid. It could have been removed from the branch history via a force push, or this could be a shallow clone with insufficient history"}};function VI({err:t}){let e=Object.keys(U0).find(r=>{let{regex:n}=U0[r];return n.some(i=>i.test(t))});return e?{level:"warn",message:U0[e].message,code:e}:{level:"error",message:t,code:"UNKNOWN_ERROR"}}u();var WI=require("child_process"),jz=["[skip ci]","[ci skip]","[no ci]","[skip vercel]","[vercel skip]"],Hz=["[vercel deploy]","[vercel build]"];function $z({workspace:t}){return[`[vercel skip ${t}]`]}function Uz({workspace:t}){return[`[vercel deploy ${t}]`,`[vercel build ${t}]`]}var Gz=/\[vercel only .+\]/;function Vz({workspace:t}){return[`[vercel only ${t}]`]}function Wz(){return process.env.VERCEL==="1"&&process.env.VERCEL_GIT_COMMIT_MESSAGE?process.env.VERCEL_GIT_COMMIT_MESSAGE:(0,WI.execSync)("git show -s --format=%B").toString()}function zI({workspace:t}){var c;let e=Wz(),r=l=>e.includes(l),n=(c=Gz.exec(e))==null?void 0:c[0];if(n)return Vz({workspace:t}).find(l=>l===n)?{result:"deploy",scope:"workspace",reason:`Found commit message: ${n}`}:{result:"skip",scope:"workspace",reason:`Found commit message: ${n}`};let i=Uz({workspace:t}).find(r),s=$z({workspace:t}).find(r);if(i&&s)return{result:"conflict",scope:"workspace",reason:`Conflicting commit messages found: ${i} and ${s}`};if(i)return{result:"deploy",scope:"workspace",reason:`Found commit message: ${i}`};if(s)return{result:"skip",scope:"workspace",reason:`Found commit message: ${s}`};let o=Hz.find(r),a=jz.find(r);return o&&a?{result:"conflict",scope:"global",reason:`Conflicting commit messages found: ${o} and ${a}`}:o?{result:"deploy",scope:"global",reason:`Found commit message: ${o}`}:a?{result:"skip",scope:"global",reason:`Found commit message: ${a}`}:{result:"continue",scope:"global",reason:"No deploy or skip string found in commit message."}}function zz(t){var e,r,n,i;(e=t.telemetry)==null||e.trackOptionTask(t.task),(r=t.telemetry)==null||r.trackOptionFallback(t.fallback),(n=t.telemetry)==null||n.trackOptionDirectory(t.directory),(i=t.telemetry)==null||i.trackOptionMaxBuffer(t.maxBuffer)}function YI(){return B0("\u23ED Ignoring the change"),process.exit(0)}function qr(){return B0("\u2713 Proceeding with deployment"),process.exit(1)}function XI(t,e){var d,y;(d=e.telemetry)==null||d.trackCommandStatus({command:"ignore",status:"start"}),(y=e.telemetry)==null||y.trackArgumentWorkspace(t!==void 0),zz(e);let r={workspace:t,...e};if(xe(`Using Turborepo to determine if this project is affected by the commit...
88
88
  `),e.directory){let g=ZI.default.resolve(e.directory);(0,JI.existsSync)(g)?r.directory=g:(q0(`Directory "${e.directory}" does not exist, using current directory`),r.directory=process.cwd())}else r.directory=process.cwd();if(process.env.TURBO_FORCE==="true")return xe("`TURBO_FORCE` detected"),qr();let n=hc(r.directory);if(!n)return or("Monorepo root not found. turbo-ignore inferencing failed"),qr();let i=$I(r);if(!i)return qr();let s=GI(r,n),o=BI(r),a=zI({workspace:i});if(a.result==="skip")return xe(a.reason),YI();if(a.result==="deploy")return xe(a.reason),qr();a.result==="conflict"&&xe(a.reason);let c=qI({workspace:i,fallback:r.fallback});if(!c)return qr();let f=`npx -y ${s?`turbo@${s}`:"turbo"} run ${o} --filter="${i}...[${c.ref}]" --dry=json`;xe(`Analyzing results of \`${f}\``);let h={cwd:n};e.maxBuffer&&(h.maxBuffer=e.maxBuffer),(0,KI.exec)(f,h,(g,E)=>{var v,A;if(g){let{level:P,code:D,message:ie}=VI({err:g.message});return P==="warn"?((v=e.telemetry)==null||v.trackCommandWarning(ie),q0(ie)):or(`${D}: ${g.message}`),qr()}try{let P=JSON.parse(E);if(P===null)return or(`Failed to parse JSON output from \`${f}\`.`),qr();let{packages:D}=P;return D?D.length>0?(D.length===1?xe(`This commit affects "${i}"`):xe(`This commit affects "${i}" and ${D.length-1} ${D.length-1===1?"dependency":"dependencies"} (${D.slice(1).join(", ")})`),qr()):(xe("This project and its dependencies are not affected"),YI()):(xe("Detected single package repo"),qr())}catch(P){return or(`Failed to parse JSON output from \`${f}\`.`),or(P),qr()}finally{(A=e.telemetry)==null||A.trackCommandStatus({command:"ignore",status:"end"})}})}var Pf,G0=new o_;G0.name(kf.name).description("Only proceed with deployment if the workspace or any of its dependencies have changed").hook("preAction",async(t,e)=>{let{telemetry:r}=await D0({packageInfo:{name:"turbo-ignore",version:kf.version}});e.addOption(new Jn("--telemetry").default(r).hideHelp()),Pf=r}).hook("postAction",async()=>{await(Pf==null?void 0:Pf.close())}).argument("[workspace]",'The workspace being deployed. If [workspace] is not provided, it will be inferred from the "name" field of the "package.json" located at the current working directory.').addOption(new Jn("-t, --task <name>","The task to execute").default("build")).addOption(new Jn("-f, --fallback <ref>","On Vercel, if no previously deployed SHA is available to compare against, fallback to comparing against the provided ref")).addOption(new Jn("-d, --directory <path>","The directory to run in (default: cwd)")).addOption(new Jn("--turbo-version <version>","Explicitly set which version of turbo to invoke")).addOption(new Jn("-b, --max-buffer <number>","maxBuffer for the child process in KB (default: 1024 KB)").argParser(t=>parseInt(t,10)*1024)).version(kf.version,"-v, --version","Output the current version").helpOption("-h, --help","Display help for command").showHelpAfterError(!1).action(XI);M0(G0);G0.parse();
89
89
  /*!
90
90
  * fill-range <https://github.com/jonschlinkert/fill-range>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turbo-ignore",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "",
5
5
  "homepage": "https://turbo.build/repo",
6
6
  "keywords": [],
@@ -33,7 +33,7 @@
33
33
  "@turbo/telemetry": "0.0.0",
34
34
  "@turbo/tsconfig": "0.0.0",
35
35
  "@turbo/test-utils": "0.0.0",
36
- "@turbo/types": "2.0.5",
36
+ "@turbo/types": "2.0.6",
37
37
  "@turbo/utils": "0.0.0"
38
38
  },
39
39
  "scripts": {