+
    iS)                        R t ^ RIHt ^ RIt^RIHt RtRRRRR	R
RR/t/ tR t	R t
R t ! R R]4      t]
! R4      t]
! R4      t]
! R4      tR!R ltR t]R3R ltR!R ltR t]R3R ltR t ! R R]4      t ! R R ]4      tR# )"z

webencodings
~~~~~~~~~~~~

This is a Python implementation of the `WHATWG Encoding standard
<http://encoding.spec.whatwg.org/>`. See README for details.

:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.

)unicode_literalsN)LABELSz0.5.1ziso-8859-8-iz
iso-8859-8zx-mac-cyrilliczmac-cyrillic	macintoshz	mac-romanzwindows-874cp874c                ^    V P                  R4      P                  4       P                  R4      # )a  Transform (only) ASCII letters to lower case: A-Z is mapped to a-z.

:param string: An Unicode string.
:returns: A new Unicode string.

This is used for `ASCII case-insensitive
<http://encoding.spec.whatwg.org/#ascii-case-insensitive>`_
matching of encoding labels.
The same matching is also used, among other things,
for `CSS keywords <http://dev.w3.org/csswg/css-values/#keywords>`_.

This is different from the :meth:`~py:str.lower` method of Unicode strings
which also affect non-ASCII characters,
sometimes mapping them into the ASCII range:

    >>> keyword = u'Bac\N{KELVIN SIGN}ground'
    >>> assert keyword.lower() == u'background'
    >>> assert ascii_lower(keyword) != keyword.lower()
    >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground'

utf8)encodelowerdecode)strings   &^/Users/mibo/.openclaw/workspace/.venv-ak/lib/python3.14/site-packages/webencodings/__init__.pyascii_lowerr   #   s'    . == &&(//77    c                >   \        V P                  R4      4      p \        P                  ! V 4      pVf   R# \        P                  V4      pVfN   VR8X  d   ^RIHp M+\        P                  W4      p\        P                  ! V4      p\        W4      pV\        V&   V# )u  
Look for an encoding by its label.
This is the spec’s `get an encoding
<http://encoding.spec.whatwg.org/#concept-encoding-get>`_ algorithm.
Supported labels are listed there.

:param label: A string.
:returns:
    An :class:`Encoding` object, or :obj:`None` for an unknown label.

z	
 Nzx-user-defined)
codec_info)r   stripr   getCACHEx_user_definedr   PYTHON_NAMEScodecslookupEncoding)labelnameencodingr   python_names   &    r   r   r   =   s     K01E::eD|yyH##2&**46K{3JD-dOr   c                p    \        V R4      '       d   V # \        V 4      pVf   \        RV ,          4      hV# )z
Accept either an encoding object or label.

:param encoding: An :class:`Encoding` object or a label string.
:returns: An :class:`Encoding` object.
:raises: :exc:`~exceptions.LookupError` for an unknown label.

r   zUnknown encoding label: %r)hasattrr   LookupError)encoding_or_labelr   s   & r   _get_encodingr!   [   s@      ,//  '(H69JJKKOr   c                   0   a  ] tR t^mt o RtR tR tRtV tR# )r   a/  Reresents a character encoding such as UTF-8,
that can be used for decoding or encoding.

.. attribute:: name

    Canonical name of the encoding

.. attribute:: codec_info

    The actual implementation of the encoding,
    a stdlib :class:`~codecs.CodecInfo` object.
    See :func:`codecs.register`.

c                    Wn         W n        R # N)r   r   )selfr   r   s   &&&r   __init__Encoding.__init__|   s    	$r   c                (    R V P                   ,          # )z<Encoding %s>)r   )r%   s   &r   __repr__Encoding.__repr__   s    **r   )r   r   N)	__name__
__module____qualname____firstlineno____doc__r&   r)   __static_attributes____classdictcell____classdict__s   @r   r   r   m   s     %+ +r   r   zutf-8zutf-16lezutf-16bec                    \        V4      p\        V 4      w  r0T;'       g    TpVP                  P                  W4      ^ ,          V3# )a  
Decode a single string.

:param input: A byte string
:param fallback_encoding:
    An :class:`Encoding` object or a label string.
    The encoding to use if :obj:`input` does note have a BOM.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
:return:
    A ``(output, encoding)`` tuple of an Unicode string
    and an :obj:`Encoding`.

)r!   _detect_bomr   r
   )inputfallback_encodingerrorsbom_encodingr   s   &&&  r   r
   r
      sL      &&78%e,L000H%%e4Q7AAr   c                    V P                  R4      '       d   \        V R,          3# V P                  R4      '       d   \        V R,          3# V P                  R4      '       d   \        V R,          3# RV 3# )zBReturn (bom_encoding, input), with any BOM removed from the input.s   :   NNs   s   ﻿:   NNN)
