import re

from .base import AbstractActionSet

class PythonActionSet(AbstractActionSet):
    def describe(self, with_long_description: bool = True, with_examples: bool = True):
        """
        Returns a textual description of this action space.
        """
        description = f"""
Each action consists of executable Python code (python>=3.10) that uses the Playwright library (playwright==1.32)
to interact with the current webpage and the browser context. The currently active webpage is accessible via the
global variable `page`. A function `send_message_to_user(text)` is also accessible and can be used to send a
message to the user, as well as a function `report_infeasible_instructions(reason)` to notify the user when their
instructions are infeasible."""
        if with_long_description:
            description += f"""
The browser context is in `page.context`, and all open webpages (tabs and popups)
are in `page.context.pages`. Here is is an example of a valid action:
```
frame = page.frame_locator(".result-frame")
button = frame.get_by_text("Submit")
button.click()
```
Here is another example:
```
frame = page.get_by_test_id("a").frame_locator(":scope")
frame.get_by_test_id("a776").click()
```
Note that Playwright's `get_by_test_id()` method is configured to use the `bid` attribute to locate HTML elements,
instead of the default `data-testid`. Also, Playwright's locators can not traverse iframes, so you have to locate
parent iframes first in order to locate an element in an iframe. The `bid` attribute contains all the information
required to recursively locate an element. For example, an element with `bid="ac2"` can be retrieved as follows:
```
frame = page.get_by_test_id("a").frame_locator(":scope")
frame = frame.get_by_test_id("ac").frame_locator(":scope")
elem = frame.get_by_test_id("ac2")
```
"""
        else:
            description += f"""\

"""
        if with_examples:
            description += f"""\
Here are other examples of valid actions:
```
page = page.context.new_page()
page.goto("https://www.wikipedia.org/")
```
```
page.get_by_label("Birth date").fill("2020-02-02")
page.get_by_role("link", name="Get started").click()
```
```
page.get_by_label('I agree to the terms above').check()
```
```
page.locator('#area').fill('Hello World!')
```
```
page.get_by_role("textbox").press("Control+ArrowRight")
```
```
send_message_to_user("There are 7 items to choose from.")
```
```
report_infeasible_instructions("I cannot follow these instructions because there is no email field in this form.")
```
"""

        return description

    def example_action(self, abstract: bool) -> str:
        """
        Returns an example action as a string.
        """
        if abstract:
            return """\
One single bloc of Python code. Do not include any explanation, only valid Python code."""
        else:
            return """\
frame = page.get_by_test_id("b").frame_locator(":scope")
frame = page.get_by_test_id("ba").frame_locator(":scope")
frame.get_by_test_id("ba2").fill("Hello world!")
frame.get_by_test_id("ba3").click()
"""

    def to_python_code(self, action):
        """
        Converts the given code action string to browsergym-compatible playwright code.

        Args:
            action: the code action to parse.

        Returns:
            Executable playwright code that performs the action in a browsergym environment.
        """

        python_code = ""

        # extract markdown-style code snippets if detected
        pattern = re.compile(r"```(?:python)?\n(?P<code>[\s\S]*?)```")
        if pattern.match(action):
            python_code += "\n".join([match.group("code") for match in pattern.finditer(action)])
        # otherwise just use the code action as is
        else:
            python_code += action

        # return the produced playwright code
        return python_code


describe

import re

from .base import AbstractActionSet

class PythonActionSet(AbstractActionSet):
    def describe(self, with_long_description: bool = True, with_examples: bool = True):
        """
        Returns a textual description of this action space.
        """
        description = f"""
Each action consists of executable Python code (python>=3.10) that uses the Playwright library (playwright==1.32)
to interact with the current webpage and the browser context. The currently active webpage is accessible via the
global variable `page`. A function `send_message_to_user(text)` is also accessible and can be used to send a
message to the user, as well as a function `report_infeasible_instructions(reason)` to notify the user when their
instructions are infeasible."""
        if with_long_description:
            description += f"""
The browser context is in `page.context`, and all open webpages (tabs and popups)
are in `page.context.pages`. Here is is an example of a valid action:
```
frame = page.frame_locator(".result-frame")
button = frame.get_by_text("Submit")
button.click()
```
Here is another example:
```
frame = page.get_by_test_id("a").frame_locator(":scope")
frame.get_by_test_id("a776").click()
```
Note that Playwright's `get_by_test_id()` method is configured to use the `bid` attribute to locate HTML elements,
instead of the default `data-testid`. Also, Playwright's locators can not traverse iframes, so you have to locate
parent iframes first in order to locate an element in an iframe. The `bid` attribute contains all the information
required to recursively locate an element. For example, an element with `bid="ac2"` can be retrieved as follows:
```
frame = page.get_by_test_id("a").frame_locator(":scope")
frame = frame.get_by_test_id("ac").frame_locator(":scope")
elem = frame.get_by_test_id("ac2")
```
"""
        else:
            description += f"""\

"""
        if with_examples:
            description += f"""\
Here are other examples of valid actions:
```
page = page.context.new_page()
page.goto("https://www.wikipedia.org/")
```
```
page.get_by_label("Birth date").fill("2020-02-02")
page.get_by_role("link", name="Get started").click()
```
```
page.get_by_label('I agree to the terms above').check()
```
```
page.locator('#area').fill('Hello World!')
```
```
page.get_by_role("textbox").press("Control+ArrowRight")
```
```
send_message_to_user("There are 7 items to choose from.")
```
```
report_infeasible_instructions("I cannot follow these instructions because there is no email field in this form.")
```
"""

        return description

    def example_action(self, abstract: bool) -> str:
        """
        Returns an example action as a string.
        """
        if abstract:
            return """\
One single bloc of Python code. Do not include any explanation, only valid Python code."""
        else:
            return """\
frame = page.get_by_test_id("b").frame_locator(":scope")
frame = page.get_by_test_id("ba").frame_locator(":scope")
frame.get_by_test_id("ba2").fill("Hello world!")
frame.get_by_test_id("ba3").click()
"""

    def to_python_code(self, action):
        """
        Converts the given code action string to browsergym-compatible playwright code.


```
```
page.get_by_label('I agree to the terms above').check()
```
```
page.locator('#area').fill('Hello World!')
```
```
page.get_by_role("textbox").press("Control+ArrowRight")
```
```
send_message_to_user("There are 7 items to choose from.")
```
```
report_infeasible_instructions("I cannot follow these instructions because there is no email field in this form.")
```
"""

        return description

    def example_action(self, abstract: bool) -> str:
        """
        Returns an example action as a string.
        """
        if abstract:
            return """\
One single bloc of Python code. Do not include any explanation, only valid Python code."""
        else:
            return """\
frame = page.get_by_test_id("b").frame_locator(":scope")
frame = page.get_by_test_id("ba").frame_locator(":scope")
frame.get_by_test_id("ba2").fill("Hello world!")
frame.get_by_test_id("ba3").click()
"""

    def to_python_code(self, action):
        """
        Converts the given code action string to browsergym-compatible playwright code.

        Args:
            action: the code action to parse.

        Returns:
            Executable playwright code that performs the action in a browsergym environment.
        """

        python_code = ""

        # extract markdown-style code snippets if detected
        pattern = re.compile(r"```(?:python)?\n(?P<code>[\s\S]*?)```")
        if pattern.match(action):
            python_code += "\n".join([match.group("code") for match in pattern.finditer(action)])
        # otherwise just use the code action as is
        else:


