/**
 * Mapping of 4chan board codes to 5chan directory names
 * Used for displaying board links in the boardsbar
 */
export const BOARD_CODE_TO_DIRECTORY: Record<string, string> = {
  a: 'Anime & Manga',
  b: 'Random',
  c: 'Anime/Cute',
  d: 'Mecha',
  e: 'Ecchi',
  f: 'Flash',
  g: 'Technology',
  gif: 'Adult GIF',
  h: 'Hentai',
  hr: 'High Resolution',
  k: 'Traditional Games',
  m: 'Mecha',
  o: 'Auto',
  p: 'Photography',
  r: 'Request',
  s: 'Sexy Beautiful Women',
  t: 'Torrents',
  u: 'Yuri',
  v: 'Video Games',
  vg: 'Video Game Generals',
  vm: 'Video Games/Multiplayer',
  vmg: 'Video Games/Mobile',
  vr: 'Retro Games',
  vrpg: 'Video Games/RPG',
  vst: 'Video Games/Strategy',
  w: 'Anime/Wallpapers',
  wg: 'Worksafe GIF',
  i: 'Oekaki',
  ic: 'Artwork/Critique',
  r9k: 'ROBOT9001',
  s5s: 'Shit 5chan Says',
  vip: 'Very Important Posts',
  cm: 'Cute/Male',
  hm: 'Handsome Men',
  lgbt: 'LGBT',
  y: 'Yaoi',
  '3': '3DCG',
  aco: 'Anime/Cute',
  adv: 'Advertisement',
  an: 'Animals & Nature',
  bant: 'International/Random',
  biz: 'Business & Finance',
  cgl: 'Cosplay & EGL',
  ck: 'Food & Cooking',
  co: 'Comics & Cartoons',
  diy: 'Do-It-Yourself',
  fa: 'Fashion',
  fit: 'Fitness',
  gd: 'Graphic Design',
  hc: 'Hardcore',
  his: 'History & Humanities',
  int: 'International',
  jp: 'Otaku Culture',
  lit: 'Literature',
  mlp: 'Pony',
  mu: 'Music',
  n: 'Transportation',
  news: 'Current News',
  out: 'Outdoors',
  po: 'Papercraft & Origami',
  pol: 'Politically Incorrect',
  pw: 'Professional Wrestling',
  qst: 'Quests',
  sci: 'Science & Math',
  soc: 'Cams & Meetups',
  sp: 'Sports',
  tg: 'Traditional Games',
  toy: 'Toys',
  trv: 'Travel',
  tv: 'Television & Film',
  vp: 'Pokémon',
  vt: 'Virtual YouTubers',
  wsg: 'Worksafe Requests',
  wsr: 'Worksafe Requests',
  x: 'Adult Cartoons',
  xs: 'Extreme Sports',
};

/**
 * Board code groups matching 4chan's bracket structure
 * Each group represents boards displayed together in brackets
 */
export const BOARD_CODE_GROUPS: string[][] = [
  // Group 1: [a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg]
  ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'gif', 'h', 'hr', 'k', 'm', 'o', 'p', 'r', 's', 't', 'u', 'v', 'vg', 'vm', 'vmg', 'vr', 'vrpg', 'vst', 'w', 'wg'],
  // Group 2: [i / ic]
  ['i', 'ic'],
  // Group 3: [r9k / s5s / vip]
  ['r9k', 's5s', 'vip'],
  // Group 4: [cm / hm / lgbt / y]
  ['cm', 'hm', 'lgbt', 'y'],
  // Group 5: [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs]
  [
    '3',
    'aco',
    'adv',
    'an',
    'bant',
    'biz',
    'cgl',
    'ck',
    'co',
    'diy',
    'fa',
    'fit',
    'gd',
    'hc',
    'his',
    'int',
    'jp',
    'lit',
    'mlp',
    'mu',
    'n',
    'news',
    'out',
    'po',
    'pol',
    'pw',
    'qst',
    'sci',
    'soc',
    'sp',
    'tg',
    'toy',
    'trv',
    'tv',
    'vp',
    'vt',
    'wsg',
    'wsr',
    'x',
    'xs',
  ],
];

/**
 * Get all board codes as a flat array
 */
export const getAllBoardCodes = (): string[] => {
  return BOARD_CODE_GROUPS.flat();
};
