// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';

var Pervasives = require("bs-platform/lib/js/pervasives.js");
var Int$OptolithClient = require("../../Data/Int.bs.js");

function unsafeFromInt(id) {
  var switcher = id - 1 | 0;
  if (switcher > 2 || switcher < 0) {
    return Pervasives.invalid_arg("unsafeFromInt: " + (Int$OptolithClient.show(id) + " is not a valid phase"));
  } else {
    return switcher;
  }
}

function toInt(id) {
  return id + 1 | 0;
}

var Phase = {
  unsafeFromInt: unsafeFromInt,
  toInt: toInt,
  rcp: 1,
  creation: 2,
  inGame: 3
};

function unsafeFromInt$1(id) {
  var switcher = id - 1 | 0;
  if (switcher > 6 || switcher < 0) {
    return Pervasives.invalid_arg("unsafeFromInt: " + (Int$OptolithClient.show(id) + " is not a valid experience level"));
  } else {
    return switcher;
  }
}

function toInt$1(id) {
  return id + 1 | 0;
}

var ExperienceLevelId = {
  unsafeFromInt: unsafeFromInt$1,
  toInt: toInt$1,
  inexperienced: "EL_1",
  ordinary: "EL_2",
  experienced: "EL_3",
  competent: "EL_4",
  masterly: "EL_5",
  brilliant: "EL_6",
  legendary: "EL_7"
};

var RaceId = {
  humans: "R_1",
  elves: "R_2",
  halfElves: "R_3",
  dwarves: "R_4"
};

var CultureId = {
  gladeElves: "C_19",
  firnelves: "C_20",
  woodElves: "C_21",
  steppenelfen: "C_28"
};

var ProfessionId = {
  customProfession: "P_0"
};

function unsafeFromInt$2(id) {
  var switcher = id - 1 | 0;
  if (switcher > 7 || switcher < 0) {
    return Pervasives.invalid_arg("unsafeFromInt: " + (Int$OptolithClient.show(id) + " is not a valid attribute"));
  } else {
    return switcher;
  }
}

function toInt$2(id) {
  return id + 1 | 0;
}

var AttrId = {
  unsafeFromInt: unsafeFromInt$2,
  toInt: toInt$2,
  courage: "ATTR_1",
  sagacity: "ATTR_2",
  intuition: "ATTR_3",
  charisma: "ATTR_4",
  dexterity: "ATTR_5",
  agility: "ATTR_6",
  constitution: "ATTR_7",
  strength: "ATTR_8"
};

var DCId = {
  lifePoints: "LP",
  arcaneEnergy: "AE",
  karmaPoints: "KP",
  spirit: "SPI",
  toughness: "TOU",
  dodge: "DO",
  initiative: "INI",
  movement: "MOV",
  woundThreshold: "WT"
};

function fromInt(id) {
  switch (id) {
    case 4 :
        return /* Aptitude */0;
    case 9 :
        return /* Nimble */1;
    case 12 :
        return /* Blessed */2;
    case 14 :
        return /* Luck */3;
    case 16 :
        return /* ExceptionalSkill */4;
    case 17 :
        return /* ExceptionalCombatTechnique */5;
    case 23 :
        return /* IncreasedAstralPower */6;
    case 24 :
        return /* IncreasedKarmaPoints */7;
    case 25 :
        return /* IncreasedLifePoints */8;
    case 26 :
        return /* IncreasedSpirit */9;
    case 27 :
        return /* IncreasedToughness */10;
    case 28 :
        return /* ImmunityToPoison */11;
    case 29 :
        return /* ImmunityToDisease */12;
    case 32 :
        return /* MagicalAttunement */13;
    case 36 :
        return /* Rich */14;
    case 40 :
        return /* SociallyAdaptable */15;
    case 46 :
        return /* InspireConfidence */16;
    case 47 :
        return /* WeaponAptitude */17;
    case 50 :
        return /* Spellcaster */18;
    case 54 :
        return /* Unyielding */19;
    case 58 :
        return /* LargeSpellSelection */20;
    case 68 :
        return /* HatredFor */21;
    case 77 :
        return /* Prediger */22;
    case 78 :
        return /* Visionaer */23;
    case 79 :
        return /* ZahlreichePredigten */24;
    case 80 :
        return /* ZahlreicheVisionen */25;
    case 92 :
        return /* LeichterGang */26;
    case 5 :
    case 6 :
    case 7 :
    case 8 :
    case 10 :
    case 11 :
    case 13 :
    case 15 :
    case 18 :
    case 19 :
    case 20 :
    case 21 :
    case 22 :
    case 30 :
    case 31 :
    case 33 :
    case 34 :
    case 35 :
    case 37 :
    case 38 :
    case 39 :
    case 41 :
    case 42 :
    case 43 :
    case 44 :
    case 45 :
    case 48 :
    case 49 :
    case 51 :
    case 52 :
    case 53 :
    case 55 :
    case 56 :
    case 57 :
    case 59 :
    case 60 :
    case 61 :
    case 62 :
    case 63 :
    case 64 :
    case 65 :
    case 66 :
    case 67 :
    case 69 :
    case 70 :
    case 71 :
    case 72 :
    case 73 :
    case 74 :
    case 75 :
    case 76 :
    case 81 :
    case 82 :
    case 83 :
    case 84 :
    case 85 :
    case 86 :
    case 87 :
    case 88 :
    case 89 :
    case 90 :
    case 91 :
    case 93 :
    case 94 :
    case 95 :
    case 96 :
    case 97 :
    case 98 :
        return /* Other */{
                _0: id
              };
    case 99 :
        return /* Einkommen */27;
    default:
      return /* Other */{
              _0: id
            };
  }
}

