@yukino.js/yukino 0.0.19 → 0.0.21-dev

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 (44) hide show
  1. package/README.md +36 -65
  2. package/dist/anthropic-LB4T3BEN.js +4 -0
  3. package/dist/browser/dist/index.html +2 -2
  4. package/dist/browser/dist/static/chunk-3HWUJ4KR.js +1 -0
  5. package/dist/browser/dist/static/{highlight-ZDY7K2CR.js → highlight-KNDEBJWF.js} +10 -10
  6. package/dist/browser/dist/static/index.css +1 -1
  7. package/dist/browser/dist/static/index.js +40 -40
  8. package/dist/chunk-2N7OIUQW.js +884 -0
  9. package/dist/{chunk-QDMUFOED.js → chunk-57IGGFHK.js} +6 -6
  10. package/dist/chunk-5AOJ5ZSQ.js +30 -0
  11. package/dist/chunk-5D3QKHYQ.js +36 -0
  12. package/dist/{chunk-PYFRT6N5.js → chunk-7WP7SERS.js} +1 -1
  13. package/dist/{chunk-S56AXDDN.js → chunk-EQABLL4S.js} +1 -1
  14. package/dist/{chunk-UX5DJPHN.js → chunk-P6K7EQHF.js} +29 -29
  15. package/dist/{chunk-WGRGSG2J.js → chunk-QSKJBSCI.js} +1 -1
  16. package/dist/chunk-WKTO7XPO.js +4 -0
  17. package/dist/lib/{anthropic-I7ZSAP7Z.js → anthropic-TYBMDJP3.js} +3 -3
  18. package/dist/lib/{chunk-T4WEXOQ7.js → chunk-3QGT2MSI.js} +1 -83
  19. package/dist/lib/{chunk-MJHQUFUL.js → chunk-IPKULHXR.js} +2 -2
  20. package/dist/lib/{chunk-UU6ZV6GB.js → chunk-NIUCGP4C.js} +82 -241
  21. package/dist/lib/{chunk-TO34ITLQ.js → chunk-OPEO6D4O.js} +2 -5
  22. package/dist/lib/chunk-XVXFUSSS.js +217 -0
  23. package/dist/lib/index.d.ts +1024 -1720
  24. package/dist/lib/index.js +5859 -9076
  25. package/dist/lib/{openai-Y4P7SWUB.js → openai-Z2JCYL6F.js} +3 -3
  26. package/dist/lib/{chunk-YZURLYHG.js → providers-2NPR2VR4.js} +28 -207
  27. package/dist/{main-MHJXHOY6.js → main-OMIZDIYB.js} +211 -275
  28. package/dist/main.js +4 -6
  29. package/dist/{openai-3IGA2BCD.js → openai-UOCUBMFA.js} +1 -1
  30. package/dist/{chunk-7WYSSZKU.js → providers-G5SKN22T.js} +9 -9
  31. package/dist/server-ESDMJACZ.js +14 -0
  32. package/dist/server-Z742CQSK.js +4 -0
  33. package/package.json +4 -6
  34. package/dist/anthropic-D72CIYEQ.js +0 -4
  35. package/dist/chunk-676RWZYX.js +0 -38
  36. package/dist/chunk-A4IB5PNW.js +0 -8
  37. package/dist/chunk-BCYFGWSM.js +0 -30
  38. package/dist/chunk-DGDF5PBF.js +0 -869
  39. package/dist/lib/providers-MRGAAMBB.js +0 -10
  40. package/dist/providers-GRYPIKCY.js +0 -4
  41. package/dist/server-XBVP3S5Q.js +0 -4
  42. package/dist/server-ZYP54JBK.js +0 -15
  43. package/dist/stdio-UHDEALLA.js +0 -5
  44. package/dist/websocket-J5DE5FRQ.js +0 -9
