Ë
    Ã?Æi  ã                  óZ   — d Z ddlmZ ddl­ ddlmZ ddlmZmZ dd„Z	dd„Z
dd„Zdd	„Zy
)uY  ICE (Identifiant Commun de lâ€™Entreprise, Ø§Ù„ØªØ¹Ø±ÙŠÙ� Ø§Ù„Ù…ÙˆØ­Ø¯ Ù„Ù„Ù…Ù‚Ø§ÙˆÙ„Ø©, Morocco tax number).

The ICE is a number that identifies the company and its branches in a unique
and uniform way by all Moroccan administrations. It comes in addition to the
other legal identifiers, notably the "identifiant fiscal" (IF), the "numÃ©ro de
registre de commerce" (RC) and the CNSS number. The ICE does not replace these
identifiers, which remain mandatory.

The ICE is intended to ease communication among Moroccan administration
branches, therefore simplifying procedures, increasing reliability and speed,
and therefore reducing costs.

The ICE applies to legal entities and their branches, as well as to natural
persons.

The ICE consists of 15 characters, where the first 9 represent the enterprise,
the following 4 represent its establishments, and the last 2 are control
characters.

More information:

* https://www.ice.gov.ma/
* https://www.ice.gov.ma/ICE/Depliant_ICE.pdf
* https://www.ice.gov.ma/ICE/Guide_ICE.pdf

>>> validate('001561191000066')
'001561191000066'
>>> validate('00 21 36 09 30 00 040')
'002136093000040'
>>> validate('12345')
Traceback (most recent call last):
    ...
InvalidLength: ...
>>> validate('001561191000065')
Traceback (most recent call last):
    ...
InvalidChecksum: ...
>>> format('00 21 36 09 30 00 040')
'002136093000040'
é    )Úannotations)Ú*)Ú	mod_97_10)ÚcleanÚisdigitsc                ó   — t        | d«      S )z�Convert the number to the minimal representation.

    This strips the number of any valid separators, removes surrounding
    whitespace.
    ú )r   ©Únumbers    úT/var/www/html/myprovider/mon_projet_qr/lib/python3.12/site-packages/stdnum/ma/ice.pyÚcompactr   F   s   € ô �˜ÓÐó    c                óº   — t        | «      } t        | «      dk7  r
t        «       ‚t        | «      s
t	        «       ‚t        j                  | «      dk7  r
t        «       ‚| S )zcCheck if the number is a valid Morocco ICE number.

    This checks the length and formatting.
    é   r   )r   ÚlenÚInvalidLengthr   ÚInvalidFormatr   ÚchecksumÚInvalidChecksumr
   s    r   Úvalidater   O   sR   € ô
 �V‹_€FÜ
ˆ6ƒ{�bÒÜ‹oÐÜ�FÔÜ‹oÐÜ×Ñ˜&Ó! QÒ&ÜÓÐØ€Mr   c                óJ   — 	 t        t        | «      «      S # t        $ r Y yw xY w)z2Check if the number is a valid Morocco ICE number.F)Úboolr   ÚValidationErrorr
   s    r   Úis_validr   ^   s)   € ðÜ”H˜VÓ$Ó%Ð%øÜò Ùðús   ‚ –	"¡"c                ó6   — t        | «      j                  d«      S )z8Reformat the number to the standard presentation format.r   )r   Úzfillr
   s    r   Úformatr   f   s   € ä�6‹?× Ñ  Ó$Ð$r   N)r   ÚstrÚreturnr   )r   r   r   r   )Ú__doc__Ú
__future__r   Ústdnum.exceptionsÚstdnum.iso7064r   Ústdnum.utilr   r   r   r   r   r   © r   r   ú<module>r&      s-   ðñ,'õR #ä Ý $ß 'óóóô%r   