import 'clsx';
import 'tailwind-merge';
import slug from 'slug';

function slugify(text, locale = "en") {
  return slug(text, { lower: true, locale });
}
function extractIpAddress(headers) {
  if (!headers) return void 0;
  const forwardedFor = headers.get("x-forwarded-for");
  if (forwardedFor) {
    return forwardedFor.split(",")[0]?.trim();
  }
  const realIp = headers.get("x-real-ip");
  if (realIp) {
    return realIp.trim();
  }
  const cfConnectingIp = headers.get("cf-connecting-ip");
  if (cfConnectingIp) {
    return cfConnectingIp.trim();
  }
  return void 0;
}
function extractUserAgent(headers) {
  if (!headers) return void 0;
  return headers.get("user-agent") || void 0;
}

export { extractIpAddress, extractUserAgent, slugify };
