@skyramp/testbot-core 0.13.2-v3.538 → 0.13.2-v3.540
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.
package/dist/runner-client.cjs
CHANGED
|
@@ -139,7 +139,7 @@ ${i}
|
|
|
139
139
|
`),`
|
|
140
140
|
`,t)}o(Mj,"boundedFailureText");function Aa(e){return ro(Lie(e),[]).trim()}o(Aa,"commandFailureText");var jie=/^(.*?:\s*)?Command failed: (?:git|gh)\b.*$/;function sp(e,t=qh){let[n="",...i]=e.split(`
|
|
141
141
|
`).map(a=>a.trim()).filter(Boolean),r=i.length?jie.exec(n):null,s=r?[`${r[1]??""}${i[0]}`,...i.slice(1)]:[n,...i];return Oj(s," ",t,Math.floor(t*2/3))}o(sp,"failureReason");function mu(e){return e.replace(new RegExp("\x1B\\[[0-9;]*m","g"),"")}o(mu,"stripAnsi");function Gie(e){let t=/^(yarn run v|info Visit|error Command failed|npm ERR!|husky\b|\$ )/i,n=mu(e).split(`
|
|
142
|
-
`).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(Gie,"hookSummary");function Lj(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=Gie(e),n=ue().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(mu(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ue().staged.commitHookCouldNotRun(n,t):ue().staged.commitRefusedByHook(n,t)}o(Lj,"hookRefusal");var d={};Xr(d,{BRAND:()=>Ase,DIRTY:()=>ha,EMPTY_PATH:()=>Hie,INVALID:()=>Ce,NEVER:()=>Xse,OK:()=>vn,ParseStatus:()=>cn,Schema:()=>Ve,ZodAny:()=>oo,ZodArray:()=>hs,ZodBigInt:()=>ya,ZodBoolean:()=>Ea,ZodBranded:()=>ap,ZodCatch:()=>Qa,ZodDate:()=>ba,ZodDefault:()=>xa,ZodDiscriminatedUnion:()=>Yh,ZodEffects:()=>Or,ZodEnum:()=>Ba,ZodError:()=>Wn,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Zh,ZodIntersection:()=>Ca,ZodIssueCode:()=>G,ZodLazy:()=>Sa,ZodLiteral:()=>ka,ZodMap:()=>wu,ZodNaN:()=>Su,ZodNativeEnum:()=>Ra,ZodNever:()=>ui,ZodNull:()=>Ia,ZodNullable:()=>Pi,ZodNumber:()=>ma,ZodObject:()=>Zn,ZodOptional:()=>Ur,ZodParsedType:()=>re,ZodPipeline:()=>cp,ZodPromise:()=>ao,ZodReadonly:()=>$a,ZodRecord:()=>Wh,ZodSchema:()=>Ve,ZodSet:()=>Cu,ZodString:()=>so,ZodSymbol:()=>vu,ZodTransformer:()=>Or,ZodTuple:()=>Ni,ZodType:()=>Ve,ZodUndefined:()=>va,ZodUnion:()=>wa,ZodUnknown:()=>As,ZodVoid:()=>Iu,addIssueToContext:()=>X,any:()=>Cse,array:()=>Rse,bigint:()=>Ese,boolean:()=>Kj,coerce:()=>Kse,custom:()=>Yj,date:()=>bse,datetimeRegex:()=>Hj,defaultErrorMap:()=>fs,discriminatedUnion:()=>Tse,effect:()=>Vse,enum:()=>Lse,function:()=>Fse,getErrorMap:()=>yu,getParsedType:()=>_i,instanceof:()=>mse,intersection:()=>Dse,isAborted:()=>Hh,isAsync:()=>Eu,isDirty:()=>Jh,isValid:()=>io,late:()=>hse,lazy:()=>Ose,literal:()=>Mse,makeIssue:()=>op,map:()=>Pse,nan:()=>yse,nativeEnum:()=>jse,never:()=>kse,null:()=>wse,nullable:()=>qse,number:()=>Zj,object:()=>xse,objectUtil:()=>BC,oboolean:()=>Zse,onumber:()=>Wse,optional:()=>zse,ostring:()=>Yse,pipeline:()=>Jse,preprocess:()=>Hse,promise:()=>Gse,quotelessJson:()=>Vie,record:()=>Nse,set:()=>Use,setErrorMap:()=>qie,strictObject:()=>Qse,string:()=>Wj,symbol:()=>vse,transformer:()=>Vse,tuple:()=>_se,undefined:()=>Ise,union:()=>$se,unknown:()=>Sse,util:()=>Ye,void:()=>Bse});var Ye;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Ye||(Ye={}));var BC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(BC||(BC={}));var re=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=o(e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},"getParsedType");var G=Ye.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"]),Vie=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Wn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],p=u===a.path.length-1;if(l==="_errors"){p&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],p&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Wn.create=e=>new Wn(e);var zie=o((e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ye.assertNever(e)}return{message:n}},"errorMap"),fs=zie;var jj=fs;function qie(e){jj=e}o(qie,"setErrorMap");function yu(){return jj}o(yu,"getErrorMap");var op=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Hie=[];function X(e,t){let n=yu(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fs?void 0:fs].filter(r=>!!r)});e.common.issues.push(i)}o(X,"addIssueToContext");var cn=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return Ce;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},Ce=Object.freeze({status:"aborted"}),ha=o(e=>({status:"dirty",value:e}),"DIRTY"),vn=o(e=>({status:"valid",value:e}),"OK"),Hh=o(e=>e.status==="aborted","isAborted"),Jh=o(e=>e.status==="dirty","isDirty"),io=o(e=>e.status==="valid","isValid"),Eu=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Fr=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gj=o((e,t)=>{if(io(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Wn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Fe,"processCreateParams");var Ve=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cn,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Eu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Gj(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return io(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>io(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(Eu(r)?r:Promise.resolve(r));return Gj(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:G.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Or({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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),this["~standard"]={version:1,vendor:"zod",validate:o(n=>this["~validate"](n),"validate")}}optional(){return Ur.create(this,this._def)}nullable(){return Pi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hs.create(this)}promise(){return ao.create(this,this._def)}or(t){return wa.create([this,t],this._def)}and(t){return Ca.create(this,t,this._def)}transform(t){return new Or({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new xa({...Fe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new ap({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Qa({...Fe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cp.create(this,t)}readonly(){return $a.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Jie=/^c[^\s-]{8,}$/i,Yie=/^[0-9a-z]+$/,Wie=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zie=/^[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,Kie=/^[a-z0-9_-]{21}$/i,Xie=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ese=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nse="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",RC,rse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ise=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sse=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ose=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ase=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",use=new RegExp(`^${zj}$`);function qj(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(qj,"timeRegexSource");function lse(e){return new RegExp(`^${qj(e)}$`)}o(lse,"timeRegex");function Hj(e){let t=`${zj}T${qj(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o(Hj,"datetimeRegex");function dse(e,t){return!!((t==="v4"||!t)&&rse.test(e)||(t==="v6"||!t)&&sse.test(e))}o(dse,"isValidIP");function pse(e,t){if(!Xie.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o(pse,"isValidJWT");function fse(e,t){return!!((t==="v4"||!t)&&ise.test(e)||(t==="v6"||!t)&&ose.test(e))}o(fse,"isValidCidr");var so=class e extends Ve{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.string,received:s.parsedType}),Ce}let i=new cn,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")tse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"email",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")RC||(RC=new RegExp(nse,"u")),RC.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"emoji",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"uuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")Kie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"nanoid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Jie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid2",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Wie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ulid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),X(r,{validation:"url",code:G.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"regex",code:G.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Hj(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?use.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?lse(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?ese.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"duration",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?dse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ip",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?pse(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"jwt",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?fse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cidr",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?ase.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?cse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64url",code:G.invalid_string,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:G.invalid_string,...de.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...de.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...de.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}nonempty(t){return this.min(1,de.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};so.create=e=>new so({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function gse(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(gse,"floatSafeRemainder");var ma=class e extends Ve{static{o(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.number,received:s.parsedType}),Ce}let i,r=new cn;for(let s of this._def.checks)s.kind==="int"?Ye.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?gse(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_finite,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ma.create=e=>new ma({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var ya=class e extends Ve{static{o(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==re.bigint)return this._getInvalidInput(t);let i,r=new cn;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ya.create=e=>new ya({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Ea=class extends Ve{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.boolean,received:i.parsedType}),Ce}return vn(t.data)}};Ea.create=e=>new Ea({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var ba=class e extends Ve{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.date,received:s.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_date}),Ce}let i=new cn,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ba.create=e=>new ba({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var vu=class extends Ve{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==re.symbol){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.symbol,received:i.parsedType}),Ce}return vn(t.data)}};vu.create=e=>new vu({typeName:xe.ZodSymbol,...Fe(e)});var va=class extends Ve{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.undefined,received:i.parsedType}),Ce}return vn(t.data)}};va.create=e=>new va({typeName:xe.ZodUndefined,...Fe(e)});var Ia=class extends Ve{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==re.null){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.null,received:i.parsedType}),Ce}return vn(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodNull,...Fe(e)});var oo=class extends Ve{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return vn(t.data)}};oo.create=e=>new oo({typeName:xe.ZodAny,...Fe(e)});var As=class extends Ve{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return vn(t.data)}};As.create=e=>new As({typeName:xe.ZodUnknown,...Fe(e)});var ui=class extends Ve{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.never,received:n.parsedType}),Ce}};ui.create=e=>new ui({typeName:xe.ZodNever,...Fe(e)});var Iu=class extends Ve{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.void,received:i.parsedType}),Ce}return vn(t.data)}};Iu.create=e=>new Iu({typeName:xe.ZodVoid,...Fe(e)});var hs=class e extends Ve{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==re.array)return X(n,{code:G.invalid_type,expected:re.array,received:n.parsedType}),Ce;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(X(n,{code:a?G.too_big:G.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(X(n,{code:G.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(X(n,{code:G.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new Fr(n,a,n.path,c)))).then(a=>cn.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new Fr(n,a,n.path,c)));return cn.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}};hs.create=(e,t)=>new hs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function bu(e){if(e instanceof Zn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ur.create(bu(i))}return new Zn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof hs?new hs({...e._def,type:bu(e.element)}):e instanceof Ur?Ur.create(bu(e.unwrap())):e instanceof Pi?Pi.create(bu(e.unwrap())):e instanceof Ni?Ni.create(e.items.map(t=>bu(t))):e}o(bu,"deepPartialify");var Zn=class e extends Ve{static{o(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ye.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==re.object){let l=this._getOrReturnCtx(t);return X(l,{code:G.invalid_type,expected:re.object,received:l.parsedType}),Ce}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof ui&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let p=s[l],f=r.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new Fr(r,f,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof ui){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of c)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")c.length>0&&(X(r,{code:G.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of c){let f=r.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new Fr(r,f,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let f=await p.key,A=await p.value;l.push({key:f,value:A,alwaysSet:p.alwaysSet})}return l}).then(l=>cn.mergeObjectSync(i,l)):cn.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:de.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:xe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Ye.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Ye.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return bu(this)}partial(t){let n={};for(let i of Ye.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Ye.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ur;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return Jj(Ye.objectKeys(this.shape))}};Zn.create=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});Zn.strictCreate=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});Zn.lazycreate=(e,t)=>new Zn({shape:e,unknownKeys:"strip",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});var wa=class extends Ve{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Wn(c.ctx.common.issues));return X(n,{code:G.invalid_union,unionErrors:a}),Ce}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Wn(u));return X(n,{code:G.invalid_union,unionErrors:c}),Ce}}get options(){return this._def.options}};wa.create=(e,t)=>new wa({options:e,typeName:xe.ZodUnion,...Fe(t)});var gs=o(e=>e instanceof Sa?gs(e.schema):e instanceof Or?gs(e.innerType()):e instanceof ka?[e.value]:e instanceof Ba?e.options:e instanceof Ra?Ye.objectValues(e.enum):e instanceof xa?gs(e._def.innerType):e instanceof va?[void 0]:e instanceof Ia?[null]:e instanceof Ur?[void 0,...gs(e.unwrap())]:e instanceof Pi?[null,...gs(e.unwrap())]:e instanceof ap||e instanceof $a?gs(e.unwrap()):e instanceof Qa?gs(e._def.innerType):[],"getDiscriminator"),Yh=class e extends Ve{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return X(n,{code:G.invalid_type,expected:re.object,received:n.parsedType}),Ce;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=gs(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Fe(i)})}};function xC(e,t){let n=_i(e),i=_i(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&i===re.object){let r=Ye.objectKeys(t),s=Ye.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=xC(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===re.array&&i===re.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=xC(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===re.date&&i===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(xC,"mergeValues");var Ca=class extends Ve{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(Hh(s)||Hh(a))return Ce;let c=xC(s.value,a.value);return c.valid?((Jh(s)||Jh(a))&&n.dirty(),{status:n.value,value:c.data}):(X(i,{code:G.invalid_intersection_types}),Ce)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ca.create=(e,t,n)=>new Ca({left:e,right:t,typeName:xe.ZodIntersection,...Fe(n)});var Ni=class e extends Ve{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.array)return X(i,{code:G.invalid_type,expected:re.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return X(i,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(X(i,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new Fr(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>cn.mergeArray(n,a)):cn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ni.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ni({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var Wh=class e extends Ve{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return X(i,{code:G.invalid_type,expected:re.object,received:i.parsedType}),Ce;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new Fr(i,c,i.path,c)),value:a._parse(new Fr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?cn.mergeObjectAsync(n,r):cn.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Ve?new e({keyType:t,valueType:n,typeName:xe.ZodRecord,...Fe(i)}):new e({keyType:so.create(),valueType:t,typeName:xe.ZodRecord,...Fe(n)})}},wu=class extends Ve{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.map)return X(i,{code:G.invalid_type,expected:re.map,received:i.parsedType}),Ce;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new Fr(i,c,i.path,[l,"key"])),value:s._parse(new Fr(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}}}};wu.create=(e,t,n)=>new wu({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(n)});var Cu=class e extends Ve{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.set)return X(i,{code:G.invalid_type,expected:re.set,received:i.parsedType}),Ce;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(X(i,{code:G.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(X(i,{code:G.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let p of u){if(p.status==="aborted")return Ce;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new Fr(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Cu.create=(e,t)=>new Cu({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Zh=class e extends Ve{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return X(n,{code:G.invalid_type,expected:re.function,received:n.parsedType}),Ce;function i(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yu(),fs].filter(l=>!!l),issueData:{code:G.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yu(),fs].filter(l=>!!l),issueData:{code:G.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof ao){let c=this;return vn(async function(...u){let l=new Wn([]),p=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),f=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(f,s).catch(h=>{throw l.addIssue(r(f,h)),l})})}else{let c=this;return vn(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Wn([i(u,l.error)]);let p=Reflect.apply(a,this,l.data),f=c._def.returns.safeParse(p,s);if(!f.success)throw new Wn([r(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ni.create(t).rest(As.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||Ni.create([]).rest(As.create()),returns:n||As.create(),typeName:xe.ZodFunction,...Fe(i)})}},Sa=class extends Ve{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Sa.create=(e,t)=>new Sa({getter:e,typeName:xe.ZodLazy,...Fe(t)});var ka=class extends Ve{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};ka.create=(e,t)=>new ka({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Jj(e,t){return new Ba({values:e,typeName:xe.ZodEnum,...Fe(t)})}o(Jj,"createZodEnum");var Ba=class e extends Ve{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{expected:Ye.joinValues(i),received:n.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{received:n.data,code:G.invalid_enum_value,options:i}),Ce}return vn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Ba.create=Jj;var Ra=class extends Ve{static{o(this,"ZodNativeEnum")}_parse(t){let n=Ye.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==re.string&&i.parsedType!==re.number){let r=Ye.objectValues(n);return X(i,{expected:Ye.joinValues(r),received:i.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ye.objectValues(n);return X(i,{received:i.data,code:G.invalid_enum_value,options:r}),Ce}return vn(t.data)}get enum(){return this._def.values}};Ra.create=(e,t)=>new Ra({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var ao=class extends Ve{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return X(n,{code:G.invalid_type,expected:re.promise,received:n.parsedType}),Ce;let i=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return vn(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ao.create=(e,t)=>new ao({type:e,typeName:xe.ZodPromise,...Fe(t)});var Or=class extends Ve{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{X(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ce;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"?ha(u.value):n.value==="dirty"?ha(u.value):u});{if(n.value==="aborted")return Ce;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?Ce:c.status==="dirty"?ha(c.value):n.value==="dirty"?ha(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!io(a))return Ce;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>io(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):Ce);Ye.assertNever(r)}};Or.create=(e,t,n)=>new Or({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(n)});Or.createWithPreprocess=(e,t,n)=>new Or({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(n)});var Ur=class extends Ve{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===re.undefined?vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ur.create=(e,t)=>new Ur({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var Pi=class extends Ve{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===re.null?vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var xa=class extends Ve{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===re.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};xa.create=(e,t)=>new xa({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var Qa=class extends Ve{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Eu(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Qa.create=(e,t)=>new Qa({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var Su=class extends Ve{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==re.nan){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.nan,received:i.parsedType}),Ce}return{status:"valid",value:t.data}}};Su.create=e=>new Su({typeName:xe.ZodNaN,...Fe(e)});var Ase=Symbol("zod_brand"),ap=class extends Ve{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},cp=class e extends Ve{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),ha(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ce:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:xe.ZodPipeline})}},$a=class extends Ve{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(io(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return Eu(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};$a.create=(e,t)=>new $a({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function Vj(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(Vj,"cleanParams");function Yj(e,t={},n){return e?oo.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=Vj(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=Vj(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):oo.create()}o(Yj,"custom");var hse={object:Zn.lazycreate},xe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(xe||(xe={}));var mse=o((e,t={message:`Input not instance of ${e.name}`})=>Yj(n=>n instanceof e,t),"instanceOfType"),Wj=so.create,Zj=ma.create,yse=Su.create,Ese=ya.create,Kj=Ea.create,bse=ba.create,vse=vu.create,Ise=va.create,wse=Ia.create,Cse=oo.create,Sse=As.create,kse=ui.create,Bse=Iu.create,Rse=hs.create,xse=Zn.create,Qse=Zn.strictCreate,$se=wa.create,Tse=Yh.create,Dse=Ca.create,_se=Ni.create,Nse=Wh.create,Pse=wu.create,Use=Cu.create,Fse=Zh.create,Ose=Sa.create,Mse=ka.create,Lse=Ba.create,jse=Ra.create,Gse=ao.create,Vse=Or.create,zse=Ur.create,qse=Pi.create,Hse=Or.createWithPreprocess,Jse=cp.create,Yse=o(()=>Wj().optional(),"ostring"),Wse=o(()=>Zj().optional(),"onumber"),Zse=o(()=>Kj().optional(),"oboolean"),Kse={string:o((e=>so.create({...e,coerce:!0})),"string"),number:o((e=>ma.create({...e,coerce:!0})),"number"),boolean:o((e=>Ea.create({...e,coerce:!0})),"boolean"),bigint:o((e=>ya.create({...e,coerce:!0})),"bigint"),date:o((e=>ba.create({...e,coerce:!0})),"date")};var Xse=Ce;var up=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(up||{}),QC=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(QC||{});var Kh=300,$t=d.string().trim().min(1),eoe=d.object({action:d.enum(["start","run","wait"]),text:$t,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:$t.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),lp=/^[A-Za-z_][A-Za-z0-9_]*$/,li=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,ku=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(ku||{}),Ui="shared",toe=$t.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Bu=d.object({address:toe,readyWhen:$t.nullable(),credentials:d.array(d.string().regex(li)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(ku),detail:$t.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array($t).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),$C={steps:d.array(eoe).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:$t,service:$t.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(lp)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},TC=d.object({name:$t,repository:$t.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...$C,deployed:$t.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),noe=d.object({name:d.string().regex(li).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:$t.max(Kh).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),roe=d.object({component:$t,problem:$t,evidence:$t.describe("the exact command and output that shows it"),fix:$t.describe("what the user must provide, and where")}),ioe=d.object({framework:$t,file:$t.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),soe=d.object({input:$t.describe("the part of the user's SUT input, as given"),reason:$t}),KBe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(QC).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(TC),suites:d.array(ioe).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array($t).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:$t.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:$t.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(soe).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(roe).describe("required (non-empty) when status is blocked"),inputs:d.array(noe).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:Bu.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var DC=64*1024,_C=512*1024,Xj=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var Fi=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Fi||{}),di=d.string().trim().min(1),ooe=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:di.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),NC=d.array(d.object({component:di.describe("a shared component listed above"),url:di.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:di.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),aoe=d.object({name:di.describe("the credential's environment variable name, as listed above; never its value"),component:di.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:di.describe("the request or command you tested it with and what came back, never the value")}),e1=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:ooe.optional(),teardown:di.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(Fi).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:di,output:di}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:di.describe("ISO timestamp"),revisions:NC.optional(),missingSecrets:d.array(d.string().regex(lp)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(aoe).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var x1=require("node:crypto");var Ta=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Ta||{});var PC=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var dp=/^pasted-[0-9a-f]{16}$/,ms=/^file-[0-9a-f]{16}$/,pp=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(pp||{}),Da=o(e=>e.trim().toUpperCase(),"normalKey"),t1=o((e,t)=>{let n=e.trim();return dp.test(n.toLowerCase())?"Pasted text":ms.test(n.toLowerCase())?t?.get(Da(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var Xh=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xh||{}),Oi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(Oi||{}),Ru=(b=>(b.RelatedChangeConflict="related_change_conflict",b.ReferenceOutsideTarget="reference_outside_target",b.SourceAccessLost="source_access_lost",b.ConfigurationIncomplete="configuration_incomplete",b.CredentialUnavailable="credential_unavailable",b.WorkflowBindingUnverified="workflow_binding_unverified",b.WorkflowRefUnprotected="workflow_ref_unprotected",b.BedrockWorkflowRequired="bedrock_workflow_required",b.DeploymentReview="deployment_review",b.SutRevisionMismatch="sut_revision_mismatch",b.IsolationUnavailable="isolation_unavailable",b.EvidenceInsufficient="evidence_insufficient",b.ConfigurationUnresolved="configuration_unresolved",b.ModelProviderDenied="model_provider_denied",b.ModelProviderUnavailable="model_provider_unavailable",b.RunnerProviderNotReady="runner_provider_not_ready",b.MergeConflict="merge_conflict",b))(Ru||{}),co=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(co||{}),fp=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(fp||{}),gp=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(gp||{});var em=(n=>(n.Probe="probe",n.Agent="agent",n))(em||{}),Ap=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(Ap||{}),tm=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(tm||{});function nm(e){return e==="failed"?2:e==="unknown"?1:0}o(nm,"cleanupShortfall");var hp=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(hp||{}),Mi=d.string().trim().min(1),coe=d.object({case:Mi.describe("recommend id this assertion enforces"),evidence:Mi.describe("the exact assertion line from the file that checks that case's observable")});var n1=d.object({route:d.literal("persistence"),url:d.string().url()}).strict(),mp=d.object({kind:d.nativeEnum(Ap).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Mi.describe("the dependency, endpoint or data it affects"),mechanism:d.nativeEnum(tm).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Mi.describe("what it sets up"),worker:Mi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:n1.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Mi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Mi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),uoe=d.object({file:Mi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum(hp),language:Mi,covers:d.array(d.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:d.array(coe).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(mp).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),UC=d.object({schemaVersion:d.literal(1),tests:d.array(uoe),deferredUi:d.array(d.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Mi.describe("one paragraph")});var ys=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(ys||{}),Tn=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(Tn||{}),$n=d.string().trim().min(1),FC=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(FC||{}),rm=d.object({kind:d.nativeEnum(FC),reason:$n.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),yp=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),r1=d.object({case:$n.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(Tn),runtimeTargets:yp.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:$n.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:d.boolean().optional(),testProblem:rm.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:d.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:d.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),i1=d.object({started:d.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(r1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),s1=d.object({context:d.array(mp).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:d.string().optional().describe("staged path \u2014 required for placements"),file:$n.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:$n.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(ys),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:$n.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:$n.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:i1,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:d.array($n).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:d.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),o1=(n=>(n.Junit="junit",n.Converter="converter",n))(o1||{}),loe=$n.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),doe=d.object({results:$n.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(o1),run:$n.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array($n).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:$n.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:$n.describe("the covers id it realizes"),file:loe})).describe("map each reported test name to the case it covers")}),poe=d.object({suites:d.array(doe).min(1)}),OC=d.object({schemaVersion:d.literal(1),items:d.array(s1),runnerResults:poe.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:$n.describe("one paragraph")});hu();SC();function a1(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(a1,"credentialKeyFromRole");var c1=ee(require("path"));var un=d.string().trim().min(1),im=un,MC=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(MC||{}),LC=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],u1=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(MC).optional(),repository:im.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:Bu.optional(),components:d.array(d.object({name:un,repository:un.describe(`owner/repo, or "${Ui}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...$C,credentials:d.array(d.string().regex(li)).max(50).optional(),deployed:un.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:un,file:un,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(un),inputsUsedHow:d.array(d.object({input:un,how:un}).strict()).optional(),inputsNotUsed:d.array(d.object({input:un,reason:un}).strict()),blockers:d.array(d.object({component:un,problem:un,evidence:un,fix:un}).strict()),replay:d.object({outcome:un,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:un,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Ui&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${Ui}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{LC.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==Ui&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var CRe=["clean","recipe-drift"];function Ep(e){let t=c1.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(Ep,"isRuntimePlanFile");var bp=d.string().uuid(),vp=d.object({environmentId:d.string().uuid(),allowed:d.boolean(),revision:bp,updatedAt:d.string().datetime(),updatedBy:d.string().uuid()}).strict();var Ip=(a=>(a.NoEnvironment="no_environment",a.NoRecordedGrant="no_recorded_grant",a.Unavailable="unavailable",a.Changed="changed",a.Denied="denied",a.OutOfScope="out_of_scope",a))(Ip||{});function wp(e){switch(e){case"no_environment":return"the run has no selected Test Environment address";case"no_recorded_grant":return"the run's configuration did not record permission to keep test data in this environment";case"unavailable":return"the current permission to keep test data could not be read";case"changed":return"the permission to keep test data changed after the run started";case"denied":return"the environment does not permit test data to stay";case"out_of_scope":return"the request is outside the environment's address"}}o(wp,"persistenceRefusalText");function sm(e,t,n){let i=vp.safeParse(t);return!i.success||!i.data.allowed||!e.environmentId||i.data.environmentId!==e.environmentId||!e.environmentAddress||e.persistentDataPolicy&&e.persistentDataPolicy.revision!==i.data.revision?!1:uo(e.environmentAddress,n)}o(sm,"persistentDataPolicyApplies");function uo(e,t){try{let n=new URL(t),i=new URL(e);if(i.search||i.hash)return!1;let r=/%(?:2f|5c|2e|25)/i;if(t.includes("\\")||e.includes("\\")||r.test(n.pathname)||r.test(i.pathname))return!1;let s=i.pathname.replace(/\/$/,"");return["https:","http:"].includes(i.protocol)&&n.origin===i.origin&&(n.pathname===s||n.pathname.startsWith(`${s}/`))}catch{return!1}}o(uo,"environmentContainsUrl");var jC="delivery-persistence.json",l1=d.object({environmentId:d.string().uuid(),environmentAddress:d.string().url(),revision:bp}).strict(),d1=d.object({refusal:d.nativeEnum(Ip)}).strict();var Q1=d.unknown().optional(),$1={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",persistentDataPolicy:"/api/v1/runner/attempts/:attemptId/persistent-data-policy",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",runEvents:"/api/v1/runner/attempts/:attemptId/run-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file",deployedRevisions:"/api/v1/runner/attempts/:attemptId/deployed-revisions"},Na=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Na||{}),dm=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(dm||{}),pm=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(pm||{}),foe=["sut_setup"],goe=["sut_setup","schedule","revision_read"],Aoe=["sut_setup"],qC=(t=>(t.PullRequest="pull_request",t))(qC||{}),HC=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(HC||{}),p1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var fm=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(fm||{}),kp=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(kp||{}),T1=(n=>(n.Running="running",n.Ended="ended",n))(T1||{}),Bp=(A=>(A.TimedOut="timed_out",A.AgentFailed="agent_failed",A.SetupFailed="setup_failed",A.CredentialMissing="credential_missing",A.RunnerLost="runner_lost",A.CheckoutFailed="checkout_failed",A.EnvironmentUnverified="environment_unverified",A.ModelProviderDenied="model_provider_denied",A.ModelProviderUnavailable="model_provider_unavailable",A.RunnerProviderNotReady="runner_provider_not_ready",A.MergeConflict="merge_conflict",A.EnvironmentUnavailable="environment_unavailable",A))(Bp||{}),D1=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(D1||{}),JC=(n=>(n.Started="started",n.Finished="finished",n))(JC||{}),_1=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(_1||{});var N1=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(N1||{});var P1=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(P1||{}),YC=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(YC||{}),GC=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(GC||{});var WC=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(WC||{}),Mr=d.string().regex(/^[1-9][0-9]{0,18}$/),Lr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),VC=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function U1(e,t){return`${e.replace(/\/+$/,"")}/runs/${t}`}o(U1,"skyrampRunPageUrl");var In=d.string().regex(Tu),Dn=d.string().regex(/^[0-9a-f]{64}$/),lm=d.object({id:In,revision:Mr}).strict(),gm={provider:d.literal("github"),providerAccountId:Mr,providerRepositoryId:Mr},Am={provider:d.literal("azure-devops"),providerAccountId:In,providerRepositoryId:In},vr=d.discriminatedUnion("provider",[d.object(gm).strict(),d.object(Am).strict()]),ZC=d.discriminatedUnion("provider",[d.object(gm).passthrough(),d.object(Am).passthrough()]),ji=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),f1={namespace:d.string().min(1),name:d.string().min(1)},F1=d.discriminatedUnion("provider",[d.object({...gm,...f1}).strict(),d.object({...Am,...f1}).strict()]),g1=d.object({ref:d.string().min(1),revision:Lr}).strict(),hoe=d.object({kind:d.nativeEnum(HC),number:Mr.optional(),ref:d.string().min(1),revision:Lr,reason:d.nativeEnum(dm)}).strict(),moe=d.object({repository:F1,revision:Lr,ref:d.string().nullable(),reason:d.nativeEnum(dm),change:d.object({kind:d.nativeEnum(qC),number:Mr,base:g1.optional()}).strict().nullable(),compareWith:g1.optional(),merge:d.array(hoe).min(2).optional()}).strict();function yoe(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!p1.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=p1.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(yoe,"mergedSourceIssue");function Eoe(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>ji(l.repository))),c=new Set(r.map(l=>ji(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Eoe,"baselineSourcesIssue");var O1=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,M1=/^[1-9][0-9]{0,18}$/,A1=new RegExp(`${O1.source}|${M1.source}`),h1=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,boe=d.union([d.object({source:d.literal("jira"),site:d.string().regex(h1),key:d.string().regex(O1),updated:d.string().datetime(),contentHash:Dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(h1),key:d.string().regex(M1),version:d.number().int().positive(),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),contentHash:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict()]),m1=d.union([d.literal("jira"),d.literal("confluence")]),voe=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:m1,site:d.string(),key:d.string().regex(A1),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:m1,site:d.string(),key:d.string().regex(A1),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),state:d.literal("read"),version:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Ioe=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),woe=d.object({schemaVersion:d.literal(1),runId:In,skyrampOrgId:In,target:lm,policy:lm.nullable(),trigger:d.object({kind:d.nativeEnum(pm),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:In,revision:Mr.nullable(),hash:Dn}).strict(),baseline:d.object({confirmedRunId:In.nullable(),initialBaselineId:In.optional(),comparisonBaselineId:In.optional(),knownFailures:d.array(Ioe).optional(),sources:d.array(d.object({repository:vr,revision:Lr}).strict()).optional()}).strict().optional(),sources:d.array(moe).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Na),repository:F1,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(up),required:d.boolean()}).strict()),requirements:d.array(boe).min(1).optional(),instructions:d.object({contentHash:Dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let p="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${p}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let f=PC({source:u.source,key:u.key});n.has(f)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(f)});let i=e.trigger.kind,r=foe.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Eoe(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),goe.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>ji(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let p=ji(u.repository);a.has(p)?c.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(p)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let p=yoe(u);p&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...p.path],message:p.message})})});var KC=(n=>(n.Person="person",n.Policy="policy",n))(KC||{}),Coe=d.object({kind:d.nativeEnum(KC),name:d.string().min(1).max(256)}).strict(),Soe=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),koe=d.object({schemaVersion:d.literal(1),attempt:d.object({id:In,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:woe,manifestHash:Dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Coe.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).optional(),statedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).optional(),runSettings:Soe.optional()}).strict(),y1={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Boe=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),Roe=d.object({schemaVersion:d.literal(1),runId:In,execution:d.discriminatedUnion("provider",[d.object({...y1,provider:d.literal("github"),repository:d.object(gm).strict(),providerRunId:Mr}).strict(),d.object({...y1,provider:d.literal("azure-devops"),repository:d.object(Am).strict(),providerRunId:Boe}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional(),credentialKinds:d.literal(!0).optional()}).strict(),E1=d.object({repository:vr,number:Mr,commitSha:Lr.optional()}).strict(),om=d.array(d.object({repository:vr,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),L1=d.object({branch:VC.optional(),commitSha:Lr.optional()}).strict(),hm=4096,j1=d.array(d.object({file:d.string().max(4096).regex(/\S/),dependsOn:d.array(d.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),b1=d.object({repository:vr,message:d.string().max(hm),...L1.shape,heldBack:j1.optional()}).strict(),xoe=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:om}).strict(),d.object({status:d.literal("delivered"),noTests:om,pullRequests:d.array(E1).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:om,pullRequests:d.array(E1).min(1),failures:d.array(b1).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string().max(hm),noTests:om,failures:d.array(b1).min(1).optional()}).strict()]),XC=1024*1024,G1=16*1024*1024,Cp={id:4096,text:16384,businessCase:65536},Rp={id:Cp.id,statement:Cp.text,rows:1e3},v1=d.string().min(1).max(Cp.id),cm=d.string().max(Cp.text),am=o((e,t)=>d.array(d.object({[e]:cm}).strict()).max(t).optional(),"texts"),eS=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string().max(Cp.businessCase),validation:d.object({rationale:cm.min(1),gaps:d.array(d.string().min(1).max(4096)).max(200)}).strict().optional(),changes:d.array(d.object({id:v1,text:cm}).strict()).max(1e3).optional(),requirements:d.array(d.object({id:v1,statement:cm}).strict()).max(Rp.rows).optional(),issuesFound:am("description",5e3),newTestsCreated:am("description",5e3),testResults:am("details",5e3),caveats:am("text",100)}).strict(),Qoe=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(Oi),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(co),repository:d.string().min(1),revision:Lr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(Ru))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),um=500,V1=2048,z1=1e3,$oe=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,I1=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!$oe.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),q1=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&I1(n)&&I1(i)},"isResultRepository"),Toe=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(q1,"Invalid"),testType:d.string(),runtimeTargets:yp.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(fp),family:d.nativeEnum(gp).optional()}).strict().optional(),origin:d.nativeEnum(Xh).optional()}).strict()),validation:Qoe,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(V1),testedBy:d.array(d.string().min(1).max(1024)).max(um),writtenBy:d.array(d.string().min(1).max(1024)).max(um),maintainedBy:d.array(d.string().min(1).max(1024)).max(um)}).strict()).max(z1).optional(),traceVersion:d.literal(1),display:eS.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),w1=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function tS(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${w1(a)}`;return i?`${c}#${w1(i)}`:c}o(tS,"testResultId");var mm=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(mm||{}),H1=50,J1=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:vr,branch:VC,commit:Lr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:vr,number:Mr,branch:VC}).strict()]),Doe=100,_oe=2048,FRe=d.object({records:d.array(d.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(_oe)).max(Doe),unlisted:d.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),Y1=d.object({schemaVersion:d.literal(1),run:d.object({runId:In,attemptNumber:d.number().int().positive(),manifestHash:Dn}).strict(),target:lm,policy:lm,provenance:d.object({sources:d.array(d.object({repository:vr,revision:Lr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:xoe}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Toe,githubWrites:d.array(J1).max(H1).optional()}).strict(),nS=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(nS||{}),rS=200,Noe=d.object({cause:d.nativeEnum(nS),credential:d.string().regex(li).optional(),reason:d.string().trim().min(1).max(rS).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Poe=d.object({name:d.string().regex(li),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Kh)}).strict(),ORe=Y1.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:u1,check:Noe.optional(),inputs:d.array(Poe).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{Ep(s.path)||n(["files",a,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),Xj.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>DC&&n(["files",a,"content"],`larger than ${DC} bytes`)}),r>_C&&n(["files"],`recipe text over ${_C} bytes in total`)}),MRe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(q1,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(em),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function W1(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(W1,"readsDeployedState");var Uoe=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(D1),event:d.nativeEnum(JC),status:d.nativeEnum(_1).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),ym=100,Foe=5e3,_a=2e3,C1=100,Z1=/^[A-Za-z0-9_-]{1,64}$/,Ooe=20,Moe=200,Loe=100,joe=100,Goe=200,S1="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Voe=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${S1}/${S1})$`),zoe=500,k1=50,qoe=10,Hoe=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,K1=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,br=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!K1.test(t),"blank, or not text"),"setupText"),Li={sequence:d.number().int().min(1).max(Foe),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},X1=d.object({...Li,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(P1),accepted:d.boolean(),text:br(_a),note:d.object({source:d.enum(["target","environment"]),quote:br(_a)}).strict().optional(),kept:br(_a).optional()}).strict();function eG(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(eG,"checkReply");var Joe=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),phase:d.nativeEnum(YC),text:br(_a)}).strict(),d.object({...Li,kind:d.literal("component"),name:br(C1),repository:br(Goe).refine(e=>Voe.test(e)||e===Ui,"not owner/name"),file:br(zoe).nullable(),status:d.nativeEnum(WC),version:br(joe).optional()}).strict(),X1,d.object({...Li,kind:d.literal("question"),id:d.string().regex(Z1),type:d.nativeEnum(N1),text:br(_a),component:br(C1).nullable(),choices:d.array(br(Moe)).max(Ooe),placeholder:br(Loe).optional()}).strict(),d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("credentials"),names:d.array(d.string().regex(li)).min(1).max(k1),logins:d.array(d.object({key:d.string().regex(Hoe),usernameVariable:d.string().regex(li),passwordVariable:d.string().regex(li)}).strict()).min(1).max(qoe).optional(),variables:d.array(d.string().regex(li)).min(1).max(k1).optional()}).strict()]).superRefine((e,t)=>{if(eG(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>a1(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:d.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),Yoe=d.object({schemaVersion:d.literal(1),events:d.array(Joe).max(ym)}).strict(),Woe=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),stage:d.nativeEnum(GC),text:br(_a)}).strict(),X1,d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("stage"),stage:d.nativeEnum(GC),event:d.nativeEnum(JC)}).strict(),d.object({...Li,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(_a).refine(e=>!K1.test(e),"not text")}).strict()]).superRefine(eG),Zoe=d.object({schemaVersion:d.literal(1),events:d.array(Woe).max(ym)}).strict(),B1={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},tG=d.discriminatedUnion("kind",[d.object({...B1,kind:d.literal("instruction"),question:d.null()}),d.object({...B1,kind:d.literal("answer"),question:d.string().regex(Z1)})]),nG=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),Koe=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),Xoe=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(tG).optional(),stop:d.object({key:nG}).optional(),notes:Koe.optional()}),eae=d.object({schemaVersion:d.literal(1),messages:d.array(tG).optional()});var tae=500*1024*1024,rG=d.object({id:Mr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Mr,expiresAt:d.string().datetime()}).strict(),nae=d.object({schemaVersion:d.literal(1),artifact:rG,sessionId:In,contentHash:Dn,bytes:d.number().int().min(1).max(tae)}).strict(),rae=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:rG,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:In,contentHash:Dn,key:nG}).strict().nullable()}).strict(),iae=200,xu=100,iG=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(iG||{}),sae=d.object({kind:d.nativeEnum(iG),setup:d.object({runId:In,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(WC)}).strict()).max(xu),credentials:d.array(d.string().min(1)).max(xu),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(xu),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(xu),log:d.array(d.object({phase:d.nativeEnum(YC),text:d.string()}).strict()).max(iae),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(xu),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(xu)}).strict().optional()}).strict(),oae=d.object({schemaVersion:d.literal(1),context:sae.nullable()}).strict(),aae=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:In,revision:Mr.nullable(),hash:Dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional(),environmentId:d.string().uuid().optional(),persistentDataPolicy:Q1}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:Dn}).strict()}).strict(),sG=d.object({schemaVersion:d.literal(1),environmentId:d.string().uuid().nullable(),environmentAddress:d.string().url().nullable(),persistentDataPolicy:vp.nullable()}).strict(),cae=Bu.extend({environmentId:d.string().uuid().optional(),persistentDataPolicy:Q1,version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:Dn.optional(),files:d.array(d.object({path:d.string().refine(e=>Ep(e)&&!LC.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),uae=d.object({schemaVersion:d.literal(1),testEnvironment:cae.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:Dn,files:d.array(d.object({path:d.string().refine(Ep,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:im.optional(),recipeRepository:im.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),oG=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(T1),ending:d.nativeEnum(kp).nullable(),cause:d.nativeEnum(Bp).nullable(),deadlineAt:d.string().datetime()}).strict();function aG(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(aG,"attemptClosure");var cG=50,LRe=d.object({repository:vr,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(cG)}).strict();function zC(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(zC).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${zC(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(zC,"canonicalJson");function uG(e){return(0,x1.createHash)("sha256").update(zC(e),"utf8").digest("hex")}o(uG,"manifestHash");var Qu=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function iS(e,t,{statedPins:n=!0,credentialKinds:i=!0}={}){return Roe.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{},...i?{credentialKinds:!0}:{}})}o(iS,"handshakeRequest");function lG(e){let t=koe.parse(e);if(uG(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(lG,"parseHandshakeResponse");function lae(e){let t=o(r=>r.map(s=>({repository:Qu(s.repository),number:s.number,...s.commitSha===void 0?{}:{commitSha:s.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(r=>({repository:Qu(r.repository),reason:r.reason}))}:{};if(e.status==="delivered")return{status:e.status,...n,pullRequests:t(e.pullRequests)};let i=o(r=>r.map(s=>({repository:Qu(s.repository),message:s.message,...s.branch===void 0?{}:{branch:s.branch},...s.commitSha===void 0?{}:{commitSha:s.commitSha},...s.heldBack===void 0?{}:{heldBack:s.heldBack}})),"failures");return e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:i(e.failures)}:e.status==="failed"&&e.failures?{...e,...n,failures:i(e.failures)}:{...e,...n}}o(lae,"toDelivery");function dae(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(dae,"describeIssues");function dG(e){let{manifest:t}=e;if(Aoe.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=Y1.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:uG(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:Qu(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:lae(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:Qu(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${dae(n.error)}`);return pae(n.data,t,e.checkedOut),n.data}o(dG,"buildReportUpload");function pae(e,t,n){let i=o(s=>n.find(a=>ji(a.repository)===ji(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(pae,"assertEvidenceFromSnapshot");function pG(e){if(e.reportUploaded)return{schemaVersion:1,reason:"report_uploaded",cause:null};if(e.recipeUploaded)return{schemaVersion:1,reason:"recipe_uploaded",cause:null};if(e.revisionsUploaded)return{schemaVersion:1,reason:"revisions_uploaded",cause:null};let t=e.githubWrites?.length?{githubWrites:e.githubWrites.map(n=>({...n,repository:Qu(n.repository)}))}:{};return e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null,...t,...e.sharedEnvironmentRecords?{sharedEnvironmentRecords:e.sharedEnvironmentRecords}:{}}:e.mergeConflict&&R1(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict,...t}:{schemaVersion:1,reason:"no_report",cause:R1({...e,mergeConflict:void 0}),...t}}o(pG,"attemptEndFor");function R1(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":e.environmentUnavailable?"environment_unavailable":"agent_failed"}o(R1,"noReportCause");var YRe=["clean","recipe-drift"];var lo=ee(require("path"));var XRe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var sS=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Da(t.key),t.file.name]]:[])),"itemNames"),Aae=10*1024*1024,gG=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),AG=o((e,t)=>lo.join(lo.dirname(e),`${lo.basename(e,lo.extname(e))}${t}`),"besideFile"),hG=o(e=>AG(e,".extracted.txt"),"extractedTextPath");var hae=o(e=>AG(e,".quotes.txt"),"confirmedQuotesPath");function mG(e){return gG(e.file)?hG(e.path):e.file?.mediaType==="application/pdf"?hae(e.path):e.path}o(mG,"itemTextPath");var xp=ee(require("fs")),Pa=ee(require("path"));var mae=8;function ln(e,t,n={}){let i=t.slice(0,mae),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}o(ln,"fail");function Gi(e){if(xp.existsSync(e))try{return JSON.parse(xp.readFileSync(e,"utf-8"))}catch{return}}o(Gi,"readJsonFile");function ve(e,t){return Gi(Pa.join(e.outputsDir,t))}o(ve,"readArtifact");function Kn(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:ln(this.name,r,{fatal:!0})}}}o(Kn,"schemaGate");function Vi(e,t){return Pa.relative(e,Pa.resolve(e,t)).replace(/\/+$/,"")}o(Vi,"relNorm");function Qp(e){return e.replace(/\s+/g," ").trim()}o(Qp,"normalizeCode");var $p=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");function _t(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(_t,"codeSpan");var yG=ee(require("path"));var oS="outputs/preflight.json",Ua="pr-diff.txt",aS="related-diffs";function cS(e){return yG.join(aS,`${e.toLowerCase().replace(/\//g,"__").replace(/[^a-z0-9._-]/g,"_")}.diff`)}o(cS,"relatedDiffArtifact");var Es=ee(require("path"));var Tp=ee(require("path"));var po="Skyramp Testbot",Fa="test-bot@skyramp.dev";var Du=o(e=>e.slice(0,12),"shortCommit");var yae=o((e,t)=>Vt(t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function EG(e){let t="";try{t=yae(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${Tp.basename(Tp.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(EG,"repositorySlug");var vxe=new Set(Object.values(co));var Ixe=d.object({checks:d.array(d.object({repository:d.string().optional(),name:d.string().min(1),headSha:d.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:d.string().default("completed"),conclusion:d.string().nullable().optional(),url:d.string().optional(),summary:d.string().optional()}))});var Eae=["generate-unit","native-run"],kxe=["preflight","plan","write",...Eae,"report","deliver"];var Em=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(Em||{}),bae=Object.values(Em);var bG=8e3;function vG(e,t){return(e.contextRepositories??[]).some(n=>pi(n,t))}o(vG,"pinnedForContext");var uS=new Map;function Iae(e){return e.repositorySlug?e.repositorySlug:(uS.has(e.repositoryPath)||uS.set(e.repositoryPath,EG(e.repositoryPath)),uS.get(e.repositoryPath))}o(Iae,"workingSlug");function Jt(e){let t=Iae(e);return[{slug:t,path:e.repositoryPath,writable:!vG(e,t),working:!0},...(e.relatedRepos??[]).map(n=>({slug:n.slug,path:n.path,writable:n.writable===!0,working:!1}))]}o(Jt,"runSources");var pi=o((e,t)=>e.toLowerCase()===t.toLowerCase(),"sameSlug");function _u(e,t){return t?.trim()?e.find(n=>pi(n.slug,t.trim())):e[0]}o(_u,"findSource");function Ir(e,t){return _u(Jt(e),t)}o(Ir,"resolveSource");var wae=o((e,t)=>`${t} is not a repository of this run (${Jt(e).map(n=>n.slug).join(", ")})`,"notARepository");function bs(e,t){let n=Ir(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${Jt(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:wae(e,t)}}o(bs,"writableSource");function fi(e,t){return IG(Jt(e),t)}o(fi,"checkoutLabel");var lS=o(e=>Es.basename(Es.resolve(e.path)),"relatedDirName");function IG(e,t){return e.length<2?"":`${_u(e,t)?.slug??t}: `}o(IG,"labelAmong");var Mxe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var Pu=o(e=>!!e.inputs?.scheduledValidation?.comparisonBaselineId,"retestsKnownFailures");var hb=ee(require("fs")),Tt=ee(require("path"));var kr=ee(require("fs")),Iq=require("child_process"),wq=require("module"),Cq=ee(require("os")),yi=ee(require("path"));var pe={};Xr(pe,{$brand:()=>SS,$input:()=>rx,$output:()=>nx,INVALID:()=>Pn,NEVER:()=>CS,TimePrecision:()=>Ax,ZodAny:()=>n$,ZodArray:()=>o$,ZodBase64:()=>pE,ZodBase64URL:()=>fE,ZodBigInt:()=>bl,ZodBigIntFormat:()=>hE,ZodBoolean:()=>El,ZodCIDRv4:()=>lE,ZodCIDRv6:()=>dE,ZodCUID:()=>rE,ZodCUID2:()=>iE,ZodCatch:()=>B$,ZodCodec:()=>$f,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,ZodCreditCard:()=>JQ,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>tc,ZodDate:()=>Sf,ZodDefault:()=>v$,ZodDiscriminatedUnion:()=>c$,ZodE164:()=>gE,ZodEmail:()=>Xy,ZodEmoji:()=>tE,ZodEnum:()=>hl,ZodError:()=>Gde,ZodExactOptional:()=>bE,ZodFile:()=>m$,ZodFirstPartyTypeKind:()=>L$,ZodFunction:()=>U$,ZodGUID:()=>eE,ZodIBAN:()=>YQ,ZodIPv4:()=>cE,ZodIPv6:()=>uE,ZodISODate:()=>Co,ZodISODateTime:()=>wo,ZodISODuration:()=>ko,ZodISOTime:()=>So,ZodInstanceOf:()=>M$,ZodIntersection:()=>u$,ZodIssueCode:()=>qde,ZodJWT:()=>AE,ZodKSUID:()=>aE,ZodLazy:()=>_$,ZodLiteral:()=>h$,ZodMAC:()=>HQ,ZodMap:()=>g$,ZodNaN:()=>x$,ZodNanoID:()=>nE,ZodNever:()=>i$,ZodNonOptional:()=>vE,ZodNull:()=>e$,ZodNullable:()=>b$,ZodNumber:()=>yl,ZodNumberFormat:()=>nc,ZodObject:()=>Bf,ZodOptional:()=>xf,ZodPipe:()=>Qf,ZodPrefault:()=>w$,ZodPreprocess:()=>Q$,ZodPromise:()=>P$,ZodReadonly:()=>$$,ZodRealError:()=>rr,ZodRecord:()=>Al,ZodSet:()=>A$,ZodString:()=>ml,ZodStringFormat:()=>dt,ZodSuccess:()=>k$,ZodSymbol:()=>KQ,ZodTemplateLiteral:()=>D$,ZodTransform:()=>y$,ZodTuple:()=>d$,ZodType:()=>Oe,ZodULID:()=>sE,ZodURL:()=>Cf,ZodUUID:()=>Ji,ZodUndefined:()=>XQ,ZodUnion:()=>Rf,ZodUnknown:()=>r$,ZodVoid:()=>s$,ZodXID:()=>oE,ZodXor:()=>a$,_ZodString:()=>Ky,_default:()=>I$,_function:()=>Wz,any:()=>Bz,array:()=>kf,base64:()=>az,base64url:()=>cz,bigint:()=>Iz,boolean:()=>ZQ,catch:()=>R$,check:()=>Zz,cidrv4:()=>sz,cidrv6:()=>oz,clone:()=>st,codec:()=>qz,coerce:()=>G$,compile:()=>ax,config:()=>Nt,core:()=>Ss,creditCard:()=>lz,cuid:()=>ZV,cuid2:()=>KV,currencyCode:()=>hz,custom:()=>Kz,date:()=>xz,decode:()=>MQ,decodeAsync:()=>jQ,deepPartial:()=>dq,describe:()=>Xz,discriminatedUnion:()=>Nz,e164:()=>uz,email:()=>LV,emoji:()=>YV,encode:()=>OQ,encodeAsync:()=>LQ,endsWith:()=>il,enum:()=>yE,exactOptional:()=>E$,file:()=>jz,flattenError:()=>Gp,float32:()=>yz,float64:()=>Ez,formatError:()=>Vp,fromJSONSchema:()=>uq,function:()=>Wz,getDiscriminatedOption:()=>CB,getErrorMap:()=>Jde,globalRegistry:()=>pn,gt:()=>qi,gte:()=>Cr,guid:()=>jV,hash:()=>mz,hex:()=>Az,hostname:()=>gz,httpUrl:()=>JV,iban:()=>dz,includes:()=>nl,input:()=>fq,instanceof:()=>tq,int:()=>Wy,int32:()=>bz,int64:()=>wz,intersection:()=>l$,invertCodec:()=>Hz,ipv4:()=>nz,ipv6:()=>iz,iso:()=>Df,json:()=>rq,jwt:()=>pz,keyof:()=>Qz,ksuid:()=>tz,lazy:()=>N$,length:()=>Wa,literal:()=>Lz,locales:()=>gf,looseObject:()=>Dz,looseRecord:()=>Uz,lowercase:()=>el,lt:()=>zi,lte:()=>wr,mac:()=>rz,map:()=>Fz,maxLength:()=>Ya,maxSize:()=>Eo,memoizer:()=>uf,meta:()=>eq,mime:()=>ol,minLength:()=>Cs,minSize:()=>Hi,multipleOf:()=>yo,nan:()=>zz,nanoid:()=>WV,nativeEnum:()=>Mz,negative:()=>Oy,never:()=>mE,nonnegative:()=>Ly,nonoptional:()=>S$,nonpositive:()=>My,normalize:()=>al,null:()=>t$,nullable:()=>wf,nullish:()=>Gz,number:()=>WQ,object:()=>$z,optional:()=>Xa,output:()=>gq,overwrite:()=>hi,parse:()=>NQ,parseAsync:()=>PQ,partialRecord:()=>Pz,pipe:()=>Zy,positive:()=>Fy,prefault:()=>C$,preprocess:()=>iq,prettifyError:()=>QS,promise:()=>Yz,properties:()=>sl,property:()=>jy,readonly:()=>T$,record:()=>f$,refine:()=>F$,regex:()=>Xu,regexes:()=>Vr,registry:()=>fy,safeDecode:()=>VQ,safeDecodeAsync:()=>qQ,safeEncode:()=>GQ,safeEncodeAsync:()=>zQ,safeParse:()=>UQ,safeParseAsync:()=>FQ,set:()=>Oz,setErrorMap:()=>Hde,size:()=>Ja,slugify:()=>dl,startsWith:()=>rl,strictObject:()=>Tz,string:()=>If,stringFormat:()=>fz,stringbool:()=>nq,success:()=>Vz,superRefine:()=>O$,symbol:()=>Sz,templateLiteral:()=>Jz,toJSONSchema:()=>qy,toLowerCase:()=>ul,toUpperCase:()=>ll,toZod:()=>Dp,transform:()=>EE,treeifyError:()=>xS,trim:()=>cl,tuple:()=>p$,uint32:()=>vz,uint64:()=>Cz,ulid:()=>XV,undefined:()=>kz,union:()=>vl,unknown:()=>Ka,uppercase:()=>tl,url:()=>HV,util:()=>N,uuid:()=>GV,uuidv4:()=>VV,uuidv6:()=>zV,uuidv7:()=>qV,validate:()=>zp,validateAsync:()=>qp,void:()=>Rz,withParser:()=>gy,xid:()=>ez,xor:()=>_z});var Ss={};Xr(Ss,{$ZodAny:()=>AB,$ZodArray:()=>vB,$ZodAsyncError:()=>tr,$ZodBase64:()=>rB,$ZodBase64URL:()=>iB,$ZodBigInt:()=>ny,$ZodBigIntFormat:()=>dB,$ZodBoolean:()=>nf,$ZodCIDRv4:()=>tB,$ZodCIDRv6:()=>nB,$ZodCUID:()=>Gk,$ZodCUID2:()=>Vk,$ZodCatch:()=>MB,$ZodCheck:()=>mt,$ZodCheckBigIntFormat:()=>hk,$ZodCheckEndsWith:()=>Rk,$ZodCheckGreaterThan:()=>Mm,$ZodCheckIncludes:()=>kk,$ZodCheckLengthEquals:()=>Ik,$ZodCheckLessThan:()=>Om,$ZodCheckLowerCase:()=>Ck,$ZodCheckMaxLength:()=>bk,$ZodCheckMaxSize:()=>mk,$ZodCheckMimeType:()=>$k,$ZodCheckMinLength:()=>vk,$ZodCheckMinSize:()=>yk,$ZodCheckMultipleOf:()=>gk,$ZodCheckNumberFormat:()=>Ak,$ZodCheckOverwrite:()=>Tk,$ZodCheckProperties:()=>Qk,$ZodCheckProperty:()=>xk,$ZodCheckRegex:()=>wk,$ZodCheckSizeEquals:()=>Ek,$ZodCheckStartsWith:()=>Bk,$ZodCheckStringFormat:()=>Ju,$ZodCheckUpperCase:()=>Sk,$ZodCodec:()=>sf,$ZodCreditCard:()=>oB,$ZodCustom:()=>HB,$ZodCustomStringFormat:()=>uB,$ZodCyclicError:()=>uy,$ZodDate:()=>EB,$ZodDefault:()=>PB,$ZodDiscriminatedUnion:()=>SB,$ZodE164:()=>sB,$ZodEmail:()=>Uk,$ZodEmoji:()=>Lk,$ZodEncodeError:()=>ho,$ZodEnum:()=>QB,$ZodError:()=>RS,$ZodExactOptional:()=>_B,$ZodFile:()=>TB,$ZodFunction:()=>zB,$ZodGUID:()=>Nk,$ZodIBAN:()=>aB,$ZodIPv4:()=>Kk,$ZodIPv6:()=>Xk,$ZodISODate:()=>Yk,$ZodISODateTime:()=>Jk,$ZodISODuration:()=>Zk,$ZodISOTime:()=>Wk,$ZodIntersection:()=>kB,$ZodJWT:()=>cB,$ZodKSUID:()=>Hk,$ZodLazy:()=>of,$ZodLiteral:()=>$B,$ZodMAC:()=>eB,$ZodMap:()=>RB,$ZodNaN:()=>LB,$ZodNanoID:()=>jk,$ZodNever:()=>mB,$ZodNonOptional:()=>FB,$ZodNull:()=>gB,$ZodNullable:()=>NB,$ZodNumber:()=>ty,$ZodNumberFormat:()=>lB,$ZodObject:()=>rV,$ZodObjectJIT:()=>IB,$ZodOptional:()=>iy,$ZodPipe:()=>sy,$ZodPrefault:()=>UB,$ZodPreprocess:()=>jB,$ZodPromise:()=>qB,$ZodReadonly:()=>GB,$ZodRealError:()=>nr,$ZodRecord:()=>BB,$ZodRegistry:()=>py,$ZodSet:()=>xB,$ZodString:()=>Va,$ZodStringFormat:()=>ot,$ZodSuccess:()=>OB,$ZodSymbol:()=>pB,$ZodTemplateLiteral:()=>VB,$ZodTransform:()=>DB,$ZodTuple:()=>ry,$ZodType:()=>De,$ZodULID:()=>zk,$ZodURL:()=>Mk,$ZodUUID:()=>Pk,$ZodUndefined:()=>fB,$ZodUnion:()=>rf,$ZodUnknown:()=>hB,$ZodVoid:()=>yB,$ZodXID:()=>qk,$ZodXor:()=>wB,$brand:()=>SS,$constructor:()=>S,$input:()=>rx,$output:()=>nx,Doc:()=>Ga,INVALID:()=>Pn,JSONSchema:()=>FV,JSONSchemaGenerator:()=>Hy,NEVER:()=>CS,TimePrecision:()=>Ax,URL_BAD_FORMAT:()=>Fk,URL_UNPARSEABLE:()=>Zp,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,_any:()=>Tx,_array:()=>Ox,_base64:()=>_y,_base64url:()=>Ny,_bigint:()=>Sx,_boolean:()=>wx,_catch:()=>$de,_check:()=>IV,_cidrv4:()=>Ty,_cidrv6:()=>Dy,_coercedBigint:()=>kx,_coercedBoolean:()=>Cx,_coercedDate:()=>Ux,_coercedNumber:()=>mx,_coercedString:()=>dx,_creditCard:()=>fx,_cuid:()=>Sy,_cuid2:()=>ky,_custom:()=>Lx,_date:()=>Px,_decode:()=>Rm,_decodeAsync:()=>Qm,_default:()=>Rde,_discriminatedUnion:()=>hde,_e164:()=>Py,_email:()=>my,_emoji:()=>wy,_encode:()=>Bm,_encodeAsync:()=>xm,_endsWith:()=>il,_enum:()=>Ide,_file:()=>Mx,_float32:()=>Ex,_float64:()=>bx,_gt:()=>qi,_gte:()=>Cr,_guid:()=>yy,_iban:()=>gx,_includes:()=>nl,_int:()=>yx,_int32:()=>vx,_int64:()=>Bx,_intersection:()=>mde,_ipv4:()=>Qy,_ipv6:()=>$y,_isoDate:()=>mf,_isoDateTime:()=>hf,_isoDuration:()=>Ef,_isoTime:()=>yf,_jwt:()=>Uy,_ksuid:()=>xy,_lazy:()=>Nde,_length:()=>Wa,_literal:()=>Cde,_lowercase:()=>el,_lt:()=>zi,_lte:()=>wr,_mac:()=>px,_map:()=>bde,_max:()=>wr,_maxLength:()=>Ya,_maxSize:()=>Eo,_mime:()=>ol,_min:()=>Cr,_minLength:()=>Cs,_minSize:()=>Hi,_multipleOf:()=>yo,_nan:()=>Fx,_nanoid:()=>Cy,_nativeEnum:()=>wde,_negative:()=>Oy,_never:()=>_x,_nonnegative:()=>Ly,_nonoptional:()=>xde,_nonpositive:()=>My,_normalize:()=>al,_null:()=>$x,_nullable:()=>Bde,_number:()=>hx,_optional:()=>kde,_overwrite:()=>hi,_parse:()=>Vu,_parseAsync:()=>zu,_pipe:()=>Tde,_positive:()=>Fy,_promise:()=>Pde,_properties:()=>sl,_property:()=>jy,_readonly:()=>Dde,_record:()=>Ede,_refine:()=>jx,_regex:()=>Xu,_safeDecode:()=>Tm,_safeDecodeAsync:()=>_m,_safeEncode:()=>$m,_safeEncodeAsync:()=>Dm,_safeParse:()=>qu,_safeParseAsync:()=>Hu,_set:()=>vde,_size:()=>Ja,_slugify:()=>dl,_startsWith:()=>rl,_string:()=>lx,_stringFormat:()=>Za,_stringbool:()=>qx,_success:()=>Qde,_superRefine:()=>Gx,_symbol:()=>xx,_templateLiteral:()=>_de,_toLowerCase:()=>ul,_toUpperCase:()=>ll,_transform:()=>Sde,_trim:()=>cl,_tuple:()=>yde,_uint32:()=>Ix,_uint64:()=>Rx,_ulid:()=>By,_undefined:()=>Qx,_union:()=>gde,_unknown:()=>Dx,_uppercase:()=>tl,_url:()=>Af,_uuid:()=>Ey,_uuidv4:()=>by,_uuidv6:()=>vy,_uuidv7:()=>Iy,_void:()=>Nx,_xid:()=>Ry,_xor:()=>Ade,base64Charset:()=>Wm,base64urlCharset:()=>tf,canParseURL:()=>Ok,clone:()=>st,compile:()=>ax,compileFn:()=>Ay,config:()=>Nt,createStandardJSONSchemaMethod:()=>pl,createToJSONSchemaMethod:()=>Jx,decode:()=>Ace,decodeAsync:()=>mce,describe:()=>Vx,encode:()=>gce,encodeAsync:()=>hce,extractDefs:()=>vo,finalize:()=>Io,flattenError:()=>Gp,formatError:()=>Vp,getDiscriminatedOption:()=>CB,globalConfig:()=>nn,globalRegistry:()=>pn,handleUnrepresentable:()=>Yt,initializeContext:()=>bo,isBackEdge:()=>dy,isRecursiveSchema:()=>ly,isValidBase64:()=>ef,isValidBase64URL:()=>Zm,isValidCIDRv6:()=>Ym,isValidCreditCard:()=>Km,isValidIBAN:()=>Xm,isValidIPv6:()=>Xp,isValidJWT:()=>ey,locales:()=>gf,memoizer:()=>uf,mergeValues:()=>Yu,meta:()=>zx,parse:()=>Sm,parseAsync:()=>km,parseURLObject:()=>eV,prettifyError:()=>QS,process:()=>at,processSchema:()=>at,regexes:()=>Vr,registry:()=>fy,safeDecode:()=>Ece,safeDecodeAsync:()=>vce,safeEncode:()=>yce,safeEncodeAsync:()=>bce,safeParse:()=>uce,safeParseAsync:()=>lce,standardProps:()=>zm,stripTabAndNewline:()=>Kp,toDotPath:()=>DG,toJSONSchema:()=>qy,toZod:()=>Dp,treeifyError:()=>xS,urlHostnameOk:()=>Hm,urlProtocolOk:()=>Jm,util:()=>N,validate:()=>zp,validateAsync:()=>qp,validateURL:()=>qm,version:()=>Dk,withParser:()=>gy});var N={};Xr(N,{BIGINT_FORMAT_RANGES:()=>Fp,CONSTANT_CATCH:()=>wm,Class:()=>gS,NUMBER_FORMAT_RANGES:()=>Up,aborted:()=>Nn,allowsEval:()=>mS,assert:()=>xae,assertEqual:()=>Sae,assertIs:()=>Bae,assertNever:()=>Rae,assertNotEqual:()=>kae,assignProp:()=>dn,attachSchema:()=>Op,base64ToUint8Array:()=>BG,base64urlToUint8Array:()=>Jae,cached:()=>Mu,captureStackTrace:()=>vm,cleanEnum:()=>Hae,cleanRegex:()=>Is,clone:()=>st,cloneDef:()=>Tae,codePointLength:()=>La,constantCatch:()=>IS,createTransparentProxy:()=>Fae,defineLazy:()=>AS,defineLazyInternal:()=>Ge,derived:()=>Kae,esc:()=>_n,escapeRegex:()=>Gr,explicitlyAborted:()=>bS,extend:()=>Lae,finalizeIssue:()=>er,floatSafeRemainder:()=>_p,getElementAtPath:()=>Dae,getEnumValues:()=>Fu,getLengthableOrigin:()=>Lp,getParsedType:()=>Uae,getSizableOrigin:()=>Mp,hexToUint8Array:()=>Wae,hide:()=>jp,installLazyProp:()=>nce,isObject:()=>Ma,isPlainObject:()=>jr,issue:()=>Gu,joinValues:()=>k,jsonStringifyReplacer:()=>Ou,members:()=>vS,merge:()=>Gae,mergeDefs:()=>gi,normalizeParams:()=>q,nullish:()=>bm,numKeys:()=>Pae,objectClone:()=>Qae,omit:()=>Mae,optionalKeys:()=>ES,own:()=>Ao,parsedType:()=>U,partial:()=>Vae,pick:()=>Oae,prefixIssues:()=>Xn,primitiveTypes:()=>yS,promiseAllObject:()=>_ae,propertyKeyTypes:()=>Pp,randomString:()=>Nae,rawShape:()=>Lu,required:()=>zae,safeExtend:()=>jae,shallowClone:()=>Np,sizeCaps:()=>ju,slugify:()=>hS,stringifyPrimitive:()=>P,toZod:()=>Dp,uint8ArrayToBase64:()=>RG,uint8ArrayToBase64url:()=>Yae,uint8ArrayToHex:()=>Zae,unwrapMessage:()=>Uu});function Sae(e){return e}o(Sae,"assertEqual");function kae(e){return e}o(kae,"assertNotEqual");function Dp(){return e=>e}o(Dp,"toZod");function Bae(e){}o(Bae,"assertIs");function Rae(e){throw new Error("Unexpected value in exhaustive check")}o(Rae,"assertNever");function xae(e){}o(xae,"assert");function Fu(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}o(Fu,"getEnumValues");function k(e,t="|"){return e.map(n=>P(n)).join(t)}o(k,"joinValues");function Ou(e,t){return typeof t=="bigint"?t.toString():t}o(Ou,"jsonStringifyReplacer");var fS=class{static{o(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Mu(e){return new fS(e)}o(Mu,"cached");function bm(e){return e==null}o(bm,"nullish");function Is(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}o(Is,"cleanRegex");function _p(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}o(_p,"floatSafeRemainder");var wG=Symbol("evaluating");function AS(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==wG)return i===void 0&&(i=wG,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(AS,"defineLazy");function Qae(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(Qae,"objectClone");function dn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}o(dn,"assignProp");function Lu(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}o(Lu,"rawShape");function vs(e){return Lu(e._zod.def)??e._zod.def.shape}o(vs,"sourceShape");function CG(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return dn(this,t,i),i},enumerable:!0,configurable:!0})}o(CG,"deferProp");function SG(e,t,n){t in e?dn(e,t,n):e[t]=n}o(SG,"putProp");function Oa(e,t,n,i){let r=vs(t);for(let s of n){let a=Object.getOwnPropertyDescriptor(r,s);a.enumerable&&(a.get?CG(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):SG(e,s,i?i(a.value,s):a.value))}}o(Oa,"mirrorShape");function $ae(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?CG(e,n,()=>t[n]):SG(e,n,i.value))}}o($ae,"mirrorProps");function gi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}o(gi,"mergeDefs");function Tae(e){return gi(e._zod.def)}o(Tae,"cloneDef");function Dae(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Dae,"getElementAtPath");function _ae(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let s=0;s<t.length;s++)r[t[s]]=i[s];return r})}o(_ae,"promiseAllObject");function Nae(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Nae,"randomString");function _n(e){return JSON.stringify(e)}o(_n,"esc");function hS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(hS,"slugify");var vm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ma,"isObject");var mS=Mu(()=>{if(nn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function jr(e){if(Ma(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ma(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}o(jr,"isPlainObject");function Np(e){return jr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(Np,"shallowClone");function Pae(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(Pae,"numKeys");var Uae=o(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Pp=new Set(["string","number","symbol"]),yS=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Gr,"escapeRegex");function st(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}o(st,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function Fae(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,s){return t??(t=e()),Reflect.set(t,i,r,s)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}o(Fae,"createTransparentProxy");function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o(P,"stringifyPrimitive");function ES(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(ES,"optionalKeys");var Up={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Oae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Oa(s,e,Im(e,t)),st(e,gi(n,{shape:s,checks:[]}))}o(Oae,"pick");function Im(e,t){let n=vs(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}o(Im,"maskedKeys");function Mae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Im(e,t)),a={};return Oa(a,e,Reflect.ownKeys(vs(e)).filter(c=>!s.has(c))),st(e,gi(n,{shape:a,checks:[]}))}o(Mae,"omit");function Lae(e,t){if(!jr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=vs(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,gi(e._zod.def,{shape:kG(e,t)}))}o(Lae,"extend");function kG(e,t){let n={};return Oa(n,e,Reflect.ownKeys(vs(e))),$ae(n,t),n}o(kG,"extended");function jae(e,t){if(!jr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,gi(e._zod.def,{shape:kG(e,t)}))}o(jae,"safeExtend");function Gae(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Oa(n,e,Reflect.ownKeys(vs(e))),Oa(n,t,Reflect.ownKeys(vs(t)));let i=gi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,i)}o(Gae,"merge");function Vae(e,t,n,i="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=n?new Set(Im(t,n)):void 0,u={};return Oa(u,t,Reflect.ownKeys(vs(t)),e&&((l,p)=>c&&!c.has(p)?l:new e({type:"optional",innerType:l}))),st(t,gi(t._zod.def,{shape:u,checks:[]}))}o(Vae,"partial");function zae(e,t,n){let i=n?new Set(Im(t,n)):void 0,r={};return Oa(r,t,Reflect.ownKeys(vs(t)),(s,a)=>i&&!i.has(a)?s:new e({type:"nonoptional",innerType:s})),st(t,gi(t._zod.def,{shape:r}))}o(zae,"required");function Nn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}o(Nn,"aborted");function bS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}o(bS,"explicitlyAborted");function Xn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}o(Xn,"prefixIssues");function Uu(e){return typeof e=="string"?e:e?.message}o(Uu,"unwrapMessage");function ju(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}o(ju,"sizeCaps");function Op(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(Op,"attachSchema");function er(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Uu(e.inst?._zod.def?.error?.(e))??Uu(s?.(e))??Uu(t?.error?.(e))??Uu(n.customError?.(e))??Uu(n.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}o(er,"finalizeIssue");function Mp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Mp,"getSizableOrigin");var qae=/[\uD800-\uDBFF]/;function La(e){let t=e.length;if(!qae.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}o(La,"codePointLength");function Lp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Lp,"getLengthableOrigin");function U(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}o(U,"parsedType");function Gu(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}o(Gu,"issue");function Hae(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(Hae,"cleanEnum");function BG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}o(BG,"base64ToUint8Array");function RG(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o(RG,"uint8ArrayToBase64");function Jae(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return BG(t+n)}o(Jae,"base64urlToUint8Array");function Yae(e){return RG(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(Yae,"uint8ArrayToBase64url");function Wae(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}o(Wae,"hexToUint8Array");function Zae(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(Zae,"uint8ArrayToHex");var gS=class{static{o(this,"Class")}constructor(...t){}};function vS(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):Xae(e,n,i.value)}}o(vS,"members");function Ao(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}o(Ao,"own");function jp(e,t,n){return Ao(e,t,n,!1)}o(jp,"hide");function Kae(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ao(this,n,i(this))},set(r){Ao(this,n,r)}})}return t}o(Kae,"derived");function Xae(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ao(this,t,n.bind(this))},set(i){Ao(this,t,i)}})}o(Xae,"defineBound");function ece(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(ece,"claim");var pS,go=!1,tce={configurable:!0,get(){go=!0}};function Ge(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&pS!==e._zod){pS=void 0;return}pS=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,tce);let r=go;go=!1;try{let s=n(this);return go?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),go=go||r,s}catch(s){throw delete this[t],go=go||r,s}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}o(Ge,"defineLazyInternal");function nce(e,t,n,i){let r=ece(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:s})}})}o(nce,"installLazyProp");var wm="~constantCatch";function IS(e){let t=o(()=>e,"fn");return t[wm]=!0,t}o(IS,"constantCatch");var xG,CS=Object.freeze({status:"aborted"}),wS={value:void 0,enumerable:!1},QG="captureStackTrace"in Error?Error:null;function rce(e){let t=QG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return QG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(rce,"newError");function S(e,t,n,i){let r={};function s(A){this.def=A,this.constr=f,this.traits=new Set}o(s,"Internals"),s.prototype=r;let a=n,c=a&&new WeakSet;function u(A,h){if(A._zod){if(A._zod.traits.has(e))return}else{wS.value=new s(h);try{Object.defineProperty(A,"_zod",wS)}finally{wS.value=void 0}}if(A._zod.traits.add(e),t(A,h),c){let E=Object.getPrototypeOf(A),v=A._zod.constr.prototype,b=E;for(;b&&b!==v;)b=Object.getPrototypeOf(b);let I=b??E;c.has(I)||(c.add(I),vS(I,a))}let m=f.prototype;for(let E in m)Object.prototype.hasOwnProperty.call(m,E)&&(E in A||(A[E]=m[E].bind(A)))}o(u,"init");let l=i?.Parent??Object;class p extends l{static{o(this,"Definition")}}Object.defineProperty(p,"name",{value:e});function f(A){let h=i?.Parent?rce(p):this;u(h,A);let m=h._zod.deferred;if(m){for(let v of m)v();h._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;return E&&E(h),h}return o(f,"_"),Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:o(A=>i?.Parent&&A instanceof i.Parent?!0:A?._zod?.traits?.has(e),"value")}),Object.defineProperty(f,"name",{value:e}),f}o(S,"$constructor");var SS=Symbol("zod_brand"),tr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ho=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(xG=globalThis).__zod_globalConfig??(xG.__zod_globalConfig={});var nn=globalThis.__zod_globalConfig;function Nt(e){return e&&Object.assign(nn,e),nn}o(Nt,"config");function ice(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ou,2)),e.message}o(ice,"_getMessage");function sce(e){this._zod.message=e}o(sce,"_setMessage");var oce={get:ice,set:sce,enumerable:!0,configurable:!0},BS={value:void 0,enumerable:!1},$G=new WeakSet([Object.prototype,Error.prototype]),TG=o((e,t)=>{e.name="$ZodError",BS.value=t,Object.defineProperty(e,"issues",BS),BS.value=void 0,Object.defineProperty(e,"message",oce);let n=Object.getPrototypeOf(e);$G.has(n)||($G.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=o(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),RS=S("$ZodError",TG),nr=S("$ZodError",TG,void 0,{Parent:Error});function ace(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}o(ace,"node");function Gp(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?ace(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}o(Gp,"flattenError");function Vp(e,t=n=>n.message){let n={_errors:[]},i=o((r,s=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let p=c[l],f=l===c.length-1;if(p==="_errors"){f&&u._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,p)||Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let A=u[p];f&&A._errors.push(t(a)),u=A,l++}}}},"processError");return i(e),n}o(Vp,"formatError");function xS(e,t=n=>n.message){let n={errors:[]},i=o((r,s=[])=>{var a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else{let u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let l=n,p=0;for(;p<u.length;){let f=u[p],A=p===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,f)||Object.defineProperty(l.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[f]):(l.items??(l.items=[]),(a=l.items)[f]??(a[f]={errors:[]}),l=l.items[f]),A&&l.errors.push(t(c)),p++}}},"processError");return i(e),n}o(xS,"treeifyError");function DG(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}o(DG,"toDotPath");function QS(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${DG(i.path)}`);return t.join(`
|
|
142
|
+
`).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(Gie,"hookSummary");function Lj(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=Gie(e),n=ue().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(mu(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ue().staged.commitHookCouldNotRun(n,t):ue().staged.commitRefusedByHook(n,t)}o(Lj,"hookRefusal");var d={};Xr(d,{BRAND:()=>Ase,DIRTY:()=>ha,EMPTY_PATH:()=>Hie,INVALID:()=>Ce,NEVER:()=>Xse,OK:()=>vn,ParseStatus:()=>cn,Schema:()=>Ve,ZodAny:()=>oo,ZodArray:()=>hs,ZodBigInt:()=>ya,ZodBoolean:()=>Ea,ZodBranded:()=>ap,ZodCatch:()=>Qa,ZodDate:()=>ba,ZodDefault:()=>xa,ZodDiscriminatedUnion:()=>Yh,ZodEffects:()=>Or,ZodEnum:()=>Ba,ZodError:()=>Wn,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Zh,ZodIntersection:()=>Ca,ZodIssueCode:()=>G,ZodLazy:()=>Sa,ZodLiteral:()=>ka,ZodMap:()=>wu,ZodNaN:()=>Su,ZodNativeEnum:()=>Ra,ZodNever:()=>ui,ZodNull:()=>Ia,ZodNullable:()=>Pi,ZodNumber:()=>ma,ZodObject:()=>Zn,ZodOptional:()=>Ur,ZodParsedType:()=>re,ZodPipeline:()=>cp,ZodPromise:()=>ao,ZodReadonly:()=>$a,ZodRecord:()=>Wh,ZodSchema:()=>Ve,ZodSet:()=>Cu,ZodString:()=>so,ZodSymbol:()=>vu,ZodTransformer:()=>Or,ZodTuple:()=>Ni,ZodType:()=>Ve,ZodUndefined:()=>va,ZodUnion:()=>wa,ZodUnknown:()=>As,ZodVoid:()=>Iu,addIssueToContext:()=>X,any:()=>Cse,array:()=>Rse,bigint:()=>Ese,boolean:()=>Kj,coerce:()=>Kse,custom:()=>Yj,date:()=>bse,datetimeRegex:()=>Hj,defaultErrorMap:()=>fs,discriminatedUnion:()=>Tse,effect:()=>Vse,enum:()=>Lse,function:()=>Fse,getErrorMap:()=>yu,getParsedType:()=>_i,instanceof:()=>mse,intersection:()=>Dse,isAborted:()=>Hh,isAsync:()=>Eu,isDirty:()=>Jh,isValid:()=>io,late:()=>hse,lazy:()=>Ose,literal:()=>Mse,makeIssue:()=>op,map:()=>Pse,nan:()=>yse,nativeEnum:()=>jse,never:()=>kse,null:()=>wse,nullable:()=>qse,number:()=>Zj,object:()=>xse,objectUtil:()=>BC,oboolean:()=>Zse,onumber:()=>Wse,optional:()=>zse,ostring:()=>Yse,pipeline:()=>Jse,preprocess:()=>Hse,promise:()=>Gse,quotelessJson:()=>Vie,record:()=>Nse,set:()=>Use,setErrorMap:()=>qie,strictObject:()=>Qse,string:()=>Wj,symbol:()=>vse,transformer:()=>Vse,tuple:()=>_se,undefined:()=>Ise,union:()=>$se,unknown:()=>Sse,util:()=>Ye,void:()=>Bse});var Ye;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Ye||(Ye={}));var BC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(BC||(BC={}));var re=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=o(e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},"getParsedType");var G=Ye.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"]),Vie=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Wn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],p=u===a.path.length-1;if(l==="_errors"){p&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],p&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Wn.create=e=>new Wn(e);var zie=o((e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ye.assertNever(e)}return{message:n}},"errorMap"),fs=zie;var jj=fs;function qie(e){jj=e}o(qie,"setErrorMap");function yu(){return jj}o(yu,"getErrorMap");var op=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Hie=[];function X(e,t){let n=yu(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===fs?void 0:fs].filter(r=>!!r)});e.common.issues.push(i)}o(X,"addIssueToContext");var cn=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return Ce;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},Ce=Object.freeze({status:"aborted"}),ha=o(e=>({status:"dirty",value:e}),"DIRTY"),vn=o(e=>({status:"valid",value:e}),"OK"),Hh=o(e=>e.status==="aborted","isAborted"),Jh=o(e=>e.status==="dirty","isDirty"),io=o(e=>e.status==="valid","isValid"),Eu=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Fr=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Gj=o((e,t)=>{if(io(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Wn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Fe,"processCreateParams");var Ve=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cn,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(Eu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Gj(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return io(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>io(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(Eu(r)?r:Promise.resolve(r));return Gj(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:G.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Or({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,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),this["~standard"]={version:1,vendor:"zod",validate:o(n=>this["~validate"](n),"validate")}}optional(){return Ur.create(this,this._def)}nullable(){return Pi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hs.create(this)}promise(){return ao.create(this,this._def)}or(t){return wa.create([this,t],this._def)}and(t){return Ca.create(this,t,this._def)}transform(t){return new Or({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new xa({...Fe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new ap({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new Qa({...Fe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cp.create(this,t)}readonly(){return $a.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Jie=/^c[^\s-]{8,}$/i,Yie=/^[0-9a-z]+$/,Wie=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zie=/^[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,Kie=/^[a-z0-9_-]{21}$/i,Xie=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ese=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,tse=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nse="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",RC,rse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ise=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sse=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ose=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ase=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,cse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,zj="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",use=new RegExp(`^${zj}$`);function qj(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(qj,"timeRegexSource");function lse(e){return new RegExp(`^${qj(e)}$`)}o(lse,"timeRegex");function Hj(e){let t=`${zj}T${qj(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o(Hj,"datetimeRegex");function dse(e,t){return!!((t==="v4"||!t)&&rse.test(e)||(t==="v6"||!t)&&sse.test(e))}o(dse,"isValidIP");function pse(e,t){if(!Xie.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o(pse,"isValidJWT");function fse(e,t){return!!((t==="v4"||!t)&&ise.test(e)||(t==="v6"||!t)&&ose.test(e))}o(fse,"isValidCidr");var so=class e extends Ve{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.string,received:s.parsedType}),Ce}let i=new cn,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")tse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"email",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")RC||(RC=new RegExp(nse,"u")),RC.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"emoji",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")Zie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"uuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")Kie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"nanoid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Jie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Yie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid2",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Wie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ulid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),X(r,{validation:"url",code:G.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"regex",code:G.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Hj(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?use.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?lse(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?ese.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"duration",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?dse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ip",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?pse(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"jwt",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?fse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cidr",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?ase.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?cse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64url",code:G.invalid_string,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:G.invalid_string,...de.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...de.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...de.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}nonempty(t){return this.min(1,de.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};so.create=e=>new so({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function gse(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(gse,"floatSafeRemainder");var ma=class e extends Ve{static{o(this,"ZodNumber")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==re.number){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.number,received:s.parsedType}),Ce}let i,r=new cn;for(let s of this._def.checks)s.kind==="int"?Ye.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?gse(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_finite,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ma.create=e=>new ma({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var ya=class e extends Ve{static{o(this,"ZodBigInt")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==re.bigint)return this._getInvalidInput(t);let i,r=new cn;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};ya.create=e=>new ya({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var Ea=class extends Ve{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.boolean,received:i.parsedType}),Ce}return vn(t.data)}};Ea.create=e=>new Ea({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var ba=class e extends Ve{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.date,received:s.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_date}),Ce}let i=new cn,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};ba.create=e=>new ba({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var vu=class extends Ve{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==re.symbol){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.symbol,received:i.parsedType}),Ce}return vn(t.data)}};vu.create=e=>new vu({typeName:xe.ZodSymbol,...Fe(e)});var va=class extends Ve{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.undefined,received:i.parsedType}),Ce}return vn(t.data)}};va.create=e=>new va({typeName:xe.ZodUndefined,...Fe(e)});var Ia=class extends Ve{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==re.null){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.null,received:i.parsedType}),Ce}return vn(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodNull,...Fe(e)});var oo=class extends Ve{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return vn(t.data)}};oo.create=e=>new oo({typeName:xe.ZodAny,...Fe(e)});var As=class extends Ve{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return vn(t.data)}};As.create=e=>new As({typeName:xe.ZodUnknown,...Fe(e)});var ui=class extends Ve{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.never,received:n.parsedType}),Ce}};ui.create=e=>new ui({typeName:xe.ZodNever,...Fe(e)});var Iu=class extends Ve{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.void,received:i.parsedType}),Ce}return vn(t.data)}};Iu.create=e=>new Iu({typeName:xe.ZodVoid,...Fe(e)});var hs=class e extends Ve{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==re.array)return X(n,{code:G.invalid_type,expected:re.array,received:n.parsedType}),Ce;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(X(n,{code:a?G.too_big:G.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(X(n,{code:G.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(X(n,{code:G.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new Fr(n,a,n.path,c)))).then(a=>cn.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new Fr(n,a,n.path,c)));return cn.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}};hs.create=(e,t)=>new hs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function bu(e){if(e instanceof Zn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Ur.create(bu(i))}return new Zn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof hs?new hs({...e._def,type:bu(e.element)}):e instanceof Ur?Ur.create(bu(e.unwrap())):e instanceof Pi?Pi.create(bu(e.unwrap())):e instanceof Ni?Ni.create(e.items.map(t=>bu(t))):e}o(bu,"deepPartialify");var Zn=class e extends Ve{static{o(this,"ZodObject")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=Ye.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==re.object){let l=this._getOrReturnCtx(t);return X(l,{code:G.invalid_type,expected:re.object,received:l.parsedType}),Ce}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof ui&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let p=s[l],f=r.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new Fr(r,f,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof ui){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of c)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")c.length>0&&(X(r,{code:G.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of c){let f=r.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new Fr(r,f,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let f=await p.key,A=await p.value;l.push({key:f,value:A,alwaysSet:p.alwaysSet})}return l}).then(l=>cn.mergeObjectSync(i,l)):cn.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:de.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:xe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Ye.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Ye.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return bu(this)}partial(t){let n={};for(let i of Ye.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Ye.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Ur;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return Jj(Ye.objectKeys(this.shape))}};Zn.create=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});Zn.strictCreate=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});Zn.lazycreate=(e,t)=>new Zn({shape:e,unknownKeys:"strip",catchall:ui.create(),typeName:xe.ZodObject,...Fe(t)});var wa=class extends Ve{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Wn(c.ctx.common.issues));return X(n,{code:G.invalid_union,unionErrors:a}),Ce}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Wn(u));return X(n,{code:G.invalid_union,unionErrors:c}),Ce}}get options(){return this._def.options}};wa.create=(e,t)=>new wa({options:e,typeName:xe.ZodUnion,...Fe(t)});var gs=o(e=>e instanceof Sa?gs(e.schema):e instanceof Or?gs(e.innerType()):e instanceof ka?[e.value]:e instanceof Ba?e.options:e instanceof Ra?Ye.objectValues(e.enum):e instanceof xa?gs(e._def.innerType):e instanceof va?[void 0]:e instanceof Ia?[null]:e instanceof Ur?[void 0,...gs(e.unwrap())]:e instanceof Pi?[null,...gs(e.unwrap())]:e instanceof ap||e instanceof $a?gs(e.unwrap()):e instanceof Qa?gs(e._def.innerType):[],"getDiscriminator"),Yh=class e extends Ve{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return X(n,{code:G.invalid_type,expected:re.object,received:n.parsedType}),Ce;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=gs(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Fe(i)})}};function xC(e,t){let n=_i(e),i=_i(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&i===re.object){let r=Ye.objectKeys(t),s=Ye.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=xC(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===re.array&&i===re.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=xC(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===re.date&&i===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(xC,"mergeValues");var Ca=class extends Ve{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(Hh(s)||Hh(a))return Ce;let c=xC(s.value,a.value);return c.valid?((Jh(s)||Jh(a))&&n.dirty(),{status:n.value,value:c.data}):(X(i,{code:G.invalid_intersection_types}),Ce)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Ca.create=(e,t,n)=>new Ca({left:e,right:t,typeName:xe.ZodIntersection,...Fe(n)});var Ni=class e extends Ve{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.array)return X(i,{code:G.invalid_type,expected:re.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return X(i,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(X(i,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new Fr(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>cn.mergeArray(n,a)):cn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ni.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ni({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var Wh=class e extends Ve{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return X(i,{code:G.invalid_type,expected:re.object,received:i.parsedType}),Ce;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new Fr(i,c,i.path,c)),value:a._parse(new Fr(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?cn.mergeObjectAsync(n,r):cn.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Ve?new e({keyType:t,valueType:n,typeName:xe.ZodRecord,...Fe(i)}):new e({keyType:so.create(),valueType:t,typeName:xe.ZodRecord,...Fe(n)})}},wu=class extends Ve{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.map)return X(i,{code:G.invalid_type,expected:re.map,received:i.parsedType}),Ce;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new Fr(i,c,i.path,[l,"key"])),value:s._parse(new Fr(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}}}};wu.create=(e,t,n)=>new wu({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(n)});var Cu=class e extends Ve{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.set)return X(i,{code:G.invalid_type,expected:re.set,received:i.parsedType}),Ce;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(X(i,{code:G.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(X(i,{code:G.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let p of u){if(p.status==="aborted")return Ce;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new Fr(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Cu.create=(e,t)=>new Cu({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Zh=class e extends Ve{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return X(n,{code:G.invalid_type,expected:re.function,received:n.parsedType}),Ce;function i(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yu(),fs].filter(l=>!!l),issueData:{code:G.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,yu(),fs].filter(l=>!!l),issueData:{code:G.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof ao){let c=this;return vn(async function(...u){let l=new Wn([]),p=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),f=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(f,s).catch(h=>{throw l.addIssue(r(f,h)),l})})}else{let c=this;return vn(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Wn([i(u,l.error)]);let p=Reflect.apply(a,this,l.data),f=c._def.returns.safeParse(p,s);if(!f.success)throw new Wn([r(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ni.create(t).rest(As.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,i){return new e({args:t||Ni.create([]).rest(As.create()),returns:n||As.create(),typeName:xe.ZodFunction,...Fe(i)})}},Sa=class extends Ve{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Sa.create=(e,t)=>new Sa({getter:e,typeName:xe.ZodLazy,...Fe(t)});var ka=class extends Ve{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};ka.create=(e,t)=>new ka({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Jj(e,t){return new Ba({values:e,typeName:xe.ZodEnum,...Fe(t)})}o(Jj,"createZodEnum");var Ba=class e extends Ve{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{expected:Ye.joinValues(i),received:n.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{received:n.data,code:G.invalid_enum_value,options:i}),Ce}return vn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Ba.create=Jj;var Ra=class extends Ve{static{o(this,"ZodNativeEnum")}_parse(t){let n=Ye.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==re.string&&i.parsedType!==re.number){let r=Ye.objectValues(n);return X(i,{expected:Ye.joinValues(r),received:i.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ye.objectValues(n);return X(i,{received:i.data,code:G.invalid_enum_value,options:r}),Ce}return vn(t.data)}get enum(){return this._def.values}};Ra.create=(e,t)=>new Ra({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var ao=class extends Ve{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return X(n,{code:G.invalid_type,expected:re.promise,received:n.parsedType}),Ce;let i=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return vn(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ao.create=(e,t)=>new ao({type:e,typeName:xe.ZodPromise,...Fe(t)});var Or=class extends Ve{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{X(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ce;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"?ha(u.value):n.value==="dirty"?ha(u.value):u});{if(n.value==="aborted")return Ce;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?Ce:c.status==="dirty"?ha(c.value):n.value==="dirty"?ha(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!io(a))return Ce;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>io(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):Ce);Ye.assertNever(r)}};Or.create=(e,t,n)=>new Or({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(n)});Or.createWithPreprocess=(e,t,n)=>new Or({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(n)});var Ur=class extends Ve{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===re.undefined?vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Ur.create=(e,t)=>new Ur({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var Pi=class extends Ve{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===re.null?vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var xa=class extends Ve{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===re.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};xa.create=(e,t)=>new xa({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var Qa=class extends Ve{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return Eu(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};Qa.create=(e,t)=>new Qa({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var Su=class extends Ve{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==re.nan){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.nan,received:i.parsedType}),Ce}return{status:"valid",value:t.data}}};Su.create=e=>new Su({typeName:xe.ZodNaN,...Fe(e)});var Ase=Symbol("zod_brand"),ap=class extends Ve{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},cp=class e extends Ve{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),ha(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ce:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:xe.ZodPipeline})}},$a=class extends Ve{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(io(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return Eu(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};$a.create=(e,t)=>new $a({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function Vj(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(Vj,"cleanParams");function Yj(e,t={},n){return e?oo.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=Vj(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=Vj(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):oo.create()}o(Yj,"custom");var hse={object:Zn.lazycreate},xe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(xe||(xe={}));var mse=o((e,t={message:`Input not instance of ${e.name}`})=>Yj(n=>n instanceof e,t),"instanceOfType"),Wj=so.create,Zj=ma.create,yse=Su.create,Ese=ya.create,Kj=Ea.create,bse=ba.create,vse=vu.create,Ise=va.create,wse=Ia.create,Cse=oo.create,Sse=As.create,kse=ui.create,Bse=Iu.create,Rse=hs.create,xse=Zn.create,Qse=Zn.strictCreate,$se=wa.create,Tse=Yh.create,Dse=Ca.create,_se=Ni.create,Nse=Wh.create,Pse=wu.create,Use=Cu.create,Fse=Zh.create,Ose=Sa.create,Mse=ka.create,Lse=Ba.create,jse=Ra.create,Gse=ao.create,Vse=Or.create,zse=Ur.create,qse=Pi.create,Hse=Or.createWithPreprocess,Jse=cp.create,Yse=o(()=>Wj().optional(),"ostring"),Wse=o(()=>Zj().optional(),"onumber"),Zse=o(()=>Kj().optional(),"oboolean"),Kse={string:o((e=>so.create({...e,coerce:!0})),"string"),number:o((e=>ma.create({...e,coerce:!0})),"number"),boolean:o((e=>Ea.create({...e,coerce:!0})),"boolean"),bigint:o((e=>ya.create({...e,coerce:!0})),"bigint"),date:o((e=>ba.create({...e,coerce:!0})),"date")};var Xse=Ce;var up=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(up||{}),QC=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(QC||{});var Kh=300,$t=d.string().trim().min(1),eoe=d.object({action:d.enum(["start","run","wait"]),text:$t,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:$t.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),lp=/^[A-Za-z_][A-Za-z0-9_]*$/,li=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,ku=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(ku||{}),Ui="shared",toe=$t.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Bu=d.object({address:toe,readyWhen:$t.nullable(),credentials:d.array(d.string().regex(li)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(ku),detail:$t.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array($t).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),$C={steps:d.array(eoe).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:$t,service:$t.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(lp)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},TC=d.object({name:$t,repository:$t.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...$C,deployed:$t.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),noe=d.object({name:d.string().regex(li).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:$t.max(Kh).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),roe=d.object({component:$t,problem:$t,evidence:$t.describe("the exact command and output that shows it"),fix:$t.describe("what the user must provide, and where")}),ioe=d.object({framework:$t,file:$t.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),soe=d.object({input:$t.describe("the part of the user's SUT input, as given"),reason:$t}),KBe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(QC).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(TC),suites:d.array(ioe).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array($t).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:$t.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:$t.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(soe).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(roe).describe("required (non-empty) when status is blocked"),inputs:d.array(noe).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),environment:Bu.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var DC=64*1024,_C=512*1024,Xj=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var Fi=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Fi||{}),di=d.string().trim().min(1),ooe=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:di.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),NC=d.array(d.object({component:di.describe("a shared component listed above"),url:di.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:di.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),aoe=d.object({name:di.describe("the credential's environment variable name, as listed above; never its value"),component:di.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:di.describe("the request or command you tested it with and what came back, never the value")}),e1=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:ooe.optional(),teardown:di.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(Fi).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:di,output:di}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:di.describe("ISO timestamp"),revisions:NC.optional(),missingSecrets:d.array(d.string().regex(lp)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(aoe).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var x1=require("node:crypto");var Ta=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Ta||{});var PC=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var dp=/^pasted-[0-9a-f]{16}$/,ms=/^file-[0-9a-f]{16}$/,pp=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(pp||{}),Da=o(e=>e.trim().toUpperCase(),"normalKey"),t1=o((e,t)=>{let n=e.trim();return dp.test(n.toLowerCase())?"Pasted text":ms.test(n.toLowerCase())?t?.get(Da(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var Xh=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xh||{}),Oi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(Oi||{}),Ru=(b=>(b.RelatedChangeConflict="related_change_conflict",b.ReferenceOutsideTarget="reference_outside_target",b.SourceAccessLost="source_access_lost",b.ConfigurationIncomplete="configuration_incomplete",b.CredentialUnavailable="credential_unavailable",b.WorkflowBindingUnverified="workflow_binding_unverified",b.WorkflowRefUnprotected="workflow_ref_unprotected",b.BedrockWorkflowRequired="bedrock_workflow_required",b.DeploymentReview="deployment_review",b.SutRevisionMismatch="sut_revision_mismatch",b.IsolationUnavailable="isolation_unavailable",b.EvidenceInsufficient="evidence_insufficient",b.ConfigurationUnresolved="configuration_unresolved",b.ModelProviderDenied="model_provider_denied",b.ModelProviderUnavailable="model_provider_unavailable",b.RunnerProviderNotReady="runner_provider_not_ready",b.MergeConflict="merge_conflict",b))(Ru||{}),co=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(co||{}),fp=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(fp||{}),gp=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(gp||{});var em=(n=>(n.Probe="probe",n.Agent="agent",n))(em||{}),Ap=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(Ap||{}),tm=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(tm||{});function nm(e){return e==="failed"?2:e==="unknown"?1:0}o(nm,"cleanupShortfall");var hp=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(hp||{}),Mi=d.string().trim().min(1),coe=d.object({case:Mi.describe("recommend id this assertion enforces"),evidence:Mi.describe("the exact assertion line from the file that checks that case's observable")});var n1=d.object({route:d.literal("persistence"),url:d.string().url()}).strict(),mp=d.object({kind:d.nativeEnum(Ap).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Mi.describe("the dependency, endpoint or data it affects"),mechanism:d.nativeEnum(tm).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Mi.describe("what it sets up"),worker:Mi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:n1.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Mi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Mi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),uoe=d.object({file:Mi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum(hp),language:Mi,covers:d.array(d.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:d.array(coe).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(mp).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),UC=d.object({schemaVersion:d.literal(1),tests:d.array(uoe),deferredUi:d.array(d.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Mi.describe("one paragraph")});var ys=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(ys||{}),Tn=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(Tn||{}),$n=d.string().trim().min(1),FC=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(FC||{}),rm=d.object({kind:d.nativeEnum(FC),reason:$n.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),yp=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),r1=d.object({case:$n.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(Tn),runtimeTargets:yp.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:$n.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:d.boolean().optional(),testProblem:rm.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:d.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:d.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),i1=d.object({started:d.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(r1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),s1=d.object({context:d.array(mp).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:d.string().optional().describe("staged path \u2014 required for placements"),file:$n.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:$n.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(ys),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:$n.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:$n.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:i1,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:d.array($n).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:d.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),o1=(n=>(n.Junit="junit",n.Converter="converter",n))(o1||{}),loe=$n.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),doe=d.object({results:$n.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(o1),run:$n.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array($n).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:$n.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:$n.describe("the covers id it realizes"),file:loe})).describe("map each reported test name to the case it covers")}),poe=d.object({suites:d.array(doe).min(1)}),OC=d.object({schemaVersion:d.literal(1),items:d.array(s1),runnerResults:poe.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:$n.describe("one paragraph")});hu();SC();function a1(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(a1,"credentialKeyFromRole");var c1=ee(require("path"));var un=d.string().trim().min(1),im=un,MC=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(MC||{}),LC=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],u1=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(MC).optional(),repository:im.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:Bu.optional(),components:d.array(d.object({name:un,repository:un.describe(`owner/repo, or "${Ui}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...$C,credentials:d.array(d.string().regex(li)).max(50).optional(),deployed:un.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:un,file:un,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(un),inputsUsedHow:d.array(d.object({input:un,how:un}).strict()).optional(),inputsNotUsed:d.array(d.object({input:un,reason:un}).strict()),blockers:d.array(d.object({component:un,problem:un,evidence:un,fix:un}).strict()),replay:d.object({outcome:un,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:un,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Ui&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${Ui}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{LC.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==Ui&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var CRe=["clean","recipe-drift"];function Ep(e){let t=c1.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(Ep,"isRuntimePlanFile");var bp=d.string().uuid(),vp=d.object({environmentId:d.string().uuid(),allowed:d.boolean(),revision:bp,updatedAt:d.string().datetime(),updatedBy:d.string().uuid()}).strict();var Ip=(a=>(a.NoEnvironment="no_environment",a.NoRecordedGrant="no_recorded_grant",a.Unavailable="unavailable",a.Changed="changed",a.Denied="denied",a.OutOfScope="out_of_scope",a))(Ip||{});function wp(e){switch(e){case"no_environment":return"the run has no selected Test Environment address";case"no_recorded_grant":return"the run's configuration did not record permission to keep test data in this environment";case"unavailable":return"the current permission to keep test data could not be read";case"changed":return"the permission to keep test data changed after the run started";case"denied":return"the environment does not permit test data to stay";case"out_of_scope":return"the request is outside the environment's address"}}o(wp,"persistenceRefusalText");function sm(e,t,n){let i=vp.safeParse(t);return!i.success||!i.data.allowed||!e.environmentId||i.data.environmentId!==e.environmentId||!e.environmentAddress||e.persistentDataPolicy&&e.persistentDataPolicy.revision!==i.data.revision?!1:uo(e.environmentAddress,n)}o(sm,"persistentDataPolicyApplies");function uo(e,t){try{let n=new URL(t),i=new URL(e);if(i.search||i.hash)return!1;let r=/%(?:2f|5c|2e|25)/i;if(t.includes("\\")||e.includes("\\")||r.test(n.pathname)||r.test(i.pathname))return!1;let s=i.pathname.replace(/\/$/,"");return["https:","http:"].includes(i.protocol)&&n.origin===i.origin&&(n.pathname===s||n.pathname.startsWith(`${s}/`))}catch{return!1}}o(uo,"environmentContainsUrl");var jC="delivery-persistence.json",l1=d.object({environmentId:d.string().uuid(),environmentAddress:d.string().url(),revision:bp}).strict(),d1=d.object({refusal:d.nativeEnum(Ip)}).strict();var Q1=d.unknown().optional(),$1={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",persistentDataPolicy:"/api/v1/runner/attempts/:attemptId/persistent-data-policy",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",runEvents:"/api/v1/runner/attempts/:attemptId/run-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file",deployedRevisions:"/api/v1/runner/attempts/:attemptId/deployed-revisions"},Na=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Na||{}),dm=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(dm||{}),pm=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(pm||{}),foe=["sut_setup"],goe=["sut_setup","schedule","revision_read"],Aoe=["sut_setup"],qC=(t=>(t.PullRequest="pull_request",t))(qC||{}),HC=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(HC||{}),p1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var fm=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(fm||{}),kp=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(kp||{}),T1=(n=>(n.Running="running",n.Ended="ended",n))(T1||{}),Bp=(A=>(A.TimedOut="timed_out",A.AgentFailed="agent_failed",A.SetupFailed="setup_failed",A.CredentialMissing="credential_missing",A.RunnerLost="runner_lost",A.CheckoutFailed="checkout_failed",A.EnvironmentUnverified="environment_unverified",A.ModelProviderDenied="model_provider_denied",A.ModelProviderUnavailable="model_provider_unavailable",A.RunnerProviderNotReady="runner_provider_not_ready",A.MergeConflict="merge_conflict",A.EnvironmentUnavailable="environment_unavailable",A))(Bp||{}),D1=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(D1||{}),JC=(n=>(n.Started="started",n.Finished="finished",n))(JC||{}),_1=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(_1||{});var N1=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(N1||{});var P1=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(P1||{}),YC=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(YC||{}),GC=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(GC||{});var WC=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(WC||{}),Mr=d.string().regex(/^[1-9][0-9]{0,18}$/),Lr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),VC=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function U1(e,t){return`${e.replace(/\/+$/,"")}/runs/${t}`}o(U1,"skyrampRunPageUrl");var In=d.string().regex(Tu),Dn=d.string().regex(/^[0-9a-f]{64}$/),lm=d.object({id:In,revision:Mr}).strict(),gm={provider:d.literal("github"),providerAccountId:Mr,providerRepositoryId:Mr},Am={provider:d.literal("azure-devops"),providerAccountId:In,providerRepositoryId:In},vr=d.discriminatedUnion("provider",[d.object(gm).strict(),d.object(Am).strict()]),ZC=d.discriminatedUnion("provider",[d.object(gm).passthrough(),d.object(Am).passthrough()]),ji=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),f1={namespace:d.string().min(1),name:d.string().min(1)},F1=d.discriminatedUnion("provider",[d.object({...gm,...f1}).strict(),d.object({...Am,...f1}).strict()]),g1=d.object({ref:d.string().min(1),revision:Lr}).strict(),hoe=d.object({kind:d.nativeEnum(HC),number:Mr.optional(),ref:d.string().min(1),revision:Lr,reason:d.nativeEnum(dm)}).strict(),moe=d.object({repository:F1,revision:Lr,ref:d.string().nullable(),reason:d.nativeEnum(dm),change:d.object({kind:d.nativeEnum(qC),number:Mr,base:g1.optional()}).strict().nullable(),compareWith:g1.optional(),merge:d.array(hoe).min(2).optional()}).strict();function yoe(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!p1.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=p1.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(yoe,"mergedSourceIssue");function Eoe(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>ji(l.repository))),c=new Set(r.map(l=>ji(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Eoe,"baselineSourcesIssue");var O1=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,M1=/^[1-9][0-9]{0,18}$/,A1=new RegExp(`${O1.source}|${M1.source}`),h1=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,boe=d.union([d.object({source:d.literal("jira"),site:d.string().regex(h1),key:d.string().regex(O1),updated:d.string().datetime(),contentHash:Dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(h1),key:d.string().regex(M1),version:d.number().int().positive(),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),contentHash:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict()]),m1=d.union([d.literal("jira"),d.literal("confluence")]),voe=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:m1,site:d.string(),key:d.string().regex(A1),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:m1,site:d.string(),key:d.string().regex(A1),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),state:d.literal("read"),version:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(ms),state:d.literal("not_read"),reason:d.nativeEnum(Ta)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Ioe=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),woe=d.object({schemaVersion:d.literal(1),runId:In,skyrampOrgId:In,target:lm,policy:lm.nullable(),trigger:d.object({kind:d.nativeEnum(pm),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:In,revision:Mr.nullable(),hash:Dn}).strict(),baseline:d.object({confirmedRunId:In.nullable(),initialBaselineId:In.optional(),comparisonBaselineId:In.optional(),knownFailures:d.array(Ioe).optional(),sources:d.array(d.object({repository:vr,revision:Lr}).strict()).optional()}).strict().optional(),sources:d.array(moe).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Na),repository:F1,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(up),required:d.boolean()}).strict()),requirements:d.array(boe).min(1).optional(),instructions:d.object({contentHash:Dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let p="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${p}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let f=PC({source:u.source,key:u.key});n.has(f)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(f)});let i=e.trigger.kind,r=foe.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Eoe(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),goe.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>ji(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let p=ji(u.repository);a.has(p)?c.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(p)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let p=yoe(u);p&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...p.path],message:p.message})})});var KC=(n=>(n.Person="person",n.Policy="policy",n))(KC||{}),Coe=d.object({kind:d.nativeEnum(KC),name:d.string().min(1).max(256)}).strict(),Soe=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),koe=d.object({schemaVersion:d.literal(1),attempt:d.object({id:In,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:woe,manifestHash:Dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Coe.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).optional(),statedRevisions:d.array(d.object({repository:vr,revision:Lr}).strict()).optional(),runSettings:Soe.optional()}).strict(),y1={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Boe=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),Roe=d.object({schemaVersion:d.literal(1),runId:In,execution:d.discriminatedUnion("provider",[d.object({...y1,provider:d.literal("github"),repository:d.object(gm).strict(),providerRunId:Mr}).strict(),d.object({...y1,provider:d.literal("azure-devops"),repository:d.object(Am).strict(),providerRunId:Boe}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional(),credentialKinds:d.literal(!0).optional()}).strict(),E1=d.object({repository:vr,number:Mr,commitSha:Lr.optional()}).strict(),om=d.array(d.object({repository:vr,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),L1=d.object({branch:VC.optional(),commitSha:Lr.optional()}).strict(),hm=4096,j1=d.array(d.object({file:d.string().max(4096).regex(/\S/),dependsOn:d.array(d.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),b1=d.object({repository:vr,message:d.string().max(hm),...L1.shape,heldBack:j1.optional()}).strict(),xoe=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:om}).strict(),d.object({status:d.literal("delivered"),noTests:om,pullRequests:d.array(E1).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:om,pullRequests:d.array(E1).min(1),failures:d.array(b1).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string().max(hm),noTests:om,failures:d.array(b1).min(1).optional()}).strict()]),XC=1024*1024,G1=16*1024*1024,Cp={id:4096,text:16384,businessCase:65536},Rp={id:Cp.id,statement:Cp.text,rows:1e3},v1=d.string().min(1).max(Cp.id),cm=d.string().max(Cp.text),am=o((e,t)=>d.array(d.object({[e]:cm}).strict()).max(t).optional(),"texts"),eS=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string().max(Cp.businessCase),validation:d.object({rationale:cm.min(1),gaps:d.array(d.string().min(1).max(4096)).max(200)}).strict().optional(),changes:d.array(d.object({id:v1,text:cm}).strict()).max(1e3).optional(),requirements:d.array(d.object({id:v1,statement:cm}).strict()).max(Rp.rows).optional(),issuesFound:am("description",5e3),newTestsCreated:am("description",5e3),testResults:am("details",5e3),caveats:am("text",100)}).strict(),Qoe=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(Oi),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(co),repository:d.string().min(1),revision:Lr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(Ru))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),um=500,V1=2048,z1=1e3,$oe=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,I1=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!$oe.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),q1=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&I1(n)&&I1(i)},"isResultRepository"),Toe=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(q1,"Invalid"),testType:d.string(),runtimeTargets:yp.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(fp),family:d.nativeEnum(gp).optional()}).strict().optional(),origin:d.nativeEnum(Xh).optional()}).strict()),validation:Qoe,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(V1),testedBy:d.array(d.string().min(1).max(1024)).max(um),writtenBy:d.array(d.string().min(1).max(1024)).max(um),maintainedBy:d.array(d.string().min(1).max(1024)).max(um)}).strict()).max(z1).optional(),traceVersion:d.literal(1),display:eS.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),w1=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function tS(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${w1(a)}`;return i?`${c}#${w1(i)}`:c}o(tS,"testResultId");var mm=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(mm||{}),H1=50,J1=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:vr,branch:VC,commit:Lr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:vr,number:Mr,branch:VC}).strict()]),Doe=100,_oe=2048,FRe=d.object({records:d.array(d.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(_oe)).max(Doe),unlisted:d.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),Y1=d.object({schemaVersion:d.literal(1),run:d.object({runId:In,attemptNumber:d.number().int().positive(),manifestHash:Dn}).strict(),target:lm,policy:lm,provenance:d.object({sources:d.array(d.object({repository:vr,revision:Lr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:xoe}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Toe,githubWrites:d.array(J1).max(H1).optional()}).strict(),nS=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(nS||{}),rS=200,Noe=d.object({cause:d.nativeEnum(nS),credential:d.string().regex(li).optional(),reason:d.string().trim().min(1).max(rS).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),Poe=d.object({name:d.string().regex(li),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Kh)}).strict(),ORe=Y1.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:u1,check:Noe.optional(),inputs:d.array(Poe).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{Ep(s.path)||n(["files",a,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),Xj.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>DC&&n(["files",a,"content"],`larger than ${DC} bytes`)}),r>_C&&n(["files"],`recipe text over ${_C} bytes in total`)}),MRe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(q1,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(em),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function W1(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(W1,"readsDeployedState");var Uoe=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(D1),event:d.nativeEnum(JC),status:d.nativeEnum(_1).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),ym=100,Foe=5e3,_a=2e3,C1=100,Z1=/^[A-Za-z0-9_-]{1,64}$/,Ooe=20,Moe=200,Loe=100,joe=100,Goe=200,S1="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Voe=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${S1}/${S1})$`),zoe=500,k1=50,qoe=10,Hoe=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,K1=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,br=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!K1.test(t),"blank, or not text"),"setupText"),Li={sequence:d.number().int().min(1).max(Foe),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},X1=d.object({...Li,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(P1),accepted:d.boolean(),text:br(_a),note:d.object({source:d.enum(["target","environment"]),quote:br(_a)}).strict().optional(),kept:br(_a).optional()}).strict();function eG(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(eG,"checkReply");var Joe=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),phase:d.nativeEnum(YC),text:br(_a)}).strict(),d.object({...Li,kind:d.literal("component"),name:br(C1),repository:br(Goe).refine(e=>Voe.test(e)||e===Ui,"not owner/name"),file:br(zoe).nullable(),status:d.nativeEnum(WC),version:br(joe).optional()}).strict(),X1,d.object({...Li,kind:d.literal("question"),id:d.string().regex(Z1),type:d.nativeEnum(N1),text:br(_a),component:br(C1).nullable(),choices:d.array(br(Moe)).max(Ooe),placeholder:br(Loe).optional()}).strict(),d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("credentials"),names:d.array(d.string().regex(li)).min(1).max(k1),logins:d.array(d.object({key:d.string().regex(Hoe),usernameVariable:d.string().regex(li),passwordVariable:d.string().regex(li)}).strict()).min(1).max(qoe).optional(),variables:d.array(d.string().regex(li)).min(1).max(k1).optional()}).strict()]).superRefine((e,t)=>{if(eG(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>a1(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:d.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),Yoe=d.object({schemaVersion:d.literal(1),events:d.array(Joe).max(ym)}).strict(),Woe=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),stage:d.nativeEnum(GC),text:br(_a)}).strict(),X1,d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("stage"),stage:d.nativeEnum(GC),event:d.nativeEnum(JC)}).strict(),d.object({...Li,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(_a).refine(e=>!K1.test(e),"not text")}).strict()]).superRefine(eG),Zoe=d.object({schemaVersion:d.literal(1),events:d.array(Woe).max(ym)}).strict(),B1={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},tG=d.discriminatedUnion("kind",[d.object({...B1,kind:d.literal("instruction"),question:d.null()}),d.object({...B1,kind:d.literal("answer"),question:d.string().regex(Z1)})]),nG=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),Koe=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),Xoe=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(tG).optional(),stop:d.object({key:nG}).optional(),notes:Koe.optional()}),eae=d.object({schemaVersion:d.literal(1),messages:d.array(tG).optional()});var tae=500*1024*1024,rG=d.object({id:Mr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Mr,expiresAt:d.string().datetime()}).strict(),nae=d.object({schemaVersion:d.literal(1),artifact:rG,sessionId:In,contentHash:Dn,bytes:d.number().int().min(1).max(tae)}).strict(),rae=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:rG,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:In,contentHash:Dn,key:nG}).strict().nullable()}).strict(),iae=200,xu=100,iG=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(iG||{}),sae=d.object({kind:d.nativeEnum(iG),setup:d.object({runId:In,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(WC)}).strict()).max(xu),credentials:d.array(d.string().min(1)).max(xu),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(xu),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(xu),log:d.array(d.object({phase:d.nativeEnum(YC),text:d.string()}).strict()).max(iae),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(xu),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(xu)}).strict().optional()}).strict(),oae=d.object({schemaVersion:d.literal(1),context:sae.nullable()}).strict(),aae=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:In,revision:Mr.nullable(),hash:Dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional(),environmentId:d.string().uuid().optional(),persistentDataPolicy:Q1}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:Dn}).strict()}).strict(),sG=d.object({schemaVersion:d.literal(1),environmentId:d.string().uuid().nullable(),environmentAddress:d.string().url().nullable(),persistentDataPolicy:vp.nullable()}).strict(),cae=Bu.extend({environmentId:d.string().uuid().optional(),persistentDataPolicy:Q1,version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:Dn.optional(),files:d.array(d.object({path:d.string().refine(e=>Ep(e)&&!LC.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),uae=d.object({schemaVersion:d.literal(1),testEnvironment:cae.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:Dn,files:d.array(d.object({path:d.string().refine(Ep,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:im.optional(),recipeRepository:im.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),oG=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(T1),ending:d.nativeEnum(kp).nullable(),cause:d.nativeEnum(Bp).nullable(),deadlineAt:d.string().datetime()}).strict();function aG(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(aG,"attemptClosure");var cG=50,LRe=d.object({repository:vr,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(cG)}).strict();function zC(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(zC).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${zC(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(zC,"canonicalJson");function uG(e){return(0,x1.createHash)("sha256").update(zC(e),"utf8").digest("hex")}o(uG,"manifestHash");var Qu=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function iS(e,t,{statedPins:n=!0,credentialKinds:i=!0}={}){return Roe.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{},...i?{credentialKinds:!0}:{}})}o(iS,"handshakeRequest");function lG(e){let t=koe.parse(e);if(uG(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(lG,"parseHandshakeResponse");function lae(e){let t=o(r=>r.map(s=>({repository:Qu(s.repository),number:s.number,...s.commitSha===void 0?{}:{commitSha:s.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(r=>({repository:Qu(r.repository),reason:r.reason}))}:{};if(e.status==="delivered")return{status:e.status,...n,pullRequests:t(e.pullRequests)};let i=o(r=>r.map(s=>({repository:Qu(s.repository),message:s.message,...s.branch===void 0?{}:{branch:s.branch},...s.commitSha===void 0?{}:{commitSha:s.commitSha},...s.heldBack===void 0?{}:{heldBack:s.heldBack}})),"failures");return e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:i(e.failures)}:e.status==="failed"&&e.failures?{...e,...n,failures:i(e.failures)}:{...e,...n}}o(lae,"toDelivery");function dae(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(dae,"describeIssues");function dG(e){let{manifest:t}=e;if(Aoe.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=Y1.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:uG(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:Qu(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:lae(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:Qu(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${dae(n.error)}`);return pae(n.data,t,e.checkedOut),n.data}o(dG,"buildReportUpload");function pae(e,t,n){let i=o(s=>n.find(a=>ji(a.repository)===ji(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(pae,"assertEvidenceFromSnapshot");function pG(e){if(e.reportUploaded)return{schemaVersion:1,reason:"report_uploaded",cause:null};if(e.recipeUploaded)return{schemaVersion:1,reason:"recipe_uploaded",cause:null};if(e.revisionsUploaded)return{schemaVersion:1,reason:"revisions_uploaded",cause:null};let t=e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:Qu(i.repository)}))}:{},n=e.sharedEnvironmentRecords?{sharedEnvironmentRecords:e.sharedEnvironmentRecords}:{};return e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null,...t,...n}:e.mergeConflict&&R1(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict,...t,...n}:{schemaVersion:1,reason:"no_report",cause:R1({...e,mergeConflict:void 0}),...t,...n}}o(pG,"attemptEndFor");function R1(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":e.environmentUnavailable?"environment_unavailable":"agent_failed"}o(R1,"noReportCause");var YRe=["clean","recipe-drift"];var lo=ee(require("path"));var XRe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var sS=o(e=>new Map((e??[]).flatMap(t=>t.file?[[Da(t.key),t.file.name]]:[])),"itemNames"),Aae=10*1024*1024,gG=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),AG=o((e,t)=>lo.join(lo.dirname(e),`${lo.basename(e,lo.extname(e))}${t}`),"besideFile"),hG=o(e=>AG(e,".extracted.txt"),"extractedTextPath");var hae=o(e=>AG(e,".quotes.txt"),"confirmedQuotesPath");function mG(e){return gG(e.file)?hG(e.path):e.file?.mediaType==="application/pdf"?hae(e.path):e.path}o(mG,"itemTextPath");var xp=ee(require("fs")),Pa=ee(require("path"));var mae=8;function ln(e,t,n={}){let i=t.slice(0,mae),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}o(ln,"fail");function Gi(e){if(xp.existsSync(e))try{return JSON.parse(xp.readFileSync(e,"utf-8"))}catch{return}}o(Gi,"readJsonFile");function ve(e,t){return Gi(Pa.join(e.outputsDir,t))}o(ve,"readArtifact");function Kn(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:ln(this.name,r,{fatal:!0})}}}o(Kn,"schemaGate");function Vi(e,t){return Pa.relative(e,Pa.resolve(e,t)).replace(/\/+$/,"")}o(Vi,"relNorm");function Qp(e){return e.replace(/\s+/g," ").trim()}o(Qp,"normalizeCode");var $p=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");function _t(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(_t,"codeSpan");var yG=ee(require("path"));var oS="outputs/preflight.json",Ua="pr-diff.txt",aS="related-diffs";function cS(e){return yG.join(aS,`${e.toLowerCase().replace(/\//g,"__").replace(/[^a-z0-9._-]/g,"_")}.diff`)}o(cS,"relatedDiffArtifact");var Es=ee(require("path"));var Tp=ee(require("path"));var po="Skyramp Testbot",Fa="test-bot@skyramp.dev";var Du=o(e=>e.slice(0,12),"shortCommit");var yae=o((e,t)=>Vt(t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function EG(e){let t="";try{t=yae(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${Tp.basename(Tp.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(EG,"repositorySlug");var vxe=new Set(Object.values(co));var Ixe=d.object({checks:d.array(d.object({repository:d.string().optional(),name:d.string().min(1),headSha:d.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:d.string().default("completed"),conclusion:d.string().nullable().optional(),url:d.string().optional(),summary:d.string().optional()}))});var Eae=["generate-unit","native-run"],kxe=["preflight","plan","write",...Eae,"report","deliver"];var Em=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(Em||{}),bae=Object.values(Em);var bG=8e3;function vG(e,t){return(e.contextRepositories??[]).some(n=>pi(n,t))}o(vG,"pinnedForContext");var uS=new Map;function Iae(e){return e.repositorySlug?e.repositorySlug:(uS.has(e.repositoryPath)||uS.set(e.repositoryPath,EG(e.repositoryPath)),uS.get(e.repositoryPath))}o(Iae,"workingSlug");function Jt(e){let t=Iae(e);return[{slug:t,path:e.repositoryPath,writable:!vG(e,t),working:!0},...(e.relatedRepos??[]).map(n=>({slug:n.slug,path:n.path,writable:n.writable===!0,working:!1}))]}o(Jt,"runSources");var pi=o((e,t)=>e.toLowerCase()===t.toLowerCase(),"sameSlug");function _u(e,t){return t?.trim()?e.find(n=>pi(n.slug,t.trim())):e[0]}o(_u,"findSource");function Ir(e,t){return _u(Jt(e),t)}o(Ir,"resolveSource");var wae=o((e,t)=>`${t} is not a repository of this run (${Jt(e).map(n=>n.slug).join(", ")})`,"notARepository");function bs(e,t){let n=Ir(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${Jt(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:wae(e,t)}}o(bs,"writableSource");function fi(e,t){return IG(Jt(e),t)}o(fi,"checkoutLabel");var lS=o(e=>Es.basename(Es.resolve(e.path)),"relatedDirName");function IG(e,t){return e.length<2?"":`${_u(e,t)?.slug??t}: `}o(IG,"labelAmong");var Mxe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var Pu=o(e=>!!e.inputs?.scheduledValidation?.comparisonBaselineId,"retestsKnownFailures");var hb=ee(require("fs")),Tt=ee(require("path"));var kr=ee(require("fs")),Iq=require("child_process"),wq=require("module"),Cq=ee(require("os")),yi=ee(require("path"));var pe={};Xr(pe,{$brand:()=>SS,$input:()=>rx,$output:()=>nx,INVALID:()=>Pn,NEVER:()=>CS,TimePrecision:()=>Ax,ZodAny:()=>n$,ZodArray:()=>o$,ZodBase64:()=>pE,ZodBase64URL:()=>fE,ZodBigInt:()=>bl,ZodBigIntFormat:()=>hE,ZodBoolean:()=>El,ZodCIDRv4:()=>lE,ZodCIDRv6:()=>dE,ZodCUID:()=>rE,ZodCUID2:()=>iE,ZodCatch:()=>B$,ZodCodec:()=>$f,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,ZodCreditCard:()=>JQ,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>tc,ZodDate:()=>Sf,ZodDefault:()=>v$,ZodDiscriminatedUnion:()=>c$,ZodE164:()=>gE,ZodEmail:()=>Xy,ZodEmoji:()=>tE,ZodEnum:()=>hl,ZodError:()=>Gde,ZodExactOptional:()=>bE,ZodFile:()=>m$,ZodFirstPartyTypeKind:()=>L$,ZodFunction:()=>U$,ZodGUID:()=>eE,ZodIBAN:()=>YQ,ZodIPv4:()=>cE,ZodIPv6:()=>uE,ZodISODate:()=>Co,ZodISODateTime:()=>wo,ZodISODuration:()=>ko,ZodISOTime:()=>So,ZodInstanceOf:()=>M$,ZodIntersection:()=>u$,ZodIssueCode:()=>qde,ZodJWT:()=>AE,ZodKSUID:()=>aE,ZodLazy:()=>_$,ZodLiteral:()=>h$,ZodMAC:()=>HQ,ZodMap:()=>g$,ZodNaN:()=>x$,ZodNanoID:()=>nE,ZodNever:()=>i$,ZodNonOptional:()=>vE,ZodNull:()=>e$,ZodNullable:()=>b$,ZodNumber:()=>yl,ZodNumberFormat:()=>nc,ZodObject:()=>Bf,ZodOptional:()=>xf,ZodPipe:()=>Qf,ZodPrefault:()=>w$,ZodPreprocess:()=>Q$,ZodPromise:()=>P$,ZodReadonly:()=>$$,ZodRealError:()=>rr,ZodRecord:()=>Al,ZodSet:()=>A$,ZodString:()=>ml,ZodStringFormat:()=>dt,ZodSuccess:()=>k$,ZodSymbol:()=>KQ,ZodTemplateLiteral:()=>D$,ZodTransform:()=>y$,ZodTuple:()=>d$,ZodType:()=>Oe,ZodULID:()=>sE,ZodURL:()=>Cf,ZodUUID:()=>Ji,ZodUndefined:()=>XQ,ZodUnion:()=>Rf,ZodUnknown:()=>r$,ZodVoid:()=>s$,ZodXID:()=>oE,ZodXor:()=>a$,_ZodString:()=>Ky,_default:()=>I$,_function:()=>Wz,any:()=>Bz,array:()=>kf,base64:()=>az,base64url:()=>cz,bigint:()=>Iz,boolean:()=>ZQ,catch:()=>R$,check:()=>Zz,cidrv4:()=>sz,cidrv6:()=>oz,clone:()=>st,codec:()=>qz,coerce:()=>G$,compile:()=>ax,config:()=>Nt,core:()=>Ss,creditCard:()=>lz,cuid:()=>ZV,cuid2:()=>KV,currencyCode:()=>hz,custom:()=>Kz,date:()=>xz,decode:()=>MQ,decodeAsync:()=>jQ,deepPartial:()=>dq,describe:()=>Xz,discriminatedUnion:()=>Nz,e164:()=>uz,email:()=>LV,emoji:()=>YV,encode:()=>OQ,encodeAsync:()=>LQ,endsWith:()=>il,enum:()=>yE,exactOptional:()=>E$,file:()=>jz,flattenError:()=>Gp,float32:()=>yz,float64:()=>Ez,formatError:()=>Vp,fromJSONSchema:()=>uq,function:()=>Wz,getDiscriminatedOption:()=>CB,getErrorMap:()=>Jde,globalRegistry:()=>pn,gt:()=>qi,gte:()=>Cr,guid:()=>jV,hash:()=>mz,hex:()=>Az,hostname:()=>gz,httpUrl:()=>JV,iban:()=>dz,includes:()=>nl,input:()=>fq,instanceof:()=>tq,int:()=>Wy,int32:()=>bz,int64:()=>wz,intersection:()=>l$,invertCodec:()=>Hz,ipv4:()=>nz,ipv6:()=>iz,iso:()=>Df,json:()=>rq,jwt:()=>pz,keyof:()=>Qz,ksuid:()=>tz,lazy:()=>N$,length:()=>Wa,literal:()=>Lz,locales:()=>gf,looseObject:()=>Dz,looseRecord:()=>Uz,lowercase:()=>el,lt:()=>zi,lte:()=>wr,mac:()=>rz,map:()=>Fz,maxLength:()=>Ya,maxSize:()=>Eo,memoizer:()=>uf,meta:()=>eq,mime:()=>ol,minLength:()=>Cs,minSize:()=>Hi,multipleOf:()=>yo,nan:()=>zz,nanoid:()=>WV,nativeEnum:()=>Mz,negative:()=>Oy,never:()=>mE,nonnegative:()=>Ly,nonoptional:()=>S$,nonpositive:()=>My,normalize:()=>al,null:()=>t$,nullable:()=>wf,nullish:()=>Gz,number:()=>WQ,object:()=>$z,optional:()=>Xa,output:()=>gq,overwrite:()=>hi,parse:()=>NQ,parseAsync:()=>PQ,partialRecord:()=>Pz,pipe:()=>Zy,positive:()=>Fy,prefault:()=>C$,preprocess:()=>iq,prettifyError:()=>QS,promise:()=>Yz,properties:()=>sl,property:()=>jy,readonly:()=>T$,record:()=>f$,refine:()=>F$,regex:()=>Xu,regexes:()=>Vr,registry:()=>fy,safeDecode:()=>VQ,safeDecodeAsync:()=>qQ,safeEncode:()=>GQ,safeEncodeAsync:()=>zQ,safeParse:()=>UQ,safeParseAsync:()=>FQ,set:()=>Oz,setErrorMap:()=>Hde,size:()=>Ja,slugify:()=>dl,startsWith:()=>rl,strictObject:()=>Tz,string:()=>If,stringFormat:()=>fz,stringbool:()=>nq,success:()=>Vz,superRefine:()=>O$,symbol:()=>Sz,templateLiteral:()=>Jz,toJSONSchema:()=>qy,toLowerCase:()=>ul,toUpperCase:()=>ll,toZod:()=>Dp,transform:()=>EE,treeifyError:()=>xS,trim:()=>cl,tuple:()=>p$,uint32:()=>vz,uint64:()=>Cz,ulid:()=>XV,undefined:()=>kz,union:()=>vl,unknown:()=>Ka,uppercase:()=>tl,url:()=>HV,util:()=>N,uuid:()=>GV,uuidv4:()=>VV,uuidv6:()=>zV,uuidv7:()=>qV,validate:()=>zp,validateAsync:()=>qp,void:()=>Rz,withParser:()=>gy,xid:()=>ez,xor:()=>_z});var Ss={};Xr(Ss,{$ZodAny:()=>AB,$ZodArray:()=>vB,$ZodAsyncError:()=>tr,$ZodBase64:()=>rB,$ZodBase64URL:()=>iB,$ZodBigInt:()=>ny,$ZodBigIntFormat:()=>dB,$ZodBoolean:()=>nf,$ZodCIDRv4:()=>tB,$ZodCIDRv6:()=>nB,$ZodCUID:()=>Gk,$ZodCUID2:()=>Vk,$ZodCatch:()=>MB,$ZodCheck:()=>mt,$ZodCheckBigIntFormat:()=>hk,$ZodCheckEndsWith:()=>Rk,$ZodCheckGreaterThan:()=>Mm,$ZodCheckIncludes:()=>kk,$ZodCheckLengthEquals:()=>Ik,$ZodCheckLessThan:()=>Om,$ZodCheckLowerCase:()=>Ck,$ZodCheckMaxLength:()=>bk,$ZodCheckMaxSize:()=>mk,$ZodCheckMimeType:()=>$k,$ZodCheckMinLength:()=>vk,$ZodCheckMinSize:()=>yk,$ZodCheckMultipleOf:()=>gk,$ZodCheckNumberFormat:()=>Ak,$ZodCheckOverwrite:()=>Tk,$ZodCheckProperties:()=>Qk,$ZodCheckProperty:()=>xk,$ZodCheckRegex:()=>wk,$ZodCheckSizeEquals:()=>Ek,$ZodCheckStartsWith:()=>Bk,$ZodCheckStringFormat:()=>Ju,$ZodCheckUpperCase:()=>Sk,$ZodCodec:()=>sf,$ZodCreditCard:()=>oB,$ZodCustom:()=>HB,$ZodCustomStringFormat:()=>uB,$ZodCyclicError:()=>uy,$ZodDate:()=>EB,$ZodDefault:()=>PB,$ZodDiscriminatedUnion:()=>SB,$ZodE164:()=>sB,$ZodEmail:()=>Uk,$ZodEmoji:()=>Lk,$ZodEncodeError:()=>ho,$ZodEnum:()=>QB,$ZodError:()=>RS,$ZodExactOptional:()=>_B,$ZodFile:()=>TB,$ZodFunction:()=>zB,$ZodGUID:()=>Nk,$ZodIBAN:()=>aB,$ZodIPv4:()=>Kk,$ZodIPv6:()=>Xk,$ZodISODate:()=>Yk,$ZodISODateTime:()=>Jk,$ZodISODuration:()=>Zk,$ZodISOTime:()=>Wk,$ZodIntersection:()=>kB,$ZodJWT:()=>cB,$ZodKSUID:()=>Hk,$ZodLazy:()=>of,$ZodLiteral:()=>$B,$ZodMAC:()=>eB,$ZodMap:()=>RB,$ZodNaN:()=>LB,$ZodNanoID:()=>jk,$ZodNever:()=>mB,$ZodNonOptional:()=>FB,$ZodNull:()=>gB,$ZodNullable:()=>NB,$ZodNumber:()=>ty,$ZodNumberFormat:()=>lB,$ZodObject:()=>rV,$ZodObjectJIT:()=>IB,$ZodOptional:()=>iy,$ZodPipe:()=>sy,$ZodPrefault:()=>UB,$ZodPreprocess:()=>jB,$ZodPromise:()=>qB,$ZodReadonly:()=>GB,$ZodRealError:()=>nr,$ZodRecord:()=>BB,$ZodRegistry:()=>py,$ZodSet:()=>xB,$ZodString:()=>Va,$ZodStringFormat:()=>ot,$ZodSuccess:()=>OB,$ZodSymbol:()=>pB,$ZodTemplateLiteral:()=>VB,$ZodTransform:()=>DB,$ZodTuple:()=>ry,$ZodType:()=>De,$ZodULID:()=>zk,$ZodURL:()=>Mk,$ZodUUID:()=>Pk,$ZodUndefined:()=>fB,$ZodUnion:()=>rf,$ZodUnknown:()=>hB,$ZodVoid:()=>yB,$ZodXID:()=>qk,$ZodXor:()=>wB,$brand:()=>SS,$constructor:()=>S,$input:()=>rx,$output:()=>nx,Doc:()=>Ga,INVALID:()=>Pn,JSONSchema:()=>FV,JSONSchemaGenerator:()=>Hy,NEVER:()=>CS,TimePrecision:()=>Ax,URL_BAD_FORMAT:()=>Fk,URL_UNPARSEABLE:()=>Zp,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,_any:()=>Tx,_array:()=>Ox,_base64:()=>_y,_base64url:()=>Ny,_bigint:()=>Sx,_boolean:()=>wx,_catch:()=>$de,_check:()=>IV,_cidrv4:()=>Ty,_cidrv6:()=>Dy,_coercedBigint:()=>kx,_coercedBoolean:()=>Cx,_coercedDate:()=>Ux,_coercedNumber:()=>mx,_coercedString:()=>dx,_creditCard:()=>fx,_cuid:()=>Sy,_cuid2:()=>ky,_custom:()=>Lx,_date:()=>Px,_decode:()=>Rm,_decodeAsync:()=>Qm,_default:()=>Rde,_discriminatedUnion:()=>hde,_e164:()=>Py,_email:()=>my,_emoji:()=>wy,_encode:()=>Bm,_encodeAsync:()=>xm,_endsWith:()=>il,_enum:()=>Ide,_file:()=>Mx,_float32:()=>Ex,_float64:()=>bx,_gt:()=>qi,_gte:()=>Cr,_guid:()=>yy,_iban:()=>gx,_includes:()=>nl,_int:()=>yx,_int32:()=>vx,_int64:()=>Bx,_intersection:()=>mde,_ipv4:()=>Qy,_ipv6:()=>$y,_isoDate:()=>mf,_isoDateTime:()=>hf,_isoDuration:()=>Ef,_isoTime:()=>yf,_jwt:()=>Uy,_ksuid:()=>xy,_lazy:()=>Nde,_length:()=>Wa,_literal:()=>Cde,_lowercase:()=>el,_lt:()=>zi,_lte:()=>wr,_mac:()=>px,_map:()=>bde,_max:()=>wr,_maxLength:()=>Ya,_maxSize:()=>Eo,_mime:()=>ol,_min:()=>Cr,_minLength:()=>Cs,_minSize:()=>Hi,_multipleOf:()=>yo,_nan:()=>Fx,_nanoid:()=>Cy,_nativeEnum:()=>wde,_negative:()=>Oy,_never:()=>_x,_nonnegative:()=>Ly,_nonoptional:()=>xde,_nonpositive:()=>My,_normalize:()=>al,_null:()=>$x,_nullable:()=>Bde,_number:()=>hx,_optional:()=>kde,_overwrite:()=>hi,_parse:()=>Vu,_parseAsync:()=>zu,_pipe:()=>Tde,_positive:()=>Fy,_promise:()=>Pde,_properties:()=>sl,_property:()=>jy,_readonly:()=>Dde,_record:()=>Ede,_refine:()=>jx,_regex:()=>Xu,_safeDecode:()=>Tm,_safeDecodeAsync:()=>_m,_safeEncode:()=>$m,_safeEncodeAsync:()=>Dm,_safeParse:()=>qu,_safeParseAsync:()=>Hu,_set:()=>vde,_size:()=>Ja,_slugify:()=>dl,_startsWith:()=>rl,_string:()=>lx,_stringFormat:()=>Za,_stringbool:()=>qx,_success:()=>Qde,_superRefine:()=>Gx,_symbol:()=>xx,_templateLiteral:()=>_de,_toLowerCase:()=>ul,_toUpperCase:()=>ll,_transform:()=>Sde,_trim:()=>cl,_tuple:()=>yde,_uint32:()=>Ix,_uint64:()=>Rx,_ulid:()=>By,_undefined:()=>Qx,_union:()=>gde,_unknown:()=>Dx,_uppercase:()=>tl,_url:()=>Af,_uuid:()=>Ey,_uuidv4:()=>by,_uuidv6:()=>vy,_uuidv7:()=>Iy,_void:()=>Nx,_xid:()=>Ry,_xor:()=>Ade,base64Charset:()=>Wm,base64urlCharset:()=>tf,canParseURL:()=>Ok,clone:()=>st,compile:()=>ax,compileFn:()=>Ay,config:()=>Nt,createStandardJSONSchemaMethod:()=>pl,createToJSONSchemaMethod:()=>Jx,decode:()=>Ace,decodeAsync:()=>mce,describe:()=>Vx,encode:()=>gce,encodeAsync:()=>hce,extractDefs:()=>vo,finalize:()=>Io,flattenError:()=>Gp,formatError:()=>Vp,getDiscriminatedOption:()=>CB,globalConfig:()=>nn,globalRegistry:()=>pn,handleUnrepresentable:()=>Yt,initializeContext:()=>bo,isBackEdge:()=>dy,isRecursiveSchema:()=>ly,isValidBase64:()=>ef,isValidBase64URL:()=>Zm,isValidCIDRv6:()=>Ym,isValidCreditCard:()=>Km,isValidIBAN:()=>Xm,isValidIPv6:()=>Xp,isValidJWT:()=>ey,locales:()=>gf,memoizer:()=>uf,mergeValues:()=>Yu,meta:()=>zx,parse:()=>Sm,parseAsync:()=>km,parseURLObject:()=>eV,prettifyError:()=>QS,process:()=>at,processSchema:()=>at,regexes:()=>Vr,registry:()=>fy,safeDecode:()=>Ece,safeDecodeAsync:()=>vce,safeEncode:()=>yce,safeEncodeAsync:()=>bce,safeParse:()=>uce,safeParseAsync:()=>lce,standardProps:()=>zm,stripTabAndNewline:()=>Kp,toDotPath:()=>DG,toJSONSchema:()=>qy,toZod:()=>Dp,treeifyError:()=>xS,urlHostnameOk:()=>Hm,urlProtocolOk:()=>Jm,util:()=>N,validate:()=>zp,validateAsync:()=>qp,validateURL:()=>qm,version:()=>Dk,withParser:()=>gy});var N={};Xr(N,{BIGINT_FORMAT_RANGES:()=>Fp,CONSTANT_CATCH:()=>wm,Class:()=>gS,NUMBER_FORMAT_RANGES:()=>Up,aborted:()=>Nn,allowsEval:()=>mS,assert:()=>xae,assertEqual:()=>Sae,assertIs:()=>Bae,assertNever:()=>Rae,assertNotEqual:()=>kae,assignProp:()=>dn,attachSchema:()=>Op,base64ToUint8Array:()=>BG,base64urlToUint8Array:()=>Jae,cached:()=>Mu,captureStackTrace:()=>vm,cleanEnum:()=>Hae,cleanRegex:()=>Is,clone:()=>st,cloneDef:()=>Tae,codePointLength:()=>La,constantCatch:()=>IS,createTransparentProxy:()=>Fae,defineLazy:()=>AS,defineLazyInternal:()=>Ge,derived:()=>Kae,esc:()=>_n,escapeRegex:()=>Gr,explicitlyAborted:()=>bS,extend:()=>Lae,finalizeIssue:()=>er,floatSafeRemainder:()=>_p,getElementAtPath:()=>Dae,getEnumValues:()=>Fu,getLengthableOrigin:()=>Lp,getParsedType:()=>Uae,getSizableOrigin:()=>Mp,hexToUint8Array:()=>Wae,hide:()=>jp,installLazyProp:()=>nce,isObject:()=>Ma,isPlainObject:()=>jr,issue:()=>Gu,joinValues:()=>k,jsonStringifyReplacer:()=>Ou,members:()=>vS,merge:()=>Gae,mergeDefs:()=>gi,normalizeParams:()=>q,nullish:()=>bm,numKeys:()=>Pae,objectClone:()=>Qae,omit:()=>Mae,optionalKeys:()=>ES,own:()=>Ao,parsedType:()=>U,partial:()=>Vae,pick:()=>Oae,prefixIssues:()=>Xn,primitiveTypes:()=>yS,promiseAllObject:()=>_ae,propertyKeyTypes:()=>Pp,randomString:()=>Nae,rawShape:()=>Lu,required:()=>zae,safeExtend:()=>jae,shallowClone:()=>Np,sizeCaps:()=>ju,slugify:()=>hS,stringifyPrimitive:()=>P,toZod:()=>Dp,uint8ArrayToBase64:()=>RG,uint8ArrayToBase64url:()=>Yae,uint8ArrayToHex:()=>Zae,unwrapMessage:()=>Uu});function Sae(e){return e}o(Sae,"assertEqual");function kae(e){return e}o(kae,"assertNotEqual");function Dp(){return e=>e}o(Dp,"toZod");function Bae(e){}o(Bae,"assertIs");function Rae(e){throw new Error("Unexpected value in exhaustive check")}o(Rae,"assertNever");function xae(e){}o(xae,"assert");function Fu(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}o(Fu,"getEnumValues");function k(e,t="|"){return e.map(n=>P(n)).join(t)}o(k,"joinValues");function Ou(e,t){return typeof t=="bigint"?t.toString():t}o(Ou,"jsonStringifyReplacer");var fS=class{static{o(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Mu(e){return new fS(e)}o(Mu,"cached");function bm(e){return e==null}o(bm,"nullish");function Is(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}o(Is,"cleanRegex");function _p(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}o(_p,"floatSafeRemainder");var wG=Symbol("evaluating");function AS(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==wG)return i===void 0&&(i=wG,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(AS,"defineLazy");function Qae(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(Qae,"objectClone");function dn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}o(dn,"assignProp");function Lu(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}o(Lu,"rawShape");function vs(e){return Lu(e._zod.def)??e._zod.def.shape}o(vs,"sourceShape");function CG(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return dn(this,t,i),i},enumerable:!0,configurable:!0})}o(CG,"deferProp");function SG(e,t,n){t in e?dn(e,t,n):e[t]=n}o(SG,"putProp");function Oa(e,t,n,i){let r=vs(t);for(let s of n){let a=Object.getOwnPropertyDescriptor(r,s);a.enumerable&&(a.get?CG(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):SG(e,s,i?i(a.value,s):a.value))}}o(Oa,"mirrorShape");function $ae(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?CG(e,n,()=>t[n]):SG(e,n,i.value))}}o($ae,"mirrorProps");function gi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}o(gi,"mergeDefs");function Tae(e){return gi(e._zod.def)}o(Tae,"cloneDef");function Dae(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Dae,"getElementAtPath");function _ae(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let s=0;s<t.length;s++)r[t[s]]=i[s];return r})}o(_ae,"promiseAllObject");function Nae(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Nae,"randomString");function _n(e){return JSON.stringify(e)}o(_n,"esc");function hS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(hS,"slugify");var vm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Ma,"isObject");var mS=Mu(()=>{if(nn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function jr(e){if(Ma(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(Ma(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}o(jr,"isPlainObject");function Np(e){return jr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(Np,"shallowClone");function Pae(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(Pae,"numKeys");var Uae=o(e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},"getParsedType"),Pp=new Set(["string","number","symbol"]),yS=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Gr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Gr,"escapeRegex");function st(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}o(st,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function Fae(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,s){return t??(t=e()),Reflect.set(t,i,r,s)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}o(Fae,"createTransparentProxy");function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o(P,"stringifyPrimitive");function ES(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(ES,"optionalKeys");var Up={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Fp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Oae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Oa(s,e,Im(e,t)),st(e,gi(n,{shape:s,checks:[]}))}o(Oae,"pick");function Im(e,t){let n=vs(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}o(Im,"maskedKeys");function Mae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Im(e,t)),a={};return Oa(a,e,Reflect.ownKeys(vs(e)).filter(c=>!s.has(c))),st(e,gi(n,{shape:a,checks:[]}))}o(Mae,"omit");function Lae(e,t){if(!jr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=vs(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,gi(e._zod.def,{shape:kG(e,t)}))}o(Lae,"extend");function kG(e,t){let n={};return Oa(n,e,Reflect.ownKeys(vs(e))),$ae(n,t),n}o(kG,"extended");function jae(e,t){if(!jr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,gi(e._zod.def,{shape:kG(e,t)}))}o(jae,"safeExtend");function Gae(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Oa(n,e,Reflect.ownKeys(vs(e))),Oa(n,t,Reflect.ownKeys(vs(t)));let i=gi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,i)}o(Gae,"merge");function Vae(e,t,n,i="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=n?new Set(Im(t,n)):void 0,u={};return Oa(u,t,Reflect.ownKeys(vs(t)),e&&((l,p)=>c&&!c.has(p)?l:new e({type:"optional",innerType:l}))),st(t,gi(t._zod.def,{shape:u,checks:[]}))}o(Vae,"partial");function zae(e,t,n){let i=n?new Set(Im(t,n)):void 0,r={};return Oa(r,t,Reflect.ownKeys(vs(t)),(s,a)=>i&&!i.has(a)?s:new e({type:"nonoptional",innerType:s})),st(t,gi(t._zod.def,{shape:r}))}o(zae,"required");function Nn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}o(Nn,"aborted");function bS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}o(bS,"explicitlyAborted");function Xn(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}o(Xn,"prefixIssues");function Uu(e){return typeof e=="string"?e:e?.message}o(Uu,"unwrapMessage");function ju(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}o(ju,"sizeCaps");function Op(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(Op,"attachSchema");function er(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Uu(e.inst?._zod.def?.error?.(e))??Uu(s?.(e))??Uu(t?.error?.(e))??Uu(n.customError?.(e))??Uu(n.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}o(er,"finalizeIssue");function Mp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Mp,"getSizableOrigin");var qae=/[\uD800-\uDBFF]/;function La(e){let t=e.length;if(!qae.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}o(La,"codePointLength");function Lp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Lp,"getLengthableOrigin");function U(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}o(U,"parsedType");function Gu(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}o(Gu,"issue");function Hae(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(Hae,"cleanEnum");function BG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}o(BG,"base64ToUint8Array");function RG(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o(RG,"uint8ArrayToBase64");function Jae(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return BG(t+n)}o(Jae,"base64urlToUint8Array");function Yae(e){return RG(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(Yae,"uint8ArrayToBase64url");function Wae(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}o(Wae,"hexToUint8Array");function Zae(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(Zae,"uint8ArrayToHex");var gS=class{static{o(this,"Class")}constructor(...t){}};function vS(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):Xae(e,n,i.value)}}o(vS,"members");function Ao(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}o(Ao,"own");function jp(e,t,n){return Ao(e,t,n,!1)}o(jp,"hide");function Kae(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ao(this,n,i(this))},set(r){Ao(this,n,r)}})}return t}o(Kae,"derived");function Xae(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ao(this,t,n.bind(this))},set(i){Ao(this,t,i)}})}o(Xae,"defineBound");function ece(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(ece,"claim");var pS,go=!1,tce={configurable:!0,get(){go=!0}};function Ge(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&pS!==e._zod){pS=void 0;return}pS=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,tce);let r=go;go=!1;try{let s=n(this);return go?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),go=go||r,s}catch(s){throw delete this[t],go=go||r,s}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}o(Ge,"defineLazyInternal");function nce(e,t,n,i){let r=ece(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:s})}})}o(nce,"installLazyProp");var wm="~constantCatch";function IS(e){let t=o(()=>e,"fn");return t[wm]=!0,t}o(IS,"constantCatch");var xG,CS=Object.freeze({status:"aborted"}),wS={value:void 0,enumerable:!1},QG="captureStackTrace"in Error?Error:null;function rce(e){let t=QG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return QG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(rce,"newError");function S(e,t,n,i){let r={};function s(A){this.def=A,this.constr=f,this.traits=new Set}o(s,"Internals"),s.prototype=r;let a=n,c=a&&new WeakSet;function u(A,h){if(A._zod){if(A._zod.traits.has(e))return}else{wS.value=new s(h);try{Object.defineProperty(A,"_zod",wS)}finally{wS.value=void 0}}if(A._zod.traits.add(e),t(A,h),c){let E=Object.getPrototypeOf(A),v=A._zod.constr.prototype,b=E;for(;b&&b!==v;)b=Object.getPrototypeOf(b);let I=b??E;c.has(I)||(c.add(I),vS(I,a))}let m=f.prototype;for(let E in m)Object.prototype.hasOwnProperty.call(m,E)&&(E in A||(A[E]=m[E].bind(A)))}o(u,"init");let l=i?.Parent??Object;class p extends l{static{o(this,"Definition")}}Object.defineProperty(p,"name",{value:e});function f(A){let h=i?.Parent?rce(p):this;u(h,A);let m=h._zod.deferred;if(m){for(let v of m)v();h._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;return E&&E(h),h}return o(f,"_"),Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:o(A=>i?.Parent&&A instanceof i.Parent?!0:A?._zod?.traits?.has(e),"value")}),Object.defineProperty(f,"name",{value:e}),f}o(S,"$constructor");var SS=Symbol("zod_brand"),tr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ho=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(xG=globalThis).__zod_globalConfig??(xG.__zod_globalConfig={});var nn=globalThis.__zod_globalConfig;function Nt(e){return e&&Object.assign(nn,e),nn}o(Nt,"config");function ice(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Ou,2)),e.message}o(ice,"_getMessage");function sce(e){this._zod.message=e}o(sce,"_setMessage");var oce={get:ice,set:sce,enumerable:!0,configurable:!0},BS={value:void 0,enumerable:!1},$G=new WeakSet([Object.prototype,Error.prototype]),TG=o((e,t)=>{e.name="$ZodError",BS.value=t,Object.defineProperty(e,"issues",BS),BS.value=void 0,Object.defineProperty(e,"message",oce);let n=Object.getPrototypeOf(e);$G.has(n)||($G.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=o(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),RS=S("$ZodError",TG),nr=S("$ZodError",TG,void 0,{Parent:Error});function ace(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}o(ace,"node");function Gp(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?ace(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}o(Gp,"flattenError");function Vp(e,t=n=>n.message){let n={_errors:[]},i=o((r,s=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let p=c[l],f=l===c.length-1;if(p==="_errors"){f&&u._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,p)||Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let A=u[p];f&&A._errors.push(t(a)),u=A,l++}}}},"processError");return i(e),n}o(Vp,"formatError");function xS(e,t=n=>n.message){let n={errors:[]},i=o((r,s=[])=>{var a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else{let u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let l=n,p=0;for(;p<u.length;){let f=u[p],A=p===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,f)||Object.defineProperty(l.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[f]):(l.items??(l.items=[]),(a=l.items)[f]??(a[f]={errors:[]}),l=l.items[f]),A&&l.errors.push(t(c)),p++}}},"processError");return i(e),n}o(xS,"treeifyError");function DG(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}o(DG,"toDotPath");function QS(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${DG(i.path)}`);return t.join(`
|
|
143
143
|
`)}o(QS,"prettifyError");function Cm(e,t){return{callee:t?.callee??e,Err:t?.Err}}o(Cm,"finalizeParams");var Vu=o(e=>{let t=o((n,i,r,s)=>{let a=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise)throw new tr;if(c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>er(l,a,Nt())));throw vm(u,s?.callee??t),u}return c.value},"fn");return t},"_parse"),Sm=Vu(nr),zu=o(e=>{let t=o(async(n,i,r,s)=>{let a=r?{...r,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>er(l,a,Nt())));throw vm(u,s?.callee??t),u}return c.value},"fn");return t},"_parseAsync"),km=zu(nr),qu=o(e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new tr;return s.issues.length?_G(e,s.issues,r):{success:!0,data:s.value}},"_safeParse"),uce=qu(nr);function _G(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>er(r,n,Nt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}o(_G,"failure");var Hu=o(e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?_G(e,s.issues,r):{success:!0,data:s.value}},"_safeParseAsync"),lce=Hu(nr),dce=Symbol.for("zod.compile.invalid"),pce=Symbol.for("zod.compile.fallback"),zp=o(((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==dce)return!0;if(i.definite===!0&&n===void 0)return!1}return fce(e,t,n)}),"validate");function fce(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,s;if(r?(i[pce]=!0,s=r({value:t,issues:[]},i)):s=e._zod.run({value:t,issues:[]},i),s instanceof Promise)throw new tr;return s.issues.length===0}o(fce,"validateFallback");var qp=o(async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},"validateAsync"),Bm=o(e=>{let t=Vu(e),n=o((i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(i,r,c,Cm(n,a))},"fn");return n},"_encode"),gce=Bm(nr),Rm=o(e=>{let t=Vu(e),n=o((i,r,s,a)=>t(i,r,s,Cm(n,a)),"fn");return n},"_decode"),Ace=Rm(nr),xm=o(e=>{let t=zu(e),n=o(async(i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(i,r,c,Cm(n,a))},"fn");return n},"_encodeAsync"),hce=xm(nr),Qm=o(e=>{let t=zu(e),n=o(async(i,r,s,a)=>await t(i,r,s,Cm(n,a)),"fn");return n},"_decodeAsync"),mce=Qm(nr),$m=o(e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return qu(e)(t,n,r)},"_safeEncode"),yce=$m(nr),Tm=o(e=>(t,n,i)=>qu(e)(t,n,i),"_safeDecode"),Ece=Tm(nr),Dm=o(e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Hu(e)(t,n,r)},"_safeEncodeAsync"),bce=Dm(nr),_m=o(e=>async(t,n,i)=>Hu(e)(t,n,i),"_safeDecodeAsync"),vce=_m(nr);var Vr={};Xr(Vr,{anyString:()=>rk,base64:()=>JS,base64url:()=>YS,bigint:()=>sk,boolean:()=>ok,browserEmail:()=>xce,cidrv4:()=>qS,cidrv6:()=>HS,creditCard:()=>Nm,cuid:()=>TS,cuid2:()=>DS,currencyCode:()=>XS,date:()=>ek,datetime:()=>nk,domain:()=>ZS,duration:()=>OS,e164:()=>KS,email:()=>LS,emoji:()=>jS,extendedDuration:()=>Ice,guid:()=>MS,hex:()=>dk,hostname:()=>WS,html5Email:()=>kce,httpProtocol:()=>Hp,iban:()=>Pm,idnEmail:()=>Rce,integer:()=>Jp,ipv4:()=>GS,ipv6:()=>VS,ksuid:()=>PS,lowercase:()=>uk,mac:()=>zS,md5_base64:()=>Dce,md5_base64url:()=>_ce,md5_hex:()=>Tce,nanoid:()=>US,nanoidOfLength:()=>FS,null:()=>ak,number:()=>ws,rfc5322Email:()=>Bce,sha1_base64:()=>Pce,sha1_base64url:()=>Uce,sha1_hex:()=>Nce,sha256_base64:()=>Oce,sha256_base64url:()=>Mce,sha256_hex:()=>Fce,sha384_base64:()=>jce,sha384_base64url:()=>Gce,sha384_hex:()=>Lce,sha512_base64:()=>zce,sha512_base64url:()=>qce,sha512_hex:()=>Vce,string:()=>ik,time:()=>tk,ulid:()=>_S,undefined:()=>ck,unicodeEmail:()=>NG,uppercase:()=>lk,uuid:()=>ja,uuid4:()=>wce,uuid6:()=>Cce,uuid7:()=>Sce,xid:()=>NS});var TS=/^[cC][0-9a-z]{6,}$/,DS=/^[0-9a-z]+$/,_S=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,NS=/^[0-9a-vA-V]{20}$/,PS=/^[A-Za-z0-9]{27}$/,US=/^[a-zA-Z0-9_-]{21}$/;function FS(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}o(FS,"nanoidOfLength");var OS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ice=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,MS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ja=o(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),wce=ja(4),Cce=ja(6),Sce=ja(7),LS=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kce=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Bce=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,NG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Rce=NG,xce=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Qce="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function jS(){return new RegExp(Qce,"u")}o(jS,"emoji");var GS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zS=o(e=>{let t=Gr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),qS=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,HS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,JS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,YS=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,WS=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ZS=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Hp=/^https?$/,KS=/^\+[1-9]\d{6,14}$/,Nm=/^\d(?:[ -]?\d){11,18}$/,XS=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Pm=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,PG="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function $ce(e){return new RegExp(`^${e}$`)}o($ce,"anchor");var ek=$ce(PG);function $S(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}o($S,"timeSource");function tk(e){return new RegExp(`^${$S(e)}$`)}o(tk,"time");function nk(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${$S({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${$S({precision:e.precision})}`:n;return new RegExp(`^${PG}T(?:${i})$`)}o(nk,"datetime");var rk=/^[\s\S]{0,}$/,ik=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),sk=/^-?\d+n?$/,Jp=/^-?\d+$/,ws=/^-?\d+(?:\.\d+)?$/,ok=/^(?:true|false)$/i,ak=/^null$/i;var ck=/^undefined$/i;var uk=/^[^A-Z]*$/,lk=/^[^a-z]*$/,dk=/^[0-9a-fA-F]*$/;function Yp(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}o(Yp,"fixedBase64");function Wp(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}o(Wp,"fixedBase64url");var Tce=/^[0-9a-fA-F]{32}$/,Dce=Yp(22,"=="),_ce=Wp(22),Nce=/^[0-9a-fA-F]{40}$/,Pce=Yp(27,"="),Uce=Wp(27),Fce=/^[0-9a-fA-F]{64}$/,Oce=Yp(43,"="),Mce=Wp(43),Lce=/^[0-9a-fA-F]{96}$/,jce=Yp(64,""),Gce=Wp(64),Vce=/^[0-9a-fA-F]{128}$/,zce=Yp(86,"=="),qce=Wp(86);var mt=S("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),pk=o(e=>{let t=e.value;return!bm(t)&&t.size!==void 0},"_whenHasSize"),fk=o(e=>{let t=e.value;return!bm(t)&&t.length!==void 0},"_whenHasLength"),Um={number:"number",bigint:"bigint",object:"date"},Om=S("$ZodCheckLessThan",(e,t)=>{mt.init(e,t);let n=Um[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Um[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mm=S("$ZodCheckGreaterThan",(e,t)=>{mt.init(e,t);let n=Um[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Um[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),gk=S("$ZodCheckMultipleOf",(e,t)=>{mt.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):_p(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Ak=S("$ZodCheckNumberFormat",(e,t)=>{mt.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,s]=Up[t.format];e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),hk=S("$ZodCheckBigIntFormat",(e,t)=>{mt.init(e,t);let[n,i]=Fp[t.format];e._zod.check=r=>{let s=r.value;s<n&&r.issues.push({origin:"bigint",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&r.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),mk=S("$ZodCheckMaxSize",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=pk),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Mp(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),yk=S("$ZodCheckMinSize",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=pk),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Mp(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ek=S("$ZodCheckSizeEquals",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=pk),e._zod.check=i=>{let r=i.value,s=r.size;if(s===t.size)return;let a=s>t.size;i.issues.push({origin:Mp(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),bk=S("$ZodCheckMaxLength",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>t.maximum?La(r):s)<=t.maximum)return;let c=Lp(r);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vk=S("$ZodCheckMinLength",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>=t.minimum&&s<t.minimum*2?La(r):s)>=t.minimum)return;let c=Lp(r);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ik=S("$ZodCheckLengthEquals",(e,t)=>{var n;mt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value,s=r.length,a=typeof r=="string"&&s>=t.length&&s<=t.length*2?La(r):s;if(a===t.length)return;let c=Lp(r),u=a>t.length;i.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Ju=S("$ZodCheckStringFormat",(e,t)=>{var n,i;mt.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),wk=S("$ZodCheckRegex",(e,t)=>{Ju.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ck=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=uk),Ju.init(e,t)}),Sk=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=lk),Ju.init(e,t)}),kk=S("$ZodCheckIncludes",(e,t)=>{mt.init(e,t);let n=Gr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Bk=S("$ZodCheckStartsWith",(e,t)=>{mt.init(e,t);let n=new RegExp(`^${Gr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Rk=S("$ZodCheckEndsWith",(e,t)=>{mt.init(e,t);let n=new RegExp(`.*${Gr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Fm(e,t,n){e.issues.length&&t.issues.push(...Xn(n,e.issues))}o(Fm,"handleCheckPropertyResult");var xk=S("$ZodCheckProperty",(e,t)=>{mt.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Fm(r,n,t.property));Fm(i,n,t.property)}}),Qk=S("$ZodCheckProperties",(e,t)=>{mt.init(e,t),jp(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let r=i.value,s;for(let[a,c]of n){let u=c._zod.run({value:r[a],issues:[]},{});u instanceof Promise?(s??(s=[]),s.push(u.then(l=>Fm(l,i,a)))):Fm(u,i,a)}if(s)return Promise.all(s).then(()=>{})}}),$k=S("$ZodCheckMimeType",(e,t)=>{mt.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Tk=S("$ZodCheckOverwrite",(e,t)=>{mt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Ga=class{static{o(this,"Doc")}constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
144
144
|
`).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),s=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
145
145
|
${n.join(`
|