§
    >²¸j Š  ã                   ó  — U d Z ddlZddlZddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZmZmZ ddlmZmZmZmZmZmZ ddlmZmZ dZeed	<    G d
„ d¦  «        Z	 d%dddedddddddœ
dedededede	ed                  de	e         de	eee	e         f                  de	eeef                  deded         dedee gdf         fd„Z!ddddedddd œd!ed"edededede	ed                  de	e         d#ede	eeef                  ddfd$„Z"dS )&aY  Proxy utilities for deprecating Python object instances and classes.

Provides :func:`~deprecate.proxy.deprecated_instance` for wrapping any Python object with
transparent deprecation warnings and optional read-only enforcement, and
:func:`~deprecate.proxy.deprecated_class` as a class-level decorator with optional target
redirection.

Typical use cases:

- Deprecating module-level config dicts, constants, or legacy singletons
  while still allowing reads during a migration window.
- Deprecating an Enum or dataclass in favor of a replacement type, with
  automatic forwarding of all attribute, item, and call access.

Example:
    >>> import warnings
    >>> cfg = {"threshold": 0.5}
    >>> proxy = deprecated_instance(cfg, deprecated_in="1.0", remove_in="2.0", stream=None)
    >>> proxy["threshold"]
    0.5

    >>> proxy.get("threshold")
    0.5

