
    P&i;                        d 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
  ej        de
           i ddd	d
ddddddddddddddddddddddddddddddi ddd dd!dd"dd#d$d%d&d'd(d)d*d+dd,d-d.dd/d0d1d
d2d3d4dd5dd6di d7d8d9dd:dd;dd<dd=d>d?dd@ddAddBddCd
dDdEdFdEdGdHdIdEdJdHdKd8i dLdMdNddOddPd8dQdRdSd
dTddUddVddWddXddYddZd[d\d]d^dd_d$d`d&dddRddd>daZdidbedceddefdeZej        dfdfeeeef                  dgedceddeeddf         fdhZdS )ju
  Deprecated backport of docutils.utils.smartquotes.

This is extracted (with minor adaptations for flake8 compliance) from
docutils’ docutils/utils/smartquotes.py as of revision 8097 (30 May 2017),
in order to backport for Sphinx usage with Docutils < 0.14 extra language
configurations and fixes. Replaces earlier smartypants version as used up
to Sphinx 1.5.6.

:copyright: © 2010 Günter Milde,
            original `SmartyPants`_: © 2003 John Gruber
            smartypants.py:          © 2004, 2007 Chad Miller
:license: Released under the terms of the `2-Clause BSD license`_, in short:

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notices and this notice are preserved.
   This file is offered as-is, without any warranty.

.. _SmartyPants: https://daringfireball.net/projects/smartypants/
.. _2-Clause BSD license: https://spdx.org/licenses/BSD-2-Clause

See the LICENSE file and the original docutils code for details.

    N)	GeneratorIterableTuple)smartquotes)RemovedInSphinx60Warningz&sphinx.util.smartypants is deprecated.afu   “”‘’zaf-x-altquotu   „”‚’bgu   „“‚‘cau
   «»“”zca-x-altquotcszcs-x-altquotu
   »«›‹dazda-x-altquotdezde-x-altquotzde-chu
   «»‹›elenzen-uk-x-altquotu   ‘’“”eoeszes-x-altquotetzet-x-altquoteufiu   ””’’zfi-x-altquotu
   »»››fr)u   « u    »   “   ”zfr-x-altquot)   «     »r   r   zfr-chzfr-ch-x-altquot)r   r   u   ‹ u    ›glheu
   ”“»«zhe-x-altquothru   „”‘’zhr-x-altquothsbzhsb-x-altquothuu
   „”«»isitzit-chzit-x-altquotjau   「」『』ltlvmknlznl-x-altquotnbu
   «»’’nnznn-x-altquotu
   «»‘’nozno-x-altquotplzpl-x-altquotu
   «»‚’ptzpt-brroruu
   «»„“shzsh-x-altquotskzsk-x-altquotslzsl-x-altquotsqzsq-x-altquotu   “„‘‚sru   „”’’zsr-x-altquotsvzsv-x-altquot)trztr-x-altquotukzuk-x-altquotzzh-cnzzh-twtextlanguagereturnc                 &   t          j        |          }	 |j        }n# t          $ r d}Y nw xY wd}t	          j        d|d|j        |           } t	          j        d|d|j        |           } t	          j        d|j        |j	        z   |           } t	          j        d|j	        |j        z   |           } |
                    d          r"t	          j        d	|| t          j        
          } d}d}t	          j        d|dt          j        t          j        z            }|                    d|j	        z   |           } |j        |k    r5t	          j        dt          j                  }|                    ||           } t	          j        d|dt          j        t          j        z            }	|	                    d|j        z   |           } t	          j        d|dt          j        t          j        z            }	|	                    d|j        z  |           } t	          j        d|j	        |           } t	          j        d|dt          j                  }
|
                    d|j        z   |           } t	          j        d|dt          j                  }|                    |j        |           } t	          j        d|dt          j                  }|                    d|j        z   |           } t	          j        d|j        |           } | S )u  
    Parameter:  - text string (unicode or bytes).
                - language (`BCP 47` language tag.)
    Returns:    The `text`, with "educated" curly quote characters.

    Example input:  "Isn't this fun?"
    Example output: “Isn’t this fun?“;
    u   ’z)[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]z^'(?=z\\B)z^"(?=z"'(?=\w)z'"(?=\w)r   z'(?=\d{2}s))flagsz[^\ \t\r\n\[\{\(\-]z&#8211;|&#8212;a@  
                    (
                            \s          |   # a whitespace char, or
                            &nbsp;      |   # a non-breaking space entity, or
                            --          |   # dashes, or
                            &[mn]dash;  |   # named dash entities
                            z          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    '                 # the quote
                    (?=\w)            # followed by a word character
                    z\1z(?<=(\w|\d))'(?=\w)z
                    (z)
                    '
                    (?!\s  |       # whitespace
                       s\b |
                        \d         # digits   ('80s)
                    )
                    zK)
                    '
                    (\s | s\b)
                    z\1%s\2'z          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    "                 # the quote
                    (?=\w)            # followed by a word character
                    z
                    #(z)?   # character that indicates the quote should be closing
                    "
                    (?=\s)
                    ze)   # character that indicates the quote should be closing
                    "
                    ")r   
smartchars
apostrophe	Exceptionresubcsquotecpquoteopquoteosquote
startswithUNICODEcompileVERBOSE)r5   r6   smartr=   punct_classclose_class
dec_dashesopening_single_quotes_regexapostrophe_regexclosing_single_quotes_regexopening_double_quotes_regexclosing_double_quotes_regexs               d/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/sphinx/util/smartypants.pyeducateQuotesrS      s9    "8,,E%

   


 CK
 665u}dKKD665u}dKKD 6/5=5=#@$GGD6/5=5=#@$GGD 4   Nv(*d"*MMM,K'J #%** &::.( *,bj)@#B #B '**55=+@$GGD }
"":&<bjII##J55 #%** ';;.) +-*rz*A#C #C '**55=+@$GGD"$** ';;	.) +-*rz*A	#C #C
 '**9u}+DdKKD 6(EM400D #%** &::.( *,#5 #5 '**55=+@$GGD #%** ';;	.) +-*	#6 #6
 '**5=$??D"$** ';;.) +-*#6 #6 '**55=+@$GGD 6$t,,DKs    --text_tokensattrc              #     K   d}d}d}d}d}d}|dk    rd}d}d}nU|dk    rd}d}d}nH|dk    r	d}d}d	}d}n9|d
k    rd}n0d|v rd}d|v rd}d|v rd}d|v rd}d|v rd}d|v rd	}d|v rd}d|v rd}d}	| D ]p\  }
}|
dk    s|s|V  |
dk    r|dd         }	|V  (|dd         }t          j        |          }|rt          j        dd|          }|dk    rt          j        |          }n5|dk    rt          j        |          }n|d	k    rt          j        |          }|rt          j        |          }|rt          j        ||          }|dk    rt          j	        ||          }|rE|	
                    dd          
                    dd          }t          ||z   |          dd         }|rt          j        ||          }|}	t          j        |d          }|V  rdS )a5  Return iterator that "educates" the items of `text_tokens`.

    This is modified to intercept the ``attr='2'`` as it was used by the
    Docutils 0.13.1 SmartQuotes transform in a hard coded way. Docutils 0.14
    uses ``'qDe'``` and is configurable, and its choice is backported here
    for use by Sphinx with earlier Docutils releases. Similarly ``'1'`` is
    replaced by ``'qde'``.

    Use ``attr='qDbe'``, resp. ``'qdbe'`` to recover Docutils effect of ``'2'``,
    resp. ``'1'``.

    refs: https://sourceforge.net/p/docutils/mailman/message/35869025/
    Fr   1T   2   3   z-1qbBdDiew tagliteralNz&quot;r;   ;r:   )restore)r   processEscapesr?   r@   educateDasheseducateDashesOldSchooleducateDashesOldSchoolInvertededucateEllipseseducateBacktickseducateSingleBackticksreplacerS   stupefyEntities)rT   rU   r6   convert_quot	do_dashesdo_backticks	do_quotesdo_ellipses
