Ë
    Ã?Æi\  ã                  ó‚   — d Z ddlmZ ddlmZ ddlmZ ddl­ ddlm	Z	 g d¢Z
ej                  Zdd„Zdd	„Zdd
„Zdd„Zy)u€  CIF (CÃ³digo de IdentificaciÃ³n Fiscal, Spanish company tax number).

The CIF is a tax identification number for legal entities. It has 9 digits
where the first digit is a letter (denoting the type of entity) and the
last is a check digit (which may also be a letter).

More information

* https://es.wikipedia.org/wiki/CÃ³digo_de_identificaciÃ³n_fiscal

>>> validate('J99216582')
'J99216582'
>>> validate('J99216583')  # invalid check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('J992165831')  # too long
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('M-1234567-L')  # valid NIF but not valid CIF
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> validate('O-1234567-L')  # invalid first character
Traceback (most recent call last):
    ...
InvalidFormat: ...
>>> split('A13 585 625')
('A', '13', '58562', '5')
é    )Úannotations)Úluhn)Údni)Ú*)Úisdigits)ÚcompactÚvalidateÚis_validÚsplitc                óT   — t        j                  | dd «      }|dt        |«         z   S )zÄCalculate the check digits for the specified number. The number
    passed should not have the check digit included. This function returns
    both the number and character check digit candidates.é   NÚ
JABCDEFGHI)r   Úcalc_check_digitÚint)ÚnumberÚchecks     úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/es/cif.pyÚcalc_check_digitsr   D   s.   € ô ×!Ñ! &¨¨ *Ó-€EØ�<¤ E£
Ñ+Ñ+Ð+ó    c                óØ   — t        | «      } t        | dd «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚| d   dv r| d   t        | dd «      vr
t        «       ‚| S t        «       ‚)úkCheck if the number provided is a valid DNI number. This checks the
    length, formatting and check digit.r   éÿÿÿÿé	   r   ÚABCDEFGHJNPQRSUVWN)r   r   ÚInvalidFormatÚlenÚInvalidLengthr   ÚInvalidChecksum©r   s    r   r	   r	   L   sx   € ô �V‹_€FÜ�F˜1˜R�LÔ!Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐØˆa�yÐ'Ñ'ð �"‰:Ô.¨v°c°r¨{Ó;Ñ;Ü!Ó#Ð#ð €Mô ‹oÐr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr	   ÚValidationErrorr   s    r   r
   r
   `   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó<   — t        | «      } | d   | dd | dd | dd fS )z¸Split the provided number into a letter to define the type of
    organisation, two digits that specify a province, a 5 digit sequence
    number within the province and a check digit.r   r   é   é   N)r   r   s    r   r   r   i   s2   € ô �V‹_€FØ�!‰9�f˜Q˜q�k 6¨!¨A ;°°q°r°
Ð:Ð:r   N)r   ÚstrÚreturnr&   )r   r&   r'   r!   )r   r&   r'   ztuple[str, str, str, str])Ú__doc__Ú
__future__r   Ústdnumr   Ú	stdnum.esr   Ústdnum.exceptionsÚstdnum.utilr   Ú__all__r   r   r	   r
   r   © r   r   ú<module>r0      sB   ðñ*õ@ #å Ý Ü Ý  ò 7€ð �+‰+€ó,óó(ô;r   