@weppy/roblox-mcp 2.17.7 → 2.17.8
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/CHANGELOG.md +7 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -53,6 +53,13 @@ All notable changes to this project will be documented in this file.
|
|
|
53
53
|
|
|
54
54
|
|
|
55
55
|
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
## [2.17.8] - 2026-09-21
|
|
59
|
+
|
|
60
|
+
### Bug Fixes
|
|
61
|
+
|
|
62
|
+
- **Show published Place names for connected Studio targets** — The Dashboard and Place information now use the published Roblox name instead of internal DataModel names such as `Place1`. Connected published Places refresh their display name without changing routing or Sync folders, temporary Roblox lookup failures keep the last confirmed name, and unpublished local Places continue to use their Studio name. Update both WEPPY components and restart Roblox Studio to load the patched Plugin.
|
|
56
63
|
|
|
57
64
|
## [2.17.7] - 2026-09-21
|
|
58
65
|
|
package/dist/index.js
CHANGED
|
@@ -242,7 +242,7 @@ run().catch(() => {
|
|
|
242
242
|
|
|
243
243
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let s=o[1];if(e===o[0]){a(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){a(o);continue}}if(t.metadataRegistry.get(o[0])?.id){a(o);continue}if(s.cycle){a(o);continue}if(s.count>1&&t.reused==="ref"){a(o);continue}}}function Uo(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=o=>{let s=t.seen.get(o);if(s.ref===null)return;let c=s.def??s.schema,l={...c},u=s.ref;if(s.ref=null,u){n(u);let p=t.seen.get(u),m=p.schema;if(m.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,l),o._zod.parent===u)for(let g in c)g==="$ref"||g==="allOf"||g in l||delete c[g];if(m.$ref&&p.def)for(let g in c)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(c[g])===JSON.stringify(p.def[g])&&delete c[g]}let d=o._zod.parent;if(d&&d!==u){n(d);let p=t.seen.get(d);if(p?.schema.$ref&&(c.$ref=p.schema.$ref,p.def))for(let m in c)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(c[m])===JSON.stringify(p.def[m])&&delete c[m]}t.override({zodSchema:o,jsonSchema:c,path:s.path??[]})};for(let o of[...t.seen.entries()].reverse())n(o[0]);let i={};if(t.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let o=t.external.registry.get(e)?.id;if(!o)throw new Error("Schema is missing an `id` property");i.$id=t.external.uri(o)}Object.assign(i,r.def??r.schema);let a=t.external?.defs??{};for(let o of t.seen.entries()){let s=o[1];s.def&&s.defId&&(a[s.defId]=s.def)}t.external||Object.keys(a).length>0&&(t.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{let o=JSON.parse(JSON.stringify(i));return Object.defineProperty(o,"~standard",{value:{...e["~standard"],jsonSchema:{input:Zl(e,"input",t.processors),output:Zl(e,"output",t.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function jr(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return jr(n.element,r);if(n.type==="set")return jr(n.valueType,r);if(n.type==="lazy")return jr(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return jr(n.innerType,r);if(n.type==="intersection")return jr(n.left,r)||jr(n.right,r);if(n.type==="record"||n.type==="map")return jr(n.keyType,r)||jr(n.valueType,r);if(n.type==="pipe")return jr(n.in,r)||jr(n.out,r);if(n.type==="object"){for(let i in n.shape)if(jr(n.shape[i],r))return!0;return!1}if(n.type==="union"){for(let i of n.options)if(jr(i,r))return!0;return!1}if(n.type==="tuple"){for(let i of n.items)if(jr(i,r))return!0;return!!(n.rest&&jr(n.rest,r))}return!1}var nk=(t,e={})=>r=>{let n=jo({...r,processors:e});return $e(t,n),Lo(n,t),Uo(n,t)},Zl=(t,e,r={})=>n=>{let{libraryOptions:i,target:a}=n??{},o=jo({...i??{},target:a,io:e,processors:r});return $e(t,o),Lo(o,t),Uo(o,t)};var zne={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ik=(t,e,r,n)=>{let i=r;i.type="string";let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof o=="number"&&(i.maxLength=o),s&&(i.format=zne[s]??s,i.format===""&&delete i.format,s==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},ak=(t,e,r,n)=>{let i=r,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a=="number"&&(i.minimum=a,typeof u=="number"&&e.target!=="draft-04"&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o=="number"&&(i.maximum=o,typeof l=="number"&&e.target!=="draft-04"&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},ok=(t,e,r,n)=>{r.type="boolean"},sk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},ck=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},lk=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},uk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},dk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},pk=(t,e,r,n)=>{r.not={}},mk=(t,e,r,n)=>{},fk=(t,e,r,n)=>{},gk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},hk=(t,e,r,n)=>{let i=t._zod.def,a=Up(i.entries);a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),r.enum=a},yk=(t,e,r,n)=>{let i=t._zod.def,a=[];for(let o of i.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let o=a[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o}else a.every(o=>typeof o=="number")&&(r.type="number"),a.every(o=>typeof o=="string")&&(r.type="string"),a.every(o=>typeof o=="boolean")&&(r.type="boolean"),a.every(o=>o===null)&&(r.type="null"),r.enum=a},vk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},bk=(t,e,r,n)=>{let i=r,a=t._zod.pattern;if(!a)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=a.source},_k=(t,e,r,n)=>{let i=r,a={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:s,mime:c}=t._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(i,a)},xk=(t,e,r,n)=>{r.type="boolean"},Sk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},wk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Ik=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pk=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Ck=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},kk=(t,e,r,n)=>{let i=r,a=t._zod.def,{minimum:o,maximum:s}=t._zod.bag;typeof o=="number"&&(i.minItems=o),typeof s=="number"&&(i.maxItems=s),i.type="array",i.items=$e(a.element,e,{...n,path:[...n.path,"items"]})},Rk=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object",i.properties={};let o=a.shape;for(let l in o)i.properties[l]=$e(o[l],e,{...n,path:[...n.path,"properties",l]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(l=>{let u=a.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=$e(a.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(i.additionalProperties=!1)},Hb=(t,e,r,n)=>{let i=t._zod.def,a=i.inclusive===!1,o=i.options.map((s,c)=>$e(s,e,{...n,path:[...n.path,a?"oneOf":"anyOf",c]}));a?r.oneOf=o:r.anyOf=o},Ek=(t,e,r,n)=>{let i=t._zod.def,a=$e(i.left,e,{...n,path:[...n.path,"allOf",0]}),o=$e(i.right,e,{...n,path:[...n.path,"allOf",1]}),s=l=>"allOf"in l&&Object.keys(l).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];r.allOf=c},Ak=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",s=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=a.items.map((p,m)=>$e(p,e,{...n,path:[...n.path,o,m]})),l=a.rest?$e(a.rest,e,{...n,path:[...n.path,s,...e.target==="openapi-3.0"?[a.items.length]:[]]}):null;e.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):e.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(i.minItems=u),typeof d=="number"&&(i.maxItems=d)},Tk=(t,e,r,n)=>{let i=r,a=t._zod.def;i.type="object";let o=a.keyType,c=o._zod.bag?.patterns;if(a.mode==="loose"&&c&&c.size>0){let u=$e(a.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});i.patternProperties={};for(let d of c)i.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(i.propertyNames=$e(a.keyType,e,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=$e(a.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(i.required=u)}},Ok=(t,e,r,n)=>{let i=t._zod.def,a=$e(i.innerType,e,n),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=i.innerType,r.nullable=!0):r.anyOf=[a,{type:"null"}]},Dk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},$k=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},Nk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Mk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o},jk=(t,e,r,n)=>{let i=t._zod.def,a=e.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;$e(a,e,n);let o=e.seen.get(t);o.ref=a},Lk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType,r.readOnly=!0},Uk=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},Zb=(t,e,r,n)=>{let i=t._zod.def;$e(i.innerType,e,n);let a=e.seen.get(t);a.ref=i.innerType},zk=(t,e,r,n)=>{let i=t._zod.innerType;$e(i,e,n);let a=e.seen.get(t);a.ref=i},Wb={string:ik,number:ak,boolean:ok,bigint:sk,symbol:ck,null:lk,undefined:uk,void:dk,never:pk,any:mk,unknown:fk,date:gk,enum:hk,literal:yk,nan:vk,template_literal:bk,file:_k,success:xk,custom:Sk,function:wk,transform:Ik,map:Pk,set:Ck,array:kk,object:Rk,union:Hb,intersection:Ek,tuple:Ak,record:Tk,nullable:Ok,nonoptional:Dk,default:$k,prefault:Nk,catch:Mk,pipe:jk,readonly:Lk,promise:Uk,optional:Zb,lazy:zk};function Gl(t,e){if("_idmap"in t){let n=t,i=jo({...e,processors:Wb}),a={};for(let c of n._idmap.entries()){let[l,u]=c;$e(u,i)}let o={},s={registry:n,uri:e?.uri,defs:a};i.external=s;for(let c of n._idmap.entries()){let[l,u]=c;Lo(i,u),o[l]=Uo(i,u)}if(Object.keys(a).length>0){let c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:a}}return{schemas:o}}let r=jo({...e,processors:Wb});return $e(t,r),Lo(r,t),Uo(r,t)}var Gb=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=jo({processors:Wb,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,r={path:[],schemaPath:[]}){return $e(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),Lo(this.ctx,e);let n=Uo(this.ctx,e),{"~standard":i,...a}=n;return a}};var P4={};var Pm={};wr(Pm,{ZodAny:()=>sR,ZodArray:()=>dR,ZodBase64:()=>f_,ZodBase64URL:()=>g_,ZodBigInt:()=>eu,ZodBigIntFormat:()=>v_,ZodBoolean:()=>Ql,ZodCIDRv4:()=>p_,ZodCIDRv6:()=>m_,ZodCUID:()=>a_,ZodCUID2:()=>o_,ZodCatch:()=>TR,ZodCodec:()=>I_,ZodCustom:()=>Nm,ZodCustomStringFormat:()=>Yl,ZodDate:()=>Am,ZodDefault:()=>PR,ZodDiscriminatedUnion:()=>mR,ZodE164:()=>h_,ZodEmail:()=>r_,ZodEmoji:()=>n_,ZodEnum:()=>Jl,ZodExactOptional:()=>SR,ZodFile:()=>_R,ZodFunction:()=>zR,ZodGUID:()=>Cm,ZodIPv4:()=>u_,ZodIPv6:()=>d_,ZodIntersection:()=>fR,ZodJWT:()=>y_,ZodKSUID:()=>l_,ZodLazy:()=>jR,ZodLiteral:()=>bR,ZodMAC:()=>nR,ZodMap:()=>yR,ZodNaN:()=>DR,ZodNanoID:()=>i_,ZodNever:()=>lR,ZodNonOptional:()=>S_,ZodNull:()=>oR,ZodNullable:()=>IR,ZodNumber:()=>Xl,ZodNumberFormat:()=>nc,ZodObject:()=>Tm,ZodOptional:()=>x_,ZodPipe:()=>w_,ZodPrefault:()=>kR,ZodPromise:()=>UR,ZodReadonly:()=>$R,ZodRecord:()=>$m,ZodSet:()=>vR,ZodString:()=>Kl,ZodStringFormat:()=>Be,ZodSuccess:()=>AR,ZodSymbol:()=>iR,ZodTemplateLiteral:()=>MR,ZodTransform:()=>xR,ZodTuple:()=>gR,ZodType:()=>ae,ZodULID:()=>s_,ZodURL:()=>Em,ZodUUID:()=>Bi,ZodUndefined:()=>aR,ZodUnion:()=>Om,ZodUnknown:()=>cR,ZodVoid:()=>uR,ZodXID:()=>c_,ZodXor:()=>pR,_ZodString:()=>t_,_default:()=>CR,_function:()=>RU,any:()=>uU,array:()=>me,base64:()=>Z4,base64url:()=>G4,bigint:()=>aU,boolean:()=>kt,catch:()=>OR,check:()=>EU,cidrv4:()=>W4,cidrv6:()=>H4,codec:()=>PU,cuid:()=>j4,cuid2:()=>L4,custom:()=>P_,date:()=>pU,describe:()=>AU,discriminatedUnion:()=>Dm,e164:()=>J4,email:()=>k4,emoji:()=>N4,enum:()=>ur,exactOptional:()=>wR,file:()=>xU,float32:()=>tU,float64:()=>rU,function:()=>RU,guid:()=>R4,hash:()=>eU,hex:()=>Q4,hostname:()=>X4,httpUrl:()=>$4,instanceof:()=>OU,int:()=>e_,int32:()=>nU,int64:()=>oU,intersection:()=>ru,ipv4:()=>q4,ipv6:()=>V4,json:()=>$U,jwt:()=>K4,keyof:()=>mU,ksuid:()=>F4,lazy:()=>LR,literal:()=>W,looseObject:()=>lr,looseRecord:()=>yU,mac:()=>B4,map:()=>vU,meta:()=>TU,nan:()=>IU,nanoid:()=>M4,nativeEnum:()=>_U,never:()=>b_,nonoptional:()=>ER,null:()=>tu,nullable:()=>km,nullish:()=>SU,number:()=>Ee,object:()=>F,optional:()=>et,partialRecord:()=>hU,pipe:()=>Rm,prefault:()=>RR,preprocess:()=>Mm,promise:()=>kU,readonly:()=>NR,record:()=>Ge,refine:()=>FR,set:()=>bU,strictObject:()=>fU,string:()=>R,stringFormat:()=>Y4,stringbool:()=>DU,success:()=>wU,superRefine:()=>qR,symbol:()=>cU,templateLiteral:()=>CU,transform:()=>__,tuple:()=>hR,uint32:()=>iU,uint64:()=>sU,ulid:()=>U4,undefined:()=>lU,union:()=>Ue,unknown:()=>Ve,url:()=>D4,uuid:()=>E4,uuidv4:()=>A4,uuidv6:()=>T4,uuidv7:()=>O4,void:()=>dU,xid:()=>z4,xor:()=>gU});var Jb={};wr(Jb,{endsWith:()=>Ks,gt:()=>di,gte:()=>cr,includes:()=>Gs,length:()=>Mo,lowercase:()=>Hs,lt:()=>ui,lte:()=>Mr,maxLength:()=>No,maxSize:()=>Na,mime:()=>Ys,minLength:()=>qi,minSize:()=>pi,multipleOf:()=>$a,negative:()=>xm,nonnegative:()=>wm,nonpositive:()=>Sm,normalize:()=>Xs,overwrite:()=>zn,positive:()=>_m,property:()=>Im,regex:()=>Ws,size:()=>$o,slugify:()=>Hl,startsWith:()=>Js,toLowerCase:()=>ec,toUpperCase:()=>tc,trim:()=>Qs,uppercase:()=>Zs});var zo={};wr(zo,{ZodISODate:()=>Yb,ZodISODateTime:()=>Kb,ZodISODuration:()=>Qb,ZodISOTime:()=>Xb,date:()=>qk,datetime:()=>Fk,duration:()=>Vk,time:()=>Bk});var Kb=w("ZodISODateTime",(t,e)=>{av.init(t,e),Be.init(t,e)});function Fk(t){return db(Kb,t)}var Yb=w("ZodISODate",(t,e)=>{ov.init(t,e),Be.init(t,e)});function qk(t){return pb(Yb,t)}var Xb=w("ZodISOTime",(t,e)=>{sv.init(t,e),Be.init(t,e)});function Bk(t){return mb(Xb,t)}var Qb=w("ZodISODuration",(t,e)=>{cv.init(t,e),Be.init(t,e)});function Vk(t){return fb(Qb,t)}var C4=(t,e)=>{Vp.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>Al(t,r)},flatten:{value:r=>El(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Cl,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Cl,2)}},isEmpty:{get(){return t.issues.length===0}}})},qne=w("ZodError",C4),Qr=w("ZodError",C4,{Parent:Error});var Wk=Tl(Qr),Hk=Dl(Qr),Zk=Nl(Qr),Gk=Ml(Qr),Jk=Ty(Qr),Kk=Oy(Qr),Yk=Dy(Qr),Xk=$y(Qr),Qk=Ny(Qr),eR=My(Qr),tR=jy(Qr),rR=Ly(Qr);var ae=w("ZodType",(t,e)=>(te.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Zl(t,"input"),output:Zl(t,"output")}}),t.toJSONSchema=nk(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone(O.mergeDefs(e,{checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),t.with=t.check,t.clone=(r,n)=>sr(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>Wk(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>Zk(t,r,n),t.parseAsync=async(r,n)=>Hk(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>Gk(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>Jk(t,r,n),t.decode=(r,n)=>Kk(t,r,n),t.encodeAsync=async(r,n)=>Yk(t,r,n),t.decodeAsync=async(r,n)=>Xk(t,r,n),t.safeEncode=(r,n)=>Qk(t,r,n),t.safeDecode=(r,n)=>eR(t,r,n),t.safeEncodeAsync=async(r,n)=>tR(t,r,n),t.safeDecodeAsync=async(r,n)=>rR(t,r,n),t.refine=(r,n)=>t.check(FR(r,n)),t.superRefine=r=>t.check(qR(r)),t.overwrite=r=>t.check(zn(r)),t.optional=()=>et(t),t.exactOptional=()=>wR(t),t.nullable=()=>km(t),t.nullish=()=>et(km(t)),t.nonoptional=r=>ER(t,r),t.array=()=>me(t),t.or=r=>Ue([t,r]),t.and=r=>ru(t,r),t.transform=r=>Rm(t,__(r)),t.default=r=>CR(t,r),t.prefault=r=>RR(t,r),t.catch=r=>OR(t,r),t.pipe=r=>Rm(t,r),t.readonly=()=>NR(t),t.describe=r=>{let n=t.clone();return Zt.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return Zt.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Zt.get(t);let n=t.clone();return Zt.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=r=>r(t),t)),t_=w("_ZodString",(t,e)=>{Do.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ik(t,n,i,a);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(Ws(...n)),t.includes=(...n)=>t.check(Gs(...n)),t.startsWith=(...n)=>t.check(Js(...n)),t.endsWith=(...n)=>t.check(Ks(...n)),t.min=(...n)=>t.check(qi(...n)),t.max=(...n)=>t.check(No(...n)),t.length=(...n)=>t.check(Mo(...n)),t.nonempty=(...n)=>t.check(qi(1,...n)),t.lowercase=n=>t.check(Hs(n)),t.uppercase=n=>t.check(Zs(n)),t.trim=()=>t.check(Qs()),t.normalize=(...n)=>t.check(Xs(...n)),t.toLowerCase=()=>t.check(ec()),t.toUpperCase=()=>t.check(tc()),t.slugify=()=>t.check(Hl())}),Kl=w("ZodString",(t,e)=>{Do.init(t,e),t_.init(t,e),t.email=r=>t.check(em(r_,r)),t.url=r=>t.check(Wl(Em,r)),t.jwt=r=>t.check(bm(y_,r)),t.emoji=r=>t.check(am(n_,r)),t.guid=r=>t.check(Vl(Cm,r)),t.uuid=r=>t.check(tm(Bi,r)),t.uuidv4=r=>t.check(rm(Bi,r)),t.uuidv6=r=>t.check(nm(Bi,r)),t.uuidv7=r=>t.check(im(Bi,r)),t.nanoid=r=>t.check(om(i_,r)),t.guid=r=>t.check(Vl(Cm,r)),t.cuid=r=>t.check(sm(a_,r)),t.cuid2=r=>t.check(cm(o_,r)),t.ulid=r=>t.check(lm(s_,r)),t.base64=r=>t.check(hm(f_,r)),t.base64url=r=>t.check(ym(g_,r)),t.xid=r=>t.check(um(c_,r)),t.ksuid=r=>t.check(dm(l_,r)),t.ipv4=r=>t.check(pm(u_,r)),t.ipv6=r=>t.check(mm(d_,r)),t.cidrv4=r=>t.check(fm(p_,r)),t.cidrv6=r=>t.check(gm(m_,r)),t.e164=r=>t.check(vm(h_,r)),t.datetime=r=>t.check(Fk(r)),t.date=r=>t.check(qk(r)),t.time=r=>t.check(Bk(r)),t.duration=r=>t.check(Vk(r))});function R(t){return sb(Kl,t)}var Be=w("ZodStringFormat",(t,e)=>{Le.init(t,e),t_.init(t,e)}),r_=w("ZodEmail",(t,e)=>{Ky.init(t,e),Be.init(t,e)});function k4(t){return em(r_,t)}var Cm=w("ZodGUID",(t,e)=>{Gy.init(t,e),Be.init(t,e)});function R4(t){return Vl(Cm,t)}var Bi=w("ZodUUID",(t,e)=>{Jy.init(t,e),Be.init(t,e)});function E4(t){return tm(Bi,t)}function A4(t){return rm(Bi,t)}function T4(t){return nm(Bi,t)}function O4(t){return im(Bi,t)}var Em=w("ZodURL",(t,e)=>{Yy.init(t,e),Be.init(t,e)});function D4(t){return Wl(Em,t)}function $4(t){return Wl(Em,{protocol:/^https?$/,hostname:Xr.domain,...O.normalizeParams(t)})}var n_=w("ZodEmoji",(t,e)=>{Xy.init(t,e),Be.init(t,e)});function N4(t){return am(n_,t)}var i_=w("ZodNanoID",(t,e)=>{Qy.init(t,e),Be.init(t,e)});function M4(t){return om(i_,t)}var a_=w("ZodCUID",(t,e)=>{ev.init(t,e),Be.init(t,e)});function j4(t){return sm(a_,t)}var o_=w("ZodCUID2",(t,e)=>{tv.init(t,e),Be.init(t,e)});function L4(t){return cm(o_,t)}var s_=w("ZodULID",(t,e)=>{rv.init(t,e),Be.init(t,e)});function U4(t){return lm(s_,t)}var c_=w("ZodXID",(t,e)=>{nv.init(t,e),Be.init(t,e)});function z4(t){return um(c_,t)}var l_=w("ZodKSUID",(t,e)=>{iv.init(t,e),Be.init(t,e)});function F4(t){return dm(l_,t)}var u_=w("ZodIPv4",(t,e)=>{lv.init(t,e),Be.init(t,e)});function q4(t){return pm(u_,t)}var nR=w("ZodMAC",(t,e)=>{dv.init(t,e),Be.init(t,e)});function B4(t){return lb(nR,t)}var d_=w("ZodIPv6",(t,e)=>{uv.init(t,e),Be.init(t,e)});function V4(t){return mm(d_,t)}var p_=w("ZodCIDRv4",(t,e)=>{pv.init(t,e),Be.init(t,e)});function W4(t){return fm(p_,t)}var m_=w("ZodCIDRv6",(t,e)=>{mv.init(t,e),Be.init(t,e)});function H4(t){return gm(m_,t)}var f_=w("ZodBase64",(t,e)=>{fv.init(t,e),Be.init(t,e)});function Z4(t){return hm(f_,t)}var g_=w("ZodBase64URL",(t,e)=>{gv.init(t,e),Be.init(t,e)});function G4(t){return ym(g_,t)}var h_=w("ZodE164",(t,e)=>{hv.init(t,e),Be.init(t,e)});function J4(t){return vm(h_,t)}var y_=w("ZodJWT",(t,e)=>{yv.init(t,e),Be.init(t,e)});function K4(t){return bm(y_,t)}var Yl=w("ZodCustomStringFormat",(t,e)=>{vv.init(t,e),Be.init(t,e)});function Y4(t,e,r={}){return rc(Yl,t,e,r)}function X4(t){return rc(Yl,"hostname",Xr.hostname,t)}function Q4(t){return rc(Yl,"hex",Xr.hex,t)}function eU(t,e){let r=e?.enc??"hex",n=`${t}_${r}`,i=Xr[n];if(!i)throw new Error(`Unrecognized hash format: ${n}`);return rc(Yl,n,i,e)}var Xl=w("ZodNumber",(t,e)=>{Gp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>ak(t,n,i,a),t.gt=(n,i)=>t.check(di(n,i)),t.gte=(n,i)=>t.check(cr(n,i)),t.min=(n,i)=>t.check(cr(n,i)),t.lt=(n,i)=>t.check(ui(n,i)),t.lte=(n,i)=>t.check(Mr(n,i)),t.max=(n,i)=>t.check(Mr(n,i)),t.int=n=>t.check(e_(n)),t.safe=n=>t.check(e_(n)),t.positive=n=>t.check(di(0,n)),t.nonnegative=n=>t.check(cr(0,n)),t.negative=n=>t.check(ui(0,n)),t.nonpositive=n=>t.check(Mr(0,n)),t.multipleOf=(n,i)=>t.check($a(n,i)),t.step=(n,i)=>t.check($a(n,i)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Ee(t){return gb(Xl,t)}var nc=w("ZodNumberFormat",(t,e)=>{bv.init(t,e),Xl.init(t,e)});function e_(t){return yb(nc,t)}function tU(t){return vb(nc,t)}function rU(t){return bb(nc,t)}function nU(t){return _b(nc,t)}function iU(t){return xb(nc,t)}var Ql=w("ZodBoolean",(t,e)=>{Ul.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ok(t,r,n,i)});function kt(t){return Sb(Ql,t)}var eu=w("ZodBigInt",(t,e)=>{Jp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>sk(t,n,i,a),t.gte=(n,i)=>t.check(cr(n,i)),t.min=(n,i)=>t.check(cr(n,i)),t.gt=(n,i)=>t.check(di(n,i)),t.gte=(n,i)=>t.check(cr(n,i)),t.min=(n,i)=>t.check(cr(n,i)),t.lt=(n,i)=>t.check(ui(n,i)),t.lte=(n,i)=>t.check(Mr(n,i)),t.max=(n,i)=>t.check(Mr(n,i)),t.positive=n=>t.check(di(BigInt(0),n)),t.negative=n=>t.check(ui(BigInt(0),n)),t.nonpositive=n=>t.check(Mr(BigInt(0),n)),t.nonnegative=n=>t.check(cr(BigInt(0),n)),t.multipleOf=(n,i)=>t.check($a(n,i));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function aU(t){return Ib(eu,t)}var v_=w("ZodBigIntFormat",(t,e)=>{_v.init(t,e),eu.init(t,e)});function oU(t){return Cb(v_,t)}function sU(t){return kb(v_,t)}var iR=w("ZodSymbol",(t,e)=>{xv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>ck(t,r,n,i)});function cU(t){return Rb(iR,t)}var aR=w("ZodUndefined",(t,e)=>{Sv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>uk(t,r,n,i)});function lU(t){return Eb(aR,t)}var oR=w("ZodNull",(t,e)=>{wv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>lk(t,r,n,i)});function tu(t){return Ab(oR,t)}var sR=w("ZodAny",(t,e)=>{Iv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>mk(t,r,n,i)});function uU(){return Tb(sR)}var cR=w("ZodUnknown",(t,e)=>{Pv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>fk(t,r,n,i)});function Ve(){return Ob(cR)}var lR=w("ZodNever",(t,e)=>{Cv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>pk(t,r,n,i)});function b_(t){return Db(lR,t)}var uR=w("ZodVoid",(t,e)=>{kv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>dk(t,r,n,i)});function dU(t){return $b(uR,t)}var Am=w("ZodDate",(t,e)=>{Rv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>gk(t,n,i,a),t.min=(n,i)=>t.check(cr(n,i)),t.max=(n,i)=>t.check(Mr(n,i));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function pU(t){return Nb(Am,t)}var dR=w("ZodArray",(t,e)=>{Ev.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>kk(t,r,n,i),t.element=e.element,t.min=(r,n)=>t.check(qi(r,n)),t.nonempty=r=>t.check(qi(1,r)),t.max=(r,n)=>t.check(No(r,n)),t.length=(r,n)=>t.check(Mo(r,n)),t.unwrap=()=>t.element});function me(t,e){return rk(dR,t,e)}function mU(t){let e=t._zod.def.shape;return ur(Object.keys(e))}var Tm=w("ZodObject",(t,e)=>{tk.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Rk(t,r,n,i),O.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>ur(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Ve()}),t.loose=()=>t.clone({...t._zod.def,catchall:Ve()}),t.strict=()=>t.clone({...t._zod.def,catchall:b_()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>O.extend(t,r),t.safeExtend=r=>O.safeExtend(t,r),t.merge=r=>O.merge(t,r),t.pick=r=>O.pick(t,r),t.omit=r=>O.omit(t,r),t.partial=(...r)=>O.partial(x_,t,r[0]),t.required=(...r)=>O.required(S_,t,r[0])});function F(t,e){let r={type:"object",shape:t??{},...O.normalizeParams(e)};return new Tm(r)}function fU(t,e){return new Tm({type:"object",shape:t,catchall:b_(),...O.normalizeParams(e)})}function lr(t,e){return new Tm({type:"object",shape:t,catchall:Ve(),...O.normalizeParams(e)})}var Om=w("ZodUnion",(t,e)=>{zl.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Hb(t,r,n,i),t.options=e.options});function Ue(t,e){return new Om({type:"union",options:t,...O.normalizeParams(e)})}var pR=w("ZodXor",(t,e)=>{Om.init(t,e),Av.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Hb(t,r,n,i),t.options=e.options});function gU(t,e){return new pR({type:"union",options:t,inclusive:!1,...O.normalizeParams(e)})}var mR=w("ZodDiscriminatedUnion",(t,e)=>{Om.init(t,e),Tv.init(t,e)});function Dm(t,e,r){return new mR({type:"union",options:e,discriminator:t,...O.normalizeParams(r)})}var fR=w("ZodIntersection",(t,e)=>{Ov.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ek(t,r,n,i)});function ru(t,e){return new fR({type:"intersection",left:t,right:e})}var gR=w("ZodTuple",(t,e)=>{Kp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ak(t,r,n,i),t.rest=r=>t.clone({...t._zod.def,rest:r})});function hR(t,e,r){let n=e instanceof te,i=n?r:e,a=n?e:null;return new gR({type:"tuple",items:t,rest:a,...O.normalizeParams(i)})}var $m=w("ZodRecord",(t,e)=>{Dv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Tk(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType});function Ge(t,e,r){return new $m({type:"record",keyType:t,valueType:e,...O.normalizeParams(r)})}function hU(t,e,r){let n=sr(t);return n._zod.values=void 0,new $m({type:"record",keyType:n,valueType:e,...O.normalizeParams(r)})}function yU(t,e,r){return new $m({type:"record",keyType:t,valueType:e,mode:"loose",...O.normalizeParams(r)})}var yR=w("ZodMap",(t,e)=>{$v.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Pk(t,r,n,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(pi(...r)),t.nonempty=r=>t.check(pi(1,r)),t.max=(...r)=>t.check(Na(...r)),t.size=(...r)=>t.check($o(...r))});function vU(t,e,r){return new yR({type:"map",keyType:t,valueType:e,...O.normalizeParams(r)})}var vR=w("ZodSet",(t,e)=>{Nv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ck(t,r,n,i),t.min=(...r)=>t.check(pi(...r)),t.nonempty=r=>t.check(pi(1,r)),t.max=(...r)=>t.check(Na(...r)),t.size=(...r)=>t.check($o(...r))});function bU(t,e){return new vR({type:"set",valueType:t,...O.normalizeParams(e)})}var Jl=w("ZodEnum",(t,e)=>{Mv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(n,i,a)=>hk(t,n,i,a),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,i)=>{let a={};for(let o of n)if(r.has(o))a[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new Jl({...e,checks:[],...O.normalizeParams(i),entries:a})},t.exclude=(n,i)=>{let a={...e.entries};for(let o of n)if(r.has(o))delete a[o];else throw new Error(`Key ${o} not found in enum`);return new Jl({...e,checks:[],...O.normalizeParams(i),entries:a})}});function ur(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Jl({type:"enum",entries:r,...O.normalizeParams(e)})}function _U(t,e){return new Jl({type:"enum",entries:t,...O.normalizeParams(e)})}var bR=w("ZodLiteral",(t,e)=>{jv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>yk(t,r,n,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function W(t,e){return new bR({type:"literal",values:Array.isArray(t)?t:[t],...O.normalizeParams(e)})}var _R=w("ZodFile",(t,e)=>{Lv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>_k(t,r,n,i),t.min=(r,n)=>t.check(pi(r,n)),t.max=(r,n)=>t.check(Na(r,n)),t.mime=(r,n)=>t.check(Ys(Array.isArray(r)?r:[r],n))});function xU(t){return Lb(_R,t)}var xR=w("ZodTransform",(t,e)=>{Uv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ik(t,r,n,i),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Ro(t.constructor.name);r.addIssue=a=>{if(typeof a=="string")r.issues.push(O.issue(a,r.value,e));else{let o=a;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(O.issue(o))}};let i=e.transform(r.value,r);return i instanceof Promise?i.then(a=>(r.value=a,r)):(r.value=i,r)}});function __(t){return new xR({type:"transform",transform:t})}var x_=w("ZodOptional",(t,e)=>{Yp.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Zb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function et(t){return new x_({type:"optional",innerType:t})}var SR=w("ZodExactOptional",(t,e)=>{zv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Zb(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function wR(t){return new SR({type:"optional",innerType:t})}var IR=w("ZodNullable",(t,e)=>{Fv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Ok(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function km(t){return new IR({type:"nullable",innerType:t})}function SU(t){return et(km(t))}var PR=w("ZodDefault",(t,e)=>{qv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>$k(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function CR(t,e){return new PR({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var kR=w("ZodPrefault",(t,e)=>{Bv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Nk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function RR(t,e){return new kR({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():O.shallowClone(e)}})}var S_=w("ZodNonOptional",(t,e)=>{Vv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Dk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function ER(t,e){return new S_({type:"nonoptional",innerType:t,...O.normalizeParams(e)})}var AR=w("ZodSuccess",(t,e)=>{Wv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>xk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function wU(t){return new AR({type:"success",innerType:t})}var TR=w("ZodCatch",(t,e)=>{Hv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Mk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function OR(t,e){return new TR({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var DR=w("ZodNaN",(t,e)=>{Zv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>vk(t,r,n,i)});function IU(t){return jb(DR,t)}var w_=w("ZodPipe",(t,e)=>{Gv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>jk(t,r,n,i),t.in=e.in,t.out=e.out});function Rm(t,e){return new w_({type:"pipe",in:t,out:e})}var I_=w("ZodCodec",(t,e)=>{w_.init(t,e),Fl.init(t,e)});function PU(t,e,r){return new I_({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}var $R=w("ZodReadonly",(t,e)=>{Jv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Lk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function NR(t){return new $R({type:"readonly",innerType:t})}var MR=w("ZodTemplateLiteral",(t,e)=>{Kv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>bk(t,r,n,i)});function CU(t,e){return new MR({type:"template_literal",parts:t,...O.normalizeParams(e)})}var jR=w("ZodLazy",(t,e)=>{Qv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>zk(t,r,n,i),t.unwrap=()=>t._zod.def.getter()});function LR(t){return new jR({type:"lazy",getter:t})}var UR=w("ZodPromise",(t,e)=>{Xv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Uk(t,r,n,i),t.unwrap=()=>t._zod.def.innerType});function kU(t){return new UR({type:"promise",innerType:t})}var zR=w("ZodFunction",(t,e)=>{Yv.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>wk(t,r,n,i)});function RU(t){return new zR({type:"function",input:Array.isArray(t?.input)?hR(t?.input):t?.input??me(Ve()),output:t?.output??Ve()})}var Nm=w("ZodCustom",(t,e)=>{eb.init(t,e),ae.init(t,e),t._zod.processJSONSchema=(r,n,i)=>Sk(t,r,n,i)});function EU(t){let e=new qe({check:"custom"});return e._zod.check=t,e}function P_(t,e){return Ub(Nm,t??(()=>!0),e)}function FR(t,e={}){return zb(Nm,t,e)}function qR(t){return Fb(t)}var AU=qb,TU=Bb;function OU(t,e={}){let r=new Nm({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...O.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=n=>{n.value instanceof t||n.issues.push({code:"invalid_type",expected:t.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var DU=(...t)=>Vb({Codec:I_,Boolean:Ql,String:Kl},...t);function $U(t){let e=LR(()=>Ue([R(t),Ee(),kt(),tu(),me(e),Ge(R(),e)]));return e}function Mm(t,e){return Rm(__(t),e)}var Vne={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Wne(t){ht({customError:t})}function Hne(){return ht().customError}var BR;BR||(BR={});var L={...Pm,...Jb,iso:zo},Zne=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function Gne(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function Jne(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let n=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===n){let i=r[1];if(!i||!e.defs[i])throw new Error(`Reference not found: ${t}`);return e.defs[i]}throw new Error(`Reference not found: ${t}`)}function NU(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let i=t.$ref;if(e.refs.has(i))return e.refs.get(i);if(e.processing.has(i))return L.lazy(()=>{if(!e.refs.has(i))throw new Error(`Circular reference not resolved: ${i}`);return e.refs.get(i)});e.processing.add(i);let a=Jne(i,e),o=Pr(a,e);return e.refs.set(i,o),e.processing.delete(i),o}if(t.enum!==void 0){let i=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&i.length===1&&i[0]===null)return L.null();if(i.length===0)return L.never();if(i.length===1)return L.literal(i[0]);if(i.every(o=>typeof o=="string"))return L.enum(i);let a=i.map(o=>L.literal(o));return a.length<2?a[0]:L.union([a[0],a[1],...a.slice(2)])}if(t.const!==void 0)return L.literal(t.const);let r=t.type;if(Array.isArray(r)){let i=r.map(a=>{let o={...t,type:a};return NU(o,e)});return i.length===0?L.never():i.length===1?i[0]:L.union(i)}if(!r)return L.any();let n;switch(r){case"string":{let i=L.string();if(t.format){let a=t.format;a==="email"?i=i.check(L.email()):a==="uri"||a==="uri-reference"?i=i.check(L.url()):a==="uuid"||a==="guid"?i=i.check(L.uuid()):a==="date-time"?i=i.check(L.iso.datetime()):a==="date"?i=i.check(L.iso.date()):a==="time"?i=i.check(L.iso.time()):a==="duration"?i=i.check(L.iso.duration()):a==="ipv4"?i=i.check(L.ipv4()):a==="ipv6"?i=i.check(L.ipv6()):a==="mac"?i=i.check(L.mac()):a==="cidr"?i=i.check(L.cidrv4()):a==="cidr-v6"?i=i.check(L.cidrv6()):a==="base64"?i=i.check(L.base64()):a==="base64url"?i=i.check(L.base64url()):a==="e164"?i=i.check(L.e164()):a==="jwt"?i=i.check(L.jwt()):a==="emoji"?i=i.check(L.emoji()):a==="nanoid"?i=i.check(L.nanoid()):a==="cuid"?i=i.check(L.cuid()):a==="cuid2"?i=i.check(L.cuid2()):a==="ulid"?i=i.check(L.ulid()):a==="xid"?i=i.check(L.xid()):a==="ksuid"&&(i=i.check(L.ksuid()))}typeof t.minLength=="number"&&(i=i.min(t.minLength)),typeof t.maxLength=="number"&&(i=i.max(t.maxLength)),t.pattern&&(i=i.regex(new RegExp(t.pattern))),n=i;break}case"number":case"integer":{let i=r==="integer"?L.number().int():L.number();typeof t.minimum=="number"&&(i=i.min(t.minimum)),typeof t.maximum=="number"&&(i=i.max(t.maximum)),typeof t.exclusiveMinimum=="number"?i=i.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(i=i.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?i=i.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(i=i.lt(t.maximum)),typeof t.multipleOf=="number"&&(i=i.multipleOf(t.multipleOf)),n=i;break}case"boolean":{n=L.boolean();break}case"null":{n=L.null();break}case"object":{let i={},a=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(a)){let u=Pr(l,e);i[c]=o.has(c)?u:u.optional()}if(t.propertyNames){let c=Pr(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?Pr(t.additionalProperties,e):L.any();if(Object.keys(i).length===0){n=L.record(c,l);break}let u=L.object(i).passthrough(),d=L.looseRecord(c,l);n=L.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let p of l){let m=Pr(c[p],e),f=L.string().regex(new RegExp(p));u.push(L.looseRecord(f,m))}let d=[];if(Object.keys(i).length>0&&d.push(L.object(i).passthrough()),d.push(...u),d.length===0)n=L.object({}).passthrough();else if(d.length===1)n=d[0];else{let p=L.intersection(d[0],d[1]);for(let m=2;m<d.length;m++)p=L.intersection(p,d[m]);n=p}break}let s=L.object(i);t.additionalProperties===!1?n=s.strict():typeof t.additionalProperties=="object"?n=s.catchall(Pr(t.additionalProperties,e)):n=s.passthrough();break}case"array":{let i=t.prefixItems,a=t.items;if(i&&Array.isArray(i)){let o=i.map(c=>Pr(c,e)),s=a&&typeof a=="object"&&!Array.isArray(a)?Pr(a,e):void 0;s?n=L.tuple(o).rest(s):n=L.tuple(o),typeof t.minItems=="number"&&(n=n.check(L.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(L.maxLength(t.maxItems)))}else if(Array.isArray(a)){let o=a.map(c=>Pr(c,e)),s=t.additionalItems&&typeof t.additionalItems=="object"?Pr(t.additionalItems,e):void 0;s?n=L.tuple(o).rest(s):n=L.tuple(o),typeof t.minItems=="number"&&(n=n.check(L.minLength(t.minItems))),typeof t.maxItems=="number"&&(n=n.check(L.maxLength(t.maxItems)))}else if(a!==void 0){let o=Pr(a,e),s=L.array(o);typeof t.minItems=="number"&&(s=s.min(t.minItems)),typeof t.maxItems=="number"&&(s=s.max(t.maxItems)),n=s}else n=L.array(L.any());break}default:throw new Error(`Unsupported type: ${r}`)}return t.description&&(n=n.describe(t.description)),t.default!==void 0&&(n=n.default(t.default)),n}function Pr(t,e){if(typeof t=="boolean")return t?L.any():L.never();let r=NU(t,e),n=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let s=t.anyOf.map(l=>Pr(l,e)),c=L.union(s);r=n?L.intersection(r,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){let s=t.oneOf.map(l=>Pr(l,e)),c=L.xor(s);r=n?L.intersection(r,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=n?r:L.any();else{let s=n?r:Pr(t.allOf[0],e),c=n?0:1;for(let l=c;l<t.allOf.length;l++)s=L.intersection(s,Pr(t.allOf[l],e));r=s}t.nullable===!0&&e.version==="openapi-3.0"&&(r=L.nullable(r)),t.readOnly===!0&&(r=L.readonly(r));let i={},a=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let s of a)s in t&&(i[s]=t[s]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let s of o)s in t&&(i[s]=t[s]);for(let s of Object.keys(t))Zne.has(s)||(i[s]=t[s]);return Object.keys(i).length>0&&e.registry.add(r,i),r}function MU(t,e){if(typeof t=="boolean")return t?L.any():L.never();let r=Gne(t,e?.defaultTarget),n=t.$defs||t.definitions||{},i={version:r,defs:n,refs:new Map,processing:new Set,rootSchema:t,registry:e?.registry??Zt};return Pr(t,i)}var VR={};wr(VR,{bigint:()=>Qne,boolean:()=>Xne,date:()=>eie,number:()=>Yne,string:()=>Kne});function Kne(t){return cb(Kl,t)}function Yne(t){return hb(Xl,t)}function Xne(t){return wb(Ql,t)}function Qne(t){return Pb(eu,t)}function eie(t){return Mb(Am,t)}ht(tb());var HR="2025-11-25";var jU=[HR,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Fo="io.modelcontextprotocol/related-task",k_="2.0",dr=P_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),LU=Ue([R(),Ee().int()]),UU=R(),VFe=lr({ttl:Ue([Ee(),tu()]).optional(),pollInterval:Ee().optional()}),rie=F({ttl:Ee().optional()}),nie=F({taskId:R()}),ZR=lr({progressToken:LU.optional(),[Fo]:nie.optional()}),wn=F({_meta:ZR.optional()}),jm=wn.extend({task:rie.optional()}),zU=t=>jm.safeParse(t).success,pr=F({method:R(),params:wn.loose().optional()}),Fn=F({_meta:ZR.optional()}),qn=F({method:R(),params:Fn.loose().optional()}),mr=lr({_meta:ZR.optional()}),R_=Ue([R(),Ee().int()]),FU=F({jsonrpc:W(k_),id:R_,...pr.shape}).strict(),GR=t=>FU.safeParse(t).success,qU=F({jsonrpc:W(k_),...qn.shape}).strict(),BU=t=>qU.safeParse(t).success,JR=F({jsonrpc:W(k_),id:R_,result:mr}).strict(),Lm=t=>JR.safeParse(t).success;var Se;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Se||(Se={}));var KR=F({jsonrpc:W(k_),id:R_.optional(),error:F({code:Ee().int(),message:R(),data:Ve().optional()})}).strict();var VU=t=>KR.safeParse(t).success;var WU=Ue([FU,qU,JR,KR]),WFe=Ue([JR,KR]),E_=mr.strict(),iie=Fn.extend({requestId:R_.optional(),reason:R().optional()}),A_=qn.extend({method:W("notifications/cancelled"),params:iie}),aie=F({src:R(),mimeType:R().optional(),sizes:me(R()).optional(),theme:ur(["light","dark"]).optional()}),Um=F({icons:me(aie).optional()}),nu=F({name:R(),title:R().optional()}),HU=nu.extend({...nu.shape,...Um.shape,version:R(),websiteUrl:R().optional(),description:R().optional()}),oie=ru(F({applyDefaults:kt().optional()}),Ge(R(),Ve())),sie=Mm(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,ru(F({form:oie.optional(),url:dr.optional()}),Ge(R(),Ve()).optional())),cie=lr({list:dr.optional(),cancel:dr.optional(),requests:lr({sampling:lr({createMessage:dr.optional()}).optional(),elicitation:lr({create:dr.optional()}).optional()}).optional()}),lie=lr({list:dr.optional(),cancel:dr.optional(),requests:lr({tools:lr({call:dr.optional()}).optional()}).optional()}),uie=F({experimental:Ge(R(),dr).optional(),sampling:F({context:dr.optional(),tools:dr.optional()}).optional(),elicitation:sie.optional(),roots:F({listChanged:kt().optional()}).optional(),tasks:cie.optional()}),die=wn.extend({protocolVersion:R(),capabilities:uie,clientInfo:HU}),YR=pr.extend({method:W("initialize"),params:die});var pie=F({experimental:Ge(R(),dr).optional(),logging:dr.optional(),completions:dr.optional(),prompts:F({listChanged:kt().optional()}).optional(),resources:F({subscribe:kt().optional(),listChanged:kt().optional()}).optional(),tools:F({listChanged:kt().optional()}).optional(),tasks:lie.optional()}),mie=mr.extend({protocolVersion:R(),capabilities:pie,serverInfo:HU,instructions:R().optional()}),XR=qn.extend({method:W("notifications/initialized"),params:Fn.optional()});var T_=pr.extend({method:W("ping"),params:wn.optional()}),fie=F({progress:Ee(),total:et(Ee()),message:et(R())}),gie=F({...Fn.shape,...fie.shape,progressToken:LU}),O_=qn.extend({method:W("notifications/progress"),params:gie}),hie=wn.extend({cursor:UU.optional()}),zm=pr.extend({params:hie.optional()}),Fm=mr.extend({nextCursor:UU.optional()}),yie=ur(["working","input_required","completed","failed","cancelled"]),qm=F({taskId:R(),status:yie,ttl:Ue([Ee(),tu()]),createdAt:R(),lastUpdatedAt:R(),pollInterval:et(Ee()),statusMessage:et(R())}),iu=mr.extend({task:qm}),vie=Fn.merge(qm),Bm=qn.extend({method:W("notifications/tasks/status"),params:vie}),D_=pr.extend({method:W("tasks/get"),params:wn.extend({taskId:R()})}),$_=mr.merge(qm),N_=pr.extend({method:W("tasks/result"),params:wn.extend({taskId:R()})}),HFe=mr.loose(),M_=zm.extend({method:W("tasks/list")}),j_=Fm.extend({tasks:me(qm)}),L_=pr.extend({method:W("tasks/cancel"),params:wn.extend({taskId:R()})}),ZU=mr.merge(qm),GU=F({uri:R(),mimeType:et(R()),_meta:Ge(R(),Ve()).optional()}),JU=GU.extend({text:R()}),QR=R().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),KU=GU.extend({blob:QR}),Vm=ur(["user","assistant"]),au=F({audience:me(Vm).optional(),priority:Ee().min(0).max(1).optional(),lastModified:zo.datetime({offset:!0}).optional()}),YU=F({...nu.shape,...Um.shape,uri:R(),description:et(R()),mimeType:et(R()),annotations:au.optional(),_meta:et(lr({}))}),bie=F({...nu.shape,...Um.shape,uriTemplate:R(),description:et(R()),mimeType:et(R()),annotations:au.optional(),_meta:et(lr({}))}),eE=zm.extend({method:W("resources/list")}),_ie=Fm.extend({resources:me(YU)}),xie=zm.extend({method:W("resources/templates/list")}),Sie=Fm.extend({resourceTemplates:me(bie)}),tE=wn.extend({uri:R()}),wie=tE,rE=pr.extend({method:W("resources/read"),params:wie}),Iie=mr.extend({contents:me(Ue([JU,KU]))}),Pie=qn.extend({method:W("notifications/resources/list_changed"),params:Fn.optional()}),Cie=tE,kie=pr.extend({method:W("resources/subscribe"),params:Cie}),Rie=tE,Eie=pr.extend({method:W("resources/unsubscribe"),params:Rie}),Aie=Fn.extend({uri:R()}),Tie=qn.extend({method:W("notifications/resources/updated"),params:Aie}),Oie=F({name:R(),description:et(R()),required:et(kt())}),Die=F({...nu.shape,...Um.shape,description:et(R()),arguments:et(me(Oie)),_meta:et(lr({}))}),$ie=zm.extend({method:W("prompts/list")}),Nie=Fm.extend({prompts:me(Die)}),Mie=wn.extend({name:R(),arguments:Ge(R(),R()).optional()}),jie=pr.extend({method:W("prompts/get"),params:Mie}),nE=F({type:W("text"),text:R(),annotations:au.optional(),_meta:Ge(R(),Ve()).optional()}),iE=F({type:W("image"),data:QR,mimeType:R(),annotations:au.optional(),_meta:Ge(R(),Ve()).optional()}),aE=F({type:W("audio"),data:QR,mimeType:R(),annotations:au.optional(),_meta:Ge(R(),Ve()).optional()}),Lie=F({type:W("tool_use"),name:R(),id:R(),input:Ge(R(),Ve()),_meta:Ge(R(),Ve()).optional()}),Uie=F({type:W("resource"),resource:Ue([JU,KU]),annotations:au.optional(),_meta:Ge(R(),Ve()).optional()}),zie=YU.extend({type:W("resource_link")}),oE=Ue([nE,iE,aE,zie,Uie]),Fie=F({role:Vm,content:oE}),qie=mr.extend({description:R().optional(),messages:me(Fie)}),Bie=qn.extend({method:W("notifications/prompts/list_changed"),params:Fn.optional()}),Vie=F({title:R().optional(),readOnlyHint:kt().optional(),destructiveHint:kt().optional(),idempotentHint:kt().optional(),openWorldHint:kt().optional()}),Wie=F({taskSupport:ur(["required","optional","forbidden"]).optional()}),XU=F({...nu.shape,...Um.shape,description:R().optional(),inputSchema:F({type:W("object"),properties:Ge(R(),dr).optional(),required:me(R()).optional()}).catchall(Ve()),outputSchema:F({type:W("object"),properties:Ge(R(),dr).optional(),required:me(R()).optional()}).catchall(Ve()).optional(),annotations:Vie.optional(),execution:Wie.optional(),_meta:Ge(R(),Ve()).optional()}),sE=zm.extend({method:W("tools/list")}),Hie=Fm.extend({tools:me(XU)}),U_=mr.extend({content:me(oE).default([]),structuredContent:Ge(R(),Ve()).optional(),isError:kt().optional()}),ZFe=U_.or(mr.extend({toolResult:Ve()})),Zie=jm.extend({name:R(),arguments:Ge(R(),Ve()).optional()}),Wm=pr.extend({method:W("tools/call"),params:Zie}),Gie=qn.extend({method:W("notifications/tools/list_changed"),params:Fn.optional()}),GFe=F({autoRefresh:kt().default(!0),debounceMs:Ee().int().nonnegative().default(300)}),Hm=ur(["debug","info","notice","warning","error","critical","alert","emergency"]),Jie=wn.extend({level:Hm}),cE=pr.extend({method:W("logging/setLevel"),params:Jie}),Kie=Fn.extend({level:Hm,logger:R().optional(),data:Ve()}),Yie=qn.extend({method:W("notifications/message"),params:Kie}),Xie=F({name:R().optional()}),Qie=F({hints:me(Xie).optional(),costPriority:Ee().min(0).max(1).optional(),speedPriority:Ee().min(0).max(1).optional(),intelligencePriority:Ee().min(0).max(1).optional()}),eae=F({mode:ur(["auto","required","none"]).optional()}),tae=F({type:W("tool_result"),toolUseId:R().describe("The unique identifier for the corresponding tool call."),content:me(oE).default([]),structuredContent:F({}).loose().optional(),isError:kt().optional(),_meta:Ge(R(),Ve()).optional()}),rae=Dm("type",[nE,iE,aE]),C_=Dm("type",[nE,iE,aE,Lie,tae]),nae=F({role:Vm,content:Ue([C_,me(C_)]),_meta:Ge(R(),Ve()).optional()}),iae=jm.extend({messages:me(nae),modelPreferences:Qie.optional(),systemPrompt:R().optional(),includeContext:ur(["none","thisServer","allServers"]).optional(),temperature:Ee().optional(),maxTokens:Ee().int(),stopSequences:me(R()).optional(),metadata:dr.optional(),tools:me(XU).optional(),toolChoice:eae.optional()}),aae=pr.extend({method:W("sampling/createMessage"),params:iae}),lE=mr.extend({model:R(),stopReason:et(ur(["endTurn","stopSequence","maxTokens"]).or(R())),role:Vm,content:rae}),uE=mr.extend({model:R(),stopReason:et(ur(["endTurn","stopSequence","maxTokens","toolUse"]).or(R())),role:Vm,content:Ue([C_,me(C_)])}),oae=F({type:W("boolean"),title:R().optional(),description:R().optional(),default:kt().optional()}),sae=F({type:W("string"),title:R().optional(),description:R().optional(),minLength:Ee().optional(),maxLength:Ee().optional(),format:ur(["email","uri","date","date-time"]).optional(),default:R().optional()}),cae=F({type:ur(["number","integer"]),title:R().optional(),description:R().optional(),minimum:Ee().optional(),maximum:Ee().optional(),default:Ee().optional()}),lae=F({type:W("string"),title:R().optional(),description:R().optional(),enum:me(R()),default:R().optional()}),uae=F({type:W("string"),title:R().optional(),description:R().optional(),oneOf:me(F({const:R(),title:R()})),default:R().optional()}),dae=F({type:W("string"),title:R().optional(),description:R().optional(),enum:me(R()),enumNames:me(R()).optional(),default:R().optional()}),pae=Ue([lae,uae]),mae=F({type:W("array"),title:R().optional(),description:R().optional(),minItems:Ee().optional(),maxItems:Ee().optional(),items:F({type:W("string"),enum:me(R())}),default:me(R()).optional()}),fae=F({type:W("array"),title:R().optional(),description:R().optional(),minItems:Ee().optional(),maxItems:Ee().optional(),items:F({anyOf:me(F({const:R(),title:R()}))}),default:me(R()).optional()}),gae=Ue([mae,fae]),hae=Ue([dae,pae,gae]),yae=Ue([hae,oae,sae,cae]),vae=jm.extend({mode:W("form").optional(),message:R(),requestedSchema:F({type:W("object"),properties:Ge(R(),yae),required:me(R()).optional()})}),bae=jm.extend({mode:W("url"),message:R(),elicitationId:R(),url:R().url()}),_ae=Ue([vae,bae]),xae=pr.extend({method:W("elicitation/create"),params:_ae}),Sae=Fn.extend({elicitationId:R()}),wae=qn.extend({method:W("notifications/elicitation/complete"),params:Sae}),z_=mr.extend({action:ur(["accept","decline","cancel"]),content:Mm(t=>t===null?void 0:t,Ge(R(),Ue([R(),Ee(),kt(),me(R())])).optional())}),Iae=F({type:W("ref/resource"),uri:R()});var Pae=F({type:W("ref/prompt"),name:R()}),Cae=wn.extend({ref:Ue([Pae,Iae]),argument:F({name:R(),value:R()}),context:F({arguments:Ge(R(),R()).optional()}).optional()}),kae=pr.extend({method:W("completion/complete"),params:Cae});var Rae=mr.extend({completion:lr({values:me(R()).max(100),total:et(Ee().int()),hasMore:et(kt())})}),Eae=F({uri:R().startsWith("file://"),name:R().optional(),_meta:Ge(R(),Ve()).optional()}),Aae=pr.extend({method:W("roots/list"),params:wn.optional()}),dE=mr.extend({roots:me(Eae)}),Tae=qn.extend({method:W("notifications/roots/list_changed"),params:Fn.optional()}),JFe=Ue([T_,YR,kae,cE,jie,$ie,eE,xie,rE,kie,Eie,Wm,sE,D_,N_,M_,L_]),KFe=Ue([A_,O_,XR,Tae,Bm]),YFe=Ue([E_,lE,uE,z_,dE,$_,j_,iu]),XFe=Ue([T_,aae,xae,Aae,D_,N_,M_,L_]),QFe=Ue([A_,O_,Yie,Tie,Pie,Gie,Bie,Bm,wae]),eqe=Ue([E_,mie,Rae,qie,Nie,_ie,Sie,Iie,U_,Hie,$_,j_,iu]),ue=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===Se.UrlElicitationRequired&&n){let i=n;if(i.elicitations)return new WR(i.elicitations,r)}return new t(e,r,n)}},WR=class extends ue{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(Se.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};var F_=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
|
|
244
244
|
`);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),Oae(r)}clear(){this._buffer=void 0}};function Oae(t){return WU.parse(JSON.parse(t))}function QU(t){return JSON.stringify(t)+`
|
|
245
|
-
`}var q_=class{constructor(e=ez.stdin,r=ez.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new F_,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=QU(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var B_=class{startPromise=null;stopPromise=null;start(e){return this.startPromise??=e(),this.startPromise}stop(e){return this.stopPromise??=(async()=>{this.startPromise&&await this.startPromise.catch(()=>{}),await e()})(),this.stopPromise}};var be;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(be||(be={}));var tz;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(tz||(tz={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ma=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var D=be.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"]);var In=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};In.create=t=>new In(t);var Dae=(t,e)=>{let r;switch(t.code){case D.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case D.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case D.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=e.defaultError,be.assertNever(t)}return{message:r}},qo=Dae;var $ae=qo;function Zm(){return $ae}var V_=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)s=l(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function U(t,e){let r=Zm(),n=V_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qo?void 0:qo].filter(i=>!!i)});t.common.issues.push(n)}var Cr=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Y;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return Y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},Y=Object.freeze({status:"aborted"}),ou=t=>({status:"dirty",value:t}),Lr=t=>({status:"valid",value:t}),pE=t=>t.status==="aborted",mE=t=>t.status==="dirty",ic=t=>t.status==="valid",Gm=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Bn=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},rz=(t,e)=>{if(ic(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new In(t.common.issues);return this._error=r,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:i}}var fe=class{get description(){return this._def.description}_getType(e){return Ma(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Cr,ctx:{common:e.parent.common,data:e.data,parsedType:Ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Gm(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)},i=this._parseSync({data:e,path:n.path,parent:n});return rz(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ic(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ic(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Gm(i)?i:Promise.resolve(i));return rz(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:D.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new fi({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return mi.create(this,this._def)}nullable(){return Ua.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vo.create(this)}promise(){return ac.create(this,this._def)}or(e){return du.create([this,e],this._def)}and(e){return pu.create(this,e,this._def)}transform(e){return new fi({...oe(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new yu({...oe(this._def),innerType:this,defaultValue:r,typeName:J.ZodDefault})}brand(){return new W_({typeName:J.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vu({...oe(this._def),innerType:this,catchValue:r,typeName:J.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return H_.create(this,e)}readonly(){return bu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Nae=/^c[^\s-]{8,}$/i,Mae=/^[0-9a-z]+$/,jae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lae=/^[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,Uae=/^[a-z0-9_-]{21}$/i,zae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fae=/^[-+]?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)?)??$/,qae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fE,Vae=/^(?:(?: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])$/,Wae=/^(?:(?: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])$/,Hae=/^(([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]))$/,Zae=/^(([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])$/,Gae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nz="((\\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])))",Kae=new RegExp(`^${nz}$`);function iz(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Yae(t){return new RegExp(`^${iz(t)}$`)}function Xae(t){let e=`${nz}T${iz(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Qae(t,e){return!!((e==="v4"||!e)&&Vae.test(t)||(e==="v6"||!e)&&Hae.test(t))}function eoe(t,e){if(!zae.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function toe(t,e){return!!((e==="v4"||!e)&&Wae.test(t)||(e==="v6"||!e)&&Zae.test(t))}var cu=class t extends fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.string,received:a.parsedType}),Y}let n=new Cr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?U(i,{code:D.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&U(i,{code:D.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")qae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")fE||(fE=new RegExp(Bae,"u")),fE.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Lae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Uae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Nae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Mae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")jae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:D.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:D.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Xae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Kae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Yae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Fae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Qae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?eoe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?toe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Gae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Jae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:D.invalid_string,message:a.message}),n.dirty()):be.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:D.invalid_string,...V.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cu.create=t=>new cu({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...oe(t)});function roe(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}var Jm=class t extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.number,received:a.parsedType}),Y}let n,i=new Cr;for(let a of this._def.checks)a.kind==="int"?be.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:D.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?roe(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_finite,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Jm.create=t=>new Jm({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Km=class t extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let n,i=new Cr;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:D.invalid_type,expected:q.bigint,received:r.parsedType}),Y}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Km.create=t=>new Km({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var Ym=class extends fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.boolean,received:n.parsedType}),Y}return Lr(e.data)}};Ym.create=t=>new Ym({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Xm=class t extends fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.date,received:a.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_date}),Y}let n=new Cr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):be.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Xm.create=t=>new Xm({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...oe(t)});var Qm=class extends fe{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.symbol,received:n.parsedType}),Y}return Lr(e.data)}};Qm.create=t=>new Qm({typeName:J.ZodSymbol,...oe(t)});var lu=class extends fe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.undefined,received:n.parsedType}),Y}return Lr(e.data)}};lu.create=t=>new lu({typeName:J.ZodUndefined,...oe(t)});var uu=class extends fe{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.null,received:n.parsedType}),Y}return Lr(e.data)}};uu.create=t=>new uu({typeName:J.ZodNull,...oe(t)});var ef=class extends fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Lr(e.data)}};ef.create=t=>new ef({typeName:J.ZodAny,...oe(t)});var Bo=class extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lr(e.data)}};Bo.create=t=>new Bo({typeName:J.ZodUnknown,...oe(t)});var Vi=class extends fe{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:D.invalid_type,expected:q.never,received:r.parsedType}),Y}};Vi.create=t=>new Vi({typeName:J.ZodNever,...oe(t)});var tf=class extends fe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.void,received:n.parsedType}),Y}return Lr(e.data)}};tf.create=t=>new tf({typeName:J.ZodVoid,...oe(t)});var Vo=class t extends fe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:D.invalid_type,expected:q.array,received:r.parsedType}),Y;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(U(r,{code:o?D.too_big:D.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:D.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:D.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Bn(r,o,r.path,s)))).then(o=>Cr.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new Bn(r,o,r.path,s)));return Cr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};Vo.create=(t,e)=>new Vo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...oe(e)});function su(t){if(t instanceof Pn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=mi.create(su(n))}return new Pn({...t._def,shape:()=>e})}else return t instanceof Vo?new Vo({...t._def,type:su(t.element)}):t instanceof mi?mi.create(su(t.unwrap())):t instanceof Ua?Ua.create(su(t.unwrap())):t instanceof La?La.create(t.items.map(e=>su(e))):t}var Pn=class t extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=be.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:D.invalid_type,expected:q.object,received:l.parsedType}),Y}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Vi&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||s.push(l);let c=[];for(let l of o){let u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Bn(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Vi){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")s.length>0&&(U(i,{code:D.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of s){let d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Bn(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>Cr.mergeObjectSync(n,l)):Cr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:V.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of be.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of be.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return su(this)}partial(e){let r={};for(let n of be.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of be.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof mi;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return az(be.objectKeys(this.shape))}};Pn.create=(t,e)=>new Pn({shape:()=>t,unknownKeys:"strip",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});Pn.strictCreate=(t,e)=>new Pn({shape:()=>t,unknownKeys:"strict",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});Pn.lazycreate=(t,e)=>new Pn({shape:t,unknownKeys:"strip",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});var du=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new In(s.ctx.common.issues));return U(r,{code:D.invalid_union,unionErrors:o}),Y}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(c=>new In(c));return U(r,{code:D.invalid_union,unionErrors:s}),Y}}get options(){return this._def.options}};du.create=(t,e)=>new du({options:t,typeName:J.ZodUnion,...oe(e)});var ja=t=>t instanceof mu?ja(t.schema):t instanceof fi?ja(t.innerType()):t instanceof fu?[t.value]:t instanceof gu?t.options:t instanceof hu?be.objectValues(t.enum):t instanceof yu?ja(t._def.innerType):t instanceof lu?[void 0]:t instanceof uu?[null]:t instanceof mi?[void 0,...ja(t.unwrap())]:t instanceof Ua?[null,...ja(t.unwrap())]:t instanceof W_||t instanceof bu?ja(t.unwrap()):t instanceof vu?ja(t._def.innerType):[],gE=class t extends fe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:D.invalid_type,expected:q.object,received:r.parsedType}),Y;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=ja(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...oe(n)})}};function hE(t,e){let r=Ma(t),n=Ma(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&n===q.object){let i=be.objectKeys(e),a=be.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=hE(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===q.array&&n===q.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],c=hE(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pu=class extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(pE(a)||pE(o))return Y;let s=hE(a.value,o.value);return s.valid?((mE(a)||mE(o))&&r.dirty(),{status:r.value,value:s.data}):(U(n,{code:D.invalid_intersection_types}),Y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};pu.create=(t,e,r)=>new pu({left:t,right:e,typeName:J.ZodIntersection,...oe(r)});var La=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return U(n,{code:D.invalid_type,expected:q.array,received:n.parsedType}),Y;if(n.data.length<this._def.items.length)return U(n,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Bn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Cr.mergeArray(r,o)):Cr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};La.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new La({items:t,typeName:J.ZodTuple,rest:null,...oe(e)})};var yE=class t extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return U(n,{code:D.invalid_type,expected:q.object,received:n.parsedType}),Y;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new Bn(n,s,n.path,s)),value:o._parse(new Bn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Cr.mergeObjectAsync(r,i):Cr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof fe?new t({keyType:e,valueType:r,typeName:J.ZodRecord,...oe(n)}):new t({keyType:cu.create(),valueType:e,typeName:J.ZodRecord,...oe(r)})}},rf=class extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.map)return U(n,{code:D.invalid_type,expected:q.map,received:n.parsedType}),Y;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new Bn(n,s,n.path,[l,"key"])),value:a._parse(new Bn(n,c,n.path,[l,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};rf.create=(t,e,r)=>new rf({valueType:e,keyType:t,typeName:J.ZodMap,...oe(r)});var nf=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return U(n,{code:D.invalid_type,expected:q.set,received:n.parsedType}),Y;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:D.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:D.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Y;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let s=[...n.data.values()].map((c,l)=>a._parse(new Bn(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};nf.create=(t,e)=>new nf({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...oe(e)});var vE=class t extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:D.invalid_type,expected:q.function,received:r.parsedType}),Y;function n(s,c){return V_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zm(),qo].filter(l=>!!l),issueData:{code:D.invalid_arguments,argumentsError:c}})}function i(s,c){return V_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zm(),qo].filter(l=>!!l),issueData:{code:D.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof ac){let s=this;return Lr(async function(...c){let l=new In([]),u=await s._def.args.parseAsync(c,a).catch(m=>{throw l.addIssue(n(c,m)),l}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,a).catch(m=>{throw l.addIssue(i(d,m)),l})})}else{let s=this;return Lr(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new In([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new In([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:La.create(e).rest(Bo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||La.create([]).rest(Bo.create()),returns:r||Bo.create(),typeName:J.ZodFunction,...oe(n)})}},mu=class extends fe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};mu.create=(t,e)=>new mu({getter:t,typeName:J.ZodLazy,...oe(e)});var fu=class extends fe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};fu.create=(t,e)=>new fu({value:t,typeName:J.ZodLiteral,...oe(e)});function az(t,e){return new gu({values:t,typeName:J.ZodEnum,...oe(e)})}var gu=class t extends fe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:be.joinValues(n),received:r.parsedType,code:D.invalid_type}),Y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:D.invalid_enum_value,options:n}),Y}return Lr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};gu.create=az;var hu=class extends fe{_parse(e){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return U(n,{expected:be.joinValues(i),received:n.parsedType,code:D.invalid_type}),Y}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=be.objectValues(r);return U(n,{received:n.data,code:D.invalid_enum_value,options:i}),Y}return Lr(e.data)}get enum(){return this._def.values}};hu.create=(t,e)=>new hu({values:t,typeName:J.ZodNativeEnum,...oe(e)});var ac=class extends fe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:D.invalid_type,expected:q.promise,received:r.parsedType}),Y;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return Lr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ac.create=(t,e)=>new ac({type:t,typeName:J.ZodPromise,...oe(e)});var fi=class extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{U(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return Y;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?Y:c.status==="dirty"?ou(c.value):r.value==="dirty"?ou(c.value):c});{if(r.value==="aborted")return Y;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Y:s.status==="dirty"?ou(s.value):r.value==="dirty"?ou(s.value):s}}if(i.type==="refinement"){let o=s=>{let c=i.refinement(s,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Y:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Y:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ic(o))return Y;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ic(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):Y);be.assertNever(i)}};fi.create=(t,e,r)=>new fi({schema:t,typeName:J.ZodEffects,effect:e,...oe(r)});fi.createWithPreprocess=(t,e,r)=>new fi({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...oe(r)});var mi=class extends fe{_parse(e){return this._getType(e)===q.undefined?Lr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mi.create=(t,e)=>new mi({innerType:t,typeName:J.ZodOptional,...oe(e)});var Ua=class extends fe{_parse(e){return this._getType(e)===q.null?Lr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ua.create=(t,e)=>new Ua({innerType:t,typeName:J.ZodNullable,...oe(e)});var yu=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};yu.create=(t,e)=>new yu({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var vu=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gm(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new In(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new In(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};vu.create=(t,e)=>new vu({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var af=class extends fe{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.nan,received:n.parsedType}),Y}return{status:"valid",value:e.data}}};af.create=t=>new af({typeName:J.ZodNaN,...oe(t)});var Pqe=Symbol("zod_brand"),W_=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},H_=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Y:a.status==="dirty"?(r.dirty(),ou(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Y:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:J.ZodPipeline})}},bu=class extends fe{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ic(i)&&(i.value=Object.freeze(i.value)),i);return Gm(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};bu.create=(t,e)=>new bu({innerType:t,typeName:J.ZodReadonly,...oe(e)});var Cqe={object:Pn.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var kqe=cu.create,Rqe=Jm.create,Eqe=af.create,Aqe=Km.create,Tqe=Ym.create,Oqe=Xm.create,Dqe=Qm.create,$qe=lu.create,Nqe=uu.create,Mqe=ef.create,jqe=Bo.create,Lqe=Vi.create,Uqe=tf.create,zqe=Vo.create,noe=Pn.create,Fqe=Pn.strictCreate,qqe=du.create,Bqe=gE.create,Vqe=pu.create,Wqe=La.create,Hqe=yE.create,Zqe=rf.create,Gqe=nf.create,Jqe=vE.create,Kqe=mu.create,Yqe=fu.create,Xqe=gu.create,Qqe=hu.create,eBe=ac.create,tBe=fi.create,rBe=mi.create,nBe=Ua.create,iBe=fi.createWithPreprocess,aBe=H_.create;function _u(t){return!!t._zod}function Wo(t,e){return _u(t)?Bs(t,e):t.safeParse(e)}function Z_(t){if(!t)return;let e;if(_u(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function cz(t){if(_u(t)){let a=t._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}function Ho(t){return t==="completed"||t==="failed"||t==="cancelled"}var uoe=Symbol("Let zodToJsonSchema decide on which parser to use");var f2e=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function bE(t){let r=Z_(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=cz(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function _E(t,e){let r=Wo(t,e);if(!r.success)throw r.error;return r.data}var hoe=6e4,G_=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(A_,r=>{this._oncancel(r)}),this.setNotificationHandler(O_,r=>{this._onprogress(r)}),this.setRequestHandler(T_,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(D_,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(Se.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(N_,async(r,n)=>{let i=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let d=c,p=new ue(d.error.code,d.error.message,d.error.data);u(p)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new ue(Se.InvalidParams,`Task not found: ${a}`);if(!Ho(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(Ho(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[Fo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(M_,async(r,n)=>{try{let{tasks:i,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:a,_meta:{}}}catch(i){throw new ue(Se.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(L_,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(Se.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ho(i.status))throw new ue(Se.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new ue(Se.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ue?i:new ue(Se.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ue.fromError(Se.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let i=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{i?.(a,o),Lm(a)||VU(a)?this._onresponse(a):GR(a)?this._onrequest(a,o):BU(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let r=ue.fromError(Se.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,a=e.params?._meta?.[Fo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:Se.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=zU(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{let d={relatedRequestId:e.id};a&&(d.relatedTask={taskId:a}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{let m={...p,relatedRequestId:e.id};a&&!m.relatedTask&&(m.relatedTask={taskId:a});let f=m.relatedTask?.taskId??a;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(u,d,m)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:a,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(o.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(o.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:Se.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(c);return}a(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Lm(e))n(e);else{let o=new ue(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(Lm(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let s=o.task;typeof s.taskId=="string"&&(a=!0,this._taskProgressTokens.set(s.taskId,r))}}if(a||this._progressHandlers.delete(r),Lm(e))i(e);else{let o=ue.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof ue?o:new ue(Se.InternalError,String(o))}}return}let a;try{let o=await this.request(e,iu,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ue(Se.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},Ho(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ue(Se.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ue(Se.InternalError,`Task ${a} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof ue?o:new ue(Se.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,task:s,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=b=>{u(b)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),s&&this.assertTaskCapability(e.method)}catch(b){d(b);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),s&&(m.params={...m.params,task:s}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[Fo]:c}});let f=b=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(b)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let _=b instanceof ue?b:new ue(Se.RequestTimeout,String(b));u(_)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let _=Wo(r,b.result);_.success?l(_.data):u(_.error)}catch(_){u(_)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??hoe,h=()=>f(ue.fromError(Se.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=_=>{let S=this._responseHandlers.get(p);S?S(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,b),this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),u(_)})}else this._transport.send(m,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(b=>{this._cleanupTimeout(p),u(b)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},$_,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},j_,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ZU,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Fo]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Fo]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Fo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=bE(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=_E(e,i);return Promise.resolve(r(o,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=bE(e);this._notificationHandlers.set(n,i=>{let a=_E(e,i);return Promise.resolve(r(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&GR(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ue(Se.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,a)=>{if(r.aborted){a(new ue(Se.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ue(Se.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new ue(Se.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,o)=>{await n.storeTaskResult(i,a,o,r);let s=await n.getTask(i,r);if(s){let c=Bm.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Ho(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,o)=>{let s=await n.getTask(i,r);if(!s)throw new ue(Se.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ho(s.status))throw new ue(Se.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,o,r);let c=await n.getTask(i,r);if(c){let l=Bm.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ho(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function lz(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function uz(t,e){let r={...t};for(let n in e){let i=n,a=e[i];if(a===void 0)continue;let o=r[i];lz(o)&&lz(a)?r[i]={...o,...a}:r[i]=a}return r}var Kq=Ht(aT(),1),Yq=Ht(Jq(),1);function ope(){let t=new Kq.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Yq.default)(t),t}var Tx=class{constructor(e){this._ajv=e??ope()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ox=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function Xq(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Qq(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Dx=class extends G_{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Hm.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let a=this._loggingLevels.get(i);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Tx,this.setRequestHandler(YR,n=>this._oninitialize(n)),this.setNotificationHandler(XR,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(cE,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Hm.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ox(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=uz(this._capabilities,e)}setRequestHandler(e,r){let i=Z_(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(_u(i)){let s=i;a=s._zod?.def?.value??s.value}else{let s=i;a=s._def?.value??s.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let s=async(c,l)=>{let u=Wo(Wm,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ue(Se.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=Wo(iu,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ue(Se.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=Wo(U_,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ue(Se.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Qq(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Xq(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:jU.includes(r)?r:HR,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},E_)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],a=i.some(l=>l.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],c=s.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},uE,r):this.request({method:"sampling/createMessage",params:e},lE,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},z_,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},z_,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ue(Se.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ue?o:new ue(Se.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},dE,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function spe(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var He=spe()??"2.17.7";var mT="weppy://ui-studio/guide",fT="weppy://ui-studio/tokens",gT="weppy://ui-studio/functional-rules",eB='# UI Studio Guide\n\n**Audience:** AI agents and developers building Roblox interfaces through UI Studio.\n**Resource:** `weppy://ui-studio/guide`\n**Policy:** Design Check quality findings are advisory. Schema errors, unsupported properties, forbidden paths, destructive-action boundaries, and external upload approval remain enforceable safety rules.\n\n## How to use this guide\n\nBuild from project evidence, not from a built-in game subject or genre preset. The guide has three layers:\n\n1. The advisory usability floor covers observable interaction and readability risks.\n2. The visual vocabulary offers optional directions, not a checklist or score.\n3. The review workflow separates verified functional evidence from visual judgment.\n\nVisual quality is contextual. Do not turn token values, shape counts, image counts, ornament counts, occupancy, or family counts into pass conditions.\n\n### Context-first brief gate\n\nFor an ambiguous request, call `manage_ui.design_brief` with an omitted or partial brief. Inspect Studio and project evidence before asking the user for information.\n\n- An empty `StarterGui` proves only that no Edit UI root was observed. For an existing-UI review, return `runtime_not_reviewed` until a Play Client `PlayerGui` observation is available. Treat it as new-interface evidence only when the user explicitly asks to create new UI.\n- Existing `ScreenGui` roots support a redesign or targeted-update interpretation.\n- A selected GUI object is strong target evidence unless the user names a broader scope.\n- Explicit `projectContext` and user choices outrank existing Studio patterns.\n- Existing Studio patterns may inform continuity, but they never create a reusable subject preset.\n- An explicit user placement, grouping, surface, flow, or backdrop choice outranks project evidence, existing UI, and WEPPY fallback in that order.\n\nAsk one focused question at a time. Include a current-state summary, a recommended choice with evidence, useful alternatives, and a free-form escape hatch. Return an exact `brief_patch` for an accepted recommendation.\n\n### Asset recommendation gate\n\nAsset evidence is considered in this order:\n\n1. user-provided `brief.reference_assets`\n2. approved `projectContext.approved_assets`\n3. relevant images already used by the selected project UI\n4. `manage_assets.search` only when `projectContext.asset_search_intent` is explicit and user-approved\n5. an assetless fallback\n\nDo not synthesize a subject search query from names, labels, hierarchy text, or Workspace content. Do not use a recommended asset until the user accepts it. Never invent an `rbxassetid://...` value.\n\n### Calling-agent capability and image generation gate\n\nInspect the calling agent\'s actual callable image capability and local output channel. Do not infer capability from a model or client name, and never record provider credentials.\n\n- Generation and Roblox upload require separate approval.\n- `image_review` means the calling agent can review an output; it does not authorize generation or upload.\n- If generation or local output is unavailable or unknown, continue with approved assets or an assetless fallback.\n\nAfter local generation, show the output for selection. Run upload preflight only after selection, and request separate approval naming the files, count, and destination.\n\n### Project Design Contract gate\n\nPass relevant repository evidence in `projectContext` instead of asking the Studio plugin to guess it:\n\n- `screen_job`, `primary_action`, `content_hierarchy`, recommended `required_states`, and explicitly blocking `required_state_ids`\n- `visual_thesis`, `signature_motif`, and `forbidden_defaults`\n- `presentation_mode` and `focal_region`\n- neutral `surface_roles` and `shape_language`\n- role-specific `layout_preferences` with their decision source\n- `target_profiles` and `platform_distribution`\n- project-owned tokens and approved assets with evidence paths\n\nKeep the returned `design_contract` and `brief_id` together. `create_tree` and `update` require an accepted brief. Candidate directions should differ materially in composition, hierarchy, or interaction behavior; palette swaps alone are not meaningful alternatives.\n\n### Role-based game layout contract\n\nWEPPY supplies style-neutral structure. The calling agent owns visual direction from explicit user intent plus game and project evidence. A WEPPY fallback must not choose the palette, font, imagery treatment, ornament, semantic shape, or numeric opacity for the project.\n\nFor an underspecified `non_modal_overlay`, translate neutral roles into these advisory constraints:\n\n- `persistent_status`: top-left compact individual chrome, growing inward from the edge;\n- `resource_display`: top-right compact chips in a row;\n- `navigation`: side rail or top edge, using individual controls instead of one large shared panel;\n- `slot_action`: bottom-center single-row flow only when the content has real slot semantics;\n- `contextual_action`: transient lower-center or target-relative action, normally one or a few controls;\n- `objective_tracker`: side-edge bounded group that can condense or collapse.\n\nUse a transparent group root for non-modal HUD regions. Opaque paint may remain inside the local bounds of a button, status chip, tracker, or other readable content surface. A contract-backed `modal_overlay`, `fullscreen_navigation`, or `diegetic` presentation may use a backdrop.\n\nOn touch profiles, keep a semantic slot bar between the touch-left and touch-right reserved regions and clear of the top inset. Prefer condense, paginate, collapse, or contextual disclosure over wrapping generic actions into a multi-row bottom-center grid.\n\nEach region can preserve `placement_band`, `flow_axis`, `surface_mode`, `avoid_regions`, `wrap_policy`, `decision_source`, and an optional numeric `max_edge_gap_px`. These are advisory composition constraints, not exact coordinates or a hard tree preset. When the explicit user or approved project evidence requests a different result, preserve it and report only observed functional risk. An explicit user placement without a numeric maximum does not inherit a WEPPY edge-gap limit.\n\n### Design Check coverage gate\n\n`manage_ui.check` reports findings and coverage independently.\n\n- `structural_only` means deterministic Studio checks ran without a calling-agent visual review.\n- `structural_and_visual` means a calling agent reviewed the referenced saved preview and submitted `visualReview` evidence.\n- `visual_status = "not_requested" | "skipped"` must remain visible even when deterministic findings are empty.\n\nUse `visualReview` and its `reviewContext` only for evidence actually reviewed. If interaction states or representative primary-view context are absent, preserve `interaction_states_not_reviewed` or `gameplay_context_unavailable`. WEPPY does not call an external AI service for visual review.\n\nFor UI created only at runtime, run a structured Play session with one client, wait for the UI, and use `snapshot_gui` on `{root:"PlayerGui",segments:[]}`. Pass the saved `{recordId,stepId}` as `runtimeEvidenceRef` and use `observationMode="runtime"` for `manage_ui.check`. The Bridge validates Place, session, client, step status, and PlayerGui origin; never submit a copied tree as runtime evidence. A truncated tree remains partial coverage.\n\nKeep semantic runtime evidence and screenshot evidence separate. Play-mode screenshot capture is unavailable in this build, so a PlayerGui snapshot can complete runtime structure coverage but cannot complete visual review by itself. Preserve `play_screenshot_unsupported`, `background_unverified`, state gaps, and other limitations.\n\n## A. Advisory usability and interaction floor\n\nThese are configurable recommendations. A `priority_high` finding indicates urgency, not a mutation block.\n\n### A.1 Hit, focus, and painted surfaces\n\nEvaluate the resolved `AbsoluteSize` of the interactive hit and focus area. The painted visual surface may be smaller or differently shaped when the larger invisible area does not overlap another action or hide content.\n\nUse target-profile recommendations for touch and focus reachability. Treat them as defaults that projects may adjust with evidence. Always verify that actions remain distinguishable and reachable for every declared input mode.\n\n### A.2 Safe areas and readable text\n\nUse `ScreenInsets`, device simulation, and the declared target profile where available. Review critical actions and information against the actual safe area rather than assuming one global inset.\n\nFor an edge-bound semantic region, compare both the container bounds and the actual painted descendant union with the declared safe boundary. The painted union includes visible background, text, image, and `UIStroke` geometry after `ClipsDescendants`. A transparent parent can therefore be attached while its visible controls remain detached. Report this as one `edge_detached` finding with container, visible, and internal gap evidence. AnchorPoint mismatch alone is diagnostic evidence, not a finding.\n\nEvaluate text against the resolved background, including composable transparency. When an image, gradient, transparent game view, or complex overlay prevents a deterministic background result, return `background_unverified` instead of assuming a dark fallback. Check `TextFits`, `TextBounds`, clipping, long localized strings, and maximum numeric content. Contrast and text-size values are accessibility recommendations, not visual-style quotas. If `TextScaled` is used, constrain it with `UITextSizeConstraint` and verify representative locales.\n\nInspect visible text, images, actions, and painted progress indicators even when semantic metadata is absent. Compare direct siblings and meaningful surfaces across enabled ScreenGui roots. Exclude parent-child paint, progress fill/background composition, hidden roots, and contract-backed intentional overlap. Treat public inset and Core UI state as observed evidence; if expanded chat, player list, or touch-control geometry cannot be observed, report it as estimated or unavailable.\n\n### A.3 Input disclosure and state access\n\nA readable embedded action text can be the visible label when it remains legible across declared targets and locales. Do not duplicate it with a second adjacent label.\n\nUnfamiliar controls need an input-appropriate explanation path:\n\n- pointer and keyboard can use hover or focus labels;\n- gamepad needs a focus-visible action label and current binding;\n- touch needs a persistent label, a labelled disclosure control, or another touch-visible hint.\n\nEvery declared input mode should expose the action meaning and relevant resting, focus, pressed, selected, and disabled states. Pointer hover alone does not establish all-input discoverability.\n\n### A.4 Primary-view protection\n\nFor `non_modal_overlay`, keep the Design Contract focal region visually available. If UI and the primary view compete, consider edge placement, reflow, condensation, collapse, or contextual disclosure. Do not enforce a fixed screen-occupancy ratio.\n\nModal, fullscreen navigation, and diegetic presentation may intentionally use a backdrop when the contract supports it. A full-screen opaque surface is not automatically wrong; its presentation role decides.\n\n### A.5 Supported Roblox UI components\n\nUI Studio tree encoding supports `UIScale`, `UIFlexItem`, `UIShadow`, `UIPageLayout`, `UITableLayout`, `CanvasGroup`, `UIDragDetector`, `UIAspectRatioConstraint`, `UISizeConstraint`, and `UITextSizeConstraint` where listed by the public schema.\n\nNo class is a quality guarantee. Likewise, a `Frame`, `Offset`, sharp edge, or absent image is not a failure by itself. Report observable bounds, text-fit, reachability, focus-path, safe-area, aspect, or interaction evidence.\n\n## B. Visual vocabulary\n\nThis vocabulary is exploratory. Combine, omit, or extend options when project evidence supports the result. Consistency should be explained through roles and relationships, not through rigid family counts.\n\n### B.1 neutral surface roles\n\nAssign visible surfaces a neutral surface role before styling:\n\n- `primary_action`\n- `secondary_action`\n- `navigation`\n- `persistent_status`\n- `transient_status`\n- `resource_display`\n- `contextual_information`\n- `identity`\n- `spatial_information`\n- `slot_action`\n- `contextual_action`\n- `objective_tracker`\n- `decoration`\n\nProjects may add opaque roles. WEPPY must not reuse their subject meaning as another project\'s default.\n\nAn interaction family describes how controls reveal affordance and state. It may be framed, tactile, diegetic, tab-like, ornamented, or an intentional flat control. Gradient, shadow, bevel, rounding, and imagery are optional.\n\n### B.2 Container edge language and semantic shape\n\nPlan container edge language separately from semantic shape.\n\n- Container edge language can be sharp, softly rounded, strongly rounded, cut-corner, asymmetric, organic, or project-defined.\n- Semantic shapes can include a circle, ring, pill, rounded marker, directional wedge, segmented track, organic silhouette, or another project-defined form.\n- A compact status marker may use a ring while a nearby action uses a pill and its containing panel uses a sharp edge language.\n- Mixed semantic shapes supported by role evidence are not a style failure.\n\nUse circles and rings where radial reading, identity, progress, direction, or compact status makes them clearer. Use pills where a short label and bounded interactive state benefit from that silhouette. Use rounded containers when softness or touch affordance supports the thesis. Preserve sharp or cut edges when they better support the project.\n\nDo not require every surface to share one radius. Avoid arbitrary inconsistency, but explain meaningful differences through role, interaction state, hierarchy, or the signature motif.\n\n### B.3 Layout, anchor, and pivot strategy\n\nChoose layout from content hierarchy, parent relationship, focal region, and target profiles.\n\n- Edge placement protects the primary view for persistent non-modal information.\n- Centered hierarchy supports intentionally modal or focused flows.\n- Split, asymmetric, radial, layered, and flow layouts are valid when they clarify relationships.\n- Repeated rectangles are not a default composition. Use bounded panels only where grouping, backdrop, scrolling, or interaction requires them.\n\nTreat `AnchorPoint` as the element\'s positional pivot:\n\n- left/top pivots suit content growing inward from those edges;\n- center pivots suit centered or symmetric relationships;\n- right/bottom pivots suit content growing inward from those edges;\n- project-specific pivots may support a spatial or animated relationship.\n\nWhen using `create_tree`, add optional `layoutMetadata` to meaningful region roots so preview metadata can preserve `surfaceRole`, `placementBand`, `surfaceMode`, and `decisionSource` for review.\n\nScale and Offset are tools, not pass/fail signals. Use Scale for proportional relationships, Offset for stable local dimensions, and combine them deliberately. Add `UIScale`, `UISizeConstraint`, `UIAspectRatioConstraint`, `UITextSizeConstraint`, layout components, Style Query, or project scripts when the target behavior needs them. Verify the resolved result in declared profiles.\n\n### B.4 Imagery strategy\n\nChoose imagery based on explicit role evidence:\n\n- `symbol_set`: consistent compact signs or glyphs\n- `content_thumbnail`: a visual representation of selectable or referenced content\n- `identity_visual`: a visual used primarily for identity or recognition\n- `illustrative_backdrop`: non-interactive atmosphere or framing art\n- `diegetic_surface`: a surface visually integrated with the project world\n- `no_imagery`: an intentional text-and-shape direction\n\nDifferent roles may justify different imagery families on one screen. Coherence comes from treatment, hierarchy, and evidence\u2014not a family quota. If no approved asset exists, use a labelled geometric marker, project-approved glyph, clear placeholder, or `no_imagery`.\n\n### B.5 Depth, ornament, type, colour, and motion\n\nTokens under `weppy://ui-studio/tokens` are examples. They can suggest palette, typography, edge, motion, depth, and composition directions, but they are never mandatory values or quality scores.\n\n- Flatness can be intentional when hierarchy and state remain clear.\n- Depth may use stroke, tonal separation, overlap, shadow, or project imagery.\n- Ornament should reinforce hierarchy or a signature motif rather than fill empty space.\n- Motion should explain state or relationship and respect reduced-motion evidence.\n- Intentional silence\u2014no imagery, no ornament, or no motion\u2014is valid when the contract explains it.\n\n### B.6 Composition and distinctiveness\n\nProtect a clear reading order without forcing a single focal-area percentage. Important relationships may be expressed through scale, placement, colour, typography, motion, negative space, or semantic shape.\n\nBefore applying generic equal-weight rectangles, ask whether the roles call for edge markers, radial indicators, layered surfaces, labelled controls, a bounded content region, or contextual disclosure. If two projects differ only by palette, revisit their evidence and layout plan.\n\n## C. Review workflow\n\n### C.1 Primary visual builder and critic loop\n\nUse **Builder \u2192 Preview \u2192 Critic \u2192 Update** as the primary quality loop:\n\n1. **Builder:** compose from the accepted Design Contract, role relationships, reference evidence, and imagery strategy.\n2. **Preview:** capture the representative primary view after each meaningful create or update pass.\n3. **Critic:** compare the screenshot with the contract and references, then return `recompose`, `refine`, or `approved` with a concise summary and path-backed findings.\n4. **Update:** recompose when the layout or presentation model is wrong; refine when the direction is sound but hierarchy, geometry, imagery, or state treatment needs another pass.\n\nDo not treat schema success or an empty deterministic result as visual approval. `approved` requires representative primary-view evidence, no unresolved `priority_high` functional risk, and a resolved imagery strategy. When required imagery still has only a placeholder or fallback, keep primary visual approval ineligible and propose the separately approved generation or asset path.\n\n### C.2 Visual review\n\nReview qualitative decisions against the Design Contract:\n\n- Is the screen job evident?\n- Does hierarchy match `content_hierarchy`?\n- Are action and information roles distinguishable?\n- Does the container edge language support the visual thesis?\n- Do semantic shapes have role evidence?\n- Is imagery intentional, approved, or intentionally absent?\n- Does the composition protect the focal region?\n- Are required interaction states discoverable for declared inputs?\n\nDo not add visual elements merely to reduce finding counts. Do not issue a failure because a surface is rectangular, circular, sharp, rounded, flat, or image-free.\n\n### C.3 Responsive review\n\nReview the primary target first, then secondary and compatibility targets. User-selected targets and Experience analytics outrank a generic platform default. Excluded targets are recorded but not evaluated as required coverage.\n\nFor each reviewed profile, inspect:\n\n- critical bounds and overlap\n- text fit and localization pressure\n- anchor/pivot behavior during resize and orientation change\n- safe-area placement\n- action reachability and focus path\n- whether reflow, collapse, or contextual disclosure preserves outcomes\n\nIf device simulation is unavailable, report responsive coverage as skipped. Static arithmetic alone does not prove Roblox layout behavior.\n\n### C.4 Coverage language\n\nZero findings means no finding was observed in the checks that ran. It does not mean all quality dimensions passed. Keep structure, visual, interaction, primary-view context, and responsive viewport coverage independent.\n\n## D. Tree encoding\n\n`create_tree` and `update.changes.properties` accept constrained JSON values:\n\n| Roblox type | JSON shape |\n|---|---|\n| `UDim2` | `{xScale, xOffset, yScale, yOffset}` |\n| `UDim` | `{scale, offset}` |\n| `Color3` | `{r, g, b}` |\n| `Vector2` | `{x, y}` |\n| `Vector3` | `{x, y, z}` |\n| `NumberSequence` | `number` or keypoint array |\n| `ColorSequence` | colour keypoint array |\n| `Font` | enum string or `{family, weight, style}` |\n| Enum property | item-name string |\n\nUse a JSON newline escape for multiline text and set `TextWrapped` when appropriate, or use separate `TextLabel` children with a layout component. Do not double-escape a newline into visible backslash text.\n\nKeep `Size` and `Position` in UDim2 object form. Keep colour channel conventions consistent within a tree. Preserve clear instance paths so later updates can target approved placeholders or assets.\n\n---\n\nThis tracked source is embedded into the generated server resource. Run `npm run codegen` after editing it.\n',tB=`{
|
|
245
|
+
`}var q_=class{constructor(e=ez.stdin,r=ez.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new F_,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=QU(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var B_=class{startPromise=null;stopPromise=null;start(e){return this.startPromise??=e(),this.startPromise}stop(e){return this.stopPromise??=(async()=>{this.startPromise&&await this.startPromise.catch(()=>{}),await e()})(),this.stopPromise}};var be;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let a={};for(let o of i)a[o]=o;return a},t.getValidEnumValues=i=>{let a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(let s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let a=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(let o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=n,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(be||(be={}));var tz;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(tz||(tz={}));var q=be.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ma=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var D=be.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"]);var In=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(a){return a.message},n={_errors:[]},i=a=>{for(let o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let s=n,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(r(o))):s[l]=s[l]||{_errors:[]},s=s[l],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,be.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};In.create=t=>new In(t);var Dae=(t,e)=>{let r;switch(t.code){case D.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,be.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${be.joinValues(t.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${be.joinValues(t.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${be.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:be.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case D.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case D.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=e.defaultError,be.assertNever(t)}return{message:r}},qo=Dae;var $ae=qo;function Zm(){return $ae}var V_=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)s=l(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function U(t,e){let r=Zm(),n=V_({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===qo?void 0:qo].filter(i=>!!i)});t.common.issues.push(n)}var Cr=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Y;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let a=await i.key,o=await i.value;n.push({key:a,value:o})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return Y;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[a.value]=o.value)}return{status:e.value,value:n}}},Y=Object.freeze({status:"aborted"}),ou=t=>({status:"dirty",value:t}),Lr=t=>({status:"valid",value:t}),pE=t=>t.status==="aborted",mE=t=>t.status==="dirty",ic=t=>t.status==="valid",Gm=t=>typeof Promise<"u"&&t instanceof Promise;var V;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(V||(V={}));var Bn=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},rz=(t,e)=>{if(ic(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new In(t.common.issues);return this._error=r,this._error}}};function oe(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{let{message:c}=t;return o.code==="invalid_enum_value"?{message:c??s.defaultError}:typeof s.data>"u"?{message:c??n??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:c??r??s.defaultError}},description:i}}var fe=class{get description(){return this._def.description}_getType(e){return Ma(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Cr,ctx:{common:e.parent.common,data:e.data,parsedType:Ma(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Gm(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)},i=this._parseSync({data:e,path:n.path,parent:n});return rz(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return ic(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ic(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ma(e)},i=this._parse({data:e,path:n.path,parent:n}),a=await(Gm(i)?i:Promise.resolve(i));return rz(n,a)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{let o=e(i),s=()=>a.addIssue({code:D.custom,...n(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new fi({schema:this,typeName:J.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return mi.create(this,this._def)}nullable(){return Ua.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vo.create(this)}promise(){return ac.create(this,this._def)}or(e){return du.create([this,e],this._def)}and(e){return pu.create(this,e,this._def)}transform(e){return new fi({...oe(this._def),schema:this,typeName:J.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new yu({...oe(this._def),innerType:this,defaultValue:r,typeName:J.ZodDefault})}brand(){return new W_({typeName:J.ZodBranded,type:this,...oe(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vu({...oe(this._def),innerType:this,catchValue:r,typeName:J.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return H_.create(this,e)}readonly(){return bu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Nae=/^c[^\s-]{8,}$/i,Mae=/^[0-9a-z]+$/,jae=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Lae=/^[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,Uae=/^[a-z0-9_-]{21}$/i,zae=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fae=/^[-+]?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)?)??$/,qae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bae="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",fE,Vae=/^(?:(?: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])$/,Wae=/^(?:(?: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])$/,Hae=/^(([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]))$/,Zae=/^(([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])$/,Gae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Jae=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nz="((\\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])))",Kae=new RegExp(`^${nz}$`);function iz(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Yae(t){return new RegExp(`^${iz(t)}$`)}function Xae(t){let e=`${nz}T${iz(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Qae(t,e){return!!((e==="v4"||!e)&&Vae.test(t)||(e==="v6"||!e)&&Hae.test(t))}function eoe(t,e){if(!zae.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function toe(t,e){return!!((e==="v4"||!e)&&Wae.test(t)||(e==="v6"||!e)&&Zae.test(t))}var cu=class t extends fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.string,received:a.parsedType}),Y}let n=new Cr,i;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?U(i,{code:D.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&U(i,{code:D.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")qae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")fE||(fE=new RegExp(Bae,"u")),fE.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Lae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")Uae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Nae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Mae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")jae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:D.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:D.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:D.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?Xae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?Kae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?Yae(a).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:D.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?Fae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?Qae(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?eoe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?toe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?Gae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:D.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?Jae.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:D.invalid_string,message:a.message}),n.dirty()):be.assertNever(a);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:D.invalid_string,...V.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...V.errToObj(e)})}url(e){return this._addCheck({kind:"url",...V.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...V.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...V.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...V.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...V.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...V.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...V.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...V.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...V.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...V.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...V.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...V.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...V.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...V.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...V.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...V.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...V.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...V.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...V.errToObj(r)})}nonempty(e){return this.min(1,V.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cu.create=t=>new cu({checks:[],typeName:J.ZodString,coerce:t?.coerce??!1,...oe(t)});function roe(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}var Jm=class t extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.number,received:a.parsedType}),Y}let n,i=new Cr;for(let a of this._def.checks)a.kind==="int"?be.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:D.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?roe(e.data,a.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_finite,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:V.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:V.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:V.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:V.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&be.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Jm.create=t=>new Jm({checks:[],typeName:J.ZodNumber,coerce:t?.coerce||!1,...oe(t)});var Km=class t extends fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let n,i=new Cr;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:D.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):be.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:D.invalid_type,expected:q.bigint,received:r.parsedType}),Y}gte(e,r){return this.setLimit("min",e,!0,V.toString(r))}gt(e,r){return this.setLimit("min",e,!1,V.toString(r))}lte(e,r){return this.setLimit("max",e,!0,V.toString(r))}lt(e,r){return this.setLimit("max",e,!1,V.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:V.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:V.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Km.create=t=>new Km({checks:[],typeName:J.ZodBigInt,coerce:t?.coerce??!1,...oe(t)});var Ym=class extends fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.boolean,received:n.parsedType}),Y}return Lr(e.data)}};Ym.create=t=>new Ym({typeName:J.ZodBoolean,coerce:t?.coerce||!1,...oe(t)});var Xm=class t extends fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_type,expected:q.date,received:a.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return U(a,{code:D.invalid_date}),Y}let n=new Cr,i;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:D.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):be.assertNever(a);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:V.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:V.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Xm.create=t=>new Xm({checks:[],coerce:t?.coerce||!1,typeName:J.ZodDate,...oe(t)});var Qm=class extends fe{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.symbol,received:n.parsedType}),Y}return Lr(e.data)}};Qm.create=t=>new Qm({typeName:J.ZodSymbol,...oe(t)});var lu=class extends fe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.undefined,received:n.parsedType}),Y}return Lr(e.data)}};lu.create=t=>new lu({typeName:J.ZodUndefined,...oe(t)});var uu=class extends fe{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.null,received:n.parsedType}),Y}return Lr(e.data)}};uu.create=t=>new uu({typeName:J.ZodNull,...oe(t)});var ef=class extends fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Lr(e.data)}};ef.create=t=>new ef({typeName:J.ZodAny,...oe(t)});var Bo=class extends fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lr(e.data)}};Bo.create=t=>new Bo({typeName:J.ZodUnknown,...oe(t)});var Vi=class extends fe{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:D.invalid_type,expected:q.never,received:r.parsedType}),Y}};Vi.create=t=>new Vi({typeName:J.ZodNever,...oe(t)});var tf=class extends fe{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.void,received:n.parsedType}),Y}return Lr(e.data)}};tf.create=t=>new tf({typeName:J.ZodVoid,...oe(t)});var Vo=class t extends fe{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:D.invalid_type,expected:q.array,received:r.parsedType}),Y;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,s=r.data.length<i.exactLength.value;(o||s)&&(U(r,{code:o?D.too_big:D.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:D.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:D.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,s)=>i.type._parseAsync(new Bn(r,o,r.path,s)))).then(o=>Cr.mergeArray(n,o));let a=[...r.data].map((o,s)=>i.type._parseSync(new Bn(r,o,r.path,s)));return Cr.mergeArray(n,a)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:V.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:V.toString(r)}})}nonempty(e){return this.min(1,e)}};Vo.create=(t,e)=>new Vo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...oe(e)});function su(t){if(t instanceof Pn){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=mi.create(su(n))}return new Pn({...t._def,shape:()=>e})}else return t instanceof Vo?new Vo({...t._def,type:su(t.element)}):t instanceof mi?mi.create(su(t.unwrap())):t instanceof Ua?Ua.create(su(t.unwrap())):t instanceof La?La.create(t.items.map(e=>su(e))):t}var Pn=class t extends fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=be.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:D.invalid_type,expected:q.object,received:l.parsedType}),Y}let{status:n,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof Vi&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||s.push(l);let c=[];for(let l of o){let u=a[l],d=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Bn(i,d,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Vi){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of s)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")s.length>0&&(U(i,{code:D.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of s){let d=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Bn(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>Cr.mergeObjectSync(n,l)):Cr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return V.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:V.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:J.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of be.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of be.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return su(this)}partial(e){let r={};for(let n of be.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of be.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof mi;)a=a._def.innerType;r[n]=a}return new t({...this._def,shape:()=>r})}keyof(){return az(be.objectKeys(this.shape))}};Pn.create=(t,e)=>new Pn({shape:()=>t,unknownKeys:"strip",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});Pn.strictCreate=(t,e)=>new Pn({shape:()=>t,unknownKeys:"strict",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});Pn.lazycreate=(t,e)=>new Pn({shape:t,unknownKeys:"strip",catchall:Vi.create(),typeName:J.ZodObject,...oe(e)});var du=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(a){for(let s of a)if(s.result.status==="valid")return s.result;for(let s of a)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let o=a.map(s=>new In(s.ctx.common.issues));return U(r,{code:D.invalid_union,unionErrors:o}),Y}if(r.common.async)return Promise.all(n.map(async a=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a,o=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(c=>new In(c));return U(r,{code:D.invalid_union,unionErrors:s}),Y}}get options(){return this._def.options}};du.create=(t,e)=>new du({options:t,typeName:J.ZodUnion,...oe(e)});var ja=t=>t instanceof mu?ja(t.schema):t instanceof fi?ja(t.innerType()):t instanceof fu?[t.value]:t instanceof gu?t.options:t instanceof hu?be.objectValues(t.enum):t instanceof yu?ja(t._def.innerType):t instanceof lu?[void 0]:t instanceof uu?[null]:t instanceof mi?[void 0,...ja(t.unwrap())]:t instanceof Ua?[null,...ja(t.unwrap())]:t instanceof W_||t instanceof bu?ja(t.unwrap()):t instanceof vu?ja(t._def.innerType):[],gE=class t extends fe{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:D.invalid_type,expected:q.object,received:r.parsedType}),Y;let n=this.discriminator,i=r.data[n],a=this.optionsMap.get(i);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let a of r){let o=ja(a.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of o){if(i.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);i.set(s,a)}}return new t({typeName:J.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...oe(n)})}};function hE(t,e){let r=Ma(t),n=Ma(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&n===q.object){let i=be.objectKeys(e),a=be.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(let s of a){let c=hE(t[s],e[s]);if(!c.valid)return{valid:!1};o[s]=c.data}return{valid:!0,data:o}}else if(r===q.array&&n===q.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let a=0;a<t.length;a++){let o=t[a],s=e[a],c=hE(o,s);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pu=class extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(a,o)=>{if(pE(a)||pE(o))return Y;let s=hE(a.value,o.value);return s.valid?((mE(a)||mE(o))&&r.dirty(),{status:r.value,value:s.data}):(U(n,{code:D.invalid_intersection_types}),Y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};pu.create=(t,e,r)=>new pu({left:t,right:e,typeName:J.ZodIntersection,...oe(r)});var La=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return U(n,{code:D.invalid_type,expected:q.array,received:n.parsedType}),Y;if(n.data.length<this._def.items.length)return U(n,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((o,s)=>{let c=this._def.items[s]||this._def.rest;return c?c._parse(new Bn(n,o,n.path,s)):null}).filter(o=>!!o);return n.common.async?Promise.all(a).then(o=>Cr.mergeArray(r,o)):Cr.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};La.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new La({items:t,typeName:J.ZodTuple,rest:null,...oe(e)})};var yE=class t extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return U(n,{code:D.invalid_type,expected:q.object,received:n.parsedType}),Y;let i=[],a=this._def.keyType,o=this._def.valueType;for(let s in n.data)i.push({key:a._parse(new Bn(n,s,n.path,s)),value:o._parse(new Bn(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Cr.mergeObjectAsync(r,i):Cr.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof fe?new t({keyType:e,valueType:r,typeName:J.ZodRecord,...oe(n)}):new t({keyType:cu.create(),valueType:e,typeName:J.ZodRecord,...oe(r)})}},rf=class extends fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.map)return U(n,{code:D.invalid_type,expected:q.map,received:n.parsedType}),Y;let i=this._def.keyType,a=this._def.valueType,o=[...n.data.entries()].map(([s,c],l)=>({key:i._parse(new Bn(n,s,n.path,[l,"key"])),value:a._parse(new Bn(n,c,n.path,[l,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Y;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),s.set(l.value,u.value)}return{status:r.value,value:s}}}};rf.create=(t,e,r)=>new rf({valueType:e,keyType:t,typeName:J.ZodMap,...oe(r)});var nf=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return U(n,{code:D.invalid_type,expected:q.set,received:n.parsedType}),Y;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:D.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:D.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let a=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Y;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let s=[...n.data.values()].map((c,l)=>a._parse(new Bn(n,c,n.path,l)));return n.common.async?Promise.all(s).then(c=>o(c)):o(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:V.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:V.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};nf.create=(t,e)=>new nf({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...oe(e)});var vE=class t extends fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:D.invalid_type,expected:q.function,received:r.parsedType}),Y;function n(s,c){return V_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zm(),qo].filter(l=>!!l),issueData:{code:D.invalid_arguments,argumentsError:c}})}function i(s,c){return V_({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Zm(),qo].filter(l=>!!l),issueData:{code:D.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof ac){let s=this;return Lr(async function(...c){let l=new In([]),u=await s._def.args.parseAsync(c,a).catch(m=>{throw l.addIssue(n(c,m)),l}),d=await Reflect.apply(o,this,u);return await s._def.returns._def.type.parseAsync(d,a).catch(m=>{throw l.addIssue(i(d,m)),l})})}else{let s=this;return Lr(function(...c){let l=s._def.args.safeParse(c,a);if(!l.success)throw new In([n(c,l.error)]);let u=Reflect.apply(o,this,l.data),d=s._def.returns.safeParse(u,a);if(!d.success)throw new In([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:La.create(e).rest(Bo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||La.create([]).rest(Bo.create()),returns:r||Bo.create(),typeName:J.ZodFunction,...oe(n)})}},mu=class extends fe{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};mu.create=(t,e)=>new mu({getter:t,typeName:J.ZodLazy,...oe(e)});var fu=class extends fe{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};fu.create=(t,e)=>new fu({value:t,typeName:J.ZodLiteral,...oe(e)});function az(t,e){return new gu({values:t,typeName:J.ZodEnum,...oe(e)})}var gu=class t extends fe{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:be.joinValues(n),received:r.parsedType,code:D.invalid_type}),Y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:D.invalid_enum_value,options:n}),Y}return Lr(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};gu.create=az;var hu=class extends fe{_parse(e){let r=be.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=be.objectValues(r);return U(n,{expected:be.joinValues(i),received:n.parsedType,code:D.invalid_type}),Y}if(this._cache||(this._cache=new Set(be.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=be.objectValues(r);return U(n,{received:n.data,code:D.invalid_enum_value,options:i}),Y}return Lr(e.data)}get enum(){return this._def.values}};hu.create=(t,e)=>new hu({values:t,typeName:J.ZodNativeEnum,...oe(e)});var ac=class extends fe{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:D.invalid_type,expected:q.promise,received:r.parsedType}),Y;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return Lr(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ac.create=(t,e)=>new ac({type:t,typeName:J.ZodPromise,...oe(e)});var fi=class extends fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{U(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){let o=i.transform(n.data,a);if(n.common.async)return Promise.resolve(o).then(async s=>{if(r.value==="aborted")return Y;let c=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return c.status==="aborted"?Y:c.status==="dirty"?ou(c.value):r.value==="dirty"?ou(c.value):c});{if(r.value==="aborted")return Y;let s=this._def.schema._parseSync({data:o,path:n.path,parent:n});return s.status==="aborted"?Y:s.status==="dirty"?ou(s.value):r.value==="dirty"?ou(s.value):s}}if(i.type==="refinement"){let o=s=>{let c=i.refinement(s,a);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Y:(s.status==="dirty"&&r.dirty(),o(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?Y:(s.status==="dirty"&&r.dirty(),o(s.value).then(()=>({status:r.value,value:s.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ic(o))return Y;let s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ic(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:r.value,value:s})):Y);be.assertNever(i)}};fi.create=(t,e,r)=>new fi({schema:t,typeName:J.ZodEffects,effect:e,...oe(r)});fi.createWithPreprocess=(t,e,r)=>new fi({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...oe(r)});var mi=class extends fe{_parse(e){return this._getType(e)===q.undefined?Lr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mi.create=(t,e)=>new mi({innerType:t,typeName:J.ZodOptional,...oe(e)});var Ua=class extends fe{_parse(e){return this._getType(e)===q.null?Lr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ua.create=(t,e)=>new Ua({innerType:t,typeName:J.ZodNullable,...oe(e)});var yu=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};yu.create=(t,e)=>new yu({innerType:t,typeName:J.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...oe(e)});var vu=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Gm(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new In(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new In(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};vu.create=(t,e)=>new vu({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...oe(e)});var af=class extends fe{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return U(n,{code:D.invalid_type,expected:q.nan,received:n.parsedType}),Y}return{status:"valid",value:e.data}}};af.create=t=>new af({typeName:J.ZodNaN,...oe(t)});var Pqe=Symbol("zod_brand"),W_=class extends fe{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},H_=class t extends fe{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Y:a.status==="dirty"?(r.dirty(),ou(a.value)):this._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Y:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:J.ZodPipeline})}},bu=class extends fe{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ic(i)&&(i.value=Object.freeze(i.value)),i);return Gm(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};bu.create=(t,e)=>new bu({innerType:t,typeName:J.ZodReadonly,...oe(e)});var Cqe={object:Pn.lazycreate},J;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(J||(J={}));var kqe=cu.create,Rqe=Jm.create,Eqe=af.create,Aqe=Km.create,Tqe=Ym.create,Oqe=Xm.create,Dqe=Qm.create,$qe=lu.create,Nqe=uu.create,Mqe=ef.create,jqe=Bo.create,Lqe=Vi.create,Uqe=tf.create,zqe=Vo.create,noe=Pn.create,Fqe=Pn.strictCreate,qqe=du.create,Bqe=gE.create,Vqe=pu.create,Wqe=La.create,Hqe=yE.create,Zqe=rf.create,Gqe=nf.create,Jqe=vE.create,Kqe=mu.create,Yqe=fu.create,Xqe=gu.create,Qqe=hu.create,eBe=ac.create,tBe=fi.create,rBe=mi.create,nBe=Ua.create,iBe=fi.createWithPreprocess,aBe=H_.create;function _u(t){return!!t._zod}function Wo(t,e){return _u(t)?Bs(t,e):t.safeParse(e)}function Z_(t){if(!t)return;let e;if(_u(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function cz(t){if(_u(t)){let a=t._zod?.def;if(a){if(a.value!==void 0)return a.value;if(Array.isArray(a.values)&&a.values.length>0)return a.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}function Ho(t){return t==="completed"||t==="failed"||t==="cancelled"}var uoe=Symbol("Let zodToJsonSchema decide on which parser to use");var f2e=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function bE(t){let r=Z_(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=cz(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function _E(t,e){let r=Wo(t,e);if(!r.success)throw r.error;return r.data}var hoe=6e4,G_=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(A_,r=>{this._oncancel(r)}),this.setNotificationHandler(O_,r=>{this._onprogress(r)}),this.setRequestHandler(T_,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(D_,async(r,n)=>{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(Se.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(N_,async(r,n)=>{let i=async()=>{let a=r.params.taskId;if(this._taskMessageQueue){let s;for(;s=await this._taskMessageQueue.dequeue(a,n.sessionId);){if(s.type==="response"||s.type==="error"){let c=s.message,l=c.id,u=this._requestResolvers.get(l);if(u)if(this._requestResolvers.delete(l),s.type==="response")u(c);else{let d=c,p=new ue(d.error.code,d.error.message,d.error.data);u(p)}else{let d=s.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${l}`))}continue}await this._transport?.send(s.message,{relatedRequestId:n.requestId})}}let o=await this._taskStore.getTask(a,n.sessionId);if(!o)throw new ue(Se.InvalidParams,`Task not found: ${a}`);if(!Ho(o.status))return await this._waitForTaskUpdate(a,n.signal),await i();if(Ho(o.status)){let s=await this._taskStore.getTaskResult(a,n.sessionId);return this._clearTaskQueue(a),{...s,_meta:{...s._meta,[Fo]:{taskId:a}}}}return await i()};return await i()}),this.setRequestHandler(M_,async(r,n)=>{try{let{tasks:i,nextCursor:a}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:i,nextCursor:a,_meta:{}}}catch(i){throw new ue(Se.InvalidParams,`Failed to list tasks: ${i instanceof Error?i.message:String(i)}`)}}),this.setRequestHandler(L_,async(r,n)=>{try{let i=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!i)throw new ue(Se.InvalidParams,`Task not found: ${r.params.taskId}`);if(Ho(i.status))throw new ue(Se.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let a=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!a)throw new ue(Se.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...a}}catch(i){throw i instanceof ue?i:new ue(Se.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,i,a=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:a,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),ue.fromError(Se.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=a=>{n?.(a),this._onerror(a)};let i=this._transport?.onmessage;this._transport.onmessage=(a,o)=>{i?.(a,o),Lm(a)||VU(a)?this._onresponse(a):GR(a)?this._onrequest(a,o):BU(a)?this._onnotification(a):this._onerror(new Error(`Unknown message type: ${JSON.stringify(a)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();let r=ue.fromError(Se.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,i=this._transport,a=e.params?._meta?.[Fo]?.taskId;if(n===void 0){let u={jsonrpc:"2.0",id:e.id,error:{code:Se.MethodNotFound,message:"Method not found"}};a&&this._taskMessageQueue?this._enqueueTaskMessage(a,{type:"error",message:u,timestamp:Date.now()},i?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):i?.send(u).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let o=new AbortController;this._requestHandlerAbortControllers.set(e.id,o);let s=zU(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,i?.sessionId):void 0,l={signal:o.signal,sessionId:i?.sessionId,_meta:e.params?._meta,sendNotification:async u=>{let d={relatedRequestId:e.id};a&&(d.relatedTask={taskId:a}),await this.notification(u,d)},sendRequest:async(u,d,p)=>{let m={...p,relatedRequestId:e.id};a&&!m.relatedTask&&(m.relatedTask={taskId:a});let f=m.relatedTask?.taskId??a;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(u,d,m)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:a,taskStore:c,taskRequestedTtl:s?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{s&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,l)).then(async u=>{if(o.signal.aborted)return;let d={result:u,jsonrpc:"2.0",id:e.id};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"response",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)},async u=>{if(o.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:Se.InternalError,message:u.message??"Internal error",...u.data!==void 0&&{data:u.data}}};a&&this._taskMessageQueue?await this._enqueueTaskMessage(a,{type:"error",message:d,timestamp:Date.now()},i?.sessionId):await i?.send(d)}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),a=this._progressHandlers.get(i);if(!a){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let o=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&o&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),o(c);return}a(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Lm(e))n(e);else{let o=new ue(e.error.code,e.error.message,e.error.data);n(o)}return}let i=this._responseHandlers.get(r);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let a=!1;if(Lm(e)&&e.result&&typeof e.result=="object"){let o=e.result;if(o.task&&typeof o.task=="object"){let s=o.task;typeof s.taskId=="string"&&(a=!0,this._taskProgressTokens.set(s.taskId,r))}}if(a||this._progressHandlers.delete(r),Lm(e))i(e);else{let o=ue.fromError(e.error.code,e.error.message,e.error.data);i(o)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:i}=n??{};if(!i){try{yield{type:"result",result:await this.request(e,r,n)}}catch(o){yield{type:"error",error:o instanceof ue?o:new ue(Se.InternalError,String(o))}}return}let a;try{let o=await this.request(e,iu,n);if(o.task)a=o.task.taskId,yield{type:"taskCreated",task:o.task};else throw new ue(Se.InternalError,"Task creation did not return a task");for(;;){let s=await this.getTask({taskId:a},n);if(yield{type:"taskStatus",task:s},Ho(s.status)){s.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)}:s.status==="failed"?yield{type:"error",error:new ue(Se.InternalError,`Task ${a} failed`)}:s.status==="cancelled"&&(yield{type:"error",error:new ue(Se.InternalError,`Task ${a} was cancelled`)});return}if(s.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:a},r,n)};return}let c=s.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(l=>setTimeout(l,c)),n?.signal?.throwIfAborted()}}catch(o){yield{type:"error",error:o instanceof ue?o:new ue(Se.InternalError,String(o))}}}request(e,r,n){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,task:s,relatedTask:c}=n??{};return new Promise((l,u)=>{let d=b=>{u(b)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),s&&this.assertTaskCapability(e.method)}catch(b){d(b);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),s&&(m.params={...m.params,task:s}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[Fo]:c}});let f=b=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(b)}},{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let _=b instanceof ue?b:new ue(Se.RequestTimeout,String(b));u(_)};this._responseHandlers.set(p,b=>{if(!n?.signal?.aborted){if(b instanceof Error)return u(b);try{let _=Wo(r,b.result);_.success?l(_.data):u(_.error)}catch(_){u(_)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let g=n?.timeout??hoe,h=()=>f(ue.fromError(Se.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(p,g,n?.maxTotalTimeout,h,n?.resetTimeoutOnProgress??!1);let v=c?.taskId;if(v){let b=_=>{let S=this._responseHandlers.get(p);S?S(_):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,b),this._enqueueTaskMessage(v,{type:"request",message:m,timestamp:Date.now()}).catch(_=>{this._cleanupTimeout(p),u(_)})}else this._transport.send(m,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(b=>{this._cleanupTimeout(p),u(b)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},$_,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},j_,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},ZU,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let s={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[Fo]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:s,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let s={...e,jsonrpc:"2.0"};r?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[Fo]:r.relatedTask}}}),this._transport?.send(s,r).catch(c=>this._onerror(c))});return}let o={...e,jsonrpc:"2.0"};r?.relatedTask&&(o={...o,params:{...o.params,_meta:{...o.params?._meta||{},[Fo]:r.relatedTask}}}),await this._transport.send(o,r)}setRequestHandler(e,r){let n=bE(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,a)=>{let o=_E(e,i);return Promise.resolve(r(o,a))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=bE(e);this._notificationHandlers.set(n,i=>{let a=_E(e,i);return Promise.resolve(r(a))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let i=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,i)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let i of n)if(i.type==="request"&&GR(i.message)){let a=i.message.id,o=this._requestResolvers.get(a);o?(o(new ue(Se.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(a)):this._onerror(new Error(`Resolver missing for request ${a} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(e);i?.pollInterval&&(n=i.pollInterval)}catch{}return new Promise((i,a)=>{if(r.aborted){a(new ue(Se.InvalidRequest,"Request cancelled"));return}let o=setTimeout(i,n);r.addEventListener("abort",()=>{clearTimeout(o),a(new ue(Se.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async i=>{if(!e)throw new Error("No request provided");return await n.createTask(i,e.id,{method:e.method,params:e.params},r)},getTask:async i=>{let a=await n.getTask(i,r);if(!a)throw new ue(Se.InvalidParams,"Failed to retrieve task: Task not found");return a},storeTaskResult:async(i,a,o)=>{await n.storeTaskResult(i,a,o,r);let s=await n.getTask(i,r);if(s){let c=Bm.parse({method:"notifications/tasks/status",params:s});await this.notification(c),Ho(s.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>n.getTaskResult(i,r),updateTaskStatus:async(i,a,o)=>{let s=await n.getTask(i,r);if(!s)throw new ue(Se.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(Ho(s.status))throw new ue(Se.InvalidParams,`Cannot update task "${i}" from terminal status "${s.status}" to "${a}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(i,a,o,r);let c=await n.getTask(i,r);if(c){let l=Bm.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ho(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>n.listTasks(i,r)}}};function lz(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function uz(t,e){let r={...t};for(let n in e){let i=n,a=e[i];if(a===void 0)continue;let o=r[i];lz(o)&&lz(a)?r[i]={...o,...a}:r[i]=a}return r}var Kq=Ht(aT(),1),Yq=Ht(Jq(),1);function ope(){let t=new Kq.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Yq.default)(t),t}var Tx=class{constructor(e){this._ajv=e??ope()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ox=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function Xq(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function Qq(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Dx=class extends G_{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Hm.options.map((n,i)=>[n,i])),this.isMessageIgnored=(n,i)=>{let a=this._loggingLevels.get(i);return a?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(a):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Tx,this.setRequestHandler(YR,n=>this._oninitialize(n)),this.setNotificationHandler(XR,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(cE,async(n,i)=>{let a=i.sessionId||i.requestInfo?.headers["mcp-session-id"]||void 0,{level:o}=n.params,s=Hm.safeParse(o);return s.success&&this._loggingLevels.set(a,s.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ox(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=uz(this._capabilities,e)}setRequestHandler(e,r){let i=Z_(e)?.method;if(!i)throw new Error("Schema is missing a method literal");let a;if(_u(i)){let s=i;a=s._zod?.def?.value??s.value}else{let s=i;a=s._def?.value??s.value}if(typeof a!="string")throw new Error("Schema method literal must be a string");if(a==="tools/call"){let s=async(c,l)=>{let u=Wo(Wm,c);if(!u.success){let f=u.error instanceof Error?u.error.message:String(u.error);throw new ue(Se.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=u.data,p=await Promise.resolve(r(c,l));if(d.task){let f=Wo(iu,p);if(!f.success){let g=f.error instanceof Error?f.error.message:String(f.error);throw new ue(Se.InvalidParams,`Invalid task creation result: ${g}`)}return f.data}let m=Wo(U_,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new ue(Se.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(e,s)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){Qq(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&Xq(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:jU.includes(r)?r:HR,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},E_)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],i=Array.isArray(n.content)?n.content:[n.content],a=i.some(l=>l.type==="tool_result"),o=e.messages.length>1?e.messages[e.messages.length-2]:void 0,s=o?Array.isArray(o.content)?o.content:[o.content]:[],c=s.some(l=>l.type==="tool_use");if(a){if(i.some(l=>l.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let l=new Set(s.filter(d=>d.type==="tool_use").map(d=>d.id)),u=new Set(i.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(l.size!==u.size||![...l].every(d=>u.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},uE,r):this.request({method:"sampling/createMessage",params:e},lE,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let i=e;return this.request({method:"elicitation/create",params:i},z_,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let i=e.mode==="form"?e:{...e,mode:"form"},a=await this.request({method:"elicitation/create",params:i},z_,r);if(a.action==="accept"&&a.content&&i.requestedSchema)try{let s=this._jsonSchemaValidator.getValidator(i.requestedSchema)(a.content);if(!s.valid)throw new ue(Se.InvalidParams,`Elicitation response content does not match requested schema: ${s.errorMessage}`)}catch(o){throw o instanceof ue?o:new ue(Se.InternalError,`Error validating elicitation response: ${o instanceof Error?o.message:String(o)}`)}return a}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},dE,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function spe(){let t=process.env.WEPPY_ROBLOX_MCP_VERSION?.trim();return t||null}var He=spe()??"2.17.8";var mT="weppy://ui-studio/guide",fT="weppy://ui-studio/tokens",gT="weppy://ui-studio/functional-rules",eB='# UI Studio Guide\n\n**Audience:** AI agents and developers building Roblox interfaces through UI Studio.\n**Resource:** `weppy://ui-studio/guide`\n**Policy:** Design Check quality findings are advisory. Schema errors, unsupported properties, forbidden paths, destructive-action boundaries, and external upload approval remain enforceable safety rules.\n\n## How to use this guide\n\nBuild from project evidence, not from a built-in game subject or genre preset. The guide has three layers:\n\n1. The advisory usability floor covers observable interaction and readability risks.\n2. The visual vocabulary offers optional directions, not a checklist or score.\n3. The review workflow separates verified functional evidence from visual judgment.\n\nVisual quality is contextual. Do not turn token values, shape counts, image counts, ornament counts, occupancy, or family counts into pass conditions.\n\n### Context-first brief gate\n\nFor an ambiguous request, call `manage_ui.design_brief` with an omitted or partial brief. Inspect Studio and project evidence before asking the user for information.\n\n- An empty `StarterGui` proves only that no Edit UI root was observed. For an existing-UI review, return `runtime_not_reviewed` until a Play Client `PlayerGui` observation is available. Treat it as new-interface evidence only when the user explicitly asks to create new UI.\n- Existing `ScreenGui` roots support a redesign or targeted-update interpretation.\n- A selected GUI object is strong target evidence unless the user names a broader scope.\n- Explicit `projectContext` and user choices outrank existing Studio patterns.\n- Existing Studio patterns may inform continuity, but they never create a reusable subject preset.\n- An explicit user placement, grouping, surface, flow, or backdrop choice outranks project evidence, existing UI, and WEPPY fallback in that order.\n\nAsk one focused question at a time. Include a current-state summary, a recommended choice with evidence, useful alternatives, and a free-form escape hatch. Return an exact `brief_patch` for an accepted recommendation.\n\n### Asset recommendation gate\n\nAsset evidence is considered in this order:\n\n1. user-provided `brief.reference_assets`\n2. approved `projectContext.approved_assets`\n3. relevant images already used by the selected project UI\n4. `manage_assets.search` only when `projectContext.asset_search_intent` is explicit and user-approved\n5. an assetless fallback\n\nDo not synthesize a subject search query from names, labels, hierarchy text, or Workspace content. Do not use a recommended asset until the user accepts it. Never invent an `rbxassetid://...` value.\n\n### Calling-agent capability and image generation gate\n\nInspect the calling agent\'s actual callable image capability and local output channel. Do not infer capability from a model or client name, and never record provider credentials.\n\n- Generation and Roblox upload require separate approval.\n- `image_review` means the calling agent can review an output; it does not authorize generation or upload.\n- If generation or local output is unavailable or unknown, continue with approved assets or an assetless fallback.\n\nAfter local generation, show the output for selection. Run upload preflight only after selection, and request separate approval naming the files, count, and destination.\n\n### Project Design Contract gate\n\nPass relevant repository evidence in `projectContext` instead of asking the Studio plugin to guess it:\n\n- `screen_job`, `primary_action`, `content_hierarchy`, recommended `required_states`, and explicitly blocking `required_state_ids`\n- `visual_thesis`, `signature_motif`, and `forbidden_defaults`\n- `presentation_mode` and `focal_region`\n- neutral `surface_roles` and `shape_language`\n- role-specific `layout_preferences` with their decision source\n- `target_profiles` and `platform_distribution`\n- project-owned tokens and approved assets with evidence paths\n\nKeep the returned `design_contract` and `brief_id` together. `create_tree` and `update` require an accepted brief. Candidate directions should differ materially in composition, hierarchy, or interaction behavior; palette swaps alone are not meaningful alternatives.\n\n### Role-based game layout contract\n\nWEPPY supplies style-neutral structure. The calling agent owns visual direction from explicit user intent plus game and project evidence. A WEPPY fallback must not choose the palette, font, imagery treatment, ornament, semantic shape, or numeric opacity for the project.\n\nFor an underspecified `non_modal_overlay`, translate neutral roles into these advisory constraints:\n\n- `persistent_status`: top-left compact individual chrome, growing inward from the edge;\n- `resource_display`: top-right compact chips in a row;\n- `navigation`: side rail or top edge, using individual controls instead of one large shared panel;\n- `slot_action`: bottom-center single-row flow only when the content has real slot semantics;\n- `contextual_action`: transient lower-center or target-relative action, normally one or a few controls;\n- `objective_tracker`: side-edge bounded group that can condense or collapse.\n\nUse a transparent group root for non-modal HUD regions. Opaque paint may remain inside the local bounds of a button, status chip, tracker, or other readable content surface. A contract-backed `modal_overlay`, `fullscreen_navigation`, or `diegetic` presentation may use a backdrop.\n\nOn touch profiles, keep a semantic slot bar between the touch-left and touch-right reserved regions and clear of the top inset. Prefer condense, paginate, collapse, or contextual disclosure over wrapping generic actions into a multi-row bottom-center grid.\n\nEach region can preserve `placement_band`, `flow_axis`, `surface_mode`, `avoid_regions`, `wrap_policy`, `decision_source`, and an optional numeric `max_edge_gap_px`. These are advisory composition constraints, not exact coordinates or a hard tree preset. When the explicit user or approved project evidence requests a different result, preserve it and report only observed functional risk. An explicit user placement without a numeric maximum does not inherit a WEPPY edge-gap limit.\n\n### Design Check coverage gate\n\n`manage_ui.check` reports findings and coverage independently.\n\n- `structural_only` means deterministic Studio checks ran without a calling-agent visual review.\n- `structural_and_visual` means a calling agent reviewed the referenced saved preview and submitted `visualReview` evidence.\n- `visual_status = "not_requested" | "skipped"` must remain visible even when deterministic findings are empty.\n\nUse `visualReview` and its `reviewContext` only for evidence actually reviewed. If interaction states or representative primary-view context are absent, preserve `interaction_states_not_reviewed` or `gameplay_context_unavailable`. WEPPY does not call an external AI service for visual review.\n\nFor UI created only at runtime, run a structured Play session with one client, wait for the UI, and use `snapshot_gui` on `{root:"PlayerGui",segments:[]}`. Pass the saved `{recordId,stepId}` as `runtimeEvidenceRef` and use `observationMode="runtime"` for `manage_ui.check`. The Bridge validates Place, session, client, step status, and PlayerGui origin; never submit a copied tree as runtime evidence. A truncated tree remains partial coverage.\n\nKeep semantic runtime evidence and screenshot evidence separate. Play-mode screenshot capture is unavailable in this build, so a PlayerGui snapshot can complete runtime structure coverage but cannot complete visual review by itself. Preserve `play_screenshot_unsupported`, `background_unverified`, state gaps, and other limitations.\n\n## A. Advisory usability and interaction floor\n\nThese are configurable recommendations. A `priority_high` finding indicates urgency, not a mutation block.\n\n### A.1 Hit, focus, and painted surfaces\n\nEvaluate the resolved `AbsoluteSize` of the interactive hit and focus area. The painted visual surface may be smaller or differently shaped when the larger invisible area does not overlap another action or hide content.\n\nUse target-profile recommendations for touch and focus reachability. Treat them as defaults that projects may adjust with evidence. Always verify that actions remain distinguishable and reachable for every declared input mode.\n\n### A.2 Safe areas and readable text\n\nUse `ScreenInsets`, device simulation, and the declared target profile where available. Review critical actions and information against the actual safe area rather than assuming one global inset.\n\nFor an edge-bound semantic region, compare both the container bounds and the actual painted descendant union with the declared safe boundary. The painted union includes visible background, text, image, and `UIStroke` geometry after `ClipsDescendants`. A transparent parent can therefore be attached while its visible controls remain detached. Report this as one `edge_detached` finding with container, visible, and internal gap evidence. AnchorPoint mismatch alone is diagnostic evidence, not a finding.\n\nEvaluate text against the resolved background, including composable transparency. When an image, gradient, transparent game view, or complex overlay prevents a deterministic background result, return `background_unverified` instead of assuming a dark fallback. Check `TextFits`, `TextBounds`, clipping, long localized strings, and maximum numeric content. Contrast and text-size values are accessibility recommendations, not visual-style quotas. If `TextScaled` is used, constrain it with `UITextSizeConstraint` and verify representative locales.\n\nInspect visible text, images, actions, and painted progress indicators even when semantic metadata is absent. Compare direct siblings and meaningful surfaces across enabled ScreenGui roots. Exclude parent-child paint, progress fill/background composition, hidden roots, and contract-backed intentional overlap. Treat public inset and Core UI state as observed evidence; if expanded chat, player list, or touch-control geometry cannot be observed, report it as estimated or unavailable.\n\n### A.3 Input disclosure and state access\n\nA readable embedded action text can be the visible label when it remains legible across declared targets and locales. Do not duplicate it with a second adjacent label.\n\nUnfamiliar controls need an input-appropriate explanation path:\n\n- pointer and keyboard can use hover or focus labels;\n- gamepad needs a focus-visible action label and current binding;\n- touch needs a persistent label, a labelled disclosure control, or another touch-visible hint.\n\nEvery declared input mode should expose the action meaning and relevant resting, focus, pressed, selected, and disabled states. Pointer hover alone does not establish all-input discoverability.\n\n### A.4 Primary-view protection\n\nFor `non_modal_overlay`, keep the Design Contract focal region visually available. If UI and the primary view compete, consider edge placement, reflow, condensation, collapse, or contextual disclosure. Do not enforce a fixed screen-occupancy ratio.\n\nModal, fullscreen navigation, and diegetic presentation may intentionally use a backdrop when the contract supports it. A full-screen opaque surface is not automatically wrong; its presentation role decides.\n\n### A.5 Supported Roblox UI components\n\nUI Studio tree encoding supports `UIScale`, `UIFlexItem`, `UIShadow`, `UIPageLayout`, `UITableLayout`, `CanvasGroup`, `UIDragDetector`, `UIAspectRatioConstraint`, `UISizeConstraint`, and `UITextSizeConstraint` where listed by the public schema.\n\nNo class is a quality guarantee. Likewise, a `Frame`, `Offset`, sharp edge, or absent image is not a failure by itself. Report observable bounds, text-fit, reachability, focus-path, safe-area, aspect, or interaction evidence.\n\n## B. Visual vocabulary\n\nThis vocabulary is exploratory. Combine, omit, or extend options when project evidence supports the result. Consistency should be explained through roles and relationships, not through rigid family counts.\n\n### B.1 neutral surface roles\n\nAssign visible surfaces a neutral surface role before styling:\n\n- `primary_action`\n- `secondary_action`\n- `navigation`\n- `persistent_status`\n- `transient_status`\n- `resource_display`\n- `contextual_information`\n- `identity`\n- `spatial_information`\n- `slot_action`\n- `contextual_action`\n- `objective_tracker`\n- `decoration`\n\nProjects may add opaque roles. WEPPY must not reuse their subject meaning as another project\'s default.\n\nAn interaction family describes how controls reveal affordance and state. It may be framed, tactile, diegetic, tab-like, ornamented, or an intentional flat control. Gradient, shadow, bevel, rounding, and imagery are optional.\n\n### B.2 Container edge language and semantic shape\n\nPlan container edge language separately from semantic shape.\n\n- Container edge language can be sharp, softly rounded, strongly rounded, cut-corner, asymmetric, organic, or project-defined.\n- Semantic shapes can include a circle, ring, pill, rounded marker, directional wedge, segmented track, organic silhouette, or another project-defined form.\n- A compact status marker may use a ring while a nearby action uses a pill and its containing panel uses a sharp edge language.\n- Mixed semantic shapes supported by role evidence are not a style failure.\n\nUse circles and rings where radial reading, identity, progress, direction, or compact status makes them clearer. Use pills where a short label and bounded interactive state benefit from that silhouette. Use rounded containers when softness or touch affordance supports the thesis. Preserve sharp or cut edges when they better support the project.\n\nDo not require every surface to share one radius. Avoid arbitrary inconsistency, but explain meaningful differences through role, interaction state, hierarchy, or the signature motif.\n\n### B.3 Layout, anchor, and pivot strategy\n\nChoose layout from content hierarchy, parent relationship, focal region, and target profiles.\n\n- Edge placement protects the primary view for persistent non-modal information.\n- Centered hierarchy supports intentionally modal or focused flows.\n- Split, asymmetric, radial, layered, and flow layouts are valid when they clarify relationships.\n- Repeated rectangles are not a default composition. Use bounded panels only where grouping, backdrop, scrolling, or interaction requires them.\n\nTreat `AnchorPoint` as the element\'s positional pivot:\n\n- left/top pivots suit content growing inward from those edges;\n- center pivots suit centered or symmetric relationships;\n- right/bottom pivots suit content growing inward from those edges;\n- project-specific pivots may support a spatial or animated relationship.\n\nWhen using `create_tree`, add optional `layoutMetadata` to meaningful region roots so preview metadata can preserve `surfaceRole`, `placementBand`, `surfaceMode`, and `decisionSource` for review.\n\nScale and Offset are tools, not pass/fail signals. Use Scale for proportional relationships, Offset for stable local dimensions, and combine them deliberately. Add `UIScale`, `UISizeConstraint`, `UIAspectRatioConstraint`, `UITextSizeConstraint`, layout components, Style Query, or project scripts when the target behavior needs them. Verify the resolved result in declared profiles.\n\n### B.4 Imagery strategy\n\nChoose imagery based on explicit role evidence:\n\n- `symbol_set`: consistent compact signs or glyphs\n- `content_thumbnail`: a visual representation of selectable or referenced content\n- `identity_visual`: a visual used primarily for identity or recognition\n- `illustrative_backdrop`: non-interactive atmosphere or framing art\n- `diegetic_surface`: a surface visually integrated with the project world\n- `no_imagery`: an intentional text-and-shape direction\n\nDifferent roles may justify different imagery families on one screen. Coherence comes from treatment, hierarchy, and evidence\u2014not a family quota. If no approved asset exists, use a labelled geometric marker, project-approved glyph, clear placeholder, or `no_imagery`.\n\n### B.5 Depth, ornament, type, colour, and motion\n\nTokens under `weppy://ui-studio/tokens` are examples. They can suggest palette, typography, edge, motion, depth, and composition directions, but they are never mandatory values or quality scores.\n\n- Flatness can be intentional when hierarchy and state remain clear.\n- Depth may use stroke, tonal separation, overlap, shadow, or project imagery.\n- Ornament should reinforce hierarchy or a signature motif rather than fill empty space.\n- Motion should explain state or relationship and respect reduced-motion evidence.\n- Intentional silence\u2014no imagery, no ornament, or no motion\u2014is valid when the contract explains it.\n\n### B.6 Composition and distinctiveness\n\nProtect a clear reading order without forcing a single focal-area percentage. Important relationships may be expressed through scale, placement, colour, typography, motion, negative space, or semantic shape.\n\nBefore applying generic equal-weight rectangles, ask whether the roles call for edge markers, radial indicators, layered surfaces, labelled controls, a bounded content region, or contextual disclosure. If two projects differ only by palette, revisit their evidence and layout plan.\n\n## C. Review workflow\n\n### C.1 Primary visual builder and critic loop\n\nUse **Builder \u2192 Preview \u2192 Critic \u2192 Update** as the primary quality loop:\n\n1. **Builder:** compose from the accepted Design Contract, role relationships, reference evidence, and imagery strategy.\n2. **Preview:** capture the representative primary view after each meaningful create or update pass.\n3. **Critic:** compare the screenshot with the contract and references, then return `recompose`, `refine`, or `approved` with a concise summary and path-backed findings.\n4. **Update:** recompose when the layout or presentation model is wrong; refine when the direction is sound but hierarchy, geometry, imagery, or state treatment needs another pass.\n\nDo not treat schema success or an empty deterministic result as visual approval. `approved` requires representative primary-view evidence, no unresolved `priority_high` functional risk, and a resolved imagery strategy. When required imagery still has only a placeholder or fallback, keep primary visual approval ineligible and propose the separately approved generation or asset path.\n\n### C.2 Visual review\n\nReview qualitative decisions against the Design Contract:\n\n- Is the screen job evident?\n- Does hierarchy match `content_hierarchy`?\n- Are action and information roles distinguishable?\n- Does the container edge language support the visual thesis?\n- Do semantic shapes have role evidence?\n- Is imagery intentional, approved, or intentionally absent?\n- Does the composition protect the focal region?\n- Are required interaction states discoverable for declared inputs?\n\nDo not add visual elements merely to reduce finding counts. Do not issue a failure because a surface is rectangular, circular, sharp, rounded, flat, or image-free.\n\n### C.3 Responsive review\n\nReview the primary target first, then secondary and compatibility targets. User-selected targets and Experience analytics outrank a generic platform default. Excluded targets are recorded but not evaluated as required coverage.\n\nFor each reviewed profile, inspect:\n\n- critical bounds and overlap\n- text fit and localization pressure\n- anchor/pivot behavior during resize and orientation change\n- safe-area placement\n- action reachability and focus path\n- whether reflow, collapse, or contextual disclosure preserves outcomes\n\nIf device simulation is unavailable, report responsive coverage as skipped. Static arithmetic alone does not prove Roblox layout behavior.\n\n### C.4 Coverage language\n\nZero findings means no finding was observed in the checks that ran. It does not mean all quality dimensions passed. Keep structure, visual, interaction, primary-view context, and responsive viewport coverage independent.\n\n## D. Tree encoding\n\n`create_tree` and `update.changes.properties` accept constrained JSON values:\n\n| Roblox type | JSON shape |\n|---|---|\n| `UDim2` | `{xScale, xOffset, yScale, yOffset}` |\n| `UDim` | `{scale, offset}` |\n| `Color3` | `{r, g, b}` |\n| `Vector2` | `{x, y}` |\n| `Vector3` | `{x, y, z}` |\n| `NumberSequence` | `number` or keypoint array |\n| `ColorSequence` | colour keypoint array |\n| `Font` | enum string or `{family, weight, style}` |\n| Enum property | item-name string |\n\nUse a JSON newline escape for multiline text and set `TextWrapped` when appropriate, or use separate `TextLabel` children with a layout component. Do not double-escape a newline into visible backslash text.\n\nKeep `Size` and `Position` in UDim2 object form. Keep colour channel conventions consistent within a tree. Preserve clear instance paths so later updates can target approved placeholders or assets.\n\n---\n\nThis tracked source is embedded into the generated server resource. Run `npm run codegen` after editing it.\n',tB=`{
|
|
246
246
|
"$schema": "./design-tokens.schema.json",
|
|
247
247
|
"version": "2.0.0",
|
|
248
248
|
"_notes": "palettes is a style-family menu, not a list of recommendations. Each entry carries mood/pairs_with/avoid_for to help match a design_brief. Adding new palettes is encouraged. See ui-studio-guide.md \xA7B.1 and \xA7C.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.8",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|