```
"""

        return description

    def example_action(self, abstract: bool) -> str:
        """
        Returns an example action as a string.
        """
        if abstract:
            return """\
One single bloc of Python code. Do not include any explanation, only valid Python code."""
        else:
            return """\
frame = page.get_by_test_id("b").frame_locator(":scope")
frame = page.get_by_test_id("ba").frame_locator(":scope")
frame.get_by_test_id("ba2").fill("Hello world!")
frame.get_by_test_id("ba3").click()
"""

    def to_python_code(self, action):
        """
        Converts the given code action string to browsergym-compatible playwright code.

        Args:
            action: the code action to parse.

        Returns:
            Executable playwright code that performs the action in a browsergym environment.
        """

        python_code = ""

        # extract markdown-style code snippets if detected
        pattern = re.compile(r"```(?:python)?\n(?P<code>[\s\S]*?)```")
        if pattern.match(action):
            python_code += "\n".join([match.group("code") for match in pattern.finditer(action)])
        # otherwise just use the code action as is
        else:
            python_code += action

        # return the produced playwright code
        return python_code


import os
from typing import Optional, Tuple

import playwright.sync_api
from browsergym.core.task import AbstractBrowserTask

class AbstractMiniwobTask(AbstractBrowserTask):
    """
    Abstract class for all Miniwob++ tasks

    """

    # gym metadata (default value, can be overloaded per task)
    nondeterministic: bool = False

    @classmethod
    def get_task_id(cls):
        return f"miniwob.{cls.subdomain}"

    def __init__(
        self,
        seed: int,
        base_url: Optional[str] = None,
        episode_max_time: int = 1000000,
        remove_human_display: bool = True,
    ) -> None:
        """
        Args:
            seed: random seed.
            base_url: str (optional), the base Miniwob URL where the task's HTML file is to be found. If not provided, the MINIWOB_URL environment variable will be used.
            episode_max_time: int, episode max time in milliseconds. Default: 1000000 ms.
            remove_human_display: bool, whether or not to remove the human display (goal, time left, last reward etc.) from the DOM. Default: True.

        """
        super().__init__(seed)

        # Screenshot is scaled for this banchmark see `_bgym_scale_factor`
        # Keeping this aspect ratio and size works well with claude-3.5 so far.
        # But may not be optimal for other VLMs.
        self.viewport = {"width": 332, "height": 214}
        self.slow_mo = 100  # ms
        self.timeout = 5000  # ms

        assert episode_max_time > 0

        # if not provided, try to get Miniwob URL from environment variable
        if base_url is None:
            if "MINIWOB_URL" in os.environ:
                base_url = os.environ["MINIWOB_URL"]
            else:
                raise ValueError(
                    f"Please provide a Miniwob base URL (or setup one using the environment variable MINIWOB_URL)."
                )

        self.url = base_url + self.subdomain + ".html"
        self.episode_max_time = episode_max_time
        self.remove_human_display = remove_human_display

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        self.page = page

        # navigate to the task's url
        self.page.goto(self.url)

        # remove human display if requested (goal, time left, last reward etc.)
        if self.remove_human_display:
            self.page.evaluate(  # if error : core is not defined, make sure you started the miniwob http server at the right place miniwob-plusplus/miniwob/html
                r"""
let __display_ids = ['reward-display', 'click-canvas', 'sync-task-cover'];
let __display_divs = {};
let __query_div_hidden_copy = null;

removeDisplay = function() {
  core.clearTimer();
  document.body.removeEventListener('click', core.canvasDrawClick);

  __query_div_hidden_copy = document.getElementById('query').cloneNode(true);
  document.getElementById('query').innerHTML = '';

  for (i in __display_ids) {
    elem_id = __display_ids[i];
    elem = document.getElementById(elem_id);
    // remove elem from the document
    elem.remove();
    // but keep it stored somewhere to bring back later
    __display_divs[elem_id] = elem;
  }
};

bringBackDisplay = function() {
  document.getElementById('query').innerHTML = __query_div_hidden_copy.innerHTML;
  for (var elem_id in __display_divs){
    document.body.appendChild(__display_divs[elem_id]);
  }
  core.createDisplay();
};

core.endEpisode_legacy = core.endEpisode;
core.startEpisodeReal_legacy = core.startEpisodeReal;
core.getUtterance_legacy = core.getUtterance;

core.getUtterance = function () {
  bringBackDisplay();
  utterance = core.getUtterance_legacy();
  removeDisplay();
  return utterance;
};

core.endEpisode = function(reward, time_proportional, reason){
  bringBackDisplay();
  core.endEpisode_legacy(reward, time_proportional, reason);
  removeDisplay();
};

core.startEpisodeReal = function() {
  bringBackDisplay();
  core.startEpisodeReal_legacy();
  removeDisplay();
};

removeDisplay();
"""
            )

        # start the task
        self.page.evaluate(
            r"""
Math.seedrandom({seed});
core.EPISODE_MAX_TIME = {episode_max_time};
core.startEpisodeReal();
""".format(
                seed=self.random.randint(0, 1000000),
                episode_max_time=self.episode_max_time,
            )
        )

        # wait for the Miniwob task to have status ready
        self.page.wait_for_function(r"""() => WOB_TASK_READY""")

        # Zoom in miniwob. Helps visual agents have more precision
        # Reducing viewport size (smaller screenshot) leads to some VLM loosing
        # their ability to have good coordinate mapping e.g.: claude-3.5
        self.page._bgym_scale_factor = 1.5  # default zoom factor
        return self._get_goal(), self._get_info()

    def teardown(self) -> None:
        pass  # nothing to clean up

    def _get_goal(self) -> str:
        response = self.page.evaluate(r"""() => core.getUtterance()""")
        if isinstance(response, dict):
            goal = response["utterance"]
        else:
            goal = response
        return goal

    def _get_info(self) -> dict:
        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,
        ) = self.page.evaluate(
            r"""() => [WOB_REWARD_GLOBAL, WOB_RAW_REWARD_GLOBAL, WOB_REWARD_REASON, WOB_DONE_GLOBAL, WOB_EPISODE_ID, WOB_TASK_READY]"""
        )
        info = {
            "REWARD_GLOBAL": REWARD_GLOBAL,
            "RAW_REWARD_GLOBAL": RAW_REWARD_GLOBAL,
            "REWARD_REASON": REWARD_REASON,
            "DONE_GLOBAL": DONE_GLOBAL,
            "EPISODE_ID": EPISODE_ID,
            "TASK_READY": TASK_READY,
        }
        return info

    def validate(
        self, page: playwright.sync_api.Page, chat_messages: list[str]
    ) -> Tuple[float, bool, str, dict]:
        if page != self.page:
            return 0, True, "", {"error": "invalid page, terminating task"}
        if page.url != self.url:
            return 0, True, "", {"error": "invalid url, terminating task"}

        info = self._get_info()
        reward = float(info["RAW_REWARD_GLOBAL"] > 0)  # TODO: shouldn't it be 0.5?
        done = info["DONE_GLOBAL"]
        msg = ""
        return reward, done, msg, info


import os
from typing import Optional, Tuple

import playwright.sync_api
from browsergym.core.task import AbstractBrowserTask

class AbstractMiniwobTask(AbstractBrowserTask):
    """
    Abstract class for all Miniwob++ tasks

    """

    # gym metadata (default value, can be overloaded per task)
    nondeterministic: bool = False

    @classmethod
    def get_task_id(cls):
        return f"miniwob.{cls.subdomain}"

    def __init__(
        self,
        seed: int,
        base_url: Optional[str] = None,
        episode_max_time: int = 1000000,
        remove_human_display: bool = True,
    ) -> None:
        """
        Args:
            seed: random seed.
            base_url: str (optional), the base Miniwob URL where the task's HTML file is to be found. If not provided, the MINIWOB_URL environment variable will be used.
            episode_max_time: int, episode max time in milliseconds. Default: 1000000 ms.
            remove_human_display: bool, whether or not to remove the human display (goal, time left, last reward etc.) from the DOM. Default: True.

        """
        super().__init__(seed)

        # Screenshot is scaled for this banchmark see `_bgym_scale_factor`
        # Keeping this aspect ratio and size works well with claude-3.5 so far.


import os
from typing import Optional, Tuple

import playwright.sync_api
from browsergym.core.task import AbstractBrowserTask

class AbstractMiniwobTask(AbstractBrowserTask):
    """
    Abstract class for all Miniwob++ tasks

    """

    # gym metadata (default value, can be overloaded per task)
    nondeterministic: bool = False

    @classmethod
    def get_task_id(cls):
        return f"miniwob.{cls.subdomain}"

    def __init__(
        self,
        seed: int,
        base_url: Optional[str] = None,
        episode_max_time: int = 1000000,
        remove_human_display: bool = True,
    ) -> None:
        """
        Args:
            seed: random seed.
            base_url: str (optional), the base Miniwob URL where the task's HTML file is to be found. If not provided, the MINIWOB_URL environment variable will be used.
            episode_max_time: int, episode max time in milliseconds. Default: 1000000 ms.
            remove_human_display: bool, whether or not to remove the human display (goal, time left, last reward etc.) from the DOM. Default: True.

        """
        super().__init__(seed)

        # Screenshot is scaled for this banchmark see `_bgym_scale_factor`
        # Keeping this aspect ratio and size works well with claude-3.5 so far.
        # But may not be optimal for other VLMs.
        self.viewport = {"width": 332, "height": 214}
        self.slow_mo = 100  # ms
        self.timeout = 5000  # ms

        assert episode_max_time > 0

        # if not provided, try to get Miniwob URL from environment variable
        if base_url is None:
            if "MINIWOB_URL" in os.environ:
                base_url = os.environ["MINIWOB_URL"]
            else:
                raise ValueError(
                    f"Please provide a Miniwob base URL (or setup one using the environment variable MINIWOB_URL)."
                )

        self.url = base_url + self.subdomain + ".html"
        self.episode_max_time = episode_max_time
        self.remove_human_display = remove_human_display

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        self.page = page

        # navigate to the task's url
        self.page.goto(self.url)

        # remove human display if requested (goal, time left, last reward etc.)
        if self.remove_human_display:
            self.page.evaluate(  # if error : core is not defined, make sure you started the miniwob http server at the right place miniwob-plusplus/miniwob/html
                r"""
let __display_ids = ['reward-display', 'click-canvas', 'sync-task-cover'];
let __display_divs = {};
let __query_div_hidden_copy = null;

removeDisplay = function() {
  core.clearTimer();
  document.body.removeEventListener('click', core.canvasDrawClick);

  __query_div_hidden_copy = document.getElementById('query').cloneNode(true);


setup

        # But may not be optimal for other VLMs.
        self.viewport = {"width": 332, "height": 214}
        self.slow_mo = 100  # ms
        self.timeout = 5000  # ms

        assert episode_max_time > 0

        # if not provided, try to get Miniwob URL from environment variable
        if base_url is None:
            if "MINIWOB_URL" in os.environ:
                base_url = os.environ["MINIWOB_URL"]
            else:
                raise ValueError(
                    f"Please provide a Miniwob base URL (or setup one using the environment variable MINIWOB_URL)."
                )

        self.url = base_url + self.subdomain + ".html"
        self.episode_max_time = episode_max_time
        self.remove_human_display = remove_human_display

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        self.page = page

        # navigate to the task's url
        self.page.goto(self.url)

        # remove human display if requested (goal, time left, last reward etc.)
        if self.remove_human_display:
            self.page.evaluate(  # if error : core is not defined, make sure you started the miniwob http server at the right place miniwob-plusplus/miniwob/html
                r"""
let __display_ids = ['reward-display', 'click-canvas', 'sync-task-cover'];
let __display_divs = {};
let __query_div_hidden_copy = null;

removeDisplay = function() {
  core.clearTimer();
  document.body.removeEventListener('click', core.canvasDrawClick);

  __query_div_hidden_copy = document.getElementById('query').cloneNode(true);
  document.getElementById('query').innerHTML = '';

  for (i in __display_ids) {
    elem_id = __display_ids[i];
    elem = document.getElementById(elem_id);
    // remove elem from the document
    elem.remove();
    // but keep it stored somewhere to bring back later
    __display_divs[elem_id] = elem;
  }
};

bringBackDisplay = function() {
  document.getElementById('query').innerHTML = __query_div_hidden_copy.innerHTML;
  for (var elem_id in __display_divs){
    document.body.appendChild(__display_divs[elem_id]);
  }
  core.createDisplay();
};

core.endEpisode_legacy = core.endEpisode;
core.startEpisodeReal_legacy = core.startEpisodeReal;
core.getUtterance_legacy = core.getUtterance;

core.getUtterance = function () {
  bringBackDisplay();
  utterance = core.getUtterance_legacy();
  removeDisplay();
  return utterance;
};

core.endEpisode = function(reward, time_proportional, reason){
  bringBackDisplay();
  core.endEpisode_legacy(reward, time_proportional, reason);
  removeDisplay();
};

core.startEpisodeReal = function() {
  bringBackDisplay();
  core.startEpisodeReal_legacy();
  removeDisplay();
};

removeDisplay();
"""
            )

        # start the task
        self.page.evaluate(
            r"""
Math.seedrandom({seed});
core.EPISODE_MAX_TIME = {episode_max_time};
core.startEpisodeReal();
""".format(
                seed=self.random.randint(0, 1000000),
                episode_max_time=self.episode_max_time,
            )
        )

        # wait for the Miniwob task to have status ready
        self.page.wait_for_function(r"""() => WOB_TASK_READY""")

        # Zoom in miniwob. Helps visual agents have more precision
        # Reducing viewport size (smaller screenshot) leads to some VLM loosing
        # their ability to have good coordinate mapping e.g.: claude-3.5
        self.page._bgym_scale_factor = 1.5  # default zoom factor
        return self._get_goal(), self._get_info()

    def teardown(self) -> None:
        pass  # nothing to clean up

    def _get_goal(self) -> str:
        response = self.page.evaluate(r"""() => core.getUtterance()""")
        if isinstance(response, dict):
            goal = response["utterance"]
        else:
            goal = response
        return goal

    def _get_info(self) -> dict:
        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,


teardown

        self.page.evaluate(
            r"""
Math.seedrandom({seed});
core.EPISODE_MAX_TIME = {episode_max_time};
core.startEpisodeReal();
""".format(
                seed=self.random.randint(0, 1000000),
                episode_max_time=self.episode_max_time,
            )
        )

        # wait for the Miniwob task to have status ready
        self.page.wait_for_function(r"""() => WOB_TASK_READY""")

        # Zoom in miniwob. Helps visual agents have more precision
        # Reducing viewport size (smaller screenshot) leads to some VLM loosing
        # their ability to have good coordinate mapping e.g.: claude-3.5
        self.page._bgym_scale_factor = 1.5  # default zoom factor
        return self._get_goal(), self._get_info()

    def teardown(self) -> None:
        pass  # nothing to clean up

    def _get_goal(self) -> str:
        response = self.page.evaluate(r"""() => core.getUtterance()""")
        if isinstance(response, dict):
            goal = response["utterance"]
        else:
            goal = response
        return goal

    def _get_info(self) -> dict:
        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,
        ) = self.page.evaluate(
            r"""() => [WOB_REWARD_GLOBAL, WOB_RAW_REWARD_GLOBAL, WOB_REWARD_REASON, WOB_DONE_GLOBAL, WOB_EPISODE_ID, WOB_TASK_READY]"""
        )


core.EPISODE_MAX_TIME = {episode_max_time};
core.startEpisodeReal();
""".format(
                seed=self.random.randint(0, 1000000),
                episode_max_time=self.episode_max_time,
            )
        )

        # wait for the Miniwob task to have status ready
        self.page.wait_for_function(r"""() => WOB_TASK_READY""")

        # Zoom in miniwob. Helps visual agents have more precision
        # Reducing viewport size (smaller screenshot) leads to some VLM loosing
        # their ability to have good coordinate mapping e.g.: claude-3.5
        self.page._bgym_scale_factor = 1.5  # default zoom factor
        return self._get_goal(), self._get_info()

    def teardown(self) -> None:
        pass  # nothing to clean up

    def _get_goal(self) -> str:
        response = self.page.evaluate(r"""() => core.getUtterance()""")
        if isinstance(response, dict):
            goal = response["utterance"]
        else:
            goal = response
        return goal

    def _get_info(self) -> dict:
        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,
        ) = self.page.evaluate(
            r"""() => [WOB_REWARD_GLOBAL, WOB_RAW_REWARD_GLOBAL, WOB_REWARD_REASON, WOB_DONE_GLOBAL, WOB_EPISODE_ID, WOB_TASK_READY]"""
        )
        info = {
            "REWARD_GLOBAL": REWARD_GLOBAL,
            "RAW_REWARD_GLOBAL": RAW_REWARD_GLOBAL,
            "REWARD_REASON": REWARD_REASON,
            "DONE_GLOBAL": DONE_GLOBAL,
            "EPISODE_ID": EPISODE_ID,
            "TASK_READY": TASK_READY,
        }


        # wait for the Miniwob task to have status ready
        self.page.wait_for_function(r"""() => WOB_TASK_READY""")

        # Zoom in miniwob. Helps visual agents have more precision
        # Reducing viewport size (smaller screenshot) leads to some VLM loosing
        # their ability to have good coordinate mapping e.g.: claude-3.5
        self.page._bgym_scale_factor = 1.5  # default zoom factor
        return self._get_goal(), self._get_info()

    def teardown(self) -> None:
        pass  # nothing to clean up

    def _get_goal(self) -> str:
        response = self.page.evaluate(r"""() => core.getUtterance()""")
        if isinstance(response, dict):
            goal = response["utterance"]
        else:
            goal = response
        return goal

    def _get_info(self) -> dict:
        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,
        ) = self.page.evaluate(
            r"""() => [WOB_REWARD_GLOBAL, WOB_RAW_REWARD_GLOBAL, WOB_REWARD_REASON, WOB_DONE_GLOBAL, WOB_EPISODE_ID, WOB_TASK_READY]"""
        )
        info = {
            "REWARD_GLOBAL": REWARD_GLOBAL,
            "RAW_REWARD_GLOBAL": RAW_REWARD_GLOBAL,
            "REWARD_REASON": REWARD_REASON,
            "DONE_GLOBAL": DONE_GLOBAL,
            "EPISODE_ID": EPISODE_ID,
            "TASK_READY": TASK_READY,
        }
        return info

    def validate(
        self, page: playwright.sync_api.Page, chat_messages: list[str]
    ) -> Tuple[float, bool, str, dict]:
        if page != self.page:
            return 0, True, "", {"error": "invalid page, terminating task"}
        if page.url != self.url:
            return 0, True, "", {"error": "invalid url, terminating task"}

        info = self._get_info()
        reward = float(info["RAW_REWARD_GLOBAL"] > 0)  # TODO: shouldn't it be 0.5?
        done = info["DONE_GLOBAL"]
        msg = ""
        return reward, done, msg, info


validate

        (
            REWARD_GLOBAL,
            RAW_REWARD_GLOBAL,
            REWARD_REASON,
            DONE_GLOBAL,
            EPISODE_ID,
            TASK_READY,
        ) = self.page.evaluate(
            r"""() => [WOB_REWARD_GLOBAL, WOB_RAW_REWARD_GLOBAL, WOB_REWARD_REASON, WOB_DONE_GLOBAL, WOB_EPISODE_ID, WOB_TASK_READY]"""
        )
        info = {
            "REWARD_GLOBAL": REWARD_GLOBAL,
            "RAW_REWARD_GLOBAL": RAW_REWARD_GLOBAL,
            "REWARD_REASON": REWARD_REASON,
            "DONE_GLOBAL": DONE_GLOBAL,
            "EPISODE_ID": EPISODE_ID,
            "TASK_READY": TASK_READY,
        }
        return info

    def validate(
        self, page: playwright.sync_api.Page, chat_messages: list[str]
    ) -> Tuple[float, bool, str, dict]:
        if page != self.page:
            return 0, True, "", {"error": "invalid page, terminating task"}
        if page.url != self.url:
            return 0, True, "", {"error": "invalid url, terminating task"}

        info = self._get_info()
        reward = float(info["RAW_REWARD_GLOBAL"] > 0)  # TODO: shouldn't it be 0.5?
        done = info["DONE_GLOBAL"]
        msg = ""
        return reward, done, msg, info


import playwright.sync_api

from .base import AbstractMiniwobTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:
            get_utterance_func = "getUtterance_legacy"
        else:
            get_utterance_func = "getUtterance"

        # this task requires specific treatment to recover the text goal
        page.evaluate(
            f"core.{get_utterance_func} = function () "
            + r"""{
    query_div = document.getElementById('query');
    if (query_div.children.length > 0) {
        utterance = '';
        utterance = utterance + query_div.childNodes[0].textContent.replace(/\s+/g, ' ').trim();
        utterance = utterance + ' "' + query_div.children[0].getAttribute('class').split(' ')[1] + '"';
        utterance = utterance + ' ' + query_div.childNodes[2].textContent.replace(/\s+/g, ' ').trim();
    }
    else {
        utterance = query_div.textContent.replace(/\s+/g, ' ').trim();
    }
    return utterance;
};
'';
"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"

class ClickWidgetTask(AbstractMiniwobTask):
    desc = "Click on a specific widget in a generated form."
    subdomain = "click-widget"

class CopyPasteTask(AbstractMiniwobTask):
    desc = "Copy text and paste it into an input."
    subdomain = "copy-paste"

class CopyPaste2Task(AbstractMiniwobTask):
    desc = "Copy text from a specific textarea and paste it into an input."
    subdomain = "copy-paste-2"

class CountShapeTask(AbstractMiniwobTask):
    desc = "Count number of shapes."
    subdomain = "count-shape"

class CountSidesTask(AbstractMiniwobTask):
    desc = "Count the number of sides on a shape."
    subdomain = "count-sides"

class DailyCalendarTask(AbstractMiniwobTask):
    desc = "Create an event on a daily calendar."
    subdomain = "daily-calendar"

class DragBoxTask(AbstractMiniwobTask):
    desc = "Drag the smaller box into the larger box."
    subdomain = "drag-box"

class DragCircleTask(AbstractMiniwobTask):
    desc = "Drag an item in a specified direction."
    subdomain = "drag-circle"

class DragCubeTask(AbstractMiniwobTask):
    desc = "Drag a 3D cube to show a specific face."
    subdomain = "drag-cube"

class DragItemsTask(AbstractMiniwobTask):
    desc = "Drag items in a list, in a specified direction"
    subdomain = "drag-items"

class DragItemsGridTask(AbstractMiniwobTask):
    desc = "Drag items in a 2D grid around."
    subdomain = "drag-items-grid"

class DragShapesTask(AbstractMiniwobTask):
    desc = "Drag shapes into a box."
    subdomain = "drag-shapes"

class DragShapes2Task(AbstractMiniwobTask):
    desc = "Drag shapes into boxes, categorized by type."
    subdomain = "drag-shapes-2"

class DragSingleShapeTask(AbstractMiniwobTask):
    desc = "Drag a randomly generated shape in a specified direction."
    subdomain = "drag-single-shape"

class DragSortNumbersTask(AbstractMiniwobTask):
    desc = "Drag numbers into sorted ascending order."
    subdomain = "drag-sort-numbers"

class DrawCircleTask(AbstractMiniwobTask):
    desc = "Draw a circle around a marked point."
    subdomain = "draw-circle"

class DrawLineTask(AbstractMiniwobTask):
    desc = "Draw a line through a marked point."
    subdomain = "draw-line"

class EmailInboxTask(AbstractMiniwobTask):
    desc = "Navigate through an email inbox and perform some actions."
    subdomain = "email-inbox"

class EmailInboxDeleteTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling + 1 subtask."
    subdomain = "email-inbox-delete"

class EmailInboxForwardTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling + 1 subtask."
    subdomain = "email-inbox-forward"

class EmailInboxForwardNlTask(AbstractMiniwobTask):
    desc = "[email-inbox-forward] varied instruction texts (30 templates)."
    subdomain = "email-inbox-forward-nl"

class EmailInboxForwardNlTurkTask(AbstractMiniwobTask):
    desc = "[email-inbox-forward] varied instruction texts (100 templates)."
    subdomain = "email-inbox-forward-nl-turk"

class EmailInboxImportantTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling + 1 subtask."
    subdomain = "email-inbox-important"

class EmailInboxNlTurkTask(AbstractMiniwobTask):
    desc = "[email-inbox] varied instruction texts (100 templates for each subtask)."
    subdomain = "email-inbox-nl-turk"

class EmailInboxNoscrollTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling."
    subdomain = "email-inbox-noscroll"

class EmailInboxReplyTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling + 1 subtask."
    subdomain = "email-inbox-reply"

class EmailInboxStarReplyTask(AbstractMiniwobTask):
    desc = "[email-inbox] No scrolling + 2 subtasks."
    subdomain = "email-inbox-star-reply"

class EnterDateTask(AbstractMiniwobTask):
    desc = "Use the date input to pick the correct date."
    subdomain = "enter-date"

class EnterPasswordTask(AbstractMiniwobTask):
    desc = "Enter the password into the form."
    subdomain = "enter-password"

class EnterTextTask(AbstractMiniwobTask):
    desc = "Enter given text to a textfield."
    subdomain = "enter-text"

class EnterText2Task(AbstractMiniwobTask):
    desc = "Convert given text to upper or lower case."
    subdomain = "enter-text-2"

class EnterTextDynamicTask(AbstractMiniwobTask):
    desc = "Enter dynamically generated text to a textfield."
    subdomain = "enter-text-dynamic"

class EnterTimeTask(AbstractMiniwobTask):
    desc = "Enter the specified time into the input."
    subdomain = "enter-time"

class FindGreatestTask(AbstractMiniwobTask):
    desc = "Find the card with the greatest number."
    subdomain = "find-greatest"

class FindMidpointTask(AbstractMiniwobTask):
    desc = "Find the shortest mid-point of two points."
    subdomain = "find-midpoint"

class FindWordTask(AbstractMiniwobTask):
    desc = "Find nth word in a block of text."
    subdomain = "find-word"

class FocusTextTask(AbstractMiniwobTask):
    desc = "Focus into a text input."
    subdomain = "focus-text"

class FocusText2Task(AbstractMiniwobTask):
    desc = "Focus on a specific text input."
    subdomain = "focus-text-2"

class FormSequenceTask(AbstractMiniwobTask):
    desc = "Perform a series of instructions on a form."
    subdomain = "form-sequence"

class FormSequence2Task(AbstractMiniwobTask):
    desc = "Perform a series of instructions on a form."
    subdomain = "form-sequence-2"

class FormSequence3Task(AbstractMiniwobTask):
    desc = "Perform a series of instructions on a form."
    subdomain = "form-sequence-3"

class GenerateNumberTask(AbstractMiniwobTask):
    desc = "Generate a random number that meets certain criteria."
    subdomain = "generate-number"

class GridCoordinateTask(AbstractMiniwobTask):
    desc = "Find the Cartesian coordinates on a grid."
    subdomain = "grid-coordinate"

class GuessNumberTask(AbstractMiniwobTask):
    desc = "Guess the number."
    subdomain = "guess-number"

class HighlightTextTask(AbstractMiniwobTask):
    desc = "Highlight all the text."
    subdomain = "highlight-text"

class HighlightText2Task(AbstractMiniwobTask):
    desc = "Highlight the specified paragraph."
    subdomain = "highlight-text-2"

class HotColdTask(AbstractMiniwobTask):
    desc = "Find and click on the hot area."
    subdomain = "hot-cold"

class IdentifyShapeTask(AbstractMiniwobTask):
    desc = "Identify a randomly generated shape."
    subdomain = "identify-shape"

class LoginUserTask(AbstractMiniwobTask):
    desc = "Enter user login details into the form."
    subdomain = "login-user"

class LoginUserPopupTask(AbstractMiniwobTask):
    desc = "[login-user] Random popup."
    subdomain = "login-user-popup"

class MultiLayoutsTask(AbstractMiniwobTask):
    desc = "Fill in forms of varying layouts."
    subdomain = "multi-layouts"

class MultiOrderingsTask(AbstractMiniwobTask):
    desc = "Fill in forms with shuffled field orderings."
    subdomain = "multi-orderings"

class NavigateTreeTask(AbstractMiniwobTask):
    desc = "Navigate a file tree to find a specified file or folder."
    subdomain = "navigate-tree"

class NumberCheckboxesTask(AbstractMiniwobTask):
    desc = "Draw a given number using checkboxes."
    subdomain = "number-checkboxes"

class OddOrEvenTask(AbstractMiniwobTask):
    desc = "Mark each number as odd or even."
    subdomain = "odd-or-even"

class OrderFoodTask(AbstractMiniwobTask):
    desc = "Order food items from a menu."
    subdomain = "order-food"

class PhoneBookTask(AbstractMiniwobTask):
    desc = "Find a contact in a phone book."
    subdomain = "phone-book"

class ReadTableTask(AbstractMiniwobTask):
    desc = "Read information out from a table."
    subdomain = "read-table"

class ReadTable2Task(AbstractMiniwobTask):
    desc = "Read multiple pieces of information out from a table."
    subdomain = "read-table-2"

class ResizeTextareaTask(AbstractMiniwobTask):
    desc = "Resize a textarea in a given direction."
    subdomain = "resize-textarea"

class RightAngleTask(AbstractMiniwobTask):
    desc = "Given two points, add a third point to create a right angle."
    subdomain = "right-angle"

class ScrollTextTask(AbstractMiniwobTask):
    desc = "Scroll through a text area element and enter last word into text area."
    subdomain = "scroll-text"

class ScrollText2Task(AbstractMiniwobTask):
    desc = "Scroll through a text area in a given direction."
    subdomain = "scroll-text-2"

class SearchEngineTask(AbstractMiniwobTask):
    desc = "Search through a bunch of results to find a specified link."
    subdomain = "search-engine"

class SignAgreementTask(AbstractMiniwobTask):
    desc = "Sign a user agreement."
    subdomain = "sign-agreement"

class SimpleAlgebraTask(AbstractMiniwobTask):
    desc = "Solve for X."
    subdomain = "simple-algebra"

class SimpleArithmeticTask(AbstractMiniwobTask):
    desc = "Perform some arithmetic math operations."
    subdomain = "simple-arithmetic"

class SocialMediaTask(AbstractMiniwobTask):
    desc = "Interact with a social media feed."
    subdomain = "social-media"

class SocialMediaAllTask(AbstractMiniwobTask):
    desc = "[social-media] Do some action on all matching entries."
    subdomain = "social-media-all"

class SocialMediaSomeTask(AbstractMiniwobTask):
    desc = "[social-media] Do some action on some matching entries."
    subdomain = "social-media-some"

class StockMarketTask(AbstractMiniwobTask):
    desc = "Buy from the stock market below a specified price."
    subdomain = "stock-market"

class TerminalTask(AbstractMiniwobTask):
    desc = "Use the terminal to delete a file."
    subdomain = "terminal"
    nondeterministic = True

class TextEditorTask(AbstractMiniwobTask):
    desc = "Modify a text's style in a text-editor."
    subdomain = "text-editor"

class TextTransformTask(AbstractMiniwobTask):
    desc = "Enter slightly transformed text into a text box."
    subdomain = "text-transform"

class TicTacToeTask(AbstractMiniwobTask):
    desc = "Win a game of tic-tac-toe."
    subdomain = "tic-tac-toe"

class UnicodeTestTask(AbstractMiniwobTask):
    desc = "Click on the button with the correct Unicode text."
    subdomain = "unicode-test"

class UseAutocompleteTask(AbstractMiniwobTask):
    desc = "Use autocomplete element efficiently."
    subdomain = "use-autocomplete"

class UseAutocompleteNodelayTask(AbstractMiniwobTask):
    desc = "[use-autocomplete] Removed delay."
    subdomain = "use-autocomplete-nodelay"

class UseColorwheelTask(AbstractMiniwobTask):
    desc = "Use a color wheel."
    subdomain = "use-colorwheel"

class UseColorwheel2Task(AbstractMiniwobTask):
    desc = "Use a color wheel given specific random color."
    subdomain = "use-colorwheel-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:
            get_utterance_func = "getUtterance_legacy"
        else:
            get_utterance_func = "getUtterance"

        # this task requires specific treatment to recover the text goal
        page.evaluate(
            f"core.{get_utterance_func} = function () "
            + r"""{
    const rgb2hex = (rgb) => `#${rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/).slice(1).map(n => parseInt(n, 10).toString(16).padStart(2, '0')).join('')}`;
    query_div = document.getElementById('query');
    utterance = '';
    utterance = utterance + query_div.children[0].textContent.replace(/\s+/g, ' ').trim();
    utterance = utterance + ' ' + rgb2hex(query_div.children[1].style.backgroundColor);
    utterance = utterance + ' ' + query_div.children[2].textContent.replace(/\s+/g, ' ').trim();
    return utterance;
};
'';
"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class UseSliderTask(AbstractMiniwobTask):
    desc = "Use a slider to select a particular value."
    subdomain = "use-slider"

