§
    Æ‡tj:  ã                   óª   — d Z ddlZddlmZ ddlmZ  ej        d¦  «        Z ej        d¦  «        Zde	de	fd	„Z
 ej        d
¦  «        Zde	de	fd„ZdS )zBPython implementation of ASCII85/ASCIIHex decoder (Adobe version).é    N)Ú	a85decode)Ú	unhexlifys   ^\s*<?\s*~\s*s   \s*~\s*>?\s*$ÚdataÚreturnc                 óŒ   — t                                d| ¦  «        } t                               d| ¦  «        } t          | ¦  «        S )aÚ  In ASCII85 encoding, every four bytes are encoded with five ASCII
    letters, using 85 different types of characters (as 256**4 < 85**5).
    When the length of the original bytes is not a multiple of 4, a special
    rule is used for round up.

    Adobe's ASCII85 implementation expects the input to be terminated
    by `b"~>"`, and (though this is absent from the PDF spec) it can
    also begin with `b"<~"`.  We can't reliably expect this to be the
    case, and there can be off-by-one errors in stream lengths which
    mean we only see `~` at the end.  Worse yet, `<` and `>` are
    ASCII85 digits, so we can't strip them.  We settle on a compromise
    where we strip leading `<~` or `~` and trailing `~` or `~>`.
    ó    )Ústart_reÚsubÚend_rer   )r   s    úN/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/pdfminer/ascii85.pyÚascii85decoder      s6   € õ �<Š<˜˜TÑ"Ô"€DÝ�:Š:�c˜4Ñ Ô €DÝ�T‰?Œ?Ðr   s   \sc                 ó¼   — t                                d| ¦  «        } |                      d¦  «        }|dk    r| d|…         } |dz  dk    r| dz  } t          | ¦  «        S )aá  ASCIIHexDecode filter: PDFReference v1.4 section 3.3.1
    For each pair of ASCII hexadecimal digits (0-9 and A-F or a-f), the
    ASCIIHexDecode filter produces one byte of binary data. All white-space
    characters are ignored. A right angle bracket character (>) indicates
    EOD. Any other characters will cause an error. If the filter encounters
    the EOD marker after reading an odd number of hexadecimal digits, it
    will behave as if a 0 followed the last digit.
    r   ó   >éÿÿÿÿNé   é   ó   0)Úbws_rer
   Úfindr   )r   Úidxs     r   Úasciihexdecoder   !   s^   € õ �:Š:�c˜4Ñ Ô €DØ
�)Š)�D‰/Œ/€CØ
ˆb‚y€yØ�D�S�DŒzˆØ�‰7�aŠ<ˆ<Ø�D‰LˆDÝ�T‰?Œ?Ðr   )Ú__doc__ÚreÚbase64r   Úbinasciir   Úcompiler	   r   Úbytesr   r   r   © r   r   ú<module>r      s½   ðØ HÐ Hà 	€	€	€	Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð àˆ2Œ:Ð'Ñ(Ô(€Ø	ˆŒÐ%Ñ	&Ô	&€ð˜ð  %ð ð ð ð ð& 
ˆŒ�FÑ	Ô	€ð˜ð  5ð ð ð ð ð ð r   