import { runtimeConfigValue } from "../config/runtime-config";

export const privacyConfig = {
  siteName: "Plimi",
  siteUrl: runtimeConfigValue("VITE_SITE_URL", window.location.origin),
  controllerName: runtimeConfigValue(
    "VITE_LEGAL_NAME",
    "Plimi website operator"
  ),
  privacyEmail: runtimeConfigValue(
    "VITE_PRIVACY_EMAIL",
    "privacy@example.com"
  ),
  controllerCountry: runtimeConfigValue(
    "VITE_LEGAL_COUNTRY",
    "Not configured"
  ),
  policyEffectiveDate: runtimeConfigValue(
    "VITE_PRIVACY_EFFECTIVE_DATE",
    "2026-06-07"
  ),
  analyticsProvider: runtimeConfigValue(
    "VITE_ANALYTICS_PROVIDER_NAME",
    "Umami"
  ),
  analyticsScriptUrl: runtimeConfigValue(
    "VITE_ANALYTICS_SCRIPT_URL",
    "https://u.achraf.app/script.js"
  ),
  analyticsHostUrl: runtimeConfigValue(
    "VITE_ANALYTICS_HOST_URL",
    "https://u.achraf.app"
  ),
  analyticsWebsiteId: runtimeConfigValue(
    "VITE_ANALYTICS_WEBSITE_ID",
    "89d0f8d2-5b59-438c-b1f6-ab2655e97f6e"
  ),
  analyticsHost: runtimeConfigValue("VITE_ANALYTICS_HOST", "u.achraf.app"),
  analyticsHostCountry: runtimeConfigValue(
    "VITE_ANALYTICS_HOST_COUNTRY",
    "Not configured"
  ),
  analyticsRetentionMonths: runtimeConfigValue(
    "VITE_ANALYTICS_RETENTION_MONTHS",
    "13"
  ),
};

export const hasAnalyticsConfiguration = Boolean(
  privacyConfig.analyticsScriptUrl && privacyConfig.analyticsWebsiteId
);
