// <auto-generated>
// This file was automatically generated. Do not edit manually.


// src/identity/Gender.ts
var Gender = /* @__PURE__ */ ((Gender2) => {
  Gender2["Male"] = "Male";
  Gender2["Female"] = "Female";
  Gender2["Other"] = "Other";
  return Gender2;
})(Gender || {});

// src/identity/IdentityHelperUtils.ts
var IdentityHelperUtils = class {
  /**
   * Normalize a birth date to the standard format: "yyyy-MM-dd".
   * Handles various input formats including ISO strings with time components.
   * Returns empty string for invalid/empty dates.
   */
  static normalizeBirthDate(input) {
    if (!input || input.trim() === "" || input.startsWith("0001-01-01")) {
      return "";
    }
    const trimmed = input.trim();
    const match = trimmed.match(/^(\d{4})-(\d{2})-(\d{2})/);
    if (match) {
      const [, y, m, d] = match;
      return `${y}-${m}-${d}`;
    }
    const parsedDate = new Date(trimmed);
    if (!isNaN(parsedDate.getTime())) {
      const year = parsedDate.getFullYear().toString().padStart(4, "0");
      const month = (parsedDate.getMonth() + 1).toString().padStart(2, "0");
      const day = parsedDate.getDate().toString().padStart(2, "0");
      return `${year}-${month}-${day}`;
    }
    return "";
  }
  /**
   * Check if a birth date is valid.
   */
  static isValidBirthDate(input) {
    if (!input || input.trim() === "") {
      return false;
    }
    if (input.startsWith("0001-01-01")) {
      return false;
    }
    const date = new Date(input);
    if (isNaN(date.getTime())) {
      return false;
    }
    const yearValid = date.getFullYear() > 1 && date.getFullYear() < 9999;
    return yearValid;
  }
};

export { Gender, IdentityHelperUtils };