do_stupefyprev_token_last_charttyper5   	last_charcontexts                 rR   educate_tokensr~      s     B LILIKJs{{									

$;;I$;;L$;;L$;;I$;;I$;;I$;;K$;;L % 4 4 E>>>JJJ I#'9 JJJI	)$// 	/6(C..D>>,T22DD!^^5d;;DD!^^=dCCD 	5.t44D  	@/h??D15dHEED 	? +223<<DDS#NNG 4::122>D 	?.tX>>D  ))$===



i4 4    )r   )__doc__r?   warningstypingr   r   r   docutils.utilsr   sphinx.deprecationr   warn
langquotesstrrS   default_smartypants_attrr~    r   rR   <module>r      s;   2 
			  - - - - - - - - - - & & & & & & 7 7 7 7 7 7 6&( ( (Wdn WnWnW lW n	W
 nW lW lW nW nW lW lW lW nW  W  n!W" l#W W$ n%W& n'W( l)W* l+W, n-W. l/W0 <1W2 >3W4 l5W6  !H7W: l;W< l=W> n?WB nCWD lEWF nGWH |IW W WJ lKWL nMWN lOWP lQWR nSWV nWWX nYWZ n[W\ n]W` naWb ncWf lgWh liWj lkWp lqWr lsWx lyW W Wz l{W@ lAWB nCWD lEWF lGWH nIWJ lKWL nMWN lOWP nQWR lSWT lUWV nWWX nYWZ l[W\ n]W^ l_W W` -**,,,mW W W
to o os oc o o o of  +C#'E EsCx 9 EE E "#tT/2E E E E E Er   