Ë
    6Š·jD  ã                  óL   — d dl mZ d dlZd dlmZ dZerd dlmZ  G d„ d«      Zy)é    )ÚannotationsN)ÚBytesIOF)ÚIOc                  ó@   — e Zd ZdZdZdd	d„Zd
d„Zedd„«       Zdd„Z	y)ÚGimpPaletteFilez'File handler for GIMP's palette format.ÚRGBc                óÜ  ‡— |j                  «       j                  d«      sd}t        |«      ‚g }d}	 |r|dk(  rn¢|dz  }|j                  «       }|snŠt        j                  d|«      rŒ8|rt        |«      dkD  rd}t        |«      ‚|j                  d	¬
«      Št        ‰«      d	k  rd}t        |«      ‚|ˆfd„t        d	«      D «       z  }|rt        |«      dk(  rnŒªt        |«      | _
        y )Ns   GIMP Paletteznot a GIMP palette filer   i  é   s   \w+:|#éd   zbad palette fileé   )Úmaxsplitzbad palette entryc              3  ó:   •K  — | ]  }t        ‰|   «      –— Œ y ­w©N)Úint)Ú.0ÚiÚvs     €úI/root/workspace/.venv/lib/python3.12/site-packages/PIL/GimpPaletteFile.pyú	<genexpr>z(GimpPaletteFile._read.<locals>.<genexpr>;   s   øè ø€ Ò4 aœ˜A˜a™DŸ	Ñ4ùs   ƒi   )ÚreadlineÚ
startswithÚSyntaxErrorÚreÚmatchÚlenÚsplitÚ
ValueErrorÚrangeÚbytesÚpalette)ÚselfÚfpÚlimitÚmsgr    r   Úsr   s          @r   Ú_readzGimpPaletteFile._read   së   ø€ Ø�{‰{‹}×'Ñ'¨Ô8Ø+ˆCÜ˜cÓ"Ð"àˆØˆØÙ˜˜gšØà�‰FˆAØ—‘“ˆAÙØô �x‰x˜
 AÔ&ØÙœ˜Q› #šØ(�Ü! #Ó&Ð&à—‘ �Ó#ˆAÜ�1‹v˜ŠzØ)�Ü  “oÐ%àÓ4¬5°«8Ô4Ñ4ˆGÙœ˜W›¨Ò,Øð/ ô2 ˜W“~ˆ�ó    c                ó&   — | j                  |«       y r   )r&   )r!   r"   s     r   Ú__init__zGimpPaletteFile.__init__A   s   € Ø�
‰
�2�r'   c                ó^   — | j                  | «      }|j                  t        |«      d«       |S )NF)Ú__new__r&   r   )ÚclsÚdatar!   s      r   Ú	frombyteszGimpPaletteFile.frombytesD   s'   € à�{‰{˜3ÓˆØ�
‰
”7˜4“= %Ô(Øˆr'   c                ó2   — | j                   | j                  fS r   )r    Úrawmode)r!   s    r   Ú
getpalettezGimpPaletteFile.getpaletteJ   s   € Ø�|‰|˜TŸ\™\Ð)Ð)r'   N)T)r"   ú	IO[bytes]r#   ÚboolÚreturnÚNone)r"   r2   r4   r5   )r-   r   r4   r   )r4   ztuple[bytes, str])
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r0   r&   r)   Úclassmethodr.   r1   © r'   r   r   r      s.   „ Ù1à€Gô &óDð òó ðô
*r'   r   )	Ú
__future__r   r   Úior   ÚTYPE_CHECKINGÚtypingr   r   r;   r'   r   ú<module>r@      s%   ðõ  #ã 	Ý à€ÙÝ÷1*ò 1*r'   