function toInt$3(id) {
  if (typeof id !== "number") {
    return id._0;
  }
  switch (id) {
    case /* Aptitude */0 :
        return 4;
    case /* Nimble */1 :
        return 9;
    case /* Blessed */2 :
        return 12;
    case /* Luck */3 :
        return 14;
    case /* ExceptionalSkill */4 :
        return 16;
    case /* ExceptionalCombatTechnique */5 :
        return 17;
    case /* IncreasedAstralPower */6 :
        return 23;
    case /* IncreasedKarmaPoints */7 :
        return 24;
    case /* IncreasedLifePoints */8 :
        return 25;
    case /* IncreasedSpirit */9 :
        return 26;
    case /* IncreasedToughness */10 :
        return 27;
    case /* ImmunityToPoison */11 :
        return 28;
    case /* ImmunityToDisease */12 :
        return 29;
    case /* MagicalAttunement */13 :
        return 32;
    case /* Rich */14 :
        return 36;
    case /* SociallyAdaptable */15 :
        return 40;
    case /* InspireConfidence */16 :
        return 46;
    case /* WeaponAptitude */17 :
        return 47;
    case /* Spellcaster */18 :
        return 50;
    case /* Unyielding */19 :
        return 54;
    case /* LargeSpellSelection */20 :
        return 58;
    case /* HatredFor */21 :
        return 68;
    case /* Prediger */22 :
        return 77;
    case /* Visionaer */23 :
        return 78;
    case /* ZahlreichePredigten */24 :
        return 79;
    case /* ZahlreicheVisionen */25 :
        return 80;
    case /* LeichterGang */26 :
        return 92;
    case /* Einkommen */27 :
        return 99;
    
  }
}

var AdvantageId = {
  fromInt: fromInt,
  toInt: toInt$3,
  aptitude: "ADV_4",
  nimble: "ADV_9",
  blessed: "ADV_12",
  luck: "ADV_14",
  exceptionalSkill: "ADV_16",
  exceptionalCombatTechnique: "ADV_17",
  increasedAstralPower: "ADV_23",
  increasedKarmaPoints: "ADV_24",
  increasedLifePoints: "ADV_25",
  increasedSpirit: "ADV_26",
  increasedToughness: "ADV_27",
  immunityToPoison: "ADV_28",
  immunityToDisease: "ADV_29",
  magicalAttunement: "ADV_32",
  rich: "ADV_36",
  sociallyAdaptable: "ADV_40",
  inspireConfidence: "ADV_46",
  weaponAptitude: "ADV_47",
  spellcaster: "ADV_50",
  unyielding: "ADV_54",
  largeSpellSelection: "ADV_58",
  hatredOf: "ADV_68",
  prediger: "ADV_77",
  visionaer: "ADV_78",
  zahlreichePredigten: "ADV_79",
  zahlreicheVisionen: "ADV_80",
  leichterGang: "ADV_92",
  einkommen: "ADV_99"
};

function fromInt$1(id) {
  switch (id) {
    case 1 :
        return /* AfraidOf */0;
    case 2 :
        return /* Poor */1;
    case 4 :
        return /* Slow */2;
    case 17 :
        return /* NoFlyingBalm */3;
    case 18 :
        return /* NoFamiliar */4;
    case 24 :
        return /* MagicalRestriction */5;
    case 26 :
        return /* DecreasedArcanePower */6;
    case 27 :
        return /* DecreasedKarmaPoints */7;
    case 28 :
        return /* DecreasedLifePoints */8;
    case 29 :
        return /* DecreasedSpirit */9;
    case 30 :
        return /* DecreasedToughness */10;
    case 31 :
        return /* BadLuck */11;
    case 33 :
        return /* PersonalityFlaw */12;
    case 34 :
        return /* Principles */13;
    case 36 :
        return /* BadHabit */14;
    case 37 :
        return /* NegativeTrait */15;
    case 45 :
        return /* Stigma */16;
    case 47 :
        return /* Deaf */17;
    case 48 :
        return /* Incompetent */18;
    case 50 :
        return /* Obligations */19;
    case 51 :
        return /* Maimed */20;
    case 56 :
        return /* BrittleBones */21;
    case 59 :
        return /* SmallSpellSelection */22;
    case 3 :
    case 5 :
    case 6 :
    case 7 :
    case 8 :
    case 9 :
    case 10 :
    case 11 :
    case 12 :
    case 13 :
    case 14 :
    case 15 :
    case 16 :
    case 19 :
    case 20 :
    case 21 :
    case 22 :
    case 23 :
    case 25 :
    case 32 :
    case 35 :
    case 38 :
    case 39 :
    case 40 :
    case 41 :
    case 42 :
    case 43 :
    case 44 :
    case 46 :
    case 49 :
    case 52 :
    case 53 :
    case 54 :
    case 55 :
    case 57 :
    case 58 :
    case 60 :
    case 61 :
    case 62 :
    case 63 :
    case 64 :
    case 65 :
    case 66 :
    case 67 :
    case 68 :
    case 69 :
    case 70 :
    case 71 :
        return /* Other */{
                _0: id
              };
    case 72 :
        return /* WenigePredigten */23;
    case 73 :
        return /* WenigeVisionen */24;
    default:
      return /* Other */{
              _0: id
            };
  }
}

