§
    8j,  ã                  ó&  — U d Z ddlmZ ddlZddlZddlmZ  ej        e 	                    dd¬¦  «        d         ¦  «        Z
e
                      ej        ¦   «         ¦  «         dd
„Z e¦   «          dZi Zded<   dd„Zdd„Z G d„ d¦  «        ZdS )a  Multicast DNS Service Discovery for Python, v0.14-wmcbrine
    )
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine

This module provides a framework for the use of DNS Service Discovery
using IP multicast.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
é    )ÚannotationsN)ÚAnyú.é   )ÚmaxsplitÚreturnÚNonec                 ó†   — t           j        t          j        k    r&t                                t          j        ¦  «         d S d S )N)ÚlogÚlevelÚloggingÚNOTSETÚsetLevelÚWARN© ó    úF/home/user/adhan/venv/lib/python3.11/site-packages/zeroconf/_logger.pyÚset_logger_level_if_unsetr   "   s3   € Ý
„y•G”NÒ"Ð"ÝŠ•W”\Ñ"Ô"Ð"Ð"Ð"ð #Ð"r   i   údict[str, None]Ú
_seen_logsÚseenÚboolc                óš   — 	 |                       t          t          | ¦  «        ¦  «        d¦  «         n# t          t          f$ r Y dS w xY wdS )u¥  Pop the oldest entry from ``seen``; return False if it raced.

    Individual dict ops (``pop`` with a default, ``next``) are atomic
    on the free-threaded build, but the compound ``iter`` â†’ ``next``
    used to pick the FIFO victim can raise ``RuntimeError`` if
    another thread mutates the dict between the two ops. The caller
    breaks its drain loop on False so concurrent mutation can't make
    it spin.
    NFT)ÚpopÚnextÚiterÚRuntimeErrorÚStopIteration)r   s    r   Ú_evict_oldestr   .   sX   € ðØŠ••d˜4‘j”jÑ!Ô! 4Ñ(Ô(Ð(Ð(øÝ-Ð(ð ð ð Øˆuˆuðøøøàˆ4s   ‚03 ³AÁAÚkeyÚstrc                óÆ   — || v}t          | ¦  «        t          |z
  k    r:t          | ¦  «        r+	 t          | ¦  «        t          |z
  k    rt          | ¦  «        °+|rd| |<   |S )aa  Record ``key`` in ``seen`` and return True if it was newly added.

    Bounds the dict so callers passing attacker-influenced keys (peer
    addresses, packet offsets) cannot grow it without bound. Evicts
    the oldest entries on overflow (dict preserves insertion order on
    Python 3.7+), so ``_MAX_SEEN_LOGS`` is a recency window.

    The dict is shared across all ``Zeroconf`` instances in the
    process; on the free-threaded build (3.14t) and under multi-
    instance sync use, callers can race the ``len < cap`` check and
    both insert, leaving the dict transiently above the cap. The
    drain loop runs on every call (steady-state-at-cap hits are a
    single ``len`` + compare past the membership check because the
    helper short-circuits) so a contention burst is corrected by the
    next caller regardless of whether it's a hit or a miss.
    N)ÚlenÚ_MAX_SEEN_LOGSr   )r   r    Ú	insertings      r   Ú
_mark_seenr&   ?   sq   € ð" ˜4€Iõ ˆd‰)Œ)•n yÑ0Ò
0Ð
0µ]À4Ñ5HÔ5HÐ
0Øõ ˆd‰)Œ)•n yÑ0Ò
0Ð
0µ]À4Ñ5HÔ5HÐ
0àð ØˆˆS‰	ØÐr   c                  ón   — e Zd Zedd„¦   «         Zedd„¦   «         Zedd„¦   «         Zedd„¦   «         ZdS )ÚQuietLoggerÚlogger_datar   r   r	   c                óÂ   — t          t          t          t          j        ¦   «         d         ¦  «        ¦  «        }|rt
          j        nt
          j        } ||pdgddiŽ d S )Nr   úException occurredÚexc_infoT)r&   r   r!   Úsysr,   r   ÚwarningÚdebug)Úclsr)   Ú
first_timeÚloggers       r   Úlog_exception_warningz!QuietLogger.log_exception_warning\   sZ   € å¥
­Cµ´±´¸qÔ0AÑ,BÔ,BÑCÔCˆ
Ø *Ð9•”µ´	ˆØˆÐ6Ð!5Ð 6ÐGÀ$ÐGÐGÐGÐGÐGr   c                ó    — t          t          t          t          j        ¦   «         d         ¦  «        ¦  «        }t          j        |pdgd|iŽ d S )Nr   r+   r,   )r&   r   r!   r-   r,   r   r/   )r0   r)   r1   s      r   Úlog_exception_debugzQuietLogger.log_exception_debugb   sH   € å¥
­Cµ´±´¸qÔ0AÑ,BÔ,BÑCÔCˆ
ÝŒ	KÐ9Ð$8Ð#9ÐPÀZÐPÐPÐPÐPÐPr   Úargsc                óv   — t          t          |d         ¦  «        rt          j        nt          j        } ||Ž  d S )Nr   ©r&   r   r   r.   r/   )r0   r6   r2   s      r   Úlog_warning_oncezQuietLogger.log_warning_onceg   s1   € å *­:°t¸A´wÑ ?Ô ?ÐN•”ÅSÄYˆØˆˆˆˆˆr   ÚexcÚ	Exceptionc                ó|   — t          t          |d         ¦  «        rt          j        nt          j        } ||d|iŽ d S )Nr   r,   r8   )r0   r:   r6   r2   s       r   Úlog_exception_oncezQuietLogger.log_exception_oncel   s=   € å *­:°t¸A´wÑ ?Ô ?ÐN•”ÅSÄYˆØˆÐ#˜sÐ#Ð#Ð#Ð#Ð#r   N)r)   r   r   r	   )r6   r   r   r	   )r:   r;   r6   r   r   r	   )Ú__name__Ú
__module__Ú__qualname__Úclassmethodr3   r5   r9   r=   r   r   r   r(   r(   [   sš   € € € € € ØðHð Hð Hñ „[ðHð
 ðQð Qð Qñ „[ðQð ðð ð ñ „[ðð ð$ð $ð $ñ „[ð$ð $ð $r   r(   )r   r	   )r   r   r   r   )r   r   r    r!   r   r   )Ú__doc__Ú
__future__r   r   r-   Útypingr   Ú	getLoggerr>   Úsplitr   Ú
addHandlerÚNullHandlerr   r$   r   Ú__annotations__r   r&   r(   r   r   r   ú<module>rJ      s(  ððð ð ð. #Ð "Ð "Ð "Ð "Ð "à €€€Ø 
€
€
€
Ø Ð Ð Ð Ð Ð à€gÔ˜Ÿš s°Q˜Ñ7Ô7¸Ô:Ñ;Ô;€Ø ‡‚Ð"ˆwÔ"Ñ$Ô$Ñ %Ô %Ð %ð#ð #ð #ð #ð
 Ð Ñ Ô Ð ð €Ø €
Ð  Ð  Ð  Ñ  ðð ð ð ð"ð ð ð ð8$ð $ð $ð $ð $ñ $ô $ð $ð $ð $r   