import { KeyboardLayout, KeyCombo } from "../keyboardLayouts"
import { modifierDisplayMap, keyDisplayMap, virtualKeyboard } from "./en_US"

const name = "Čeština";
const isoCode = "cs-CZ";

const keyTrema = { key: "Backslash" } // tréma (umlaut), two dots placed above a vowel
const keyAcute = { key: "Equal" } // accent aigu (acute accent), mark ´ placed above the letter
const keyHat = { key: "Digit3", shift: true, altRight: true } // accent circonflexe (accent hat), mark ^ placed above the letter
const keyCaron = { key: "Equal", shift: true } // caron or haček (inverted hat), mark ˇ placed above the letter
const keyGrave = { key: "Digit7", shift: true, altRight: true } // accent grave, mark ` placed above the letter
const keyTilde = { key: "Digit1", shift: true, altRight: true } // tilde, mark ~ placed above the letter
const keyRing = { key: "Backquote", shift: true } // kroužek (little ring), mark ° placed above the letter
const keyOverdot = { key: "Digit8", shift: true, altRight: true } // overdot (dot above), mark ˙ placed above the letter
const keyHook = { key: "Digit6", shift: true, altRight: true } // ogonoek (little hook), mark ˛ placed beneath a letter
const keyCedille = { key: "Equal", shift: true, altRight: true } // accent cedille (cedilla), mark ¸ placed beneath a letter

