import { MetadataRoute } from 'next';

export default function robots(): MetadataRoute.Robots {
  const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || 'https://megido72-portal.com';

  return {
    rules: [
      {
        userAgent: '*',
        allow: '/',
        disallow: ['/api/'],
      },
      // Block SEO analysis tools and web scrapers
      {
        userAgent: 'AhrefsBot',
        disallow: '/',
      },
      {
        userAgent: 'SemrushBot',
        disallow: '/',
      },
      {
        userAgent: 'MJ12bot',
        disallow: '/',
      },
      {
        userAgent: 'DotBot',
        disallow: '/',
      },
      {
        userAgent: 'Rogerbot',
        disallow: '/',
      },
      {
        userAgent: 'SEOkicks-Robot',
        disallow: '/',
      },
      {
        userAgent: 'SEBot-WA',
        disallow: '/',
      },
      {
        userAgent: 'SERankingBacklinksBot',
        disallow: '/',
      },
      {
        userAgent: 'SerpstatBot',
        disallow: '/',
      },
      {
        userAgent: 'SISTRIX',
        disallow: '/',
      },
      {
        userAgent: 'DataForSeoBot',
        disallow: '/',
      },
      {
        userAgent: 'BLEXBot',
        disallow: '/',
      },
      {
        userAgent: 'Screaming Frog SEO Spider',
        disallow: '/',
      },
      {
        userAgent: 'UbersuggestBot',
        disallow: '/',
      },
      {
        userAgent: 'SpyFu',
        disallow: '/',
      },
      {
        userAgent: 'SimilarWebBot',
        disallow: '/',
      },
      {
        userAgent: 'Netcraft',
        disallow: '/',
      },
      {
        userAgent: 'zoominfobot',
        disallow: '/',
      },
      {
        userAgent: 'serendeputy',
        disallow: '/',
      },
      {
        userAgent: 'PetalBot',
        disallow: '/',
      },
      {
        userAgent: 'Sogou',
        disallow: '/',
      },
      {
        userAgent: 'Baiduspider',
        disallow: '/',
      },
      {
        userAgent: 'YandexBot',
        disallow: '/',
      },
    ],
    sitemap: `${baseUrl}/sitemap.xml`,
  };
}
