<?php

declare(strict_types=1);

namespace Signocore\Multilanguage\Application;

if (!defined('ABSPATH')) {
	exit;
}

final class Entitlements
{
	public const MEDIA_TRANSLATION = 'media_translation';

	public const CUSTOM_DOMAINS = 'custom_domains';

	public const SUBDOMAIN_URLS = 'subdomain_urls';

	public const CONTENT_DUPLICATOR = 'content_duplicator';

	public const WOOCOMMERCE = 'woocommerce';

	public const ELEMENTOR = 'elementor';

	public const ADVANCED_SWITCHER = 'advanced_switcher';

	public const ADVANCED_STRING_TRANSLATION = 'advanced_string_translation';

	public const UNLIMITED_LANGUAGES = 'unlimited_languages';

	public const SHARED_SLUGS = 'shared_slugs';

	public const PERMALINK_TRANSLATION = 'permalink_translation';

	public const YOAST = 'yoast';

	public const RANKMATH = 'rankmath';

	/**
	 * Maximum number of languages allowed on the free plan.
	 */
	public const FREE_LANGUAGE_LIMIT = 2;

	/** @var array<string, string> */
	public const LABELS = [
		self::MEDIA_TRANSLATION => 'Media Translation',
		self::CUSTOM_DOMAINS => 'Custom Domains',
		self::SUBDOMAIN_URLS => 'Subdomain URLs',
		self::CONTENT_DUPLICATOR => 'Content Duplicator',
		self::WOOCOMMERCE => 'WooCommerce Support',
		self::ELEMENTOR => 'Elementor Support',
		self::ADVANCED_SWITCHER => 'Advanced Language Switcher',
		self::ADVANCED_STRING_TRANSLATION => 'Advanced String Translation',
		self::UNLIMITED_LANGUAGES => 'Unlimited Languages',
		self::SHARED_SLUGS => 'Shared Slugs',
		self::PERMALINK_TRANSLATION => 'Permalink Translation',
		self::YOAST => 'Yoast SEO Integration',
		self::RANKMATH => 'Rank Math Integration',
	];

	/** @var string[] */
	public const PRO_FEATURES = [
		self::CUSTOM_DOMAINS,
		self::SUBDOMAIN_URLS,
		self::WOOCOMMERCE,
		self::ELEMENTOR,
		self::UNLIMITED_LANGUAGES,
		self::SHARED_SLUGS,
		self::PERMALINK_TRANSLATION,
		self::YOAST,
		self::RANKMATH,
	];

	/**
	 * @param string $feature One of the feature constants.
	 */
	public static function label(string $feature): string
	{
		return self::LABELS[$feature] ?? $feature;
	}
}
