§
    N=&b	  ã                   óz   — d Z dZddlmZ ddlmZ  G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        ZdS )z
Miscellaneous transforms.
ÚreStructuredTexté    )Únodes)Ú	Transformc                   ó   — e Zd ZdZdZd„ ZdS )ÚCallBacka�  
    Inserts a callback into a document.  The callback is called when the
    transform is applied, which is determined by its priority.

    For use with `nodes.pending` elements.  Requires a ``details['callback']``
    entry, a bound method or function which takes one parameter: the pending
    node.  Other data can be stored in the ``details`` attribute or in the
    object hosting the callback method.
    iÞ  c                 ót   — | j         } |j        d         |¦  «         |j                             |¦  «         d S )NÚcallback)Ú	startnodeÚdetailsÚparentÚremove)ÚselfÚpendings     ú:/usr/lib/python3/dist-packages/docutils/transforms/misc.pyÚapplyzCallBack.apply   s<   € Ø”.ˆØ#ˆŒ˜
Ô# GÑ,Ô,Ð,ØŒ×Ò˜gÑ&Ô&Ð&Ð&Ð&ó    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Údefault_priorityr   © r   r   r   r      s5   € € € € € ðð ð Ðð'ð 'ð 'ð 'ð 'r   r   c                   ó   — e Zd ZdZdZd„ ZdS )ÚClassAttributez|
    Move the "class" attribute specified in the "pending" node into the
    immediately following non-comment element.
    éÒ   c                 ób  — | j         }|j        }|}|rµt          |                     |¦  «        dz   t	          |¦  «        ¦  «        D ]v}||         }t          |t          j        ¦  «        st          |t          j        ¦  «        rŒ?|dxx         |j	        d         z  cc<   |j         
                    |¦  «          d S |}|j        }|°µ| j        j                             d|j	        d         z  t          j        |j        |j        ¦  «        |j        ¬¦  «        }|                     |¦  «         d S )Né   ÚclassesÚclassz,No suitable element following "%s" directiveÚ	directive©Úline)r
   r   ÚrangeÚindexÚlenÚ
isinstancer   Ú	InvisibleÚsystem_messager   r   ÚdocumentÚreporterÚerrorÚliteral_blockÚ	rawsourcer#   Úreplace_self)r   r   r   Úchildr%   Úelementr,   s          r   r   zClassAttribute.apply,   sD  € Ø”.ˆØ”ˆØˆØð 	'å˜vŸ|š|¨EÑ2Ô2°QÑ6½¸F¹¼ÑDÔDð 'ð '�Ø  œ-�Ý˜w­¬Ñ8Ô8ð Ý! '­5Ô+?Ñ@Ô@ðàØ˜	Ð"Ð"Ô" g¤o°gÔ&>Ñ>Ð"Ð"Ñ"Ø”×%Ò% gÑ.Ô.Ð.Ø��ð �Øœ�ð ð 	'ð ”Ô&×,Ò,Ø:ØŒo˜kÔ*ñ+åÔ Ô 1°7Ô3DÑEÔEØ”ð	 -ñ ô ˆð
 	×Ò˜UÑ#Ô#Ð#Ð#Ð#r   Nr   r   r   r   r   r   #   s5   € € € € € ðð ð
 Ðð$ð $ð $ð $ð $r   r   c                   ó"   — e Zd ZdZdZd„ Zd„ ZdS )ÚTransitionsa¡  
    Move transitions at the end of sections up the tree.  Complain
    on transitions after a title, at the beginning or end of the
    document, and after another transition.

    For example, transform this::

        <section>
            ...
            <transition>
        <section>
            ...

    into this::

        <section>
            ...
        <transition>
        <section>
            ...
    i>  c                 ó~   — | j                              t          j        ¦  «        D ]}|                      |¦  «         Œd S )N)r*   Úfindallr   Ú
