Ë
    Ã?Æ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
)au  TFN (Australian Tax File Number).

The Tax File Number (TFN) is issued by the Australian Taxation Office (ATO)
to taxpaying individuals and organisations. A business has both a TFN and an
Australian Business Number (ABN).

The number consists of 8 (older numbers) or 9 digits and includes a check
digit but otherwise without structure.

More information:

* https://en.wikipedia.org/wiki/Tax_file_number
* https://www.ato.gov.au/Individuals/Tax-file-number/

>>> validate('123 456 782')
'123456782'
>>> validate('999 999 999')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('123456782')
'123 456 782'
é    )Ú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/tfn.pyÚcompactr   3   s   € ô �˜Ó×#Ñ#Ó%Ð%ó    c                óD   — d}t        d„ t        || «      D «       «      dz  S )zCalculate the checksum.)	é   é   é   é   é   é   é   é	   é
   c              3  ó>   K  — | ]  \  }}|t        |«      z  –— Œ y ­w)N)Úint)Ú.0ÚwÚns      r   ú	<genexpr>zchecksum.<locals>.<genexpr><   s   è ø€ Ò;™d˜a ˆq”3�q“6�zÑ;ùs   ‚é   )ÚsumÚzip)r   Úweightss     r   Úchecksumr#   9   s$   € à*€GÜÑ;¤c¨'°6Ó&:Ô;Ó;¸bÑ@Ð@r   c                ó¤   — t        | «      } t        | «      s
t        «       ‚t        | «      dvr
t	        «       ‚t        | «      dk7  r
t        «       ‚| S )z[Check if the number is a valid TFN. This checks the length, formatting
    and check digit.)r   r   r   )r   r   ÚInvalidFormatÚlenÚInvalidLengthr#   ÚInvalidChecksumr
   s    r   Úvalidater)   ?   sL   € ô �V‹_€FÜ�FÔÜ‹oÐÜ
ˆ6ƒ{˜&Ñ Ü‹oÐÜ�Ó˜1ÒÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z#Check if the number is a valid TFN.F)Úboolr)   ÚValidationErrorr
   s    r   Úis_validr-   L   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                óR   — t        | «      } dj                  | 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   Úformatr0   T   s3   € ä�V‹_€FØ�8‰8�V˜A˜a�[ &¨¨1 +¨v°a°b¨zÐ:Ó;Ð;r   N)r   ÚstrÚreturnr1   )r   r1   r2   r   )r   r1   r2   r+   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.utilr   r   r   r#   r)   r-   r0   © r   r   ú<module>r8      s/   ðñ*õ0 #ä ß 'ó&óAó
óô<r   