// Street-crime categories carried by the `crime_hotspots` vector tiles in the
// `crime_type` feature property. The `value` strings must match the police.uk
// "Crime type" values exactly (see pipeline/transform/crime_hotspot_tiles.py),
// because they are used directly in the MapLibre heatmap `filter` expression.
// `label` is a shorter, human-friendly name for the overlay-selector checkboxes.

export interface CrimeTypeDef {
  value: string;
  /** English label (fallback / reference). */
  label: string;
  /** i18n key under `crimeTypes.*` used to render the selector label. */
  labelKey: string;
}

export const CRIME_TYPES: readonly CrimeTypeDef[] = [
  {
    value: 'Violence and sexual offences',
    label: 'Violence & sexual offences',
    labelKey: 'crimeTypes.violenceAndSexualOffences',
  },
  {
    value: 'Anti-social behaviour',
    label: 'Anti-social behaviour',
    labelKey: 'crimeTypes.antiSocialBehaviour',
  },
  {
    value: 'Criminal damage and arson',
    label: 'Criminal damage & arson',
    labelKey: 'crimeTypes.criminalDamageAndArson',
  },
  { value: 'Public order', label: 'Public order', labelKey: 'crimeTypes.publicOrder' },
  { value: 'Shoplifting', label: 'Shoplifting', labelKey: 'crimeTypes.shoplifting' },
  { value: 'Vehicle crime', label: 'Vehicle crime', labelKey: 'crimeTypes.vehicleCrime' },
  { value: 'Burglary', label: 'Burglary', labelKey: 'crimeTypes.burglary' },
  { value: 'Other theft', label: 'Other theft', labelKey: 'crimeTypes.otherTheft' },
  {
    value: 'Theft from the person',
    label: 'Theft from the person',
    labelKey: 'crimeTypes.theftFromThePerson',
  },
  { value: 'Bicycle theft', label: 'Bicycle theft', labelKey: 'crimeTypes.bicycleTheft' },
  { value: 'Drugs', label: 'Drugs', labelKey: 'crimeTypes.drugs' },
  { value: 'Robbery', label: 'Robbery', labelKey: 'crimeTypes.robbery' },
  {
    value: 'Possession of weapons',
    label: 'Possession of weapons',
    labelKey: 'crimeTypes.possessionOfWeapons',
  },
  { value: 'Other crime', label: 'Other crime', labelKey: 'crimeTypes.otherCrime' },
] as const;

export const CRIME_TYPE_VALUES: readonly string[] = CRIME_TYPES.map((c) => c.value);

const CRIME_TYPE_VALUE_SET = new Set<string>(CRIME_TYPE_VALUES);

export function isCrimeTypeValue(value: string): boolean {
  return CRIME_TYPE_VALUE_SET.has(value);
}