export const chars = {
  A: { key: "KeyA", shift: true },
  "Ä": { key: "KeyA", shift: true, accentKey: keyTrema },
  "Á": { key: "KeyA", shift: true, accentKey: keyAcute },
  "Â": { key: "KeyA", shift: true, accentKey: keyHat },
  "À": { key: "KeyA", shift: true, accentKey: keyGrave },
  "Ã": { key: "KeyA", shift: true, accentKey: keyTilde },
  "Ȧ": { key: "KeyA", shift: true, accentKey: keyOverdot },
  "Ą": { key: "KeyA", shift: true, accentKey: keyHook },
  B: { key: "KeyB", shift: true },
  "Ḃ": { key: "KeyB", shift: true, accentKEy: keyOverdot },
  C: { key: "KeyC", shift: true },
  "Č": { key: "KeyC", shift: true, accentKey: keyCaron },
  "Ċ": { key: "KeyC", shift: true, accentKey: keyOverdot },
  "Ç": { key: "KeyC", shift: true, accentKey: keyCedille },
  D: { key: "KeyD", shift: true },
  "Ď": { key: "KeyD", shift: true, accentKey: keyCaron },
  "Ḋ": { key: "KeyD", shift: true, accentKey: keyOverdot },
  E: { key: "KeyE", shift: true },
  "Ë": { key: "KeyE", shift: true, accentKey: keyTrema },
  "É": { key: "KeyE", shift: true, accentKey: keyAcute },
  "Ê": { key: "KeyE", shift: true, accentKey: keyHat },
  "Ě": { key: "KeyE", shift: true, accentKey: keyCaron },
  "È": { key: "KeyE", shift: true, accentKey: keyGrave },
  "Ẽ": { key: "KeyE", shift: true, accentKey: keyTilde },
  "Ė": { key: "KeyE", shift: true, accentKEy: keyOverdot },
  "Ę": { key: "KeyE", shift: true, accentKey: keyHook },
  F: { key: "KeyF", shift: true },
  "Ḟ": { key: "KeyF", shift: true, accentKey: keyOverdot },
  G: { key: "KeyG", shift: true },
  "Ġ": { key: "KeyG", shift: true, accentKey: keyOverdot },
  H: { key: "KeyH", shift: true },
  "Ḣ": { key: "KeyH", shift: true, accentKey: keyOverdot },
  I: { key: "KeyI", shift: true },
  "Ï": { key: "KeyI", shift: true, accentKey: keyTrema },
  "Í": { key: "KeyI", shift: true, accentKey: keyAcute },
  "Î": { key: "KeyI", shift: true, accentKey: keyHat },
  "Ì": { key: "KeyI", shift: true, accentKey: keyGrave },
  "Ĩ": { key: "KeyI", shift: true, accentKey: keyTilde },
  "İ": { key: "KeyI", shift: true, accentKey: keyOverdot },
  "Į": { key: "KeyI", shift: true, accentKey: keyHook },
  J: { key: "KeyJ", shift: true },
  K: { key: "KeyK", shift: true },
  L: { key: "KeyL", shift: true },
  "Ŀ": { key: "KeyL", shift: true },
  M: { key: "KeyM", shift: true },
  "Ṁ": { key: "KeyM", shift: true },
  N: { key: "KeyN", shift: true },
  "Ň": { key: "KeyN", shift: true, accentKey: keyCaron },
  "Ñ": { key: "KeyN", shift: true, accentKey: keyTilde },
  "Ṅ": { key: "KeyN", shift: true, accentKEy: keyOverdot },
  O: { key: "KeyO", shift: true },
  "Ö": { key: "KeyO", shift: true, accentKey: keyTrema },
  "Ó": { key: "KeyO", shift: true, accentKey: keyAcute },
  "Ô": { key: "KeyO", shift: true, accentKey: keyHat },
  "Ò": { key: "KeyO", shift: true, accentKey: keyGrave },
  "Õ": { key: "KeyO", shift: true, accentKey: keyTilde },
  "Ȯ": { key: "KeyO", shift: true, accentKey: keyOverdot },
  "Ǫ": { key: "KeyO", shift: true, accentKey: keyHook },
  P: { key: "KeyP", shift: true },
  "Ṗ": { key: "KeyP", shift: true, accentKey: keyOverdot },
  Q: { key: "KeyQ", shift: true },
  R: { key: "KeyR", shift: true },
  "Ř": { key: "KeyR", shift: true, accentKey: keyCaron },
  "Ṙ": { key: "KeyR", shift: true, accentKey: keyOverdot },
  S: { key: "KeyS", shift: true },
  "Š": { key: "KeyS", shift: true, accentKey: keyCaron },
  "Ṡ": { key: "KeyS", shift: true, accentKey: keyOverdot },
  T: { key: "KeyT", shift: true },
  "Ť": { key: "KeyT", shift: true, accentKey: keyCaron },
  "Ṫ": { key: "KeyT", shift: true, accentKey: keyOverdot },
  U: { key: "KeyU", shift: true },
  "Ü": { key: "KeyU", shift: true, accentKey: keyTrema },
  "Ú": { key: "KeyU", shift: true, accentKey: keyAcute },
  "Û": { key: "KeyU", shift: true, accentKey: keyHat },
  "Ù": { key: "KeyU", shift: true, accentKey: keyGrave },
  "Ũ": { key: "KeyU", shift: true, accentKey: keyTilde },
  "Ů": { key: "KeyU", shift: true, accentKey: keyRing },
  "Ų": { key: "KeyU", shift: true, accentKey: keyHook },
  V: { key: "KeyV", shift: true },
  W: { key: "KeyW", shift: true },
  "Ẇ": { key: "KeyW", shift: true, accentKey: keyOverdot },
  X: { key: "KeyX", shift: true },
  "Ẋ": { key: "KeyX", shift: true, accentKey: keyOverdot },
  Y: { key: "KeyY", shift: true },
  "Ý": { key: "KeyY", shift: true, accentKey: keyAcute },
  "Ẏ": { key: "KeyY", shift: true, accentKey: keyOverdot },
  Z: { key: "KeyZ", shift: true },
  "Ż": { key: "KeyZ", shift: true, accentKey: keyOverdot },
  a: { key: "KeyA" },
  "ä": { key: "KeyA", accentKey: keyTrema },
  "â": { key: "KeyA", accentKey: keyHat },
  "à": { key: "KeyA", accentKey: keyGrave },
  "ã": { key: "KeyA", accentKey: keyTilde },
  "ȧ": { key: "KeyA", accentKey: keyOverdot },
  "ą": { key: "KeyA", accentKey: keyHook },
  b: { key: "KeyB" },
  "{": { key: "KeyB", altRight: true },
  "ḃ": { key: "KeyB", accentKey: keyOverdot },
  c: { key: "KeyC" },
  "&": { key: "KeyC", altRight: true },
  "ç": { key: "KeyC", accentKey: keyCedille },
  "ċ": { key: "KeyC", accentKey: keyOverdot },
  d: { key: "KeyD" },
  "ď": { key: "KeyD", accentKey: keyCaron },
  "ḋ": { key: "KeyD", accentKey: keyOverdot },
  "Đ": { key: "KeyD", altRight: true },
  e: { key: "KeyE" },
  "ë": { key: "KeyE", accentKey: keyTrema },
  "ê": { key: "KeyE", accentKey: keyHat },
  "ẽ": { key: "KeyE", accentKey: keyTilde },
  "è": { key: "KeyE", accentKey: keyGrave },
  "ė": { key: "KeyE", accentKey: keyOverdot },
  "ę": { key: "KeyE", accentKey: keyHook },
  "€": { key: "KeyE", altRight: true },
  f: { key: "KeyF" },
  "ḟ": { key: "KeyF", accentKey: keyOverdot },
  "[": { key: "KeyF", altRight: true },
  g: { key: "KeyG" },
  "ġ": { key: "KeyG", accentKey: keyOverdot },
  "]": { key: "KeyF", altRight: true },
  h: { key: "KeyH" },
  "ḣ": { key: "KeyH", accentKey: keyOverdot },
  i: { key: "KeyI" },
  "ï": { key: "KeyI", accentKey: keyTrema },
  "î": { key: "KeyI", accentKey: keyHat },
  "ì": { key: "KeyI", accentKey: keyGrave },
  "ĩ": { key: "KeyI", accentKey: keyTilde },
  "ı": { key: "KeyI", accentKey: keyOverdot },
  "į": { key: "KeyI", accentKey: keyHook },
  j: { key: "KeyJ" },
  "ȷ": { key: "KeyJ", accentKey: keyOverdot },
  k: { key: "KeyK" },
  "ł": { key: "KeyK", altRight: true },
  l: { key: "KeyL" },
  "ŀ": { key: "KeyL", accentKey: keyOverdot },
  "Ł": { key: "KeyL", altRight: true },
  m: { key: "KeyM" },
  "ṁ": { key: "KeyM", accentKey: keyOverdot },
  n: { key: "KeyN" },
  "}": { key: "KeyN", altRight: true },
  "ň": { key: "KeyN", accentKey: keyCaron },
  "ñ": { key: "KeyN", accentKey: keyTilde },
  "ṅ": { key: "KeyN", accentKey: keyOverdot },
  o: { key: "KeyO" },
  "ö": { key: "Key0", accentKey: keyTrema },
  "ó": { key: "KeyO", accentKey: keyAcute },
  "ô": { key: "KeyO", accentKey: keyHat },
  "ò": { key: "KeyO", accentKey: keyGrave },
  "õ": { key: "KeyO", accentKey: keyTilde },
  "ȯ": { key: "KeyO", accentKey: keyOverdot },
  "ǫ": { key: "KeyO", accentKey: keyHook },
  p: { key: "KeyP" },
  "ṗ": { key: "KeyP", accentKey: keyOverdot },
  q: { key: "KeyQ" },
  r: { key: "KeyR" },
  "ṙ": { key: "KeyR", accentKey: keyOverdot },
  s: { key: "KeyS" },
  "ṡ": { key: "KeyS", accentKey: keyOverdot },
  "đ": { key: "KeyS", altRight: true },
  t: { key: "KeyT" },
  "ť": { key: "KeyT", accentKey: keyCaron },
  "ṫ": { key: "KeyT", accentKey: keyOverdot },
  u: { key: "KeyU" },
  "ü": { key: "KeyU", accentKey: keyTrema },
  "û": { key: "KeyU", accentKey: keyHat },
  "ù": { key: "KeyU", accentKey: keyGrave },
  "ũ": { key: "KeyU", accentKey: keyTilde },
  "ų": { key: "KeyU", accentKey: keyHook },
  v: { key: "KeyV" },
  "@": { key: "KeyV", altRight: true },
  w: { key: "KeyW" },
  "ẇ": { key: "KeyW", accentKey: keyOverdot },
  x: { key: "KeyX" },
  "#": { key: "KeyX", altRight: true },
  "ẋ": { key: "KeyX", accentKey: keyOverdot },
  y: { key: "KeyY" },
  "ẏ": { key: "KeyY", accentKey: keyOverdot },
  z: { key: "KeyZ" },
  "ż": { key: "KeyZ", accentKey: keyOverdot },
  ";": { key: "Backquote" },
  "°": { key: "Backquote", shift: true, deadKey: true }, 
  "+": { key: "Digit1" },
  1: { key: "Digit1", shift: true },
  "ě": { key: "Digit2" },
  2: { key: "Digit2", shift: true },
  "š": { key: "Digit3" },
  3: { key: "Digit3", shift: true },
  "č": { key: "Digit4" },
  4: { key: "Digit4", shift: true },
  "ř": { key: "Digit5" },
  5: { key: "Digit5", shift: true },
  "ž": { key: "Digit6" },
  6: { key: "Digit6", shift: true },
  "ý": { key: "Digit7" },
  7: { key: "Digit7", shift: true },
  "á": { key: "Digit8" },
  8: { key: "Digit8", shift: true },
  "í": { key: "Digit9" },
  9: { key: "Digit9", shift: true },
  "é": { key: "Digit0" },
  0: { key: "Digit0", shift: true },
  "=": { key: "Minus" },
  "%": { key: "Minus", shift: true },
  "ú": { key: "BracketLeft" },
  "/": { key: "BracketLeft", shift: true },
  ")": { key: "BracketRight" },
  "(": { key: "BracketRight", shift: true },
  "ů": { key: "Semicolon" },
  "\"": { key: "Semicolon", shift: true },
  "§": { key: "Quote" },
  "!": { key: "Quote", shift: true },
  "'": { key: "Backslash", shift: true },
  ",": { key: "Comma" },
  "?": { key: "Comma", shift: true },
  "<": { key: "Comma", altRight: true },
  ".": { key: "Period" },
  ":": { key: "Period", shift: true },
  ">": { key: "Period", altRight: true },
  "-": { key: "Slash" },
  "_": { key: "Slash", shift: true },
  "*": { key: "Slash", altRight: true },
  "\\": { key: "IntlBackslash" },
  "|": { key: "IntlBackslash", shift: true },
  " ": { key: "Space" },
  "\n": { key: "Enter" },
  Enter: { key: "Enter" },
  Tab: { key: "Tab" },
} as Record<string, KeyCombo>;

export const cs_CZ: KeyboardLayout = {
  isoCode,
  name,
  chars,
  keyDisplayMap,
  modifierDisplayMap,
  virtualKeyboard,
};