class UseSlider2Task(AbstractMiniwobTask):
    desc = "Use sliders to create a given combination."
    subdomain = "use-slider-2"

class UseSpinnerTask(AbstractMiniwobTask):
    desc = "Use a spinner to select given number."
    subdomain = "use-spinner"

class VisualAdditionTask(AbstractMiniwobTask):
    desc = "Count the total number of blocks."
    subdomain = "visual-addition"
    nondeterministic = True


AscendingNumbersTask

import playwright.sync_api

from .base import AbstractMiniwobTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"


BisectAngleTask

import playwright.sync_api

from .base import AbstractMiniwobTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"


BookFlightTask

import playwright.sync_api

from .base import AbstractMiniwobTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"


BookFlightNodelayTask

import playwright.sync_api

from .base import AbstractMiniwobTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"


BuyTicketTask

class AscendingNumbersTask(AbstractMiniwobTask):
    desc = "Click on the numbers in ascending order."
    subdomain = "ascending-numbers"

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"


ChooseDateTask

class BisectAngleTask(AbstractMiniwobTask):
    desc = "Find the line that bisects an angle evenly in two."
    subdomain = "bisect-angle"

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"


ChooseDateEasyTask

class BookFlightTask(AbstractMiniwobTask):
    desc = "Search for flight results."
    subdomain = "book-flight"

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"


