Ë
    ˜2Úil  ã            	       ó¤  — d Z ddlmZmZ ddlZddlZddlZ	 ddlmZ e	Z
 ed«      d ed«      d ed	«      d
 ed«      diZ ed«      d ed«      diZd„ Zd„ Zdd„Zdd„Z	 	 	 	 dd„Z	 	 	 	 dd„Z ej0                  d«      j2                  Z	 	 	 	 	 	 d d„Z	 	 	 	 	 	 d d„Zd„ Zd„ Zd!d„Zd!d„Z 	 	 d"d„Z!	 	 d"d„Z"y# e$ r ddlmZ eZ	eZ
Y Œ®w xY w)#aˆ  Additional factory functions for common QR codes.

Aside from  :py:func:`make_epc_qr`, the factory functions return a QR code
with the minimum error correction level "L" (or better).

To create a (Micro) QR code which should use a specific error correction level
or version etc., use the "_data" factory functions which return a string which
can be used as input for :py:func:`segno.make()`.
é    )Úabsolute_importÚunicode_literalsN)Úquoteú\z\\ú;z\;ú:z\:ú"z\"ú,z\,c                 ó>   — t        | «      j                  t        «      S ©z~    Escapes ``\``, ``;``, ``"`` and ``:`` in the provided string.

    :param str s: The string to escape.
    :rtype str
    )ÚstrÚ	translateÚ_MECARD_ESCAPE©Úss    úD/var/www/html/acx/venv/lib/python3.12/site-packages/segno/helpers.pyÚ_escape_mecardr   -   s   € ô ˆq‹6×ÑœNÓ+Ð+ó    c                 ó>   — t        | «      j                  t        «      S r   )r   r   Ú_VCARD_ESCAPEr   s    r   Ú_escape_vcardr   7   s   € ô ˆq‹6×ÑœMÓ*Ð*r   c                 óò   — t         }d}|r)|dj                  |dk7  r|j                  «       n|«      z  }|dj                   || «      «      z  }|�|dj                   ||«      «      z  }||rdz  }|S dz  }|S )a      Creates WIFI configuration string.

    :param str ssid: The SSID of the network.
    :param password: The password.
    :type password: str or None
    :param security: Authentication type; the value should be "WEP" or "WPA".
            Set to ``None`` to omit the value.
            "nopass" is equivalent to setting the value to ``None`` but in
            the former case, the value is not omitted.
    :type security: str or None
    :param bool hidden: Indicates if the network is hidden (default: ``False``)
    :rtype: str
    zWIFI:zT:{0};ÚnopasszS:{0};zP:{0};zH:true;r   )r   ÚformatÚupper)ÚssidÚpasswordÚsecurityÚhiddenÚescapeÚdatas         r   Úmake_wifi_datar"   A   s‰   € ô €FØ€DÙØ�—‘°HÀÒ4H §¡Ô 0ÈhÓWÑWˆØˆH�O‰O™F 4›LÓ)Ñ)€DØÐØ�—‘¡ xÓ 0Ó1Ñ1ˆØ™ˆIÑ(€DØ€Kð &)Ñ(€DØ€Kr   c                 óD   — t        j                  t        | |||«      «      S )a(      Creates a WIFI configuration QR code.

    :param str ssid: The SSID of the network.
    :param password: The password.
    :type password: str or None
    :param security: Authentication type; the value should be "WEP" or "WPA".
            Set to ``None`` to omit the value.
            "nopass" is equivalent to setting the value to ``None`` but in
            the former case, the value is not omitted.
    :type security: str or None
    :param bool hidden: Indicates if the network is hidden (default: ``False``)
    :rtype: segno.QRCode
    )ÚsegnoÚmake_qrr"   )r   r   r   r   s       r   Ú	make_wifir&   [   s   € ô �=‰=œ¨¨h¸À&ÓIÓJÐJr   c                 ód  ‡— ˆfd„}t         Šdj                   ‰| «      «      g}|r&|j                  dj                   ‰|«      «      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|«      «       |r&|j                  dj                   ‰|«      «      «       |r2	 |j	                  d«      }|j                  d	j                  |«      «       |j                   |d
