export function normalizeApiBase(value: string): string {
  const base = value.replace(/\/+$/, '')
  return /\/api\/v1$/.test(base) ? base : `${base}/api/v1`
}

export const API_BASE = normalizeApiBase(
  typeof window === 'undefined'
    ? (process.env.API_INTERNAL_URL || 'http://localhost:4000/api/v1')
    : (process.env.NEXT_PUBLIC_API_URL || '/api/v1'),
)

export const EMPLOYEE_PROFILE_KEY = 'employee_profile'