ChooseDateMediumTask

class BookFlightNodelayTask(AbstractMiniwobTask):
    desc = "[book-flight] Removed animation."
    subdomain = "book-flight-nodelay"

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"


ChooseDateNodelayTask

class BuyTicketTask(AbstractMiniwobTask):
    desc = "Buy a ticket that matches the requested criteria."
    subdomain = "buy-ticket"

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"


ChooseListTask

class ChooseDateTask(AbstractMiniwobTask):
    desc = "Learn to operate a date picker tool."
    subdomain = "choose-date"

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"


CircleCenterTask

class ChooseDateEasyTask(AbstractMiniwobTask):
    desc = "[choose-date] December only."
    subdomain = "choose-date-easy"

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"


ClickButtonTask

class ChooseDateMediumTask(AbstractMiniwobTask):
    desc = "[choose-date] December or November only."
    subdomain = "choose-date-medium"

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"


ClickButtonSequenceTask

class ChooseDateNodelayTask(AbstractMiniwobTask):
    desc = "[choose-date] Removed animation."
    subdomain = "choose-date-nodelay"

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"


ClickCheckboxesTask

class ChooseListTask(AbstractMiniwobTask):
    desc = "Choose an item from a drop down list."
    subdomain = "choose-list"

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"


ClickCheckboxesLargeTask

