Ë
    éÿæií  ã                  óˆ   — d dl mZ d dlmZmZ d dlZd dlmZm	Z	 d dl
Z
d
d„Z ej                  d¬«       G d„ d	«      «       Zy)é    )Úannotations)ÚCallableÚMutableMappingN)ÚAnyÚLiteralc                óD   — | si S t        | t        «      rt        | «      S | S )zŠConvert Token.attrs set as ``None`` or ``[[key, value], ...]`` to a dict.

    This improves compatibility with upstream markdown-it.
    )Ú
isinstanceÚlistÚdict)Úvalues    úf/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/markdown_it/token.pyÚconvert_attrsr   	   s%   € ñ
 Øˆ	Ü�%œÔÜ�E‹{ÐØ€Ló    T)Úslotsc                  ó”  — e Zd ZU ded<   	 ded<   	 ded<   	  ej
                  e¬«      Zded<   	 d	Zd
ed<   	 dZ	ded<   	 d	Z
ded<   	 dZded<   	 dZded<   	 dZded<   	  ej
                  e¬«      Zded<   	 dZded<   	 dZded<   	 d'd„Zd(d„Zd)d„Zd*d„Zd+d„Zd,d „Zd-d!„Zd.d"„Zd#d#d	d	ed$œ	 	 	 	 	 	 	 	 	 	 	 d/d%„Zed0d&„«       Zy	)1ÚTokenÚstrÚtypeÚtagzLiteral[-1, 0, 1]Únesting)Údefault_factoryzdict[str, str | int | float]ÚattrsNzlist[int] | NoneÚmapr   ÚintÚlevelzlist[Token] | NoneÚchildrenÚ ÚcontentÚmarkupÚinfozdict[Any, Any]ÚmetaFÚboolÚblockÚhiddenc                ó8   — t        | j                  «      | _        y ©N)r   r   ©Úselfs    r   Ú__post_init__zToken.__post_init__M   s   € Ü" 4§:¡:Ó.ˆ�
r   c                ó¸   — t        j                  dt        «       || j                  vryt	        | j                  j                  «       «      j                  |«      S )NzEToken.attrIndex should not be used, since Token.attrs is a dictionaryéÿÿÿÿ)ÚwarningsÚwarnÚUserWarningr   r
   ÚkeysÚindex©r(   Únames     r   Ú	attrIndexzToken.attrIndexP   sF   € Ü�‰ØSÜô	
ð �t—z‘zÑ!ØÜ�D—J‘J—O‘OÓ%Ó&×,Ñ,¨TÓ2Ð2r   c                óH   — t        | j                  j                  «       «      S )zGet (key, value) list of attrs.)r
   r   Úitemsr'   s    r   Ú	attrItemszToken.attrItemsY   s   € ä�D—J‘J×$Ñ$Ó&Ó'Ð'r   c                ó2   — |\  }}| j                  ||«       y)zAAdd `[ name, value ]` attribute to list. Init attrs if necessary.N)ÚattrSet)r(   ÚattrDatar2   r   s       r   ÚattrPushzToken.attrPush]   s   € à‰ˆˆeØ�‰�T˜5Õ!r   c                ó"   — || j                   |<   y)z>Set `name` attribute to `value`. Override old value if exists.N)r   )r(   r2   r   s      r   r8   zToken.attrSetb   s   € à ˆ�
‰
�4Òr   c                ó:   — | j                   j                  |d«      S )z@Get the value of attribute `name`, or null if it does not exist.N)r   Úgetr1   s     r   ÚattrGetzToken.attrGetf   s   € à�z‰z�~‰~˜d DÓ)Ð)r   c                óÜ   — || j                   v rO| j                   |   }t        |t        «      st        d| j                   |   › �«      ‚|› d|› �| j                   |<   y|| j                   |<   y)z‘Join value to existing attribute via space.
        Or create new attribute if not exists.
        Useful to operate with token classes.
        z#existing attr 'name' is not a str: Ú N)r   r	   r   Ú	TypeError)r(   r2   r   Úcurrents       r   ÚattrJoinzToken.attrJoinj   sr   € ð
 �4—:‘:ÑØ—j‘j Ñ&ˆGÜ˜g¤sÔ+ÜØ9¸$¿*¹*ÀTÑ:JÐ9KÐLóð ð #* ¨!¨E¨7Ð3ˆD�J‰J�tÒà$ˆD�J‰J�tÒr   c                ó.   — t        j                  | fi |¤ŽS )z&Return a shallow copy of the instance.)ÚdcÚreplace)r(   Úchangess     r   Úcopyz