é    N)ÚIterator)ÚAnyÚCallableÚLiteralÚOptionalÚcast)ÚDeprecationConfigÚ
TargetModeÚ_ProxyConfig)ÚTEMPLATE_ARGUMENT_MAPPINGÚTEMPLATE_WARNING_ARGUMENTSÚTEMPLATE_WARNING_CALLABLEÚTEMPLATE_WARNING_NO_TARGETÚ_validate_template_mgsÚdeprecation_warning)Ú"_update_docstring_with_deprecationÚnormalize_docstring_styleé   Ú_DEFAULT_STACKLEVEL_TO_CALLERc                   ó  — e Zd ZdZddddddedddddœded	ed
edeeeee         f                  deeeef                  dedede	dee
d                  dee         dedededdfd„Zedefd„¦   «         Zedefd„¦   «         Zddœdee         ddfd„Zdeddfd„Zedefd„¦   «         Zdefd „Zd!eeef         deeef         fd"„Zd!eeef         deeef         fd#„Zed	edefd$„¦   «         Zd	edefd%„Zd	ed&eddfd'„Zd	eddfd(„Zd)edefd*„Zd)ed&eddfd+„Zd)eddfd,„Zde	fd-„Z de!e         fd.„Z"d/edefd0„Z#d1ed!edefd2„Z$d3e%defd4„Z&d3e%defd5„Z'de	fd6„Z(defd7„Z)defd8„Z*defd9„Z+d:e%defd;„Z,d<e-defd=„Z.dS )>Ú_DeprecatedProxyuU
  Transparent proxy that emits deprecation warnings on attribute and item access.

    Wraps any Python object and forwards all read operations (attribute lookup, subscript, iteration, calls) to the
    underlying object â€” or to an optional *target* replacement â€” while emitting a configurable :class:`FutureWarning`.

    In *read-only* mode any attempt to mutate the proxied object via ``__setitem__``, ``__delitem__``, or
    ``__setattr__`` raises :class:`AttributeError`.

    Use :func:`~deprecate.proxy.deprecated_instance` or :func:`~deprecate.proxy.deprecated_class` to create
    instances rather than instantiating this class directly.

    Args:
        obj: The deprecated object to wrap (the *source*).
        name: Display name used in the warning message.
        deprecated_in: Version string when the object was deprecated.
        remove_in: Version string when the object will be removed.
        num_warns: Maximum number of warnings to emit. ``1`` (default) warns once; ``-1`` warns on every access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`
            (:class:`FutureWarning`).  Pass ``None`` to suppress warnings.  **Note:** the built-in
            stacklevel budget assumes *stream* is :func:`warnings.warn` itself or a C-level
            :func:`functools.partial` of it; a Python-defined wrapper interposes an extra frame and
            the warning will appear to originate inside :mod:`deprecate.proxy` rather than the caller.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used (callable-target, no-target, or
            per-argument).  See :func:`~deprecate.proxy.deprecated_class` for the available ``%``-style placeholders.
        read_only: If ``True``, raise :class:`AttributeError` on any write attempt through the proxy.
            Only the following standard collection mutator names are intercepted: ``append``, ``clear``,
            ``discard``, ``extend``, ``insert``, ``pop``, ``remove``, ``setdefault``, ``update``, ``add``.
            Custom method names (e.g. ``register()``, ``reload()``, ``set_value()``) are not blocked.
        target: Optional replacement object.  When set, all attribute, item, and call access is forwarded to *target*
            instead of *obj*.
        args_mapping: Optional dict remapping keyword argument names when the proxy is called.  Keys are old argument
            names; values are new names, or ``None`` to drop the argument entirely.

    NÚ é   FÚauto)ÚtargetÚargs_mappingÚ
args_extraÚdeprecated_inÚ	remove_inÚ	num_warnsÚstreamÚtemplate_mgsÚ	read_onlyÚdocstring_styleÚ_misconfigured_overrideÚobjÚnamer   r   r   r   r   r    r!   ©.Nr"   r#   r$   r%   Úreturnc                óP  — t          |
¦  «         |du p|}t          |t          ¦  «        rt          j        ||d¬¦  «        }|€|rt          j        }t          |t          ¦  «        r|t          j        ||||d¬¦  «        z  }t          ||	||||
¬¦  «        }t           	                    | d|¦  «         t          |||||||t          |¦  «        |
¬	¦	  «	        }t           	                    | d
|¦  «         t          |dd¦  «        }|rt           	                    | d|¦  «         dS dS )a  Initialise the proxy with typed runtime/config dataclasses.

        ``__config`` stores private mutable runtime state in :class:`~deprecate._types._ProxyConfig` (obj, stream,
        num_warns, read_only, args_extra, warned counter).

        ``__deprecated__`` is the public metadata interface consumed by audit tools
        (:func:`~deprecate.audit.validate_deprecation_wrapper`,
        :func:`~deprecate.audit.find_deprecation_wrappers`, etc.)
        as a :class:`~deprecate._types.DeprecationConfig` instance aligned with the ``@deprecated`` schema.

        ``_misconfigured_override`` is a private hook used by :func:`~deprecate.deprecated` when it delegates to
        :func:`~deprecate.deprecated_class` for class targets: it lets the caller pre-compute misconfig signals
        (raw ``target=False`` plus NOTIFY+args_mapping / NOTIFY+args_extra detected upstream) before the proxy
        rewrites them away, so the final frozen :class:`~deprecate._types.DeprecationConfig` records every signal
        in one place.

        Fr   )r   Ú
stacklevelNé   )r   r   r+   )r&   r!   r    r#   r   r"   Ú_DeprecatedProxy__config)	r   r   r'   r   r   r   Úmisconfiguredr$   r"   Ú__deprecated__Ú__doc__)r   Ú
isinstanceÚboolr
   Ú_from_legacy_proxyÚ
ARGS_REMAPÚ	_validater   ÚobjectÚ__setattr__r	   r   Úgetattr)Úselfr&   r'   r   r   r   r   r   r    r!   r"   r#   r$   r%   r.   ÚcfgÚdep_metaÚ_docs                     ú_/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/deprecate/proxy.pyÚ__init__z_DeprecatedProxy.__init__V   sv  € õH 	˜|Ñ,Ô,Ð,ð  %˜ÐBÐ+BˆÝ�f�dÑ#Ô#ð 	dÝÔ2°6ÈÐabÐcÑcÔcˆFàˆ>˜lˆ>ÝÔ*ˆFõ �f�jÑ)Ô)ð 	Ø�ZÔ1Ø˜¨<ÀJÐ[\ðñ ô ñ ˆMõ
 ØØØØØ!Ø%ð
ñ 
ô 
ˆõ 	×Ò˜4Ð!;¸SÑAÔAÐAå$Ø'ØØØØ%Ø!Ø'Ý5°oÑFÔFØ%ð

ñ 

ô 

ˆõ 	×Ò˜4Ð!1°8Ñ<Ô<Ð<õ �s˜I tÑ,Ô,ˆØð 	6Ý×Ò˜t Y°Ñ5Ô5Ð5Ð5Ð5ð	6ð 	6ó    c                 ó^   — t          t          t                               | d¦  «        ¦  «        S )u¾   Private mutable runtime state (warn counter, stream, read-only flag, wrapped object).

        Private to this class â€” not part of the public API and not consumed by audit tools.

        r-   )r   r   r6   Ú__getattribute__©r9   s    r=   Ú_cfgz_DeprecatedProxy._cfg®   s%   € õ •L¥&×"9Ò"9¸$Ð@ZÑ"[Ô"[Ñ\Ô\Ð\r?   c                 ó^   — t          t          t                               | d¦  «        ¦  «        S )u  Static deprecation metadata (versions, name, target, args_mapping).

        Stored as ``__deprecated__`` (dunder, not name-mangled) â€” audit tools and external code may read it directly;
        this property simply provides a typed view of the same object.

        r/   )r   r	   r6   rA   rB   s    r=   Ú_depz_DeprecatedProxy._dep·   s&   € õ Õ%¥v×'>Ò'>¸tÐEUÑ'VÔ'VÑWÔWÐWr?   ©Úarg_namerG   c                óB  — | j         }|j        }|sdS |�4|j                             |d¦  «        }|j        dk    r||j        k    rdS n|j        dk    r|j        |j        k    rdS | j        }|j        }|j        }|j	        }|�K|rI||v rE||         }	t          |t          |	¦  «        dœz  }
|pt          }||j        |j        |j        |
dœz  }ngt!          |¦  «        r7|j        }|j        › d|› �}|pt&          }||j        |j        |j        ||dœz  }n!|pt(          }||j        |j        |j        dœz  }	  ||t*          ¬¦  «         n# t,          $ r  ||¦  «         Y nw xY w|�(|j                             |d¦  «        d	z   |j        |<   dS |xj        d	z  c_        dS )
uV  Emit a deprecation warning if the warn budget is not exhausted.

        Args:
            arg_name: When given, use per-argument warning tracking (``cfg.warned_args``) instead of the global
                ``cfg.warned`` counter.  The warning is suppressed when the per-argument count has already reached
                ``cfg.num_warns``.  When provided alongside an ``args_mapping`` entry, the emitted message uses the
                per-argument template (`old -> new`) rather than the generic callable template â€” matching the
                decorator's argument-deprecation form.

        Nr   )Úold_argÚnew_arg)Úsource_namer   r   Úargument_mapú.)rK   r   r   Útarget_nameÚtarget_path)rK   r   r   ©r+   r   )rC   r!   Úwarned_argsÚgetr    ÚwarnedrE   r   r   r"   r   Ústrr   r'   r   r   ÚcallableÚ__name__Ú
__module__r   r   r   Ú	TypeError)r9   rG   r:   r!   Ú	arg_countÚdepr   r   Úcustom_templaterJ   rL   ÚtemplateÚmsgrN   rO   s                  r=   Ú_warnz_DeprecatedProxy._warnÁ   s1  € ð ŒiˆØ”ˆØð 	ØˆFØÐàœ×+Ò+¨H°aÑ8Ô8ˆIØŒ} Ò!Ð! i°3´=Ò&@Ð&@Ø�øð Œ} Ò!Ð! c¤j°C´MÒ&AÐ&AØ�ØŒiˆØ”jˆØÔ'ˆð
 Ô*ˆð Ð LÐ°XÀÐ5MÐ5MØ" 8Ô,ˆGÝ4À8ÕX[Ð\cÑXdÔXdÐ7eÐ7eÑeˆLØ&ÐDÕ*DˆHØØ"œxØ!$Ô!2Ø œ]Ø ,ð	ð ñ ˆCˆCõ �fÑÔð 	Ø œ/ˆKØ#Ô.Ð>Ð>°Ð>Ð>ˆKØ&ÐCÕ*CˆHØØ"œxØ!$Ô!2Ø œ]Ø*Ø*ðð ñ ˆCˆCð 'ÐDÕ*DˆHØØ"œxØ!$Ô!2Ø œ]ðð ñ ˆCð	ØˆF�3Õ#@ÐAÑAÔAÐAÐAøÝð 	ð 	ð 	ØˆF�3‰KŒKˆKˆKˆKð	øøøàÐØ(+¬×(;Ò(;¸HÀaÑ(HÔ(HÈ1Ñ(LˆCŒO˜HÑ%Ð%Ð%àˆJŒJ˜!‰OˆJŒJˆJˆJs   Ä7E
 Å
E"Å!E"Ú	operationc                 ób   — | j         j        r"| j        j        }t	          d|› d|› d�¦  «        ‚dS )z¤Raise AttributeError when the proxy is in read-only mode.

        Raises:
            AttributeError: If ``read_only=True`` was set at construction time.

        ú'z' is deprecated and read-only. z/ is not allowed. Migrate away from this object.N)rC   r#   rE   r'   ÚAttributeError)r9   r_   r'   s      r=   Ú_check_read_onlyz!_DeprecatedProxy._check_read_only  sL   € ð Œ9Ôð 	Øœ	œˆDÝ Øs�DÐsÐs¸ÐsÐsÐsñô ð ð	ð 	r?   c                 ó   — | j         j        S )zHThe deprecated source object this proxy wraps (audit contract accessor).)rC   r&   rB   s    r=   Úwrappedz_DeprecatedProxy.wrapped  s   € ð ŒyŒ}Ðr?   c                 ód   — | j         j        }|�t          |t          ¦  «        s|S | j        j        S )z@Return the active object: *target* when set, otherwise *source*.)rE   r   r1   r
   rC   r&   )r9   r   s     r=   Ú_get_activez_DeprecatedProxy._get_active  s0   € à”Ô!ˆØÐ¥j°½Ñ&DÔ&DÐØˆMØŒyŒ}Ðr?   Úkwargsc                 ó¨   ‡‡— | j         j        Š‰r|s|S d„ ‰                     ¦   «         D ¦   «         Šˆˆfd„|                     ¦   «         D ¦   «         S )zHApply args_mapping to *kwargs*, renaming or dropping keys as configured.c                 ó   — h | ]	\  }}|­|’Œ
S ©N© )Ú.0ÚkÚvs      r=   ú	<setcomp>z7_DeprecatedProxy._apply_args_mapping.<locals>.<setcomp>*  s   € ÐHÐHÐH™d˜a ¸a¸i˜¸i¸i¸ir?   c                 óN   •— i | ]!\  }}|‰v¯	‰                      |¦  «        p||“Œ"S rl   )rR   )rm   rn   ro   r   Úargs_to_drops      €€r=   ú
<dictcomp>z8_DeprecatedProxy._apply_args_mapping.<locals>.<dictcomp>+  s=   ø€ ÐbÐbÐb±$°!°QÈAÐUaÐLaÐLa�×!Ò! !Ñ$Ô$Ð)¨¨AÐLaÐLaÐLar?   )rE   r   Úitems)r9   rh   r   rr   s     @@r=   Ú_apply_args_mappingz$_DeprecatedProxy._apply_args_mapping%  sf   øø€ à”yÔ-ˆØð 	 6ð 	ØˆMØHÐH l×&8Ò&8Ñ&:Ô&:ÐHÑHÔHˆØbÐbÐbÐbÐb¸&¿,º,¹.¼.ÐbÑbÔbÐbr?   c                 ón   — | j         j        }|s|S t          |¦  «        }|                     |¦  «         |S )zFMerge :attr:`_ProxyConfig.args_extra` into *kwargs*; extra values win.)rC   r   ÚdictÚupdate)r9   rh   r   Úmergeds       r=   Ú_merge_args_extraz"_DeprecatedProxy._merge_args_extra-  s;   € à”YÔ)ˆ
Øð 	ØˆMÝ�f‘”ˆØ�Š�jÑ!Ô!Ð!Øˆr?   c                 ó   — h d£}| |v S )zâHeuristic to detect common mutating methods on built-in collections.

        This is intentionally conservative and only covers the most common mutating APIs on built-in container types
        (lists, dicts, sets).

        >
   ÚaddÚpopÚclearÚappendÚextendÚinsertÚremoverx   ÚdiscardÚ
setdefaultrl   )r'   Úmutating_namess     r=   Ú_is_potential_mutatorz&_DeprecatedProxy._is_potential_mutator6  s    € ð
ð 
ð 
ˆð �~Ð%Ð%r?   c                 ó  ‡ ‡— ‰                       ¦   «          t          ‰                      ¦   «         ‰¦  «        }‰ j        j        r=t          |¦  «        r.‰                      ‰¦  «        rdt          dt          ddfˆˆ fd„}|S |S )a?  Forward attribute lookup to the active object, emitting a deprecation warning.

        In read-only mode, common mutating methods on built-in collections (for example, ``append`` or ``update``) are
        wrapped so that calling them raises :class:`AttributeError` instead of mutating the underlying object.

        Úargsrh   r)   Nc                  ó:   •— ‰                      d‰› d�¦  «         d S )NzCalling mutating method 'ra   )rc   )rˆ   rh   r'   r9   s     €€r=   Ú_guarded_mutatorz6_DeprecatedProxy.__getattr__.<locals>._guarded_mutator\  s)   ø€ Ø×%Ò%Ð&IÀ$Ð&IÐ&IÐ&IÑJÔJÐJÐJÐJr?   )r^   r8   rg   rC   r#   rU   r†   r   )r9   r'   ÚattrrŠ   s   ``  r=   Ú__getattr__z_DeprecatedProxy.__getattr__P  s­   øø€ ð 	�
Š
‰ŒˆÝ�t×'Ò'Ñ)Ô)¨4Ñ0Ô0ˆàŒ9Ôð 	$¥8¨D¡>¤>ð 	$°d×6PÒ6PÐQUÑ6VÔ6Vð 	$ðK­ð Kµsð K¸tð Kð Kð Kð Kð Kð Kð Kð $Ð#Øˆr?   Úvaluec                 ó~   — |                       d|› d�¦  «         t          |                      ¦   «         ||¦  «         dS )z¥Forward attribute mutation to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zSetting attribute 'ra   N)rc   Úsetattrrg   )r9   r'   r�   s      r=   r7   z_DeprecatedProxy.__setattr__b  sH   € ð 	×ÒÐ;°DÐ;Ð;Ð;Ñ<Ô<Ð<Ý�× Ò Ñ"Ô" D¨%Ñ0Ô0Ð0Ð0Ð0r?   c                 ó|   — |                       d|› d�¦  «         t          |                      ¦   «         |¦  «         dS )z¥Forward attribute deletion to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zDeleting attribute 'ra   N)rc   Údelattrrg   )r9   r'   s     r=   Ú__delattr__z_DeprecatedProxy.__delattr__l  sF   € ð 	×ÒÐ<°TÐ<Ð<Ð<Ñ=Ô=Ð=Ý�× Ò Ñ"Ô" DÑ)Ô)Ð)Ð)Ð)r?   Úkeyc                 ó^   — |                       ¦   «          |                      ¦   «         |         S )zNForward subscript lookup to the active object, emitting a deprecation warning.)r^   rg   ©r9   r“   s     r=   Ú__getitem__z_DeprecatedProxy.__getitem__z  s&   € à�
Š
‰ŒˆØ×ÒÑ!Ô! #Ô&Ð&r?   c                 óf   — |                       d|› d�¦  «         ||                      ¦   «         |<   dS )z¥Forward subscript mutation to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zSetting item 'ra   N©rc   rg   )r9   r“   r�   s      r=   Ú__setitem__z_DeprecatedProxy.__setitem__  s@   € ð 	×ÒÐ5¨sÐ5Ð5Ð5Ñ6Ô6Ð6Ø"'ˆ×ÒÑÔ˜3ÑÐÐr?   c                 ób   — |                       d|› d�¦  «         |                      ¦   «         |= dS )z¥Forward subscript deletion to the active object, raising in read-only mode.

        Raises:
            AttributeError: If the proxy is in read-only mode.

        zDeleting item 'ra   Nr˜   r•   s     r=   Ú__delitem__z_DeprecatedProxy.__delitem__‰  s>   € ð 	×ÒÐ6°Ð6Ð6Ð6Ñ7Ô7Ð7Ø×ÒÑÔ˜sÐ#Ð#Ð#r?   c                 óD   — t          |                      ¦   «         ¦  «        S )z>Return length of the active object without emitting a warning.)Úlenrg   rB   s    r=   Ú__len__z_DeprecatedProxy.__len__—  s   € å�4×#Ò#Ñ%Ô%Ñ&Ô&Ð&r?   c                 ól   — |                       ¦   «          t          |                      ¦   «         ¦  «        S )z?Iterate over the active object, emitting a deprecation warning.)r^   Úiterrg   rB   s    r=   Ú__iter__z_DeprecatedProxy.__iter__›  s)   € à�
Š
‰ŒˆÝ�D×$Ò$Ñ&Ô&Ñ'Ô'Ð'r?   Úitemc                 ó.   — ||                       ¦   «         v S )zACheck membership in the active object without emitting a warning.)rg   )r9   r¢   s     r=   Ú__contains__z_DeprecatedProxy.__contains__   s   € à�t×'Ò'Ñ)Ô)Ð)Ð)r?   rˆ   c                 óê  ‡— t                                | d¦  «        }t                                | d¦  «        }|j        t          j        u r_|j        pi }|D ]}|‰v r|                      |¬¦  «         Œ|                      ‰¦  «        }|                      |¦  «        } |j	        |i |¤ŽS t          |j        ¦  «        r•|j        rŽ|j        pi }|D ]}|‰v r|                      |¬¦  «         Œt          ˆfd„|D ¦   «         ¦  «        s|                      ¦   «          |                      ‰¦  «        }|                      |¦  «        } |j        |i |¤ŽS |                      ¦   «          t          |j        ¦  «        r  |j        |i |                      ‰¦  «        ¤ŽS |j        t          j        u r |                      ¦   «         |i ‰¤ŽS  |                      ¦   «         |i |                      ‰¦  «        ¤ŽS )aQ  Call the active object, emitting a deprecation warning conditionally based on target mode.

        Branching logic:
        - :attr:`~deprecate._types.TargetMode.ARGS_REMAP`: warn only when a deprecated kwarg name is present in the
          call; remap, merge ``args_extra``, and call ``obj``.
        - Callable target with ``args_mapping``: warn per deprecated kwarg present; if none of the old names were
          passed still warn at the callable level (class is deprecated); remap, merge ``args_extra``, and forward to
          target.
        - Callable target without ``args_mapping``: warn (global budget), merge ``args_extra``, and forward to target.
        - :attr:`~deprecate._types.TargetMode.NOTIFY`: always warn (global budget) and forward kwargs unchanged;
          ``args_extra`` is intentionally ignored (misconfig).

        r/   r-   rF   c              3   ó    •K  — | ]}|‰v V — Œ	d S rk   rl   )rm   Úold_keyrh   s     €r=   ú	<genexpr>z,_DeprecatedProxy.__call__.<locals>.<genexpr>Æ  s(   øè è € Ð@Ð@¨W�w &Ð(Ð@Ð@Ð@Ð@Ð@Ð@r?   )r6   rA   r   r
   r4   r   r^   ru   rz   r&   rU   ÚanyÚNOTIFYrg   )r9   rˆ   rh   rZ   r:   Úmappingr§   Úmapped_kwargss     `     r=   Ú__call__z_DeprecatedProxy.__call__¨  s*  ø€ õ ×%Ò% dÐ,<Ñ=Ô=ˆÝ×%Ò% dÐ,FÑGÔGˆàŒ:�Ô.Ð.Ð.ØÔ&Ð,¨"ˆGØ"ð 1ð 1�Ø˜fÐ$Ð$Ø—J’J¨�JÑ0Ô0Ð0øØ ×4Ò4°VÑ<Ô<ˆMØ ×2Ò2°=ÑAÔAˆMØ�3”7˜DÐ2 MÐ2Ð2Ð2Ý�C”JÑÔð 
	6 CÔ$4ð 
	6ØÔ&Ð,¨"ˆGØ"ð 1ð 1�Ø˜fÐ$Ð$Ø—J’J¨�JÑ0Ô0Ð0øÝÐ@Ð@Ð@Ð@¸Ð@Ñ@Ô@Ñ@Ô@ð à—