class CircleCenterTask(AbstractMiniwobTask):
    desc = "Find the center of a circle."
    subdomain = "circle-center"

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"


ClickCheckboxesSoftTask

class ClickButtonTask(AbstractMiniwobTask):
    desc = "Click on a specific button in a generated form."
    subdomain = "click-button"

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"


ClickCheckboxesTransferTask

class ClickButtonSequenceTask(AbstractMiniwobTask):
    desc = "Click on buttons in a certain order."
    subdomain = "click-button-sequence"

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"


ClickCollapsibleTask

class ClickCheckboxesTask(AbstractMiniwobTask):
    desc = "Click desired checkboxes."
    subdomain = "click-checkboxes"

class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"


class ClickCheckboxesLargeTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Click at least 5 out of up to 12 checkboxes."
    subdomain = "click-checkboxes-large"

class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"


class ClickCheckboxesSoftTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Paraphrased entries."
    subdomain = "click-checkboxes-soft"

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"


ClickCollapsibleNodelayTask

class ClickCheckboxesTransferTask(AbstractMiniwobTask):
    desc = "[click-checkboxes] Train and test on different number of targets."
    subdomain = "click-checkboxes-transfer"

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"


ClickColorTask

class ClickCollapsibleTask(AbstractMiniwobTask):
    desc = "Click a collapsible element to expand it."
    subdomain = "click-collapsible"

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"


