§
    §	Êj%  ã            	       óž  — d dl Z d dlZd dlZd dlmZmZmZ d dlmZ d dl	m
Z
mZmZ d dlmZmZ d dlmZ  ej        e¦  «        Zdedefd	„Zed
eeej        f         dedz  deeej        f         fd„¦   «         Zed
ej        dedz  dej        fd„¦   «         Zd
ej        dedz  dej        fd„Z G d„ deeej        f         ¦  «        ZdS )é    N)ÚMappingÚMutableMappingÚSequence)ÚNoneType)ÚTYPE_CHECKINGÚAnyÚoverload)Úassert_neverÚ
deprecated)ÚtypesÚkeyÚreturnc                 ó‚   — t          | ¦  «        j        t          j        upt          | ¦  «        j        t          j        uS ©N)ÚtypeÚ__str__ÚobjectÚ__repr__)r   s    úQC:\Projects\Muse2API\.venv\Lib\site-packages\opentelemetry/attributes/__init__.pyÚ_is_non_custom_strr      s/   € Ý�‰9Œ9Ô¥F¤NÐ2Ð_µd¸3±i´iÔ6HÕPVÔP_Ð6_Ð_ó    ÚvalueÚmax_string_value_lengthc                 ó   — d S r   © ©r   r   s     r   Ú_clean_attribute_valuer      s	   € ð $' 3r   c                 ó   — d S r   r   r   s     r   r   r   "   s	   € ð �Sr   c                 ó¦  ‡— t          | t          t          t          t          t
          f¦  «        r| S t          | t          ¦  «        r<‰�8t          | ¦  «        ‰k    r%t           	                    d‰¦  «         | d‰…         } | S t          | t          ¦  «        rt          ˆfd„| D ¦   «         ¦  «        S t          | t          ¦  «        r­i }|                      ¦   «         D ]”\  }}|st           	                    d|¦  «         Œ#t          |t          ¦  «        sIt           	                    dt          |¦  «        |¦  «         t          |¦  «        rt          |¦  «        }nŒ�t!          |‰¦  «        ||<   Œ•|S t"          rt%          | ¦  «         t           	                    dt          | ¦  «        ¦  «         t          | ¦  «        rt          | ¦  «        S dS )aŸ  Recursively checks if an attribute value is valid and cleans it if required.

    String values are truncated to max_string_value_length if provided.
    Anything that isn't of `types.AnyValue`, we attempt to cast to `str`.
    If this fails, the value is replaced with None. Sequence's are converted to tuples and mappings
    are copied into new dicts.

    Returns:
        The recursively cleaned AnyValue.
    Nz<String attribute value exceeds max length of %d, truncating.c              3   ó8   •K  — | ]}t          |‰¦  «        V — Œd S r   )r   )Ú.0Úvr   s     €r   ú	<genexpr>z)_clean_attribute_value.<locals>.<genexpr>B   s/   øè è € ÐWÐWÈAÕ+¨AÐ/FÑGÔGÐWÐWÐWÐWÐWÐWr   zSinvalid attribute key `%s`. must be non-empty string. Dropping key from attributes.z£Invalid type `%s` for attribute key `%s`, must be a str. Key's `__str__/__repr__` method will be called if it exists, otherwise the key/value pair will be dropped.zæInvalid type `%s` for attribute value. Expected one of bool, str, None, bytes, int, float or a Mapping or Sequence of those types. Value's __str__ method will be called if it exists, otherwise the value will be replaced with None.)Ú
