Ë
    Ã?Æi
  ã                  óN   — d 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
y	)uk  ID za DDV (DavÄ�na Å¡tevilka, Slovenian VAT number).

The DDV number (DavÄ�na Å¡tevilka) is used for VAT (DDV, Davek na dodano
vrednost) purposes and consist of 8 digits of which the last is a check
digit.

>>> validate('SI 5022 3054')
'50223054'
>>> validate('SI 50223055')  # invalid check digits
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )Úannotations)Ú*)Ú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 -ÚSIé   N)r   ÚupperÚstripÚ
startswith©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/si/ddv.pyÚcompactr   )   s@   € ô �6˜4Ó ×&Ñ&Ó(×.Ñ.Ó0€FØ×Ñ˜ÔØ˜˜�ˆØ€Mó    c                óh   — dt        d„ t        | «      D «       «      dz  z
  }|dk(  rdS t        |«      S )zZCalculate the check digit. 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.<locals>.<genexpr>5   s!   è ø€ ÒE©4¨1¨a�q˜1‘u¤ A£Õ&ÑEùs   ‚ é
   Ú0)ÚsumÚ	enumerateÚstr)r   Úchecks     r   Úcalc_check_digitr!   2   s8   € ð ”#ÑE´9¸VÓ3DÔEÓEÈÑJÑJ€Eà˜2’+ˆ3Ð-¤3 u£:Ð-r   c                óÔ   — t        | «      } t        | «      r| j                  d«      r
t        «       ‚t	        | «      dk7  r
t        «       ‚t        | dd «      | d   k7  r
t        «       ‚| S )zbCheck if the number is a valid VAT number. This checks the length,
    formatting and check digit.r   r   Néÿÿÿÿ)r   r   r   ÚInvalidFormatÚlenÚInvalidLengthr!   ÚInvalidChecksumr   s    r   Úvalidater(   :   sc   € ô �V‹_€FÜ�FÔ˜v×0Ñ0°Ô5Ü‹oÐÜ
ˆ6ƒ{�aÒÜ‹oÐÜ˜˜s ˜Ó$¨¨r©
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z*Check if the number is a valid VAT number.F)Úboolr(   ÚValidationErrorr   s    r   Úis_validr,   G   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"N)r   r   Úreturnr   )r   r   r-   r*   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r!   r(   r,   © r   r   ú<module>r3      s)   ðñ*õ #ä ß 'óó.ó
ôr   