ai-sdk-react-model-picker
Version:
A flexible, theme-aware React component library for selecting and managing AI models. Built for seamless integration with Vercel's AI SDK v5, with special support for VSCode extensions and JetBrains IDEs.
1,569 lines • 119 kB
JavaScript
const Qu = Object.freeze({
status: "aborted"
});
function u(e, n, t) {
function r(c, l) {
var f;
Object.defineProperty(c, "_zod", {
value: c._zod ?? {},
enumerable: !1
}), (f = c._zod).traits ?? (f.traits = /* @__PURE__ */ new Set()), c._zod.traits.add(e), n(c, l);
for (const p in i.prototype)
p in c || Object.defineProperty(c, p, { value: i.prototype[p].bind(c) });
c._zod.constr = i, c._zod.def = l;
}
const o = t?.Parent ?? Object;
class s extends o {
}
Object.defineProperty(s, "name", { value: e });
function i(c) {
var l;
const f = t?.Parent ? new s() : this;
r(f, c), (l = f._zod).deferred ?? (l.deferred = []);
for (const p of f._zod.deferred)
p();
return f;
}
return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
value: (c) => t?.Parent && c instanceof t.Parent ? !0 : c?._zod?.traits?.has(e)
}), Object.defineProperty(i, "name", { value: e }), i;
}
const ec = Symbol("zod_brand");
class M extends Error {
constructor() {
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
}
}
class Oe extends Error {
constructor(n) {
super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
}
}
const ye = {};
function S(e) {
return e && Object.assign(ye, e), ye;
}
function Dr(e) {
return e;
}
function Fr(e) {
return e;
}
function Rr(e) {
}
function Ur(e) {
throw new Error();
}
function Mr(e) {
}
function un(e) {
const n = Object.values(e).filter((r) => typeof r == "number");
return Object.entries(e).filter(([r, o]) => n.indexOf(+r) === -1).map(([r, o]) => o);
}
function Lr(e, n = "|") {
return e.map((t) => fn(t)).join(n);
}
function ie(e, n) {
return typeof n == "bigint" ? n.toString() : n;
}
function q(e) {
return {
get value() {
{
const n = e();
return Object.defineProperty(this, "value", { value: n }), n;
}
}
};
}
function R(e) {
return e == null;
}
function fe(e) {
const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
return e.slice(n, t);
}
function cn(e, n) {
const t = (e.toString().split(".")[1] || "").length, r = n.toString();
let o = (r.split(".")[1] || "").length;
if (o === 0 && /\d?e-\d?/.test(r)) {
const l = r.match(/\d?e-(\d?)/);
l?.[1] && (o = Number.parseInt(l[1]));
}
const s = t > o ? t : o, i = Number.parseInt(e.toFixed(s).replace(".", "")), c = Number.parseInt(n.toFixed(s).replace(".", ""));
return i % c / 10 ** s;
}
const Ve = Symbol("evaluating");
function g(e, n, t) {
let r;
Object.defineProperty(e, n, {
get() {
if (r !== Ve)
return r === void 0 && (r = Ve, r = t()), r;
},
set(o) {
Object.defineProperty(e, n, {
value: o
// configurable: true,
});
},
configurable: !0
});
}
function pe(e) {
return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
}
function I(e, n, t) {
Object.defineProperty(e, n, {
value: t,
writable: !0,
enumerable: !0,
configurable: !0
});
}
function C(...e) {
const n = {};
for (const t of e) {
const r = Object.getOwnPropertyDescriptors(t);
Object.assign(n, r);
}
return Object.defineProperties({}, n);
}
function Br(e) {
return C(e._zod.def);
}
function Vr(e, n) {
return n ? n.reduce((t, r) => t?.[r], e) : e;
}
function Wr(e) {
const n = Object.keys(e), t = n.map((r) => e[r]);
return Promise.all(t).then((r) => {
const o = {};
for (let s = 0; s < n.length; s++)
o[n[s]] = r[s];
return o;
});
}
function Gr(e = 10) {
const n = "abcdefghijklmnopqrstuvwxyz";
let t = "";
for (let r = 0; r < e; r++)
t += n[Math.floor(Math.random() * n.length)];
return t;
}
function ke(e) {
return JSON.stringify(e);
}
const je = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
};
function L(e) {
return typeof e == "object" && e !== null && !Array.isArray(e);
}
const an = q(() => {
if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
return !1;
try {
const e = Function;
return new e(""), !0;
} catch {
return !1;
}
});
function F(e) {
if (L(e) === !1)
return !1;
const n = e.constructor;
if (n === void 0)
return !0;
const t = n.prototype;
return !(L(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
}
function de(e) {
return F(e) ? { ...e } : Array.isArray(e) ? [...e] : e;
}
function Jr(e) {
let n = 0;
for (const t in e)
Object.prototype.hasOwnProperty.call(e, t) && n++;
return n;
}
const Kr = (e) => {
const n = typeof e;
switch (n) {
case "undefined":
return "undefined";
case "string":
return "string";
case "number":
return Number.isNaN(e) ? "nan" : "number";
case "boolean":
return "boolean";
case "function":
return "function";
case "bigint":
return "bigint";
case "symbol":
return "symbol";
case "object":
return Array.isArray(e) ? "array" : e === null ? "null" : e.then && typeof e.then == "function" && e.catch && typeof e.catch == "function" ? "promise" : typeof Map < "u" && e instanceof Map ? "map" : typeof Set < "u" && e instanceof Set ? "set" : typeof Date < "u" && e instanceof Date ? "date" : typeof File < "u" && e instanceof File ? "file" : "object";
default:
throw new Error(`Unknown data type: ${n}`);
}
}, ue = /* @__PURE__ */ new Set(["string", "number", "symbol"]), ln = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
function j(e) {
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function P(e, n, t) {
const r = new e._zod.constr(n ?? e._zod.def);
return (!n || t?.parent) && (r._zod.parent = e), r;
}
function a(e) {
const n = e;
if (!n)
return {};
if (typeof n == "string")
return { error: () => n };
if (n?.message !== void 0) {
if (n?.error !== void 0)
throw new Error("Cannot specify both `message` and `error` params");
n.error = n.message;
}
return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
}
function Yr(e) {
let n;
return new Proxy({}, {
get(t, r, o) {
return n ?? (n = e()), Reflect.get(n, r, o);
},
set(t, r, o, s) {
return n ?? (n = e()), Reflect.set(n, r, o, s);
},
has(t, r) {
return n ?? (n = e()), Reflect.has(n, r);
},
deleteProperty(t, r) {
return n ?? (n = e()), Reflect.deleteProperty(n, r);
},
ownKeys(t) {
return n ?? (n = e()), Reflect.ownKeys(n);
},
getOwnPropertyDescriptor(t, r) {
return n ?? (n = e()), Reflect.getOwnPropertyDescriptor(n, r);
},
defineProperty(t, r, o) {
return n ?? (n = e()), Reflect.defineProperty(n, r, o);
}
});
}
function fn(e) {
return typeof e == "bigint" ? e.toString() + "n" : typeof e == "string" ? `"${e}"` : `${e}`;
}
function pn(e) {
return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
}
const dn = {
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
int32: [-2147483648, 2147483647],
uint32: [0, 4294967295],
float32: [-34028234663852886e22, 34028234663852886e22],
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
}, hn = {
int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")],
uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")]
};
function mn(e, n) {
const t = e._zod.def, r = C(e._zod.def, {
get shape() {
const o = {};
for (const s in n) {
if (!(s in t.shape))
throw new Error(`Unrecognized key: "${s}"`);
n[s] && (o[s] = t.shape[s]);
}
return I(this, "shape", o), o;
},
checks: []
});
return P(e, r);
}
function _n(e, n) {
const t = e._zod.def, r = C(e._zod.def, {
get shape() {
const o = { ...e._zod.def.shape };
for (const s in n) {
if (!(s in t.shape))
throw new Error(`Unrecognized key: "${s}"`);
n[s] && delete o[s];
}
return I(this, "shape", o), o;
},
checks: []
});
return P(e, r);
}
function gn(e, n) {
if (!F(n))
throw new Error("Invalid input to extend: expected a plain object");
const t = e._zod.def.checks;
if (t && t.length > 0)
throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
const o = C(e._zod.def, {
get shape() {
const s = { ...e._zod.def.shape, ...n };
return I(this, "shape", s), s;
},
checks: []
});
return P(e, o);
}
function vn(e, n) {
if (!F(n))
throw new Error("Invalid input to safeExtend: expected a plain object");
const t = {
...e._zod.def,
get shape() {
const r = { ...e._zod.def.shape, ...n };
return I(this, "shape", r), r;
},
checks: e._zod.def.checks
};
return P(e, t);
}
function bn(e, n) {
const t = C(e._zod.def, {
get shape() {
const r = { ...e._zod.def.shape, ...n._zod.def.shape };
return I(this, "shape", r), r;
},
get catchall() {
return n._zod.def.catchall;
},
checks: []
// delete existing checks
});
return P(e, t);
}
function zn(e, n, t) {
const r = C(n._zod.def, {
get shape() {
const o = n._zod.def.shape, s = { ...o };
if (t)
for (const i in t) {
if (!(i in o))
throw new Error(`Unrecognized key: "${i}"`);
t[i] && (s[i] = e ? new e({
type: "optional",
innerType: o[i]
}) : o[i]);
}
else
for (const i in o)
s[i] = e ? new e({
type: "optional",
innerType: o[i]
}) : o[i];
return I(this, "shape", s), s;
},
checks: []
});
return P(n, r);
}
function wn(e, n, t) {
const r = C(n._zod.def, {
get shape() {
const o = n._zod.def.shape, s = { ...o };
if (t)
for (const i in t) {
if (!(i in s))
throw new Error(`Unrecognized key: "${i}"`);
t[i] && (s[i] = new e({
type: "nonoptional",
innerType: o[i]
}));
}
else
for (const i in o)
s[i] = new e({
type: "nonoptional",
innerType: o[i]
});
return I(this, "shape", s), s;
},
checks: []
});
return P(n, r);
}
function D(e, n = 0) {
if (e.aborted === !0)
return !0;
for (let t = n; t < e.issues.length; t++)
if (e.issues[t]?.continue !== !0)
return !0;
return !1;
}
function k(e, n) {
return n.map((t) => {
var r;
return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
});
}
function G(e) {
return typeof e == "string" ? e : e?.message;
}
function A(e, n, t) {
const r = { ...e, path: e.path ?? [] };
if (!e.message) {
const o = G(e.inst?._zod.def?.error?.(e)) ?? G(n?.error?.(e)) ?? G(t.customError?.(e)) ?? G(t.localeError?.(e)) ?? "Invalid input";
r.message = o;
}
return delete r.inst, delete r.continue, n?.reportInput || delete r.input, r;
}
function he(e) {
return e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof File ? "file" : "unknown";
}
function me(e) {
return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
}
function B(...e) {
const [n, t, r] = e;
return typeof n == "string" ? {
message: n,
code: "custom",
input: t,
inst: r
} : { ...n };
}
function qr(e) {
return Object.entries(e).filter(([n, t]) => Number.isNaN(Number.parseInt(n, 10))).map((n) => n[1]);
}
function $n(e) {
const n = atob(e), t = new Uint8Array(n.length);
for (let r = 0; r < n.length; r++)
t[r] = n.charCodeAt(r);
return t;
}
function Zn(e) {
let n = "";
for (let t = 0; t < e.length; t++)
n += String.fromCharCode(e[t]);
return btoa(n);
}
function Hr(e) {
const n = e.replace(/-/g, "+").replace(/_/g, "/"), t = "=".repeat((4 - n.length % 4) % 4);
return $n(n + t);
}
function Xr(e) {
return Zn(e).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
function Qr(e) {
const n = e.replace(/^0x/, "");
if (n.length % 2 !== 0)
throw new Error("Invalid hex string length");
const t = new Uint8Array(n.length / 2);
for (let r = 0; r < n.length; r += 2)
t[r / 2] = Number.parseInt(n.slice(r, r + 2), 16);
return t;
}
function eo(e) {
return Array.from(e).map((n) => n.toString(16).padStart(2, "0")).join("");
}
class no {
constructor(...n) {
}
}
const nc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
BIGINT_FORMAT_RANGES: hn,
Class: no,
NUMBER_FORMAT_RANGES: dn,
aborted: D,
allowsEval: an,
assert: Mr,
assertEqual: Dr,
assertIs: Rr,
assertNever: Ur,
assertNotEqual: Fr,
assignProp: I,
base64ToUint8Array: $n,
base64urlToUint8Array: Hr,
cached: q,
captureStackTrace: je,
cleanEnum: qr,
cleanRegex: fe,
clone: P,
cloneDef: Br,
createTransparentProxy: Yr,
defineLazy: g,
esc: ke,
escapeRegex: j,
extend: gn,
finalizeIssue: A,
floatSafeRemainder: cn,
getElementAtPath: Vr,
getEnumValues: un,
getLengthableOrigin: me,
getParsedType: Kr,
getSizableOrigin: he,
hexToUint8Array: Qr,
isObject: L,
isPlainObject: F,
issue: B,
joinValues: Lr,
jsonStringifyReplacer: ie,
merge: bn,
mergeDefs: C,
normalizeParams: a,
nullish: R,
numKeys: Jr,
objectClone: pe,
omit: _n,
optionalKeys: pn,
partial: zn,
pick: mn,
prefixIssues: k,
primitiveTypes: ln,
promiseAllObject: Wr,
propertyKeyTypes: ue,
randomString: Gr,
required: wn,
safeExtend: vn,
shallowClone: de,
stringifyPrimitive: fn,
uint8ArrayToBase64: Zn,
uint8ArrayToBase64url: Xr,
uint8ArrayToHex: eo,
unwrapMessage: G
}, Symbol.toStringTag, { value: "Module" })), yn = (e, n) => {
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
value: e._zod,
enumerable: !1
}), Object.defineProperty(e, "issues", {
value: n,
enumerable: !1
}), e.message = JSON.stringify(n, ie, 2), Object.defineProperty(e, "toString", {
value: () => e.message,
enumerable: !1
});
}, kn = u("$ZodError", yn), Z = u("$ZodError", yn, { Parent: Error });
function to(e, n = (t) => t.message) {
const t = {}, r = [];
for (const o of e.issues)
o.path.length > 0 ? (t[o.path[0]] = t[o.path[0]] || [], t[o.path[0]].push(n(o))) : r.push(n(o));
return { formErrors: r, fieldErrors: t };
}
function ro(e, n) {
const t = n || function(s) {
return s.message;
}, r = { _errors: [] }, o = (s) => {
for (const i of s.issues)
if (i.code === "invalid_union" && i.errors.length)
i.errors.map((c) => o({ issues: c }));
else if (i.code === "invalid_key")
o({ issues: i.issues });
else if (i.code === "invalid_element")
o({ issues: i.issues });
else if (i.path.length === 0)
r._errors.push(t(i));
else {
let c = r, l = 0;
for (; l < i.path.length; ) {
const f = i.path[l];
l === i.path.length - 1 ? (c[f] = c[f] || { _errors: [] }, c[f]._errors.push(t(i))) : c[f] = c[f] || { _errors: [] }, c = c[f], l++;
}
}
};
return o(e), r;
}
function tc(e, n) {
const t = n || function(s) {
return s.message;
}, r = { errors: [] }, o = (s, i = []) => {
var c, l;
for (const f of s.issues)
if (f.code === "invalid_union" && f.errors.length)
f.errors.map((p) => o({ issues: p }, f.path));
else if (f.code === "invalid_key")
o({ issues: f.issues }, f.path);
else if (f.code === "invalid_element")
o({ issues: f.issues }, f.path);
else {
const p = [...i, ...f.path];
if (p.length === 0) {
r.errors.push(t(f));
continue;
}
let _ = r, v = 0;
for (; v < p.length; ) {
const h = p[v], $ = v === p.length - 1;
typeof h == "string" ? (_.properties ?? (_.properties = {}), (c = _.properties)[h] ?? (c[h] = { errors: [] }), _ = _.properties[h]) : (_.items ?? (_.items = []), (l = _.items)[h] ?? (l[h] = { errors: [] }), _ = _.items[h]), $ && _.errors.push(t(f)), v++;
}
}
};
return o(e), r;
}
function oo(e) {
const n = [], t = e.map((r) => typeof r == "object" ? r.key : r);
for (const r of t)
typeof r == "number" ? n.push(`[${r}]`) : typeof r == "symbol" ? n.push(`[${JSON.stringify(String(r))}]`) : /[^\w$]/.test(r) ? n.push(`[${JSON.stringify(r)}]`) : (n.length && n.push("."), n.push(r));
return n.join("");
}
function rc(e) {
const n = [], t = [...e.issues].sort((r, o) => (r.path ?? []).length - (o.path ?? []).length);
for (const r of t)
n.push(`✖ ${r.message}`), r.path?.length && n.push(` → at ${oo(r.path)}`);
return n.join(`
`);
}
const _e = (e) => (n, t, r, o) => {
const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = n._zod.run({ value: t, issues: [] }, s);
if (i instanceof Promise)
throw new M();
if (i.issues.length) {
const c = new (o?.Err ?? e)(i.issues.map((l) => A(l, s, S())));
throw je(c, o?.callee), c;
}
return i.value;
}, We = /* @__PURE__ */ _e(Z), ge = (e) => async (n, t, r, o) => {
const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
let i = n._zod.run({ value: t, issues: [] }, s);
if (i instanceof Promise && (i = await i), i.issues.length) {
const c = new (o?.Err ?? e)(i.issues.map((l) => A(l, s, S())));
throw je(c, o?.callee), c;
}
return i.value;
}, Ge = /* @__PURE__ */ ge(Z), ve = (e) => (n, t, r) => {
const o = r ? { ...r, async: !1 } : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
if (s instanceof Promise)
throw new M();
return s.issues.length ? {
success: !1,
error: new (e ?? kn)(s.issues.map((i) => A(i, o, S())))
} : { success: !0, data: s.value };
}, so = /* @__PURE__ */ ve(Z), be = (e) => async (n, t, r) => {
const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
let s = n._zod.run({ value: t, issues: [] }, o);
return s instanceof Promise && (s = await s), s.issues.length ? {
success: !1,
error: new e(s.issues.map((i) => A(i, o, S())))
} : { success: !0, data: s.value };
}, io = /* @__PURE__ */ be(Z), An = (e) => (n, t, r) => {
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
return _e(e)(n, t, o);
}, oc = /* @__PURE__ */ An(Z), In = (e) => (n, t, r) => _e(e)(n, t, r), sc = /* @__PURE__ */ In(Z), En = (e) => async (n, t, r) => {
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
return ge(e)(n, t, o);
}, ic = /* @__PURE__ */ En(Z), Tn = (e) => async (n, t, r) => ge(e)(n, t, r), uc = /* @__PURE__ */ Tn(Z), Sn = (e) => (n, t, r) => {
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
return ve(e)(n, t, o);
}, cc = /* @__PURE__ */ Sn(Z), Pn = (e) => (n, t, r) => ve(e)(n, t, r), ac = /* @__PURE__ */ Pn(Z), xn = (e) => async (n, t, r) => {
const o = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
return be(e)(n, t, o);
}, lc = /* @__PURE__ */ xn(Z), Nn = (e) => async (n, t, r) => be(e)(n, t, r), fc = /* @__PURE__ */ Nn(Z), On = /^[cC][^\s-]{8,}$/, jn = /^[0-9a-z]+$/, Cn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Dn = /^[0-9a-vA-V]{20}$/, Fn = /^[A-Za-z0-9]{27}$/, Rn = /^[a-zA-Z0-9_-]{21}$/, Un = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, uo = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Mn = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, V = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, co = /* @__PURE__ */ V(4), ao = /* @__PURE__ */ V(6), lo = /* @__PURE__ */ V(7), Ln = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, fo = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, po = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, Bn = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u, ho = Bn, mo = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/, _o = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
function Vn() {
return new RegExp(_o, "u");
}
const Wn = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Gn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Jn = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Kn = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Yn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Ce = /^[A-Za-z0-9_-]*$/, De = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, qn = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/, Hn = /^\+(?:[0-9]){6,14}[0-9]$/, Xn = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Qn = /* @__PURE__ */ new RegExp(`^${Xn}$`);
function et(e) {
const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
}
function nt(e) {
return new RegExp(`^${et(e)}$`);
}
function tt(e) {
const n = et({ precision: e.precision }), t = ["Z"];
e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
const r = `${n}(?:${t.join("|")})`;
return new RegExp(`^${Xn}T(?:${r})$`);
}
const rt = (e) => {
const n = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
return new RegExp(`^${n}$`);
}, ot = /^-?\d+n?$/, st = /^-?\d+$/, it = /^-?\d+(?:\.\d+)?/, ut = /^(?:true|false)$/i, ct = /^null$/i, at = /^undefined$/i, lt = /^[^A-Z]*$/, ft = /^[^a-z]*$/, pt = /^[0-9a-fA-F]*$/;
function H(e, n) {
return new RegExp(`^[A-Za-z0-9+/]{${e}}${n}$`);
}
function X(e) {
return new RegExp(`^[A-Za-z0-9_-]{${e}}$`);
}
const go = /^[0-9a-fA-F]{32}$/, vo = /* @__PURE__ */ H(22, "=="), bo = /* @__PURE__ */ X(22), zo = /^[0-9a-fA-F]{40}$/, wo = /* @__PURE__ */ H(27, "="), $o = /* @__PURE__ */ X(27), Zo = /^[0-9a-fA-F]{64}$/, yo = /* @__PURE__ */ H(43, "="), ko = /* @__PURE__ */ X(43), Ao = /^[0-9a-fA-F]{96}$/, Io = /* @__PURE__ */ H(64, ""), Eo = /* @__PURE__ */ X(64), To = /^[0-9a-fA-F]{128}$/, So = /* @__PURE__ */ H(86, "=="), Po = /* @__PURE__ */ X(86), xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
base64: Yn,
base64url: Ce,
bigint: ot,
boolean: ut,
browserEmail: mo,
cidrv4: Jn,
cidrv6: Kn,
cuid: On,
cuid2: jn,
date: Qn,
datetime: tt,
domain: qn,
duration: Un,
e164: Hn,
email: Ln,
emoji: Vn,
extendedDuration: uo,
guid: Mn,
hex: pt,
hostname: De,
html5Email: fo,
idnEmail: ho,
integer: st,
ipv4: Wn,
ipv6: Gn,
ksuid: Fn,
lowercase: lt,
md5_base64: vo,
md5_base64url: bo,
md5_hex: go,
nanoid: Rn,
null: ct,
number: it,
rfc5322Email: po,
sha1_base64: wo,
sha1_base64url: $o,
sha1_hex: zo,
sha256_base64: yo,
sha256_base64url: ko,
sha256_hex: Zo,
sha384_base64: Io,
sha384_base64url: Eo,
sha384_hex: Ao,
sha512_base64: So,
sha512_base64url: Po,
sha512_hex: To,
string: rt,
time: nt,
ulid: Cn,
undefined: at,
unicodeEmail: Bn,
uppercase: ft,
uuid: V,
uuid4: co,
uuid6: ao,
uuid7: lo,
xid: Dn
}, Symbol.toStringTag, { value: "Module" })), w = /* @__PURE__ */ u("$ZodCheck", (e, n) => {
var t;
e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
}), dt = {
number: "number",
bigint: "bigint",
object: "date"
}, ht = /* @__PURE__ */ u("$ZodCheckLessThan", (e, n) => {
w.init(e, n);
const t = dt[typeof n.value];
e._zod.onattach.push((r) => {
const o = r._zod.bag, s = (n.inclusive ? o.maximum : o.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
n.value < s && (n.inclusive ? o.maximum = n.value : o.exclusiveMaximum = n.value);
}), e._zod.check = (r) => {
(n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
origin: t,
code: "too_big",
maximum: n.value,
input: r.value,
inclusive: n.inclusive,
inst: e,
continue: !n.abort
});
};
}), mt = /* @__PURE__ */ u("$ZodCheckGreaterThan", (e, n) => {
w.init(e, n);
const t = dt[typeof n.value];
e._zod.onattach.push((r) => {
const o = r._zod.bag, s = (n.inclusive ? o.minimum : o.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
n.value > s && (n.inclusive ? o.minimum = n.value : o.exclusiveMinimum = n.value);
}), e._zod.check = (r) => {
(n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
origin: t,
code: "too_small",
minimum: n.value,
input: r.value,
inclusive: n.inclusive,
inst: e,
continue: !n.abort
});
};
}), No = /* @__PURE__ */ u("$ZodCheckMultipleOf", (e, n) => {
w.init(e, n), e._zod.onattach.push((t) => {
var r;
(r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
}), e._zod.check = (t) => {
if (typeof t.value != typeof n.value)
throw new Error("Cannot mix number and bigint in multiple_of check.");
(typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : cn(t.value, n.value) === 0) || t.issues.push({
origin: typeof t.value,
code: "not_multiple_of",
divisor: n.value,
input: t.value,
inst: e,
continue: !n.abort
});
};
}), Oo = /* @__PURE__ */ u("$ZodCheckNumberFormat", (e, n) => {
w.init(e, n), n.format = n.format || "float64";
const t = n.format?.includes("int"), r = t ? "int" : "number", [o, s] = dn[n.format];
e._zod.onattach.push((i) => {
const c = i._zod.bag;
c.format = n.format, c.minimum = o, c.maximum = s, t && (c.pattern = st);
}), e._zod.check = (i) => {
const c = i.value;
if (t) {
if (!Number.isInteger(c)) {
i.issues.push({
expected: r,
format: n.format,
code: "invalid_type",
continue: !1,
input: c,
inst: e
});
return;
}
if (!Number.isSafeInteger(c)) {
c > 0 ? i.issues.push({
input: c,
code: "too_big",
maximum: Number.MAX_SAFE_INTEGER,
note: "Integers must be within the safe integer range.",
inst: e,
origin: r,
continue: !n.abort
}) : i.issues.push({
input: c,
code: "too_small",
minimum: Number.MIN_SAFE_INTEGER,
note: "Integers must be within the safe integer range.",
inst: e,
origin: r,
continue: !n.abort
});
return;
}
}
c < o && i.issues.push({
origin: "number",
input: c,
code: "too_small",
minimum: o,
inclusive: !0,
inst: e,
continue: !n.abort
}), c > s && i.issues.push({
origin: "number",
input: c,
code: "too_big",
maximum: s,
inst: e
});
};
}), jo = /* @__PURE__ */ u("$ZodCheckBigIntFormat", (e, n) => {
w.init(e, n);
const [t, r] = hn[n.format];
e._zod.onattach.push((o) => {
const s = o._zod.bag;
s.format = n.format, s.minimum = t, s.maximum = r;
}), e._zod.check = (o) => {
const s = o.value;
s < t && o.issues.push({
origin: "bigint",
input: s,
code: "too_small",
minimum: t,
inclusive: !0,
inst: e,
continue: !n.abort
}), s > r && o.issues.push({
origin: "bigint",
input: s,
code: "too_big",
maximum: r,
inst: e
});
};
}), Co = /* @__PURE__ */ u("$ZodCheckMaxSize", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.size !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
n.maximum < o && (r._zod.bag.maximum = n.maximum);
}), e._zod.check = (r) => {
const o = r.value;
o.size <= n.maximum || r.issues.push({
origin: he(o),
code: "too_big",
maximum: n.maximum,
inclusive: !0,
input: o,
inst: e,
continue: !n.abort
});
};
}), Do = /* @__PURE__ */ u("$ZodCheckMinSize", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.size !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
n.minimum > o && (r._zod.bag.minimum = n.minimum);
}), e._zod.check = (r) => {
const o = r.value;
o.size >= n.minimum || r.issues.push({
origin: he(o),
code: "too_small",
minimum: n.minimum,
inclusive: !0,
input: o,
inst: e,
continue: !n.abort
});
};
}), Fo = /* @__PURE__ */ u("$ZodCheckSizeEquals", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.size !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag;
o.minimum = n.size, o.maximum = n.size, o.size = n.size;
}), e._zod.check = (r) => {
const o = r.value, s = o.size;
if (s === n.size)
return;
const i = s > n.size;
r.issues.push({
origin: he(o),
...i ? { code: "too_big", maximum: n.size } : { code: "too_small", minimum: n.size },
inclusive: !0,
exact: !0,
input: r.value,
inst: e,
continue: !n.abort
});
};
}), Ro = /* @__PURE__ */ u("$ZodCheckMaxLength", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.length !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
n.maximum < o && (r._zod.bag.maximum = n.maximum);
}), e._zod.check = (r) => {
const o = r.value;
if (o.length <= n.maximum)
return;
const i = me(o);
r.issues.push({
origin: i,
code: "too_big",
maximum: n.maximum,
inclusive: !0,
input: o,
inst: e,
continue: !n.abort
});
};
}), Uo = /* @__PURE__ */ u("$ZodCheckMinLength", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.length !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
n.minimum > o && (r._zod.bag.minimum = n.minimum);
}), e._zod.check = (r) => {
const o = r.value;
if (o.length >= n.minimum)
return;
const i = me(o);
r.issues.push({
origin: i,
code: "too_small",
minimum: n.minimum,
inclusive: !0,
input: o,
inst: e,
continue: !n.abort
});
};
}), Mo = /* @__PURE__ */ u("$ZodCheckLengthEquals", (e, n) => {
var t;
w.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
const o = r.value;
return !R(o) && o.length !== void 0;
}), e._zod.onattach.push((r) => {
const o = r._zod.bag;
o.minimum = n.length, o.maximum = n.length, o.length = n.length;
}), e._zod.check = (r) => {
const o = r.value, s = o.length;
if (s === n.length)
return;
const i = me(o), c = s > n.length;
r.issues.push({
origin: i,
...c ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
inclusive: !0,
exact: !0,
input: r.value,
inst: e,
continue: !n.abort
});
};
}), ze = /* @__PURE__ */ u("$ZodCheckStringFormat", (e, n) => {
var t, r;
w.init(e, n), e._zod.onattach.push((o) => {
const s = o._zod.bag;
s.format = n.format, n.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(n.pattern));
}), n.pattern ? (t = e._zod).check ?? (t.check = (o) => {
n.pattern.lastIndex = 0, !n.pattern.test(o.value) && o.issues.push({
origin: "string",
code: "invalid_format",
format: n.format,
input: o.value,
...n.pattern ? { pattern: n.pattern.toString() } : {},
inst: e,
continue: !n.abort
});
}) : (r = e._zod).check ?? (r.check = () => {
});
}), Lo = /* @__PURE__ */ u("$ZodCheckRegex", (e, n) => {
ze.init(e, n), e._zod.check = (t) => {
n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
origin: "string",
code: "invalid_format",
format: "regex",
input: t.value,
pattern: n.pattern.toString(),
inst: e,
continue: !n.abort
});
};
}), Bo = /* @__PURE__ */ u("$ZodCheckLowerCase", (e, n) => {
n.pattern ?? (n.pattern = lt), ze.init(e, n);
}), Vo = /* @__PURE__ */ u("$ZodCheckUpperCase", (e, n) => {
n.pattern ?? (n.pattern = ft), ze.init(e, n);
}), Wo = /* @__PURE__ */ u("$ZodCheckIncludes", (e, n) => {
w.init(e, n);
const t = j(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
n.pattern = r, e._zod.onattach.push((o) => {
const s = o._zod.bag;
s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
}), e._zod.check = (o) => {
o.value.includes(n.includes, n.position) || o.issues.push({
origin: "string",
code: "invalid_format",
format: "includes",
includes: n.includes,
input: o.value,
inst: e,
continue: !n.abort
});
};
}), Go = /* @__PURE__ */ u("$ZodCheckStartsWith", (e, n) => {
w.init(e, n);
const t = new RegExp(`^${j(n.prefix)}.*`);
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
const o = r._zod.bag;
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
}), e._zod.check = (r) => {
r.value.startsWith(n.prefix) || r.issues.push({
origin: "string",
code: "invalid_format",
format: "starts_with",
prefix: n.prefix,
input: r.value,
inst: e,
continue: !n.abort
});
};
}), Jo = /* @__PURE__ */ u("$ZodCheckEndsWith", (e, n) => {
w.init(e, n);
const t = new RegExp(`.*${j(n.suffix)}$`);
n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
const o = r._zod.bag;
o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(t);
}), e._zod.check = (r) => {
r.value.endsWith(n.suffix) || r.issues.push({
origin: "string",
code: "invalid_format",
format: "ends_with",
suffix: n.suffix,
input: r.value,
inst: e,
continue: !n.abort
});
};
});
function Je(e, n, t) {
e.issues.length && n.issues.push(...k(t, e.issues));
}
const Ko = /* @__PURE__ */ u("$ZodCheckProperty", (e, n) => {
w.init(e, n), e._zod.check = (t) => {
const r = n.schema._zod.run({
value: t.value[n.property],
issues: []
}, {});
if (r instanceof Promise)
return r.then((o) => Je(o, t, n.property));
Je(r, t, n.property);
};
}), Yo = /* @__PURE__ */ u("$ZodCheckMimeType", (e, n) => {
w.init(e, n);
const t = new Set(n.mime);
e._zod.onattach.push((r) => {
r._zod.bag.mime = n.mime;
}), e._zod.check = (r) => {
t.has(r.value.type) || r.issues.push({
code: "invalid_value",
values: n.mime,
input: r.value.type,
inst: e,
continue: !n.abort
});
};
}), qo = /* @__PURE__ */ u("$ZodCheckOverwrite", (e, n) => {
w.init(e, n), e._zod.check = (t) => {
t.value = n.tx(t.value);
};
});
class Ho {
constructor(n = []) {
this.content = [], this.indent = 0, this && (this.args = n);
}
indented(n) {
this.indent += 1, n(this), this.indent -= 1;
}
write(n) {
if (typeof n == "function") {
n(this, { execution: "sync" }), n(this, { execution: "async" });
return;
}
const r = n.split(`
`).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), s = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
for (const i of s)
this.content.push(i);
}
compile() {
const n = Function, t = this?.args, o = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
return new n(...t, o.join(`
`));
}
}
const Xo = {
major: 4,
minor: 1,
patch: 8
}, d = /* @__PURE__ */ u("$ZodType", (e, n) => {
var t;
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = Xo;
const r = [...e._zod.def.checks ?? []];
e._zod.traits.has("$ZodCheck") && r.unshift(e);
for (const o of r)
for (const s of o._zod.onattach)
s(e);
if (r.length === 0)
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
e._zod.run = e._zod.parse;
});
else {
const o = (i, c, l) => {
let f = D(i), p;
for (const _ of c) {
if (_._zod.def.when) {
if (!_._zod.def.when(i))
continue;
} else if (f)
continue;
const v = i.issues.length, h = _._zod.check(i);
if (h instanceof Promise && l?.async === !1)
throw new M();
if (p || h instanceof Promise)
p = (p ?? Promise.resolve()).then(async () => {
await h, i.issues.length !== v && (f || (f = D(i, v)));
});
else {
if (i.issues.length === v)
continue;
f || (f = D(i, v));
}
}
return p ? p.then(() => i) : i;
}, s = (i, c, l) => {
if (D(i))
return i.aborted = !0, i;
const f = o(c, r, l);
if (f instanceof Promise) {
if (l.async === !1)
throw new M();
return f.then((p) => e._zod.parse(p, l));
}
return e._zod.parse(f, l);
};
e._zod.run = (i, c) => {
if (c.skipChecks)
return e._zod.parse(i, c);
if (c.direction === "backward") {
const f = e._zod.parse({ value: i.value, issues: [] }, { ...c, skipChecks: !0 });
return f instanceof Promise ? f.then((p) => s(p, i, c)) : s(f, i, c);
}
const l = e._zod.parse(i, c);
if (l instanceof Promise) {
if (c.async === !1)
throw new M();
return l.then((f) => o(f, r, c));
}
return o(l, r, c);
};
}
e["~standard"] = {
validate: (o) => {
try {
const s = so(e, o);
return s.success ? { value: s.data } : { issues: s.error?.issues };
} catch {
return io(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
}
},
vendor: "zod",
version: 1
};
}), we = /* @__PURE__ */ u("$ZodString", (e, n) => {
d.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? rt(e._zod.bag), e._zod.parse = (t, r) => {
if (n.coerce)
try {
t.value = String(t.value);
} catch {
}
return typeof t.value == "string" || t.issues.push({
expected: "string",
code: "invalid_type",
input: t.value,
inst: e
}), t;
};
}), b = /* @__PURE__ */ u("$ZodStringFormat", (e, n) => {
ze.init(e, n), we.init(e, n);
}), Qo = /* @__PURE__ */ u("$ZodGUID", (e, n) => {
n.pattern ?? (n.pattern = Mn), b.init(e, n);
}), es = /* @__PURE__ */ u("$ZodUUID", (e, n) => {
if (n.version) {
const r = {
v1: 1,
v2: 2,
v3: 3,
v4: 4,
v5: 5,
v6: 6,
v7: 7,
v8: 8
}[n.version];
if (r === void 0)
throw new Error(`Invalid UUID version: "${n.version}"`);
n.pattern ?? (n.pattern = V(r));
} else
n.pattern ?? (n.pattern = V());
b.init(e, n);
}), ns = /* @__PURE__ */ u("$ZodEmail", (e, n) => {
n.pattern ?? (n.pattern = Ln), b.init(e, n);
}), ts = /* @__PURE__ */ u("$ZodURL", (e, n) => {
b.init(e, n), e._zod.check = (t) => {
try {
const r = t.value.trim(), o = new URL(r);
n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(o.hostname) || t.issues.push({
code: "invalid_format",
format: "url",
note: "Invalid hostname",
pattern: De.source,
input: t.value,
inst: e,
continue: !n.abort
})), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || t.issues.push({
code: "invalid_format",
format: "url",
note: "Invalid protocol",
pattern: n.protocol.source,
input: t.value,
inst: e,
continue: !n.abort
})), n.normalize ? t.value = o.href : t.value = r;
return;
} catch {
t.issues.push({
code: "invalid_format",
format: "url",
input: t.value,
inst: e,
continue: !n.abort
});
}
};
}), rs = /* @__PURE__ */ u("$ZodEmoji", (e, n) => {
n.pattern ?? (n.pattern = Vn()), b.init(e, n);
}), os = /* @__PURE__ */ u("$ZodNanoID", (e, n) => {
n.pattern ?? (n.pattern = Rn), b.init(e, n);
}), ss = /* @__PURE__ */ u("$ZodCUID", (e, n) => {
n.pattern ?? (n.pattern = On), b.init(e, n);
}), is = /* @__PURE__ */ u("$ZodCUID2", (e, n) => {
n.pattern ?? (n.pattern = jn), b.init(e, n);
}), us = /* @__PURE__ */ u("$ZodULID", (e, n) => {
n.pattern ?? (n.pattern = Cn), b.init(e, n);
}), cs = /* @__PURE__ */ u("$ZodXID", (e, n) => {
n.pattern ?? (n.pattern = Dn), b.init(e, n);
}), as = /* @__PURE__ */ u("$ZodKSUID", (e, n) => {
n.pattern ?? (n.pattern = Fn), b.init(e, n);
}), ls = /* @__PURE__ */ u("$ZodISODateTime", (e, n) => {
n.pattern ?? (n.pattern = tt(n)), b.init(e, n);
}), fs = /* @__PURE__ */ u("$ZodISODate", (e, n) => {
n.pattern ?? (n.pattern = Qn), b.init(e, n);
}), ps = /* @__PURE__ */ u("$ZodISOTime", (e, n) => {
n.pattern ?? (n.pattern = nt(n)), b.init(e, n);
}), ds = /* @__PURE__ */ u("$ZodISODuration", (e, n) => {
n.pattern ?? (n.pattern = Un), b.init(e, n);
}), hs = /* @__PURE__ */ u("$ZodIPv4", (e, n) => {
n.pattern ?? (n.pattern = Wn), b.init(e, n), e._zod.onattach.push((t) => {
const r = t._zod.bag;
r.format = "ipv4";
});
}), ms = /* @__PURE__ */ u("$ZodIPv6", (e, n) => {
n.pattern ?? (n.pattern = Gn), b.init(e, n), e._zod.onattach.push((t) => {
const r = t._zod.bag;
r.format = "ipv6";
}), e._zod.check = (t) => {
try {
new URL(`http://[${t.value}]`);
} catch {
t.issues.push({
code: "invalid_format",
format: "ipv6",
input: t.value,
inst: e,
continue: !n.abort
});
}
};
}), _s = /* @__PURE__ */ u("$ZodCIDRv4", (e, n) => {
n.pattern ?? (n.pattern = Jn), b.init(e, n);
}), gs = /* @__PURE__ */ u("$ZodCIDRv6", (e, n) => {
n.pattern ?? (n.pattern = Kn), b.init(e, n), e._zod.check = (t) => {
const r = t.value.split("/");
try {
if (r.length !== 2)
throw new Error();
const [o, s] = r;
if (!s)
throw new Error();
const i = Number(s);
if (`${i}` !== s)
throw new Error();
if (i < 0 || i > 128)
throw new Error();
new URL(`http://[${o}]`);
} catch {
t.issues.push({
code: "invalid_format",
format: "cidrv6",
input: t.value,
inst: e,
continue: !n.abort
});
}
};
});
function _t(e) {
if (e === "")
return !0;
if (e.length % 4 !== 0)
return !1;
try {
return atob(e), !0;
} catch {
return !1;
}
}
const vs = /* @__PURE__ */ u("$ZodBase64", (e, n) => {
n.pattern ?? (n.pattern = Yn), b.init(e, n), e._zod.onattach.push((t) => {
t._zod.bag.contentEncoding = "base64";
}), e._zod.check = (t) => {
_t(t.value) || t.issues.push({
code: "invalid_format",
format: "base64",
input: t.value,
inst: e,
continue: !n.abort
});
};
});
function bs(e) {
if (!Ce.test(e))
return !1;
const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
return _t(t);
}
const zs = /* @__PURE__ */ u("$ZodBase64URL", (e, n) => {
n.pattern ?? (n.pattern = Ce), b.init(e, n), e._zod.onattach.push((t) => {
t._zod.bag.contentEncoding = "base64url";
}), e._zod.check = (t) => {
bs(t.value) || t.issues.push({
code: "invalid_format",
format: "base64url",
input: t.value,
inst: e,
continue: !n.abort
});
};
}), ws = /* @__PURE__ */ u("$ZodE164", (e, n) => {
n.pattern ?? (n.pattern = Hn), b.init(e, n);
});
function $s(e, n = null) {
try {
const t = e.split(".");
if (t.length !== 3)
return !1;
const [r] = t;
if (!r)
return !1;
const o = JSON.parse(atob(r));
return !("typ" in o && o?.typ !== "JWT" || !o.alg || n && (!("alg" in o) || o.alg !== n));
} catch {
return !1;
}
}
const Zs = /* @__PURE__ */ u("$ZodJWT", (e, n) => {
b.init(e, n), e._zod.check = (t) => {
$s(t.value, n.alg) || t.issues.push({
code: "invalid_format",
format: "jwt",
input: t.value,
inst: e,
continue: !n.abort
});
};
}), ys = /* @__PURE__ */ u("$ZodCustomStringFormat", (e, n) => {
b.init(e, n), e._zod.check = (t) => {
n.fn(t.value) || t.issues.push({
code: "invalid_format",
format: n.format,
input: t.value,
inst: e,
continue: !n.abort
});
};
}), gt = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
d.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? it, e._zod.parse = (t, r) => {
if (n.coerce)
try {
t.value = Number(t.value);
} catch {
}
const o = t.value;
if (typeof o == "number" && !Number.isNaN(o) && Number.isFinite(o))
return t;
const s = typeof o == "number" ? Number.isNaN(o) ? "NaN" : Number.isFinite(o) ? void 0 : "Infinity" : void 0;
return t.issues.push({
expected: "number",
code: "invalid_type",
input: o,
inst: e,
...s ? { received: s } : {}
}), t;
};
}), ks = /* @__PURE__ */ u("$ZodNumber", (e, n) => {
Oo.init(e, n), gt.init(e, n);
}), vt = /* @__PURE__ */ u("$ZodBoolean", (e, n) => {
d.init(e, n), e._zod.pattern = ut, e._zod.parse = (t, r) => {
if (n.coerce)
try {
t.value = !!t.value;
} catch {
}
const o = t.value;
return typeof o == "boolean" || t.issues.push({
expected: "boolean",
code: "invalid_type",
input: o,
inst: e
}), t;
};
}), bt = /* @__PURE__ */ u("$ZodBigInt", (e, n) => {
d.init(e, n), e._zod.pattern = ot, e._zod.parse = (t, r) => {
if (n.coerce)
try {
t.value = BigInt(t.value);
} catch {
}
return typeof t.value == "bigint" || t.issues.push({
expected: "bigint",
code: "invalid_type",
input: t.value,
inst: e
}), t;
};
}), As = /* @__PURE__ */ u("$ZodBigInt", (e, n) => {
jo.init(e, n), bt.init(e, n);
}), Is = /* @__PURE__ */ u("$ZodSymbol", (e, n) => {
d.init(e, n), e._zod.parse = (t, r) => {
const o = t.value;
return typeof o == "symbol" || t.issues.push({
expected: "symbol",
code: "invalid_type",
input: o,
inst: e
}), t;
};
}), Es = /* @__PURE__ */ u("$ZodUndefined", (e, n) => {
d.init(e, n), e._zod.pattern = at, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.optin = "optional", e._zod.optout = "optional", e._zod.parse = (t, r) => {
const o = t.value;
return typeof o > "u" || t.issues.push({
expected: "undefined",
code: "invalid_type",
input: o,
inst: e
}), t;
};
}), Ts = /* @__PURE__ */ u("$ZodNull", (e, n) => {
d.init(e, n), e._zod.pattern = ct, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, r) => {
const o = t.value;
return o === null || t.issues.push({
expected: "null",
code: "invalid_type",
input: o,
inst: e
}), t;
};
}), Ss = /* @__PURE__ */ u("$ZodAny", (e, n) => {
d.init(e, n), e._zod.parse = (t) => t;
}), Ps = /* @__PURE__ */ u("$ZodUnknown", (e, n) => {
d.init(e, n), e._zod.parse = (t) => t;
}), xs = /* @__PURE__ */ u("$ZodNever", (e, n) => {
d.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
expected: "never",
code: "invalid_type",
input: t.value,
inst: e
}), t);
}), Ns = /* @__PURE__ */ u("$ZodVoid", (e, n) => {
d.init(e, n), e._zod.parse = (t, r) => {
const o = t.value;
return typeof o > "u" || t.issues.push({
expected: "void",
code: "invalid_type",
input: o,
inst: e
}), t;
};
}), Os = /* @__PURE__ */ u("$ZodDate", (e, n) => {
d.init(e, n), e._zod.parse = (t, r) => {
if (n.coerce)
try {
t.value = new Date(t.value);
} catch {
}
const o = t.value, s = o instanceof Date;
return s && !Nu