Ë
    Ã?Æi–  ã                  ól   — d Z ddlmZ ddlmZ ddl­ ddlmZmZ dd„Z	dd„Z
dd„Zdd	„Zdd
„Zddd„Zy)aò  IMEI (International Mobile Equipment Identity).

The  IMEI is used to identify mobile phones. An IMEI is 14, 15 (when the
check digit is included) or 16 digits (IMEISV) long. The check digit is
validated using the Luhn algorithm.

More information:

* https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity

>>> validate('35686800-004141-20')
'3568680000414120'
>>> validate('35-417803-685978-1')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> compact('35686800-004141-20')
'3568680000414120'
>>> format('354178036859789')
'35-417803-685978-9'
>>> format('35686800-004141', add_check_digit=True)
'35-686800-004141-8'
>>> imei_type('35686800-004141-20')
'IMEISV'
>>> split('35686800-004141')
('35686800', '004141', '')
é    )Úannotations)Úluhn)Ú*)ÚcleanÚisdigitsc                óR   — t        | d«      j                  «       j                  «       S )z�Convert the IMEI number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -)r   ÚstripÚupper©Únumbers    úR/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/imei.pyÚcompactr   8   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    c                ó¾   — t        | «      } t        | «      s
t        «       ‚t        | «      dk(  rt	        j
                  | «       | S t        | «      dvr
t        «       ‚| S )ú@Check if the number provided is a valid IMEI (or IMEISV) number.é   )é   é   )r   r   ÚInvalidFormatÚlenr   ÚvalidateÚInvalidLengthr   s    r   r   r   >   sU   € ä�V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒä�‰�fÔð €Mô 
ˆV‹˜HÑ	$ä‹oÐØ€Mr   c                óV   — 	 t        | «      } t        | «      dv ryy# t        $ r Y yw xY w)zuCheck the passed number and return 'IMEI', 'IMEISV' or None (for
    invalid) for checking the type of number passed.N)r   r   ÚIMEIÚIMEISV)r   ÚValidationErrorr   r   s    r   Ú	imei_typer   L   s9   € ðÜ˜&Ó!ˆô ˆ6ƒ{�hÑØàøô ò Ùðús   ‚ œ	(§(c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   r   r   s    r   Úis_validr    Y   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó4   — t        | «      } | dd | dd | dd fS )z™Split the number into a Type Allocation Code (TAC), serial number
    and either the checksum (for IMEI) or the software version number (for
    IMEISV).Né   r   )r   r   s    r   Úsplitr#   a   s,   € ô �V‹_€FØ�2�AˆJ˜˜q ˜ f¨R¨S kÐ2Ð2r   c                ó¼   — t        | «      } t        | «      dk(  r|r| t        j                  | «      z  } | dd | dd | dd | dd f}|j	                  d„ |D «       «      S )z8Reformat the number to the standard presentation format.r   Né   r"   c              3  ó&   K  — | ]	  }|sŒ|–— Œ y ­w)N© )Ú.0Úxs     r   ú	<genexpr>zformat.<locals>.<genexpr>o   s   è ø€ Ò0 ªaœ!Ñ0ùs   ‚Š)r   r   r   Úcalc_check_digitÚjoin)r   Ú	separatorÚadd_check_digitÚpartss       r   Úformatr0   i   si   € ä�V‹_€FÜ
ˆ6ƒ{�bÒ™_Ø”$×'Ñ'¨Ó/Ñ/ˆØ�B�QˆZ˜  !˜ f¨Q¨r l°F¸2¸3°KÐ@€EØ�>‰>Ñ0 UÔ0Ó0Ð0r   N)r   ÚstrÚreturnr1   )r   r1   r2   z
str | None)r   r1   r2   r   )r   r1   r2   ztuple[str, str, str])ú-F)r   r1   r-   r1   r.   r   r2   r1   )Ú__doc__Ú
__future__r   Ústdnumr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r   r   r    r#   r0   r'   r   r   ú<module>r9      s6   ðñ*õ8 #å Ü ß 'ó/óó
óó3õ1r   