’
‘”�Ø ×4Ò4°VÑ<Ô<ˆMØ ×2Ò2°=ÑAÔAˆMØ�3”:˜tÐ5 }Ð5Ð5Ð5ð 	�
Š
‰ŒˆÝ�C”JÑÔð 	GØ�3”:˜tÐF t×'=Ò'=¸fÑ'EÔ'EÐFÐFÐFàŒ:�Ô*Ð*Ð*Ø%�4×#Ò#Ñ%Ô% tÐ6¨vÐ6Ð6Ð6ð "ˆt×ÒÑ!Ô! 4ÐJ¨4×+AÒ+AÀ&Ñ+IÔ+IÐJÐJÐJr?   Úotherc                 ó‚   — | j         j        }t          |t          ¦  «        r|j         j        }t	          ||k    ¦  «        S )z'Compare the source object for equality.)rC   r&   r1   r   r2   )r9   r®   r&   s      r=   Ú__eq__z_DeprecatedProxy.__eq__Ü  s9   € àŒiŒmˆÝ�eÕ-Ñ.Ô.ð 	#Ø”J”NˆEÝ�C˜5’LÑ!Ô!Ð!r?   c                 ó.   — |                       |¦  «         S )zReturn the inverse of equality.)r°   )r9   r®   s     r=   Ú__ne__z_DeprecatedProxy.__ne__ã  s   € à—;’;˜uÑ%Ô%Ð%Ð%r?   c                 ó4   — t          | j        j        ¦  «        S )z%Return the hash of the source object.)ÚhashrC   r&   rB   s    r=   Ú__hash__z_DeprecatedProxy.__hash__ç  ó   € å�D”I”MÑ"Ô"Ð"r?   c                 ó4   — t          | j        j        ¦  «        S )z!Return repr of the source object.)ÚreprrC   r&   rB   s    r=   Ú__repr__z_DeprecatedProxy.__repr__ï  r¶   r?   c                 ó4   — t          | j        j        ¦  «        S )z Return str of the source object.)rT   rC   r&   rB   s    r=   Ú__str__z_DeprecatedProxy.__str__ó  s   € å�4”9”=Ñ!Ô!Ð!r?   c                 óD   — t          |                      ¦   «         ¦  «        S )z<Return bool of the active object without emitting a warning.)r2   rg   rB   s    r=   Ú__bool__z_DeprecatedProxy.__bool__÷  s   € å�D×$Ò$Ñ&Ô&Ñ'Ô'Ð'r?   Úinstancec                 óx   — |                       ¦   «         }t          |t          ¦  «        rt          ||¦  «        S dS )uQ  Support ``isinstance(x, proxy)`` by delegating to the active class.

        Allows a proxy used as a deprecated class alias to work transparently with ``isinstance`` without emitting a
        warning â€” type checks are structural, not a use of the deprecated API.

        Returns False when the active object is not a type.

        F)rg   r1   Útype)r9   r¾   Úactives      r=   Ú__instancecheck__z"_DeprecatedProxy.__instancecheck__ÿ  s<   € ð ×!Ò!Ñ#Ô#ˆÝ�f�dÑ#Ô#ð 	0å˜h¨Ñ/Ô/Ð/Øˆur?   Úsubclassc                 óx   — |                       ¦   «         }t          |t          ¦  «        rt          ||¦  «        S dS )uù   Support ``issubclass(X, proxy)`` by delegating to the active class.

        Same rationale as :meth:`~deprecate.proxy._DeprecatedProxy.__instancecheck__` â€” no warning emitted.

        Returns False when the active object is not a type.

        F)rg   r1   rÀ   Ú
