function _(e) {
  const t = Object.values(e).filter((r) => typeof r == "number");
  return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
}
function b(e, t) {
  return typeof t == "bigint" ? t.toString() : t;
}
function y(e) {
  return {
    get value() {
      {
        const t = e();
        return Object.defineProperty(this, "value", { value: t }), t;
      }
    }
  };
}
function w(e) {
  return e == null;
}
function z(e) {
  const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
  return e.slice(t, n);
}
function E(e, t) {
  const n = (e.toString().split(".")[1] || "").length, r = t.toString();
  let o = (r.split(".")[1] || "").length;
  if (o === 0 && /\d?e-\d?/.test(r)) {
    const d = r.match(/\d?e-(\d?)/);
    d?.[1] && (o = Number.parseInt(d[1]));
  }
  const i = n > o ? n : o, c = Number.parseInt(e.toFixed(i).replace(".", "")), g = Number.parseInt(t.toFixed(i).replace(".", ""));
  return c % g / 10 ** i;
}
const l = Symbol("evaluating");
function O(e, t, n) {
  let r;
  Object.defineProperty(e, t, {
    get() {
      if (r !== l)
        return r === void 0 && (r = l, r = n()), r;
    },
    set(o) {
      Object.defineProperty(e, t, {
        value: o
        // configurable: true,
      });
    },
    configurable: !0
  });
}
function j(e) {
  return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
}
function s(e, t, n) {
  Object.defineProperty(e, t, {
    value: n,
    writable: !0,
    enumerable: !0,
    configurable: !0
  });
}
function f(...e) {
  const t = {};
  for (const n of e) {
    const r = Object.getOwnPropertyDescriptors(n);
    Object.assign(t, r);
  }
  return Object.defineProperties({}, t);
}
function k(e) {
  return JSON.stringify(e);
}
const S = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
};
function h(e) {
  return typeof e == "object" && e !== null && !Array.isArray(e);
}
const m = y(() => {
  if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
    return !1;
  try {
    const e = Function;
    return new e(""), !0;
  } catch {
    return !1;
  }
});
function p(e) {
  if (h(e) === !1)
    return !1;
  const t = e.constructor;
  if (t === void 0)
    return !0;
  const n = t.prototype;
  return !(h(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
}
function A(e) {
  return p(e) ? { ...e } : e;
}
const v = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
function I(e) {
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
function u(e, t, n) {
  const r = new e._zod.constr(t ?? e._zod.def);
  return (!t || n?.parent) && (r._zod.parent = e), r;
}
function N(e) {
  const t = e;
  if (!t)
    return {};
  if (typeof t == "string")
    return { error: () => t };
  if (t?.message !== void 0) {
    if (t?.error !== void 0)
      throw new Error("Cannot specify both `message` and `error` params");
    t.error = t.message;
  }
  return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
}
function P(e) {
  return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
}
const x = {
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
  int32: [-2147483648, 2147483647],
  uint32: [0, 4294967295],
  float32: [-34028234663852886e22, 34028234663852886e22],
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
};
function T(e, t) {
  const n = e._zod.def, r = f(e._zod.def, {
    get shape() {
      const o = {};
      for (const i in t) {
        if (!(i in n.shape))
          throw new Error(`Unrecognized key: "${i}"`);
        t[i] && (o[i] = n.shape[i]);
      }
      return s(this, "shape", o), o;
    },
    checks: []
  });
  return u(e, r);
}
function R(e, t) {
  const n = e._zod.def, r = f(e._zod.def, {
    get shape() {
      const o = { ...e._zod.def.shape };
      for (const i in t) {
        if (!(i in n.shape))
          throw new Error(`Unrecognized key: "${i}"`);
        t[i] && delete o[i];
      }
      return s(this, "shape", o), o;
    },
    checks: []
  });
  return u(e, r);
}
function U(e, t) {
  if (!p(t))
    throw new Error("Invalid input to extend: expected a plain object");
  const n = e._zod.def.checks;
  if (n && n.length > 0)
    throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
  const o = f(e._zod.def, {
    get shape() {
      const i = { ...e._zod.def.shape, ...t };
      return s(this, "shape", i), i;
    },
    checks: []
  });
  return u(e, o);
}
function D(e, t) {
  if (!p(t))
    throw new Error("Invalid input to safeExtend: expected a plain object");
  const n = {
    ...e._zod.def,
    get shape() {
      const r = { ...e._zod.def.shape, ...t };
      return s(this, "shape", r), r;
    },
    checks: e._zod.def.checks
  };
  return u(e, n);
}
function F(e, t) {
  const n = f(e._zod.def, {
    get shape() {
      const r = { ...e._zod.def.shape, ...t._zod.def.shape };
      return s(this, "shape", r), r;
    },
    get catchall() {
      return t._zod.def.catchall;
    },
    checks: []
    // delete existing checks
  });
  return u(e, n);
}
function M(e, t, n) {
  const r = f(t._zod.def, {
    get shape() {
      const o = t._zod.def.shape, i = { ...o };
      if (n)
        for (const c in n) {
          if (!(c in o))
            throw new Error(`Unrecognized key: "${c}"`);
          n[c] && (i[c] = e ? new e({
            type: "optional",
            innerType: o[c]
          }) : o[c]);
        }
      else
        for (const c in o)
          i[c] = e ? new e({
            type: "optional",
            innerType: o[c]
          }) : o[c];
      return s(this, "shape", i), i;
    },
    checks: []
  });
  return u(t, r);
}
function $(e, t, n) {
  const r = f(t._zod.def, {
    get shape() {
      const o = t._zod.def.shape, i = { ...o };
      if (n)
        for (const c in n) {
          if (!(c in i))
            throw new Error(`Unrecognized key: "${c}"`);
          n[c] && (i[c] = new e({
            type: "nonoptional",
            innerType: o[c]
          }));
        }
      else
        for (const c in o)
          i[c] = new e({
            type: "nonoptional",
            innerType: o[c]
          });
      return s(this, "shape", i), i;
    },
    checks: []
  });
  return u(t, r);
}
function C(e, t = 0) {
  if (e.aborted === !0)
    return !0;
  for (let n = t; n < e.issues.length; n++)
    if (e.issues[n]?.continue !== !0)
      return !0;
  return !1;
}
function L(e, t) {
  return t.map((n) => {
    var r;
    return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
  });
}
function a(e) {
  return typeof e == "string" ? e : e?.message;
}
function V(e, t, n) {
  const r = { ...e, path: e.path ?? [] };
  if (!e.message) {
    const o = a(e.inst?._zod.def?.error?.(e)) ?? a(t?.error?.(e)) ?? a(n.customError?.(e)) ?? a(n.localeError?.(e)) ?? "Invalid input";
    r.message = o;
  }
  return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
}
function G(e) {
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
}
function X(...e) {
  const [t, n, r] = e;
  return typeof t == "string" ? {
    message: t,
    code: "custom",
    input: n,
    inst: r
  } : { ...t };
}
export {
  x as NUMBER_FORMAT_RANGES,
  C as aborted,
  m as allowsEval,
  s as assignProp,
  y as cached,
  S as captureStackTrace,
  z as cleanRegex,
  u as clone,
  O as defineLazy,
  k as esc,
  I as escapeRegex,
  U as extend,
  V as finalizeIssue,
  E as floatSafeRemainder,
  _ as getEnumValues,
  G as getLengthableOrigin,
  h as isObject,
  p as isPlainObject,
  X as issue,
  b as jsonStringifyReplacer,
  F as merge,
  f as mergeDefs,
  N as normalizeParams,
  w as nullish,
  j as objectClone,
  R as omit,
  P as optionalKeys,
  M as partial,
  T as pick,
  L as prefixIssues,
  v as propertyKeyTypes,
  $ as required,
  D as safeExtend,
  A as shallowClone,
  a as unwrapMessage
};
//# sourceMappingURL=util.js.map