function toInt$4(id) {
  if (typeof id !== "number") {
    return id._0;
  }
  switch (id) {
    case /* AfraidOf */0 :
        return 1;
    case /* Poor */1 :
        return 2;
    case /* Slow */2 :
        return 4;
    case /* NoFlyingBalm */3 :
        return 17;
    case /* NoFamiliar */4 :
        return 18;
    case /* MagicalRestriction */5 :
        return 24;
    case /* DecreasedArcanePower */6 :
        return 26;
    case /* DecreasedKarmaPoints */7 :
        return 27;
    case /* DecreasedLifePoints */8 :
        return 28;
    case /* DecreasedSpirit */9 :
        return 29;
    case /* DecreasedToughness */10 :
        return 30;
    case /* BadLuck */11 :
        return 31;
    case /* PersonalityFlaw */12 :
        return 33;
    case /* Principles */13 :
        return 34;
    case /* BadHabit */14 :
        return 36;
    case /* NegativeTrait */15 :
        return 37;
    case /* Stigma */16 :
        return 45;
    case /* Deaf */17 :
        return 47;
    case /* Incompetent */18 :
        return 48;
    case /* Obligations */19 :
        return 50;
    case /* Maimed */20 :
        return 51;
    case /* BrittleBones */21 :
        return 56;
    case /* SmallSpellSelection */22 :
        return 59;
    case /* WenigePredigten */23 :
        return 72;
    case /* WenigeVisionen */24 :
        return 73;
    
  }
}

var DisadvantageId = {
  fromInt: fromInt$1,
  toInt: toInt$4,
  afraidOf: "DISADV_1",
  poor: "DISADV_2",
  slow: "DISADV_4",
  noFlyingBalm: "DISADV_17",
  noFamiliar: "DISADV_18",
  magicalRestriction: "DISADV_24",
  decreasedArcanePower: "DISADV_26",
  decreasedKarmaPoints: "DISADV_27",
  decreasedLifePoints: "DISADV_28",
  decreasedSpirit: "DISADV_29",
  decreasedToughness: "DISADV_30",
  badLuck: "DISADV_31",
  personalityFlaw: "DISADV_33",
  principles: "DISADV_34",
  badHabit: "DISADV_36",
  negativeTrait: "DISADV_37",
  stigma: "DISADV_45",
  deaf: "DISADV_47",
  incompetent: "DISADV_48",
  obligations: "DISADV_50",
  maimed: "DISADV_51",
  brittleBones: "DISADV_56",
  smallSpellSelection: "DISADV_59",
  wenigePredigten: "DISADV_72",
  wenigeVisionen: "DISADV_73"
};

function fromInt$2(id) {
  var switcher = id - 1 | 0;
  if (switcher > 58 || switcher < 0) {
    return Pervasives.invalid_arg("fromInt: " + (Int$OptolithClient.show(id) + " is not a valid skill"));
  } else {
    return switcher;
  }
}

function toInt$5(id) {
  return id + 1 | 0;
}

var SkillId = {
  fromInt: fromInt$2,
  toInt: toInt$5,
  flying: "TAL_1",
  gaukelei: "TAL_2",
  climbing: "TAL_3",
  bodyControl: "TAL_4",
  featOfStrength: "TAL_5",
  riding: "TAL_6",
  swimming: "TAL_7",
  selfControl: "TAL_8",
  singing: "TAL_9",
  perception: "TAL_10",
  dancing: "TAL_11",
  pickpocket: "TAL_12",
  stealth: "TAL_13",
  carousing: "TAL_14",
  persuasion: "TAL_15",
  seduction: "TAL_16",
  intimidation: "TAL_17",
  etiquette: "TAL_18",
  streetwise: "TAL_19",
  empathy: "TAL_20",
  fastTalk: "TAL_21",
  disguise: "TAL_22",
  willpower: "TAL_23",
  tracking: "TAL_24",
  ropes: "TAL_25",
  fishing: "TAL_26",
  orienting: "TAL_27",
  plantLore: "TAL_28",
  animalLore: "TAL_29",
  survival: "TAL_30",
  gambling: "TAL_31",
  geography: "TAL_32",
  history: "TAL_33",
  religions: "TAL_34",
  warfare: "TAL_35",
  magicalLore: "TAL_36",
  mechanics: "TAL_37",
  math: "TAL_38",
  law: "TAL_39",
  mythsAndLegends: "TAL_40",
  sphereLore: "TAL_41",
  astronomy: "TAL_42",
  alchemy: "TAL_43",
  sailing: "TAL_44",
  driving: "TAL_45",
  commerce: "TAL_46",
  treatPoison: "TAL_47",
  treatDisease: "TAL_48",
  treatSoul: "TAL_49",
  treatWounds: "TAL_50",
  woodworking: "TAL_51",
  prepareFood: "TAL_52",
  leatherworking: "TAL_53",
  artisticAbility: "TAL_54",
  metalworking: "TAL_55",
  music: "TAL_56",
  pickLocks: "TAL_57",
  earthencraft: "TAL_58",
  clothworking: "TAL_59"
};

