Ë
    Ã?ÆiÞ
  ã                  óV   — 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
dd	„Zy
)a  ABN (Australian Business Number).

The Australian Business Number (ABN) is an identifier issued to entities
registered in the Australian Business Register (ABR). The number consists of
11 digits of which the first two are check digits.

More information:

* https://en.wikipedia.org/wiki/Australian_Business_Number
* https://abr.business.gov.au/

>>> validate('83 914 571 673')
'83914571673'
>>> validate('99 999 999 999')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('51824753556')
'51 824 753 556'
é    )Úannotations)Ú*)ÚcleanÚisdigitsc                ó6   — t        | d«      j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.ú )r   Ústrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/au/abn.pyÚcompactr   0   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                óf   — d}t        d„ t        || «      D «       «      }t        d|dz
  dz  z   «      S )zQCalculate the check digits that should be prepended to make the number
    valid.)	é   é   é   é	   é   é   é   é   é   c              3  ó@   K  — | ]  \  }}| t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>z$calc_check_digits.<locals>.<genexpr>:   s   è ø€ Ò9™D˜A˜qˆQˆB”�Q“�KÑ9ùs   ‚r   é   éY   )ÚsumÚzipÚstr)r   ÚweightsÚss      r   Úcalc_check_digitsr&   6   s8   € ð /€GÜÑ9¤C¨°Ó$8Ô9Ó9€AÜˆr�Q˜‘U˜b‘LÑ Ó!Ð!r   c                ó²   — t        | «      } t        | «      s
t        «       ‚t        | «      dk7  r
t	        «       ‚t        | dd «      | dd k7  r
t        «       ‚| S )z[Check if the number is a valid ABN. This checks the length, formatting
    and check digit.r   é   N)r   r   ÚInvalidFormatÚlenÚInvalidLengthr&   ÚInvalidChecksumr
   s    r   Úvalidater-   >   sX   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{�bÒÜ‹oÐÜ˜  ˜Ó$¨¨r°¨
Ò2ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid ABN.F)Úboolr-   ÚValidationErrorr
   s    r   Úis_validr1   K   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óZ   — t        | «      } dj                  | dd | dd | dd | dd f«      S )z8Reformat the number to the standard presentation format.r   r   r(   r   é   N)r   Újoinr
   s    r   Úformatr5   S   s;   € ä�V‹_€FØ�8‰8�V˜A˜a�[ &¨¨1 +¨v°a¸¨{¸FÀ1À2¸JÐGÓHÐHr   N)r   r#   Úreturnr#   )r   r#   r6   r/   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r&   r-   r1   r5   © r   r   ú<module>r<      s/   ðñ*õ* #ä ß 'ó&ó"ó
óôIr   