export function maskPhone(phone: string): string {
  const digits = phone.replace(/\D/g, "");
  if (digits.length < 4) {
    return "***";
  }
  const start = digits.slice(0, 4);
  const end = digits.slice(-3);
  return `${start}***${end}`;
}

export function maskNationalId(nid: string): string {
  const d = nid.replace(/\D/g, "");
  if (d.length < 4) {
    return "***";
  }
  return `${d.slice(0, 3)}****${d.slice(-2)}`;
}