|«      «       |	|
|||||f}t        |«      r7|D �cg c]  } ‰|xs d«      ‘Œ }}|j                   dj                  |Ž «       |r&|j                  dj                   ‰|«      «      «       |j                  d«       dj                  |«      S # t
        $ r Y ŒØw xY wc c}w )a�      Creates a string encoding the contact information as MeCard.

    :param str name: Name. If it contains a comma, the first part
            is treated as lastname and the second part is treated as forename.
    :param reading: Designates a text string to be set as the kana name in the phonebook
    :type reading: str or None
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the date as YYYYMMDD value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param roomno: Room number (address information).
    :type roomno: str or None
    :param houseno: House number (address information).
    :type houseno: str or None
    :param city: City (address information).
    :type city: str or None
    :param prefecture: Prefecture (address information).
    :type prefecture: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :rtype: str
    c           	      ó†   •— |syt        |t        «      r|f}|D �cg c]  }dj                  |  ‰|«      «      ‘Œ c}S c c}w )N© z{0}:{1};©Ú
isinstanceÚstr_typer   ©ÚnameÚvalÚir    s      €r   Úmake_multifieldz)make_mecard_data.<locals>.make_multifield–   s?   ø€ ÙØÜ�cœ8Ô$Ø�&ˆCØ<?Ö@°q�
×!Ñ! $©¨q«	Õ2Ò@Ð@ùÒ@ó   œ>zMECARD:N:{0};z
SOUND:{0};ÚTELÚTELAVÚEMAILzNICKNAME:{0};z%Y%m%dz	BDAY:{0};ÚURLÚ z ADR:{0},{1},{2},{3},{4},{5},{6};z	MEMO:{0};r   )r   r   ÚappendÚextendÚstrftimeÚAttributeErrorÚanyÚjoin)r.   ÚreadingÚemailÚphoneÚ
videophoneÚmemoÚnicknameÚbirthdayÚurlÚpoboxÚroomnoÚhousenoÚcityÚ
prefectureÚzipcodeÚcountryr1   r!   Úadr_propertiesr0   Úadr_datar    s                        @r   Úmake_mecard_datarO   m   s„  ø€ ôRAô €FØ×"Ñ"¡6¨$£<Ó0Ð1€DÙØ�‰�L×'Ñ'©¨w«Ó8Ô9Ø‡K�K‘  uÓ-Ô.Ø‡K�K‘ ¨Ó4Ô5Ø‡K�K‘ ¨Ó/Ô0ÙØ�‰�O×*Ñ*©6°(Ó+;Ó<Ô=Ùð	Ø×(Ñ(¨Ó2ˆHð 	�‰�K×&Ñ& xÓ0Ô1Ø‡K�K‘  sÓ+Ô,Ø˜V W¨d°JÀÈÐQ€NÜ
ˆ>ÔØ-;Ö<¨‘F˜1š7 •OÐ<ˆÐ<Ø�‰Ð=Ð6×=Ñ=¸xÐHÔIÙØ�‰�K×&Ñ&¡v¨d£|Ó4Ô5Ø‡K�K�ÔØ�7‰7�4‹=Ðøô ò 	Ùð	üò =s   Ã F Ä!F-Æ	F*Æ)F*c                 óš   — t        j                  t        di d| “d|“d|“d|“d|“d|“d|“d|“d	|“d
|	“d|
“d|“d|“d|“d|“d|“Ž«      S )a¯      Returns a QR code which encodes a `MeCard <https://en.wikipedia.org/wiki/MeCard>`_

    :param str name: Name. If it contains a comma, the first part
            is treated as lastname and the second part is treated as forename.
    :param reading: Designates a text string to be set as the kana name in the phonebook
    :type reading: str or None
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the date as YYYYMMDD value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param roomno: Room number (address information).
    :type roomno: str or None
    :param houseno: House number (address information).
    :type houseno: str or None
    :param city: City (address information).
    :type city: str or None
    :param prefecture: Prefecture (address information).
    :type prefecture: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :rtype: segno.QRCode
    r.   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   r)   )r$   r%   rO   )r.   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   s                   r   Úmake_mecardrQ   ·   s¹   € ôR �=‰=Ô)ò ;©tð ;¹Wð ;Ù05ð;Ù=Bð;á5?ð;áFJð;ñ 4<ð;ñ GOð;ñ /2ð	;ñ :?ð	;ñ HNð	;ñ
 3:ð;ñ
 AEð;ñ 6@ð;ñ JQð;ñ 3:ð;ó <ð <r   zB^\d{4}-\d{2}-\d{2}(?:T\d{2}:\d{2}:\d{2}(?:(?:-?\d{2}:\d{2})|Z)?)?$c                 ó¨  ‡— ˆfd„}t         Šdddj                  | «      dj                   ‰|«      «      g}|r&|j                  dj                   ‰|«      «      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d	|«      «       |j                   |d
