/// Twelve emotional-state-pick (ESP) topic chips shown on the onboarding ESP
/// screen. Multi-select, info-only — the picks are persisted on the chat
/// session at session start and surfaced to the mitra as a chip row above
/// the first message bubble. They do NOT affect matching, pricing, or routing.
///
/// `value` is the wire-format string sent to the backend
/// (`chat_sessions.topics TEXT[]`). Lowercase snake_case to keep it stable
/// across UI label tweaks.
enum EspTopic {
  relationship('relationship', 'Hubungan'),
  family('family', 'Keluarga'),
  work('work', 'Pekerjaan'),
  study('study', 'Sekolah / Kuliah'),
  finance('finance', 'Keuangan'),
  health('health', 'Kesehatan'),
  friendship('friendship', 'Pertemanan'),
  selfWorth('self_worth', 'Self-worth'),
  anxiety('anxiety', 'Kecemasan'),
  loneliness('loneliness', 'Kesepian'),
  grief('grief', 'Kehilangan'),
  identity('identity', 'Identitas');

  final String value;
  final String label;
  const EspTopic(this.value, this.label);

  static EspTopic? fromValue(String? v) {
    if (v == null) return null;
    for (final t in values) {
      if (t.value == v) return t;
    }
    return null;
  }
}