isinstancer   ÚboolÚintÚfloatÚbytesÚstrÚlenÚ_loggerÚwarningr   Útupler   Úitemsr   r   r   r   r
   )r   r   Úcleaned_mappingr   Úvals    `   r   r   r   )   sð  ø€ õ �%�(¥D­#­uµeÐ<Ñ=Ô=ð ØˆÝ�%�ÑÔð Ø"Ð.µ3°u±:´:Ð@WÒ3WÐ3WÝ�OŠOØNØ'ñô ð ð Ð2Ð2Ð2Ô3ˆEØˆÝ�%�Ñ"Ô"ð XÝÐWÐWÐWÐWÐQVÐWÑWÔWÑWÔWÐWÝ�%�Ñ!Ô!ð Ø57ˆØŸš™œð 	Xð 	X‰HˆC�Øð Ý—’ØiØñô ð ð å˜c¥3Ñ'Ô'ð 	Ý—’ð zÝ˜‘I”IØñô ð õ
 & cÑ*Ô*ð Ý˜c™(œ(�C�CàÝ#9¸#Ð?VÑ#WÔ#WˆO˜CÑ Ð ØÐÝð Ý�UÑÔÐÝ‡O‚Oð	RåˆU‰Œñô ð õ
 ˜%Ñ Ô ð Ý�5‰zŒzÐØˆ4r   c                   ó  — e Zd ZdZe	 	 	 	 ddedz  dej        dededz  ddf
d	„¦   «         Z	e e
d
¦  «        	 	 	 	 	 ddedz  dej        dededz  deddfd„¦   «         ¦   «         Z		 	 	 	 	 ddedz  dej        dededz  deddfd„Z	defd„Zdedej        fd„Zdd„Zdedej        ddfd„Zdeeej        f         ddfd„Zdedej        ddfd„Zdeddfd„Zd„ Zdefd„Zdeeef         dd fd„Zdeeej        f         fd„ZdS ) ÚBoundedAttributesa  A dict with a fixed max capacity which cleans and potentially drops values to ensure they are valid attribute values.

    Args:
        maxlen: The maximum number of attributes to store, use None for no limit.
        attributes: The initial attributes to store.
        immutable: Defaults to true. Whether to allow adding/removing of attributes after the initialisation of the instance.
        max_value_len: The maximum length of string values, use None for no limit.
        extended_attributes: Deprecated. Kept for backwards compatibility. Extended attributes are now always used for attributes everywhere.

    When the dict is full and a new element is added, the oldest element is dropped. Attributes are made to be immutable when set in this container.
    So passing a mutable list as an attribute value, and then mutating it after will not change it's value in this container.
    NTÚmaxlenÚ
attributesÚ	immutableÚmax_value_lenr   c                 ó   — d S r   r   )Úselfr3   r4   r5   r6   s        r   Ú__init__zBoundedAttributes.__init__s   s	   € ð ˆsr   zæCreating BoundedAttributes with `extended_attributes` set is deprecated. The `extended_attributes` param is no longer used and will be removed in a future release. Extended attributes are now always used for attributes everywhere.FÚextended_attributesc                 ó   — d S r   r   ©r8   r3   r4   r5   r6   r:   s         r   r9   zBoundedAttributes.__init__|   s	   € ð ˆsr   c                 ó  — |�|dk     rt          d¦  «        ‚|�|dk     rt          d¦  «        ‚i | _        || _        d| _        || _        t          j        ¦   «         | _        d| _        |r|  	                    |¦  «         || _        d S )Nr   z.maxlen must be valid int greater or equal to 0z5max_value_len must be valid int greater or equal to 0F)
Ú
ValueErrorÚ_dictr3   Údroppedr6   Ú	threadingÚLockÚ_lockÚ
_immutableÚ
_set_itemsr<   s         r   r9   zBoundedAttributes.__init__‹   s˜   € ð Ð &¨1¢* *ÝÐMÑNÔNÐNØÐ$¨¸Ò):Ð):ÝÐTÑUÔUÐUØ02ˆŒ
ØˆŒØˆŒØ*ˆÔÝ”^Ñ%Ô%ˆŒ
àˆŒØð 	(Ø�OŠO˜JÑ'Ô'Ð'Ø#ˆŒˆˆr   c                 ó,   — t          | j        ¦  «        › S r   )Údictr?   ©r8   s    r   r   zBoundedAttributes.__repr__¢   s   € Ý�t”zÑ"Ô"Ð$Ð$r   r   c                 ó   — | j         |         S r   )r?   ©r8   r   s     r   Ú__getitem__zBoundedAttributes.__getitem__¥   s   € ØŒz˜#ŒÐr   c                 ó2   — | j         rt          d¦  «        ‚d S )Nz)Cannot mutate immutable BoundedAttributes)rD   Ú	TypeErrorrH   s    r   Ú_raise_if_immutablez%BoundedAttributes._raise_if_immutable¨   s(   € ØŒ?ð 	IÝÐGÑHÔHÐHð	Ið 	Ir   r   c                 ó  — |                       ¦   «          | j        �<| j        dk    r1| j        5  | xj        dz  c_        	 d d d ¦  «         d S # 1 swxY w Y   |rt	          |t
          ¦  «        sLt                               d|¦  «         | j        5  | xj        dz  c_        d d d ¦  «         n# 1 swxY w Y   d S t          || j	        ¦  «        }| j        5  |  
                    ||¦  «         d d d ¦  «         d S # 1 swxY w Y   d S )Nr   é   zIinvalid key `%s`. must be non-empty string. Dropping key from attributes.)rN   r3   rC   r@   r$   r)   r+   r,   r   r6   Ú_setitem_locked)r8   r   r   Úcleaneds       r   Ú__setitem__zBoundedAttributes.__setitem__¬   sÜ  € Ø× Ò Ñ"Ô"Ð"ØŒ;Ð" t¤{°aÒ'7Ð'7Ø”ð ð Ø�” Ñ!�”Øðð ð ñ ô ð ð ð ð ð ð ð øøøð ð ð ð ð ð 	�* S­#Ñ.Ô.ð 	Ý�OŠOØ[Øñô ð ð ”ð "ð "Ø�” Ñ!�”ð"ð "ð "ñ "ô "ð "ð "ð "ð "ð "ð "øøøð "ð "ð "ð "àˆFÝ(¨°Ô0BÑCÔCˆØŒZð 	/ð 	/Ø× Ò   gÑ.Ô.Ð.ð	/ð 	/ð 	/ñ 	/ô 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/ð 	/øøøð 	/ð 	/ð 	/ð 	/ð 	/ð 	/s5   ®AÁAÁAÂB.Â.B2Â5B2ÃC;Ã;C?ÄC?c                 óô  — |                       ¦   «          | j        �I| j        dk    r>| j        5  | xj        t	          |¦  «        z  c_        d d d ¦  «         n# 1 swxY w Y   d S t          || j        ¦  «        }| j        5  | xj        t	          |¦  «        t	          |¦  «        z
  z  c_        |                     ¦   «         D ]\  }}|                      ||¦  «         Œ	 d d d ¦  «         d S # 1 swxY w Y   d S )Nr   )	rN   r3   rC   r@   r*   r   r6   r.   rQ   )r8   r4   Úcleaned_attributesr   r   s        r   rE   zBoundedAttributes._set_items¾   s‚  € Ø× Ò Ñ"Ô"Ð"ØŒ;Ð" t¤{°aÒ'7Ð'7Ø”ð 0ð 0Ø�”¥ J¡¤Ñ/�”ð0ð 0ð 0ñ 0ô 0ð 0ð 0ð 0ð 0ð 0ð 0øøøð 0ð 0ð 0ð 0àˆFÝ;QÐR\Ð^bÔ^pÑ;qÔ;qÐØŒZð 	1ð 	1ØˆLŒL�C 
™OœO­cÐ2DÑ.EÔ.EÑEÑEˆLŒLØ0×6Ò6Ñ8Ô8ð 1ð 1‘
��UØ×$Ò$ S¨%Ñ0Ô0Ð0Ð0ð1ð	1ð 	1ð 	1ñ 	1ô 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1ð 	1øøøð 	1ð 	1ð 	1ð 	1ð 	1ð 	1s$   ®AÁAÁAÂAC-Ã-C1Ã4C1c                 óJ  — || j         v r| j         |= | j        �€t          | j         ¦  «        | j        k    rct                               d¦  «         | j         t          t          | j                              ¦   «         ¦  «        ¦  «        = | xj        dz  c_        || j         |<   d S )NzuAttributes dict is full. Dropping the oldest key-value pair from attributes to make space for the new key-value pair.rP   )	r?   r3   r*   r+   r,   ÚnextÚiterÚkeysr@   )r8   r   r   s      r   rQ   z!BoundedAttributes._setitem_lockedÊ   s—   € Ø�$”*ÐÐØ”
˜3�ØŒ;Ð"¥s¨4¬:¡¤¸$¼+Ò'EÐ'EÝ�OŠOð Hñô ð ð ”
�4¥ T¤Z§_¢_Ñ%6Ô%6Ñ 7Ô 7Ñ8Ô8Ð9ØˆLŒL˜AÑˆLŒLàˆŒ
�3‰ˆˆr   c                 ó>   — |                       ¦   «          | j        |= d S r   )rN   r?   rJ   s     r   Ú__delitem__zBoundedAttributes.__delitem__×   s!   € Ø× Ò Ñ"Ô"Ð"ØŒJ�sˆOˆOˆOr   c                 ó¼   — | j         rt          | j        ¦  «        S | j        5  t          t	          | j        ¦  «        ¦  «        cd d d ¦  «         S # 1 swxY w Y   d S r   )rD   rX   r?   rC   ÚlistrH   s    r   Ú__iter__zBoundedAttributes.__iter__Û   s�   € ØŒ?ð 	$Ý˜œ
Ñ#Ô#Ð#ØŒZð 	*ð 	*Ý�˜TœZÑ(Ô(Ñ)Ô)ð	*ð 	*ð 	*ð 	*ñ 	*ô 	*ð 	*ð 	*ð 	*ð 	*ð 	*ð 	*øøøð 	*ð 	*ð 	*ð 	*ð 	*ð 	*s   £!AÁAÁAc                 ó*   — t          | j        ¦  «        S r   )r*   r?   rH   s    r   Ú__len__zBoundedAttributes.__len__á   s   € Ý�4”:‰ŒÐr   Úmemoc                 ó   — t          | j        | j        | j        ¬¦  «        }||t	          | ¦  «        <   | j        5  t          j        | j        |¦  «        |_        | j	        |_	        d d d ¦  «         n# 1 swxY w Y   |S )N)r3   r5   r6   )
r2   r3   rD   r6   ÚidrC   ÚcopyÚdeepcopyr?   r@   )r8   ra   Úcopy_s      r   Ú__deepcopy__zBoundedAttributes.__deepcopy__ä   s»   € Ý!Ø”;Ø”oØÔ,ð
ñ 
ô 
ˆð
 ˆ�R�‰XŒX‰ØŒZð 	)ð 	)õ œ-¨¬
°DÑ9Ô9ˆEŒKØ œLˆEŒMð		)ð 	)ð 	)ñ 	)ô 	)ð 	)ð 	)ð 	)ð 	)ð 	)ð 	)øøøð 	)ð 	)ð 	)ð 	)ð
 ˆs   »,A3Á3A7Á:A7c                 ó4   — | j                              ¦   «         S r   )r?   rd   rH   s    r   rd   zBoundedAttributes.copyò   s   € ØŒz�ŠÑ Ô Ð r   )NNTN)NNTNF)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   r&   r   Ú
Attributesr%   r9   r   r)   r   ÚAnyValuerK   rN   rS   r   rE   rQ   r[   r^   r`   rG   r   rg   r   rd   r   r   r   r2   r2   e   s  € € € € € ðð ð ð "Ø'+ØØ$(ðð à�d‘
ðð Ô$ðð ð	ð
 ˜T‘zðð 
