local ____lualib = require("lualib_bundle")
local Set = ____lualib.Set
local __TS__New = ____lualib.__TS__New
local __TS__ArrayFind = ____lualib.__TS__ArrayFind
local ____exports = {}
local getItemPoolJSON
local ____cachedEnumValues = require("cachedEnumValues")
local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
local itemPoolsJSON = require("data.itempools")
local ____types = require("functions.types")
local asCollectibleType = ____types.asCollectibleType
local parseIntSafe = ____types.parseIntSafe
local ____itemPoolTypeToItemPoolName = require("maps.itemPoolTypeToItemPoolName")
local ITEM_POOL_TYPE_TO_ITEM_POOL_NAME = ____itemPoolTypeToItemPoolName.ITEM_POOL_TYPE_TO_ITEM_POOL_NAME
function getItemPoolJSON(self, itemPoolType)
    local itemPoolName = ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType]
    local itemPoolsJSONArray = itemPoolsJSON.ItemPools.Pool
    return __TS__ArrayFind(
        itemPoolsJSONArray,
        function(____, itemPoolJSON) return itemPoolJSON["$"].Name == itemPoolName end
    )
end
____exports.ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET = (function()
    local itemPoolTypeToCollectibleTypes = {}
    for ____, itemPoolType in ipairs(ITEM_POOL_TYPE_VALUES) do
        local itemPoolJSON = getItemPoolJSON(nil, itemPoolType)
        if itemPoolJSON == nil then
            itemPoolTypeToCollectibleTypes[itemPoolType] = __TS__New(Set)
        else
            local collectibleTypesSet = __TS__New(Set)
            for ____, itemPoolJSONElement in ipairs(itemPoolJSON.Item) do
                local collectibleTypeInt = parseIntSafe(nil, itemPoolJSONElement["$"].Id)
                if collectibleTypeInt == nil then
                    error("Failed to parse a collectible type in the \"itempools.json\" file: " .. itemPoolJSONElement["$"].Id)
                end
                local collectibleType = asCollectibleType(nil, collectibleTypeInt)
                collectibleTypesSet:add(collectibleType)
            end
            itemPoolTypeToCollectibleTypes[itemPoolType] = collectibleTypesSet
        end
    end
    return itemPoolTypeToCollectibleTypes
end)(nil)
return ____exports
