@interactive-inc/claude-funnel 0.64.2 → 0.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/bin.js +5 -5
  2. package/dist/broadcaster-DVNcw00K.d.ts +138 -0
  3. package/dist/channel.d.ts +161 -0
  4. package/dist/channel.js +203 -0
  5. package/dist/{channels-CRGb6B5_.d.ts → channels-DR90RmUP.d.ts} +5 -4
  6. package/dist/claude.d.ts +4 -4
  7. package/dist/claude.js +1 -1
  8. package/dist/{connector-descriptor-BFIhyTfa.d.ts → connector-descriptor-CmyHlEiT.d.ts} +3 -26
  9. package/dist/connectors/discord.d.ts +27 -6
  10. package/dist/connectors/discord.js +1 -1
  11. package/dist/connectors/gh.d.ts +4 -3
  12. package/dist/connectors/schedule.d.ts +4 -3
  13. package/dist/connectors/slack.d.ts +4 -3
  14. package/dist/diagnostics.d.ts +1 -1
  15. package/dist/{discord-connector-DIFkYBbi.js → discord-connector-DXARcO6w.js} +18 -2
  16. package/dist/docs.d.ts +1 -1
  17. package/dist/doctor.d.ts +1 -1
  18. package/dist/{file-process-guard-tVcgckH6.d.ts → file-process-guard-CiBwXjzm.d.ts} +5 -4
  19. package/dist/{flume-source-listener-BNyAII7N.d.ts → flume-source-listener-FzR5lGpL.d.ts} +2 -1
  20. package/dist/{funnel-diagnostics-b9ar0Ing.d.ts → funnel-diagnostics-kbd27d7I.d.ts} +1 -1
  21. package/dist/{funnel-doctor-CnRQi4kM.d.ts → funnel-doctor-CVTNUtDn.d.ts} +2 -2
  22. package/dist/{funnel-recovery-CMhY8Jfk.d.ts → funnel-recovery-D8MkiTpk.d.ts} +1 -1
  23. package/dist/gateway/daemon.js +19 -19
  24. package/dist/gateway.d.ts +3 -2
  25. package/dist/{index-Ds6sHhA-.d.ts → index-BU1TtuFy.d.ts} +6 -139
  26. package/dist/index.d.ts +19 -17
  27. package/dist/local-config.d.ts +2 -2
  28. package/dist/logger-Bc_Ooypb.d.ts +25 -0
  29. package/dist/{memory-token-prompter-BoV8Hf-n.d.ts → memory-token-prompter-D0kIdhar.d.ts} +2 -2
  30. package/dist/{profiles-cVZQkM69.d.ts → profiles-M24JrcOh.d.ts} +3 -3
  31. package/dist/profiles.d.ts +1 -1
  32. package/dist/recovery.d.ts +1 -1
  33. package/dist/{settings-reader-BNxjsxCB.d.ts → settings-reader-BnKIbmsD.d.ts} +1 -1
  34. package/package.json +7 -2
  35. /package/dist/{discord-connector-schema-D-bOVAKt.d.ts → discord-connector-schema-D1dyxhXk.d.ts} +0 -0
  36. /package/dist/{file-system-VhwwXZbm.d.ts → file-system-DHgbuTFb.d.ts} +0 -0
  37. /package/dist/{funnel-docs-CNklHvbt.d.ts → funnel-docs-Cd66sKyV.d.ts} +0 -0
  38. /package/dist/{gh-connector-schema-DWQaB6gX.d.ts → gh-connector-schema-BCHEqpUg.d.ts} +0 -0
  39. /package/dist/{schedule-connector-schema-Z0RXLgPI.d.ts → schedule-connector-schema-D7ZEKvit.d.ts} +0 -0
  40. /package/dist/{settings-schema-BL_c2Udm.d.ts → settings-schema-IShSMm5G.d.ts} +0 -0
  41. /package/dist/{slack-event-processor-BhCf5Wiy.d.ts → slack-event-processor-BDTr62cN.d.ts} +0 -0
package/dist/bin.js CHANGED
@@ -145,7 +145,7 @@ ${v.comment}`:v.comment}this.doc.range[2]=v.offset;break}default:this.errors.pus
145
145
  `)+1;while(v!==0)this.onNewLine(this.offset+v),v=this.source.indexOf(`
146
146
  `,v)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,v.value){let U="end"in v.value?v.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else{if(this.atIndentedComment(v.start,$.indent)){let I=$.items[$.items.length-2]?.value?.end;if(Array.isArray(I)){tW(I,v.start),I.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return}if(this.indent>=$.indent){let U=!this.onKeyLine&&this.indent===$.indent,I=U&&(v.sep||v.explicitKey)&&this.type!=="seq-item-ind",b=[];if(I&&v.sep&&!v.value){let D=[];for(let u=0;u<v.sep.length;++u){let w=v.sep[u];switch(w.type){case"newline":D.push(u);break;case"space":break;case"comment":if(w.indent>$.indent)D.length=0;break;default:D.length=0}}if(D.length>=2)b=v.sep.splice(D[1])}switch(this.type){case"anchor":case"tag":if(I||v.value)b.push(this.sourceToken),$.items.push({start:b}),this.onKeyLine=!0;else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"explicit-key-ind":if(!v.sep&&!v.explicitKey)v.start.push(this.sourceToken),v.explicitKey=!0;else if(I||v.value)b.push(this.sourceToken),$.items.push({start:b,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(v.explicitKey)if(!v.sep)if(gb(v.start,"newline"))Object.assign(v,{key:null,sep:[this.sourceToken]});else{let D=cI(v.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:D,key:null,sep:[this.sourceToken]}]})}else if(v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gb(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:b,key:null,sep:[this.sourceToken]}]});else if(xi(v.key)&&!gb(v.sep,"newline")){let D=cI(v.start),u=v.key,w=v.sep;w.push(this.sourceToken),delete v.key,delete v.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:D,key:u,sep:w}]})}else if(b.length>0)v.sep=v.sep.concat(b,this.sourceToken);else v.sep.push(this.sourceToken);else if(!v.sep)Object.assign(v,{key:null,sep:[this.sourceToken]});else if(v.value||I)$.items.push({start:b,key:null,sep:[this.sourceToken]});else if(gb(v.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else v.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let D=this.flowScalar(this.type);if(I||v.value)$.items.push({start:b,key:D,sep:[]}),this.onKeyLine=!0;else if(v.sep)this.stack.push(D);else Object.assign(v,{key:D,sep:[]}),this.onKeyLine=!0;return}default:{let D=this.startBlockValue($);if(D){if(D.type==="block-seq"){if(!v.explicitKey&&v.sep&&!gb(v.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(U)$.items.push({start:b});this.stack.push(D);return}}}}yield*this.pop(),yield*this.step()}*blockSequence($){let v=$.items[$.items.length-1];switch(this.type){case"newline":if(v.value){let U="end"in v.value?v.value.end:void 0;if((Array.isArray(U)?U[U.length-1]:void 0)?.type==="comment")U?.push(this.sourceToken);else $.items.push({start:[this.sourceToken]})}else v.start.push(this.sourceToken);return;case"space":case"comment":if(v.value)$.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(v.start,$.indent)){let I=$.items[$.items.length-2]?.value?.end;if(Array.isArray(I)){tW(I,v.start),I.push(this.sourceToken),$.items.pop();return}}v.start.push(this.sourceToken)}return;case"anchor":case"tag":if(v.value||this.indent<=$.indent)break;v.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==$.indent)break;if(v.value||gb(v.start,"seq-item-ind"))$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return}if(this.indent>$.indent){let U=this.startBlockValue($);if(U){this.stack.push(U);return}}yield*this.pop(),yield*this.step()}*flowCollection($){let v=$.items[$.items.length-1];if(this.type==="flow-error-end"){let U;do yield*this.pop(),U=this.peek(1);while(U?.type==="flow-collection")}else if($.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!v||v.sep)$.items.push({start:[this.sourceToken]});else v.start.push(this.sourceToken);return;case"map-value-ind":if(!v||v.value)$.items.push({start:[],key:null,sep:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else Object.assign(v,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!v||v.value)$.items.push({start:[this.sourceToken]});else if(v.sep)v.sep.push(this.sourceToken);else v.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let I=this.flowScalar(this.type);if(!v||v.value)$.items.push({start:[],key:I,sep:[]});else if(v.sep)this.stack.push(I);else Object.assign(v,{key:I,sep:[]});return}case"flow-map-end":case"flow-seq-end":$.end.push(this.sourceToken);return}let U=this.startBlockValue($);if(U)this.stack.push(U);else yield*this.pop(),yield*this.step()}else{let U=this.peek(2);if(U.type==="block-map"&&(this.type==="map-value-ind"&&U.indent===$.indent||this.type==="newline"&&!U.items[U.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&U.type!=="flow-collection"){let I=oW(U),b=cI(I);ii($);let D=$.end.splice(1,$.end.length);D.push(this.sourceToken);let u={type:"block-map",offset:$.offset,indent:$.indent,items:[{start:b,key:$,sep:D}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd($)}}flowScalar($){if(this.onNewLine){let v=this.source.indexOf(`
147
147
  `)+1;while(v!==0)this.onNewLine(this.offset+v),v=this.source.indexOf(`
148
- `,v)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let v=oW($),U=cI(v);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let v=oW($),U=cI(v);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,v){if(this.type!=="comment")return!1;if(this.indent<=v)return!1;return $.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}$G$.Parser=li});var ci=P((JG$)=>{var fi=IA(),bG$=yD(),dD=hD(),UG$=HB(),IG$=V$(),DG$=HA(),yi=zA();function hi($){let v=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||v&&new DG$.LineCounter||null,prettyErrors:v}}function uG$($,v={}){let{lineCounter:U,prettyErrors:I}=hi(v),b=new yi.Parser(U?.addNewLine),D=new fi.Composer(v),u=Array.from(D.compose(b.parse($)));if(I&&U)for(let w of u)w.errors.forEach(dD.prettifyError($,U)),w.warnings.forEach(dD.prettifyError($,U));if(u.length>0)return u;return Object.assign([],{empty:!0},D.streamInfo())}function mi($,v={}){let{lineCounter:U,prettyErrors:I}=hi(v),b=new yi.Parser(U?.addNewLine),D=new fi.Composer(v),u=null;for(let w of D.compose(b.parse($),!0,$.length))if(!u)u=w;else if(u.options.logLevel!=="silent"){u.errors.push(new dD.YAMLParseError(w.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(I&&U)u.errors.forEach(dD.prettifyError($,U)),u.warnings.forEach(dD.prettifyError($,U));return u}function wG$($,v,U){let I=void 0;if(typeof v==="function")I=v;else if(U===void 0&&v&&typeof v==="object")U=v;let b=mi($,U);if(!b)return null;if(b.warnings.forEach((D)=>UG$.warn(b.options.logLevel,D)),b.errors.length>0)if(b.options.logLevel!=="silent")throw b.errors[0];else b.errors=[];return b.toJS(Object.assign({reviver:I},U))}function gG$($,v,U){let I=null;if(typeof v==="function"||Array.isArray(v))I=v;else if(U===void 0&&v)U=v;if(typeof U==="string")U=U.length;if(typeof U==="number"){let b=Math.round(U);U=b<1?void 0:b>8?{indent:8}:{indent:b}}if($===void 0){let{keepUndefined:b}=U??v??{};if(!b)return}if(IG$.isDocument($)&&!I)return $.toString(U);return new bG$.Document($,I,U).toString(U)}JG$.parse=wG$;JG$.parseAllDocuments=uG$;JG$.parseDocument=mi;JG$.stringify=gG$});import{homedir as vz$}from"os";var NP={name:"@interactive-inc/claude-funnel",version:"0.64.2",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./claude":{types:"./dist/claude.d.ts",import:"./dist/claude.js",default:"./dist/claude.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./diagnostics":{types:"./dist/diagnostics.d.ts",import:"./dist/diagnostics.js",default:"./dist/diagnostics.js"},"./recovery":{types:"./dist/recovery.d.ts",import:"./dist/recovery.js",default:"./dist/recovery.js"},"./doctor":{types:"./dist/doctor.d.ts",import:"./dist/doctor.js",default:"./dist/doctor.js"},"./docs":{types:"./dist/docs.d.ts",import:"./dist/docs.js",default:"./dist/docs.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./logger":{types:"./dist/logger.d.ts",import:"./dist/logger.js",default:"./dist/logger.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"0.8.0","@interactive-inc/flume":"^0.9.2","@modelcontextprotocol/sdk":"^1.29.0",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21",vitest:"^4.1.8"},engines:{bun:">=1.3.0"}};var e=class extends Error{res;status;constructor($=500,v){super(v?.message,{cause:v?.cause});this.res=v?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var H={};e$(H,{xor:()=>IN,xid:()=>Sj,void:()=>ej,uuidv7:()=>Lj,uuidv6:()=>Vj,uuidv4:()=>Yj,uuid:()=>Qj,util:()=>R,url:()=>Kj,uppercase:()=>GU,unknown:()=>Kb,union:()=>iw,undefined:()=>pj,ulid:()=>Nj,uint64:()=>tj,uint32:()=>mj,tuple:()=>Rz,trim:()=>VU,treeifyError:()=>NG,transform:()=>lw,toUpperCase:()=>KU,toLowerCase:()=>LU,toJSONSchema:()=>Gw,templateLiteral:()=>VN,symbol:()=>dj,superRefine:()=>JQ,success:()=>HN,stringbool:()=>NN,stringFormat:()=>Cj,string:()=>L1,strictObject:()=>bN,startsWith:()=>HU,slugify:()=>qU,size:()=>Yb,setErrorMap:()=>Om,set:()=>JN,safeParseAsync:()=>Jz,safeParse:()=>gz,safeEncodeAsync:()=>Qz,safeEncode:()=>Hz,safeDecodeAsync:()=>Yz,safeDecode:()=>zz,registry:()=>ru,regexes:()=>yv,regex:()=>XU,refine:()=>gQ,record:()=>nz,readonly:()=>bQ,property:()=>gw,promise:()=>LN,prettifyError:()=>SG,preprocess:()=>MN,prefault:()=>tz,positive:()=>Iw,pipe:()=>Lw,partialRecord:()=>uN,parseAsync:()=>wz,parse:()=>uz,overwrite:()=>w4,optional:()=>q1,object:()=>vN,number:()=>Lz,nullish:()=>ON,nullable:()=>B1,null:()=>Pz,normalize:()=>YU,nonpositive:()=>uw,nonoptional:()=>dz,nonnegative:()=>ww,never:()=>Cw,negative:()=>Dw,nativeEnum:()=>XN,nanoid:()=>Aj,nan:()=>zN,multipleOf:()=>j6,minSize:()=>M4,minLength:()=>m4,mime:()=>QU,meta:()=>PN,maxSize:()=>N6,maxLength:()=>Vb,map:()=>gN,mac:()=>Fj,lte:()=>hv,lt:()=>N4,lowercase:()=>WU,looseRecord:()=>wN,looseObject:()=>UN,locales:()=>z1,literal:()=>WN,length:()=>Lb,lazy:()=>DQ,ksuid:()=>Mj,keyof:()=>$N,jwt:()=>rj,json:()=>SN,iso:()=>PU,ipv6:()=>Zj,ipv4:()=>_j,invertCodec:()=>YN,intersection:()=>kz,int64:()=>oj,int32:()=>hj,int:()=>Vw,instanceof:()=>jN,includes:()=>OU,httpUrl:()=>qj,hostname:()=>ij,hex:()=>xj,hash:()=>lj,guid:()=>zj,gte:()=>qv,gt:()=>S4,globalRegistry:()=>Dv,getErrorMap:()=>Hm,function:()=>KN,fromJSONSchema:()=>FN,formatError:()=>I1,float64:()=>yj,float32:()=>fj,flattenError:()=>U1,file:()=>GN,exactOptional:()=>yz,enum:()=>xw,endsWith:()=>zU,encodeAsync:()=>Gz,encode:()=>Xz,emoji:()=>Bj,email:()=>Hj,e164:()=>nj,discriminatedUnion:()=>DN,describe:()=>AN,decodeAsync:()=>Oz,decode:()=>Wz,date:()=>sj,custom:()=>BN,cuid2:()=>jj,cuid:()=>Pj,core:()=>c4,config:()=>c$,coerce:()=>WQ,codec:()=>QN,clone:()=>Lv,cidrv6:()=>kj,cidrv4:()=>Tj,check:()=>qN,catch:()=>ez,boolean:()=>Kz,bigint:()=>cj,base64url:()=>Rj,base64:()=>Ej,array:()=>N1,any:()=>aj,_function:()=>KN,_default:()=>cz,_ZodString:()=>Kw,ZodXor:()=>Fz,ZodXID:()=>Sw,ZodVoid:()=>Mz,ZodUnknown:()=>Nz,ZodUnion:()=>M1,ZodUndefined:()=>Bz,ZodUUID:()=>_4,ZodURL:()=>P1,ZodULID:()=>Nw,ZodType:()=>U$,ZodTuple:()=>Ez,ZodTransform:()=>lz,ZodTemplateLiteral:()=>UQ,ZodSymbol:()=>qz,ZodSuccess:()=>pz,ZodStringFormat:()=>j$,ZodString:()=>SU,ZodSet:()=>Cz,ZodRecord:()=>jU,ZodRealError:()=>kv,ZodReadonly:()=>vQ,ZodPromise:()=>uQ,ZodPreprocess:()=>$Q,ZodPrefault:()=>oz,ZodPipe:()=>_1,ZodOptional:()=>fw,ZodObject:()=>S1,ZodNumberFormat:()=>qb,ZodNumber:()=>_U,ZodNullable:()=>hz,ZodNull:()=>Az,ZodNonOptional:()=>yw,ZodNever:()=>Sz,ZodNanoID:()=>Aw,ZodNaN:()=>sz,ZodMap:()=>rz,ZodMAC:()=>Vz,ZodLiteral:()=>iz,ZodLazy:()=>IQ,ZodKSUID:()=>Mw,ZodJWT:()=>nw,ZodIssueCode:()=>Gm,ZodIntersection:()=>Tz,ZodISOTime:()=>Qw,ZodISODuration:()=>Yw,ZodISODateTime:()=>Hw,ZodISODate:()=>zw,ZodIPv6:()=>Fw,ZodIPv4:()=>_w,ZodGUID:()=>K1,ZodFunction:()=>wQ,ZodFirstPartyTypeKind:()=>XQ,ZodFile:()=>xz,ZodExactOptional:()=>fz,ZodError:()=>Xm,ZodEnum:()=>NU,ZodEmoji:()=>Bw,ZodEmail:()=>qw,ZodE164:()=>Rw,ZodDiscriminatedUnion:()=>Zz,ZodDefault:()=>mz,ZodDate:()=>j1,ZodCustomStringFormat:()=>MU,ZodCustom:()=>Z1,ZodCodec:()=>F1,ZodCatch:()=>az,ZodCUID2:()=>jw,ZodCUID:()=>Pw,ZodCIDRv6:()=>Tw,ZodCIDRv4:()=>Zw,ZodBoolean:()=>FU,ZodBigIntFormat:()=>rw,ZodBigInt:()=>ZU,ZodBase64URL:()=>Ew,ZodBase64:()=>kw,ZodArray:()=>_z,ZodAny:()=>jz,TimePrecision:()=>RH,NEVER:()=>HG,$output:()=>_H,$input:()=>FH,$brand:()=>zG});var c4={};e$(c4,{version:()=>A9,util:()=>R,treeifyError:()=>NG,toJSONSchema:()=>Gw,toDotPath:()=>kP,safeParseAsync:()=>_G,safeParse:()=>MG,safeEncodeAsync:()=>Gy,safeEncode:()=>Xy,safeDecodeAsync:()=>Oy,safeDecode:()=>Wy,registry:()=>ru,regexes:()=>yv,process:()=>q$,prettifyError:()=>SG,parseAsync:()=>zu,parse:()=>Hu,meta:()=>z8,locales:()=>z1,isValidJWT:()=>vj,isValidBase64URL:()=>$j,isValidBase64:()=>m9,initializeContext:()=>S6,globalRegistry:()=>Dv,globalConfig:()=>Gb,formatError:()=>I1,flattenError:()=>U1,finalize:()=>_6,extractDefs:()=>M6,encodeAsync:()=>gy,encode:()=>uy,describe:()=>H8,decodeAsync:()=>Jy,decode:()=>wy,createToJSONSchemaMethod:()=>Y8,createStandardJSONSchemaMethod:()=>AU,config:()=>c$,clone:()=>Lv,_xor:()=>xh,_xid:()=>tu,_void:()=>D8,_uuidv7:()=>fu,_uuidv6:()=>lu,_uuidv4:()=>xu,_uuid:()=>iu,_url:()=>Y1,_uppercase:()=>GU,_unknown:()=>U8,_union:()=>ih,_undefined:()=>$8,_ulid:()=>ou,_uint64:()=>eH,_uint32:()=>cH,_tuple:()=>yh,_trim:()=>VU,_transform:()=>ph,_toUpperCase:()=>KU,_toLowerCase:()=>LU,_templateLiteral:()=>Dm,_symbol:()=>sH,_superRefine:()=>O8,_success:()=>vm,_stringbool:()=>Q8,_stringFormat:()=>BU,_string:()=>TH,_startsWith:()=>HU,_slugify:()=>qU,_size:()=>Yb,_set:()=>ch,_safeParseAsync:()=>wU,_safeParse:()=>uU,_safeEncodeAsync:()=>Bu,_safeEncode:()=>Ku,_safeDecodeAsync:()=>Au,_safeDecode:()=>qu,_regex:()=>XU,_refine:()=>G8,_record:()=>hh,_readonly:()=>Im,_property:()=>gw,_promise:()=>wm,_positive:()=>Iw,_pipe:()=>Um,_parseAsync:()=>DU,_parse:()=>IU,_overwrite:()=>w4,_optional:()=>ah,_number:()=>xH,_nullable:()=>eh,_null:()=>v8,_normalize:()=>YU,_nonpositive:()=>uw,_nonoptional:()=>$m,_nonnegative:()=>ww,_never:()=>I8,_negative:()=>Dw,_nativeEnum:()=>th,_nanoid:()=>hu,_nan:()=>g8,_multipleOf:()=>j6,_minSize:()=>M4,_minLength:()=>m4,_min:()=>qv,_mime:()=>QU,_maxSize:()=>N6,_maxLength:()=>Vb,_max:()=>hv,_map:()=>mh,_mac:()=>EH,_lte:()=>hv,_lt:()=>N4,_lowercase:()=>WU,_literal:()=>dh,_length:()=>Lb,_lazy:()=>um,_ksuid:()=>du,_jwt:()=>Uw,_isoTime:()=>CH,_isoDuration:()=>iH,_isoDateTime:()=>nH,_isoDate:()=>rH,_ipv6:()=>au,_ipv4:()=>pu,_intersection:()=>fh,_int64:()=>aH,_int32:()=>mH,_int:()=>fH,_includes:()=>OU,_guid:()=>Q1,_gte:()=>qv,_gt:()=>S4,_float64:()=>hH,_float32:()=>yH,_file:()=>X8,_enum:()=>oh,_endsWith:()=>zU,_encodeAsync:()=>Vu,_encode:()=>Qu,_emoji:()=>yu,_email:()=>Cu,_e164:()=>bw,_discriminatedUnion:()=>lh,_default:()=>sh,_decodeAsync:()=>Lu,_decode:()=>Yu,_date:()=>u8,_custom:()=>W8,_cuid2:()=>cu,_cuid:()=>mu,_coercedString:()=>kH,_coercedNumber:()=>lH,_coercedDate:()=>w8,_coercedBoolean:()=>tH,_coercedBigint:()=>pH,_cidrv6:()=>su,_cidrv4:()=>eu,_check:()=>Xj,_catch:()=>bm,_boolean:()=>oH,_bigint:()=>dH,_base64url:()=>vw,_base64:()=>$w,_array:()=>J8,_any:()=>b8,TimePrecision:()=>RH,NEVER:()=>HG,JSONSchemaGenerator:()=>vz,JSONSchema:()=>Wj,Doc:()=>Su,$output:()=>_H,$input:()=>FH,$constructor:()=>V,$brand:()=>zG,$ZodXor:()=>JO,$ZodXID:()=>E9,$ZodVoid:()=>DO,$ZodUnknown:()=>UO,$ZodUnion:()=>J1,$ZodUndefined:()=>$O,$ZodUUID:()=>N9,$ZodURL:()=>M9,$ZodULID:()=>k9,$ZodType:()=>$$,$ZodTuple:()=>Eu,$ZodTransform:()=>VO,$ZodTemplateLiteral:()=>_O,$ZodSymbol:()=>s9,$ZodSuccess:()=>PO,$ZodStringFormat:()=>P$,$ZodString:()=>Qb,$ZodSet:()=>HO,$ZodRegistry:()=>ZH,$ZodRecord:()=>GO,$ZodRealError:()=>Tv,$ZodReadonly:()=>MO,$ZodPromise:()=>ZO,$ZodPreprocess:()=>SO,$ZodPrefault:()=>BO,$ZodPipe:()=>nu,$ZodOptional:()=>Ru,$ZodObjectJIT:()=>gO,$ZodObject:()=>Ij,$ZodNumberFormat:()=>a9,$ZodNumber:()=>Tu,$ZodNullable:()=>KO,$ZodNull:()=>vO,$ZodNonOptional:()=>AO,$ZodNever:()=>IO,$ZodNanoID:()=>F9,$ZodNaN:()=>NO,$ZodMap:()=>OO,$ZodMAC:()=>f9,$ZodLiteral:()=>QO,$ZodLazy:()=>TO,$ZodKSUID:()=>R9,$ZodJWT:()=>d9,$ZodIntersection:()=>WO,$ZodISOTime:()=>C9,$ZodISODuration:()=>i9,$ZodISODateTime:()=>n9,$ZodISODate:()=>r9,$ZodIPv6:()=>l9,$ZodIPv4:()=>x9,$ZodGUID:()=>j9,$ZodFunction:()=>FO,$ZodFile:()=>YO,$ZodExactOptional:()=>LO,$ZodError:()=>b1,$ZodEnum:()=>zO,$ZodEncodeError:()=>Ob,$ZodEmoji:()=>_9,$ZodEmail:()=>S9,$ZodE164:()=>t9,$ZodDiscriminatedUnion:()=>XO,$ZodDefault:()=>qO,$ZodDate:()=>uO,$ZodCustomStringFormat:()=>p9,$ZodCustom:()=>kO,$ZodCodec:()=>X1,$ZodCheckUpperCase:()=>Q9,$ZodCheckStringFormat:()=>gU,$ZodCheckStartsWith:()=>V9,$ZodCheckSizeEquals:()=>X9,$ZodCheckRegex:()=>H9,$ZodCheckProperty:()=>K9,$ZodCheckOverwrite:()=>B9,$ZodCheckNumberFormat:()=>u9,$ZodCheckMultipleOf:()=>D9,$ZodCheckMinSize:()=>J9,$ZodCheckMinLength:()=>G9,$ZodCheckMimeType:()=>q9,$ZodCheckMaxSize:()=>g9,$ZodCheckMaxLength:()=>W9,$ZodCheckLowerCase:()=>z9,$ZodCheckLessThan:()=>ju,$ZodCheckLengthEquals:()=>O9,$ZodCheckIncludes:()=>Y9,$ZodCheckGreaterThan:()=>Nu,$ZodCheckEndsWith:()=>L9,$ZodCheckBigIntFormat:()=>w9,$ZodCheck:()=>M$,$ZodCatch:()=>jO,$ZodCUID2:()=>T9,$ZodCUID:()=>Z9,$ZodCIDRv6:()=>h9,$ZodCIDRv4:()=>y9,$ZodBoolean:()=>g1,$ZodBigIntFormat:()=>e9,$ZodBigInt:()=>ku,$ZodBase64URL:()=>o9,$ZodBase64:()=>c9,$ZodAsyncError:()=>j4,$ZodArray:()=>wO,$ZodAny:()=>bO});var SP,HG=Object.freeze({status:"aborted"});function V($,v,U){function I(w,g){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1});if(w._zod.traits.has($))return;w._zod.traits.add($),v(w,g);let J=u.prototype,X=Object.keys(J);for(let W=0;W<X.length;W++){let G=X[W];if(!(G in w))w[G]=J[G].bind(w)}}let b=U?.Parent??Object;class D extends b{}Object.defineProperty(D,"name",{value:$});function u(w){var g;let J=U?.Parent?new D:this;I(J,w),(g=J._zod).deferred??(g.deferred=[]);for(let X of J._zod.deferred)X();return J}return Object.defineProperty(u,"init",{value:I}),Object.defineProperty(u,Symbol.hasInstance,{value:(w)=>{if(U?.Parent&&w instanceof U.Parent)return!0;return w?._zod?.traits?.has($)}}),Object.defineProperty(u,"name",{value:$}),u}var zG=Symbol("zod_brand");class j4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ob extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(SP=globalThis).__zod_globalConfig??(SP.__zod_globalConfig={});var Gb=globalThis.__zod_globalConfig;function c$($){if($)Object.assign(Gb,$);return Gb}var R={};e$(R,{unwrapMessage:()=>pI,uint8ArrayToHex:()=>Iy,uint8ArrayToBase64url:()=>by,uint8ArrayToBase64:()=>FP,stringifyPrimitive:()=>Z,slugify:()=>VG,shallowClone:()=>KG,safeExtend:()=>pf,required:()=>sf,randomString:()=>yf,propertyKeyTypes:()=>sI,promiseAllObject:()=>ff,primitiveTypes:()=>qG,prefixIssues:()=>Zv,pick:()=>of,partial:()=>ef,parsedType:()=>k,optionalKeys:()=>BG,omit:()=>tf,objectClone:()=>Cf,numKeys:()=>hf,nullish:()=>q6,normalizeParams:()=>r,mergeDefs:()=>h4,merge:()=>af,jsonStringifyReplacer:()=>vU,joinValues:()=>q,issue:()=>UU,isPlainObject:()=>A6,isObject:()=>Hb,hexToUint8Array:()=>Uy,getSizableOrigin:()=>$1,getParsedType:()=>mf,getLengthableOrigin:()=>v1,getEnumValues:()=>aI,getElementAtPath:()=>lf,floatSafeRemainder:()=>YG,finalizeIssue:()=>Kv,extend:()=>df,explicitlyAborted:()=>jG,escapeRegex:()=>av,esc:()=>Gu,defineLazy:()=>g$,createTransparentProxy:()=>cf,cloneDef:()=>xf,clone:()=>Lv,cleanRegex:()=>eI,cleanEnum:()=>$y,captureStackTrace:()=>Ou,cached:()=>bU,base64urlToUint8Array:()=>vy,base64ToUint8Array:()=>_P,assignProp:()=>B6,assertNotEqual:()=>Ef,assertNever:()=>nf,assertIs:()=>Rf,assertEqual:()=>kf,assert:()=>rf,allowsEval:()=>LG,aborted:()=>P6,NUMBER_FORMAT_RANGES:()=>AG,Class:()=>ZP,BIGINT_FORMAT_RANGES:()=>PG});function kf($){return $}function Ef($){return $}function Rf($){}function nf($){throw Error("Unexpected value in exhaustive check")}function rf($){}function aI($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,b])=>v.indexOf(+I)===-1).map(([I,b])=>b)}function q($,v="|"){return $.map((U)=>Z(U)).join(v)}function vU($,v){if(typeof v==="bigint")return v.toString();return v}function bU($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function q6($){return $===null||$===void 0}function eI($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function YG($,v){let U=$/v,I=Math.round(U),b=Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<b)return 0;return U-I}var MP=Symbol("evaluating");function g$($,v,U){let I=void 0;Object.defineProperty($,v,{get(){if(I===MP)return;if(I===void 0)I=MP,I=U();return I},set(b){Object.defineProperty($,v,{value:b})},configurable:!0})}function Cf($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function B6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function h4(...$){let v={};for(let U of $){let I=Object.getOwnPropertyDescriptors(U);Object.assign(v,I)}return Object.defineProperties({},v)}function xf($){return h4($._zod.def)}function lf($,v){if(!v)return $;return v.reduce((U,I)=>U?.[I],$)}function ff($){let v=Object.keys($),U=v.map((I)=>$[I]);return Promise.all(U).then((I)=>{let b={};for(let D=0;D<v.length;D++)b[v[D]]=I[D];return b})}function yf($=10){let U="";for(let I=0;I<$;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Gu($){return JSON.stringify($)}function VG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ou="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function Hb($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var LG=bU(()=>{if(Gb.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function A6($){if(Hb($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(Hb(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function KG($){if(A6($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function hf($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var mf=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},sI=new Set(["string","number","symbol"]),qG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function av($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lv($,v,U){let I=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)I._zod.parent=$;return I}function r($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function cf($){let v;return new Proxy({},{get(U,I,b){return v??(v=$()),Reflect.get(v,I,b)},set(U,I,b,D){return v??(v=$()),Reflect.set(v,I,b,D)},has(U,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(U,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(U,I,b){return v??(v=$()),Reflect.defineProperty(v,I,b)}})}function Z($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function BG($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var AG={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},PG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function of($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let D=h4($._zod.def,{get shape(){let u={};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;u[w]=U.shape[w]}return B6(this,"shape",u),u},checks:[]});return Lv($,D)}function tf($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let D=h4($._zod.def,{get shape(){let u={...$._zod.def.shape};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;delete u[w]}return B6(this,"shape",u),u},checks:[]});return Lv($,D)}function df($,v){if(!A6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let D=$._zod.def.shape;for(let u in v)if(Object.getOwnPropertyDescriptor(D,u)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let b=h4($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return B6(this,"shape",D),D}});return Lv($,b)}function pf($,v){if(!A6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=h4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return B6(this,"shape",I),I}});return Lv($,U)}function af($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U=h4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return B6(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return Lv($,U)}function ef($,v,U){let b=v._zod.def.checks;if(b&&b.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let u=h4(v._zod.def,{get shape(){let w=v._zod.def.shape,g={...w};if(U)for(let J in U){if(!(J in w))throw Error(`Unrecognized key: "${J}"`);if(!U[J])continue;g[J]=$?new $({type:"optional",innerType:w[J]}):w[J]}else for(let J in w)g[J]=$?new $({type:"optional",innerType:w[J]}):w[J];return B6(this,"shape",g),g},checks:[]});return Lv(v,u)}function sf($,v,U){let I=h4(v._zod.def,{get shape(){let b=v._zod.def.shape,D={...b};if(U)for(let u in U){if(!(u in D))throw Error(`Unrecognized key: "${u}"`);if(!U[u])continue;D[u]=new $({type:"nonoptional",innerType:b[u]})}else for(let u in b)D[u]=new $({type:"nonoptional",innerType:b[u]});return B6(this,"shape",D),D}});return Lv(v,I)}function P6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function jG($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue===!1)return!0;return!1}function Zv($,v){return v.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift($),U})}function pI($){return typeof $==="string"?$:$?.message}function Kv($,v,U){let I=$.message?$.message:pI($.inst?._zod.def?.error?.($))??pI(v?.error?.($))??pI(U.customError?.($))??pI(U.localeError?.($))??"Invalid input",{inst:b,continue:D,input:u,...w}=$;if(w.path??(w.path=[]),w.message=I,v?.reportInput)w.input=u;return w}function $1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function v1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function k($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function UU(...$){let[v,U,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:I};return{...v}}function $y($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function _P($){let v=atob($),U=new Uint8Array(v.length);for(let I=0;I<v.length;I++)U[I]=v.charCodeAt(I);return U}function FP($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function vy($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return _P(v+U)}function by($){return FP($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Uy($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)U[I/2]=Number.parseInt(v.slice(I,I+2),16);return U}function Iy($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class ZP{constructor(...$){}}var TP=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,vU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},b1=V("$ZodError",TP),Tv=V("$ZodError",TP,{Parent:Error});function U1($,v=(U)=>U.message){let U={},I=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(v(b));else I.push(v(b));return{formErrors:I,fieldErrors:U}}function I1($,v=(U)=>U.message){let U={_errors:[]},I=(b,D=[])=>{for(let u of b.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((w)=>I({issues:w},[...D,...u.path]));else if(u.code==="invalid_key")I({issues:u.issues},[...D,...u.path]);else if(u.code==="invalid_element")I({issues:u.issues},[...D,...u.path]);else{let w=[...D,...u.path];if(w.length===0)U._errors.push(v(u));else{let g=U,J=0;while(J<w.length){let X=w[J];if(J!==w.length-1)g[X]=g[X]||{_errors:[]};else g[X]=g[X]||{_errors:[]},g[X]._errors.push(v(u));g=g[X],J++}}}};return I($),U}function NG($,v=(U)=>U.message){let U={errors:[]},I=(b,D=[])=>{var u,w;for(let g of b.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((J)=>I({issues:J},[...D,...g.path]));else if(g.code==="invalid_key")I({issues:g.issues},[...D,...g.path]);else if(g.code==="invalid_element")I({issues:g.issues},[...D,...g.path]);else{let J=[...D,...g.path];if(J.length===0){U.errors.push(v(g));continue}let X=U,W=0;while(W<J.length){let G=J[W],O=W===J.length-1;if(typeof G==="string")X.properties??(X.properties={}),(u=X.properties)[G]??(u[G]={errors:[]}),X=X.properties[G];else X.items??(X.items=[]),(w=X.items)[G]??(w[G]={errors:[]}),X=X.items[G];if(O)X.errors.push(v(g));W++}}};return I($),U}function kP($){let v=[],U=$.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")v.push(`[${I}]`);else if(typeof I==="symbol")v.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))v.push(`[${JSON.stringify(I)}]`);else{if(v.length)v.push(".");v.push(I)}return v.join("")}function SG($){let v=[],U=[...$.issues].sort((I,b)=>(I.path??[]).length-(b.path??[]).length);for(let I of U)if(v.push(`\u2716 ${I.message}`),I.path?.length)v.push(` \u2192 at ${kP(I.path)}`);return v.join(`
148
+ `,v)+1}return{type:$,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue($){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let v=oW($),U=cI(v);return U.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let v=oW($),U=cI(v);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:U,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment($,v){if(this.type!=="comment")return!1;if(this.indent<=v)return!1;return $.every((U)=>U.type==="newline"||U.type==="space")}*documentEnd($){if(this.type!=="doc-mode"){if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd($){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if($.end)$.end.push(this.sourceToken);else $.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}$G$.Parser=li});var ci=P((JG$)=>{var fi=IA(),bG$=yD(),dD=hD(),UG$=HB(),IG$=V$(),DG$=HA(),yi=zA();function hi($){let v=$.prettyErrors!==!1;return{lineCounter:$.lineCounter||v&&new DG$.LineCounter||null,prettyErrors:v}}function uG$($,v={}){let{lineCounter:U,prettyErrors:I}=hi(v),b=new yi.Parser(U?.addNewLine),D=new fi.Composer(v),u=Array.from(D.compose(b.parse($)));if(I&&U)for(let w of u)w.errors.forEach(dD.prettifyError($,U)),w.warnings.forEach(dD.prettifyError($,U));if(u.length>0)return u;return Object.assign([],{empty:!0},D.streamInfo())}function mi($,v={}){let{lineCounter:U,prettyErrors:I}=hi(v),b=new yi.Parser(U?.addNewLine),D=new fi.Composer(v),u=null;for(let w of D.compose(b.parse($),!0,$.length))if(!u)u=w;else if(u.options.logLevel!=="silent"){u.errors.push(new dD.YAMLParseError(w.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(I&&U)u.errors.forEach(dD.prettifyError($,U)),u.warnings.forEach(dD.prettifyError($,U));return u}function wG$($,v,U){let I=void 0;if(typeof v==="function")I=v;else if(U===void 0&&v&&typeof v==="object")U=v;let b=mi($,U);if(!b)return null;if(b.warnings.forEach((D)=>UG$.warn(b.options.logLevel,D)),b.errors.length>0)if(b.options.logLevel!=="silent")throw b.errors[0];else b.errors=[];return b.toJS(Object.assign({reviver:I},U))}function gG$($,v,U){let I=null;if(typeof v==="function"||Array.isArray(v))I=v;else if(U===void 0&&v)U=v;if(typeof U==="string")U=U.length;if(typeof U==="number"){let b=Math.round(U);U=b<1?void 0:b>8?{indent:8}:{indent:b}}if($===void 0){let{keepUndefined:b}=U??v??{};if(!b)return}if(IG$.isDocument($)&&!I)return $.toString(U);return new bG$.Document($,I,U).toString(U)}JG$.parse=wG$;JG$.parseAllDocuments=uG$;JG$.parseDocument=mi;JG$.stringify=gG$});import{homedir as vz$}from"os";var NP={name:"@interactive-inc/claude-funnel",version:"0.66.0",description:"Hub CLI that routes external events (Slack / GitHub / Discord) to Claude Code agents through subscription channels over MCP.",keywords:["bun","claude","claude-code","cli","discord","github","mcp","slack"],homepage:"https://github.com/interactive-inc/open-claude-funnel#readme",bugs:{url:"https://github.com/interactive-inc/open-claude-funnel/issues"},license:"MIT",author:"Interactive Inc.",repository:{type:"git",url:"git+https://github.com/interactive-inc/open-claude-funnel.git"},bin:{fnl:"./dist/bin.js",funnel:"./dist/bin.js"},files:["dist/**/*","funnel.schema.json","README.md","LICENSE"],type:"module",main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.js"},"./claude":{types:"./dist/claude.d.ts",import:"./dist/claude.js",default:"./dist/claude.js"},"./gateway":{types:"./dist/gateway.d.ts",import:"./dist/gateway.js",default:"./dist/gateway.js"},"./profiles":{types:"./dist/profiles.d.ts",import:"./dist/profiles.js",default:"./dist/profiles.js"},"./local-config":{types:"./dist/local-config.d.ts",import:"./dist/local-config.js",default:"./dist/local-config.js"},"./diagnostics":{types:"./dist/diagnostics.d.ts",import:"./dist/diagnostics.js",default:"./dist/diagnostics.js"},"./recovery":{types:"./dist/recovery.d.ts",import:"./dist/recovery.js",default:"./dist/recovery.js"},"./doctor":{types:"./dist/doctor.d.ts",import:"./dist/doctor.js",default:"./dist/doctor.js"},"./docs":{types:"./dist/docs.d.ts",import:"./dist/docs.js",default:"./dist/docs.js"},"./connectors/slack":{types:"./dist/connectors/slack.d.ts",import:"./dist/connectors/slack.js",default:"./dist/connectors/slack.js"},"./connectors/discord":{types:"./dist/connectors/discord.d.ts",import:"./dist/connectors/discord.js",default:"./dist/connectors/discord.js"},"./connectors/gh":{types:"./dist/connectors/gh.d.ts",import:"./dist/connectors/gh.js",default:"./dist/connectors/gh.js"},"./connectors/schedule":{types:"./dist/connectors/schedule.d.ts",import:"./dist/connectors/schedule.js",default:"./dist/connectors/schedule.js"},"./logger":{types:"./dist/logger.d.ts",import:"./dist/logger.js",default:"./dist/logger.js"},"./channel":{types:"./dist/channel.d.ts",import:"./dist/channel.js",default:"./dist/channel.js"},"./bin":"./dist/bin.js","./package.json":"./package.json"},publishConfig:{access:"public"},scripts:{prepack:"make build"},dependencies:{"@hono/zod-validator":"0.8.0","@interactive-inc/flume":"^0.10.0","@modelcontextprotocol/sdk":"^1.29.0",hono:"^4.12.19",yaml:"^2.9.0",zod:"^4.4.3"},devDependencies:{"@types/bun":"^1.3.14","@typescript/native-preview":"^7.0.0-dev.20260516.1","vite-plus":"^0.1.21",vitest:"^4.1.8"},engines:{bun:">=1.3.0"}};var e=class extends Error{res;status;constructor($=500,v){super(v?.message,{cause:v?.cause});this.res=v?.res,this.status=$}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var H={};e$(H,{xor:()=>IN,xid:()=>Sj,void:()=>ej,uuidv7:()=>Lj,uuidv6:()=>Vj,uuidv4:()=>Yj,uuid:()=>Qj,util:()=>R,url:()=>Kj,uppercase:()=>GU,unknown:()=>Kb,union:()=>iw,undefined:()=>pj,ulid:()=>Nj,uint64:()=>tj,uint32:()=>mj,tuple:()=>Rz,trim:()=>VU,treeifyError:()=>NG,transform:()=>lw,toUpperCase:()=>KU,toLowerCase:()=>LU,toJSONSchema:()=>Gw,templateLiteral:()=>VN,symbol:()=>dj,superRefine:()=>JQ,success:()=>HN,stringbool:()=>NN,stringFormat:()=>Cj,string:()=>L1,strictObject:()=>bN,startsWith:()=>HU,slugify:()=>qU,size:()=>Yb,setErrorMap:()=>Om,set:()=>JN,safeParseAsync:()=>Jz,safeParse:()=>gz,safeEncodeAsync:()=>Qz,safeEncode:()=>Hz,safeDecodeAsync:()=>Yz,safeDecode:()=>zz,registry:()=>ru,regexes:()=>yv,regex:()=>XU,refine:()=>gQ,record:()=>nz,readonly:()=>bQ,property:()=>gw,promise:()=>LN,prettifyError:()=>SG,preprocess:()=>MN,prefault:()=>tz,positive:()=>Iw,pipe:()=>Lw,partialRecord:()=>uN,parseAsync:()=>wz,parse:()=>uz,overwrite:()=>w4,optional:()=>q1,object:()=>vN,number:()=>Lz,nullish:()=>ON,nullable:()=>B1,null:()=>Pz,normalize:()=>YU,nonpositive:()=>uw,nonoptional:()=>dz,nonnegative:()=>ww,never:()=>Cw,negative:()=>Dw,nativeEnum:()=>XN,nanoid:()=>Aj,nan:()=>zN,multipleOf:()=>j6,minSize:()=>M4,minLength:()=>m4,mime:()=>QU,meta:()=>PN,maxSize:()=>N6,maxLength:()=>Vb,map:()=>gN,mac:()=>Fj,lte:()=>hv,lt:()=>N4,lowercase:()=>WU,looseRecord:()=>wN,looseObject:()=>UN,locales:()=>z1,literal:()=>WN,length:()=>Lb,lazy:()=>DQ,ksuid:()=>Mj,keyof:()=>$N,jwt:()=>rj,json:()=>SN,iso:()=>PU,ipv6:()=>Zj,ipv4:()=>_j,invertCodec:()=>YN,intersection:()=>kz,int64:()=>oj,int32:()=>hj,int:()=>Vw,instanceof:()=>jN,includes:()=>OU,httpUrl:()=>qj,hostname:()=>ij,hex:()=>xj,hash:()=>lj,guid:()=>zj,gte:()=>qv,gt:()=>S4,globalRegistry:()=>Dv,getErrorMap:()=>Hm,function:()=>KN,fromJSONSchema:()=>FN,formatError:()=>I1,float64:()=>yj,float32:()=>fj,flattenError:()=>U1,file:()=>GN,exactOptional:()=>yz,enum:()=>xw,endsWith:()=>zU,encodeAsync:()=>Gz,encode:()=>Xz,emoji:()=>Bj,email:()=>Hj,e164:()=>nj,discriminatedUnion:()=>DN,describe:()=>AN,decodeAsync:()=>Oz,decode:()=>Wz,date:()=>sj,custom:()=>BN,cuid2:()=>jj,cuid:()=>Pj,core:()=>c4,config:()=>c$,coerce:()=>WQ,codec:()=>QN,clone:()=>Lv,cidrv6:()=>kj,cidrv4:()=>Tj,check:()=>qN,catch:()=>ez,boolean:()=>Kz,bigint:()=>cj,base64url:()=>Rj,base64:()=>Ej,array:()=>N1,any:()=>aj,_function:()=>KN,_default:()=>cz,_ZodString:()=>Kw,ZodXor:()=>Fz,ZodXID:()=>Sw,ZodVoid:()=>Mz,ZodUnknown:()=>Nz,ZodUnion:()=>M1,ZodUndefined:()=>Bz,ZodUUID:()=>_4,ZodURL:()=>P1,ZodULID:()=>Nw,ZodType:()=>U$,ZodTuple:()=>Ez,ZodTransform:()=>lz,ZodTemplateLiteral:()=>UQ,ZodSymbol:()=>qz,ZodSuccess:()=>pz,ZodStringFormat:()=>j$,ZodString:()=>SU,ZodSet:()=>Cz,ZodRecord:()=>jU,ZodRealError:()=>kv,ZodReadonly:()=>vQ,ZodPromise:()=>uQ,ZodPreprocess:()=>$Q,ZodPrefault:()=>oz,ZodPipe:()=>_1,ZodOptional:()=>fw,ZodObject:()=>S1,ZodNumberFormat:()=>qb,ZodNumber:()=>_U,ZodNullable:()=>hz,ZodNull:()=>Az,ZodNonOptional:()=>yw,ZodNever:()=>Sz,ZodNanoID:()=>Aw,ZodNaN:()=>sz,ZodMap:()=>rz,ZodMAC:()=>Vz,ZodLiteral:()=>iz,ZodLazy:()=>IQ,ZodKSUID:()=>Mw,ZodJWT:()=>nw,ZodIssueCode:()=>Gm,ZodIntersection:()=>Tz,ZodISOTime:()=>Qw,ZodISODuration:()=>Yw,ZodISODateTime:()=>Hw,ZodISODate:()=>zw,ZodIPv6:()=>Fw,ZodIPv4:()=>_w,ZodGUID:()=>K1,ZodFunction:()=>wQ,ZodFirstPartyTypeKind:()=>XQ,ZodFile:()=>xz,ZodExactOptional:()=>fz,ZodError:()=>Xm,ZodEnum:()=>NU,ZodEmoji:()=>Bw,ZodEmail:()=>qw,ZodE164:()=>Rw,ZodDiscriminatedUnion:()=>Zz,ZodDefault:()=>mz,ZodDate:()=>j1,ZodCustomStringFormat:()=>MU,ZodCustom:()=>Z1,ZodCodec:()=>F1,ZodCatch:()=>az,ZodCUID2:()=>jw,ZodCUID:()=>Pw,ZodCIDRv6:()=>Tw,ZodCIDRv4:()=>Zw,ZodBoolean:()=>FU,ZodBigIntFormat:()=>rw,ZodBigInt:()=>ZU,ZodBase64URL:()=>Ew,ZodBase64:()=>kw,ZodArray:()=>_z,ZodAny:()=>jz,TimePrecision:()=>RH,NEVER:()=>HG,$output:()=>_H,$input:()=>FH,$brand:()=>zG});var c4={};e$(c4,{version:()=>A9,util:()=>R,treeifyError:()=>NG,toJSONSchema:()=>Gw,toDotPath:()=>kP,safeParseAsync:()=>_G,safeParse:()=>MG,safeEncodeAsync:()=>Gy,safeEncode:()=>Xy,safeDecodeAsync:()=>Oy,safeDecode:()=>Wy,registry:()=>ru,regexes:()=>yv,process:()=>q$,prettifyError:()=>SG,parseAsync:()=>zu,parse:()=>Hu,meta:()=>z8,locales:()=>z1,isValidJWT:()=>vj,isValidBase64URL:()=>$j,isValidBase64:()=>m9,initializeContext:()=>S6,globalRegistry:()=>Dv,globalConfig:()=>Gb,formatError:()=>I1,flattenError:()=>U1,finalize:()=>_6,extractDefs:()=>M6,encodeAsync:()=>gy,encode:()=>uy,describe:()=>H8,decodeAsync:()=>Jy,decode:()=>wy,createToJSONSchemaMethod:()=>Y8,createStandardJSONSchemaMethod:()=>AU,config:()=>c$,clone:()=>Lv,_xor:()=>xh,_xid:()=>tu,_void:()=>D8,_uuidv7:()=>fu,_uuidv6:()=>lu,_uuidv4:()=>xu,_uuid:()=>iu,_url:()=>Y1,_uppercase:()=>GU,_unknown:()=>U8,_union:()=>ih,_undefined:()=>$8,_ulid:()=>ou,_uint64:()=>eH,_uint32:()=>cH,_tuple:()=>yh,_trim:()=>VU,_transform:()=>ph,_toUpperCase:()=>KU,_toLowerCase:()=>LU,_templateLiteral:()=>Dm,_symbol:()=>sH,_superRefine:()=>O8,_success:()=>vm,_stringbool:()=>Q8,_stringFormat:()=>BU,_string:()=>TH,_startsWith:()=>HU,_slugify:()=>qU,_size:()=>Yb,_set:()=>ch,_safeParseAsync:()=>wU,_safeParse:()=>uU,_safeEncodeAsync:()=>Bu,_safeEncode:()=>Ku,_safeDecodeAsync:()=>Au,_safeDecode:()=>qu,_regex:()=>XU,_refine:()=>G8,_record:()=>hh,_readonly:()=>Im,_property:()=>gw,_promise:()=>wm,_positive:()=>Iw,_pipe:()=>Um,_parseAsync:()=>DU,_parse:()=>IU,_overwrite:()=>w4,_optional:()=>ah,_number:()=>xH,_nullable:()=>eh,_null:()=>v8,_normalize:()=>YU,_nonpositive:()=>uw,_nonoptional:()=>$m,_nonnegative:()=>ww,_never:()=>I8,_negative:()=>Dw,_nativeEnum:()=>th,_nanoid:()=>hu,_nan:()=>g8,_multipleOf:()=>j6,_minSize:()=>M4,_minLength:()=>m4,_min:()=>qv,_mime:()=>QU,_maxSize:()=>N6,_maxLength:()=>Vb,_max:()=>hv,_map:()=>mh,_mac:()=>EH,_lte:()=>hv,_lt:()=>N4,_lowercase:()=>WU,_literal:()=>dh,_length:()=>Lb,_lazy:()=>um,_ksuid:()=>du,_jwt:()=>Uw,_isoTime:()=>CH,_isoDuration:()=>iH,_isoDateTime:()=>nH,_isoDate:()=>rH,_ipv6:()=>au,_ipv4:()=>pu,_intersection:()=>fh,_int64:()=>aH,_int32:()=>mH,_int:()=>fH,_includes:()=>OU,_guid:()=>Q1,_gte:()=>qv,_gt:()=>S4,_float64:()=>hH,_float32:()=>yH,_file:()=>X8,_enum:()=>oh,_endsWith:()=>zU,_encodeAsync:()=>Vu,_encode:()=>Qu,_emoji:()=>yu,_email:()=>Cu,_e164:()=>bw,_discriminatedUnion:()=>lh,_default:()=>sh,_decodeAsync:()=>Lu,_decode:()=>Yu,_date:()=>u8,_custom:()=>W8,_cuid2:()=>cu,_cuid:()=>mu,_coercedString:()=>kH,_coercedNumber:()=>lH,_coercedDate:()=>w8,_coercedBoolean:()=>tH,_coercedBigint:()=>pH,_cidrv6:()=>su,_cidrv4:()=>eu,_check:()=>Xj,_catch:()=>bm,_boolean:()=>oH,_bigint:()=>dH,_base64url:()=>vw,_base64:()=>$w,_array:()=>J8,_any:()=>b8,TimePrecision:()=>RH,NEVER:()=>HG,JSONSchemaGenerator:()=>vz,JSONSchema:()=>Wj,Doc:()=>Su,$output:()=>_H,$input:()=>FH,$constructor:()=>V,$brand:()=>zG,$ZodXor:()=>JO,$ZodXID:()=>E9,$ZodVoid:()=>DO,$ZodUnknown:()=>UO,$ZodUnion:()=>J1,$ZodUndefined:()=>$O,$ZodUUID:()=>N9,$ZodURL:()=>M9,$ZodULID:()=>k9,$ZodType:()=>$$,$ZodTuple:()=>Eu,$ZodTransform:()=>VO,$ZodTemplateLiteral:()=>_O,$ZodSymbol:()=>s9,$ZodSuccess:()=>PO,$ZodStringFormat:()=>P$,$ZodString:()=>Qb,$ZodSet:()=>HO,$ZodRegistry:()=>ZH,$ZodRecord:()=>GO,$ZodRealError:()=>Tv,$ZodReadonly:()=>MO,$ZodPromise:()=>ZO,$ZodPreprocess:()=>SO,$ZodPrefault:()=>BO,$ZodPipe:()=>nu,$ZodOptional:()=>Ru,$ZodObjectJIT:()=>gO,$ZodObject:()=>Ij,$ZodNumberFormat:()=>a9,$ZodNumber:()=>Tu,$ZodNullable:()=>KO,$ZodNull:()=>vO,$ZodNonOptional:()=>AO,$ZodNever:()=>IO,$ZodNanoID:()=>F9,$ZodNaN:()=>NO,$ZodMap:()=>OO,$ZodMAC:()=>f9,$ZodLiteral:()=>QO,$ZodLazy:()=>TO,$ZodKSUID:()=>R9,$ZodJWT:()=>d9,$ZodIntersection:()=>WO,$ZodISOTime:()=>C9,$ZodISODuration:()=>i9,$ZodISODateTime:()=>n9,$ZodISODate:()=>r9,$ZodIPv6:()=>l9,$ZodIPv4:()=>x9,$ZodGUID:()=>j9,$ZodFunction:()=>FO,$ZodFile:()=>YO,$ZodExactOptional:()=>LO,$ZodError:()=>b1,$ZodEnum:()=>zO,$ZodEncodeError:()=>Ob,$ZodEmoji:()=>_9,$ZodEmail:()=>S9,$ZodE164:()=>t9,$ZodDiscriminatedUnion:()=>XO,$ZodDefault:()=>qO,$ZodDate:()=>uO,$ZodCustomStringFormat:()=>p9,$ZodCustom:()=>kO,$ZodCodec:()=>X1,$ZodCheckUpperCase:()=>Q9,$ZodCheckStringFormat:()=>gU,$ZodCheckStartsWith:()=>V9,$ZodCheckSizeEquals:()=>X9,$ZodCheckRegex:()=>H9,$ZodCheckProperty:()=>K9,$ZodCheckOverwrite:()=>B9,$ZodCheckNumberFormat:()=>u9,$ZodCheckMultipleOf:()=>D9,$ZodCheckMinSize:()=>J9,$ZodCheckMinLength:()=>G9,$ZodCheckMimeType:()=>q9,$ZodCheckMaxSize:()=>g9,$ZodCheckMaxLength:()=>W9,$ZodCheckLowerCase:()=>z9,$ZodCheckLessThan:()=>ju,$ZodCheckLengthEquals:()=>O9,$ZodCheckIncludes:()=>Y9,$ZodCheckGreaterThan:()=>Nu,$ZodCheckEndsWith:()=>L9,$ZodCheckBigIntFormat:()=>w9,$ZodCheck:()=>M$,$ZodCatch:()=>jO,$ZodCUID2:()=>T9,$ZodCUID:()=>Z9,$ZodCIDRv6:()=>h9,$ZodCIDRv4:()=>y9,$ZodBoolean:()=>g1,$ZodBigIntFormat:()=>e9,$ZodBigInt:()=>ku,$ZodBase64URL:()=>o9,$ZodBase64:()=>c9,$ZodAsyncError:()=>j4,$ZodArray:()=>wO,$ZodAny:()=>bO});var SP,HG=Object.freeze({status:"aborted"});function V($,v,U){function I(w,g){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1});if(w._zod.traits.has($))return;w._zod.traits.add($),v(w,g);let J=u.prototype,X=Object.keys(J);for(let W=0;W<X.length;W++){let G=X[W];if(!(G in w))w[G]=J[G].bind(w)}}let b=U?.Parent??Object;class D extends b{}Object.defineProperty(D,"name",{value:$});function u(w){var g;let J=U?.Parent?new D:this;I(J,w),(g=J._zod).deferred??(g.deferred=[]);for(let X of J._zod.deferred)X();return J}return Object.defineProperty(u,"init",{value:I}),Object.defineProperty(u,Symbol.hasInstance,{value:(w)=>{if(U?.Parent&&w instanceof U.Parent)return!0;return w?._zod?.traits?.has($)}}),Object.defineProperty(u,"name",{value:$}),u}var zG=Symbol("zod_brand");class j4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ob extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(SP=globalThis).__zod_globalConfig??(SP.__zod_globalConfig={});var Gb=globalThis.__zod_globalConfig;function c$($){if($)Object.assign(Gb,$);return Gb}var R={};e$(R,{unwrapMessage:()=>pI,uint8ArrayToHex:()=>Iy,uint8ArrayToBase64url:()=>by,uint8ArrayToBase64:()=>FP,stringifyPrimitive:()=>Z,slugify:()=>VG,shallowClone:()=>KG,safeExtend:()=>pf,required:()=>sf,randomString:()=>yf,propertyKeyTypes:()=>sI,promiseAllObject:()=>ff,primitiveTypes:()=>qG,prefixIssues:()=>Zv,pick:()=>of,partial:()=>ef,parsedType:()=>k,optionalKeys:()=>BG,omit:()=>tf,objectClone:()=>Cf,numKeys:()=>hf,nullish:()=>q6,normalizeParams:()=>r,mergeDefs:()=>h4,merge:()=>af,jsonStringifyReplacer:()=>vU,joinValues:()=>q,issue:()=>UU,isPlainObject:()=>A6,isObject:()=>Hb,hexToUint8Array:()=>Uy,getSizableOrigin:()=>$1,getParsedType:()=>mf,getLengthableOrigin:()=>v1,getEnumValues:()=>aI,getElementAtPath:()=>lf,floatSafeRemainder:()=>YG,finalizeIssue:()=>Kv,extend:()=>df,explicitlyAborted:()=>jG,escapeRegex:()=>av,esc:()=>Gu,defineLazy:()=>g$,createTransparentProxy:()=>cf,cloneDef:()=>xf,clone:()=>Lv,cleanRegex:()=>eI,cleanEnum:()=>$y,captureStackTrace:()=>Ou,cached:()=>bU,base64urlToUint8Array:()=>vy,base64ToUint8Array:()=>_P,assignProp:()=>B6,assertNotEqual:()=>Ef,assertNever:()=>nf,assertIs:()=>Rf,assertEqual:()=>kf,assert:()=>rf,allowsEval:()=>LG,aborted:()=>P6,NUMBER_FORMAT_RANGES:()=>AG,Class:()=>ZP,BIGINT_FORMAT_RANGES:()=>PG});function kf($){return $}function Ef($){return $}function Rf($){}function nf($){throw Error("Unexpected value in exhaustive check")}function rf($){}function aI($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,b])=>v.indexOf(+I)===-1).map(([I,b])=>b)}function q($,v="|"){return $.map((U)=>Z(U)).join(v)}function vU($,v){if(typeof v==="bigint")return v.toString();return v}function bU($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function q6($){return $===null||$===void 0}function eI($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function YG($,v){let U=$/v,I=Math.round(U),b=Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<b)return 0;return U-I}var MP=Symbol("evaluating");function g$($,v,U){let I=void 0;Object.defineProperty($,v,{get(){if(I===MP)return;if(I===void 0)I=MP,I=U();return I},set(b){Object.defineProperty($,v,{value:b})},configurable:!0})}function Cf($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function B6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function h4(...$){let v={};for(let U of $){let I=Object.getOwnPropertyDescriptors(U);Object.assign(v,I)}return Object.defineProperties({},v)}function xf($){return h4($._zod.def)}function lf($,v){if(!v)return $;return v.reduce((U,I)=>U?.[I],$)}function ff($){let v=Object.keys($),U=v.map((I)=>$[I]);return Promise.all(U).then((I)=>{let b={};for(let D=0;D<v.length;D++)b[v[D]]=I[D];return b})}function yf($=10){let U="";for(let I=0;I<$;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Gu($){return JSON.stringify($)}function VG($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ou="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function Hb($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var LG=bU(()=>{if(Gb.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function A6($){if(Hb($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(Hb(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function KG($){if(A6($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function hf($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var mf=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},sI=new Set(["string","number","symbol"]),qG=new Set(["string","number","bigint","boolean","symbol","undefined"]);function av($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lv($,v,U){let I=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)I._zod.parent=$;return I}function r($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function cf($){let v;return new Proxy({},{get(U,I,b){return v??(v=$()),Reflect.get(v,I,b)},set(U,I,b,D){return v??(v=$()),Reflect.set(v,I,b,D)},has(U,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(U,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(U,I,b){return v??(v=$()),Reflect.defineProperty(v,I,b)}})}function Z($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function BG($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var AG={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},PG={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function of($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let D=h4($._zod.def,{get shape(){let u={};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;u[w]=U.shape[w]}return B6(this,"shape",u),u},checks:[]});return Lv($,D)}function tf($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let D=h4($._zod.def,{get shape(){let u={...$._zod.def.shape};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;delete u[w]}return B6(this,"shape",u),u},checks:[]});return Lv($,D)}function df($,v){if(!A6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let D=$._zod.def.shape;for(let u in v)if(Object.getOwnPropertyDescriptor(D,u)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let b=h4($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return B6(this,"shape",D),D}});return Lv($,b)}function pf($,v){if(!A6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=h4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return B6(this,"shape",I),I}});return Lv($,U)}function af($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U=h4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return B6(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return Lv($,U)}function ef($,v,U){let b=v._zod.def.checks;if(b&&b.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let u=h4(v._zod.def,{get shape(){let w=v._zod.def.shape,g={...w};if(U)for(let J in U){if(!(J in w))throw Error(`Unrecognized key: "${J}"`);if(!U[J])continue;g[J]=$?new $({type:"optional",innerType:w[J]}):w[J]}else for(let J in w)g[J]=$?new $({type:"optional",innerType:w[J]}):w[J];return B6(this,"shape",g),g},checks:[]});return Lv(v,u)}function sf($,v,U){let I=h4(v._zod.def,{get shape(){let b=v._zod.def.shape,D={...b};if(U)for(let u in U){if(!(u in D))throw Error(`Unrecognized key: "${u}"`);if(!U[u])continue;D[u]=new $({type:"nonoptional",innerType:b[u]})}else for(let u in b)D[u]=new $({type:"nonoptional",innerType:b[u]});return B6(this,"shape",D),D}});return Lv(v,I)}function P6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function jG($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue===!1)return!0;return!1}function Zv($,v){return v.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift($),U})}function pI($){return typeof $==="string"?$:$?.message}function Kv($,v,U){let I=$.message?$.message:pI($.inst?._zod.def?.error?.($))??pI(v?.error?.($))??pI(U.customError?.($))??pI(U.localeError?.($))??"Invalid input",{inst:b,continue:D,input:u,...w}=$;if(w.path??(w.path=[]),w.message=I,v?.reportInput)w.input=u;return w}function $1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function v1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function k($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function UU(...$){let[v,U,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:I};return{...v}}function $y($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function _P($){let v=atob($),U=new Uint8Array(v.length);for(let I=0;I<v.length;I++)U[I]=v.charCodeAt(I);return U}function FP($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function vy($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return _P(v+U)}function by($){return FP($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Uy($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)U[I/2]=Number.parseInt(v.slice(I,I+2),16);return U}function Iy($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class ZP{constructor(...$){}}var TP=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,vU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},b1=V("$ZodError",TP),Tv=V("$ZodError",TP,{Parent:Error});function U1($,v=(U)=>U.message){let U={},I=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(v(b));else I.push(v(b));return{formErrors:I,fieldErrors:U}}function I1($,v=(U)=>U.message){let U={_errors:[]},I=(b,D=[])=>{for(let u of b.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((w)=>I({issues:w},[...D,...u.path]));else if(u.code==="invalid_key")I({issues:u.issues},[...D,...u.path]);else if(u.code==="invalid_element")I({issues:u.issues},[...D,...u.path]);else{let w=[...D,...u.path];if(w.length===0)U._errors.push(v(u));else{let g=U,J=0;while(J<w.length){let X=w[J];if(J!==w.length-1)g[X]=g[X]||{_errors:[]};else g[X]=g[X]||{_errors:[]},g[X]._errors.push(v(u));g=g[X],J++}}}};return I($),U}function NG($,v=(U)=>U.message){let U={errors:[]},I=(b,D=[])=>{var u,w;for(let g of b.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((J)=>I({issues:J},[...D,...g.path]));else if(g.code==="invalid_key")I({issues:g.issues},[...D,...g.path]);else if(g.code==="invalid_element")I({issues:g.issues},[...D,...g.path]);else{let J=[...D,...g.path];if(J.length===0){U.errors.push(v(g));continue}let X=U,W=0;while(W<J.length){let G=J[W],O=W===J.length-1;if(typeof G==="string")X.properties??(X.properties={}),(u=X.properties)[G]??(u[G]={errors:[]}),X=X.properties[G];else X.items??(X.items=[]),(w=X.items)[G]??(w[G]={errors:[]}),X=X.items[G];if(O)X.errors.push(v(g));W++}}};return I($),U}function kP($){let v=[],U=$.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")v.push(`[${I}]`);else if(typeof I==="symbol")v.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))v.push(`[${JSON.stringify(I)}]`);else{if(v.length)v.push(".");v.push(I)}return v.join("")}function SG($){let v=[],U=[...$.issues].sort((I,b)=>(I.path??[]).length-(b.path??[]).length);for(let I of U)if(v.push(`\u2716 ${I.message}`),I.path?.length)v.push(` \u2192 at ${kP(I.path)}`);return v.join(`
149
149
  `)}var IU=($)=>(v,U,I,b)=>{let D=I?{...I,async:!1}:{async:!1},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)throw new j4;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>Kv(g,D,c$())));throw Ou(w,b?.callee),w}return u.value},Hu=IU(Tv),DU=($)=>async(v,U,I,b)=>{let D=I?{...I,async:!0}:{async:!0},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)u=await u;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>Kv(g,D,c$())));throw Ou(w,b?.callee),w}return u.value},zu=DU(Tv),uU=($)=>(v,U,I)=>{let b=I?{...I,async:!1}:{async:!1},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)throw new j4;return D.issues.length?{success:!1,error:new($??b1)(D.issues.map((u)=>Kv(u,b,c$())))}:{success:!0,data:D.value}},MG=uU(Tv),wU=($)=>async(v,U,I)=>{let b=I?{...I,async:!0}:{async:!0},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)D=await D;return D.issues.length?{success:!1,error:new $(D.issues.map((u)=>Kv(u,b,c$())))}:{success:!0,data:D.value}},_G=wU(Tv),Qu=($)=>(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return IU($)(v,U,b)},uy=Qu(Tv),Yu=($)=>(v,U,I)=>{return IU($)(v,U,I)},wy=Yu(Tv),Vu=($)=>async(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return DU($)(v,U,b)},gy=Vu(Tv),Lu=($)=>async(v,U,I)=>{return DU($)(v,U,I)},Jy=Lu(Tv),Ku=($)=>(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return uU($)(v,U,b)},Xy=Ku(Tv),qu=($)=>(v,U,I)=>{return uU($)(v,U,I)},Wy=qu(Tv),Bu=($)=>async(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return wU($)(v,U,b)},Gy=Bu(Tv),Au=($)=>async(v,U,I)=>{return wU($)(v,U,I)},Oy=Au(Tv);var yv={};e$(yv,{xid:()=>kG,uuid7:()=>Yy,uuid6:()=>Qy,uuid4:()=>zy,uuid:()=>zb,uppercase:()=>I9,unicodeEmail:()=>EP,undefined:()=>b9,ulid:()=>TG,time:()=>dG,string:()=>aG,sha512_hex:()=>Cy,sha512_base64url:()=>xy,sha512_base64:()=>iy,sha384_hex:()=>Ry,sha384_base64url:()=>ry,sha384_base64:()=>ny,sha256_hex:()=>Ty,sha256_base64url:()=>Ey,sha256_base64:()=>ky,sha1_hex:()=>_y,sha1_base64url:()=>Zy,sha1_base64:()=>Fy,rfc5322Email:()=>Ly,number:()=>D1,null:()=>v9,nanoid:()=>RG,md5_hex:()=>Ny,md5_base64url:()=>My,md5_base64:()=>Sy,mac:()=>fG,lowercase:()=>U9,ksuid:()=>EG,ipv6:()=>lG,ipv4:()=>xG,integer:()=>sG,idnEmail:()=>Ky,httpProtocol:()=>cG,html5Email:()=>Vy,hostname:()=>Ay,hex:()=>jy,guid:()=>rG,extendedDuration:()=>Hy,emoji:()=>iG,email:()=>CG,e164:()=>oG,duration:()=>nG,domain:()=>Py,datetime:()=>pG,date:()=>tG,cuid2:()=>ZG,cuid:()=>FG,cidrv6:()=>hG,cidrv4:()=>yG,browserEmail:()=>qy,boolean:()=>$9,bigint:()=>eG,base64url:()=>Pu,base64:()=>mG});var FG=/^[cC][0-9a-z]{6,}$/,ZG=/^[0-9a-z]+$/,TG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kG=/^[0-9a-vA-V]{20}$/,EG=/^[A-Za-z0-9]{27}$/,RG=/^[a-zA-Z0-9_-]{21}$/,nG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hy=/^[-+]?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)?)??$/,rG=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,zb=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},zy=zb(4),Qy=zb(6),Yy=zb(7),CG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Vy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ly=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,EP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Ky=EP,qy=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,By="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iG(){return new RegExp(By,"u")}var xG=/^(?:(?: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])$/,lG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,fG=($)=>{let v=av($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},yG=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pu=/^[A-Za-z0-9_-]*$/,Ay=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Py=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,cG=/^https?$/,oG=/^\+[1-9]\d{6,14}$/,RP="(?:(?:\\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])))",tG=new RegExp(`^${RP}$`);function nP($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function dG($){return new RegExp(`^${nP($)}$`)}function pG($){let v=nP({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let I=`${v}(?:${U.join("|")})`;return new RegExp(`^${RP}T(?:${I})$`)}var aG=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},eG=/^-?\d+n?$/,sG=/^-?\d+$/,D1=/^-?\d+(?:\.\d+)?$/,$9=/^(?:true|false)$/i,v9=/^null$/i;var b9=/^undefined$/i;var U9=/^[^A-Z]*$/,I9=/^[^a-z]*$/,jy=/^[0-9a-fA-F]*$/;function u1($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function w1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var Ny=/^[0-9a-fA-F]{32}$/,Sy=u1(22,"=="),My=w1(22),_y=/^[0-9a-fA-F]{40}$/,Fy=u1(27,"="),Zy=w1(27),Ty=/^[0-9a-fA-F]{64}$/,ky=u1(43,"="),Ey=w1(43),Ry=/^[0-9a-fA-F]{96}$/,ny=u1(64,""),ry=w1(64),Cy=/^[0-9a-fA-F]{128}$/,iy=u1(86,"=="),xy=w1(86);var M$=V("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),CP={number:"number",bigint:"bigint",object:"date"},ju=V("$ZodCheckLessThan",($,v)=>{M$.init($,v);let U=CP[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.maximum:b.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<D)if(v.inclusive)b.maximum=v.value;else b.exclusiveMaximum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value<=v.value:I.value<v.value)return;I.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),Nu=V("$ZodCheckGreaterThan",($,v)=>{M$.init($,v);let U=CP[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.minimum:b.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>D)if(v.inclusive)b.minimum=v.value;else b.exclusiveMinimum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value>=v.value:I.value>v.value)return;I.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),D9=V("$ZodCheckMultipleOf",($,v)=>{M$.init($,v),$._zod.onattach.push((U)=>{var I;(I=U._zod.bag).multipleOf??(I.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):YG(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),u9=V("$ZodCheckNumberFormat",($,v)=>{M$.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),I=U?"int":"number",[b,D]=AG[v.format];$._zod.onattach.push((u)=>{let w=u._zod.bag;if(w.format=v.format,w.minimum=b,w.maximum=D,U)w.pattern=sG}),$._zod.check=(u)=>{let w=u.value;if(U){if(!Number.isInteger(w)){u.issues.push({expected:I,format:v.format,code:"invalid_type",continue:!1,input:w,inst:$});return}if(!Number.isSafeInteger(w)){if(w>0)u.issues.push({input:w,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});else u.issues.push({input:w,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});return}}if(w<b)u.issues.push({origin:"number",input:w,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!v.abort});if(w>D)u.issues.push({origin:"number",input:w,code:"too_big",maximum:D,inclusive:!0,inst:$,continue:!v.abort})}}),w9=V("$ZodCheckBigIntFormat",($,v)=>{M$.init($,v);let[U,I]=PG[v.format];$._zod.onattach.push((b)=>{let D=b._zod.bag;D.format=v.format,D.minimum=U,D.maximum=I}),$._zod.check=(b)=>{let D=b.value;if(D<U)b.issues.push({origin:"bigint",input:D,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(D>I)b.issues.push({origin:"bigint",input:D,code:"too_big",maximum:I,inclusive:!0,inst:$,continue:!v.abort})}}),g9=V("$ZodCheckMaxSize",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<b)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let b=I.value;if(b.size<=v.maximum)return;I.issues.push({origin:$1(b),code:"too_big",maximum:v.maximum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),J9=V("$ZodCheckMinSize",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>b)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let b=I.value;if(b.size>=v.minimum)return;I.issues.push({origin:$1(b),code:"too_small",minimum:v.minimum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),X9=V("$ZodCheckSizeEquals",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.minimum=v.size,b.maximum=v.size,b.size=v.size}),$._zod.check=(I)=>{let b=I.value,D=b.size;if(D===v.size)return;let u=D>v.size;I.issues.push({origin:$1(b),...u?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),W9=V("$ZodCheckMaxLength",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<b)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let b=I.value;if(b.length<=v.maximum)return;let u=v1(b);I.issues.push({origin:u,code:"too_big",maximum:v.maximum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),G9=V("$ZodCheckMinLength",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>b)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let b=I.value;if(b.length>=v.minimum)return;let u=v1(b);I.issues.push({origin:u,code:"too_small",minimum:v.minimum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),O9=V("$ZodCheckLengthEquals",($,v)=>{var U;M$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!q6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.minimum=v.length,b.maximum=v.length,b.length=v.length}),$._zod.check=(I)=>{let b=I.value,D=b.length;if(D===v.length)return;let u=v1(b),w=D>v.length;I.issues.push({origin:u,...w?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),gU=V("$ZodCheckStringFormat",($,v)=>{var U,I;if(M$.init($,v),$._zod.onattach.push((b)=>{let D=b._zod.bag;if(D.format=v.format,v.pattern)D.patterns??(D.patterns=new Set),D.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(b)=>{if(v.pattern.lastIndex=0,v.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:v.format,input:b.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(I=$._zod).check??(I.check=()=>{})}),H9=V("$ZodCheckRegex",($,v)=>{gU.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),z9=V("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=U9),gU.init($,v)}),Q9=V("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=I9),gU.init($,v)}),Y9=V("$ZodCheckIncludes",($,v)=>{M$.init($,v);let U=av(v.includes),I=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=I,$._zod.onattach.push((b)=>{let D=b._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(I)}),$._zod.check=(b)=>{if(b.value.includes(v.includes,v.position))return;b.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:b.value,inst:$,continue:!v.abort})}}),V9=V("$ZodCheckStartsWith",($,v)=>{M$.init($,v);let U=new RegExp(`^${av(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.startsWith(v.prefix))return;I.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:I.value,inst:$,continue:!v.abort})}}),L9=V("$ZodCheckEndsWith",($,v)=>{M$.init($,v);let U=new RegExp(`.*${av(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.endsWith(v.suffix))return;I.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:I.value,inst:$,continue:!v.abort})}});function rP($,v,U){if($.issues.length)v.issues.push(...Zv(U,$.issues))}var K9=V("$ZodCheckProperty",($,v)=>{M$.init($,v),$._zod.check=(U)=>{let I=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(I instanceof Promise)return I.then((b)=>rP(b,U,v.property));rP(I,U,v.property);return}}),q9=V("$ZodCheckMimeType",($,v)=>{M$.init($,v);let U=new Set(v.mime);$._zod.onattach.push((I)=>{I._zod.bag.mime=v.mime}),$._zod.check=(I)=>{if(U.has(I.value.type))return;I.issues.push({code:"invalid_value",values:v.mime,input:I.value.type,inst:$,continue:!v.abort})}}),B9=V("$ZodCheckOverwrite",($,v)=>{M$.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}});class Su{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
150
150
  `).filter((D)=>D),I=Math.min(...U.map((D)=>D.length-D.trimStart().length)),b=U.map((D)=>D.slice(I)).map((D)=>" ".repeat(this.indent*2)+D);for(let D of b)this.content.push(D)}compile(){let $=Function,v=this?.args,I=[...(this?.content??[""]).map((b)=>` ${b}`)];return new $(...v,I.join(`
151
151
  `))}}var A9={major:4,minor:4,patch:3};var $$=V("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=A9;let I=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))I.unshift($);for(let b of I)for(let D of b._zod.onattach)D($);if(I.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let b=(u,w,g)=>{let J=P6(u),X;for(let W of w){if(W._zod.def.when){if(jG(u))continue;if(!W._zod.def.when(u))continue}else if(J)continue;let G=u.issues.length,O=W._zod.check(u);if(O instanceof Promise&&g?.async===!1)throw new j4;if(X||O instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await O,u.issues.length===G)return;if(!J)J=P6(u,G)});else{if(u.issues.length===G)continue;if(!J)J=P6(u,G)}}if(X)return X.then(()=>{return u});return u},D=(u,w,g)=>{if(P6(u))return u.aborted=!0,u;let J=b(w,I,g);if(J instanceof Promise){if(g.async===!1)throw new j4;return J.then((X)=>$._zod.parse(X,g))}return $._zod.parse(J,g)};$._zod.run=(u,w)=>{if(w.skipChecks)return $._zod.parse(u,w);if(w.direction==="backward"){let J=$._zod.parse({value:u.value,issues:[]},{...w,skipChecks:!0});if(J instanceof Promise)return J.then((X)=>{return D(X,u,w)});return D(J,u,w)}let g=$._zod.parse(u,w);if(g instanceof Promise){if(w.async===!1)throw new j4;return g.then((J)=>b(J,I,w))}return b(g,I,w)}}g$($,"~standard",()=>({validate:(b)=>{try{let D=MG($,b);return D.success?{value:D.data}:{issues:D.error?.issues}}catch(D){return _G($,b).then((u)=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Qb=V("$ZodString",($,v)=>{$$.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??aG($._zod.bag),$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=String(U.value)}catch(b){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),P$=V("$ZodStringFormat",($,v)=>{gU.init($,v),Qb.init($,v)}),j9=V("$ZodGUID",($,v)=>{v.pattern??(v.pattern=rG),P$.init($,v)}),N9=V("$ZodUUID",($,v)=>{if(v.version){let I={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(I===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=zb(I))}else v.pattern??(v.pattern=zb());P$.init($,v)}),S9=V("$ZodEmail",($,v)=>{v.pattern??(v.pattern=CG),P$.init($,v)}),M9=V("$ZodURL",($,v)=>{P$.init($,v),$._zod.check=(U)=>{try{let I=U.value.trim();if(!v.normalize&&v.protocol?.source===cG.source){if(!/^https?:\/\//i.test(I)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!v.abort});return}}let b=new URL(I);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(b.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(b.protocol.endsWith(":")?b.protocol.slice(0,-1):b.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=b.href;else U.value=I;return}catch(I){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),_9=V("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=iG()),P$.init($,v)}),F9=V("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=RG),P$.init($,v)}),Z9=V("$ZodCUID",($,v)=>{v.pattern??(v.pattern=FG),P$.init($,v)}),T9=V("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=ZG),P$.init($,v)}),k9=V("$ZodULID",($,v)=>{v.pattern??(v.pattern=TG),P$.init($,v)}),E9=V("$ZodXID",($,v)=>{v.pattern??(v.pattern=kG),P$.init($,v)}),R9=V("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=EG),P$.init($,v)}),n9=V("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=pG(v)),P$.init($,v)}),r9=V("$ZodISODate",($,v)=>{v.pattern??(v.pattern=tG),P$.init($,v)}),C9=V("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=dG(v)),P$.init($,v)}),i9=V("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=nG),P$.init($,v)}),x9=V("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=xG),P$.init($,v),$._zod.bag.format="ipv4"}),l9=V("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=lG),P$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!v.abort})}}}),f9=V("$ZodMAC",($,v)=>{v.pattern??(v.pattern=fG(v.delimiter)),P$.init($,v),$._zod.bag.format="mac"}),y9=V("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=yG),P$.init($,v)}),h9=V("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=hG),P$.init($,v),$._zod.check=(U)=>{let I=U.value.split("/");try{if(I.length!==2)throw Error();let[b,D]=I;if(!D)throw Error();let u=Number(D);if(`${u}`!==D)throw Error();if(u<0||u>128)throw Error();new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});function m9($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var c9=V("$ZodBase64",($,v)=>{v.pattern??(v.pattern=mG),P$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(m9(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});function $j($){if(!Pu.test($))return!1;let v=$.replace(/[-_]/g,(I)=>I==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return m9(U)}var o9=V("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=Pu),P$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if($j(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),t9=V("$ZodE164",($,v)=>{v.pattern??(v.pattern=oG),P$.init($,v)});function vj($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[I]=U;if(!I)return!1;let b=JSON.parse(atob(I));if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(v&&(!("alg"in b)||b.alg!==v))return!1;return!0}catch{return!1}}var d9=V("$ZodJWT",($,v)=>{P$.init($,v),$._zod.check=(U)=>{if(vj(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),p9=V("$ZodCustomStringFormat",($,v)=>{P$.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),Tu=V("$ZodNumber",($,v)=>{$$.init($,v),$._zod.pattern=$._zod.bag.pattern??D1,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=Number(U.value)}catch(u){}let b=U.value;if(typeof b==="number"&&!Number.isNaN(b)&&Number.isFinite(b))return U;let D=typeof b==="number"?Number.isNaN(b)?"NaN":!Number.isFinite(b)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:b,inst:$,...D?{received:D}:{}}),U}}),a9=V("$ZodNumberFormat",($,v)=>{u9.init($,v),Tu.init($,v)}),g1=V("$ZodBoolean",($,v)=>{$$.init($,v),$._zod.pattern=$9,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(D){}let b=U.value;if(typeof b==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:b,inst:$}),U}}),ku=V("$ZodBigInt",($,v)=>{$$.init($,v),$._zod.pattern=eG,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(b){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),e9=V("$ZodBigIntFormat",($,v)=>{w9.init($,v),ku.init($,v)}),s9=V("$ZodSymbol",($,v)=>{$$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:b,inst:$}),U}}),$O=V("$ZodUndefined",($,v)=>{$$.init($,v),$._zod.pattern=b9,$._zod.values=new Set([void 0]),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:b,inst:$}),U}}),vO=V("$ZodNull",($,v)=>{$$.init($,v),$._zod.pattern=v9,$._zod.values=new Set([null]),$._zod.parse=(U,I)=>{let b=U.value;if(b===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:b,inst:$}),U}}),bO=V("$ZodAny",($,v)=>{$$.init($,v),$._zod.parse=(U)=>U}),UO=V("$ZodUnknown",($,v)=>{$$.init($,v),$._zod.parse=(U)=>U}),IO=V("$ZodNever",($,v)=>{$$.init($,v),$._zod.parse=(U,I)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),DO=V("$ZodVoid",($,v)=>{$$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:b,inst:$}),U}}),uO=V("$ZodDate",($,v)=>{$$.init($,v),$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(w){}let b=U.value,D=b instanceof Date;if(D&&!Number.isNaN(b.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:b,...D?{received:"Invalid Date"}:{},inst:$}),U}});function xP($,v,U){if($.issues.length)v.issues.push(...Zv(U,$.issues));v.value[U]=$.value}var wO=V("$ZodArray",($,v)=>{$$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(!Array.isArray(b))return U.issues.push({expected:"array",code:"invalid_type",input:b,inst:$}),U;U.value=Array(b.length);let D=[];for(let u=0;u<b.length;u++){let w=b[u],g=v.element._zod.run({value:w,issues:[]},I);if(g instanceof Promise)D.push(g.then((J)=>xP(J,U,u)));else xP(g,U,u)}if(D.length)return Promise.all(D).then(()=>U);return U}});function Zu($,v,U,I,b,D){let u=U in I;if($.issues.length){if(b&&D&&!u)return;v.issues.push(...Zv(U,$.issues))}if(!u&&!b){if(!$.issues.length)v.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[U]});return}if($.value===void 0){if(u)v.value[U]=void 0}else v.value[U]=$.value}function bj($){let v=Object.keys($.shape);for(let I of v)if(!$.shape?.[I]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${I}": expected a Zod schema`);let U=BG($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function Uj($,v,U,I,b,D){let u=[],w=b.keySet,g=b.catchall._zod,J=g.def.type,X=g.optin==="optional",W=g.optout==="optional";for(let G in v){if(G==="__proto__")continue;if(w.has(G))continue;if(J==="never"){u.push(G);continue}let O=g.run({value:v[G],issues:[]},I);if(O instanceof Promise)$.push(O.then((z)=>Zu(z,U,G,v,X,W)));else Zu(O,U,G,v,X,W)}if(u.length)U.issues.push({code:"unrecognized_keys",keys:u,input:v,inst:D});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var Ij=V("$ZodObject",($,v)=>{if($$.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let w=v.shape;Object.defineProperty(v,"shape",{get:()=>{let g={...w};return Object.defineProperty(v,"shape",{value:g}),g}})}let I=bU(()=>bj(v));g$($._zod,"propValues",()=>{let w=v.shape,g={};for(let J in w){let X=w[J]._zod;if(X.values){g[J]??(g[J]=new Set);for(let W of X.values)g[J].add(W)}}return g});let b=Hb,D=v.catchall,u;$._zod.parse=(w,g)=>{u??(u=I.value);let J=w.value;if(!b(J))return w.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),w;w.value={};let X=[],W=u.shape;for(let G of u.keys){let O=W[G],z=O._zod.optin==="optional",Q=O._zod.optout==="optional",Y=O._zod.run({value:J[G],issues:[]},g);if(Y instanceof Promise)X.push(Y.then((K)=>Zu(K,w,G,J,z,Q)));else Zu(Y,w,G,J,z,Q)}if(!D)return X.length?Promise.all(X).then(()=>w):w;return Uj(X,J,w,g,I.value,$)}}),gO=V("$ZodObjectJIT",($,v)=>{Ij.init($,v);let U=$._zod.parse,I=bU(()=>bj(v)),b=(G)=>{let O=new Su(["shape","payload","ctx"]),z=I.value,Q=(S)=>{let j=Gu(S);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};O.write("const input = payload.value;");let Y=Object.create(null),K=0;for(let S of z.keys)Y[S]=`key_${K++}`;O.write("const newResult = {};");for(let S of z.keys){let j=Y[S],A=Gu(S),h=G[S],s=h?._zod?.optin==="optional",l=h?._zod?.optout==="optional";if(O.write(`const ${j} = ${Q(S)};`),s&&l)O.write(`
@@ -239,7 +239,7 @@ see also:
239
239
  fnl docs mcp what the MCP server exposes once Claude is up
240
240
  fnl docs debugging the diagnose \u2192 recover \u2192 verify loop
241
241
 
242
- programmable: funnel.claude.launch({ profileId | channelId, options, env, resume })`,pm=["profile","channel"],US=_.createHandlers(c(C1),i("query",H.object({profile:H.string().optional(),channel:H.string().optional()}).loose()),async($)=>{let v=$.req.valid("query"),{funnel:U,claude:I,profiles:b,localConfig:D,localConfigSync:u}=$.env,w=sw($.req.url,pm);if(v.channel&&!v.profile){let G=await I.launch({channel:v.channel,userArgs:w});process.exit(G)}if(v.profile){let G=b.get(v.profile);if(!G)throw new e(404,{message:x$({kind:"profile",name:v.profile,available:b.list().map((z)=>z.name),nextAction:"fnl profiles add <name> --path=<repo> --channel=<channel>"})});let O=await I.launch({channel:G.channelId,cwd:G.path,userArgs:w,profileId:G.id,options:G.options,env:G.env,resume:G.resume});process.exit(O)}let g=process.cwd(),J=D.read(g);if(J){let G=v.channel!==void 0?J.channels.find((Q)=>Q.name===v.channel):J.channels[0];if(!G)throw new e(404,{message:v.channel?`channel "${v.channel}" is not declared in funnel.json`:"funnel.json declares no channels"});let O=await u.ensure(G);for(let Q of O.touched)if(Q.changed)await U.listeners.restart(G.name,Q.name);else await U.listeners.start(G.name,Q.name);for(let Q of O.removed)await U.listeners.stop(G.name,Q);let z=await I.launch({channel:G.name,cwd:g,userArgs:w});process.exit(z)}let X=b.getDefault();if(!X)return $.text(C1);let W=await I.launch({channel:X.channelId,cwd:X.path,userArgs:w,profileId:X.id,options:X.options,env:X.env,resume:X.resume});process.exit(W)});var am="--help",em="-h",sm="--profile",$c="-p",vc="--channel",IS=($,v,U,I)=>{let b=$[v];if(b===void 0)return null;if(b===U||I!==null&&b===I){let u=$[v+1];if(u!==void 0&&!u.startsWith("-"))return{value:u,consumed:2};return{value:null,consumed:1}}let D=`${U}=`;if(b.startsWith(D))return{value:b.slice(D.length),consumed:1};return null},bc=($)=>{let v=[],U=null,I=null,b=!1,D=0;while(D<$.length){let u=$[D];if(u===void 0)break;if(u===am||u===em){b=!0,D++;continue}let w=IS($,D,sm,$c);if(w){if(w.value!==null)U=w.value;D+=w.consumed;continue}let g=IS($,D,vc,null);if(g){if(g.value!==null)I=g.value;D+=g.consumed;continue}v.push(u),D++}return{profile:U,channel:I,wantsHelp:b,userArgs:v}},DS=async($,v,U)=>{for(let I of U.touched)if(I.changed)await $.restart(v,I.name);else await $.start(v,I.name);for(let I of U.removed)await $.stop(v,I)},uS=($,v)=>{if(v===null){let I=$.channels[0];if(!I)return"funnel.json declares no channels";return I}let U=$.channels.find((I)=>I.name===v);if(!U){let I=$.channels.map((b)=>b.name).join(", ");return`channel "${v}" is not declared in funnel.json (available: ${I})`}return U},wS=async($,v)=>{let U=bc(v);if(U.wantsHelp)return{stdout:C1,stderr:null,exitCode:0};if(U.profile!==null&&U.channel!==null)return{stdout:null,stderr:`error: --channel cannot be combined with --profile (profile "${U.profile}" already binds a channel)`,exitCode:1};let{claude:I,profiles:b,localConfig:D,localConfigSync:u,listeners:w}=$,g=$.cwd??process.cwd();if(U.profile!==null){let G=b.get(U.profile);if(G)return{stdout:null,stderr:null,exitCode:await I.launch({channel:G.channelId,cwd:G.path,userArgs:U.userArgs,profileId:G.id,options:G.options,env:G.env,resume:G.resume})};let O=D.read(g),z=O?.profiles?.find((Y)=>Y.name===U.profile);if(O&&z){let Y=uS(O,z.channel);if(typeof Y==="string")return{stdout:null,stderr:`error: ${Y}`,exitCode:1};let K=await u.ensure(Y);return await DS(w,Y.name,K),{stdout:null,stderr:null,exitCode:await I.launch({channel:Y.name,cwd:g,userArgs:U.userArgs,options:z.options,env:z.env})}}let Q=O?.profiles?.map((Y)=>Y.name)??[];return{stdout:null,stderr:`error: ${x$({kind:"profile",name:U.profile,available:[...b.list().map((Y)=>Y.name),...Q],nextAction:"fnl profiles add <name> --path=<repo> --channel=<channel>"})}`,exitCode:1}}let J=D.read(g);if(J){let G=uS(J,U.channel);if(typeof G==="string")return{stdout:null,stderr:`error: ${G}`,exitCode:1};let O=await u.ensure(G);return await DS(w,G.name,O),{stdout:null,stderr:null,exitCode:await I.launch({channel:G.name,cwd:g,userArgs:U.userArgs})}}if(U.channel!==null)return{stdout:null,stderr:null,exitCode:await I.launch({channel:U.channel,cwd:g,userArgs:U.userArgs})};let X=b.getDefault();if(!X)return{stdout:C1,stderr:null,exitCode:0};return{stdout:null,stderr:null,exitCode:await I.launch({channel:X.channelId,cwd:X.path,userArgs:U.userArgs,profileId:X.id,options:X.options,env:X.env,resume:X.resume})}};import{join as gS}from"path";var JS=($,v)=>{let U=$.localConfig.read(v);if(!U)return null;if(U.id!==void 0&&U.id!=="")return gS($.home,".funnel","projects",U.id);let I=$.idGenerator.generate(),b=$.writer.ensureId(v,I)??I;return gS($.home,".funnel","projects",b)};class Pb{}var o4=($)=>{if($.literal!==void 0&&$.literal!=="")return $.literal;if($.envVar!==void 0&&$.envVar!==""){let v=$.env[$.envVar];if(v!==void 0&&v!=="")return v;throw Error(`${$.label} references env var "${$.envVar}" but it is not set in the environment`)}throw Error(`${$.label} has neither a literal token nor an env var reference`)};class i1{}class g4 extends i1{constructor(){super();Object.freeze(this)}async fetch($){let v=await globalThis.fetch($.url,{method:$.method,headers:$.headers,body:$.body});return{status:v.status,ok:v.ok,text:()=>v.text(),json:()=>v.json()}}}var Uc="https://discord.com/api/v10",Ic=new g4;class AQ extends Pb{token;http;constructor($){super();this.token=o4({literal:$.config.botToken,envVar:$.config.botTokenEnv,env:$.env??process.env,label:`${$.config.name}.botToken`}),this.http=$.http??Ic,Object.freeze(this)}async call($){let v=($.method||"GET").toUpperCase(),U=$.path.startsWith("/")?$.path:`/${$.path}`,I=$.body,b=I!==null&&typeof I==="object"&&v!=="GET"&&Object.keys(I).length>0,D=await this.http.fetch({method:v,url:`${Uc}${U}`,headers:{Authorization:`Bot ${this.token}`,"Content-Type":"application/json"},body:b?JSON.stringify($.body):void 0});if(!D.ok)throw Error(`Discord API failed (${D.status}): ${await D.text()}`);if(D.status===204)return null;return await D.json()}}var t4=H.object({id:H.string(),name:H.string(),type:H.literal("discord"),botToken:H.string().min(10).optional(),botTokenEnv:H.string().optional(),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});function x($){if($.error instanceof Error)try{let v=$.error.message;if(typeof v==="string")return v;return"<non-string error message>"}catch{return"<unreadable error message>"}try{return String($.error)}catch{return"<unprintable error>"}}function F$($){if($.value instanceof Error)return $.value;let v=x({error:$.value});try{return Error(v)}catch{try{return Error("unknown error")}catch{let U=Object.create(Error.prototype);return U.name="Error",U.message="unknown error",U}}}function p($){try{let v=$();if(v instanceof Promise)return v.catch((U)=>F$({value:U}));return v}catch(v){return F$({value:v})}}var mv=class extends Error{constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeParseError",Object.freeze(this)}},F4=class extends Error{constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeStartError",Object.freeze(this)}};function ev($){try{let v=$.deps.now();if(typeof v!=="number"||!Number.isFinite(v))return 0;return v}catch{return 0}}var d4=class ${props;constructor(v){this.props=v,Object.freeze(this)}debug(v){this.emit("debug",v)}info(v){this.emit("info",v)}warn(v){this.emit("warn",v)}error(v){this.emit("error",v)}get handler(){return this.props.handler}child(v){return new $({source:v,handler:this.props.handler,deps:this.props.deps})}emit(v,U){let I=this.props.handler;if(!I)return;let b={level:v,source:this.props.source,action:U.action,message:U.message,timestamp:ev({deps:this.props.deps}),error:U.error,detail:U.detail};try{Promise.resolve(I(b)).catch(()=>{})}catch{}}};function jb($){try{Promise.resolve($.fn()).catch((v)=>{try{$.onError(F$({value:v}))}catch{}}).catch(()=>{})}catch(v){try{$.onError(F$({value:v}))}catch{}}}var Dc=class{props;currentStatus="disconnected";currentDetail=null;constructor($){this.props=$}get value(){return this.currentStatus}set($,v){let U=v??null;if(this.currentStatus===$&&this.currentDetail===U)return;let I=this.currentStatus,b=v?` (${v})`:"";this.props.log.info({action:"status",message:`${I} \u2192 ${$}${b}`,detail:{from:I,to:$,reason:U}}),this.currentStatus=$,this.currentDetail=U;let D=this.props.onStatus;if(!D)return;jb({fn:v!==void 0?()=>D($,v):()=>D($),onError:(u)=>{this.props.log.error({action:"onStatus.error",message:x({error:u}),error:u})}})}},uc=class{props;chain=Promise.resolve();depth=0;cancelled=!1;constructor($={}){this.props=$}add($){if(this.cancelled)return;if(this.props.maxDepth!==void 0&&this.depth>=this.props.maxDepth){this.props.onOverflow?.({dropped:1,depth:this.depth});return}this.depth++,this.chain=this.chain.then(async()=>{try{await $()}catch{}finally{this.depth--}})}async drain(){await this.chain}cancel(){this.cancelled=!0,this.depth=0,this.chain=Promise.resolve()}size(){return this.depth}isCancelled(){return this.cancelled}},Nb=class{consumed=!1;stopped=!1;ctx=null;statusEmitter=null;queue=new uc;async start($){if(this.consumed)return new F4(`${this.name}: already started`);return this.consumed=!0,this.ctx=$,this.statusEmitter=new Dc({log:$.log,onStatus:$.onStatus}),await this.connect($)}async stop(){if(this.stopped)return;this.stopped=!0;try{await this.disconnect()}finally{await this.queue.drain(),this.statusEmitter?.set("disconnected"),this.ctx=null}}status(){return this.statusEmitter?.value??"disconnected"}emit($){let v=this.ctx;if(!v)return;this.queue.add(async()=>{let U=await p(()=>Promise.resolve(v.onEvent($)));if(U instanceof Error)v.log.error({action:"onEvent.error",message:x({error:U}),error:U})})}setStatus($,v){this.statusEmitter?.set($,v)}get currentStatus(){return this.statusEmitter?.value??"disconnected"}get context(){return this.ctx}};var Uv=class extends Error{code;constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeConnectionError",this.code=v?.code??null,Object.freeze(this)}};function $g($){try{let v=$.deps.random();if(typeof v!=="number"||!Number.isFinite(v))return 0.5;if(v<0||v>=1)return 0.5;return v}catch{return 0.5}}var vg=class{props;currentAttempt=0;isAborted=!1;timer=null;constructor($){this.props=$}get attempt(){return this.currentAttempt}get aborted(){return this.isAborted}schedule($){if(this.isAborted)return 0;if(this.currentAttempt>=this.props.maxAttempts)return-1;this.clearTimer();let v=this.computeDelay(),U=p(()=>this.props.deps.setTimeout(()=>this.runRetry($),v));if(U instanceof Error)return this.props.log.error({action:"reconnect.timer.schedule.error",message:x({error:U}),error:U}),this.timer=null,0;return this.currentAttempt++,this.timer=U,v}reset(){this.currentAttempt=0}cancel(){this.isAborted=!0,this.clearTimer()}runRetry($){this.timer=null,jb({fn:$,onError:(v)=>{this.props.log.error({action:"reconnect.timer.error",message:x({error:v}),error:v})}})}clearTimer(){if(this.timer===null)return;let $=this.timer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.props.log.error({action:"reconnect.timer.clear.error",message:x({error:v}),error:v});this.timer=null}computeDelay(){return Math.min(this.props.baseDelay*2**this.currentAttempt,this.props.maxDelay)*(0.5+$g({deps:this.props.deps})*0.5)}};function bg($){if(!$.reconnector){$.log.info({action:"reconnect.disabled",message:"reconnect is disabled, staying disconnected"}),$.setStatus("disconnected");return}if($.reconnector.aborted){$.log.info({action:"reconnect.aborted",message:"reconnector cancelled, staying disconnected"}),$.setStatus("disconnected");return}let v=$.reconnector.schedule($.retry);if(v===-1){let U=new Uv(`reconnect exhausted after ${$.reconnector.attempt} attempts`);$.log.error({action:"reconnect.exhausted",message:x({error:U}),error:U}),$.setStatus("disconnected");return}$.setStatus("reconnecting"),$.log.info({action:"reconnect.scheduled",message:`next attempt in ${Math.round(v)}ms`,detail:{attempt:$.reconnector.attempt,delayMs:Math.round(v)}})}function Ug($){return p(()=>JSON.stringify($))}function p4($){return typeof $==="object"&&$!==null}function Sb($){try{return JSON.parse($)}catch(v){return new mv(v instanceof Error?`invalid JSON: ${v.message}`:"invalid JSON",{cause:v})}}var z$={};e$(z$,{xor:()=>lM,xid:()=>XM,void:()=>RM,uuidv7:()=>bM,uuidv6:()=>vM,uuidv4:()=>$M,uuid:()=>sS,util:()=>n,url:()=>UM,uppercase:()=>cU,unknown:()=>nb,union:()=>ZJ,undefined:()=>kM,ulid:()=>JM,uint64:()=>ZM,uint32:()=>MM,tuple:()=>mV,trim:()=>eU,treeifyError:()=>nQ,transform:()=>kJ,toUpperCase:()=>$I,toLowerCase:()=>sU,toJSONSchema:()=>IJ,templateLiteral:()=>v_,symbol:()=>TM,superRefine:()=>LL,success:()=>aM,stringbool:()=>J_,stringFormat:()=>qM,string:()=>J0,strictObject:()=>iM,startsWith:()=>tU,slugify:()=>vI,size:()=>kb,setErrorMap:()=>lt,set:()=>cM,safeParseAsync:()=>LV,safeParse:()=>VV,safeEncodeAsync:()=>NV,safeEncode:()=>PV,safeDecodeAsync:()=>SV,safeDecode:()=>jV,registry:()=>_g,regexes:()=>cv,regex:()=>hU,refine:()=>VL,record:()=>cV,readonly:()=>GL,property:()=>$J,promise:()=>b_,prettifyError:()=>rQ,preprocess:()=>W_,prefault:()=>IL,positive:()=>pg,pipe:()=>WJ,partialRecord:()=>yM,parseAsync:()=>YV,parse:()=>QV,overwrite:()=>J4,optional:()=>W0,object:()=>CM,number:()=>_V,nullish:()=>pM,nullable:()=>G0,null:()=>EV,normalize:()=>aU,nonpositive:()=>eg,nonoptional:()=>DL,nonnegative:()=>sg,never:()=>FJ,negative:()=>ag,nativeEnum:()=>oM,nanoid:()=>uM,nan:()=>eM,multipleOf:()=>E6,minSize:()=>E4,minLength:()=>e4,mime:()=>pU,meta:()=>w_,maxSize:()=>R6,maxLength:()=>Eb,map:()=>mM,mac:()=>OM,lte:()=>ov,lt:()=>T4,lowercase:()=>mU,looseRecord:()=>hM,looseObject:()=>xM,locales:()=>D0,literal:()=>tM,length:()=>Rb,lazy:()=>zL,ksuid:()=>WM,keyof:()=>rM,jwt:()=>KM,json:()=>X_,iso:()=>II,ipv6:()=>HM,ipv4:()=>GM,invertCodec:()=>$_,intersection:()=>yV,int64:()=>FM,int32:()=>SM,int:()=>XJ,instanceof:()=>g_,includes:()=>oU,httpUrl:()=>IM,hostname:()=>BM,hex:()=>AM,hash:()=>PM,guid:()=>eS,gte:()=>jv,gt:()=>k4,globalRegistry:()=>uv,getErrorMap:()=>ft,function:()=>U_,fromJSONSchema:()=>O_,formatError:()=>t1,float64:()=>NM,float32:()=>jM,flattenError:()=>o1,file:()=>dM,exactOptional:()=>sV,enum:()=>TJ,endsWith:()=>dU,encodeAsync:()=>BV,encode:()=>KV,emoji:()=>DM,email:()=>aS,e164:()=>LM,discriminatedUnion:()=>fM,describe:()=>u_,decodeAsync:()=>AV,decode:()=>qV,date:()=>nM,custom:()=>D_,cuid2:()=>gM,cuid:()=>wM,core:()=>s4,config:()=>o$,coerce:()=>qL,codec:()=>sM,clone:()=>Av,cidrv6:()=>QM,cidrv4:()=>zM,check:()=>I_,catch:()=>gL,boolean:()=>FV,bigint:()=>_M,base64url:()=>VM,base64:()=>YM,array:()=>Q0,any:()=>EM,_function:()=>U_,_default:()=>bL,_ZodString:()=>GJ,ZodXor:()=>xV,ZodXID:()=>LJ,ZodVoid:()=>CV,ZodUnknown:()=>nV,ZodUnion:()=>V0,ZodUndefined:()=>TV,ZodUUID:()=>R4,ZodURL:()=>H0,ZodULID:()=>VJ,ZodType:()=>I$,ZodTuple:()=>hV,ZodTransform:()=>aV,ZodTemplateLiteral:()=>OL,ZodSymbol:()=>ZV,ZodSuccess:()=>uL,ZodStringFormat:()=>S$,ZodString:()=>wI,ZodSet:()=>tV,ZodRecord:()=>DI,ZodRealError:()=>nv,ZodReadonly:()=>WL,ZodPromise:()=>QL,ZodPreprocess:()=>XL,ZodPrefault:()=>UL,ZodPipe:()=>L0,ZodOptional:()=>EJ,ZodObject:()=>Y0,ZodNumberFormat:()=>rb,ZodNumber:()=>JI,ZodNullable:()=>$L,ZodNull:()=>kV,ZodNonOptional:()=>RJ,ZodNever:()=>rV,ZodNanoID:()=>zJ,ZodNaN:()=>JL,ZodMap:()=>oV,ZodMAC:()=>MV,ZodLiteral:()=>dV,ZodLazy:()=>HL,ZodKSUID:()=>KJ,ZodJWT:()=>MJ,ZodIssueCode:()=>xt,ZodIntersection:()=>fV,ZodISOTime:()=>gJ,ZodISODuration:()=>JJ,ZodISODateTime:()=>uJ,ZodISODate:()=>wJ,ZodIPv6:()=>BJ,ZodIPv4:()=>qJ,ZodGUID:()=>X0,ZodFunction:()=>YL,ZodFirstPartyTypeKind:()=>KL,ZodFile:()=>pV,ZodExactOptional:()=>eV,ZodError:()=>Ct,ZodEnum:()=>uI,ZodEmoji:()=>HJ,ZodEmail:()=>OJ,ZodE164:()=>SJ,ZodDiscriminatedUnion:()=>lV,ZodDefault:()=>vL,ZodDate:()=>z0,ZodCustomStringFormat:()=>gI,ZodCustom:()=>q0,ZodCodec:()=>K0,ZodCatch:()=>wL,ZodCUID2:()=>YJ,ZodCUID:()=>QJ,ZodCIDRv6:()=>PJ,ZodCIDRv4:()=>AJ,ZodBoolean:()=>XI,ZodBigIntFormat:()=>_J,ZodBigInt:()=>WI,ZodBase64URL:()=>NJ,ZodBase64:()=>jJ,ZodArray:()=>iV,ZodAny:()=>RV,TimePrecision:()=>m7,NEVER:()=>PQ,$output:()=>i7,$input:()=>x7,$brand:()=>jQ});var s4={};e$(s4,{version:()=>kY,util:()=>n,treeifyError:()=>nQ,toJSONSchema:()=>IJ,toDotPath:()=>QS,safeParseAsync:()=>iQ,safeParse:()=>CQ,safeEncodeAsync:()=>ic,safeEncode:()=>rc,safeDecodeAsync:()=>xc,safeDecode:()=>Cc,registry:()=>_g,regexes:()=>cv,process:()=>B$,prettifyError:()=>rQ,parseAsync:()=>wg,parse:()=>ug,meta:()=>j3,locales:()=>D0,isValidJWT:()=>CS,isValidBase64URL:()=>rS,isValidBase64:()=>v5,initializeContext:()=>n6,globalRegistry:()=>uv,globalConfig:()=>Mb,formatError:()=>t1,flattenError:()=>o1,finalize:()=>C6,extractDefs:()=>r6,encodeAsync:()=>Rc,encode:()=>kc,describe:()=>P3,decodeAsync:()=>nc,decode:()=>Ec,createToJSONSchemaMethod:()=>S3,createStandardJSONSchemaMethod:()=>UI,config:()=>o$,clone:()=>Av,_xor:()=>Ht,_xid:()=>xg,_void:()=>z3,_uuidv7:()=>Eg,_uuidv6:()=>kg,_uuidv4:()=>Tg,_uuid:()=>Zg,_url:()=>w0,_uppercase:()=>cU,_unknown:()=>O3,_union:()=>Ot,_undefined:()=>X3,_ulid:()=>ig,_uint64:()=>g3,_uint32:()=>b3,_tuple:()=>Yt,_trim:()=>eU,_transform:()=>Pt,_toUpperCase:()=>$I,_toLowerCase:()=>sU,_templateLiteral:()=>kt,_symbol:()=>J3,_superRefine:()=>A3,_success:()=>_t,_stringbool:()=>N3,_stringFormat:()=>bI,_string:()=>f7,_startsWith:()=>tU,_slugify:()=>vI,_size:()=>kb,_set:()=>Kt,_safeParseAsync:()=>lU,_safeParse:()=>xU,_safeEncodeAsync:()=>Hg,_safeEncode:()=>Gg,_safeDecodeAsync:()=>zg,_safeDecode:()=>Og,_regex:()=>hU,_refine:()=>B3,_record:()=>Vt,_readonly:()=>Tt,_property:()=>$J,_promise:()=>Rt,_positive:()=>pg,_pipe:()=>Zt,_parseAsync:()=>iU,_parse:()=>CU,_overwrite:()=>J4,_optional:()=>jt,_number:()=>p7,_nullable:()=>Nt,_null:()=>W3,_normalize:()=>aU,_nonpositive:()=>eg,_nonoptional:()=>Mt,_nonnegative:()=>sg,_never:()=>H3,_negative:()=>ag,_nativeEnum:()=>Bt,_nanoid:()=>ng,_nan:()=>V3,_multipleOf:()=>E6,_minSize:()=>E4,_minLength:()=>e4,_min:()=>jv,_mime:()=>pU,_maxSize:()=>R6,_maxLength:()=>Eb,_max:()=>ov,_map:()=>Lt,_mac:()=>h7,_lte:()=>ov,_lt:()=>T4,_lowercase:()=>mU,_literal:()=>At,_length:()=>Rb,_lazy:()=>Et,_ksuid:()=>lg,_jwt:()=>dg,_isoTime:()=>t7,_isoDuration:()=>d7,_isoDateTime:()=>c7,_isoDate:()=>o7,_ipv6:()=>yg,_ipv4:()=>fg,_intersection:()=>Qt,_int64:()=>w3,_int32:()=>v3,_int:()=>e7,_includes:()=>oU,_guid:()=>u0,_gte:()=>jv,_gt:()=>k4,_float64:()=>$3,_float32:()=>s7,_file:()=>K3,_enum:()=>qt,_endsWith:()=>dU,_encodeAsync:()=>Xg,_encode:()=>gg,_emoji:()=>Rg,_email:()=>Fg,_e164:()=>tg,_discriminatedUnion:()=>zt,_default:()=>St,_decodeAsync:()=>Wg,_decode:()=>Jg,_date:()=>Q3,_custom:()=>q3,_cuid2:()=>Cg,_cuid:()=>rg,_coercedString:()=>y7,_coercedNumber:()=>a7,_coercedDate:()=>Y3,_coercedBoolean:()=>I3,_coercedBigint:()=>u3,_cidrv6:()=>mg,_cidrv4:()=>hg,_check:()=>oS,_catch:()=>Ft,_boolean:()=>U3,_bigint:()=>D3,_base64url:()=>og,_base64:()=>cg,_array:()=>L3,_any:()=>G3,TimePrecision:()=>m7,NEVER:()=>PQ,JSONSchemaGenerator:()=>WV,JSONSchema:()=>tS,Doc:()=>Lg,$output:()=>i7,$input:()=>x7,$constructor:()=>L,$brand:()=>jQ,$ZodXor:()=>L5,$ZodXID:()=>hY,$ZodVoid:()=>z5,$ZodUnknown:()=>O5,$ZodUnion:()=>s1,$ZodUndefined:()=>X5,$ZodUUID:()=>nY,$ZodURL:()=>CY,$ZodULID:()=>yY,$ZodType:()=>v$,$ZodTuple:()=>Ng,$ZodTransform:()=>M5,$ZodTemplateLiteral:()=>i5,$ZodSymbol:()=>J5,$ZodSuccess:()=>E5,$ZodStringFormat:()=>N$,$ZodString:()=>Tb,$ZodSet:()=>P5,$ZodRegistry:()=>l7,$ZodRecord:()=>B5,$ZodRealError:()=>Rv,$ZodReadonly:()=>C5,$ZodPromise:()=>l5,$ZodPreprocess:()=>r5,$ZodPrefault:()=>T5,$ZodPipe:()=>Mg,$ZodOptional:()=>Sg,$ZodObjectJIT:()=>V5,$ZodObject:()=>lS,$ZodNumberFormat:()=>w5,$ZodNumber:()=>Pg,$ZodNullable:()=>F5,$ZodNull:()=>W5,$ZodNonOptional:()=>k5,$ZodNever:()=>H5,$ZodNanoID:()=>xY,$ZodNaN:()=>n5,$ZodMap:()=>A5,$ZodMAC:()=>eY,$ZodLiteral:()=>N5,$ZodLazy:()=>f5,$ZodKSUID:()=>mY,$ZodJWT:()=>D5,$ZodIntersection:()=>q5,$ZodISOTime:()=>tY,$ZodISODuration:()=>dY,$ZodISODateTime:()=>cY,$ZodISODate:()=>oY,$ZodIPv6:()=>aY,$ZodIPv4:()=>pY,$ZodGUID:()=>RY,$ZodFunction:()=>x5,$ZodFile:()=>S5,$ZodExactOptional:()=>_5,$ZodError:()=>c1,$ZodEnum:()=>j5,$ZodEncodeError:()=>_b,$ZodEmoji:()=>iY,$ZodEmail:()=>rY,$ZodE164:()=>I5,$ZodDiscriminatedUnion:()=>K5,$ZodDefault:()=>Z5,$ZodDate:()=>Q5,$ZodCustomStringFormat:()=>u5,$ZodCustom:()=>y5,$ZodCodec:()=>$0,$ZodCheckUpperCase:()=>NY,$ZodCheckStringFormat:()=>fU,$ZodCheckStartsWith:()=>MY,$ZodCheckSizeEquals:()=>KY,$ZodCheckRegex:()=>PY,$ZodCheckProperty:()=>FY,$ZodCheckOverwrite:()=>TY,$ZodCheckNumberFormat:()=>QY,$ZodCheckMultipleOf:()=>zY,$ZodCheckMinSize:()=>LY,$ZodCheckMinLength:()=>BY,$ZodCheckMimeType:()=>ZY,$ZodCheckMaxSize:()=>VY,$ZodCheckMaxLength:()=>qY,$ZodCheckLowerCase:()=>jY,$ZodCheckLessThan:()=>Yg,$ZodCheckLengthEquals:()=>AY,$ZodCheckIncludes:()=>SY,$ZodCheckGreaterThan:()=>Vg,$ZodCheckEndsWith:()=>_Y,$ZodCheckBigIntFormat:()=>YY,$ZodCheck:()=>Z$,$ZodCatch:()=>R5,$ZodCUID2:()=>fY,$ZodCUID:()=>lY,$ZodCIDRv6:()=>$5,$ZodCIDRv4:()=>sY,$ZodBoolean:()=>e1,$ZodBigIntFormat:()=>g5,$ZodBigInt:()=>jg,$ZodBase64URL:()=>U5,$ZodBase64:()=>b5,$ZodAsyncError:()=>Z4,$ZodArray:()=>Y5,$ZodAny:()=>G5});var XS,PQ=Object.freeze({status:"aborted"});function L($,v,U){function I(w,g){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1});if(w._zod.traits.has($))return;w._zod.traits.add($),v(w,g);let J=u.prototype,X=Object.keys(J);for(let W=0;W<X.length;W++){let G=X[W];if(!(G in w))w[G]=J[G].bind(w)}}let b=U?.Parent??Object;class D extends b{}Object.defineProperty(D,"name",{value:$});function u(w){var g;let J=U?.Parent?new D:this;I(J,w),(g=J._zod).deferred??(g.deferred=[]);for(let X of J._zod.deferred)X();return J}return Object.defineProperty(u,"init",{value:I}),Object.defineProperty(u,Symbol.hasInstance,{value:(w)=>{if(U?.Parent&&w instanceof U.Parent)return!0;return w?._zod?.traits?.has($)}}),Object.defineProperty(u,"name",{value:$}),u}var jQ=Symbol("zod_brand");class Z4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _b extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(XS=globalThis).__zod_globalConfig??(XS.__zod_globalConfig={});var Mb=globalThis.__zod_globalConfig;function o$($){if($)Object.assign(Mb,$);return Mb}var n={};e$(n,{unwrapMessage:()=>x1,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>_c,uint8ArrayToBase64:()=>OS,stringifyPrimitive:()=>T,slugify:()=>MQ,shallowClone:()=>FQ,safeExtend:()=>Ac,required:()=>Nc,randomString:()=>Qc,propertyKeyTypes:()=>y1,promiseAllObject:()=>zc,primitiveTypes:()=>ZQ,prefixIssues:()=>Ev,pick:()=>Kc,partial:()=>jc,parsedType:()=>E,optionalKeys:()=>TQ,omit:()=>qc,objectClone:()=>Gc,numKeys:()=>Yc,nullish:()=>F6,normalizeParams:()=>C,mergeDefs:()=>a4,merge:()=>Pc,jsonStringifyReplacer:()=>RU,joinValues:()=>B,issue:()=>rU,isPlainObject:()=>T6,isObject:()=>Fb,hexToUint8Array:()=>Fc,getSizableOrigin:()=>h1,getParsedType:()=>Vc,getLengthableOrigin:()=>m1,getEnumValues:()=>l1,getElementAtPath:()=>Hc,floatSafeRemainder:()=>SQ,finalizeIssue:()=>Pv,extend:()=>Bc,explicitlyAborted:()=>RQ,escapeRegex:()=>sv,esc:()=>Ig,defineLazy:()=>J$,createTransparentProxy:()=>Lc,cloneDef:()=>Oc,clone:()=>Av,cleanRegex:()=>f1,cleanEnum:()=>Sc,captureStackTrace:()=>Dg,cached:()=>nU,base64urlToUint8Array:()=>Mc,base64ToUint8Array:()=>GS,assignProp:()=>Z6,assertNotEqual:()=>gc,assertNever:()=>Xc,assertIs:()=>Jc,assertEqual:()=>wc,assert:()=>Wc,allowsEval:()=>_Q,aborted:()=>k6,NUMBER_FORMAT_RANGES:()=>kQ,Class:()=>HS,BIGINT_FORMAT_RANGES:()=>EQ});function wc($){return $}function gc($){return $}function Jc($){}function Xc($){throw Error("Unexpected value in exhaustive check")}function Wc($){}function l1($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,b])=>v.indexOf(+I)===-1).map(([I,b])=>b)}function B($,v="|"){return $.map((U)=>T(U)).join(v)}function RU($,v){if(typeof v==="bigint")return v.toString();return v}function nU($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function F6($){return $===null||$===void 0}function f1($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function SQ($,v){let U=$/v,I=Math.round(U),b=Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<b)return 0;return U-I}var WS=Symbol("evaluating");function J$($,v,U){let I=void 0;Object.defineProperty($,v,{get(){if(I===WS)return;if(I===void 0)I=WS,I=U();return I},set(b){Object.defineProperty($,v,{value:b})},configurable:!0})}function Gc($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function Z6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function a4(...$){let v={};for(let U of $){let I=Object.getOwnPropertyDescriptors(U);Object.assign(v,I)}return Object.defineProperties({},v)}function Oc($){return a4($._zod.def)}function Hc($,v){if(!v)return $;return v.reduce((U,I)=>U?.[I],$)}function zc($){let v=Object.keys($),U=v.map((I)=>$[I]);return Promise.all(U).then((I)=>{let b={};for(let D=0;D<v.length;D++)b[v[D]]=I[D];return b})}function Qc($=10){let U="";for(let I=0;I<$;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Ig($){return JSON.stringify($)}function MQ($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dg="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function Fb($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var _Q=nU(()=>{if(Mb.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function T6($){if(Fb($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(Fb(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function FQ($){if(T6($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function Yc($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var Vc=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},y1=new Set(["string","number","symbol"]),ZQ=new Set(["string","number","bigint","boolean","symbol","undefined"]);function sv($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Av($,v,U){let I=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)I._zod.parent=$;return I}function C($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function Lc($){let v;return new Proxy({},{get(U,I,b){return v??(v=$()),Reflect.get(v,I,b)},set(U,I,b,D){return v??(v=$()),Reflect.set(v,I,b,D)},has(U,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(U,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(U,I,b){return v??(v=$()),Reflect.defineProperty(v,I,b)}})}function T($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function TQ($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var kQ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},EQ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kc($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let D=a4($._zod.def,{get shape(){let u={};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;u[w]=U.shape[w]}return Z6(this,"shape",u),u},checks:[]});return Av($,D)}function qc($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let D=a4($._zod.def,{get shape(){let u={...$._zod.def.shape};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;delete u[w]}return Z6(this,"shape",u),u},checks:[]});return Av($,D)}function Bc($,v){if(!T6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let D=$._zod.def.shape;for(let u in v)if(Object.getOwnPropertyDescriptor(D,u)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let b=a4($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return Z6(this,"shape",D),D}});return Av($,b)}function Ac($,v){if(!T6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=a4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return Z6(this,"shape",I),I}});return Av($,U)}function Pc($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U=a4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return Z6(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return Av($,U)}function jc($,v,U){let b=v._zod.def.checks;if(b&&b.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let u=a4(v._zod.def,{get shape(){let w=v._zod.def.shape,g={...w};if(U)for(let J in U){if(!(J in w))throw Error(`Unrecognized key: "${J}"`);if(!U[J])continue;g[J]=$?new $({type:"optional",innerType:w[J]}):w[J]}else for(let J in w)g[J]=$?new $({type:"optional",innerType:w[J]}):w[J];return Z6(this,"shape",g),g},checks:[]});return Av(v,u)}function Nc($,v,U){let I=a4(v._zod.def,{get shape(){let b=v._zod.def.shape,D={...b};if(U)for(let u in U){if(!(u in D))throw Error(`Unrecognized key: "${u}"`);if(!U[u])continue;D[u]=new $({type:"nonoptional",innerType:b[u]})}else for(let u in b)D[u]=new $({type:"nonoptional",innerType:b[u]});return Z6(this,"shape",D),D}});return Av(v,I)}function k6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function RQ($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue===!1)return!0;return!1}function Ev($,v){return v.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift($),U})}function x1($){return typeof $==="string"?$:$?.message}function Pv($,v,U){let I=$.message?$.message:x1($.inst?._zod.def?.error?.($))??x1(v?.error?.($))??x1(U.customError?.($))??x1(U.localeError?.($))??"Invalid input",{inst:b,continue:D,input:u,...w}=$;if(w.path??(w.path=[]),w.message=I,v?.reportInput)w.input=u;return w}function h1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function m1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function E($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function rU(...$){let[v,U,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:I};return{...v}}function Sc($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function GS($){let v=atob($),U=new Uint8Array(v.length);for(let I=0;I<v.length;I++)U[I]=v.charCodeAt(I);return U}function OS($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function Mc($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return GS(v+U)}function _c($){return OS($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Fc($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)U[I/2]=Number.parseInt(v.slice(I,I+2),16);return U}function Zc($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class HS{constructor(...$){}}var zS=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,RU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},c1=L("$ZodError",zS),Rv=L("$ZodError",zS,{Parent:Error});function o1($,v=(U)=>U.message){let U={},I=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(v(b));else I.push(v(b));return{formErrors:I,fieldErrors:U}}function t1($,v=(U)=>U.message){let U={_errors:[]},I=(b,D=[])=>{for(let u of b.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((w)=>I({issues:w},[...D,...u.path]));else if(u.code==="invalid_key")I({issues:u.issues},[...D,...u.path]);else if(u.code==="invalid_element")I({issues:u.issues},[...D,...u.path]);else{let w=[...D,...u.path];if(w.length===0)U._errors.push(v(u));else{let g=U,J=0;while(J<w.length){let X=w[J];if(J!==w.length-1)g[X]=g[X]||{_errors:[]};else g[X]=g[X]||{_errors:[]},g[X]._errors.push(v(u));g=g[X],J++}}}};return I($),U}function nQ($,v=(U)=>U.message){let U={errors:[]},I=(b,D=[])=>{var u,w;for(let g of b.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((J)=>I({issues:J},[...D,...g.path]));else if(g.code==="invalid_key")I({issues:g.issues},[...D,...g.path]);else if(g.code==="invalid_element")I({issues:g.issues},[...D,...g.path]);else{let J=[...D,...g.path];if(J.length===0){U.errors.push(v(g));continue}let X=U,W=0;while(W<J.length){let G=J[W],O=W===J.length-1;if(typeof G==="string")X.properties??(X.properties={}),(u=X.properties)[G]??(u[G]={errors:[]}),X=X.properties[G];else X.items??(X.items=[]),(w=X.items)[G]??(w[G]={errors:[]}),X=X.items[G];if(O)X.errors.push(v(g));W++}}};return I($),U}function QS($){let v=[],U=$.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")v.push(`[${I}]`);else if(typeof I==="symbol")v.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))v.push(`[${JSON.stringify(I)}]`);else{if(v.length)v.push(".");v.push(I)}return v.join("")}function rQ($){let v=[],U=[...$.issues].sort((I,b)=>(I.path??[]).length-(b.path??[]).length);for(let I of U)if(v.push(`\u2716 ${I.message}`),I.path?.length)v.push(` \u2192 at ${QS(I.path)}`);return v.join(`
242
+ programmable: funnel.claude.launch({ profileId | channelId, options, env, resume })`,pm=["profile","channel"],US=_.createHandlers(c(C1),i("query",H.object({profile:H.string().optional(),channel:H.string().optional()}).loose()),async($)=>{let v=$.req.valid("query"),{funnel:U,claude:I,profiles:b,localConfig:D,localConfigSync:u}=$.env,w=sw($.req.url,pm);if(v.channel&&!v.profile){let G=await I.launch({channel:v.channel,userArgs:w});process.exit(G)}if(v.profile){let G=b.get(v.profile);if(!G)throw new e(404,{message:x$({kind:"profile",name:v.profile,available:b.list().map((z)=>z.name),nextAction:"fnl profiles add <name> --path=<repo> --channel=<channel>"})});let O=await I.launch({channel:G.channelId,cwd:G.path,userArgs:w,profileId:G.id,options:G.options,env:G.env,resume:G.resume});process.exit(O)}let g=process.cwd(),J=D.read(g);if(J){let G=v.channel!==void 0?J.channels.find((Q)=>Q.name===v.channel):J.channels[0];if(!G)throw new e(404,{message:v.channel?`channel "${v.channel}" is not declared in funnel.json`:"funnel.json declares no channels"});let O=await u.ensure(G);for(let Q of O.touched)if(Q.changed)await U.listeners.restart(G.name,Q.name);else await U.listeners.start(G.name,Q.name);for(let Q of O.removed)await U.listeners.stop(G.name,Q);let z=await I.launch({channel:G.name,cwd:g,userArgs:w});process.exit(z)}let X=b.getDefault();if(!X)return $.text(C1);let W=await I.launch({channel:X.channelId,cwd:X.path,userArgs:w,profileId:X.id,options:X.options,env:X.env,resume:X.resume});process.exit(W)});var am="--help",em="-h",sm="--profile",$c="-p",vc="--channel",IS=($,v,U,I)=>{let b=$[v];if(b===void 0)return null;if(b===U||I!==null&&b===I){let u=$[v+1];if(u!==void 0&&!u.startsWith("-"))return{value:u,consumed:2};return{value:null,consumed:1}}let D=`${U}=`;if(b.startsWith(D))return{value:b.slice(D.length),consumed:1};return null},bc=($)=>{let v=[],U=null,I=null,b=!1,D=0;while(D<$.length){let u=$[D];if(u===void 0)break;if(u===am||u===em){b=!0,D++;continue}let w=IS($,D,sm,$c);if(w){if(w.value!==null)U=w.value;D+=w.consumed;continue}let g=IS($,D,vc,null);if(g){if(g.value!==null)I=g.value;D+=g.consumed;continue}v.push(u),D++}return{profile:U,channel:I,wantsHelp:b,userArgs:v}},DS=async($,v,U)=>{for(let I of U.touched)if(I.changed)await $.restart(v,I.name);else await $.start(v,I.name);for(let I of U.removed)await $.stop(v,I)},uS=($,v)=>{if(v===null){let I=$.channels[0];if(!I)return"funnel.json declares no channels";return I}let U=$.channels.find((I)=>I.name===v);if(!U){let I=$.channels.map((b)=>b.name).join(", ");return`channel "${v}" is not declared in funnel.json (available: ${I})`}return U},wS=async($,v)=>{let U=bc(v);if(U.wantsHelp)return{stdout:C1,stderr:null,exitCode:0};if(U.profile!==null&&U.channel!==null)return{stdout:null,stderr:`error: --channel cannot be combined with --profile (profile "${U.profile}" already binds a channel)`,exitCode:1};let{claude:I,profiles:b,localConfig:D,localConfigSync:u,listeners:w}=$,g=$.cwd??process.cwd();if(U.profile!==null){let G=b.get(U.profile);if(G)return{stdout:null,stderr:null,exitCode:await I.launch({channel:G.channelId,cwd:G.path,userArgs:U.userArgs,profileId:G.id,options:G.options,env:G.env,resume:G.resume})};let O=D.read(g),z=O?.profiles?.find((Y)=>Y.name===U.profile);if(O&&z){let Y=uS(O,z.channel);if(typeof Y==="string")return{stdout:null,stderr:`error: ${Y}`,exitCode:1};let K=await u.ensure(Y);return await DS(w,Y.name,K),{stdout:null,stderr:null,exitCode:await I.launch({channel:Y.name,cwd:g,userArgs:U.userArgs,options:z.options,env:z.env})}}let Q=O?.profiles?.map((Y)=>Y.name)??[];return{stdout:null,stderr:`error: ${x$({kind:"profile",name:U.profile,available:[...b.list().map((Y)=>Y.name),...Q],nextAction:"fnl profiles add <name> --path=<repo> --channel=<channel>"})}`,exitCode:1}}let J=D.read(g);if(J){let G=uS(J,U.channel);if(typeof G==="string")return{stdout:null,stderr:`error: ${G}`,exitCode:1};let O=await u.ensure(G);return await DS(w,G.name,O),{stdout:null,stderr:null,exitCode:await I.launch({channel:G.name,cwd:g,userArgs:U.userArgs})}}if(U.channel!==null)return{stdout:null,stderr:null,exitCode:await I.launch({channel:U.channel,cwd:g,userArgs:U.userArgs})};let X=b.getDefault();if(!X)return{stdout:C1,stderr:null,exitCode:0};return{stdout:null,stderr:null,exitCode:await I.launch({channel:X.channelId,cwd:X.path,userArgs:U.userArgs,profileId:X.id,options:X.options,env:X.env,resume:X.resume})}};import{join as gS}from"path";var JS=($,v)=>{let U=$.localConfig.read(v);if(!U)return null;if(U.id!==void 0&&U.id!=="")return gS($.home,".funnel","projects",U.id);let I=$.idGenerator.generate(),b=$.writer.ensureId(v,I)??I;return gS($.home,".funnel","projects",b)};class Pb{}var o4=($)=>{if($.literal!==void 0&&$.literal!=="")return $.literal;if($.envVar!==void 0&&$.envVar!==""){let v=$.env[$.envVar];if(v!==void 0&&v!=="")return v;throw Error(`${$.label} references env var "${$.envVar}" but it is not set in the environment`)}throw Error(`${$.label} has neither a literal token nor an env var reference`)};class i1{}class g4 extends i1{constructor(){super();Object.freeze(this)}async fetch($){let v=await globalThis.fetch($.url,{method:$.method,headers:$.headers,body:$.body});return{status:v.status,ok:v.ok,text:()=>v.text(),json:()=>v.json()}}}var Uc="https://discord.com/api/v10",Ic=new g4;class AQ extends Pb{token;http;constructor($){super();this.token=o4({literal:$.config.botToken,envVar:$.config.botTokenEnv,env:$.env??process.env,label:`${$.config.name}.botToken`}),this.http=$.http??Ic,Object.freeze(this)}async call($){let v=($.method||"GET").toUpperCase(),U=$.path.startsWith("/")?$.path:`/${$.path}`,I=$.body,b=I!==null&&typeof I==="object"&&v!=="GET"&&Object.keys(I).length>0,D=await this.http.fetch({method:v,url:`${Uc}${U}`,headers:{Authorization:`Bot ${this.token}`,"Content-Type":"application/json"},body:b?JSON.stringify($.body):void 0});if(!D.ok)throw Error(`Discord API failed (${D.status}): ${await D.text()}`);if(D.status===204)return null;return await D.json()}}var t4=H.object({id:H.string(),name:H.string(),type:H.literal("discord"),botToken:H.string().min(10).optional(),botTokenEnv:H.string().optional(),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});function x($){if($.error instanceof Error)try{let v=$.error.message;if(typeof v==="string")return v;return"<non-string error message>"}catch{return"<unreadable error message>"}try{return String($.error)}catch{return"<unprintable error>"}}function F$($){if($.value instanceof Error)return $.value;let v=x({error:$.value});try{return Error(v)}catch{try{return Error("unknown error")}catch{let U=Object.create(Error.prototype);return U.name="Error",U.message="unknown error",U}}}function p($){try{let v=$();if(v instanceof Promise)return v.catch((U)=>F$({value:U}));return v}catch(v){return F$({value:v})}}var mv=class extends Error{constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeParseError",Object.freeze(this)}},F4=class extends Error{constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeStartError",Object.freeze(this)}};function ev($){try{let v=$.deps.now();if(typeof v!=="number"||!Number.isFinite(v))return 0;return v}catch{return 0}}var d4=class ${props;constructor(v){this.props=v,Object.freeze(this)}debug(v){this.emit("debug",v)}info(v){this.emit("info",v)}warn(v){this.emit("warn",v)}error(v){this.emit("error",v)}get handler(){return this.props.handler}child(v){return new $({source:v,handler:this.props.handler,deps:this.props.deps})}emit(v,U){let I=this.props.handler;if(!I)return;let b={level:v,source:this.props.source,action:U.action,message:U.message,timestamp:ev({deps:this.props.deps}),error:U.error,detail:U.detail};try{Promise.resolve(I(b)).catch(()=>{})}catch{}}};function jb($){try{Promise.resolve($.fn()).catch((v)=>{try{$.onError(F$({value:v}))}catch{}}).catch(()=>{})}catch(v){try{$.onError(F$({value:v}))}catch{}}}var Dc=class{props;currentStatus="disconnected";currentDetail=null;constructor($){this.props=$}get value(){return this.currentStatus}set($,v){let U=v??null;if(this.currentStatus===$&&this.currentDetail===U)return;let I=this.currentStatus,b=v?` (${v})`:"";this.props.log.info({action:"status",message:`${I} \u2192 ${$}${b}`,detail:{from:I,to:$,reason:U}}),this.currentStatus=$,this.currentDetail=U;let D=this.props.onStatus;if(!D)return;jb({fn:v!==void 0?()=>D($,v):()=>D($),onError:(u)=>{this.props.log.error({action:"onStatus.error",message:x({error:u}),error:u})}})}},uc=class{props;chain=Promise.resolve();depth=0;cancelled=!1;constructor($={}){this.props=$}add($){if(this.cancelled)return;if(this.props.maxDepth!==void 0&&this.depth>=this.props.maxDepth){this.props.onOverflow?.({dropped:1,depth:this.depth});return}this.depth++,this.chain=this.chain.then(async()=>{try{await $()}catch{}finally{this.depth--}})}async drain(){await this.chain}cancel(){this.cancelled=!0,this.depth=0,this.chain=Promise.resolve()}size(){return this.depth}isCancelled(){return this.cancelled}},Nb=class{consumed=!1;stopped=!1;ctx=null;statusEmitter=null;queue=new uc;async start($){if(this.consumed)return new F4(`${this.name}: already started`);return this.consumed=!0,this.ctx=$,this.statusEmitter=new Dc({log:$.log,onStatus:$.onStatus}),await this.connect($)}async stop(){if(this.stopped)return;this.stopped=!0;try{await this.disconnect()}finally{await this.queue.drain(),this.statusEmitter?.set("disconnected"),this.ctx=null}}status(){return this.statusEmitter?.value??"disconnected"}emit($){let v=this.ctx;if(!v)return;this.queue.add(async()=>{let U=await p(()=>Promise.resolve(v.onEvent($)));if(U instanceof Error)v.log.error({action:"onEvent.error",message:x({error:U}),error:U})})}setStatus($,v){this.statusEmitter?.set($,v)}get currentStatus(){return this.statusEmitter?.value??"disconnected"}get context(){return this.ctx}};var Uv=class extends Error{code;constructor($,v){super($,v?.cause===void 0?void 0:{cause:v.cause});this.name="FlumeConnectionError",this.code=v?.code??null,Object.freeze(this)}};function p4($){return typeof $==="object"&&$!==null}function $g($){try{let v=$.deps.random();if(typeof v!=="number"||!Number.isFinite(v))return 0.5;if(v<0||v>=1)return 0.5;return v}catch{return 0.5}}var vg=class{props;currentAttempt=0;isAborted=!1;timer=null;constructor($){this.props=$}get attempt(){return this.currentAttempt}get aborted(){return this.isAborted}schedule($){if(this.isAborted)return 0;if(this.currentAttempt>=this.props.maxAttempts)return-1;this.clearTimer();let v=this.computeDelay(),U=p(()=>this.props.deps.setTimeout(()=>this.runRetry($),v));if(U instanceof Error)return this.props.log.error({action:"reconnect.timer.schedule.error",message:x({error:U}),error:U}),this.timer=null,0;return this.currentAttempt++,this.timer=U,v}reset(){this.currentAttempt=0}cancel(){this.isAborted=!0,this.clearTimer()}runRetry($){this.timer=null,jb({fn:$,onError:(v)=>{this.props.log.error({action:"reconnect.timer.error",message:x({error:v}),error:v})}})}clearTimer(){if(this.timer===null)return;let $=this.timer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.props.log.error({action:"reconnect.timer.clear.error",message:x({error:v}),error:v});this.timer=null}computeDelay(){return Math.min(this.props.baseDelay*2**this.currentAttempt,this.props.maxDelay)*(0.5+$g({deps:this.props.deps})*0.5)}};function bg($){if(!$.reconnector){$.log.info({action:"reconnect.disabled",message:"reconnect is disabled, staying disconnected"}),$.setStatus("disconnected");return}if($.reconnector.aborted){$.log.info({action:"reconnect.aborted",message:"reconnector cancelled, staying disconnected"}),$.setStatus("disconnected");return}let v=$.reconnector.schedule($.retry);if(v===-1){let U=new Uv(`reconnect exhausted after ${$.reconnector.attempt} attempts`);$.log.error({action:"reconnect.exhausted",message:x({error:U}),error:U}),$.setStatus("disconnected");return}$.setStatus("reconnecting"),$.log.info({action:"reconnect.scheduled",message:`next attempt in ${Math.round(v)}ms`,detail:{attempt:$.reconnector.attempt,delayMs:Math.round(v)}})}function Ug($){return p(()=>JSON.stringify($))}function Sb($){try{return JSON.parse($)}catch(v){return new mv(v instanceof Error?`invalid JSON: ${v.message}`:"invalid JSON",{cause:v})}}var z$={};e$(z$,{xor:()=>lM,xid:()=>XM,void:()=>RM,uuidv7:()=>bM,uuidv6:()=>vM,uuidv4:()=>$M,uuid:()=>sS,util:()=>n,url:()=>UM,uppercase:()=>cU,unknown:()=>nb,union:()=>ZJ,undefined:()=>kM,ulid:()=>JM,uint64:()=>ZM,uint32:()=>MM,tuple:()=>mV,trim:()=>eU,treeifyError:()=>nQ,transform:()=>kJ,toUpperCase:()=>$I,toLowerCase:()=>sU,toJSONSchema:()=>IJ,templateLiteral:()=>v_,symbol:()=>TM,superRefine:()=>LL,success:()=>aM,stringbool:()=>J_,stringFormat:()=>qM,string:()=>J0,strictObject:()=>iM,startsWith:()=>tU,slugify:()=>vI,size:()=>kb,setErrorMap:()=>lt,set:()=>cM,safeParseAsync:()=>LV,safeParse:()=>VV,safeEncodeAsync:()=>NV,safeEncode:()=>PV,safeDecodeAsync:()=>SV,safeDecode:()=>jV,registry:()=>_g,regexes:()=>cv,regex:()=>hU,refine:()=>VL,record:()=>cV,readonly:()=>GL,property:()=>$J,promise:()=>b_,prettifyError:()=>rQ,preprocess:()=>W_,prefault:()=>IL,positive:()=>pg,pipe:()=>WJ,partialRecord:()=>yM,parseAsync:()=>YV,parse:()=>QV,overwrite:()=>J4,optional:()=>W0,object:()=>CM,number:()=>_V,nullish:()=>pM,nullable:()=>G0,null:()=>EV,normalize:()=>aU,nonpositive:()=>eg,nonoptional:()=>DL,nonnegative:()=>sg,never:()=>FJ,negative:()=>ag,nativeEnum:()=>oM,nanoid:()=>uM,nan:()=>eM,multipleOf:()=>E6,minSize:()=>E4,minLength:()=>e4,mime:()=>pU,meta:()=>w_,maxSize:()=>R6,maxLength:()=>Eb,map:()=>mM,mac:()=>OM,lte:()=>ov,lt:()=>T4,lowercase:()=>mU,looseRecord:()=>hM,looseObject:()=>xM,locales:()=>D0,literal:()=>tM,length:()=>Rb,lazy:()=>zL,ksuid:()=>WM,keyof:()=>rM,jwt:()=>KM,json:()=>X_,iso:()=>II,ipv6:()=>HM,ipv4:()=>GM,invertCodec:()=>$_,intersection:()=>yV,int64:()=>FM,int32:()=>SM,int:()=>XJ,instanceof:()=>g_,includes:()=>oU,httpUrl:()=>IM,hostname:()=>BM,hex:()=>AM,hash:()=>PM,guid:()=>eS,gte:()=>jv,gt:()=>k4,globalRegistry:()=>uv,getErrorMap:()=>ft,function:()=>U_,fromJSONSchema:()=>O_,formatError:()=>t1,float64:()=>NM,float32:()=>jM,flattenError:()=>o1,file:()=>dM,exactOptional:()=>sV,enum:()=>TJ,endsWith:()=>dU,encodeAsync:()=>BV,encode:()=>KV,emoji:()=>DM,email:()=>aS,e164:()=>LM,discriminatedUnion:()=>fM,describe:()=>u_,decodeAsync:()=>AV,decode:()=>qV,date:()=>nM,custom:()=>D_,cuid2:()=>gM,cuid:()=>wM,core:()=>s4,config:()=>o$,coerce:()=>qL,codec:()=>sM,clone:()=>Av,cidrv6:()=>QM,cidrv4:()=>zM,check:()=>I_,catch:()=>gL,boolean:()=>FV,bigint:()=>_M,base64url:()=>VM,base64:()=>YM,array:()=>Q0,any:()=>EM,_function:()=>U_,_default:()=>bL,_ZodString:()=>GJ,ZodXor:()=>xV,ZodXID:()=>LJ,ZodVoid:()=>CV,ZodUnknown:()=>nV,ZodUnion:()=>V0,ZodUndefined:()=>TV,ZodUUID:()=>R4,ZodURL:()=>H0,ZodULID:()=>VJ,ZodType:()=>I$,ZodTuple:()=>hV,ZodTransform:()=>aV,ZodTemplateLiteral:()=>OL,ZodSymbol:()=>ZV,ZodSuccess:()=>uL,ZodStringFormat:()=>S$,ZodString:()=>wI,ZodSet:()=>tV,ZodRecord:()=>DI,ZodRealError:()=>nv,ZodReadonly:()=>WL,ZodPromise:()=>QL,ZodPreprocess:()=>XL,ZodPrefault:()=>UL,ZodPipe:()=>L0,ZodOptional:()=>EJ,ZodObject:()=>Y0,ZodNumberFormat:()=>rb,ZodNumber:()=>JI,ZodNullable:()=>$L,ZodNull:()=>kV,ZodNonOptional:()=>RJ,ZodNever:()=>rV,ZodNanoID:()=>zJ,ZodNaN:()=>JL,ZodMap:()=>oV,ZodMAC:()=>MV,ZodLiteral:()=>dV,ZodLazy:()=>HL,ZodKSUID:()=>KJ,ZodJWT:()=>MJ,ZodIssueCode:()=>xt,ZodIntersection:()=>fV,ZodISOTime:()=>gJ,ZodISODuration:()=>JJ,ZodISODateTime:()=>uJ,ZodISODate:()=>wJ,ZodIPv6:()=>BJ,ZodIPv4:()=>qJ,ZodGUID:()=>X0,ZodFunction:()=>YL,ZodFirstPartyTypeKind:()=>KL,ZodFile:()=>pV,ZodExactOptional:()=>eV,ZodError:()=>Ct,ZodEnum:()=>uI,ZodEmoji:()=>HJ,ZodEmail:()=>OJ,ZodE164:()=>SJ,ZodDiscriminatedUnion:()=>lV,ZodDefault:()=>vL,ZodDate:()=>z0,ZodCustomStringFormat:()=>gI,ZodCustom:()=>q0,ZodCodec:()=>K0,ZodCatch:()=>wL,ZodCUID2:()=>YJ,ZodCUID:()=>QJ,ZodCIDRv6:()=>PJ,ZodCIDRv4:()=>AJ,ZodBoolean:()=>XI,ZodBigIntFormat:()=>_J,ZodBigInt:()=>WI,ZodBase64URL:()=>NJ,ZodBase64:()=>jJ,ZodArray:()=>iV,ZodAny:()=>RV,TimePrecision:()=>m7,NEVER:()=>PQ,$output:()=>i7,$input:()=>x7,$brand:()=>jQ});var s4={};e$(s4,{version:()=>kY,util:()=>n,treeifyError:()=>nQ,toJSONSchema:()=>IJ,toDotPath:()=>QS,safeParseAsync:()=>iQ,safeParse:()=>CQ,safeEncodeAsync:()=>ic,safeEncode:()=>rc,safeDecodeAsync:()=>xc,safeDecode:()=>Cc,registry:()=>_g,regexes:()=>cv,process:()=>B$,prettifyError:()=>rQ,parseAsync:()=>wg,parse:()=>ug,meta:()=>j3,locales:()=>D0,isValidJWT:()=>CS,isValidBase64URL:()=>rS,isValidBase64:()=>v5,initializeContext:()=>n6,globalRegistry:()=>uv,globalConfig:()=>Mb,formatError:()=>t1,flattenError:()=>o1,finalize:()=>C6,extractDefs:()=>r6,encodeAsync:()=>Rc,encode:()=>kc,describe:()=>P3,decodeAsync:()=>nc,decode:()=>Ec,createToJSONSchemaMethod:()=>S3,createStandardJSONSchemaMethod:()=>UI,config:()=>o$,clone:()=>Av,_xor:()=>Ht,_xid:()=>xg,_void:()=>z3,_uuidv7:()=>Eg,_uuidv6:()=>kg,_uuidv4:()=>Tg,_uuid:()=>Zg,_url:()=>w0,_uppercase:()=>cU,_unknown:()=>O3,_union:()=>Ot,_undefined:()=>X3,_ulid:()=>ig,_uint64:()=>g3,_uint32:()=>b3,_tuple:()=>Yt,_trim:()=>eU,_transform:()=>Pt,_toUpperCase:()=>$I,_toLowerCase:()=>sU,_templateLiteral:()=>kt,_symbol:()=>J3,_superRefine:()=>A3,_success:()=>_t,_stringbool:()=>N3,_stringFormat:()=>bI,_string:()=>f7,_startsWith:()=>tU,_slugify:()=>vI,_size:()=>kb,_set:()=>Kt,_safeParseAsync:()=>lU,_safeParse:()=>xU,_safeEncodeAsync:()=>Hg,_safeEncode:()=>Gg,_safeDecodeAsync:()=>zg,_safeDecode:()=>Og,_regex:()=>hU,_refine:()=>B3,_record:()=>Vt,_readonly:()=>Tt,_property:()=>$J,_promise:()=>Rt,_positive:()=>pg,_pipe:()=>Zt,_parseAsync:()=>iU,_parse:()=>CU,_overwrite:()=>J4,_optional:()=>jt,_number:()=>p7,_nullable:()=>Nt,_null:()=>W3,_normalize:()=>aU,_nonpositive:()=>eg,_nonoptional:()=>Mt,_nonnegative:()=>sg,_never:()=>H3,_negative:()=>ag,_nativeEnum:()=>Bt,_nanoid:()=>ng,_nan:()=>V3,_multipleOf:()=>E6,_minSize:()=>E4,_minLength:()=>e4,_min:()=>jv,_mime:()=>pU,_maxSize:()=>R6,_maxLength:()=>Eb,_max:()=>ov,_map:()=>Lt,_mac:()=>h7,_lte:()=>ov,_lt:()=>T4,_lowercase:()=>mU,_literal:()=>At,_length:()=>Rb,_lazy:()=>Et,_ksuid:()=>lg,_jwt:()=>dg,_isoTime:()=>t7,_isoDuration:()=>d7,_isoDateTime:()=>c7,_isoDate:()=>o7,_ipv6:()=>yg,_ipv4:()=>fg,_intersection:()=>Qt,_int64:()=>w3,_int32:()=>v3,_int:()=>e7,_includes:()=>oU,_guid:()=>u0,_gte:()=>jv,_gt:()=>k4,_float64:()=>$3,_float32:()=>s7,_file:()=>K3,_enum:()=>qt,_endsWith:()=>dU,_encodeAsync:()=>Xg,_encode:()=>gg,_emoji:()=>Rg,_email:()=>Fg,_e164:()=>tg,_discriminatedUnion:()=>zt,_default:()=>St,_decodeAsync:()=>Wg,_decode:()=>Jg,_date:()=>Q3,_custom:()=>q3,_cuid2:()=>Cg,_cuid:()=>rg,_coercedString:()=>y7,_coercedNumber:()=>a7,_coercedDate:()=>Y3,_coercedBoolean:()=>I3,_coercedBigint:()=>u3,_cidrv6:()=>mg,_cidrv4:()=>hg,_check:()=>oS,_catch:()=>Ft,_boolean:()=>U3,_bigint:()=>D3,_base64url:()=>og,_base64:()=>cg,_array:()=>L3,_any:()=>G3,TimePrecision:()=>m7,NEVER:()=>PQ,JSONSchemaGenerator:()=>WV,JSONSchema:()=>tS,Doc:()=>Lg,$output:()=>i7,$input:()=>x7,$constructor:()=>L,$brand:()=>jQ,$ZodXor:()=>L5,$ZodXID:()=>hY,$ZodVoid:()=>z5,$ZodUnknown:()=>O5,$ZodUnion:()=>s1,$ZodUndefined:()=>X5,$ZodUUID:()=>nY,$ZodURL:()=>CY,$ZodULID:()=>yY,$ZodType:()=>v$,$ZodTuple:()=>Ng,$ZodTransform:()=>M5,$ZodTemplateLiteral:()=>i5,$ZodSymbol:()=>J5,$ZodSuccess:()=>E5,$ZodStringFormat:()=>N$,$ZodString:()=>Tb,$ZodSet:()=>P5,$ZodRegistry:()=>l7,$ZodRecord:()=>B5,$ZodRealError:()=>Rv,$ZodReadonly:()=>C5,$ZodPromise:()=>l5,$ZodPreprocess:()=>r5,$ZodPrefault:()=>T5,$ZodPipe:()=>Mg,$ZodOptional:()=>Sg,$ZodObjectJIT:()=>V5,$ZodObject:()=>lS,$ZodNumberFormat:()=>w5,$ZodNumber:()=>Pg,$ZodNullable:()=>F5,$ZodNull:()=>W5,$ZodNonOptional:()=>k5,$ZodNever:()=>H5,$ZodNanoID:()=>xY,$ZodNaN:()=>n5,$ZodMap:()=>A5,$ZodMAC:()=>eY,$ZodLiteral:()=>N5,$ZodLazy:()=>f5,$ZodKSUID:()=>mY,$ZodJWT:()=>D5,$ZodIntersection:()=>q5,$ZodISOTime:()=>tY,$ZodISODuration:()=>dY,$ZodISODateTime:()=>cY,$ZodISODate:()=>oY,$ZodIPv6:()=>aY,$ZodIPv4:()=>pY,$ZodGUID:()=>RY,$ZodFunction:()=>x5,$ZodFile:()=>S5,$ZodExactOptional:()=>_5,$ZodError:()=>c1,$ZodEnum:()=>j5,$ZodEncodeError:()=>_b,$ZodEmoji:()=>iY,$ZodEmail:()=>rY,$ZodE164:()=>I5,$ZodDiscriminatedUnion:()=>K5,$ZodDefault:()=>Z5,$ZodDate:()=>Q5,$ZodCustomStringFormat:()=>u5,$ZodCustom:()=>y5,$ZodCodec:()=>$0,$ZodCheckUpperCase:()=>NY,$ZodCheckStringFormat:()=>fU,$ZodCheckStartsWith:()=>MY,$ZodCheckSizeEquals:()=>KY,$ZodCheckRegex:()=>PY,$ZodCheckProperty:()=>FY,$ZodCheckOverwrite:()=>TY,$ZodCheckNumberFormat:()=>QY,$ZodCheckMultipleOf:()=>zY,$ZodCheckMinSize:()=>LY,$ZodCheckMinLength:()=>BY,$ZodCheckMimeType:()=>ZY,$ZodCheckMaxSize:()=>VY,$ZodCheckMaxLength:()=>qY,$ZodCheckLowerCase:()=>jY,$ZodCheckLessThan:()=>Yg,$ZodCheckLengthEquals:()=>AY,$ZodCheckIncludes:()=>SY,$ZodCheckGreaterThan:()=>Vg,$ZodCheckEndsWith:()=>_Y,$ZodCheckBigIntFormat:()=>YY,$ZodCheck:()=>Z$,$ZodCatch:()=>R5,$ZodCUID2:()=>fY,$ZodCUID:()=>lY,$ZodCIDRv6:()=>$5,$ZodCIDRv4:()=>sY,$ZodBoolean:()=>e1,$ZodBigIntFormat:()=>g5,$ZodBigInt:()=>jg,$ZodBase64URL:()=>U5,$ZodBase64:()=>b5,$ZodAsyncError:()=>Z4,$ZodArray:()=>Y5,$ZodAny:()=>G5});var XS,PQ=Object.freeze({status:"aborted"});function L($,v,U){function I(w,g){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1});if(w._zod.traits.has($))return;w._zod.traits.add($),v(w,g);let J=u.prototype,X=Object.keys(J);for(let W=0;W<X.length;W++){let G=X[W];if(!(G in w))w[G]=J[G].bind(w)}}let b=U?.Parent??Object;class D extends b{}Object.defineProperty(D,"name",{value:$});function u(w){var g;let J=U?.Parent?new D:this;I(J,w),(g=J._zod).deferred??(g.deferred=[]);for(let X of J._zod.deferred)X();return J}return Object.defineProperty(u,"init",{value:I}),Object.defineProperty(u,Symbol.hasInstance,{value:(w)=>{if(U?.Parent&&w instanceof U.Parent)return!0;return w?._zod?.traits?.has($)}}),Object.defineProperty(u,"name",{value:$}),u}var jQ=Symbol("zod_brand");class Z4 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _b extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}(XS=globalThis).__zod_globalConfig??(XS.__zod_globalConfig={});var Mb=globalThis.__zod_globalConfig;function o$($){if($)Object.assign(Mb,$);return Mb}var n={};e$(n,{unwrapMessage:()=>x1,uint8ArrayToHex:()=>Zc,uint8ArrayToBase64url:()=>_c,uint8ArrayToBase64:()=>OS,stringifyPrimitive:()=>T,slugify:()=>MQ,shallowClone:()=>FQ,safeExtend:()=>Ac,required:()=>Nc,randomString:()=>Qc,propertyKeyTypes:()=>y1,promiseAllObject:()=>zc,primitiveTypes:()=>ZQ,prefixIssues:()=>Ev,pick:()=>Kc,partial:()=>jc,parsedType:()=>E,optionalKeys:()=>TQ,omit:()=>qc,objectClone:()=>Gc,numKeys:()=>Yc,nullish:()=>F6,normalizeParams:()=>C,mergeDefs:()=>a4,merge:()=>Pc,jsonStringifyReplacer:()=>RU,joinValues:()=>B,issue:()=>rU,isPlainObject:()=>T6,isObject:()=>Fb,hexToUint8Array:()=>Fc,getSizableOrigin:()=>h1,getParsedType:()=>Vc,getLengthableOrigin:()=>m1,getEnumValues:()=>l1,getElementAtPath:()=>Hc,floatSafeRemainder:()=>SQ,finalizeIssue:()=>Pv,extend:()=>Bc,explicitlyAborted:()=>RQ,escapeRegex:()=>sv,esc:()=>Ig,defineLazy:()=>J$,createTransparentProxy:()=>Lc,cloneDef:()=>Oc,clone:()=>Av,cleanRegex:()=>f1,cleanEnum:()=>Sc,captureStackTrace:()=>Dg,cached:()=>nU,base64urlToUint8Array:()=>Mc,base64ToUint8Array:()=>GS,assignProp:()=>Z6,assertNotEqual:()=>gc,assertNever:()=>Xc,assertIs:()=>Jc,assertEqual:()=>wc,assert:()=>Wc,allowsEval:()=>_Q,aborted:()=>k6,NUMBER_FORMAT_RANGES:()=>kQ,Class:()=>HS,BIGINT_FORMAT_RANGES:()=>EQ});function wc($){return $}function gc($){return $}function Jc($){}function Xc($){throw Error("Unexpected value in exhaustive check")}function Wc($){}function l1($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,b])=>v.indexOf(+I)===-1).map(([I,b])=>b)}function B($,v="|"){return $.map((U)=>T(U)).join(v)}function RU($,v){if(typeof v==="bigint")return v.toString();return v}function nU($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function F6($){return $===null||$===void 0}function f1($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function SQ($,v){let U=$/v,I=Math.round(U),b=Number.EPSILON*Math.max(Math.abs(U),1);if(Math.abs(U-I)<b)return 0;return U-I}var WS=Symbol("evaluating");function J$($,v,U){let I=void 0;Object.defineProperty($,v,{get(){if(I===WS)return;if(I===void 0)I=WS,I=U();return I},set(b){Object.defineProperty($,v,{value:b})},configurable:!0})}function Gc($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function Z6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function a4(...$){let v={};for(let U of $){let I=Object.getOwnPropertyDescriptors(U);Object.assign(v,I)}return Object.defineProperties({},v)}function Oc($){return a4($._zod.def)}function Hc($,v){if(!v)return $;return v.reduce((U,I)=>U?.[I],$)}function zc($){let v=Object.keys($),U=v.map((I)=>$[I]);return Promise.all(U).then((I)=>{let b={};for(let D=0;D<v.length;D++)b[v[D]]=I[D];return b})}function Qc($=10){let U="";for(let I=0;I<$;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function Ig($){return JSON.stringify($)}function MQ($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Dg="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function Fb($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var _Q=nU(()=>{if(Mb.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function T6($){if(Fb($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(Fb(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function FQ($){if(T6($))return{...$};if(Array.isArray($))return[...$];if($ instanceof Map)return new Map($);if($ instanceof Set)return new Set($);return $}function Yc($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var Vc=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},y1=new Set(["string","number","symbol"]),ZQ=new Set(["string","number","bigint","boolean","symbol","undefined"]);function sv($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Av($,v,U){let I=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)I._zod.parent=$;return I}function C($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function Lc($){let v;return new Proxy({},{get(U,I,b){return v??(v=$()),Reflect.get(v,I,b)},set(U,I,b,D){return v??(v=$()),Reflect.set(v,I,b,D)},has(U,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(U,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(U,I,b){return v??(v=$()),Reflect.defineProperty(v,I,b)}})}function T($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function TQ($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var kQ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},EQ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Kc($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let D=a4($._zod.def,{get shape(){let u={};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;u[w]=U.shape[w]}return Z6(this,"shape",u),u},checks:[]});return Av($,D)}function qc($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let D=a4($._zod.def,{get shape(){let u={...$._zod.def.shape};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;delete u[w]}return Z6(this,"shape",u),u},checks:[]});return Av($,D)}function Bc($,v){if(!T6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let D=$._zod.def.shape;for(let u in v)if(Object.getOwnPropertyDescriptor(D,u)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let b=a4($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return Z6(this,"shape",D),D}});return Av($,b)}function Ac($,v){if(!T6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=a4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return Z6(this,"shape",I),I}});return Av($,U)}function Pc($,v){if($._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let U=a4($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return Z6(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:v._zod.def.checks??[]});return Av($,U)}function jc($,v,U){let b=v._zod.def.checks;if(b&&b.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let u=a4(v._zod.def,{get shape(){let w=v._zod.def.shape,g={...w};if(U)for(let J in U){if(!(J in w))throw Error(`Unrecognized key: "${J}"`);if(!U[J])continue;g[J]=$?new $({type:"optional",innerType:w[J]}):w[J]}else for(let J in w)g[J]=$?new $({type:"optional",innerType:w[J]}):w[J];return Z6(this,"shape",g),g},checks:[]});return Av(v,u)}function Nc($,v,U){let I=a4(v._zod.def,{get shape(){let b=v._zod.def.shape,D={...b};if(U)for(let u in U){if(!(u in D))throw Error(`Unrecognized key: "${u}"`);if(!U[u])continue;D[u]=new $({type:"nonoptional",innerType:b[u]})}else for(let u in b)D[u]=new $({type:"nonoptional",innerType:b[u]});return Z6(this,"shape",D),D}});return Av(v,I)}function k6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function RQ($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue===!1)return!0;return!1}function Ev($,v){return v.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift($),U})}function x1($){return typeof $==="string"?$:$?.message}function Pv($,v,U){let I=$.message?$.message:x1($.inst?._zod.def?.error?.($))??x1(v?.error?.($))??x1(U.customError?.($))??x1(U.localeError?.($))??"Invalid input",{inst:b,continue:D,input:u,...w}=$;if(w.path??(w.path=[]),w.message=I,v?.reportInput)w.input=u;return w}function h1($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function m1($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function E($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function rU(...$){let[v,U,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:I};return{...v}}function Sc($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function GS($){let v=atob($),U=new Uint8Array(v.length);for(let I=0;I<v.length;I++)U[I]=v.charCodeAt(I);return U}function OS($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function Mc($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return GS(v+U)}function _c($){return OS($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Fc($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)U[I/2]=Number.parseInt(v.slice(I,I+2),16);return U}function Zc($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class HS{constructor(...$){}}var zS=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,RU,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},c1=L("$ZodError",zS),Rv=L("$ZodError",zS,{Parent:Error});function o1($,v=(U)=>U.message){let U={},I=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(v(b));else I.push(v(b));return{formErrors:I,fieldErrors:U}}function t1($,v=(U)=>U.message){let U={_errors:[]},I=(b,D=[])=>{for(let u of b.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map((w)=>I({issues:w},[...D,...u.path]));else if(u.code==="invalid_key")I({issues:u.issues},[...D,...u.path]);else if(u.code==="invalid_element")I({issues:u.issues},[...D,...u.path]);else{let w=[...D,...u.path];if(w.length===0)U._errors.push(v(u));else{let g=U,J=0;while(J<w.length){let X=w[J];if(J!==w.length-1)g[X]=g[X]||{_errors:[]};else g[X]=g[X]||{_errors:[]},g[X]._errors.push(v(u));g=g[X],J++}}}};return I($),U}function nQ($,v=(U)=>U.message){let U={errors:[]},I=(b,D=[])=>{var u,w;for(let g of b.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map((J)=>I({issues:J},[...D,...g.path]));else if(g.code==="invalid_key")I({issues:g.issues},[...D,...g.path]);else if(g.code==="invalid_element")I({issues:g.issues},[...D,...g.path]);else{let J=[...D,...g.path];if(J.length===0){U.errors.push(v(g));continue}let X=U,W=0;while(W<J.length){let G=J[W],O=W===J.length-1;if(typeof G==="string")X.properties??(X.properties={}),(u=X.properties)[G]??(u[G]={errors:[]}),X=X.properties[G];else X.items??(X.items=[]),(w=X.items)[G]??(w[G]={errors:[]}),X=X.items[G];if(O)X.errors.push(v(g));W++}}};return I($),U}function QS($){let v=[],U=$.map((I)=>typeof I==="object"?I.key:I);for(let I of U)if(typeof I==="number")v.push(`[${I}]`);else if(typeof I==="symbol")v.push(`[${JSON.stringify(String(I))}]`);else if(/[^\w$]/.test(I))v.push(`[${JSON.stringify(I)}]`);else{if(v.length)v.push(".");v.push(I)}return v.join("")}function rQ($){let v=[],U=[...$.issues].sort((I,b)=>(I.path??[]).length-(b.path??[]).length);for(let I of U)if(v.push(`\u2716 ${I.message}`),I.path?.length)v.push(` \u2192 at ${QS(I.path)}`);return v.join(`
243
243
  `)}var CU=($)=>(v,U,I,b)=>{let D=I?{...I,async:!1}:{async:!1},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)throw new Z4;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>Pv(g,D,o$())));throw Dg(w,b?.callee),w}return u.value},ug=CU(Rv),iU=($)=>async(v,U,I,b)=>{let D=I?{...I,async:!0}:{async:!0},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)u=await u;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>Pv(g,D,o$())));throw Dg(w,b?.callee),w}return u.value},wg=iU(Rv),xU=($)=>(v,U,I)=>{let b=I?{...I,async:!1}:{async:!1},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)throw new Z4;return D.issues.length?{success:!1,error:new($??c1)(D.issues.map((u)=>Pv(u,b,o$())))}:{success:!0,data:D.value}},CQ=xU(Rv),lU=($)=>async(v,U,I)=>{let b=I?{...I,async:!0}:{async:!0},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)D=await D;return D.issues.length?{success:!1,error:new $(D.issues.map((u)=>Pv(u,b,o$())))}:{success:!0,data:D.value}},iQ=lU(Rv),gg=($)=>(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return CU($)(v,U,b)},kc=gg(Rv),Jg=($)=>(v,U,I)=>{return CU($)(v,U,I)},Ec=Jg(Rv),Xg=($)=>async(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return iU($)(v,U,b)},Rc=Xg(Rv),Wg=($)=>async(v,U,I)=>{return iU($)(v,U,I)},nc=Wg(Rv),Gg=($)=>(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return xU($)(v,U,b)},rc=Gg(Rv),Og=($)=>(v,U,I)=>{return xU($)(v,U,I)},Cc=Og(Rv),Hg=($)=>async(v,U,I)=>{let b=I?{...I,direction:"backward"}:{direction:"backward"};return lU($)(v,U,b)},ic=Hg(Rv),zg=($)=>async(v,U,I)=>{return lU($)(v,U,I)},xc=zg(Rv);var cv={};e$(cv,{xid:()=>yQ,uuid7:()=>hc,uuid6:()=>yc,uuid4:()=>fc,uuid:()=>Zb,uppercase:()=>HY,unicodeEmail:()=>YS,undefined:()=>GY,ulid:()=>fQ,time:()=>DY,string:()=>wY,sha512_hex:()=>Wo,sha512_base64url:()=>Oo,sha512_base64:()=>Go,sha384_hex:()=>go,sha384_base64url:()=>Xo,sha384_base64:()=>Jo,sha256_hex:()=>Do,sha256_base64url:()=>wo,sha256_base64:()=>uo,sha1_hex:()=>bo,sha1_base64url:()=>Io,sha1_base64:()=>Uo,rfc5322Email:()=>cc,number:()=>d1,null:()=>WY,nanoid:()=>mQ,md5_hex:()=>sc,md5_base64url:()=>vo,md5_base64:()=>$o,mac:()=>eQ,lowercase:()=>OY,ksuid:()=>hQ,ipv6:()=>aQ,ipv4:()=>pQ,integer:()=>JY,idnEmail:()=>oc,httpProtocol:()=>bY,html5Email:()=>mc,hostname:()=>pc,hex:()=>ec,guid:()=>oQ,extendedDuration:()=>lc,emoji:()=>dQ,email:()=>tQ,e164:()=>UY,duration:()=>cQ,domain:()=>ac,datetime:()=>uY,date:()=>IY,cuid2:()=>lQ,cuid:()=>xQ,cidrv6:()=>$Y,cidrv4:()=>sQ,browserEmail:()=>tc,boolean:()=>XY,bigint:()=>gY,base64url:()=>Qg,base64:()=>vY});var xQ=/^[cC][0-9a-z]{6,}$/,lQ=/^[0-9a-z]+$/,fQ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yQ=/^[0-9a-vA-V]{20}$/,hQ=/^[A-Za-z0-9]{27}$/,mQ=/^[a-zA-Z0-9_-]{21}$/,cQ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lc=/^[-+]?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)?)??$/,oQ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zb=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},fc=Zb(4),yc=Zb(6),hc=Zb(7),tQ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,YS=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,oc=YS,tc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,dc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function dQ(){return new RegExp(dc,"u")}var pQ=/^(?:(?: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])$/,aQ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,eQ=($)=>{let v=sv($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},sQ=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,$Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,vY=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qg=/^[A-Za-z0-9_-]*$/,pc=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ac=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,bY=/^https?$/,UY=/^\+[1-9]\d{6,14}$/,VS="(?:(?:\\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])))",IY=new RegExp(`^${VS}$`);function LS($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function DY($){return new RegExp(`^${LS($)}$`)}function uY($){let v=LS({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let I=`${v}(?:${U.join("|")})`;return new RegExp(`^${VS}T(?:${I})$`)}var wY=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},gY=/^-?\d+n?$/,JY=/^-?\d+$/,d1=/^-?\d+(?:\.\d+)?$/,XY=/^(?:true|false)$/i,WY=/^null$/i;var GY=/^undefined$/i;var OY=/^[^A-Z]*$/,HY=/^[^a-z]*$/,ec=/^[0-9a-fA-F]*$/;function p1($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function a1($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var sc=/^[0-9a-fA-F]{32}$/,$o=p1(22,"=="),vo=a1(22),bo=/^[0-9a-fA-F]{40}$/,Uo=p1(27,"="),Io=a1(27),Do=/^[0-9a-fA-F]{64}$/,uo=p1(43,"="),wo=a1(43),go=/^[0-9a-fA-F]{96}$/,Jo=p1(64,""),Xo=a1(64),Wo=/^[0-9a-fA-F]{128}$/,Go=p1(86,"=="),Oo=a1(86);var Z$=L("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),qS={number:"number",bigint:"bigint",object:"date"},Yg=L("$ZodCheckLessThan",($,v)=>{Z$.init($,v);let U=qS[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.maximum:b.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<D)if(v.inclusive)b.maximum=v.value;else b.exclusiveMaximum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value<=v.value:I.value<v.value)return;I.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),Vg=L("$ZodCheckGreaterThan",($,v)=>{Z$.init($,v);let U=qS[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.minimum:b.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>D)if(v.inclusive)b.minimum=v.value;else b.exclusiveMinimum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value>=v.value:I.value>v.value)return;I.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),zY=L("$ZodCheckMultipleOf",($,v)=>{Z$.init($,v),$._zod.onattach.push((U)=>{var I;(I=U._zod.bag).multipleOf??(I.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):SQ(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),QY=L("$ZodCheckNumberFormat",($,v)=>{Z$.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),I=U?"int":"number",[b,D]=kQ[v.format];$._zod.onattach.push((u)=>{let w=u._zod.bag;if(w.format=v.format,w.minimum=b,w.maximum=D,U)w.pattern=JY}),$._zod.check=(u)=>{let w=u.value;if(U){if(!Number.isInteger(w)){u.issues.push({expected:I,format:v.format,code:"invalid_type",continue:!1,input:w,inst:$});return}if(!Number.isSafeInteger(w)){if(w>0)u.issues.push({input:w,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});else u.issues.push({input:w,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});return}}if(w<b)u.issues.push({origin:"number",input:w,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!v.abort});if(w>D)u.issues.push({origin:"number",input:w,code:"too_big",maximum:D,inclusive:!0,inst:$,continue:!v.abort})}}),YY=L("$ZodCheckBigIntFormat",($,v)=>{Z$.init($,v);let[U,I]=EQ[v.format];$._zod.onattach.push((b)=>{let D=b._zod.bag;D.format=v.format,D.minimum=U,D.maximum=I}),$._zod.check=(b)=>{let D=b.value;if(D<U)b.issues.push({origin:"bigint",input:D,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(D>I)b.issues.push({origin:"bigint",input:D,code:"too_big",maximum:I,inclusive:!0,inst:$,continue:!v.abort})}}),VY=L("$ZodCheckMaxSize",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<b)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let b=I.value;if(b.size<=v.maximum)return;I.issues.push({origin:h1(b),code:"too_big",maximum:v.maximum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),LY=L("$ZodCheckMinSize",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>b)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let b=I.value;if(b.size>=v.minimum)return;I.issues.push({origin:h1(b),code:"too_small",minimum:v.minimum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),KY=L("$ZodCheckSizeEquals",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.size!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.minimum=v.size,b.maximum=v.size,b.size=v.size}),$._zod.check=(I)=>{let b=I.value,D=b.size;if(D===v.size)return;let u=D>v.size;I.issues.push({origin:h1(b),...u?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),qY=L("$ZodCheckMaxLength",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<b)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let b=I.value;if(b.length<=v.maximum)return;let u=m1(b);I.issues.push({origin:u,code:"too_big",maximum:v.maximum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),BY=L("$ZodCheckMinLength",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>b)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let b=I.value;if(b.length>=v.minimum)return;let u=m1(b);I.issues.push({origin:u,code:"too_small",minimum:v.minimum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),AY=L("$ZodCheckLengthEquals",($,v)=>{var U;Z$.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!F6(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.minimum=v.length,b.maximum=v.length,b.length=v.length}),$._zod.check=(I)=>{let b=I.value,D=b.length;if(D===v.length)return;let u=m1(b),w=D>v.length;I.issues.push({origin:u,...w?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),fU=L("$ZodCheckStringFormat",($,v)=>{var U,I;if(Z$.init($,v),$._zod.onattach.push((b)=>{let D=b._zod.bag;if(D.format=v.format,v.pattern)D.patterns??(D.patterns=new Set),D.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(b)=>{if(v.pattern.lastIndex=0,v.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:v.format,input:b.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(I=$._zod).check??(I.check=()=>{})}),PY=L("$ZodCheckRegex",($,v)=>{fU.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),jY=L("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=OY),fU.init($,v)}),NY=L("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=HY),fU.init($,v)}),SY=L("$ZodCheckIncludes",($,v)=>{Z$.init($,v);let U=sv(v.includes),I=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=I,$._zod.onattach.push((b)=>{let D=b._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(I)}),$._zod.check=(b)=>{if(b.value.includes(v.includes,v.position))return;b.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:b.value,inst:$,continue:!v.abort})}}),MY=L("$ZodCheckStartsWith",($,v)=>{Z$.init($,v);let U=new RegExp(`^${sv(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.startsWith(v.prefix))return;I.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:I.value,inst:$,continue:!v.abort})}}),_Y=L("$ZodCheckEndsWith",($,v)=>{Z$.init($,v);let U=new RegExp(`.*${sv(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.endsWith(v.suffix))return;I.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:I.value,inst:$,continue:!v.abort})}});function KS($,v,U){if($.issues.length)v.issues.push(...Ev(U,$.issues))}var FY=L("$ZodCheckProperty",($,v)=>{Z$.init($,v),$._zod.check=(U)=>{let I=v.schema._zod.run({value:U.value[v.property],issues:[]},{});if(I instanceof Promise)return I.then((b)=>KS(b,U,v.property));KS(I,U,v.property);return}}),ZY=L("$ZodCheckMimeType",($,v)=>{Z$.init($,v);let U=new Set(v.mime);$._zod.onattach.push((I)=>{I._zod.bag.mime=v.mime}),$._zod.check=(I)=>{if(U.has(I.value.type))return;I.issues.push({code:"invalid_value",values:v.mime,input:I.value.type,inst:$,continue:!v.abort})}}),TY=L("$ZodCheckOverwrite",($,v)=>{Z$.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}});class Lg{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`
244
244
  `).filter((D)=>D),I=Math.min(...U.map((D)=>D.length-D.trimStart().length)),b=U.map((D)=>D.slice(I)).map((D)=>" ".repeat(this.indent*2)+D);for(let D of b)this.content.push(D)}compile(){let $=Function,v=this?.args,I=[...(this?.content??[""]).map((b)=>` ${b}`)];return new $(...v,I.join(`
245
245
  `))}}var kY={major:4,minor:4,patch:3};var v$=L("$ZodType",($,v)=>{var U;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=kY;let I=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))I.unshift($);for(let b of I)for(let D of b._zod.onattach)D($);if(I.length===0)(U=$._zod).deferred??(U.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let b=(u,w,g)=>{let J=k6(u),X;for(let W of w){if(W._zod.def.when){if(RQ(u))continue;if(!W._zod.def.when(u))continue}else if(J)continue;let G=u.issues.length,O=W._zod.check(u);if(O instanceof Promise&&g?.async===!1)throw new Z4;if(X||O instanceof Promise)X=(X??Promise.resolve()).then(async()=>{if(await O,u.issues.length===G)return;if(!J)J=k6(u,G)});else{if(u.issues.length===G)continue;if(!J)J=k6(u,G)}}if(X)return X.then(()=>{return u});return u},D=(u,w,g)=>{if(k6(u))return u.aborted=!0,u;let J=b(w,I,g);if(J instanceof Promise){if(g.async===!1)throw new Z4;return J.then((X)=>$._zod.parse(X,g))}return $._zod.parse(J,g)};$._zod.run=(u,w)=>{if(w.skipChecks)return $._zod.parse(u,w);if(w.direction==="backward"){let J=$._zod.parse({value:u.value,issues:[]},{...w,skipChecks:!0});if(J instanceof Promise)return J.then((X)=>{return D(X,u,w)});return D(J,u,w)}let g=$._zod.parse(u,w);if(g instanceof Promise){if(w.async===!1)throw new Z4;return g.then((J)=>b(J,I,w))}return b(g,I,w)}}J$($,"~standard",()=>({validate:(b)=>{try{let D=CQ($,b);return D.success?{value:D.data}:{issues:D.error?.issues}}catch(D){return iQ($,b).then((u)=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),Tb=L("$ZodString",($,v)=>{v$.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??wY($._zod.bag),$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=String(U.value)}catch(b){}if(typeof U.value==="string")return U;return U.issues.push({expected:"string",code:"invalid_type",input:U.value,inst:$}),U}}),N$=L("$ZodStringFormat",($,v)=>{fU.init($,v),Tb.init($,v)}),RY=L("$ZodGUID",($,v)=>{v.pattern??(v.pattern=oQ),N$.init($,v)}),nY=L("$ZodUUID",($,v)=>{if(v.version){let I={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(I===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=Zb(I))}else v.pattern??(v.pattern=Zb());N$.init($,v)}),rY=L("$ZodEmail",($,v)=>{v.pattern??(v.pattern=tQ),N$.init($,v)}),CY=L("$ZodURL",($,v)=>{N$.init($,v),$._zod.check=(U)=>{try{let I=U.value.trim();if(!v.normalize&&v.protocol?.source===bY.source){if(!/^https?:\/\//i.test(I)){U.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:U.value,inst:$,continue:!v.abort});return}}let b=new URL(I);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(b.hostname))U.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:U.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(b.protocol.endsWith(":")?b.protocol.slice(0,-1):b.protocol))U.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:U.value,inst:$,continue:!v.abort})}if(v.normalize)U.value=b.href;else U.value=I;return}catch(I){U.issues.push({code:"invalid_format",format:"url",input:U.value,inst:$,continue:!v.abort})}}}),iY=L("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=dQ()),N$.init($,v)}),xY=L("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=mQ),N$.init($,v)}),lY=L("$ZodCUID",($,v)=>{v.pattern??(v.pattern=xQ),N$.init($,v)}),fY=L("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=lQ),N$.init($,v)}),yY=L("$ZodULID",($,v)=>{v.pattern??(v.pattern=fQ),N$.init($,v)}),hY=L("$ZodXID",($,v)=>{v.pattern??(v.pattern=yQ),N$.init($,v)}),mY=L("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=hQ),N$.init($,v)}),cY=L("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=uY(v)),N$.init($,v)}),oY=L("$ZodISODate",($,v)=>{v.pattern??(v.pattern=IY),N$.init($,v)}),tY=L("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=DY(v)),N$.init($,v)}),dY=L("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=cQ),N$.init($,v)}),pY=L("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=pQ),N$.init($,v),$._zod.bag.format="ipv4"}),aY=L("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=aQ),N$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(U)=>{try{new URL(`http://[${U.value}]`)}catch{U.issues.push({code:"invalid_format",format:"ipv6",input:U.value,inst:$,continue:!v.abort})}}}),eY=L("$ZodMAC",($,v)=>{v.pattern??(v.pattern=eQ(v.delimiter)),N$.init($,v),$._zod.bag.format="mac"}),sY=L("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=sQ),N$.init($,v)}),$5=L("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=$Y),N$.init($,v),$._zod.check=(U)=>{let I=U.value.split("/");try{if(I.length!==2)throw Error();let[b,D]=I;if(!D)throw Error();let u=Number(D);if(`${u}`!==D)throw Error();if(u<0||u>128)throw Error();new URL(`http://[${b}]`)}catch{U.issues.push({code:"invalid_format",format:"cidrv6",input:U.value,inst:$,continue:!v.abort})}}});function v5($){if($==="")return!0;if(/\s/.test($))return!1;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var b5=L("$ZodBase64",($,v)=>{v.pattern??(v.pattern=vY),N$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(U)=>{if(v5(U.value))return;U.issues.push({code:"invalid_format",format:"base64",input:U.value,inst:$,continue:!v.abort})}});function rS($){if(!Qg.test($))return!1;let v=$.replace(/[-_]/g,(I)=>I==="-"?"+":"/"),U=v.padEnd(Math.ceil(v.length/4)*4,"=");return v5(U)}var U5=L("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=Qg),N$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(U)=>{if(rS(U.value))return;U.issues.push({code:"invalid_format",format:"base64url",input:U.value,inst:$,continue:!v.abort})}}),I5=L("$ZodE164",($,v)=>{v.pattern??(v.pattern=UY),N$.init($,v)});function CS($,v=null){try{let U=$.split(".");if(U.length!==3)return!1;let[I]=U;if(!I)return!1;let b=JSON.parse(atob(I));if("typ"in b&&b?.typ!=="JWT")return!1;if(!b.alg)return!1;if(v&&(!("alg"in b)||b.alg!==v))return!1;return!0}catch{return!1}}var D5=L("$ZodJWT",($,v)=>{N$.init($,v),$._zod.check=(U)=>{if(CS(U.value,v.alg))return;U.issues.push({code:"invalid_format",format:"jwt",input:U.value,inst:$,continue:!v.abort})}}),u5=L("$ZodCustomStringFormat",($,v)=>{N$.init($,v),$._zod.check=(U)=>{if(v.fn(U.value))return;U.issues.push({code:"invalid_format",format:v.format,input:U.value,inst:$,continue:!v.abort})}}),Pg=L("$ZodNumber",($,v)=>{v$.init($,v),$._zod.pattern=$._zod.bag.pattern??d1,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=Number(U.value)}catch(u){}let b=U.value;if(typeof b==="number"&&!Number.isNaN(b)&&Number.isFinite(b))return U;let D=typeof b==="number"?Number.isNaN(b)?"NaN":!Number.isFinite(b)?"Infinity":void 0:void 0;return U.issues.push({expected:"number",code:"invalid_type",input:b,inst:$,...D?{received:D}:{}}),U}}),w5=L("$ZodNumberFormat",($,v)=>{QY.init($,v),Pg.init($,v)}),e1=L("$ZodBoolean",($,v)=>{v$.init($,v),$._zod.pattern=XY,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=Boolean(U.value)}catch(D){}let b=U.value;if(typeof b==="boolean")return U;return U.issues.push({expected:"boolean",code:"invalid_type",input:b,inst:$}),U}}),jg=L("$ZodBigInt",($,v)=>{v$.init($,v),$._zod.pattern=gY,$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=BigInt(U.value)}catch(b){}if(typeof U.value==="bigint")return U;return U.issues.push({expected:"bigint",code:"invalid_type",input:U.value,inst:$}),U}}),g5=L("$ZodBigIntFormat",($,v)=>{YY.init($,v),jg.init($,v)}),J5=L("$ZodSymbol",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b==="symbol")return U;return U.issues.push({expected:"symbol",code:"invalid_type",input:b,inst:$}),U}}),X5=L("$ZodUndefined",($,v)=>{v$.init($,v),$._zod.pattern=GY,$._zod.values=new Set([void 0]),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b>"u")return U;return U.issues.push({expected:"undefined",code:"invalid_type",input:b,inst:$}),U}}),W5=L("$ZodNull",($,v)=>{v$.init($,v),$._zod.pattern=WY,$._zod.values=new Set([null]),$._zod.parse=(U,I)=>{let b=U.value;if(b===null)return U;return U.issues.push({expected:"null",code:"invalid_type",input:b,inst:$}),U}}),G5=L("$ZodAny",($,v)=>{v$.init($,v),$._zod.parse=(U)=>U}),O5=L("$ZodUnknown",($,v)=>{v$.init($,v),$._zod.parse=(U)=>U}),H5=L("$ZodNever",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{return U.issues.push({expected:"never",code:"invalid_type",input:U.value,inst:$}),U}}),z5=L("$ZodVoid",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(typeof b>"u")return U;return U.issues.push({expected:"void",code:"invalid_type",input:b,inst:$}),U}}),Q5=L("$ZodDate",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{if(v.coerce)try{U.value=new Date(U.value)}catch(w){}let b=U.value,D=b instanceof Date;if(D&&!Number.isNaN(b.getTime()))return U;return U.issues.push({expected:"date",code:"invalid_type",input:b,...D?{received:"Invalid Date"}:{},inst:$}),U}});function AS($,v,U){if($.issues.length)v.issues.push(...Ev(U,$.issues));v.value[U]=$.value}var Y5=L("$ZodArray",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(!Array.isArray(b))return U.issues.push({expected:"array",code:"invalid_type",input:b,inst:$}),U;U.value=Array(b.length);let D=[];for(let u=0;u<b.length;u++){let w=b[u],g=v.element._zod.run({value:w,issues:[]},I);if(g instanceof Promise)D.push(g.then((J)=>AS(J,U,u)));else AS(g,U,u)}if(D.length)return Promise.all(D).then(()=>U);return U}});function Ag($,v,U,I,b,D){let u=U in I;if($.issues.length){if(b&&D&&!u)return;v.issues.push(...Ev(U,$.issues))}if(!u&&!b){if(!$.issues.length)v.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[U]});return}if($.value===void 0){if(u)v.value[U]=void 0}else v.value[U]=$.value}function iS($){let v=Object.keys($.shape);for(let I of v)if(!$.shape?.[I]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${I}": expected a Zod schema`);let U=TQ($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(U)}}function xS($,v,U,I,b,D){let u=[],w=b.keySet,g=b.catchall._zod,J=g.def.type,X=g.optin==="optional",W=g.optout==="optional";for(let G in v){if(G==="__proto__")continue;if(w.has(G))continue;if(J==="never"){u.push(G);continue}let O=g.run({value:v[G],issues:[]},I);if(O instanceof Promise)$.push(O.then((z)=>Ag(z,U,G,v,X,W)));else Ag(O,U,G,v,X,W)}if(u.length)U.issues.push({code:"unrecognized_keys",keys:u,input:v,inst:D});if(!$.length)return U;return Promise.all($).then(()=>{return U})}var lS=L("$ZodObject",($,v)=>{if(v$.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let w=v.shape;Object.defineProperty(v,"shape",{get:()=>{let g={...w};return Object.defineProperty(v,"shape",{value:g}),g}})}let I=nU(()=>iS(v));J$($._zod,"propValues",()=>{let w=v.shape,g={};for(let J in w){let X=w[J]._zod;if(X.values){g[J]??(g[J]=new Set);for(let W of X.values)g[J].add(W)}}return g});let b=Fb,D=v.catchall,u;$._zod.parse=(w,g)=>{u??(u=I.value);let J=w.value;if(!b(J))return w.issues.push({expected:"object",code:"invalid_type",input:J,inst:$}),w;w.value={};let X=[],W=u.shape;for(let G of u.keys){let O=W[G],z=O._zod.optin==="optional",Q=O._zod.optout==="optional",Y=O._zod.run({value:J[G],issues:[]},g);if(Y instanceof Promise)X.push(Y.then((K)=>Ag(K,w,G,J,z,Q)));else Ag(Y,w,G,J,z,Q)}if(!D)return X.length?Promise.all(X).then(()=>w):w;return xS(X,J,w,g,I.value,$)}}),V5=L("$ZodObjectJIT",($,v)=>{lS.init($,v);let U=$._zod.parse,I=nU(()=>iS(v)),b=(G)=>{let O=new Lg(["shape","payload","ctx"]),z=I.value,Q=(S)=>{let j=Ig(S);return`shape[${j}]._zod.run({ value: input[${j}], issues: [] }, ctx)`};O.write("const input = payload.value;");let Y=Object.create(null),K=0;for(let S of z.keys)Y[S]=`key_${K++}`;O.write("const newResult = {};");for(let S of z.keys){let j=Y[S],A=Ig(S),h=G[S],s=h?._zod?.optin==="optional",l=h?._zod?.optout==="optional";if(O.write(`const ${j} = ${Q(S)};`),s&&l)O.write(`
@@ -303,9 +303,9 @@ programmable: funnel.claude.launch({ profileId | channelId, options, env, resume
303
303
 
304
304
  `)}O.write("payload.value = newResult;"),O.write("return payload;");let F=O.compile();return(S,j)=>F(G,S,j)},D,u=Fb,w=!Mb.jitless,J=w&&_Q.value,X=v.catchall,W;$._zod.parse=(G,O)=>{W??(W=I.value);let z=G.value;if(!u(z))return G.issues.push({expected:"object",code:"invalid_type",input:z,inst:$}),G;if(w&&J&&O?.async===!1&&O.jitless!==!0){if(!D)D=b(v.shape);if(G=D(G,O),!X)return G;return xS([],z,G,O,W,$)}return U(G,O)}});function PS($,v,U,I){for(let D of $)if(D.issues.length===0)return v.value=D.value,v;let b=$.filter((D)=>!k6(D));if(b.length===1)return v.value=b[0].value,b[0];return v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((D)=>D.issues.map((u)=>Pv(u,I,o$())))}),v}var s1=L("$ZodUnion",($,v)=>{v$.init($,v),J$($._zod,"optin",()=>v.options.some((I)=>I._zod.optin==="optional")?"optional":void 0),J$($._zod,"optout",()=>v.options.some((I)=>I._zod.optout==="optional")?"optional":void 0),J$($._zod,"values",()=>{if(v.options.every((I)=>I._zod.values))return new Set(v.options.flatMap((I)=>Array.from(I._zod.values)));return}),J$($._zod,"pattern",()=>{if(v.options.every((I)=>I._zod.pattern)){let I=v.options.map((b)=>b._zod.pattern);return new RegExp(`^(${I.map((b)=>f1(b.source)).join("|")})$`)}return});let U=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(I,b)=>{if(U)return U(I,b);let D=!1,u=[];for(let w of v.options){let g=w._zod.run({value:I.value,issues:[]},b);if(g instanceof Promise)u.push(g),D=!0;else{if(g.issues.length===0)return g;u.push(g)}}if(!D)return PS(u,I,$,b);return Promise.all(u).then((w)=>{return PS(w,I,$,b)})}});function jS($,v,U,I){let b=$.filter((D)=>D.issues.length===0);if(b.length===1)return v.value=b[0].value,v;if(b.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:$.map((D)=>D.issues.map((u)=>Pv(u,I,o$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:U,errors:[],inclusive:!1});return v}var L5=L("$ZodXor",($,v)=>{s1.init($,v),v.inclusive=!1;let U=v.options.length===1?v.options[0]._zod.run:null;$._zod.parse=(I,b)=>{if(U)return U(I,b);let D=!1,u=[];for(let w of v.options){let g=w._zod.run({value:I.value,issues:[]},b);if(g instanceof Promise)u.push(g),D=!0;else u.push(g)}if(!D)return jS(u,I,$,b);return Promise.all(u).then((w)=>{return jS(w,I,$,b)})}}),K5=L("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,s1.init($,v);let U=$._zod.parse;J$($._zod,"propValues",()=>{let b={};for(let D of v.options){let u=D._zod.propValues;if(!u||Object.keys(u).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(D)}"`);for(let[w,g]of Object.entries(u)){if(!b[w])b[w]=new Set;for(let J of g)b[w].add(J)}}return b});let I=nU(()=>{let b=v.options,D=new Map;for(let u of b){let w=u._zod.propValues?.[v.discriminator];if(!w||w.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(u)}"`);for(let g of w){if(D.has(g))throw Error(`Duplicate discriminator value "${String(g)}"`);D.set(g,u)}}return D});$._zod.parse=(b,D)=>{let u=b.value;if(!Fb(u))return b.issues.push({code:"invalid_type",expected:"object",input:u,inst:$}),b;let w=I.value.get(u?.[v.discriminator]);if(w)return w._zod.run(b,D);if(v.unionFallback||D.direction==="backward")return U(b,D);return b.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,options:Array.from(I.value.keys()),input:u,path:[v.discriminator],inst:$}),b}}),q5=L("$ZodIntersection",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value,D=v.left._zod.run({value:b,issues:[]},I),u=v.right._zod.run({value:b,issues:[]},I);if(D instanceof Promise||u instanceof Promise)return Promise.all([D,u]).then(([g,J])=>{return NS(U,g,J)});return NS(U,D,u)}});function EY($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(T6($)&&T6(v)){let U=Object.keys(v),I=Object.keys($).filter((D)=>U.indexOf(D)!==-1),b={...$,...v};for(let D of I){let u=EY($[D],v[D]);if(!u.valid)return{valid:!1,mergeErrorPath:[D,...u.mergeErrorPath]};b[D]=u.data}return{valid:!0,data:b}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let U=[];for(let I=0;I<$.length;I++){let b=$[I],D=v[I],u=EY(b,D);if(!u.valid)return{valid:!1,mergeErrorPath:[I,...u.mergeErrorPath]};U.push(u.data)}return{valid:!0,data:U}}return{valid:!1,mergeErrorPath:[]}}function NS($,v,U){let I=new Map,b;for(let w of v.issues)if(w.code==="unrecognized_keys"){b??(b=w);for(let g of w.keys){if(!I.has(g))I.set(g,{});I.get(g).l=!0}}else $.issues.push(w);for(let w of U.issues)if(w.code==="unrecognized_keys")for(let g of w.keys){if(!I.has(g))I.set(g,{});I.get(g).r=!0}else $.issues.push(w);let D=[...I].filter(([,w])=>w.l&&w.r).map(([w])=>w);if(D.length&&b)$.issues.push({...b,keys:D});if(k6($))return $;let u=EY(v.value,U.value);if(!u.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return $.value=u.data,$}var Ng=L("$ZodTuple",($,v)=>{v$.init($,v);let U=v.items;$._zod.parse=(I,b)=>{let D=I.value;if(!Array.isArray(D))return I.issues.push({input:D,inst:$,expected:"tuple",code:"invalid_type"}),I;I.value=[];let u=[],w=SS(U,"optin"),g=SS(U,"optout");if(!v.rest){if(D.length<w)return I.issues.push({code:"too_small",minimum:w,inclusive:!0,input:D,inst:$,origin:"array"}),I;if(D.length>U.length)I.issues.push({code:"too_big",maximum:U.length,inclusive:!0,input:D,inst:$,origin:"array"})}let J=Array(U.length);for(let X=0;X<U.length;X++){let W=U[X]._zod.run({value:D[X],issues:[]},b);if(W instanceof Promise)u.push(W.then((G)=>{J[X]=G}));else J[X]=W}if(v.rest){let X=U.length-1,W=D.slice(U.length);for(let G of W){X++;let O=v.rest._zod.run({value:G,issues:[]},b);if(O instanceof Promise)u.push(O.then((z)=>MS(z,I,X)));else MS(O,I,X)}}if(u.length)return Promise.all(u).then(()=>_S(J,I,U,D,g));return _S(J,I,U,D,g)}});function SS($,v){for(let U=$.length-1;U>=0;U--)if($[U]._zod[v]!=="optional")return U+1;return 0}function MS($,v,U){if($.issues.length)v.issues.push(...Ev(U,$.issues));v.value[U]=$.value}function _S($,v,U,I,b){for(let D=0;D<U.length;D++){let u=$[D],w=D<I.length;if(u.issues.length){if(!w&&D>=b){v.value.length=D;break}v.issues.push(...Ev(D,u.issues))}v.value[D]=u.value}for(let D=v.value.length-1;D>=I.length;D--)if(U[D]._zod.optout==="optional"&&v.value[D]===void 0)v.value.length=D;else break;return v}var B5=L("$ZodRecord",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(!T6(b))return U.issues.push({expected:"record",code:"invalid_type",input:b,inst:$}),U;let D=[],u=v.keyType._zod.values;if(u){U.value={};let w=new Set;for(let J of u)if(typeof J==="string"||typeof J==="number"||typeof J==="symbol"){w.add(typeof J==="number"?J.toString():J);let X=v.keyType._zod.run({value:J,issues:[]},I);if(X instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(X.issues.length){U.issues.push({code:"invalid_key",origin:"record",issues:X.issues.map((O)=>Pv(O,I,o$())),input:J,path:[J],inst:$});continue}let W=X.value,G=v.valueType._zod.run({value:b[J],issues:[]},I);if(G instanceof Promise)D.push(G.then((O)=>{if(O.issues.length)U.issues.push(...Ev(J,O.issues));U.value[W]=O.value}));else{if(G.issues.length)U.issues.push(...Ev(J,G.issues));U.value[W]=G.value}}let g;for(let J in b)if(!w.has(J))g=g??[],g.push(J);if(g&&g.length>0)U.issues.push({code:"unrecognized_keys",input:b,inst:$,keys:g})}else{U.value={};for(let w of Reflect.ownKeys(b)){if(w==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(b,w))continue;let g=v.keyType._zod.run({value:w,issues:[]},I);if(g instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof w==="string"&&d1.test(w)&&g.issues.length){let W=v.keyType._zod.run({value:Number(w),issues:[]},I);if(W instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(W.issues.length===0)g=W}if(g.issues.length){if(v.mode==="loose")U.value[w]=b[w];else U.issues.push({code:"invalid_key",origin:"record",issues:g.issues.map((W)=>Pv(W,I,o$())),input:w,path:[w],inst:$});continue}let X=v.valueType._zod.run({value:b[w],issues:[]},I);if(X instanceof Promise)D.push(X.then((W)=>{if(W.issues.length)U.issues.push(...Ev(w,W.issues));U.value[g.value]=W.value}));else{if(X.issues.length)U.issues.push(...Ev(w,X.issues));U.value[g.value]=X.value}}}if(D.length)return Promise.all(D).then(()=>U);return U}}),A5=L("$ZodMap",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(!(b instanceof Map))return U.issues.push({expected:"map",code:"invalid_type",input:b,inst:$}),U;let D=[];U.value=new Map;for(let[u,w]of b){let g=v.keyType._zod.run({value:u,issues:[]},I),J=v.valueType._zod.run({value:w,issues:[]},I);if(g instanceof Promise||J instanceof Promise)D.push(Promise.all([g,J]).then(([X,W])=>{FS(X,W,U,u,b,$,I)}));else FS(g,J,U,u,b,$,I)}if(D.length)return Promise.all(D).then(()=>U);return U}});function FS($,v,U,I,b,D,u){if($.issues.length)if(y1.has(typeof I))U.issues.push(...Ev(I,$.issues));else U.issues.push({code:"invalid_key",origin:"map",input:b,inst:D,issues:$.issues.map((w)=>Pv(w,u,o$()))});if(v.issues.length)if(y1.has(typeof I))U.issues.push(...Ev(I,v.issues));else U.issues.push({origin:"map",code:"invalid_element",input:b,inst:D,key:I,issues:v.issues.map((w)=>Pv(w,u,o$()))});U.value.set($.value,v.value)}var P5=L("$ZodSet",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(!(b instanceof Set))return U.issues.push({input:b,inst:$,expected:"set",code:"invalid_type"}),U;let D=[];U.value=new Set;for(let u of b){let w=v.valueType._zod.run({value:u,issues:[]},I);if(w instanceof Promise)D.push(w.then((g)=>ZS(g,U)));else ZS(w,U)}if(D.length)return Promise.all(D).then(()=>U);return U}});function ZS($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var j5=L("$ZodEnum",($,v)=>{v$.init($,v);let U=l1(v.entries),I=new Set(U);$._zod.values=I,$._zod.pattern=new RegExp(`^(${U.filter((b)=>y1.has(typeof b)).map((b)=>typeof b==="string"?sv(b):b.toString()).join("|")})$`),$._zod.parse=(b,D)=>{let u=b.value;if(I.has(u))return b;return b.issues.push({code:"invalid_value",values:U,input:u,inst:$}),b}}),N5=L("$ZodLiteral",($,v)=>{if(v$.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let U=new Set(v.values);$._zod.values=U,$._zod.pattern=new RegExp(`^(${v.values.map((I)=>typeof I==="string"?sv(I):I?sv(I.toString()):String(I)).join("|")})$`),$._zod.parse=(I,b)=>{let D=I.value;if(U.has(D))return I;return I.issues.push({code:"invalid_value",values:v.values,input:D,inst:$}),I}}),S5=L("$ZodFile",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{let b=U.value;if(b instanceof File)return U;return U.issues.push({expected:"file",code:"invalid_type",input:b,inst:$}),U}}),M5=L("$ZodTransform",($,v)=>{v$.init($,v),$._zod.optin="optional",$._zod.parse=(U,I)=>{if(I.direction==="backward")throw new _b($.constructor.name);let b=v.transform(U.value,U);if(I.async)return(b instanceof Promise?b:Promise.resolve(b)).then((u)=>{return U.value=u,U.fallback=!0,U});if(b instanceof Promise)throw new Z4;return U.value=b,U.fallback=!0,U}});function TS($,v){if(v===void 0&&($.issues.length||$.fallback))return{issues:[],value:void 0};return $}var Sg=L("$ZodOptional",($,v)=>{v$.init($,v),$._zod.optin="optional",$._zod.optout="optional",J$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),J$($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${f1(U.source)})?$`):void 0}),$._zod.parse=(U,I)=>{if(v.innerType._zod.optin==="optional"){let b=U.value,D=v.innerType._zod.run(U,I);if(D instanceof Promise)return D.then((u)=>TS(u,b));return TS(D,b)}if(U.value===void 0)return U;return v.innerType._zod.run(U,I)}}),_5=L("$ZodExactOptional",($,v)=>{Sg.init($,v),J$($._zod,"values",()=>v.innerType._zod.values),J$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(U,I)=>{return v.innerType._zod.run(U,I)}}),F5=L("$ZodNullable",($,v)=>{v$.init($,v),J$($._zod,"optin",()=>v.innerType._zod.optin),J$($._zod,"optout",()=>v.innerType._zod.optout),J$($._zod,"pattern",()=>{let U=v.innerType._zod.pattern;return U?new RegExp(`^(${f1(U.source)}|null)$`):void 0}),J$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(U,I)=>{if(U.value===null)return U;return v.innerType._zod.run(U,I)}}),Z5=L("$ZodDefault",($,v)=>{v$.init($,v),$._zod.optin="optional",J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,I)=>{if(I.direction==="backward")return v.innerType._zod.run(U,I);if(U.value===void 0)return U.value=v.defaultValue,U;let b=v.innerType._zod.run(U,I);if(b instanceof Promise)return b.then((D)=>kS(D,v));return kS(b,v)}});function kS($,v){if($.value===void 0)$.value=v.defaultValue;return $}var T5=L("$ZodPrefault",($,v)=>{v$.init($,v),$._zod.optin="optional",J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,I)=>{if(I.direction==="backward")return v.innerType._zod.run(U,I);if(U.value===void 0)U.value=v.defaultValue;return v.innerType._zod.run(U,I)}}),k5=L("$ZodNonOptional",($,v)=>{v$.init($,v),J$($._zod,"values",()=>{let U=v.innerType._zod.values;return U?new Set([...U].filter((I)=>I!==void 0)):void 0}),$._zod.parse=(U,I)=>{let b=v.innerType._zod.run(U,I);if(b instanceof Promise)return b.then((D)=>ES(D,$));return ES(b,$)}});function ES($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var E5=L("$ZodSuccess",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{if(I.direction==="backward")throw new _b("ZodSuccess");let b=v.innerType._zod.run(U,I);if(b instanceof Promise)return b.then((D)=>{return U.value=D.issues.length===0,U});return U.value=b.issues.length===0,U}}),R5=L("$ZodCatch",($,v)=>{v$.init($,v),$._zod.optin="optional",J$($._zod,"optout",()=>v.innerType._zod.optout),J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(U,I)=>{if(I.direction==="backward")return v.innerType._zod.run(U,I);let b=v.innerType._zod.run(U,I);if(b instanceof Promise)return b.then((D)=>{if(U.value=D.value,D.issues.length)U.value=v.catchValue({...U,error:{issues:D.issues.map((u)=>Pv(u,I,o$()))},input:U.value}),U.issues=[],U.fallback=!0;return U});if(U.value=b.value,b.issues.length)U.value=v.catchValue({...U,error:{issues:b.issues.map((D)=>Pv(D,I,o$()))},input:U.value}),U.issues=[],U.fallback=!0;return U}}),n5=L("$ZodNaN",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{if(typeof U.value!=="number"||!Number.isNaN(U.value))return U.issues.push({input:U.value,inst:$,expected:"nan",code:"invalid_type"}),U;return U}}),Mg=L("$ZodPipe",($,v)=>{v$.init($,v),J$($._zod,"values",()=>v.in._zod.values),J$($._zod,"optin",()=>v.in._zod.optin),J$($._zod,"optout",()=>v.out._zod.optout),J$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,I)=>{if(I.direction==="backward"){let D=v.out._zod.run(U,I);if(D instanceof Promise)return D.then((u)=>Kg(u,v.in,I));return Kg(D,v.in,I)}let b=v.in._zod.run(U,I);if(b instanceof Promise)return b.then((D)=>Kg(D,v.out,I));return Kg(b,v.out,I)}});function Kg($,v,U){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},U)}var $0=L("$ZodCodec",($,v)=>{v$.init($,v),J$($._zod,"values",()=>v.in._zod.values),J$($._zod,"optin",()=>v.in._zod.optin),J$($._zod,"optout",()=>v.out._zod.optout),J$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(U,I)=>{if((I.direction||"forward")==="forward"){let D=v.in._zod.run(U,I);if(D instanceof Promise)return D.then((u)=>qg(u,v,I));return qg(D,v,I)}else{let D=v.out._zod.run(U,I);if(D instanceof Promise)return D.then((u)=>qg(u,v,I));return qg(D,v,I)}}});function qg($,v,U){if($.issues.length)return $.aborted=!0,$;if((U.direction||"forward")==="forward"){let b=v.transform($.value,$);if(b instanceof Promise)return b.then((D)=>Bg($,D,v.out,U));return Bg($,b,v.out,U)}else{let b=v.reverseTransform($.value,$);if(b instanceof Promise)return b.then((D)=>Bg($,D,v.in,U));return Bg($,b,v.in,U)}}function Bg($,v,U,I){if($.issues.length)return $.aborted=!0,$;return U._zod.run({value:v,issues:$.issues},I)}var r5=L("$ZodPreprocess",($,v)=>{Mg.init($,v)}),C5=L("$ZodReadonly",($,v)=>{v$.init($,v),J$($._zod,"propValues",()=>v.innerType._zod.propValues),J$($._zod,"values",()=>v.innerType._zod.values),J$($._zod,"optin",()=>v.innerType?._zod?.optin),J$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(U,I)=>{if(I.direction==="backward")return v.innerType._zod.run(U,I);let b=v.innerType._zod.run(U,I);if(b instanceof Promise)return b.then(RS);return RS(b)}});function RS($){return $.value=Object.freeze($.value),$}var i5=L("$ZodTemplateLiteral",($,v)=>{v$.init($,v);let U=[];for(let I of v.parts)if(typeof I==="object"&&I!==null){if(!I._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...I._zod.traits].shift()}`);let b=I._zod.pattern instanceof RegExp?I._zod.pattern.source:I._zod.pattern;if(!b)throw Error(`Invalid template literal part: ${I._zod.traits}`);let D=b.startsWith("^")?1:0,u=b.endsWith("$")?b.length-1:b.length;U.push(b.slice(D,u))}else if(I===null||ZQ.has(typeof I))U.push(sv(`${I}`));else throw Error(`Invalid template literal part: ${I}`);$._zod.pattern=new RegExp(`^${U.join("")}$`),$._zod.parse=(I,b)=>{if(typeof I.value!=="string")return I.issues.push({input:I.value,inst:$,expected:"string",code:"invalid_type"}),I;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(I.value))return I.issues.push({input:I.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),I;return I}}),x5=L("$ZodFunction",($,v)=>{return v$.init($,v),$._def=v,$._zod.def=v,$.implement=(U)=>{if(typeof U!=="function")throw Error("implement() must be called with a function");return function(...I){let b=$._def.input?ug($._def.input,I):I,D=Reflect.apply(U,this,b);if($._def.output)return ug($._def.output,D);return D}},$.implementAsync=(U)=>{if(typeof U!=="function")throw Error("implementAsync() must be called with a function");return async function(...I){let b=$._def.input?await wg($._def.input,I):I,D=await Reflect.apply(U,this,b);if($._def.output)return await wg($._def.output,D);return D}},$._zod.parse=(U,I)=>{if(typeof U.value!=="function")return U.issues.push({code:"invalid_type",expected:"function",input:U.value,inst:$}),U;if($._def.output&&$._def.output._zod.def.type==="promise")U.value=$.implementAsync(U.value);else U.value=$.implement(U.value);return U},$.input=(...U)=>{let I=$.constructor;if(Array.isArray(U[0]))return new I({type:"function",input:new Ng({type:"tuple",items:U[0],rest:U[1]}),output:$._def.output});return new I({type:"function",input:U[0],output:$._def.output})},$.output=(U)=>{return new $.constructor({type:"function",input:$._def.input,output:U})},$}),l5=L("$ZodPromise",($,v)=>{v$.init($,v),$._zod.parse=(U,I)=>{return Promise.resolve(U.value).then((b)=>v.innerType._zod.run({value:b,issues:[]},I))}}),f5=L("$ZodLazy",($,v)=>{v$.init($,v),J$($._zod,"innerType",()=>{let U=v;if(!U._cachedInner)U._cachedInner=v.getter();return U._cachedInner}),J$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),J$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),J$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),J$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(U,I)=>{return $._zod.innerType._zod.run(U,I)}}),y5=L("$ZodCustom",($,v)=>{Z$.init($,v),v$.init($,v),$._zod.parse=(U,I)=>{return U},$._zod.check=(U)=>{let I=U.value,b=v.fn(I);if(b instanceof Promise)return b.then((D)=>nS(D,U,I,$));nS(b,U,I,$);return}});function nS($,v,U,I){if(!$){let b={code:"custom",input:U,inst:I,path:[...I._zod.def.path??[]],continue:!I._zod.def.abort};if(I._zod.def.params)b.params=I._zod.def.params;v.issues.push(rU(b))}}var D0={};e$(D0,{zhTW:()=>r7,zhCN:()=>n7,yo:()=>C7,vi:()=>R7,uz:()=>E7,ur:()=>k7,uk:()=>I0,ua:()=>T7,tr:()=>Z7,th:()=>F7,ta:()=>_7,sv:()=>M7,sl:()=>S7,ru:()=>N7,ro:()=>j7,pt:()=>P7,ps:()=>B7,pl:()=>A7,ota:()=>q7,no:()=>K7,nl:()=>L7,ms:()=>V7,mk:()=>Y7,lt:()=>Q7,ko:()=>z7,km:()=>b0,kh:()=>H7,ka:()=>O7,ja:()=>G7,it:()=>W7,is:()=>X7,id:()=>J7,hy:()=>g7,hu:()=>w7,hr:()=>u7,he:()=>D7,frCA:()=>I7,fr:()=>U7,fi:()=>b7,fa:()=>v7,es:()=>$7,eo:()=>s5,en:()=>v0,el:()=>e5,de:()=>a5,da:()=>p5,cs:()=>d5,ca:()=>t5,bg:()=>o5,be:()=>c5,az:()=>m5,ar:()=>h5});var zo=()=>{let $={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function v(b){return $[b]??null}let U={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${b.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${w}`;return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${D}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${w}`}case"invalid_value":if(b.values.length===1)return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${T(b.values[0])}`;return`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${b.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${D} ${b.maximum.toString()} ${u.unit??"\u0639\u0646\u0635\u0631"}`;return`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${b.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${D} ${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${b.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${D} ${b.minimum.toString()} ${u.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${b.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${D} ${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${b.prefix}"`;if(D.format==="ends_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${D.suffix}"`;if(D.format==="includes")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${D.includes}"`;if(D.format==="regex")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${D.pattern}`;return`${U[D.format]??b.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${b.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${b.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${b.keys.length>1?"\u0629":""}: ${B(b.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${b.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${b.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function h5(){return{localeError:zo()}}var Qo=()=>{let $={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function v(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${b.expected}, daxil olan ${w}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${D}, daxil olan ${w}`}case"invalid_value":if(b.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${T(b.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${b.origin??"d\u0259y\u0259r"} ${D}${b.maximum.toString()} ${u.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${b.origin??"d\u0259y\u0259r"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${b.origin} ${D}${b.minimum.toString()} ${u.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Yanl\u0131\u015F m\u0259tn: "${D.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;if(D.format==="ends_with")return`Yanl\u0131\u015F m\u0259tn: "${D.suffix}" il\u0259 bitm\u0259lidir`;if(D.format==="includes")return`Yanl\u0131\u015F m\u0259tn: "${D.includes}" daxil olmal\u0131d\u0131r`;if(D.format==="regex")return`Yanl\u0131\u015F m\u0259tn: ${D.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;return`Yanl\u0131\u015F ${U[D.format]??b.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${b.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${b.keys.length>1?"lar":""}: ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${b.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function m5(){return{localeError:Qo()}}function fS($,v,U,I){let b=Math.abs($),D=b%10,u=b%100;if(u>=11&&u<=19)return I;if(D===1)return v;if(D>=2&&D<=4)return U;return I}var Yo=()=>{let $={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function v(b){return $[b]??null}let U={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},I={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${b.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${w}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${D}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${w}`}case"invalid_value":if(b.values.length===1)return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${T(b.values[0])}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u){let w=Number(b.maximum),g=fS(w,u.unit.one,u.unit.few,u.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${u.verb} ${D}${b.maximum.toString()} ${g}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u){let w=Number(b.minimum),g=fS(w,u.unit.one,u.unit.few,u.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${b.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${u.verb} ${D}${b.minimum.toString()} ${g}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${b.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${D.prefix}"`;if(D.format==="ends_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${D.suffix}"`;if(D.format==="includes")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${D.includes}"`;if(D.format==="regex")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${D.pattern}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${U[D.format]??b.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${b.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${b.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${B(b.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${b.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${b.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function c5(){return{localeError:Yo()}}var Vo=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function v(b){return $[b]??null}let U={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},I={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${b.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${w}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${D}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${w}`}case"invalid_value":if(b.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${T(b.values[0])}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${b.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${D}${b.maximum.toString()} ${u.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${b.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${b.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${D}${b.minimum.toString()} ${u.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${b.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${D.prefix}"`;if(D.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${D.suffix}"`;if(D.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${D.includes}"`;if(D.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${D.pattern}`;let u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";if(D.format==="emoji")u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(D.format==="datetime")u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(D.format==="date")u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";if(D.format==="time")u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(D.format==="duration")u="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";return`${u} ${U[D.format]??b.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${b.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${b.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${b.keys.length>1?"\u043E\u0432\u0435":""}: ${B(b.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${b.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${b.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function o5(){return{localeError:Vo()}}var Lo=()=>{let $={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(b){return $[b]??null}let U={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${b.expected}, s'ha rebut ${w}`;return`Tipus inv\xE0lid: s'esperava ${D}, s'ha rebut ${w}`}case"invalid_value":if(b.values.length===1)return`Valor inv\xE0lid: s'esperava ${T(b.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${B(b.values," o ")}`;case"too_big":{let D=b.inclusive?"com a m\xE0xim":"menys de",u=v(b.origin);if(u)return`Massa gran: s'esperava que ${b.origin??"el valor"} contingu\xE9s ${D} ${b.maximum.toString()} ${u.unit??"elements"}`;return`Massa gran: s'esperava que ${b.origin??"el valor"} fos ${D} ${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?"com a m\xEDnim":"m\xE9s de",u=v(b.origin);if(u)return`Massa petit: s'esperava que ${b.origin} contingu\xE9s ${D} ${b.minimum.toString()} ${u.unit}`;return`Massa petit: s'esperava que ${b.origin} fos ${D} ${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Format inv\xE0lid: ha de comen\xE7ar amb "${D.prefix}"`;if(D.format==="ends_with")return`Format inv\xE0lid: ha d'acabar amb "${D.suffix}"`;if(D.format==="includes")return`Format inv\xE0lid: ha d'incloure "${D.includes}"`;if(D.format==="regex")return`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${D.pattern}`;return`Format inv\xE0lid per a ${U[D.format]??b.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${b.divisor}`;case"unrecognized_keys":return`Clau${b.keys.length>1?"s":""} no reconeguda${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${b.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${b.origin}`;default:return"Entrada inv\xE0lida"}}};function t5(){return{localeError:Lo()}}var Ko=()=>{let $={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function v(b){return $[b]??null}let U={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},I={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${b.expected}, obdr\u017Eeno ${w}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${D}, obdr\u017Eeno ${w}`}case"invalid_value":if(b.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${T(b.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${b.origin??"hodnota"} mus\xED m\xEDt ${D}${b.maximum.toString()} ${u.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${b.origin??"hodnota"} mus\xED b\xFDt ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${b.origin??"hodnota"} mus\xED m\xEDt ${D}${b.minimum.toString()} ${u.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${b.origin??"hodnota"} mus\xED b\xFDt ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${D.prefix}"`;if(D.format==="ends_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${D.suffix}"`;if(D.format==="includes")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${D.includes}"`;if(D.format==="regex")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${D.pattern}`;return`Neplatn\xFD form\xE1t ${U[D.format]??b.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${b.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${B(b.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${b.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${b.origin}`;default:return"Neplatn\xFD vstup"}}};function d5(){return{localeError:Ko()}}var qo=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(b){return $[b]??null}let U={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},I={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ugyldigt input: forventede instanceof ${b.expected}, fik ${w}`;return`Ugyldigt input: forventede ${D}, fik ${w}`}case"invalid_value":if(b.values.length===1)return`Ugyldig v\xE6rdi: forventede ${T(b.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`For stor: forventede ${w??"value"} ${u.verb} ${D} ${b.maximum.toString()} ${u.unit??"elementer"}`;return`For stor: forventede ${w??"value"} havde ${D} ${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`For lille: forventede ${w} ${u.verb} ${D} ${b.minimum.toString()} ${u.unit}`;return`For lille: forventede ${w} havde ${D} ${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ugyldig streng: skal starte med "${D.prefix}"`;if(D.format==="ends_with")return`Ugyldig streng: skal ende med "${D.suffix}"`;if(D.format==="includes")return`Ugyldig streng: skal indeholde "${D.includes}"`;if(D.format==="regex")return`Ugyldig streng: skal matche m\xF8nsteret ${D.pattern}`;return`Ugyldig ${U[D.format]??b.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${B(b.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${b.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${b.origin}`;default:return"Ugyldigt input"}}};function p5(){return{localeError:qo()}}var Bo=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(b){return $[b]??null}let U={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},I={nan:"NaN",number:"Zahl",array:"Array"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${b.expected}, erhalten ${w}`;return`Ung\xFCltige Eingabe: erwartet ${D}, erhalten ${w}`}case"invalid_value":if(b.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${T(b.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Zu gro\xDF: erwartet, dass ${b.origin??"Wert"} ${D}${b.maximum.toString()} ${u.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${b.origin??"Wert"} ${D}${b.maximum.toString()} ist`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Zu klein: erwartet, dass ${b.origin} ${D}${b.minimum.toString()} ${u.unit} hat`;return`Zu klein: erwartet, dass ${b.origin} ${D}${b.minimum.toString()} ist`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ung\xFCltiger String: muss mit "${D.prefix}" beginnen`;if(D.format==="ends_with")return`Ung\xFCltiger String: muss mit "${D.suffix}" enden`;if(D.format==="includes")return`Ung\xFCltiger String: muss "${D.includes}" enthalten`;if(D.format==="regex")return`Ung\xFCltiger String: muss dem Muster ${D.pattern} entsprechen`;return`Ung\xFCltig: ${U[D.format]??b.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${b.divisor} sein`;case"unrecognized_keys":return`${b.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${B(b.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${b.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${b.origin}`;default:return"Ung\xFCltige Eingabe"}}};function a5(){return{localeError:Bo()}}var Ao=()=>{let $={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function v(b){return $[b]??null}let U={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(typeof b.expected==="string"&&/^[A-Z]/.test(b.expected))return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${b.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${w}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${D}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${w}`}case"invalid_value":if(b.values.length===1)return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${T(b.values[0])}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${b.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${D}${b.maximum.toString()} ${u.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${b.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${b.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${D}${b.minimum.toString()} ${u.unit}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${b.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${D.prefix}"`;if(D.format==="ends_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${D.suffix}"`;if(D.format==="includes")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${D.includes}"`;if(D.format==="regex")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${D.pattern}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${U[D.format]??b.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${b.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${b.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${b.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${B(b.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${b.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${b.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function e5(){return{localeError:Ao()}}var Po=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function v(b){return $[b]??null}let U={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;return`Invalid input: expected ${D}, received ${w}`}case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${T(b.values[0])}`;return`Invalid option: expected one of ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Too big: expected ${b.origin??"value"} to have ${D}${b.maximum.toString()} ${u.unit??"elements"}`;return`Too big: expected ${b.origin??"value"} to be ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Too small: expected ${b.origin} to have ${D}${b.minimum.toString()} ${u.unit}`;return`Too small: expected ${b.origin} to be ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Invalid string: must start with "${D.prefix}"`;if(D.format==="ends_with")return`Invalid string: must end with "${D.suffix}"`;if(D.format==="includes")return`Invalid string: must include "${D.includes}"`;if(D.format==="regex")return`Invalid string: must match pattern ${D.pattern}`;return`Invalid ${U[D.format]??b.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${b.divisor}`;case"unrecognized_keys":return`Unrecognized key${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Invalid key in ${b.origin}`;case"invalid_union":if(b.options&&Array.isArray(b.options)&&b.options.length>0)return`Invalid discriminator value. Expected ${b.options.map((u)=>`'${u}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${b.origin}`;default:return"Invalid input"}}};function v0(){return{localeError:Po()}}var jo=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(b){return $[b]??null}let U={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},I={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${b.expected}, ricevi\u011Dis ${w}`;return`Nevalida enigo: atendi\u011Dis ${D}, ricevi\u011Dis ${w}`}case"invalid_value":if(b.values.length===1)return`Nevalida enigo: atendi\u011Dis ${T(b.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Tro granda: atendi\u011Dis ke ${b.origin??"valoro"} havu ${D}${b.maximum.toString()} ${u.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${b.origin??"valoro"} havu ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Tro malgranda: atendi\u011Dis ke ${b.origin} havu ${D}${b.minimum.toString()} ${u.unit}`;return`Tro malgranda: atendi\u011Dis ke ${b.origin} estu ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Nevalida karaktraro: devas komenci\u011Di per "${D.prefix}"`;if(D.format==="ends_with")return`Nevalida karaktraro: devas fini\u011Di per "${D.suffix}"`;if(D.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${D.includes}"`;if(D.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${D.pattern}`;return`Nevalida ${U[D.format]??b.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${b.divisor}`;case"unrecognized_keys":return`Nekonata${b.keys.length>1?"j":""} \u015Dlosilo${b.keys.length>1?"j":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${b.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${b.origin}`;default:return"Nevalida enigo"}}};function s5(){return{localeError:jo()}}var No=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(b){return $[b]??null}let U={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},I={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${b.expected}, recibido ${w}`;return`Entrada inv\xE1lida: se esperaba ${D}, recibido ${w}`}case"invalid_value":if(b.values.length===1)return`Entrada inv\xE1lida: se esperaba ${T(b.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`Demasiado grande: se esperaba que ${w??"valor"} tuviera ${D}${b.maximum.toString()} ${u.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${w??"valor"} fuera ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`Demasiado peque\xF1o: se esperaba que ${w} tuviera ${D}${b.minimum.toString()} ${u.unit}`;return`Demasiado peque\xF1o: se esperaba que ${w} fuera ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Cadena inv\xE1lida: debe comenzar con "${D.prefix}"`;if(D.format==="ends_with")return`Cadena inv\xE1lida: debe terminar en "${D.suffix}"`;if(D.format==="includes")return`Cadena inv\xE1lida: debe incluir "${D.includes}"`;if(D.format==="regex")return`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${D.pattern}`;return`Inv\xE1lido ${U[D.format]??b.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${b.divisor}`;case"unrecognized_keys":return`Llave${b.keys.length>1?"s":""} desconocida${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${I[b.origin]??b.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${I[b.origin]??b.origin}`;default:return"Entrada inv\xE1lida"}}};function $7(){return{localeError:No()}}var So=()=>{let $={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function v(b){return $[b]??null}let U={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},I={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${b.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${w} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${D} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${w} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":if(b.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${T(b.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;return`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${B(b.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${b.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${D}${b.maximum.toString()} ${u.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${b.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${D}${b.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${b.origin} \u0628\u0627\u06CC\u062F ${D}${b.minimum.toString()} ${u.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${b.origin} \u0628\u0627\u06CC\u062F ${D}${b.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${D.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;if(D.format==="ends_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${D.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;if(D.format==="includes")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${D.includes}" \u0628\u0627\u0634\u062F`;if(D.format==="regex")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${D.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;return`${U[D.format]??b.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${b.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${b.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${B(b.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${b.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${b.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function v7(){return{localeError:So()}}var Mo=()=>{let $={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function v(b){return $[b]??null}let U={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Virheellinen tyyppi: odotettiin instanceof ${b.expected}, oli ${w}`;return`Virheellinen tyyppi: odotettiin ${D}, oli ${w}`}case"invalid_value":if(b.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${T(b.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Liian suuri: ${u.subject} t\xE4ytyy olla ${D}${b.maximum.toString()} ${u.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Liian pieni: ${u.subject} t\xE4ytyy olla ${D}${b.minimum.toString()} ${u.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${D.prefix}"`;if(D.format==="ends_with")return`Virheellinen sy\xF6te: t\xE4ytyy loppua "${D.suffix}"`;if(D.format==="includes")return`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${D.includes}"`;if(D.format==="regex")return`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${D.pattern}`;return`Virheellinen ${U[D.format]??b.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${b.divisor} monikerta`;case"unrecognized_keys":return`${b.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${B(b.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function b7(){return{localeError:Mo()}}var _o=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function v(b){return $[b]??null}let U={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},I={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Entr\xE9e invalide : instanceof ${b.expected} attendu, ${w} re\xE7u`;return`Entr\xE9e invalide : ${D} attendu, ${w} re\xE7u`}case"invalid_value":if(b.values.length===1)return`Entr\xE9e invalide : ${T(b.values[0])} attendu`;return`Option invalide : une valeur parmi ${B(b.values,"|")} attendue`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Trop grand : ${I[b.origin]??"valeur"} doit ${u.verb} ${D}${b.maximum.toString()} ${u.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${I[b.origin]??"valeur"} doit \xEAtre ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Trop petit : ${I[b.origin]??"valeur"} doit ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`Trop petit : ${I[b.origin]??"valeur"} doit \xEAtre ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${D.prefix}"`;if(D.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${D.suffix}"`;if(D.format==="includes")return`Cha\xEEne invalide : doit inclure "${D.includes}"`;if(D.format==="regex")return`Cha\xEEne invalide : doit correspondre au mod\xE8le ${D.pattern}`;return`${U[D.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${b.divisor}`;case"unrecognized_keys":return`Cl\xE9${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${B(b.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${b.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entr\xE9e invalide"}}};function U7(){return{localeError:_o()}}var Fo=()=>{let $={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function v(b){return $[b]??null}let U={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Entr\xE9e invalide : attendu instanceof ${b.expected}, re\xE7u ${w}`;return`Entr\xE9e invalide : attendu ${D}, re\xE7u ${w}`}case"invalid_value":if(b.values.length===1)return`Entr\xE9e invalide : attendu ${T(b.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"\u2264":"<",u=v(b.origin);if(u)return`Trop grand : attendu que ${b.origin??"la valeur"} ait ${D}${b.maximum.toString()} ${u.unit}`;return`Trop grand : attendu que ${b.origin??"la valeur"} soit ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?"\u2265":">",u=v(b.origin);if(u)return`Trop petit : attendu que ${b.origin} ait ${D}${b.minimum.toString()} ${u.unit}`;return`Trop petit : attendu que ${b.origin} soit ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${D.prefix}"`;if(D.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${D.suffix}"`;if(D.format==="includes")return`Cha\xEEne invalide : doit inclure "${D.includes}"`;if(D.format==="regex")return`Cha\xEEne invalide : doit correspondre au motif ${D.pattern}`;return`${U[D.format]??b.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${b.divisor}`;case"unrecognized_keys":return`Cl\xE9${b.keys.length>1?"s":""} non reconnue${b.keys.length>1?"s":""} : ${B(b.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${b.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${b.origin}`;default:return"Entr\xE9e invalide"}}};function I7(){return{localeError:Fo()}}var Zo=()=>{let $={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},v={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},U=(J)=>J?$[J]:void 0,I=(J)=>{let X=U(J);if(X)return X.label;return J??$.unknown.label},b=(J)=>`\u05D4${I(J)}`,D=(J)=>{return(U(J)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA"},u=(J)=>{if(!J)return null;return v[J]??null},w={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},g={nan:"NaN"};return(J)=>{switch(J.code){case"invalid_type":{let X=J.expected,W=g[X??""]??I(X),G=E(J.input),O=g[G]??$[G]?.label??G;if(/^[A-Z]/.test(J.expected))return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${J.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${O}`;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${W}, \u05D4\u05EA\u05E7\u05D1\u05DC ${O}`}case"invalid_value":{if(J.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${T(J.values[0])}`;let X=J.values.map((O)=>T(O));if(J.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${X[0]} \u05D0\u05D5 ${X[1]}`;let W=X[X.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${X.slice(0,-1).join(", ")} \u05D0\u05D5 ${W}`}case"too_big":{let X=u(J.origin),W=b(J.origin??"value");if(J.origin==="string")return`${X?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${W} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${J.maximum.toString()} ${X?.unit??""} ${J.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(J.origin==="number"){let z=J.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${J.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${J.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${W} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${z}`}if(J.origin==="array"||J.origin==="set"){let z=J.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",Q=J.inclusive?`${J.maximum} ${X?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${J.maximum} ${X?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${W} ${z} \u05DC\u05D4\u05DB\u05D9\u05DC ${Q}`.trim()}let G=J.inclusive?"<=":"<",O=D(J.origin??"value");if(X?.unit)return`${X.longLabel} \u05DE\u05D3\u05D9: ${W} ${O} ${G}${J.maximum.toString()} ${X.unit}`;return`${X?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${W} ${O} ${G}${J.maximum.toString()}`}case"too_small":{let X=u(J.origin),W=b(J.origin??"value");if(J.origin==="string")return`${X?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${W} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${J.minimum.toString()} ${X?.unit??""} ${J.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(J.origin==="number"){let z=J.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${J.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${J.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${W} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${z}`}if(J.origin==="array"||J.origin==="set"){let z=J.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(J.minimum===1&&J.inclusive){let Y=J.origin==="set"?"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3":"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${W} ${z} \u05DC\u05D4\u05DB\u05D9\u05DC ${Y}`}let Q=J.inclusive?`${J.minimum} ${X?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${J.minimum} ${X?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${W} ${z} \u05DC\u05D4\u05DB\u05D9\u05DC ${Q}`.trim()}let G=J.inclusive?">=":">",O=D(J.origin??"value");if(X?.unit)return`${X.shortLabel} \u05DE\u05D3\u05D9: ${W} ${O} ${G}${J.minimum.toString()} ${X.unit}`;return`${X?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${W} ${O} ${G}${J.minimum.toString()}`}case"invalid_format":{let X=J;if(X.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${X.prefix}"`;if(X.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${X.suffix}"`;if(X.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${X.includes}"`;if(X.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${X.pattern}`;let W=w[X.format],G=W?.label??X.format,z=(W?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${G} \u05DC\u05D0 ${z}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${J.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${J.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${J.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${B(J.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${b(J.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function D7(){return{localeError:Zo()}}var To=()=>{let $={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function v(b){return $[b]??null}let U={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},I={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Neispravan unos: o\u010Dekuje se instanceof ${b.expected}, a primljeno je ${w}`;return`Neispravan unos: o\u010Dekuje se ${D}, a primljeno je ${w}`}case"invalid_value":if(b.values.length===1)return`Neispravna vrijednost: o\u010Dekivano ${T(b.values[0])}`;return`Neispravna opcija: o\u010Dekivano jedno od ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`Preveliko: o\u010Dekivano da ${w??"vrijednost"} ima ${D}${b.maximum.toString()} ${u.unit??"elemenata"}`;return`Preveliko: o\u010Dekivano da ${w??"vrijednost"} bude ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin),w=I[b.origin]??b.origin;if(u)return`Premalo: o\u010Dekivano da ${w} ima ${D}${b.minimum.toString()} ${u.unit}`;return`Premalo: o\u010Dekivano da ${w} bude ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Neispravan tekst: mora zapo\u010Dinjati s "${D.prefix}"`;if(D.format==="ends_with")return`Neispravan tekst: mora zavr\u0161avati s "${D.suffix}"`;if(D.format==="includes")return`Neispravan tekst: mora sadr\u017Eavati "${D.includes}"`;if(D.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${D.pattern}`;return`Neispravna ${U[D.format]??b.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${b.divisor}`;case"unrecognized_keys":return`Neprepoznat${b.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${B(b.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${I[b.origin]??b.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${I[b.origin]??b.origin}`;default:return"Neispravan unos"}}};function u7(){return{localeError:To()}}var ko=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(b){return $[b]??null}let U={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},I={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${b.expected}, a kapott \xE9rt\xE9k ${w}`;return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${D}, a kapott \xE9rt\xE9k ${w}`}case"invalid_value":if(b.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${T(b.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`T\xFAl nagy: ${b.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${D}${b.maximum.toString()} ${u.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${b.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${b.origin} m\xE9rete t\xFAl kicsi ${D}${b.minimum.toString()} ${u.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${b.origin} t\xFAl kicsi ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\xC9rv\xE9nytelen string: "${D.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;if(D.format==="ends_with")return`\xC9rv\xE9nytelen string: "${D.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;if(D.format==="includes")return`\xC9rv\xE9nytelen string: "${D.includes}" \xE9rt\xE9ket kell tartalmaznia`;if(D.format==="regex")return`\xC9rv\xE9nytelen string: ${D.pattern} mint\xE1nak kell megfelelnie`;return`\xC9rv\xE9nytelen ${U[D.format]??b.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${b.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${b.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${b.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function w7(){return{localeError:ko()}}function yS($,v,U){return Math.abs($)===1?v:U}function yU($){if(!$)return"";let v=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],U=$[$.length-1];return $+(v.includes(U)?"\u0576":"\u0568")}var Eo=()=>{let $={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function v(b){return $[b]??null}let U={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},I={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${b.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${w}`;return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${D}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${w}`}case"invalid_value":if(b.values.length===1)return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${T(b.values[1])}`;return`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u){let w=Number(b.maximum),g=yS(w,u.unit.one,u.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${yU(b.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${D}${b.maximum.toString()} ${g}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${yU(b.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u){let w=Number(b.minimum),g=yS(w,u.unit.one,u.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${yU(b.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${D}${b.minimum.toString()} ${g}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${yU(b.origin)} \u056C\u056B\u0576\u056B ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${D.prefix}"-\u0578\u057E`;if(D.format==="ends_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${D.suffix}"-\u0578\u057E`;if(D.format==="includes")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${D.includes}"`;if(D.format==="regex")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${D.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;return`\u054D\u056D\u0561\u056C ${U[D.format]??b.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${b.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${b.keys.length>1?"\u0576\u0565\u0580":""}. ${B(b.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${yU(b.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${yU(b.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function g7(){return{localeError:Eo()}}var Ro=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(b){return $[b]??null}let U={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Input tidak valid: diharapkan instanceof ${b.expected}, diterima ${w}`;return`Input tidak valid: diharapkan ${D}, diterima ${w}`}case"invalid_value":if(b.values.length===1)return`Input tidak valid: diharapkan ${T(b.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Terlalu besar: diharapkan ${b.origin??"value"} memiliki ${D}${b.maximum.toString()} ${u.unit??"elemen"}`;return`Terlalu besar: diharapkan ${b.origin??"value"} menjadi ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Terlalu kecil: diharapkan ${b.origin} memiliki ${D}${b.minimum.toString()} ${u.unit}`;return`Terlalu kecil: diharapkan ${b.origin} menjadi ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`String tidak valid: harus dimulai dengan "${D.prefix}"`;if(D.format==="ends_with")return`String tidak valid: harus berakhir dengan "${D.suffix}"`;if(D.format==="includes")return`String tidak valid: harus menyertakan "${D.includes}"`;if(D.format==="regex")return`String tidak valid: harus sesuai pola ${D.pattern}`;return`${U[D.format]??b.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${b.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${b.origin}`;default:return"Input tidak valid"}}};function J7(){return{localeError:Ro()}}var no=()=>{let $={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function v(b){return $[b]??null}let U={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},I={nan:"NaN",number:"n\xFAmer",array:"fylki"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${w} \xFEar sem \xE1 a\xF0 vera instanceof ${b.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${w} \xFEar sem \xE1 a\xF0 vera ${D}`}case"invalid_value":if(b.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${T(b.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${b.origin??"gildi"} hafi ${D}${b.maximum.toString()} ${u.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${b.origin??"gildi"} s\xE9 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${b.origin} hafi ${D}${b.minimum.toString()} ${u.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${b.origin} s\xE9 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${D.prefix}"`;if(D.format==="ends_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${D.suffix}"`;if(D.format==="includes")return`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${D.includes}"`;if(D.format==="regex")return`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${D.pattern}`;return`Rangt ${U[D.format]??b.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${b.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${b.keys.length>1?"ir lyklar":"ur lykill"}: ${B(b.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${b.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${b.origin}`;default:return"Rangt gildi"}}};function X7(){return{localeError:no()}}var ro=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(b){return $[b]??null}let U={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},I={nan:"NaN",number:"numero",array:"vettore"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Input non valido: atteso instanceof ${b.expected}, ricevuto ${w}`;return`Input non valido: atteso ${D}, ricevuto ${w}`}case"invalid_value":if(b.values.length===1)return`Input non valido: atteso ${T(b.values[0])}`;return`Opzione non valida: atteso uno tra ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Troppo grande: ${b.origin??"valore"} deve avere ${D}${b.maximum.toString()} ${u.unit??"elementi"}`;return`Troppo grande: ${b.origin??"valore"} deve essere ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Troppo piccolo: ${b.origin} deve avere ${D}${b.minimum.toString()} ${u.unit}`;return`Troppo piccolo: ${b.origin} deve essere ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Stringa non valida: deve iniziare con "${D.prefix}"`;if(D.format==="ends_with")return`Stringa non valida: deve terminare con "${D.suffix}"`;if(D.format==="includes")return`Stringa non valida: deve includere "${D.includes}"`;if(D.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${D.pattern}`;return`Input non valido: ${U[D.format]??b.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${b.divisor}`;case"unrecognized_keys":return`Chiav${b.keys.length>1?"i":"e"} non riconosciut${b.keys.length>1?"e":"a"}: ${B(b.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${b.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${b.origin}`;default:return"Input non valido"}}};function W7(){return{localeError:ro()}}var Co=()=>{let $={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function v(b){return $[b]??null}let U={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},I={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${b.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${w}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u5165\u529B: ${D}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${w}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":if(b.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${T(b.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${B(b.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let D=b.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",u=v(b.origin);if(u)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${b.origin??"\u5024"}\u306F${b.maximum.toString()}${u.unit??"\u8981\u7D20"}${D}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${b.origin??"\u5024"}\u306F${b.maximum.toString()}${D}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let D=b.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",u=v(b.origin);if(u)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${b.origin}\u306F${b.minimum.toString()}${u.unit}${D}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${b.origin}\u306F${b.minimum.toString()}${D}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${D.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(D.format==="ends_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${D.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(D.format==="includes")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${D.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(D.format==="regex")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${D.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u7121\u52B9\u306A${U[D.format]??b.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${b.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${b.keys.length>1?"\u7FA4":""}: ${B(b.keys,"\u3001")}`;case"invalid_key":return`${b.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${b.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function G7(){return{localeError:Co()}}var io=()=>{let $={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function v(b){return $[b]??null}let U={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},I={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${b.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${w}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${D}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${w}`}case"invalid_value":if(b.values.length===1)return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${T(b.values[0])}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${B(b.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${b.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${u.verb} ${D}${b.maximum.toString()} ${u.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${b.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${b.origin} ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${b.origin} \u10D8\u10E7\u10DD\u10E1 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${D.prefix}"-\u10D8\u10D7`;if(D.format==="ends_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${D.suffix}"-\u10D8\u10D7`;if(D.format==="includes")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${D.includes}"-\u10E1`;if(D.format==="regex")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${D.pattern}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${b.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${b.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${B(b.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${b.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${b.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function O7(){return{localeError:io()}}var xo=()=>{let $={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function v(b){return $[b]??null}let U={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},I={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${b.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${w}`;return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${D} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${w}`}case"invalid_value":if(b.values.length===1)return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${T(b.values[0])}`;return`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${b.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${D} ${b.maximum.toString()} ${u.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${b.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${D} ${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${b.origin} ${D} ${b.minimum.toString()} ${u.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${b.origin} ${D} ${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${D.prefix}"`;if(D.format==="ends_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${D.suffix}"`;if(D.format==="includes")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${D.includes}"`;if(D.format==="regex")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${D.pattern}`;return`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${b.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${B(b.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${b.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${b.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function b0(){return{localeError:xo()}}function H7(){return b0()}var lo=()=>{let $={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function v(b){return $[b]??null}let U={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${b.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${w}\uC785\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${D}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${w}\uC785\uB2C8\uB2E4`}case"invalid_value":if(b.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${T(b.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${B(b.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let D=b.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",u=D==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",w=v(b.origin),g=w?.unit??"\uC694\uC18C";if(w)return`${b.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${b.maximum.toString()}${g} ${D}${u}`;return`${b.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${b.maximum.toString()} ${D}${u}`}case"too_small":{let D=b.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",u=D==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",w=v(b.origin),g=w?.unit??"\uC694\uC18C";if(w)return`${b.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${b.minimum.toString()}${g} ${D}${u}`;return`${b.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${b.minimum.toString()} ${D}${u}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${D.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;if(D.format==="ends_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${D.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;if(D.format==="includes")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${D.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;if(D.format==="regex")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${D.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C ${U[D.format]??b.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${b.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${B(b.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${b.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${b.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function z7(){return{localeError:lo()}}var U0=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function hS($){let v=Math.abs($),U=v%10,I=v%100;if(I>=11&&I<=19||U===0)return"many";if(U===1)return"one";return"few"}var fo=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function v(b,D,u,w){let g=$[b]??null;if(g===null)return g;return{unit:g.unit[D],verb:g.verb[w][u?"inclusive":"notInclusive"]}}let U={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},I={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Gautas tipas ${w}, o tik\u0117tasi - instanceof ${b.expected}`;return`Gautas tipas ${w}, o tik\u0117tasi - ${D}`}case"invalid_value":if(b.values.length===1)return`Privalo b\u016Bti ${T(b.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${B(b.values,"|")} pasirinkim\u0173`;case"too_big":{let D=I[b.origin]??b.origin,u=v(b.origin,hS(Number(b.maximum)),b.inclusive??!1,"smaller");if(u?.verb)return`${U0(D??b.origin??"reik\u0161m\u0117")} ${u.verb} ${b.maximum.toString()} ${u.unit??"element\u0173"}`;let w=b.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${U0(D??b.origin??"reik\u0161m\u0117")} turi b\u016Bti ${w} ${b.maximum.toString()} ${u?.unit}`}case"too_small":{let D=I[b.origin]??b.origin,u=v(b.origin,hS(Number(b.minimum)),b.inclusive??!1,"bigger");if(u?.verb)return`${U0(D??b.origin??"reik\u0161m\u0117")} ${u.verb} ${b.minimum.toString()} ${u.unit??"element\u0173"}`;let w=b.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${U0(D??b.origin??"reik\u0161m\u0117")} turi b\u016Bti ${w} ${b.minimum.toString()} ${u?.unit}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Eilut\u0117 privalo prasid\u0117ti "${D.prefix}"`;if(D.format==="ends_with")return`Eilut\u0117 privalo pasibaigti "${D.suffix}"`;if(D.format==="includes")return`Eilut\u0117 privalo \u012Ftraukti "${D.includes}"`;if(D.format==="regex")return`Eilut\u0117 privalo atitikti ${D.pattern}`;return`Neteisingas ${U[D.format]??b.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${b.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${b.keys.length>1?"i":"as"} rakt${b.keys.length>1?"ai":"as"}: ${B(b.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let D=I[b.origin]??b.origin;return`${U0(D??b.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function Q7(){return{localeError:fo()}}var yo=()=>{let $={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function v(b){return $[b]??null}let U={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},I={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${b.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${w}`;return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${D}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${w}`}case"invalid_value":if(b.values.length===1)return`Invalid input: expected ${T(b.values[0])}`;return`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${b.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${D}${b.maximum.toString()} ${u.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${b.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${b.origin} \u0434\u0430 \u0438\u043C\u0430 ${D}${b.minimum.toString()} ${u.unit}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${b.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${D.prefix}"`;if(D.format==="ends_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${D.suffix}"`;if(D.format==="includes")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${D.includes}"`;if(D.format==="regex")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${D.pattern}`;return`Invalid ${U[D.format]??b.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${B(b.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${b.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${b.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function Y7(){return{localeError:yo()}}var ho=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(b){return $[b]??null}let U={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},I={nan:"NaN",number:"nombor"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Input tidak sah: dijangka instanceof ${b.expected}, diterima ${w}`;return`Input tidak sah: dijangka ${D}, diterima ${w}`}case"invalid_value":if(b.values.length===1)return`Input tidak sah: dijangka ${T(b.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Terlalu besar: dijangka ${b.origin??"nilai"} ${u.verb} ${D}${b.maximum.toString()} ${u.unit??"elemen"}`;return`Terlalu besar: dijangka ${b.origin??"nilai"} adalah ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Terlalu kecil: dijangka ${b.origin} ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`Terlalu kecil: dijangka ${b.origin} adalah ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`String tidak sah: mesti bermula dengan "${D.prefix}"`;if(D.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${D.suffix}"`;if(D.format==="includes")return`String tidak sah: mesti mengandungi "${D.includes}"`;if(D.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${D.pattern}`;return`${U[D.format]??b.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${b.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${B(b.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${b.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${b.origin}`;default:return"Input tidak sah"}}};function V7(){return{localeError:ho()}}var mo=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(b){return $[b]??null}let U={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},I={nan:"NaN",number:"getal"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ongeldige invoer: verwacht instanceof ${b.expected}, ontving ${w}`;return`Ongeldige invoer: verwacht ${D}, ontving ${w}`}case"invalid_value":if(b.values.length===1)return`Ongeldige invoer: verwacht ${T(b.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin),w=b.origin==="date"?"laat":b.origin==="string"?"lang":"groot";if(u)return`Te ${w}: verwacht dat ${b.origin??"waarde"} ${D}${b.maximum.toString()} ${u.unit??"elementen"} ${u.verb}`;return`Te ${w}: verwacht dat ${b.origin??"waarde"} ${D}${b.maximum.toString()} is`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin),w=b.origin==="date"?"vroeg":b.origin==="string"?"kort":"klein";if(u)return`Te ${w}: verwacht dat ${b.origin} ${D}${b.minimum.toString()} ${u.unit} ${u.verb}`;return`Te ${w}: verwacht dat ${b.origin} ${D}${b.minimum.toString()} is`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ongeldige tekst: moet met "${D.prefix}" beginnen`;if(D.format==="ends_with")return`Ongeldige tekst: moet op "${D.suffix}" eindigen`;if(D.format==="includes")return`Ongeldige tekst: moet "${D.includes}" bevatten`;if(D.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${D.pattern}`;return`Ongeldig: ${U[D.format]??b.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${b.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${b.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${b.origin}`;default:return"Ongeldige invoer"}}};function L7(){return{localeError:mo()}}var co=()=>{let $={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function v(b){return $[b]??null}let U={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},I={nan:"NaN",number:"tall",array:"liste"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ugyldig input: forventet instanceof ${b.expected}, fikk ${w}`;return`Ugyldig input: forventet ${D}, fikk ${w}`}case"invalid_value":if(b.values.length===1)return`Ugyldig verdi: forventet ${T(b.values[0])}`;return`Ugyldig valg: forventet en av ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`For stor(t): forventet ${b.origin??"value"} til \xE5 ha ${D}${b.maximum.toString()} ${u.unit??"elementer"}`;return`For stor(t): forventet ${b.origin??"value"} til \xE5 ha ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`For lite(n): forventet ${b.origin} til \xE5 ha ${D}${b.minimum.toString()} ${u.unit}`;return`For lite(n): forventet ${b.origin} til \xE5 ha ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ugyldig streng: m\xE5 starte med "${D.prefix}"`;if(D.format==="ends_with")return`Ugyldig streng: m\xE5 ende med "${D.suffix}"`;if(D.format==="includes")return`Ugyldig streng: m\xE5 inneholde "${D.includes}"`;if(D.format==="regex")return`Ugyldig streng: m\xE5 matche m\xF8nsteret ${D.pattern}`;return`Ugyldig ${U[D.format]??b.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${B(b.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${b.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${b.origin}`;default:return"Ugyldig input"}}};function K7(){return{localeError:co()}}var oo=()=>{let $={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function v(b){return $[b]??null}let U={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},I={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`F\xE2sit giren: umulan instanceof ${b.expected}, al\u0131nan ${w}`;return`F\xE2sit giren: umulan ${D}, al\u0131nan ${w}`}case"invalid_value":if(b.values.length===1)return`F\xE2sit giren: umulan ${T(b.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Fazla b\xFCy\xFCk: ${b.origin??"value"}, ${D}${b.maximum.toString()} ${u.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${b.origin??"value"}, ${D}${b.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Fazla k\xFC\xE7\xFCk: ${b.origin}, ${D}${b.minimum.toString()} ${u.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${b.origin}, ${D}${b.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`F\xE2sit metin: "${D.prefix}" ile ba\u015Flamal\u0131.`;if(D.format==="ends_with")return`F\xE2sit metin: "${D.suffix}" ile bitmeli.`;if(D.format==="includes")return`F\xE2sit metin: "${D.includes}" ihtiv\xE2 etmeli.`;if(D.format==="regex")return`F\xE2sit metin: ${D.pattern} nak\u015F\u0131na uymal\u0131.`;return`F\xE2sit ${U[D.format]??b.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${b.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${b.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function q7(){return{localeError:oo()}}var to=()=>{let $={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function v(b){return $[b]??null}let U={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},I={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${b.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${w} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${D} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${w} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":if(b.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${T(b.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${B(b.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${b.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${D}${b.maximum.toString()} ${u.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${b.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${D}${b.maximum.toString()} \u0648\u064A`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${b.origin} \u0628\u0627\u06CC\u062F ${D}${b.minimum.toString()} ${u.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${b.origin} \u0628\u0627\u06CC\u062F ${D}${b.minimum.toString()} \u0648\u064A`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${D.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;if(D.format==="ends_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${D.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;if(D.format==="includes")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${D.includes}" \u0648\u0644\u0631\u064A`;if(D.format==="regex")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${D.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;return`${U[D.format]??b.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${b.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${b.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${B(b.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${b.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${b.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function B7(){return{localeError:to()}}var po=()=>{let $={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function v(b){return $[b]??null}let U={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},I={nan:"NaN",number:"liczba",array:"tablica"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${b.expected}, otrzymano ${w}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${D}, otrzymano ${w}`}case"invalid_value":if(b.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${T(b.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${b.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${D}${b.maximum.toString()} ${u.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${b.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${b.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${D}${b.minimum.toString()} ${u.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${b.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${D.prefix}"`;if(D.format==="ends_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${D.suffix}"`;if(D.format==="includes")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${D.includes}"`;if(D.format==="regex")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${D.pattern}`;return`Nieprawid\u0142ow(y/a/e) ${U[D.format]??b.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${b.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${b.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${b.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function A7(){return{localeError:po()}}var ao=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(b){return $[b]??null}let U={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},I={nan:"NaN",number:"n\xFAmero",null:"nulo"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Tipo inv\xE1lido: esperado instanceof ${b.expected}, recebido ${w}`;return`Tipo inv\xE1lido: esperado ${D}, recebido ${w}`}case"invalid_value":if(b.values.length===1)return`Entrada inv\xE1lida: esperado ${T(b.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Muito grande: esperado que ${b.origin??"valor"} tivesse ${D}${b.maximum.toString()} ${u.unit??"elementos"}`;return`Muito grande: esperado que ${b.origin??"valor"} fosse ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Muito pequeno: esperado que ${b.origin} tivesse ${D}${b.minimum.toString()} ${u.unit}`;return`Muito pequeno: esperado que ${b.origin} fosse ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Texto inv\xE1lido: deve come\xE7ar com "${D.prefix}"`;if(D.format==="ends_with")return`Texto inv\xE1lido: deve terminar com "${D.suffix}"`;if(D.format==="includes")return`Texto inv\xE1lido: deve incluir "${D.includes}"`;if(D.format==="regex")return`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${D.pattern}`;return`${U[D.format]??b.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${b.divisor}`;case"unrecognized_keys":return`Chave${b.keys.length>1?"s":""} desconhecida${b.keys.length>1?"s":""}: ${B(b.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${b.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${b.origin}`;default:return"Campo inv\xE1lido"}}};function P7(){return{localeError:ao()}}var eo=()=>{let $={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function v(b){return $[b]??null}let U={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},I={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;return`Intrare invalid\u0103: a\u0219teptat ${D}, primit ${w}`}case"invalid_value":if(b.values.length===1)return`Intrare invalid\u0103: a\u0219teptat ${T(b.values[0])}`;return`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Prea mare: a\u0219teptat ca ${b.origin??"valoarea"} ${u.verb} ${D}${b.maximum.toString()} ${u.unit??"elemente"}`;return`Prea mare: a\u0219teptat ca ${b.origin??"valoarea"} s\u0103 fie ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Prea mic: a\u0219teptat ca ${b.origin} ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`Prea mic: a\u0219teptat ca ${b.origin} s\u0103 fie ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${D.prefix}"`;if(D.format==="ends_with")return`\u0218ir invalid: trebuie s\u0103 se termine cu "${D.suffix}"`;if(D.format==="includes")return`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${D.includes}"`;if(D.format==="regex")return`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${D.pattern}`;return`Format invalid: ${U[D.format]??b.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${b.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${B(b.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${b.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${b.origin}`;default:return"Intrare invalid\u0103"}}};function j7(){return{localeError:eo()}}function mS($,v,U,I){let b=Math.abs($),D=b%10,u=b%100;if(u>=11&&u<=19)return I;if(D===1)return v;if(D>=2&&D<=4)return U;return I}var so=()=>{let $={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function v(b){return $[b]??null}let U={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},I={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${b.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${w}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${D}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${w}`}case"invalid_value":if(b.values.length===1)return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${T(b.values[0])}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u){let w=Number(b.maximum),g=mS(w,u.unit.one,u.unit.few,u.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${D}${b.maximum.toString()} ${g}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u){let w=Number(b.minimum),g=mS(w,u.unit.one,u.unit.few,u.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${b.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${D}${b.minimum.toString()} ${g}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${b.origin} \u0431\u0443\u0434\u0435\u0442 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${D.prefix}"`;if(D.format==="ends_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${D.suffix}"`;if(D.format==="includes")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${D.includes}"`;if(D.format==="regex")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${D.pattern}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${b.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${b.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${b.keys.length>1?"\u0438":""}: ${B(b.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${b.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${b.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function N7(){return{localeError:so()}}var $t=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(b){return $[b]??null}let U={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},I={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${b.expected}, prejeto ${w}`;return`Neveljaven vnos: pri\u010Dakovano ${D}, prejeto ${w}`}case"invalid_value":if(b.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${T(b.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Preveliko: pri\u010Dakovano, da bo ${b.origin??"vrednost"} imelo ${D}${b.maximum.toString()} ${u.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${b.origin??"vrednost"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Premajhno: pri\u010Dakovano, da bo ${b.origin} imelo ${D}${b.minimum.toString()} ${u.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Neveljaven niz: mora se za\u010Deti z "${D.prefix}"`;if(D.format==="ends_with")return`Neveljaven niz: mora se kon\u010Dati z "${D.suffix}"`;if(D.format==="includes")return`Neveljaven niz: mora vsebovati "${D.includes}"`;if(D.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${D.pattern}`;return`Neveljaven ${U[D.format]??b.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${b.divisor}`;case"unrecognized_keys":return`Neprepoznan${b.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${B(b.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${b.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${b.origin}`;default:return"Neveljaven vnos"}}};function S7(){return{localeError:$t()}}var vt=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function v(b){return $[b]??null}let U={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},I={nan:"NaN",number:"antal",array:"lista"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${b.expected}, fick ${w}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${D}, fick ${w}`}case"invalid_value":if(b.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${T(b.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${b.origin??"v\xE4rdet"} att ha ${D}${b.maximum.toString()} ${u.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${b.origin??"v\xE4rdet"} att ha ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${b.origin??"v\xE4rdet"} att ha ${D}${b.minimum.toString()} ${u.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${b.origin??"v\xE4rdet"} att ha ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${D.prefix}"`;if(D.format==="ends_with")return`Ogiltig str\xE4ng: m\xE5ste sluta med "${D.suffix}"`;if(D.format==="includes")return`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${D.includes}"`;if(D.format==="regex")return`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${D.pattern}"`;return`Ogiltig(t) ${U[D.format]??b.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${b.divisor}`;case"unrecognized_keys":return`${b.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${B(b.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${b.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${b.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function M7(){return{localeError:vt()}}var bt=()=>{let $={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function v(b){return $[b]??null}let U={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},I={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${b.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${D}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${w}`}case"invalid_value":if(b.values.length===1)return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${T(b.values[0])}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${B(b.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${D}${b.maximum.toString()} ${u.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${D}${b.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b.origin} ${D}${b.minimum.toString()} ${u.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${b.origin} ${D}${b.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${D.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(D.format==="ends_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${D.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(D.format==="includes")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${D.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(D.format==="regex")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${D.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${b.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${b.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${b.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function _7(){return{localeError:bt()}}var Ut=()=>{let $={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function v(b){return $[b]??null}let U={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},I={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${b.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${w}`;return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${D} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${w}`}case"invalid_value":if(b.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${T(b.values[0])}`;return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",u=v(b.origin);if(u)return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${b.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${D} ${b.maximum.toString()} ${u.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${b.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${D} ${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",u=v(b.origin);if(u)return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${b.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${D} ${b.minimum.toString()} ${u.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${b.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${D} ${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${D.prefix}"`;if(D.format==="ends_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${D.suffix}"`;if(D.format==="includes")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${D.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;if(D.format==="regex")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${D.pattern}`;return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${U[D.format]??b.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${b.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${B(b.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${b.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${b.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function F7(){return{localeError:Ut()}}var It=()=>{let $={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function v(b){return $[b]??null}let U={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${b.expected}, al\u0131nan ${w}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${D}, al\u0131nan ${w}`}case"invalid_value":if(b.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${T(b.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\xC7ok b\xFCy\xFCk: beklenen ${b.origin??"de\u011Fer"} ${D}${b.maximum.toString()} ${u.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${b.origin??"de\u011Fer"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${b.origin} ${D}${b.minimum.toString()} ${u.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Ge\xE7ersiz metin: "${D.prefix}" ile ba\u015Flamal\u0131`;if(D.format==="ends_with")return`Ge\xE7ersiz metin: "${D.suffix}" ile bitmeli`;if(D.format==="includes")return`Ge\xE7ersiz metin: "${D.includes}" i\xE7ermeli`;if(D.format==="regex")return`Ge\xE7ersiz metin: ${D.pattern} desenine uymal\u0131`;return`Ge\xE7ersiz ${U[D.format]??b.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${b.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${b.keys.length>1?"lar":""}: ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${b.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function Z7(){return{localeError:It()}}var Dt=()=>{let $={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function v(b){return $[b]??null}let U={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},I={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${b.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${w}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${D}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${w}`}case"invalid_value":if(b.values.length===1)return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${T(b.values[0])}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${u.verb} ${D}${b.maximum.toString()} ${u.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${b.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${b.origin} ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${b.origin} \u0431\u0443\u0434\u0435 ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${D.prefix}"`;if(D.format==="ends_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${D.suffix}"`;if(D.format==="includes")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${D.includes}"`;if(D.format==="regex")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${D.pattern}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${b.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${b.keys.length>1?"\u0456":""}: ${B(b.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${b.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${b.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function I0(){return{localeError:Dt()}}function T7(){return I0()}var ut=()=>{let $={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function v(b){return $[b]??null}let U={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},I={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${b.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${w} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${D} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${w} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":if(b.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${T(b.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${B(b.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${b.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${D}${b.maximum.toString()} ${u.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${b.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${D}${b.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${b.origin} \u06A9\u06D2 ${D}${b.minimum.toString()} ${u.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${b.origin} \u06A9\u0627 ${D}${b.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${D.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(D.format==="ends_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${D.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(D.format==="includes")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${D.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(D.format==="regex")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${D.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;return`\u063A\u0644\u0637 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${b.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${b.keys.length>1?"\u0632":""}: ${B(b.keys,"\u060C ")}`;case"invalid_key":return`${b.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${b.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function k7(){return{localeError:ut()}}var wt=()=>{let $={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function v(b){return $[b]??null}let U={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},I={nan:"NaN",number:"raqam",array:"massiv"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${b.expected}, qabul qilingan ${w}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${D}, qabul qilingan ${w}`}case"invalid_value":if(b.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${T(b.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Juda katta: kutilgan ${b.origin??"qiymat"} ${D}${b.maximum.toString()} ${u.unit} ${u.verb}`;return`Juda katta: kutilgan ${b.origin??"qiymat"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Juda kichik: kutilgan ${b.origin} ${D}${b.minimum.toString()} ${u.unit} ${u.verb}`;return`Juda kichik: kutilgan ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Noto\u2018g\u2018ri satr: "${D.prefix}" bilan boshlanishi kerak`;if(D.format==="ends_with")return`Noto\u2018g\u2018ri satr: "${D.suffix}" bilan tugashi kerak`;if(D.format==="includes")return`Noto\u2018g\u2018ri satr: "${D.includes}" ni o\u2018z ichiga olishi kerak`;if(D.format==="regex")return`Noto\u2018g\u2018ri satr: ${D.pattern} shabloniga mos kelishi kerak`;return`Noto\u2018g\u2018ri ${U[D.format]??b.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${b.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${b.keys.length>1?"lar":""}: ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${b.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function E7(){return{localeError:wt()}}var gt=()=>{let $={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function v(b){return $[b]??null}let U={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},I={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${b.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${w}`;return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${D}, nh\u1EADn \u0111\u01B0\u1EE3c ${w}`}case"invalid_value":if(b.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${T(b.values[0])}`;return`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${b.origin??"gi\xE1 tr\u1ECB"} ${u.verb} ${D}${b.maximum.toString()} ${u.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${b.origin??"gi\xE1 tr\u1ECB"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${b.origin} ${u.verb} ${D}${b.minimum.toString()} ${u.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${D.prefix}"`;if(D.format==="ends_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${D.suffix}"`;if(D.format==="includes")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${D.includes}"`;if(D.format==="regex")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${D.pattern}`;return`${U[D.format]??b.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${b.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${B(b.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${b.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${b.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function R7(){return{localeError:gt()}}var Jt=()=>{let $={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function v(b){return $[b]??null}let U={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},I={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${b.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${w}`;return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${D}\uFF0C\u5B9E\u9645\u63A5\u6536 ${w}`}case"invalid_value":if(b.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${T(b.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${b.origin??"\u503C"} ${D}${b.maximum.toString()} ${u.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${b.origin??"\u503C"} ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${b.origin} ${D}${b.minimum.toString()} ${u.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${b.origin} ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${D.prefix}" \u5F00\u5934`;if(D.format==="ends_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${D.suffix}" \u7ED3\u5C3E`;if(D.format==="includes")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${D.includes}"`;if(D.format==="regex")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${D.pattern}`;return`\u65E0\u6548${U[D.format]??b.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${b.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${B(b.keys,", ")}`;case"invalid_key":return`${b.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${b.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function n7(){return{localeError:Jt()}}var Xt=()=>{let $={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function v(b){return $[b]??null}let U={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},I={nan:"NaN"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${b.expected}\uFF0C\u4F46\u6536\u5230 ${w}`;return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${D}\uFF0C\u4F46\u6536\u5230 ${w}`}case"invalid_value":if(b.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${T(b.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${b.origin??"\u503C"} \u61C9\u70BA ${D}${b.maximum.toString()} ${u.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${b.origin??"\u503C"} \u61C9\u70BA ${D}${b.maximum.toString()}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${b.origin} \u61C9\u70BA ${D}${b.minimum.toString()} ${u.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${b.origin} \u61C9\u70BA ${D}${b.minimum.toString()}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${D.prefix}" \u958B\u982D`;if(D.format==="ends_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${D.suffix}" \u7D50\u5C3E`;if(D.format==="includes")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${D.includes}"`;if(D.format==="regex")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${D.pattern}`;return`\u7121\u6548\u7684 ${U[D.format]??b.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${b.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${b.keys.length>1?"\u5011":""}\uFF1A${B(b.keys,"\u3001")}`;case"invalid_key":return`${b.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${b.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function r7(){return{localeError:Xt()}}var Wt=()=>{let $={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function v(b){return $[b]??null}let U={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},I={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return(b)=>{switch(b.code){case"invalid_type":{let D=I[b.expected]??b.expected,u=E(b.input),w=I[u]??u;if(/^[A-Z]/.test(b.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${b.expected}, \xE0m\u1ECD\u0300 a r\xED ${w}`;return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${D}, \xE0m\u1ECD\u0300 a r\xED ${w}`}case"invalid_value":if(b.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${T(b.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${B(b.values,"|")}`;case"too_big":{let D=b.inclusive?"<=":"<",u=v(b.origin);if(u)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${b.origin??"iye"} ${u.verb} ${D}${b.maximum} ${u.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${D}${b.maximum}`}case"too_small":{let D=b.inclusive?">=":">",u=v(b.origin);if(u)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${b.origin} ${u.verb} ${D}${b.minimum} ${u.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${D}${b.minimum}`}case"invalid_format":{let D=b;if(D.format==="starts_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${D.prefix}"`;if(D.format==="ends_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${D.suffix}"`;if(D.format==="includes")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${D.includes}"`;if(D.format==="regex")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${D.pattern}`;return`A\u1E63\xEC\u1E63e: ${U[D.format]??b.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${b.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${B(b.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${b.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${b.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function C7(){return{localeError:Wt()}}var cS,i7=Symbol("ZodOutput"),x7=Symbol("ZodInput");class l7{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let U=v[0];if(this._map.set($,U),U&&typeof U==="object"&&"id"in U)this._idmap.set(U.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let U={...this.get(v)??{}};delete U.id;let I={...U,...this._map.get($)};return Object.keys(I).length?I:void 0}return this._map.get($)}has($){return this._map.has($)}}function _g(){return new l7}(cS=globalThis).__zod_globalRegistry??(cS.__zod_globalRegistry=_g());var uv=globalThis.__zod_globalRegistry;function f7($,v){return new $({type:"string",...C(v)})}function y7($,v){return new $({type:"string",coerce:!0,...C(v)})}function Fg($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...C(v)})}function u0($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...C(v)})}function Zg($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...C(v)})}function Tg($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(v)})}function kg($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(v)})}function Eg($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(v)})}function w0($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...C(v)})}function Rg($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...C(v)})}function ng($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(v)})}function rg($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...C(v)})}function Cg($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(v)})}function ig($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...C(v)})}function xg($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...C(v)})}function lg($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(v)})}function fg($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(v)})}function yg($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(v)})}function h7($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...C(v)})}function hg($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(v)})}function mg($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(v)})}function cg($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...C(v)})}function og($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...C(v)})}function tg($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...C(v)})}function dg($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...C(v)})}var m7={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function c7($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(v)})}function o7($,v){return new $({type:"string",format:"date",check:"string_format",...C(v)})}function t7($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...C(v)})}function d7($,v){return new $({type:"string",format:"duration",check:"string_format",...C(v)})}function p7($,v){return new $({type:"number",checks:[],...C(v)})}function a7($,v){return new $({type:"number",coerce:!0,checks:[],...C(v)})}function e7($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...C(v)})}function s7($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...C(v)})}function $3($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...C(v)})}function v3($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...C(v)})}function b3($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...C(v)})}function U3($,v){return new $({type:"boolean",...C(v)})}function I3($,v){return new $({type:"boolean",coerce:!0,...C(v)})}function D3($,v){return new $({type:"bigint",...C(v)})}function u3($,v){return new $({type:"bigint",coerce:!0,...C(v)})}function w3($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(v)})}function g3($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(v)})}function J3($,v){return new $({type:"symbol",...C(v)})}function X3($,v){return new $({type:"undefined",...C(v)})}function W3($,v){return new $({type:"null",...C(v)})}function G3($){return new $({type:"any"})}function O3($){return new $({type:"unknown"})}function H3($,v){return new $({type:"never",...C(v)})}function z3($,v){return new $({type:"void",...C(v)})}function Q3($,v){return new $({type:"date",...C(v)})}function Y3($,v){return new $({type:"date",coerce:!0,...C(v)})}function V3($,v){return new $({type:"nan",...C(v)})}function T4($,v){return new Yg({check:"less_than",...C(v),value:$,inclusive:!1})}function ov($,v){return new Yg({check:"less_than",...C(v),value:$,inclusive:!0})}function k4($,v){return new Vg({check:"greater_than",...C(v),value:$,inclusive:!1})}function jv($,v){return new Vg({check:"greater_than",...C(v),value:$,inclusive:!0})}function pg($){return k4(0,$)}function ag($){return T4(0,$)}function eg($){return ov(0,$)}function sg($){return jv(0,$)}function E6($,v){return new zY({check:"multiple_of",...C(v),value:$})}function R6($,v){return new VY({check:"max_size",...C(v),maximum:$})}function E4($,v){return new LY({check:"min_size",...C(v),minimum:$})}function kb($,v){return new KY({check:"size_equals",...C(v),size:$})}function Eb($,v){return new qY({check:"max_length",...C(v),maximum:$})}function e4($,v){return new BY({check:"min_length",...C(v),minimum:$})}function Rb($,v){return new AY({check:"length_equals",...C(v),length:$})}function hU($,v){return new PY({check:"string_format",format:"regex",...C(v),pattern:$})}function mU($){return new jY({check:"string_format",format:"lowercase",...C($)})}function cU($){return new NY({check:"string_format",format:"uppercase",...C($)})}function oU($,v){return new SY({check:"string_format",format:"includes",...C(v),includes:$})}function tU($,v){return new MY({check:"string_format",format:"starts_with",...C(v),prefix:$})}function dU($,v){return new _Y({check:"string_format",format:"ends_with",...C(v),suffix:$})}function $J($,v,U){return new FY({check:"property",property:$,schema:v,...C(U)})}function pU($,v){return new ZY({check:"mime_type",mime:$,...C(v)})}function J4($){return new TY({check:"overwrite",tx:$})}function aU($){return J4((v)=>v.normalize($))}function eU(){return J4(($)=>$.trim())}function sU(){return J4(($)=>$.toLowerCase())}function $I(){return J4(($)=>$.toUpperCase())}function vI(){return J4(($)=>MQ($))}function L3($,v,U){return new $({type:"array",element:v,...C(U)})}function Ot($,v,U){return new $({type:"union",options:v,...C(U)})}function Ht($,v,U){return new $({type:"union",options:v,inclusive:!1,...C(U)})}function zt($,v,U,I){return new $({type:"union",options:U,discriminator:v,...C(I)})}function Qt($,v,U){return new $({type:"intersection",left:v,right:U})}function Yt($,v,U,I){let b=U instanceof v$;return new $({type:"tuple",items:v,rest:b?U:null,...C(b?I:U)})}function Vt($,v,U,I){return new $({type:"record",keyType:v,valueType:U,...C(I)})}function Lt($,v,U,I){return new $({type:"map",keyType:v,valueType:U,...C(I)})}function Kt($,v,U){return new $({type:"set",valueType:v,...C(U)})}function qt($,v,U){let I=Array.isArray(v)?Object.fromEntries(v.map((b)=>[b,b])):v;return new $({type:"enum",entries:I,...C(U)})}function Bt($,v,U){return new $({type:"enum",entries:v,...C(U)})}function At($,v,U){return new $({type:"literal",values:Array.isArray(v)?v:[v],...C(U)})}function K3($,v){return new $({type:"file",...C(v)})}function Pt($,v){return new $({type:"transform",transform:v})}function jt($,v){return new $({type:"optional",innerType:v})}function Nt($,v){return new $({type:"nullable",innerType:v})}function St($,v,U){return new $({type:"default",innerType:v,get defaultValue(){return typeof U==="function"?U():FQ(U)}})}function Mt($,v,U){return new $({type:"nonoptional",innerType:v,...C(U)})}function _t($,v){return new $({type:"success",innerType:v})}function Ft($,v,U){return new $({type:"catch",innerType:v,catchValue:typeof U==="function"?U:()=>U})}function Zt($,v,U){return new $({type:"pipe",in:v,out:U})}function Tt($,v){return new $({type:"readonly",innerType:v})}function kt($,v,U){return new $({type:"template_literal",parts:v,...C(U)})}function Et($,v){return new $({type:"lazy",getter:v})}function Rt($,v){return new $({type:"promise",innerType:v})}function q3($,v,U){let I=C(U);return I.abort??(I.abort=!0),new $({type:"custom",check:"custom",fn:v,...I})}function B3($,v,U){return new $({type:"custom",check:"custom",fn:v,...C(U)})}function A3($,v){let U=oS((I)=>{return I.addIssue=(b)=>{if(typeof b==="string")I.issues.push(rU(b,I.value,U._zod.def));else{let D=b;if(D.fatal)D.continue=!1;D.code??(D.code="custom"),D.input??(D.input=I.value),D.inst??(D.inst=U),D.continue??(D.continue=!U._zod.def.abort),I.issues.push(rU(D))}},$(I.value,I)},v);return U}function oS($,v){let U=new Z$({check:"custom",...C(v)});return U._zod.check=$,U}function P3($){let v=new Z$({check:"describe"});return v._zod.onattach=[(U)=>{let I=uv.get(U)??{};uv.add(U,{...I,description:$})}],v._zod.check=()=>{},v}function j3($){let v=new Z$({check:"meta"});return v._zod.onattach=[(U)=>{let I=uv.get(U)??{};uv.add(U,{...I,...$})}],v._zod.check=()=>{},v}function N3($,v){let U=C(v),I=U.truthy??["true","1","yes","on","y","enabled"],b=U.falsy??["false","0","no","off","n","disabled"];if(U.case!=="sensitive")I=I.map((O)=>typeof O==="string"?O.toLowerCase():O),b=b.map((O)=>typeof O==="string"?O.toLowerCase():O);let D=new Set(I),u=new Set(b),w=$.Codec??$0,g=$.Boolean??e1,X=new($.String??Tb)({type:"string",error:U.error}),W=new g({type:"boolean",error:U.error}),G=new w({type:"pipe",in:X,out:W,transform:(O,z)=>{let Q=O;if(U.case!=="sensitive")Q=Q.toLowerCase();if(D.has(Q))return!0;else if(u.has(Q))return!1;else return z.issues.push({code:"invalid_value",expected:"stringbool",values:[...D,...u],input:z.value,inst:G,continue:!1}),{}},reverseTransform:(O,z)=>{if(O===!0)return I[0]||"true";else return b[0]||"false"},error:U.error});return G}function bI($,v,U,I={}){let b=C(I),D={...C(I),check:"string_format",type:"string",format:v,fn:typeof U==="function"?U:(w)=>U.test(w),...b};if(U instanceof RegExp)D.pattern=U;return new $(D)}function n6($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??uv,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function B$($,v,U={path:[],schemaPath:[]}){var I;let b=$._zod.def,D=v.seen.get($);if(D){if(D.count++,U.schemaPath.includes($))D.cycle=U.path;return D.schema}let u={schema:{},count:1,cycle:void 0,path:U.path};v.seen.set($,u);let w=$._zod.toJSONSchema?.();if(w)u.schema=w;else{let X={...U,schemaPath:[...U.schemaPath,$],path:U.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,u.schema,X);else{let G=u.schema,O=v.processors[b.type];if(!O)throw Error(`[toJSONSchema]: Non-representable type encountered: ${b.type}`);O($,v,G,X)}let W=$._zod.parent;if(W){if(!u.ref)u.ref=W;B$(W,v,X),v.seen.get(W).isParent=!0}}let g=v.metadataRegistry.get($);if(g)Object.assign(u.schema,g);if(v.io==="input"&&Nv($))delete u.schema.examples,delete u.schema.default;if(v.io==="input"&&"_prefault"in u.schema)(I=u.schema).default??(I.default=u.schema._prefault);return delete u.schema._prefault,v.seen.get($).schema}function r6($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let I=new Map;for(let u of $.seen.entries()){let w=$.metadataRegistry.get(u[0])?.id;if(w){let g=I.get(w);if(g&&g!==u[0])throw Error(`Duplicate schema id "${w}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);I.set(w,u[0])}}let b=(u)=>{let w=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let W=$.external.registry.get(u[0])?.id,G=$.external.uri??((z)=>z);if(W)return{ref:G(W)};let O=u[1].defId??u[1].schema.id??`schema${$.counter++}`;return u[1].defId=O,{defId:O,ref:`${G("__shared")}#/${w}/${O}`}}if(u[1]===U)return{ref:"#"};let J=`${"#"}/${w}/`,X=u[1].schema.id??`__schema${$.counter++}`;return{defId:X,ref:J+X}},D=(u)=>{if(u[1].schema.$ref)return;let w=u[1],{ref:g,defId:J}=b(u);if(w.def={...w.schema},J)w.defId=J;let X=w.schema;for(let W in X)delete X[W];X.$ref=g};if($.cycles==="throw")for(let u of $.seen.entries()){let w=u[1];if(w.cycle)throw Error(`Cycle detected: #/${w.cycle?.join("/")}/<root>
305
305
 
306
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let u of $.seen.entries()){let w=u[1];if(v===u[0]){D(u);continue}if($.external){let J=$.external.registry.get(u[0])?.id;if(v!==u[0]&&J){D(u);continue}}if($.metadataRegistry.get(u[0])?.id){D(u);continue}if(w.cycle){D(u);continue}if(w.count>1){if($.reused==="ref"){D(u);continue}}}}function C6($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let I=(w)=>{let g=$.seen.get(w);if(g.ref===null)return;let J=g.def??g.schema,X={...J},W=g.ref;if(g.ref=null,W){I(W);let O=$.seen.get(W),z=O.schema;if(z.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(z);else Object.assign(J,z);if(Object.assign(J,X),w._zod.parent===W)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(!(Y in X))delete J[Y]}if(z.$ref&&O.def)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(Y in O.def&&JSON.stringify(J[Y])===JSON.stringify(O.def[Y]))delete J[Y]}}let G=w._zod.parent;if(G&&G!==W){I(G);let O=$.seen.get(G);if(O?.schema.$ref){if(J.$ref=O.schema.$ref,O.def)for(let z in J){if(z==="$ref"||z==="allOf")continue;if(z in O.def&&JSON.stringify(J[z])===JSON.stringify(O.def[z]))delete J[z]}}}$.override({zodSchema:w,jsonSchema:J,path:g.path??[]})};for(let w of[...$.seen.entries()].reverse())I(w[0]);let b={};if($.target==="draft-2020-12")b.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")b.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")b.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let w=$.external.registry.get(v)?.id;if(!w)throw Error("Schema is missing an `id` property");b.$id=$.external.uri(w)}Object.assign(b,U.def??U.schema);let D=$.metadataRegistry.get(v)?.id;if(D!==void 0&&b.id===D)delete b.id;let u=$.external?.defs??{};for(let w of $.seen.entries()){let g=w[1];if(g.def&&g.defId){if(g.def.id===g.defId)delete g.def.id;u[g.defId]=g.def}}if($.external);else if(Object.keys(u).length>0)if($.target==="draft-2020-12")b.$defs=u;else b.definitions=u;try{let w=JSON.parse(JSON.stringify(b));return Object.defineProperty(w,"~standard",{value:{...v["~standard"],jsonSchema:{input:UI(v,"input",$.processors),output:UI(v,"output",$.processors)}},enumerable:!1,writable:!1}),w}catch(w){throw Error("Error converting schema to JSON.")}}function Nv($,v){let U=v??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let I=$._zod.def;if(I.type==="transform")return!0;if(I.type==="array")return Nv(I.element,U);if(I.type==="set")return Nv(I.valueType,U);if(I.type==="lazy")return Nv(I.getter(),U);if(I.type==="promise"||I.type==="optional"||I.type==="nonoptional"||I.type==="nullable"||I.type==="readonly"||I.type==="default"||I.type==="prefault")return Nv(I.innerType,U);if(I.type==="intersection")return Nv(I.left,U)||Nv(I.right,U);if(I.type==="record"||I.type==="map")return Nv(I.keyType,U)||Nv(I.valueType,U);if(I.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return Nv(I.in,U)||Nv(I.out,U)}if(I.type==="object"){for(let b in I.shape)if(Nv(I.shape[b],U))return!0;return!1}if(I.type==="union"){for(let b of I.options)if(Nv(b,U))return!0;return!1}if(I.type==="tuple"){for(let b of I.items)if(Nv(b,U))return!0;if(I.rest&&Nv(I.rest,U))return!0;return!1}return!1}var S3=($,v={})=>(U)=>{let I=n6({...U,processors:v});return B$($,I),r6(I,$),C6(I,$)},UI=($,v,U={})=>(I)=>{let{libraryOptions:b,target:D}=I??{},u=n6({...b??{},target:D,io:v,processors:U});return B$($,u),r6(u,$),C6(u,$)};var nt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},M3=($,v,U,I)=>{let b=U;b.type="string";let{minimum:D,maximum:u,format:w,patterns:g,contentEncoding:J}=$._zod.bag;if(typeof D==="number")b.minLength=D;if(typeof u==="number")b.maxLength=u;if(w){if(b.format=nt[w]??w,b.format==="")delete b.format;if(w==="time")delete b.format}if(J)b.contentEncoding=J;if(g&&g.size>0){let X=[...g];if(X.length===1)b.pattern=X[0].source;else if(X.length>1)b.allOf=[...X.map((W)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:W.source}))]}},_3=($,v,U,I)=>{let b=U,{minimum:D,maximum:u,format:w,multipleOf:g,exclusiveMaximum:J,exclusiveMinimum:X}=$._zod.bag;if(typeof w==="string"&&w.includes("int"))b.type="integer";else b.type="number";let W=typeof X==="number"&&X>=(D??Number.NEGATIVE_INFINITY),G=typeof J==="number"&&J<=(u??Number.POSITIVE_INFINITY),O=v.target==="draft-04"||v.target==="openapi-3.0";if(W)if(O)b.minimum=X,b.exclusiveMinimum=!0;else b.exclusiveMinimum=X;else if(typeof D==="number")b.minimum=D;if(G)if(O)b.maximum=J,b.exclusiveMaximum=!0;else b.exclusiveMaximum=J;else if(typeof u==="number")b.maximum=u;if(typeof g==="number")b.multipleOf=g},F3=($,v,U,I)=>{U.type="boolean"},Z3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},T3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},k3=($,v,U,I)=>{if(v.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},E3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},R3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},n3=($,v,U,I)=>{U.not={}},r3=($,v,U,I)=>{},C3=($,v,U,I)=>{},i3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},x3=($,v,U,I)=>{let b=$._zod.def,D=l1(b.entries);if(D.every((u)=>typeof u==="number"))U.type="number";if(D.every((u)=>typeof u==="string"))U.type="string";U.enum=D},l3=($,v,U,I)=>{let b=$._zod.def,D=[];for(let u of b.values)if(u===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else D.push(Number(u));else D.push(u);if(D.length===0);else if(D.length===1){let u=D[0];if(U.type=u===null?"null":typeof u,v.target==="draft-04"||v.target==="openapi-3.0")U.enum=[u];else U.const=u}else{if(D.every((u)=>typeof u==="number"))U.type="number";if(D.every((u)=>typeof u==="string"))U.type="string";if(D.every((u)=>typeof u==="boolean"))U.type="boolean";if(D.every((u)=>u===null))U.type="null";U.enum=D}},f3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},y3=($,v,U,I)=>{let b=U,D=$._zod.pattern;if(!D)throw Error("Pattern not found in template literal");b.type="string",b.pattern=D.source},h3=($,v,U,I)=>{let b=U,D={type:"string",format:"binary",contentEncoding:"binary"},{minimum:u,maximum:w,mime:g}=$._zod.bag;if(u!==void 0)D.minLength=u;if(w!==void 0)D.maxLength=w;if(g)if(g.length===1)D.contentMediaType=g[0],Object.assign(b,D);else Object.assign(b,D),b.anyOf=g.map((J)=>({contentMediaType:J}));else Object.assign(b,D)},m3=($,v,U,I)=>{U.type="boolean"},c3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},o3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},t3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},d3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},p3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},a3=($,v,U,I)=>{let b=U,D=$._zod.def,{minimum:u,maximum:w}=$._zod.bag;if(typeof u==="number")b.minItems=u;if(typeof w==="number")b.maxItems=w;b.type="array",b.items=B$(D.element,v,{...I,path:[...I.path,"items"]})},e3=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="object",b.properties={};let u=D.shape;for(let J in u)b.properties[J]=B$(u[J],v,{...I,path:[...I.path,"properties",J]});let w=new Set(Object.keys(u)),g=new Set([...w].filter((J)=>{let X=D.shape[J]._zod;if(v.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(g.size>0)b.required=Array.from(g);if(D.catchall?._zod.def.type==="never")b.additionalProperties=!1;else if(!D.catchall){if(v.io==="output")b.additionalProperties=!1}else if(D.catchall)b.additionalProperties=B$(D.catchall,v,{...I,path:[...I.path,"additionalProperties"]})},bJ=($,v,U,I)=>{let b=$._zod.def,D=b.inclusive===!1,u=b.options.map((w,g)=>B$(w,v,{...I,path:[...I.path,D?"oneOf":"anyOf",g]}));if(D)U.oneOf=u;else U.anyOf=u},s3=($,v,U,I)=>{let b=$._zod.def,D=B$(b.left,v,{...I,path:[...I.path,"allOf",0]}),u=B$(b.right,v,{...I,path:[...I.path,"allOf",1]}),w=(J)=>("allOf"in J)&&Object.keys(J).length===1,g=[...w(D)?D.allOf:[D],...w(u)?u.allOf:[u]];U.allOf=g},$V=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="array";let u=v.target==="draft-2020-12"?"prefixItems":"items",w=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",g=D.items.map((G,O)=>B$(G,v,{...I,path:[...I.path,u,O]})),J=D.rest?B$(D.rest,v,{...I,path:[...I.path,w,...v.target==="openapi-3.0"?[D.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(b.prefixItems=g,J)b.items=J}else if(v.target==="openapi-3.0"){if(b.items={anyOf:g},J)b.items.anyOf.push(J);if(b.minItems=g.length,!J)b.maxItems=g.length}else if(b.items=g,J)b.additionalItems=J;let{minimum:X,maximum:W}=$._zod.bag;if(typeof X==="number")b.minItems=X;if(typeof W==="number")b.maxItems=W},vV=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="object";let u=D.keyType,g=u._zod.bag?.patterns;if(D.mode==="loose"&&g&&g.size>0){let X=B$(D.valueType,v,{...I,path:[...I.path,"patternProperties","*"]});b.patternProperties={};for(let W of g)b.patternProperties[W.source]=X}else{if(v.target==="draft-07"||v.target==="draft-2020-12")b.propertyNames=B$(D.keyType,v,{...I,path:[...I.path,"propertyNames"]});b.additionalProperties=B$(D.valueType,v,{...I,path:[...I.path,"additionalProperties"]})}let J=u._zod.values;if(J){let X=[...J].filter((W)=>typeof W==="string"||typeof W==="number");if(X.length>0)b.required=X}},bV=($,v,U,I)=>{let b=$._zod.def,D=B$(b.innerType,v,I),u=v.seen.get($);if(v.target==="openapi-3.0")u.ref=b.innerType,U.nullable=!0;else U.anyOf=[D,{type:"null"}]},UV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},IV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType,U.default=JSON.parse(JSON.stringify(b.defaultValue))},DV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);if(D.ref=b.innerType,v.io==="input")U._prefault=JSON.parse(JSON.stringify(b.defaultValue))},uV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType;let u;try{u=b.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=u},wV=($,v,U,I)=>{let b=$._zod.def,D=b.in._zod.traits.has("$ZodTransform"),u=v.io==="input"?D?b.out:b.in:b.out;B$(u,v,I);let w=v.seen.get($);w.ref=u},gV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType,U.readOnly=!0},JV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},UJ=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},XV=($,v,U,I)=>{let b=$._zod.innerType;B$(b,v,I);let D=v.seen.get($);D.ref=b},vJ={string:M3,number:_3,boolean:F3,bigint:Z3,symbol:T3,null:k3,undefined:E3,void:R3,never:n3,any:r3,unknown:C3,date:i3,enum:x3,literal:l3,nan:f3,template_literal:y3,file:h3,success:m3,custom:c3,function:o3,transform:t3,map:d3,set:p3,array:a3,object:e3,union:bJ,intersection:s3,tuple:$V,record:vV,nullable:bV,nonoptional:UV,default:IV,prefault:DV,catch:uV,pipe:wV,readonly:gV,promise:JV,optional:UJ,lazy:XV};function IJ($,v){if("_idmap"in $){let I=$,b=n6({...v,processors:vJ}),D={};for(let g of I._idmap.entries()){let[J,X]=g;B$(X,b)}let u={},w={registry:I,uri:v?.uri,defs:D};b.external=w;for(let g of I._idmap.entries()){let[J,X]=g;r6(b,X),u[J]=C6(b,X)}if(Object.keys(D).length>0){let g=b.target==="draft-2020-12"?"$defs":"definitions";u.__shared={[g]:D}}return{schemas:u}}let U=n6({...v,processors:vJ});return B$($,U),r6(U,$),C6(U,$)}class WV{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($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=n6({processors:vJ,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return B$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}r6(this.ctx,$);let U=C6(this.ctx,$),{"~standard":I,...b}=U;return b}}var tS={};var g0={};e$(g0,{xor:()=>lM,xid:()=>XM,void:()=>RM,uuidv7:()=>bM,uuidv6:()=>vM,uuidv4:()=>$M,uuid:()=>sS,url:()=>UM,unknown:()=>nb,union:()=>ZJ,undefined:()=>kM,ulid:()=>JM,uint64:()=>ZM,uint32:()=>MM,tuple:()=>mV,transform:()=>kJ,templateLiteral:()=>v_,symbol:()=>TM,superRefine:()=>LL,success:()=>aM,stringbool:()=>J_,stringFormat:()=>qM,string:()=>J0,strictObject:()=>iM,set:()=>cM,refine:()=>VL,record:()=>cV,readonly:()=>GL,promise:()=>b_,preprocess:()=>W_,prefault:()=>IL,pipe:()=>WJ,partialRecord:()=>yM,optional:()=>W0,object:()=>CM,number:()=>_V,nullish:()=>pM,nullable:()=>G0,null:()=>EV,nonoptional:()=>DL,never:()=>FJ,nativeEnum:()=>oM,nanoid:()=>uM,nan:()=>eM,meta:()=>w_,map:()=>mM,mac:()=>OM,looseRecord:()=>hM,looseObject:()=>xM,literal:()=>tM,lazy:()=>zL,ksuid:()=>WM,keyof:()=>rM,jwt:()=>KM,json:()=>X_,ipv6:()=>HM,ipv4:()=>GM,invertCodec:()=>$_,intersection:()=>yV,int64:()=>FM,int32:()=>SM,int:()=>XJ,instanceof:()=>g_,httpUrl:()=>IM,hostname:()=>BM,hex:()=>AM,hash:()=>PM,guid:()=>eS,function:()=>U_,float64:()=>NM,float32:()=>jM,file:()=>dM,exactOptional:()=>sV,enum:()=>TJ,emoji:()=>DM,email:()=>aS,e164:()=>LM,discriminatedUnion:()=>fM,describe:()=>u_,date:()=>nM,custom:()=>D_,cuid2:()=>gM,cuid:()=>wM,codec:()=>sM,cidrv6:()=>QM,cidrv4:()=>zM,check:()=>I_,catch:()=>gL,boolean:()=>FV,bigint:()=>_M,base64url:()=>VM,base64:()=>YM,array:()=>Q0,any:()=>EM,_function:()=>U_,_default:()=>bL,_ZodString:()=>GJ,ZodXor:()=>xV,ZodXID:()=>LJ,ZodVoid:()=>CV,ZodUnknown:()=>nV,ZodUnion:()=>V0,ZodUndefined:()=>TV,ZodUUID:()=>R4,ZodURL:()=>H0,ZodULID:()=>VJ,ZodType:()=>I$,ZodTuple:()=>hV,ZodTransform:()=>aV,ZodTemplateLiteral:()=>OL,ZodSymbol:()=>ZV,ZodSuccess:()=>uL,ZodStringFormat:()=>S$,ZodString:()=>wI,ZodSet:()=>tV,ZodRecord:()=>DI,ZodReadonly:()=>WL,ZodPromise:()=>QL,ZodPreprocess:()=>XL,ZodPrefault:()=>UL,ZodPipe:()=>L0,ZodOptional:()=>EJ,ZodObject:()=>Y0,ZodNumberFormat:()=>rb,ZodNumber:()=>JI,ZodNullable:()=>$L,ZodNull:()=>kV,ZodNonOptional:()=>RJ,ZodNever:()=>rV,ZodNanoID:()=>zJ,ZodNaN:()=>JL,ZodMap:()=>oV,ZodMAC:()=>MV,ZodLiteral:()=>dV,ZodLazy:()=>HL,ZodKSUID:()=>KJ,ZodJWT:()=>MJ,ZodIntersection:()=>fV,ZodIPv6:()=>BJ,ZodIPv4:()=>qJ,ZodGUID:()=>X0,ZodFunction:()=>YL,ZodFile:()=>pV,ZodExactOptional:()=>eV,ZodEnum:()=>uI,ZodEmoji:()=>HJ,ZodEmail:()=>OJ,ZodE164:()=>SJ,ZodDiscriminatedUnion:()=>lV,ZodDefault:()=>vL,ZodDate:()=>z0,ZodCustomStringFormat:()=>gI,ZodCustom:()=>q0,ZodCodec:()=>K0,ZodCatch:()=>wL,ZodCUID2:()=>YJ,ZodCUID:()=>QJ,ZodCIDRv6:()=>PJ,ZodCIDRv4:()=>AJ,ZodBoolean:()=>XI,ZodBigIntFormat:()=>_J,ZodBigInt:()=>WI,ZodBase64URL:()=>NJ,ZodBase64:()=>jJ,ZodArray:()=>iV,ZodAny:()=>RV});var DJ={};e$(DJ,{uppercase:()=>cU,trim:()=>eU,toUpperCase:()=>$I,toLowerCase:()=>sU,startsWith:()=>tU,slugify:()=>vI,size:()=>kb,regex:()=>hU,property:()=>$J,positive:()=>pg,overwrite:()=>J4,normalize:()=>aU,nonpositive:()=>eg,nonnegative:()=>sg,negative:()=>ag,multipleOf:()=>E6,minSize:()=>E4,minLength:()=>e4,mime:()=>pU,maxSize:()=>R6,maxLength:()=>Eb,lte:()=>ov,lt:()=>T4,lowercase:()=>mU,length:()=>Rb,includes:()=>oU,gte:()=>jv,gt:()=>k4,endsWith:()=>dU});var II={};e$(II,{time:()=>HV,duration:()=>zV,datetime:()=>GV,date:()=>OV,ZodISOTime:()=>gJ,ZodISODuration:()=>JJ,ZodISODateTime:()=>uJ,ZodISODate:()=>wJ});var uJ=L("ZodISODateTime",($,v)=>{cY.init($,v),S$.init($,v)});function GV($){return c7(uJ,$)}var wJ=L("ZodISODate",($,v)=>{oY.init($,v),S$.init($,v)});function OV($){return o7(wJ,$)}var gJ=L("ZodISOTime",($,v)=>{tY.init($,v),S$.init($,v)});function HV($){return t7(gJ,$)}var JJ=L("ZodISODuration",($,v)=>{dY.init($,v),S$.init($,v)});function zV($){return d7(JJ,$)}var dS=($,v)=>{c1.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>t1($,U)},flatten:{value:(U)=>o1($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,RU,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,RU,2)}},isEmpty:{get(){return $.issues.length===0}}})},Ct=L("ZodError",dS),nv=L("ZodError",dS,{Parent:Error});var QV=CU(nv),YV=iU(nv),VV=xU(nv),LV=lU(nv),KV=gg(nv),qV=Jg(nv),BV=Xg(nv),AV=Wg(nv),PV=Gg(nv),jV=Og(nv),NV=Hg(nv),SV=zg(nv);var pS=new WeakMap;function O0($,v,U){let I=Object.getPrototypeOf($),b=pS.get(I);if(!b)b=new Set,pS.set(I,b);if(b.has(v))return;b.add(v);for(let D in U){let u=U[D];Object.defineProperty(I,D,{configurable:!0,enumerable:!1,get(){let w=u.bind(this);return Object.defineProperty(this,D,{configurable:!0,writable:!0,enumerable:!0,value:w}),w},set(w){Object.defineProperty(this,D,{configurable:!0,writable:!0,enumerable:!0,value:w})}})}}var I$=L("ZodType",($,v)=>{return v$.init($,v),Object.assign($["~standard"],{jsonSchema:{input:UI($,"input"),output:UI($,"output")}}),$.toJSONSchema=S3($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(U,I)=>QV($,U,I,{callee:$.parse}),$.safeParse=(U,I)=>VV($,U,I),$.parseAsync=async(U,I)=>YV($,U,I,{callee:$.parseAsync}),$.safeParseAsync=async(U,I)=>LV($,U,I),$.spa=$.safeParseAsync,$.encode=(U,I)=>KV($,U,I),$.decode=(U,I)=>qV($,U,I),$.encodeAsync=async(U,I)=>BV($,U,I),$.decodeAsync=async(U,I)=>AV($,U,I),$.safeEncode=(U,I)=>PV($,U,I),$.safeDecode=(U,I)=>jV($,U,I),$.safeEncodeAsync=async(U,I)=>NV($,U,I),$.safeDecodeAsync=async(U,I)=>SV($,U,I),O0($,"ZodType",{check(...U){let I=this.def;return this.clone(n.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}),{parent:!0})},with(...U){return this.check(...U)},clone(U,I){return Av(this,U,I)},brand(){return this},register(U,I){return U.add(this,I),this},refine(U,I){return this.check(VL(U,I))},superRefine(U,I){return this.check(LL(U,I))},overwrite(U){return this.check(J4(U))},optional(){return W0(this)},exactOptional(){return sV(this)},nullable(){return G0(this)},nullish(){return W0(G0(this))},nonoptional(U){return DL(this,U)},array(){return Q0(this)},or(U){return ZJ([this,U])},and(U){return yV(this,U)},transform(U){return WJ(this,kJ(U))},default(U){return bL(this,U)},prefault(U){return IL(this,U)},catch(U){return gL(this,U)},pipe(U){return WJ(this,U)},readonly(){return GL(this)},describe(U){let I=this.clone();return uv.add(I,{description:U}),I},meta(...U){if(U.length===0)return uv.get(this);let I=this.clone();return uv.add(I,U[0]),I},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(U){return U(this)}}),Object.defineProperty($,"description",{get(){return uv.get($)?.description},configurable:!0}),$}),GJ=L("_ZodString",($,v)=>{Tb.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>M3($,I,b,D);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,O0($,"_ZodString",{regex(...I){return this.check(hU(...I))},includes(...I){return this.check(oU(...I))},startsWith(...I){return this.check(tU(...I))},endsWith(...I){return this.check(dU(...I))},min(...I){return this.check(e4(...I))},max(...I){return this.check(Eb(...I))},length(...I){return this.check(Rb(...I))},nonempty(...I){return this.check(e4(1,...I))},lowercase(I){return this.check(mU(I))},uppercase(I){return this.check(cU(I))},trim(){return this.check(eU())},normalize(...I){return this.check(aU(...I))},toLowerCase(){return this.check(sU())},toUpperCase(){return this.check($I())},slugify(){return this.check(vI())}})}),wI=L("ZodString",($,v)=>{Tb.init($,v),GJ.init($,v),$.email=(U)=>$.check(Fg(OJ,U)),$.url=(U)=>$.check(w0(H0,U)),$.jwt=(U)=>$.check(dg(MJ,U)),$.emoji=(U)=>$.check(Rg(HJ,U)),$.guid=(U)=>$.check(u0(X0,U)),$.uuid=(U)=>$.check(Zg(R4,U)),$.uuidv4=(U)=>$.check(Tg(R4,U)),$.uuidv6=(U)=>$.check(kg(R4,U)),$.uuidv7=(U)=>$.check(Eg(R4,U)),$.nanoid=(U)=>$.check(ng(zJ,U)),$.guid=(U)=>$.check(u0(X0,U)),$.cuid=(U)=>$.check(rg(QJ,U)),$.cuid2=(U)=>$.check(Cg(YJ,U)),$.ulid=(U)=>$.check(ig(VJ,U)),$.base64=(U)=>$.check(cg(jJ,U)),$.base64url=(U)=>$.check(og(NJ,U)),$.xid=(U)=>$.check(xg(LJ,U)),$.ksuid=(U)=>$.check(lg(KJ,U)),$.ipv4=(U)=>$.check(fg(qJ,U)),$.ipv6=(U)=>$.check(yg(BJ,U)),$.cidrv4=(U)=>$.check(hg(AJ,U)),$.cidrv6=(U)=>$.check(mg(PJ,U)),$.e164=(U)=>$.check(tg(SJ,U)),$.datetime=(U)=>$.check(GV(U)),$.date=(U)=>$.check(OV(U)),$.time=(U)=>$.check(HV(U)),$.duration=(U)=>$.check(zV(U))});function J0($){return f7(wI,$)}var S$=L("ZodStringFormat",($,v)=>{N$.init($,v),GJ.init($,v)}),OJ=L("ZodEmail",($,v)=>{rY.init($,v),S$.init($,v)});function aS($){return Fg(OJ,$)}var X0=L("ZodGUID",($,v)=>{RY.init($,v),S$.init($,v)});function eS($){return u0(X0,$)}var R4=L("ZodUUID",($,v)=>{nY.init($,v),S$.init($,v)});function sS($){return Zg(R4,$)}function $M($){return Tg(R4,$)}function vM($){return kg(R4,$)}function bM($){return Eg(R4,$)}var H0=L("ZodURL",($,v)=>{CY.init($,v),S$.init($,v)});function UM($){return w0(H0,$)}function IM($){return w0(H0,{protocol:cv.httpProtocol,hostname:cv.domain,...n.normalizeParams($)})}var HJ=L("ZodEmoji",($,v)=>{iY.init($,v),S$.init($,v)});function DM($){return Rg(HJ,$)}var zJ=L("ZodNanoID",($,v)=>{xY.init($,v),S$.init($,v)});function uM($){return ng(zJ,$)}var QJ=L("ZodCUID",($,v)=>{lY.init($,v),S$.init($,v)});function wM($){return rg(QJ,$)}var YJ=L("ZodCUID2",($,v)=>{fY.init($,v),S$.init($,v)});function gM($){return Cg(YJ,$)}var VJ=L("ZodULID",($,v)=>{yY.init($,v),S$.init($,v)});function JM($){return ig(VJ,$)}var LJ=L("ZodXID",($,v)=>{hY.init($,v),S$.init($,v)});function XM($){return xg(LJ,$)}var KJ=L("ZodKSUID",($,v)=>{mY.init($,v),S$.init($,v)});function WM($){return lg(KJ,$)}var qJ=L("ZodIPv4",($,v)=>{pY.init($,v),S$.init($,v)});function GM($){return fg(qJ,$)}var MV=L("ZodMAC",($,v)=>{eY.init($,v),S$.init($,v)});function OM($){return h7(MV,$)}var BJ=L("ZodIPv6",($,v)=>{aY.init($,v),S$.init($,v)});function HM($){return yg(BJ,$)}var AJ=L("ZodCIDRv4",($,v)=>{sY.init($,v),S$.init($,v)});function zM($){return hg(AJ,$)}var PJ=L("ZodCIDRv6",($,v)=>{$5.init($,v),S$.init($,v)});function QM($){return mg(PJ,$)}var jJ=L("ZodBase64",($,v)=>{b5.init($,v),S$.init($,v)});function YM($){return cg(jJ,$)}var NJ=L("ZodBase64URL",($,v)=>{U5.init($,v),S$.init($,v)});function VM($){return og(NJ,$)}var SJ=L("ZodE164",($,v)=>{I5.init($,v),S$.init($,v)});function LM($){return tg(SJ,$)}var MJ=L("ZodJWT",($,v)=>{D5.init($,v),S$.init($,v)});function KM($){return dg(MJ,$)}var gI=L("ZodCustomStringFormat",($,v)=>{u5.init($,v),S$.init($,v)});function qM($,v,U={}){return bI(gI,$,v,U)}function BM($){return bI(gI,"hostname",cv.hostname,$)}function AM($){return bI(gI,"hex",cv.hex,$)}function PM($,v){let U=v?.enc??"hex",I=`${$}_${U}`,b=cv[I];if(!b)throw Error(`Unrecognized hash format: ${I}`);return bI(gI,I,b,v)}var JI=L("ZodNumber",($,v)=>{Pg.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>_3($,I,b,D),O0($,"ZodNumber",{gt(I,b){return this.check(k4(I,b))},gte(I,b){return this.check(jv(I,b))},min(I,b){return this.check(jv(I,b))},lt(I,b){return this.check(T4(I,b))},lte(I,b){return this.check(ov(I,b))},max(I,b){return this.check(ov(I,b))},int(I){return this.check(XJ(I))},safe(I){return this.check(XJ(I))},positive(I){return this.check(k4(0,I))},nonnegative(I){return this.check(jv(0,I))},negative(I){return this.check(T4(0,I))},nonpositive(I){return this.check(ov(0,I))},multipleOf(I,b){return this.check(E6(I,b))},step(I,b){return this.check(E6(I,b))},finite(){return this}});let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function _V($){return p7(JI,$)}var rb=L("ZodNumberFormat",($,v)=>{w5.init($,v),JI.init($,v)});function XJ($){return e7(rb,$)}function jM($){return s7(rb,$)}function NM($){return $3(rb,$)}function SM($){return v3(rb,$)}function MM($){return b3(rb,$)}var XI=L("ZodBoolean",($,v)=>{e1.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>F3($,U,I,b)});function FV($){return U3(XI,$)}var WI=L("ZodBigInt",($,v)=>{jg.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>Z3($,I,b,D),$.gte=(I,b)=>$.check(jv(I,b)),$.min=(I,b)=>$.check(jv(I,b)),$.gt=(I,b)=>$.check(k4(I,b)),$.gte=(I,b)=>$.check(jv(I,b)),$.min=(I,b)=>$.check(jv(I,b)),$.lt=(I,b)=>$.check(T4(I,b)),$.lte=(I,b)=>$.check(ov(I,b)),$.max=(I,b)=>$.check(ov(I,b)),$.positive=(I)=>$.check(k4(BigInt(0),I)),$.negative=(I)=>$.check(T4(BigInt(0),I)),$.nonpositive=(I)=>$.check(ov(BigInt(0),I)),$.nonnegative=(I)=>$.check(jv(BigInt(0),I)),$.multipleOf=(I,b)=>$.check(E6(I,b));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function _M($){return D3(WI,$)}var _J=L("ZodBigIntFormat",($,v)=>{g5.init($,v),WI.init($,v)});function FM($){return w3(_J,$)}function ZM($){return g3(_J,$)}var ZV=L("ZodSymbol",($,v)=>{J5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>T3($,U,I,b)});function TM($){return J3(ZV,$)}var TV=L("ZodUndefined",($,v)=>{X5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>E3($,U,I,b)});function kM($){return X3(TV,$)}var kV=L("ZodNull",($,v)=>{W5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>k3($,U,I,b)});function EV($){return W3(kV,$)}var RV=L("ZodAny",($,v)=>{G5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>r3($,U,I,b)});function EM(){return G3(RV)}var nV=L("ZodUnknown",($,v)=>{O5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>C3($,U,I,b)});function nb(){return O3(nV)}var rV=L("ZodNever",($,v)=>{H5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>n3($,U,I,b)});function FJ($){return H3(rV,$)}var CV=L("ZodVoid",($,v)=>{z5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>R3($,U,I,b)});function RM($){return z3(CV,$)}var z0=L("ZodDate",($,v)=>{Q5.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>i3($,I,b,D),$.min=(I,b)=>$.check(jv(I,b)),$.max=(I,b)=>$.check(ov(I,b));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function nM($){return Q3(z0,$)}var iV=L("ZodArray",($,v)=>{Y5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>a3($,U,I,b),$.element=v.element,O0($,"ZodArray",{min(U,I){return this.check(e4(U,I))},nonempty(U){return this.check(e4(1,U))},max(U,I){return this.check(Eb(U,I))},length(U,I){return this.check(Rb(U,I))},unwrap(){return this.element}})});function Q0($,v){return L3(iV,$,v)}function rM($){let v=$._zod.def.shape;return TJ(Object.keys(v))}var Y0=L("ZodObject",($,v)=>{V5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>e3($,U,I,b),n.defineLazy($,"shape",()=>{return v.shape}),O0($,"ZodObject",{keyof(){return TJ(Object.keys(this._zod.def.shape))},catchall(U){return this.clone({...this._zod.def,catchall:U})},passthrough(){return this.clone({...this._zod.def,catchall:nb()})},loose(){return this.clone({...this._zod.def,catchall:nb()})},strict(){return this.clone({...this._zod.def,catchall:FJ()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(U){return n.extend(this,U)},safeExtend(U){return n.safeExtend(this,U)},merge(U){return n.merge(this,U)},pick(U){return n.pick(this,U)},omit(U){return n.omit(this,U)},partial(...U){return n.partial(EJ,this,U[0])},required(...U){return n.required(RJ,this,U[0])}})});function CM($,v){let U={type:"object",shape:$??{},...n.normalizeParams(v)};return new Y0(U)}function iM($,v){return new Y0({type:"object",shape:$,catchall:FJ(),...n.normalizeParams(v)})}function xM($,v){return new Y0({type:"object",shape:$,catchall:nb(),...n.normalizeParams(v)})}var V0=L("ZodUnion",($,v)=>{s1.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>bJ($,U,I,b),$.options=v.options});function ZJ($,v){return new V0({type:"union",options:$,...n.normalizeParams(v)})}var xV=L("ZodXor",($,v)=>{V0.init($,v),L5.init($,v),$._zod.processJSONSchema=(U,I,b)=>bJ($,U,I,b),$.options=v.options});function lM($,v){return new xV({type:"union",options:$,inclusive:!1,...n.normalizeParams(v)})}var lV=L("ZodDiscriminatedUnion",($,v)=>{V0.init($,v),K5.init($,v)});function fM($,v,U){return new lV({type:"union",options:v,discriminator:$,...n.normalizeParams(U)})}var fV=L("ZodIntersection",($,v)=>{q5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>s3($,U,I,b)});function yV($,v){return new fV({type:"intersection",left:$,right:v})}var hV=L("ZodTuple",($,v)=>{Ng.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>$V($,U,I,b),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function mV($,v,U){let I=v instanceof v$,b=I?U:v;return new hV({type:"tuple",items:$,rest:I?v:null,...n.normalizeParams(b)})}var DI=L("ZodRecord",($,v)=>{B5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>vV($,U,I,b),$.keyType=v.keyType,$.valueType=v.valueType});function cV($,v,U){if(!v||!v._zod)return new DI({type:"record",keyType:J0(),valueType:$,...n.normalizeParams(v)});return new DI({type:"record",keyType:$,valueType:v,...n.normalizeParams(U)})}function yM($,v,U){let I=Av($);return I._zod.values=void 0,new DI({type:"record",keyType:I,valueType:v,...n.normalizeParams(U)})}function hM($,v,U){return new DI({type:"record",keyType:$,valueType:v,mode:"loose",...n.normalizeParams(U)})}var oV=L("ZodMap",($,v)=>{A5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>d3($,U,I,b),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...U)=>$.check(E4(...U)),$.nonempty=(U)=>$.check(E4(1,U)),$.max=(...U)=>$.check(R6(...U)),$.size=(...U)=>$.check(kb(...U))});function mM($,v,U){return new oV({type:"map",keyType:$,valueType:v,...n.normalizeParams(U)})}var tV=L("ZodSet",($,v)=>{P5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>p3($,U,I,b),$.min=(...U)=>$.check(E4(...U)),$.nonempty=(U)=>$.check(E4(1,U)),$.max=(...U)=>$.check(R6(...U)),$.size=(...U)=>$.check(kb(...U))});function cM($,v){return new tV({type:"set",valueType:$,...n.normalizeParams(v)})}var uI=L("ZodEnum",($,v)=>{j5.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>x3($,I,b,D),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(I,b)=>{let D={};for(let u of I)if(U.has(u))D[u]=v.entries[u];else throw Error(`Key ${u} not found in enum`);return new uI({...v,checks:[],...n.normalizeParams(b),entries:D})},$.exclude=(I,b)=>{let D={...v.entries};for(let u of I)if(U.has(u))delete D[u];else throw Error(`Key ${u} not found in enum`);return new uI({...v,checks:[],...n.normalizeParams(b),entries:D})}});function TJ($,v){let U=Array.isArray($)?Object.fromEntries($.map((I)=>[I,I])):$;return new uI({type:"enum",entries:U,...n.normalizeParams(v)})}function oM($,v){return new uI({type:"enum",entries:$,...n.normalizeParams(v)})}var dV=L("ZodLiteral",($,v)=>{N5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>l3($,U,I,b),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function tM($,v){return new dV({type:"literal",values:Array.isArray($)?$:[$],...n.normalizeParams(v)})}var pV=L("ZodFile",($,v)=>{S5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>h3($,U,I,b),$.min=(U,I)=>$.check(E4(U,I)),$.max=(U,I)=>$.check(R6(U,I)),$.mime=(U,I)=>$.check(pU(Array.isArray(U)?U:[U],I))});function dM($){return K3(pV,$)}var aV=L("ZodTransform",($,v)=>{M5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>t3($,U,I,b),$._zod.parse=(U,I)=>{if(I.direction==="backward")throw new _b($.constructor.name);U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(n.issue(D,U.value,v));else{let u=D;if(u.fatal)u.continue=!1;u.code??(u.code="custom"),u.input??(u.input=U.value),u.inst??(u.inst=$),U.issues.push(n.issue(u))}};let b=v.transform(U.value,U);if(b instanceof Promise)return b.then((D)=>{return U.value=D,U.fallback=!0,U});return U.value=b,U.fallback=!0,U}});function kJ($){return new aV({type:"transform",transform:$})}var EJ=L("ZodOptional",($,v)=>{Sg.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UJ($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function W0($){return new EJ({type:"optional",innerType:$})}var eV=L("ZodExactOptional",($,v)=>{_5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UJ($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function sV($){return new eV({type:"optional",innerType:$})}var $L=L("ZodNullable",($,v)=>{F5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>bV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function G0($){return new $L({type:"nullable",innerType:$})}function pM($){return W0(G0($))}var vL=L("ZodDefault",($,v)=>{Z5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>IV($,U,I,b),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function bL($,v){return new vL({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():n.shallowClone(v)}})}var UL=L("ZodPrefault",($,v)=>{T5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>DV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function IL($,v){return new UL({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():n.shallowClone(v)}})}var RJ=L("ZodNonOptional",($,v)=>{k5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function DL($,v){return new RJ({type:"nonoptional",innerType:$,...n.normalizeParams(v)})}var uL=L("ZodSuccess",($,v)=>{E5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>m3($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function aM($){return new uL({type:"success",innerType:$})}var wL=L("ZodCatch",($,v)=>{R5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>uV($,U,I,b),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function gL($,v){return new wL({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var JL=L("ZodNaN",($,v)=>{n5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>f3($,U,I,b)});function eM($){return V3(JL,$)}var L0=L("ZodPipe",($,v)=>{Mg.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>wV($,U,I,b),$.in=v.in,$.out=v.out});function WJ($,v){return new L0({type:"pipe",in:$,out:v})}var K0=L("ZodCodec",($,v)=>{L0.init($,v),$0.init($,v)});function sM($,v,U){return new K0({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}function $_($){let v=$._zod.def;return new K0({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var XL=L("ZodPreprocess",($,v)=>{L0.init($,v),r5.init($,v)}),WL=L("ZodReadonly",($,v)=>{C5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>gV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function GL($){return new WL({type:"readonly",innerType:$})}var OL=L("ZodTemplateLiteral",($,v)=>{i5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>y3($,U,I,b)});function v_($,v){return new OL({type:"template_literal",parts:$,...n.normalizeParams(v)})}var HL=L("ZodLazy",($,v)=>{f5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>XV($,U,I,b),$.unwrap=()=>$._zod.def.getter()});function zL($){return new HL({type:"lazy",getter:$})}var QL=L("ZodPromise",($,v)=>{l5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>JV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function b_($){return new QL({type:"promise",innerType:$})}var YL=L("ZodFunction",($,v)=>{x5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>o3($,U,I,b)});function U_($){return new YL({type:"function",input:Array.isArray($?.input)?mV($?.input):$?.input??Q0(nb()),output:$?.output??nb()})}var q0=L("ZodCustom",($,v)=>{y5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>c3($,U,I,b)});function I_($){let v=new Z$({check:"custom"});return v._zod.check=$,v}function D_($,v){return q3(q0,$??(()=>!0),v)}function VL($,v={}){return B3(q0,$,v)}function LL($,v){return A3($,v)}var u_=P3,w_=j3;function g_($,v={}){let U=new q0({type:"custom",check:"custom",fn:(I)=>I instanceof $,abort:!0,...n.normalizeParams(v)});return U._zod.bag.Class=$,U._zod.check=(I)=>{if(!(I.value instanceof $))I.issues.push({code:"invalid_type",expected:$.name,input:I.value,inst:U,path:[...U._zod.def.path??[]]})},U}var J_=(...$)=>N3({Codec:K0,Boolean:XI,String:wI},...$);function X_($){let v=zL(()=>{return ZJ([J0($),_V(),FV(),EV(),Q0(v),cV(J0(),v)])});return v}function W_($,v){return new XL({type:"pipe",in:kJ($),out:v})}var xt={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 lt($){o$({customError:$})}function ft(){return o$().customError}var KL;(function($){})(KL||(KL={}));var y={...g0,...DJ,iso:II},yt=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 ht($,v){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function mt($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return v.rootSchema;let I=v.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===I){let b=U[1];if(!b||!v.defs[b])throw Error(`Reference not found: ${$}`);return v.defs[b]}throw Error(`Reference not found: ${$}`)}function G_($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return y.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let b=$.$ref;if(v.refs.has(b))return v.refs.get(b);if(v.processing.has(b))return y.lazy(()=>{if(!v.refs.has(b))throw Error(`Circular reference not resolved: ${b}`);return v.refs.get(b)});v.processing.add(b);let D=mt(b,v),u=Hv(D,v);return v.refs.set(b,u),v.processing.delete(b),u}if($.enum!==void 0){let b=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&b.length===1&&b[0]===null)return y.null();if(b.length===0)return y.never();if(b.length===1)return y.literal(b[0]);if(b.every((u)=>typeof u==="string"))return y.enum(b);let D=b.map((u)=>y.literal(u));if(D.length<2)return D[0];return y.union([D[0],D[1],...D.slice(2)])}if($.const!==void 0)return y.literal($.const);let U=$.type;if(Array.isArray(U)){let b=U.map((D)=>{let u={...$,type:D};return G_(u,v)});if(b.length===0)return y.never();if(b.length===1)return b[0];return y.union(b)}if(!U)return y.any();let I;switch(U){case"string":{let b=y.string();if($.format){let D=$.format;if(D==="email")b=b.check(y.email());else if(D==="uri"||D==="uri-reference")b=b.check(y.url());else if(D==="uuid"||D==="guid")b=b.check(y.uuid());else if(D==="date-time")b=b.check(y.iso.datetime());else if(D==="date")b=b.check(y.iso.date());else if(D==="time")b=b.check(y.iso.time());else if(D==="duration")b=b.check(y.iso.duration());else if(D==="ipv4")b=b.check(y.ipv4());else if(D==="ipv6")b=b.check(y.ipv6());else if(D==="mac")b=b.check(y.mac());else if(D==="cidr")b=b.check(y.cidrv4());else if(D==="cidr-v6")b=b.check(y.cidrv6());else if(D==="base64")b=b.check(y.base64());else if(D==="base64url")b=b.check(y.base64url());else if(D==="e164")b=b.check(y.e164());else if(D==="jwt")b=b.check(y.jwt());else if(D==="emoji")b=b.check(y.emoji());else if(D==="nanoid")b=b.check(y.nanoid());else if(D==="cuid")b=b.check(y.cuid());else if(D==="cuid2")b=b.check(y.cuid2());else if(D==="ulid")b=b.check(y.ulid());else if(D==="xid")b=b.check(y.xid());else if(D==="ksuid")b=b.check(y.ksuid())}if(typeof $.minLength==="number")b=b.min($.minLength);if(typeof $.maxLength==="number")b=b.max($.maxLength);if($.pattern)b=b.regex(new RegExp($.pattern));I=b;break}case"number":case"integer":{let b=U==="integer"?y.number().int():y.number();if(typeof $.minimum==="number")b=b.min($.minimum);if(typeof $.maximum==="number")b=b.max($.maximum);if(typeof $.exclusiveMinimum==="number")b=b.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")b=b.gt($.minimum);if(typeof $.exclusiveMaximum==="number")b=b.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")b=b.lt($.maximum);if(typeof $.multipleOf==="number")b=b.multipleOf($.multipleOf);I=b;break}case"boolean":{I=y.boolean();break}case"null":{I=y.null();break}case"object":{let b={},D=$.properties||{},u=new Set($.required||[]);for(let[g,J]of Object.entries(D)){let X=Hv(J,v);b[g]=u.has(g)?X:X.optional()}if($.propertyNames){let g=Hv($.propertyNames,v),J=$.additionalProperties&&typeof $.additionalProperties==="object"?Hv($.additionalProperties,v):y.any();if(Object.keys(b).length===0){I=y.record(g,J);break}let X=y.object(b).passthrough(),W=y.looseRecord(g,J);I=y.intersection(X,W);break}if($.patternProperties){let g=$.patternProperties,J=Object.keys(g),X=[];for(let G of J){let O=Hv(g[G],v),z=y.string().regex(new RegExp(G));X.push(y.looseRecord(z,O))}let W=[];if(Object.keys(b).length>0)W.push(y.object(b).passthrough());if(W.push(...X),W.length===0)I=y.object({}).passthrough();else if(W.length===1)I=W[0];else{let G=y.intersection(W[0],W[1]);for(let O=2;O<W.length;O++)G=y.intersection(G,W[O]);I=G}break}let w=y.object(b);if($.additionalProperties===!1)I=w.strict();else if(typeof $.additionalProperties==="object")I=w.catchall(Hv($.additionalProperties,v));else I=w.passthrough();break}case"array":{let{prefixItems:b,items:D}=$;if(b&&Array.isArray(b)){let u=b.map((g)=>Hv(g,v)),w=D&&typeof D==="object"&&!Array.isArray(D)?Hv(D,v):void 0;if(w)I=y.tuple(u).rest(w);else I=y.tuple(u);if(typeof $.minItems==="number")I=I.check(y.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(y.maxLength($.maxItems))}else if(Array.isArray(D)){let u=D.map((g)=>Hv(g,v)),w=$.additionalItems&&typeof $.additionalItems==="object"?Hv($.additionalItems,v):void 0;if(w)I=y.tuple(u).rest(w);else I=y.tuple(u);if(typeof $.minItems==="number")I=I.check(y.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(y.maxLength($.maxItems))}else if(D!==void 0){let u=Hv(D,v),w=y.array(u);if(typeof $.minItems==="number")w=w.min($.minItems);if(typeof $.maxItems==="number")w=w.max($.maxItems);I=w}else I=y.array(y.any());break}default:throw Error(`Unsupported type: ${U}`)}return I}function Hv($,v){if(typeof $==="boolean")return $?y.any():y.never();let U=G_($,v),I=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((J)=>Hv(J,v)),g=y.union(w);U=I?y.intersection(U,g):g}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((J)=>Hv(J,v)),g=y.xor(w);U=I?y.intersection(U,g):g}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=I?U:y.any();else{let w=I?U:Hv($.allOf[0],v),g=I?0:1;for(let J=g;J<$.allOf.length;J++)w=y.intersection(w,Hv($.allOf[J],v));U=w}if($.nullable===!0&&v.version==="openapi-3.0")U=y.nullable(U);if($.readOnly===!0)U=y.readonly(U);if($.default!==void 0)U=U.default($.default);let b={},D=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let w of D)if(w in $)b[w]=$[w];let u=["contentEncoding","contentMediaType","contentSchema"];for(let w of u)if(w in $)b[w]=$[w];for(let w of Object.keys($))if(!yt.has(w))b[w]=$[w];if(Object.keys(b).length>0)v.registry.add(U,b);if($.description)U=U.describe($.description);return U}function O_($,v){if(typeof $==="boolean")return $?y.any():y.never();let U;try{U=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let I=ht(U,v?.defaultTarget),b=U.$defs||U.definitions||{},D={version:I,defs:b,refs:new Map,processing:new Set,rootSchema:U,registry:v?.registry??uv};return Hv(U,D)}var qL={};e$(qL,{string:()=>ct,number:()=>ot,date:()=>pt,boolean:()=>tt,bigint:()=>dt});function ct($){return y7(wI,$)}function ot($){return a7(JI,$)}function tt($){return I3(XI,$)}function dt($){return u3(WI,$)}function pt($){return Y3(z0,$)}o$(v0());var at=class ${sessionId;resumeUrl;seq;constructor(v){this.sessionId=v.sessionId,this.resumeUrl=v.resumeUrl,this.seq=v.seq,Object.freeze(this)}static empty(){return new $({sessionId:null,resumeUrl:null,seq:null})}canResume(){return this.sessionId!==null}withSeq(v){return new $({sessionId:this.sessionId,resumeUrl:this.resumeUrl,seq:v})}withReady(v,U){return new $({sessionId:v,resumeUrl:U,seq:this.seq})}withReset(){return $.empty()}},et=class{props;initialTimer=null;intervalTimer=null;ackReceived=!0;constructor($){this.props=$}start($){this.stop(),this.ackReceived=!0;let v=$g({deps:this.props.deps})*$,U=p(()=>this.props.deps.setTimeout(()=>{this.initialTimer=null,this.safeFire();let I=p(()=>this.props.deps.setInterval(()=>this.safeFire(),$));if(I instanceof Error)this.props.log.error({action:"heartbeat.interval.schedule.error",message:x({error:I}),error:I}),this.intervalTimer=null;else this.intervalTimer=I},v));if(U instanceof Error)this.props.log.error({action:"heartbeat.initial.schedule.error",message:x({error:U}),error:U}),this.initialTimer=null;else this.initialTimer=U}stop(){if(this.initialTimer!==null){let $=this.initialTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.props.log.error({action:"heartbeat.initial.clear.error",message:x({error:v}),error:v});this.initialTimer=null}if(this.intervalTimer!==null){let $=this.intervalTimer,v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.props.log.error({action:"heartbeat.interval.clear.error",message:x({error:v}),error:v});this.intervalTimer=null}}ack(){this.ackReceived=!0}isRunning(){return this.initialTimer!==null||this.intervalTimer!==null}safeFire(){jb({fn:()=>this.fire(),onError:($)=>{this.props.log.error({action:"heartbeat.fire.error",message:x({error:$}),error:$})}})}fire(){if(!this.ackReceived){this.props.onZombie();return}this.ackReceived=!1,this.props.onSend()}},st=z$.object({op:z$.number(),d:z$.unknown(),s:z$.number().nullable(),t:z$.string().nullable()});function $d($){let v=Sb($);if(v instanceof mv)return v;let U=st.safeParse(v);if(!U.success)return new mv(`invalid gateway message frame (${$.length} bytes)`,{cause:U.error});return U.data}var vd="wss://gateway.discord.gg/?v=10&encoding=json",Q_=0,nJ=1,Y_=2,V_=6,L_=7,K_=9,q_=10,B_=11,H_={[Q_]:"DISPATCH",[nJ]:"HEARTBEAT",[Y_]:"IDENTIFY",[V_]:"RESUME",[L_]:"RECONNECT",[K_]:"INVALID_SESSION",[q_]:"HELLO",[B_]:"HEARTBEAT_ACK"},z_=1,bd=new Set([4004,4010,4011,4012,4013,4014]),Ud=class{props;log;ws=null;heartbeat=null;currentSession=at.empty();isStoppedFlag=!1;hasConnected=!1;pendingResolve=null;pendingResolved=!1;invalidSessionTimer=null;constructor($){this.props=$,this.log=new d4({source:"discord.gateway",handler:$.onLog,deps:$.deps})}get session(){return this.currentSession}get isStopped(){return this.isStoppedFlag}connect($){let v=this.props.deps.WebSocket;if(!v){let D=new Uv("WebSocket runtime not available");return this.log.error({action:"ws.error",message:x({error:D}),error:D}),Promise.resolve(D)}let U=$??vd,I=p(()=>new URL(U).hostname),b=I instanceof Error?"unknown":I;return this.log.info({action:"connect.start",message:`host=${b}`}),this.pendingResolved=!1,this.hasConnected=!1,new Promise((D)=>{this.pendingResolve=D;let u=p(()=>new v(U));if(u instanceof Error){let J=new Uv(`WebSocket construction failed: ${x({error:u})}`,{cause:u});this.log.error({action:"ws.construct.error",message:x({error:J}),error:J}),this.ws=null,this.pendingResolved=!0,D(J);return}let w=u;this.ws=w;let g=p(()=>{w.addEventListener("message",(J)=>this.safeOnMessage(J,w)),w.addEventListener("close",(J)=>this.safeOnClose(J)),w.addEventListener("error",()=>this.safeOnError())});if(g instanceof Error){let J=new Uv(`WebSocket listener registration failed: ${x({error:g})}`,{cause:g});this.log.error({action:"ws.listener.error",message:x({error:J}),error:J}),this.ws=null,this.pendingResolved=!0,D(J)}})}disconnect(){this.log.info({action:"disconnect",message:"shutting down gateway"}),this.isStoppedFlag=!0,this.heartbeat?.stop(),this.clearInvalidSessionTimer(),this.closeSocket({ws:this.ws,code:1000,reason:"shutdown"}),this.ws=null}isConnected(){return this.ws!==null&&this.ws.readyState===z_}completeConnect($){if(this.pendingResolved||!this.pendingResolve)return;this.pendingResolved=!0,this.pendingResolve($)}safeOnMessage($,v){let U=p(()=>this.onMessage(String($.data),v));if(U instanceof Error)this.log.error({action:"ws.message.threw",message:x({error:U}),error:U})}safeOnClose($){let v=p(()=>this.onClose($));if(v instanceof Error)this.log.error({action:"ws.close.threw",message:x({error:v}),error:v})}safeOnError(){let $=p(()=>this.onError());if($ instanceof Error)this.log.error({action:"ws.error.threw",message:x({error:$}),error:$})}onMessage($,v){if(this.isStoppedFlag)return;let U=$d($);if(U instanceof mv){this.log.error({action:"ws.parse.error",message:U.message,error:U,detail:{length:$.length}});return}if(this.log.debug({action:"ws.recv",message:`op=${H_[U.op]??U.op} t=${U.t??"-"} s=${U.s??"-"} length=${$.length}`,detail:{op:U.op,t:U.t,s:U.s,length:$.length}}),U.s!==null)this.currentSession=this.currentSession.withSeq(U.s);if(U.op===q_)return this.onHello(U);if(U.op===B_)return this.onHeartbeatAck();if(U.op===nJ)return this.onHeartbeatRequest();if(U.op===L_)return this.onReconnectRequest(v);if(U.op===K_)return this.onInvalidSession(U,v);if(U.op===Q_)return this.onDispatch(U);this.log.warn({action:"ws.op.unknown",message:`unknown op=${U.op}`,detail:{op:U.op}})}onHello($){let v=p4($.d)?$.d:null,U=v&&typeof v.heartbeat_interval==="number"?v.heartbeat_interval:0;if(this.log.info({action:"gateway.hello",message:`heartbeat_interval=${U}ms`,detail:{interval:U}}),this.heartbeat?.stop(),this.heartbeat=new et({log:this.log,deps:this.props.deps,onSend:()=>{this.log.debug({action:"heartbeat.send",message:`seq=${this.currentSession.seq}`}),this.send({op:nJ,d:this.currentSession.seq})},onZombie:()=>{this.log.warn({action:"heartbeat.zombie",message:"no ACK received, closing connection"}),this.closeSocket({ws:this.ws,code:4009,reason:"zombie connection"})}}),this.heartbeat.start(U),this.currentSession.canResume())this.sendResume();else this.sendIdentify()}onHeartbeatAck(){this.log.debug({action:"heartbeat.ack",message:"received"}),this.heartbeat?.ack()}onHeartbeatRequest(){this.log.debug({action:"heartbeat.requested",message:"server requested heartbeat"}),this.send({op:nJ,d:this.currentSession.seq})}onReconnectRequest($){this.log.info({action:"ws.reconnect.requested",message:"server requested reconnect"}),this.closeSocket({ws:$,code:4000,reason:"reconnect requested"})}onInvalidSession($,v){let U=$.d===!0||p4($.d)&&$.d.resumable===!0;this.log.warn({action:"session.invalid",message:`resumable=${U}`,detail:{resumable:U}});let I=1000+$g({deps:this.props.deps})*4000;if(!U)this.currentSession=this.currentSession.withReset();this.clearInvalidSessionTimer();let b=p(()=>this.props.deps.setTimeout(()=>{this.invalidSessionTimer=null,this.closeSocket({ws:v,code:4000,reason:"invalid session"})},I));if(b instanceof Error)this.log.error({action:"session.invalid.timer.error",message:x({error:b}),error:b}),this.invalidSessionTimer=null;else this.invalidSessionTimer=b}onDispatch($){let v=p4($.d)?$.d:null;if($.t==="READY"&&v){let U=typeof v.session_id==="string"?v.session_id:"",I=typeof v.resume_gateway_url==="string"?v.resume_gateway_url:"";this.currentSession=this.currentSession.withReady(U,I),this.log.info({action:"gateway.ready",message:"session ready",detail:{hasResumeUrl:I!==""}}),this.hasConnected=!0,this.props.onStatus("connected"),this.completeConnect(null)}if($.t==="RESUMED")this.log.info({action:"gateway.resumed",message:`seq=${this.currentSession.seq}`}),this.hasConnected=!0,this.props.onStatus("connected"),this.completeConnect(null);if($.t&&v)this.props.onDispatch($.t,v);else if($.t)this.log.debug({action:"dispatch.empty",message:`dropped ${$.t} (no payload)`,detail:{type:$.t}})}onClose($){let v=bd.has($.code);if(this.log.info({action:"ws.close",message:`code=${$.code} reason=${$.reason||"none"}${v?" (terminal)":""}`,detail:{code:$.code,reason:$.reason,terminal:v}}),this.ws=null,this.heartbeat?.stop(),this.clearInvalidSessionTimer(),v)this.isStoppedFlag=!0;if(this.hasConnected||v)this.props.onStatus("disconnected");if(!this.pendingResolved){let U=new Uv(`WebSocket closed before ready (code=${$.code})`,{code:$.code});this.completeConnect(U)}}onError(){let $=new Uv("WebSocket connection error");this.log.error({action:"ws.error",message:x({error:$}),error:$}),this.completeConnect($)}clearInvalidSessionTimer(){if(this.invalidSessionTimer===null)return;let $=this.invalidSessionTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.log.error({action:"session.invalid.timer.clear.error",message:x({error:v}),error:v});this.invalidSessionTimer=null}closeSocket($){if($.ws===null)return;let v=$.ws,U=p(()=>{if($.code!==void 0)v.close($.code,$.reason??"");else v.close()});if(U instanceof Error)this.log.error({action:"ws.close.error",message:x({error:U}),error:U})}send($){let v=this.safeSerialize($);if(v===null)return;this.log.debug({action:"ws.send",message:`op=${H_[$.op]??$.op} length=${v.length}`,detail:{op:$.op,length:v.length}});let U=this.ws;if(U===null){this.log.warn({action:"ws.send",message:"ws.send skipped: socket is null"});return}if(U.readyState!==z_){this.log.warn({action:"ws.send",message:`ws.send skipped: readyState=${U.readyState} (not OPEN)`,detail:{readyState:U.readyState}});return}let I=p(()=>U.send(v));if(I instanceof Error)this.log.error({action:"ws.send",message:`ws.send failed: ${x({error:I})}`,error:I})}safeSerialize($){let v=Ug({op:$.op,d:$.d??null});if(v instanceof Error)return this.log.error({action:"ws.send.serialize.error",message:x({error:v}),error:v,detail:{op:$.op}}),null;return v}sendIdentify(){this.log.info({action:"gateway.identify",message:`intents=${this.props.intents}`}),this.send({op:Y_,d:{token:this.props.token,intents:this.props.intents,properties:{os:"linux",browser:"open-flume",device:"open-flume"}}})}sendResume(){this.log.info({action:"gateway.resume",message:`seq=${this.currentSession.seq}`}),this.send({op:V_,d:{token:this.props.token,session_id:this.currentSession.sessionId,seq:this.currentSession.seq}})}},i6={Guilds:1,GuildMembers:2,GuildModeration:4,GuildExpressions:8,GuildIntegrations:16,GuildWebhooks:32,GuildInvites:64,GuildVoiceStates:128,GuildPresences:256,GuildMessages:512,GuildMessageReactions:1024,GuildMessageTyping:2048,DirectMessages:4096,DirectMessageReactions:8192,DirectMessageTyping:16384,MessageContent:32768,GuildScheduledEvents:65536,AutoModerationConfiguration:1048576,AutoModerationExecution:2097152,GuildMessagePolls:16777216,DirectMessagePolls:33554432};function Id($,v){let U={event_type:$};if(typeof v.channel_id==="string")U.channel_id=v.channel_id;if(typeof v.guild_id==="string")U.guild_id=v.guild_id;if(p4(v.author)&&typeof v.author.id==="string")U.user_id=v.author.id;return U}var Dd=i6.Guilds|i6.GuildMessages|i6.DirectMessages,A_=class extends Nb{options;name="discord";gateway=null;reconnector=null;constructor($){super();this.options=$}async connect($){if(!this.hasWebSocket($))return new F4("Discord source: deps.WebSocket is null (no WebSocket runtime available)");if($.reconnect&&!this.reconnector)this.reconnector=new vg({...$.reconnect,log:$.log,deps:$.deps});return await this.connectInternal($)}disconnect(){if(this.reconnector&&!this.reconnector.aborted)this.context?.log.debug({action:"reconnect.cancel",message:"aborting reconnector"});this.reconnector?.cancel(),this.gateway?.disconnect(),this.gateway=null}hasWebSocket($){let v=p(()=>Boolean($.deps.WebSocket));if(v instanceof Error){let U=F$({value:v});return $.log.error({action:"deps.web-socket.read.error",message:x({error:U}),error:U}),!1}return v}async connectInternal($,v){this.setStatus("connecting"),this.gateway=new Ud({token:this.options.token,intents:this.options.intents??Dd,onLog:$.log.handler,deps:$.deps,onDispatch:(I,b)=>this.dispatch($,I,b),onStatus:(I)=>this.handleGatewayStatus($,I)});let U=await this.gateway.connect(v);if(U instanceof Uv){if($.log.error({action:"connect.failed",message:x({error:U}),error:U}),this.gateway.isStopped||!this.reconnector||this.reconnector.aborted)return this.setStatus("disconnected"),U;this.scheduleReconnect($)}return null}dispatch($,v,U){this.emit({source:"discord",type:v,data:U,meta:this.safeExtractMeta($,v,U),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v,U){let I=p(()=>Id(v,U));if(I instanceof Error){let b=F$({value:I});return $.log.warn({action:"meta.extract.error",message:x({error:b}),error:b,detail:{eventName:v}}),{event_type:v}}return I}handleGatewayStatus($,v){if(v==="connected"){if(this.reconnector&&this.reconnector.attempt>0)$.log.info({action:"reconnect.reset",message:`cleared ${this.reconnector.attempt} attempts`});this.reconnector?.reset(),this.setStatus("connected");return}if(this.gateway?.isStopped){this.setStatus("disconnected");return}this.scheduleReconnect($)}scheduleReconnect($){let v=this.gateway?.session.resumeUrl??void 0;bg({reconnector:this.reconnector,log:$.log,setStatus:(U)=>this.setStatus(U),retry:()=>{this.connectInternal($,v).catch((U)=>{let I=F$({value:U});$.log.error({action:"reconnect.unhandled",message:x({error:I}),error:I}),this.setStatus("disconnected")})}})}};var T$=($)=>{return $ instanceof Error?$.message:String($)};class BL{ownUserId;constructor($){this.ownUserId=$.ownUserId}process($){if($.authorIsBot)return{skip:!0};let v=this.ownUserId?$.mentionedUserIds.includes(this.ownUserId):!1;return{skip:!1,content:JSON.stringify($.raw),meta:{event_type:"discord",channel_id:$.channelId,user_id:$.authorId,mentioned:String(v),guild_id:$.guildId??""}}}}var tv=class extends Error{status;constructor($){super($.message,$.cause===void 0?void 0:{cause:$.cause});this.name="FlumeHttpError",this.status=$.status,Object.freeze(this)}};function ud(){let $=p(()=>globalThis.WebSocket);if($ instanceof Error||typeof $!=="function")return null;return $}function PL(){return{fetch:($,v)=>globalThis.fetch($,v),WebSocket:ud(),now:()=>Date.now(),random:()=>Math.random(),setTimeout:($,v)=>globalThis.setTimeout($,v),clearTimeout:($)=>globalThis.clearTimeout($),setInterval:($,v)=>globalThis.setInterval($,v),clearInterval:($)=>globalThis.clearInterval($)}}var AL={value:void 0,done:!0},wd=class{props;items=[];resolvers=[];closed=!1;constructor($){this.props=$}push($){if(this.closed)return;let v=this.resolvers.shift();if(v){v({value:$,done:!1});return}if(this.items.length>=this.props.buffer){if(this.props.onOverflow==="drop-newest")return;this.items.shift()}this.items.push($)}close(){if(this.closed)return;this.closed=!0;while(this.resolvers.length>0){let $=this.resolvers.shift();if($)$(AL)}}next(){let $=this.items.shift();if($!==void 0)return Promise.resolve({value:$,done:!1});if(this.closed)return Promise.resolve(AL);return new Promise((v)=>this.resolvers.push(v))}return(){return this.close(),this.props.onClose(),Promise.resolve(AL)}[Symbol.asyncIterator](){return this}},gd=1000,Jd=class{streams=new Set;closed=!1;publish($){if(this.closed)return;for(let v of this.streams)v.push($)}subscribe($){let v=new wd({buffer:$?.buffer??gd,onOverflow:$?.onOverflow??"drop-oldest",onClose:()=>this.streams.delete(v)});if(this.closed)return v.close(),v;return this.streams.add(v),v}close(){if(this.closed)return;this.closed=!0;for(let $ of this.streams)$.close();this.streams.clear()}},P_=class{props;kind="closed";constructor($){this.props=$,Object.freeze(this)}statuses(){return this.props.finalStatuses}errors(){return this.props.closeErrors}},Xd=class{props;kind="running";closePromise=null;onAbort;constructor($){this.props=$,this.onAbort=()=>{this.props.log.info({action:"flume.abort",message:"signal aborted, closing"}),jb({fn:()=>this.close(),onError:(U)=>{this.props.log.error({action:"flume.abort.close.failed",message:x({error:U}),error:U})}})};let v=$.signal;if(v){let U=p(()=>v.addEventListener("abort",this.onAbort,{once:!0}));if(U instanceof Error){let I=F$({value:U});$.log.error({action:"signal.addListener.failed",message:x({error:I}),error:I})}}}close(){if(this.closePromise)return this.closePromise;return this.closePromise=this.runClose(),this.closePromise}statuses(){return this.snapshotStatuses()}stream($){return this.props.hub.subscribe($)}get signal(){return this.props.signal}async runClose(){let $=[];try{this.props.log.info({action:"flume.close",message:`closing ${this.props.sources.length} source(s)`});let v=await Promise.allSettled(this.props.sources.map((I)=>Promise.resolve().then(()=>I.stop())));for(let[I,b]of v.entries())if(b.status==="rejected"){let D=this.props.sources[I],u=D?this.sourceName(D):"?",w=F$({value:b.reason});$.push({source:u,error:w}),this.props.log.error({action:"flume.close.failed",message:`${u}: ${x({error:w})}`,error:w,detail:{source:u}})}let U=this.props.signal;if(U){let I=p(()=>U.removeEventListener("abort",this.onAbort));if(I instanceof Error){let b=F$({value:I});this.props.log.error({action:"signal.removeListener.failed",message:x({error:b}),error:b})}}return this.props.log.info({action:"flume.close.complete",message:"all sources closed"}),this.props.hub.close(),new P_({finalStatuses:this.snapshotStatuses(),closeErrors:$})}catch(v){let U=F$({value:v});return this.props.log.error({action:"flume.close.unhandled",message:x({error:U}),error:U}),this.props.hub.close(),new P_({finalStatuses:this.snapshotStatuses(),closeErrors:$})}}snapshotStatuses(){return this.props.sources.map(($)=>{let v=this.sourceName($),U=p(()=>$.status());if(U instanceof Error){let I=F$({value:U});return this.props.log.error({action:"source.status.failed",message:`${v}: ${x({error:I})}`,error:I,detail:{source:v}}),{source:v,status:"disconnected"}}return{source:v,status:U}})}sourceName($){let v=p(()=>$.name);if(v instanceof Error)return"?";if(typeof v!=="string")return"?";return v}},j_={maxAttempts:1/0,baseDelay:1000,maxDelay:30000};function Wd($){if($===!1||$===void 0)return null;if($===!0)return{...j_};return{...j_,...$}}var N_=class{options;consumed=!1;log;deps;sources;sourceEventHandler;hub=new Jd;constructor($){this.options=$,this.sources=$.sources,this.deps=$.deps??PL(),this.log=new d4({source:"flume",handler:this.buildLogHandler(),deps:this.deps}),this.sourceEventHandler=(v)=>this.emitItem({kind:"event",event:v})}buildLogHandler(){return($)=>{this.emitItem({kind:"log",log:$});let v=this.options.onError;if(!v||$.level!=="error")return;try{Promise.resolve(v($)).catch(()=>{})}catch{}}}emitItem($){this.hub.publish($);let v=this.options.onEvent;if(!v)return;try{Promise.resolve(v($)).catch(()=>{})}catch{}}async open(){let $=this.guardOpen();if($)return $;this.consumed=!0,this.log.info({action:"flume.open",message:`opening ${this.sources.length} source(s)`,detail:{count:this.sources.length}});let v=Wd(this.options.reconnect),U=await Promise.allSettled(this.sources.map((D)=>this.safeStart(D,v))),I=[],b=[];for(let[D,u]of U.entries()){let w=this.sources[D];if(w===void 0)continue;let g=this.sourceName(w);if(u.status==="rejected"){I.push({name:g,error:F$({value:u.reason})});continue}if(u.value instanceof Error){I.push({name:g,error:u.value});continue}b.push(w)}if(I.length>0){for(let w of I)this.log.error({action:"flume.source.failed",message:`${w.name}: ${x({error:w.error})}`,error:w.error,detail:{source:w.name}});await this.rollback(b);let D=I.map((w)=>`${w.name}: ${x({error:w.error})}`).join("; "),u=new F4(`Flume.open: ${I.length} source(s) failed: ${D}`);return this.log.error({action:"flume.open.failed",message:x({error:u}),error:u}),u}if(this.isSignalAborted()){await this.rollback(this.sources);let D=new F4("Flume.open: aborted during open");return this.log.warn({action:"flume.open.aborted",message:x({error:D}),error:D}),D}return this.log.info({action:"flume.open.complete",message:"all sources opened"}),new Xd({sources:this.sources,signal:this.options.signal,log:this.log,hub:this.hub})}guardOpen(){if(this.consumed){let $=new F4("Flume.open: already opened");return this.log.warn({action:"flume.open.refused",message:x({error:$}),error:$}),$}if(this.isSignalAborted()){let $=new F4("Flume.open: signal already aborted");return this.log.warn({action:"flume.open.refused",message:x({error:$}),error:$}),$}return null}isSignalAborted(){let $=this.options.signal;if(!$)return!1;let v=p(()=>$.aborted===!0);return v instanceof Error?!0:v}sourceName($){let v=p(()=>$.name);if(v instanceof Error)return"?";if(typeof v!=="string")return"?";return v}safeStart($,v){let U=this.sourceName($),I={onEvent:this.sourceEventHandler,log:this.log.child(U),deps:this.deps,reconnect:v,signal:this.options.signal};return Promise.resolve().then(()=>$.start(I))}async rollback($){let v=await Promise.allSettled($.map((U)=>Promise.resolve().then(()=>U.stop())));for(let[U,I]of v.entries())if(I.status==="rejected"){let b=$[U],D=b?this.sourceName(b):"?",u=F$({value:I.reason});this.log.error({action:"flume.rollback.failed",message:`${D}: ${x({error:u})}`,error:u,detail:{source:D}})}}};var GI=($)=>{if(!$||Object.keys($).length===0)return;return{...PL(),...$}},OI=($)=>{if(!$)return;return(v)=>{if(v.level==="debug")return;let U=`${v.source}/${v.action}: ${v.message}`,I=Gd(v);if(v.level==="error"){$.error(U,I);return}if(v.level==="warn"){$.warn(U,I);return}$.info(U,I)}},Gd=($)=>{let v={...$.detail??{}};if($.error){if(v.error=$.error.message,$.error.stack)v.stack=$.error.stack;if($.error.name&&$.error.name!=="Error")v.errorName=$.error.name}return Object.keys(v).length>0?v:void 0};class B0{isAlive(){return!0}}class A0{props;constructor($){this.props=$;Object.freeze(this)}recordRaw($,v){this.props.log?.recordRaw({eventId:$,type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,payload:v})}recordProcessed($,v,U){this.props.log?.recordProcessed({eventId:$,type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,outcome:v,payload:U})}recordConnection($,v){this.props.log?.recordConnection({type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,status:$,detail:v})}}class Cb extends B0{logger;diagnostics;type;running=null;connected=!1;reconnecting=!1;deliveryChain=Promise.resolve();constructor($){super();this.type=$.type,this.logger=$.logger,this.diagnostics=new A0({type:$.type,connectorId:$.connectorId,channelId:$.channelId,log:$.diagnosticLog})}async runStart($){let v=$.reconnect??!0,U=v===!1?void 0:v===!0?{}:v,I=(w)=>{if(w.kind==="event"){this.deliveryChain=this.deliveryChain.catch(()=>{}).then(()=>Promise.resolve($.onEvent(w.event)));return}let g=w.log,J=zd(g);if(J)this.handleStatus(J);$.onLog?.(g)},b={sources:[$.source],onEvent:I};if($.deps)b.deps=$.deps;if($.signal)b.signal=$.signal;if(U)b.reconnect=U;let u=await new N_(b).open();if(u instanceof Error)throw this.diagnostics.recordConnection("error",T$(u)),u;this.running=u}async stop(){if(!this.running)return;try{await this.running.close(),this.diagnostics.recordConnection("disconnected","")}catch($){this.diagnostics.recordConnection("error",T$($)),this.logger?.error(`${this.type} stop error`,{error:T$($)})}finally{this.running=null,this.connected=!1,this.reconnecting=!1,this.deliveryChain=Promise.resolve(),this.onStop(),this.diagnostics.recordConnection("stopped","")}}isAlive(){if(this.running===null)return!1;return this.connected||this.reconnecting}handleStatus($){if($.status==="connected"){this.connected=!0,this.reconnecting=!1,this.diagnostics.recordConnection("connected",$.detail??"");return}if($.status==="disconnected"){this.connected=!1,this.reconnecting=!1,this.diagnostics.recordConnection("disconnected",$.detail??"");return}if($.status==="reconnecting")this.connected=!1,this.reconnecting=!0}onStop(){}}var Od=["disconnected","connecting","connected","reconnecting"],Hd=($)=>typeof $==="string"&&Od.includes($),zd=($)=>{if($.action!=="status")return null;let v=$.detail;if(!v)return null;let U=v.to;if(!Hd(U))return null;let I=typeof v.reason==="string"?v.reason:null;return{source:$.source,status:U,detail:I}};var jL=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),NL=($,v)=>{let U=$[v];return typeof U==="string"?U:void 0};class SL extends Cb{config;env;flumeDeps;signal;processor=null;constructor($){super({type:"discord",connectorId:$.config.id,channelId:$.channelId??null,logger:$.logger,diagnosticLog:$.diagnosticLog});this.config=$.config,this.env=$.env??process.env,this.flumeDeps=$.flumeDeps??{},this.signal=$.signal}async start($){this.diagnostics.recordConnection("started","");let v;try{v=o4({literal:this.config.botToken,envVar:this.config.botTokenEnv,env:this.env,label:`${this.config.name}.botToken`})}catch(I){throw this.diagnostics.recordConnection("auth-failed",T$(I)),I}let U=new A_({token:v,intents:i6.Guilds|i6.GuildMessages|i6.MessageContent|i6.DirectMessages});await this.runStart({source:U,onLog:OI(this.logger),deps:GI(this.flumeDeps),signal:this.signal,onEvent:(I)=>{if(I.source!=="discord")return Promise.resolve();return this.handleEvent(I,$)}})}onStop(){this.processor=null}async handleEvent($,v){if($.type==="READY"){this.adoptReady($.data);return}if(!this.processor){let G=crypto.randomUUID();this.diagnostics.recordRaw(G,JSON.stringify($.data)),this.diagnostics.recordProcessed(G,"skip:pre-ready","");return}let U=$.data,I=jL(U.author)?U.author:null,b=I!==null&&I.bot===!0,D=$.meta.user_id??"",u=$.meta.channel_id??"",w=$.meta.guild_id??null,g=Array.isArray(U.mentions)?U.mentions.map((G)=>jL(G)?NL(G,"id")??"":"").filter((G)=>G!==""):[],J=crypto.randomUUID(),X=JSON.stringify(U);this.diagnostics.recordRaw(J,X);let W=this.processor.process({authorId:D,authorIsBot:b,channelId:u,guildId:w,mentionedUserIds:g,raw:U});if(W.skip){this.diagnostics.recordProcessed(J,"skip:bot",X),this.logger?.info("discord skip",{reason:"bot author"});return}await this.deliver(v,J,X,W.content,W.meta)}adoptReady($){let v=jL($.user)?NL($.user,"id"):void 0,U=NL($,"user_id"),I=v??U??"";if(!I){let b=crypto.randomUUID();this.diagnostics.recordRaw(b,JSON.stringify($)),this.diagnostics.recordProcessed(b,"skip:ready-missing-user-id",""),this.diagnostics.recordConnection("error","discord READY payload had neither user.id nor user_id; processor not initialized"),this.logger?.error("discord READY missing user id",{connector:this.config.name});return}this.processor=new BL({ownUserId:I})}async deliver($,v,U,I,b){try{await $(I,b)}catch(D){this.diagnostics.recordProcessed(v,"emitted:delivery-failed",I||U),this.logger?.error("discord notify error",{error:T$(D)});return}this.diagnostics.recordProcessed(v,"emitted",I)}}var ib=($,v,U,I)=>{let b=U[$];if(typeof b==="string")return{[$]:b};let D=U[v];if(typeof D==="string")return{[v]:D};let u={},w=I[$],g=I[v];if(typeof w==="string")u[$]=w;if(typeof g==="string")u[v]=g;return u};var S_=()=>({type:"discord",toolExposed:!0,createListener($,v){return new SL({config:t4.parse($),channelId:v.channelId,logger:v.logger,diagnosticLog:v.diagnosticLog,signal:v.signal})},createAdapter($,v){return new AQ({config:t4.parse($),http:v.http})},secretTokens($){return[t4.parse($).botToken].filter((U)=>U!==void 0)},buildConfig($,v){return t4.parse({id:v.id,type:"discord",name:$.name,...typeof $.botToken==="string"?{botToken:$.botToken}:{},...typeof $.botTokenEnv==="string"?{botTokenEnv:$.botTokenEnv}:{},createdAt:v.now,updatedAt:v.now})},applyUpdate($,v,U){let I=t4.parse($);return t4.parse({id:I.id,name:I.name,type:"discord",createdAt:I.createdAt,updatedAt:U.now,...ib("botToken","botTokenEnv",v,I)})},operations:{}});import{openSync as __}from"fs";function M_($){let v=[],U=Array.from($),I="",b=!1,D=0;while(D<U.length){let u=U[D]??"";if(b){if(u==='"'&&U[D+1]==='"'){I+='"',D+=2;continue}if(u==='"'){b=!1,D+=1;continue}I+=u,D+=1;continue}if(u==='"'){b=!0,D+=1;continue}if(u===","){v.push(I),I="",D+=1;continue}I+=u,D+=1}return v.push(I),v}class P0{}var ML=($)=>{if(!$)return;let v={};for(let[U,I]of Object.entries(process.env))if(typeof I==="string")v[U]=I;for(let[U,I]of Object.entries($))v[U]=I;return v},_L=()=>process.platform==="win32";class $v extends P0{constructor(){super();Object.freeze(this)}runSync($){let v=Bun.spawnSync($,{stdout:"pipe",stderr:"pipe"});return{exitCode:v.exitCode??0,stdout:v.stdout.toString(),stderr:v.stderr.toString()}}async run($,v={}){let U=Bun.spawn($,{cwd:v.cwd,env:ML(v.env),stdin:v.input!==void 0?"pipe":"ignore",stdout:"pipe",stderr:"pipe"});if(v.input!==void 0&&U.stdin)U.stdin.write(v.input),U.stdin.end();let I=await U.exited,b=await new Response(U.stdout).text(),D=await new Response(U.stderr).text();return{exitCode:I,stdout:b,stderr:D}}async attach($,v={}){let U=Bun.spawn($,{cwd:v.cwd,env:ML(v.env),stdio:["inherit","inherit","inherit"]});if(v.onSpawned)v.onSpawned(U.pid);return await U.exited}detach($,v={}){let U=v.stdoutFile?__(v.stdoutFile,"a"):"ignore",I=v.stderrFile?v.stderrFile===v.stdoutFile&&typeof U==="number"?U:__(v.stderrFile,"a"):"ignore";Bun.spawn($,{env:ML(v.env),stdio:["ignore",U,I],windowsHide:!0}).unref()}kill($,v="SIGTERM"){try{process.kill($,v)}catch{}}isAlive($){if(!Number.isInteger($)||$<=0)return!1;if(_L())return this.isAliveWindows($);return this.isAlivePosix($)}listProcessesContaining($){if(!$)return[];if(_L())return this.listProcessesContainingWindows($);return this.listProcessesContainingPosix($)}getStartTime($){if(!Number.isInteger($)||$<=0)return null;if(_L())return this.getStartTimeWindows($);return this.getStartTimePosix($)}isAlivePosix($){let v=this.runSync(["ps","-p",String($),"-o","state="]);if(v.exitCode!==0)return!1;let U=v.stdout.trim();if(!U)return!1;return!U.startsWith("Z")}isAliveWindows($){let v=this.runSync(["tasklist","/FI",`PID eq ${$}`,"/NH","/FO","CSV"]);if(v.exitCode!==0)return!1;return v.stdout.includes(`"${$}"`)}listProcessesContainingPosix($){let v=this.runSync(["ps","-e","-o","pid=,args="]);if(v.exitCode!==0)return[];let U=[];for(let I of v.stdout.split(`
307
- `)){let b=I.trim();if(!b)continue;let D=/^(\d+)\s+(.+)$/.exec(b);if(!D)continue;let u=Number(D[1]),w=D[2]??"";if(!Number.isInteger(u)||u<=0)continue;if(!w.includes($))continue;U.push({pid:u,command:w})}return U}getStartTimePosix($){let v=this.runSync(["ps","-p",String($),"-o","lstart="]);if(v.exitCode!==0)return null;let U=v.stdout.trim();if(!U)return null;return U}getStartTimeWindows($){let v=`Get-CimInstance Win32_Process -Filter "ProcessId=${$}" | Select-Object -ExpandProperty CreationDate | ForEach-Object { $_.ToString("o") }`,U=this.runSync(["powershell","-NoProfile","-Command",v]);if(U.exitCode!==0)return null;let I=U.stdout.trim();if(!I)return null;return I}listProcessesContainingWindows($){let U=this.runSync(["powershell","-NoProfile","-Command","Get-CimInstance Win32_Process | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"]);if(U.exitCode!==0)return[];let I=[],b=U.stdout.split(/\r?\n/).slice(1);for(let D of b){let u=D.trim();if(!u)continue;let w=M_(u);if(w.length<2)continue;let g=Number(w[0]),J=w[1]??"";if(!Number.isInteger(g)||g<=0)continue;if(!J.includes($))continue;I.push({pid:g,command:J})}return I}}var Qd=new $v;class FL extends Pb{process;constructor($={}){super();this.process=$.process??Qd,Object.freeze(this)}async call($){let v=["api",$.path];if($.method&&$.method.toLowerCase()!=="get")v.push("-X",$.method.toUpperCase());let U=$.body&&typeof $.body==="object"&&Object.keys($.body).length>0;if(U)v.push("--input","-");let I=await this.process.run(["gh",...v],{input:U?JSON.stringify($.body):void 0});if(I.exitCode!==0)throw Error(`gh api failed: ${I.stderr.trim()||I.stdout.trim()}`);try{return JSON.parse(I.stdout)}catch{return I.stdout}}}var $6=H.object({id:H.string(),name:H.string(),type:H.literal("gh"),pollInterval:H.number().int().positive().optional(),token:H.string().optional(),tokenEnv:H.string().optional(),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});async function rJ($){try{return await $.response.text()}catch(v){return new tv({message:`${$.context}: failed to read body: ${x({error:v})}`,status:$.response.status,cause:v})}}function Yd($){return{event_type:"notification",reason:$.reason,subject_type:$.subject.type,repository:$.repository.full_name,thread_id:$.id}}var Vd=z$.object({id:z$.string(),reason:z$.string(),unread:z$.boolean(),updated_at:z$.string(),subject:z$.object({title:z$.string(),url:z$.string().nullable(),type:z$.string()}),repository:z$.object({full_name:z$.string()})}),Ld=class{props;seen=new Map;constructor($){this.props=$}has($,v){return this.seen.get($)===v}add($,v){this.seen.set($,v)}trim(){if(this.seen.size<=this.props.maxSize)return;let $=this.seen.size-this.props.maxSize;for(let v of this.seen.keys()){if($<=0)break;this.seen.delete(v),$--}}get size(){return this.seen.size}},Kd="https://api.github.com/notifications",qd=3,Bd=5000,Ad=class{props;log;cache=new Ld({maxSize:Bd});timer=null;rateLimitTimer=null;since=null;etag=null;lastModified=null;bootstrapped=!1;isStoppedFlag=!1;inFlight=!1;consecutiveErrors=0;effectiveIntervalSec;controller=null;constructor($){this.props=$,this.log=new d4({source:"github.poller",handler:$.onLog,deps:$.deps}),this.effectiveIntervalSec=$.interval}get isStopped(){return this.isStoppedFlag}async start(){this.isStoppedFlag=!1;let $=p(()=>new AbortController);if($ instanceof Error)this.log.error({action:"github.abort-controller.new.error",message:x({error:$}),error:$}),this.controller=null;else this.controller=$;this.log.info({action:"poller.start",message:`polling every ${this.effectiveIntervalSec}s`});let v=await this.poll();if(v)return v;if(this.isStoppedFlag)return null;if(this.rateLimitTimer!==null)return null;return this.scheduleInterval(),null}stop(){this.log.info({action:"poller.stop",message:"stopping poller"}),this.isStoppedFlag=!0,this.controller?.abort(),this.controller=null,this.clearTimer(),this.clearRateLimitTimer()}scheduleInterval(){this.clearTimer();let $=p(()=>this.props.deps.setInterval(()=>{this.poll().catch((v)=>{let U=F$({value:v});this.log.error({action:"poll.unhandled",message:x({error:U}),error:U})})},this.effectiveIntervalSec*1000));if($ instanceof Error){if(this.log.error({action:"poller.interval.schedule.error",message:x({error:$}),error:$}),this.timer=null,!this.isStoppedFlag)this.props.onDisconnected("interval scheduling rejected by runtime");return}this.timer=$}async poll(){if(this.inFlight||this.isStoppedFlag)return null;this.inFlight=!0;try{return await this.pollOnce()}catch($){let v=F$({value:$}),U=new tv({message:`poll loop threw: ${x({error:v})}`,status:0,cause:v});if(this.log.error({action:"poll.unhandled",message:x({error:U}),error:U}),!this.bootstrapped)return U;return null}finally{this.inFlight=!1}}async pollOnce(){let $=new URLSearchParams({all:"false",per_page:"50"});if(this.since)$.set("since",this.since);let v=`${Kd}?${$}`;this.log.debug({action:"http.request",message:`GET ${v}`});let U={Authorization:`Bearer ${this.props.token}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};if(this.etag)U["If-None-Match"]=this.etag;if(this.lastModified)U["If-Modified-Since"]=this.lastModified;let I=await p(()=>this.props.deps.fetch(v,{headers:U,signal:this.controller?.signal}));if(this.isStoppedFlag)return null;if(I instanceof Error)return this.log.error({action:"http.error",message:x({error:I}),error:I}),this.recordFailure({kind:"network",message:I.message,cause:I});if(this.log.debug({action:"http.response",message:`GET ${I.status}`,detail:{status:I.status,url:v}}),this.maybeWidenInterval(I.headers.get("X-Poll-Interval")),I.status===304)return this.consecutiveErrors=0,this.log.debug({action:"poll.not-modified",message:"304 Not Modified"}),null;if(this.isRateLimited(I))return this.handleRateLimit(I),null;if(!I.ok){let u=new tv({message:`HTTP ${I.status}`,status:I.status});return this.recordFailure({kind:"http",message:x({error:u}),error:u})}this.consecutiveErrors=0,this.etag=I.headers.get("ETag"),this.lastModified=I.headers.get("Last-Modified");let b=await rJ({response:I,context:"notifications"});if(this.isStoppedFlag)return null;if(b instanceof tv)return this.log.warn({action:"http.body.read",message:x({error:b}),error:b}),this.recordFailure({kind:"http",message:b.message,error:b});let D=Sb(b);if(D instanceof mv)return this.log.warn({action:"http.body.parse",message:D.message,error:D}),null;if(!Array.isArray(D))return this.log.warn({action:"http.body.shape",message:"response body is not an array, dropping",detail:{bodyType:typeof D}}),null;return this.processNotifications(D),null}recordFailure($){this.consecutiveErrors++;let v=$.error??new tv({message:$.message,status:0,cause:$.cause});if(this.log.error({action:"http.error",message:$.message,error:v,detail:{consecutiveErrors:this.consecutiveErrors}}),this.consecutiveErrors>=qd&&!this.isStoppedFlag)this.props.onDisconnected($.kind==="network"?"network error":$.message);if(!this.bootstrapped)return v;return null}isRateLimited($){if($.status===429)return!0;if($.status===403&&$.headers.get("X-RateLimit-Remaining")==="0")return!0;return!1}handleRateLimit($){let v=$.headers.get("Retry-After"),U=$.headers.get("X-RateLimit-Reset"),I=Math.floor(ev({deps:this.props.deps})/1000),b=v!==null?Number.parseInt(v,10):NaN,D=U!==null?Number.parseInt(U,10)-I:NaN,u=Number.isFinite(b)&&b>0?b:Number.isFinite(D)&&D>0?D:60;this.log.warn({action:"rate.limit",message:`rate limited, pausing for ${u}s`,detail:{status:$.status,delaySec:u}}),this.clearTimer(),this.clearRateLimitTimer();let w=p(()=>this.props.deps.setTimeout(()=>{if(this.rateLimitTimer=null,this.isStoppedFlag)return;this.scheduleInterval()},u*1000));if(w instanceof Error)this.log.error({action:"poller.rate-limit.schedule.error",message:x({error:w}),error:w}),this.rateLimitTimer=null;else this.rateLimitTimer=w}clearTimer(){if(this.timer===null)return;let $=this.timer,v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.log.error({action:"poller.timer.clear.error",message:x({error:v}),error:v});this.timer=null}clearRateLimitTimer(){if(this.rateLimitTimer===null)return;let $=this.rateLimitTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.log.error({action:"poller.rate-limit.clear.error",message:x({error:v}),error:v});this.rateLimitTimer=null}maybeWidenInterval($){if($===null)return;let v=Number.parseInt($,10);if(!Number.isFinite(v)||v<=this.effectiveIntervalSec)return;if(this.log.info({action:"poll.widen-interval",message:`widening interval ${this.effectiveIntervalSec}s -> ${v}s per X-Poll-Interval`,detail:{from:this.effectiveIntervalSec,to:v}}),this.effectiveIntervalSec=v,this.timer!==null)this.scheduleInterval()}processNotifications($){let v=$.map((D)=>Vd.safeParse(D));for(let D of v){if(D.success)continue;this.log.warn({action:"parse.skip",message:"notification did not match schema",detail:{issues:D.error.issues.map((u)=>({path:u.path,message:u.message}))}})}let U=v.flatMap((D)=>D.success?[D.data]:[]),I=$.length-U.length;if(I>0)this.log.warn({action:"parse.summary",message:`${I}/${$.length} notifications dropped by schema`});if(!this.bootstrapped){this.bootstrapped=!0;for(let D of U)this.cache.add(D.id,D.updated_at);this.advanceCursor(),this.log.info({action:"poller.bootstrap",message:`seeded ${U.length} existing notifications`}),this.props.onConnected();return}let b=U.filter((D)=>{if(this.cache.has(D.id,D.updated_at))return!1;return this.cache.add(D.id,D.updated_at),!0});if(this.cache.trim(),this.advanceCursor(),b.length>0){this.log.info({action:"poll.fresh",message:`${b.length} new notifications`,detail:{count:b.length}}),this.props.onNotifications(b);return}this.log.debug({action:"poll.idle",message:"0 new notifications"})}advanceCursor(){if(this.lastModified!==null){let U=new Date(this.lastModified);if(!Number.isNaN(U.getTime())){let I=p(()=>U.toISOString());if(!(I instanceof Error)){this.since=I;return}}}let $=ev({deps:this.props.deps});if(!Number.isFinite($)){this.log.warn({action:"cursor.advance.skip",message:"deps.now() returned non-finite, leaving since cursor unchanged"});return}let v=p(()=>new Date($).toISOString());if(v instanceof Error){let U=F$({value:v});this.log.warn({action:"cursor.advance.skip",message:x({error:U}),error:U});return}this.since=v}},F_=class extends Nb{options;name="github";poller=null;constructor($){super();this.options=$}async connect($){this.setStatus("connecting"),this.poller=new Ad({token:this.options.token,interval:this.options.pollInterval??60,onLog:$.log.handler,deps:$.deps,onNotifications:(U)=>this.handleNotifications($,U),onConnected:()=>this.setStatus("connected"),onDisconnected:(U)=>this.setStatus("disconnected",U)});let v=await this.poller.start();if(v instanceof Error)return $.log.error({action:"source.start.failed",message:x({error:v}),error:v}),this.setStatus("disconnected",v.message),v;return null}disconnect(){this.poller?.stop(),this.poller=null}handleNotifications($,v){for(let U of v)this.emit({source:"github",type:"notification",data:U,meta:this.safeExtractMeta($,U),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v){let U=p(()=>Yd(v));if(U instanceof Error){let I=F$({value:U});return $.log.warn({action:"meta.extract.error",message:x({error:I}),error:I,detail:{notificationId:v.id}}),{event_type:"notification"}}return U}};var Pd=new $v;class ZL extends Cb{config;env;process;flumeDeps;signal;constructor($){super({type:"gh",connectorId:$.config.id,channelId:$.channelId??null,logger:$.logger,diagnosticLog:$.diagnosticLog});this.config=$.config,this.env=$.env??process.env,this.process=$.process??Pd,this.flumeDeps=$.flumeDeps??{},this.signal=$.signal}async start($){this.diagnostics.recordConnection("started","");let v;try{v=await this.resolveToken()}catch(I){throw this.diagnostics.recordConnection("auth-failed",T$(I)),I}let U=new F_({token:v,pollInterval:this.config.pollInterval??60});await this.runStart({source:U,onLog:OI(this.logger),deps:GI(this.flumeDeps),signal:this.signal,onEvent:(I)=>{if(I.source!=="github")return Promise.resolve();return this.handleEvent(I,$)}})}async resolveToken(){if(this.config.token)return this.config.token;if(this.config.tokenEnv){let v=this.env[this.config.tokenEnv];if(typeof v==="string"&&v!=="")return v;throw Error(`${this.config.name}.token references env var "${this.config.tokenEnv}" but it is not set`)}let $=await this.process.run(["gh","auth","token"]);if($.exitCode!==0)throw Error(`gh auth token failed: ${$.stderr.trim()||$.stdout.trim()}`);return $.stdout.trim()}async handleEvent($,v){let U=$.data.id,I=JSON.stringify($.data);this.diagnostics.recordRaw(U,I);let b={...$.meta,event_type:"gh",subject_url:$.data.subject.url??"",updated_at:$.data.updated_at};await this.deliver(v,U,I,b)}async deliver($,v,U,I){try{await $(U,I)}catch(b){this.diagnostics.recordProcessed(v,"emitted:delivery-failed",U),this.logger?.error("gh notify error",{error:T$(b)});return}this.diagnostics.recordProcessed(v,"emitted",U)}}var Z_=()=>({type:"gh",toolExposed:!0,createListener($,v){return new ZL({config:$6.parse($),channelId:v.channelId,process:v.process,logger:v.logger,diagnosticLog:v.diagnosticLog,signal:v.signal})},createAdapter($,v){return $6.parse($),new FL({process:v.process})},secretTokens($){return[$6.parse($).token].filter((U)=>U!==void 0)},buildConfig($,v){return $6.parse({id:v.id,type:"gh",name:$.name,...typeof $.pollInterval==="number"?{pollInterval:$.pollInterval}:{},...typeof $.token==="string"?{token:$.token}:{},...typeof $.tokenEnv==="string"?{tokenEnv:$.tokenEnv}:{},createdAt:v.now,updatedAt:v.now})},applyUpdate($,v,U){let I=$6.parse($);return $6.parse({id:I.id,name:I.name,type:"gh",pollInterval:typeof v.pollInterval==="number"?v.pollInterval:I.pollInterval,createdAt:I.createdAt,updatedAt:U.now,...ib("token","tokenEnv",v,I)})},operations:{}});import{join as cd}from"path";var TL=H.enum(["latest","all","skip"]),x6=H.object({id:H.string(),cron:H.string(),prompt:H.string(),enabled:H.boolean().default(!0),catchupPolicy:TL.default("latest")}),n4=H.object({id:H.string(),name:H.string(),type:H.literal("schedule"),entries:H.array(x6).default([]),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});var j0=($,v,U)=>{let I=new Set;for(let b of $.split(",")){let[D,u]=b.split("/"),w=u?Number(u):1;if(!Number.isFinite(w)||w<=0)throw Error(`invalid cron step: "${u}"`);let g=v,J=U;if(D==="*"||D===void 0||D==="")g=v,J=U;else if(D.includes("-")){let[X,W]=D.split("-"),G=Number(X),O=Number(W);if(!Number.isFinite(G)||!Number.isFinite(O))throw Error(`invalid cron range: "${D}"`);g=G,J=O}else{let X=Number(D);if(!Number.isFinite(X))throw Error(`invalid cron value: "${D}"`);g=X,J=u?U:X}if(g<v||J>U||g>J)throw Error(`cron value out of range: ${D} (must be ${v}-${U})`);for(let X=g;X<=J;X+=w)I.add(X)}return{min:v,max:U,values:I}},CJ=($,v)=>{let U=$.trim().split(/\s+/);if(U.length!==5)throw Error(`cron must have 5 fields (got ${U.length}): "${$}"`);let[I,b,D,u,w]=U;if(!I||!b||!D||!u||!w)throw Error(`cron has empty fields: "${$}"`);let g=[{field:j0(I,0,59),value:v.getMinutes()},{field:j0(b,0,23),value:v.getHours()},{field:j0(D,1,31),value:v.getDate()},{field:j0(u,1,12),value:v.getMonth()+1},{field:j0(w,0,6),value:v.getDay()}];for(let{field:J,value:X}of g)if(!J.values.has(X))return!1;return!0};var T_=1440;class kL extends B0{config;lastFiredStore;logger;diagnostics;now;onFired;timer=null;stopped=!1;tickScheduled=!1;constructor($){super();this.config=$.config,this.lastFiredStore=$.lastFiredStore,this.logger=$.logger,this.diagnostics=new A0({type:"schedule",connectorId:$.config.id,channelId:$.channelId??null,log:$.diagnosticLog}),this.now=$.now??(()=>new Date),this.onFired=$.onFired??null}async start($){this.stopped=!1,this.tickScheduled=!0,this.diagnostics.recordConnection("started","");let v=()=>{if(this.stopped)return;let U=this.now(),I=60000-(U.getSeconds()*1000+U.getMilliseconds());this.timer=setTimeout(async()=>{if(this.stopped)return;try{await this.tick($)}catch(b){this.recordTickError(b)}v()},I),this.timer.unref(),this.tickScheduled=!0};try{await this.tick($)}catch(U){this.recordTickError(U)}this.diagnostics.recordConnection("connected",""),v()}async stop(){if(this.stopped=!0,this.tickScheduled=!1,this.timer)clearTimeout(this.timer),this.timer=null;this.diagnostics.recordConnection("disconnected",""),this.diagnostics.recordConnection("stopped","")}recordTickError($){let v=T$($);this.diagnostics.recordConnection("error",`tick: ${v}`),this.logger?.error("schedule tick failed",{connector:this.config.name,error:v})}isAlive(){return!this.stopped&&this.tickScheduled}async tick($){let v=this.truncateToMinute(this.now()),U=this.lastFiredStore.load(),I=!1;for(let b of this.config.entries){if(!b.enabled)continue;if(await this.fireEntry(b,v,U,$))I=!0}if(I)this.lastFiredStore.save(U)}async fireEntry($,v,U,I){let b=U.get($.id),D=b?new Date(b.getTime()+60000):v;if(D.getTime()>v.getTime())return!1;if($.catchupPolicy==="skip"){try{if(!CJ($.cron,v))return!1}catch(w){return this.logInvalidCron($,w),!1}return await this.notifyOne($,v,I,!1),U.set($.id,v),!0}if($.catchupPolicy==="all"){let w=this.findAllMatches($.cron,D,v,$.id);if(w.length===0)return!1;for(let g of w)await this.notifyOne($,g,I,g.getTime()!==v.getTime());return U.set($.id,w[w.length-1]??v),!0}let u=this.findMostRecentMatch($.cron,D,v,$.id);if(!u)return!1;return await this.notifyOne($,u,I,u.getTime()!==v.getTime()),U.set($.id,u),!0}async notifyOne($,v,U,I){let b={event_type:"schedule",schedule_id:$.id,cron:$.cron,fired_at:v.toISOString(),catchup_policy:$.catchupPolicy};if(I)b.catchup="true";let D=`${$.id}@${v.toISOString()}`;this.diagnostics.recordRaw(D,JSON.stringify({schedule_id:$.id,cron:$.cron,prompt:$.prompt,fired_at:v.toISOString(),catchup:I}));try{await U($.prompt,b)}catch(u){throw this.diagnostics.recordProcessed(D,"emitted:delivery-failed",$.prompt),u}if(this.diagnostics.recordProcessed(D,"emitted",$.prompt),this.onFired)try{await this.onFired($,v)}catch(u){this.logger?.error("schedule onFired callback failed",{connector:this.config.name,id:$.id,error:T$(u)})}}findMostRecentMatch($,v,U,I){let b=Math.min(T_,Math.floor((U.getTime()-v.getTime())/60000)+1);for(let D=0;D<b;D++){let u=new Date(U.getTime()-D*60000);try{if(CJ($,u))return u}catch(w){return this.logInvalidCron({id:I,cron:$},w),null}}return null}findAllMatches($,v,U,I){let b=Math.min(T_,Math.floor((U.getTime()-v.getTime())/60000)+1),D=[];for(let u=0;u<b;u++){let w=new Date(v.getTime()+u*60000);if(w.getTime()>U.getTime())break;try{if(CJ($,w))D.push(w)}catch(g){return this.logInvalidCron({id:I,cron:$},g),[]}}return D}logInvalidCron($,v){let U=T$(v);this.diagnostics.recordConnection("error",`invalid cron "${$.cron}" (entry ${$.id}): ${U}`),this.logger?.error("invalid cron expression in schedule",{connector:this.config.name,id:$.id,cron:$.cron,error:U})}truncateToMinute($){let v=new Date($.getTime());return v.setSeconds(0,0),v}}import{dirname as hd}from"path";import{appendFileSync as jd,chmodSync as Nd,closeSync as Sd,existsSync as Md,mkdirSync as _d,openSync as Fd,readdirSync as Zd,readFileSync as R_,renameSync as Td,statSync as n_,unlinkSync as S0,writeFileSync as r_}from"fs";import{dirname as kd,basename as Ed}from"path";class N0{}var Rd=384,EL=0,nd=()=>{return EL=EL+1|0,`${process.pid}-${EL}-${Math.floor(Math.random()*1e9)}`};class d$ extends N0{constructor(){super();Object.freeze(this)}existsSync($){return Md($)}readFileSync($){return R_($,"utf-8")}writeFileSync($,v){E_($,v,null)}writeSecretFileSync($,v){E_($,v,Rd)}appendFileSync($,v){jd($,v)}unlink($){try{S0($)}catch(v){if(RL(v,"ENOENT"))return;throw v}}mkdirSync($,v){_d($,{recursive:v?.recursive??!1})}readdirSync($){return Zd($)}statSync($){let v=n_($);return{mtimeMs:v.mtimeMs,mode:v.mode&511}}withFileLock($,v){let U=xd($);try{return v()}finally{try{Sd(U)}catch{}try{S0($)}catch{}}}}var rd=10,Cd=100,k_=5000,id=30000,xd=($)=>{let v=performance.now()+k_,U=0;while(!0)try{let I=Fd($,"wx",384);return r_(I,String(process.pid)),I}catch(I){if(!RL(I,"EEXIST"))throw I;if(performance.now()>=v)throw Error(`failed to acquire file lock ${$} within ${k_}ms`);ld($);let b=Math.min(Cd,rd*2**Math.min(U,4));yd(b),U=U+1}},ld=($)=>{let v,U;try{U=n_($).mtimeMs,v=Number(R_($,"utf-8").trim())}catch{return}if(Date.now()-U>id){try{S0($)}catch{}return}if(v>0&&!fd(v))try{S0($)}catch{}},fd=($)=>{try{return process.kill($,0),!0}catch(v){if(RL(v,"EPERM"))return!0;return!1}},yd=($)=>{let v=new SharedArrayBuffer(4),U=new Int32Array(v);Atomics.wait(U,0,0,$)},RL=($,v)=>{if(!($ instanceof Error))return!1;if(!("code"in $))return!1;return $.code===v},E_=($,v,U)=>{let b=`${kd($)}/.${Ed($)}.${nd()}.tmp`,D=U===null?void 0:{mode:U};try{if(r_(b,v,D),U!==null)try{Nd(b,U)}catch{}Td(b,$)}catch(u){try{S0(b)}catch{}throw u}};var md=new d$;class nL{path;fs;constructor($){this.path=$.path,this.fs=$.fs??md,Object.freeze(this)}load(){let $=new Map;if(!this.fs.existsSync(this.path))return $;let v=JSON.parse(this.fs.readFileSync(this.path));if(v===null||typeof v!=="object")return $;for(let[U,I]of Object.entries(v))if(typeof I==="string")$.set(U,new Date(I));return $}save($){let v={};for(let[U,I]of $)v[U]=I.toISOString();this.fs.mkdirSync(hd(this.path),{recursive:!0}),this.fs.writeFileSync(this.path,`${JSON.stringify(v,null,2)}
308
- `)}}var od=H.object({cron:H.string(),prompt:H.string(),id:H.string().optional(),enabled:H.boolean().optional(),catchupPolicy:x6.shape.catchupPolicy.optional()}),td=H.object({id:H.string()}),C_=($={})=>({type:"schedule",toolExposed:!1,createListener(v,U){let I=n4.parse(v);return new kL({config:I,lastFiredStore:new nL({path:cd(U.connectorDir(U.channelId,I.id),"state.json"),fs:U.fs}),channelId:U.channelId,logger:U.logger,diagnosticLog:U.diagnosticLog,onFired:$.onFired,now:()=>U.clock.now()})},createAdapter:null,secretTokens(){return[]},buildConfig(v,U){return n4.parse({id:U.id,type:"schedule",name:v.name,entries:Array.isArray(v.entries)?v.entries:[],createdAt:U.now,updatedAt:U.now})},applyUpdate(v,U,I){let b=n4.parse(v);return n4.parse({...b,updatedAt:I.now})},operations:{listEntries(v){let U=n4.parse(v.config);return{config:v.config,result:U.entries}},addEntry(v){let U=n4.parse(v.config),I=od.parse(v.args),b=x6.parse({id:I.id??v.context.generateId(),cron:I.cron,prompt:I.prompt,...I.enabled!==void 0?{enabled:I.enabled}:{},...I.catchupPolicy!==void 0?{catchupPolicy:I.catchupPolicy}:{}});return{config:n4.parse({...U,entries:[...U.entries,b],updatedAt:v.context.now}),result:b}},removeEntry(v){let U=n4.parse(v.config),I=td.parse(v.args);if(!U.entries.some((b)=>b.id===I.id))throw Error(`schedule entry "${I.id}" not found`);return{config:n4.parse({...U,entries:U.entries.filter((b)=>b.id!==I.id),updatedAt:v.context.now}),result:null}}}});var dd="https://slack.com/api/",pd=($)=>{let v={};for(let[U,I]of Object.entries($))v[U]=I;return v};class rL extends Pb{token;http;constructor($){super();this.token=o4({literal:$.config.botToken,envVar:$.config.botTokenEnv,env:$.env??process.env,label:`${$.config.name}.botToken`}),this.http=$.http??new g4,Object.freeze(this)}async call($){let v=`${dd}${$.path}`,U=$.body!==null&&typeof $.body==="object"?pd($.body):{},I=new URLSearchParams;for(let[u,w]of Object.entries(U))I.set(u,typeof w==="string"?w:JSON.stringify(w));let D=await(await this.http.fetch({method:"POST",url:v,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/x-www-form-urlencoded"},body:I.toString()})).text();try{return JSON.parse(D)}catch{return{ok:!1,error:`non-JSON response: ${D.slice(0,200)}`}}}async postMessage($){return this.call({method:"post",path:"chat.postMessage",body:{channel:$.channel,text:$.text,...$.threadTs?{thread_ts:$.threadTs}:{}}})}async addReaction($){return this.call({method:"post",path:"reactions.add",body:{channel:$.channel,timestamp:$.timestamp,name:$.name}})}async removeReaction($){return this.call({method:"post",path:"reactions.remove",body:{channel:$.channel,timestamp:$.timestamp,name:$.name}})}}var v6=H.object({id:H.string(),name:H.string(),type:H.literal("slack"),botToken:H.string().startsWith("xoxb-").optional(),appToken:H.string().startsWith("xapp-").optional(),botTokenEnv:H.string().optional(),appTokenEnv:H.string().optional(),minify:H.boolean().default(!0),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});function ad($){let v={event_type:$.type},U=p4($.payload.event)?$.payload.event:null;if(!U)return v;if(typeof U.channel==="string")v.channel_id=U.channel;if(typeof U.user==="string")v.user_id=U.user;if(typeof U.thread_ts==="string")v.thread_ts=U.thread_ts;if(typeof U.type==="string")v.slack_event_type=U.type;return v}var ed=class{props;seen=new Map;constructor($){this.props=$}has($){let v=this.seen.get($);if(v===void 0)return!1;if(ev({deps:this.props.deps})-v>this.props.ttlMs)return this.seen.delete($),!1;return!0}add($){this.seen.set($,ev({deps:this.props.deps}))}trim(){let $=ev({deps:this.props.deps})-this.props.ttlMs;for(let[U,I]of this.seen)if(I<$)this.seen.delete(U);if(this.seen.size<=this.props.maxSize)return;let v=this.seen.size-this.props.maxSize;for(let U of this.seen.keys()){if(v<=0)break;this.seen.delete(U),v--}}get size(){return this.seen.size}},sd=z$.object({ok:z$.boolean(),url:z$.string().optional(),error:z$.string().optional()}),CL="https://slack.com/api/apps.connections.open";async function $p($){let v=new d4({source:"slack.url",handler:$.onLog,deps:$.deps});v.debug({action:"http.request",message:`POST ${CL}`});let U=await p(()=>$.deps.fetch(CL,{method:"POST",headers:{Authorization:`Bearer ${$.appToken}`},signal:$.signal}));if(U instanceof Error){let w=F$({value:U});return v.error({action:"http.error",message:x({error:w}),error:w}),new Uv(`apps.connections.open transport: ${U.message}`,{cause:U})}v.debug({action:"http.response",message:`POST ${U.status}`,detail:{status:U.status,url:CL}});let I=await rJ({response:U,context:"apps.connections.open"});if(I instanceof tv)return v.warn({action:"http.body.read",message:x({error:I}),error:I}),I;let b=Sb(I);if(b instanceof mv)return v.warn({action:"http.body.parse",message:b.message,error:b}),new tv({message:"apps.connections.open: invalid JSON body",status:U.status,cause:b});let D=p4(b)?b:{};v.debug({action:"http.body",message:"apps.connections.open response",detail:{ok:D.ok,error:D.error}});let u=sd.safeParse(b);if(!u.success)return v.warn({action:"http.body.schema",message:"apps.connections.open: invalid response shape",detail:{issues:u.error.issues.map((w)=>({path:w.path,message:w.message}))}}),new tv({message:"apps.connections.open: invalid response shape",status:U.status,cause:u.error});if(!u.data.ok||!u.data.url)return v.warn({action:"slack.api.error",message:`apps.connections.open failed: ${u.data.error??"no url"}`}),new tv({message:`apps.connections.open failed: ${u.data.error??"no url"}`,status:U.status});return v.info({action:"slack.url.obtained",message:"WSS URL obtained"}),u.data.url}var vp=z$.object({envelope_id:z$.string(),type:z$.string(),payload:z$.record(z$.string(),z$.unknown()),accepts_response_payload:z$.boolean().optional(),retry_attempt:z$.number().optional(),retry_reason:z$.string().optional()}),bp=90000,Up=15000,i_=1,Ip=class{props;log;ws=null;isStoppedFlag=!1;hasConnected=!1;pendingResolve=null;pendingResolved=!1;lastFrameAt=0;idleWatchdog=null;constructor($){this.props=$,this.log=new d4({source:"slack.socket-mode",handler:$.onLog,deps:$.deps})}get isStopped(){return this.isStoppedFlag}async connect($){this.log.info({action:"connect.start",message:"opening WebSocket connection"});let v=await $p({appToken:this.props.appToken,signal:$?.signal,onLog:this.props.onLog,deps:this.props.deps});if(v instanceof tv)return this.log.error({action:"http.error",message:v.message,error:v}),v;if(v instanceof Uv)return this.log.error({action:"url.error",message:v.message,error:v}),v;if(this.isStoppedFlag){let U=new Uv("stopped before WebSocket open");return this.log.info({action:"connect.aborted",message:x({error:U})}),U}return this.log.info({action:"slack.url.obtained",message:"WebSocket URL obtained"}),this.openSocket(v)}disconnect(){this.log.info({action:"disconnect",message:"stopping socket mode"}),this.isStoppedFlag=!0,this.disarmIdleWatchdog(),this.closeSocket(this.ws),this.ws=null}armIdleWatchdog(){this.disarmIdleWatchdog();let $=this.props.idleTimeoutMs??bp,v=p(()=>this.props.deps.setInterval(()=>this.checkIdle($),Up));if(v instanceof Error){this.log.error({action:"idle.watchdog.schedule.error",message:x({error:v}),error:v});return}this.idleWatchdog=v}disarmIdleWatchdog(){if(!this.idleWatchdog)return;let $=this.idleWatchdog;this.idleWatchdog=null;let v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.log.error({action:"idle.watchdog.clear.error",message:x({error:v}),error:v})}checkIdle($){if(!this.hasConnected||this.isStoppedFlag)return;let v=this.props.deps.now()-this.lastFrameAt;if(v<$)return;this.log.warn({action:"idle.timeout",message:`no frames for ${v}ms (limit ${$}ms) \u2014 force-closing socket`,detail:{elapsedMs:v,limitMs:$}}),this.disarmIdleWatchdog(),this.closeSocket(this.ws)}isConnected(){return this.ws!==null&&this.ws.readyState===i_}openSocket($){let v=this.props.deps.WebSocket;if(!v){let U=new Uv("WebSocket runtime not available");return this.log.error({action:"ws.error",message:x({error:U}),error:U}),Promise.resolve(U)}return this.pendingResolved=!1,this.hasConnected=!1,new Promise((U)=>{this.pendingResolve=U;let I=p(()=>new v($));if(I instanceof Error){let u=new Uv(`WebSocket construction failed: ${x({error:I})}`,{cause:I});this.log.error({action:"ws.construct.error",message:x({error:u}),error:u}),this.ws=null,this.pendingResolved=!0,U(u);return}let b=I;this.ws=b;let D=p(()=>{b.addEventListener("message",(u)=>this.safeOnMessage(u,b)),b.addEventListener("close",(u)=>this.safeOnClose(u)),b.addEventListener("error",()=>this.safeOnError())});if(D instanceof Error){let u=new Uv(`WebSocket listener registration failed: ${x({error:D})}`,{cause:D});this.log.error({action:"ws.listener.error",message:x({error:u}),error:u}),this.ws=null,this.pendingResolved=!0,U(u)}})}completeConnect($){if(this.pendingResolved||!this.pendingResolve)return;this.pendingResolved=!0,this.pendingResolve($)}safeOnMessage($,v){let U=p(()=>this.onMessage(String($.data),v));if(U instanceof Error)this.log.error({action:"ws.message.threw",message:x({error:U}),error:U})}safeOnClose($){let v=p(()=>this.onClose($));if(v instanceof Error)this.log.error({action:"ws.close.threw",message:x({error:v}),error:v})}safeOnError(){let $=p(()=>this.onError());if($ instanceof Error)this.log.error({action:"ws.error.threw",message:x({error:$}),error:$})}onMessage($,v){if(this.isStoppedFlag)return;let U=Sb($);if(U instanceof mv){this.log.error({action:"ws.parse.error",message:U.message,error:U,detail:{length:$.length}});return}if(!p4(U)){this.log.error({action:"ws.parse.error",message:"expected JSON object",error:new mv(`non-object frame (${typeof U})`)});return}if(this.log.debug({action:"ws.recv",message:`type=${typeof U.type==="string"?U.type:"-"} length=${$.length}`,detail:{length:$.length}}),this.lastFrameAt=this.props.deps.now(),U.type==="hello"){this.log.info({action:"socket.hello",message:"connection ready"}),this.hasConnected=!0,this.armIdleWatchdog(),this.props.onConnected(),this.completeConnect(null);return}if(U.type==="disconnect"){let b=typeof U.reason==="string"?U.reason:"unknown";this.log.info({action:"ws.disconnect.requested",message:`reason=${b}`,detail:{reason:b}}),this.closeSocket(v);return}if(typeof U.envelope_id==="string"){this.log.debug({action:"ws.ack",message:`envelope_id=${U.envelope_id}`});let b=this.safeSerialize({envelope_id:U.envelope_id});if(b!==null)this.send(v,b)}let I=vp.safeParse(U);if(I.success){this.log.debug({action:"envelope.recv",message:`type=${I.data.type} envelope_id=${I.data.envelope_id}`,detail:{type:I.data.type,envelopeId:I.data.envelope_id}}),this.props.onMessage(I.data);return}this.log.warn({action:"envelope.parse.error",message:"unrecognised envelope shape, dropping",detail:{type:typeof U.type==="string"?U.type:"unknown",issues:I.error.issues.map((b)=>({path:b.path,message:b.message}))}})}onClose($){if(this.log.info({action:"ws.close",message:`code=${$.code} reason=${$.reason||"none"}`,detail:{code:$.code,reason:$.reason}}),this.disarmIdleWatchdog(),this.ws=null,this.hasConnected)this.props.onDisconnected();if(!this.pendingResolved){let v=new Uv(`WebSocket closed before hello (code=${$.code})`,{code:$.code});this.completeConnect(v)}}onError(){let $=new Uv("WebSocket connection error");this.log.error({action:"ws.error",message:x({error:$}),error:$}),this.completeConnect($)}closeSocket($){if($===null)return;let v=p(()=>$.close());if(v instanceof Error)this.log.error({action:"ws.close.error",message:x({error:v}),error:v})}send($,v){if($.readyState!==i_){this.log.warn({action:"ws.send",message:`ws.send skipped: readyState=${$.readyState} (not OPEN)`,detail:{readyState:$.readyState}});return}let U=p(()=>$.send(v));if(U instanceof Error)this.log.error({action:"ws.send",message:`ws.send failed: ${x({error:U})}`,error:U})}safeSerialize($){let v=Ug($);if(v instanceof Error)return this.log.error({action:"ws.send.serialize.error",message:x({error:v}),error:v}),null;return v}},Dp=1024,up=300000,x_=class extends Nb{options;name="slack";socket=null;reconnector=null;internalController=null;seen=null;constructor($){super();this.options=$}async connect($){if(!this.hasWebSocket($))return new F4("Slack source: deps.WebSocket is null (no WebSocket runtime available)");if(this.seen=new ed({maxSize:Dp,ttlMs:up,deps:$.deps}),$.reconnect&&!this.reconnector)this.reconnector=new vg({...$.reconnect,log:$.log,deps:$.deps});let v=p(()=>new AbortController);if(v instanceof Error){let U=F$({value:v});$.log.error({action:"slack.abort-controller.new.error",message:x({error:U}),error:U}),this.internalController=null}else this.internalController=v;return await this.connectInternal($)}disconnect(){let $=this.context;if($&&this.reconnector&&!this.reconnector.aborted)$.log.debug({action:"reconnect.cancel",message:"aborting reconnector"});this.reconnector?.cancel(),this.internalController?.abort(),this.socket?.disconnect(),this.socket=null,this.internalController=null}hasWebSocket($){let v=p(()=>Boolean($.deps.WebSocket));if(v instanceof Error){let U=F$({value:v});return $.log.error({action:"deps.web-socket.read.error",message:x({error:U}),error:U}),!1}return v}async connectInternal($){this.setStatus("connecting"),this.socket=new Ip({appToken:this.options.appToken,onLog:$.log.handler,deps:$.deps,onMessage:(U)=>this.handleMessage($,U),onConnected:()=>{if(this.reconnector&&this.reconnector.attempt>0)$.log.info({action:"reconnect.reset",message:`cleared ${this.reconnector.attempt} attempts`});this.reconnector?.reset(),this.setStatus("connected")},onDisconnected:()=>{if(this.socket?.isStopped){this.setStatus("disconnected");return}this.scheduleReconnect($)}});let v=await this.socket.connect({signal:this.internalController?.signal});if(v instanceof Error){if($.log.error({action:"connect.failed",message:x({error:v}),error:v}),this.socket.isStopped||!this.reconnector||this.reconnector.aborted)return this.setStatus("disconnected"),v;this.scheduleReconnect($)}return null}handleMessage($,v){let U=this.seen;if(!U)return;if(U.has(v.envelope_id)){$.log.debug({action:"dedup.skip",message:`duplicate envelope_id=${v.envelope_id}`,detail:{envelope_id:v.envelope_id,retry_attempt:v.retry_attempt}});return}U.add(v.envelope_id),U.trim(),this.emit({source:"slack",type:v.type,data:v.payload,meta:this.safeExtractMeta($,v),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v){let U=p(()=>ad(v));if(U instanceof Error){let I=F$({value:U});return $.log.warn({action:"meta.extract.error",message:x({error:I}),error:I,detail:{envelopeType:v.type}}),{event_type:v.type}}return U}scheduleReconnect($){bg({reconnector:this.reconnector,log:$.log,setStatus:(v)=>this.setStatus(v),retry:()=>{this.connectInternal($).catch((v)=>{let U=F$({value:v});$.log.error({action:"reconnect.unhandled",message:x({error:U}),error:U}),this.setStatus("disconnected")})}})}};class M0 extends Error{constructor($,v){super($);if(this.name=new.target.name,v?.cause!==void 0)Object.defineProperty(this,"cause",{value:v.cause,enumerable:!1})}}class _0 extends M0{channel;code="channel-not-found";constructor($,v){super(`channel not found: ${$}`,v);this.channel=$}}class iJ extends M0{channel;code="channel-already-exists";constructor($,v){super(`channel already exists: ${$}`,v);this.channel=$}}class HI extends M0{channel;connector;code="connector-not-found";constructor($,v,U){super(`connector not found in ${$}: ${v}`,U);this.channel=$;this.connector=v}}class F0 extends M0{connector;detail;code="auth-failed";constructor($,v,U){super(`${$}: auth failed \u2014 ${v}`,U);this.connector=$;this.detail=v}}var wp=["type","subtype","user","bot_id","text","ts","thread_ts","channel","channel_type","files","attachments"],gp=["id","name","mimetype","filetype","size","url_private","permalink"],Jp=["title","text","fallback"],xJ=($)=>{return typeof $==="object"&&$!==null&&!Array.isArray($)},iL=($,v)=>{let U={};for(let I of v)if($[I]!==void 0)U[I]=$[I];return U},Xp=($)=>{return Object.keys($).some((v)=>v.startsWith("thumb")||v.startsWith("preview"))},Wp=($)=>{if(!xJ($))return $;let v=iL($,gp);if(Xp($))v._funnel_omitted=["thumb_*"];return v},xL=($)=>{if(!xJ($))return"";let v=$.text;if(typeof v==="string")return v;let U=$.elements;if(!Array.isArray(U))return"";return U.map(xL).join("")},Gp=($)=>{if(!Array.isArray($))return"";return $.map(xL).join("\t")},Op=($)=>{if(!xJ($))return"";if($.type==="table"&&Array.isArray($.rows))return $.rows.map(Gp).join(`
306
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let u of $.seen.entries()){let w=u[1];if(v===u[0]){D(u);continue}if($.external){let J=$.external.registry.get(u[0])?.id;if(v!==u[0]&&J){D(u);continue}}if($.metadataRegistry.get(u[0])?.id){D(u);continue}if(w.cycle){D(u);continue}if(w.count>1){if($.reused==="ref"){D(u);continue}}}}function C6($,v){let U=$.seen.get(v);if(!U)throw Error("Unprocessed schema. This is a bug in Zod.");let I=(w)=>{let g=$.seen.get(w);if(g.ref===null)return;let J=g.def??g.schema,X={...J},W=g.ref;if(g.ref=null,W){I(W);let O=$.seen.get(W),z=O.schema;if(z.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))J.allOf=J.allOf??[],J.allOf.push(z);else Object.assign(J,z);if(Object.assign(J,X),w._zod.parent===W)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(!(Y in X))delete J[Y]}if(z.$ref&&O.def)for(let Y in J){if(Y==="$ref"||Y==="allOf")continue;if(Y in O.def&&JSON.stringify(J[Y])===JSON.stringify(O.def[Y]))delete J[Y]}}let G=w._zod.parent;if(G&&G!==W){I(G);let O=$.seen.get(G);if(O?.schema.$ref){if(J.$ref=O.schema.$ref,O.def)for(let z in J){if(z==="$ref"||z==="allOf")continue;if(z in O.def&&JSON.stringify(J[z])===JSON.stringify(O.def[z]))delete J[z]}}}$.override({zodSchema:w,jsonSchema:J,path:g.path??[]})};for(let w of[...$.seen.entries()].reverse())I(w[0]);let b={};if($.target==="draft-2020-12")b.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")b.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")b.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let w=$.external.registry.get(v)?.id;if(!w)throw Error("Schema is missing an `id` property");b.$id=$.external.uri(w)}Object.assign(b,U.def??U.schema);let D=$.metadataRegistry.get(v)?.id;if(D!==void 0&&b.id===D)delete b.id;let u=$.external?.defs??{};for(let w of $.seen.entries()){let g=w[1];if(g.def&&g.defId){if(g.def.id===g.defId)delete g.def.id;u[g.defId]=g.def}}if($.external);else if(Object.keys(u).length>0)if($.target==="draft-2020-12")b.$defs=u;else b.definitions=u;try{let w=JSON.parse(JSON.stringify(b));return Object.defineProperty(w,"~standard",{value:{...v["~standard"],jsonSchema:{input:UI(v,"input",$.processors),output:UI(v,"output",$.processors)}},enumerable:!1,writable:!1}),w}catch(w){throw Error("Error converting schema to JSON.")}}function Nv($,v){let U=v??{seen:new Set};if(U.seen.has($))return!1;U.seen.add($);let I=$._zod.def;if(I.type==="transform")return!0;if(I.type==="array")return Nv(I.element,U);if(I.type==="set")return Nv(I.valueType,U);if(I.type==="lazy")return Nv(I.getter(),U);if(I.type==="promise"||I.type==="optional"||I.type==="nonoptional"||I.type==="nullable"||I.type==="readonly"||I.type==="default"||I.type==="prefault")return Nv(I.innerType,U);if(I.type==="intersection")return Nv(I.left,U)||Nv(I.right,U);if(I.type==="record"||I.type==="map")return Nv(I.keyType,U)||Nv(I.valueType,U);if(I.type==="pipe"){if($._zod.traits.has("$ZodCodec"))return!0;return Nv(I.in,U)||Nv(I.out,U)}if(I.type==="object"){for(let b in I.shape)if(Nv(I.shape[b],U))return!0;return!1}if(I.type==="union"){for(let b of I.options)if(Nv(b,U))return!0;return!1}if(I.type==="tuple"){for(let b of I.items)if(Nv(b,U))return!0;if(I.rest&&Nv(I.rest,U))return!0;return!1}return!1}var S3=($,v={})=>(U)=>{let I=n6({...U,processors:v});return B$($,I),r6(I,$),C6(I,$)},UI=($,v,U={})=>(I)=>{let{libraryOptions:b,target:D}=I??{},u=n6({...b??{},target:D,io:v,processors:U});return B$($,u),r6(u,$),C6(u,$)};var nt={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},M3=($,v,U,I)=>{let b=U;b.type="string";let{minimum:D,maximum:u,format:w,patterns:g,contentEncoding:J}=$._zod.bag;if(typeof D==="number")b.minLength=D;if(typeof u==="number")b.maxLength=u;if(w){if(b.format=nt[w]??w,b.format==="")delete b.format;if(w==="time")delete b.format}if(J)b.contentEncoding=J;if(g&&g.size>0){let X=[...g];if(X.length===1)b.pattern=X[0].source;else if(X.length>1)b.allOf=[...X.map((W)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:W.source}))]}},_3=($,v,U,I)=>{let b=U,{minimum:D,maximum:u,format:w,multipleOf:g,exclusiveMaximum:J,exclusiveMinimum:X}=$._zod.bag;if(typeof w==="string"&&w.includes("int"))b.type="integer";else b.type="number";let W=typeof X==="number"&&X>=(D??Number.NEGATIVE_INFINITY),G=typeof J==="number"&&J<=(u??Number.POSITIVE_INFINITY),O=v.target==="draft-04"||v.target==="openapi-3.0";if(W)if(O)b.minimum=X,b.exclusiveMinimum=!0;else b.exclusiveMinimum=X;else if(typeof D==="number")b.minimum=D;if(G)if(O)b.maximum=J,b.exclusiveMaximum=!0;else b.exclusiveMaximum=J;else if(typeof u==="number")b.maximum=u;if(typeof g==="number")b.multipleOf=g},F3=($,v,U,I)=>{U.type="boolean"},Z3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},T3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},k3=($,v,U,I)=>{if(v.target==="openapi-3.0")U.type="string",U.nullable=!0,U.enum=[null];else U.type="null"},E3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},R3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},n3=($,v,U,I)=>{U.not={}},r3=($,v,U,I)=>{},C3=($,v,U,I)=>{},i3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},x3=($,v,U,I)=>{let b=$._zod.def,D=l1(b.entries);if(D.every((u)=>typeof u==="number"))U.type="number";if(D.every((u)=>typeof u==="string"))U.type="string";U.enum=D},l3=($,v,U,I)=>{let b=$._zod.def,D=[];for(let u of b.values)if(u===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else D.push(Number(u));else D.push(u);if(D.length===0);else if(D.length===1){let u=D[0];if(U.type=u===null?"null":typeof u,v.target==="draft-04"||v.target==="openapi-3.0")U.enum=[u];else U.const=u}else{if(D.every((u)=>typeof u==="number"))U.type="number";if(D.every((u)=>typeof u==="string"))U.type="string";if(D.every((u)=>typeof u==="boolean"))U.type="boolean";if(D.every((u)=>u===null))U.type="null";U.enum=D}},f3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},y3=($,v,U,I)=>{let b=U,D=$._zod.pattern;if(!D)throw Error("Pattern not found in template literal");b.type="string",b.pattern=D.source},h3=($,v,U,I)=>{let b=U,D={type:"string",format:"binary",contentEncoding:"binary"},{minimum:u,maximum:w,mime:g}=$._zod.bag;if(u!==void 0)D.minLength=u;if(w!==void 0)D.maxLength=w;if(g)if(g.length===1)D.contentMediaType=g[0],Object.assign(b,D);else Object.assign(b,D),b.anyOf=g.map((J)=>({contentMediaType:J}));else Object.assign(b,D)},m3=($,v,U,I)=>{U.type="boolean"},c3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},o3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},t3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},d3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},p3=($,v,U,I)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},a3=($,v,U,I)=>{let b=U,D=$._zod.def,{minimum:u,maximum:w}=$._zod.bag;if(typeof u==="number")b.minItems=u;if(typeof w==="number")b.maxItems=w;b.type="array",b.items=B$(D.element,v,{...I,path:[...I.path,"items"]})},e3=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="object",b.properties={};let u=D.shape;for(let J in u)b.properties[J]=B$(u[J],v,{...I,path:[...I.path,"properties",J]});let w=new Set(Object.keys(u)),g=new Set([...w].filter((J)=>{let X=D.shape[J]._zod;if(v.io==="input")return X.optin===void 0;else return X.optout===void 0}));if(g.size>0)b.required=Array.from(g);if(D.catchall?._zod.def.type==="never")b.additionalProperties=!1;else if(!D.catchall){if(v.io==="output")b.additionalProperties=!1}else if(D.catchall)b.additionalProperties=B$(D.catchall,v,{...I,path:[...I.path,"additionalProperties"]})},bJ=($,v,U,I)=>{let b=$._zod.def,D=b.inclusive===!1,u=b.options.map((w,g)=>B$(w,v,{...I,path:[...I.path,D?"oneOf":"anyOf",g]}));if(D)U.oneOf=u;else U.anyOf=u},s3=($,v,U,I)=>{let b=$._zod.def,D=B$(b.left,v,{...I,path:[...I.path,"allOf",0]}),u=B$(b.right,v,{...I,path:[...I.path,"allOf",1]}),w=(J)=>("allOf"in J)&&Object.keys(J).length===1,g=[...w(D)?D.allOf:[D],...w(u)?u.allOf:[u]];U.allOf=g},$V=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="array";let u=v.target==="draft-2020-12"?"prefixItems":"items",w=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",g=D.items.map((G,O)=>B$(G,v,{...I,path:[...I.path,u,O]})),J=D.rest?B$(D.rest,v,{...I,path:[...I.path,w,...v.target==="openapi-3.0"?[D.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(b.prefixItems=g,J)b.items=J}else if(v.target==="openapi-3.0"){if(b.items={anyOf:g},J)b.items.anyOf.push(J);if(b.minItems=g.length,!J)b.maxItems=g.length}else if(b.items=g,J)b.additionalItems=J;let{minimum:X,maximum:W}=$._zod.bag;if(typeof X==="number")b.minItems=X;if(typeof W==="number")b.maxItems=W},vV=($,v,U,I)=>{let b=U,D=$._zod.def;b.type="object";let u=D.keyType,g=u._zod.bag?.patterns;if(D.mode==="loose"&&g&&g.size>0){let X=B$(D.valueType,v,{...I,path:[...I.path,"patternProperties","*"]});b.patternProperties={};for(let W of g)b.patternProperties[W.source]=X}else{if(v.target==="draft-07"||v.target==="draft-2020-12")b.propertyNames=B$(D.keyType,v,{...I,path:[...I.path,"propertyNames"]});b.additionalProperties=B$(D.valueType,v,{...I,path:[...I.path,"additionalProperties"]})}let J=u._zod.values;if(J){let X=[...J].filter((W)=>typeof W==="string"||typeof W==="number");if(X.length>0)b.required=X}},bV=($,v,U,I)=>{let b=$._zod.def,D=B$(b.innerType,v,I),u=v.seen.get($);if(v.target==="openapi-3.0")u.ref=b.innerType,U.nullable=!0;else U.anyOf=[D,{type:"null"}]},UV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},IV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType,U.default=JSON.parse(JSON.stringify(b.defaultValue))},DV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);if(D.ref=b.innerType,v.io==="input")U._prefault=JSON.parse(JSON.stringify(b.defaultValue))},uV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType;let u;try{u=b.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}U.default=u},wV=($,v,U,I)=>{let b=$._zod.def,D=b.in._zod.traits.has("$ZodTransform"),u=v.io==="input"?D?b.out:b.in:b.out;B$(u,v,I);let w=v.seen.get($);w.ref=u},gV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType,U.readOnly=!0},JV=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},UJ=($,v,U,I)=>{let b=$._zod.def;B$(b.innerType,v,I);let D=v.seen.get($);D.ref=b.innerType},XV=($,v,U,I)=>{let b=$._zod.innerType;B$(b,v,I);let D=v.seen.get($);D.ref=b},vJ={string:M3,number:_3,boolean:F3,bigint:Z3,symbol:T3,null:k3,undefined:E3,void:R3,never:n3,any:r3,unknown:C3,date:i3,enum:x3,literal:l3,nan:f3,template_literal:y3,file:h3,success:m3,custom:c3,function:o3,transform:t3,map:d3,set:p3,array:a3,object:e3,union:bJ,intersection:s3,tuple:$V,record:vV,nullable:bV,nonoptional:UV,default:IV,prefault:DV,catch:uV,pipe:wV,readonly:gV,promise:JV,optional:UJ,lazy:XV};function IJ($,v){if("_idmap"in $){let I=$,b=n6({...v,processors:vJ}),D={};for(let g of I._idmap.entries()){let[J,X]=g;B$(X,b)}let u={},w={registry:I,uri:v?.uri,defs:D};b.external=w;for(let g of I._idmap.entries()){let[J,X]=g;r6(b,X),u[J]=C6(b,X)}if(Object.keys(D).length>0){let g=b.target==="draft-2020-12"?"$defs":"definitions";u.__shared={[g]:D}}return{schemas:u}}let U=n6({...v,processors:vJ});return B$($,U),r6(U,$),C6(U,$)}class WV{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($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=n6({processors:vJ,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return B$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}r6(this.ctx,$);let U=C6(this.ctx,$),{"~standard":I,...b}=U;return b}}var tS={};var g0={};e$(g0,{xor:()=>lM,xid:()=>XM,void:()=>RM,uuidv7:()=>bM,uuidv6:()=>vM,uuidv4:()=>$M,uuid:()=>sS,url:()=>UM,unknown:()=>nb,union:()=>ZJ,undefined:()=>kM,ulid:()=>JM,uint64:()=>ZM,uint32:()=>MM,tuple:()=>mV,transform:()=>kJ,templateLiteral:()=>v_,symbol:()=>TM,superRefine:()=>LL,success:()=>aM,stringbool:()=>J_,stringFormat:()=>qM,string:()=>J0,strictObject:()=>iM,set:()=>cM,refine:()=>VL,record:()=>cV,readonly:()=>GL,promise:()=>b_,preprocess:()=>W_,prefault:()=>IL,pipe:()=>WJ,partialRecord:()=>yM,optional:()=>W0,object:()=>CM,number:()=>_V,nullish:()=>pM,nullable:()=>G0,null:()=>EV,nonoptional:()=>DL,never:()=>FJ,nativeEnum:()=>oM,nanoid:()=>uM,nan:()=>eM,meta:()=>w_,map:()=>mM,mac:()=>OM,looseRecord:()=>hM,looseObject:()=>xM,literal:()=>tM,lazy:()=>zL,ksuid:()=>WM,keyof:()=>rM,jwt:()=>KM,json:()=>X_,ipv6:()=>HM,ipv4:()=>GM,invertCodec:()=>$_,intersection:()=>yV,int64:()=>FM,int32:()=>SM,int:()=>XJ,instanceof:()=>g_,httpUrl:()=>IM,hostname:()=>BM,hex:()=>AM,hash:()=>PM,guid:()=>eS,function:()=>U_,float64:()=>NM,float32:()=>jM,file:()=>dM,exactOptional:()=>sV,enum:()=>TJ,emoji:()=>DM,email:()=>aS,e164:()=>LM,discriminatedUnion:()=>fM,describe:()=>u_,date:()=>nM,custom:()=>D_,cuid2:()=>gM,cuid:()=>wM,codec:()=>sM,cidrv6:()=>QM,cidrv4:()=>zM,check:()=>I_,catch:()=>gL,boolean:()=>FV,bigint:()=>_M,base64url:()=>VM,base64:()=>YM,array:()=>Q0,any:()=>EM,_function:()=>U_,_default:()=>bL,_ZodString:()=>GJ,ZodXor:()=>xV,ZodXID:()=>LJ,ZodVoid:()=>CV,ZodUnknown:()=>nV,ZodUnion:()=>V0,ZodUndefined:()=>TV,ZodUUID:()=>R4,ZodURL:()=>H0,ZodULID:()=>VJ,ZodType:()=>I$,ZodTuple:()=>hV,ZodTransform:()=>aV,ZodTemplateLiteral:()=>OL,ZodSymbol:()=>ZV,ZodSuccess:()=>uL,ZodStringFormat:()=>S$,ZodString:()=>wI,ZodSet:()=>tV,ZodRecord:()=>DI,ZodReadonly:()=>WL,ZodPromise:()=>QL,ZodPreprocess:()=>XL,ZodPrefault:()=>UL,ZodPipe:()=>L0,ZodOptional:()=>EJ,ZodObject:()=>Y0,ZodNumberFormat:()=>rb,ZodNumber:()=>JI,ZodNullable:()=>$L,ZodNull:()=>kV,ZodNonOptional:()=>RJ,ZodNever:()=>rV,ZodNanoID:()=>zJ,ZodNaN:()=>JL,ZodMap:()=>oV,ZodMAC:()=>MV,ZodLiteral:()=>dV,ZodLazy:()=>HL,ZodKSUID:()=>KJ,ZodJWT:()=>MJ,ZodIntersection:()=>fV,ZodIPv6:()=>BJ,ZodIPv4:()=>qJ,ZodGUID:()=>X0,ZodFunction:()=>YL,ZodFile:()=>pV,ZodExactOptional:()=>eV,ZodEnum:()=>uI,ZodEmoji:()=>HJ,ZodEmail:()=>OJ,ZodE164:()=>SJ,ZodDiscriminatedUnion:()=>lV,ZodDefault:()=>vL,ZodDate:()=>z0,ZodCustomStringFormat:()=>gI,ZodCustom:()=>q0,ZodCodec:()=>K0,ZodCatch:()=>wL,ZodCUID2:()=>YJ,ZodCUID:()=>QJ,ZodCIDRv6:()=>PJ,ZodCIDRv4:()=>AJ,ZodBoolean:()=>XI,ZodBigIntFormat:()=>_J,ZodBigInt:()=>WI,ZodBase64URL:()=>NJ,ZodBase64:()=>jJ,ZodArray:()=>iV,ZodAny:()=>RV});var DJ={};e$(DJ,{uppercase:()=>cU,trim:()=>eU,toUpperCase:()=>$I,toLowerCase:()=>sU,startsWith:()=>tU,slugify:()=>vI,size:()=>kb,regex:()=>hU,property:()=>$J,positive:()=>pg,overwrite:()=>J4,normalize:()=>aU,nonpositive:()=>eg,nonnegative:()=>sg,negative:()=>ag,multipleOf:()=>E6,minSize:()=>E4,minLength:()=>e4,mime:()=>pU,maxSize:()=>R6,maxLength:()=>Eb,lte:()=>ov,lt:()=>T4,lowercase:()=>mU,length:()=>Rb,includes:()=>oU,gte:()=>jv,gt:()=>k4,endsWith:()=>dU});var II={};e$(II,{time:()=>HV,duration:()=>zV,datetime:()=>GV,date:()=>OV,ZodISOTime:()=>gJ,ZodISODuration:()=>JJ,ZodISODateTime:()=>uJ,ZodISODate:()=>wJ});var uJ=L("ZodISODateTime",($,v)=>{cY.init($,v),S$.init($,v)});function GV($){return c7(uJ,$)}var wJ=L("ZodISODate",($,v)=>{oY.init($,v),S$.init($,v)});function OV($){return o7(wJ,$)}var gJ=L("ZodISOTime",($,v)=>{tY.init($,v),S$.init($,v)});function HV($){return t7(gJ,$)}var JJ=L("ZodISODuration",($,v)=>{dY.init($,v),S$.init($,v)});function zV($){return d7(JJ,$)}var dS=($,v)=>{c1.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(U)=>t1($,U)},flatten:{value:(U)=>o1($,U)},addIssue:{value:(U)=>{$.issues.push(U),$.message=JSON.stringify($.issues,RU,2)}},addIssues:{value:(U)=>{$.issues.push(...U),$.message=JSON.stringify($.issues,RU,2)}},isEmpty:{get(){return $.issues.length===0}}})},Ct=L("ZodError",dS),nv=L("ZodError",dS,{Parent:Error});var QV=CU(nv),YV=iU(nv),VV=xU(nv),LV=lU(nv),KV=gg(nv),qV=Jg(nv),BV=Xg(nv),AV=Wg(nv),PV=Gg(nv),jV=Og(nv),NV=Hg(nv),SV=zg(nv);var pS=new WeakMap;function O0($,v,U){let I=Object.getPrototypeOf($),b=pS.get(I);if(!b)b=new Set,pS.set(I,b);if(b.has(v))return;b.add(v);for(let D in U){let u=U[D];Object.defineProperty(I,D,{configurable:!0,enumerable:!1,get(){let w=u.bind(this);return Object.defineProperty(this,D,{configurable:!0,writable:!0,enumerable:!0,value:w}),w},set(w){Object.defineProperty(this,D,{configurable:!0,writable:!0,enumerable:!0,value:w})}})}}var I$=L("ZodType",($,v)=>{return v$.init($,v),Object.assign($["~standard"],{jsonSchema:{input:UI($,"input"),output:UI($,"output")}}),$.toJSONSchema=S3($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.parse=(U,I)=>QV($,U,I,{callee:$.parse}),$.safeParse=(U,I)=>VV($,U,I),$.parseAsync=async(U,I)=>YV($,U,I,{callee:$.parseAsync}),$.safeParseAsync=async(U,I)=>LV($,U,I),$.spa=$.safeParseAsync,$.encode=(U,I)=>KV($,U,I),$.decode=(U,I)=>qV($,U,I),$.encodeAsync=async(U,I)=>BV($,U,I),$.decodeAsync=async(U,I)=>AV($,U,I),$.safeEncode=(U,I)=>PV($,U,I),$.safeDecode=(U,I)=>jV($,U,I),$.safeEncodeAsync=async(U,I)=>NV($,U,I),$.safeDecodeAsync=async(U,I)=>SV($,U,I),O0($,"ZodType",{check(...U){let I=this.def;return this.clone(n.mergeDefs(I,{checks:[...I.checks??[],...U.map((b)=>typeof b==="function"?{_zod:{check:b,def:{check:"custom"},onattach:[]}}:b)]}),{parent:!0})},with(...U){return this.check(...U)},clone(U,I){return Av(this,U,I)},brand(){return this},register(U,I){return U.add(this,I),this},refine(U,I){return this.check(VL(U,I))},superRefine(U,I){return this.check(LL(U,I))},overwrite(U){return this.check(J4(U))},optional(){return W0(this)},exactOptional(){return sV(this)},nullable(){return G0(this)},nullish(){return W0(G0(this))},nonoptional(U){return DL(this,U)},array(){return Q0(this)},or(U){return ZJ([this,U])},and(U){return yV(this,U)},transform(U){return WJ(this,kJ(U))},default(U){return bL(this,U)},prefault(U){return IL(this,U)},catch(U){return gL(this,U)},pipe(U){return WJ(this,U)},readonly(){return GL(this)},describe(U){let I=this.clone();return uv.add(I,{description:U}),I},meta(...U){if(U.length===0)return uv.get(this);let I=this.clone();return uv.add(I,U[0]),I},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(U){return U(this)}}),Object.defineProperty($,"description",{get(){return uv.get($)?.description},configurable:!0}),$}),GJ=L("_ZodString",($,v)=>{Tb.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>M3($,I,b,D);let U=$._zod.bag;$.format=U.format??null,$.minLength=U.minimum??null,$.maxLength=U.maximum??null,O0($,"_ZodString",{regex(...I){return this.check(hU(...I))},includes(...I){return this.check(oU(...I))},startsWith(...I){return this.check(tU(...I))},endsWith(...I){return this.check(dU(...I))},min(...I){return this.check(e4(...I))},max(...I){return this.check(Eb(...I))},length(...I){return this.check(Rb(...I))},nonempty(...I){return this.check(e4(1,...I))},lowercase(I){return this.check(mU(I))},uppercase(I){return this.check(cU(I))},trim(){return this.check(eU())},normalize(...I){return this.check(aU(...I))},toLowerCase(){return this.check(sU())},toUpperCase(){return this.check($I())},slugify(){return this.check(vI())}})}),wI=L("ZodString",($,v)=>{Tb.init($,v),GJ.init($,v),$.email=(U)=>$.check(Fg(OJ,U)),$.url=(U)=>$.check(w0(H0,U)),$.jwt=(U)=>$.check(dg(MJ,U)),$.emoji=(U)=>$.check(Rg(HJ,U)),$.guid=(U)=>$.check(u0(X0,U)),$.uuid=(U)=>$.check(Zg(R4,U)),$.uuidv4=(U)=>$.check(Tg(R4,U)),$.uuidv6=(U)=>$.check(kg(R4,U)),$.uuidv7=(U)=>$.check(Eg(R4,U)),$.nanoid=(U)=>$.check(ng(zJ,U)),$.guid=(U)=>$.check(u0(X0,U)),$.cuid=(U)=>$.check(rg(QJ,U)),$.cuid2=(U)=>$.check(Cg(YJ,U)),$.ulid=(U)=>$.check(ig(VJ,U)),$.base64=(U)=>$.check(cg(jJ,U)),$.base64url=(U)=>$.check(og(NJ,U)),$.xid=(U)=>$.check(xg(LJ,U)),$.ksuid=(U)=>$.check(lg(KJ,U)),$.ipv4=(U)=>$.check(fg(qJ,U)),$.ipv6=(U)=>$.check(yg(BJ,U)),$.cidrv4=(U)=>$.check(hg(AJ,U)),$.cidrv6=(U)=>$.check(mg(PJ,U)),$.e164=(U)=>$.check(tg(SJ,U)),$.datetime=(U)=>$.check(GV(U)),$.date=(U)=>$.check(OV(U)),$.time=(U)=>$.check(HV(U)),$.duration=(U)=>$.check(zV(U))});function J0($){return f7(wI,$)}var S$=L("ZodStringFormat",($,v)=>{N$.init($,v),GJ.init($,v)}),OJ=L("ZodEmail",($,v)=>{rY.init($,v),S$.init($,v)});function aS($){return Fg(OJ,$)}var X0=L("ZodGUID",($,v)=>{RY.init($,v),S$.init($,v)});function eS($){return u0(X0,$)}var R4=L("ZodUUID",($,v)=>{nY.init($,v),S$.init($,v)});function sS($){return Zg(R4,$)}function $M($){return Tg(R4,$)}function vM($){return kg(R4,$)}function bM($){return Eg(R4,$)}var H0=L("ZodURL",($,v)=>{CY.init($,v),S$.init($,v)});function UM($){return w0(H0,$)}function IM($){return w0(H0,{protocol:cv.httpProtocol,hostname:cv.domain,...n.normalizeParams($)})}var HJ=L("ZodEmoji",($,v)=>{iY.init($,v),S$.init($,v)});function DM($){return Rg(HJ,$)}var zJ=L("ZodNanoID",($,v)=>{xY.init($,v),S$.init($,v)});function uM($){return ng(zJ,$)}var QJ=L("ZodCUID",($,v)=>{lY.init($,v),S$.init($,v)});function wM($){return rg(QJ,$)}var YJ=L("ZodCUID2",($,v)=>{fY.init($,v),S$.init($,v)});function gM($){return Cg(YJ,$)}var VJ=L("ZodULID",($,v)=>{yY.init($,v),S$.init($,v)});function JM($){return ig(VJ,$)}var LJ=L("ZodXID",($,v)=>{hY.init($,v),S$.init($,v)});function XM($){return xg(LJ,$)}var KJ=L("ZodKSUID",($,v)=>{mY.init($,v),S$.init($,v)});function WM($){return lg(KJ,$)}var qJ=L("ZodIPv4",($,v)=>{pY.init($,v),S$.init($,v)});function GM($){return fg(qJ,$)}var MV=L("ZodMAC",($,v)=>{eY.init($,v),S$.init($,v)});function OM($){return h7(MV,$)}var BJ=L("ZodIPv6",($,v)=>{aY.init($,v),S$.init($,v)});function HM($){return yg(BJ,$)}var AJ=L("ZodCIDRv4",($,v)=>{sY.init($,v),S$.init($,v)});function zM($){return hg(AJ,$)}var PJ=L("ZodCIDRv6",($,v)=>{$5.init($,v),S$.init($,v)});function QM($){return mg(PJ,$)}var jJ=L("ZodBase64",($,v)=>{b5.init($,v),S$.init($,v)});function YM($){return cg(jJ,$)}var NJ=L("ZodBase64URL",($,v)=>{U5.init($,v),S$.init($,v)});function VM($){return og(NJ,$)}var SJ=L("ZodE164",($,v)=>{I5.init($,v),S$.init($,v)});function LM($){return tg(SJ,$)}var MJ=L("ZodJWT",($,v)=>{D5.init($,v),S$.init($,v)});function KM($){return dg(MJ,$)}var gI=L("ZodCustomStringFormat",($,v)=>{u5.init($,v),S$.init($,v)});function qM($,v,U={}){return bI(gI,$,v,U)}function BM($){return bI(gI,"hostname",cv.hostname,$)}function AM($){return bI(gI,"hex",cv.hex,$)}function PM($,v){let U=v?.enc??"hex",I=`${$}_${U}`,b=cv[I];if(!b)throw Error(`Unrecognized hash format: ${I}`);return bI(gI,I,b,v)}var JI=L("ZodNumber",($,v)=>{Pg.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>_3($,I,b,D),O0($,"ZodNumber",{gt(I,b){return this.check(k4(I,b))},gte(I,b){return this.check(jv(I,b))},min(I,b){return this.check(jv(I,b))},lt(I,b){return this.check(T4(I,b))},lte(I,b){return this.check(ov(I,b))},max(I,b){return this.check(ov(I,b))},int(I){return this.check(XJ(I))},safe(I){return this.check(XJ(I))},positive(I){return this.check(k4(0,I))},nonnegative(I){return this.check(jv(0,I))},negative(I){return this.check(T4(0,I))},nonpositive(I){return this.check(ov(0,I))},multipleOf(I,b){return this.check(E6(I,b))},step(I,b){return this.check(E6(I,b))},finite(){return this}});let U=$._zod.bag;$.minValue=Math.max(U.minimum??Number.NEGATIVE_INFINITY,U.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(U.maximum??Number.POSITIVE_INFINITY,U.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(U.format??"").includes("int")||Number.isSafeInteger(U.multipleOf??0.5),$.isFinite=!0,$.format=U.format??null});function _V($){return p7(JI,$)}var rb=L("ZodNumberFormat",($,v)=>{w5.init($,v),JI.init($,v)});function XJ($){return e7(rb,$)}function jM($){return s7(rb,$)}function NM($){return $3(rb,$)}function SM($){return v3(rb,$)}function MM($){return b3(rb,$)}var XI=L("ZodBoolean",($,v)=>{e1.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>F3($,U,I,b)});function FV($){return U3(XI,$)}var WI=L("ZodBigInt",($,v)=>{jg.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>Z3($,I,b,D),$.gte=(I,b)=>$.check(jv(I,b)),$.min=(I,b)=>$.check(jv(I,b)),$.gt=(I,b)=>$.check(k4(I,b)),$.gte=(I,b)=>$.check(jv(I,b)),$.min=(I,b)=>$.check(jv(I,b)),$.lt=(I,b)=>$.check(T4(I,b)),$.lte=(I,b)=>$.check(ov(I,b)),$.max=(I,b)=>$.check(ov(I,b)),$.positive=(I)=>$.check(k4(BigInt(0),I)),$.negative=(I)=>$.check(T4(BigInt(0),I)),$.nonpositive=(I)=>$.check(ov(BigInt(0),I)),$.nonnegative=(I)=>$.check(jv(BigInt(0),I)),$.multipleOf=(I,b)=>$.check(E6(I,b));let U=$._zod.bag;$.minValue=U.minimum??null,$.maxValue=U.maximum??null,$.format=U.format??null});function _M($){return D3(WI,$)}var _J=L("ZodBigIntFormat",($,v)=>{g5.init($,v),WI.init($,v)});function FM($){return w3(_J,$)}function ZM($){return g3(_J,$)}var ZV=L("ZodSymbol",($,v)=>{J5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>T3($,U,I,b)});function TM($){return J3(ZV,$)}var TV=L("ZodUndefined",($,v)=>{X5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>E3($,U,I,b)});function kM($){return X3(TV,$)}var kV=L("ZodNull",($,v)=>{W5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>k3($,U,I,b)});function EV($){return W3(kV,$)}var RV=L("ZodAny",($,v)=>{G5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>r3($,U,I,b)});function EM(){return G3(RV)}var nV=L("ZodUnknown",($,v)=>{O5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>C3($,U,I,b)});function nb(){return O3(nV)}var rV=L("ZodNever",($,v)=>{H5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>n3($,U,I,b)});function FJ($){return H3(rV,$)}var CV=L("ZodVoid",($,v)=>{z5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>R3($,U,I,b)});function RM($){return z3(CV,$)}var z0=L("ZodDate",($,v)=>{Q5.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>i3($,I,b,D),$.min=(I,b)=>$.check(jv(I,b)),$.max=(I,b)=>$.check(ov(I,b));let U=$._zod.bag;$.minDate=U.minimum?new Date(U.minimum):null,$.maxDate=U.maximum?new Date(U.maximum):null});function nM($){return Q3(z0,$)}var iV=L("ZodArray",($,v)=>{Y5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>a3($,U,I,b),$.element=v.element,O0($,"ZodArray",{min(U,I){return this.check(e4(U,I))},nonempty(U){return this.check(e4(1,U))},max(U,I){return this.check(Eb(U,I))},length(U,I){return this.check(Rb(U,I))},unwrap(){return this.element}})});function Q0($,v){return L3(iV,$,v)}function rM($){let v=$._zod.def.shape;return TJ(Object.keys(v))}var Y0=L("ZodObject",($,v)=>{V5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>e3($,U,I,b),n.defineLazy($,"shape",()=>{return v.shape}),O0($,"ZodObject",{keyof(){return TJ(Object.keys(this._zod.def.shape))},catchall(U){return this.clone({...this._zod.def,catchall:U})},passthrough(){return this.clone({...this._zod.def,catchall:nb()})},loose(){return this.clone({...this._zod.def,catchall:nb()})},strict(){return this.clone({...this._zod.def,catchall:FJ()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(U){return n.extend(this,U)},safeExtend(U){return n.safeExtend(this,U)},merge(U){return n.merge(this,U)},pick(U){return n.pick(this,U)},omit(U){return n.omit(this,U)},partial(...U){return n.partial(EJ,this,U[0])},required(...U){return n.required(RJ,this,U[0])}})});function CM($,v){let U={type:"object",shape:$??{},...n.normalizeParams(v)};return new Y0(U)}function iM($,v){return new Y0({type:"object",shape:$,catchall:FJ(),...n.normalizeParams(v)})}function xM($,v){return new Y0({type:"object",shape:$,catchall:nb(),...n.normalizeParams(v)})}var V0=L("ZodUnion",($,v)=>{s1.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>bJ($,U,I,b),$.options=v.options});function ZJ($,v){return new V0({type:"union",options:$,...n.normalizeParams(v)})}var xV=L("ZodXor",($,v)=>{V0.init($,v),L5.init($,v),$._zod.processJSONSchema=(U,I,b)=>bJ($,U,I,b),$.options=v.options});function lM($,v){return new xV({type:"union",options:$,inclusive:!1,...n.normalizeParams(v)})}var lV=L("ZodDiscriminatedUnion",($,v)=>{V0.init($,v),K5.init($,v)});function fM($,v,U){return new lV({type:"union",options:v,discriminator:$,...n.normalizeParams(U)})}var fV=L("ZodIntersection",($,v)=>{q5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>s3($,U,I,b)});function yV($,v){return new fV({type:"intersection",left:$,right:v})}var hV=L("ZodTuple",($,v)=>{Ng.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>$V($,U,I,b),$.rest=(U)=>$.clone({...$._zod.def,rest:U})});function mV($,v,U){let I=v instanceof v$,b=I?U:v;return new hV({type:"tuple",items:$,rest:I?v:null,...n.normalizeParams(b)})}var DI=L("ZodRecord",($,v)=>{B5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>vV($,U,I,b),$.keyType=v.keyType,$.valueType=v.valueType});function cV($,v,U){if(!v||!v._zod)return new DI({type:"record",keyType:J0(),valueType:$,...n.normalizeParams(v)});return new DI({type:"record",keyType:$,valueType:v,...n.normalizeParams(U)})}function yM($,v,U){let I=Av($);return I._zod.values=void 0,new DI({type:"record",keyType:I,valueType:v,...n.normalizeParams(U)})}function hM($,v,U){return new DI({type:"record",keyType:$,valueType:v,mode:"loose",...n.normalizeParams(U)})}var oV=L("ZodMap",($,v)=>{A5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>d3($,U,I,b),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...U)=>$.check(E4(...U)),$.nonempty=(U)=>$.check(E4(1,U)),$.max=(...U)=>$.check(R6(...U)),$.size=(...U)=>$.check(kb(...U))});function mM($,v,U){return new oV({type:"map",keyType:$,valueType:v,...n.normalizeParams(U)})}var tV=L("ZodSet",($,v)=>{P5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>p3($,U,I,b),$.min=(...U)=>$.check(E4(...U)),$.nonempty=(U)=>$.check(E4(1,U)),$.max=(...U)=>$.check(R6(...U)),$.size=(...U)=>$.check(kb(...U))});function cM($,v){return new tV({type:"set",valueType:$,...n.normalizeParams(v)})}var uI=L("ZodEnum",($,v)=>{j5.init($,v),I$.init($,v),$._zod.processJSONSchema=(I,b,D)=>x3($,I,b,D),$.enum=v.entries,$.options=Object.values(v.entries);let U=new Set(Object.keys(v.entries));$.extract=(I,b)=>{let D={};for(let u of I)if(U.has(u))D[u]=v.entries[u];else throw Error(`Key ${u} not found in enum`);return new uI({...v,checks:[],...n.normalizeParams(b),entries:D})},$.exclude=(I,b)=>{let D={...v.entries};for(let u of I)if(U.has(u))delete D[u];else throw Error(`Key ${u} not found in enum`);return new uI({...v,checks:[],...n.normalizeParams(b),entries:D})}});function TJ($,v){let U=Array.isArray($)?Object.fromEntries($.map((I)=>[I,I])):$;return new uI({type:"enum",entries:U,...n.normalizeParams(v)})}function oM($,v){return new uI({type:"enum",entries:$,...n.normalizeParams(v)})}var dV=L("ZodLiteral",($,v)=>{N5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>l3($,U,I,b),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function tM($,v){return new dV({type:"literal",values:Array.isArray($)?$:[$],...n.normalizeParams(v)})}var pV=L("ZodFile",($,v)=>{S5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>h3($,U,I,b),$.min=(U,I)=>$.check(E4(U,I)),$.max=(U,I)=>$.check(R6(U,I)),$.mime=(U,I)=>$.check(pU(Array.isArray(U)?U:[U],I))});function dM($){return K3(pV,$)}var aV=L("ZodTransform",($,v)=>{M5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>t3($,U,I,b),$._zod.parse=(U,I)=>{if(I.direction==="backward")throw new _b($.constructor.name);U.addIssue=(D)=>{if(typeof D==="string")U.issues.push(n.issue(D,U.value,v));else{let u=D;if(u.fatal)u.continue=!1;u.code??(u.code="custom"),u.input??(u.input=U.value),u.inst??(u.inst=$),U.issues.push(n.issue(u))}};let b=v.transform(U.value,U);if(b instanceof Promise)return b.then((D)=>{return U.value=D,U.fallback=!0,U});return U.value=b,U.fallback=!0,U}});function kJ($){return new aV({type:"transform",transform:$})}var EJ=L("ZodOptional",($,v)=>{Sg.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UJ($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function W0($){return new EJ({type:"optional",innerType:$})}var eV=L("ZodExactOptional",($,v)=>{_5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UJ($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function sV($){return new eV({type:"optional",innerType:$})}var $L=L("ZodNullable",($,v)=>{F5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>bV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function G0($){return new $L({type:"nullable",innerType:$})}function pM($){return W0(G0($))}var vL=L("ZodDefault",($,v)=>{Z5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>IV($,U,I,b),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function bL($,v){return new vL({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():n.shallowClone(v)}})}var UL=L("ZodPrefault",($,v)=>{T5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>DV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function IL($,v){return new UL({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():n.shallowClone(v)}})}var RJ=L("ZodNonOptional",($,v)=>{k5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>UV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function DL($,v){return new RJ({type:"nonoptional",innerType:$,...n.normalizeParams(v)})}var uL=L("ZodSuccess",($,v)=>{E5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>m3($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function aM($){return new uL({type:"success",innerType:$})}var wL=L("ZodCatch",($,v)=>{R5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>uV($,U,I,b),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function gL($,v){return new wL({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var JL=L("ZodNaN",($,v)=>{n5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>f3($,U,I,b)});function eM($){return V3(JL,$)}var L0=L("ZodPipe",($,v)=>{Mg.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>wV($,U,I,b),$.in=v.in,$.out=v.out});function WJ($,v){return new L0({type:"pipe",in:$,out:v})}var K0=L("ZodCodec",($,v)=>{L0.init($,v),$0.init($,v)});function sM($,v,U){return new K0({type:"pipe",in:$,out:v,transform:U.decode,reverseTransform:U.encode})}function $_($){let v=$._zod.def;return new K0({type:"pipe",in:v.out,out:v.in,transform:v.reverseTransform,reverseTransform:v.transform})}var XL=L("ZodPreprocess",($,v)=>{L0.init($,v),r5.init($,v)}),WL=L("ZodReadonly",($,v)=>{C5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>gV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function GL($){return new WL({type:"readonly",innerType:$})}var OL=L("ZodTemplateLiteral",($,v)=>{i5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>y3($,U,I,b)});function v_($,v){return new OL({type:"template_literal",parts:$,...n.normalizeParams(v)})}var HL=L("ZodLazy",($,v)=>{f5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>XV($,U,I,b),$.unwrap=()=>$._zod.def.getter()});function zL($){return new HL({type:"lazy",getter:$})}var QL=L("ZodPromise",($,v)=>{l5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>JV($,U,I,b),$.unwrap=()=>$._zod.def.innerType});function b_($){return new QL({type:"promise",innerType:$})}var YL=L("ZodFunction",($,v)=>{x5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>o3($,U,I,b)});function U_($){return new YL({type:"function",input:Array.isArray($?.input)?mV($?.input):$?.input??Q0(nb()),output:$?.output??nb()})}var q0=L("ZodCustom",($,v)=>{y5.init($,v),I$.init($,v),$._zod.processJSONSchema=(U,I,b)=>c3($,U,I,b)});function I_($){let v=new Z$({check:"custom"});return v._zod.check=$,v}function D_($,v){return q3(q0,$??(()=>!0),v)}function VL($,v={}){return B3(q0,$,v)}function LL($,v){return A3($,v)}var u_=P3,w_=j3;function g_($,v={}){let U=new q0({type:"custom",check:"custom",fn:(I)=>I instanceof $,abort:!0,...n.normalizeParams(v)});return U._zod.bag.Class=$,U._zod.check=(I)=>{if(!(I.value instanceof $))I.issues.push({code:"invalid_type",expected:$.name,input:I.value,inst:U,path:[...U._zod.def.path??[]]})},U}var J_=(...$)=>N3({Codec:K0,Boolean:XI,String:wI},...$);function X_($){let v=zL(()=>{return ZJ([J0($),_V(),FV(),EV(),Q0(v),cV(J0(),v)])});return v}function W_($,v){return new XL({type:"pipe",in:kJ($),out:v})}var xt={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 lt($){o$({customError:$})}function ft(){return o$().customError}var KL;(function($){})(KL||(KL={}));var y={...g0,...DJ,iso:II},yt=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 ht($,v){let U=$.$schema;if(U==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(U==="http://json-schema.org/draft-07/schema#")return"draft-7";if(U==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function mt($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let U=$.slice(1).split("/").filter(Boolean);if(U.length===0)return v.rootSchema;let I=v.version==="draft-2020-12"?"$defs":"definitions";if(U[0]===I){let b=U[1];if(!b||!v.defs[b])throw Error(`Reference not found: ${$}`);return v.defs[b]}throw Error(`Reference not found: ${$}`)}function G_($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return y.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let b=$.$ref;if(v.refs.has(b))return v.refs.get(b);if(v.processing.has(b))return y.lazy(()=>{if(!v.refs.has(b))throw Error(`Circular reference not resolved: ${b}`);return v.refs.get(b)});v.processing.add(b);let D=mt(b,v),u=Hv(D,v);return v.refs.set(b,u),v.processing.delete(b),u}if($.enum!==void 0){let b=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&b.length===1&&b[0]===null)return y.null();if(b.length===0)return y.never();if(b.length===1)return y.literal(b[0]);if(b.every((u)=>typeof u==="string"))return y.enum(b);let D=b.map((u)=>y.literal(u));if(D.length<2)return D[0];return y.union([D[0],D[1],...D.slice(2)])}if($.const!==void 0)return y.literal($.const);let U=$.type;if(Array.isArray(U)){let b=U.map((D)=>{let u={...$,type:D};return G_(u,v)});if(b.length===0)return y.never();if(b.length===1)return b[0];return y.union(b)}if(!U)return y.any();let I;switch(U){case"string":{let b=y.string();if($.format){let D=$.format;if(D==="email")b=b.check(y.email());else if(D==="uri"||D==="uri-reference")b=b.check(y.url());else if(D==="uuid"||D==="guid")b=b.check(y.uuid());else if(D==="date-time")b=b.check(y.iso.datetime());else if(D==="date")b=b.check(y.iso.date());else if(D==="time")b=b.check(y.iso.time());else if(D==="duration")b=b.check(y.iso.duration());else if(D==="ipv4")b=b.check(y.ipv4());else if(D==="ipv6")b=b.check(y.ipv6());else if(D==="mac")b=b.check(y.mac());else if(D==="cidr")b=b.check(y.cidrv4());else if(D==="cidr-v6")b=b.check(y.cidrv6());else if(D==="base64")b=b.check(y.base64());else if(D==="base64url")b=b.check(y.base64url());else if(D==="e164")b=b.check(y.e164());else if(D==="jwt")b=b.check(y.jwt());else if(D==="emoji")b=b.check(y.emoji());else if(D==="nanoid")b=b.check(y.nanoid());else if(D==="cuid")b=b.check(y.cuid());else if(D==="cuid2")b=b.check(y.cuid2());else if(D==="ulid")b=b.check(y.ulid());else if(D==="xid")b=b.check(y.xid());else if(D==="ksuid")b=b.check(y.ksuid())}if(typeof $.minLength==="number")b=b.min($.minLength);if(typeof $.maxLength==="number")b=b.max($.maxLength);if($.pattern)b=b.regex(new RegExp($.pattern));I=b;break}case"number":case"integer":{let b=U==="integer"?y.number().int():y.number();if(typeof $.minimum==="number")b=b.min($.minimum);if(typeof $.maximum==="number")b=b.max($.maximum);if(typeof $.exclusiveMinimum==="number")b=b.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")b=b.gt($.minimum);if(typeof $.exclusiveMaximum==="number")b=b.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")b=b.lt($.maximum);if(typeof $.multipleOf==="number")b=b.multipleOf($.multipleOf);I=b;break}case"boolean":{I=y.boolean();break}case"null":{I=y.null();break}case"object":{let b={},D=$.properties||{},u=new Set($.required||[]);for(let[g,J]of Object.entries(D)){let X=Hv(J,v);b[g]=u.has(g)?X:X.optional()}if($.propertyNames){let g=Hv($.propertyNames,v),J=$.additionalProperties&&typeof $.additionalProperties==="object"?Hv($.additionalProperties,v):y.any();if(Object.keys(b).length===0){I=y.record(g,J);break}let X=y.object(b).passthrough(),W=y.looseRecord(g,J);I=y.intersection(X,W);break}if($.patternProperties){let g=$.patternProperties,J=Object.keys(g),X=[];for(let G of J){let O=Hv(g[G],v),z=y.string().regex(new RegExp(G));X.push(y.looseRecord(z,O))}let W=[];if(Object.keys(b).length>0)W.push(y.object(b).passthrough());if(W.push(...X),W.length===0)I=y.object({}).passthrough();else if(W.length===1)I=W[0];else{let G=y.intersection(W[0],W[1]);for(let O=2;O<W.length;O++)G=y.intersection(G,W[O]);I=G}break}let w=y.object(b);if($.additionalProperties===!1)I=w.strict();else if(typeof $.additionalProperties==="object")I=w.catchall(Hv($.additionalProperties,v));else I=w.passthrough();break}case"array":{let{prefixItems:b,items:D}=$;if(b&&Array.isArray(b)){let u=b.map((g)=>Hv(g,v)),w=D&&typeof D==="object"&&!Array.isArray(D)?Hv(D,v):void 0;if(w)I=y.tuple(u).rest(w);else I=y.tuple(u);if(typeof $.minItems==="number")I=I.check(y.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(y.maxLength($.maxItems))}else if(Array.isArray(D)){let u=D.map((g)=>Hv(g,v)),w=$.additionalItems&&typeof $.additionalItems==="object"?Hv($.additionalItems,v):void 0;if(w)I=y.tuple(u).rest(w);else I=y.tuple(u);if(typeof $.minItems==="number")I=I.check(y.minLength($.minItems));if(typeof $.maxItems==="number")I=I.check(y.maxLength($.maxItems))}else if(D!==void 0){let u=Hv(D,v),w=y.array(u);if(typeof $.minItems==="number")w=w.min($.minItems);if(typeof $.maxItems==="number")w=w.max($.maxItems);I=w}else I=y.array(y.any());break}default:throw Error(`Unsupported type: ${U}`)}return I}function Hv($,v){if(typeof $==="boolean")return $?y.any():y.never();let U=G_($,v),I=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let w=$.anyOf.map((J)=>Hv(J,v)),g=y.union(w);U=I?y.intersection(U,g):g}if($.oneOf&&Array.isArray($.oneOf)){let w=$.oneOf.map((J)=>Hv(J,v)),g=y.xor(w);U=I?y.intersection(U,g):g}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)U=I?U:y.any();else{let w=I?U:Hv($.allOf[0],v),g=I?0:1;for(let J=g;J<$.allOf.length;J++)w=y.intersection(w,Hv($.allOf[J],v));U=w}if($.nullable===!0&&v.version==="openapi-3.0")U=y.nullable(U);if($.readOnly===!0)U=y.readonly(U);if($.default!==void 0)U=U.default($.default);let b={},D=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let w of D)if(w in $)b[w]=$[w];let u=["contentEncoding","contentMediaType","contentSchema"];for(let w of u)if(w in $)b[w]=$[w];for(let w of Object.keys($))if(!yt.has(w))b[w]=$[w];if(Object.keys(b).length>0)v.registry.add(U,b);if($.description)U=U.describe($.description);return U}function O_($,v){if(typeof $==="boolean")return $?y.any():y.never();let U;try{U=JSON.parse(JSON.stringify($))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let I=ht(U,v?.defaultTarget),b=U.$defs||U.definitions||{},D={version:I,defs:b,refs:new Map,processing:new Set,rootSchema:U,registry:v?.registry??uv};return Hv(U,D)}var qL={};e$(qL,{string:()=>ct,number:()=>ot,date:()=>pt,boolean:()=>tt,bigint:()=>dt});function ct($){return y7(wI,$)}function ot($){return a7(JI,$)}function tt($){return I3(XI,$)}function dt($){return u3(WI,$)}function pt($){return Y3(z0,$)}o$(v0());var at=class ${sessionId;resumeUrl;seq;constructor(v){this.sessionId=v.sessionId,this.resumeUrl=v.resumeUrl,this.seq=v.seq,Object.freeze(this)}static empty(){return new $({sessionId:null,resumeUrl:null,seq:null})}canResume(){return this.sessionId!==null}withSeq(v){return new $({sessionId:this.sessionId,resumeUrl:this.resumeUrl,seq:v})}withReady(v,U){return new $({sessionId:v,resumeUrl:U,seq:this.seq})}withReset(){return $.empty()}},et=class{props;initialTimer=null;intervalTimer=null;ackReceived=!0;constructor($){this.props=$}start($){this.stop(),this.ackReceived=!0;let v=$g({deps:this.props.deps})*$,U=p(()=>this.props.deps.setTimeout(()=>{this.initialTimer=null,this.safeFire();let I=p(()=>this.props.deps.setInterval(()=>this.safeFire(),$));if(I instanceof Error)this.props.log.error({action:"heartbeat.interval.schedule.error",message:x({error:I}),error:I}),this.intervalTimer=null;else this.intervalTimer=I},v));if(U instanceof Error)this.props.log.error({action:"heartbeat.initial.schedule.error",message:x({error:U}),error:U}),this.initialTimer=null;else this.initialTimer=U}stop(){if(this.initialTimer!==null){let $=this.initialTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.props.log.error({action:"heartbeat.initial.clear.error",message:x({error:v}),error:v});this.initialTimer=null}if(this.intervalTimer!==null){let $=this.intervalTimer,v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.props.log.error({action:"heartbeat.interval.clear.error",message:x({error:v}),error:v});this.intervalTimer=null}}ack(){this.ackReceived=!0}isRunning(){return this.initialTimer!==null||this.intervalTimer!==null}safeFire(){jb({fn:()=>this.fire(),onError:($)=>{this.props.log.error({action:"heartbeat.fire.error",message:x({error:$}),error:$})}})}fire(){if(!this.ackReceived){this.props.onZombie();return}this.ackReceived=!1,this.props.onSend()}},st=z$.object({op:z$.number(),d:z$.unknown(),s:z$.number().nullable(),t:z$.string().nullable()});function $d($){let v=Sb($);if(v instanceof mv)return v;let U=st.safeParse(v);if(!U.success)return new mv(`invalid gateway message frame (${$.length} bytes)`,{cause:U.error});return U.data}var vd="wss://gateway.discord.gg/?v=10&encoding=json",Q_=0,nJ=1,Y_=2,V_=6,L_=7,K_=9,q_=10,B_=11,H_={[Q_]:"DISPATCH",[nJ]:"HEARTBEAT",[Y_]:"IDENTIFY",[V_]:"RESUME",[L_]:"RECONNECT",[K_]:"INVALID_SESSION",[q_]:"HELLO",[B_]:"HEARTBEAT_ACK"},z_=1,bd=new Set([4004,4010,4011,4012,4013,4014]),Ud=class{props;log;ws=null;heartbeat=null;currentSession=at.empty();isStoppedFlag=!1;hasConnected=!1;pendingResolve=null;pendingResolved=!1;invalidSessionTimer=null;constructor($){this.props=$,this.log=new d4({source:"discord.gateway",handler:$.onLog,deps:$.deps})}get session(){return this.currentSession}get isStopped(){return this.isStoppedFlag}connect($){let v=this.props.deps.WebSocket;if(!v){let D=new Uv("WebSocket runtime not available");return this.log.error({action:"ws.error",message:x({error:D}),error:D}),Promise.resolve(D)}let U=$??vd,I=p(()=>new URL(U).hostname),b=I instanceof Error?"unknown":I;return this.log.info({action:"connect.start",message:`host=${b}`}),this.pendingResolved=!1,this.hasConnected=!1,new Promise((D)=>{this.pendingResolve=D;let u=p(()=>new v(U));if(u instanceof Error){let J=new Uv(`WebSocket construction failed: ${x({error:u})}`,{cause:u});this.log.error({action:"ws.construct.error",message:x({error:J}),error:J}),this.ws=null,this.pendingResolved=!0,D(J);return}let w=u;this.ws=w;let g=p(()=>{w.addEventListener("message",(J)=>this.safeOnMessage(J,w)),w.addEventListener("close",(J)=>this.safeOnClose(J)),w.addEventListener("error",()=>this.safeOnError())});if(g instanceof Error){let J=new Uv(`WebSocket listener registration failed: ${x({error:g})}`,{cause:g});this.log.error({action:"ws.listener.error",message:x({error:J}),error:J}),this.ws=null,this.pendingResolved=!0,D(J)}})}disconnect(){this.log.info({action:"disconnect",message:"shutting down gateway"}),this.isStoppedFlag=!0,this.heartbeat?.stop(),this.clearInvalidSessionTimer(),this.closeSocket({ws:this.ws,code:1000,reason:"shutdown"}),this.ws=null}isConnected(){return this.ws!==null&&this.ws.readyState===z_}completeConnect($){if(this.pendingResolved||!this.pendingResolve)return;this.pendingResolved=!0,this.pendingResolve($)}safeOnMessage($,v){let U=p(()=>this.onMessage(String($.data),v));if(U instanceof Error)this.log.error({action:"ws.message.threw",message:x({error:U}),error:U})}safeOnClose($){let v=p(()=>this.onClose($));if(v instanceof Error)this.log.error({action:"ws.close.threw",message:x({error:v}),error:v})}safeOnError(){let $=p(()=>this.onError());if($ instanceof Error)this.log.error({action:"ws.error.threw",message:x({error:$}),error:$})}onMessage($,v){if(this.isStoppedFlag)return;let U=$d($);if(U instanceof mv){this.log.error({action:"ws.parse.error",message:U.message,error:U,detail:{length:$.length}});return}if(this.log.debug({action:"ws.recv",message:`op=${H_[U.op]??U.op} t=${U.t??"-"} s=${U.s??"-"} length=${$.length}`,detail:{op:U.op,t:U.t,s:U.s,length:$.length}}),U.s!==null)this.currentSession=this.currentSession.withSeq(U.s);if(U.op===q_)return this.onHello(U);if(U.op===B_)return this.onHeartbeatAck();if(U.op===nJ)return this.onHeartbeatRequest();if(U.op===L_)return this.onReconnectRequest(v);if(U.op===K_)return this.onInvalidSession(U,v);if(U.op===Q_)return this.onDispatch(U);this.log.warn({action:"ws.op.unknown",message:`unknown op=${U.op}`,detail:{op:U.op}})}onHello($){let v=p4($.d)?$.d:null,U=v&&typeof v.heartbeat_interval==="number"?v.heartbeat_interval:0;if(this.log.info({action:"gateway.hello",message:`heartbeat_interval=${U}ms`,detail:{interval:U}}),this.heartbeat?.stop(),this.heartbeat=new et({log:this.log,deps:this.props.deps,onSend:()=>{this.log.debug({action:"heartbeat.send",message:`seq=${this.currentSession.seq}`}),this.send({op:nJ,d:this.currentSession.seq})},onZombie:()=>{this.log.warn({action:"heartbeat.zombie",message:"no ACK received, closing connection"}),this.closeSocket({ws:this.ws,code:4009,reason:"zombie connection"})}}),this.heartbeat.start(U),this.currentSession.canResume())this.sendResume();else this.sendIdentify()}onHeartbeatAck(){this.log.debug({action:"heartbeat.ack",message:"received"}),this.heartbeat?.ack()}onHeartbeatRequest(){this.log.debug({action:"heartbeat.requested",message:"server requested heartbeat"}),this.send({op:nJ,d:this.currentSession.seq})}onReconnectRequest($){this.log.info({action:"ws.reconnect.requested",message:"server requested reconnect"}),this.closeSocket({ws:$,code:4000,reason:"reconnect requested"})}onInvalidSession($,v){let U=$.d===!0||p4($.d)&&$.d.resumable===!0;this.log.warn({action:"session.invalid",message:`resumable=${U}`,detail:{resumable:U}});let I=1000+$g({deps:this.props.deps})*4000;if(!U)this.currentSession=this.currentSession.withReset();this.clearInvalidSessionTimer();let b=p(()=>this.props.deps.setTimeout(()=>{this.invalidSessionTimer=null,this.closeSocket({ws:v,code:4000,reason:"invalid session"})},I));if(b instanceof Error)this.log.error({action:"session.invalid.timer.error",message:x({error:b}),error:b}),this.invalidSessionTimer=null;else this.invalidSessionTimer=b}onDispatch($){let v=p4($.d)?$.d:null;if($.t==="READY"&&v){let U=typeof v.session_id==="string"?v.session_id:"",I=typeof v.resume_gateway_url==="string"?v.resume_gateway_url:"";this.currentSession=this.currentSession.withReady(U,I),this.log.info({action:"gateway.ready",message:"session ready",detail:{hasResumeUrl:I!==""}}),this.hasConnected=!0,this.props.onStatus("connected"),this.completeConnect(null)}if($.t==="RESUMED")this.log.info({action:"gateway.resumed",message:`seq=${this.currentSession.seq}`}),this.hasConnected=!0,this.props.onStatus("connected"),this.completeConnect(null);if($.t&&v)this.props.onDispatch($.t,v);else if($.t)this.log.debug({action:"dispatch.empty",message:`dropped ${$.t} (no payload)`,detail:{type:$.t}})}onClose($){let v=bd.has($.code);if(this.log.info({action:"ws.close",message:`code=${$.code} reason=${$.reason||"none"}${v?" (terminal)":""}`,detail:{code:$.code,reason:$.reason,terminal:v}}),this.ws=null,this.heartbeat?.stop(),this.clearInvalidSessionTimer(),v)this.isStoppedFlag=!0;if(this.hasConnected||v)this.props.onStatus("disconnected");if(!this.pendingResolved){let U=new Uv(`WebSocket closed before ready (code=${$.code})`,{code:$.code});this.completeConnect(U)}}onError(){let $=new Uv("WebSocket connection error");this.log.error({action:"ws.error",message:x({error:$}),error:$}),this.completeConnect($)}clearInvalidSessionTimer(){if(this.invalidSessionTimer===null)return;let $=this.invalidSessionTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.log.error({action:"session.invalid.timer.clear.error",message:x({error:v}),error:v});this.invalidSessionTimer=null}closeSocket($){if($.ws===null)return;let v=$.ws,U=p(()=>{if($.code!==void 0)v.close($.code,$.reason??"");else v.close()});if(U instanceof Error)this.log.error({action:"ws.close.error",message:x({error:U}),error:U})}send($){let v=this.safeSerialize($);if(v===null)return;this.log.debug({action:"ws.send",message:`op=${H_[$.op]??$.op} length=${v.length}`,detail:{op:$.op,length:v.length}});let U=this.ws;if(U===null){this.log.warn({action:"ws.send",message:"ws.send skipped: socket is null"});return}if(U.readyState!==z_){this.log.warn({action:"ws.send",message:`ws.send skipped: readyState=${U.readyState} (not OPEN)`,detail:{readyState:U.readyState}});return}let I=p(()=>U.send(v));if(I instanceof Error)this.log.error({action:"ws.send",message:`ws.send failed: ${x({error:I})}`,error:I})}safeSerialize($){let v=Ug({op:$.op,d:$.d??null});if(v instanceof Error)return this.log.error({action:"ws.send.serialize.error",message:x({error:v}),error:v,detail:{op:$.op}}),null;return v}sendIdentify(){this.log.info({action:"gateway.identify",message:`intents=${this.props.intents}`}),this.send({op:Y_,d:{token:this.props.token,intents:this.props.intents,properties:{os:"linux",browser:"open-flume",device:"open-flume"}}})}sendResume(){this.log.info({action:"gateway.resume",message:`seq=${this.currentSession.seq}`}),this.send({op:V_,d:{token:this.props.token,session_id:this.currentSession.sessionId,seq:this.currentSession.seq}})}},i6={Guilds:1,GuildMembers:2,GuildModeration:4,GuildExpressions:8,GuildIntegrations:16,GuildWebhooks:32,GuildInvites:64,GuildVoiceStates:128,GuildPresences:256,GuildMessages:512,GuildMessageReactions:1024,GuildMessageTyping:2048,DirectMessages:4096,DirectMessageReactions:8192,DirectMessageTyping:16384,MessageContent:32768,GuildScheduledEvents:65536,AutoModerationConfiguration:1048576,AutoModerationExecution:2097152,GuildMessagePolls:16777216,DirectMessagePolls:33554432};function Id($,v){let U={event_type:$};if(typeof v.channel_id==="string")U.channel_id=v.channel_id;if(typeof v.guild_id==="string")U.guild_id=v.guild_id;if(p4(v.author)&&typeof v.author.id==="string")U.user_id=v.author.id;return U}var Dd=i6.Guilds|i6.GuildMessages|i6.DirectMessages,A_=class extends Nb{options;name="discord";gateway=null;reconnector=null;constructor($){super();this.options=$}async connect($){if(!this.hasWebSocket($))return new F4("Discord source: deps.WebSocket is null (no WebSocket runtime available)");if($.reconnect&&!this.reconnector)this.reconnector=new vg({...$.reconnect,log:$.log,deps:$.deps});return await this.connectInternal($)}disconnect(){if(this.reconnector&&!this.reconnector.aborted)this.context?.log.debug({action:"reconnect.cancel",message:"aborting reconnector"});this.reconnector?.cancel(),this.gateway?.disconnect(),this.gateway=null}hasWebSocket($){let v=p(()=>Boolean($.deps.WebSocket));if(v instanceof Error){let U=F$({value:v});return $.log.error({action:"deps.web-socket.read.error",message:x({error:U}),error:U}),!1}return v}async connectInternal($,v){this.setStatus("connecting"),this.gateway=new Ud({token:this.options.token,intents:this.options.intents??Dd,onLog:$.log.handler,deps:$.deps,onDispatch:(I,b)=>this.dispatch($,I,b),onStatus:(I)=>this.handleGatewayStatus($,I)});let U=await this.gateway.connect(v);if(U instanceof Uv){if($.log.error({action:"connect.failed",message:x({error:U}),error:U}),this.gateway.isStopped||!this.reconnector||this.reconnector.aborted)return this.setStatus("disconnected"),U;this.scheduleReconnect($)}return null}dispatch($,v,U){this.emit({source:"discord",type:v,data:U,meta:this.safeExtractMeta($,v,U),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v,U){let I=p(()=>Id(v,U));if(I instanceof Error){let b=F$({value:I});return $.log.warn({action:"meta.extract.error",message:x({error:b}),error:b,detail:{eventName:v}}),{event_type:v}}return I}handleGatewayStatus($,v){if(v==="connected"){if(this.reconnector&&this.reconnector.attempt>0)$.log.info({action:"reconnect.reset",message:`cleared ${this.reconnector.attempt} attempts`});this.reconnector?.reset(),this.setStatus("connected");return}if(this.gateway?.isStopped){this.setStatus("disconnected");return}this.scheduleReconnect($)}scheduleReconnect($){let v=this.gateway?.session.resumeUrl??void 0;bg({reconnector:this.reconnector,log:$.log,setStatus:(U)=>this.setStatus(U),retry:()=>{this.connectInternal($,v).catch((U)=>{let I=F$({value:U});$.log.error({action:"reconnect.unhandled",message:x({error:I}),error:I}),this.setStatus("disconnected")})}})}};var T$=($)=>{return $ instanceof Error?$.message:String($)};class BL{ownUserId;constructor($){this.ownUserId=$.ownUserId}process($){if($.authorIsBot)return{skip:!0};let v=this.ownUserId?$.mentionedUserIds.includes(this.ownUserId):!1;return{skip:!1,content:JSON.stringify($.raw),meta:{event_type:"discord",channel_id:$.channelId,user_id:$.authorId,mentioned:String(v),guild_id:$.guildId??""}}}}var tv=class extends Error{status;constructor($){super($.message,$.cause===void 0?void 0:{cause:$.cause});this.name="FlumeHttpError",this.status=$.status,Object.freeze(this)}};function ud(){let $=p(()=>globalThis.WebSocket);if($ instanceof Error||typeof $!=="function")return null;return $}function PL(){return{fetch:($,v)=>globalThis.fetch($,v),WebSocket:ud(),now:()=>Date.now(),random:()=>Math.random(),setTimeout:($,v)=>globalThis.setTimeout($,v),clearTimeout:($)=>globalThis.clearTimeout($),setInterval:($,v)=>globalThis.setInterval($,v),clearInterval:($)=>globalThis.clearInterval($)}}var AL={value:void 0,done:!0},wd=class{props;items=[];resolvers=[];closed=!1;constructor($){this.props=$}push($){if(this.closed)return;let v=this.resolvers.shift();if(v){v({value:$,done:!1});return}if(this.items.length>=this.props.buffer){if(this.props.onOverflow==="drop-newest")return;this.items.shift()}this.items.push($)}close(){if(this.closed)return;this.closed=!0;while(this.resolvers.length>0){let $=this.resolvers.shift();if($)$(AL)}}next(){let $=this.items.shift();if($!==void 0)return Promise.resolve({value:$,done:!1});if(this.closed)return Promise.resolve(AL);return new Promise((v)=>this.resolvers.push(v))}return(){return this.close(),this.props.onClose(),Promise.resolve(AL)}[Symbol.asyncIterator](){return this}},gd=1000,Jd=class{streams=new Set;closed=!1;publish($){if(this.closed)return;for(let v of this.streams)v.push($)}subscribe($){let v=new wd({buffer:$?.buffer??gd,onOverflow:$?.onOverflow??"drop-oldest",onClose:()=>this.streams.delete(v)});if(this.closed)return v.close(),v;return this.streams.add(v),v}close(){if(this.closed)return;this.closed=!0;for(let $ of this.streams)$.close();this.streams.clear()}},P_=class{props;kind="closed";constructor($){this.props=$,Object.freeze(this)}statuses(){return this.props.finalStatuses}errors(){return this.props.closeErrors}},Xd=class{props;kind="running";closePromise=null;onAbort;constructor($){this.props=$,this.onAbort=()=>{this.props.log.info({action:"flume.abort",message:"signal aborted, closing"}),jb({fn:()=>this.close(),onError:(U)=>{this.props.log.error({action:"flume.abort.close.failed",message:x({error:U}),error:U})}})};let v=$.signal;if(v){let U=p(()=>v.addEventListener("abort",this.onAbort,{once:!0}));if(U instanceof Error){let I=F$({value:U});$.log.error({action:"signal.addListener.failed",message:x({error:I}),error:I})}}}close(){if(this.closePromise)return this.closePromise;return this.closePromise=this.runClose(),this.closePromise}statuses(){return this.snapshotStatuses()}stream($){return this.props.hub.subscribe($)}get signal(){return this.props.signal}async runClose(){let $=[];try{this.props.log.info({action:"flume.close",message:`closing ${this.props.sources.length} source(s)`});let v=await Promise.allSettled(this.props.sources.map((I)=>Promise.resolve().then(()=>I.stop())));for(let[I,b]of v.entries())if(b.status==="rejected"){let D=this.props.sources[I],u=D?this.sourceName(D):"?",w=F$({value:b.reason});$.push({source:u,error:w}),this.props.log.error({action:"flume.close.failed",message:`${u}: ${x({error:w})}`,error:w,detail:{source:u}})}let U=this.props.signal;if(U){let I=p(()=>U.removeEventListener("abort",this.onAbort));if(I instanceof Error){let b=F$({value:I});this.props.log.error({action:"signal.removeListener.failed",message:x({error:b}),error:b})}}return this.props.log.info({action:"flume.close.complete",message:"all sources closed"}),this.props.hub.close(),new P_({finalStatuses:this.snapshotStatuses(),closeErrors:$})}catch(v){let U=F$({value:v});return this.props.log.error({action:"flume.close.unhandled",message:x({error:U}),error:U}),this.props.hub.close(),new P_({finalStatuses:this.snapshotStatuses(),closeErrors:$})}}snapshotStatuses(){return this.props.sources.map(($)=>{let v=this.sourceName($),U=p(()=>$.status());if(U instanceof Error){let I=F$({value:U});return this.props.log.error({action:"source.status.failed",message:`${v}: ${x({error:I})}`,error:I,detail:{source:v}}),{source:v,status:"disconnected"}}return{source:v,status:U}})}sourceName($){let v=p(()=>$.name);if(v instanceof Error)return"?";if(typeof v!=="string")return"?";return v}},j_={maxAttempts:1/0,baseDelay:1000,maxDelay:30000};function Wd($){if($===!1||$===void 0)return null;if($===!0)return{...j_};return{...j_,...$}}var N_=class{options;consumed=!1;log;deps;sources;sourceEventHandler;hub=new Jd;constructor($){this.options=$,this.sources=$.sources,this.deps=$.deps??PL(),this.log=new d4({source:"flume",handler:this.buildLogHandler(),deps:this.deps}),this.sourceEventHandler=(v)=>this.emitItem({kind:"event",event:v})}buildLogHandler(){return($)=>{this.emitItem({kind:"log",log:$});let v=this.options.onError;if(!v||$.level!=="error")return;try{Promise.resolve(v($)).catch(()=>{})}catch{}}}emitItem($){this.hub.publish($);let v=this.options.onEvent;if(!v)return;try{Promise.resolve(v($)).catch(()=>{})}catch{}}async open(){let $=this.guardOpen();if($)return $;this.consumed=!0,this.log.info({action:"flume.open",message:`opening ${this.sources.length} source(s)`,detail:{count:this.sources.length}});let v=Wd(this.options.reconnect),U=await Promise.allSettled(this.sources.map((D)=>this.safeStart(D,v))),I=[],b=[];for(let[D,u]of U.entries()){let w=this.sources[D];if(w===void 0)continue;let g=this.sourceName(w);if(u.status==="rejected"){I.push({name:g,error:F$({value:u.reason})});continue}if(u.value instanceof Error){I.push({name:g,error:u.value});continue}b.push(w)}if(I.length>0){for(let w of I)this.log.error({action:"flume.source.failed",message:`${w.name}: ${x({error:w.error})}`,error:w.error,detail:{source:w.name}});await this.rollback(b);let D=I.map((w)=>`${w.name}: ${x({error:w.error})}`).join("; "),u=new F4(`Flume.open: ${I.length} source(s) failed: ${D}`);return this.log.error({action:"flume.open.failed",message:x({error:u}),error:u}),u}if(this.isSignalAborted()){await this.rollback(this.sources);let D=new F4("Flume.open: aborted during open");return this.log.warn({action:"flume.open.aborted",message:x({error:D}),error:D}),D}return this.log.info({action:"flume.open.complete",message:"all sources opened"}),new Xd({sources:this.sources,signal:this.options.signal,log:this.log,hub:this.hub})}guardOpen(){if(this.consumed){let $=new F4("Flume.open: already opened");return this.log.warn({action:"flume.open.refused",message:x({error:$}),error:$}),$}if(this.isSignalAborted()){let $=new F4("Flume.open: signal already aborted");return this.log.warn({action:"flume.open.refused",message:x({error:$}),error:$}),$}return null}isSignalAborted(){let $=this.options.signal;if(!$)return!1;let v=p(()=>$.aborted===!0);return v instanceof Error?!0:v}sourceName($){let v=p(()=>$.name);if(v instanceof Error)return"?";if(typeof v!=="string")return"?";return v}safeStart($,v){let U=this.sourceName($),I={onEvent:this.sourceEventHandler,log:this.log.child(U),deps:this.deps,reconnect:v,signal:this.options.signal};return Promise.resolve().then(()=>$.start(I))}async rollback($){let v=await Promise.allSettled($.map((U)=>Promise.resolve().then(()=>U.stop())));for(let[U,I]of v.entries())if(I.status==="rejected"){let b=$[U],D=b?this.sourceName(b):"?",u=F$({value:I.reason});this.log.error({action:"flume.rollback.failed",message:`${D}: ${x({error:u})}`,error:u,detail:{source:D}})}}};var GI=($)=>{if(!$||Object.keys($).length===0)return;return{...PL(),...$}},OI=($)=>{if(!$)return;return(v)=>{if(v.level==="debug")return;let U=`${v.source}/${v.action}: ${v.message}`,I=Gd(v);if(v.level==="error"){$.error(U,I);return}if(v.level==="warn"){$.warn(U,I);return}$.info(U,I)}},Gd=($)=>{let v={...$.detail??{}};if($.error){if(v.error=$.error.message,$.error.stack)v.stack=$.error.stack;if($.error.name&&$.error.name!=="Error")v.errorName=$.error.name}return Object.keys(v).length>0?v:void 0};class B0{isAlive(){return!0}}class A0{props;constructor($){this.props=$;Object.freeze(this)}recordRaw($,v){this.props.log?.recordRaw({eventId:$,type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,payload:v})}recordProcessed($,v,U){this.props.log?.recordProcessed({eventId:$,type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,outcome:v,payload:U})}recordConnection($,v){this.props.log?.recordConnection({type:this.props.type,connectorId:this.props.connectorId,channelId:this.props.channelId,status:$,detail:v})}}class Cb extends B0{logger;diagnostics;type;running=null;connected=!1;reconnecting=!1;deliveryChain=Promise.resolve();constructor($){super();this.type=$.type,this.logger=$.logger,this.diagnostics=new A0({type:$.type,connectorId:$.connectorId,channelId:$.channelId,log:$.diagnosticLog})}async runStart($){let v=$.reconnect??!0,U=v===!1?void 0:v===!0?{}:v,I=(w)=>{if(w.kind==="event"){this.deliveryChain=this.deliveryChain.catch(()=>{}).then(()=>Promise.resolve($.onEvent(w.event)));return}let g=w.log,J=zd(g);if(J)this.handleStatus(J);$.onLog?.(g)},b={sources:[$.source],onEvent:I};if($.deps)b.deps=$.deps;if($.signal)b.signal=$.signal;if(U)b.reconnect=U;let u=await new N_(b).open();if(u instanceof Error)throw this.diagnostics.recordConnection("error",T$(u)),u;this.running=u}async stop(){if(!this.running)return;try{await this.running.close(),this.diagnostics.recordConnection("disconnected","")}catch($){this.diagnostics.recordConnection("error",T$($)),this.logger?.error(`${this.type} stop error`,{error:T$($)})}finally{this.running=null,this.connected=!1,this.reconnecting=!1,this.deliveryChain=Promise.resolve(),this.onStop(),this.diagnostics.recordConnection("stopped","")}}isAlive(){if(this.running===null)return!1;return this.connected||this.reconnecting}handleStatus($){if($.status==="connected"){this.connected=!0,this.reconnecting=!1,this.diagnostics.recordConnection("connected",$.detail??"");return}if($.status==="disconnected"){this.connected=!1,this.reconnecting=!1,this.diagnostics.recordConnection("disconnected",$.detail??"");return}if($.status==="reconnecting")this.connected=!1,this.reconnecting=!0}onStop(){}}var Od=["disconnected","connecting","connected","reconnecting"],Hd=($)=>typeof $==="string"&&Od.includes($),zd=($)=>{if($.action!=="status")return null;let v=$.detail;if(!v)return null;let U=v.to;if(!Hd(U))return null;let I=typeof v.reason==="string"?v.reason:null;return{source:$.source,status:U,detail:I}};var Qd=["MESSAGE_CREATE","MESSAGE_UPDATE"],jL=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),NL=($,v)=>{let U=$[v];return typeof U==="string"?U:void 0};class SL extends Cb{config;env;flumeDeps;signal;eventTypes;processor=null;constructor($){super({type:"discord",connectorId:$.config.id,channelId:$.channelId??null,logger:$.logger,diagnosticLog:$.diagnosticLog});this.config=$.config,this.env=$.env??process.env,this.flumeDeps=$.flumeDeps??{},this.signal=$.signal,this.eventTypes=$.eventTypes==="all"?"all":new Set($.eventTypes??Qd)}async start($){this.diagnostics.recordConnection("started","");let v;try{v=o4({literal:this.config.botToken,envVar:this.config.botTokenEnv,env:this.env,label:`${this.config.name}.botToken`})}catch(I){throw this.diagnostics.recordConnection("auth-failed",T$(I)),I}let U=new A_({token:v,intents:i6.Guilds|i6.GuildMessages|i6.MessageContent|i6.DirectMessages});await this.runStart({source:U,onLog:OI(this.logger),deps:GI(this.flumeDeps),signal:this.signal,onEvent:(I)=>{if(I.source!=="discord")return Promise.resolve();return this.handleEvent(I,$)}})}onStop(){this.processor=null}async handleEvent($,v){if($.type==="READY"){this.adoptReady($.data);return}if(!this.processor){let G=crypto.randomUUID();this.diagnostics.recordRaw(G,JSON.stringify($.data)),this.diagnostics.recordProcessed(G,"skip:pre-ready","");return}if(this.eventTypes!=="all"&&!this.eventTypes.has($.type)){let G=crypto.randomUUID();this.diagnostics.recordRaw(G,JSON.stringify($.data)),this.diagnostics.recordProcessed(G,`skip:filtered:${$.type}`,"");return}let U=$.data,I=jL(U.author)?U.author:null,b=I!==null&&I.bot===!0,D=$.meta.user_id??"",u=$.meta.channel_id??"",w=$.meta.guild_id??null,g=Array.isArray(U.mentions)?U.mentions.map((G)=>jL(G)?NL(G,"id")??"":"").filter((G)=>G!==""):[],J=crypto.randomUUID(),X=JSON.stringify(U);this.diagnostics.recordRaw(J,X);let W=this.processor.process({authorId:D,authorIsBot:b,channelId:u,guildId:w,mentionedUserIds:g,raw:U});if(W.skip){this.diagnostics.recordProcessed(J,"skip:bot",X),this.logger?.info("discord skip",{reason:"bot author"});return}await this.deliver(v,J,X,W.content,W.meta)}adoptReady($){let v=jL($.user)?NL($.user,"id"):void 0,U=NL($,"user_id"),I=v??U??"";if(!I){let b=crypto.randomUUID();this.diagnostics.recordRaw(b,JSON.stringify($)),this.diagnostics.recordProcessed(b,"skip:ready-missing-user-id",""),this.diagnostics.recordConnection("error","discord READY payload had neither user.id nor user_id; processor not initialized"),this.logger?.error("discord READY missing user id",{connector:this.config.name});return}this.processor=new BL({ownUserId:I})}async deliver($,v,U,I,b){try{await $(I,b)}catch(D){this.diagnostics.recordProcessed(v,"emitted:delivery-failed",I||U),this.logger?.error("discord notify error",{error:T$(D)});return}this.diagnostics.recordProcessed(v,"emitted",I)}}var ib=($,v,U,I)=>{let b=U[$];if(typeof b==="string")return{[$]:b};let D=U[v];if(typeof D==="string")return{[v]:D};let u={},w=I[$],g=I[v];if(typeof w==="string")u[$]=w;if(typeof g==="string")u[v]=g;return u};var S_=($={})=>({type:"discord",toolExposed:!0,createListener(v,U){return new SL({config:t4.parse(v),channelId:U.channelId,logger:U.logger,diagnosticLog:U.diagnosticLog,signal:U.signal,eventTypes:$.eventTypes})},createAdapter(v,U){return new AQ({config:t4.parse(v),http:U.http})},secretTokens(v){return[t4.parse(v).botToken].filter((I)=>I!==void 0)},buildConfig(v,U){return t4.parse({id:U.id,type:"discord",name:v.name,...typeof v.botToken==="string"?{botToken:v.botToken}:{},...typeof v.botTokenEnv==="string"?{botTokenEnv:v.botTokenEnv}:{},createdAt:U.now,updatedAt:U.now})},applyUpdate(v,U,I){let b=t4.parse(v);return t4.parse({id:b.id,name:b.name,type:"discord",createdAt:b.createdAt,updatedAt:I.now,...ib("botToken","botTokenEnv",U,b)})},operations:{}});import{openSync as __}from"fs";function M_($){let v=[],U=Array.from($),I="",b=!1,D=0;while(D<U.length){let u=U[D]??"";if(b){if(u==='"'&&U[D+1]==='"'){I+='"',D+=2;continue}if(u==='"'){b=!1,D+=1;continue}I+=u,D+=1;continue}if(u==='"'){b=!0,D+=1;continue}if(u===","){v.push(I),I="",D+=1;continue}I+=u,D+=1}return v.push(I),v}class P0{}var ML=($)=>{if(!$)return;let v={};for(let[U,I]of Object.entries(process.env))if(typeof I==="string")v[U]=I;for(let[U,I]of Object.entries($))v[U]=I;return v},_L=()=>process.platform==="win32";class $v extends P0{constructor(){super();Object.freeze(this)}runSync($){let v=Bun.spawnSync($,{stdout:"pipe",stderr:"pipe"});return{exitCode:v.exitCode??0,stdout:v.stdout.toString(),stderr:v.stderr.toString()}}async run($,v={}){let U=Bun.spawn($,{cwd:v.cwd,env:ML(v.env),stdin:v.input!==void 0?"pipe":"ignore",stdout:"pipe",stderr:"pipe"});if(v.input!==void 0&&U.stdin)U.stdin.write(v.input),U.stdin.end();let I=await U.exited,b=await new Response(U.stdout).text(),D=await new Response(U.stderr).text();return{exitCode:I,stdout:b,stderr:D}}async attach($,v={}){let U=Bun.spawn($,{cwd:v.cwd,env:ML(v.env),stdio:["inherit","inherit","inherit"]});if(v.onSpawned)v.onSpawned(U.pid);return await U.exited}detach($,v={}){let U=v.stdoutFile?__(v.stdoutFile,"a"):"ignore",I=v.stderrFile?v.stderrFile===v.stdoutFile&&typeof U==="number"?U:__(v.stderrFile,"a"):"ignore";Bun.spawn($,{env:ML(v.env),stdio:["ignore",U,I],windowsHide:!0}).unref()}kill($,v="SIGTERM"){try{process.kill($,v)}catch{}}isAlive($){if(!Number.isInteger($)||$<=0)return!1;if(_L())return this.isAliveWindows($);return this.isAlivePosix($)}listProcessesContaining($){if(!$)return[];if(_L())return this.listProcessesContainingWindows($);return this.listProcessesContainingPosix($)}getStartTime($){if(!Number.isInteger($)||$<=0)return null;if(_L())return this.getStartTimeWindows($);return this.getStartTimePosix($)}isAlivePosix($){let v=this.runSync(["ps","-p",String($),"-o","state="]);if(v.exitCode!==0)return!1;let U=v.stdout.trim();if(!U)return!1;return!U.startsWith("Z")}isAliveWindows($){let v=this.runSync(["tasklist","/FI",`PID eq ${$}`,"/NH","/FO","CSV"]);if(v.exitCode!==0)return!1;return v.stdout.includes(`"${$}"`)}listProcessesContainingPosix($){let v=this.runSync(["ps","-e","-o","pid=,args="]);if(v.exitCode!==0)return[];let U=[];for(let I of v.stdout.split(`
307
+ `)){let b=I.trim();if(!b)continue;let D=/^(\d+)\s+(.+)$/.exec(b);if(!D)continue;let u=Number(D[1]),w=D[2]??"";if(!Number.isInteger(u)||u<=0)continue;if(!w.includes($))continue;U.push({pid:u,command:w})}return U}getStartTimePosix($){let v=this.runSync(["ps","-p",String($),"-o","lstart="]);if(v.exitCode!==0)return null;let U=v.stdout.trim();if(!U)return null;return U}getStartTimeWindows($){let v=`Get-CimInstance Win32_Process -Filter "ProcessId=${$}" | Select-Object -ExpandProperty CreationDate | ForEach-Object { $_.ToString("o") }`,U=this.runSync(["powershell","-NoProfile","-Command",v]);if(U.exitCode!==0)return null;let I=U.stdout.trim();if(!I)return null;return I}listProcessesContainingWindows($){let U=this.runSync(["powershell","-NoProfile","-Command","Get-CimInstance Win32_Process | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"]);if(U.exitCode!==0)return[];let I=[],b=U.stdout.split(/\r?\n/).slice(1);for(let D of b){let u=D.trim();if(!u)continue;let w=M_(u);if(w.length<2)continue;let g=Number(w[0]),J=w[1]??"";if(!Number.isInteger(g)||g<=0)continue;if(!J.includes($))continue;I.push({pid:g,command:J})}return I}}var Yd=new $v;class FL extends Pb{process;constructor($={}){super();this.process=$.process??Yd,Object.freeze(this)}async call($){let v=["api",$.path];if($.method&&$.method.toLowerCase()!=="get")v.push("-X",$.method.toUpperCase());let U=$.body&&typeof $.body==="object"&&Object.keys($.body).length>0;if(U)v.push("--input","-");let I=await this.process.run(["gh",...v],{input:U?JSON.stringify($.body):void 0});if(I.exitCode!==0)throw Error(`gh api failed: ${I.stderr.trim()||I.stdout.trim()}`);try{return JSON.parse(I.stdout)}catch{return I.stdout}}}var $6=H.object({id:H.string(),name:H.string(),type:H.literal("gh"),pollInterval:H.number().int().positive().optional(),token:H.string().optional(),tokenEnv:H.string().optional(),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});async function rJ($){try{return await $.response.text()}catch(v){return new tv({message:`${$.context}: failed to read body: ${x({error:v})}`,status:$.response.status,cause:v})}}function Vd($){return{event_type:"notification",reason:$.reason,subject_type:$.subject.type,repository:$.repository.full_name,thread_id:$.id}}var Ld=z$.object({id:z$.string(),reason:z$.string(),unread:z$.boolean(),updated_at:z$.string(),subject:z$.object({title:z$.string(),url:z$.string().nullable(),type:z$.string()}),repository:z$.object({full_name:z$.string()})}),Kd=class{props;seen=new Map;constructor($){this.props=$}has($,v){return this.seen.get($)===v}add($,v){this.seen.set($,v)}trim(){if(this.seen.size<=this.props.maxSize)return;let $=this.seen.size-this.props.maxSize;for(let v of this.seen.keys()){if($<=0)break;this.seen.delete(v),$--}}get size(){return this.seen.size}},qd="https://api.github.com/notifications",Bd=3,Ad=5000,Pd=class{props;log;cache=new Kd({maxSize:Ad});timer=null;rateLimitTimer=null;since=null;etag=null;lastModified=null;bootstrapped=!1;isStoppedFlag=!1;inFlight=!1;consecutiveErrors=0;effectiveIntervalSec;controller=null;constructor($){this.props=$,this.log=new d4({source:"github.poller",handler:$.onLog,deps:$.deps}),this.effectiveIntervalSec=$.interval}get isStopped(){return this.isStoppedFlag}async start(){this.isStoppedFlag=!1;let $=p(()=>new AbortController);if($ instanceof Error)this.log.error({action:"github.abort-controller.new.error",message:x({error:$}),error:$}),this.controller=null;else this.controller=$;this.log.info({action:"poller.start",message:`polling every ${this.effectiveIntervalSec}s`});let v=await this.poll();if(v)return v;if(this.isStoppedFlag)return null;if(this.rateLimitTimer!==null)return null;return this.scheduleInterval(),null}stop(){this.log.info({action:"poller.stop",message:"stopping poller"}),this.isStoppedFlag=!0,this.controller?.abort(),this.controller=null,this.clearTimer(),this.clearRateLimitTimer()}scheduleInterval(){this.clearTimer();let $=p(()=>this.props.deps.setInterval(()=>{this.poll().catch((v)=>{let U=F$({value:v});this.log.error({action:"poll.unhandled",message:x({error:U}),error:U})})},this.effectiveIntervalSec*1000));if($ instanceof Error){if(this.log.error({action:"poller.interval.schedule.error",message:x({error:$}),error:$}),this.timer=null,!this.isStoppedFlag)this.props.onDisconnected("interval scheduling rejected by runtime");return}this.timer=$}async poll(){if(this.inFlight||this.isStoppedFlag)return null;this.inFlight=!0;try{return await this.pollOnce()}catch($){let v=F$({value:$}),U=new tv({message:`poll loop threw: ${x({error:v})}`,status:0,cause:v});if(this.log.error({action:"poll.unhandled",message:x({error:U}),error:U}),!this.bootstrapped)return U;return null}finally{this.inFlight=!1}}async pollOnce(){let $=new URLSearchParams({all:"false",per_page:"50"});if(this.since)$.set("since",this.since);let v=`${qd}?${$}`;this.log.debug({action:"http.request",message:`GET ${v}`});let U={Authorization:`Bearer ${this.props.token}`,Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"};if(this.etag)U["If-None-Match"]=this.etag;if(this.lastModified)U["If-Modified-Since"]=this.lastModified;let I=await p(()=>this.props.deps.fetch(v,{headers:U,signal:this.controller?.signal}));if(this.isStoppedFlag)return null;if(I instanceof Error)return this.log.error({action:"http.error",message:x({error:I}),error:I}),this.recordFailure({kind:"network",message:I.message,cause:I});if(this.log.debug({action:"http.response",message:`GET ${I.status}`,detail:{status:I.status,url:v}}),this.maybeWidenInterval(I.headers.get("X-Poll-Interval")),I.status===304)return this.consecutiveErrors=0,this.log.debug({action:"poll.not-modified",message:"304 Not Modified"}),null;if(this.isRateLimited(I))return this.handleRateLimit(I),null;if(!I.ok){let u=new tv({message:`HTTP ${I.status}`,status:I.status});return this.recordFailure({kind:"http",message:x({error:u}),error:u})}this.consecutiveErrors=0,this.etag=I.headers.get("ETag"),this.lastModified=I.headers.get("Last-Modified");let b=await rJ({response:I,context:"notifications"});if(this.isStoppedFlag)return null;if(b instanceof tv)return this.log.warn({action:"http.body.read",message:x({error:b}),error:b}),this.recordFailure({kind:"http",message:b.message,error:b});let D=Sb(b);if(D instanceof mv)return this.log.warn({action:"http.body.parse",message:D.message,error:D}),null;if(!Array.isArray(D))return this.log.warn({action:"http.body.shape",message:"response body is not an array, dropping",detail:{bodyType:typeof D}}),null;return this.processNotifications(D),null}recordFailure($){this.consecutiveErrors++;let v=$.error??new tv({message:$.message,status:0,cause:$.cause});if(this.log.error({action:"http.error",message:$.message,error:v,detail:{consecutiveErrors:this.consecutiveErrors}}),this.consecutiveErrors>=Bd&&!this.isStoppedFlag)this.props.onDisconnected($.kind==="network"?"network error":$.message);if(!this.bootstrapped)return v;return null}isRateLimited($){if($.status===429)return!0;if($.status===403&&$.headers.get("X-RateLimit-Remaining")==="0")return!0;return!1}handleRateLimit($){let v=$.headers.get("Retry-After"),U=$.headers.get("X-RateLimit-Reset"),I=Math.floor(ev({deps:this.props.deps})/1000),b=v!==null?Number.parseInt(v,10):NaN,D=U!==null?Number.parseInt(U,10)-I:NaN,u=Number.isFinite(b)&&b>0?b:Number.isFinite(D)&&D>0?D:60;this.log.warn({action:"rate.limit",message:`rate limited, pausing for ${u}s`,detail:{status:$.status,delaySec:u}}),this.clearTimer(),this.clearRateLimitTimer();let w=p(()=>this.props.deps.setTimeout(()=>{if(this.rateLimitTimer=null,this.isStoppedFlag)return;this.scheduleInterval()},u*1000));if(w instanceof Error)this.log.error({action:"poller.rate-limit.schedule.error",message:x({error:w}),error:w}),this.rateLimitTimer=null;else this.rateLimitTimer=w}clearTimer(){if(this.timer===null)return;let $=this.timer,v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.log.error({action:"poller.timer.clear.error",message:x({error:v}),error:v});this.timer=null}clearRateLimitTimer(){if(this.rateLimitTimer===null)return;let $=this.rateLimitTimer,v=p(()=>this.props.deps.clearTimeout($));if(v instanceof Error)this.log.error({action:"poller.rate-limit.clear.error",message:x({error:v}),error:v});this.rateLimitTimer=null}maybeWidenInterval($){if($===null)return;let v=Number.parseInt($,10);if(!Number.isFinite(v)||v<=this.effectiveIntervalSec)return;if(this.log.info({action:"poll.widen-interval",message:`widening interval ${this.effectiveIntervalSec}s -> ${v}s per X-Poll-Interval`,detail:{from:this.effectiveIntervalSec,to:v}}),this.effectiveIntervalSec=v,this.timer!==null)this.scheduleInterval()}processNotifications($){let v=$.map((D)=>Ld.safeParse(D));for(let D of v){if(D.success)continue;this.log.warn({action:"parse.skip",message:"notification did not match schema",detail:{issues:D.error.issues.map((u)=>({path:u.path,message:u.message}))}})}let U=v.flatMap((D)=>D.success?[D.data]:[]),I=$.length-U.length;if(I>0)this.log.warn({action:"parse.summary",message:`${I}/${$.length} notifications dropped by schema`});if(!this.bootstrapped){this.bootstrapped=!0;for(let D of U)this.cache.add(D.id,D.updated_at);this.advanceCursor(),this.log.info({action:"poller.bootstrap",message:`seeded ${U.length} existing notifications`}),this.props.onConnected();return}let b=U.filter((D)=>{if(this.cache.has(D.id,D.updated_at))return!1;return this.cache.add(D.id,D.updated_at),!0});if(this.cache.trim(),this.advanceCursor(),b.length>0){this.log.info({action:"poll.fresh",message:`${b.length} new notifications`,detail:{count:b.length}}),this.props.onNotifications(b);return}this.log.debug({action:"poll.idle",message:"0 new notifications"})}advanceCursor(){if(this.lastModified!==null){let U=new Date(this.lastModified);if(!Number.isNaN(U.getTime())){let I=p(()=>U.toISOString());if(!(I instanceof Error)){this.since=I;return}}}let $=ev({deps:this.props.deps});if(!Number.isFinite($)){this.log.warn({action:"cursor.advance.skip",message:"deps.now() returned non-finite, leaving since cursor unchanged"});return}let v=p(()=>new Date($).toISOString());if(v instanceof Error){let U=F$({value:v});this.log.warn({action:"cursor.advance.skip",message:x({error:U}),error:U});return}this.since=v}},F_=class extends Nb{options;name="github";poller=null;constructor($){super();this.options=$}async connect($){this.setStatus("connecting"),this.poller=new Pd({token:this.options.token,interval:this.options.pollInterval??60,onLog:$.log.handler,deps:$.deps,onNotifications:(U)=>this.handleNotifications($,U),onConnected:()=>this.setStatus("connected"),onDisconnected:(U)=>this.setStatus("disconnected",U)});let v=await this.poller.start();if(v instanceof Error)return $.log.error({action:"source.start.failed",message:x({error:v}),error:v}),this.setStatus("disconnected",v.message),v;return null}disconnect(){this.poller?.stop(),this.poller=null}handleNotifications($,v){for(let U of v)this.emit({source:"github",type:"notification",data:U,meta:this.safeExtractMeta($,U),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v){let U=p(()=>Vd(v));if(U instanceof Error){let I=F$({value:U});return $.log.warn({action:"meta.extract.error",message:x({error:I}),error:I,detail:{notificationId:v.id}}),{event_type:"notification"}}return U}};var jd=new $v;class ZL extends Cb{config;env;process;flumeDeps;signal;constructor($){super({type:"gh",connectorId:$.config.id,channelId:$.channelId??null,logger:$.logger,diagnosticLog:$.diagnosticLog});this.config=$.config,this.env=$.env??process.env,this.process=$.process??jd,this.flumeDeps=$.flumeDeps??{},this.signal=$.signal}async start($){this.diagnostics.recordConnection("started","");let v;try{v=await this.resolveToken()}catch(I){throw this.diagnostics.recordConnection("auth-failed",T$(I)),I}let U=new F_({token:v,pollInterval:this.config.pollInterval??60});await this.runStart({source:U,onLog:OI(this.logger),deps:GI(this.flumeDeps),signal:this.signal,onEvent:(I)=>{if(I.source!=="github")return Promise.resolve();return this.handleEvent(I,$)}})}async resolveToken(){if(this.config.token)return this.config.token;if(this.config.tokenEnv){let v=this.env[this.config.tokenEnv];if(typeof v==="string"&&v!=="")return v;throw Error(`${this.config.name}.token references env var "${this.config.tokenEnv}" but it is not set`)}let $=await this.process.run(["gh","auth","token"]);if($.exitCode!==0)throw Error(`gh auth token failed: ${$.stderr.trim()||$.stdout.trim()}`);return $.stdout.trim()}async handleEvent($,v){let U=$.data.id,I=JSON.stringify($.data);this.diagnostics.recordRaw(U,I);let b={...$.meta,event_type:"gh",subject_url:$.data.subject.url??"",updated_at:$.data.updated_at};await this.deliver(v,U,I,b)}async deliver($,v,U,I){try{await $(U,I)}catch(b){this.diagnostics.recordProcessed(v,"emitted:delivery-failed",U),this.logger?.error("gh notify error",{error:T$(b)});return}this.diagnostics.recordProcessed(v,"emitted",U)}}var Z_=()=>({type:"gh",toolExposed:!0,createListener($,v){return new ZL({config:$6.parse($),channelId:v.channelId,process:v.process,logger:v.logger,diagnosticLog:v.diagnosticLog,signal:v.signal})},createAdapter($,v){return $6.parse($),new FL({process:v.process})},secretTokens($){return[$6.parse($).token].filter((U)=>U!==void 0)},buildConfig($,v){return $6.parse({id:v.id,type:"gh",name:$.name,...typeof $.pollInterval==="number"?{pollInterval:$.pollInterval}:{},...typeof $.token==="string"?{token:$.token}:{},...typeof $.tokenEnv==="string"?{tokenEnv:$.tokenEnv}:{},createdAt:v.now,updatedAt:v.now})},applyUpdate($,v,U){let I=$6.parse($);return $6.parse({id:I.id,name:I.name,type:"gh",pollInterval:typeof v.pollInterval==="number"?v.pollInterval:I.pollInterval,createdAt:I.createdAt,updatedAt:U.now,...ib("token","tokenEnv",v,I)})},operations:{}});import{join as od}from"path";var TL=H.enum(["latest","all","skip"]),x6=H.object({id:H.string(),cron:H.string(),prompt:H.string(),enabled:H.boolean().default(!0),catchupPolicy:TL.default("latest")}),n4=H.object({id:H.string(),name:H.string(),type:H.literal("schedule"),entries:H.array(x6).default([]),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});var j0=($,v,U)=>{let I=new Set;for(let b of $.split(",")){let[D,u]=b.split("/"),w=u?Number(u):1;if(!Number.isFinite(w)||w<=0)throw Error(`invalid cron step: "${u}"`);let g=v,J=U;if(D==="*"||D===void 0||D==="")g=v,J=U;else if(D.includes("-")){let[X,W]=D.split("-"),G=Number(X),O=Number(W);if(!Number.isFinite(G)||!Number.isFinite(O))throw Error(`invalid cron range: "${D}"`);g=G,J=O}else{let X=Number(D);if(!Number.isFinite(X))throw Error(`invalid cron value: "${D}"`);g=X,J=u?U:X}if(g<v||J>U||g>J)throw Error(`cron value out of range: ${D} (must be ${v}-${U})`);for(let X=g;X<=J;X+=w)I.add(X)}return{min:v,max:U,values:I}},CJ=($,v)=>{let U=$.trim().split(/\s+/);if(U.length!==5)throw Error(`cron must have 5 fields (got ${U.length}): "${$}"`);let[I,b,D,u,w]=U;if(!I||!b||!D||!u||!w)throw Error(`cron has empty fields: "${$}"`);let g=[{field:j0(I,0,59),value:v.getMinutes()},{field:j0(b,0,23),value:v.getHours()},{field:j0(D,1,31),value:v.getDate()},{field:j0(u,1,12),value:v.getMonth()+1},{field:j0(w,0,6),value:v.getDay()}];for(let{field:J,value:X}of g)if(!J.values.has(X))return!1;return!0};var T_=1440;class kL extends B0{config;lastFiredStore;logger;diagnostics;now;onFired;timer=null;stopped=!1;tickScheduled=!1;constructor($){super();this.config=$.config,this.lastFiredStore=$.lastFiredStore,this.logger=$.logger,this.diagnostics=new A0({type:"schedule",connectorId:$.config.id,channelId:$.channelId??null,log:$.diagnosticLog}),this.now=$.now??(()=>new Date),this.onFired=$.onFired??null}async start($){this.stopped=!1,this.tickScheduled=!0,this.diagnostics.recordConnection("started","");let v=()=>{if(this.stopped)return;let U=this.now(),I=60000-(U.getSeconds()*1000+U.getMilliseconds());this.timer=setTimeout(async()=>{if(this.stopped)return;try{await this.tick($)}catch(b){this.recordTickError(b)}v()},I),this.timer.unref(),this.tickScheduled=!0};try{await this.tick($)}catch(U){this.recordTickError(U)}this.diagnostics.recordConnection("connected",""),v()}async stop(){if(this.stopped=!0,this.tickScheduled=!1,this.timer)clearTimeout(this.timer),this.timer=null;this.diagnostics.recordConnection("disconnected",""),this.diagnostics.recordConnection("stopped","")}recordTickError($){let v=T$($);this.diagnostics.recordConnection("error",`tick: ${v}`),this.logger?.error("schedule tick failed",{connector:this.config.name,error:v})}isAlive(){return!this.stopped&&this.tickScheduled}async tick($){let v=this.truncateToMinute(this.now()),U=this.lastFiredStore.load(),I=!1;for(let b of this.config.entries){if(!b.enabled)continue;if(await this.fireEntry(b,v,U,$))I=!0}if(I)this.lastFiredStore.save(U)}async fireEntry($,v,U,I){let b=U.get($.id),D=b?new Date(b.getTime()+60000):v;if(D.getTime()>v.getTime())return!1;if($.catchupPolicy==="skip"){try{if(!CJ($.cron,v))return!1}catch(w){return this.logInvalidCron($,w),!1}return await this.notifyOne($,v,I,!1),U.set($.id,v),!0}if($.catchupPolicy==="all"){let w=this.findAllMatches($.cron,D,v,$.id);if(w.length===0)return!1;for(let g of w)await this.notifyOne($,g,I,g.getTime()!==v.getTime());return U.set($.id,w[w.length-1]??v),!0}let u=this.findMostRecentMatch($.cron,D,v,$.id);if(!u)return!1;return await this.notifyOne($,u,I,u.getTime()!==v.getTime()),U.set($.id,u),!0}async notifyOne($,v,U,I){let b={event_type:"schedule",schedule_id:$.id,cron:$.cron,fired_at:v.toISOString(),catchup_policy:$.catchupPolicy};if(I)b.catchup="true";let D=`${$.id}@${v.toISOString()}`;this.diagnostics.recordRaw(D,JSON.stringify({schedule_id:$.id,cron:$.cron,prompt:$.prompt,fired_at:v.toISOString(),catchup:I}));try{await U($.prompt,b)}catch(u){throw this.diagnostics.recordProcessed(D,"emitted:delivery-failed",$.prompt),u}if(this.diagnostics.recordProcessed(D,"emitted",$.prompt),this.onFired)try{await this.onFired($,v)}catch(u){this.logger?.error("schedule onFired callback failed",{connector:this.config.name,id:$.id,error:T$(u)})}}findMostRecentMatch($,v,U,I){let b=Math.min(T_,Math.floor((U.getTime()-v.getTime())/60000)+1);for(let D=0;D<b;D++){let u=new Date(U.getTime()-D*60000);try{if(CJ($,u))return u}catch(w){return this.logInvalidCron({id:I,cron:$},w),null}}return null}findAllMatches($,v,U,I){let b=Math.min(T_,Math.floor((U.getTime()-v.getTime())/60000)+1),D=[];for(let u=0;u<b;u++){let w=new Date(v.getTime()+u*60000);if(w.getTime()>U.getTime())break;try{if(CJ($,w))D.push(w)}catch(g){return this.logInvalidCron({id:I,cron:$},g),[]}}return D}logInvalidCron($,v){let U=T$(v);this.diagnostics.recordConnection("error",`invalid cron "${$.cron}" (entry ${$.id}): ${U}`),this.logger?.error("invalid cron expression in schedule",{connector:this.config.name,id:$.id,cron:$.cron,error:U})}truncateToMinute($){let v=new Date($.getTime());return v.setSeconds(0,0),v}}import{dirname as md}from"path";import{appendFileSync as Nd,chmodSync as Sd,closeSync as Md,existsSync as _d,mkdirSync as Fd,openSync as Zd,readdirSync as Td,readFileSync as R_,renameSync as kd,statSync as n_,unlinkSync as S0,writeFileSync as r_}from"fs";import{dirname as Ed,basename as Rd}from"path";class N0{}var nd=384,EL=0,rd=()=>{return EL=EL+1|0,`${process.pid}-${EL}-${Math.floor(Math.random()*1e9)}`};class d$ extends N0{constructor(){super();Object.freeze(this)}existsSync($){return _d($)}readFileSync($){return R_($,"utf-8")}writeFileSync($,v){E_($,v,null)}writeSecretFileSync($,v){E_($,v,nd)}appendFileSync($,v){Nd($,v)}unlink($){try{S0($)}catch(v){if(RL(v,"ENOENT"))return;throw v}}mkdirSync($,v){Fd($,{recursive:v?.recursive??!1})}readdirSync($){return Td($)}statSync($){let v=n_($);return{mtimeMs:v.mtimeMs,mode:v.mode&511}}withFileLock($,v){let U=ld($);try{return v()}finally{try{Md(U)}catch{}try{S0($)}catch{}}}}var Cd=10,id=100,k_=5000,xd=30000,ld=($)=>{let v=performance.now()+k_,U=0;while(!0)try{let I=Zd($,"wx",384);return r_(I,String(process.pid)),I}catch(I){if(!RL(I,"EEXIST"))throw I;if(performance.now()>=v)throw Error(`failed to acquire file lock ${$} within ${k_}ms`);fd($);let b=Math.min(id,Cd*2**Math.min(U,4));hd(b),U=U+1}},fd=($)=>{let v,U;try{U=n_($).mtimeMs,v=Number(R_($,"utf-8").trim())}catch{return}if(Date.now()-U>xd){try{S0($)}catch{}return}if(v>0&&!yd(v))try{S0($)}catch{}},yd=($)=>{try{return process.kill($,0),!0}catch(v){if(RL(v,"EPERM"))return!0;return!1}},hd=($)=>{let v=new SharedArrayBuffer(4),U=new Int32Array(v);Atomics.wait(U,0,0,$)},RL=($,v)=>{if(!($ instanceof Error))return!1;if(!("code"in $))return!1;return $.code===v},E_=($,v,U)=>{let b=`${Ed($)}/.${Rd($)}.${rd()}.tmp`,D=U===null?void 0:{mode:U};try{if(r_(b,v,D),U!==null)try{Sd(b,U)}catch{}kd(b,$)}catch(u){try{S0(b)}catch{}throw u}};var cd=new d$;class nL{path;fs;constructor($){this.path=$.path,this.fs=$.fs??cd,Object.freeze(this)}load(){let $=new Map;if(!this.fs.existsSync(this.path))return $;let v=JSON.parse(this.fs.readFileSync(this.path));if(v===null||typeof v!=="object")return $;for(let[U,I]of Object.entries(v))if(typeof I==="string")$.set(U,new Date(I));return $}save($){let v={};for(let[U,I]of $)v[U]=I.toISOString();this.fs.mkdirSync(md(this.path),{recursive:!0}),this.fs.writeFileSync(this.path,`${JSON.stringify(v,null,2)}
308
+ `)}}var td=H.object({cron:H.string(),prompt:H.string(),id:H.string().optional(),enabled:H.boolean().optional(),catchupPolicy:x6.shape.catchupPolicy.optional()}),dd=H.object({id:H.string()}),C_=($={})=>({type:"schedule",toolExposed:!1,createListener(v,U){let I=n4.parse(v);return new kL({config:I,lastFiredStore:new nL({path:od(U.connectorDir(U.channelId,I.id),"state.json"),fs:U.fs}),channelId:U.channelId,logger:U.logger,diagnosticLog:U.diagnosticLog,onFired:$.onFired,now:()=>U.clock.now()})},createAdapter:null,secretTokens(){return[]},buildConfig(v,U){return n4.parse({id:U.id,type:"schedule",name:v.name,entries:Array.isArray(v.entries)?v.entries:[],createdAt:U.now,updatedAt:U.now})},applyUpdate(v,U,I){let b=n4.parse(v);return n4.parse({...b,updatedAt:I.now})},operations:{listEntries(v){let U=n4.parse(v.config);return{config:v.config,result:U.entries}},addEntry(v){let U=n4.parse(v.config),I=td.parse(v.args),b=x6.parse({id:I.id??v.context.generateId(),cron:I.cron,prompt:I.prompt,...I.enabled!==void 0?{enabled:I.enabled}:{},...I.catchupPolicy!==void 0?{catchupPolicy:I.catchupPolicy}:{}});return{config:n4.parse({...U,entries:[...U.entries,b],updatedAt:v.context.now}),result:b}},removeEntry(v){let U=n4.parse(v.config),I=dd.parse(v.args);if(!U.entries.some((b)=>b.id===I.id))throw Error(`schedule entry "${I.id}" not found`);return{config:n4.parse({...U,entries:U.entries.filter((b)=>b.id!==I.id),updatedAt:v.context.now}),result:null}}}});var pd="https://slack.com/api/",ad=($)=>{let v={};for(let[U,I]of Object.entries($))v[U]=I;return v};class rL extends Pb{token;http;constructor($){super();this.token=o4({literal:$.config.botToken,envVar:$.config.botTokenEnv,env:$.env??process.env,label:`${$.config.name}.botToken`}),this.http=$.http??new g4,Object.freeze(this)}async call($){let v=`${pd}${$.path}`,U=$.body!==null&&typeof $.body==="object"?ad($.body):{},I=new URLSearchParams;for(let[u,w]of Object.entries(U))I.set(u,typeof w==="string"?w:JSON.stringify(w));let D=await(await this.http.fetch({method:"POST",url:v,headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/x-www-form-urlencoded"},body:I.toString()})).text();try{return JSON.parse(D)}catch{return{ok:!1,error:`non-JSON response: ${D.slice(0,200)}`}}}async postMessage($){return this.call({method:"post",path:"chat.postMessage",body:{channel:$.channel,text:$.text,...$.threadTs?{thread_ts:$.threadTs}:{}}})}async addReaction($){return this.call({method:"post",path:"reactions.add",body:{channel:$.channel,timestamp:$.timestamp,name:$.name}})}async removeReaction($){return this.call({method:"post",path:"reactions.remove",body:{channel:$.channel,timestamp:$.timestamp,name:$.name}})}}var v6=H.object({id:H.string(),name:H.string(),type:H.literal("slack"),botToken:H.string().startsWith("xoxb-").optional(),appToken:H.string().startsWith("xapp-").optional(),botTokenEnv:H.string().optional(),appTokenEnv:H.string().optional(),minify:H.boolean().default(!0),createdAt:H.string().datetime().optional(),updatedAt:H.string().datetime().optional()});function ed($){let v={event_type:$.type},U=p4($.payload.event)?$.payload.event:null;if(!U)return v;if(typeof U.channel==="string")v.channel_id=U.channel;if(typeof U.user==="string")v.user_id=U.user;if(typeof U.thread_ts==="string")v.thread_ts=U.thread_ts;if(typeof U.type==="string")v.slack_event_type=U.type;return v}var sd=class{props;seen=new Map;constructor($){this.props=$}has($){let v=this.seen.get($);if(v===void 0)return!1;if(ev({deps:this.props.deps})-v>this.props.ttlMs)return this.seen.delete($),!1;return!0}add($){this.seen.set($,ev({deps:this.props.deps}))}trim(){let $=ev({deps:this.props.deps})-this.props.ttlMs;for(let[U,I]of this.seen)if(I<$)this.seen.delete(U);if(this.seen.size<=this.props.maxSize)return;let v=this.seen.size-this.props.maxSize;for(let U of this.seen.keys()){if(v<=0)break;this.seen.delete(U),v--}}get size(){return this.seen.size}},$p=z$.object({ok:z$.boolean(),url:z$.string().optional(),error:z$.string().optional()}),CL="https://slack.com/api/apps.connections.open";async function vp($){let v=new d4({source:"slack.url",handler:$.onLog,deps:$.deps});v.debug({action:"http.request",message:`POST ${CL}`});let U=await p(()=>$.deps.fetch(CL,{method:"POST",headers:{Authorization:`Bearer ${$.appToken}`},signal:$.signal}));if(U instanceof Error){let w=F$({value:U});return v.error({action:"http.error",message:x({error:w}),error:w}),new Uv(`apps.connections.open transport: ${U.message}`,{cause:U})}v.debug({action:"http.response",message:`POST ${U.status}`,detail:{status:U.status,url:CL}});let I=await rJ({response:U,context:"apps.connections.open"});if(I instanceof tv)return v.warn({action:"http.body.read",message:x({error:I}),error:I}),I;let b=Sb(I);if(b instanceof mv)return v.warn({action:"http.body.parse",message:b.message,error:b}),new tv({message:"apps.connections.open: invalid JSON body",status:U.status,cause:b});let D=p4(b)?b:{};v.debug({action:"http.body",message:"apps.connections.open response",detail:{ok:D.ok,error:D.error}});let u=$p.safeParse(b);if(!u.success)return v.warn({action:"http.body.schema",message:"apps.connections.open: invalid response shape",detail:{issues:u.error.issues.map((w)=>({path:w.path,message:w.message}))}}),new tv({message:"apps.connections.open: invalid response shape",status:U.status,cause:u.error});if(!u.data.ok||!u.data.url)return v.warn({action:"slack.api.error",message:`apps.connections.open failed: ${u.data.error??"no url"}`}),new tv({message:`apps.connections.open failed: ${u.data.error??"no url"}`,status:U.status});return v.info({action:"slack.url.obtained",message:"WSS URL obtained"}),u.data.url}var bp=z$.object({envelope_id:z$.string(),type:z$.string(),payload:z$.record(z$.string(),z$.unknown()),accepts_response_payload:z$.boolean().optional(),retry_attempt:z$.number().optional(),retry_reason:z$.string().optional()}),Up=15000,i_=1,Ip=class{props;log;ws=null;isStoppedFlag=!1;hasConnected=!1;pendingResolve=null;pendingResolved=!1;lastFrameAt=0;idleWatchdog=null;constructor($){this.props=$,this.log=new d4({source:"slack.socket-mode",handler:$.onLog,deps:$.deps})}get isStopped(){return this.isStoppedFlag}async connect($){this.log.info({action:"connect.start",message:"opening WebSocket connection"});let v=await vp({appToken:this.props.appToken,signal:$?.signal,onLog:this.props.onLog,deps:this.props.deps});if(v instanceof tv)return this.log.error({action:"http.error",message:v.message,error:v}),v;if(v instanceof Uv)return this.log.error({action:"url.error",message:v.message,error:v}),v;if(this.isStoppedFlag){let U=new Uv("stopped before WebSocket open");return this.log.info({action:"connect.aborted",message:x({error:U})}),U}return this.log.info({action:"slack.url.obtained",message:"WebSocket URL obtained"}),this.openSocket(v)}disconnect(){this.log.info({action:"disconnect",message:"stopping socket mode"}),this.isStoppedFlag=!0,this.disarmIdleWatchdog(),this.closeSocket(this.ws),this.ws=null}armIdleWatchdog(){this.disarmIdleWatchdog();let $=this.props.idleTimeoutMs;if($===null||$===void 0||$<=0)return;let v=p(()=>this.props.deps.setInterval(()=>this.checkIdle($),Up));if(v instanceof Error){this.log.error({action:"idle.watchdog.schedule.error",message:x({error:v}),error:v});return}this.idleWatchdog=v}disarmIdleWatchdog(){if(!this.idleWatchdog)return;let $=this.idleWatchdog;this.idleWatchdog=null;let v=p(()=>this.props.deps.clearInterval($));if(v instanceof Error)this.log.error({action:"idle.watchdog.clear.error",message:x({error:v}),error:v})}checkIdle($){if(!this.hasConnected||this.isStoppedFlag)return;let v=this.props.deps.now()-this.lastFrameAt;if(v<$)return;this.log.warn({action:"idle.timeout",message:`no frames for ${v}ms (limit ${$}ms) \u2014 force-closing socket`,detail:{elapsedMs:v,limitMs:$}}),this.disarmIdleWatchdog(),this.closeSocket(this.ws)}isConnected(){return this.ws!==null&&this.ws.readyState===i_}openSocket($){let v=this.props.deps.WebSocket;if(!v){let U=new Uv("WebSocket runtime not available");return this.log.error({action:"ws.error",message:x({error:U}),error:U}),Promise.resolve(U)}return this.pendingResolved=!1,this.hasConnected=!1,new Promise((U)=>{this.pendingResolve=U;let I=p(()=>new v($));if(I instanceof Error){let u=new Uv(`WebSocket construction failed: ${x({error:I})}`,{cause:I});this.log.error({action:"ws.construct.error",message:x({error:u}),error:u}),this.ws=null,this.pendingResolved=!0,U(u);return}let b=I;this.ws=b;let D=p(()=>{b.addEventListener("message",(u)=>this.safeOnMessage(u,b)),b.addEventListener("close",(u)=>this.safeOnClose(u)),b.addEventListener("error",()=>this.safeOnError())});if(D instanceof Error){let u=new Uv(`WebSocket listener registration failed: ${x({error:D})}`,{cause:D});this.log.error({action:"ws.listener.error",message:x({error:u}),error:u}),this.ws=null,this.pendingResolved=!0,U(u)}})}completeConnect($){if(this.pendingResolved||!this.pendingResolve)return;this.pendingResolved=!0,this.pendingResolve($)}safeOnMessage($,v){let U=p(()=>this.onMessage(String($.data),v));if(U instanceof Error)this.log.error({action:"ws.message.threw",message:x({error:U}),error:U})}safeOnClose($){let v=p(()=>this.onClose($));if(v instanceof Error)this.log.error({action:"ws.close.threw",message:x({error:v}),error:v})}safeOnError(){let $=p(()=>this.onError());if($ instanceof Error)this.log.error({action:"ws.error.threw",message:x({error:$}),error:$})}onMessage($,v){if(this.isStoppedFlag)return;let U=Sb($);if(U instanceof mv){this.log.error({action:"ws.parse.error",message:U.message,error:U,detail:{length:$.length}});return}if(!p4(U)){this.log.error({action:"ws.parse.error",message:"expected JSON object",error:new mv(`non-object frame (${typeof U})`)});return}if(this.log.debug({action:"ws.recv",message:`type=${typeof U.type==="string"?U.type:"-"} length=${$.length}`,detail:{length:$.length}}),this.lastFrameAt=this.props.deps.now(),U.type==="hello"){this.log.info({action:"socket.hello",message:"connection ready"}),this.hasConnected=!0,this.armIdleWatchdog(),this.props.onConnected(),this.completeConnect(null);return}if(U.type==="disconnect"){let b=typeof U.reason==="string"?U.reason:"unknown";this.log.info({action:"ws.disconnect.requested",message:`reason=${b}`,detail:{reason:b}}),this.closeSocket(v);return}if(typeof U.envelope_id==="string"){this.log.debug({action:"ws.ack",message:`envelope_id=${U.envelope_id}`});let b=this.safeSerialize({envelope_id:U.envelope_id});if(b!==null)this.send(v,b)}let I=bp.safeParse(U);if(I.success){this.log.debug({action:"envelope.recv",message:`type=${I.data.type} envelope_id=${I.data.envelope_id}`,detail:{type:I.data.type,envelopeId:I.data.envelope_id}}),this.props.onMessage(I.data);return}this.log.warn({action:"envelope.parse.error",message:"unrecognised envelope shape, dropping",detail:{type:typeof U.type==="string"?U.type:"unknown",issues:I.error.issues.map((b)=>({path:b.path,message:b.message}))}})}onClose($){if(this.log.info({action:"ws.close",message:`code=${$.code} reason=${$.reason||"none"}`,detail:{code:$.code,reason:$.reason}}),this.disarmIdleWatchdog(),this.ws=null,this.hasConnected)this.props.onDisconnected();if(!this.pendingResolved){let v=new Uv(`WebSocket closed before hello (code=${$.code})`,{code:$.code});this.completeConnect(v)}}onError(){let $=new Uv("WebSocket connection error");this.log.error({action:"ws.error",message:x({error:$}),error:$}),this.completeConnect($)}closeSocket($){if($===null)return;let v=p(()=>$.close());if(v instanceof Error)this.log.error({action:"ws.close.error",message:x({error:v}),error:v})}send($,v){if($.readyState!==i_){this.log.warn({action:"ws.send",message:`ws.send skipped: readyState=${$.readyState} (not OPEN)`,detail:{readyState:$.readyState}});return}let U=p(()=>$.send(v));if(U instanceof Error)this.log.error({action:"ws.send",message:`ws.send failed: ${x({error:U})}`,error:U})}safeSerialize($){let v=Ug($);if(v instanceof Error)return this.log.error({action:"ws.send.serialize.error",message:x({error:v}),error:v}),null;return v}},Dp=1024,up=300000,x_=class extends Nb{options;name="slack";socket=null;reconnector=null;internalController=null;seen=null;constructor($){super();this.options=$}async connect($){if(!this.hasWebSocket($))return new F4("Slack source: deps.WebSocket is null (no WebSocket runtime available)");if(this.seen=new sd({maxSize:Dp,ttlMs:up,deps:$.deps}),$.reconnect&&!this.reconnector)this.reconnector=new vg({...$.reconnect,log:$.log,deps:$.deps});let v=p(()=>new AbortController);if(v instanceof Error){let U=F$({value:v});$.log.error({action:"slack.abort-controller.new.error",message:x({error:U}),error:U}),this.internalController=null}else this.internalController=v;return await this.connectInternal($)}disconnect(){let $=this.context;if($&&this.reconnector&&!this.reconnector.aborted)$.log.debug({action:"reconnect.cancel",message:"aborting reconnector"});this.reconnector?.cancel(),this.internalController?.abort(),this.socket?.disconnect(),this.socket=null,this.internalController=null}hasWebSocket($){let v=p(()=>Boolean($.deps.WebSocket));if(v instanceof Error){let U=F$({value:v});return $.log.error({action:"deps.web-socket.read.error",message:x({error:U}),error:U}),!1}return v}async connectInternal($){this.setStatus("connecting"),this.socket=new Ip({appToken:this.options.appToken,idleTimeoutMs:this.options.idleTimeoutMs,onLog:$.log.handler,deps:$.deps,onMessage:(U)=>this.handleMessage($,U),onConnected:()=>{if(this.reconnector&&this.reconnector.attempt>0)$.log.info({action:"reconnect.reset",message:`cleared ${this.reconnector.attempt} attempts`});this.reconnector?.reset(),this.setStatus("connected")},onDisconnected:()=>{if(this.socket?.isStopped){this.setStatus("disconnected");return}this.scheduleReconnect($)}});let v=await this.socket.connect({signal:this.internalController?.signal});if(v instanceof Error){if($.log.error({action:"connect.failed",message:x({error:v}),error:v}),this.socket.isStopped||!this.reconnector||this.reconnector.aborted)return this.setStatus("disconnected"),v;this.scheduleReconnect($)}return null}handleMessage($,v){let U=this.seen;if(!U)return;if(U.has(v.envelope_id)){$.log.debug({action:"dedup.skip",message:`duplicate envelope_id=${v.envelope_id}`,detail:{envelope_id:v.envelope_id,retry_attempt:v.retry_attempt}});return}U.add(v.envelope_id),U.trim(),this.emit({source:"slack",type:v.type,data:v.payload,meta:this.safeExtractMeta($,v),receivedAt:ev({deps:$.deps})})}safeExtractMeta($,v){let U=p(()=>ed(v));if(U instanceof Error){let I=F$({value:U});return $.log.warn({action:"meta.extract.error",message:x({error:I}),error:I,detail:{envelopeType:v.type}}),{event_type:v.type}}return U}scheduleReconnect($){bg({reconnector:this.reconnector,log:$.log,setStatus:(v)=>this.setStatus(v),retry:()=>{this.connectInternal($).catch((v)=>{let U=F$({value:v});$.log.error({action:"reconnect.unhandled",message:x({error:U}),error:U}),this.setStatus("disconnected")})}})}};class M0 extends Error{constructor($,v){super($);if(this.name=new.target.name,v?.cause!==void 0)Object.defineProperty(this,"cause",{value:v.cause,enumerable:!1})}}class _0 extends M0{channel;code="channel-not-found";constructor($,v){super(`channel not found: ${$}`,v);this.channel=$}}class iJ extends M0{channel;code="channel-already-exists";constructor($,v){super(`channel already exists: ${$}`,v);this.channel=$}}class HI extends M0{channel;connector;code="connector-not-found";constructor($,v,U){super(`connector not found in ${$}: ${v}`,U);this.channel=$;this.connector=v}}class F0 extends M0{connector;detail;code="auth-failed";constructor($,v,U){super(`${$}: auth failed \u2014 ${v}`,U);this.connector=$;this.detail=v}}var wp=["type","subtype","user","bot_id","text","ts","thread_ts","channel","channel_type","files","attachments"],gp=["id","name","mimetype","filetype","size","url_private","permalink"],Jp=["title","text","fallback"],xJ=($)=>{return typeof $==="object"&&$!==null&&!Array.isArray($)},iL=($,v)=>{let U={};for(let I of v)if($[I]!==void 0)U[I]=$[I];return U},Xp=($)=>{return Object.keys($).some((v)=>v.startsWith("thumb")||v.startsWith("preview"))},Wp=($)=>{if(!xJ($))return $;let v=iL($,gp);if(Xp($))v._funnel_omitted=["thumb_*"];return v},xL=($)=>{if(!xJ($))return"";let v=$.text;if(typeof v==="string")return v;let U=$.elements;if(!Array.isArray(U))return"";return U.map(xL).join("")},Gp=($)=>{if(!Array.isArray($))return"";return $.map(xL).join("\t")},Op=($)=>{if(!xJ($))return"";if($.type==="table"&&Array.isArray($.rows))return $.rows.map(Gp).join(`
309
309
  `);return xL($)},Hp=($)=>{return $.map(Op).filter((v)=>v.length>0).join(`
310
310
  `)},zp=($)=>{if(!xJ($))return $;let v=iL($,Jp),U=$.blocks;if(Array.isArray(U)){let I=Hp(U),b=typeof v.text==="string"?v.text:"";v.text=b?`${b}
311
311
  ${I}`:I,v._funnel_omitted=["blocks"]}return v},l_=($)=>{let v=iL($,wp);if(Array.isArray(v.files))v.files=v.files.map(Wp);if(Array.isArray(v.attachments))v.attachments=v.attachments.map(zp);return v};var Qp=new Set(["message","app_mention"]),Yp=new Set([void 0,"thread_broadcast","bot_message","file_share"]),Vp=1e4,X4=($,v)=>{let U=$[v];return typeof U==="string"?U:void 0};class lL{ownBotUserId;ownBotId;minify;now;dedup=new Map;constructor($){this.ownBotUserId=$.ownBotUserId,this.ownBotId=$.ownBotId,this.minify=$.minify??!0,this.now=$.now??(()=>Date.now())}process($){let v=X4($,"type");if(!v||!Qp.has(v))return{skip:!0,reason:"skip:type"};let U=X4($,"subtype");if(!Yp.has(U))return{skip:!0,reason:"skip:subtype"};let I=X4($,"channel")??"",b=X4($,"event_ts")??X4($,"ts")??"",D=`${I}:${b}`,u=this.now();if(this.dedup.has(D))return{skip:!0,reason:"skip:dedup"};this.dedup.set(D,u);for(let Y of this.dedup.keys())if((this.dedup.get(Y)??0)<u-Vp)this.dedup.delete(Y);let w=X4($,"user"),g=X4($,"bot_id");if(w===this.ownBotUserId)return{skip:!0,reason:"skip:self-user"};if(g===this.ownBotId)return{skip:!0,reason:"skip:self-bot"};let J=X4($,"text")??"",X=J.includes(`<@${this.ownBotUserId}>`),W=X4($,"thread_ts")??X4($,"ts")??"",G=X4($,"ts")??"",O=v==="app_mention"?"app_mention":"message",z=this.minify?l_($):$;return{skip:!1,event:{kind:"message",channel:I,user:w??"",rawText:J,text:Lp(J,this.ownBotUserId),threadTs:W,ts:G,isThreadRoot:W===G,mentioned:X,source:O},content:JSON.stringify(z),meta:{event_type:"slack",channel_id:I,user_id:w??"",mentioned:String(X),thread_ts:W},shouldReact:X,channel:I,timestamp:G}}}var Lp=($,v)=>$.replace(new RegExp(`<@${v}>`,"g"),"").trim();var Kp=H.object({ok:H.boolean(),user_id:H.string().optional(),bot_id:H.string().optional(),error:H.string().optional()}),qp="https://slack.com/api/auth.test";class fL extends Cb{config;env;flumeDeps;http;signal;preprocessEvent;onInteractive;processor=null;botToken="";constructor($){super({type:"slack",connectorId:$.config.id,channelId:$.channelId??null,logger:$.logger,diagnosticLog:$.diagnosticLog});this.config=$.config,this.env=$.env??process.env,this.flumeDeps=$.flumeDeps??{},this.http=$.http??new g4,this.signal=$.signal,this.preprocessEvent=$.preprocessEvent,this.onInteractive=$.onInteractive}async start($){this.diagnostics.recordConnection("started","");let v,U;try{v=o4({literal:this.config.appToken,envVar:this.config.appTokenEnv,env:this.env,label:`${this.config.name}.appToken`}),U=o4({literal:this.config.botToken,envVar:this.config.botTokenEnv,env:this.env,label:`${this.config.name}.botToken`})}catch(D){throw this.diagnostics.recordConnection("auth-failed",T$(D)),D}this.botToken=U;let I=await this.callAuthTest();if(!I.ok){let D=I.error??"auth.test returned ok=false";throw this.diagnostics.recordConnection("auth-failed",D),new F0(this.config.name,D)}this.processor=new lL({ownBotUserId:I.user_id??"",ownBotId:I.bot_id??"",minify:this.config.minify});let b=new x_({appToken:v,botToken:this.botToken});await this.runStart({source:b,onLog:OI(this.logger),deps:GI(this.flumeDeps),signal:this.signal,onEvent:(D)=>{if(D.source!=="slack")return Promise.resolve();return this.handleEvent(D,$)}})}onStop(){this.processor=null}async handleInteractive($){let v=crypto.randomUUID(),U=JSON.stringify($);if(this.diagnostics.recordRaw(v,U),!this.onInteractive){this.diagnostics.recordProcessed(v,"skip:no-interactive-handler","");return}let I=typeof $.type==="string"?$.type:"unknown";try{await this.onInteractive($),this.diagnostics.recordProcessed(v,`interactive:${I}`,"")}catch(b){let D=T$(b);this.diagnostics.recordProcessed(v,`interactive-error:${I}`,D),this.logger?.error(`slack interactive handler error (${I})`,{error:D})}}async callAuthTest(){let $;try{$=await(await this.http.fetch({method:"POST",url:qp,headers:{Authorization:`Bearer ${this.botToken}`,"Content-Type":"application/x-www-form-urlencoded"}})).text()}catch(U){throw this.diagnostics.recordConnection("auth-failed",T$(U)),U}let v=Kp.safeParse(f_($));if(!v.success)return{ok:!1,error:`non-JSON auth.test response: ${$.slice(0,200)}`};return v.data}async handleEvent($,v){if(!this.processor)return;if($.type==="interactive"){await this.handleInteractive($.data);return}let U=$.data.event;if(!Bp(U)){let w=crypto.randomUUID();this.diagnostics.recordRaw(w,JSON.stringify($.data)),this.diagnostics.recordProcessed(w,"skip:non-object-event","");return}let I=crypto.randomUUID(),b=JSON.stringify(U);this.diagnostics.recordRaw(I,b);let D=U;if(this.preprocessEvent){let w=await this.preprocessEvent(U);if(w===null){this.diagnostics.recordProcessed(I,"skip:preprocess",b);return}D=w}let u=this.processor.process(D);if(u.skip){this.diagnostics.recordProcessed(I,u.reason,b);return}await this.deliver(v,I,b,u.content,u.meta,u.shouldReact)}async deliver($,v,U,I,b,D){try{await $(I,b)}catch(u){this.diagnostics.recordProcessed(v,"emitted:delivery-failed",I||U),this.logger?.error("slack notify error",{error:T$(u)});return}if(this.diagnostics.recordProcessed(v,"emitted",I),D)this.postReaction(b).catch((u)=>{this.diagnostics.recordProcessed(v,"emitted:reaction-failed",T$(u)),this.logger?.warn("slack reaction failed",{error:T$(u)})})}async postReaction($){let v=await this.http.fetch({method:"POST",url:"https://slack.com/api/reactions.add",headers:{Authorization:`Bearer ${this.botToken}`,"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({channel:$.channel_id??"",timestamp:$.thread_ts??"",name:"eyes"}).toString()}),U=await v.text(),I=Pp(U);if(!I.ok)throw Error(`slack reactions.add: ${I.error??`status=${v.status}`}`)}}var Bp=($)=>typeof $==="object"&&$!==null&&!Array.isArray($),f_=($)=>{try{return JSON.parse($)}catch{return null}},Ap=H.object({ok:H.boolean(),error:H.string().optional()}),Pp=($)=>{let v=Ap.safeParse(f_($));if(!v.success)return{ok:!1,error:`non-JSON response: ${$.slice(0,200)}`};return v.data};var y_=($={})=>({type:"slack",toolExposed:!0,createListener(v,U){let I=v6.parse(v);return new fL({config:I,channelId:U.channelId,logger:U.logger,diagnosticLog:U.diagnosticLog,http:U.http,signal:U.signal,preprocessEvent:$.preprocessEvent,onInteractive:$.onInteractive})},createAdapter(v,U){return new rL({config:v6.parse(v),http:U.http})},secretTokens(v){let U=v6.parse(v);return[U.botToken,U.appToken].filter((I)=>I!==void 0)},buildConfig(v,U){return v6.parse({id:U.id,type:"slack",name:v.name,...typeof v.botToken==="string"?{botToken:v.botToken}:{},...typeof v.appToken==="string"?{appToken:v.appToken}:{},...typeof v.botTokenEnv==="string"?{botTokenEnv:v.botTokenEnv}:{},...typeof v.appTokenEnv==="string"?{appTokenEnv:v.appTokenEnv}:{},minify:typeof v.minify==="boolean"?v.minify:!0,createdAt:U.now,updatedAt:U.now})},applyUpdate(v,U,I){let b=v6.parse(v);return v6.parse({id:b.id,name:b.name,type:"slack",minify:b.minify,createdAt:b.createdAt,updatedAt:I.now,...ib("botToken","botTokenEnv",U,b),...ib("appToken","appTokenEnv",U,b)})},operations:{}});var lJ=()=>[y_(),Z_(),S_(),C_()];import{existsSync as q9$,readFileSync as B9$}from"fs";import{homedir as A9$}from"os";import{join as Kx}from"path";var DA$=Object.freeze({status:"aborted"});function M($,v,U){function I(w,g){if(!w._zod)Object.defineProperty(w,"_zod",{value:{def:g,constr:u,traits:new Set},enumerable:!1});if(w._zod.traits.has($))return;w._zod.traits.add($),v(w,g);let J=u.prototype,X=Object.keys(J);for(let W=0;W<X.length;W++){let G=X[W];if(!(G in w))w[G]=J[G].bind(w)}}let b=U?.Parent??Object;class D extends b{}Object.defineProperty(D,"name",{value:$});function u(w){var g;let J=U?.Parent?new D:this;I(J,w),(g=J._zod).deferred??(g.deferred=[]);for(let X of J._zod.deferred)X();return J}return Object.defineProperty(u,"init",{value:I}),Object.defineProperty(u,Symbol.hasInstance,{value:(w)=>{if(U?.Parent&&w instanceof U.Parent)return!0;return w?._zod?.traits?.has($)}}),Object.defineProperty(u,"name",{value:$}),u}var uA$=Symbol("zod_brand");class b6 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Z0 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var fJ={};function $4($){if($)Object.assign(fJ,$);return fJ}var L$={};e$(L$,{unwrapMessage:()=>T0,uint8ArrayToHex:()=>dp,uint8ArrayToBase64url:()=>op,uint8ArrayToBase64:()=>p_,stringifyPrimitive:()=>cJ,slugify:()=>mL,shallowClone:()=>m_,safeExtend:()=>lp,required:()=>hp,randomString:()=>Ep,propertyKeyTypes:()=>oL,promiseAllObject:()=>kp,primitiveTypes:()=>c_,prefixIssues:()=>D6,pick:()=>Cp,partial:()=>yp,parsedType:()=>pL,optionalKeys:()=>tL,omit:()=>ip,objectClone:()=>Fp,numKeys:()=>Rp,nullish:()=>E0,normalizeParams:()=>a,mergeDefs:()=>U6,merge:()=>fp,jsonStringifyReplacer:()=>zI,joinValues:()=>yJ,issue:()=>YI,isPlainObject:()=>f6,isObject:()=>xb,hexToUint8Array:()=>tp,getSizableOrigin:()=>t_,getParsedType:()=>np,getLengthableOrigin:()=>n0,getEnumValues:()=>k0,getElementAtPath:()=>Tp,floatSafeRemainder:()=>hL,finalizeIssue:()=>G4,extend:()=>xp,escapeRegex:()=>I6,esc:()=>hJ,defineLazy:()=>K$,createTransparentProxy:()=>rp,cloneDef:()=>Zp,clone:()=>W4,cleanRegex:()=>R0,cleanEnum:()=>mp,captureStackTrace:()=>mJ,cached:()=>QI,base64urlToUint8Array:()=>cp,base64ToUint8Array:()=>d_,assignProp:()=>l6,assertNotEqual:()=>Np,assertNever:()=>Mp,assertIs:()=>Sp,assertEqual:()=>jp,assert:()=>_p,allowsEval:()=>cL,aborted:()=>y6,NUMBER_FORMAT_RANGES:()=>dL,Class:()=>a_,BIGINT_FORMAT_RANGES:()=>o_});function jp($){return $}function Np($){return $}function Sp($){}function Mp($){throw Error("Unexpected value in exhaustive check")}function _p($){}function k0($){let v=Object.values($).filter((I)=>typeof I==="number");return Object.entries($).filter(([I,b])=>v.indexOf(+I)===-1).map(([I,b])=>b)}function yJ($,v="|"){return $.map((U)=>cJ(U)).join(v)}function zI($,v){if(typeof v==="bigint")return v.toString();return v}function QI($){return{get value(){{let U=$();return Object.defineProperty(this,"value",{value:U}),U}throw Error("cached value already set")}}}function E0($){return $===null||$===void 0}function R0($){let v=$.startsWith("^")?1:0,U=$.endsWith("$")?$.length-1:$.length;return $.slice(v,U)}function hL($,v){let U=($.toString().split(".")[1]||"").length,I=v.toString(),b=(I.split(".")[1]||"").length;if(b===0&&/\d?e-\d?/.test(I)){let g=I.match(/\d?e-(\d?)/);if(g?.[1])b=Number.parseInt(g[1])}let D=U>b?U:b,u=Number.parseInt($.toFixed(D).replace(".","")),w=Number.parseInt(v.toFixed(D).replace(".",""));return u%w/10**D}var h_=Symbol("evaluating");function K$($,v,U){let I=void 0;Object.defineProperty($,v,{get(){if(I===h_)return;if(I===void 0)I=h_,I=U();return I},set(b){Object.defineProperty($,v,{value:b})},configurable:!0})}function Fp($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function l6($,v,U){Object.defineProperty($,v,{value:U,writable:!0,enumerable:!0,configurable:!0})}function U6(...$){let v={};for(let U of $){let I=Object.getOwnPropertyDescriptors(U);Object.assign(v,I)}return Object.defineProperties({},v)}function Zp($){return U6($._zod.def)}function Tp($,v){if(!v)return $;return v.reduce((U,I)=>U?.[I],$)}function kp($){let v=Object.keys($),U=v.map((I)=>$[I]);return Promise.all(U).then((I)=>{let b={};for(let D=0;D<v.length;D++)b[v[D]]=I[D];return b})}function Ep($=10){let U="";for(let I=0;I<$;I++)U+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return U}function hJ($){return JSON.stringify($)}function mL($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mJ="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function xb($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var cL=QI(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function f6($){if(xb($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let U=v.prototype;if(xb(U)===!1)return!1;if(Object.prototype.hasOwnProperty.call(U,"isPrototypeOf")===!1)return!1;return!0}function m_($){if(f6($))return{...$};if(Array.isArray($))return[...$];return $}function Rp($){let v=0;for(let U in $)if(Object.prototype.hasOwnProperty.call($,U))v++;return v}var np=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},oL=new Set(["string","number","symbol"]),c_=new Set(["string","number","bigint","boolean","symbol","undefined"]);function I6($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W4($,v,U){let I=new $._zod.constr(v??$._zod.def);if(!v||U?.parent)I._zod.parent=$;return I}function a($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function rp($){let v;return new Proxy({},{get(U,I,b){return v??(v=$()),Reflect.get(v,I,b)},set(U,I,b,D){return v??(v=$()),Reflect.set(v,I,b,D)},has(U,I){return v??(v=$()),Reflect.has(v,I)},deleteProperty(U,I){return v??(v=$()),Reflect.deleteProperty(v,I)},ownKeys(U){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(U,I){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,I)},defineProperty(U,I,b){return v??(v=$()),Reflect.defineProperty(v,I,b)}})}function cJ($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function tL($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var dL={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},o_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Cp($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let D=U6($._zod.def,{get shape(){let u={};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;u[w]=U.shape[w]}return l6(this,"shape",u),u},checks:[]});return W4($,D)}function ip($,v){let U=$._zod.def,I=U.checks;if(I&&I.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let D=U6($._zod.def,{get shape(){let u={...$._zod.def.shape};for(let w in v){if(!(w in U.shape))throw Error(`Unrecognized key: "${w}"`);if(!v[w])continue;delete u[w]}return l6(this,"shape",u),u},checks:[]});return W4($,D)}function xp($,v){if(!f6(v))throw Error("Invalid input to extend: expected a plain object");let U=$._zod.def.checks;if(U&&U.length>0){let D=$._zod.def.shape;for(let u in v)if(Object.getOwnPropertyDescriptor(D,u)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let b=U6($._zod.def,{get shape(){let D={...$._zod.def.shape,...v};return l6(this,"shape",D),D}});return W4($,b)}function lp($,v){if(!f6(v))throw Error("Invalid input to safeExtend: expected a plain object");let U=U6($._zod.def,{get shape(){let I={...$._zod.def.shape,...v};return l6(this,"shape",I),I}});return W4($,U)}function fp($,v){let U=U6($._zod.def,{get shape(){let I={...$._zod.def.shape,...v._zod.def.shape};return l6(this,"shape",I),I},get catchall(){return v._zod.def.catchall},checks:[]});return W4($,U)}function yp($,v,U){let b=v._zod.def.checks;if(b&&b.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let u=U6(v._zod.def,{get shape(){let w=v._zod.def.shape,g={...w};if(U)for(let J in U){if(!(J in w))throw Error(`Unrecognized key: "${J}"`);if(!U[J])continue;g[J]=$?new $({type:"optional",innerType:w[J]}):w[J]}else for(let J in w)g[J]=$?new $({type:"optional",innerType:w[J]}):w[J];return l6(this,"shape",g),g},checks:[]});return W4(v,u)}function hp($,v,U){let I=U6(v._zod.def,{get shape(){let b=v._zod.def.shape,D={...b};if(U)for(let u in U){if(!(u in D))throw Error(`Unrecognized key: "${u}"`);if(!U[u])continue;D[u]=new $({type:"nonoptional",innerType:b[u]})}else for(let u in b)D[u]=new $({type:"nonoptional",innerType:b[u]});return l6(this,"shape",D),D}});return W4(v,I)}function y6($,v=0){if($.aborted===!0)return!0;for(let U=v;U<$.issues.length;U++)if($.issues[U]?.continue!==!0)return!0;return!1}function D6($,v){return v.map((U)=>{var I;return(I=U).path??(I.path=[]),U.path.unshift($),U})}function T0($){return typeof $==="string"?$:$?.message}function G4($,v,U){let I={...$,path:$.path??[]};if(!$.message){let b=T0($.inst?._zod.def?.error?.($))??T0(v?.error?.($))??T0(U.customError?.($))??T0(U.localeError?.($))??"Invalid input";I.message=b}if(delete I.inst,delete I.continue,!v?.reportInput)delete I.input;return I}function t_($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function n0($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function pL($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let U=$;if(U&&Object.getPrototypeOf(U)!==Object.prototype&&"constructor"in U&&U.constructor)return U.constructor.name}}return v}function YI(...$){let[v,U,I]=$;if(typeof v==="string")return{message:v,code:"custom",input:U,inst:I};return{...v}}function mp($){return Object.entries($).filter(([v,U])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function d_($){let v=atob($),U=new Uint8Array(v.length);for(let I=0;I<v.length;I++)U[I]=v.charCodeAt(I);return U}function p_($){let v="";for(let U=0;U<$.length;U++)v+=String.fromCharCode($[U]);return btoa(v)}function cp($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),U="=".repeat((4-v.length%4)%4);return d_(v+U)}function op($){return p_($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function tp($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let U=new Uint8Array(v.length/2);for(let I=0;I<v.length;I+=2)U[I/2]=Number.parseInt(v.slice(I,I+2),16);return U}function dp($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class a_{constructor(...$){}}var e_=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,zI,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},oJ=M("$ZodError",e_),aL=M("$ZodError",e_,{Parent:Error});function s_($,v=(U)=>U.message){let U={},I=[];for(let b of $.issues)if(b.path.length>0)U[b.path[0]]=U[b.path[0]]||[],U[b.path[0]].push(v(b));else I.push(v(b));return{formErrors:I,fieldErrors:U}}function $F($,v=(U)=>U.message){let U={_errors:[]},I=(b)=>{for(let D of b.issues)if(D.code==="invalid_union"&&D.errors.length)D.errors.map((u)=>I({issues:u}));else if(D.code==="invalid_key")I({issues:D.issues});else if(D.code==="invalid_element")I({issues:D.issues});else if(D.path.length===0)U._errors.push(v(D));else{let u=U,w=0;while(w<D.path.length){let g=D.path[w];if(w!==D.path.length-1)u[g]=u[g]||{_errors:[]};else u[g]=u[g]||{_errors:[]},u[g]._errors.push(v(D));u=u[g],w++}}};return I($),U}var tJ=($)=>(v,U,I,b)=>{let D=I?Object.assign(I,{async:!1}):{async:!1},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)throw new b6;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>G4(g,D,$4())));throw mJ(w,b?.callee),w}return u.value};var dJ=($)=>async(v,U,I,b)=>{let D=I?Object.assign(I,{async:!0}):{async:!0},u=v._zod.run({value:U,issues:[]},D);if(u instanceof Promise)u=await u;if(u.issues.length){let w=new(b?.Err??$)(u.issues.map((g)=>G4(g,D,$4())));throw mJ(w,b?.callee),w}return u.value};var r0=($)=>(v,U,I)=>{let b=I?{...I,async:!1}:{async:!1},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)throw new b6;return D.issues.length?{success:!1,error:new($??oJ)(D.issues.map((u)=>G4(u,b,$4())))}:{success:!0,data:D.value}},C0=r0(aL),i0=($)=>async(v,U,I)=>{let b=I?Object.assign(I,{async:!0}):{async:!0},D=v._zod.run({value:U,issues:[]},b);if(D instanceof Promise)D=await D;return D.issues.length?{success:!1,error:new $(D.issues.map((u)=>G4(u,b,$4())))}:{success:!0,data:D.value}},pJ=i0(aL),vF=($)=>(v,U,I)=>{let b=I?Object.assign(I,{direction:"backward"}):{direction:"backward"};return tJ($)(v,U,b)};var bF=($)=>(v,U,I)=>{return tJ($)(v,U,I)};var UF=($)=>async(v,U,I)=>{let b=I?Object.assign(I,{direction:"backward"}):{direction:"backward"};return dJ($)(v,U,b)};var IF=($)=>async(v,U,I)=>{return dJ($)(v,U,I)};var DF=($)=>(v,U,I)=>{let b=I?Object.assign(I,{direction:"backward"}):{direction:"backward"};return r0($)(v,U,b)};var uF=($)=>(v,U,I)=>{return r0($)(v,U,I)};var wF=($)=>async(v,U,I)=>{let b=I?Object.assign(I,{direction:"backward"}):{direction:"backward"};return i0($)(v,U,b)};var gF=($)=>async(v,U,I)=>{return i0($)(v,U,I)};var JF=/^[cC][^\s-]{8,}$/,XF=/^[0-9a-z]+$/,WF=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,GF=/^[0-9a-vA-V]{20}$/,OF=/^[A-Za-z0-9]{27}$/,HF=/^[a-zA-Z0-9_-]{21}$/,zF=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var QF=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,eL=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var YF=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ap="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function VF(){return new RegExp(ap,"u")}var LF=/^(?:(?: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])$/,KF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var qF=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,BF=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,AF=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,sL=/^[A-Za-z0-9_-]*$/;var PF=/^\+[1-9]\d{6,14}$/,jF="(?:(?:\\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])))",NF=new RegExp(`^${jF}$`);function SF($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function MF($){return new RegExp(`^${SF($)}$`)}function _F($){let v=SF({precision:$.precision}),U=["Z"];if($.local)U.push("");if($.offset)U.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let I=`${v}(?:${U.join("|")})`;return new RegExp(`^${jF}T(?:${I})$`)}var FF=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)};var ZF=/^-?\d+$/,aJ=/^-?\d+(?:\.\d+)?$/,TF=/^(?:true|false)$/i,kF=/^null$/i;var EF=/^[^A-Z]*$/,RF=/^[^a-z]*$/;var wv=M("$ZodCheck",($,v)=>{var U;$._zod??($._zod={}),$._zod.def=v,(U=$._zod).onattach??(U.onattach=[])}),nF={number:"number",bigint:"bigint",object:"date"},$K=M("$ZodCheckLessThan",($,v)=>{wv.init($,v);let U=nF[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.maximum:b.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<D)if(v.inclusive)b.maximum=v.value;else b.exclusiveMaximum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value<=v.value:I.value<v.value)return;I.issues.push({origin:U,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),vK=M("$ZodCheckGreaterThan",($,v)=>{wv.init($,v);let U=nF[typeof v.value];$._zod.onattach.push((I)=>{let b=I._zod.bag,D=(v.inclusive?b.minimum:b.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>D)if(v.inclusive)b.minimum=v.value;else b.exclusiveMinimum=v.value}),$._zod.check=(I)=>{if(v.inclusive?I.value>=v.value:I.value>v.value)return;I.issues.push({origin:U,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:I.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),rF=M("$ZodCheckMultipleOf",($,v)=>{wv.init($,v),$._zod.onattach.push((U)=>{var I;(I=U._zod.bag).multipleOf??(I.multipleOf=v.value)}),$._zod.check=(U)=>{if(typeof U.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof U.value==="bigint"?U.value%v.value===BigInt(0):hL(U.value,v.value)===0)return;U.issues.push({origin:typeof U.value,code:"not_multiple_of",divisor:v.value,input:U.value,inst:$,continue:!v.abort})}}),CF=M("$ZodCheckNumberFormat",($,v)=>{wv.init($,v),v.format=v.format||"float64";let U=v.format?.includes("int"),I=U?"int":"number",[b,D]=dL[v.format];$._zod.onattach.push((u)=>{let w=u._zod.bag;if(w.format=v.format,w.minimum=b,w.maximum=D,U)w.pattern=ZF}),$._zod.check=(u)=>{let w=u.value;if(U){if(!Number.isInteger(w)){u.issues.push({expected:I,format:v.format,code:"invalid_type",continue:!1,input:w,inst:$});return}if(!Number.isSafeInteger(w)){if(w>0)u.issues.push({input:w,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});else u.issues.push({input:w,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:I,inclusive:!0,continue:!v.abort});return}}if(w<b)u.issues.push({origin:"number",input:w,code:"too_small",minimum:b,inclusive:!0,inst:$,continue:!v.abort});if(w>D)u.issues.push({origin:"number",input:w,code:"too_big",maximum:D,inclusive:!0,inst:$,continue:!v.abort})}});var iF=M("$ZodCheckMaxLength",($,v)=>{var U;wv.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!E0(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<b)I._zod.bag.maximum=v.maximum}),$._zod.check=(I)=>{let b=I.value;if(b.length<=v.maximum)return;let u=n0(b);I.issues.push({origin:u,code:"too_big",maximum:v.maximum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),xF=M("$ZodCheckMinLength",($,v)=>{var U;wv.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!E0(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>b)I._zod.bag.minimum=v.minimum}),$._zod.check=(I)=>{let b=I.value;if(b.length>=v.minimum)return;let u=n0(b);I.issues.push({origin:u,code:"too_small",minimum:v.minimum,inclusive:!0,input:b,inst:$,continue:!v.abort})}}),lF=M("$ZodCheckLengthEquals",($,v)=>{var U;wv.init($,v),(U=$._zod.def).when??(U.when=(I)=>{let b=I.value;return!E0(b)&&b.length!==void 0}),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.minimum=v.length,b.maximum=v.length,b.length=v.length}),$._zod.check=(I)=>{let b=I.value,D=b.length;if(D===v.length)return;let u=n0(b),w=D>v.length;I.issues.push({origin:u,...w?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:I.value,inst:$,continue:!v.abort})}}),x0=M("$ZodCheckStringFormat",($,v)=>{var U,I;if(wv.init($,v),$._zod.onattach.push((b)=>{let D=b._zod.bag;if(D.format=v.format,v.pattern)D.patterns??(D.patterns=new Set),D.patterns.add(v.pattern)}),v.pattern)(U=$._zod).check??(U.check=(b)=>{if(v.pattern.lastIndex=0,v.pattern.test(b.value))return;b.issues.push({origin:"string",code:"invalid_format",format:v.format,input:b.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(I=$._zod).check??(I.check=()=>{})}),fF=M("$ZodCheckRegex",($,v)=>{x0.init($,v),$._zod.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:"regex",input:U.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),yF=M("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=EF),x0.init($,v)}),hF=M("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=RF),x0.init($,v)}),mF=M("$ZodCheckIncludes",($,v)=>{wv.init($,v);let U=I6(v.includes),I=new RegExp(typeof v.position==="number"?`^.{${v.position}}${U}`:U);v.pattern=I,$._zod.onattach.push((b)=>{let D=b._zod.bag;D.patterns??(D.patterns=new Set),D.patterns.add(I)}),$._zod.check=(b)=>{if(b.value.includes(v.includes,v.position))return;b.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:b.value,inst:$,continue:!v.abort})}}),cF=M("$ZodCheckStartsWith",($,v)=>{wv.init($,v);let U=new RegExp(`^${I6(v.prefix)}.*`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.startsWith(v.prefix))return;I.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:I.value,inst:$,continue:!v.abort})}}),oF=M("$ZodCheckEndsWith",($,v)=>{wv.init($,v);let U=new RegExp(`.*${I6(v.suffix)}$`);v.pattern??(v.pattern=U),$._zod.onattach.push((I)=>{let b=I._zod.bag;b.patterns??(b.patterns=new Set),b.patterns.add(U)}),$._zod.check=(I)=>{if(I.value.endsWith(v.suffix))return;I.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:I.value,inst:$,continue:!v.abort})}});var tF=M("$ZodCheckOverwrite",($,v)=>{wv.init($,v),$._zod.check=(U)=>{U.value=v.tx(U.value)}});class bK{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let U=$.split(`