Token.copyy   s   € ä�z‰z˜$Ñ* 'Ñ*Ð*r   T)r   Úas_upstreamÚmeta_serializerÚfilterÚdict_factoryc          
     ó¾  ‡ ‡—  |ˆ fd„t        j                  ‰ «      D «       «      }‰r |ˆfd„|j                  «       D «       «      }|r6d|v r2|d   sdn'|d   j                  «       D ��cg c]	  \  }}||g‘Œ c}}|d<   |rd|v r ||d   «      |d<   |r<|j                  dd«      r*|d   D �	cg c]  }	|	j	                  |‰|||¬«      ‘Œ c}	|d<   |S c c}}w c c}	w )aê  Return the token as a dictionary.

        :param children: Also convert children to dicts
        :param as_upstream: Ensure the output dictionary is equal to that created by markdown-it
            For example, attrs are converted to null or lists
        :param meta_serializer: hook for serializing ``Token.meta``
        :param filter: A callable whose return code determines whether an
            attribute or element is included (``True``) or dropped (``False``).
            Is called with the (key, value) pair.
        :param dict_factory: A callable to produce dictionaries from.
            For example, to produce ordered dictionaries instead of normal Python
            dictionaries, pass in ``collections.OrderedDict``.

        c              3  ób   •K  — | ]&  }|j                   t        ‰|j                   «      f–— Œ( y ­wr&   )r2   Úgetattr)Ú.0Úfr(   s     €r   Ú	<genexpr>z Token.as_dict.<locals>.<genexpr>”   s&   øè ø€ ÐXÉÀ1 §¡¬°°a·f±fÓ(=Ô>Éùs   ƒ,/c              3  ó@   •K  — | ]  \  }} ‰||«      sŒ||f–— Œ y ­wr&   © )rP   ÚkÚvrK   s      €r   rR   z Token.as_dict.<locals>.<genexpr>–   s$   øè ø€ Ð"V±o©d¨a°ÉÐPQÐSTÍ A q¤6±oùs   ƒ•	r   Nr!   r   )r   rK   rL   rI   rJ   )rE   Úfieldsr5   r=   Úas_dict)
r(   r   rI   rJ   rK   rL   ÚmappingrU   rV   Úchilds
   `   `     r   rX   zToken.as_dict}   s  ù€ ñ. ÓXÌÏ	É	ÐRVÌÓXÓXˆÙÙ"Ó"V°g·m±m´oÓ"VÓVˆGÙ˜7 gÑ-ð ˜wÒ'ñ à)0°Ñ)9×)?Ñ)?Ô)AÔBÑ)A¡  A�q˜!’fÐ)AÒBð �GÑñ
 ˜v¨Ñ0Ù-¨g°f©oÓ>ˆG�F‰OÙ˜Ÿ™ J°Ô5ð % ZÒ0ó	#ñ 1�Eð —‘Ø%Ø!Ø!-Ø +Ø$3ð õ ð 1ñ	#ˆG�JÑð ˆùó Cùò
	#s   Á+CÂ/Cc                ó”   —  | di |¤Ž}|j                   r.|j                   D �cg c]  }| j                  |«      ‘Œ c}|_         |S c c}w )zConvert a dict to a Token.rT   )r   Ú	from_dict)ÚclsÚdctÚtokenÚcs       r   r\   zToken.from_dict¬   sD   € ñ ‘
�c‘
ˆØ�>Š>Ø8=¿ºÓG¹°1˜cŸm™m¨AÕ.¸ÑGˆEŒNØˆùò Hs   £A)ÚreturnÚNone)r2   r   ra   r   )ra   z#list[tuple[str, str | int | float]])r9   ztuple[str, str | int | float]ra   rb   )r2   r   r   zstr | int | floatra   rb   )r2   r   ra   zNone | str | int | float)r2   r   r   r   ra   rb   )rG   r   ra   r   )r   r"   rI   r"   rJ   z&Callable[[dict[Any, Any]], Any] | NonerK   z!Callable[[str, Any], bool] | NonerL   z'Callable[..., MutableMapping[str, Any]]ra   úMutableMapping[str, Any])r^   rc   ra   r   )Ú__name__Ú
__module__Ú__qualname__Ú__annotations__rE   Úfieldr   r   r   r   r   r   r   r    r!   r#   r$   r)   r3   r6   r:   r8   r>   rC   rH   rX   Úclassmethodr\   rT   r   r   r   r      sV  … à
ƒIØ;à	ƒHØ!àÓðð +3¨"¯(©(À4Ô*H€EÐ'ÓHðð
 !€CÐ	Ó Ø=à€Eˆ3ƒNØ2à#'€HÐ Ó'Ø7à€GˆSÓØUà€FˆCÓØ?à€Dˆ#ƒNðð $˜2Ÿ8™8°DÔ9€Dˆ.Ó9Ø9à€Eˆ4Óðð €FˆDÓðó/ó3ó(ó"ó
!ó*ó%ó+ð Ø ØBFØ48Ø@Dñ-ð ð-ð ð	-ð
 @ð-ð 2ð-ð >ð-ð 
"ó-ð^ òó ñr   r   )r   r   ra   r   )Ú
__future__r   Úcollections.abcr   r   ÚdataclassesrE   Útypingr   r   r,   r   Ú	dataclassr   rT   r   r   Ú<module>ro      s@   ðÝ "ç 4Û ß Û ó	ð €‡��DÔ÷\ð \ó ñ\r   