startswith_UTF16LE_UTF16BEUTF8)r6   s   &r   r5   r5      sk    $$r""$$r""((U2Y;r   strictc                X    \        V4      P                  P                  W4      ^ ,          # )a  
Encode a single string.

:param input: An Unicode string.
:param encoding: An :class:`Encoding` object or a label string.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
:return: A byte string.

)r!   r   r   )r6   r   r8   s   &&&r   r   r      s%     "--44UCAFFr   c                J    \        W4      p\        W4      p\        V4      pWE3# )a  
"Pull"-based decoder.

:param input:
    An iterable of byte strings.

    The input is first consumed just enough to determine the encoding
    based on the precense of a BOM,
    then consumed on demand when the return value is.
:param fallback_encoding:
    An :class:`Encoding` object or a label string.
    The encoding to use if :obj:`input` does note have a BOM.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
:returns:
    An ``(output, encoding)`` tuple.
    :obj:`output` is an iterable of Unicode strings,
    :obj:`encoding` is the :obj:`Encoding` that is being used.

)IncrementalDecoder_iter_decode_generatornext)r6   r7   r8   decoder	generatorr   s   &&&   r   iter_decoderI      s+    , !!2;G&u6IIHr   c              #    "   VP                   p\        V 4      p V  F7  pV! V4      pV'       g   K  VP                  f   Q hVP                  x  Vx   M8	  V! RRR7      pVP                  f   Q hVP                  x  V'       d   Vx  R# V  F  pV! V4      pV'       g   K  Vx  K  	  V! RRR7      pV'       d   Vx  R# R# 5i)ziReturn a generator that first yields the :obj:`Encoding`,
then yields output chukns as Unicode strings.

Nr   Tfinal)r
   iterr   )r6   rG   r
   chunckoutputs   &&   r   rE   rE      s     
 ^^FKE6##///"""L  4(+++L6L  Ct$F s   *CACC$C>Cc                B    \        W4      P                  p\        W4      # )u=  
“Pull”-based encoder.

:param input: An iterable of Unicode strings.
:param encoding: An :class:`Encoding` object or a label string.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
:returns: An iterable of byte strings.

)IncrementalEncoderr   _iter_encode_generator)r6   r   r8   r   s   &&& r   iter_encoderS      s      188F!%00r   c              #   |   "   V  F  pV! V4      pV'       g   K  Vx  K  	  V! R RR7      pV'       d   Vx  R# R# 5i) TrK   N )r6   r   rN   rO   s   &&  r   rR   rR     s=     6L  Bd#F s   <<<c                   8   a  ] tR tRt o RtRR ltRR ltRtV tR# )	rD   i  u3  
“Push”-based decoder.

:param fallback_encoding:
    An :class:`Encoding` object or a label string.
    The encoding to use if :obj:`input` does note have a BOM.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

c                \    \        V4      V n        W n        R V n        RV n        RV n        R# )r   N)r!   _fallback_encoding_errors_buffer_decoderr   )r%   r7   r8   s   &&&r   r&   IncrementalDecoder.__init__  s,    "/0A"B
 r   c                X   V P                   pVe	   V! W4      # V P                  V,           p\        V4      w  rAVf-   \        V4      ^8  d   V'       g	   Wn        R# V P                  pVP
                  P                  V P                  4      P                  pW0n         W@n	        V! W4      # )zDecode one chunk of the input.

:param input: A byte string.
:param final:
    Indicate that no more input is available.
    Must be :obj:`True` if this is the last call.
:returns: An Unicode string.

rU   )
r\   r[   r5   lenrY   r   incrementaldecoderrZ   r
   r   )r%   r6   rL   rG   r   s   &&&  r   r
   IncrementalDecoder.decode'  s     --5((u$%e,5zA~e$22%%88FMM u$$r   )r[   r\   rZ   rY   r   Nreplace)F)	r+   r,   r-   r.   r/   r&   r
   r0   r1   r2   s   @r   rD   rD     s     	
% %r   rD   c                   2   a  ] tR tRt o Rt]R3R ltRtV tR# )rQ   iC  u  
“Push”-based encoder.

:param encoding: An :class:`Encoding` object or a label string.
:param errors: Type of error handling. See :func:`codecs.register`.
:raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

.. method:: encode(input, final=False)

    :param input: An Unicode string.
    :param final:
        Indicate that no more input is available.
        Must be :obj:`True` if this is the last call.
    :returns: A byte string.

rA   c                p    \        V4      pVP                  P                  V4      P                  V n        R # r$   )r!   r   incrementalencoderr   )r%   r   r8   s   &&&r   r&   IncrementalEncoder.__init__T  s*     *))<<VDKKr   )r   N)	r+   r,   r-   r.   r/   r@   r&   r0   r1   r2   s   @r   rQ   rQ   C  s       !%X L Lr   rQ   rb   )r/   
__future__r   r   labelsr   VERSIONr   r   r   r   r!   objectr   r@   r>   r?   r
   r5   r   rI   rE   rS   rR   rD   rQ   rV   r   r   <module>rl      s    (   
 Ln7	 	84<$+v +0 g**B,   G8@ !%X 1 0% 0%fL Lr   