var CombatTechniqueId = {
  crossbows: "CT_1",
  bows: "CT_2",
  daggers: "CT_3",
  fencingWeapons: "CT_4",
  impactWeapons: "CT_5",
  chainWeapons: "CT_6",
  lances: "CT_7",
  brawling: "CT_9",
  shields: "CT_10",
  slings: "CT_11",
  swords: "CT_12",
  polearms: "CT_13",
  thrownWeapons: "CT_14",
  twoHandedImpactWeapons: "CT_15",
  twoHandedSwords: "CT_16",
  spittingFire: "CT_17",
  blowguns: "CT_18",
  discuses: "CT_19",
  faecher: "CT_20",
  spiesswaffen: "CT_21"
};

function fromInt$3(id) {
  if (id >= 623) {
    if (id >= 1069) {
      if (id >= 1222) {
        if (id >= 1294) {
          if (id !== 1391) {
            if (id !== 1438) {
              return /* Other */{
                      _0: id
                    };
            } else {
              return /* TraditionBrobimGeoden */96;
            }
          } else {
            return /* Zaubervariabilitaet */95;
          }
        } else if (id !== 1255) {
          if (id >= 1293) {
            return /* TraditionZibilijas */94;
          } else {
            return /* Other */{
                    _0: id
                  };
          }
        } else {
          return /* TraditionGeoden */93;
        }
      }
      if (id < 1100) {
        if (id !== 1075) {
          if (id >= 1070) {
            return /* Other */{
                    _0: id
                  };
          } else {
            return /* WegDerKuenstlerin */83;
          }
        } else {
          return /* WegDerSchreiberin */84;
        }
      }
      var switcher = id - 1128 | 0;
      if (!(switcher > 92 || switcher < 0)) {
        if (switcher !== 19) {
          return /* Other */{
                  _0: id
                };
        } else {
          return /* ScholarDesMagierkollegsZuHoningen */91;
        }
      }
      if (switcher >= 93) {
        return /* TraditionAnimisten */92;
      }
      switch (switcher + 28 | 0) {
        case 0 :
            return /* Fachwissen */85;
        case 8 :
            return /* Handwerkskunst */86;
        case 10 :
            return /* KindDerNatur */87;
        case 12 :
            return /* KoerperlichesGeschick */88;
        case 23 :
            return /* SozialeKompetenz */89;
        case 1 :
        case 2 :
        case 3 :
        case 4 :
        case 5 :
        case 6 :
        case 7 :
        case 9 :
        case 11 :
        case 13 :
        case 14 :
        case 15 :
        case 16 :
        case 17 :
        case 18 :
        case 19 :
        case 20 :
        case 21 :
        case 22 :
        case 24 :
        case 25 :
        case 26 :
            return /* Other */{
                    _0: id
                  };
        case 27 :
            return /* Universalgenie */90;
        
      }
    } else {
      if (id >= 809) {
        if (id >= 902) {
          if (id !== 1040) {
            if (id !== 1049) {
              return /* Other */{
                      _0: id
                    };
            } else {
              return /* TraditionCultOfNuminoru */82;
            }
          } else {
            return /* WegDerGelehrten */81;
          }
        } else if (id !== 821) {
          if (id >= 901) {
            return /* GaretherGossenStil */80;
          } else {
            return /* Other */{
                    _0: id
                  };
          }
        } else {
          return /* MadaschwesternStil */79;
        }
      }
      if (id >= 772) {
        var switcher$1 = id - 782 | 0;
        if (!(switcher$1 > 25 || switcher$1 < 0)) {
          if (switcher$1 !== 20) {
            return /* Other */{
                    _0: id
                  };
          } else {
            return /* ScholarDerHalleDesLebensZuNorburg */77;
          }
        }
        if (switcher$1 >= 26) {
          return /* ScholarDesKreisesDerEinfuehlung */78;
        }
        switch (switcher$1 + 10 | 0) {
          case 0 :
              return /* GrosseMeditation */74;
          case 3 :
              return /* Imitationszauberei */75;
          case 1 :
          case 2 :
          case 4 :
          case 5 :
          case 6 :
          case 7 :
          case 8 :
              return /* Other */{
                      _0: id
                    };
          case 9 :
              return /* Kraftliniennutzung */76;
          
        }
      } else if (id >= 663) {
        if (id >= 751) {
          return /* Other */{
                  _0: id
                };
        }
        switch (id - 663 | 0) {
          case 0 :
              return /* ChantEnhancement */46;
          case 4 :
              return /* DunklesAbbildDerBuendnisgabe */47;
          case 13 :
              return /* TraditionIllusionist */48;
          case 14 :
              return /* TraditionArcaneBard */49;
          case 15 :
              return /* TraditionArcaneDancer */50;
          case 16 :
              return /* TraditionIntuitiveMage */51;
          case 17 :
              return /* TraditionSavant */52;
          case 18 :
              return /* TraditionQabalyaMage */53;
          case 19 :
              return /* TraditionChurchOfRondra */54;
          case 20 :
              return /* TraditionChurchOfBoron */55;
          case 21 :
              return /* TraditionChurchOfHesinde */56;
          case 22 :
              return /* TraditionChurchOfPhex */57;
          case 23 :
              return /* TraditionChurchOfPeraine */58;
          case 24 :
              return /* TraditionChurchOfEfferd */59;
          case 25 :
              return /* TraditionChurchOfTravia */60;
          case 26 :
              return /* TraditionChurchOfFirun */61;
          case 27 :
              return /* TraditionChurchOfTsa */62;
          case 28 :
              return /* TraditionChurchOfIngerimm */63;
          case 29 :
              return /* TraditionChurchOfRahja */64;
          case 30 :
              return /* TraditionCultOfTheNamelessOne */65;
          case 31 :
              return /* TraditionChurchOfAves */66;
          case 32 :
              return /* TraditionChurchOfIfirn */67;
          case 33 :
              return /* TraditionChurchOfKor */68;
          case 34 :
              return /* TraditionChurchOfNandus */69;
          case 35 :
              return /* TraditionChurchOfSwafnir */70;
          case 36 :
              return /* LanguageSpecializations */71;
          case 63 :
              return /* TraditionSchelme */72;
          case 1 :
          case 2 :
          case 3 :
          case 5 :
          case 6 :
          case 7 :
          case 8 :
          case 9 :
          case 10 :
          case 11 :
          case 12 :
          case 37 :
          case 38 :
          case 39 :
          case 40 :
          case 41 :
          case 42 :
          case 43 :
          case 44 :
          case 45 :
          case 46 :
          case 47 :
          case 48 :
          case 49 :
          case 50 :
          case 51 :
          case 52 :
          case 53 :
          case 54 :
          case 55 :
          case 56 :
          case 57 :
          case 58 :
          case 59 :
          case 60 :
          case 61 :
          case 62 :
          case 64 :
          case 65 :
          case 66 :
          case 67 :
          case 68 :
          case 69 :
          case 70 :
          case 71 :
          case 72 :
          case 73 :
          case 74 :
          case 75 :
          case 76 :
          case 77 :
          case 78 :
          case 79 :
          case 80 :
          case 81 :
          case 82 :
          case 83 :
          case 84 :
          case 85 :
          case 86 :
              return /* Other */{
                      _0: id
                    };
          case 87 :
              return /* TraditionZauberalchimisten */73;
          
        }
      } else {
        if (id >= 640) {
          return /* Other */{
                  _0: id
                };
        }
        switch (id - 623 | 0) {
          case 0 :
              return /* Zugvoegel */42;
          case 2 :
              return /* JaegerinnenDerWeissenMaid */43;
          case 9 :
              return /* AnhaengerDesGueldenen */44;
          case 1 :
          case 3 :
          case 4 :
          case 5 :
          case 6 :
          case 7 :
          case 8 :
          case 10 :
          case 11 :
          case 12 :
          case 13 :
          case 14 :
          case 15 :
              return /* Other */{
                      _0: id
                    };
          case 16 :
              return /* GebieterDesAspekts */45;
          
        }
      }
    }
  } else if (id >= 255) {
    if (id >= 346) {
      if (id < 472) {
        if (id !== 414) {
          if (id >= 347) {
            return /* Other */{
                    _0: id
                  };
          } else {
            return /* TraditionDruids */24;
          }
        } else {
          return /* SpellEnhancement */25;
        }
      }
      if (id < 474) {
        if (id >= 473) {
          return /* Expertenwissen */27;
        } else {
          return /* Forschungsgebiet */26;
        }
      }
      switch (id) {
        case 531 :
            return /* Wissensdurst */28;
        case 533 :
            return /* Recherchegespuer */29;
        case 544 :
            return /* PredigtDerGemeinschaft */30;
        case 545 :
            return /* PredigtDerZuversicht */31;
        case 546 :
            return /* PredigtDesGottvertrauens */32;
        case 547 :
            return /* PredigtDesWohlgefallens */33;
        case 548 :
            return /* PredigtWiderMissgeschicke */34;
        case 549 :
            return /* VisionDerBestimmung */35;
        case 550 :
            return /* VisionDerEntrueckung */36;
        case 551 :
            return /* VisionDerGottheit */37;
        case 552 :
            return /* VisionDesSchicksals */38;
        case 553 :
            return /* VisionDesWahrenGlaubens */39;
        case 563 :
            return /* HoheWeihe */40;
        case 532 :
        case 534 :
        case 535 :
        case 536 :
        case 537 :
        case 538 :
        case 539 :
        case 540 :
        case 541 :
        case 542 :
        case 543 :
        case 554 :
        case 555 :
        case 556 :
        case 557 :
        case 558 :
        case 559 :
        case 560 :
        case 561 :
        case 562 :
        case 564 :
        case 565 :
        case 566 :
        case 567 :
        case 568 :
            return /* Other */{
                    _0: id
                  };
        case 569 :
            return /* Lieblingsliturgie */41;
        default:
          return /* Other */{
                  _0: id
                };
      }
    } else {
      if (id < 296) {
        if (id !== 266) {
          if (id >= 256) {
            return /* Other */{
                    _0: id
                  };
          } else {
            return /* TraditionWitches */19;
          }
        } else {
          return /* MagicStyleCombination */20;
        }
      }
      var switcher$2 = id - 297 | 0;
      if (switcher$2 > 47 || switcher$2 < 0) {
        if (switcher$2 >= 48) {
          return /* TraditionElves */23;
        } else {
          return /* Harmoniezauberei */21;
        }
      } else if (switcher$2 !== 6) {
        return /* Other */{
                _0: id
              };
      } else {
        return /* Matrixzauberei */22;
      }
    }
  } else {
    if (id >= 110) {
      if (id >= 232) {
        if (id !== 240) {
          if (id !== 250) {
            return /* Other */{
                    _0: id
                  };
          } else {
            return /* FavoriteSpellwork */18;
          }
        } else {
          return /* Exorzist */17;
        }
      } else if (id !== 164) {
        if (id >= 231) {
          return /* AdaptionZauber */16;
        } else {
          return /* Other */{
                  _0: id
                };
        }
      } else {
        return /* CombatStyleCombination */15;
      }
    }
    if (id >= 52) {
      if (id >= 88) {
        if (id >= 109) {
          return /* Feuerschlucker */14;
        } else {
          return /* Other */{
                  _0: id
                };
        }
      }
      if (id < 64) {
        return /* Other */{
                _0: id
              };
      }
      switch (id - 64 | 0) {
        case 0 :
            return /* ImprovedDodge */8;
        case 6 :
            return /* TraditionGuildMages */9;
        case 8 :
            return /* PropertyKnowledge */10;
        case 17 :
            return /* PropertyFocus */11;
        case 1 :
        case 2 :
        case 3 :
        case 4 :
        case 5 :
        case 7 :
        case 9 :
        case 10 :
        case 11 :
        case 12 :
        case 13 :
        case 14 :
        case 15 :
        case 16 :
        case 18 :
        case 19 :
        case 20 :
        case 21 :
            return /* Other */{
                    _0: id
                  };
        case 22 :
            return /* TraditionChurchOfPraios */13;
        case 23 :
            return /* AspectKnowledge */12;
        
      }
    } else {
      if (id >= 30) {
        if (id >= 51) {
          return /* CombatReflexes */7;
        } else {
          return /* Other */{
                  _0: id
                };
        }
      }
      if (id < 9) {
        return /* Other */{
                _0: id
              };
      }
      switch (id - 9 | 0) {
        case 0 :
            return /* SkillSpecialization */0;
        case 3 :
            return /* TerrainKnowledge */1;
        case 8 :
            return /* CraftInstruments */2;
        case 9 :
            return /* Hunter */3;
        case 13 :
            return /* AreaKnowledge */4;
        case 18 :
            return /* Literacy */5;
        case 1 :
        case 2 :
        case 4 :
        case 5 :
        case 6 :
        case 7 :
        case 10 :
        case 11 :
        case 12 :
        case 14 :
        case 15 :
        case 16 :
        case 17 :
        case 19 :
            return /* Other */{
                    _0: id
                  };
        case 20 :
            return /* Language */6;
        
      }
    }
  }
}

