Y
    ˆÒ�þ\+«7#o€1Œ¤üÿáƒ®;àß¿Ý ç   """Helpers for use with type annotation.

Use the empty classes in this module when annotating the types of Pyrsistent
objects, instead of using the actual collection class.

For example,

    from pyrsistent import pvector
    from pyrsistent.typing import PVector

    myvector: PVector[str] = pvector(['a', 'b', 'c'])

"""
from __future__ import absolute_import

try:
    from typing import Container
    from typing import Hashable
    from typing import Generic
    from typing import Iterable
    from typing import Mapping
    from typing import Sequence
    from typing import Sized
    from typing import TypeVar

    __all__ = [
        'CheckedPMap',
        'CheckedPSet',
        'CheckedPVector',
        'PBag',
        'PDeque',
        'PList',
        'PMap',
        'PSet',
        'PVector',
    ]

    T = TypeVar('T')
    KT = TypeVar('KT')
    VT = TypeVar('VT')

    class CheckedPMap(Mapping[KT, VT], Hashable):
        pass

    # PSet.add and PSet.discard have different type signatures than that of Set.
    class CheckedPSet(Generic[T], Hashable):
        pass

    class CheckedPVector(Sequence[T], Hashable):
        pass

    class PBag(Container[T], Iterable[T], Sized, Hashable):
        pass

    class PDeque(Sequence[T], Hashable):
        pass

    class PList(Sequence[T], Hashable):
        pass

    class PMap(Mapping[KT, VT], Hashable):
        pass

    # PSet.add and PSet.discard have different type signatures than that of Set.
    class PSet(Generic[T], Hashable):
        pass

    class PVector(Sequence[T], Hashable):
        pass

    class PVectorEvolver(Generic[T]):
        pass

    class PMapEvolver(Generic[KT, VT]):
        pass

    class PSetEvolver(Generic[T]):
        pass
except ImportError:
    pass
    ˆçŽþ[
ÍºëO…æÙz@ùá81àß¿Ý  Q   __version_info__ = (0, 7, 12)
__version__ = ".".join(map(str, __version_info__))
  !  ˆÂ�þ^Y¹+®Ê%h þá„e–�sàß¿Ý ?÷    """The runtime functions and state used by compiled templates."""
import functools
import sys
import typing as t
from collections import abc
from itertools import chain

from markupsafe import escape  # noqa: F401
from markupsafe import Markup
from markupsafe import soft_str

from .async_utils import auto_aiter
from .async_utils import auto_await  # noqa: F401
from .exceptions import TemplateNotFound  # noqa: F401
from .exceptions import TemplateRuntimeError  # noqa: F401
from .exceptions import UndefinedError
from .nodes import EvalContext
from .utils import _PassArg
from .utils import concat
from .utils import internalcode
from .utils import missing
from .utils import Namespace  # noqa: F401
from .utils import object_type_repr
from .utils import pass_eval_context

V = t.TypeVar("V")
F = t.TypeVar("F", bound=t.Callable[..., t.Any])

if t.TYPE_CHECKING:
    import logging
    import typing_extensions as te
    from .environment import Environment

    class LoopRenderFunc(te.Protocol):
        def __call__(
            self,
            reciter: t.Iterable[V],
            loop_render_func: "LoopRenderFunc",
            depth: int = 0,
        ) -> str:
            ...


# these variables are exported to the template runtime
exported = [
    "LoopContext",
    "TemplateReference",
    "Macro",
    "Markup",
    "TemplateRuntimeError",
    "missing",
    "escape",
    "markup_join",
    "str_join",
    "identity",
    "TemplateNotFound",
    "Namespace",
    "Undefined",
    "internalcode",
]
async_exported = [
    "AsyncLoopContext",
    "auto_aiter",
    "auto_await",
]


def identity(x: V) -> V:
    """Returns its argument. Useful for certain things in the
    environment.
    """
    return x


def markup_join(seq: t.Iterable[t.Any]) -> str:
    """Concatenation that escapes if necessary and converts to string."""
    buf = []
    iterator = map(soft_str, seq)
    for arg in iterator:
        buf.append(arg)
        if hasattr(arg, "__html__"):
            return Markup("").join(chain(buf, iterator))
    return concat(buf)


def str_join(seq: t.Iterable[t.Any])