Ë
    Ã?Æiø  ã                  ó|   — d Z ddlmZ ddlZddl­ ddlmZ ddlmZ  ej                  d«      Z
	 dd„Zdd	„Zdd
„Zy)ao  PPS No (Personal Public Service Number, Irish personal number).

The Personal Public Service number consists of 7 digits, and one or
two letters. The first letter is a check character.
When present (which should be the case for new numbers as of 2013),
the second letter can be 'A' (for individuals) or 'H' (for
non-individuals, such as limited companies, trusts, partnerships
and unincorporated bodies). As of 2024, B was accepted as a second
letter on all new PPS numbers.

Pre-2013 values may have 'W', 'T', or 'X' as the second letter ;
it is ignored by the check.

>>> validate('6433435F')  # pre-2013
'6433435F'
>>> validate('6433435FT')  # pre-2013 with special final 'T'
'6433435FT'
>>> validate('6433435FW')  # pre-2013 format for married women
'6433435FW'
>>> validate('6433435E')  # incorrect check digit
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> validate('6433435OA')  # 2013 format (personal)
'6433435OA'
>>> validate('6433435IH')  # 2013 format (non-personal)
'6433435IH'
>>> validate('6433435VH')  # 2013 format (incorrect check)
Traceback (most recent call last):
    ...
InvalidChecksum: ...
é    )ÚannotationsN)Ú*)Úvat)Úcleanz^\d{7}[A-W][ABHWTX]?$c                óR   — t        | d«      j                  «       j                  «       S )zˆConvert the number to the minimal representation. This strips the
    number of any valid separators and removes surrounding whitespace.z -)r   ÚupperÚstrip©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ie/pps.pyÚcompactr   C   s#   € ô �˜Ó×$Ñ$Ó&×,Ñ,Ó.Ð.ó    c                ó4  — t        | «      } t        j                  | «      s
t        «       ‚t	        | «      dk(  r7| d   dv r0| d   t        j                  | dd | dd z   «      k7  r
t        «       ‚| S | d   t        j                  | dd «      k7  r
t        «       ‚| S )úkCheck if the number provided is a valid PPS number. This checks the
    length, formatting and check digit.é	   é   ÚABHé   N)r   Úpps_reÚmatchÚInvalidFormatÚlenr   Úcalc_check_digitÚInvalidChecksumr
   s    r   Úvalidater   I   s�   € ô �V‹_€FÜ�<‰<˜ÔÜ‹oÐÜ
ˆ6ƒ{�aÒ˜F 1™I¨Ñ.à�!‰9œ×,Ñ,¨V°B°Q¨Z¸&ÀÀ¸*Ñ-DÓEÒEÜ!Ó#Ð#ð
 €Mð �!‰9œ×,Ñ,¨V°B°Q¨ZÓ8Ò8Ü!Ó#Ð#Ø€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)r   F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   Z   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡")r   ÚstrÚreturnr    )r   r    r!   r   )Ú__doc__Ú
__future__r   ÚreÚstdnum.exceptionsÚ	stdnum.ier   Ústdnum.utilr   Úcompiler   r   r   r   © r   r   ú<module>r*      sA   ðñ*õB #ã 	ä Ý Ý ð 
ˆ�‰Ð,Ó	-€Ø =ó/óô"r   