|«      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|«      «       |j                   |d|	«      «       |j                   |d|«      «       |j                   |d|«      «       |r&|j                  dj                   ‰|«      «      «       |
|||||f}t	        |«      r7|D �cg c]  } ‰|xs d«      ‘Œ }}|j                   dj                  |Ž «       |rX	 |j                  d«      }t        |t        «      rt        |«      st        d«      ‚|j                  dj                  |«      «       |r|r|r|st        d«      ‚|r#|r!|j                  dj                  ||«      «       |r&|j                  dj                   ‰|«      «      «       |r&|j                  dj                   ‰|«      «      «       |rX	 |j                  d«      }t        |t        «      rt        |«      st        d«      ‚|j                  dj                  |«      «       |j                  d«       |j                  d«       dj                  |«      S c c}w # t        $ r Y �Œlw xY w# t        $ r Y Œ™w xY w)a–
      Creates a string encoding the contact information as vCard 3.0.

    Only a subset of available `vCard 3.0 properties <https://tools.ietf.org/html/rfc2426>`
    is supported.

    :param str name: The name. If it contains a semicolon, , the first part
            is treated as lastname and the second part is treated as forename.
    :param str displayname: Common name.
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param fax: Fax number. Multiple values are allowed.
    :type fax: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the
                     date as ``YYYY-MM-DD`` value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param street: Street address.
    :type street: str or None
    :param city: City (address information).
    :type city: str or None
    :param region: Region (address information).
    :type region: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :param org: Company / organization name.
    :type org: str or None
    :param lat: Latitude.
    :type lat: float or None
    :param lng: Longitude.
    :type lng: float or None
    :param source: URL where to obtain the vCard.
    :type source: str or None
    :param rev: Revision of the vCard / last modification date.
    :type rev: str, datetime.date or None
    :param title: Job Title. Multiple values are allowed.
    :type title: str, iterable of strings, or None
    :param photo_uri: Photo URI. Multiple values are allowed.
    :type photo_uri: str, iterable of strings, or None
    :param cellphone: Cell phone number. Multiple values are allowed.
    :type cellphone: str, iterable of strings, or None
    :param homephone: Home phone number. Multiple values are allowed.
    :type homephone: str, iterable of strings, or None
    :param workphone: Work phone number. Multiple values are allowed.
    :type workphone: str, iterable of strings, or None
    :rtype: str
    c           	      ó†   •— |syt        |t        «      r|f}|D �cg c]  }dj                  |  ‰|«      «      ‘Œ c}S c c}w )Nr)   z{0}:{1}r*   r-   s      €r   r1   z(make_vcard_data.<locals>.make_multifield/  s?   ø€ ÙØÜ�cœ8Ô$Ø�&ˆCØ;>Ö?°a�	× Ñ  ¡v¨a£yÕ1Ò?Ð?ùÒ?r2   zBEGIN:VCARDzVERSION:3.0zN:{0}zFN:{0}zORG:{0}r5   r3   zTEL;TYPE=FAXzTEL;TYPE=VIDEOzTEL;TYPE=CELLzTEL;TYPE=HOMEzTEL;TYPE=WORKr6   ÚTITLEzPHOTO;VALUE=urizNICKNAME:{0}r7   zADR:{0};;{1};{2};{3};{4};{5}z%Y-%m-%dzG"birthday" does not seem to be a valid date or date/time representationzBDAY:{0}zBIncomplete geo information, please specify latitude and longitude.zGEO:{0};{1}z
SOURCE:{0}zNOTE:{0}zB"rev" does not seem to be a valid date or date/time representationzREV:{0}z	END:VCARDz
)r   r   r8   r9   r<   r:   r;   r+   r,   Ú_looks_like_datetimeÚ
ValueErrorr=   ) r.   Údisplaynamer?   r@   ÚfaxrA   rB   rC   rD   rE   rF   ÚstreetrI   ÚregionrK   rL   ÚorgÚlatÚlngÚsourceÚrevÚtitleÚ	photo_uriÚ	cellphoneÚ	homephoneÚ	workphoner1   r!   rM   r0   rN   r    s                                   @r   Úmake_vcard_datare   í   sæ  ø€ ôD@ô €FØ˜=Ø�N‰N˜4Ó Ø�O‰O™F ;Ó/Ó0ð2€Dñ Ø�‰�I×$Ñ$¡V¨C£[Ó1Ô2Ø‡K�K‘ ¨Ó/Ô0Ø‡K�K‘  uÓ-Ô.Ø‡K�K‘ °Ó4Ô5Ø‡K�K‘Ð 0°*Ó=Ô>Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘ °Ó;Ô<Ø‡K�K‘  sÓ+Ô,Ø‡K�K‘ ¨Ó/Ô0Ø‡K�K‘Ð 1°9Ó=Ô>ÙØ�‰�N×)Ñ)©&°Ó*:Ó;Ô<Ø˜V T¨6°7¸GÐD€NÜ
ˆ>ÔØ-;Ö<¨‘F˜1š7 •OÐ<ˆÐ<Ø�‰Ð9Ð2×9Ñ9¸8ÐDÔEÙð	Ø×(Ñ(¨Ó4ˆHô ˜(¤HÔ-Ô5IÈ(Ô5SÜÐfÓgÐgØ�‰�J×%Ñ% hÓ/Ô0Ù
‘3™#¡cÜÐ]Ó^Ð^Ù
‰sØ�‰�M×(Ñ(¨¨cÓ2Ô3ÙØ�‰�L×'Ñ'©¨v«Ó7Ô8ÙØ�‰�J×%Ñ%¡f¨T£lÓ3Ô4Ù
ð	Ø—,‘,˜zÓ*ˆCô ˜#œxÔ(Ô0DÀSÔ0IÜÐaÓbÐbØ�‰�I×$Ñ$ SÓ)Ô*Ø‡K�K�ÔØ‡K�K�„OØ�;‰;�tÓÐùò9 =øô
 ò 	Úð	ûô  ò 	Ùð	ús*   ÆL0ÇL5 Ê&M Ì5	MÍMÍ	MÍMc                 óÎ   — t        j                  t        | |fi d|“d|“d|“d|“d|“d|“d|“d|	“d	|
“d
|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“d|“Ž«      S )aÁ
      Creates a QR code which encodes a `vCard <https://en.wikipedia.org/wiki/VCard>`_
    version 3.0.

    Only a subset of available `vCard 3.0 properties <https://tools.ietf.org/html/rfc2426>`
    is supported.

    :param str name: The name. If it contains a semicolon, , the first part
            is treated as lastname and the second part is treated as forename.
    :param str displayname: Common name.
    :param email: E-mail address. Multiple values are allowed.
    :type email: str, iterable of strings, or None
    :param phone: Phone number. Multiple values are allowed.
    :type phone: str, iterable of strings, or None
    :param fax: Fax number. Multiple values are allowed.
    :type fax: str, iterable of strings, or None
    :param videophone: Phone number for video calls. Multiple values are allowed.
    :type videophone: str, iterable of strings, or None
    :param memo: A notice for the contact.
    :type memo: str or None
    :param nickname: Nickname.
    :type nickname: str or None
    :param birthday: Birthday. If a string is provided, it should encode the
                     date as ``YYYY-MM-DD`` value.
    :type birthday: str, datetime.date or None
    :param url: Homepage. Multiple values are allowed.
    :type url: str, iterable of strings, or None
    :param pobox: P.O. box (address information).
    :type pobox: str or None
    :param street: Street address.
    :type street: str or None
    :param city: City (address information).
    :type city: str or None
    :param region: Region (address information).
    :type region: str or None
    :param zipcode: Zip code (address information).
    :type zipcode: str or None
    :param country: Country (address information).
    :type country: str or None
    :param org: Company / organization name.
    :type org: str or None
    :param lat: Latitude.
    :type lat: float or None
    :param lng: Longitude.
    :type lng: float or None
    :param source: URL where to obtain the vCard.
    :type source: str or None
    :param rev: Revision of the vCard / last modification date.
    :type rev: str, datetime.date or None
    :param title: Job Title. Multiple values are allowed.
    :type title: str, iterable of strings, or None
    :param photo_uri: Photo URI. Multiple values are allowed.
    :type photo_uri: str, iterable of strings, or None
    :param cellphone: Cell phone number. Multiple values are allowed.
    :type cellphone: str, iterable of strings, or None
    :param homephone: Home phone number. Multiple values are allowed.
    :type homephone: str, iterable of strings, or None
    :param workphone: Work phone number. Multiple values are allowed.
    :type workphone: str, iterable of strings, or None
    :rtype: segno.QRCode
    r?   r@   rX   rA   rB   rC   rD   rE   rF   rY   rI   rZ   rK   rL   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   )r$   r%   re   )r.   rW   r?   r@   rX   rA   rB   rC   rD   rE   rF   rY   rI   rZ   rK   rL   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   s                             r   Ú
make_vcardrg   i  s  € ôF �=‰=œ¨¨{ò >Á%ð >Ù/4ð>Ù:=ð>á4>ð>áEIð>ñ 3;ð>ñ FNð>ñ .1ð	>ñ 9>ð	>ñ GMð	>ñ
 /3ð>ñ
 <Bð>ñ 29ð>ñ CJð>ñ .1ð>ñ 7:ð>ñ @Cð>ñ 17ð>ñ =@ð>ñ HMð>ñ 4=ð>ñ 4=ð>ñ 4=ð>ñ 4=ð>ó ?ð ?r   c                 óD   — d„ }dj                   || «       ||«      «      S )zt    Creates a geo location URI.

    :param float lat: Latitude
    :param float lng: Longitude
    :rtype: str
    c                 ó`   — dj                  | «      j                  d«      j                  d«      S )Nz{0:.8f}Ú0ú.)r   Úrstrip)Úfs    r   Úfloat_to_strz#make_geo_data.<locals>.float_to_strÃ  s)   € Ø×Ñ Ó"×)Ñ)¨#Ó.×5Ñ5°cÓ:Ð:r   zgeo:{0},{1})r   )r\   r]   rn   s      r   Úmake_geo_dataro   »  s&   € ò;ð ×Ñ¡¨SÓ 1±<ÀÓ3DÓEÐEr   c                 ó@   — t        j                  t        | |«      «      S )z·    Returns a QR code which encodes geographic location using the ``geo`` URI
    scheme.

    :param float lat: Latitude
    :param float lng: Longitude
    :rtype: segno.QRCode
    )r$   r%   ro   )r\   r]   s     r   Úmake_georq   É  s   € ô �=‰=œ s¨CÓ0Ó1Ð1r   c                 óÒ  — d„ }d}dg}| st        d«      ‚|j                  dj                   || «      «      «       d|fd|ffD ]C  \  }}	 ||	«      }
|
sŒ|j                  dj                  ||dj                  |
«      «      «       d	}ŒE d
|fd|ffD ]C  \  }}	|	�:|j                  dj                  ||t	        |	j                  d«      «      «      «       d	}ŒE dj                  |«      S )a|      Creates either a simple "mailto:" URL or complete e-mail message with
    (blind) carbon copies and a subject and a body.

    :param to: The email address (recipient). Multiple values are allowed.
    :type to: str or iterable of strings
    :param cc: The carbon copy recipient. Multiple values are allowed.
    :type cc: str, iterable of strings, or None
    :param bcc: The blind carbon copy recipient. Multiple values are allowed.
    :type bcc: str, iterable of strings, or None
    :param subject: The subject.
    :type subject: str or None
    :param body: The message body.
    :type body: str or None
    :rtype: str
    c                 óD   — | syt        | t        «      r| fS t        | «      S )Nr)   )r+   r,   Útuple)r/   s    r   Úmultiz#make_make_email_data.<locals>.multiæ  s#   € ÙØÜ�cœ8Ô$Ø�6ˆMÜ�S‹zÐr   ú?zmailto:z"to" must not be empty or Noner
   ÚccÚbccz
{0}{1}={2}ú&ÚsubjectÚbodyúutf-8r7   )rV   r8   r=   r   r   Úencode)Útorw   rx   rz   r{   ru   Údelimr!   Úkeyr/   Úvalss              r   Úmake_make_email_datar‚   Õ  s÷   € ò"ð €EØˆ;€DÙÜÐ9Ó:Ð:Ø‡K�K�—‘™˜r›Ó#Ô$Ø˜B�Z %¨ Ð.ò ‰ˆˆSÙ�S‹zˆÚØ�K‰K˜×+Ñ+¨E°3¸¿¹À»ÓGÔHØ‰Eð	ð
   Ð)¨F°D¨>Ð:ò ‰ˆˆSØˆ?Ø�K‰K˜×+Ñ+¨E°3¼¸c¿j¹jÈÓ>QÓ8RÓSÔTØ‰ðð �7‰7�4‹=Ðr   c           	      óH   — t        j                  t        | ||||¬«      «      S )a�      Encodes either a simple e-mail address or a complete message with
    (blind) carbon copies and a subject and a body.

    :param to: The email address (recipient). Multiple values are allowed.
    :type to: str or iterable of strings
    :param cc: The carbon copy recipient. Multiple values are allowed.
    :type cc: str, iterable of strings, or None
    :param bcc: The blind carbon copy recipient. Multiple values are allowed.
    :type bcc: str, iterable of strings, or None
    :param subject: The subject.
    :type subject: str or None
    :param body: The message body.
    :type body: str or None
    :rtype: segno.QRCode
    ©r~   rw   rx   rz   r{   )r$   r%   r‚   r„   s        r   Ú
make_emailr…   þ  s+   € ô" �=‰=Ô-°¸ÀØ6=ÀDôJó Kð Kr   c                 ól  — d}t        j                  d«      }	t        j                  d«      }
|r|j                  «       n|}|r|j                  «       n|}|r|j                  «       n|}| r| j                  «       n| } |�tt	        |t
        «      r$	 |j                  |j                  «       «      dz   }n@t	        |t        «      rd|cxk  rt        |«      k  sn t        dj                  |«      «      ‚|s|r|r|rt        d«      ‚|r9d	t        |«      cxk  rd
k  s%n t        dj                  t        |«      «      «      ‚|r9d	t        |«      cxk  rdk  s%n t        dj                  t        |«      «      «      ‚| �d	t        | «      cxk  rdk  sn t        dj                  | «      «      ‚|�dt        |«      cxk  rdk  sn t        dj                  |«      «      ‚|r't        |«      dvrt        dj                  |«      «      ‚|r(t        |«      dk7  rt        dj                  |«      «      ‚t        j                  |«      }|	|cxk  r|
k  sn t        dj                  |	|
«      «      ‚dddd|xs d| |dj                  |«      j                  d«      j                  d«      |xs d|xs dg
}|r|j                  |«       dj                  |«      }|€dn|}|d	k  r-t        |dd d ¬!«      D ]  \  }}	 |j                  |«       |} n |d	k  rd}t#        |«      |d <   dj                  |«      j                  ||dz
     «      }t        |«      d"kD  r#t        d#j                  t        |«      «      «      ‚|S # t        $ r t        dj                  ||«      «      ‚w xY w# t         $ r Y Œ¾w xY w)$zõ    Validates the input and creates the data for an EPC QR Code.

    DOES NOT belong to the public API, kept separate from make_epc_qr to apply
    tests on the raw data.

    See :py:func:`make_epc_qr` for a description of the parameters.
    )r|   z
iso-8859-1z
iso-8859-2z
iso-8859-4z
iso-8859-5z
iso-8859-7ziso-8859-10ziso-8859-15z0.01z999999999.99Né   z&Invalid encoding "{0}", use one of {1}z9Invalid encoding number only 1 .. 8 are allowed, got "{}"zBEither a text or a creditor reference (ISO 11649) must be providedr   éŒ   z7Invalid text, max. 140 characters are allowed, got "{}"é#   zPInvalid creditor reference (ISO 11649), max. 35 characters are allowed, got "{}"éF   z6Invalid name, max. 70 characters are allowed, got "{}"é   é"   zAInvalid IBAN, min. 5 and max. 34 characters are allowed, got "{}")é   é   z8Invalid BIC, should be 8 or 11 characters long, got "{}"z3Invalid purpose, 4 characters are allowed, got "{}"zBInvalid amount, must be in bigger or equal {} and less or equal {}ÚBCDÚ002r7   ÚSCTz	EUR{:.2f}rj   rk   ú
éÿÿÿÿé   )ÚstartiK  z8Payload is too big: Max. 331 bytes allowed, got {} bytes)ÚdecimalÚDecimalrl   Ústripr+   r,   ÚindexÚlowerrV   r   ÚintÚlenr8   r=   Ú	enumerater}   ÚUnicodeEncodeErrorr   )r.   ÚibanÚamountÚtextÚ	referenceÚbicÚpurposeÚencodingÚ	encodingsÚ
min_amountÚ
max_amountÚtmp_datar!   ÚcharsetÚidxÚencs                   r   Ú_make_epc_qr_datar­     sˆ  € ðK€Iä—‘ Ó(€JÜ—‘ Ó0€JÙ ˆ4�;‰;Œ= d€DÙ&/�	× Ñ Ô"°Y€IÙˆ#�)‰)Œ+ #€CÙˆ4�:‰:Œ< T€DØÐÜ�h¤Ô)ðgØ$Ÿ?™?¨8¯>©>Ó+;Ó<¸qÑ@‘ô ˜H¤cÔ*°!°xÔ2QÄ3ÀyÃ>Ô2QÜÐX×_Ñ_Ð`hÓiÓjÐjÙ™	¡T©iÜÐ]Ó^Ð^Ù�Aœ˜D›	Ô( SÔ(ÜÐR×YÑYÔZ]Ð^bÓZcÓdÓeÐeÙ	˜1œs 9›~Ô3°Ô3ÜÐkß ™&¤ Y£Ó0ó2ð 	2à€|˜1œs 4›yÔ.¨BÔ.ÜÐQ×XÑXÐY]Ó^Ó_Ð_Ø€|˜1œs 4›yÔ.¨BÔ.ÜÐ\×cÑcÐdhÓiÓjÐjÙ
Œs�3‹x˜wÑ&ÜÐS×ZÑZÐ[^Ó_Ó`Ð`Ù”3�w“< 1Ò$ÜÐN×UÑUÐV]Ó^Ó_Ð_Ü�_‰_˜VÓ$€FØ˜Ô- :Ô-ÜÐ]ß ™& ¨ZÓ8ó:ð 	:àØØØØ’	�rØØØ×"Ñ" 6Ó*×1Ñ1°#Ó6×=Ñ=¸cÓBØ’˜2Ø’˜Rð
€Hñ Ø�‰˜ÔØ�9‰9�XÓ€DØÐ$‰b¨(€GØ�‚{Ü! )¨A¨B -°qÔ9ò 	‰HˆC�ðØ—‘˜CÔ Ø�Ùð		ð �‚{ØˆÜ�g“,€HˆQ�KØ�9‰9�XÓ×%Ñ% i°¸!±Ñ&<Ó=€Dä
ˆ4ƒy�3‚ÜÐS×ZÑZÔ[^Ð_cÓ[dÓeÓfÐfØ€Køôk ò gÜ Ð!I×!PÑ!PÐQYÐ[dÓ!eÓfÐfðgûôX &ò Ùðús   Â"M? Ë;N'Í?%N$Î'	N3Î2N3c                 ó¼   — t        j                  t        | |||||||«      dd¬«      }|j                  dkD  r$t	        dj                  |j                  «      «      ‚|S )aŠ      Creates and returns an European Payments Council Quick Response Code
    (EPC QR Code) version 002.

    The returned :py:class:`segno.QRCode` uses always the error correction level
    "M" and utilizes max. version 13 to fulfill the constraints of the EPC QR
    Code standard.

    .. note::

        Either the ``text`` or ``reference`` must be provided but not both

    .. note::

        Neither the IBAN, BIC, nor remittance reference number or any other
        information is validated (aside from checks regarding the allowed string
        lengths).

    :param str name: Name of the recipient.
    :param str iban: International Bank Account Number (IBAN)
    :param amount: The amount (in EUR) to transfer.
            The currency is always Euro, no other currencies are supported.
    :type amount: int, float, decimal.Decimal
    :param str text: Remittance Information (unstructured)
    :param str reference: Remittance Information (structured)
    :param str bic: Bank Identifier Code (BIC). Optional, only required
                for non-EEA countries.
    :param str purpose: SEPA purpose code.
    :param encoding: By default, this function tries to find the best,
                minimal encoding. If another encoding should be used, the encoding
                name or the encoding constant (an integer) can be provided:
                ``1``: "UTF-8", ``2``: "ISO 8859-1", ``3``: "ISO 8859-2",
                ``4``: "ISO 8859-4", ``5``: "ISO 8859-5", ``6``: "ISO 8859-7",
                ``7``: "ISO 8859-10", ``8``: "ISO 8859-15"

                The encoding is case-insensitive.
    :type encoding: str or int
    :rtype: segno.QRCode
    ÚmF)ÚerrorÚboost_erroré   zAInvalid EPC QR Code, max. QR Code version 13 is allowed, got "{}")r$   r%   r­   ÚversionrV   r   Ú
designator)	r.   rŸ   r    r¡   r¢   r£   r¤   r¥   Úqrs	            r   Úmake_epc_qrr¶   b  sb   € ôV 
�‰Ô(¨¨t°V¸TÀ9Ø),¨g°xóAà ¨eô
5€Bð 
‡z�z�B‚ÜÐ\×cÑcÐdf×dqÑdqÓrÓsÐsØ€Ir   )NNF)NNNNNNNNNNNNNNN)NNNNNNNNNNNNNNNNNNNNNNNN)NNNN)NNNNN)#Ú__doc__Ú
__future__r   r   Úrer–   r$   Úurllib.parser   r   r,   ÚImportErrorÚurllibÚunicodeÚ
basestringÚordr   r   r   r   r"   r&   rO   rQ   ÚcompileÚmatchrU   re   rg   ro   rq   r‚   r…   r­   r¶   r)   r   r   ú<module>rÂ      sX  ðñ	÷ 9Û 	Û Û ðÝ"Ø€Hñ ˆƒIˆvÙˆƒHˆeÙˆƒHˆeÙˆƒHˆeð	€ñ ˆƒHˆeÙˆƒHˆeð€ò,ò+óó4Kð$ MQØBFØAEØ<@óGðT HLØIMØAEØ&*ó0<ðf "�r—z‘zÐ"gÓh×nÑnÐ ð DHØHLØIMØHLØAEØ>Bóyðx ?CØCGØDHØCGØ<@Ø9=óO?òdFò	2ó&óRKð* JNØ-1óLð^ DHØ'+ô1øðS ò ÝØ
€CØ‚Hðús   ˜B= Â=CÃC