"use client";
var C;
(function(n) {
  n.assertEqual = (s) => {
  };
  function e(s) {
  }
  n.assertIs = e;
  function t(s) {
    throw new Error();
  }
  n.assertNever = t, n.arrayToEnum = (s) => {
    const r = {};
    for (const o of s)
      r[o] = o;
    return r;
  }, n.getValidEnumValues = (s) => {
    const r = n.objectKeys(s).filter((l) => typeof s[s[l]] != "number"), o = {};
    for (const l of r)
      o[l] = s[l];
    return n.objectValues(o);
  }, n.objectValues = (s) => n.objectKeys(s).map(function(r) {
    return s[r];
  }), n.objectKeys = typeof Object.keys == "function" ? (s) => Object.keys(s) : (s) => {
    const r = [];
    for (const o in s)
      Object.prototype.hasOwnProperty.call(s, o) && r.push(o);
    return r;
  }, n.find = (s, r) => {
    for (const o of s)
      if (r(o))
        return o;
  }, n.isInteger = typeof Number.isInteger == "function" ? (s) => Number.isInteger(s) : (s) => typeof s == "number" && Number.isFinite(s) && Math.floor(s) === s;
  function a(s, r = " | ") {
    return s.map((o) => typeof o == "string" ? `'${o}'` : o).join(r);
  }
  n.joinValues = a, n.jsonStringifyReplacer = (s, r) => typeof r == "bigint" ? r.toString() : r;
})(C || (C = {}));
var ye;
(function(n) {
  n.mergeShapes = (e, t) => ({
    ...e,
    ...t
    // second overwrites first
  });
})(ye || (ye = {}));
const p = C.arrayToEnum([
  "string",
  "nan",
  "number",
  "integer",
  "float",
  "boolean",
  "date",
  "bigint",
  "symbol",
  "function",
  "undefined",
  "null",
  "array",
  "object",
  "unknown",
  "promise",
  "void",
  "never",
  "map",
  "set"
]), $ = (n) => {
  switch (typeof n) {
    case "undefined":
      return p.undefined;
    case "string":
      return p.string;
    case "number":
      return Number.isNaN(n) ? p.nan : p.number;
    case "boolean":
      return p.boolean;
    case "function":
      return p.function;
    case "bigint":
      return p.bigint;
    case "symbol":
      return p.symbol;
    case "object":
      return Array.isArray(n) ? p.array : n === null ? p.null : n.then && typeof n.then == "function" && n.catch && typeof n.catch == "function" ? p.promise : typeof Map < "u" && n instanceof Map ? p.map : typeof Set < "u" && n instanceof Set ? p.set : typeof Date < "u" && n instanceof Date ? p.date : p.object;
    default:
      return p.unknown;
  }
}, c = C.arrayToEnum([
  "invalid_type",
  "invalid_literal",
  "custom",
  "invalid_union",
  "invalid_union_discriminator",
  "invalid_enum_value",
  "unrecognized_keys",
  "invalid_arguments",
  "invalid_return_type",
  "invalid_date",
  "invalid_string",
  "too_small",
  "too_big",
  "invalid_intersection_types",
  "not_multiple_of",
  "not_finite"
]);
class P extends Error {
  get errors() {
    return this.issues;
  }
  constructor(e) {
    super(), this.issues = [], this.addIssue = (a) => {
      this.issues = [...this.issues, a];
    }, this.addIssues = (a = []) => {
      this.issues = [...this.issues, ...a];
    };
    const t = new.target.prototype;
    Object.setPrototypeOf ? Object.setPrototypeOf(this, t) : this.__proto__ = t, this.name = "ZodError", this.issues = e;
  }
  format(e) {
    const t = e || function(r) {
      return r.message;
    }, a = { _errors: [] }, s = (r) => {
      for (const o of r.issues)
        if (o.code === "invalid_union")
          o.unionErrors.map(s);
        else if (o.code === "invalid_return_type")
          s(o.returnTypeError);
        else if (o.code === "invalid_arguments")
          s(o.argumentsError);
        else if (o.path.length === 0)
          a._errors.push(t(o));
        else {
          let l = a, g = 0;
          for (; g < o.path.length; ) {
            const y = o.path[g];
            g === o.path.length - 1 ? (l[y] = l[y] || { _errors: [] }, l[y]._errors.push(t(o))) : l[y] = l[y] || { _errors: [] }, l = l[y], g++;
          }
        }
    };
    return s(this), a;
  }
  static assert(e) {
    if (!(e instanceof P))
      throw new Error(`Not a ZodError: ${e}`);
  }
  toString() {
    return this.message;
  }
  get message() {
    return JSON.stringify(this.issues, C.jsonStringifyReplacer, 2);
  }
  get isEmpty() {
    return this.issues.length === 0;
  }
  flatten(e = (t) => t.message) {
    const t = {}, a = [];
    for (const s of this.issues)
      if (s.path.length > 0) {
        const r = s.path[0];
        t[r] = t[r] || [], t[r].push(e(s));
      } else
        a.push(e(s));
    return { formErrors: a, fieldErrors: t };
  }
  get formErrors() {
    return this.flatten();
  }
}
P.create = (n) => new P(n);
const oe = (n, e) => {
  let t;
  switch (n.code) {
    case c.invalid_type:
      n.received === p.undefined ? t = "Required" : t = `Expected ${n.expected}, received ${n.received}`;
      break;
    case c.invalid_literal:
      t = `Invalid literal value, expected ${JSON.stringify(n.expected, C.jsonStringifyReplacer)}`;
      break;
    case c.unrecognized_keys:
      t = `Unrecognized key(s) in object: ${C.joinValues(n.keys, ", ")}`;
      break;
    case c.invalid_union:
      t = "Invalid input";
      break;
    case c.invalid_union_discriminator:
      t = `Invalid discriminator value. Expected ${C.joinValues(n.options)}`;
      break;
    case c.invalid_enum_value:
      t = `Invalid enum value. Expected ${C.joinValues(n.options)}, received '${n.received}'`;
      break;
    case c.invalid_arguments:
      t = "Invalid function arguments";
      break;
    case c.invalid_return_type:
      t = "Invalid function return type";
      break;
    case c.invalid_date:
      t = "Invalid date";
      break;
    case c.invalid_string:
      typeof n.validation == "object" ? "includes" in n.validation ? (t = `Invalid input: must include "${n.validation.includes}"`, typeof n.validation.position == "number" && (t = `${t} at one or more positions greater than or equal to ${n.validation.position}`)) : "startsWith" in n.validation ? t = `Invalid input: must start with "${n.validation.startsWith}"` : "endsWith" in n.validation ? t = `Invalid input: must end with "${n.validation.endsWith}"` : C.assertNever(n.validation) : n.validation !== "regex" ? t = `Invalid ${n.validation}` : t = "Invalid";
      break;
    case c.too_small:
      n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "more than"} ${n.minimum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at least" : "over"} ${n.minimum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "bigint" ? t = `Number must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${n.minimum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly equal to " : n.inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(n.minimum))}` : t = "Invalid input";
      break;
    case c.too_big:
      n.type === "array" ? t = `Array must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "less than"} ${n.maximum} element(s)` : n.type === "string" ? t = `String must contain ${n.exact ? "exactly" : n.inclusive ? "at most" : "under"} ${n.maximum} character(s)` : n.type === "number" ? t = `Number must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "bigint" ? t = `BigInt must be ${n.exact ? "exactly" : n.inclusive ? "less than or equal to" : "less than"} ${n.maximum}` : n.type === "date" ? t = `Date must be ${n.exact ? "exactly" : n.inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(n.maximum))}` : t = "Invalid input";
      break;
    case c.custom:
      t = "Invalid input";
      break;
    case c.invalid_intersection_types:
      t = "Intersection results could not be merged";
      break;
    case c.not_multiple_of:
      t = `Number must be a multiple of ${n.multipleOf}`;
      break;
    case c.not_finite:
      t = "Number must be finite";
      break;
    default:
      t = e.defaultError, C.assertNever(n);
  }
  return { message: t };
};
let Pe = oe;
function Ee() {
  return Pe;
}
const je = (n) => {
  const { data: e, path: t, errorMaps: a, issueData: s } = n, r = [...t, ...s.path || []], o = {
    ...s,
    path: r
  };
  if (s.message !== void 0)
    return {
      ...s,
      path: r,
      message: s.message
    };
  let l = "";
  const g = a.filter((y) => !!y).slice().reverse();
  for (const y of g)
    l = y(o, { data: e, defaultError: l }).message;
  return {
    ...s,
    path: r,
    message: l
  };
};
function u(n, e) {
  const t = Ee(), a = je({
    issueData: e,
    data: n.data,
    path: n.path,
    errorMaps: [
      n.common.contextualErrorMap,
      // contextual error map is first priority
      n.schemaErrorMap,
      // then schema-bound map if available
      t,
      // then global override map
      t === oe ? void 0 : oe
      // then global default map
    ].filter((s) => !!s)
  });
  n.common.issues.push(a);
}
class R {
  constructor() {
    this.value = "valid";
  }
  dirty() {
    this.value === "valid" && (this.value = "dirty");
  }
  abort() {
    this.value !== "aborted" && (this.value = "aborted");
  }
  static mergeArray(e, t) {
    const a = [];
    for (const s of t) {
      if (s.status === "aborted")
        return k;
      s.status === "dirty" && e.dirty(), a.push(s.value);
    }
    return { status: e.value, value: a };
  }
  static async mergeObjectAsync(e, t) {
    const a = [];
    for (const s of t) {
      const r = await s.key, o = await s.value;
      a.push({
        key: r,
        value: o
      });
    }
    return R.mergeObjectSync(e, a);
  }
  static mergeObjectSync(e, t) {
    const a = {};
    for (const s of t) {
      const { key: r, value: o } = s;
      if (r.status === "aborted" || o.status === "aborted")
        return k;
      r.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), r.value !== "__proto__" && (typeof o.value < "u" || s.alwaysSet) && (a[r.value] = o.value);
    }
    return { status: e.value, value: a };
  }
}
const k = Object.freeze({
  status: "aborted"
}), Y = (n) => ({ status: "dirty", value: n }), Z = (n) => ({ status: "valid", value: n }), _e = (n) => n.status === "aborted", ve = (n) => n.status === "dirty", U = (n) => n.status === "valid", ee = (n) => typeof Promise < "u" && n instanceof Promise;
var f;
(function(n) {
  n.errToObj = (e) => typeof e == "string" ? { message: e } : e || {}, n.toString = (e) => typeof e == "string" ? e : e?.message;
})(f || (f = {}));
class E {
  constructor(e, t, a, s) {
    this._cachedPath = [], this.parent = e, this.data = t, this._path = a, this._key = s;
  }
  get path() {
    return this._cachedPath.length || (Array.isArray(this._key) ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
  }
}
const xe = (n, e) => {
  if (U(e))
    return { success: !0, data: e.value };
  if (!n.common.issues.length)
    throw new Error("Validation failed but no issues detected.");
  return {
    success: !1,
    get error() {
      if (this._error)
        return this._error;
      const t = new P(n.common.issues);
      return this._error = t, this._error;
    }
  };
};
function S(n) {
  if (!n)
    return {};
  const { errorMap: e, invalid_type_error: t, required_error: a, description: s } = n;
  if (e && (t || a))
    throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
  return e ? { errorMap: e, description: s } : { errorMap: (o, l) => {
    const { message: g } = n;
    return o.code === "invalid_enum_value" ? { message: g ?? l.defaultError } : typeof l.data > "u" ? { message: g ?? a ?? l.defaultError } : o.code !== "invalid_type" ? { message: l.defaultError } : { message: g ?? t ?? l.defaultError };
  }, description: s };
}
class T {
  get description() {
    return this._def.description;
  }
  _getType(e) {
    return $(e.data);
  }
  _getOrReturnCtx(e, t) {
    return t || {
      common: e.parent.common,
      data: e.data,
      parsedType: $(e.data),
      schemaErrorMap: this._def.errorMap,
      path: e.path,
      parent: e.parent
    };
  }
  _processInputParams(e) {
    return {
      status: new R(),
      ctx: {
        common: e.parent.common,
        data: e.data,
        parsedType: $(e.data),
        schemaErrorMap: this._def.errorMap,
        path: e.path,
        parent: e.parent
      }
    };
  }
  _parseSync(e) {
    const t = this._parse(e);
    if (ee(t))
      throw new Error("Synchronous parse encountered promise.");
    return t;
  }
  _parseAsync(e) {
    const t = this._parse(e);
    return Promise.resolve(t);
  }
  parse(e, t) {
    const a = this.safeParse(e, t);
    if (a.success)
      return a.data;
    throw a.error;
  }
  safeParse(e, t) {
    const a = {
      common: {
        issues: [],
        async: t?.async ?? !1,
        contextualErrorMap: t?.errorMap
      },
      path: t?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: $(e)
    }, s = this._parseSync({ data: e, path: a.path, parent: a });
    return xe(a, s);
  }
  "~validate"(e) {
    const t = {
      common: {
        issues: [],
        async: !!this["~standard"].async
      },
      path: [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: $(e)
    };
    if (!this["~standard"].async)
      try {
        const a = this._parseSync({ data: e, path: [], parent: t });
        return U(a) ? {
          value: a.value
        } : {
          issues: t.common.issues
        };
      } catch (a) {
        a?.message?.toLowerCase()?.includes("encountered") && (this["~standard"].async = !0), t.common = {
          issues: [],
          async: !0
        };
      }
    return this._parseAsync({ data: e, path: [], parent: t }).then((a) => U(a) ? {
      value: a.value
    } : {
      issues: t.common.issues
    });
  }
  async parseAsync(e, t) {
    const a = await this.safeParseAsync(e, t);
    if (a.success)
      return a.data;
    throw a.error;
  }
  async safeParseAsync(e, t) {
    const a = {
      common: {
        issues: [],
        contextualErrorMap: t?.errorMap,
        async: !0
      },
      path: t?.path || [],
      schemaErrorMap: this._def.errorMap,
      parent: null,
      data: e,
      parsedType: $(e)
    }, s = this._parse({ data: e, path: a.path, parent: a }), r = await (ee(s) ? s : Promise.resolve(s));
    return xe(a, r);
  }
  refine(e, t) {
    const a = (s) => typeof t == "string" || typeof t > "u" ? { message: t } : typeof t == "function" ? t(s) : t;
    return this._refinement((s, r) => {
      const o = e(s), l = () => r.addIssue({
        code: c.custom,
        ...a(s)
      });
      return typeof Promise < "u" && o instanceof Promise ? o.then((g) => g ? !0 : (l(), !1)) : o ? !0 : (l(), !1);
    });
  }
  refinement(e, t) {
    return this._refinement((a, s) => e(a) ? !0 : (s.addIssue(typeof t == "function" ? t(a, s) : t), !1));
  }
  _refinement(e) {
    return new W({
      schema: this,
      typeName: b.ZodEffects,
      effect: { type: "refinement", refinement: e }
    });
  }
  superRefine(e) {
    return this._refinement(e);
  }
  constructor(e) {
    this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = {
      version: 1,
      vendor: "zod",
      validate: (t) => this["~validate"](t)
    };
  }
  optional() {
    return L.create(this, this._def);
  }
  nullable() {
    return G.create(this, this._def);
  }
  nullish() {
    return this.nullable().optional();
  }
  array() {
    return I.create(this);
  }
  promise() {
    return re.create(this, this._def);
  }
  or(e) {
    return ae.create([this, e], this._def);
  }
  and(e) {
    return ne.create(this, e, this._def);
  }
  transform(e) {
    return new W({
      ...S(this._def),
      schema: this,
      typeName: b.ZodEffects,
      effect: { type: "transform", transform: e }
    });
  }
  default(e) {
    const t = typeof e == "function" ? e : () => e;
    return new he({
      ...S(this._def),
      innerType: this,
      defaultValue: t,
      typeName: b.ZodDefault
    });
  }
  brand() {
    return new st({
      typeName: b.ZodBranded,
      type: this,
      ...S(this._def)
    });
  }
  catch(e) {
    const t = typeof e == "function" ? e : () => e;
    return new fe({
      ...S(this._def),
      innerType: this,
      catchValue: t,
      typeName: b.ZodCatch
    });
  }
  describe(e) {
    const t = this.constructor;
    return new t({
      ...this._def,
      description: e
    });
  }
  pipe(e) {
    return ge.create(this, e);
  }
  readonly() {
    return me.create(this);
  }
  isOptional() {
    return this.safeParse(void 0).success;
  }
  isNullable() {
    return this.safeParse(null).success;
  }
}
const $e = /^c[^\s-]{8,}$/i, Le = /^[0-9a-z]+$/, Ve = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Me = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, ze = /^[a-z0-9_-]{21}$/i, De = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Be = /^[-+]?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)?)??$/, Ue = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Fe = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
let ie;
const qe = /^(?:(?: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])$/, We = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Ge = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Je = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ye = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, He = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Ae = "((\\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])))", Qe = new RegExp(`^${Ae}$`);
function Re(n) {
  let e = "[0-5]\\d";
  n.precision ? e = `${e}\\.\\d{${n.precision}}` : n.precision == null && (e = `${e}(\\.\\d+)?`);
  const t = n.precision ? "+" : "?";
  return `([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`;
}
function Xe(n) {
  return new RegExp(`^${Re(n)}$`);
}
function Ke(n) {
  let e = `${Ae}T${Re(n)}`;
  const t = [];
  return t.push(n.local ? "Z?" : "Z"), n.offset && t.push("([+-]\\d{2}:?\\d{2})"), e = `${e}(${t.join("|")})`, new RegExp(`^${e}$`);
}
function et(n, e) {
  return !!((e === "v4" || !e) && qe.test(n) || (e === "v6" || !e) && Ge.test(n));
}
function tt(n, e) {
  if (!De.test(n))
    return !1;
  try {
    const [t] = n.split(".");
    if (!t)
      return !1;
    const a = t.replace(/-/g, "+").replace(/_/g, "/").padEnd(t.length + (4 - t.length % 4) % 4, "="), s = JSON.parse(atob(a));
    return !(typeof s != "object" || s === null || "typ" in s && s?.typ !== "JWT" || !s.alg || e && s.alg !== e);
  } catch {
    return !1;
  }
}
function at(n, e) {
  return !!((e === "v4" || !e) && We.test(n) || (e === "v6" || !e) && Je.test(n));
}
class j extends T {
  _parse(e) {
    if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== p.string) {
      const r = this._getOrReturnCtx(e);
      return u(r, {
        code: c.invalid_type,
        expected: p.string,
        received: r.parsedType
      }), k;
    }
    const a = new R();
    let s;
    for (const r of this._def.checks)
      if (r.kind === "min")
        e.data.length < r.value && (s = this._getOrReturnCtx(e, s), u(s, {
          code: c.too_small,
          minimum: r.value,
          type: "string",
          inclusive: !0,
          exact: !1,
          message: r.message
        }), a.dirty());
      else if (r.kind === "max")
        e.data.length > r.value && (s = this._getOrReturnCtx(e, s), u(s, {
          code: c.too_big,
          maximum: r.value,
          type: "string",
          inclusive: !0,
          exact: !1,
          message: r.message
        }), a.dirty());
      else if (r.kind === "length") {
        const o = e.data.length > r.value, l = e.data.length < r.value;
        (o || l) && (s = this._getOrReturnCtx(e, s), o ? u(s, {
          code: c.too_big,
          maximum: r.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: r.message
        }) : l && u(s, {
          code: c.too_small,
          minimum: r.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: r.message
        }), a.dirty());
      } else if (r.kind === "email")
        Ue.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "email",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "emoji")
        ie || (ie = new RegExp(Fe, "u")), ie.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "emoji",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "uuid")
        Me.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "uuid",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "nanoid")
        ze.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "nanoid",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "cuid")
        $e.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "cuid",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "cuid2")
        Le.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "cuid2",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "ulid")
        Ve.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
          validation: "ulid",
          code: c.invalid_string,
          message: r.message
        }), a.dirty());
      else if (r.kind === "url")
        try {
          new URL(e.data);
        } catch {
          s = this._getOrReturnCtx(e, s), u(s, {
            validation: "url",
            code: c.invalid_string,
            message: r.message
          }), a.dirty();
        }
      else r.kind === "regex" ? (r.regex.lastIndex = 0, r.regex.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "regex",
        code: c.invalid_string,
        message: r.message
      }), a.dirty())) : r.kind === "trim" ? e.data = e.data.trim() : r.kind === "includes" ? e.data.includes(r.value, r.position) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: { includes: r.value, position: r.position },
        message: r.message
      }), a.dirty()) : r.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : r.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : r.kind === "startsWith" ? e.data.startsWith(r.value) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: { startsWith: r.value },
        message: r.message
      }), a.dirty()) : r.kind === "endsWith" ? e.data.endsWith(r.value) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: { endsWith: r.value },
        message: r.message
      }), a.dirty()) : r.kind === "datetime" ? Ke(r).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: "datetime",
        message: r.message
      }), a.dirty()) : r.kind === "date" ? Qe.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: "date",
        message: r.message
      }), a.dirty()) : r.kind === "time" ? Xe(r).test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.invalid_string,
        validation: "time",
        message: r.message
      }), a.dirty()) : r.kind === "duration" ? Be.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "duration",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : r.kind === "ip" ? et(e.data, r.version) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "ip",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : r.kind === "jwt" ? tt(e.data, r.alg) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "jwt",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : r.kind === "cidr" ? at(e.data, r.version) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "cidr",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : r.kind === "base64" ? Ye.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "base64",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : r.kind === "base64url" ? He.test(e.data) || (s = this._getOrReturnCtx(e, s), u(s, {
        validation: "base64url",
        code: c.invalid_string,
        message: r.message
      }), a.dirty()) : C.assertNever(r);
    return { status: a.value, value: e.data };
  }
  _regex(e, t, a) {
    return this.refinement((s) => e.test(s), {
      validation: t,
      code: c.invalid_string,
      ...f.errToObj(a)
    });
  }
  _addCheck(e) {
    return new j({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  email(e) {
    return this._addCheck({ kind: "email", ...f.errToObj(e) });
  }
  url(e) {
    return this._addCheck({ kind: "url", ...f.errToObj(e) });
  }
  emoji(e) {
    return this._addCheck({ kind: "emoji", ...f.errToObj(e) });
  }
  uuid(e) {
    return this._addCheck({ kind: "uuid", ...f.errToObj(e) });
  }
  nanoid(e) {
    return this._addCheck({ kind: "nanoid", ...f.errToObj(e) });
  }
  cuid(e) {
    return this._addCheck({ kind: "cuid", ...f.errToObj(e) });
  }
  cuid2(e) {
    return this._addCheck({ kind: "cuid2", ...f.errToObj(e) });
  }
  ulid(e) {
    return this._addCheck({ kind: "ulid", ...f.errToObj(e) });
  }
  base64(e) {
    return this._addCheck({ kind: "base64", ...f.errToObj(e) });
  }
  base64url(e) {
    return this._addCheck({
      kind: "base64url",
      ...f.errToObj(e)
    });
  }
  jwt(e) {
    return this._addCheck({ kind: "jwt", ...f.errToObj(e) });
  }
  ip(e) {
    return this._addCheck({ kind: "ip", ...f.errToObj(e) });
  }
  cidr(e) {
    return this._addCheck({ kind: "cidr", ...f.errToObj(e) });
  }
  datetime(e) {
    return typeof e == "string" ? this._addCheck({
      kind: "datetime",
      precision: null,
      offset: !1,
      local: !1,
      message: e
    }) : this._addCheck({
      kind: "datetime",
      precision: typeof e?.precision > "u" ? null : e?.precision,
      offset: e?.offset ?? !1,
      local: e?.local ?? !1,
      ...f.errToObj(e?.message)
    });
  }
  date(e) {
    return this._addCheck({ kind: "date", message: e });
  }
  time(e) {
    return typeof e == "string" ? this._addCheck({
      kind: "time",
      precision: null,
      message: e
    }) : this._addCheck({
      kind: "time",
      precision: typeof e?.precision > "u" ? null : e?.precision,
      ...f.errToObj(e?.message)
    });
  }
  duration(e) {
    return this._addCheck({ kind: "duration", ...f.errToObj(e) });
  }
  regex(e, t) {
    return this._addCheck({
      kind: "regex",
      regex: e,
      ...f.errToObj(t)
    });
  }
  includes(e, t) {
    return this._addCheck({
      kind: "includes",
      value: e,
      position: t?.position,
      ...f.errToObj(t?.message)
    });
  }
  startsWith(e, t) {
    return this._addCheck({
      kind: "startsWith",
      value: e,
      ...f.errToObj(t)
    });
  }
  endsWith(e, t) {
    return this._addCheck({
      kind: "endsWith",
      value: e,
      ...f.errToObj(t)
    });
  }
  min(e, t) {
    return this._addCheck({
      kind: "min",
      value: e,
      ...f.errToObj(t)
    });
  }
  max(e, t) {
    return this._addCheck({
      kind: "max",
      value: e,
      ...f.errToObj(t)
    });
  }
  length(e, t) {
    return this._addCheck({
      kind: "length",
      value: e,
      ...f.errToObj(t)
    });
  }
  /**
   * Equivalent to `.min(1)`
   */
  nonempty(e) {
    return this.min(1, f.errToObj(e));
  }
  trim() {
    return new j({
      ...this._def,
      checks: [...this._def.checks, { kind: "trim" }]
    });
  }
  toLowerCase() {
    return new j({
      ...this._def,
      checks: [...this._def.checks, { kind: "toLowerCase" }]
    });
  }
  toUpperCase() {
    return new j({
      ...this._def,
      checks: [...this._def.checks, { kind: "toUpperCase" }]
    });
  }
  get isDatetime() {
    return !!this._def.checks.find((e) => e.kind === "datetime");
  }
  get isDate() {
    return !!this._def.checks.find((e) => e.kind === "date");
  }
  get isTime() {
    return !!this._def.checks.find((e) => e.kind === "time");
  }
  get isDuration() {
    return !!this._def.checks.find((e) => e.kind === "duration");
  }
  get isEmail() {
    return !!this._def.checks.find((e) => e.kind === "email");
  }
  get isURL() {
    return !!this._def.checks.find((e) => e.kind === "url");
  }
  get isEmoji() {
    return !!this._def.checks.find((e) => e.kind === "emoji");
  }
  get isUUID() {
    return !!this._def.checks.find((e) => e.kind === "uuid");
  }
  get isNANOID() {
    return !!this._def.checks.find((e) => e.kind === "nanoid");
  }
  get isCUID() {
    return !!this._def.checks.find((e) => e.kind === "cuid");
  }
  get isCUID2() {
    return !!this._def.checks.find((e) => e.kind === "cuid2");
  }
  get isULID() {
    return !!this._def.checks.find((e) => e.kind === "ulid");
  }
  get isIP() {
    return !!this._def.checks.find((e) => e.kind === "ip");
  }
  get isCIDR() {
    return !!this._def.checks.find((e) => e.kind === "cidr");
  }
  get isBase64() {
    return !!this._def.checks.find((e) => e.kind === "base64");
  }
  get isBase64url() {
    return !!this._def.checks.find((e) => e.kind === "base64url");
  }
  get minLength() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxLength() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
}
j.create = (n) => new j({
  checks: [],
  typeName: b.ZodString,
  coerce: n?.coerce ?? !1,
  ...S(n)
});
function nt(n, e) {
  const t = (n.toString().split(".")[1] || "").length, a = (e.toString().split(".")[1] || "").length, s = t > a ? t : a, r = Number.parseInt(n.toFixed(s).replace(".", "")), o = Number.parseInt(e.toFixed(s).replace(".", ""));
  return r % o / 10 ** s;
}
class F extends T {
  constructor() {
    super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf;
  }
  _parse(e) {
    if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== p.number) {
      const r = this._getOrReturnCtx(e);
      return u(r, {
        code: c.invalid_type,
        expected: p.number,
        received: r.parsedType
      }), k;
    }
    let a;
    const s = new R();
    for (const r of this._def.checks)
      r.kind === "int" ? C.isInteger(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.invalid_type,
        expected: "integer",
        received: "float",
        message: r.message
      }), s.dirty()) : r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.too_small,
        minimum: r.value,
        type: "number",
        inclusive: r.inclusive,
        exact: !1,
        message: r.message
      }), s.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.too_big,
        maximum: r.value,
        type: "number",
        inclusive: r.inclusive,
        exact: !1,
        message: r.message
      }), s.dirty()) : r.kind === "multipleOf" ? nt(e.data, r.value) !== 0 && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.not_multiple_of,
        multipleOf: r.value,
        message: r.message
      }), s.dirty()) : r.kind === "finite" ? Number.isFinite(e.data) || (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.not_finite,
        message: r.message
      }), s.dirty()) : C.assertNever(r);
    return { status: s.value, value: e.data };
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, f.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, f.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, f.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, f.toString(t));
  }
  setLimit(e, t, a, s) {
    return new F({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind: e,
          value: t,
          inclusive: a,
          message: f.toString(s)
        }
      ]
    });
  }
  _addCheck(e) {
    return new F({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  int(e) {
    return this._addCheck({
      kind: "int",
      message: f.toString(e)
    });
  }
  positive(e) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: !1,
      message: f.toString(e)
    });
  }
  negative(e) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: !1,
      message: f.toString(e)
    });
  }
  nonpositive(e) {
    return this._addCheck({
      kind: "max",
      value: 0,
      inclusive: !0,
      message: f.toString(e)
    });
  }
  nonnegative(e) {
    return this._addCheck({
      kind: "min",
      value: 0,
      inclusive: !0,
      message: f.toString(e)
    });
  }
  multipleOf(e, t) {
    return this._addCheck({
      kind: "multipleOf",
      value: e,
      message: f.toString(t)
    });
  }
  finite(e) {
    return this._addCheck({
      kind: "finite",
      message: f.toString(e)
    });
  }
  safe(e) {
    return this._addCheck({
      kind: "min",
      inclusive: !0,
      value: Number.MIN_SAFE_INTEGER,
      message: f.toString(e)
    })._addCheck({
      kind: "max",
      inclusive: !0,
      value: Number.MAX_SAFE_INTEGER,
      message: f.toString(e)
    });
  }
  get minValue() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
  get isInt() {
    return !!this._def.checks.find((e) => e.kind === "int" || e.kind === "multipleOf" && C.isInteger(e.value));
  }
  get isFinite() {
    let e = null, t = null;
    for (const a of this._def.checks) {
      if (a.kind === "finite" || a.kind === "int" || a.kind === "multipleOf")
        return !0;
      a.kind === "min" ? (t === null || a.value > t) && (t = a.value) : a.kind === "max" && (e === null || a.value < e) && (e = a.value);
    }
    return Number.isFinite(t) && Number.isFinite(e);
  }
}
F.create = (n) => new F({
  checks: [],
  typeName: b.ZodNumber,
  coerce: n?.coerce || !1,
  ...S(n)
});
class Q extends T {
  constructor() {
    super(...arguments), this.min = this.gte, this.max = this.lte;
  }
  _parse(e) {
    if (this._def.coerce)
      try {
        e.data = BigInt(e.data);
      } catch {
        return this._getInvalidInput(e);
      }
    if (this._getType(e) !== p.bigint)
      return this._getInvalidInput(e);
    let a;
    const s = new R();
    for (const r of this._def.checks)
      r.kind === "min" ? (r.inclusive ? e.data < r.value : e.data <= r.value) && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.too_small,
        type: "bigint",
        minimum: r.value,
        inclusive: r.inclusive,
        message: r.message
      }), s.dirty()) : r.kind === "max" ? (r.inclusive ? e.data > r.value : e.data >= r.value) && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.too_big,
        type: "bigint",
        maximum: r.value,
        inclusive: r.inclusive,
        message: r.message
      }), s.dirty()) : r.kind === "multipleOf" ? e.data % r.value !== BigInt(0) && (a = this._getOrReturnCtx(e, a), u(a, {
        code: c.not_multiple_of,
        multipleOf: r.value,
        message: r.message
      }), s.dirty()) : C.assertNever(r);
    return { status: s.value, value: e.data };
  }
  _getInvalidInput(e) {
    const t = this._getOrReturnCtx(e);
    return u(t, {
      code: c.invalid_type,
      expected: p.bigint,
      received: t.parsedType
    }), k;
  }
  gte(e, t) {
    return this.setLimit("min", e, !0, f.toString(t));
  }
  gt(e, t) {
    return this.setLimit("min", e, !1, f.toString(t));
  }
  lte(e, t) {
    return this.setLimit("max", e, !0, f.toString(t));
  }
  lt(e, t) {
    return this.setLimit("max", e, !1, f.toString(t));
  }
  setLimit(e, t, a, s) {
    return new Q({
      ...this._def,
      checks: [
        ...this._def.checks,
        {
          kind: e,
          value: t,
          inclusive: a,
          message: f.toString(s)
        }
      ]
    });
  }
  _addCheck(e) {
    return new Q({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  positive(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !1,
      message: f.toString(e)
    });
  }
  negative(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !1,
      message: f.toString(e)
    });
  }
  nonpositive(e) {
    return this._addCheck({
      kind: "max",
      value: BigInt(0),
      inclusive: !0,
      message: f.toString(e)
    });
  }
  nonnegative(e) {
    return this._addCheck({
      kind: "min",
      value: BigInt(0),
      inclusive: !0,
      message: f.toString(e)
    });
  }
  multipleOf(e, t) {
    return this._addCheck({
      kind: "multipleOf",
      value: e,
      message: f.toString(t)
    });
  }
  get minValue() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e;
  }
  get maxValue() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e;
  }
}
Q.create = (n) => new Q({
  checks: [],
  typeName: b.ZodBigInt,
  coerce: n?.coerce ?? !1,
  ...S(n)
});
class le extends T {
  _parse(e) {
    if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== p.boolean) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.boolean,
        received: a.parsedType
      }), k;
    }
    return Z(e.data);
  }
}
le.create = (n) => new le({
  typeName: b.ZodBoolean,
  coerce: n?.coerce || !1,
  ...S(n)
});
class te extends T {
  _parse(e) {
    if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== p.date) {
      const r = this._getOrReturnCtx(e);
      return u(r, {
        code: c.invalid_type,
        expected: p.date,
        received: r.parsedType
      }), k;
    }
    if (Number.isNaN(e.data.getTime())) {
      const r = this._getOrReturnCtx(e);
      return u(r, {
        code: c.invalid_date
      }), k;
    }
    const a = new R();
    let s;
    for (const r of this._def.checks)
      r.kind === "min" ? e.data.getTime() < r.value && (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.too_small,
        message: r.message,
        inclusive: !0,
        exact: !1,
        minimum: r.value,
        type: "date"
      }), a.dirty()) : r.kind === "max" ? e.data.getTime() > r.value && (s = this._getOrReturnCtx(e, s), u(s, {
        code: c.too_big,
        message: r.message,
        inclusive: !0,
        exact: !1,
        maximum: r.value,
        type: "date"
      }), a.dirty()) : C.assertNever(r);
    return {
      status: a.value,
      value: new Date(e.data.getTime())
    };
  }
  _addCheck(e) {
    return new te({
      ...this._def,
      checks: [...this._def.checks, e]
    });
  }
  min(e, t) {
    return this._addCheck({
      kind: "min",
      value: e.getTime(),
      message: f.toString(t)
    });
  }
  max(e, t) {
    return this._addCheck({
      kind: "max",
      value: e.getTime(),
      message: f.toString(t)
    });
  }
  get minDate() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "min" && (e === null || t.value > e) && (e = t.value);
    return e != null ? new Date(e) : null;
  }
  get maxDate() {
    let e = null;
    for (const t of this._def.checks)
      t.kind === "max" && (e === null || t.value < e) && (e = t.value);
    return e != null ? new Date(e) : null;
  }
}
te.create = (n) => new te({
  checks: [],
  coerce: n?.coerce || !1,
  typeName: b.ZodDate,
  ...S(n)
});
class be extends T {
  _parse(e) {
    if (this._getType(e) !== p.symbol) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.symbol,
        received: a.parsedType
      }), k;
    }
    return Z(e.data);
  }
}
be.create = (n) => new be({
  typeName: b.ZodSymbol,
  ...S(n)
});
class ke extends T {
  _parse(e) {
    if (this._getType(e) !== p.undefined) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.undefined,
        received: a.parsedType
      }), k;
    }
    return Z(e.data);
  }
}
ke.create = (n) => new ke({
  typeName: b.ZodUndefined,
  ...S(n)
});
class ce extends T {
  _parse(e) {
    if (this._getType(e) !== p.null) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.null,
        received: a.parsedType
      }), k;
    }
    return Z(e.data);
  }
}
ce.create = (n) => new ce({
  typeName: b.ZodNull,
  ...S(n)
});
class we extends T {
  constructor() {
    super(...arguments), this._any = !0;
  }
  _parse(e) {
    return Z(e.data);
  }
}
we.create = (n) => new we({
  typeName: b.ZodAny,
  ...S(n)
});
class de extends T {
  constructor() {
    super(...arguments), this._unknown = !0;
  }
  _parse(e) {
    return Z(e.data);
  }
}
de.create = (n) => new de({
  typeName: b.ZodUnknown,
  ...S(n)
});
class V extends T {
  _parse(e) {
    const t = this._getOrReturnCtx(e);
    return u(t, {
      code: c.invalid_type,
      expected: p.never,
      received: t.parsedType
    }), k;
  }
}
V.create = (n) => new V({
  typeName: b.ZodNever,
  ...S(n)
});
class Se extends T {
  _parse(e) {
    if (this._getType(e) !== p.undefined) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.void,
        received: a.parsedType
      }), k;
    }
    return Z(e.data);
  }
}
Se.create = (n) => new Se({
  typeName: b.ZodVoid,
  ...S(n)
});
class I extends T {
  _parse(e) {
    const { ctx: t, status: a } = this._processInputParams(e), s = this._def;
    if (t.parsedType !== p.array)
      return u(t, {
        code: c.invalid_type,
        expected: p.array,
        received: t.parsedType
      }), k;
    if (s.exactLength !== null) {
      const o = t.data.length > s.exactLength.value, l = t.data.length < s.exactLength.value;
      (o || l) && (u(t, {
        code: o ? c.too_big : c.too_small,
        minimum: l ? s.exactLength.value : void 0,
        maximum: o ? s.exactLength.value : void 0,
        type: "array",
        inclusive: !0,
        exact: !0,
        message: s.exactLength.message
      }), a.dirty());
    }
    if (s.minLength !== null && t.data.length < s.minLength.value && (u(t, {
      code: c.too_small,
      minimum: s.minLength.value,
      type: "array",
      inclusive: !0,
      exact: !1,
      message: s.minLength.message
    }), a.dirty()), s.maxLength !== null && t.data.length > s.maxLength.value && (u(t, {
      code: c.too_big,
      maximum: s.maxLength.value,
      type: "array",
      inclusive: !0,
      exact: !1,
      message: s.maxLength.message
    }), a.dirty()), t.common.async)
      return Promise.all([...t.data].map((o, l) => s.type._parseAsync(new E(t, o, t.path, l)))).then((o) => R.mergeArray(a, o));
    const r = [...t.data].map((o, l) => s.type._parseSync(new E(t, o, t.path, l)));
    return R.mergeArray(a, r);
  }
  get element() {
    return this._def.type;
  }
  min(e, t) {
    return new I({
      ...this._def,
      minLength: { value: e, message: f.toString(t) }
    });
  }
  max(e, t) {
    return new I({
      ...this._def,
      maxLength: { value: e, message: f.toString(t) }
    });
  }
  length(e, t) {
    return new I({
      ...this._def,
      exactLength: { value: e, message: f.toString(t) }
    });
  }
  nonempty(e) {
    return this.min(1, e);
  }
}
I.create = (n, e) => new I({
  type: n,
  minLength: null,
  maxLength: null,
  exactLength: null,
  typeName: b.ZodArray,
  ...S(e)
});
function B(n) {
  if (n instanceof A) {
    const e = {};
    for (const t in n.shape) {
      const a = n.shape[t];
      e[t] = L.create(B(a));
    }
    return new A({
      ...n._def,
      shape: () => e
    });
  } else return n instanceof I ? new I({
    ...n._def,
    type: B(n.element)
  }) : n instanceof L ? L.create(B(n.unwrap())) : n instanceof G ? G.create(B(n.unwrap())) : n instanceof M ? M.create(n.items.map((e) => B(e))) : n;
}
class A extends T {
  constructor() {
    super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend;
  }
  _getCached() {
    if (this._cached !== null)
      return this._cached;
    const e = this._def.shape(), t = C.objectKeys(e);
    return this._cached = { shape: e, keys: t }, this._cached;
  }
  _parse(e) {
    if (this._getType(e) !== p.object) {
      const y = this._getOrReturnCtx(e);
      return u(y, {
        code: c.invalid_type,
        expected: p.object,
        received: y.parsedType
      }), k;
    }
    const { status: a, ctx: s } = this._processInputParams(e), { shape: r, keys: o } = this._getCached(), l = [];
    if (!(this._def.catchall instanceof V && this._def.unknownKeys === "strip"))
      for (const y in s.data)
        o.includes(y) || l.push(y);
    const g = [];
    for (const y of o) {
      const N = r[y], J = s.data[y];
      g.push({
        key: { status: "valid", value: y },
        value: N._parse(new E(s, J, s.path, y)),
        alwaysSet: y in s.data
      });
    }
    if (this._def.catchall instanceof V) {
      const y = this._def.unknownKeys;
      if (y === "passthrough")
        for (const N of l)
          g.push({
            key: { status: "valid", value: N },
            value: { status: "valid", value: s.data[N] }
          });
      else if (y === "strict")
        l.length > 0 && (u(s, {
          code: c.unrecognized_keys,
          keys: l
        }), a.dirty());
      else if (y !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.");
    } else {
      const y = this._def.catchall;
      for (const N of l) {
        const J = s.data[N];
        g.push({
          key: { status: "valid", value: N },
          value: y._parse(
            new E(s, J, s.path, N)
            //, ctx.child(key), value, getParsedType(value)
          ),
          alwaysSet: N in s.data
        });
      }
    }
    return s.common.async ? Promise.resolve().then(async () => {
      const y = [];
      for (const N of g) {
        const J = await N.key, Ie = await N.value;
        y.push({
          key: J,
          value: Ie,
          alwaysSet: N.alwaysSet
        });
      }
      return y;
    }).then((y) => R.mergeObjectSync(a, y)) : R.mergeObjectSync(a, g);
  }
  get shape() {
    return this._def.shape();
  }
  strict(e) {
    return f.errToObj, new A({
      ...this._def,
      unknownKeys: "strict",
      ...e !== void 0 ? {
        errorMap: (t, a) => {
          const s = this._def.errorMap?.(t, a).message ?? a.defaultError;
          return t.code === "unrecognized_keys" ? {
            message: f.errToObj(e).message ?? s
          } : {
            message: s
          };
        }
      } : {}
    });
  }
  strip() {
    return new A({
      ...this._def,
      unknownKeys: "strip"
    });
  }
  passthrough() {
    return new A({
      ...this._def,
      unknownKeys: "passthrough"
    });
  }
  // const AugmentFactory =
  //   <Def extends ZodObjectDef>(def: Def) =>
  //   <Augmentation extends ZodRawShape>(
  //     augmentation: Augmentation
  //   ): ZodObject<
  //     extendShape<ReturnType<Def["shape"]>, Augmentation>,
  //     Def["unknownKeys"],
  //     Def["catchall"]
  //   > => {
  //     return new ZodObject({
  //       ...def,
  //       shape: () => ({
  //         ...def.shape(),
  //         ...augmentation,
  //       }),
  //     }) as any;
  //   };
  extend(e) {
    return new A({
      ...this._def,
      shape: () => ({
        ...this._def.shape(),
        ...e
      })
    });
  }
  /**
   * Prior to zod@1.0.12 there was a bug in the
   * inferred type of merged objects. Please
   * upgrade if you are experiencing issues.
   */
  merge(e) {
    return new A({
      unknownKeys: e._def.unknownKeys,
      catchall: e._def.catchall,
      shape: () => ({
        ...this._def.shape(),
        ...e._def.shape()
      }),
      typeName: b.ZodObject
    });
  }
  // merge<
  //   Incoming extends AnyZodObject,
  //   Augmentation extends Incoming["shape"],
  //   NewOutput extends {
  //     [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
  //       ? Augmentation[k]["_output"]
  //       : k extends keyof Output
  //       ? Output[k]
  //       : never;
  //   },
  //   NewInput extends {
  //     [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
  //       ? Augmentation[k]["_input"]
  //       : k extends keyof Input
  //       ? Input[k]
  //       : never;
  //   }
  // >(
  //   merging: Incoming
  // ): ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"],
  //   NewOutput,
  //   NewInput
  // > {
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  setKey(e, t) {
    return this.augment({ [e]: t });
  }
  // merge<Incoming extends AnyZodObject>(
  //   merging: Incoming
  // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
  // ZodObject<
  //   extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
  //   Incoming["_def"]["unknownKeys"],
  //   Incoming["_def"]["catchall"]
  // > {
  //   // const mergedShape = objectUtil.mergeShapes(
  //   //   this._def.shape(),
  //   //   merging._def.shape()
  //   // );
  //   const merged: any = new ZodObject({
  //     unknownKeys: merging._def.unknownKeys,
  //     catchall: merging._def.catchall,
  //     shape: () =>
  //       objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
  //     typeName: ZodFirstPartyTypeKind.ZodObject,
  //   }) as any;
  //   return merged;
  // }
  catchall(e) {
    return new A({
      ...this._def,
      catchall: e
    });
  }
  pick(e) {
    const t = {};
    for (const a of C.objectKeys(e))
      e[a] && this.shape[a] && (t[a] = this.shape[a]);
    return new A({
      ...this._def,
      shape: () => t
    });
  }
  omit(e) {
    const t = {};
    for (const a of C.objectKeys(this.shape))
      e[a] || (t[a] = this.shape[a]);
    return new A({
      ...this._def,
      shape: () => t
    });
  }
  /**
   * @deprecated
   */
  deepPartial() {
    return B(this);
  }
  partial(e) {
    const t = {};
    for (const a of C.objectKeys(this.shape)) {
      const s = this.shape[a];
      e && !e[a] ? t[a] = s : t[a] = s.optional();
    }
    return new A({
      ...this._def,
      shape: () => t
    });
  }
  required(e) {
    const t = {};
    for (const a of C.objectKeys(this.shape))
      if (e && !e[a])
        t[a] = this.shape[a];
      else {
        let r = this.shape[a];
        for (; r instanceof L; )
          r = r._def.innerType;
        t[a] = r;
      }
    return new A({
      ...this._def,
      shape: () => t
    });
  }
  keyof() {
    return Ze(C.objectKeys(this.shape));
  }
}
A.create = (n, e) => new A({
  shape: () => n,
  unknownKeys: "strip",
  catchall: V.create(),
  typeName: b.ZodObject,
  ...S(e)
});
A.strictCreate = (n, e) => new A({
  shape: () => n,
  unknownKeys: "strict",
  catchall: V.create(),
  typeName: b.ZodObject,
  ...S(e)
});
A.lazycreate = (n, e) => new A({
  shape: n,
  unknownKeys: "strip",
  catchall: V.create(),
  typeName: b.ZodObject,
  ...S(e)
});
class ae extends T {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e), a = this._def.options;
    function s(r) {
      for (const l of r)
        if (l.result.status === "valid")
          return l.result;
      for (const l of r)
        if (l.result.status === "dirty")
          return t.common.issues.push(...l.ctx.common.issues), l.result;
      const o = r.map((l) => new P(l.ctx.common.issues));
      return u(t, {
        code: c.invalid_union,
        unionErrors: o
      }), k;
    }
    if (t.common.async)
      return Promise.all(a.map(async (r) => {
        const o = {
          ...t,
          common: {
            ...t.common,
            issues: []
          },
          parent: null
        };
        return {
          result: await r._parseAsync({
            data: t.data,
            path: t.path,
            parent: o
          }),
          ctx: o
        };
      })).then(s);
    {
      let r;
      const o = [];
      for (const g of a) {
        const y = {
          ...t,
          common: {
            ...t.common,
            issues: []
          },
          parent: null
        }, N = g._parseSync({
          data: t.data,
          path: t.path,
          parent: y
        });
        if (N.status === "valid")
          return N;
        N.status === "dirty" && !r && (r = { result: N, ctx: y }), y.common.issues.length && o.push(y.common.issues);
      }
      if (r)
        return t.common.issues.push(...r.ctx.common.issues), r.result;
      const l = o.map((g) => new P(g));
      return u(t, {
        code: c.invalid_union,
        unionErrors: l
      }), k;
    }
  }
  get options() {
    return this._def.options;
  }
}
ae.create = (n, e) => new ae({
  options: n,
  typeName: b.ZodUnion,
  ...S(e)
});
function ue(n, e) {
  const t = $(n), a = $(e);
  if (n === e)
    return { valid: !0, data: n };
  if (t === p.object && a === p.object) {
    const s = C.objectKeys(e), r = C.objectKeys(n).filter((l) => s.indexOf(l) !== -1), o = { ...n, ...e };
    for (const l of r) {
      const g = ue(n[l], e[l]);
      if (!g.valid)
        return { valid: !1 };
      o[l] = g.data;
    }
    return { valid: !0, data: o };
  } else if (t === p.array && a === p.array) {
    if (n.length !== e.length)
      return { valid: !1 };
    const s = [];
    for (let r = 0; r < n.length; r++) {
      const o = n[r], l = e[r], g = ue(o, l);
      if (!g.valid)
        return { valid: !1 };
      s.push(g.data);
    }
    return { valid: !0, data: s };
  } else return t === p.date && a === p.date && +n == +e ? { valid: !0, data: n } : { valid: !1 };
}
class ne extends T {
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e), s = (r, o) => {
      if (_e(r) || _e(o))
        return k;
      const l = ue(r.value, o.value);
      return l.valid ? ((ve(r) || ve(o)) && t.dirty(), { status: t.value, value: l.data }) : (u(a, {
        code: c.invalid_intersection_types
      }), k);
    };
    return a.common.async ? Promise.all([
      this._def.left._parseAsync({
        data: a.data,
        path: a.path,
        parent: a
      }),
      this._def.right._parseAsync({
        data: a.data,
        path: a.path,
        parent: a
      })
    ]).then(([r, o]) => s(r, o)) : s(this._def.left._parseSync({
      data: a.data,
      path: a.path,
      parent: a
    }), this._def.right._parseSync({
      data: a.data,
      path: a.path,
      parent: a
    }));
  }
}
ne.create = (n, e, t) => new ne({
  left: n,
  right: e,
  typeName: b.ZodIntersection,
  ...S(t)
});
class M extends T {
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e);
    if (a.parsedType !== p.array)
      return u(a, {
        code: c.invalid_type,
        expected: p.array,
        received: a.parsedType
      }), k;
    if (a.data.length < this._def.items.length)
      return u(a, {
        code: c.too_small,
        minimum: this._def.items.length,
        inclusive: !0,
        exact: !1,
        type: "array"
      }), k;
    !this._def.rest && a.data.length > this._def.items.length && (u(a, {
      code: c.too_big,
      maximum: this._def.items.length,
      inclusive: !0,
      exact: !1,
      type: "array"
    }), t.dirty());
    const r = [...a.data].map((o, l) => {
      const g = this._def.items[l] || this._def.rest;
      return g ? g._parse(new E(a, o, a.path, l)) : null;
    }).filter((o) => !!o);
    return a.common.async ? Promise.all(r).then((o) => R.mergeArray(t, o)) : R.mergeArray(t, r);
  }
  get items() {
    return this._def.items;
  }
  rest(e) {
    return new M({
      ...this._def,
      rest: e
    });
  }
}
M.create = (n, e) => {
  if (!Array.isArray(n))
    throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
  return new M({
    items: n,
    typeName: b.ZodTuple,
    rest: null,
    ...S(e)
  });
};
class se extends T {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e);
    if (a.parsedType !== p.object)
      return u(a, {
        code: c.invalid_type,
        expected: p.object,
        received: a.parsedType
      }), k;
    const s = [], r = this._def.keyType, o = this._def.valueType;
    for (const l in a.data)
      s.push({
        key: r._parse(new E(a, l, a.path, l)),
        value: o._parse(new E(a, a.data[l], a.path, l)),
        alwaysSet: l in a.data
      });
    return a.common.async ? R.mergeObjectAsync(t, s) : R.mergeObjectSync(t, s);
  }
  get element() {
    return this._def.valueType;
  }
  static create(e, t, a) {
    return t instanceof T ? new se({
      keyType: e,
      valueType: t,
      typeName: b.ZodRecord,
      ...S(a)
    }) : new se({
      keyType: j.create(),
      valueType: e,
      typeName: b.ZodRecord,
      ...S(t)
    });
  }
}
class Te extends T {
  get keySchema() {
    return this._def.keyType;
  }
  get valueSchema() {
    return this._def.valueType;
  }
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e);
    if (a.parsedType !== p.map)
      return u(a, {
        code: c.invalid_type,
        expected: p.map,
        received: a.parsedType
      }), k;
    const s = this._def.keyType, r = this._def.valueType, o = [...a.data.entries()].map(([l, g], y) => ({
      key: s._parse(new E(a, l, a.path, [y, "key"])),
      value: r._parse(new E(a, g, a.path, [y, "value"]))
    }));
    if (a.common.async) {
      const l = /* @__PURE__ */ new Map();
      return Promise.resolve().then(async () => {
        for (const g of o) {
          const y = await g.key, N = await g.value;
          if (y.status === "aborted" || N.status === "aborted")
            return k;
          (y.status === "dirty" || N.status === "dirty") && t.dirty(), l.set(y.value, N.value);
        }
        return { status: t.value, value: l };
      });
    } else {
      const l = /* @__PURE__ */ new Map();
      for (const g of o) {
        const y = g.key, N = g.value;
        if (y.status === "aborted" || N.status === "aborted")
          return k;
        (y.status === "dirty" || N.status === "dirty") && t.dirty(), l.set(y.value, N.value);
      }
      return { status: t.value, value: l };
    }
  }
}
Te.create = (n, e, t) => new Te({
  valueType: e,
  keyType: n,
  typeName: b.ZodMap,
  ...S(t)
});
class X extends T {
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e);
    if (a.parsedType !== p.set)
      return u(a, {
        code: c.invalid_type,
        expected: p.set,
        received: a.parsedType
      }), k;
    const s = this._def;
    s.minSize !== null && a.data.size < s.minSize.value && (u(a, {
      code: c.too_small,
      minimum: s.minSize.value,
      type: "set",
      inclusive: !0,
      exact: !1,
      message: s.minSize.message
    }), t.dirty()), s.maxSize !== null && a.data.size > s.maxSize.value && (u(a, {
      code: c.too_big,
      maximum: s.maxSize.value,
      type: "set",
      inclusive: !0,
      exact: !1,
      message: s.maxSize.message
    }), t.dirty());
    const r = this._def.valueType;
    function o(g) {
      const y = /* @__PURE__ */ new Set();
      for (const N of g) {
        if (N.status === "aborted")
          return k;
        N.status === "dirty" && t.dirty(), y.add(N.value);
      }
      return { status: t.value, value: y };
    }
    const l = [...a.data.values()].map((g, y) => r._parse(new E(a, g, a.path, y)));
    return a.common.async ? Promise.all(l).then((g) => o(g)) : o(l);
  }
  min(e, t) {
    return new X({
      ...this._def,
      minSize: { value: e, message: f.toString(t) }
    });
  }
  max(e, t) {
    return new X({
      ...this._def,
      maxSize: { value: e, message: f.toString(t) }
    });
  }
  size(e, t) {
    return this.min(e, t).max(e, t);
  }
  nonempty(e) {
    return this.min(1, e);
  }
}
X.create = (n, e) => new X({
  valueType: n,
  minSize: null,
  maxSize: null,
  typeName: b.ZodSet,
  ...S(e)
});
class pe extends T {
  get schema() {
    return this._def.getter();
  }
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    return this._def.getter()._parse({ data: t.data, path: t.path, parent: t });
  }
}
pe.create = (n, e) => new pe({
  getter: n,
  typeName: b.ZodLazy,
  ...S(e)
});
class Ce extends T {
  _parse(e) {
    if (e.data !== this._def.value) {
      const t = this._getOrReturnCtx(e);
      return u(t, {
        received: t.data,
        code: c.invalid_literal,
        expected: this._def.value
      }), k;
    }
    return { status: "valid", value: e.data };
  }
  get value() {
    return this._def.value;
  }
}
Ce.create = (n, e) => new Ce({
  value: n,
  typeName: b.ZodLiteral,
  ...S(e)
});
function Ze(n, e) {
  return new q({
    values: n,
    typeName: b.ZodEnum,
    ...S(e)
  });
}
class q extends T {
  _parse(e) {
    if (typeof e.data != "string") {
      const t = this._getOrReturnCtx(e), a = this._def.values;
      return u(t, {
        expected: C.joinValues(a),
        received: t.parsedType,
        code: c.invalid_type
      }), k;
    }
    if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) {
      const t = this._getOrReturnCtx(e), a = this._def.values;
      return u(t, {
        received: t.data,
        code: c.invalid_enum_value,
        options: a
      }), k;
    }
    return Z(e.data);
  }
  get options() {
    return this._def.values;
  }
  get enum() {
    const e = {};
    for (const t of this._def.values)
      e[t] = t;
    return e;
  }
  get Values() {
    const e = {};
    for (const t of this._def.values)
      e[t] = t;
    return e;
  }
  get Enum() {
    const e = {};
    for (const t of this._def.values)
      e[t] = t;
    return e;
  }
  extract(e, t = this._def) {
    return q.create(e, {
      ...this._def,
      ...t
    });
  }
  exclude(e, t = this._def) {
    return q.create(this.options.filter((a) => !e.includes(a)), {
      ...this._def,
      ...t
    });
  }
}
q.create = Ze;
class Ne extends T {
  _parse(e) {
    const t = C.getValidEnumValues(this._def.values), a = this._getOrReturnCtx(e);
    if (a.parsedType !== p.string && a.parsedType !== p.number) {
      const s = C.objectValues(t);
      return u(a, {
        expected: C.joinValues(s),
        received: a.parsedType,
        code: c.invalid_type
      }), k;
    }
    if (this._cache || (this._cache = new Set(C.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) {
      const s = C.objectValues(t);
      return u(a, {
        received: a.data,
        code: c.invalid_enum_value,
        options: s
      }), k;
    }
    return Z(e.data);
  }
  get enum() {
    return this._def.values;
  }
}
Ne.create = (n, e) => new Ne({
  values: n,
  typeName: b.ZodNativeEnum,
  ...S(e)
});
class re extends T {
  unwrap() {
    return this._def.type;
  }
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    if (t.parsedType !== p.promise && t.common.async === !1)
      return u(t, {
        code: c.invalid_type,
        expected: p.promise,
        received: t.parsedType
      }), k;
    const a = t.parsedType === p.promise ? t.data : Promise.resolve(t.data);
    return Z(a.then((s) => this._def.type.parseAsync(s, {
      path: t.path,
      errorMap: t.common.contextualErrorMap
    })));
  }
}
re.create = (n, e) => new re({
  type: n,
  typeName: b.ZodPromise,
  ...S(e)
});
class W extends T {
  innerType() {
    return this._def.schema;
  }
  sourceType() {
    return this._def.schema._def.typeName === b.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
  }
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e), s = this._def.effect || null, r = {
      addIssue: (o) => {
        u(a, o), o.fatal ? t.abort() : t.dirty();
      },
      get path() {
        return a.path;
      }
    };
    if (r.addIssue = r.addIssue.bind(r), s.type === "preprocess") {
      const o = s.transform(a.data, r);
      if (a.common.async)
        return Promise.resolve(o).then(async (l) => {
          if (t.value === "aborted")
            return k;
          const g = await this._def.schema._parseAsync({
            data: l,
            path: a.path,
            parent: a
          });
          return g.status === "aborted" ? k : g.status === "dirty" || t.value === "dirty" ? Y(g.value) : g;
        });
      {
        if (t.value === "aborted")
          return k;
        const l = this._def.schema._parseSync({
          data: o,
          path: a.path,
          parent: a
        });
        return l.status === "aborted" ? k : l.status === "dirty" || t.value === "dirty" ? Y(l.value) : l;
      }
    }
    if (s.type === "refinement") {
      const o = (l) => {
        const g = s.refinement(l, r);
        if (a.common.async)
          return Promise.resolve(g);
        if (g instanceof Promise)
          throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
        return l;
      };
      if (a.common.async === !1) {
        const l = this._def.schema._parseSync({
          data: a.data,
          path: a.path,
          parent: a
        });
        return l.status === "aborted" ? k : (l.status === "dirty" && t.dirty(), o(l.value), { status: t.value, value: l.value });
      } else
        return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((l) => l.status === "aborted" ? k : (l.status === "dirty" && t.dirty(), o(l.value).then(() => ({ status: t.value, value: l.value }))));
    }
    if (s.type === "transform")
      if (a.common.async === !1) {
        const o = this._def.schema._parseSync({
          data: a.data,
          path: a.path,
          parent: a
        });
        if (!U(o))
          return k;
        const l = s.transform(o.value, r);
        if (l instanceof Promise)
          throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
        return { status: t.value, value: l };
      } else
        return this._def.schema._parseAsync({ data: a.data, path: a.path, parent: a }).then((o) => U(o) ? Promise.resolve(s.transform(o.value, r)).then((l) => ({
          status: t.value,
          value: l
        })) : k);
    C.assertNever(s);
  }
}
W.create = (n, e, t) => new W({
  schema: n,
  typeName: b.ZodEffects,
  effect: e,
  ...S(t)
});
W.createWithPreprocess = (n, e, t) => new W({
  schema: e,
  effect: { type: "preprocess", transform: n },
  typeName: b.ZodEffects,
  ...S(t)
});
class L extends T {
  _parse(e) {
    return this._getType(e) === p.undefined ? Z(void 0) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
}
L.create = (n, e) => new L({
  innerType: n,
  typeName: b.ZodOptional,
  ...S(e)
});
class G extends T {
  _parse(e) {
    return this._getType(e) === p.null ? Z(null) : this._def.innerType._parse(e);
  }
  unwrap() {
    return this._def.innerType;
  }
}
G.create = (n, e) => new G({
  innerType: n,
  typeName: b.ZodNullable,
  ...S(e)
});
class he extends T {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e);
    let a = t.data;
    return t.parsedType === p.undefined && (a = this._def.defaultValue()), this._def.innerType._parse({
      data: a,
      path: t.path,
      parent: t
    });
  }
  removeDefault() {
    return this._def.innerType;
  }
}
he.create = (n, e) => new he({
  innerType: n,
  typeName: b.ZodDefault,
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
  ...S(e)
});
class fe extends T {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e), a = {
      ...t,
      common: {
        ...t.common,
        issues: []
      }
    }, s = this._def.innerType._parse({
      data: a.data,
      path: a.path,
      parent: {
        ...a
      }
    });
    return ee(s) ? s.then((r) => ({
      status: "valid",
      value: r.status === "valid" ? r.value : this._def.catchValue({
        get error() {
          return new P(a.common.issues);
        },
        input: a.data
      })
    })) : {
      status: "valid",
      value: s.status === "valid" ? s.value : this._def.catchValue({
        get error() {
          return new P(a.common.issues);
        },
        input: a.data
      })
    };
  }
  removeCatch() {
    return this._def.innerType;
  }
}
fe.create = (n, e) => new fe({
  innerType: n,
  typeName: b.ZodCatch,
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
  ...S(e)
});
class Oe extends T {
  _parse(e) {
    if (this._getType(e) !== p.nan) {
      const a = this._getOrReturnCtx(e);
      return u(a, {
        code: c.invalid_type,
        expected: p.nan,
        received: a.parsedType
      }), k;
    }
    return { status: "valid", value: e.data };
  }
}
Oe.create = (n) => new Oe({
  typeName: b.ZodNaN,
  ...S(n)
});
class st extends T {
  _parse(e) {
    const { ctx: t } = this._processInputParams(e), a = t.data;
    return this._def.type._parse({
      data: a,
      path: t.path,
      parent: t
    });
  }
  unwrap() {
    return this._def.type;
  }
}
class ge extends T {
  _parse(e) {
    const { status: t, ctx: a } = this._processInputParams(e);
    if (a.common.async)
      return (async () => {
        const r = await this._def.in._parseAsync({
          data: a.data,
          path: a.path,
          parent: a
        });
        return r.status === "aborted" ? k : r.status === "dirty" ? (t.dirty(), Y(r.value)) : this._def.out._parseAsync({
          data: r.value,
          path: a.path,
          parent: a
        });
      })();
    {
      const s = this._def.in._parseSync({
        data: a.data,
        path: a.path,
        parent: a
      });
      return s.status === "aborted" ? k : s.status === "dirty" ? (t.dirty(), {
        status: "dirty",
        value: s.value
      }) : this._def.out._parseSync({
        data: s.value,
        path: a.path,
        parent: a
      });
    }
  }
  static create(e, t) {
    return new ge({
      in: e,
      out: t,
      typeName: b.ZodPipeline
    });
  }
}
class me extends T {
  _parse(e) {
    const t = this._def.innerType._parse(e), a = (s) => (U(s) && (s.value = Object.freeze(s.value)), s);
    return ee(t) ? t.then((s) => a(s)) : a(t);
  }
  unwrap() {
    return this._def.innerType;
  }
}
me.create = (n, e) => new me({
  innerType: n,
  typeName: b.ZodReadonly,
  ...S(e)
});
var b;
(function(n) {
  n.ZodString = "ZodString", n.ZodNumber = "ZodNumber", n.ZodNaN = "ZodNaN", n.ZodBigInt = "ZodBigInt", n.ZodBoolean = "ZodBoolean", n.ZodDate = "ZodDate", n.ZodSymbol = "ZodSymbol", n.ZodUndefined = "ZodUndefined", n.ZodNull = "ZodNull", n.ZodAny = "ZodAny", n.ZodUnknown = "ZodUnknown", n.ZodNever = "ZodNever", n.ZodVoid = "ZodVoid", n.ZodArray = "ZodArray", n.ZodObject = "ZodObject", n.ZodUnion = "ZodUnion", n.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", n.ZodIntersection = "ZodIntersection", n.ZodTuple = "ZodTuple", n.ZodRecord = "ZodRecord", n.ZodMap = "ZodMap", n.ZodSet = "ZodSet", n.ZodFunction = "ZodFunction", n.ZodLazy = "ZodLazy", n.ZodLiteral = "ZodLiteral", n.ZodEnum = "ZodEnum", n.ZodEffects = "ZodEffects", n.ZodNativeEnum = "ZodNativeEnum", n.ZodOptional = "ZodOptional", n.ZodNullable = "ZodNullable", n.ZodDefault = "ZodDefault", n.ZodCatch = "ZodCatch", n.ZodPromise = "ZodPromise", n.ZodBranded = "ZodBranded", n.ZodPipeline = "ZodPipeline", n.ZodReadonly = "ZodReadonly";
})(b || (b = {}));
const i = j.create, _ = F.create, d = le.create, x = ce.create, O = de.create;
V.create;
const z = I.create, m = A.create, v = ae.create;
ne.create;
const D = M.create, H = se.create, rt = pe.create, w = q.create;
re.create;
L.create;
G.create;
const h = v([
  i(),
  _(),
  d(),
  x(),
  m({ path: i() })
]), K = rt(
  () => v([
    m({ and: z(K) }),
    m({ or: z(K) }),
    m({ not: K }),
    m({ path: i() }),
    m({ eq: D([h, h]) }),
    m({ neq: D([h, h]) }),
    m({ gt: D([h, h]) }),
    m({ gte: D([h, h]) }),
    m({ lt: D([h, h]) }),
    m({ lte: D([h, h]) })
  ])
), it = v([
  d(),
  m({ path: i() }),
  m({ auth: w(["signedIn", "signedOut"]) }),
  K
]), ot = m({
  title: i(),
  message: i(),
  variant: w(["default", "danger"]).optional(),
  confirmLabel: i().optional(),
  cancelLabel: i().optional()
}), lt = m({
  name: i(),
  params: H(i(), h).optional(),
  confirm: ot.optional(),
  onSuccess: m({ set: H(i(), h) }).optional(),
  onError: m({ set: H(i(), h) }).optional()
}), ct = m({
  variant: w(["primary", "secondary", "destructive", "outline", "beta"]).optional(),
  className: i().optional(),
  children: v([i(), _(), d(), x(), h]).optional()
}), dt = m({
  icon: v([i(), _(), d(), x(), h]).optional(),
  text: i().optional(),
  children: v([i(), _(), d(), x(), h]).optional(),
  variant: w(["default", "alert", "error"]).optional(),
  className: i().optional()
}), ut = m({
  size: w(["sm", "base"]).optional(),
  children: v([i(), _(), d(), x(), h]).optional(),
  className: i().optional()
}), pt = m({
  children: v([i(), _(), d(), x(), h]).optional(),
  className: i().optional(),
  icon: v([i(), _(), d(), x(), h]).optional(),
  loading: d().optional(),
  shape: w(["base", "square", "circle"]).optional(),
  size: w(["xs", "sm", "base", "lg"]).optional(),
  variant: w(["primary", "secondary", "ghost", "destructive", "secondary-destructive", "outline"]).optional(),
  id: i().optional(),
  lang: i().optional(),
  title: i().optional(),
  disabled: d().optional(),
  name: i().optional(),
  type: w(["submit", "reset", "button"]).optional(),
  value: O().optional()
}), ht = m({
  variant: w(["default", "error"]).optional(),
  // Visual variant: "default" or "error" for validation failures (visual only, no error text)
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the checkbox (enables built-in Field wrapper) - can be a string or any React node
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  controlFirst: d().optional(),
  // When true (default), checkbox appears before label. When false, label appears before checkbox.
  checked: d().optional(),
  // Whether the checkbox is checked (controlled)
  indeterminate: d().optional(),
  // Whether the checkbox is in indeterminate state
  disabled: d().optional(),
  // Whether the checkbox is disabled
  name: i().optional(),
  // Name for form submission
  required: d().optional(),
  // Whether the field is required
  className: i().optional(),
  // Additional class name
  onValueChange: O().optional()
  // Callback when checkbox value changes
}), ft = m({
  size: w(["sm", "base", "lg"]).optional(),
  text: i(),
  // The text to display and copy to clipboard
  className: i().optional()
  // Additional CSS classes
}), mt = m({
  lang: w(["ts", "tsx", "jsonc", "bash", "css"]).optional(),
  code: i(),
  // The code content to display
  values: O().optional(),
  // Template values for interpolation
  className: i().optional()
  // Additional CSS classes
}), gt = m({
  children: v([i(), _(), d(), x(), h]).optional(),
  label: i(),
  // Text label displayed in the trigger button
  open: d().optional(),
  // Whether the collapsible content is visible
  className: i().optional(),
  // Additional CSS classes for the content panel
  onOpenChange: O().optional()
  // Callback when collapsed state changes
}), yt = m({
  inputSide: w(["right", "top"]).optional(),
  items: z(O()),
  // Array of items to display in the dropdown
  value: z(O()).optional(),
  // Currently selected value(s)
  children: v([i(), _(), d(), x(), h]).optional(),
  // Combobox content (trigger, content, items)
  className: i().optional(),
  // Additional CSS classes
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the combobox (enables Field wrapper) - can be a string or any React node
  required: d().optional(),
  // Whether the combobox is required
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  description: v([i(), _(), d(), x(), h]).optional(),
  // Helper text displayed below the combobox
  error: O().optional(),
  // Error message or validation error object
  onValueChange: O().optional(),
  // Callback when selection changes
  multiple: d().optional(),
  // Allow multiple selections
  isItemEqualToValue: O().optional()
  // Custom equality function for comparing items
}), _t = m({
  open: d(),
  // Whether the dialog is open
  children: v([i(), _(), d(), x(), h]).optional()
  // Child content - typically one or more Panel components
}), vt = m({
  size: w(["sm", "base", "lg"]).optional(),
  variant: w(["default", "subtle"]).optional(),
  timezone: i().optional(),
  // Display timezone (display only)
  className: i().optional(),
  // Additional CSS classes
  onStartDateChange: O().optional(),
  // Callback when start date changes
  onEndDateChange: O().optional()
  // Callback when end date changes
}), xt = m({
  className: i().optional(),
  children: v([i(), _(), d(), x(), h]).optional(),
  size: w(["base", "sm", "lg", "xl"]).optional()
}), bt = m({
  variant: w(["default", "danger"]).optional()
}), kt = m({
  size: w(["sm", "base", "lg"]).optional(),
  icon: v([i(), _(), d(), x(), h]).optional(),
  title: i(),
  description: i().optional(),
  commandLine: i().optional(),
  contents: v([i(), _(), d(), x(), h]).optional(),
  className: i().optional()
}), wt = m({
  controlFirst: d().optional(),
  // When true, places the control (checkbox/switch) before the label visually. When false (default), places the label before the control. Used to support different layout patterns (e.g., iOS-style toggles on the right).
  children: v([i(), _(), d(), x(), h]).optional(),
  label: v([i(), _(), d(), x(), h]).optional(),
  // The label content - can be a string or any React node
  required: d().optional(),
  // When explicitly false, shows gray "(optional)" text after the label. When true or undefined, no indicator is shown.
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  error: O().optional(),
  description: v([i(), _(), d(), x(), h]).optional()
}), St = m({
  children: v([i(), _(), d(), x(), h]).optional(),
  // Child node(s) that can be nested inside component
  className: i().optional(),
  // CSS class names that can be appended to the component
  id: i().optional(),
  lang: i().optional(),
  title: i().optional(),
  mobileDivider: d().optional(),
  // Show dividers between grid items on mobile (only works with 4up variant)
  gap: w(["none", "sm", "base", "lg"]).optional(),
  // Gap size between grid items
  variant: w(["2up", "side-by-side", "2-1", "1-2", "1-3up", "3up", "4up", "6up", "1-2-4up"]).optional()
  // Stylistic variations of the Grid layout
}), Tt = m({
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the input (enables Field wrapper) - can be a string or any React node
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  description: v([i(), _(), d(), x(), h]).optional(),
  // Helper text displayed below the input
  error: O().optional(),
  // Error message or validation error object
  size: w(["xs", "sm", "base", "lg"]).optional(),
  variant: w(["default", "error"]).optional()
}), Ct = m({}), Nt = m({
  children: v([i(), _(), d(), x(), h]).optional(),
  // The label content - can be a string or any React node
  showOptional: d().optional(),
  // When true (and required is false), shows gray "(optional)" text after the label
  tooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  className: i().optional(),
  // Additional CSS classes
  asContent: d().optional()
  // When true, only renders the inline content (indicators, tooltip) without the outer span with font styling. Useful when composed inside another label element that already provides the text styling.
}), Ot = m({
  children: v([i(), _(), d(), x(), h]).optional(),
  className: i().optional()
}), At = m({
  variant: w(["inline", "current", "plain"]).optional(),
  to: i().optional(),
  children: v([i(), _(), d(), x(), h]).optional(),
  className: i().optional(),
  id: i().optional(),
  lang: i().optional(),
  title: i().optional(),
  download: O().optional(),
  href: i().optional(),
  hrefLang: i().optional(),
  media: i().optional(),
  ping: i().optional(),
  target: O().optional(),
  type: i().optional(),
  referrerPolicy: w(["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"]).optional(),
  render: v([i(), _(), d(), x(), h]).optional()
  // Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
}), Rt = m({
  className: i().optional(),
  size: w(["sm", "base", "lg"]).optional()
}), Zt = m({
  className: i().optional(),
  isActive: O().optional(),
  options: z(O()),
  optionIds: d().optional()
}), It = m({
  customValue: i().optional(),
  label: i(),
  showValue: d().optional(),
  trackClassName: i().optional(),
  indicatorClassName: i().optional(),
  value: _().optional(),
  // Current value of the meter
  max: _().optional(),
  // Maximum value of the meter (default: 100)
  min: _().optional()
  // Minimum value of the meter (default: 0)
}), Pt = m({
  controls: w(["full", "simple"]).optional(),
  setPage: O(),
  // Callback when page changes
  page: _().optional(),
  perPage: _().optional(),
  totalCount: _().optional()
}), Et = m({
  side: w(["top", "bottom", "left", "right"]).optional()
}), jt = m({
  legend: i(),
  // Legend text for the group (required for accessibility)
  children: v([i(), _(), d(), x(), h]).optional(),
  // Child Radio.Item components
  orientation: w(["vertical", "horizontal"]).optional(),
  // Layout direction of the radio items
  error: i().optional(),
  // Error message for the group
  description: v([i(), _(), d(), x(), h]).optional(),
  // Helper text for the group
  value: i().optional(),
  // Value of the radio that should be selected (controlled)
  disabled: d().optional(),
  // Whether all radios in the group are disabled
  controlPosition: w(["start", "end"]).optional(),
  // Position of radio control relative to label: "start" (default) puts radio before label, "end" puts label before radio
  name: i().optional(),
  // Form submission name for the radio group
  className: i().optional()
  // Additional CSS classes
}), $t = m({
  className: i().optional(),
  // Additional CSS classes
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the select (enables Field wrapper) - can be a string or any React node
  hideLabel: d().optional(),
  // Whether to visually hide the label (still accessible to screen readers)
  placeholder: i().optional(),
  // Placeholder text when no value is selected
  loading: d().optional(),
  // Whether the select is in a loading state
  disabled: d().optional(),
  // Whether the select is disabled
  required: d().optional(),
  // Whether the select is required
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  value: i().optional(),
  // The currently selected value
  children: v([i(), _(), d(), x(), h]).optional(),
  // Child elements (Select.Option components)
  description: v([i(), _(), d(), x(), h]).optional(),
  // Helper text displayed below the select
  error: O().optional(),
  // Error message or validation error object
  onValueChange: O().optional(),
  // Callback when selection changes
  defaultValue: i().optional()
  // Initial value for uncontrolled mode
}), Lt = m({
  alt: i().optional(),
  autoComplete: O().optional(),
  checked: d().optional(),
  disabled: d().optional(),
  height: O().optional(),
  list: i().optional(),
  name: i().optional(),
  placeholder: i().optional(),
  readOnly: d().optional(),
  required: d().optional(),
  width: O().optional(),
  className: i().optional(),
  id: i().optional(),
  lang: i().optional(),
  title: i().optional(),
  children: v([i(), _(), d(), x(), h]).optional(),
  value: i().optional(),
  // Controlled value
  size: w(["xs", "sm", "base", "lg"]).optional(),
  // Size variant
  variant: w(["default", "error"]).optional(),
  // Style variant
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the input (enables Field wrapper and sets masked state label) - can be a string or any React node
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  description: v([i(), _(), d(), x(), h]).optional(),
  // Helper text displayed below the input
  error: O().optional()
  // Error message or validation error object
}), Vt = m({
  as: O().optional(),
  // The element type to render as (default: "div")
  className: i().optional(),
  // Additional CSS classes
  children: v([i(), _(), d(), x(), h]).optional()
  // Child elements
}), Mt = m({
  variant: w(["default", "error"]).optional(),
  // Visual variant: "default" or "error" for validation failures (visual only, no error text)
  label: v([i(), _(), d(), x(), h]).optional(),
  // Label content for the switch (Field wrapper is built-in) - can be a string or any React node. Optional when used standalone for visual-only purposes.
  labelTooltip: v([i(), _(), d(), x(), h]).optional(),
  // Tooltip content to display next to the label via an info icon
  required: d().optional(),
  // Whether the switch is required. When explicitly false, shows "(optional)" text after the label.
  controlFirst: d().optional(),
  // When true (default), switch appears before label. When false, label appears before switch.
  size: w(["sm", "base", "lg"]).optional(),
  checked: d().optional(),
  disabled: d().optional(),
  transitioning: d().optional(),
  name: i().optional(),
  type: w(["submit", "reset", "button"]).optional(),
  value: O().optional(),
  className: i().optional(),
  id: i().optional(),
  lang: i().optional(),
  title: i().optional(),
  onClick: O()
  // Callback when switch is clicked
}), zt = m({
  layout: w(["auto", "fixed"]).optional(),
  variant: w(["default", "selected"]).optional(),
  className: i().optional(),
  // Additional CSS classes
  children: v([i(), _(), d(), x(), h]).optional()
  // Child elements
}), Dt = m({
  tabs: z(O()).optional(),
  // Array of tab items to render
  value: i().optional(),
  // Controlled value. When set, component becomes controlled.
  selectedValue: i().optional(),
  // Default selected value for uncontrolled mode. Ignored when `value` is set.
  activateOnFocus: d().optional(),
  // When true, tabs are activated immediately upon receiving focus via arrow keys. When false (default), tabs receive focus but require Enter/Space to activate. Set to true for better keyboard UX in most cases.
  className: i().optional(),
  // Additional class name for the root element
  listClassName: i().optional(),
  // Additional class name for the tab list element
  indicatorClassName: i().optional(),
  // Additional class name for the indicator element
  variant: w(["segmented", "underline"]).optional(),
  onValueChange: O().optional()
  // Callback when active tab changes
}), Bt = m({
  variant: w(["heading1", "heading2", "heading3", "body", "secondary", "success", "error", "mono", "mono-secondary"]).optional(),
  // Text style variant
  size: w(["xs", "sm", "base", "lg"]).optional(),
  // Text size (only applies to body/secondary/success/error variants)
  bold: d().optional(),
  // Whether to use bold font weight (only applies to body variants)
  as: O().optional(),
  // The element type to render as
  children: v([i(), _(), d(), x(), h]).optional()
  // Child text content
}), Ut = m({
  children: v([i(), _(), d(), x(), h]).optional()
}), Ft = m({
  align: w(["start", "center", "end"]).optional(),
  asChild: d().optional(),
  className: i().optional(),
  side: w(["top", "bottom", "left", "right"]).optional(),
  content: v([i(), _(), d(), x(), h])
  // Content to display in the tooltip
}), qt = w([
  "Badge",
  "Banner",
  "Breadcrumbs",
  "Button",
  "Checkbox",
  "ClipboardText",
  "Code",
  "Collapsible",
  "Combobox",
  "CommandPalette",
  "DateRangePicker",
  "Dialog",
  "DropdownMenu",
  "Empty",
  "Field",
  "Grid",
  "Input",
  "InputArea",
  "Label",
  "LayerCard",
  "Link",
  "Loader",
  "MenuBar",
  "Meter",
  "Pagination",
  "Popover",
  "Radio",
  "Select",
  "SensitiveInput",
  "Surface",
  "Switch",
  "Table",
  "Tabs",
  "Text",
  "Toasty",
  "Tooltip"
]), Wt = {
  Badge: ct,
  Banner: dt,
  Breadcrumbs: ut,
  Button: pt,
  Checkbox: ht,
  ClipboardText: ft,
  Code: mt,
  Collapsible: gt,
  Combobox: yt,
  CommandPalette: _t,
  DateRangePicker: vt,
  Dialog: xt,
  DropdownMenu: bt,
  Empty: kt,
  Field: wt,
  Grid: St,
  Input: Tt,
  InputArea: Ct,
  Label: Nt,
  LayerCard: Ot,
  Link: At,
  Loader: Rt,
  MenuBar: Zt,
  Meter: It,
  Pagination: Pt,
  Popover: Et,
  Radio: jt,
  Select: $t,
  SensitiveInput: Lt,
  Surface: Vt,
  Switch: Mt,
  Table: zt,
  Tabs: Dt,
  Text: Bt,
  Toasty: Ut,
  Tooltip: Ft
}, Gt = m({
  key: i(),
  type: qt,
  props: H(i(), O()),
  children: z(i()).optional(),
  parentKey: i().nullable().optional(),
  visible: it.optional(),
  action: lt.optional()
}), Jt = m({
  root: i(),
  elements: H(i(), Gt)
});
function Yt(n) {
  const e = Wt[n.type];
  return e ? e.safeParse(n.props) : { success: !1, error: new P([{ code: "custom", message: `Unknown component type: ${n.type}`, path: ["type"] }]) };
}
function Ht(n) {
  return Jt.safeParse(n);
}
const Qt = ["Badge", "Banner", "Breadcrumbs", "Button", "Checkbox", "ClipboardText", "Code", "Collapsible", "Combobox", "CommandPalette", "DateRangePicker", "Dialog", "DropdownMenu", "Empty", "Field", "Grid", "Input", "InputArea", "Label", "LayerCard", "Link", "Loader", "MenuBar", "Meter", "Pagination", "Popover", "Radio", "Select", "SensitiveInput", "Surface", "Switch", "Table", "Tabs", "Text", "Toasty", "Tooltip"];
export {
  ot as ActionConfirmSchema,
  lt as ActionSchema,
  ct as BadgePropsSchema,
  dt as BannerPropsSchema,
  ut as BreadcrumbsPropsSchema,
  pt as ButtonPropsSchema,
  ht as CheckboxPropsSchema,
  ft as ClipboardTextPropsSchema,
  mt as CodePropsSchema,
  gt as CollapsiblePropsSchema,
  yt as ComboboxPropsSchema,
  _t as CommandPalettePropsSchema,
  Wt as ComponentPropsSchemas,
  vt as DateRangePickerPropsSchema,
  xt as DialogPropsSchema,
  bt as DropdownMenuPropsSchema,
  h as DynamicValueSchema,
  kt as EmptyPropsSchema,
  wt as FieldPropsSchema,
  St as GridPropsSchema,
  Ct as InputAreaPropsSchema,
  Tt as InputPropsSchema,
  Qt as KUMO_COMPONENT_NAMES,
  qt as KumoComponentTypeSchema,
  Nt as LabelPropsSchema,
  Ot as LayerCardPropsSchema,
  At as LinkPropsSchema,
  Rt as LoaderPropsSchema,
  Zt as MenuBarPropsSchema,
  It as MeterPropsSchema,
  Pt as PaginationPropsSchema,
  Et as PopoverPropsSchema,
  jt as RadioPropsSchema,
  $t as SelectPropsSchema,
  Lt as SensitiveInputPropsSchema,
  Vt as SurfacePropsSchema,
  Mt as SwitchPropsSchema,
  zt as TablePropsSchema,
  Dt as TabsPropsSchema,
  Bt as TextPropsSchema,
  Ut as ToastyPropsSchema,
  Ft as TooltipPropsSchema,
  Gt as UIElementBaseSchema,
  Jt as UITreeSchema,
  it as VisibilityConditionSchema,
  Yt as validateElementProps,
  Ht as validateUITree
};
//# sourceMappingURL=schemas-BSdA0fz-.js.map
