+
    ¾¾jœ"  ã                   ó   € R t ^ RIt^ RIHt ^ RIHtHt R R lt]! ]4      t R R lt	]! ]	4      t
 RR R	 llt]! ]4      t R
 R lt]! ]4      t R R lt]! ]4      t ]P"                  ! R4      tR R lt. ROtR# )z-Functions for manipulating strings and bytes.N)Údeprecate_for_version_8)ÚDEFAULT_ENCODINGÚ
to_unicodec                óF   € V ^8„  d   QhR\         \        ,          R\         /# )é   ÚtextÚreturn©ÚstrÚbytes)Úformats   "ÚV/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/parser/string.pyÚ__annotate__r   	   s   € ÷ *ñ *”sœU•{ð *¤sñ *ó    c                ó8  € \        V \        \        34      '       g   Q h\        V 4      p V P	                  RR4      P	                  RR4      P	                  RR4      P	                  RR4      P	                  R	R
4      P	                  RR
4      P	                  RR
4      # )aK  Format value according to iCalendar TEXT escaping rules.

Escapes special characters in text values according to :rfc:`5545#section-3.3.11`
rules.
The order of replacements matters to avoid double-escaping.

Parameters:
    text: The text to escape.

Returns:
    The escaped text with special characters escaped.

Note:
    The replacement order is critical:

    1. ``\N`` -> ``\n`` (normalize newlines to lowercase)
    2. ``\`` -> ``\\`` (escape backslashes)
    3. ``;`` -> ``\;`` (escape semicolons)
    4. ``,`` -> ``\,`` (escape commas)
    5. ``\r\n`` -> ``\n`` (normalize line endings)
    6. ``"\n"`` -> ``r"\n"`` (transform a newline character to a literal, or raw,
       newline character)
    7. ``"\r"`` -> ``r"\n"`` (transform a lone carriage return to a literal
       newline character)

    Steps 5 to 7 normalize ``\r\n``, ``\n``, or a lone ``\r`` to ``\n``.
    The line-ending normalization is an implementation convenience,
    not part of :rfc:`5545`, which only defines ``\n`` or ``\N`` for an
    intentional line break, and doesn't give an escape form for a lone ``\r``.
ú\NÚ
Ú\ú\\Ú;ú\;Ú,ú\,ú
ú\nÚ)Ú
isinstancer
   r   r   Úreplace©r   s   &r   Ú_escape_charr   	   s‚   € ô> �dœS¤%˜L×)Ò)Ð)Ð)Ü�dÓ€Dð 	�‰�U˜DÓ!ß	‰��vÓ	ß	‰��eÓ	ß	‰��eÓ	ß	‰�˜Ó	ß	‰��uÓ	ß	‰��uÓ	ðr   c                ój   € V ^8„  d   QhR\         \        ,          R\         \        ,          R,          /# )r   r   r   Nr	   )r   s   "r   r   r   @   s'   € ÷ *ñ *œœu�ð *¬¬u­°tÕ);ñ *r   c                ó"  € \        V \        \        34      '       g   Q h\        V \        4      '       dc   V P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  R	R
4      # \        V \        4      '       dc   V P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  RR4      # R# )ax  Unescape iCalendar TEXT values.

Reverses the escaping applied by :func:`_escape_char` according to
:rfc:`5545#section-3.3.11` TEXT escaping rules.

Parameters:
    text: The escaped text.

Returns:
    The unescaped text, or ``None`` if ``text`` is neither ``str`` nor ``bytes``.

Note:
    The replacement order is critical to avoid double-unescaping:

    1. ``\N`` -> ``\n`` (intermediate step)
    2. ``\r\n`` -> ``\n`` (normalize line endings)
    3. ``\n`` -> newline (unescape newlines)
    4. ``\,`` -> ``,`` (unescape commas)
    5. ``\;`` -> ``;`` (unescape semicolons)
    6. ``\\`` -> ``\`` (unescape backslashes last)
r   r   r   r   r   r   r   r   r   r   s   \Ns   \ns   
ó   
s   \,ó   ,s   \;ó   ;s   \\ó   \N)r   r
   r   r   r   s   &r   Ú_unescape_charr&   @   sÚ   € ô, �dœS¤%˜L×)Ò)Ð)Ð)ä�$œ×Òà�L‰L˜ Ó&ß‰W�V˜TÓ"ß‰W�U˜DÓ!ß‰W�U˜CÓ ß‰W�U˜CÓ ß‰W�V˜TÓ"ð	
ô �$œ×Òà�L‰L˜ Ó(ß‰W�W˜eÓ$ß‰W�V˜UÓ#ß‰W�V˜TÓ"ß‰W�V˜TÓ"ß‰W�W˜eÓ$ð	
ñ r   c                óH   € V ^8„  d   QhR\         R\        R\         R\         /# )r   ÚlineÚlimitÚfold_sepr   )r
   Úint)r   s   "r   r   r   w   s(   € ÷ %'ñ %'”Cð %'¤ð %'´Cð %'Äcñ %'r   c                ó”  € \        V \        4      '       g   Q hRV 9  g   Q h. p. p^ pV  Fã  p\        VP                  \        4      4      pV'       d¢   WW,           V8¼  d•   \        V4      ^8”  da   VR,          R9   dS   VP                  4       pVP                  RP                  V4      4       V.p\        VP                  \        4      4      pM$VP                  RP                  V4      4       . p^ pVP                  V4       WW,          pKå  	  V'       d!   VP                  RP                  V4      4       VP                  V4      # )aŒ  Make a string folded as defined in RFC5545.