ClickDialogTask

class ClickCollapsible2Task(AbstractMiniwobTask):
    desc = "Find and click on a specified link, from collapsible elements."
    subdomain = "click-collapsible-2"

class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"


class ClickCollapsible2NodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible-2] Removed animation."
    subdomain = "click-collapsible-2-nodelay"

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:


ClickLinkTask

class ClickCollapsibleNodelayTask(AbstractMiniwobTask):
    desc = "[click-collapsible] Removed animation."
    subdomain = "click-collapsible-nodelay"

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:
            get_utterance_func = "getUtterance_legacy"
        else:
            get_utterance_func = "getUtterance"

        # this task requires specific treatment to recover the text goal


ClickMenuTask

class ClickColorTask(AbstractMiniwobTask):
    desc = "Click the specified color."
    subdomain = "click-color"

class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:
            get_utterance_func = "getUtterance_legacy"
        else:
            get_utterance_func = "getUtterance"

        # this task requires specific treatment to recover the text goal
        page.evaluate(
            f"core.{get_utterance_func} = function () "
            + r"""{
    query_div = document.getElementById('query');
    if (query_div.children.length > 0) {


class ClickDialogTask(AbstractMiniwobTask):
    desc = "Click the button to close the dialog box."
    subdomain = "click-dialog"

class ClickDialog2Task(AbstractMiniwobTask):
    desc = "Click a specific button in a dialog box."
    subdomain = "click-dialog-2"

class ClickLinkTask(AbstractMiniwobTask):
    desc = "Click on a specified link in text."
    subdomain = "click-link"

class ClickMenuTask(AbstractMiniwobTask):
    desc = "Click menu items."
    subdomain = "click-menu"

class ClickMenu2Task(AbstractMiniwobTask):
    desc = "Find a specific item from a menu."
    subdomain = "click-menu-2"

    def setup(self, page: playwright.sync_api.Page) -> tuple[str, dict]:
        goal, info = super().setup(page)

        if self.remove_human_display:
            get_utterance_func = "getUtterance_legacy"
        else:
            get_utterance_func = "getUtterance"

        # this task requires specific treatment to recover the text goal
        page.evaluate(
            f"core.{get_utterance_func} = function () "
            + r"""{
    query_div = document.getElementById('query');
    if (query_div.children.length > 0) {
        utterance = '';
        utterance = utterance + query_div.childNodes[0].textContent.replace(/\s+/g, ' ').trim();
        utterance = utterance + ' "' + query_div.children[0].getAttribute('class').split(' ')[1] + '"';
        utterance = utterance + ' ' + query_div.childNodes[2].textContent.replace(/\s+/g, ' ').trim();
    }
    else {
        utterance = query_div.textContent.replace(/\s+/g, ' ').trim();
    }
    return utterance;
};
'';
"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):


ClickOptionTask

        utterance = '';
        utterance = utterance + query_div.childNodes[0].textContent.replace(/\s+/g, ' ').trim();
        utterance = utterance + ' "' + query_div.children[0].getAttribute('class').split(' ')[1] + '"';
        utterance = utterance + ' ' + query_div.childNodes[2].textContent.replace(/\s+/g, ' ').trim();
    }
    else {
        utterance = query_div.textContent.replace(/\s+/g, ' ').trim();
    }
    return utterance;
};
'';
"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):


