local ____lualib = require("lualib_bundle")
local __TS__New = ____lualib.__TS__New
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
local __TS__Spread = ____lualib.__TS__Spread
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
local ____cachedEnumValues = require("arrays.cachedEnumValues")
local BOSS_IDS = ____cachedEnumValues.BOSS_IDS
local ____set = require("functions.set")
local combineSets = ____set.combineSets
local ____storyBosses = require("functions.storyBosses")
local isStoryBossID = ____storyBosses.isStoryBossID
local ____ReadonlyMap = require("types.ReadonlyMap")
local ReadonlyMap = ____ReadonlyMap.ReadonlyMap
local ____ReadonlySet = require("types.ReadonlySet")
local ReadonlySet = ____ReadonlySet.ReadonlySet
--- Contains just the bosses in Basement (not e.g. Burning Basement).
local BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MONSTRO,
    BossID.LARRY_JR,
    BossID.FAMINE,
    BossID.DUKE_OF_FLIES,
    BossID.GEMINI,
    BossID.STEVEN,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.DINGLE,
    BossID.GURGLING,
    BossID.LITTLE_HORN,
    BossID.DANGLE,
    BossID.TURDLING,
    BossID.BABY_PLUM
})
--- Contains just the bosses in Cellar (not e.g. Burning Basement).
local CELLAR_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.FAMINE,
    BossID.DUKE_OF_FLIES,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.BLIGHTED_OVUM,
    BossID.WIDOW,
    BossID.PIN,
    BossID.HAUNT,
    BossID.LITTLE_HORN,
    BossID.RAG_MAN,
    BossID.BABY_PLUM
})
--- Contains just the bosses in Burning Basement (not e.g. Cellar).
local BURNING_BASEMENT_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MONSTRO,
    BossID.LARRY_JR,
    BossID.FAMINE,
    BossID.DUKE_OF_FLIES,
    BossID.GEMINI,
    BossID.STEVEN,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.DINGLE,
    BossID.GURGLING,
    BossID.LITTLE_HORN,
    BossID.RAG_MAN,
    BossID.DANGLE,
    BossID.TURDLING,
    BossID.BABY_PLUM
})
--- Contains just the bosses in Downpour (not e.g. Burning Basement).
local DOWNPOUR_BOSSES_SET = __TS__New(ReadonlySet, {BossID.LIL_BLUB, BossID.WORMWOOD, BossID.RAINMAKER, BossID.MIN_MIN})
--- Contains just the bosses in Dross (not e.g. Burning Basement).
local DROSS_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.LIL_BLUB,
    BossID.WORMWOOD,
    BossID.CLOG,
    BossID.COLOSTOMIA,
    BossID.TURDLET
})
--- The set of unique bosses for Basement, Cellar, and so on.
local ALL_BASEMENT_BOSSES_SET = combineSets(
    nil,
    BASEMENT_BOSSES_SET,
    CELLAR_BOSSES_SET,
    BURNING_BASEMENT_BOSSES_SET,
    DOWNPOUR_BOSSES_SET,
    DROSS_BOSSES_SET
)
local BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
    {StageType.ORIGINAL, BASEMENT_BOSSES_SET},
    {StageType.WRATH_OF_THE_LAMB, CELLAR_BOSSES_SET},
    {StageType.AFTERBIRTH, BURNING_BASEMENT_BOSSES_SET},
    {StageType.REPENTANCE, DOWNPOUR_BOSSES_SET},
    {StageType.REPENTANCE_B, DROSS_BOSSES_SET}
})
--- Contains just the bosses in Caves (not e.g. Flooded Caves).
local CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.CHUB,
    BossID.GURDY,
    BossID.PESTILENCE,
    BossID.PEEP,
    BossID.FISTULA,
    BossID.CHAD,
    BossID.HEADLESS_HORSEMAN,
    BossID.GURDY_JR,
    BossID.MEGA_FATTY,
    BossID.MEGA_MAW,
    BossID.FALLEN,
    BossID.STAIN,
    BossID.RAG_MEGA,
    BossID.BIG_HORN,
    BossID.BUMBINO
})
--- Contains just the bosses in Catacombs (not e.g. Flooded Caves).
local CATACOMBS_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.PESTILENCE,
    BossID.PEEP,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.HOLLOW,
    BossID.CARRION_QUEEN,
    BossID.GURDY_JR,
    BossID.HUSK,
    BossID.WRETCHED,
    BossID.DARK_ONE,
    BossID.POLYCEPHALUS,
    BossID.FORSAKEN,
    BossID.FRAIL,
    BossID.RAG_MEGA,
    BossID.BIG_HORN,
    BossID.BUMBINO
})
--- Contains just the bosses in Flooded Caves (not e.g. Catacombs).
local FLOODED_CAVES_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.CHUB,
    BossID.GURDY,
    BossID.PESTILENCE,
    BossID.PEEP,
    BossID.FISTULA,
    BossID.CHAD,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.GURDY_JR,
    BossID.MEGA_MAW,
    BossID.MEGA_FATTY,
    BossID.STAIN,
    BossID.FORSAKEN,
    BossID.FRAIL,
    BossID.RAG_MEGA,
    BossID.BIG_HORN,
    BossID.BUMBINO
})
--- Contains just the bosses in Mines (not e.g. Flooded Caves).
local MINES_BOSSES_SET = __TS__New(ReadonlySet, {BossID.REAP_CREEP, BossID.TUFF_TWINS, BossID.HORNFEL, BossID.GREAT_GIDEON})
--- Contains just the bosses in Ashpit (not e.g. Flooded Caves).
local ASHPIT_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.PILE,
    BossID.GREAT_GIDEON,
    BossID.SINGE,
    BossID.SHELL,
    BossID.CLUTCH
})
--- The set of unique bosses for Caves, Catacombs, and so on.
local ALL_CAVES_BOSSES_SET = combineSets(
    nil,
    CAVES_BOSSES_SET,
    CATACOMBS_BOSSES_SET,
    FLOODED_CAVES_BOSSES_SET,
    MINES_BOSSES_SET,
    ASHPIT_BOSSES_SET
)
local CAVES_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
    {StageType.ORIGINAL, CAVES_BOSSES_SET},
    {StageType.WRATH_OF_THE_LAMB, CATACOMBS_BOSSES_SET},
    {StageType.AFTERBIRTH, FLOODED_CAVES_BOSSES_SET},
    {StageType.REPENTANCE, MINES_BOSSES_SET},
    {StageType.REPENTANCE_B, ASHPIT_BOSSES_SET}
})
--- Contains just the bosses in Depths (not e.g. Dank Depths).
-- 
-- Note that this set includes Mom, even though they are not technically in the boss pool.
local DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MONSTRO_2,
    BossID.MOM,
    BossID.WAR,
    BossID.LOKI,
    BossID.GISH,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.GATE,
    BossID.CAGE,
    BossID.BROWNIE,
    BossID.SISTERS_VIS,
    BossID.REAP_CREEP
})
--- Contains just the bosses in Necropolis (not e.g. Dank Depths).
-- 
-- Note that this set includes Mom, even though they are not technically in the boss pool.
local NECROPOLIS_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MOM,
    BossID.WAR,
    BossID.LOKI,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.BLOAT,
    BossID.MASK_OF_INFAMY,
    BossID.ADVERSARY,
    BossID.BROWNIE,
    BossID.SISTERS_VIS,
    BossID.PILE
})
--- Contains just the bosses in Dank Depths (not e.g. Necropolis).
-- 
-- Note that this set includes Mom, even though they are not technically in the boss pool.
local DANK_DEPTHS_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MONSTRO_2,
    BossID.MOM,
    BossID.WAR,
    BossID.LOKI,
    BossID.GISH,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.GATE,
    BossID.CAGE,
    BossID.BROWNIE,
    BossID.SISTERS_VIS,
    BossID.REAP_CREEP
})
--- Contains just the bosses in Mausoleum (not e.g. Dank Depths).
-- 
-- Note that this set includes Mausoleum Mom, even though they are not technically in the boss pool.
local MAUSOLEUM_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SIREN, BossID.HERETIC, BossID.MAUSOLEUM_MOM})
--- Contains just the bosses in Gehenna (not e.g. Dank Depths).
-- 
-- Note that this set includes Mausoleum Mom, even though they are not technically in the boss pool.
local GEHENNA_BOSSES_SET = __TS__New(ReadonlySet, {BossID.VISAGE, BossID.MAUSOLEUM_MOM, BossID.HORNY_BOYS})
--- The set of unique bosses for Depths, Necropolis, and so on.
local ALL_DEPTHS_BOSSES_SET = combineSets(
    nil,
    DEPTHS_BOSSES_SET,
    NECROPOLIS_BOSSES_SET,
    DANK_DEPTHS_BOSSES_SET,
    MAUSOLEUM_BOSSES_SET,
    GEHENNA_BOSSES_SET
)
local DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
    {StageType.ORIGINAL, DEPTHS_BOSSES_SET},
    {StageType.WRATH_OF_THE_LAMB, NECROPOLIS_BOSSES_SET},
    {StageType.AFTERBIRTH, DANK_DEPTHS_BOSSES_SET},
    {StageType.REPENTANCE, MAUSOLEUM_BOSSES_SET},
    {StageType.REPENTANCE_B, GEHENNA_BOSSES_SET}
})
--- Contains just the bosses in Womb (not e.g. Scarred Womb).
-- 
-- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
-- boss pool.
local WOMB_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.SCOLEX,
    BossID.MOMS_HEART,
    BossID.DEATH,
    BossID.BLASTOCYST,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.IT_LIVES,
    BossID.LOKII,
    BossID.CONQUEST,
    BossID.MAMA_GURDY,
    BossID.MR_FRED,
    BossID.MATRIARCH
})
--- Contains just the bosses in Utero (not e.g. Scarred Womb).
-- 
-- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
-- boss pool.
local UTERO_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.MOMS_HEART,
    BossID.DEATH,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.IT_LIVES,
    BossID.BLOAT,
    BossID.LOKII,
    BossID.TERATOMA,
    BossID.CONQUEST,
    BossID.DADDY_LONG_LEGS,
    BossID.TRIACHNID
})
--- Contains just the bosses in Scarred Womb (not e.g. Utero).
-- 
-- Note that this set includes Mom's Heart & It Lives, even though they are not technically in the
-- boss pool.
local SCARRED_WOMB_BOSSES_SET = __TS__New(ReadonlySet, {
    BossID.SCOLEX,
    BossID.MOMS_HEART,
    BossID.DEATH,
    BossID.BLASTOCYST,
    BossID.HEADLESS_HORSEMAN,
    BossID.FALLEN,
    BossID.IT_LIVES,
    BossID.LOKII,
    BossID.CONQUEST,
    BossID.TRIACHNID,
    BossID.MAMA_GURDY,
    BossID.MR_FRED,
    BossID.MATRIARCH
})
--- Contains just the bosses in Corpse (not e.g. Scarred Womb).
-- 
-- Note that this set includes Mother, even though they are not technically in the boss pool.
local CORPSE_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SCOURGE, BossID.CHIMERA, BossID.ROTGUT, BossID.MOTHER})
--- The set of unique bosses for Womb, Utero, and so on.
local ALL_WOMB_BOSSES_SET = combineSets(
    nil,
    WOMB_BOSSES_SET,
    UTERO_BOSSES_SET,
    SCARRED_WOMB_BOSSES_SET,
    CORPSE_BOSSES_SET
)
local WOMB_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, WOMB_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, UTERO_BOSSES_SET}, {StageType.AFTERBIRTH, SCARRED_WOMB_BOSSES_SET}, {StageType.REPENTANCE, CORPSE_BOSSES_SET}})
local BLUE_WOMB_BOSSES_SET = __TS__New(ReadonlySet, {BossID.HUSH})
local BLUE_WOMB_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, BLUE_WOMB_BOSSES_SET}})
local SHEOL_BOSSES_SET = __TS__New(ReadonlySet, {BossID.SATAN})
local CATHEDRAL_BOSSES_SET = __TS__New(ReadonlySet, {BossID.ISAAC})
local ALL_STAGE_10_BOSSES_SET = combineSets(nil, SHEOL_BOSSES_SET, CATHEDRAL_BOSSES_SET)
local STAGE_10_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, SHEOL_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, CATHEDRAL_BOSSES_SET}})
--- Note that this set includes Mega Satan, even though they are not technically in the boss pool.
local DARK_ROOM_BOSSES_SET = __TS__New(ReadonlySet, {BossID.LAMB, BossID.MEGA_SATAN})
--- Note that this set includes Mega Satan, even though they are not technically in the boss pool.
local CHEST_BOSSES_SET = __TS__New(ReadonlySet, {BossID.BLUE_BABY, BossID.MEGA_SATAN})
local ALL_STAGE_11_BOSSES_SET = combineSets(nil, DARK_ROOM_BOSSES_SET, CHEST_BOSSES_SET)
local STAGE_11_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, DARK_ROOM_BOSSES_SET}, {StageType.WRATH_OF_THE_LAMB, CHEST_BOSSES_SET}})
local VOID_BOSSES_SET = __TS__New(ReadonlySet, {BossID.DELIRIUM})
local VOID_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, VOID_BOSSES_SET}})
--- Note that this does not include Ultra Famine, Ultra Pestilence, Ultra War, and Ultra Death.
local HOME_BOSSES_SET = __TS__New(ReadonlySet, {BossID.DOGMA, BossID.BEAST})
local HOME_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {{StageType.ORIGINAL, HOME_BOSSES_SET}})
____exports.STAGE_TO_STAGE_TYPE_TO_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
    {LevelStage.BASEMENT_1, BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.BASEMENT_2, BASEMENT_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.CAVES_1, CAVES_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.CAVES_2, CAVES_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.DEPTHS_1, DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.DEPTHS_2, DEPTHS_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.WOMB_1, WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.WOMB_2, WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.BLUE_WOMB, BLUE_WOMB_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.SHEOL_CATHEDRAL, STAGE_10_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.DARK_ROOM_CHEST, STAGE_11_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.VOID, VOID_STAGE_TYPE_TO_BOSS_SET_MAP},
    {LevelStage.HOME, HOME_STAGE_TYPE_TO_BOSS_SET_MAP}
})
____exports.STAGE_TO_COMBINED_BOSS_SET_MAP = __TS__New(ReadonlyMap, {
    {LevelStage.BASEMENT_1, ALL_BASEMENT_BOSSES_SET},
    {LevelStage.BASEMENT_2, ALL_BASEMENT_BOSSES_SET},
    {LevelStage.CAVES_1, ALL_CAVES_BOSSES_SET},
    {LevelStage.CAVES_2, ALL_CAVES_BOSSES_SET},
    {LevelStage.DEPTHS_1, ALL_DEPTHS_BOSSES_SET},
    {LevelStage.DEPTHS_2, ALL_DEPTHS_BOSSES_SET},
    {LevelStage.WOMB_1, ALL_WOMB_BOSSES_SET},
    {LevelStage.WOMB_2, ALL_WOMB_BOSSES_SET},
    {LevelStage.BLUE_WOMB, BLUE_WOMB_BOSSES_SET},
    {LevelStage.SHEOL_CATHEDRAL, ALL_STAGE_10_BOSSES_SET},
    {LevelStage.DARK_ROOM_CHEST, ALL_STAGE_11_BOSSES_SET},
    {LevelStage.VOID, VOID_BOSSES_SET},
    {LevelStage.HOME, HOME_BOSSES_SET}
})
____exports.ALL_BOSSES_SET = __TS__New(
    ReadonlySet,
    __TS__ArrayFilter(
        BOSS_IDS,
        function(____, bossID) return bossID ~= BossID.RAGLICH end
    )
)
____exports.ALL_BOSSES_EXCLUDING_STORY_BOSSES_SET = __TS__New(
    ReadonlySet,
    __TS__ArrayFilter(
        {__TS__Spread(____exports.ALL_BOSSES_SET)},
        function(____, bossID) return not isStoryBossID(nil, bossID) end
    )
)
return ____exports
