package fuck.andes.config

internal enum class PowerAssistantTarget(
    val persistedValue: String,
) {
    ETA("eta"),
    OEM("oem"),
    ;

    companion object {
        fun resolve(
            persistedValue: String?,
            legacyPowerKeyTakeover: Boolean,
        ): PowerAssistantTarget = entries.firstOrNull {
            it.persistedValue == persistedValue
        } ?: if (legacyPowerKeyTakeover) {
            // 历史版本"电源键接管"即代表启用本项目自带助手；Gemini 入口已移除后归到 Eta。
            ETA
        } else {
            OEM
        }
    }
}
