
    ^f                       d Z ddlmZ ddlZddlmZ i Zi Zi ZdZ	ddZ
d Zd Zd	 Zd
 Zd Z e
ej        ej        dddg           	 ddlZ e
ej        ej        dddg           n# e$ r Y nw xY w	 ddlZ e
ej        ej        ddg           n# e$ r Y nw xY w	 ddlZ e
ej        ej        dddg           n# e$ r Y nw xY w	 ddlZd Zd Z e
eedddg           dS # e$ r Y dS w xY w)zCompression utilities.    )annotationsN)ensure_bytes)registerencodersget_encoderget_decodercompress
decompressc                    | t           <   |t          <   |r(t                              fd|D                        dS dS )a  Register new compression method.

    Arguments:
    ---------
        encoder (Callable): Function used to compress text.
        decoder (Callable): Function used to decompress previously
            compressed text.
        content_type (str): The mime type this compression method
            identifies as.
        aliases (Sequence[str]): A list of names to associate with
            this compression method.
    c              3      K   | ]}|fV  	d S N ).0aliascontent_types     C/var/www/html/env/lib/python3.11/site-packages/kombu/compression.py	<genexpr>zregister.<locals>.<genexpr>!   s(      CC%-CCCCCC    N)	_encoders	_decoders_aliasesupdate)encoderdecoderr   aliasess     ` r   r   r      s[     &Il%Il DCCCC7CCCCCCCCD Dr   c                 *    t          t                    S )z/Return a list of available compression methods.)listr   r   r   r   r   r   $   s    	??r   c                V    t                               | |           } t          |          | fS )zGet encoder by alias name.)r   getr   ts    r   r   r   )   s#    QAQ<?r   c                N    t           t                              | |                    S )zGet decoder by alias name.)r   r   r   r    s    r   r   r   /   s    X\\!Q''((r   c                Z    t          |          \  }} |t          |                     |fS )zCompress text.

    Arguments:
    ---------
        body (AnyStr): The text to compress.
        content_type (str): mime-type of compression method to use.
    )r   r   )bodyr   r   s      r   r	   r	   4   s3     (55G\7<%%&&44r   c                2     t          |          |           S )zDecompress compressed text.

    Arguments:
    ---------
        body (AnyStr): Previously compressed text to uncompress.
        content_type (str): mime-type of compression method used.
    )r   )r$   r   s     r   r
   r
   @   s     %;|$$T***r   zapplication/x-gzipgzipzlib)r   zapplication/x-bz2bzip2bzipzapplication/x-brotlibrotlizapplication/x-lzmalzmaxzc                R    t          j                    }|                    |           S r   )zstdZstdCompressorr	   )r$   cs     r   zstd_compressr1   o   s"    !!zz$r   c                R    t          j                    }|                    |           S r   )r.   ZstdDecompressorr
   )r$   ds     r   zstd_decompressr5   s   s"    !##||D!!!r   zapplication/zstdr.   	zstandardr   )__doc__
__future__r   r'   kombu.utils.encodingr   r   r   r   __all__r   r   r   r   r	   r
   bz2ImportErrorr*   r+   r6   r.   r1   r5   r   r   r   <module>r=      s     " " " " " "  - - - - - -		4D D D D&  
  ) ) )
	5 	5 	5+ + + 			'79 9 9 9=JJJ HS\^ 7F*;= = = = =  	 	 	D	9MMM HV_#hZ9 9 9 9 9  	 	 	D	;KKK HT]_!FD>; ; ; ; ;  	 	 	D	@     " " " H]&+)>@ @ @ @ @ @  	 	 	DD	sH   
A* *A21A26B BB!C C	C	C* *C32C3