import { z } from "zod";
function createLoginSchema(t) {
  return z.object({
    email: z.string().email(t("validation.email.invalid")),
    password: z.string().min(1, t("validation.password.required"))
  });
}
function createBaseSignupSchema(t) {
  return z.object({
    firstName: z.string().min(2, t("validation.firstName.min")),
    lastName: z.string().min(2, t("validation.lastName.min")),
    email: z.string().email(t("validation.email.invalid")),
    password: z.string().min(8, t("validation.password.min")).regex(/[A-Z]/, t("validation.password.uppercase")).regex(/[a-z]/, t("validation.password.lowercase")).regex(/[0-9]/, t("validation.password.number"))
  });
}
function createSignupSchema(t) {
  return createBaseSignupSchema(t).extend({
    confirmPassword: z.string()
  }).refine((data) => data.password === data.confirmPassword, {
    message: t("validation.password.match"),
    path: ["confirmPassword"]
  });
}
function createResetPasswordSchema(t) {
  return z.object({
    email: z.string().email(t("validation.email.invalid"))
  });
}
function createNewPasswordSchema(t) {
  return z.object({
    password: z.string().min(8, t("validation.password.min")).regex(/[A-Z]/, t("validation.password.uppercase")).regex(/[a-z]/, t("validation.password.lowercase")).regex(/[0-9]/, t("validation.password.number")),
    confirmPassword: z.string()
  }).refine((data) => data.password === data.confirmPassword, {
    message: t("validation.password.match"),
    path: ["confirmPassword"]
  });
}
function createChangePasswordSchema(t) {
  return z.object({
    currentPassword: z.string().min(1, t("validation.password.currentRequired")),
    newPassword: z.string().min(8, t("validation.password.min")).regex(/[A-Z]/, t("validation.password.uppercase")).regex(/[a-z]/, t("validation.password.lowercase")).regex(/[0-9]/, t("validation.password.number")),
    confirmPassword: z.string(),
    revokeOtherSessions: z.boolean().optional()
  }).refine((data) => data.newPassword === data.confirmPassword, {
    message: t("validation.password.match"),
    path: ["confirmPassword"]
  }).refine((data) => data.currentPassword !== data.newPassword, {
    message: t("validation.password.different"),
    path: ["newPassword"]
  });
}
function createProfileSchema(t) {
  return z.object({
    firstName: z.string().min(2, t("validation.firstName.min")),
    lastName: z.string().min(2, t("validation.lastName.min")),
    country: z.string().min(1, t("validation.country.required")),
    timezone: z.string().min(1, t("validation.timezone.required")),
    language: z.string().min(1, t("validation.language.required"))
  });
}
function createTaskSchema(t) {
  return z.object({
    title: z.string().min(1, t("validation.taskTitle.required")).max(200, t("validation.taskTitle.max")),
    description: z.string().max(500, t("validation.taskDescription.max")).optional()
  });
}
export {
  createBaseSignupSchema,
  createChangePasswordSchema,
  createLoginSchema,
  createNewPasswordSchema,
  createProfileSchema,
  createResetPasswordSchema,
  createSignupSchema,
  createTaskSchema
};
