local ____lualib = require("lualib_bundle")
local Map = ____lualib.Map
local __TS__New = ____lualib.__TS__New
local __TS__Class = ____lualib.__TS__Class
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
local __TS__Iterator = ____lualib.__TS__Iterator
local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
local ____exports = {}
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
local ____decorators = require("decorators")
local Exported = ____decorators.Exported
local ____input = require("functions.input")
local MOVEMENT_BUTTON_ACTIONS_SET = ____input.MOVEMENT_BUTTON_ACTIONS_SET
local SHOOTING_BUTTON_ACTIONS_SET = ____input.SHOOTING_BUTTON_ACTIONS_SET
local ____ReadonlySet = require("types.ReadonlySet")
local ReadonlySet = ____ReadonlySet.ReadonlySet
local ____Feature = require("classes.private.Feature")
local Feature = ____Feature.Feature
local v = {run = {
    __ignoreGlowingHourGlass = true,
    disableInputs = __TS__New(Map),
    enableAllInputsWithBlacklistMap = __TS__New(Map),
    disableAllInputsWithWhitelistMap = __TS__New(Map)
}}
____exports.DisableInputs = __TS__Class()
local DisableInputs = ____exports.DisableInputs
DisableInputs.name = "DisableInputs"
__TS__ClassExtends(DisableInputs, Feature)
function DisableInputs.prototype.____constructor(self)
    Feature.prototype.____constructor(self)
    self.v = v
    self.isActionPressed = function(____, _entity, _inputHook, buttonAction) return self:getReturnValue(buttonAction, true) end
    self.isActionTriggered = function(____, _entity, _inputHook, buttonAction) return self:getReturnValue(buttonAction, true) end
    self.getActionValue = function(____, _entity, _inputHook, buttonAction) return self:getReturnValue(buttonAction, false) end
    self.callbacksUsed = {{ModCallback.INPUT_ACTION, self.isActionPressed, {InputHook.IS_ACTION_PRESSED}}, {ModCallback.INPUT_ACTION, self.isActionTriggered, {InputHook.IS_ACTION_TRIGGERED}}, {ModCallback.INPUT_ACTION, self.getActionValue, {InputHook.GET_ACTION_VALUE}}}
end
function DisableInputs.prototype.getReturnValue(self, buttonAction, booleanCallback)
    local ____booleanCallback_0
    if booleanCallback then
        ____booleanCallback_0 = false
    else
        ____booleanCallback_0 = 0
    end
    local disableValue = ____booleanCallback_0
    for ____, blacklist in __TS__Iterator(v.run.disableInputs:values()) do
        if blacklist:has(buttonAction) then
            return disableValue
        end
    end
    for ____, whitelist in __TS__Iterator(v.run.disableAllInputsWithWhitelistMap:values()) do
        if not whitelist:has(buttonAction) then
            return disableValue
        end
    end
    for ____, blacklist in __TS__Iterator(v.run.enableAllInputsWithBlacklistMap:values()) do
        if blacklist:has(buttonAction) then
            return disableValue
        end
    end
    return nil
end
function DisableInputs.prototype.areInputsEnabled(self)
    return v.run.disableInputs.size == 0 and v.run.enableAllInputsWithBlacklistMap.size == 0 and v.run.disableAllInputsWithWhitelistMap.size == 0
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "areInputsEnabled", true)
function DisableInputs.prototype.enableAllInputs(self, key)
    v.run.disableAllInputsWithWhitelistMap:delete(key)
    v.run.enableAllInputsWithBlacklistMap:delete(key)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "enableAllInputs", true)
function DisableInputs.prototype.disableInputs(self, key, ...)
    local buttonActions = {...}
    local buttonActionsSet = __TS__New(ReadonlySet, buttonActions)
    v.run.disableInputs:set(key, buttonActionsSet)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableInputs", true)
function DisableInputs.prototype.disableAllInputs(self, key)
    v.run.disableAllInputsWithWhitelistMap:set(
        key,
        __TS__New(ReadonlySet)
    )
    v.run.enableAllInputsWithBlacklistMap:delete(key)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableAllInputs", true)
function DisableInputs.prototype.enableAllInputsExceptFor(self, key, blacklist)
    v.run.disableAllInputsWithWhitelistMap:delete(key)
    v.run.enableAllInputsWithBlacklistMap:set(key, blacklist)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "enableAllInputsExceptFor", true)
function DisableInputs.prototype.disableAllInputsExceptFor(self, key, whitelist)
    v.run.disableAllInputsWithWhitelistMap:set(key, whitelist)
    v.run.enableAllInputsWithBlacklistMap:delete(key)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableAllInputsExceptFor", true)
function DisableInputs.prototype.disableMovementInputs(self, key)
    self:enableAllInputsExceptFor(key, MOVEMENT_BUTTON_ACTIONS_SET)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableMovementInputs", true)
function DisableInputs.prototype.disableShootingInputs(self, key)
    self:enableAllInputsExceptFor(key, SHOOTING_BUTTON_ACTIONS_SET)
end
__TS__DecorateLegacy({Exported}, DisableInputs.prototype, "disableShootingInputs", true)
return ____exports