ðð ð ñ „Xðð Ø€Zð	bñô ð "Ø'+ØØ$(Ø$)ðð à�d‘
ðð Ô$ðð ð	ð
 ˜T‘zðð "ðð 
ðð ð ñô ñ „Xðð "Ø'+ØØ$(Ø$)ð$ð $à�d‘
ð$ð Ô$ð$ð ð	$ð
 ˜T‘zð$ð "ð$ð 
ð$ð $ð $ð $ð.%˜#ð %ð %ð %ð %ð˜sð  u¤~ð ð ð ð ðIð Ið Ið Ið/˜sð /¨5¬>ð /¸dð /ð /ð /ð /ð$
1 W¨S°%´.Ð-@Ô%Að 
1Àdð 
1ð 
1ð 
1ð 
1ð  3ð  ¨u¬~ð  À$ð  ð  ð  ð  ð˜sð  tð ð ð ð ð*ð *ð *ð˜ð ð ð ð ð  c¨3 h¤ð Ð4Gð ð ð ð ð!�n S¨%¬.Ð%8Ô9ð !ð !ð !ð !ð !ð !r   r2   )rd   ÚloggingrA   Úcollections.abcr   r   r   r   r   Útypingr   r   r	   Útyping_extensionsr
   r   Úopentelemetry.utilÚ	getLoggerri   r+   r%   r   r)   rn   r&   r   r2   r   r   r   ú<module>ru      sð  ðð €€€Ø €€€Ø Ð Ð Ð Ø =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ð =Ø Ð Ð Ð Ð Ð Ø /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ð /à 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à $Ð $Ð $Ð $Ð $Ð $à
ˆ'Ô
˜HÑ
%Ô
%€ð`˜Cð ` Dð `ð `ð `ð `ð 
ð'Ø�3˜œÐ&Ô'ð'à  4™Zð'ð ˆS�%”.Ð Ô!ð'ð 'ð 'ñ 
„ð'ð 
ðØŒ>ðà  4™Zðð „^ðð ð ñ 
„ðð9ØŒ>ð9à  4™Zð9ð „^ð9ð 9ð 9ð 9ðxN!ð N!ð N!ð N!ð N!˜ s¨E¬NÐ':Ô;ñ N!ô N!ð N!ð N!ð N!r   