function toInt$6(id) {
  if (typeof id !== "number") {
    return id._0;
  }
  switch (id) {
    case /* SkillSpecialization */0 :
        return 9;
    case /* TerrainKnowledge */1 :
        return 12;
    case /* CraftInstruments */2 :
        return 17;
    case /* Hunter */3 :
        return 18;
    case /* AreaKnowledge */4 :
        return 22;
    case /* Literacy */5 :
        return 27;
    case /* Language */6 :
        return 29;
    case /* CombatReflexes */7 :
        return 51;
    case /* ImprovedDodge */8 :
        return 64;
    case /* TraditionGuildMages */9 :
        return 70;
    case /* PropertyKnowledge */10 :
        return 72;
    case /* PropertyFocus */11 :
        return 81;
    case /* AspectKnowledge */12 :
        return 87;
    case /* TraditionChurchOfPraios */13 :
        return 86;
    case /* Feuerschlucker */14 :
        return 109;
    case /* CombatStyleCombination */15 :
        return 164;
    case /* AdaptionZauber */16 :
        return 231;
    case /* Exorzist */17 :
        return 240;
    case /* FavoriteSpellwork */18 :
        return 250;
    case /* TraditionWitches */19 :
        return 255;
    case /* MagicStyleCombination */20 :
        return 266;
    case /* Harmoniezauberei */21 :
        return 296;
    case /* Matrixzauberei */22 :
        return 303;
    case /* TraditionElves */23 :
        return 345;
    case /* TraditionDruids */24 :
        return 346;
    case /* SpellEnhancement */25 :
        return 414;
    case /* Forschungsgebiet */26 :
        return 472;
    case /* Expertenwissen */27 :
        return 473;
    case /* Wissensdurst */28 :
        return 531;
    case /* Recherchegespuer */29 :
        return 533;
    case /* PredigtDerGemeinschaft */30 :
        return 544;
    case /* PredigtDerZuversicht */31 :
        return 545;
    case /* PredigtDesGottvertrauens */32 :
        return 546;
    case /* PredigtDesWohlgefallens */33 :
        return 547;
    case /* PredigtWiderMissgeschicke */34 :
        return 548;
    case /* VisionDerBestimmung */35 :
        return 549;
    case /* VisionDerEntrueckung */36 :
        return 550;
    case /* VisionDerGottheit */37 :
        return 551;
    case /* VisionDesSchicksals */38 :
        return 552;
    case /* VisionDesWahrenGlaubens */39 :
        return 553;
    case /* HoheWeihe */40 :
        return 563;
    case /* Lieblingsliturgie */41 :
        return 569;
    case /* Zugvoegel */42 :
        return 623;
    case /* JaegerinnenDerWeissenMaid */43 :
        return 625;
    case /* AnhaengerDesGueldenen */44 :
        return 632;
    case /* GebieterDesAspekts */45 :
        return 639;
    case /* ChantEnhancement */46 :
        return 663;
    case /* DunklesAbbildDerBuendnisgabe */47 :
        return 667;
    case /* TraditionIllusionist */48 :
        return 676;
    case /* TraditionArcaneBard */49 :
        return 677;
    case /* TraditionArcaneDancer */50 :
        return 678;
    case /* TraditionIntuitiveMage */51 :
        return 679;
    case /* TraditionSavant */52 :
        return 680;
    case /* TraditionQabalyaMage */53 :
        return 681;
    case /* TraditionChurchOfRondra */54 :
        return 682;
    case /* TraditionChurchOfBoron */55 :
        return 683;
    case /* TraditionChurchOfHesinde */56 :
        return 684;
    case /* TraditionChurchOfPhex */57 :
        return 685;
    case /* TraditionChurchOfPeraine */58 :
        return 686;
    case /* TraditionChurchOfEfferd */59 :
        return 687;
    case /* TraditionChurchOfTravia */60 :
        return 688;
    case /* TraditionChurchOfFirun */61 :
        return 689;
    case /* TraditionChurchOfTsa */62 :
        return 690;
    case /* TraditionChurchOfIngerimm */63 :
        return 691;
    case /* TraditionChurchOfRahja */64 :
        return 692;
    case /* TraditionCultOfTheNamelessOne */65 :
        return 693;
    case /* TraditionChurchOfAves */66 :
        return 694;
    case /* TraditionChurchOfIfirn */67 :
        return 695;
    case /* TraditionChurchOfKor */68 :
        return 696;
    case /* TraditionChurchOfNandus */69 :
        return 697;
    case /* TraditionChurchOfSwafnir */70 :
        return 698;
    case /* LanguageSpecializations */71 :
        return 699;
    case /* TraditionSchelme */72 :
        return 726;
    case /* TraditionZauberalchimisten */73 :
        return 750;
    case /* GrosseMeditation */74 :
        return 772;
    case /* Imitationszauberei */75 :
        return 775;
    case /* Kraftliniennutzung */76 :
        return 781;
    case /* ScholarDerHalleDesLebensZuNorburg */77 :
        return 802;
    case /* ScholarDesKreisesDerEinfuehlung */78 :
        return 808;
    case /* MadaschwesternStil */79 :
        return 821;
    case /* GaretherGossenStil */80 :
        return 901;
    case /* WegDerGelehrten */81 :
        return 1040;
    case /* TraditionCultOfNuminoru */82 :
        return 1049;
    case /* WegDerKuenstlerin */83 :
        return 1069;
    case /* WegDerSchreiberin */84 :
        return 1075;
    case /* Fachwissen */85 :
        return 1100;
    case /* Handwerkskunst */86 :
        return 1108;
    case /* KindDerNatur */87 :
        return 1110;
    case /* KoerperlichesGeschick */88 :
        return 1112;
    case /* SozialeKompetenz */89 :
        return 1123;
    case /* Universalgenie */90 :
        return 1127;
    case /* ScholarDesMagierkollegsZuHoningen */91 :
        return 1147;
    case /* TraditionAnimisten */92 :
        return 1221;
    case /* TraditionGeoden */93 :
        return 1255;
    case /* TraditionZibilijas */94 :
        return 1293;
    case /* Zaubervariabilitaet */95 :
        return 1391;
    case /* TraditionBrobimGeoden */96 :
        return 1438;
    
  }
}