transitionÚvisit_transition)r   Únodes     r   r   zTransitions.apply`   sE   € Ø”M×)Ò)­%Ô*:Ñ;Ô;ð 	(ð 	(ˆDØ×!Ò! $Ñ'Ô'Ð'Ð'ð	(ð 	(r   c                 ó  — |j                              |¦  «        }d }|dk    sVt          |j         d         t          j        ¦  «        rž|dk    s+t          |j         d         t          j        ¦  «        rs|dk    rmt          |j         t          j        ¦  «        s!t          |j         t          j        ¦  «        sJ ‚| j        j         	                    d|j
        |j        ¬¦  «        }nTt          |j         |dz
           t          j        ¦  «        r,| j        j         	                    d|j
        |j        ¬¦  «        }|r |j                              ||¦  «         |dz  }|t          |j         ¦  «        k     sJ ‚|t          |j         ¦  «        dz
  k    rd S |}|t          |j         ¦  «        dz
  k    r¡|j         }|j         €^| j        j         	                    d|j        ¬¦  «        }|j                              |j                              |¦  «        dz   |¦  «         d S |j                              |¦  «        }|t          |j         ¦  «        dz
  k    °¡|j                              |¦  «         |j                              |dz   |¦  «         d S )	Nr   r   é   z4Document or section may not begin with a transition.)Úsourcer#   zZAt least one body element must separate transitions; adjacent transitions are not allowed.z'Document may not end with a transition.r"   )r   r%   r'   r   ÚtitleÚsubtitler*   Úsectionr+   r,   r;   r#   r6   Úinsertr&   r   )r   r8   r%   r,   Úsiblings        r   r7   zTransitions.visit_transitiond   sx  € Ø”×!Ò! $Ñ'Ô'ˆØˆØ�QŠJˆJÝ˜$œ+ aœ.­%¬+Ñ6Ô6ð à˜!’�Ý˜tœ{¨1œ~­u¬~Ñ>Ô>ð à˜a’Z�ZÝ˜tœ{­E¬NÑ;Ô;ð ?Ý! $¤+­u¬}Ñ=Ô=ð?ð ?ð ?à”MÔ*×0Ò0ØFØ”{¨¬ð 1ñ 4ô 4ˆEˆEõ ˜œ E¨A¡IÔ.µÔ0@ÑAÔAð 	4Ø”MÔ*×0Ò0ð8à”{¨¬ð 1ñ 4ô 4ˆEð ð 	àŒK×Ò˜u eÑ,Ô,Ð,Ø�Q‰JˆEØ•s˜4œ;Ñ'Ô'Ò'Ð'Ð'Ð'Ø•C˜œÑ$Ô$ qÑ(Ò(Ð(àˆFàˆà•s˜7œ>Ñ*Ô*¨QÑ.Ò.Ð.Ø”nˆGàŒ~Ð%ð œÔ.×4Ò4Ø=Øœð 5ñ $ô $�ð ”×"Ò" 4¤;×#4Ò#4°TÑ#:Ô#:¸QÑ#>ÀÑFÔFÐFØ�Ø”N×(Ò(¨Ñ1Ô1ˆEð •s˜7œ>Ñ*Ô*¨QÑ.Ò.Ð.ð 	Œ×Ò˜4Ñ Ô Ð àŒ×Ò˜e a™i¨Ñ.Ô.Ð.Ð.Ð.r   N)r   r   r   r   r   r   r7   r   r   r   r3   r3   F   sD   € € € € € ðð ð, Ðð(ð (ð (ð,/ð ,/ð ,/ð ,/ð ,/r   r3   N)	r   Ú__docformat__Údocutilsr   Údocutils.transformsr   r   r   r3   r   r   r   ú<module>rD      sÍ   ðð
ð ð #€à Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )ð'ð 'ð 'ð 'ð 'ˆyñ 'ô 'ð 'ð( $ð  $ð  $ð  $ð  $�Yñ  $ô  $ð  $ðFJ/ð J/ð J/ð J/ð J/�)ñ J/ô J/ð J/ð J/ð J/r   