issubclass)r9   rÃ   rÁ   s      r=   Ú__subclasscheck__z"_DeprecatedProxy.__subclasscheck__  s>   € ð ×!Ò!Ñ#Ô#ˆÝ�f�dÑ#Ô#ð 	0õ ˜h¨Ñ/Ô/Ð/Øˆur?   )/rV   rW   Ú__qualname__r0   r   r   rT   r   rw   Úintr   r2   r>   Úpropertyr   rC   r	   rE   r^   rc   re   rg   ru   rz   Ústaticmethodr†   rŒ   r7   r’   r–   r™   r›   rž   r   r¡   r¤   r­   r6   r°   r²   rµ   r¹   r»   r½   rÂ   rÀ   rÆ   rl   r?   r=   r   r   1   s  € € € € € ð"ð "ðR Ø;?Ø/3ØØØØ0CØ&*ØØ%Ø(-ðQ6ð Q6ð Q6àðQ6ð ðQ6ð
 ðQ6ð ˜t C¨°#¬Ð$6Ô7Ô8ðQ6ð ˜T # s (œ^Ô,ðQ6ð ðQ6ð ðQ6ð ðQ6ð ˜ )Ô,Ô-ðQ6ð ˜s”mðQ6ð ðQ6ð ðQ6ð "&ðQ6ð  