var SpecialAbilityId = {
  fromInt: fromInt$3,
  toInt: toInt$6,
  skillSpecialization: "SA_9",
  terrainKnowledge: "SA_12",
  craftInstruments: "SA_17",
  hunter: "SA_18",
  areaKnowledge: "SA_22",
  literacy: "SA_27",
  language: "SA_29",
  combatReflexes: "SA_51",
  improvedDodge: "SA_64",
  traditionGuildMages: 70,
  propertyKnowledge: "SA_72",
  propertyFocus: "SA_81",
  aspectKnowledge: "SA_87",
  traditionChurchOfPraios: "SA_86",
  feuerschlucker: "SA_109",
  combatStyleCombination: "SA_164",
  adaptionZauber: "SA_231",
  exorzist: "SA_240",
  favoriteSpellwork: "SA_250",
  traditionWitches: "SA_255",
  magicStyleCombination: "SA_266",
  harmoniezauberei: "SA_296",
  matrixzauberei: "SA_303",
  traditionElves: "SA_345",
  traditionDruids: "SA_346",
  spellEnhancement: 414,
  forschungsgebiet: "SA_472",
  expertenwissen: "SA_473",
  wissensdurst: "SA_531",
  recherchegespuer: "SA_533",
  predigtDerGemeinschaft: "SA_544",
  predigtDerZuversicht: "SA_545",
  predigtDesGottvertrauens: "SA_546",
  predigtDesWohlgefallens: "SA_547",
  predigtWiderMissgeschicke: "SA_548",
  visionDerBestimmung: "SA_549",
  visionDerEntrueckung: "SA_550",
  visionDerGottheit: "SA_551",
  visionDesSchicksals: "SA_552",
  visionDesWahrenGlaubens: "SA_553",
  hoheWeihe: "SA_563",
  lieblingsliturgie: "SA_569",
  zugvoegel: "SA_623",
  jaegerinnenDerWeissenMaid: "SA_625",
  anhaengerDesGueldenen: "SA_632",
  gebieterDesAspekts: "SA_639",
  chantEnhancement: 663,
  dunklesAbbildDerBuendnisgabe: "SA_667",
  traditionIllusionist: "SA_676",
  traditionArcaneBard: "SA_677",
  traditionArcaneDancer: "SA_678",
  traditionIntuitiveMage: "SA_679",
  traditionSavant: "SA_680",
  traditionQabalyaMage: "SA_681",
  traditionChurchOfRondra: "SA_682",
  traditionChurchOfBoron: "SA_683",
  traditionChurchOfHesinde: "SA_684",
  traditionChurchOfPhex: "SA_685",
  traditionChurchOfPeraine: "SA_686",
  traditionChurchOfEfferd: "SA_687",
  traditionChurchOfTravia: "SA_688",
  traditionChurchOfFirun: "SA_689",
  traditionChurchOfTsa: "SA_690",
  traditionChurchOfIngerimm: "SA_691",
  traditionChurchOfRahja: "SA_692",
  traditionCultOfTheNamelessOne: "SA_693",
  traditionChurchOfAves: "SA_694",
  traditionChurchOfIfirn: "SA_695",
  traditionChurchOfKor: "SA_696",
  traditionChurchOfNandus: "SA_697",
  traditionChurchOfSwafnir: "SA_698",
  languageSpecializations: "SA_699",
  traditionSchelme: "SA_726",
  traditionZauberalchimisten: "SA_750",
  grosseMeditation: "SA_772",
  imitationszauberei: "SA_775",
  kraftliniennutzung: "SA_781",
  scholarDerHalleDesLebensZuNorburg: "SA_802",
  scholarDesKreisesDerEinfuehlung: "SA_808",
  madaschwesternStil: "SA_821",
  garetherGossenStil: "SA_901",
  wegDerGelehrten: "SA_1040",
  traditionCultOfNuminoru: "SA_1049",
  wegDerKuenstlerin: "SA_1069",
  wegDerSchreiberin: "SA_1075",
  fachwissen: "SA_1100",
  handwerkskunst: "SA_1108",
  kindDerNatur: "SA_1110",
  koerperlichesGeschick: "SA_1112",
  sozialeKompetenz: "SA_1123",
  universalgenie: "SA_1127",
  scholarDesMagierkollegsZuHoningen: "SA_1147",
  traditionAnimisten: "SA_1221",
  traditionGeoden: "SA_1255",
  traditionZibilijas: "SA_1293",
  zaubervariabilitaet: "SA_1391",
  traditionBrobimGeoden: "SA_1438"
};

var SocialStatusId = {
  notFree: 1,
  free: 2,
  lesserNoble: 3,
  noble: 4,
  aristocracy: 5
};

var OptionalRuleId = {
  maximumAttributeScores: "OR_8",
  languageSpecialization: "OR_15",
  higherDefenseStats: "OR_17"
};

var ConditionId = {
  sikaryanVerlust: "COND_11",
  daemonischeAuszehrung: "COND_14"
};

exports.Phase = Phase;
exports.ExperienceLevelId = ExperienceLevelId;
exports.RaceId = RaceId;
exports.CultureId = CultureId;
exports.ProfessionId = ProfessionId;
exports.AttrId = AttrId;
exports.DCId = DCId;
exports.AdvantageId = AdvantageId;
exports.DisadvantageId = DisadvantageId;
exports.SkillId = SkillId;
exports.CombatTechniqueId = CombatTechniqueId;
exports.SpecialAbilityId = SpecialAbilityId;
exports.SocialStatusId = SocialStatusId;
exports.OptionalRuleId = OptionalRuleId;
exports.ConditionId = ConditionId;
/* No side effect */