Lines of text SHOULD NOT be longer than 75 octets, excluding the line
break.  Long content lines SHOULD be split into a multiple line
representations using a line "folding" technique.  That is, a long
line can be split between any two characters by inserting a CRLF
immediately followed by a single linear white-space character (i.e.,
SPACE or HTAB).
r   z\^Ú éÿÿÿÿ)r   r
   ÚlenÚencoder   ÚpopÚappendÚjoin)	r(   r)   r*   Úfolded_linesÚcurrent_charsÚ
byte_countÚcharÚchar_byte_lenÚescaped_prefixs	   &&&      r   Ú	_foldliner:   w   s  € ô �dœC× Ò Ð Ð Ø�tÔÐÐà €LØ!€MØ€JÛˆÜ˜DŸK™KÔ(8Ó9Ó:ˆß˜ZÕ7¸5Ô@ô �=Ó! AÔ%¨-¸Õ*;¸uÔ*DØ!.×!2Ñ!2Ó!4�Ø×#Ñ# B§G¡G¨MÓ$:Ô;Ø!/Ð 0�Ü  ×!6Ñ!6Ô7GÓ!HÓI‘
à×#Ñ# B§G¡G¨MÓ$:Ô;Ø "�Ø�
Ø×Ñ˜TÔ"ØÕ#Š
ñ! ÷$ Ø×Ñ˜BŸG™G MÓ2Ô3à�=‰=˜Ó&Ð&r   c                ó0   € V ^8„  d   QhR\         R\         /# ©r   Úvalr   ©r
   )r   s   "r   r   r   §   s   € ÷ !ñ !œð !¤ñ !r   c                ó¦   € V P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  R	R
4      # )aÂ  Escape backslash sequences to URL-encoded hex values.

Converts backslash-escaped characters to their percent-encoded hex
equivalents. This is used for parameter parsing to preserve escaped
characters during processing.

Parameters:
    val: The string with backslash escapes.

Returns:
    The string with backslash escapes converted to percent encoding.

Note:
    Conversions:

    - ``%`` -> ``%25``
    - ``\,`` -> ``%2C``
    - ``\:`` -> ``%3A``
    - ``\;`` -> ``%3B``
    - ``\\`` -> ``%5C``

    A literal ``%`` is escaped first so that percent sequences already in
    the value (e.g. ``%2C`` in a URI) are not confused with the markers
    introduced here. :func:`_unescape_string` reverses it.
Ú%ú%25r   ú%2Cz\:ú%3Ar   ú%3Br   ú%5C©r   ©r=   s   &r   Ú_escape_stringrH   §   sG   € ð8 	�‰�C˜Óß	‰�˜Ó	ß	‰�˜Ó	ß	‰�˜Ó	ß	‰�˜Ó	ðr   c                ó0   € V ^8„  d   QhR\         R\         /# r<   r>   )r   s   "r   r   r   Ô   s   € ÷ ñ œ#ð ¤#ñ r   c                ó¦   € V P                  RR4      P                  RR4      P                  RR4      P                  RR4      P                  R	R
4      # )ao  Unescape URL-encoded hex values to their original characters.

Reverses :func:`_escape_string` by converting percent-encoded hex values
back to their original characters. This is used for parameter parsing.

Parameters:
    val: The string with percent-encoded values.

Returns:
    The string with percent encoding converted to characters.

Note:
    Conversions:

    - ``%2C`` -> ``,``
    - ``%3A`` -> ``:``
    - ``%3B`` -> ``;``
    - ``%5C`` -> ``\``
    - ``%25`` -> ``%``

    ``%25`` is restored last so a literal ``%`` that :func:`_escape_string`
    protected does not re-trigger the marker replacements above.
rB   r   rC   Ú:rD   r   rE   r   rA   r@   rF   rG   s   &r   Ú_unescape_stringrL   Ô   sG   € ð2 	�‰�E˜3Óß	‰�˜Ó	ß	‰�˜Ó	ß	‰�˜Ó	ß	‰�˜Ó	ðr   z[\w.-]+c                ó(   € V ^8„  d   QhR\         RR/# )r   Únamer   Nr>   )r   s   "r   r   r     s   € ÷ ñ œð  ñ r   c                ó€   € \         P                  V 4      p\        V4      ^8X  d   W^ ,          8X  d   R# \        V 4      h)a  Validate that a name is a valid iCalendar token.

Checks if the name matches the :rfc:`5545` token syntax using the NAME
regex pattern (``[\w.-]+``).

Parameters:
    name: The token name to validate.

Raises:
    ValueError: If the name is not a valid token.
N)ÚNAMEÚfindallr/   Ú
ValueError)rN   Úmatchs   & r   Úvalidate_tokenrT     s4   € ô �L‰L˜Ó€EÜ
ˆ5ƒz�Q„˜4¨¥8Ô+ÙÜ
�TÓ
Ðr   )éK   z
 )r   rH   r:   r&   rL   Úescape_charÚescape_stringÚfoldlineÚunescape_charÚunescape_stringrT   )Ú__doc__ÚreÚicalendar.compatibilityr   Úicalendar.parser_toolsr   r   r   rV   r&   rY   r:   rX   rH   rW   rL   rZ   ÚcompilerP   rT   Ú__all__© r   r   Ú<module>rb      s¡   ðÙ 3ã 	å ;ß ?õ*ñZ & lÓ3€ðõ*ñZ (¨Ó7€ð÷%'ñP # 9Ó-€ðõ!ñH (¨Ó7€ðõñB *Ð*:Ó;€ðð 
‡z‚z�*Ó€õò$‚r   