Ë
    Ã?Æiî	  ã                  óL   — d Z ddlmZ ddl­ ddlmZ d
d„Zd
d„Zdd„Zddd„Z	y	)a9  GRid (Global Release Identifier).

The Global Release Identifier is used to identify releases of digital
sound recordings and uses the ISO 7064 Mod 37, 36 algorithm to verify the
correctness of the number.

>>> validate('A12425GABC1234002M')
'A12425GABC1234002M'
>>> validate('Grid: A1-2425G-ABC1234002-M')
'A12425GABC1234002M'
>>> validate('A1-2425G-ABC1234002-Q') # incorrect check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> compact('A1-2425G-ABC1234002-M')
'A12425GABC1234002M'
>>> format('A12425GABC1234002M')
'A1-2425G-ABC1234002-M'
é    )Úannotations)Ú*)Úcleanc                ó‚   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | S )z†Convert the GRid to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -zGRID:é   N)r   ÚstripÚupperÚ
startswith©Únumbers    úR/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/grid.pyÚcompactr   .   s@   € ô �6˜4Ó ×&Ñ&Ó(×.Ñ.Ó0€FØ×Ñ˜Ô!Ø˜˜�ˆØ€Mó    c                óv   — ddl m} t        | «      } t        | «      dk7  r
t	        «       ‚|j                  | «      S )ú$Check if the number is a valid GRid.r   )Ú	mod_37_36é   )Ústdnum.iso7064r   r   ÚlenÚInvalidLengthÚvalidate)r   r   s     r   r   r   7   s3   € å(Ü�V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐØ×Ñ˜fÓ%Ð%r   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr   s    r   Úis_validr   @   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ól   — t        | «      } | dd | dd | dd | dd f}|j                  d„ |D «       «      S )z8Reformat the number to the standard presentation format.r   é   é   é   Nc              3  ó&   K  — | ]	  }|sŒ|–— Œ y ­w)N© )Ú.0Úxs     r   ú	<genexpr>zformat.<locals>.<genexpr>L   s   è ø€ Ò0 ªaœ!Ñ0ùs   ‚Š)r   Újoin)r   Ú	separatorÚpartss      r   Úformatr(   H   sF   € ä�V‹_€FØ�A�aˆ[˜&  1˜+ v¨a° |°V¸B¸C°[ÐA€EØ�>‰>Ñ0 UÔ0Ó0Ð0r   N)r   ÚstrÚreturnr)   )r   r)   r*   r   )ú-)r   r)   r&   r)   r*   r)   )
Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r(   r!   r   r   ú<module>r0      s)   ðñ(õ( #ä Ý óó&óõ1r   