#pragma once

#include "application/config/ConfigOwner.h"
#include "application/config/values/BasicValues.h"
#include "application/config/values/ColorValues.h"
#include "application/config/values/NumberValues.h"
#include "features/esp/dependencies/IEspSettings.h"

namespace ta::adapters::config
{
    class EspConfigAdapter final : public ta::application::config::ConfigOwner,
                                     public ta::features::esp::dependencies::IEspSettings
    {
    public:
        EspConfigAdapter();
        [[nodiscard]] ta::features::esp::EspSettingsSnapshot read() const override;

    private:
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> extracts_{*this, "extracts", false, "Extracts"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> extracts_color_{*this, "extracts_color", ta::application::config::ConfigColor{108.0f / 255.0f, 159.0f / 255.0f, 4.0f / 255.0f, 1.0f}, "Extract Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> transits_{*this, "transits", false, "Transits"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> transits_color_{*this, "transits_color", ta::application::config::ConfigColor{176.0f / 255.0f, 100.0f / 255.0f, 53.0f / 255.0f, 1.0f}, "Transit Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> pmc_{*this, "pmc", false, "pmc"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> pmc_color_{*this, "pmc_color", ta::application::config::ConfigColor{1.0f, 92.0f / 255.0f, 87.0f / 255.0f, 1.0f}, "pmc_color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> scav_{*this, "scav", false, "scav"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> scav_color_{*this, "scav_color", ta::application::config::ConfigColor{86.0f / 255.0f, 180.0f / 255.0f, 233.0f / 255.0f, 1.0f}, "scav_color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> normal_item_esp_{*this, "normal_item_esp", false, "Normal Items"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> normal_item_color_{*this, "normal_item_color", ta::application::config::ConfigColor{183.0f / 255.0f, 196.0f / 255.0f, 208.0f / 255.0f, 1.0f}, "Normal Item Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> normal_item_distance_{*this, "normal_item_distance", 20.f, 1.f, 500.f, "Normal Item Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> loot_min_distance_{*this, "loot_min_distance", 0.f, 0.f, 10.f, "Loot Min Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> wishlist_item_esp_{*this, "wishlist_item_esp", false, "Wishlist Items"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> wishlist_item_color_{*this, "wishlist_item_color", ta::application::config::ConfigColor{216.0f / 255.0f, 107.0f / 255.0f, 1.0f, 1.0f}, "Wishlist Item Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> wishlist_item_distance_{*this, "wishlist_item_distance", 200.f, 1.f, 500.f, "Wishlist Item Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> quest_item_esp_{*this, "quest_item_esp", false, "Quest Items"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> quest_item_color_{*this, "quest_item_color", ta::application::config::ConfigColor{1.0f, 224.0f / 255.0f, 102.0f / 255.0f, 1.0f}, "Quest Item Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> quest_item_distance_{*this, "quest_item_distance", 200.f, 1.f, 500.f, "Quest Item Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> corpse_esp_{*this, "corpse_esp", false, "Corpses"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> corpse_color_{*this, "corpse_color", ta::application::config::ConfigColor{154.0f / 255.0f, 143.0f / 255.0f, 175.0f / 255.0f, 1.0f}, "Corpse Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> corpse_distance_{*this, "corpse_distance", 20.f, 1.f, 500.f, "Corpse Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::CheckboxValue> container_esp_{*this, "container_esp", false, "Containers"};
        ta::application::config::RegisteredConfigValue<ta::application::config::ColorpickerValue> container_color_{*this, "container_color", ta::application::config::ConfigColor{82.0f / 255.0f, 199.0f / 255.0f, 165.0f / 255.0f, 1.0f}, "Container Color"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> container_distance_{*this, "container_distance", 20.f, 1.f, 500.f, "Container Distance"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> font_size_{*this, "font_size", 12, 8, 36, "Font Size"};

        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> local_position_interval_ms_{*this, "local_position_interval_ms", 50, 16, 200, "Local Position Refresh (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> player_scan_interval_ms_{*this, "player_scan_interval_ms", 100, 50, 500, "Player Scan (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> dynamic_loot_interval_ms_{*this, "dynamic_loot_interval_ms", 500, 200, 2000, "Dynamic Loot Scan (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> exfil_status_interval_ms_{*this, "exfil_status_interval_ms", 500, 200, 2000, "Exfil Status Refresh (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> static_discovery_interval_ms_{*this, "static_discovery_interval_ms", 5000, 1000, 15000, "Static Object Scan (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> wishlist_fallback_interval_ms_{*this, "wishlist_fallback_interval_ms", 3000, 1000, 10000, "Wishlist Fallback Refresh (ms)"};
        ta::application::config::RegisteredConfigValue<ta::application::config::FloatSliderValue> distance_hysteresis_percent_{*this, "distance_hysteresis_percent", 5.0f, 0.0f, 20.0f, "Distance Hysteresis (%)", 0.1f};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> missing_scans_before_removal_{*this, "missing_scans_before_removal", 2, 1, 5, "Missing Scans Before Removal"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> metadata_resolves_per_tick_{*this, "metadata_resolves_per_tick", 128, 16, 512, "Metadata Resolves Per Tick"};
        ta::application::config::RegisteredConfigValue<ta::application::config::IntSliderValue> metadata_time_budget_us_{*this, "metadata_time_budget_us", 1500, 500, 5000, "Metadata Time Budget (us)"};
    };
}
