package eu.kanade.tachiyomi.animeextension.all.missav

import eu.kanade.tachiyomi.animesource.model.AnimeFilter
import eu.kanade.tachiyomi.animesource.model.AnimeFilterList

abstract class SelectFilter(
    name: String,
    private val options: List<Pair<String, String>>,
) : AnimeFilter.Select<String>(
    name,
    options.map { it.first }.toTypedArray(),
) {
    val selected get() = options[state].second.takeUnless { state == 0 }
}

class SortFilter : SelectFilter(
    "Sort by",
    SORT,
) {
    companion object {
        val SORT = listOf(
            Pair("Release date", "released_at"),
            Pair("Recent update", "published_at"),
            Pair("Today views", "today_views"),
            Pair("Weekly views", "weekly_views"),
            Pair("Monthly views", "monthly_views"),
            Pair("Total views", "views"),
        )
    }
}

class GenreList : SelectFilter(
    "Genres",
    GENRES,
) {
    companion object {
        val GENRES = listOf(
            Pair("", ""),
            Pair("Uncensored Leak", "en/uncensored-leak"),
            Pair("Hd", "en/genres/Hd"),
            Pair("Exclusive", "en/genres/Exclusive"),
            Pair("Creampie", "en/genres/Creampie"),
            Pair("Big Breasts", "en/genres/Big%20Breasts"),
            Pair("Individual", "en/genres/Individual"),
            Pair("Wife", "en/genres/Wife"),
            Pair("Mature Woman", "en/genres/Mature%20Woman"),
            Pair("Ordinary Person", "en/genres/Ordinary%20Person"),
            Pair("Pretty Girl", "en/genres/Pretty%20Girl"),
            Pair("Ride", "en/genres/Ride"),
            Pair("Oral Sex", "en/genres/Oral%20Sex"),
            Pair("Orgy", "en/genres/Orgy"),
            Pair("Slim Pixelated", "en/genres/Slim%20Pixelated"),
            Pair("4 Hours Or More", "en/genres/4%20Hours%20Or%20More"),
            Pair("Slut", "en/genres/Slut"),
            Pair("Collection", "en/genres/Collection"),
            Pair("High School Girl", "en/genres/High%20School%20Girl"),
            Pair("Squirting", "en/genres/Squirting"),
            Pair("Fetish", "en/genres/Fetish"),
            Pair("Selfie", "en/genres/Selfie"),
            Pair("Tit Job", "en/genres/Tit%20Job"),
            Pair("Planning", "en/genres/Planning"),
            Pair("Incest", "en/genres/Incest"),
            Pair("Hit On Girls", "en/genres/Hit%20On%20Girls"),
            Pair("Sneak Shots", "en/genres/Sneak%20Shots"),
            Pair("Slim", "en/genres/Slim"),
            Pair("Bukkake", "en/genres/Bukkake"),
            Pair("Beautiful Breasts", "en/genres/Beautiful%20Breasts"),
            Pair("Masturbate", "en/genres/Masturbate"),
            Pair("Masturbation", "en/genres/Masturbation"),
            Pair("Restraint", "en/genres/Restraint"),
            Pair("Promiscuous", "en/genres/Promiscuous"),
            Pair("Lesbian", "en/genres/Lesbian"),
            Pair("Ntr", "en/genres/Ntr"),
            Pair("Sister", "en/genres/Sister"),
            Pair("Plot", "en/genres/Plot"),
            Pair("Cosplay", "en/genres/Cosplay"),
            Pair("Humiliation", "en/genres/Humiliation"),
            Pair("Documentary", "en/genres/Documentary"),
            Pair("Hot Girl", "en/genres/Hot%20Girl"),
            Pair("Ol", "en/genres/Ol"),
            Pair("Uniform", "en/genres/Uniform"),
            Pair("Fingering", "en/genres/Fingering"),
            Pair("Vibrator", "en/genres/Vibrator"),
            Pair("Adultery", "en/genres/Adultery"),
            Pair("Cunnilingus", "en/genres/Cunnilingus"),
            Pair("Delusion", "en/genres/Delusion"),
            Pair("Female College Student", "en/genres/Female%20College%20Student"),
            Pair("Sm", "en/genres/Sm"),
            Pair("Shame", "en/genres/Shame"),
            Pair("Anus", "en/genres/Anus"),
            Pair("Uniform", "en/genres/Uniform"),
            Pair("Petite", "en/genres/Petite"),
            Pair("Shaving", "en/genres/Shaving"),
            Pair("Subjective Perspective", "en/genres/Subjective%20Perspective"),
            Pair("Prostitute", "en/genres/Prostitute"),
            Pair("Various Occupations", "en/genres/Various%20Occupations"),
            Pair("Mother", "en/genres/Mother"),
            Pair("Vibrator", "en/genres/Vibrator"),
            Pair("Toy", "en/genres/Toy"),
            Pair("Promiscuity", "en/genres/Promiscuity"),
            Pair("Outdoor Exposure", "en/genres/Outdoor%20Exposure"),
            Pair("Butt Fetish", "en/genres/Butt%20Fetish"),
            Pair("Pantyhose", "en/genres/Pantyhose"),
            Pair("Debut", "en/genres/Debut"),
            Pair("Urinate", "en/genres/Urinate"),
            Pair("Dirty Talk", "en/genres/Dirty%20Talk"),
            Pair("Massage", "en/genres/Massage"),
            Pair("Underwear", "en/genres/Underwear"),
            Pair("Big Ass", "en/genres/Big%20Ass"),
            Pair("Forced Blowjob", "en/genres/Forced%20Blowjob"),
            Pair("Sailor Suit", "en/genres/Sailor%20Suit"),
            Pair("Swimsuit", "en/genres/Swimsuit"),
            Pair("Delivery Only", "en/genres/Delivery%20Only"),
            Pair("Female Teacher", "en/genres/Female%20Teacher"),
            Pair("Kimono", "en/genres/Kimono"),
            Pair("Swallow Sperm", "en/genres/Swallow%20Sperm"),
            Pair("69", "en/genres/69"),
            Pair("Small Breasts", "en/genres/Small%20Breasts"),
            Pair("Elder Sister", "en/genres/Elder%20Sister"),
            Pair("Young Wife", "en/genres/Young%20Wife"),
            Pair("Nurse", "en/genres/Nurse"),
            Pair("Massage Oil", "en/genres/Massage%20Oil"),
            Pair("Group Bukkake", "en/genres/Group%20Bukkake"),
            Pair("Tied Up", "en/genres/Tied%20Up"),
            Pair("Fat Girl", "en/genres/Fat%20Girl"),
            Pair("Rejuvenation Massage", "en/genres/Rejuvenation%20Massage"),
            Pair("Short Skirt", "en/genres/Short%20Skirt"),
            Pair("Ultra Slim Pixelated", "en/genres/Ultra%20Slim%20Pixelated"),
            Pair("Contribution", "en/genres/Contribution"),
            Pair("Nice Ass", "en/genres/Nice%20Ass"),
            Pair("Foot Fetish", "en/genres/Foot%20Fetish"),
            Pair("Full Hd (Fhd)", "en/genres/Full%20Hd%20%28Fhd%29"),
            Pair("Glasses Girl", "en/genres/Glasses%20Girl"),
            Pair("Kiss", "en/genres/Kiss"),
            Pair("4K", "en/genres/4K"),
            Pair("Close Up", "en/genres/Close%20Up"),
            Pair("Big Breasts", "en/genres/Big%20Breasts"),
            Pair("Tied Up", "en/genres/Tied%20Up"),
            Pair("Big Breast Fetish", "en/genres/Big%20Breast%20Fetish"),
            Pair("Swimsuit", "en/genres/Swimsuit"),
            Pair("Sportswear", "en/genres/Sportswear"),
            Pair("Virgin", "en/genres/Virgin"),
            Pair("Vibrating Egg", "en/genres/Vibrating%20Egg"),
            Pair("Aphrodisiac", "en/genres/Aphrodisiac"),
            Pair("Lesbian Kiss", "en/genres/Lesbian%20Kiss"),
            Pair("Mini Skirt", "en/genres/Mini%20Skirt"),
            Pair("White Skin", "en/genres/White%20Skin"),
            Pair("M Male", "en/genres/M%20Male"),
            Pair("Couple", "en/genres/Couple"),
            Pair("Hot Spring", "en/genres/Hot%20Spring"),
            Pair("Maid", "en/genres/Maid"),
            Pair("Face Ride", "en/genres/Face%20Ride"),
            Pair("Imprisonment", "en/genres/Imprisonment"),
            Pair("Footjob", "en/genres/Footjob"),
            Pair("Fighting", "en/genres/Fighting"),
            Pair("Tall Lady", "en/genres/Tall%20Lady"),
            Pair("Female Warrior", "en/genres/Female%20Warrior"),
            Pair("Artist", "en/genres/Artist"),
            Pair("Science Fiction", "en/genres/Science%20Fiction"),
            Pair("Mischief", "en/genres/Mischief"),
            Pair("Actress Collection", "en/genres/Actress%20Collection"),
            Pair("Married Woman", "en/genres/Married%20Woman"),
            Pair("Sweating", "en/genres/Sweating"),
            Pair("Black Male Actor", "en/genres/Black%20Male%20Actor"),
            Pair("Stepmother", "en/genres/Stepmother"),
            Pair("Petite", "en/genres/Petite"),
            Pair("Beautiful Legs", "en/genres/Beautiful%20Legs"),
            Pair("Private Teacher", "en/genres/Private%20Teacher"),
            Pair("Big Pennis", "en/genres/Big%20Pennis"),
            Pair("Super Breasts", "en/genres/Super%20Breasts"),
            Pair("Advertising Idol", "en/genres/Advertising%20Idol"),
            Pair("Torture", "en/genres/Torture"),
            Pair("Emmanuel", "en/genres/Emmanuel"),
            Pair("Anal Sex", "en/genres/Anal%20Sex"),
            Pair("Black Hair", "en/genres/Black%20Hair"),
            Pair("Beautiful Breasts", "en/genres/Beautiful%20Breasts"),
            Pair("Erotic Photo", "en/genres/Erotic%20Photo"),
            Pair("Widow", "en/genres/Widow"),
            Pair("Gym Suit", "en/genres/Gym%20Suit"),
            Pair("Cruel", "en/genres/Cruel"),
            Pair("Sexy", "en/genres/Sexy"),
            Pair("Car Sex", "en/genres/Car%20Sex"),
            Pair("Multiple Stories", "en/genres/Multiple%20Stories"),
            Pair("Campus Story", "en/genres/Campus%20Story"),
            Pair("3P, 4P", "en/genres/3P,%204P"),
            Pair("Transgender", "en/genres/Transgender"),
            Pair("Slim", "en/genres/Slim"),
            Pair("Female Doctor", "en/genres/Female%20Doctor"),
            Pair("In Love", "en/genres/In%20Love"),
            Pair("Fighter", "en/genres/Fighter"),
            Pair("Fantasy", "en/genres/Fantasy"),
            Pair("Pure", "en/genres/Pure"),
            Pair("Virgin", "en/genres/Virgin"),
            Pair("Instant Sex", "en/genres/Instant%20Sex"),
            Pair("Missy", "en/genres/Missy"),
            Pair("Enema", "en/genresenema"),
            Pair("Dance", "en/genres/Dance"),
            Pair("Feminine", "en/genres/Feminine"),
            Pair("Best, Omnibus", "en/genres/Best,%20Omnibus"),
            Pair("Whites", "en/genres/Whites"),
            Pair("Flight Attendant", "en/genres/Flight%20Attendant"),
            Pair("Harem", "en/genres/Harem"),
            Pair("Foreign Actress", "en/genres/Foreign%20Actress"),
            Pair("Physical Education", "en/genres/Physical%20Education"),
            Pair("Bronze", "en/genres/Bronze"),
            Pair("Female Investigator", "en/genres/Female%20Investigator"),
            Pair("Transsexuals", "en/genres/Transsexuals"),
            Pair("Model", "en/genres/Model"),
            Pair("Baby Face", "en/genres/Baby%20Face"),
            Pair("Doggy Style", "en/genres/Doggy%20Style"),
            Pair("Shaving", "en/genres/Shaving"),
            Pair("Bitch", "en/genres/Bitch"),
            Pair("Bloomers", "en/genres/Bloomers"),
            Pair("One Piece Dress", "en/genres/One%20Piece%20Dress"),
            Pair("Knee Socks", "en/genres/Knee%20Socks"),
            Pair("Thanks Offering", "en/genres/Thanks%20Offering"),
            Pair("Cute Little Boy", "en/genres/Cute%20Little%20Boy"),
            Pair("Delivery-Only Amateur", "en/genres/Delivery-Only%20Amateur"),
            Pair("Other", "en/genres/Other"),
            Pair("Bubble Bath", "en/genres/Bubble%20Bath"),
            Pair("Tickle", "en/genres/Tickle"),
            Pair("High School Girl", "en/genres/High%20School%20Girl"),
            Pair("Sister", "en/genres/Sister"),
            Pair("Extreme Orgasm", "en/genres/Extreme%20Orgasm"),
            Pair("Breast Milk", "en/genres/Breast%20Milk"),
            Pair("M Female", "en/genres/M%20Female"),
            Pair("Pregnant Woman", "en/genres/Pregnant%20Woman"),
            Pair("Indie", "en/genres/Indie"),
            Pair("Homosexual", "en/genres/Homosexual"),
            Pair("Vr", "en/genres/Vr"),
            Pair("Drink Urine", "en/genres/Drink%20Urine"),
            Pair("Racing Girl", "en/genres/Racing%20Girl"),
            Pair("Femdom Slave", "en/genres/Femdom%20Slave"),
            Pair("Heaven Tv", "en/genres/Heaven%20Tv"),
            Pair("Secretary", "en/genres/Secretary"),
            Pair("Insult", "en/genres/Insult"),
            Pair("Hot Girl", "en/genres/Hot%20Girl"),
            Pair("Small Breasts", "en/genres/Small%20Breasts"),
            Pair("Rape", "en/genres/Rape"),
            Pair("Thirty", "en/genres/Thirty"),
            Pair("Lolita", "en/genres/Lolita"),
            Pair("Female Boss", "en/genres/Female%20Boss"),
            Pair("Foreign Object Penetration", "en/genres/Foreign%20Object%20Penetration"),
            Pair("Hit On Boys", "en/genres/Hit%20On%20Boys"),
            Pair("Stool", "en/genres/Stool"),
            Pair("Hysteroscope", "en/genres/Hysteroscope"),
            Pair("Young Wife", "en/genres/Young%20Wife"),
            Pair("Defecation", "en/genres/Defecation"),
            Pair("Gang Rape", "en/genres/Gang%20Rape"),
            Pair("Anchorwoman", "en/genres/Anchorwoman"),
            Pair("High Quality Vr", "en/genres/High%20Quality%20Vr"),
            Pair("Similar", "en/genres/Similar"),
            Pair("Transsexuals", "en/genres/Transsexuals"),
            Pair("Catwoman", "en/genres/Catwoman"),
            Pair("Bathtub", "en/genres/Bathtub"),
            Pair("Dildo", "en/genres/Dildo"),
            Pair("Limited Time", "en/genres/Limited%20Time"),
            Pair("Fist", "en/genres/Fist"),
            Pair("Dating", "en/genres/Dating"),
            Pair("Cuckold", "en/genres/Cuckold"),
            Pair("Original", "en/genres/Original"),
            Pair("Lecturer", "en/genres/Lecturer"),
            Pair("Esthetic Massage", "en/genres/Esthetic%20Massage"),
            Pair("Childhood", "en/genres/Childhood"),
            Pair("Uterus", "en/genres/Uterus"),
            Pair("Pregnant", "en/genres/Pregnant"),
            Pair("Entertainer", "en/genresentertainer"),
            Pair("Long Hair", "en/genres/Long%20Hair"),
            Pair("Petite", "en/genres/Petite"),
            Pair("First Shot", "en/genres/First%20Shot"),
            Pair("Muscle", "en/genres/Muscle"),
            Pair("Outdoors", "en/genres/Outdoors"),
            Pair("Naked Apron", "en/genres/Naked%20Apron"),
            Pair("Male Squirting", "en/genres/Male%20Squirting"),
            Pair("Hotel Owner", "en/genres/Hotel%20Owner"),
            Pair("Molester", "en/genres/Molester"),
            Pair("Artist", "en/genres/Artist"),
            Pair("Bunny Girl", "en/genres/Bunny%20Girl"),
            Pair("Travel", "en/genres/Travel"),
            Pair("Racing Girl", "en/genres/Racing%20Girl"),
            Pair("Asian Actress", "en/genres/Asian%20Actress"),
            Pair("Tentacle", "en/genres/Tentacle"),
            Pair("Proud Pussy", "en/genres/Proud%20Pussy"),
            Pair("Subordinate Or Colleague", "en/genres/Subordinate%20Or%20Colleague"),
            Pair("With Bonus Video Only For Mgs", "en/genres/With%20Bonus%20Video%20Only%20For%20Mgs"),
            Pair("Business Clothing", "en/genres/Business%20Clothing"),
            Pair("Premature Ejaculation", "en/genres/Premature%20Ejaculation"),
            Pair("Friend", "en/genres/Friend"),
            Pair("Shame And Humiliation", "en/genres/Shame%20And%20Humiliation"),
            Pair("Big Breasts", "en/genres/Big%20Breasts"),
            Pair("Short Hair", "en/genres/Short%20Hair"),
            Pair("Dildo", "en/genres/Dildo"),
            Pair("Limited Time", "en/genres/Limited%20Time"),
            Pair("Fist", "en/genres/Fist"),
            Pair("Dating", "en/genres/Dating"),
            Pair("Cuckold", "en/genres/Cuckold"),
            Pair("Original", "en/genres/Original"),
            Pair("Lecturer", "en/genres/Lecturer"),
            Pair("Esthetic Massage", "en/genres/Esthetic%20Massage"),
            Pair("Childhood", "en/genres/Childhood"),
            Pair("Uterus", "en/genres/Uterus"),
            Pair("Pregnant", "en/genres/Pregnant"),
            Pair("Entertainer", "en/genresentertainer"),
            Pair("Long Hair", "en/genres/Long%20Hair"),
            Pair("Petite", "en/genres/Petite"),
            Pair("First Shot", "en/genres/First%20Shot"),
            Pair("Muscle", "en/genres/Muscle"),
            Pair("Outdoors", "en/genres/Outdoors"),
            Pair("Naked Apron", "en/genres/Naked%20Apron"),
            Pair("Male Squirting", "en/genres/Male%20Squirting"),
            Pair("Hotel Owner", "en/genres/Hotel%20Owner"),
            Pair("Molester", "en/genres/Molester"),
            Pair("Artist", "en/genres/Artist"),
            Pair("Bunny Girl", "en/genres/Bunny%20Girl"),
            Pair("Travel", "en/genres/Travel"),
            Pair("Racing Girl", "en/genres/Racing%20Girl"),
            Pair("Asian Actress", "en/genres/Asian%20Actress"),
            Pair("Tentacle", "en/genres/Tentacle"),
            Pair("Proud Pussy", "en/genres/Proud%20Pussy"),
            Pair("Subordinate Or Colleague", "en/genres/Subordinate%20Or%20Colleague"),
            Pair("With Bonus Video Only For Mgs", "en/genres/With%20Bonus%20Video%20Only%20For%20Mgs"),
            Pair("Business Clothing", "en/genres/Business%20Clothing"),
            Pair("Premature Ejaculation", "en/genres/Premature%20Ejaculation"),
            Pair("Friend", "en/genres/Friend"),
            Pair("Shame And Humiliation", "en/genres/Shame%20And%20Humiliation"),
            Pair("Big Breasts", "en/genres/Big%20Breasts"),
            Pair("Short Hair", "en/genres/Short%20Hair"),
            Pair("Waitress", "en/genres/Waitress"),
            Pair("Clinic", "en/genres/Clinic"),
            Pair("Exposure", "en/genres/Exposure"),
            Pair("Kimono / Yukata", "en/genres/Kimono%20/%20Yukata"),
            Pair("Lewd Nasty Lady", "en/genres/Lewd%20Nasty%20Lady"),
            Pair("Bubble Socks", "en/genres/Bubble%20Socks"),
            Pair("Fantasy", "en/genres/Fantasy"),
            Pair("Idol", "en/genres/Idol"),
            Pair("Time Stops", "en/genres/Time%20Stops"),
        )
    }
}

fun getFilters() = AnimeFilterList(
    SortFilter(),
    GenreList(),
    AnimeFilter.Separator(),
    AnimeFilter.Header("Genre filters ignored with text search!!"),
)
