Ë
    Ã?Æiñ  ã                  ób   — 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y)u°  DIÄŒ (DaÅˆovÃ© identifikaÄ�nÃ­ Ä�Ã­slo, Czech VAT number).

The number is an 8, 9 or 10 digit code that includes a check digit and is
used to uniquely identify taxpayers for VAT (DPH in Czech). The number can
refer to legal entities (8 digit numbers), individuals with a RÄŒ (the 9 or
10 digit Czech birth number) or individuals without a RÄŒ (9 digit numbers
that begin with a 6).

>>> compact('CZ 25123891')
'25123891'
>>> validate('25123891')  # legal entity
'25123891'
>>> validate('25123890')  # incorrect check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('7103192745')  # RÄŒ
'7103192745'
>>> validate('640903926')  # special case
'640903926'
é    )Úannotations)Úrc)Ú*)ÚcleanÚisdigitsc                ó‚   — t        | d«      j                  «       j                  «       } | j                  d«      r| dd } | S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z /ÚCZé   N)r   ÚupperÚstripÚ
startswith©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/cz/dic.pyÚcompactr   2   s@   € ô �6˜4Ó ×&Ñ&Ó(×.Ñ.Ó0€FØ×Ñ˜ÔØ˜˜�ˆØ€Mó    c                óh   — dt        d„ t        | «      D «       «      z
  dz  }t        |xs ddz  «      S )zuCalculate the check digit for 8 digit legal entities. The number
    passed should not have the check digit included.é   c              3  óD   K  — | ]  \  }}d |z
  t        |«      z  –— Œ y­w©é   N©Úint©Ú.0ÚiÚns      r   ú	<genexpr>z)calc_check_digit_legal.<locals>.<genexpr>>   s!   è ø€ ÒE©4¨1¨a�q˜1‘u¤ A£Õ&ÑEùó   ‚ é   é
   ©ÚsumÚ	enumerateÚstr©r   Úchecks     r   Úcalc_check_digit_legalr(   ;   s7   € ð ”#ÑE´9¸VÓ3DÔEÓEÑEÈÑK€EÜ�’
˜˜bÑ Ó!Ð!r   c                ól   — t        d„ t        | «      D «       «      dz  }t        dd|z
  dz  z
  dz  «      S )zvCalculate the check digit for special cases. The number passed
    should not have the first and last digits included.c              3  óD   K  — | ]  \  }}d |z
  t        |«      z  –— Œ y­wr   r   r   s      r   r   z+calc_check_digit_special.<locals>.<genexpr>E   s!   è ø€ Ò?¡T Q¨��Q‘œ#˜a›&Õ Ñ?ùr   r   r   r!   r"   r&   s     r   Úcalc_check_digit_specialr+   B   s<   € ô Ñ?¬Y°vÓ->Ô?Ó?À"ÑD€EÜ��R˜%‘Z 2Ñ%Ñ%¨Ñ+Ó,Ð,r   c                ó®  — t        | «      } t        | «      s
t        «       ‚t        | «      dk(  r;| j	                  d«      r
t        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S t        | «      dk(  r1| j	                  d«      r t        | dd «      | d   k7  r
t        «       ‚| S t        | «      dv rt        j                  | «       | S t        «       ‚)	zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.r   Ú9Néÿÿÿÿé	   Ú6r    )r/   r!   )r   r   ÚInvalidFormatÚlenr   ÚInvalidComponentr(   ÚInvalidChecksumr+   r   ÚvalidateÚInvalidLengthr   s    r   r5   r5   I   sÔ   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�aÒà×Ñ˜SÔ!Ü"Ó$Ð$Ü! &¨¨" +Ó.°&¸±*Ò<Ü!Ó#Ð#ð €Mô 
ˆV‹˜Ò	˜f×/Ñ/°Ô4ä# F¨1¨R LÓ1°V¸B±ZÒ?Ü!Ó#Ð#ð €Mô 
ˆV‹˜Ñ	ä
�‰�FÔð €Mô ‹oÐr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid VAT number.F)Úboolr5   ÚValidationErrorr   s    r   Úis_validr:   a   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r%   Úreturnr%   )r   r%   r;   r8   )Ú__doc__Ú
__future__r   Ú	stdnum.czr   Ústdnum.exceptionsÚstdnum.utilr   r   r   r(   r+   r5   r:   © r   r   ú<module>rB      s1   ðñ*õ, #å Ü ß 'óó"ó-óô0r   