ð!Q6ð Q6ð Q6ð Q6ðp ð]�lð ]ð ]ð ]ñ „Xð]ð ðXÐ'ð Xð Xð Xñ „XðXð 26ð Ið Ið I ¨#¤ð I¸$ð Ið Ið Ið IðV¨#ð °$ð ð ð ð ð ð˜ð ð ð ñ „Xðð˜Sð ð ð ð ðc¨$¨s°C¨x¬.ð c¸TÀ#ÀsÀ(¼^ð cð cð cð cð¨¨S°#¨X¬ð ¸4ÀÀSÀ¼>ð ð ð ð ð ð& Cð &¨Dð &ð &ð &ñ „\ð&ð2 ð ¨ð ð ð ð ð$1 ð 1¨Cð 1°Dð 1ð 1ð 1ð 1ð* ð *¨ð *ð *ð *ð *ð'˜sð ' sð 'ð 'ð 'ð 'ð
(˜sð (¨3ð (°4ð (ð (ð (ð (ð$˜sð $ tð $ð $ð $ð $ð'˜ð 'ð 'ð 'ð 'ð(˜( 3œ-ð (ð (ð (ð (ð
* ð *¨ð *ð *ð *ð *ð.K˜cð .K¨Sð .K°Sð .Kð .Kð .Kð .Kðh"˜Fð " tð "ð "ð "ð "ð&˜Fð & tð &ð &ð &ð &ð#˜#ð #ð #ð #ð #ð#˜#ð #ð #ð #ð #ð"˜ð "ð "ð "ð "ð(˜$ð (ð (ð (ð (ð¨&ð °Tð ð ð ð ð¨$ð °4ð ð ð ð ð ð r?   r   r   r   Fr   )
r   r   r    r!   r"   r   r   Úupdate_docstringr$   r%   r   r   r   r    r!   r(   r"   r   r   rË   r$   )r   ÚrstÚmkdocsÚmarkdownr%   r)   c       
         óN   ‡ ‡‡‡‡‡‡‡‡‡	‡
— dt           ddfˆ
ˆˆˆˆ	ˆˆˆˆ ˆˆfd„}|S )uï  Decorator factory for deprecating class definitions with optional target redirection.

    Apply ``@deprecated_class(...)`` to an Enum or dataclass to wrap the class in a
    :class:`~deprecate.proxy._DeprecatedProxy`.  All attribute, item, and call access on the resulting object will
    emit a deprecation warning and, if *target* is provided, will be forwarded to the replacement class.

    Args:
        target: Optional replacement class to redirect all access to.
        deprecated_in: Version string when the class was deprecated.
        remove_in: Version string when the class will be removed.
        num_warns: Maximum number of warnings to emit per proxy instance. ``1`` warns once; ``-1`` warns on every
            access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used (callable-target, no-target, or
            per-argument for ``args_mapping``).  Available ``%``-style placeholders:

            - ``%(source_name)s`` â€” the deprecated class name (taken from ``cls.__name__``)
            - ``%(deprecated_in)s`` â€” value of the ``deprecated_in`` argument
            - ``%(remove_in)s`` â€” value of the ``remove_in`` argument
            - ``%(target_name)s`` â€” target class name (only when *target* is callable)
            - ``%(target_path)s`` â€” fully-qualified target path (only when *target* is callable)
            - ``%(argument_map)s`` â€” formatted ``\`old\` -> \`new\``` string (only for per-argument warnings
              emitted by ``args_mapping``)

            Example: ``"v%(deprecated_in)s: ``%(source_name)s`` -> ``%(target_name)s``"``.
        args_mapping: Optional dict remapping keyword argument names when the decorated class is called.  Keys are
            old argument names; values are new names, or ``None`` to drop the argument entirely.  When provided
            without an explicit callable *target*, the mode auto-resolves to
            :attr:`~deprecate._types.TargetMode.ARGS_REMAP`: the proxy warns **only when an old argument name is
            actually used** in the call, matching the per-argument warning behaviour of
            ``@deprecated(target=TargetMode.ARGS_REMAP, args_mapping=...)``.  Passing ``args_mapping`` together with
            ``target=TargetMode.NOTIFY`` is a misconfiguration and emits a :class:`UserWarning` at decoration time
            (will be :class:`TypeError` in v1.0).  Similarly, ``target=TargetMode.ARGS_REMAP`` without
            ``args_mapping`` emits a :class:`UserWarning` at decoration time.
        args_extra: Optional dict of extra keyword arguments merged into the forwarded call after ``args_mapping`` has
            been applied.  Caller-supplied values override entries with the same key.  Ignored when ``target`` is
            :attr:`~deprecate._types.TargetMode.NOTIFY` (passing both emits a :class:`UserWarning` at decoration
            time; will be :class:`TypeError` in v1.0).
        update_docstring: If ``True``, inject a deprecation notice into the class docstring at decoration time (same
            behaviour as ``@deprecated(update_docstring=True)``).
        docstring_style: Output style for the injected notice when ``update_docstring=True``.  ``"auto"`` detects the
            doc engine at decoration time; ``"rst"`` emits a ``.. deprecated::`` directive; ``"mkdocs"`` /
            ``"markdown"`` emit a ``!!! warning`` admonition.

    Returns:
        A decorator that wraps the class in a :class:`~deprecate.proxy._DeprecatedProxy`.

    Examples:
        >>> from enum import Enum
        >>> class NewColor(Enum):
        ...     RED = 1
        >>> @deprecated_class(target=NewColor, deprecated_in="1.0", remove_in="2.0", stream=None)
        ... class OldColor(Enum):
        ...     RED = 1
        >>> OldColor.RED is NewColor.RED
        True
        >>> OldColor(1) is NewColor.RED
        True

        When only argument names changed, omit *target* and supply ``args_mapping``. The proxy auto-resolves to
        :attr:`~deprecate._types.TargetMode.ARGS_REMAP` and warns **only when the old argument name is passed**:

        >>> class Config:
        ...     def __init__(self, timeout: int = 0) -> None:
        ...         self.timeout = timeout
        >>> LegacyConfig = deprecated_class(
        ...     args_mapping={"time_limit": "timeout"},
        ...     deprecated_in="1.5", remove_in="2.0", stream=None,
        ... )(Config)
        >>> LegacyConfig(timeout=30).timeout     # new name â€” no remap needed
        30
        >>> LegacyConfig(time_limit=30).timeout  # old name â€” remapped to timeout
        30

    Úclsr)   r   c                 ól  •— ‰
�)‰s'‰s%t          j        d| j        › d�t          d¬¦  «         t	          | | j        ‰‰	‰‰
‰d‰‰‰‰‰¬¦  «        }‰rdt          j        t                               |d¦  «        |j	        ¬¦  «        }t          |¦  «         t                               |d|j        ¦  «         |S )	Nz`@deprecated_class` on `ú®` has no `deprecated_in` set. Deprecation notices and generated documentation will omit the `deprecated_in` version. Pass `deprecated_in` for a meaningful deprecation notice.é   rP   F)r&   r'   r   r   r    r!   r"   r#   r   r   r   r$   r%   r0   )r0   r/   )ÚwarningsÚwarnrV   ÚUserWarningr   ÚtypesÚSimpleNamespacer6   rA   rE   r   r7   r0   )rÐ   ÚproxyÚshimr%   r   r   r   r$   r    r   r!   r   r"   rË   s      €€€€€€€€€€€r=   Ú	decoratorz#deprecated_class.<locals>.decoratory  sò   ø€ ØÐ mÐ¸LÐÝŒMðM¨3¬<ð Mð Mð Mõ Øðñ ô ð õ !ØØ”Ø'ØØØØ%ØØØ%Ø!Ø+Ø$;ð
ñ 
ô 
ˆð ð 	?õ Ô(µ×1HÒ1HÈÐPYÑ1ZÔ1ZÐkpÔkuÐvÑvÔvˆDÝ.¨tÑ4Ô4Ð4Ý×Ò˜u i°´Ñ>Ô>Ð>Øˆr?   )rÀ   )r   r   r   r    r!   r"   r   r   rË   r$   r%   rÛ   s   ``````````` r=   Údeprecated_classrÜ     sv   øøøøøøøøøøø€ ðv•tð Ð 2ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðB Ðr?   )r'   r   r   r    r!   r"   r#   r   r&   r'   r#   c                óª   — |pt          | ¦  «        j        }	|�$|s"|s t          j        d|	› d�t          d¬¦  «         t          | |	|||||||¬¦	  «	        S )u	  Wrap any Python object with deprecation warnings.

    Returns a :class:`~deprecate.proxy._DeprecatedProxy` that transparently forwards all read access to *obj* while
    emitting a :class:`FutureWarning`.  In *read-only* mode any write attempt through the proxy raises
    :class:`AttributeError`.

    Args:
        obj: The object to deprecate (dict, list, custom object, â€¦).
        name: Display name for *obj* used in the warning message. When omitted, the type name of *obj* is used
            (e.g. ``"dict"``).
        deprecated_in: Version string when *obj* was deprecated.
        remove_in: Version string when *obj* will be removed.
        num_warns: Maximum number of warnings to emit. ``1`` (default) warns once; ``-1`` warns on every access.
        stream: Callable used to emit warnings. Defaults to :data:`~deprecate.deprecation.deprecation_warning`
            (:class:`FutureWarning`).  Pass ``None`` to suppress warnings.
        template_mgs: Optional custom warning message template that overrides the built-in templates.  When ``None``
            (default), the built-in template for the active scenario is used.  See
            :func:`~deprecate.proxy.deprecated_class` for the available ``%``-style placeholders.
        read_only: If ``True``, raise :class:`AttributeError` on any write attempt through the proxy.
            Only the following standard collection mutator names are intercepted: ``append``, ``clear``,
            ``discard``, ``extend``, ``insert``, ``pop``, ``remove``, ``setdefault``, ``update``, ``add``.
            Custom method names (e.g. ``register()``, ``reload()``, ``set_value()``) are not blocked.
        args_extra: Optional dict of extra keyword arguments merged into the forwarded call when the proxy is invoked.
            Caller-supplied values override entries with the same key.

    Returns:
        A :class:`~deprecate.proxy._DeprecatedProxy` wrapping *obj*.

    Example:
        >>> cfg = {"threshold": 0.5, "enabled": True}
        >>> proxy = deprecated_instance(
        ...     cfg,
        ...     name="config_dict",
        ...     deprecated_in="1.0",
        ...     remove_in="2.0",
        ...     stream=None,
        ... )
        >>> proxy["threshold"]
        0.5
        >>> proxy.get("enabled")
        True

    Nz`deprecated_instance()` on `rÒ   rÓ   rP   )	r&   r'   r   r   r    r!   r"   r#   r   )rÀ   rV   rÔ   rÕ   rÖ   r   )
r&   r'   r   r   r    r!   r"   r#   r   Úresolved_names
             r=   Údeprecated_instancerß   �  s—   € ðn Ð.�D ™IœIÔ.€MØÐ -Ð¸ÐÝŒðI¨=ð Ið Ið Iõ Øð	
ñ 	
ô 	
ð 	
õ ØØØ#ØØØØ!ØØð
ñ 
ô 
ð 
r?   rk   )#r0   r×   rÔ   Úcollections.abcr   Útypingr   r   r   r   r   Údeprecate._typesr	   r
   r   Údeprecate.deprecationr   r   r   r   r   r   Údeprecate.docstring.injectr   r   r   rÈ   Ú__annotations__r   rT   rw   r2   rÀ   rÜ   rß   rl   r?   r=   ú<module>ræ      s  ððð ð ð4 €€€Ø €€€Ø $Ð $Ð $Ð $Ð $Ð $Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9à HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ HÐ Hðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð eÐ dÐ dÐ dÐ dÐ dÐ dÐ dð
 &'Ð ˜sÐ &Ð &Ñ &ðjð jð jð jð jñ jô jð jð\ ð|ð ØØØ,?Ø"&Ø7;Ø+/Ø"ØDJØ$)ð|ð |ð |Øð|ð ð|ð ð	|ð
 ð|ð �X˜iÔ(Ô)ð|ð ˜3”-ð|ð ˜4  X¨c¤]Ð 2Ô3Ô4ð|ð ˜˜c 3˜hœÔ(ð|ð ð|ð Ð@ÔAð|ð "ð|ð ˆtˆfÐ(Ð(Ô)ð|ð |ð |ð |ðD ØØØØ,?Ø"&ØØ+/ðJð Jð JØ	ðJð ðJð ð	Jð
 ðJð ðJð �X˜iÔ(Ô)ðJð ˜3”-ðJð ðJð ˜˜c 3˜hœÔ(ðJð ðJð Jð Jð Jð Jð Jr?   