ClickPieTask

    else {
        utterance = query_div.textContent.replace(/\s+/g, ' ').trim();
    }
    return utterance;
};
'';
"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."


ClickPieNodelayTask

"""
        )

        # re-extract the goal
        goal = self._get_goal()

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"


ClickScrollListTask

        return goal, info

class ClickOptionTask(AbstractMiniwobTask):
    desc = "Click option boxes."
    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"


ClickShadesTask

    subdomain = "click-option"

class ClickPieTask(AbstractMiniwobTask):
    desc = "Click items on a pie menu."
    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"


ClickShapeTask

    subdomain = "click-pie"
    nondeterministic = True

class ClickPieNodelayTask(AbstractMiniwobTask):
    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"


ClickTabTask

    desc = "[click-pie] Removed animation."
    subdomain = "click-pie-nodelay"
    nondeterministic = True

class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"


class ClickScrollListTask(AbstractMiniwobTask):
    desc = "Click multiple items from a scroll list."
    subdomain = "click-scroll-list"

class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"


class ClickShadesTask(AbstractMiniwobTask):
    desc = "Click the shades that match a specified color."
    subdomain = "click-shades"

class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"


class ClickShapeTask(AbstractMiniwobTask):
    desc = "Click on a specific shape."
    subdomain = "click-shape"

class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"


class ClickTabTask(AbstractMiniwobTask):
    desc = "Click on a tab element."
    subdomain = "click-tab"

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"

class ClickWidgetTask(AbstractMiniwobTask):
    desc = "Click on a specific widget in a generated form."
    subdomain = "click-widget"


ClickTestTask

class ClickTab2Task(AbstractMiniwobTask):
    desc = "Click a link inside a specific tab element."
    subdomain = "click-tab-2"

class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"

class ClickWidgetTask(AbstractMiniwobTask):
    desc = "Click on a specific widget in a generated form."
    subdomain = "click-widget"

class CopyPasteTask(AbstractMiniwobTask):
    desc = "Copy text and paste it into an input."
    subdomain = "copy-paste"


class ClickTab2EasyTask(AbstractMiniwobTask):
    desc = "[click-tab-2] One 1 tab."
    subdomain = "click-tab-2-easy"

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"

class ClickWidgetTask(AbstractMiniwobTask):
    desc = "Click on a specific widget in a generated form."
    subdomain = "click-widget"

class CopyPasteTask(AbstractMiniwobTask):
    desc = "Copy text and paste it into an input."
    subdomain = "copy-paste"

class CopyPaste2Task(AbstractMiniwobTask):
    desc = "Copy text from a specific textarea and paste it into an input."
    subdomain = "copy-paste-2"


ClickTestTransferTask

class ClickTab2HardTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Varying number of tabs from 2 to 6."
    subdomain = "click-tab-2-hard"

class ClickTab2MediumTask(AbstractMiniwobTask):
    desc = "[click-tab-2] Choose between a link or ‘no match’."
    subdomain = "click-tab-2-medium"

class ClickTestTask(AbstractMiniwobTask):
    desc = "Click on a single button."
    subdomain = "click-test"

class ClickTest2Task(AbstractMiniwobTask):
    desc = "Click on one of two buttons."
    subdomain = "click-test-2"

class ClickTestTransferTask(AbstractMiniwobTask):
    desc = "[click-test] Different buttons during train and test."
    subdomain = "click-test-transfer"

class ClickWidgetTask(AbstractMiniwobTask):
    desc = "Click on a specific widget in a generated form."
    subdomain = "click-widget"

class CopyPasteTask(AbstractMiniwobTask):
    desc = "Copy text and paste it into an input."
    subdomain = "copy-paste"

class CopyPaste2Task(AbstractMiniwobTask):
    desc = "Copy text from a specific textarea and paste it into an input."
    subdomain = "copy-paste-2"

class CountShapeTask(AbstractMiniwobTask):
    desc = "Count number of shapes."
    subdomain = "count-shape"