from typing import Any, Optional

from django import forms

from .conf import settings as settings
from .constants import EMPTY_VALUES as EMPTY_VALUES
from .utils import handle_timezone as handle_timezone
from .widgets import BaseCSVWidget as BaseCSVWidget
from .widgets import CSVWidget as CSVWidget
from .widgets import DateRangeWidget as DateRangeWidget
from .widgets import LookupChoiceWidget as LookupChoiceWidget
from .widgets import RangeWidget as RangeWidget

class RangeField(forms.MultiValueField):
    widget: Any = ...
    def __init__(
        self, fields: Optional[Any] = ..., *args: Any, **kwargs: Any
    ) -> None: ...
    def compress(self, data_list: Any): ...

class DateRangeField(RangeField):
    widget: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def compress(self, data_list: Any): ...

class DateTimeRangeField(RangeField):
    widget: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class IsoDateTimeRangeField(RangeField):
    widget: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class TimeRangeField(RangeField):
    widget: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class Lookup:
    def __new__(cls, value: Any, lookup_expr: Any): ...

class LookupChoiceField(forms.MultiValueField):
    default_error_messages: Any = ...
    def __init__(
        self, field: Any, lookup_choices: Any, *args: Any, **kwargs: Any
    ) -> None: ...
    def compress(self, data_list: Any): ...

class IsoDateTimeField(forms.DateTimeField):
    ISO_8601: str = ...
    input_formats: Any = ...
    def strptime(self, value: Any, format: Any): ...

class BaseCSVField(forms.Field):
    base_widget_class: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    def clean(self, value: Any): ...

class BaseRangeField(BaseCSVField):
    widget: Any = ...
    default_error_messages: Any = ...
    def clean(self, value: Any): ...

class ChoiceIterator:
    field: Any = ...
    choices: Any = ...
    def __init__(self, field: Any, choices: Any) -> None: ...
    def __iter__(self) -> Any: ...
    def __len__(self): ...

class ModelChoiceIterator(forms.models.ModelChoiceIterator):
    def __iter__(self) -> Any: ...
    def __len__(self): ...

class ChoiceIteratorMixin:
    null_label: Any = ...
    null_value: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...
    choices: Any = ...

class ChoiceField(ChoiceIteratorMixin, forms.ChoiceField):
    iterator: Any = ...
    empty_label: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class MultipleChoiceField(ChoiceIteratorMixin, forms.MultipleChoiceField):
    iterator: Any = ...
    empty_label: Any = ...
    def __init__(self, *args: Any, **kwargs: Any) -> None: ...

class ModelChoiceField(ChoiceIteratorMixin, forms.ModelChoiceField):
    iterator: Any = ...
    def to_python(self, value: Any): ...

class ModelMultipleChoiceField(ChoiceIteratorMixin, forms.ModelMultipleChoiceField):
    iterator: Any = ...