@@ -62,4 +62,4 @@ ${s}`:s:"",l=Function,d=`return (input) => {
62
62
  ${s}
63
63
  }`,f;try{f=new l(...a,d)(...u)}catch(m){throw new N(`this schema (generated code failed to evaluate: ${m.message})`)}return r?.debug&&(f.code=c),f.definite=o.definite,f}function S(e,r){for(let[o,t]of e.constants)if(t===r)return o;let i=`c${e.constantCounter++}`;return e.constants.set(i,r),i}function Je(e,r){return e.definite=!1,S(e,r)}function w(e){return`v${e.varCounter++}`}function $$(e,r){let i=e._zod.run({value:r,issues:[]},{});if(i&&typeof i.then=="function")return H;let o=i;return o.issues.length===0?o.value:H}function X(e,r,i,o,t=!0){let n=e.content.length,a=r.constants.size,u=r.constantCounter,s=r.varCounter;try{return R(e,r,i,o,t)}catch(c){if(!(c instanceof N)||!c.islandable)throw c;if(e.content.length=n,r.constants.size>a){let l=Array.from(r.constants.keys()).slice(a);for(let d of l)r.constants.delete(d)}return r.constantCounter=u,r.varCounter=s,h$(e,r,i,o)}}function h$(e,r,i,o){r.definite=!1;let t=S(r,i),n=S(r,$$),a=w(r);return e.write(`const ${a} = ${n}(${t}, ${o});`),e.write(`if (${a} === INVALID) return INVALID;`),a}var y$=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function _$(e,r,i,o){let t=i._zod.def.checks;if(!t||t.length===0)return o;let n=o;for(let a of t){let u=a._zod.def;if(u.when&&!y$.has(u.check))throw new N('check with a custom "when" condition');switch(u.check){case"greater_than":b$(e,r,u,n);break;case"less_than":k$(e,r,u,n);break;case"multiple_of":x$(e,r,u,n);break;case"number_format":Sf(e,u,n);break;case"min_length":{let s=Se(u.minimum,"min_length"),c=Tu(e,r,n,`${n}.length >= ${s} && ${n}.length < ${u.minimum*2}`);e.write(`if (${c} < ${s}) return INVALID;`);break}case"max_length":{let s=Se(u.maximum,"max_length"),c=Tu(e,r,n,`${n}.length > ${s}`);e.write(`if (${c} > ${s}) return INVALID;`);break}case"length_equals":{let s=Se(u.length,"length_equals"),c=Tu(e,r,n,`${n}.length >= ${s} && ${n}.length <= ${u.length*2}`);e.write(`if (${c} !== ${s}) return INVALID;`);break}case"min_size":e.write(`if (${n}.size < ${Se(u.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${n}.size > ${Se(u.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${n}.size !== ${Se(u.size,"size_equals")}) return INVALID;`);break;case"string_format":n=Pf(e,r,u,n);break;case"custom":n=D$(e,r,a,n);break;case"bigint_format":I$(e,u,n);break;case"mime_type":w$(e,r,u,n);break;case"property":S$(e,r,u,n);break;case"properties":z$(e,r,u,n);break;case"overwrite":{let s=w(r);P$(e,r,a,n,s),n=s;break}default:throw new N(`check type ${u.check}`)}}return n}function Tu(e,r,i,o){let t=S(r,Le),n=w(r);return e.write(`const ${n} = typeof ${i} === "string" && ${o} ? ${t}(${i}) : ${i}.length;`),n}function Se(e,r){if(typeof e!="number"||!Number.isFinite(e))throw new N(`${r} bound of type ${typeof e}`);return`${e}`}function zf(e,r){if(typeof r=="bigint")return`${r}n`;if(typeof r=="number"){if(Number.isNaN(r))throw new N("comparison check with NaN bound");return`${r}`}if(r instanceof Date){if(Number.isNaN(r.getTime()))throw new N("comparison check with Invalid Date bound");return S(e,r)}throw new N(`comparison check bound of type ${typeof r}`)}function b$(e,r,i,o){let t=i.inclusive?"<":"<=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function k$(e,r,i,o){let t=i.inclusive?">":">=";e.write(`if (${o} ${t} ${zf(r,i.value)}) return INVALID;`)}function x$(e,r,i,o){if(typeof i.value=="bigint"){if(i.value===BigInt(0))throw new N("multiple_of check with a zero divisor");e.write(`if (${o} % ${i.value}n !== 0n) return INVALID;`)}else{let t=S(r,Mt);e.write(`if (${t}(${o}, ${Se(i.value,"multiple_of")}) !== 0) return INVALID;`)}}function Sf(e,r,i){let o=r.format;switch(o){case"safeint":e.write(`if (!Number.isSafeInteger(${i})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${i}) || ${i} < -2147483648 || ${i} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${i}) || ${i} < 0 || ${i} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${i}) || ${i} < -3.4028234663852886e38 || ${i} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${i})) return INVALID;`);break;default:throw new N(`number format ${o}`)}}function I$(e,r,i){let o=r.format;if(o)switch(o){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break;default:throw new N(`bigint format ${o}`)}}function w$(e,r,i,o){let t=i.mime;if(t&&t.length>0){let n=S(r,new Set(t));e.write(`if (!${n}.has(${o}.type)) return INVALID;`)}}function z$(e,r,i,o){if(i.when)throw new N('check with a custom "when" condition');e.write(`if (${o} == null) return INVALID;`);let t=i.shape;for(let n of Reflect.ownKeys(t)){let a=typeof n=="symbol"?S(r,n):q(n),u=w(r);e.write(`const ${u} = ${o}[${a}];`),X(e,r,t[n],u,!1)}}function S$(e,r,i,o){let t=`${o}[${JSON.stringify(i.property)}]`;R(e,r,i.schema,t)}function P$(e,r,i,o,t){let n=i._zod.def.tx;if(!n)throw new N("overwrite check without a transform function");if(Be(n))throw new fe("z.compile: async overwrite transforms are not supported");let a=S(r,n);e.write(`const ${t} = ${a}(${o});`)}function Zu(){throw new ne}function Lu(e){this.issues.push(e)}function D$(e,r,i,o){let t=i._zod.def;if(t.fn){if(Be(t.fn))throw new fe("z.compile: async .refine() predicates are not supported");let n=Je(r,t.fn),a=S(r,Zu),u=w(r);return e.write(`const ${u} = ${n}(${o});`),e.write(`if (${u} instanceof Promise) ${a}();`),e.write(`if (!${u}) return INVALID;`),o}if(i._zod.check){if(Be(i._zod.check))throw new fe("z.compile: async .superRefine() / check functions are not supported");let n=i._zod.check,u=Je(r,c=>{let l={value:c,issues:[],addIssue:Lu};return n(l)instanceof Promise&&Zu(),l.issues.length===0?l.value:H}),s=w(r);return e.write(`const ${s} = ${u}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}throw new N("custom check without a predicate or check function")}var j$=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Pf(e,r,i,o,t=!0){let n=i.format;if(n==="base64"){let c=S(r,sr);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="base64url"){let c=S(r,yn);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="jwt"){let c=S(r,kn),l=S(r,i.alg??null);return e.write(`if (!${c}(${o}, ${l})) return INVALID;`),o}if(n==="ipv6"){let c=S(r,cr);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="cidrv6"){let c=S(r,$n);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="credit_card"){let c=S(r,_n);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(n==="iban"){let c=S(r,bn);return e.write(`if (!${c}(${o})) return INVALID;`),o}let a=i;if(n==="url"||n==="httpurl"||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let c=S(r,pn),l=S(r,i),d=w(r),f=w(r);if(e.write(`const ${d} = ${o}.trim();`),e.write(`const ${f} = ${c}(${d}, ${l});`),e.write(`if (typeof ${f} === "number") return INVALID;`),a.hostname!==void 0){let _=S(r,gn);e.write(`if (!${_}(${f}, ${l}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let _=S(r,vn);e.write(`if (!${_}(${f}, ${l}.protocol)) return INVALID;`)}if(!t)return null;let m=w(r),v=a.normalize?`${f}.href`:`${S(r,ur)}(${d})`;return e.write(`const ${m} = ${v};`),m}let u=i.fn;if(u){if(Be(u))throw new N(`async string format ${n}`);let c=S(r,u);return e.write(`if (!${c}(${o})) return INVALID;`),o}if(j$.has(n)&&i.pattern){let c=S(r,i.pattern);return e.write(`${c}.lastIndex = 0;`),e.write(`if (!${c}.test(${o})) return INVALID;`),o}let s=i.format;switch(s){case"regex":throw new N("regex format without a pattern");case"lowercase":e.write(`if (${o} !== ${o}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${o} !== ${o}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${o}.includes(${q(i.includes)})) return INVALID;`);break;case"starts_with":{let c=i.prefix;e.write(`if (${o}.slice(0, ${c.length}) !== ${q(c)}) return INVALID;`);break}case"ends_with":{let c=i.suffix;e.write(`if (${o}.slice(-${c.length}) !== ${q(c)}) return INVALID;`);break}default:throw new N(`string format ${s}`)}return o}function R(e,r,i,o,t=!0){let n=i._zod.def,a=n.type;if(n.coerce)throw new N(`coercion (z.coerce.${a}())`);let u=t||!!n.checks?.length,s;switch(a){case"string":s=O$(e,r,i,o,u);break;case"number":s=N$(e,i,o);break;case"boolean":s=U$(e,o);break;case"bigint":s=A$(e,i,o);break;case"symbol":s=T$(e,o);break;case"undefined":s=Z$(e,o);break;case"null":s=E$(e,o);break;case"any":case"unknown":s=o;break;case"never":e.write("return INVALID;"),s=o;break;case"void":s=C$(e,o);break;case"nan":s=L$(e,o);break;case"date":s=V$(e,o);break;case"object":s=R$(e,r,i,o,u);break;case"optional":s=F$(e,r,i,o,u);break;case"nullable":s=B$(e,r,i,o,u);break;case"array":s=K$(e,r,i,o,u);break;case"literal":s=G$(e,r,i,o);break;case"enum":s=W$(e,r,i,o);break;case"readonly":{let c=xf(e,r,i,o),l=w(r);e.write(`const ${l} = Object.freeze(${c});`),s=l;break}case"success":xf(e,r,i,o),s="true";break;case"default":case"prefault":s=X$(e,r,i,o);break;case"nonoptional":s=q$(e,r,i,o);break;case"tuple":s=Y$(e,r,i,o);break;case"union":s=H$(e,r,i,o);break;case"intersection":s=th(e,r,i,o);break;case"record":s=rh(e,r,i,o);break;case"map":s=ih(e,r,i,o);break;case"set":s=oh(e,r,i,o);break;case"file":s=ah(e,o);break;case"template_literal":s=uh(e,r,i,o);break;case"lazy":s=ch(e,r,i,o);break;case"pipe":s=sh(e,r,i,o);break;case"custom":s=lh(e,r,i,o);break;case"transform":s=mh(e,r,i,o);break;case"catch":s=fh(e,r,i,o);break;default:throw new N(`schema type ${a}`)}return s===null?null:_$(e,r,i,s)}function O$(e,r,i,o,t=!0){e.write(`if (typeof ${o} !== "string") return INVALID;`);let n=i._zod.def;return n.format===void 0?o:Pf(e,r,n,o,t)}function N$(e,r,i){e.write(`if (typeof ${i} !== "number" || !Number.isFinite(${i})) return INVALID;`);let o=r._zod.def;return o.check==="number_format"&&o.format&&Sf(e,{format:o.format},i),i}function U$(e,r){return e.write(`if (typeof ${r} !== "boolean") return INVALID;`),r}function A$(e,r,i){e.write(`if (typeof ${i} !== "bigint") return INVALID;`);let o=r._zod.def;if(o.format)switch(o.format){case"int64":e.write(`if (${i} < -9223372036854775808n || ${i} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${i} < 0n || ${i} > 18446744073709551615n) return INVALID;`);break}return i}function T$(e,r){return e.write(`if (typeof ${r} !== "symbol") return INVALID;`),r}function Z$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function E$(e,r){return e.write(`if (${r} !== null) return INVALID;`),r}function C$(e,r){return e.write(`if (${r} !== undefined) return INVALID;`),r}function L$(e,r){return e.write(`if (typeof ${r} !== "number" || !Number.isNaN(${r})) return INVALID;`),r}function V$(e,r){return e.write(`if (!(${r} instanceof Date) || Number.isNaN(${r}.getTime())) return INVALID;`),r}function R$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (typeof ${o} !== "object" || ${o} === null || Array.isArray(${o})) return INVALID;`);let a=n.shape,u=Object.keys(a),s=Object.getOwnPropertySymbols(a),c=s.length?[...u,...s]:u,l=I=>typeof I=="symbol"?S(r,I):q(I),d=I=>typeof I=="symbol"?`[${l(I)}]`:q(I),f=a;if(u.includes("__proto__"))throw new N('object shape key "__proto__"');let m=new Map;for(let I of c){let D=f[I],A=l(I),V=w(r);if(e.write(`const ${V} = ${o}[${A}];`),D._zod.optin!==void 0){let U=w(r);e.write(`let ${U} = (() => {`),e.indented(W=>{let Rt=X(W,r,D,V);W.write(`return ${Rt};`)}),e.write("})();"),D._zod.optout==="optional"?(e.write(`if (${U} === INVALID) {`),e.indented(W=>{W.write(`if (${A} in ${o}) return INVALID;`),W.write(`${U} = undefined;`)}),e.write("}")):e.write(`if (${U} === INVALID) return INVALID;`),m.set(I,U)}else{J$(D)&&e.write(`if (!(${A} in ${o})) return INVALID;`);let U=X(e,r,D,V,t);U!==null&&m.set(I,U)}}let v=n.catchall,_="none";if(v){let I=v._zod.def.type;if(I==="never"){let D=u.map(A=>`k !== ${q(A)}`).join(" && ")||"true";e.write(`for (const k in ${o}) {`),e.indented(A=>{A.write(`if (${D}) return INVALID;`)}),e.write("}")}else(I==="unknown"||I==="any")&&!v._zod.def.checks?.length?_="passthrough":_="schema"}let k=w(r),z=c.some(I=>kf(f[I])||Eu(f[I]));if(!t){if(_==="schema"){let I=u.length>0?S(r,new Set(u)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{D.write('if (k === "__proto__") continue;'),I&&D.write(`if (${I}.has(k)) continue;`);let A=w(r);D.write(`const ${A} = ${o}[k];`),X(D,r,v,A,!1)}),e.write("}")}return null}if(z){e.write(`const ${k} = {};`);for(let I of c){let D=l(I),A=m.get(I);Eu(f[I])?e.write(`if (${D} in ${o}) ${k}[${D}] = ${A};`):kf(f[I])?e.write(`if (${A} !== undefined || ${D} in ${o}) ${k}[${D}] = ${A};`):e.write(`${k}[${D}] = ${A};`)}}else{let I=c.map(D=>`${d(D)}: ${m.get(D)}`).join(", ");e.write(`const ${k} = { ${I} };`)}if(_!=="none"){let I=u.length>0?S(r,new Set(u)):null;e.write(`for (const k in ${o}) {`),e.indented(D=>{if(D.write('if (k === "__proto__") continue;'),I&&D.write(`if (${I}.has(k)) continue;`),_==="passthrough")D.write(`${k}[k] = ${o}[k];`);else{let A=w(r);D.write(`const ${A} = ${o}[k];`);let V=X(D,r,v,A);D.write(`${k}[k] = ${V};`)}}),e.write("}")}return k}function F$(e,r,i,o,t=!0){let n=i._zod.def;if(M$(i))return R(e,r,n.innerType,o,t);if(n.innerType._zod.optin==="defaulted"){let u=w(r),s=w(r);return e.write(`let ${u};`),e.write(`if (${o} === undefined) {`),e.indented(c=>{c.write(`const ${s} = (() => {`),c.indented(l=>{let d=R(l,r,n.innerType,o);l.write(`return ${d};`)}),c.write("})();"),c.write(`if (${s} !== INVALID) ${u} = ${s};`)}),e.write("} else {"),e.indented(c=>{let l=R(c,r,n.innerType,o);c.write(`${u} = ${l};`)}),e.write("}"),u}let a=t?w(r):null;return a&&e.write(`let ${a};`),e.write(`if (${o} !== undefined) {`),e.indented(u=>{let s=R(u,r,n.innerType,o,t);a&&s!==null&&u.write(`${a} = ${s};`)}),e.write("}"),a}function M$(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function J$(e){return e._zod.optin===void 0&&Me(e)}function Me(e){if(e._zod.def.coerce)return!0;let r=e._zod.def;switch(r.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return r.innerType?Me(r.innerType):!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return r.innerType?Me(r.innerType):!0;case"catch":return!0;case"union":return r.options?r.options.some(Me):!0;case"intersection":return!r.left||!r.right?!0:Me(r.left)&&Me(r.right);case"pipe":return r.in?Me(r.in):!0;default:return!0}}function Eu(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function kf(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&vt(e)}function vt(e){let r=e._zod.def;switch(r.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!r.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return r.innerType?vt(r.innerType):!0;case"union":return r.options?r.options.some(vt):!0;case"intersection":return!r.left||!r.right||vt(r.left)||vt(r.right);case"pipe":return r.out?vt(r.out):!0;default:return!0}}function B$(e,r,i,o,t=!0){let n=i._zod.def,a=t?w(r):null;return a&&e.write(`let ${a} = null;`),e.write(`if (${o} !== null) {`),e.indented(u=>{let s=R(u,r,n.innerType,o,t);a&&s!==null&&u.write(`${a} = ${s};`)}),e.write("}"),a}function Vu(e,r,i){for(let[o,t]of at(r._zod.def.checks))e.write(`if (${i} > ${Se(o,t._zod.def.check)}) return INVALID;`)}function K$(e,r,i,o,t=!0){let n=i._zod.def;e.write(`if (!Array.isArray(${o})) return INVALID;`),Vu(e,i,`${o}.length`);let a=t?w(r):null,u=w(r),s=w(r);return a&&e.write(`const ${a} = new Array(${o}.length);`),e.write(`for (let ${u} = 0; ${u} < ${o}.length; ${u}++) {`),e.indented(c=>{c.write(`const ${s} = ${o}[${u}];`);let l=X(c,r,n.element,s,t);a&&l!==null&&c.write(`${a}[${u}] = ${l};`)}),e.write("}"),a}function G$(e,r,i,o){let n=i._zod.def.values;if(n.length!==1){let u=S(r,new Set(n));return e.write(`if (!${u}.has(${o})) return INVALID;`),o}let a=n[0];if(typeof a=="number"&&Number.isNaN(a)){let u=S(r,new Set(n));return e.write(`if (!${u}.has(${o})) return INVALID;`),o}if(typeof a=="string")e.write(`if (${o} !== ${q(a)}) return INVALID;`);else if(typeof a=="number"||typeof a=="boolean")e.write(`if (${o} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${o} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${o} !== undefined) return INVALID;`);else if(typeof a=="bigint")e.write(`if (${o} !== ${a}n) return INVALID;`);else throw new N(`literal type ${typeof a}`);return o}function W$(e,r,i,o){let t=i._zod.values;if(!t)throw new N("enum schema without enumerated values");let n=S(r,t);return e.write(`if (!${n}.has(${o})) return INVALID;`),o}function xf(e,r,i,o){let t=i._zod.def;return R(e,r,t.innerType,o)}function X$(e,r,i,o){let t=i._zod.def,a=Object.getOwnPropertyDescriptor(i._zod.def,"defaultValue")?()=>i._zod.def.defaultValue:void 0;if(i._zod.def.type==="prefault"){if(!a)return R(e,r,t.innerType,o);let s=S(r,a),c=w(r);return e.write(`let ${c} = ${o};`),e.write(`if (${o} === undefined) ${c} = ${s}();`),R(e,r,t.innerType,c)}let u=w(r);if(a){let s=S(r,a),c=S(r,Jt);e.write(`let ${u};`),e.write(`if (${o} === undefined) {`),e.indented(l=>{l.write(`${u} = ${c}(${s}());`)}),e.write("} else {"),e.indented(l=>{let d=R(l,r,t.innerType,o);l.write(`${u} = ${d} === undefined ? ${c}(${s}()) : ${d};`)}),e.write("}")}else e.write(`let ${u};`),e.write(`if (${o} !== undefined) {`),e.indented(s=>{let c=R(s,r,t.innerType,o);s.write(`${u} = ${c};`)}),e.write("}");return u}function q$(e,r,i,o){let t=i._zod.def,n=R(e,r,t.innerType,o),a=w(r);return e.write(`const ${a} = ${n};`),e.write(`if (${a} === undefined) return INVALID;`),a}function Y$(e,r,i,o){let t=i._zod.def,n=t.items,a=t.rest;e.write(`if (!Array.isArray(${o})) return INVALID;`);let u=If(n,"optin"),s=If(n,"optout");a?e.write(`if (${o}.length < ${u}) return INVALID;`):e.write(`if (${o}.length < ${u} || ${o}.length > ${n.length}) return INVALID;`);let c=w(r);e.write(`const ${c} = [];`);for(let l=0;l<n.length;l++){let d=n[l];if(l>=s)e.write(`if (${c}.length === ${l}) {`),e.indented(f=>{f.write(`if (${l} < ${o}.length) {`),f.indented(m=>{let v=w(r);m.write(`const ${v} = ${o}[${l}];`);let _=X(m,r,d,v);m.write(`${c}[${l}] = ${_};`)}),f.write("} else {"),f.indented(m=>{if(Eu(d)){m.write(`${c}.length = ${l};`);return}let v=w(r),_=w(r);m.write(`const ${v} = undefined;`),m.write(`const ${_} = (() => {`),m.indented(k=>{let z=X(k,r,d,v);k.write(`return ${z};`)}),m.write("})();"),m.write(`if (${_} === INVALID || ${_} === undefined) ${c}.length = ${l};`),m.write(`else ${c}[${l}] = ${_};`)}),f.write("}")}),e.write("}");else{let f=w(r);e.write(`const ${f} = ${o}[${l}];`);let m=X(e,r,d,f);e.write(`${c}[${l}] = ${m};`)}}if(a){let l=w(r),d=w(r);e.write(`for (let ${l} = ${n.length}; ${l} < ${o}.length; ${l}++) {`),e.indented(f=>{f.write(`const ${d} = ${o}[${l}];`);let m=X(f,r,a,d);f.write(`${c}[${l}] = ${m};`)}),e.write("}")}return c}function If(e,r){for(let i=e.length-1;i>=0;i--)if(!(r==="optin"?e[i]._zod.optin!==void 0:e[i]._zod.optout==="optional"))return i+1;return 0}function H$(e,r,i,o){let t=i._zod.def,n=t.options;if(t.discriminator)return Q$(e,r,t,o);if(t.inclusive===!1)throw new N("exclusive unions (z.xor)");if(n.length===0)return e.write("return INVALID;"),o;if(n.length===1)return R(e,r,n[0],o);if(n.every(s=>s._zod.def.type==="literal"&&!s._zod.def.checks?.length)){let s=new Set(n.flatMap(l=>l._zod.def.values)),c=S(r,s);return e.write(`if (!${c}.has(${o})) return INVALID;`),o}let u=w(r);e.write(`let ${u};`);for(let s=0;s<n.length;s++){let c=n[s];s===0?e.write(`${u} = (() => {`):e.write(`if (${u} === INVALID) ${u} = (() => {`),e.indented(l=>{let d=R(l,r,c,o);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${u} === INVALID) return INVALID;`),u}function Q$(e,r,i,o){if(i.unionFallback)throw new N("discriminated union with unionFallback");if(i.options.length===0)return e.write("return INVALID;"),o;let t=w(r),n=w(r);e.write(`const ${t} = ${o}?.[${q(i.discriminator)}];`),e.write(`let ${n};`);let a=!0,u=new Set;for(let s of i.options){let c=s._zod.propValues?.[i.discriminator];if(!c||c.size===0)throw new N("discriminated union option without static discriminator values");for(let f of c){if(u.has(f))throw new N(`duplicate discriminator value ${String(f)}`);u.add(f)}let l=Array.from(c,f=>eh(r,t,f)),d=a?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(f=>{let m=R(f,r,s,o);f.write(`${n} = ${m};`)}),e.write("}"),a=!1}return e.write("else { return INVALID; }"),n}function eh(e,r,i){if(typeof i=="string")return`${r} === ${q(i)}`;if(typeof i=="number")return Number.isNaN(i)?`Number.isNaN(${r})`:`${r} === ${i}`;if(typeof i=="boolean")return`${r} === ${i}`;if(i===null)return`${r} === null`;if(i===void 0)return`${r} === undefined`;if(typeof i=="bigint")return`${r} === ${i}n`;if(typeof i=="symbol"){let o=S(e,i);return`${r} === ${o}`}throw new N(`literal discriminator value ${String(i)}`)}function th(e,r,i,o){let t=i._zod.def;r.definite=!1;let n=X(e,r,t.left,o),a=X(e,r,t.right,o),u=S(r,mt),s=w(r);return e.write(`const ${s} = ${u}(${n}, ${a});`),e.write(`if (!${s}.valid) return INVALID;`),`${s}.data`}function rh(e,r,i,o){let t=i._zod.def,n=S(r,ce);e.write(`if (!${n}(${o})) return INVALID;`);let a=w(r),u=w(r),s=w(r);e.write(`const ${a} = {};`);let c=t,l=c.partial?void 0:t.keyType._zod.values;if(l){let m=[];for(let _ of l){if(!(typeof _=="string"||typeof _=="number"||typeof _=="symbol"))throw new N(`record key value ${String(_)}`);let k=typeof _=="number"?_.toString():_;if(k==="__proto__")throw new N('record key "__proto__"');m.push(k);let z=S(r,_),I=R(e,r,t.keyType,z),D=w(r);e.write(`const ${D} = ${o}[${nh(r,k)}];`);let A=X(e,r,t.valueType,D);e.write(`${a}[${I}] = ${A};`)}let v=S(r,new Set(m));return e.write(`for (const ${u} in ${o}) {`),e.indented(_=>{_.write(`if (${v}.has(${u})) continue;`),c.mode==="loose"?_.write(`if (${u} !== "__proto__") ${a}[${u}] = ${o}[${u}];`):_.write("return INVALID;")}),e.write("}"),a}let d=t.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let m=t.mode==="loose",v=Vn(t.keyType);v.definite===!1&&(r.definite=!1);let _=S(r,v),k=S(r,be),z=w(r);return wf(e,r,o,u,I=>{I.write(`let ${z} = ${_}(${u});`),I.write(`if (${z} === INVALID && typeof ${u} === "string" && ${k}.test(${u})) ${z} = ${_}(Number(${u}));`),m?I.write(`if (${z} === INVALID) { ${a}[${u}] = ${o}[${u}]; continue; }`):I.write(`if (${z} === INVALID) return INVALID;`),I.write(`if (${z} === "__proto__") continue;`);let D=w(r);I.write(`const ${D} = ${o}[${u}];`);let A=X(I,r,t.valueType,D);I.write(`${a}[${z}] = ${A};`)}),a}return wf(e,r,o,u,m=>{m.write(`const ${s} = ${o}[${u}];`);let v=X(m,r,t.valueType,s);m.write(`${a}[${u}] = ${v};`)},"return INVALID;"),a}function wf(e,r,i,o,t,n){let a=S(r,Object.prototype.propertyIsEnumerable),u=w(r),s=w(r),c=w(r);e.write(`const ${u} = Object.getOwnPropertySymbols(${i});`),e.write(`const ${s} = Object.getOwnPropertyNames(${i});`),e.write(`for (let ${c} = 0; ${c} < ${s}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${o} = ${s}[${c}];`),l.write(`if (${o} === "__proto__" || !${a}.call(${i}, ${o})) continue;`),t(l)}),e.write("}"),e.write(`for (let ${c} = 0; ${c} < ${u}.length; ${c}++) {`),e.indented(l=>{l.write(`const ${o} = ${u}[${c}];`),l.write(`if (!${a}.call(${i}, ${o})) continue;`),n?l.write(n):t(l)}),e.write("}")}function nh(e,r){return typeof r=="string"?q(r):S(e,r)}function ih(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Map)) return INVALID;`),Vu(e,i,`${o}.size`);let n=w(r),a=w(r),u=w(r);return e.write(`const ${n} = new Map();`),e.write(`for (const [${a}, ${u}] of ${o}) {`),e.indented(s=>{let c=R(s,r,t.keyType,a),l=R(s,r,t.valueType,u);s.write(`${n}.set(${c}, ${l});`)}),e.write("}"),n}function oh(e,r,i,o){let t=i._zod.def;e.write(`if (!(${o} instanceof Set)) return INVALID;`),Vu(e,i,`${o}.size`);let n=w(r),a=w(r);return e.write(`const ${n} = new Set();`),e.write(`for (const ${a} of ${o}) {`),e.indented(u=>{let s=R(u,r,t.valueType,a);u.write(`${n}.add(${s});`)}),e.write("}"),n}function ah(e,r){return e.write(`if (!(${r} instanceof File)) return INVALID;`),r}function uh(e,r,i,o){e.write(`if (typeof ${o} !== "string") return INVALID;`);let t=i._zod.pattern;if(t){let n=S(r,t);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${o})) return INVALID;`)}return o}function ch(e,r,i,o){let t=i._zod.def,n=Je(r,t.getter),a=S(r,{parser:null});e.write(`if (!${a}.parser) {`),e.indented(s=>{s.write(`const inner = ${n}();`),s.write(`${a}.parser = function(input) {`),s.indented(c=>{c.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),c.write("return result.issues.length === 0 ? result.value : INVALID;")}),s.write("};")}),e.write("}");let u=w(r);return e.write(`const ${u} = ${a}.parser(${o});`),e.write(`if (${u} === INVALID) return INVALID;`),u}function sh(e,r,i,o){let t=i._zod.def,n=R(e,r,t.in,o);if(t.transform){if(Be(t.transform))throw new fe("z.compile: async transforms in pipes are not supported");let a=t.transform,s=Je(r,l=>{let d={value:l,issues:[],addIssue:Lu},f=a(l,d);return f instanceof Promise?H:d.issues.length===0?f:H}),c=w(r);return e.write(`const ${c} = ${s}(${n});`),e.write(`if (${c} === INVALID) return INVALID;`),R(e,r,t.out,c)}else return R(e,r,t.out,n)}function Be(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function lh(e,r,i,o){let t=i._zod.def;if(t.fn){if(Be(t.fn))throw new fe("z.compile: async custom predicates are not supported");let n=Je(r,t.fn),a=S(r,Zu),u=w(r);e.write(`const ${u} = ${n}(${o});`),e.write(`if (${u} instanceof Promise) ${a}();`),e.write(`if (!${u}) return INVALID;`)}else throw new N("custom schema without a predicate function");return o}function dh(e,r,i){let o=e._zod.run({value:i,issues:[]},{});if(o&&typeof o.then=="function")return H;let t=o;return t.issues.length===0?t.value:r()}function fh(e,r,i,o){let t=i._zod.def;if(!t.catchValue[Jr])throw new N("catch with a callback (only a constant catch value compiles)",!1);let n=w(r);e.write(`let ${n} = (() => {`),e.indented(c=>{let l=X(c,r,t.innerType,o);c.write(`return ${l};`)}),e.write("})();");let a=S(r,t.innerType),u=Je(r,t.catchValue),s=S(r,dh);return e.write(`if (${n} === INVALID) {`),e.indented(c=>{c.write(`${n} = ${s}(${a}, ${u}, ${o});`),c.write(`if (${n} === INVALID) return INVALID;`)}),e.write("}"),n}function mh(e,r,i,o){let t=i._zod.def;if(t.transform){if(Be(t.transform))throw new fe("z.compile: async transforms are not supported");let n=t.transform,u=Je(r,c=>{let l={value:c,issues:[],addIssue:Lu},d=n(c,l);return d instanceof Promise?H:l.issues.length===0?d:H}),s=w(r);return e.write(`const ${s} = ${u}(${o});`),e.write(`if (${s} === INVALID) return INVALID;`),s}return o}function Rn(e){return e.checks&&(e.checks=[...e.checks]),e}function Ru(e,r){return new e(Rn({type:"string",...b(r)}))}function Fu(e,r){return new e(Rn({type:"string",coerce:!0,...b(r)}))}function Fn(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(r)})}function Mn(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(r)})}function Jn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(r)})}function Bn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(r)})}function Kn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(r)})}function Gn(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(r)})}function _r(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(r)})}function Wn(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(r)})}function Xn(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(r)})}function qn(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(r)})}function Yn(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(r)})}function Hn(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(r)})}function Qn(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(r)})}function ei(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(r)})}function ti(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(r)})}function ri(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(r)})}function Mu(e,r){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...b(r)})}function ni(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(r)})}function ii(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(r)})}function oi(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(r)})}function ai(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(r)})}function ui(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(r)})}function Ju(e,r){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...b(r)})}function Bu(e,r){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...b(r)})}function ci(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(r)})}var Ku={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function br(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(r)})}function kr(e,r){return new e({type:"string",format:"date",check:"string_format",...b(r)})}function xr(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(r)})}function Ir(e,r){return new e({type:"string",format:"duration",check:"string_format",...b(r)})}function Gu(e,r){return new e(Rn({type:"number",checks:[],...b(r)}))}function Wu(e,r){return new e(Rn({type:"number",coerce:!0,checks:[],...b(r)}))}function Xu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(r)})}function qu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...b(r)})}function Yu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...b(r)})}function Hu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...b(r)})}function Qu(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...b(r)})}function ec(e,r){return new e({type:"boolean",...b(r)})}function tc(e,r){return new e({type:"boolean",coerce:!0,...b(r)})}function rc(e,r){return new e({type:"bigint",...b(r)})}function nc(e,r){return new e({type:"bigint",coerce:!0,...b(r)})}function ic(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...b(r)})}function oc(e,r){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...b(r)})}function ac(e,r){return new e({type:"symbol",...b(r)})}function uc(e,r){return new e({type:"undefined",...b(r)})}function cc(e,r){return new e({type:"null",...b(r)})}function sc(e){return new e({type:"any"})}function lc(e){return new e({type:"unknown"})}function dc(e,r){return new e({type:"never",...b(r)})}function fc(e,r){return new e({type:"void",...b(r)})}function mc(e,r){return new e({type:"date",...b(r)})}function pc(e,r){return new e({type:"date",coerce:!0,...b(r)})}function gc(e,r){return new e({type:"nan",...b(r)})}function pe(e,r){return new un({check:"less_than",...b(r),value:e,inclusive:!1})}function ae(e,r){return new un({check:"less_than",...b(r),value:e,inclusive:!0})}function ge(e,r){return new cn({check:"greater_than",...b(r),value:e,inclusive:!1})}function ue(e,r){return new cn({check:"greater_than",...b(r),value:e,inclusive:!0})}function si(e){return ge(0,e)}function li(e){return pe(0,e)}function di(e){return ae(0,e)}function fi(e){return ue(0,e)}function Pe(e,r){return new Yo({check:"multiple_of",...b(r),value:e})}function De(e,r){return new ea({check:"max_size",...b(r),maximum:e})}function ve(e,r){return new ta({check:"min_size",...b(r),minimum:e})}function Ke(e,r){return new ra({check:"size_equals",...b(r),size:e})}function Ge(e,r){return new na({check:"max_length",...b(r),maximum:e})}function ke(e,r){return new ia({check:"min_length",...b(r),minimum:e})}function We(e,r){return new oa({check:"length_equals",...b(r),length:e})}function $t(e,r){return new aa({check:"string_format",format:"regex",...b(r),pattern:e})}function ht(e){return new ua({check:"string_format",format:"lowercase",...b(e)})}function yt(e){return new ca({check:"string_format",format:"uppercase",...b(e)})}function _t(e,r){return new sa({check:"string_format",format:"includes",...b(r),includes:e})}function bt(e,r){return new la({check:"string_format",format:"starts_with",...b(r),prefix:e})}function kt(e,r){return new da({check:"string_format",format:"ends_with",...b(r),suffix:e})}function mi(e,r,i){return new fa({check:"property",property:e,schema:r,...b(i)})}function xt(e,r){return new ma({check:"properties",shape:e,...b(r)})}function It(e,r){return new pa({check:"mime_type",mime:e,...b(r)})}function me(e){return new ga({check:"overwrite",tx:e})}function wt(e){return me(r=>r.normalize(e))}function zt(){return me(e=>e.trim())}function St(){return me(e=>e.toLowerCase())}function Pt(){return me(e=>e.toUpperCase())}function Dt(){return me(e=>Hi(e))}function vc(e,r,i){return new e({type:"array",element:r,...b(i)})}function ph(e,r,i){return new e({type:"union",options:r,...b(i)})}function gh(e,r,i){return new e({type:"union",options:r,inclusive:!1,...b(i)})}function vh(e,r,i,o){return new e({type:"union",options:i,discriminator:r,...b(o)})}function $h(e,r,i){return new e({type:"intersection",left:r,right:i})}function hh(e,r,i,o){let t=i instanceof P,n=t?o:i,a=t?i:null;return new e({type:"tuple",items:r,rest:a,...b(n)})}function yh(e,r,i,o){return new e({type:"record",keyType:r,valueType:i,...b(o)})}function _h(e,r,i,o){return new e({type:"map",keyType:r,valueType:i,...b(o)})}function bh(e,r,i){return new e({type:"set",valueType:r,...b(i)})}function kh(e,r,i){let o=Array.isArray(r)?Object.fromEntries(r.map(t=>[t,t])):r;return new e({type:"enum",entries:o,...b(i)})}function xh(e,r,i){return new e({type:"enum",entries:r,...b(i)})}function Ih(e,r,i){return new e({type:"literal",values:Array.isArray(r)?r:[r],...b(i)})}function $c(e,r){return new e({type:"file",...b(r)})}function wh(e,r){return new e({type:"transform",transform:r})}function zh(e,r){return new e({type:"optional",innerType:r})}function Sh(e,r){return new e({type:"nullable",innerType:r})}function Ph(e,r,i){return new e({type:"default",innerType:r,get defaultValue(){return typeof i=="function"?i():Jt(i)}})}function Dh(e,r,i){return new e({type:"nonoptional",innerType:r,...b(i)})}function jh(e,r){return new e({type:"success",innerType:r})}function Oh(e,r,i){return new e({type:"catch",innerType:r,catchValue:typeof i=="function"?i:io(i)})}function Nh(e,r,i){return new e({type:"pipe",in:r,out:i})}function Uh(e,r){return new e({type:"readonly",innerType:r})}function Ah(e,r,i){return new e({type:"template_literal",parts:r,...b(i)})}function Th(e,r){return new e({type:"lazy",getter:r})}function Zh(e,r){return new e({type:"promise",innerType:r})}function hc(e,r,i){let o=b(i);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:r,...o})}function yc(e,r,i){return new e({type:"custom",check:"custom",fn:r,...b(i)})}function _c(e,r){let i=Df(o=>(o.addIssue=t=>{if(typeof t=="string")o.issues.push(ut(t,o.value,i._zod.def));else{let n=t;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),"input"in n||(n.input=o.value),n.inst??(n.inst=i),n.continue??(n.continue=!i._zod.def.abort),o.issues.push(ut(n))}},e(o.value,o)),r);return i}function Df(e,r){let i=new L({check:"custom",...b(r)});return i._zod.check=e,i}function bc(e){let r=new L({check:"describe"});return r._zod.onattach=[i=>{let o=G.get(i)??{};G.add(i,{...o,description:e})}],r._zod.check=()=>{},r}function kc(e){let r=new L({check:"meta"});return r._zod.onattach=[i=>{let o=G.get(i)??{};G.add(i,{...o,...e})}],r._zod.check=()=>{},r}function xc(e,r){let i=b(r),o=i.truthy??["true","1","yes","on","y","enabled"],t=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),t=t.map(m=>typeof m=="string"?m.toLowerCase():m));let n=new Set(o),a=new Set(t),u=e.Codec??mr,s=e.Boolean??dr,c=e.String??Fe,l=new c({type:"string",error:i.error}),d=new s({type:"boolean",error:i.error}),f=new u({type:"pipe",in:l,out:d,transform:((m,v)=>{let _=m;return i.case!=="sensitive"&&(_=_.toLowerCase()),n.has(_)?!0:a.has(_)?!1:(v.issues.push({code:"invalid_value",expected:"stringbool",values:[...n,...a],input:v.value,inst:f,continue:!1}),{})}),reverseTransform:((m,v)=>m===!0?o[0]||"true":t[0]||"false"),error:i.error});return f._zod.bag.truthy=o,f._zod.bag.falsy=t,f._zod.bag.case=i.case??"insensitive",f}function Xe(e,r,i,o={}){let t=b(o),n={check:"string_format",type:"string",format:r,fn:typeof i=="function"?i:u=>i.test(u),...t};return i instanceof RegExp&&(n.pattern=i),new e(n)}function wr(e,...r){for(let i of r)for(let o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&K(e,o,i[o]);return e}function je(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??G,target:r,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function M(e,r,i,o,t){let n=typeof r.unrepresentable=="function"?r.unrepresentable({zodSchema:e,path:o.path,message:t}):r.unrepresentable;if(n==="any")return!1;if(n===void 0||n==="throw")throw new Error(t);return Object.assign(i,n),!0}function E(e,r,i={path:[],schemaPath:[]}){var o;let t=e._zod.def,n=r.seen.get(e);if(n)return n.count++,i.schemaPath.includes(e)&&(n.cycle=i.path),n.schema;let a={schema:{},count:1,cycle:void 0,path:i.path};r.seen.set(e,a),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;let u=e._zod.toJSONSchema?.();if(u)a.schema=u;else{let l={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,a.schema,l);else{let f=a.schema,m=r.processors[t.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${t.type}`);m(e,r,f,l)}let d=e._zod.parent;d&&(a.ref||(a.ref=d),E(d,r,l),r.seen.get(d).isParent=!0)}let s=r.metadataRegistry.get(e);return s&&wr(a.schema,s),r.io==="input"&&Q(e)&&(delete a.schema.examples,delete a.schema.default),r.io==="input"&&"_prefault"in a.schema&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,r.seen.get(e).schema}function jf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Oe(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let a of e.seen.entries()){let u=e.metadataRegistry.get(a[0])?.id;if(u){let s=o.get(u);if(s&&s!==a[0])throw new Error(`Duplicate schema id "${u}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(u,a[0])}}let t=a=>{let u=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(a[0])?.id,f=e.external.uri??(v=>v);if(d)return{ref:f(d)};let m=a[1].defId??a[1].schema.id??`schema${e.counter++}`;return a[1].defId=m,{defId:m,ref:`${f("__shared")}#/${u}/${jf(m)}`}}let s="#",c=`${s}/${u}/`;if(a[1]===i&&!a[1].schema.id)return{ref:s};let l=a[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+jf(l)}},n=a=>{if(a[1].schema.$ref)return;let u=a[1],{ref:s,defId:c}=t(a);u.def={...u.schema},c&&(u.defId=c);let l=u.schema;for(let d in l)delete l[d];l.$ref=s};if(e.cycles==="throw")for(let a of e.seen.entries()){let u=a[1];if(u.cycle)throw new Error(`Cycle detected: #/${u.cycle?.join("/")}/<root>
64
64
 
65
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let u=a[1];if(r===a[0]){n(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(r!==a[0]&&c){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(u.cycle){n(a);continue}u.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Uf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;Uf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Af=new Set(["type","properties","required","additionalProperties"]),Of=["oneOf","anyOf"];function Nf(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function Ic(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Af.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let u=[];for(let c of r){let l=c.properties?.[a]??Nf(c);l!=null&&(u.some(d=>JSON.stringify(d)===JSON.stringify(l))||u.push(l))}let s=u.length===1?u[0]:Ic(u)??{allOf:u};K(i,a,s)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let u=Nf(a);u&&!n.some(s=>JSON.stringify(s)===JSON.stringify(u))&&n.push(u)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Eh(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Af)if(t in e)return;let i=r.filter(t=>Of.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=Ic(r);else{let t=i[0],n=Of.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=r.filter(s=>s!==t),u=t[n].map(s=>Ic([...a,s]));if(u.some(s=>!s))return;o={[n]:u}}o&&(delete e.allOf,wr(e,o))}function Ne(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=u=>{let s=e.seen.get(u);if(s.ref===null)return;let c=s.def??s.schema,l={...c},d=s.ref;if(s.ref=null,d){o(d);let m=e.seen.get(d),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(v)):wr(c,v),wr(c,l),u._zod.parent===d)for(let k in c)k==="$ref"||k==="allOf"||k in l||delete c[k];if(v.$ref&&m.def)for(let k in c)k==="$ref"||k==="allOf"||k in m.def&&JSON.stringify(c[k])===JSON.stringify(m.def[k])&&delete c[k]}let f=u._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}e.override({zodSchema:u,jsonSchema:c,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())o(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())Uf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let s of e.seen.values())for(let c of[s.schema,s.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let d=u.get(l);d?d.push(c):u.set(l,[c])}for(let s of e.intersections)for(let c of u.get(s)??[])Eh(c)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(r)?.id;if(!u)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(u)}wr(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let s=u[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,K(a,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let u=JSON.parse(JSON.stringify(t));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:jt(r,"input",e.processors),output:jt(r,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Q(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Q(o.element,i);if(o.type==="set")return Q(o.valueType,i);if(o.type==="lazy")return Q(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Q(o.innerType,i);if(o.type==="intersection")return Q(o.left,i)||Q(o.right,i);if(o.type==="record"||o.type==="map")return Q(o.keyType,i)||Q(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Q(o.in,i)||Q(o.out,i);if(o.type==="object"){for(let t in o.shape)if(Q(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(Q(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(Q(t,i))return!0;return!!(o.rest&&Q(o.rest,i))}return!1}var wc=(e,r={})=>i=>{let o=je({...i,processors:r});return E(e,o),Oe(o,e),Ne(o,e)},jt=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=je({...t??{},target:n,io:r,processors:i});return E(e,a),Oe(a,e),Ne(a,e)};var Ot=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},Nt=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Tf=(e,r)=>{Ot(e,"minimum",r),Nt(e,"maximum",r)},Lf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Vf=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Rf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Ff=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Zf=(e,r)=>Ot(e,"minimum",r.minimum),Ef=(e,r)=>Nt(e,"maximum",r.maximum),Cf=e=>(r,i)=>{Ff(r,i.format);let[o,t]=e[i.format];Ot(r,"minimum",o),Nt(r,"maximum",t)},Ch={greater_than:(e,r)=>Ot(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>Nt(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Lf(e,r.value),number_format:Cf(Kt),bigint_format:Cf(Gt),min_length:Zf,max_length:Ef,length_equals:(e,r)=>Tf(e,r.length),min_size:Zf,max_size:Ef,size_equals:(e,r)=>Tf(e,r.size),string_format:(e,r)=>{Ff(e,r.format),r.pattern&&Vf(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Rf(e,r.mime)};function J(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Ch[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&Ot(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&Ot(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&Nt(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&Nt(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Lf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Rf(r,t.mime);for(let n of t.patterns??[])Vf(r,n);return r}var Lh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Vh=new Map([[hn,Oo],[lr,No]]),Mf=e=>Vh.get(e)??e,Pc=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:u,patterns:s,contentEncoding:c,laxFormat:l}=J(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),u&&(t.format=Lh[u]??u,t.format===""&&delete t.format,(u==="time"||l)&&delete t.format),c&&(t.contentEncoding=c),s&&s.size>0){let d=[...s].map(Mf);d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Dc=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:c,isInt:l}=J(e);t.type=l?"integer":"number";let d=typeof c=="number"&&c>=(n??Number.NEGATIVE_INFINITY),f=typeof s=="number"&&s<=(a??Number.POSITIVE_INFINITY),m=r.target==="draft-04"||r.target==="openapi-3.0";if(d?m?(t.minimum=c,t.exclusiveMinimum=!0):t.exclusiveMinimum=c:typeof n=="number"&&(t.minimum=n),f?m?(t.maximum=s,t.exclusiveMaximum=!0):t.exclusiveMaximum=s:typeof a=="number"&&(t.maximum=a),u){let v=new Set;for(let z of u)Number.isFinite(z)&&z!==0?v.add(Math.abs(z)):M(e,r,t,o,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...k]=v;_!==void 0&&(t.multipleOf=_),k.length&&(t.allOf=[...t.allOf??[],...k.map(z=>({multipleOf:z}))])}},jc=(e,r,i,o)=>{i.type="boolean"},Oc=(e,r,i,o)=>{M(e,r,i,o,"BigInt cannot be represented in JSON Schema")},Nc=(e,r,i,o)=>{M(e,r,i,o,"Symbols cannot be represented in JSON Schema")},Uc=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Ac=(e,r,i,o)=>{M(e,r,i,o,"Undefined cannot be represented in JSON Schema")},Tc=(e,r,i,o)=>{M(e,r,i,o,"Void cannot be represented in JSON Schema")},Zc=(e,r,i,o)=>{i.not={}},Ec=(e,r,i,o)=>{},Cc=(e,r,i,o)=>{},Lc=(e,r,i,o)=>{M(e,r,i,o,"Date cannot be represented in JSON Schema")},Vc=(e,r,i,o)=>{let t=e._zod.def,n=rt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},Rc=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(M(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(M(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},Fc=(e,r,i,o)=>{M(e,r,i,o,"NaN cannot be represented in JSON Schema")},Mc=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},Jc=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:u}=J(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),u&&(u.length===0?t.not={}:u.length===1?t.contentMediaType=u[0]:t.anyOf=u.map(s=>({contentMediaType:s})))},Bc=(e,r,i,o)=>{i.type="boolean"},Kc=(e,r,i,o)=>{M(e,r,i,o,"Custom types cannot be represented in JSON Schema")},Gc=(e,r,i,o)=>{M(e,r,i,o,"Function types cannot be represented in JSON Schema")},Wc=(e,r,i,o)=>{M(e,r,i,o,"Transforms cannot be represented in JSON Schema")},Xc=(e,r,i,o)=>{M(e,r,i,o,"Map cannot be represented in JSON Schema")},qc=(e,r,i,o)=>{M(e,r,i,o,"Set cannot be represented in JSON Schema")},Yc=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:u}=J(e);typeof a=="number"&&(t.minItems=a),typeof u=="number"&&(t.maxItems=u),t.type="array",t.items=E(n.element,r,{...o,path:[...o.path,"items"]})};function zr(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?zr(r.out):r.type==="catch"?zr(r.innerType):e._zod.optin}var Hc=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&M(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let c in a)K(t.properties,c,E(a[c],r,{...o,path:[...o.path,"properties",c]}));let s=[];for(let c of Object.keys(a)){let l=n.shape[c];(r.io==="input"?zr(l)===void 0:l._zod.optout===void 0)&&s.push(c)}s.length>0&&(t.required=s),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=E(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},gi=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((u,s)=>E(u,r,{...o,path:[...o.path,n?"oneOf":"anyOf",s]}));n?i.oneOf=a:i.anyOf=a},Qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=E(t.right,r,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,s=[...u(n)?n.allOf:[n],...u(a)?a.allOf:[a]];i.allOf=s,r.intersections.push(s)},es=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",u=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",s=n.items.map((_,k)=>E(_,r,{...o,path:[...o.path,a,k]})),c=n.rest?E(n.rest,r,{...o,path:[...o.path,u,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,l=n.items.length;for(;l>0;){let _=n.items[l-1];if(!(r.io==="input"?zr(_)!==void 0:_._zod.optout==="optional"))break;l--}let d=n.items.length,f=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:c&&(t.items=c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):r.target==="openapi-3.0"?(t.items={anyOf:s},c&&t.items.anyOf.push(c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:c&&(t.additionalItems=c),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=J(e);typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function zc(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let _=zc(e,v,i);return _===v?r:_}for(let v of["anyOf","oneOf"]){let _=r[v];if(!Array.isArray(_))continue;let k=_.map(z=>zc(e,z,i));k.some((z,I)=>z!==_[I])&&(r={...r,[v]:k})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:u,exclusiveMinimum:s,exclusiveMaximum:c,multipleOf:l,format:d,id:f,...m}=r;return m.enum?m.enum=m.enum.map(v=>typeof v=="number"?String(v):v):typeof m.const=="number"&&(m.const=String(m.const)),t&&(m.type="string",n||(m.pattern=(o.includes("number")?be:nr).source)),m}var Sc=new WeakMap;function Rh(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Sc.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=zc(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var ts=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,u=J(a).patterns;if(n.mode==="loose"&&u&&u.size>0){let l=E(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let d of u)K(t.patternProperties,Mf(d).source,l)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=E(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let l=Sc.get(r);l||(l=[],Sc.set(r,l),r.deferred.push(()=>Rh(r))),l.push(e)}t.additionalProperties=E(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let s=a._zod.values,c=r.io==="input"&&zr(n.valueType)!==void 0;if(s&&!n.partial&&!c){let l=[...s].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(t.required=l.map(String))}},rs=(e,r,i,o)=>{let t=e._zod.def,n=E(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},ns=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},is=Symbol();function Jf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(u,s)=>typeof s!="bigint"?s:(n=!0,null));return n?(M(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),is):JSON.parse(a)}var os=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Jf(t.defaultValue,e,r,i,o);a!==is&&(i.default=a)},as=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Jf(t.defaultValue,e,r,i,o);a!==is&&(i._prefault=a)},us=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{M(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},cs=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;E(a,r,o);let u=r.seen.get(e);u.ref=a},ss=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},ls=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},vi=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},ds=(e,r,i,o)=>{let t=e._zod.innerType;E(t,r,o);let n=r.seen.get(e);n.ref=t},pi={string:Pc,number:Dc,boolean:jc,bigint:Oc,symbol:Nc,null:Uc,undefined:Ac,void:Tc,never:Zc,any:Ec,unknown:Cc,date:Lc,enum:Vc,literal:Rc,nan:Fc,template_literal:Mc,file:Jc,success:Bc,custom:Kc,function:Gc,transform:Wc,map:Xc,set:qc,array:Yc,object:Hc,union:gi,intersection:Qc,tuple:es,record:ts,nullable:rs,nonoptional:ns,default:os,prefault:as,catch:us,pipe:cs,readonly:ss,promise:ls,optional:vi,lazy:ds};function $i(e,r){if("_idmap"in e){let o=e,t=je({...r,processors:pi}),n={};for(let s of o._idmap.entries()){let[c,l]=s;E(l,t)}let a={},u={registry:o,uri:r?.uri,defs:n};t.external=u;for(let s of o._idmap.entries()){let[c,l]=s;Oe(t,l),K(a,c,Ne(t,l))}if(Object.keys(n).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:n}}return{schemas:a}}let i=je({...r,processors:pi});return E(e,i),Oe(i,e),Ne(i,e)}var hi=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=je({processors:pi,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return E(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Oe(this.ctx,r);let o=Ne(this.ctx,r),{"~standard":t,...n}=o;return n}};var Bf={};var Vt={};he(Vt,{ZodAny:()=>Us,ZodArray:()=>Es,ZodBase64:()=>Ei,ZodBase64URL:()=>Ci,ZodBigInt:()=>Ct,ZodBigIntFormat:()=>Ri,ZodBoolean:()=>Et,ZodCIDRv4:()=>Ti,ZodCIDRv6:()=>Zi,ZodCUID:()=>Pi,ZodCUID2:()=>Di,ZodCatch:()=>il,ZodCodec:()=>Zr,ZodCreditCard:()=>ws,ZodCustom:()=>Er,ZodCustomStringFormat:()=>Qe,ZodDate:()=>jr,ZodDefault:()=>Hs,ZodDiscriminatedUnion:()=>Ls,ZodE164:()=>Li,ZodEmail:()=>Ii,ZodEmoji:()=>zi,ZodEnum:()=>At,ZodExactOptional:()=>Bi,ZodFile:()=>Ws,ZodFunction:()=>pl,ZodGUID:()=>wi,ZodIBAN:()=>zs,ZodIPv4:()=>Ui,ZodIPv6:()=>Ai,ZodISODate:()=>Ae,ZodISODateTime:()=>Ue,ZodISODuration:()=>Ze,ZodISOTime:()=>Te,ZodInstanceOf:()=>$l,ZodIntersection:()=>Vs,ZodJWT:()=>Vi,ZodKSUID:()=>Ni,ZodLazy:()=>dl,ZodLiteral:()=>Gs,ZodMAC:()=>Is,ZodMap:()=>Bs,ZodNaN:()=>al,ZodNanoID:()=>Si,ZodNever:()=>Ts,ZodNonOptional:()=>Ki,ZodNull:()=>Os,ZodNullable:()=>Ys,ZodNumber:()=>Zt,ZodNumberFormat:()=>et,ZodObject:()=>Nr,ZodOptional:()=>Ar,ZodPipe:()=>Tr,ZodPrefault:()=>el,ZodPreprocess:()=>ul,ZodPromise:()=>ml,ZodReadonly:()=>cl,ZodRecord:()=>Ut,ZodSet:()=>Ks,ZodString:()=>Tt,ZodStringFormat:()=>C,ZodSuccess:()=>nl,ZodSymbol:()=>Ds,ZodTemplateLiteral:()=>ll,ZodTransform:()=>Xs,ZodTuple:()=>Fs,ZodType:()=>j,ZodULID:()=>ji,ZodURL:()=>Dr,ZodUUID:()=>$e,ZodUndefined:()=>js,ZodUnion:()=>Ur,ZodUnknown:()=>As,ZodVoid:()=>Zs,ZodXID:()=>Oi,ZodXor:()=>Cs,_ZodString:()=>xi,_default:()=>Qs,_function:()=>np,any:()=>Am,array:()=>Or,base64:()=>pm,base64url:()=>gm,bigint:()=>Dm,boolean:()=>Ps,catch:()=>ol,check:()=>ip,cidrv4:()=>fm,cidrv6:()=>mm,codec:()=>Qm,creditCard:()=>$m,cuid:()=>im,cuid2:()=>om,currencyCode:()=>xm,custom:()=>op,date:()=>Zm,describe:()=>ap,discriminatedUnion:()=>Fm,e164:()=>vm,email:()=>Wf,emoji:()=>rm,enum:()=>Mi,exactOptional:()=>qs,file:()=>Xm,float32:()=>wm,float64:()=>zm,function:()=>np,guid:()=>Xf,hash:()=>Im,hex:()=>km,hostname:()=>bm,httpUrl:()=>tm,iban:()=>hm,instanceof:()=>cp,int:()=>bi,int32:()=>Sm,int64:()=>jm,intersection:()=>Rs,invertCodec:()=>ep,ipv4:()=>sm,ipv6:()=>dm,json:()=>lp,jwt:()=>ym,keyof:()=>Em,ksuid:()=>cm,lazy:()=>fl,literal:()=>Wm,looseObject:()=>Vm,looseRecord:()=>Jm,mac:()=>lm,map:()=>Bm,meta:()=>up,nan:()=>Hm,nanoid:()=>nm,nativeEnum:()=>Gm,never:()=>Fi,nonoptional:()=>rl,null:()=>Ns,nullable:()=>Pr,nullish:()=>qm,number:()=>Ss,object:()=>Cm,optional:()=>Ye,partialRecord:()=>Mm,pipe:()=>ki,prefault:()=>tl,preprocess:()=>dp,promise:()=>rp,readonly:()=>sl,record:()=>Js,refine:()=>gl,set:()=>Km,strictObject:()=>Lm,string:()=>Sr,stringFormat:()=>_m,stringbool:()=>sp,success:()=>Ym,superRefine:()=>vl,symbol:()=>Nm,templateLiteral:()=>tp,transform:()=>Ji,tuple:()=>Ms,uint32:()=>Pm,uint64:()=>Om,ulid:()=>am,undefined:()=>Um,union:()=>Lt,unknown:()=>qe,url:()=>em,uuid:()=>qf,uuidv4:()=>Yf,uuidv6:()=>Hf,uuidv7:()=>Qf,void:()=>Tm,xid:()=>um,xor:()=>Rm});var yi={};he(yi,{endsWith:()=>kt,gt:()=>ge,gte:()=>ue,includes:()=>_t,length:()=>We,lowercase:()=>ht,lt:()=>pe,lte:()=>ae,maxLength:()=>Ge,maxSize:()=>De,mime:()=>It,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Pe,negative:()=>li,nonnegative:()=>fi,nonpositive:()=>di,normalize:()=>wt,overwrite:()=>me,positive:()=>si,properties:()=>xt,property:()=>mi,regex:()=>$t,size:()=>Ke,slugify:()=>Dt,startsWith:()=>bt,toLowerCase:()=>St,toUpperCase:()=>Pt,trim:()=>zt,uppercase:()=>yt});var Kf=new WeakSet([Object.prototype,Error.prototype]);function _i(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Gf=(e,r)=>{lo.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Kf.has(i)||(Kf.add(i),_i(i,"format",o=>t=>Qt(o,t)),_i(i,"flatten",o=>t=>Ht(o,t)),_i(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,nt,2)}),_i(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,nt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Mh=p("ZodError",Gf),oe=p("ZodError",Gf,void 0,{Parent:Error});var fs=ct(oe),ms=st(oe),ps=lt(oe),gs=dt(oe),vs=Wr(oe),$s=Xr(oe),hs=qr(oe),ys=Yr(oe),_s=Hr(oe),bs=Qr(oe),ks=en(oe),xs=tn(oe);function Bh(){B.localeError||F(An())}function He(){B.memoizer||F({memoizer:$r()})}var j=p("ZodType",(e,r)=>(Bh(),P.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone($.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return T(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(gl(e,r))},superRefine(e,r){return this.check(vl(e,r))},overwrite(e){return this.check(me(e))},optional(){return Ye(this)},exactOptional(){return qs(this)},nullable(){return Pr(this)},nullish(){return Ye(Pr(this))},nonoptional(e){return rl(this,e)},array(){return Or(this)},or(e){return Lt([this,e])},and(e){return Rs(this,e)},transform(e){return ki(this,Ji(e))},default(e){return Qs(this,e)},prefault(e){return tl(this,e)},catch(e){return ol(this,e)},pipe(e){return ki(this,e)},readonly(){return sl(this)},describe(e){let r=this.clone();return G.add(r,{description:e}),r},meta(...e){if(e.length===0)return G.get(this);let r=this.clone();return G.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return $.hide(this,"~standard",{...mn(this),jsonSchema:{input:jt(this,"input"),output:jt(this,"output")}})},set"~standard"(e){$.own(this,"~standard",e)},parse:function e(r,i){return fs(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await ms(this,r,i,{callee:e})},safeParse(e,r){return ps(this,e,r)},async safeParseAsync(e,r){return gs(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){$.own(this,"spa",e)},validate(e,r){return er(this,e,r)},validateAsync(e,r){return tr(this,e,r)},encode:function e(r,i){return vs(this,r,i,{callee:e})},decode:function e(r,i){return $s(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await hs(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await ys(this,r,i,{callee:e})},safeEncode(e,r){return _s(this,e,r)},safeDecode(e,r){return bs(this,e,r)},async safeEncodeAsync(e,r){return ks(this,e,r)},async safeDecodeAsync(e,r){return xs(this,e,r)},toJSONSchema(e){return wc(this,{})(e)},get description(){return G.get(this)?.description},get _def(){return this._zod.def}}),xi=p("_ZodString",(e,r)=>{Fe.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pc(e,i,o,t)},$.derived({format:e=>J(e).format??null,minLength:e=>J(e).minimum??null,maxLength:e=>J(e).maximum??null},{regex(...e){return this.check($t(...e))},includes(...e){return this.check(_t(...e))},startsWith(...e){return this.check(bt(...e))},endsWith(...e){return this.check(kt(...e))},min(...e){return this.check(ke(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(We(...e))},nonempty(...e){return this.check(ke(1,...e))},lowercase(e){return this.check(ht(e))},uppercase(e){return this.check(yt(e))},trim(){return this.check(zt())},normalize(...e){return this.check(wt(...e))},toLowerCase(){return this.check(St())},toUpperCase(){return this.check(Pt())},slugify(){return this.check(Dt())}})),Tt=p("ZodString",(e,r)=>{Fe.init(e,r),xi.init(e,r)},{email(e){return this.check(Fn(Ii,e))},url(e){return this.check(_r(Dr,e))},jwt(e){return this.check(ci(Vi,e))},emoji(e){return this.check(Wn(zi,e))},guid(e){return this.check(Mn(wi,e))},uuid(e){return this.check(Jn($e,e))},uuidv4(e){return this.check(Bn($e,e))},uuidv6(e){return this.check(Kn($e,e))},uuidv7(e){return this.check(Gn($e,e))},nanoid(e){return this.check(Xn(Si,e))},cuid(e){return this.check(qn(Pi,e))},cuid2(e){return this.check(Yn(Di,e))},ulid(e){return this.check(Hn(ji,e))},base64(e){return this.check(oi(Ei,e))},base64url(e){return this.check(ai(Ci,e))},xid(e){return this.check(Qn(Oi,e))},ksuid(e){return this.check(ei(Ni,e))},ipv4(e){return this.check(ti(Ui,e))},ipv6(e){return this.check(ri(Ai,e))},cidrv4(e){return this.check(ni(Ti,e))},cidrv6(e){return this.check(ii(Zi,e))},e164(e){return this.check(ui(Li,e))},datetime(e){return this.check(br(Ue,e))},date(e){return this.check(kr(Ae,e))},time(e){return this.check(xr(Te,e))},duration(e){return this.check(Ir(Ze,e))}});function Sr(e){return Ru(Tt,e)}var C=p("ZodStringFormat",(e,r)=>{Z.init(e,r),xi.init(e,r)}),Ue=p("ZodISODateTime",(e,r)=>{Oa.init(e,r),C.init(e,r)}),Ae=p("ZodISODate",(e,r)=>{Na.init(e,r),C.init(e,r)}),Te=p("ZodISOTime",(e,r)=>{Ua.init(e,r),C.init(e,r)}),Ze=p("ZodISODuration",(e,r)=>{Aa.init(e,r),C.init(e,r)}),Ii=p("ZodEmail",(e,r)=>{_a.init(e,r),C.init(e,r)});function Wf(e){return Fn(Ii,e)}var wi=p("ZodGUID",(e,r)=>{ha.init(e,r),C.init(e,r)});function Xf(e){return Mn(wi,e)}var $e=p("ZodUUID",(e,r)=>{ya.init(e,r),C.init(e,r)});function qf(e){return Jn($e,e)}function Yf(e){return Bn($e,e)}function Hf(e){return Kn($e,e)}function Qf(e){return Gn($e,e)}var Dr=p("ZodURL",(e,r)=>{xa.init(e,r),C.init(e,r)});function em(e){return _r(Dr,e)}function tm(e){return _r(Dr,{protocol:rr,hostname:Ao,...$.normalizeParams(e)})}var zi=p("ZodEmoji",(e,r)=>{Ia.init(e,r),C.init(e,r)});function rm(e){return Wn(zi,e)}var Si=p("ZodNanoID",(e,r)=>{wa.init(e,r),C.init(e,r)});function nm(e){return Xn(Si,e)}var Pi=p("ZodCUID",(e,r)=>{za.init(e,r),C.init(e,r)});function im(e){return qn(Pi,e)}var Di=p("ZodCUID2",(e,r)=>{Sa.init(e,r),C.init(e,r)});function om(e){return Yn(Di,e)}var ji=p("ZodULID",(e,r)=>{Pa.init(e,r),C.init(e,r)});function am(e){return Hn(ji,e)}var Oi=p("ZodXID",(e,r)=>{Da.init(e,r),C.init(e,r)});function um(e){return Qn(Oi,e)}var Ni=p("ZodKSUID",(e,r)=>{ja.init(e,r),C.init(e,r)});function cm(e){return ei(Ni,e)}var Ui=p("ZodIPv4",(e,r)=>{Ta.init(e,r),C.init(e,r)});function sm(e){return ti(Ui,e)}var Is=p("ZodMAC",(e,r)=>{Ea.init(e,r),C.init(e,r)});function lm(e){return Mu(Is,e)}var Ai=p("ZodIPv6",(e,r)=>{Za.init(e,r),C.init(e,r)});function dm(e){return ri(Ai,e)}var Ti=p("ZodCIDRv4",(e,r)=>{Ca.init(e,r),C.init(e,r)});function fm(e){return ni(Ti,e)}var Zi=p("ZodCIDRv6",(e,r)=>{La.init(e,r),C.init(e,r)});function mm(e){return ii(Zi,e)}var Ei=p("ZodBase64",(e,r)=>{Va.init(e,r),C.init(e,r)});function pm(e){return oi(Ei,e)}var Ci=p("ZodBase64URL",(e,r)=>{Ra.init(e,r),C.init(e,r)});function gm(e){return ai(Ci,e)}var Li=p("ZodE164",(e,r)=>{Fa.init(e,r),C.init(e,r)});function vm(e){return ui(Li,e)}var ws=p("ZodCreditCard",(e,r)=>{Ma.init(e,r),C.init(e,r)});function $m(e){return Ju(ws,e)}var zs=p("ZodIBAN",(e,r)=>{Ja.init(e,r),C.init(e,r)});function hm(e){return Bu(zs,e)}var Vi=p("ZodJWT",(e,r)=>{Ba.init(e,r),C.init(e,r)});function ym(e){return ci(Vi,e)}var Qe=p("ZodCustomStringFormat",(e,r)=>{Ka.init(e,r),C.init(e,r)});function _m(e,r,i={}){return Xe(Qe,e,r,i)}function bm(e){return Xe(Qe,"hostname",Uo,e)}function km(e){return Xe(Qe,"hex",Wo,e)}function xm(e){return Xe(Qe,"currency_code",Zo,e)}function Im(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=le[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Xe(Qe,o,t,r)}var Zt=p("ZodNumber",(e,r)=>{xn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dc(e,i,o,t),e.isFinite=!0},$.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=J(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=J(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=J(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>J(e).format??null},{gt(e,r){return this.check(ge(e,r))},gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},int(e){return this.check(bi(e))},safe(e){return this.check(bi(e))},positive(e){return this.check(ge(0,e))},nonnegative(e){return this.check(ue(0,e))},negative(e){return this.check(pe(0,e))},nonpositive(e){return this.check(ae(0,e))},multipleOf(e,r){return this.check(Pe(e,r))},step(e,r){return this.check(Pe(e,r))},finite(){return this}}));function Ss(e){return Gu(Zt,e)}var et=p("ZodNumberFormat",(e,r)=>{Ga.init(e,r),Zt.init(e,r)});function bi(e){return Xu(et,e)}function wm(e){return qu(et,e)}function zm(e){return Yu(et,e)}function Sm(e){return Hu(et,e)}function Pm(e){return Qu(et,e)}var Et=p("ZodBoolean",(e,r)=>{dr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>jc(e,i,o,t)});function Ps(e){return ec(Et,e)}var Ct=p("ZodBigInt",(e,r)=>{In.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Oc(e,i,o,t)},$.derived({minValue:e=>J(e).minimum??null,maxValue:e=>J(e).maximum??null,format:e=>J(e).format??null},{gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},gt(e,r){return this.check(ge(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},positive(e){return this.check(ge(BigInt(0),e))},negative(e){return this.check(pe(BigInt(0),e))},nonpositive(e){return this.check(ae(BigInt(0),e))},nonnegative(e){return this.check(ue(BigInt(0),e))},multipleOf(e,r){return this.check(Pe(e,r))}}));function Dm(e){return rc(Ct,e)}var Ri=p("ZodBigIntFormat",(e,r)=>{Wa.init(e,r),Ct.init(e,r)});function jm(e){return ic(Ri,e)}function Om(e){return oc(Ri,e)}var Ds=p("ZodSymbol",(e,r)=>{Xa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nc(e,i,o,t)});function Nm(e){return ac(Ds,e)}var js=p("ZodUndefined",(e,r)=>{qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ac(e,i,o,t)});function Um(e){return uc(js,e)}var Os=p("ZodNull",(e,r)=>{Ya.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Uc(e,i,o,t)});function Ns(e){return cc(Os,e)}var Us=p("ZodAny",(e,r)=>{Ha.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ec(e,i,o,t)});function Am(){return sc(Us)}var As=p("ZodUnknown",(e,r)=>{Qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cc(e,i,o,t)});function qe(){return lc(As)}var Ts=p("ZodNever",(e,r)=>{eu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Zc(e,i,o,t)});function Fi(e){return dc(Ts,e)}var Zs=p("ZodVoid",(e,r)=>{tu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tc(e,i,o,t)});function Tm(e){return fc(Zs,e)}var jr=p("ZodDate",(e,r)=>{ru.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Lc(e,i,o,t),e.min=(i,o)=>e.check(ue(i,o)),e.max=(i,o)=>e.check(ae(i,o))},$.derived({minDate:e=>{let{minimum:r}=J(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=J(e);return r?new Date(r):null}},{}));function Zm(e){return mc(jr,e)}var Es=p("ZodArray",(e,r)=>{He(),iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Yc(e,i,o,t),e.element=r.element},{min(e,r){return this.check(ke(e,r))},nonempty(e){return this.check(ke(1,e))},max(e,r){return this.check(Ge(e,r))},length(e,r){return this.check(We(e,r))},unwrap(){return this.element}});function Or(e,r){return vc(Es,e,r)}function Em(e){let r=e._zod.def.shape;return Mi(Object.keys(r))}var Nr=p("ZodObject",(e,r)=>{He(),ou.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Hc(e,i,o,t),$.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return Mi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},loose(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},strict(){return this.clone($.mergeDefs(this._zod.def,{catchall:Fi()}))},strip(){return this.clone($.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return $.extend(this,e)},safeExtend(e){return $.safeExtend(this,e)},merge(e){return $.merge(this,e)},pick(e){return $.pick(this,e)},omit(e){return $.omit(this,e)},partial(...e){return $.partial(Ar,this,e[0])},exactPartial(...e){return $.partial(Bi,this,e[0],"exactPartial")},required(...e){return $.required(Ki,this,e[0])}});function Cm(e,r){let i={type:"object",shape:e??{},...$.normalizeParams(r)};return new Nr(i)}function Lm(e,r){return new Nr({type:"object",shape:e,catchall:Fi(),...$.normalizeParams(r)})}function Vm(e,r){return new Nr({type:"object",shape:e,catchall:qe(),...$.normalizeParams(r)})}var Ur=p("ZodUnion",(e,r)=>{fr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.options=r.options});function Lt(e,r){return new Ur({type:"union",options:e,...$.normalizeParams(r)})}var Cs=p("ZodXor",(e,r)=>{Ur.init(e,r),au.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.options=r.options});function Rm(e,r){return new Cs({type:"union",options:e,inclusive:!1,...$.normalizeParams(r)})}var Ls=p("ZodDiscriminatedUnion",(e,r)=>{Ur.init(e,r),cu.init(e,r)});function Fm(e,r,i){return new Ls({type:"union",options:r,discriminator:e,...$.normalizeParams(i)})}var Vs=p("ZodIntersection",(e,r)=>{su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Qc(e,i,o,t)});function Rs(e,r){return new Vs({type:"intersection",left:e,right:r})}var Fs=p("ZodTuple",(e,r)=>{He(),wn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>es(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Ar({type:"optional",innerType:r}))})}});function Ms(e,r,i){let o=r instanceof P,t=o?i:r,n=o?r:null;return new Fs({type:"tuple",items:e,rest:n,...$.normalizeParams(t)})}var Ut=p("ZodRecord",(e,r)=>{He(),lu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ts(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function Js(e,r,i){return!r||!r._zod?new Ut({type:"record",keyType:Sr(),valueType:e,...$.normalizeParams(r)}):new Ut({type:"record",keyType:e,valueType:r,...$.normalizeParams(i)})}function Mm(e,r,i){return new Ut({type:"record",keyType:e,valueType:r,...$.normalizeParams(i),partial:!0})}function Jm(e,r,i){return new Ut({type:"record",keyType:e,valueType:r,mode:"loose",...$.normalizeParams(i)})}var Bs=p("ZodMap",(e,r)=>{He(),du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Xc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(De(...i)),e.size=(...i)=>e.check(Ke(...i))});function Bm(e,r,i){return new Bs({type:"map",keyType:e,valueType:r,...$.normalizeParams(i)})}var Ks=p("ZodSet",(e,r)=>{He(),fu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>qc(e,i,o,t),e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(De(...i)),e.size=(...i)=>e.check(Ke(...i))});function Km(e,r){return new Ks({type:"set",valueType:e,...$.normalizeParams(r)})}var At=p("ZodEnum",(e,r)=>{mu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(o,t,n)=>Vc(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new At({...r,checks:[],...$.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new At({...r,checks:[],...$.normalizeParams(t),entries:n})}});function Mi(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new At({type:"enum",entries:i,...$.normalizeParams(r)})}function Gm(e,r){return new At({type:"enum",entries:e,...$.normalizeParams(r)})}var Gs=p("ZodLiteral",(e,r)=>{pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Rc(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Wm(e,r){return new Gs({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(r)})}var Ws=p("ZodFile",(e,r)=>{gu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Jc(e,i,o,t),e.min=(i,o)=>e.check(ve(i,o)),e.max=(i,o)=>e.check(De(i,o)),e.mime=(i,o)=>e.check(It(Array.isArray(i)?i:[i],o))});function Xm(e){return $c(Ws,e)}var Xs=p("ZodTransform",(e,r)=>{He(),vu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Wc(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ze(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push($.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push($.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function Ji(e){return new Xs({type:"transform",transform:e})}var Ar=p("ZodOptional",(e,r)=>{zn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ye(e){return new Ar({type:"optional",innerType:e})}var Bi=p("ZodExactOptional",(e,r)=>{$u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function qs(e){return new Bi({type:"optional",innerType:e})}var Ys=p("ZodNullable",(e,r)=>{hu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rs(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Pr(e){return new Ys({type:"nullable",innerType:e})}function qm(e){return Ye(Pr(e))}var Hs=p("ZodDefault",(e,r)=>{yu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>os(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qs(e,r){return new Hs({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var el=p("ZodPrefault",(e,r)=>{_u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>as(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function tl(e,r){return new el({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Ki=p("ZodNonOptional",(e,r)=>{bu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ns(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function rl(e,r){return new Ki({type:"nonoptional",innerType:e,...$.normalizeParams(r)})}var nl=p("ZodSuccess",(e,r)=>{ku.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Bc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ym(e){return new nl({type:"success",innerType:e})}var il=p("ZodCatch",(e,r)=>{xu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>us(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ol(e,r){return new il({type:"catch",innerType:e,catchValue:typeof r=="function"?r:$.constantCatch(r)})}var al=p("ZodNaN",(e,r)=>{Iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Fc(e,i,o,t)});function Hm(e){return gc(al,e)}var Tr=p("ZodPipe",(e,r)=>{Sn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cs(e,i,o,t),e.in=r.in,e.out=r.out});function ki(e,r){return new Tr({type:"pipe",in:e,out:r})}var Zr=p("ZodCodec",(e,r)=>{Tr.init(e,r),mr.init(e,r)});function Qm(e,r,i){return new Zr({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function ep(e){let r=e._zod.def;return new Zr({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var ul=p("ZodPreprocess",(e,r)=>{Tr.init(e,r),wu.init(e,r)}),cl=p("ZodReadonly",(e,r)=>{zu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ss(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function sl(e){return new cl({type:"readonly",innerType:e})}var ll=p("ZodTemplateLiteral",(e,r)=>{Su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Mc(e,i,o,t)});function tp(e,r){return new ll({type:"template_literal",parts:e,...$.normalizeParams(r)})}var dl=p("ZodLazy",(e,r)=>{pr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ds(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function fl(e){return new dl({type:"lazy",getter:e})}var ml=p("ZodPromise",(e,r)=>{Du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ls(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function rp(e){return new ml({type:"promise",innerType:e})}var pl=p("ZodFunction",(e,r)=>{Pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Gc(e,i,o,t)});function np(e){return new pl({type:"function",input:Array.isArray(e?.input)?Ms(e?.input):e?.input??Or(qe()),output:e?.output??qe()})}var Er=p("ZodCustom",(e,r)=>{ju.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Kc(e,i,o,t)});function ip(e){let r=new L({check:"custom"});return r._zod.check=e,r}function op(e,r){return hc(Er,e??(()=>!0),r)}function gl(e,r={}){return yc(Er,e,r)}function vl(e,r){return _c(e,r)}var ap=bc,up=kc,$l=p("ZodInstanceOf",(e,r)=>{Er.init(e,r)},{properties(e,r){return this.check(xt(e,r))}});function cp(e,r={}){let i=new $l({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var sp=(...e)=>xc({Codec:Zr,Boolean:Et,String:Tt},...e);function lp(e){let r=fl(()=>Lt([Sr(e),Ss(),Ps(),Ns(),Or(r),Js(Sr(),r)]));return r}function dp(e,r){return new ul({type:"pipe",in:Ji(e),out:r})}var Kh={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 Gh(e){F({customError:e})}function Wh(){return F().customError}var hl;hl||(hl={});var Cr={};he(Cr,{ZodISODate:()=>Ae,ZodISODateTime:()=>Ue,ZodISODuration:()=>Ze,ZodISOTime:()=>Te,date:()=>qh,datetime:()=>Xh,duration:()=>Hh,time:()=>Yh});function Xh(e){return br(Ue,e)}function qh(e){return kr(Ae,e)}function Yh(e){return xr(Te,e)}function Hh(e){return Ir(Ze,e)}var x={...Vt,...yi,iso:Cr},Qh=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 ey(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function fp(e,r){return e.map((i,o)=>o<r?i:i.optional())}function ty(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ry(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:ty(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function ny(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let u=r.keySchema.safeParse(a);u.success||o.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function yl(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let u=yl(a,r);if(u===null)return null;n.push(u)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=yl(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var iy=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),oy=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Lr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Lr):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>iy.has(r)?Lr(i):!oy.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(Lr))}function mp(e){return e===1?"element":"elements"}function ay(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let u=yl(t[a],new Set);if(u===null)continue;let s=n.get(u);if(s===void 0){n.set(u,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${s}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let s of t)if(r.containsSchema.safeParse(s).success&&++u>=a)break;u<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${mp(n)}; found ${u}`,input:t,continue:!0}),r.maxContains!==void 0&&u>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${mp(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function pp(e,r){if(e!==!1)return e===void 0||e===!0?x.any():ee(e,r)}var uy=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function gp(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return x.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=ry(t,r),a=ee(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return x.null();if(t.length===0)return x.never();if(t.length===1)return x.literal(t[0]);if(t.every(a=>typeof a=="string"))return x.enum(t);let n=t.map(a=>x.literal(a));return n.length<2?n[0]:x.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return gp(a,r)});return t.length===0?x.never():t.length===1?t[0]:x.union(t)}if(!i)return x.any();let o;switch(i){case"string":{let t=x.string();if(e.format){let n=e.format;n==="email"?t=t.check(x.email()):n==="uri"||n==="uri-reference"?t=t.check(x.url()):n==="uuid"||n==="guid"?t=t.check(x.uuid()):n==="date-time"?t=t.check(x.iso.datetime({offset:!0})):n==="date"?t=t.check(x.iso.date()):n==="time"?t=t.check(x.regex(uy)):n==="duration"?t=t.check(x.iso.duration()):n==="hostname"?t=t.check(x.hostname()):n==="ipv4"?t=t.check(x.ipv4()):n==="ipv6"?t=t.check(x.ipv6()):n==="mac"?t=t.check(x.mac()):n==="cidr"?t=t.check(x.cidrv4()):n==="cidr-v6"?t=t.check(x.cidrv6()):n==="base64"?t=t.check(x.base64()):n==="base64url"?t=t.check(x.base64url()):n==="e164"?t=t.check(x.e164()):n==="credit_card"?t=t.check(x.creditCard()):n==="iban"?t=t.check(x.iban()):n==="jwt"?t=t.check(x.jwt()):n==="emoji"?t=t.check(x.emoji()):n==="nanoid"?t=t.check(x.nanoid()):n==="cuid"?t=t.check(x.cuid()):n==="cuid2"?t=t.check(x.cuid2()):n==="ulid"?t=t.check(x.ulid()):n==="xid"?t=t.check(x.xid()):n==="ksuid"&&(t=t.check(x.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?x.number().int():x.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=x.boolean();break}case"null":{o=x.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?ee(e.additionalProperties,r):void 0;for(let[d,f]of Object.entries(n)){let m=ee(f,r);K(t,d,a.has(d)?m:m.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),m=[];for(let _ of f){let k=ee(d[_],r),z=x.string().regex(new RegExp(_));m.push(x.looseRecord(z,k))}let v=[];if(Object.keys(t).length>0&&v.push(x.object(t).passthrough()),v.push(...m),v.length===0)o=x.object({}).passthrough();else if(v.length===1)o=v[0];else{let _=x.intersection(v[0],v[1]);for(let k=2;k<v.length;k++)_=x.intersection(_,v[k]);o=_}if(e.additionalProperties===!1){let _=Object.keys(t),k=f.map(I=>new RegExp(I)),z=o;o=o.check(I=>{if(!ce(I.value))return;let D=[];for(let A of Object.keys(I.value))_.includes(A)||k.some(V=>V.test(A))||D.push(A);D.length&&I.issues.push({code:"unrecognized_keys",keys:D,input:I.value,inst:z})})}}else{let d=x.object(t);e.additionalProperties===!1?o=d.strict():u?o=d.catchall(u):o=d.passthrough()}let s=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(s||c!==void 0||l!==void 0){let d;if(s){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ee(f,r)}o=ny(o,{keySchema:d,minProperties:c,maxProperties:l})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,u=t.map(d=>ee(d,r)),s=fp(u,a),c=Array.isArray(n)?void 0:pp(n,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,u=n.map(d=>ee(d,r)),s=fp(u,a),c=pp(e.additionalItems,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(n!==void 0){let a=ee(n,r),u=x.array(a);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=x.array(x.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=ay(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ee(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function ee(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i=gp(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(c=>ee(c,r)),s=x.union(u);i=o?x.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(c=>ee(c,r)),s=x.xor(u);i=o?x.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:x.any();else{let u=o?i:ee(e.allOf[0],r),s=o?0:1;for(let c=s;c<e.allOf.length;c++)u=x.intersection(u,ee(e.allOf[c],r));i=u}e.nullable===!0&&r.version==="openapi-3.0"&&(i=x.nullable(i)),e.readOnly===!0&&(i=x.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of n)u in e&&(t[u]=e[u]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let u of a)u in e&&(t[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Lr(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(t[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Lr(e.contains)&&(t.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(t[u]=e[u])}for(let u of Object.keys(e))Qh.has(u)||K(t,u,e[u]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function vp(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=ey(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??G};return ee(i,n)}var $p=Symbol("z.visit/resolving");function Vr(e,r){let i=typeof r=="function"?r:(a,u)=>{let s=r[a._zod.def.type];return s?s(a,u):a},o=new Map;function t(a){let u=o.get(a);if(u===$p)return new pr({type:"lazy",getter:()=>o.get(a)});if(u!==void 0)return u;o.set(a,$p);let s=n(a),c=i(s,s!==a);return o.set(a,c),c}function n(a){let u=a._zod.def,s=u.type;switch(s){case"object":{let c=u.shape,l=Object.keys(c),d=!1,f={};for(let v of l){let _=t(c[v]);_!==c[v]&&(d=!0),f[v]=_}let m=u.catchall;return u.catchall&&(m=t(u.catchall),m!==u.catchall&&(d=!0)),d?T(a,{...u,shape:f,catchall:m}):a}case"array":{let c=t(u.element);return c===u.element?a:T(a,{...u,element:c})}case"tuple":{let c=u.items,l=!1,d=[];for(let m of c){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=u.rest;return u.rest&&(f=t(u.rest),f!==u.rest&&(l=!0)),l?T(a,{...u,items:d,rest:f}):a}case"record":case"map":{let c=t(u.keyType),l=t(u.valueType);return c===u.keyType&&l===u.valueType?a:T(a,{...u,keyType:c,valueType:l})}case"set":{let c=t(u.valueType);return c===u.valueType?a:T(a,{...u,valueType:c})}case"union":{let c=u.options,l=!1,d=[];for(let f of c){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?T(a,{...u,options:d}):a}case"intersection":{let c=t(u.left),l=t(u.right);return c===u.left&&l===u.right?a:T(a,{...u,left:c,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let c=t(u.innerType);return c===u.innerType?a:T(a,{...u,innerType:c})}case"pipe":{let c=t(u.in),l=t(u.out);return c===u.in&&l===u.out?a:T(a,{...u,in:c,out:l})}case"function":{let c=t(u.input),l=t(u.output);return c===u.input&&l===u.output?a:T(a,{...u,input:c,output:l})}case"lazy":{let c=u.getter,{_cachedInner:l,...d}=u;return T(a,{...d,getter:()=>t(c())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return t(e)}function hp(e){return Vr(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Lt(i.options)}})}function cy(e,r){if(!r?.length)return e;let i=e._zod.def;return T(e,de(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function yp(e){return cy(e.out,e.checks)}function sy(e){return e.in._zod.traits.has("$ZodTransform")?yp(e):e.in}function _p(e){return Vr(e,{pipe:r=>sy(r._zod.def),default:(r,i)=>i?Ye(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function bp(e){return Vr(e,{pipe:r=>yp(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var _l={};he(_l,{bigint:()=>my,boolean:()=>fy,date:()=>py,number:()=>dy,string:()=>ly});function ly(e){return Fu(Tt,e)}function dy(e){return Wu(Zt,e)}function fy(e){return tc(Et,e)}function my(e){return nc(Ct,e)}function py(e){return pc(jr,e)}export{ao as a,sg as b,fs as c,ps as d,gs as e,Sr as f,em as g,Ss as h,bi as i,Ps as j,Ns as k,Am as l,qe as m,Or as n,Cm as o,Vm as p,Lt as q,Fm as r,Rs as s,Js as t,Mi as u,Wm as v,Ye as w,op as x,dp as y,Kh as z,Cr as A,_l as B,kp as C};
65
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let a of e.seen.entries()){let u=a[1];if(r===a[0]){n(a);continue}if(e.external){let c=e.external.registry.get(a[0])?.id;if(r!==a[0]&&c){n(a);continue}}if(e.metadataRegistry.get(a[0])?.id){n(a);continue}if(u.cycle){n(a);continue}u.count>1&&e.reused==="ref"&&n(a)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Uf(e){let r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void 0)return;let i=[];for(let o of r){if(!o||typeof o!="object")return;Uf(o);let t=Object.keys(o);if(t.length!==1||t[0]!=="type")return;let n=o.type;for(let a of Array.isArray(n)?n:[n]){if(typeof a!="string")return;i.includes(a)||i.push(a)}}delete e.anyOf,e.type=i.length===1?i[0]:i}var Af=new Set(["type","properties","required","additionalProperties"]),Of=["oneOf","anyOf"];function Nf(e){let r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function Ic(e){let r=[];for(let n of e){if(typeof n!="object"||n.type!=="object")return null;for(let a in n)if(!Af.has(a))return null;r.push(n)}let i={},o=new Set;for(let n of r){for(let a in n.properties){if(Object.prototype.hasOwnProperty.call(i,a))continue;let u=[];for(let c of r){let l=c.properties?.[a]??Nf(c);l!=null&&(u.some(d=>JSON.stringify(d)===JSON.stringify(l))||u.push(l))}let s=u.length===1?u[0]:Ic(u)??{allOf:u};K(i,a,s)}for(let a of n.required??[])o.add(a)}let t={type:"object",properties:i};if(o.size&&(t.required=[...o]),r.every(n=>n.additionalProperties===!1))t.additionalProperties=!1;else{let n=[];for(let a of r){let u=Nf(a);u&&!n.some(s=>JSON.stringify(s)===JSON.stringify(u))&&n.push(u)}n.length===1?t.additionalProperties=n[0]:n.length>1&&(t.additionalProperties={allOf:n})}return t}function Eh(e){let r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(let t of Af)if(t in e)return;let i=r.filter(t=>Of.some(n=>Array.isArray(t[n]))),o=null;if(!i.length)o=Ic(r);else{let t=i[0],n=Of.find(s=>Array.isArray(t[s]));if(Object.keys(t).length!==1)return;let a=r.filter(s=>s!==t),u=t[n].map(s=>Ic([...a,s]));if(u.some(s=>!s))return;o={[n]:u}}o&&(delete e.allOf,wr(e,o))}function Ne(e,r){let i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=u=>{let s=e.seen.get(u);if(s.ref===null)return;let c=s.def??s.schema,l={...c},d=s.ref;if(s.ref=null,d){o(d);let m=e.seen.get(d),v=m.schema;if(v.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(v)):wr(c,v),wr(c,l),u._zod.parent===d)for(let k in c)k==="$ref"||k==="allOf"||k in l||delete c[k];if(v.$ref&&m.def)for(let k in c)k==="$ref"||k==="allOf"||k in m.def&&JSON.stringify(c[k])===JSON.stringify(m.def[k])&&delete c[k]}let f=u._zod.parent;if(f&&f!==d){o(f);let m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(let v in c)v==="$ref"||v==="allOf"||v in m.def&&JSON.stringify(c[v])===JSON.stringify(m.def[v])&&delete c[v]}e.override({zodSchema:u,jsonSchema:c,path:s.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let u of[...e.seen.entries()].reverse())o(u[0]);if(e.target!=="openapi-3.0")for(let u of e.seen.entries())Uf(u[1].def??u[1].schema);for(let u of e.deferred)u();if(e.intersections.length){let u=new Map;for(let s of e.seen.values())for(let c of[s.schema,s.def]){let l=c?.allOf;if(!Array.isArray(l))continue;let d=u.get(l);d?d.push(c):u.set(l,[c])}for(let s of e.intersections)for(let c of u.get(s)??[])Eh(c)}}let t={};if(e.target==="draft-2020-12"?t.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?t.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?t.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let u=e.external.registry.get(r)?.id;if(!u)throw new Error("Schema is missing an `id` property");t.$id=e.external.uri(u)}wr(t,i.defId?i.schema:i.def??i.schema);let n=e.metadataRegistry.get(r)?.id;n!==void 0&&t.id===n&&delete t.id;let a=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let u of e.seen.entries()){let s=u[1];s.def&&s.defId&&(s.def.id===s.defId&&delete s.def.id,K(a,s.defId,s.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?t.$defs=a:t.definitions=a);try{let u=JSON.parse(JSON.stringify(t));return Object.defineProperty(u,"~standard",{value:{...r["~standard"],jsonSchema:{input:jt(r,"input",e.processors),output:jt(r,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Q(e,r){let i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Q(o.element,i);if(o.type==="set")return Q(o.valueType,i);if(o.type==="lazy")return Q(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Q(o.innerType,i);if(o.type==="intersection")return Q(o.left,i)||Q(o.right,i);if(o.type==="record"||o.type==="map")return Q(o.keyType,i)||Q(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Q(o.in,i)||Q(o.out,i);if(o.type==="object"){for(let t in o.shape)if(Q(o.shape[t],i))return!0;return!1}if(o.type==="union"){for(let t of o.options)if(Q(t,i))return!0;return!1}if(o.type==="tuple"){for(let t of o.items)if(Q(t,i))return!0;return!!(o.rest&&Q(o.rest,i))}return!1}var wc=(e,r={})=>i=>{let o=je({...i,processors:r});return E(e,o),Oe(o,e),Ne(o,e)},jt=(e,r,i={})=>o=>{let{libraryOptions:t,target:n}=o??{},a=je({...t??{},target:n,io:r,processors:i});return E(e,a),Oe(a,e),Ne(a,e)};var Ot=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},Nt=(e,r,i)=>{(e[r]===void 0||i<e[r])&&(e[r]=i)},Tf=(e,r)=>{Ot(e,"minimum",r),Nt(e,"maximum",r)},Lf=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},Vf=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},Rf=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},Ff=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Zf=(e,r)=>Ot(e,"minimum",r.minimum),Ef=(e,r)=>Nt(e,"maximum",r.maximum),Cf=e=>(r,i)=>{Ff(r,i.format);let[o,t]=e[i.format];Ot(r,"minimum",o),Nt(r,"maximum",t)},Ch={greater_than:(e,r)=>Ot(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>Nt(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>Lf(e,r.value),number_format:Cf(Kt),bigint_format:Cf(Gt),min_length:Zf,max_length:Ef,length_equals:(e,r)=>Tf(e,r.length),min_size:Zf,max_size:Ef,size_equals:(e,r)=>Tf(e,r.size),string_format:(e,r)=>{Ff(e,r.format),r.pattern&&Vf(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>Rf(e,r.mime)};function J(e){let r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(let n of o)Ch[n._zod.def.check]?.(r,n._zod.def);let t=e._zod.bag;t.minimum!==void 0&&Ot(r,"minimum",t.minimum),t.exclusiveMinimum!==void 0&&Ot(r,"exclusiveMinimum",t.exclusiveMinimum),t.maximum!==void 0&&Nt(r,"maximum",t.maximum),t.exclusiveMaximum!==void 0&&Nt(r,"exclusiveMaximum",t.exclusiveMaximum),t.multipleOf!==void 0&&Lf(r,t.multipleOf),t.format!==void 0&&(r.format??(r.format=t.format),t.format.includes("int")&&(r.isInt=!0)),t.mime&&Rf(r,t.mime);for(let n of t.patterns??[])Vf(r,n);return r}var Lh={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Vh=new Map([[hn,Oo],[lr,No]]),Mf=e=>Vh.get(e)??e,Pc=(e,r,i,o)=>{let t=i;t.type="string";let{minimum:n,maximum:a,format:u,patterns:s,contentEncoding:c,laxFormat:l}=J(e);if(typeof n=="number"&&(t.minLength=n),typeof a=="number"&&(t.maxLength=a),u&&(t.format=Lh[u]??u,t.format===""&&delete t.format,(u==="time"||l)&&delete t.format),c&&(t.contentEncoding=c),s&&s.size>0){let d=[...s].map(Mf);d.length===1?t.pattern=d[0].source:d.length>1&&(t.allOf=[...d.map(f=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Dc=(e,r,i,o)=>{let t=i,{minimum:n,maximum:a,multipleOf:u,exclusiveMaximum:s,exclusiveMinimum:c,isInt:l}=J(e);t.type=l?"integer":"number";let d=typeof c=="number"&&c>=(n??Number.NEGATIVE_INFINITY),f=typeof s=="number"&&s<=(a??Number.POSITIVE_INFINITY),m=r.target==="draft-04"||r.target==="openapi-3.0";if(d?m?(t.minimum=c,t.exclusiveMinimum=!0):t.exclusiveMinimum=c:typeof n=="number"&&(t.minimum=n),f?m?(t.maximum=s,t.exclusiveMaximum=!0):t.exclusiveMaximum=s:typeof a=="number"&&(t.maximum=a),u){let v=new Set;for(let z of u)Number.isFinite(z)&&z!==0?v.add(Math.abs(z)):M(e,r,t,o,`A multipleOf divisor of ${z} cannot be represented in JSON Schema`);let[_,...k]=v;_!==void 0&&(t.multipleOf=_),k.length&&(t.allOf=[...t.allOf??[],...k.map(z=>({multipleOf:z}))])}},jc=(e,r,i,o)=>{i.type="boolean"},Oc=(e,r,i,o)=>{M(e,r,i,o,"BigInt cannot be represented in JSON Schema")},Nc=(e,r,i,o)=>{M(e,r,i,o,"Symbols cannot be represented in JSON Schema")},Uc=(e,r,i,o)=>{r.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Ac=(e,r,i,o)=>{M(e,r,i,o,"Undefined cannot be represented in JSON Schema")},Tc=(e,r,i,o)=>{M(e,r,i,o,"Void cannot be represented in JSON Schema")},Zc=(e,r,i,o)=>{i.not={}},Ec=(e,r,i,o)=>{},Cc=(e,r,i,o)=>{},Lc=(e,r,i,o)=>{M(e,r,i,o,"Date cannot be represented in JSON Schema")},Vc=(e,r,i,o)=>{let t=e._zod.def,n=rt(t.entries);if(n.length===0){i.not={};return}n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),i.enum=n},Rc=(e,r,i,o)=>{let t=e._zod.def;if(t.values.length===0){i.not={};return}let n=[];for(let a of t.values)if(a===void 0){if(M(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof a=="bigint"){if(M(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;n.push(Number(a))}else n.push(a);if(n.length!==0)if(n.length===1){let a=n[0];i.type=a===null?"null":typeof a,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[a]:i.const=a}else n.every(a=>typeof a=="number")&&(i.type="number"),n.every(a=>typeof a=="string")&&(i.type="string"),n.every(a=>typeof a=="boolean")&&(i.type="boolean"),n.every(a=>a===null)&&(i.type="null"),i.enum=n},Fc=(e,r,i,o)=>{M(e,r,i,o,"NaN cannot be represented in JSON Schema")},Mc=(e,r,i,o)=>{let t=i,n=e._zod.pattern;if(!n)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=n.source},Jc=(e,r,i,o)=>{let t=i;t.type="string",t.format="binary",t.contentEncoding="binary";let{minimum:n,maximum:a,mime:u}=J(e);n!==void 0&&(t.minLength=n),a!==void 0&&(t.maxLength=a),u&&(u.length===0?t.not={}:u.length===1?t.contentMediaType=u[0]:t.anyOf=u.map(s=>({contentMediaType:s})))},Bc=(e,r,i,o)=>{i.type="boolean"},Kc=(e,r,i,o)=>{M(e,r,i,o,"Custom types cannot be represented in JSON Schema")},Gc=(e,r,i,o)=>{M(e,r,i,o,"Function types cannot be represented in JSON Schema")},Wc=(e,r,i,o)=>{M(e,r,i,o,"Transforms cannot be represented in JSON Schema")},Xc=(e,r,i,o)=>{M(e,r,i,o,"Map cannot be represented in JSON Schema")},qc=(e,r,i,o)=>{M(e,r,i,o,"Set cannot be represented in JSON Schema")},Yc=(e,r,i,o)=>{let t=i,n=e._zod.def,{minimum:a,maximum:u}=J(e);typeof a=="number"&&(t.minItems=a),typeof u=="number"&&(t.maxItems=u),t.type="array",t.items=E(n.element,r,{...o,path:[...o.path,"items"]})};function zr(e){let r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?zr(r.out):r.type==="catch"?zr(r.innerType):e._zod.optin}var Hc=(e,r,i,o)=>{let t=i,n=e._zod.def,a=n.shape;if(Object.getOwnPropertySymbols(a).length&&M(e,r,t,o,"Symbol keys cannot be represented in JSON Schema"))return;t.type="object",t.properties={};for(let c in a)K(t.properties,c,E(a[c],r,{...o,path:[...o.path,"properties",c]}));let s=[];for(let c of Object.keys(a)){let l=n.shape[c];(r.io==="input"?zr(l)===void 0:l._zod.optout===void 0)&&s.push(c)}s.length>0&&(t.required=s),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=E(n.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(t.additionalProperties=!1)},gi=(e,r,i,o)=>{let t=e._zod.def,n=t.inclusive===!1,a=t.options.map((u,s)=>E(u,r,{...o,path:[...o.path,n?"oneOf":"anyOf",s]}));n?i.oneOf=a:i.anyOf=a},Qc=(e,r,i,o)=>{let t=e._zod.def,n=E(t.left,r,{...o,path:[...o.path,"allOf",0]}),a=E(t.right,r,{...o,path:[...o.path,"allOf",1]}),u=c=>"allOf"in c&&Object.keys(c).length===1,s=[...u(n)?n.allOf:[n],...u(a)?a.allOf:[a]];i.allOf=s,r.intersections.push(s)},es=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="array";let a=r.target==="draft-2020-12"?"prefixItems":"items",u=r.target==="draft-2020-12"||r.target==="openapi-3.0"?"items":"additionalItems",s=n.items.map((_,k)=>E(_,r,{...o,path:[...o.path,a,k]})),c=n.rest?E(n.rest,r,{...o,path:[...o.path,u,...r.target==="openapi-3.0"?[n.items.length]:[]]}):null,l=n.items.length;for(;l>0;){let _=n.items[l-1];if(!(r.io==="input"?zr(_)!==void 0:_._zod.optout==="optional"))break;l--}let d=n.items.length,f=!n.rest;r.target==="draft-2020-12"?(t.prefixItems=s,f?t.items=!1:c&&(t.items=c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):r.target==="openapi-3.0"?(t.items={anyOf:s},c&&t.items.anyOf.push(c),l>0&&(t.minItems=l),f&&(t.maxItems=d)):(t.items=s,f?t.additionalItems=!1:c&&(t.additionalItems=c),l>0&&(t.minItems=l),f&&(t.maxItems=d));let{minimum:m,maximum:v}=J(e);typeof m=="number"&&(t.minItems=m),typeof v=="number"&&(t.maxItems=v)};function zc(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);let v=e.get(r)?.def;if(!v)return r;let _=zc(e,v,i);return _===v?r:_}for(let v of["anyOf","oneOf"]){let _=r[v];if(!Array.isArray(_))continue;let k=_.map(z=>zc(e,z,i));k.some((z,I)=>z!==_[I])&&(r={...r,[v]:k})}let o=Array.isArray(r.type)?r.type:[r.type],t=!o.includes("string")&&o.some(v=>v==="number"||v==="integer"),n=r.enum??(r.const!==void 0?[r.const]:void 0);if(!t&&!n?.some(v=>typeof v=="number"))return r;let{minimum:a,maximum:u,exclusiveMinimum:s,exclusiveMaximum:c,multipleOf:l,format:d,id:f,...m}=r;return m.enum?m.enum=m.enum.map(v=>typeof v=="number"?String(v):v):typeof m.const=="number"&&(m.const=String(m.const)),t&&(m.type="string",n||(m.pattern=(o.includes("number")?be:nr).source)),m}var Sc=new WeakMap;function Rh(e){let r=new Map;for(let o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);let i=new Map;for(let o of Sc.get(e)??[]){let t=e.seen.get(o),n=(t?.def??t?.schema)?.propertyNames;if(!n||n===!0||i.has(n))continue;let a=zc(r,n,new Set);a!==n&&i.set(n,a)}if(i.size)for(let o of e.seen.values())for(let t of[o.schema,o.def]){let n=t&&i.get(t.propertyNames);n&&(t.propertyNames=n)}}var ts=(e,r,i,o)=>{let t=i,n=e._zod.def;t.type="object";let a=n.keyType,u=J(a).patterns;if(n.mode==="loose"&&u&&u.size>0){let l=E(n.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});t.patternProperties={};for(let d of u)K(t.patternProperties,Mf(d).source,l)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){t.propertyNames=E(n.keyType,r,{...o,path:[...o.path,"propertyNames"]});let l=Sc.get(r);l||(l=[],Sc.set(r,l),r.deferred.push(()=>Rh(r))),l.push(e)}t.additionalProperties=E(n.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}let s=a._zod.values,c=r.io==="input"&&zr(n.valueType)!==void 0;if(s&&!n.partial&&!c){let l=[...s].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(t.required=l.map(String))}},rs=(e,r,i,o)=>{let t=e._zod.def,n=E(t.innerType,r,o),a=r.seen.get(e);r.target==="openapi-3.0"?(a.ref=t.innerType,i.nullable=!0):i.anyOf=[n,{type:"null"}]},ns=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},is=Symbol();function Jf(e,r,i,o,t){let n=!1,a=JSON.stringify(e,(u,s)=>typeof s!="bigint"?s:(n=!0,null));return n?(M(r,i,o,t,"BigInt defaults cannot be represented in JSON Schema"),is):JSON.parse(a)}var os=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a=Jf(t.defaultValue,e,r,i,o);a!==is&&(i.default=a)},as=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);if(n.ref=t.innerType,r.io!=="input")return;let a=Jf(t.defaultValue,e,r,i,o);a!==is&&(i._prefault=a)},us=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType;let a;try{a=t.catchValue(void 0)}catch{M(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=a},cs=(e,r,i,o)=>{let t=e._zod.def,n=t.in._zod.traits.has("$ZodTransform"),a=r.io==="input"?n?t.out:t.in:t.out;E(a,r,o);let u=r.seen.get(e);u.ref=a},ss=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType,i.readOnly=!0},ls=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},vi=(e,r,i,o)=>{let t=e._zod.def;E(t.innerType,r,o);let n=r.seen.get(e);n.ref=t.innerType},ds=(e,r,i,o)=>{let t=e._zod.innerType;E(t,r,o);let n=r.seen.get(e);n.ref=t},pi={string:Pc,number:Dc,boolean:jc,bigint:Oc,symbol:Nc,null:Uc,undefined:Ac,void:Tc,never:Zc,any:Ec,unknown:Cc,date:Lc,enum:Vc,literal:Rc,nan:Fc,template_literal:Mc,file:Jc,success:Bc,custom:Kc,function:Gc,transform:Wc,map:Xc,set:qc,array:Yc,object:Hc,union:gi,intersection:Qc,tuple:es,record:ts,nullable:rs,nonoptional:ns,default:os,prefault:as,catch:us,pipe:cs,readonly:ss,promise:ls,optional:vi,lazy:ds};function $i(e,r){if("_idmap"in e){let o=e,t=je({...r,processors:pi}),n={};for(let s of o._idmap.entries()){let[c,l]=s;E(l,t)}let a={},u={registry:o,uri:r?.uri,defs:n};t.external=u;for(let s of o._idmap.entries()){let[c,l]=s;Oe(t,l),K(a,c,Ne(t,l))}if(Object.keys(n).length>0){let s=t.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[s]:n}}return{schemas:a}}let i=je({...r,processors:pi});return E(e,i),Oe(i,e),Ne(i,e)}var hi=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(r){this.ctx.counter=r}get seen(){return this.ctx.seen}constructor(r){let i=r?.target??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=je({processors:pi,target:i,...r?.metadata&&{metadata:r.metadata},...r?.unrepresentable&&{unrepresentable:r.unrepresentable},...r?.override&&{override:r.override},...r?.io&&{io:r.io}})}process(r,i={path:[],schemaPath:[]}){return E(r,this.ctx,i)}emit(r,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Oe(this.ctx,r);let o=Ne(this.ctx,r),{"~standard":t,...n}=o;return n}};var Bf={};var Vt={};he(Vt,{ZodAny:()=>Us,ZodArray:()=>Es,ZodBase64:()=>Ei,ZodBase64URL:()=>Ci,ZodBigInt:()=>Ct,ZodBigIntFormat:()=>Ri,ZodBoolean:()=>Et,ZodCIDRv4:()=>Ti,ZodCIDRv6:()=>Zi,ZodCUID:()=>Pi,ZodCUID2:()=>Di,ZodCatch:()=>il,ZodCodec:()=>Zr,ZodCreditCard:()=>ws,ZodCustom:()=>Er,ZodCustomStringFormat:()=>Qe,ZodDate:()=>jr,ZodDefault:()=>Hs,ZodDiscriminatedUnion:()=>Ls,ZodE164:()=>Li,ZodEmail:()=>Ii,ZodEmoji:()=>zi,ZodEnum:()=>At,ZodExactOptional:()=>Bi,ZodFile:()=>Ws,ZodFunction:()=>pl,ZodGUID:()=>wi,ZodIBAN:()=>zs,ZodIPv4:()=>Ui,ZodIPv6:()=>Ai,ZodISODate:()=>Ae,ZodISODateTime:()=>Ue,ZodISODuration:()=>Ze,ZodISOTime:()=>Te,ZodInstanceOf:()=>$l,ZodIntersection:()=>Vs,ZodJWT:()=>Vi,ZodKSUID:()=>Ni,ZodLazy:()=>dl,ZodLiteral:()=>Gs,ZodMAC:()=>Is,ZodMap:()=>Bs,ZodNaN:()=>al,ZodNanoID:()=>Si,ZodNever:()=>Ts,ZodNonOptional:()=>Ki,ZodNull:()=>Os,ZodNullable:()=>Ys,ZodNumber:()=>Zt,ZodNumberFormat:()=>et,ZodObject:()=>Nr,ZodOptional:()=>Ar,ZodPipe:()=>Tr,ZodPrefault:()=>el,ZodPreprocess:()=>ul,ZodPromise:()=>ml,ZodReadonly:()=>cl,ZodRecord:()=>Ut,ZodSet:()=>Ks,ZodString:()=>Tt,ZodStringFormat:()=>C,ZodSuccess:()=>nl,ZodSymbol:()=>Ds,ZodTemplateLiteral:()=>ll,ZodTransform:()=>Xs,ZodTuple:()=>Fs,ZodType:()=>j,ZodULID:()=>ji,ZodURL:()=>Dr,ZodUUID:()=>$e,ZodUndefined:()=>js,ZodUnion:()=>Ur,ZodUnknown:()=>As,ZodVoid:()=>Zs,ZodXID:()=>Oi,ZodXor:()=>Cs,_ZodString:()=>xi,_default:()=>Qs,_function:()=>np,any:()=>Am,array:()=>Or,base64:()=>pm,base64url:()=>gm,bigint:()=>Dm,boolean:()=>Ps,catch:()=>ol,check:()=>ip,cidrv4:()=>fm,cidrv6:()=>mm,codec:()=>Qm,creditCard:()=>$m,cuid:()=>im,cuid2:()=>om,currencyCode:()=>xm,custom:()=>op,date:()=>Zm,describe:()=>ap,discriminatedUnion:()=>Fm,e164:()=>vm,email:()=>Wf,emoji:()=>rm,enum:()=>Mi,exactOptional:()=>qs,file:()=>Xm,float32:()=>wm,float64:()=>zm,function:()=>np,guid:()=>Xf,hash:()=>Im,hex:()=>km,hostname:()=>bm,httpUrl:()=>tm,iban:()=>hm,instanceof:()=>cp,int:()=>bi,int32:()=>Sm,int64:()=>jm,intersection:()=>Rs,invertCodec:()=>ep,ipv4:()=>sm,ipv6:()=>dm,json:()=>lp,jwt:()=>ym,keyof:()=>Em,ksuid:()=>cm,lazy:()=>fl,literal:()=>Wm,looseObject:()=>Vm,looseRecord:()=>Jm,mac:()=>lm,map:()=>Bm,meta:()=>up,nan:()=>Hm,nanoid:()=>nm,nativeEnum:()=>Gm,never:()=>Fi,nonoptional:()=>rl,null:()=>Ns,nullable:()=>Pr,nullish:()=>qm,number:()=>Ss,object:()=>Cm,optional:()=>Ye,partialRecord:()=>Mm,pipe:()=>ki,prefault:()=>tl,preprocess:()=>dp,promise:()=>rp,readonly:()=>sl,record:()=>Js,refine:()=>gl,set:()=>Km,strictObject:()=>Lm,string:()=>Sr,stringFormat:()=>_m,stringbool:()=>sp,success:()=>Ym,superRefine:()=>vl,symbol:()=>Nm,templateLiteral:()=>tp,transform:()=>Ji,tuple:()=>Ms,uint32:()=>Pm,uint64:()=>Om,ulid:()=>am,undefined:()=>Um,union:()=>Lt,unknown:()=>qe,url:()=>em,uuid:()=>qf,uuidv4:()=>Yf,uuidv6:()=>Hf,uuidv7:()=>Qf,void:()=>Tm,xid:()=>um,xor:()=>Rm});var yi={};he(yi,{endsWith:()=>kt,gt:()=>ge,gte:()=>ue,includes:()=>_t,length:()=>We,lowercase:()=>ht,lt:()=>pe,lte:()=>ae,maxLength:()=>Ge,maxSize:()=>De,mime:()=>It,minLength:()=>ke,minSize:()=>ve,multipleOf:()=>Pe,negative:()=>li,nonnegative:()=>fi,nonpositive:()=>di,normalize:()=>wt,overwrite:()=>me,positive:()=>si,properties:()=>xt,property:()=>mi,regex:()=>$t,size:()=>Ke,slugify:()=>Dt,startsWith:()=>bt,toLowerCase:()=>St,toUpperCase:()=>Pt,trim:()=>zt,uppercase:()=>yt});var Kf=new WeakSet([Object.prototype,Error.prototype]);function _i(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){let o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}var Gf=(e,r)=>{lo.init(e,r),e.name="ZodError";let i=Object.getPrototypeOf(e);Kf.has(i)||(Kf.add(i),_i(i,"format",o=>t=>Qt(o,t)),_i(i,"flatten",o=>t=>Ht(o,t)),_i(i,"addIssue",o=>t=>{o.issues.push(t),o.message=JSON.stringify(o.issues,nt,2)}),_i(i,"addIssues",o=>t=>{o.issues.push(...t),o.message=JSON.stringify(o.issues,nt,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Mh=p("ZodError",Gf),oe=p("ZodError",Gf,void 0,{Parent:Error});var fs=ct(oe),ms=st(oe),ps=lt(oe),gs=dt(oe),vs=Wr(oe),$s=Xr(oe),hs=qr(oe),ys=Yr(oe),_s=Hr(oe),bs=Qr(oe),ks=en(oe),xs=tn(oe);function Bh(){B.localeError||F(An())}function He(){B.memoizer||F({memoizer:$r()})}var j=p("ZodType",(e,r)=>(Bh(),P.init(e,r),e.def=r,e.type=r.type,e),{check(...e){let r=this.def;return this.clone($.mergeDefs(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return T(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(gl(e,r))},superRefine(e,r){return this.check(vl(e,r))},overwrite(e){return this.check(me(e))},optional(){return Ye(this)},exactOptional(){return qs(this)},nullable(){return Pr(this)},nullish(){return Ye(Pr(this))},nonoptional(e){return rl(this,e)},array(){return Or(this)},or(e){return Lt([this,e])},and(e){return Rs(this,e)},transform(e){return ki(this,Ji(e))},default(e){return Qs(this,e)},prefault(e){return tl(this,e)},catch(e){return ol(this,e)},pipe(e){return ki(this,e)},readonly(){return sl(this)},describe(e){let r=this.clone();return G.add(r,{description:e}),r},meta(...e){if(e.length===0)return G.get(this);let r=this.clone();return G.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return $.hide(this,"~standard",{...mn(this),jsonSchema:{input:jt(this,"input"),output:jt(this,"output")}})},set"~standard"(e){$.own(this,"~standard",e)},parse:function e(r,i){return fs(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await ms(this,r,i,{callee:e})},safeParse(e,r){return ps(this,e,r)},async safeParseAsync(e,r){return gs(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){$.own(this,"spa",e)},validate(e,r){return er(this,e,r)},validateAsync(e,r){return tr(this,e,r)},encode:function e(r,i){return vs(this,r,i,{callee:e})},decode:function e(r,i){return $s(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await hs(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await ys(this,r,i,{callee:e})},safeEncode(e,r){return _s(this,e,r)},safeDecode(e,r){return bs(this,e,r)},async safeEncodeAsync(e,r){return ks(this,e,r)},async safeDecodeAsync(e,r){return xs(this,e,r)},toJSONSchema(e){return wc(this,{})(e)},get description(){return G.get(this)?.description},get _def(){return this._zod.def}}),xi=p("_ZodString",(e,r)=>{Fe.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Pc(e,i,o,t)},$.derived({format:e=>J(e).format??null,minLength:e=>J(e).minimum??null,maxLength:e=>J(e).maximum??null},{regex(...e){return this.check($t(...e))},includes(...e){return this.check(_t(...e))},startsWith(...e){return this.check(bt(...e))},endsWith(...e){return this.check(kt(...e))},min(...e){return this.check(ke(...e))},max(...e){return this.check(Ge(...e))},length(...e){return this.check(We(...e))},nonempty(...e){return this.check(ke(1,...e))},lowercase(e){return this.check(ht(e))},uppercase(e){return this.check(yt(e))},trim(){return this.check(zt())},normalize(...e){return this.check(wt(...e))},toLowerCase(){return this.check(St())},toUpperCase(){return this.check(Pt())},slugify(){return this.check(Dt())}})),Tt=p("ZodString",(e,r)=>{Fe.init(e,r),xi.init(e,r)},{email(e){return this.check(Fn(Ii,e))},url(e){return this.check(_r(Dr,e))},jwt(e){return this.check(ci(Vi,e))},emoji(e){return this.check(Wn(zi,e))},guid(e){return this.check(Mn(wi,e))},uuid(e){return this.check(Jn($e,e))},uuidv4(e){return this.check(Bn($e,e))},uuidv6(e){return this.check(Kn($e,e))},uuidv7(e){return this.check(Gn($e,e))},nanoid(e){return this.check(Xn(Si,e))},cuid(e){return this.check(qn(Pi,e))},cuid2(e){return this.check(Yn(Di,e))},ulid(e){return this.check(Hn(ji,e))},base64(e){return this.check(oi(Ei,e))},base64url(e){return this.check(ai(Ci,e))},xid(e){return this.check(Qn(Oi,e))},ksuid(e){return this.check(ei(Ni,e))},ipv4(e){return this.check(ti(Ui,e))},ipv6(e){return this.check(ri(Ai,e))},cidrv4(e){return this.check(ni(Ti,e))},cidrv6(e){return this.check(ii(Zi,e))},e164(e){return this.check(ui(Li,e))},datetime(e){return this.check(br(Ue,e))},date(e){return this.check(kr(Ae,e))},time(e){return this.check(xr(Te,e))},duration(e){return this.check(Ir(Ze,e))}});function Sr(e){return Ru(Tt,e)}var C=p("ZodStringFormat",(e,r)=>{Z.init(e,r),xi.init(e,r)}),Ue=p("ZodISODateTime",(e,r)=>{Oa.init(e,r),C.init(e,r)}),Ae=p("ZodISODate",(e,r)=>{Na.init(e,r),C.init(e,r)}),Te=p("ZodISOTime",(e,r)=>{Ua.init(e,r),C.init(e,r)}),Ze=p("ZodISODuration",(e,r)=>{Aa.init(e,r),C.init(e,r)}),Ii=p("ZodEmail",(e,r)=>{_a.init(e,r),C.init(e,r)});function Wf(e){return Fn(Ii,e)}var wi=p("ZodGUID",(e,r)=>{ha.init(e,r),C.init(e,r)});function Xf(e){return Mn(wi,e)}var $e=p("ZodUUID",(e,r)=>{ya.init(e,r),C.init(e,r)});function qf(e){return Jn($e,e)}function Yf(e){return Bn($e,e)}function Hf(e){return Kn($e,e)}function Qf(e){return Gn($e,e)}var Dr=p("ZodURL",(e,r)=>{xa.init(e,r),C.init(e,r)});function em(e){return _r(Dr,e)}function tm(e){return _r(Dr,{protocol:rr,hostname:Ao,...$.normalizeParams(e)})}var zi=p("ZodEmoji",(e,r)=>{Ia.init(e,r),C.init(e,r)});function rm(e){return Wn(zi,e)}var Si=p("ZodNanoID",(e,r)=>{wa.init(e,r),C.init(e,r)});function nm(e){return Xn(Si,e)}var Pi=p("ZodCUID",(e,r)=>{za.init(e,r),C.init(e,r)});function im(e){return qn(Pi,e)}var Di=p("ZodCUID2",(e,r)=>{Sa.init(e,r),C.init(e,r)});function om(e){return Yn(Di,e)}var ji=p("ZodULID",(e,r)=>{Pa.init(e,r),C.init(e,r)});function am(e){return Hn(ji,e)}var Oi=p("ZodXID",(e,r)=>{Da.init(e,r),C.init(e,r)});function um(e){return Qn(Oi,e)}var Ni=p("ZodKSUID",(e,r)=>{ja.init(e,r),C.init(e,r)});function cm(e){return ei(Ni,e)}var Ui=p("ZodIPv4",(e,r)=>{Ta.init(e,r),C.init(e,r)});function sm(e){return ti(Ui,e)}var Is=p("ZodMAC",(e,r)=>{Ea.init(e,r),C.init(e,r)});function lm(e){return Mu(Is,e)}var Ai=p("ZodIPv6",(e,r)=>{Za.init(e,r),C.init(e,r)});function dm(e){return ri(Ai,e)}var Ti=p("ZodCIDRv4",(e,r)=>{Ca.init(e,r),C.init(e,r)});function fm(e){return ni(Ti,e)}var Zi=p("ZodCIDRv6",(e,r)=>{La.init(e,r),C.init(e,r)});function mm(e){return ii(Zi,e)}var Ei=p("ZodBase64",(e,r)=>{Va.init(e,r),C.init(e,r)});function pm(e){return oi(Ei,e)}var Ci=p("ZodBase64URL",(e,r)=>{Ra.init(e,r),C.init(e,r)});function gm(e){return ai(Ci,e)}var Li=p("ZodE164",(e,r)=>{Fa.init(e,r),C.init(e,r)});function vm(e){return ui(Li,e)}var ws=p("ZodCreditCard",(e,r)=>{Ma.init(e,r),C.init(e,r)});function $m(e){return Ju(ws,e)}var zs=p("ZodIBAN",(e,r)=>{Ja.init(e,r),C.init(e,r)});function hm(e){return Bu(zs,e)}var Vi=p("ZodJWT",(e,r)=>{Ba.init(e,r),C.init(e,r)});function ym(e){return ci(Vi,e)}var Qe=p("ZodCustomStringFormat",(e,r)=>{Ka.init(e,r),C.init(e,r)});function _m(e,r,i={}){return Xe(Qe,e,r,i)}function bm(e){return Xe(Qe,"hostname",Uo,e)}function km(e){return Xe(Qe,"hex",Wo,e)}function xm(e){return Xe(Qe,"currency_code",Zo,e)}function Im(e,r){let i=r?.enc??"hex",o=`${e}_${i}`,t=le[o];if(!t)throw new Error(`Unrecognized hash format: ${o}`);return Xe(Qe,o,t,r)}var Zt=p("ZodNumber",(e,r)=>{xn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Dc(e,i,o,t),e.isFinite=!0},$.derived({minValue:e=>{let{minimum:r,exclusiveMinimum:i}=J(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:r,exclusiveMaximum:i}=J(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:r,multipleOf:i}=J(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>J(e).format??null},{gt(e,r){return this.check(ge(e,r))},gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},int(e){return this.check(bi(e))},safe(e){return this.check(bi(e))},positive(e){return this.check(ge(0,e))},nonnegative(e){return this.check(ue(0,e))},negative(e){return this.check(pe(0,e))},nonpositive(e){return this.check(ae(0,e))},multipleOf(e,r){return this.check(Pe(e,r))},step(e,r){return this.check(Pe(e,r))},finite(){return this}}));function Ss(e){return Gu(Zt,e)}var et=p("ZodNumberFormat",(e,r)=>{Ga.init(e,r),Zt.init(e,r)});function bi(e){return Xu(et,e)}function wm(e){return qu(et,e)}function zm(e){return Yu(et,e)}function Sm(e){return Hu(et,e)}function Pm(e){return Qu(et,e)}var Et=p("ZodBoolean",(e,r)=>{dr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>jc(e,i,o,t)});function Ps(e){return ec(Et,e)}var Ct=p("ZodBigInt",(e,r)=>{In.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Oc(e,i,o,t)},$.derived({minValue:e=>J(e).minimum??null,maxValue:e=>J(e).maximum??null,format:e=>J(e).format??null},{gte(e,r){return this.check(ue(e,r))},min(e,r){return this.check(ue(e,r))},gt(e,r){return this.check(ge(e,r))},lt(e,r){return this.check(pe(e,r))},lte(e,r){return this.check(ae(e,r))},max(e,r){return this.check(ae(e,r))},positive(e){return this.check(ge(BigInt(0),e))},negative(e){return this.check(pe(BigInt(0),e))},nonpositive(e){return this.check(ae(BigInt(0),e))},nonnegative(e){return this.check(ue(BigInt(0),e))},multipleOf(e,r){return this.check(Pe(e,r))}}));function Dm(e){return rc(Ct,e)}var Ri=p("ZodBigIntFormat",(e,r)=>{Wa.init(e,r),Ct.init(e,r)});function jm(e){return ic(Ri,e)}function Om(e){return oc(Ri,e)}var Ds=p("ZodSymbol",(e,r)=>{Xa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Nc(e,i,o,t)});function Nm(e){return ac(Ds,e)}var js=p("ZodUndefined",(e,r)=>{qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ac(e,i,o,t)});function Um(e){return uc(js,e)}var Os=p("ZodNull",(e,r)=>{Ya.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Uc(e,i,o,t)});function Ns(e){return cc(Os,e)}var Us=p("ZodAny",(e,r)=>{Ha.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Ec(e,i,o,t)});function Am(){return sc(Us)}var As=p("ZodUnknown",(e,r)=>{Qa.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Cc(e,i,o,t)});function qe(){return lc(As)}var Ts=p("ZodNever",(e,r)=>{eu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Zc(e,i,o,t)});function Fi(e){return dc(Ts,e)}var Zs=p("ZodVoid",(e,r)=>{tu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Tc(e,i,o,t)});function Tm(e){return fc(Zs,e)}var jr=p("ZodDate",(e,r)=>{ru.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Lc(e,i,o,t),e.min=(i,o)=>e.check(ue(i,o)),e.max=(i,o)=>e.check(ae(i,o))},$.derived({minDate:e=>{let{minimum:r}=J(e);return r?new Date(r):null},maxDate:e=>{let{maximum:r}=J(e);return r?new Date(r):null}},{}));function Zm(e){return mc(jr,e)}var Es=p("ZodArray",(e,r)=>{He(),iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Yc(e,i,o,t),e.element=r.element},{min(e,r){return this.check(ke(e,r))},nonempty(e){return this.check(ke(1,e))},max(e,r){return this.check(Ge(e,r))},length(e,r){return this.check(We(e,r))},unwrap(){return this.element}});function Or(e,r){return vc(Es,e,r)}function Em(e){let r=e._zod.def.shape;return Mi(Object.keys(r))}var Nr=p("ZodObject",(e,r)=>{He(),ou.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Hc(e,i,o,t),$.installLazyProp(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return Mi(Object.keys(this._zod.def.shape))},catchall(e){return this.clone($.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},loose(){return this.clone($.mergeDefs(this._zod.def,{catchall:qe()}))},strict(){return this.clone($.mergeDefs(this._zod.def,{catchall:Fi()}))},strip(){return this.clone($.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return $.extend(this,e)},safeExtend(e){return $.safeExtend(this,e)},merge(e){return $.merge(this,e)},pick(e){return $.pick(this,e)},omit(e){return $.omit(this,e)},partial(...e){return $.partial(Ar,this,e[0])},exactPartial(...e){return $.partial(Bi,this,e[0],"exactPartial")},required(...e){return $.required(Ki,this,e[0])}});function Cm(e,r){let i={type:"object",shape:e??{},...$.normalizeParams(r)};return new Nr(i)}function Lm(e,r){return new Nr({type:"object",shape:e,catchall:Fi(),...$.normalizeParams(r)})}function Vm(e,r){return new Nr({type:"object",shape:e,catchall:qe(),...$.normalizeParams(r)})}var Ur=p("ZodUnion",(e,r)=>{fr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.options=r.options});function Lt(e,r){return new Ur({type:"union",options:e,...$.normalizeParams(r)})}var Cs=p("ZodXor",(e,r)=>{Ur.init(e,r),au.init(e,r),e._zod.processJSONSchema=(i,o,t)=>gi(e,i,o,t),e.options=r.options});function Rm(e,r){return new Cs({type:"union",options:e,inclusive:!1,...$.normalizeParams(r)})}var Ls=p("ZodDiscriminatedUnion",(e,r)=>{Ur.init(e,r),cu.init(e,r)});function Fm(e,r,i){return new Ls({type:"union",options:r,discriminator:e,...$.normalizeParams(i)})}var Vs=p("ZodIntersection",(e,r)=>{su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Qc(e,i,o,t)});function Rs(e,r){return new Vs({type:"intersection",left:e,right:r})}var Fs=p("ZodTuple",(e,r)=>{He(),wn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>es(e,i,o,t)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(r=>new Ar({type:"optional",innerType:r}))})}});function Ms(e,r,i){let o=r instanceof P,t=o?i:r,n=o?r:null;return new Fs({type:"tuple",items:e,rest:n,...$.normalizeParams(t)})}var Ut=p("ZodRecord",(e,r)=>{He(),lu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ts(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType});function Js(e,r,i){return!r||!r._zod?new Ut({type:"record",keyType:Sr(),valueType:e,...$.normalizeParams(r)}):new Ut({type:"record",keyType:e,valueType:r,...$.normalizeParams(i)})}function Mm(e,r,i){return new Ut({type:"record",keyType:e,valueType:r,...$.normalizeParams(i),partial:!0})}function Jm(e,r,i){return new Ut({type:"record",keyType:e,valueType:r,mode:"loose",...$.normalizeParams(i)})}var Bs=p("ZodMap",(e,r)=>{He(),du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Xc(e,i,o,t),e.keyType=r.keyType,e.valueType=r.valueType,e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(De(...i)),e.size=(...i)=>e.check(Ke(...i))});function Bm(e,r,i){return new Bs({type:"map",keyType:e,valueType:r,...$.normalizeParams(i)})}var Ks=p("ZodSet",(e,r)=>{He(),fu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>qc(e,i,o,t),e.min=(...i)=>e.check(ve(...i)),e.nonempty=i=>e.check(ve(1,i)),e.max=(...i)=>e.check(De(...i)),e.size=(...i)=>e.check(Ke(...i))});function Km(e,r){return new Ks({type:"set",valueType:e,...$.normalizeParams(r)})}var At=p("ZodEnum",(e,r)=>{mu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(o,t,n)=>Vc(e,o,t,n),e.enum=r.entries,e.options=[...e._zod.values];let i=new Set(Object.keys(r.entries));e.extract=(o,t)=>{let n={};for(let a of o)if(i.has(a))n[a]=r.entries[a];else throw new Error(`Key ${a} not found in enum`);return new At({...r,checks:[],...$.normalizeParams(t),entries:n})},e.exclude=(o,t)=>{let n={...r.entries};for(let a of o)if(i.has(a))delete n[a];else throw new Error(`Key ${a} not found in enum`);return new At({...r,checks:[],...$.normalizeParams(t),entries:n})}});function Mi(e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new At({type:"enum",entries:i,...$.normalizeParams(r)})}function Gm(e,r){return new At({type:"enum",entries:e,...$.normalizeParams(r)})}var Gs=p("ZodLiteral",(e,r)=>{pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Rc(e,i,o,t),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function Wm(e,r){return new Gs({type:"literal",values:Array.isArray(e)?e:[e],...$.normalizeParams(r)})}var Ws=p("ZodFile",(e,r)=>{gu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Jc(e,i,o,t),e.min=(i,o)=>e.check(ve(i,o)),e.max=(i,o)=>e.check(De(i,o)),e.mime=(i,o)=>e.check(It(Array.isArray(i)?i:[i],o))});function Xm(e){return $c(Ws,e)}var Xs=p("ZodTransform",(e,r)=>{He(),vu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Wc(e,i,o,t),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new ze(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push($.issue(n,i.value,r));else{let a=n;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),"input"in a||(a.input=i.value),a.inst??(a.inst=e),i.issues.push($.issue(a))}};let t=r.transform(i.value,i);return t instanceof Promise?t.then(n=>(i.value=n,i)):(i.value=t,i)}});function Ji(e){return new Xs({type:"transform",transform:e})}var Ar=p("ZodOptional",(e,r)=>{zn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ye(e){return new Ar({type:"optional",innerType:e})}var Bi=p("ZodExactOptional",(e,r)=>{$u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>vi(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function qs(e){return new Bi({type:"optional",innerType:e})}var Ys=p("ZodNullable",(e,r)=>{hu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>rs(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Pr(e){return new Ys({type:"nullable",innerType:e})}function qm(e){return Ye(Pr(e))}var Hs=p("ZodDefault",(e,r)=>{yu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>os(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Qs(e,r){return new Hs({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var el=p("ZodPrefault",(e,r)=>{_u.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>as(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function tl(e,r){return new el({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():$.shallowClone(r)}})}var Ki=p("ZodNonOptional",(e,r)=>{bu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ns(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function rl(e,r){return new Ki({type:"nonoptional",innerType:e,...$.normalizeParams(r)})}var nl=p("ZodSuccess",(e,r)=>{ku.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Bc(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function Ym(e){return new nl({type:"success",innerType:e})}var il=p("ZodCatch",(e,r)=>{xu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>us(e,i,o,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ol(e,r){return new il({type:"catch",innerType:e,catchValue:typeof r=="function"?r:$.constantCatch(r)})}var al=p("ZodNaN",(e,r)=>{Iu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Fc(e,i,o,t)});function Hm(e){return gc(al,e)}var Tr=p("ZodPipe",(e,r)=>{Sn.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>cs(e,i,o,t),e.in=r.in,e.out=r.out});function ki(e,r){return new Tr({type:"pipe",in:e,out:r})}var Zr=p("ZodCodec",(e,r)=>{Tr.init(e,r),mr.init(e,r)});function Qm(e,r,i){return new Zr({type:"pipe",in:e,out:r,transform:i.decode,reverseTransform:i.encode})}function ep(e){let r=e._zod.def;return new Zr({type:"pipe",in:r.out,out:r.in,transform:r.reverseTransform,reverseTransform:r.transform})}var ul=p("ZodPreprocess",(e,r)=>{Tr.init(e,r),wu.init(e,r)}),cl=p("ZodReadonly",(e,r)=>{zu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ss(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function sl(e){return new cl({type:"readonly",innerType:e})}var ll=p("ZodTemplateLiteral",(e,r)=>{Su.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Mc(e,i,o,t)});function tp(e,r){return new ll({type:"template_literal",parts:e,...$.normalizeParams(r)})}var dl=p("ZodLazy",(e,r)=>{pr.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ds(e,i,o,t),e.unwrap=()=>e._zod.def.getter()});function fl(e){return new dl({type:"lazy",getter:e})}var ml=p("ZodPromise",(e,r)=>{Du.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>ls(e,i,o,t),e.unwrap=()=>e._zod.def.innerType});function rp(e){return new ml({type:"promise",innerType:e})}var pl=p("ZodFunction",(e,r)=>{Pu.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Gc(e,i,o,t)});function np(e){return new pl({type:"function",input:Array.isArray(e?.input)?Ms(e?.input):e?.input??Or(qe()),output:e?.output??qe()})}var Er=p("ZodCustom",(e,r)=>{ju.init(e,r),j.init(e,r),e._zod.processJSONSchema=(i,o,t)=>Kc(e,i,o,t)});function ip(e){let r=new L({check:"custom"});return r._zod.check=e,r}function op(e,r){return hc(Er,e??(()=>!0),r)}function gl(e,r={}){return yc(Er,e,r)}function vl(e,r){return _c(e,r)}var ap=bc,up=kc,$l=p("ZodInstanceOf",(e,r)=>{Er.init(e,r)},{properties(e,r){return this.check(xt(e,r))}});function cp(e,r={}){let i=new $l({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...$.normalizeParams(r)});return i._zod.bag.Class=e,i._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:i,path:[...i._zod.def.path??[]]})},i}var sp=(...e)=>xc({Codec:Zr,Boolean:Et,String:Tt},...e);function lp(e){let r=fl(()=>Lt([Sr(e),Ss(),Ps(),Ns(),Or(r),Js(Sr(),r)]));return r}function dp(e,r){return new ul({type:"pipe",in:Ji(e),out:r})}var Kh={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 Gh(e){F({customError:e})}function Wh(){return F().customError}var hl;hl||(hl={});var Cr={};he(Cr,{ZodISODate:()=>Ae,ZodISODateTime:()=>Ue,ZodISODuration:()=>Ze,ZodISOTime:()=>Te,date:()=>qh,datetime:()=>Xh,duration:()=>Hh,time:()=>Yh});function Xh(e){return br(Ue,e)}function qh(e){return kr(Ae,e)}function Yh(e){return xr(Te,e)}function Hh(e){return Ir(Ze,e)}var x={...Vt,...yi,iso:Cr},Qh=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 ey(e,r){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":r??"draft-2020-12"}function fp(e,r){return e.map((i,o)=>o<r?i:i.optional())}function ty(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ry(e,r){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return r.rootSchema;let o=r.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===o){let t=i[1]===void 0?void 0:ty(i[1]);if(!t||!r.defs[t])throw new Error(`Reference not found: ${e}`);return r.defs[t]}throw new Error(`Reference not found: ${e}`)}function ny(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(typeof t!="object"||t===null||Array.isArray(t))return;let n=Object.getOwnPropertyNames(t);if(r.minProperties!==void 0&&n.length<r.minProperties&&o.issues.push({origin:"object",code:"too_small",minimum:r.minProperties,inclusive:!0,message:`Too small: expected object to have >=${r.minProperties} properties`,input:t,inst:e,continue:!0}),r.maxProperties!==void 0&&n.length>r.maxProperties&&o.issues.push({origin:"object",code:"too_big",maximum:r.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${r.maxProperties} properties`,input:t,inst:e,continue:!0}),r.keySchema)for(let a of n){let u=r.keySchema.safeParse(a);u.success||o.issues.push({code:"invalid_key",origin:"record",issues:u.error.issues,input:a,path:[a],continue:!0})}}).pipe(e)}function yl(e,r){if(e===null)return"z";let i=typeof e;if(i!=="object"){if(i==="number"&&Number.isNaN(e))return null;let o=String(e);return`${i[0]}${o.length}:${o}`}if(r.has(e))return null;r.add(e);try{if(Array.isArray(e)){let n=[];for(let a of e){let u=yl(a,r);if(u===null)return null;n.push(u)}return`a${n.length}:[${n.join(",")}]`}let o=Object.keys(e).sort(),t=[];for(let n of o){let a=yl(e[n],r);if(a===null)return null;t.push(`${n.length}:${n}=${a}`)}return`o${t.length}:{${t.join(",")}}`}finally{r.delete(e)}}var iy=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),oy=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Lr(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Lr):typeof e.$ref=="string"?!0:Object.entries(e).some(([r,i])=>iy.has(r)?Lr(i):!oy.has(r)||typeof i!="object"||i===null?!1:Object.values(i).some(Lr))}function mp(e){return e===1?"element":"elements"}function ay(e,r){return x.transform(o=>o).check(o=>{let t=o.value;if(Array.isArray(t)){if(r.uniqueItems===!0){let n=new Map;for(let a=0;a<t.length;a++){let u=yl(t[a],new Set);if(u===null)continue;let s=n.get(u);if(s===void 0){n.set(u,a);continue}o.issues.push({code:"custom",message:`Array items must be unique: element at index ${a} duplicates the one at index ${s}`,input:t,path:[a],continue:!0})}}if(r.containsSchema){let n=r.minContains??1,a=r.maxContains!==void 0?r.maxContains+1:Number.POSITIVE_INFINITY,u=0;for(let s of t)if(r.containsSchema.safeParse(s).success&&++u>=a)break;u<n&&o.issues.push({code:"custom",message:`Array must contain at least ${n} matching ${mp(n)}; found ${u}`,input:t,continue:!0}),r.maxContains!==void 0&&u>r.maxContains&&o.issues.push({code:"custom",message:`Array must contain at most ${r.maxContains} matching ${mp(r.maxContains)}`,input:t,continue:!0})}}}).pipe(e)}function pp(e,r){if(e!==!1)return e===void 0||e===!0?x.any():ee(e,r)}var uy=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function gp(e,r){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return x.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let t=e.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return x.lazy(()=>{if(!r.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let n=ry(t,r),a=ee(n,r);return r.refs.set(t,a),r.processing.delete(t),a}if(e.enum!==void 0){let t=e.enum;if(r.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return x.null();if(t.length===0)return x.never();if(t.length===1)return x.literal(t[0]);if(t.every(a=>typeof a=="string"))return x.enum(t);let n=t.map(a=>x.literal(a));return n.length<2?n[0]:x.union([n[0],n[1],...n.slice(2)])}if(e.const!==void 0)return x.literal(e.const);let i=e.type;if(Array.isArray(i)){let t=i.map(n=>{let a={...e,type:n};return gp(a,r)});return t.length===0?x.never():t.length===1?t[0]:x.union(t)}if(!i)return x.any();let o;switch(i){case"string":{let t=x.string();if(e.format){let n=e.format;n==="email"?t=t.check(x.email()):n==="uri"||n==="uri-reference"?t=t.check(x.url()):n==="uuid"||n==="guid"?t=t.check(x.uuid()):n==="date-time"?t=t.check(x.iso.datetime({offset:!0})):n==="date"?t=t.check(x.iso.date()):n==="time"?t=t.check(x.regex(uy)):n==="duration"?t=t.check(x.iso.duration()):n==="hostname"?t=t.check(x.hostname()):n==="ipv4"?t=t.check(x.ipv4()):n==="ipv6"?t=t.check(x.ipv6()):n==="mac"?t=t.check(x.mac()):n==="cidr"?t=t.check(x.cidrv4()):n==="cidr-v6"?t=t.check(x.cidrv6()):n==="base64"?t=t.check(x.base64()):n==="base64url"?t=t.check(x.base64url()):n==="e164"?t=t.check(x.e164()):n==="credit_card"?t=t.check(x.creditCard()):n==="iban"?t=t.check(x.iban()):n==="jwt"?t=t.check(x.jwt()):n==="emoji"?t=t.check(x.emoji()):n==="nanoid"?t=t.check(x.nanoid()):n==="cuid"?t=t.check(x.cuid()):n==="cuid2"?t=t.check(x.cuid2()):n==="ulid"?t=t.check(x.ulid()):n==="xid"?t=t.check(x.xid()):n==="ksuid"&&(t=t.check(x.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),o=t;break}case"number":case"integer":{let t=i==="integer"?x.number().int():x.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),o=t;break}case"boolean":{o=x.boolean();break}case"null":{o=x.null();break}case"object":{let t={},n=e.properties||{},a=new Set(e.required||[]),u=typeof e.additionalProperties=="object"?ee(e.additionalProperties,r):void 0;for(let[d,f]of Object.entries(n)){let m=ee(f,r);K(t,d,a.has(d)?m:m.optional())}if(e.patternProperties){let d=e.patternProperties,f=Object.keys(d),m=[];for(let _ of f){let k=ee(d[_],r),z=x.string().regex(new RegExp(_));m.push(x.looseRecord(z,k))}let v=[];if(Object.keys(t).length>0&&v.push(x.object(t).passthrough()),v.push(...m),v.length===0)o=x.object({}).passthrough();else if(v.length===1)o=v[0];else{let _=x.intersection(v[0],v[1]);for(let k=2;k<v.length;k++)_=x.intersection(_,v[k]);o=_}if(e.additionalProperties===!1){let _=Object.keys(t),k=f.map(I=>new RegExp(I)),z=o;o=o.check(I=>{if(!ce(I.value))return;let D=[];for(let A of Object.keys(I.value))_.includes(A)||k.some(V=>V.test(A))||D.push(A);D.length&&I.issues.push({code:"unrecognized_keys",keys:D,input:I.value,inst:z})})}}else{let d=x.object(t);e.additionalProperties===!1?o=d.strict():u?o=d.catchall(u):o=d.passthrough()}let s=e.propertyNames!==void 0&&e.propertyNames!==!0,c=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(s||c!==void 0||l!==void 0){let d;if(s){let f=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=ee(f,r)}o=ny(o,{keySchema:d,minProperties:c,maxProperties:l})}break}case"array":{let t=e.prefixItems,n=e.items;if(t&&Array.isArray(t)){let a=typeof e.minItems=="number"?e.minItems:0,u=t.map(d=>ee(d,r)),s=fp(u,a),c=Array.isArray(n)?void 0:pp(n,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(Array.isArray(n)){let a=typeof e.minItems=="number"?e.minItems:0,u=n.map(d=>ee(d,r)),s=fp(u,a),c=pp(e.additionalItems,r),l=x.tuple(s);o=c?l.rest(c):l,typeof e.minItems=="number"&&(o=o.check(x.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(x.maxLength(e.maxItems)))}else if(n!==void 0){let a=ee(n,r),u=x.array(a);typeof e.minItems=="number"&&(u=u.min(e.minItems)),typeof e.maxItems=="number"&&(u=u.max(e.maxItems)),o=u}else o=x.array(x.any());(e.uniqueItems===!0||e.contains!==void 0)&&(o=ay(o,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?ee(e.contains,r):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${i}`)}return o}function ee(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i=gp(e,r),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let u=e.anyOf.map(c=>ee(c,r)),s=x.union(u);i=o?x.intersection(i,s):s}if(e.oneOf&&Array.isArray(e.oneOf)){let u=e.oneOf.map(c=>ee(c,r)),s=x.xor(u);i=o?x.intersection(i,s):s}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=o?i:x.any();else{let u=o?i:ee(e.allOf[0],r),s=o?0:1;for(let c=s;c<e.allOf.length;c++)u=x.intersection(u,ee(e.allOf[c],r));i=u}e.nullable===!0&&r.version==="openapi-3.0"&&(i=x.nullable(i)),e.readOnly===!0&&(i=x.readonly(i)),e.default!==void 0&&(i=i.default(e.default));let t={},n=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let u of n)u in e&&(t[u]=e[u]);let a=["contentEncoding","contentMediaType","contentSchema"];for(let u of a)u in e&&(t[u]=e[u]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Lr(e.propertyNames)&&(t.propertyNames=e.propertyNames);for(let u of["minProperties","maxProperties"])e[u]!==void 0&&(t[u]=e[u])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Lr(e.contains)&&(t.contains=e.contains);for(let u of["uniqueItems","minContains","maxContains"])e[u]!==void 0&&(t[u]=e[u])}for(let u of Object.keys(e))Qh.has(u)||K(t,u,e[u]);return Object.keys(t).length>0&&r.registry.add(i,t),e.description&&(i=i.describe(e.description)),i}function vp(e,r){if(typeof e=="boolean")return e?x.any():x.never();let i;try{i=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=ey(i,r?.defaultTarget),t=i.$defs||i.definitions||{},n={version:o,defs:t,refs:new Map,processing:new Set,rootSchema:i,registry:r?.registry??G};return ee(i,n)}var $p=Symbol("z.visit/resolving");function Vr(e,r){let i=typeof r=="function"?r:(a,u)=>{let s=r[a._zod.def.type];return s?s(a,u):a},o=new Map;function t(a){let u=o.get(a);if(u===$p)return new pr({type:"lazy",getter:()=>o.get(a)});if(u!==void 0)return u;o.set(a,$p);let s=n(a),c=i(s,s!==a);return o.set(a,c),c}function n(a){let u=a._zod.def,s=u.type;switch(s){case"object":{let c=u.shape,l=Object.keys(c),d=!1,f={};for(let v of l){let _=t(c[v]);_!==c[v]&&(d=!0),f[v]=_}let m=u.catchall;return u.catchall&&(m=t(u.catchall),m!==u.catchall&&(d=!0)),d?T(a,{...u,shape:f,catchall:m}):a}case"array":{let c=t(u.element);return c===u.element?a:T(a,{...u,element:c})}case"tuple":{let c=u.items,l=!1,d=[];for(let m of c){let v=t(m);v!==m&&(l=!0),d.push(v)}let f=u.rest;return u.rest&&(f=t(u.rest),f!==u.rest&&(l=!0)),l?T(a,{...u,items:d,rest:f}):a}case"record":case"map":{let c=t(u.keyType),l=t(u.valueType);return c===u.keyType&&l===u.valueType?a:T(a,{...u,keyType:c,valueType:l})}case"set":{let c=t(u.valueType);return c===u.valueType?a:T(a,{...u,valueType:c})}case"union":{let c=u.options,l=!1,d=[];for(let f of c){let m=t(f);m!==f&&(l=!0),d.push(m)}return l?T(a,{...u,options:d}):a}case"intersection":{let c=t(u.left),l=t(u.right);return c===u.left&&l===u.right?a:T(a,{...u,left:c,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let c=t(u.innerType);return c===u.innerType?a:T(a,{...u,innerType:c})}case"pipe":{let c=t(u.in),l=t(u.out);return c===u.in&&l===u.out?a:T(a,{...u,in:c,out:l})}case"function":{let c=t(u.input),l=t(u.output);return c===u.input&&l===u.output?a:T(a,{...u,input:c,output:l})}case"lazy":{let c=u.getter,{_cachedInner:l,...d}=u;return T(a,{...d,getter:()=>t(c())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return a;default:return a}}return t(e)}function hp(e){return Vr(e,{object:r=>r.partial(),union:r=>{let i=r._zod.def;return i.discriminator===void 0?r:Lt(i.options)}})}function cy(e,r){if(!r?.length)return e;let i=e._zod.def;return T(e,de(i,{checks:[...i.checks??[],...r]}),{parent:!0})}function yp(e){return cy(e.out,e.checks)}function sy(e){return e.in._zod.traits.has("$ZodTransform")?yp(e):e.in}function _p(e){return Vr(e,{pipe:r=>sy(r._zod.def),default:(r,i)=>i?Ye(r._zod.def.innerType):r,catch:(r,i)=>i?r._zod.def.innerType:r})}function bp(e){return Vr(e,{pipe:r=>yp(r._zod.def),prefault:(r,i)=>i?r._zod.def.innerType:r})}var _l={};he(_l,{bigint:()=>my,boolean:()=>fy,date:()=>py,number:()=>dy,string:()=>ly});function ly(e){return Fu(Tt,e)}function dy(e){return Wu(Zt,e)}function fy(e){return tc(Et,e)}function my(e){return nc(Ct,e)}function py(e){return pc(jr,e)}export{ao as a,sg as b,fs as c,ps as d,gs as e,Sr as f,em as g,Ss as h,Ps as i,Ns as j,Am as k,qe as l,Or as m,Cm as n,Vm as o,Lt as p,Fm as q,Rs as r,Js as s,Mi as t,Wm as u,Ye as v,op as w,dp as x,Kh as y,Cr as z,_l as A,kp as B};
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __yukinoCreateRequire } from "node:module";
3
+ const require = __yukinoCreateRequire(import.meta.url);
4
+ import{sc as _,tc as s,yc as O}from"./chunk-5AOJ5ZSQ.js";var L="yukino",N="@yukino.js/yukino",I="none",S="console",l="otlp",u="prometheus",x="grpc",k="http/json",i="http/protobuf",a=i,y="agent",P="generation",M="tool",C="DEFAULT",U="ERROR",d="error.type",f="yukino.mode",D="session.hash",V="token.type",B="yukino.agent.runs",m="yukino.agent.duration",G="yukino.llm.requests",g="yukino.llm.tokens",h="yukino.llm.time_to_first_token",H="yukino.llm.duration",K="yukino.tool.calls",F="yukino.tool.duration",X="yukino.agent.run",b="yukino.llm.generate",j="yukino.tool.execute",v="yukino.error",w="yukino.llm.error",Y="yukino.tool.error",$="ms",W=0,q="Tool returned an error",r="[redacted]",R=/(?:authorization|api[_-]?key|password|secret|credential|(?:^|[_-])token(?:$|[_-])|access[_-]?token|refresh[_-]?token|private[_-]?key|(?:^|[_-])dsn(?:$|[_-])|^(?:cookie|set-cookie)$)/iu;import{homedir as A}from"os";function to(c){let p=_(),T=o=>{o=s(o,p,r);let t=A();return t&&t!=="/"&&(o=o.replaceAll(t,"~").replaceAll(encodeURIComponent(t),"~")),o},E=new WeakSet,n=o=>{if(!(typeof o!="object"||o===null||E.has(o))){if(E.add(o),Array.isArray(o))for(let t=0;t<o.length;t++){let e=o[t];typeof e=="string"?o[t]=T(e):n(e)}else if(O(o))for(let[t,e]of Object.entries(o))R.test(t)?o[t]=r:typeof e=="string"?o[t]=T(e):n(e)}};n(c)}export{L as a,N as b,I as c,S as d,l as e,u as f,x as g,k as h,i,a as j,y as k,P as l,M as m,C as n,U as o,d as p,f as q,D as r,V as s,B as t,m as u,G as v,g as w,h as x,H as y,K as z,F as A,X as B,b as C,j as D,v as E,w as F,Y as G,$ as H,W as I,q as J,to as K};
@@ -4,9 +4,9 @@ import {
4
4
  markLastUserTailForCache,
5
5
  markToolsForCache,
6
6
  needsToolSearchBeta
7
- } from "./chunk-TO34ITLQ.js";
8
- import "./chunk-UU6ZV6GB.js";
9
- import "./chunk-T4WEXOQ7.js";
7
+ } from "./chunk-OPEO6D4O.js";
8
+ import "./chunk-NIUCGP4C.js";
9
+ import "./chunk-3QGT2MSI.js";
10
10
  import "./chunk-TRGKUGHQ.js";
11
11
  export {
12
12
  AnthropicClient,