ó
    •£¿eOS  ã                   ó¢   • S SK r S SKrS SKrSSKJr  \" \R                  " S5      5      rS rS r	 " S S\
5      r " S	 S
5      r " S S5      rg)é    Né   )Úbuild_reÚ c                 ó2   • [         R                  " SSU 5      $ )Nz([.?*+^$[\]\\(){}|-])z\\\1)ÚreÚsub)Ústrings    Ú1/usr/lib/python3/dist-packages/linkify_it/main.pyÚ
_escape_rer      s   € Ü�6Š6Ð*¨G°VÓ<Ð<ó    c                 óP   •  U R                  U5      nU$ ! [         a    Sn U$ f = f)Néÿÿÿÿ)ÚindexÚ
ValueError)ÚtextÚsearch_valueÚresults      r
   Ú	_index_ofr      s7   € ðØ—‘˜LÓ)ˆð €Møô ó Ø‰à€Mðús   ‚ •%¤%c                   ó,   ^ • \ rS rSrSrU 4S jrSrU =r$ )ÚSchemaErroré   zLinkify schema errorc                 óF   >• SR                  X5      n[        TU ]	  U5        g )Nz%(LinkifyIt) Invalid schema '{}': '{}')ÚformatÚsuperÚ__init__)ÚselfÚnameÚvalÚmessageÚ	__class__s       €r
   r   ÚSchemaError.__init__   s    ø€ Ø9×@Ñ@ÀÓKˆÜ‰Ñ˜Õ!r   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classcell__)r    s   @r
   r   r      s   ø† Ù÷"ó "r   r   c                   ó$   • \ rS rSrSrS rS rSrg)ÚMatché    a³  Match result.

Attributes:
    schema (str): Prefix (protocol) for matched string.
    index (int): First position of matched string.
    last_index (int): Next position after matched string.
    raw (str): Matched string.
    text (str): Notmalized text of matched string.
    url (str): Normalized url of matched string.

Args:
    linkifyit (:class:`linkify_it.main.LinkifyIt`) LinkifyIt object
    shift (int): text searh position
c                 óŒ   • SR                  U R                  R                  U R                  R                  U R                  5      $ )Nz{}.{}({!r}))r   r    r$   r#   Ú__dict__©r   s    r
   Ú__repr__ÚMatch.__repr__0   s4   € Ø×#Ñ#Ø�N‰N×%Ñ% t§~¡~×'>Ñ'>ÀÇÁó
ð 	
r   c                 óÖ   • UR                   nUR                  nUR                  X4 nUR                  R	                  5       U l        X2-   U l        XB-   U l        XPl        XPl	        XPl
        g ©N)Ú_indexÚ_last_indexÚ_text_cacheÚ_schemaÚlowerÚschemar   Ú
last_indexÚrawr   Úurl)r   Ú	linkifyitÚshiftÚstartÚendr   s         r
   r   ÚMatch.__init__5   s_   € Ø× Ñ ˆØ×#Ñ#ˆØ×$Ñ$ UÐ/ˆà×'Ñ'×-Ñ-Ó/ˆŒØ‘]ˆŒ
Ø™+ˆŒØŒØŒ	Ø�r   )r   r:   r;   r9   r   r<   N)r#   r$   r%   r&   r'   r0   r   r(   r"   r   r
   r+   r+       s   † ñò
õ

r   r+   c                   ó’   • \ rS rSrSrS rS rS rS rS r	S r
S	 rSS jrS rS rS rS rS rS rS rS rSS jrS rS rSrg
)Ú	LinkifyItéB   a‘  Creates new linkifier instance with optional additional schemas.

By default understands:

- ``http(s)://...`` , ``ftp://...``, ``mailto:...`` & ``//...`` links
- "fuzzy" links and emails (example.com, foo@bar.com).

``schemas`` is an dict where each key/value describes protocol/rule:

- **key** - link prefix (usually, protocol name with ``:`` at the end, ``skype:``
  for example). `linkify-it` makes shure that prefix is not preceeded with
  alphanumeric char. Only whitespaces and punctuation allowed.

- **value** - rule to check tail after link prefix

  - *str* - just alias to existing rule
  - *dict*

    - *validate* - either a ``re.Pattern``, ``re str`` (start with ``^``, and don't
      include the link prefix itself), or a validator ``function`` which, given
      arguments *self*, *text* and *pos* returns the length of a match in *text*
      starting at index *pos*. *pos* is the index right after the link prefix.
    - *normalize* - optional function to normalize text & url of matched
      result (for example, for @twitter mentions).

``options`` is an dict:

- **fuzzyLink** - recognige URL-s without ``http(s):`` prefix. Default ``True``.
- **fuzzyIP** - allow IPs in fuzzy links above. Can conflict with some texts
  like version numbers. Default ``False``.
- **fuzzyEmail** - recognize emails without ``mailto:`` prefix.
- **---** - set `True` to terminate link with `---` (if it's considered as long
  dash).

Args:
    schemas (dict): Optional. Additional schemas to validate (prefix/validator)
    options (dict): { fuzzy_link | fuzzy_email | fuzzy_ip: True | False }.
        Default: {"fuzzy_link": True, "fuzzy_email": True, "fuzzy_ip": False}.
c                 ól  • XS  nU R                   R                  S5      (       d?  SU R                   S   -   U R                   S   -   U R                   S   -   U R                   S'   [         R                  " U R                   S   U[         R                  S9nU(       a  [	        UR                  5       5      $ g)NÚhttpz^\/\/Úsrc_authÚsrc_host_port_strictÚsrc_path©Úflagsr   ©r   ÚgetÚsearchÚ
IGNORECASEÚlenÚgroup©r   r   ÚposÚtailÚfoundss        r
   Ú_validate_httpÚLinkifyIt._validate_httpk   s�   € Ø�DˆzˆØ�w‰w�{‰{˜6×"Ñ"ð Ø—'‘'˜*Ñ%ñ&à—'‘'Ð0Ñ1ñ2ð —'‘'˜*Ñ%ñ&ð �G‰G�F‰Oô —’˜4Ÿ7™7 6™?¨D¼¿¹ÑFˆÞÜ�v—|‘|“~Ó&Ð&àr   c                 ó(  • XS  nU R                   R                  S5      (       dx  SU R                   S   -   S-   U R                   S   -   S-   U R                   S   -   S-   U R                   S	   -   U R                   S
   -   U R                   S   -   U R                   S'   [         R                  " U R                   S   U[         R                  S9nU(       a>  US:¼  a  XS-
     S:X  a  gUS:¼  a  XS-
     S:X  a  g[	        UR                  S5      5      $ g)NÚnot_httpÚ^rG   z(?:localhost|(?:(?:Ú
src_domainz)\.)+Úsrc_domain_rootÚ)Úsrc_portÚsrc_host_terminatorrI   rJ   é   Ú:r   Ú/rL   rR   s        r
   Ú_validate_double_slashÚ LinkifyIt._validate_double_slash}   s'  € Ø�Dˆzˆà�w‰w�{‰{˜:×&Ñ&ð Ø—'‘'˜*Ñ%ñ&à'ñ(ð —'‘'˜,Ñ'ñ(ð ñ	ð
 —'‘'Ð+Ñ,ñ-ð ñð —'‘'˜*Ñ%ñ&ð —'‘'Ð/Ñ0ñ1ð —'‘'˜*Ñ%ñ	&ð �G‰G�JÑô —’˜4Ÿ7™7 :Ñ.°¼B¿M¹MÑJˆÞØ�a‹x˜D q¡™M¨SÓ0Øà�a‹x˜D q¡™M¨SÓ0Øä�v—|‘| A“Ó'Ð'àr   c                 óT  • XS  nU R                   R                  S5      (       d2  SU R                   S   -   S-   U R                   S   -   U R                   S'   [         R                  " U R                   S   U[         R                  S9nU(       a  [	        UR                  S5      5      $ g)NÚmailtorZ   Úsrc_email_nameÚ@Úsrc_host_strictrJ   r   rL   rR   s        r
   Ú_validate_mailtoÚLinkifyIt._validate_mailtoœ   sŒ   € Ø�Dˆzˆà�w‰w�{‰{˜8×$Ñ$à�d—g‘gÐ.Ñ/Ñ/°#Ñ5¸¿¹Ð@QÑ8RÑRð �G‰G�HÑô —’˜4Ÿ7™7 8Ñ,¨d¼"¿-¹-ÑHˆÞÜ�v—|‘| A“Ó'Ð'àr   c                 ó    • SU l         SU l        g )Nr   r   )r4   r6   r/   s    r
   Ú_reset_scan_cacheÚLinkifyIt._reset_scan_cacheª   s   € ØˆŒØˆÕr   c                 ó   ^• U4S jnU$ )Nc                 óò   >• XS  n[        T[        5      (       a%  [        R                  " TU[        R                  S9nO[        R                  " TU5      nU(       a  [        UR                  S5      5      $ g)NrJ   r   )Ú
isinstanceÚstrr   rN   rO   rP   rQ   )r   rS   rT   rU   Úregexs       €r
   ÚfuncÚ)LinkifyIt._create_validator.<locals>.func¯   sZ   ø€ Ø˜�:ˆDÜ˜%¤×%Ñ%ÜŸš 5¨$´b·m±mÑD‘ô Ÿš 5¨$Ó/�æÜ˜6Ÿ<™<¨›?Ó+Ð+àr   r"   )r   rs   rt   s    ` r
   Ú_create_validatorÚLinkifyIt._create_validator®   s   ø€ õ	ð ˆr   c                 ó   ^ • U 4S jnU$ )Nc                 ó(   >• TR                  U 5        g r3   )Ú	normalize)Úmatchr   s    €r
   rt   Ú*LinkifyIt._create_normalizer.<locals>.func¿   s   ø€ Ø�N‰N˜5Õ!r   r"   )r   rt   s   ` r
   Ú_create_normalizerÚLinkifyIt._create_normalizer¾   s   ø€ õ	"ð ˆr   c                 ó`   • [        X5      nU R                  UR                     S   " U5        U$ )Nrz   )r+   Ú	_compiledr9   )r   r>   r{   s      r
   Ú_create_matchÚLinkifyIt._create_matchÄ   s+   € Ü�dÓ"ˆØ�‰�u—|‘|Ñ$ [Ò1°%Ô8Øˆr   Nc                 ón  • SSSS.U l         SU R                  0SSSU R                  0SU R                  0S.U l        SU l        SR                  S	5      U l        U(       a-  U R                   R                  U5        U R                   U l	        OU R                   U l	        S
U l
        S
U l        SU l        SU l        U(       a-  U R                  R                  U5        U R                  U l        OU R                  U l        0 U l        U R                  U l        SU l        0 U l        U R'                  5         g )NTF)Ú
fuzzy_linkÚfuzzy_emailÚfuzzy_ipÚvalidateúhttp:)rˆ   zhttps:zftp:z//úmailto:aW  a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]uM   biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|Ñ€Ñ„Ú|r   r   )Údefault_optionsrV   rc   rj   Údefault_schemasÚtlds_2ch_src_reÚsplitÚtlds_defaultÚupdateÚ_optsr4   r5   r7   r6   Ú_schemasr€   Ú_tldsÚ_tlds_replacedr   Ú_compile)r   ÚschemasÚoptionss      r
   r   ÚLinkifyIt.__init__É   s%  € àØØñ 
ˆÔð ! $×"5Ñ"5Ð6ØØØ˜t×:Ñ:Ð;Ø" D×$9Ñ$9Ð:ñ 
ˆÔð  yˆÔð l×qÑqØó
ˆÔö Ø× Ñ ×'Ñ'¨Ô0Ø×-Ñ-ˆD�Jà×-Ñ-ˆDŒJð ˆŒØˆÔØˆŒØˆÔæØ× Ñ ×'Ñ'¨Ô0Ø ×0Ñ0ˆD�Mà ×0Ñ0ˆDŒMàˆŒà×&Ñ&ˆŒ
Ø#ˆÔàˆŒà�‰�r   c           	      ó>  ^ • [        T R                  5      T l        [        R                  " T R
                  5      nT R                  5         T R                  (       d  UR                  T R                  5        UR                  T R                  S   5        SR                  U5      T R                  S'   U 4S jnU" T R                  S   5      T R                  S'   U" T R                  S   5      T R                  S'   U" T R                  S	   5      T R                  S
'   U" T R                  S   5      T R                  S'   / n0 T l        T R                  R                  5        GH{  u  pEUc  M  SSS.nUT R                  U'   [        U[        5      (       Ga  [        UR!                  S5      ["        5      (       a$  T R%                  UR!                  S5      5      US'   Oô[        UR!                  S5      [&        5      (       a$  T R%                  UR!                  S5      5      US'   O¬[        UR!                  S5      [(        R*                  5      (       a  UR!                  S5      US'   Oi[        UR!                  S5      [(        R,                  5      (       a0  [/        [0        SUR!                  S5      5        T R2                  US'   O[5        XE5      e[        UR!                  S5      [(        R*                  5      (       a  UR!                  S5      US'   O“[        UR!                  S5      [(        R,                  5      (       a0  [/        [0        SUR!                  S5      5        T R2                  US'   O5UR!                  S5      (       d  T R7                  5       US'   O[5        XE5      eGMJ  [        U[&        5      (       a  UR                  U5        GMs  [5        XE5      e   U Hœ  nT R                  R!                  T R                  R!                  U5      5      (       d  M>  T R                  T R                  U      S   T R                  U   S'   T R                  T R                  U      S   T R                  U   S'   Mž     ST R7                  5       S.T R                  S'   SR                  T R                  R                  5        VVs/ s H*  u  pE[9        U5      S:”  d  M  U(       d  M  [;        U5      PM,     snn5      nST R                  S   -   S-   U-   S-   n	U	T R                  S'   U	T R                  S'   ST R                  S   -   T R                  S'   SU	-   S-   T R                  S   -   S-   T R                  S '   T R=                  5         gs  snnf )!z Schemas compiler. Build regexps.Úsrc_xnrŠ   Úsrc_tldsc                 óB   >• U R                  STR                  S   5      $ )Nz%TLDS%r›   )Úreplacer   )Útplr   s    €r
   ÚuntplÚ!LinkifyIt._compile.<locals>.untpl  s   ø€ Ø—;‘;˜x¨¯©°Ñ)<Ó=Ð=r   Útpl_email_fuzzyÚemail_fuzzyÚtpl_link_fuzzyÚ
link_fuzzyÚtpl_link_no_ip_fuzzyÚlink_no_ip_fuzzyÚtpl_host_fuzzy_testÚhost_fuzzy_testN)r‡   Úlinkr‡   rt   rz   )r‡   rz   r   r   u   (^|(?!_)(?:[><ï½œ]|Úsrc_ZPCcz))(r]   Úschema_testÚschema_searchrZ   Úschema_at_startÚ(z)|(z)|@Úpretest)r   r‘   r   ÚcopyÚdeepcopyr“   Ú_on_compiler”   Úappendr�   Újoinr€   r’   Úitemsrq   ÚdictrM   ÚRE_TYPErv   rr   ÚtypesÚ
MethodTypeÚFunctionTypeÚsetattrrC   rt   r   r}   rP   r   rm   )
r   ÚtldsrŸ   Úaliasesr   r   ÚcompiledÚaliasÚslistÚre_schema_tests
   `         r
   r•   ÚLinkifyIt._compileû   s�  ø€ ô ˜4Ÿ:™:Ó&ˆŒô �}Š}˜TŸZ™ZÓ(ˆà×ÑÔà×"×"Ø�K‰K˜×,Ñ,Ô-Ø�‰�D—G‘G˜HÑ%Ô&à!Ÿh™h t›nˆ�‰�
Ñõ	>ñ "' t§w¡wÐ/@Ñ'AÓ!Bˆ�‰�Ñá % d§g¡gÐ.>Ñ&?Ó @ˆ�‰�Ñá&+¨D¯G©GÐ4JÑ,KÓ&Lˆ�‰Ð"Ñ#á%*¨4¯7©7Ð3HÑ+IÓ%Jˆ�‰Ð!Ñ"ð ˆàˆŒàŸ™×,Ñ,×.‰IˆDà‰{Ùà$(°$Ñ7ˆHà#+ˆD�N‰N˜4Ñ ä˜#œt×$Ò$Ü˜cŸg™g jÓ1´7×;Ñ;Ø+/×+AÑ+AÀ#Ç'Á'È*ÓBUÓ+V�H˜ZÒ(Ü §¡¨
Ó 3´S×9Ñ9Ø+/×+AÑ+AÀ#Ç'Á'È*ÓBUÓ+V�H˜ZÒ(Ü §¡¨
Ó 3´U×5EÑ5E×FÑFØ+.¯7©7°:Ó+>�H˜ZÒ(ä §¡¨
Ó 3´U×5GÑ5G×HÑHÜœI v¨s¯w©w°zÓ/BÔCØ+/¯9©9�H˜ZÒ(ä% dÓ0Ð0ä˜cŸg™g kÓ2´E×4DÑ4D×EÑEØ,/¯G©G°KÓ,@�H˜[Ò)ä §¡¨Ó 4´e×6HÑ6H×IÑIÜœI v¨s¯w©w°{Ó/CÔDØ,0¯I©I�H˜[Ò)ØŸ™ ×-Ñ-Ø,0×,CÑ,CÓ,E�H˜[Ò)ä% dÓ0Ð0âä˜#œs×#Ñ#Ø—‘˜tÔ$Úä˜dÓ(Ð(ñQ /óZ ˆEØ—>‘>×%Ñ% d§m¡m×&7Ñ&7¸Ó&>×?Ñ?Ùà04·±¸t¿}¹}ÈUÑ?SÑ0TØñ1ˆD�N‰N˜5Ñ! *Ñ-ð 26·±ÀÇÁÈeÑ@TÑ1UØñ2ˆD�N‰N˜5Ñ! +Ó.ñ ð +/¸T×=TÑ=TÓ=VÑWˆ�‰�rÑð
 —‘ð "&§¡×!5Ñ!5Ô!7ôâ!7‘I�DÜ�t“9˜q‘=ó !ä%(ó !”
˜4Ö Ù!7òó
ˆð % t§w¡w¨zÑ':Ñ:¸UÑBÀUÑJÈSÑPð 	ð
 "0ˆ�‰�ÑØ#1ˆ�‰�Ñ Ø%(¨4¯7©7°?Ñ+CÑ%Cˆ�‰Ð!Ñ"ð �.Ñ  5Ñ(¨4¯7©7Ð3DÑ+EÑEÈÑMð 	�‰�	Ñð 	×ÑÕ ùó-s   ÓV
Ó(V
Ó1V
c                 óB   • X R                   U'   U R                  5         U $ )a  Add new rule definition. (chainable)

See :class:`linkify_it.main.LinkifyIt` init description for details.
``schema`` is a link prefix (``skype:``, for example), and ``definition``
is a ``str`` to alias to another schema, or an ``dict`` with ``validate`` and
optionally `normalize` definitions. To disable an existing rule, use
``.add(<schema>, None)``.

Args:
    schema (str): rule name (fixed pattern prefix)
    definition (`str` or `re.Pattern`): schema definition

Return:
    :class:`linkify_it.main.LinkifyIt`
)r’   r•   )r   r9   Ú
definitions      r
   ÚaddÚLinkifyIt.addv  s   € ð  !+�‰�fÑØ�‰ŒØˆr   c                 ó<   • U R                   R                  U5        U $ )a  Override default options. (chainable)

Missed properties will not be changed.

Args:
    options (dict): ``keys``: [``fuzzy_link`` | ``fuzzy_email`` | ``fuzzy_ip``].
        ``values``: [``True`` | ``False``]

Return:
    :class:`linkify_it.main.LinkifyIt`
)r‘   r�   )r   r—   s     r
   ÚsetÚLinkifyIt.setŠ  s   € ð 	�
‰
×Ñ˜'Ô"Øˆr   c                 ót  • Xl         SU l        [        U5      (       d  g[        R                  " U R                  S   U[        R
                  S9(       aû  U R                  S   nSn[        R                  " X!US [        R
                  S9nU H¾  nUR                  S5      nUR                  5       UR                  5       S   UR                  5       S   4nU R                  XS	   U5      nU(       d  Mg  US	   U l        UR                  S5      [        US   5      -   U l        UR                  S5      [        US   5      -   U-   U l          O   U R                  R                  S
5      (       Ga†  U R                   R                  S5      (       Gae  [        R                  " U R                  S   U[        R
                  S9nU(       a  UR                  S5      n	OSn	U	S:¼  Ga  U R                  S:  d  X�R                  :  aó  U R                  R                  S5      (       a  U R                  S   n
OU R                  S   n
[        R                  " X¡[        R
                  S9nU(       aŠ  UR                  S5      [        UR                  5       S   5      -   nU R                  S:  d  XÀR                  :  a=  SU l        XÀl        UR                  S5      [        UR                  5       5      -   U l        U R                  R                  S5      (       Ga  U R                   R                  S5      (       aó  [#        US5      nUS:¼  aá  [        R                  " U R                  S   U[        R
                  S9nU(       a©  UR                  S5      [        UR                  5       S   5      -   nUR                  S5      [        UR                  5       5      -   nU R                  S:  d-  XÀR                  :  d  XÀR                  :X  a"  XðR                  :”  a  SU l        XÀl        Xðl        U R                  S:¬  $ )zÒSearches linkifiable pattern and returns ``True`` on success or ``False``
on fail.

Args:
    text (str): text to search

Returns:
    bool: ``True`` if a linkable pattern was found, otherwise it is ``False``.
r   Fr«   rJ   r¬   r   Nr   é   r„   rˆ   r¨   r†   r¤   r¦   r   r…   r‰   rh   r¢   )r6   r4   rP   r   rN   rO   Úfinditerr@   rQ   ÚgroupsÚtest_schema_atr7   r?   r5   r‘   rM   r€   r   )r   r   rs   r:   Úmatched_iterÚmatchedÚmÚlengthÚmatched_tldÚtld_posÚpatternÚmlr>   Úat_posÚmeÚ
next_shifts                   r
   ÚtestÚLinkifyIt.test™  s"  € ð  ÔØˆŒä�4�y‰yØä�9Š9�T—W‘W˜]Ñ+¨T¼¿¹×GØ—G‘G˜OÑ,ˆEØˆJÜŸ;š; u°:°;Ð.?ÄrÇ}Á}ÑUˆLÛ'�Ø$Ÿ[™[¨›^�
Ø—]‘]“_ g§n¡nÓ&6°qÑ&9¸7¿>¹>Ó;KÈAÑ;NÐO�Ø×,Ñ,¨T°Q±4¸ÓD�ß�6Ø#$ Q¡4�D”LØ")§-¡-°Ó"2´S¸¸1¹³YÑ">�D”KØ'.§}¡}°QÓ'7¼#¸aÀ¹d»)Ñ'CÀfÑ'L�DÔ$Ùñ (ð �:‰:�>‰>˜,×'Ò'¨D¯N©N×,>Ñ,>¸w×,GÒ,GäŸ)š)Ø—‘Ð)Ñ*¨D¼¿¹ñˆKö Ø%×+Ñ+¨AÓ.‘à�Ø˜!Œ|à—;‘; “? g·±Ó&;Ø—z‘z—~‘~ j×1Ñ1Ø"&§'¡'¨,Ñ"7™à"&§'¡'Ð*<Ñ"=˜äŸš 7¼¿¹ÑF�BÞØ "§¡¨£¬c°"·)±)³+¸a±.Ó.AÑ A˜àŸ;™;¨›?¨e·k±kÓ.AØ+-˜DœLØ*/œKØ/1¯x©x¸«{¼SÀÇÁÃ»_Ñ/L˜DÔ,à�:‰:�>‰>˜-×(Ò(¨T¯^©^×-?Ñ-?À	×-JÑ-Jä˜t SÓ)ˆFØ˜‹{ô —Y’Y˜tŸw™w }Ñ5°tÄ2Ç=Á=ÑQ�ÞØŸH™H Q›K¬#¨b¯i©i«k¸!©nÓ*=Ñ=�EØ!#§¡¨!£¬s°2·8±8³:«Ñ!>�Jð Ÿ™ a›Ø §;¡;Ó.Ø!§[¡[Ó0°Z×BRÑBRÓ5Rà'0˜œØ&+œØ+5Ô(à�{‰{˜aÑÐr   c                 ór   • [         R                  " U R                   S   U[         R                  S9(       a  gg)a*  Very quick check, that can give false positives.

Returns true if link MAY BE can exists. Can be used for speed optimization,
when you need to check that link NOT exists.

Args:
    text (str): text to search

Returns:
    bool: ``True`` if a linkable pattern was found, otherwise it is ``False``.
r¯   rJ   TF)r   rN   rO   )r   r   s     r
   r¯   ÚLinkifyIt.pretestç  s'   € ô �9Š9�T—W‘W˜YÑ'¨´R·]±]×CØàr   c                 óÜ   • U R                   R                  UR                  5       5      (       d  gU R                   R                  UR                  5       5      R                  S5      " X5      $ )a"  Similar to :meth:`linkify_it.main.LinkifyIt.test` but checks only
specific protocol tail exactly at given position.

Args:
    text (str): text to scan
    name (str): rule (schema) name
    position (int): length of found pattern (0 on fail).

Returns:
    int: text (str): text to search
r   r‡   )r€   rM   r8   )r   r   r   Úpositions       r
   rÎ   ÚLinkifyIt.test_schema_atø  sM   € ð �~‰~×!Ñ! $§*¡*£,×/Ñ/ØØ�~‰~×!Ñ! $§*¡*£,Ó/×3Ñ3°JÔ?ÀÓOÐOr   c                 ó¶  • Sn/ nU R                   S:¼  a<  U R                  U:X  a,  UR                  U R                  U5      5        U R                  nU(       a  XS OUnU R                  U5      (       aT  UR                  U R                  U5      5        X@R                  S nX R                  -  nU R                  U5      (       a  MT  [        U5      (       a  U$ g)aY  Returns ``list`` of found link descriptions or ``None`` on fail.

We strongly recommend to use :meth:`linkify_it.main.LinkifyIt.test`
first, for best speed.

Args:
    text (str): text to search

Returns:
    ``list`` or ``None``: Result match description:
        * **schema** - link schema, can be empty for fuzzy links, or ``//``
          for protocol-neutral  links.
        * **index** - offset of matched text
        * **last_index** - offset of matched text
        * **raw** - offset of matched text
        * **text** - normalized text
        * **url** - link, generated from matched text
r   N)r4   r6   r³   r�   r5   rÚ   rP   )r   r   r>   r   rT   s        r
   r{   ÚLinkifyIt.match	  sÁ   € ð& ˆØˆð �;‰;˜!Ó × 0Ñ 0°DÓ 8Ø�M‰M˜$×,Ñ,¨UÓ3Ô4Ø×$Ñ$ˆEö  %ˆt�F‰|¨$ˆð �i‰i˜�o‰oØ�M‰M˜$×,Ñ,¨UÓ3Ô4à×(Ñ(Ð*Ð+ˆDØ×%Ñ%Ñ%ˆEð	 �i‰i˜�o‹oô ˆv�;‰;ØˆMàr   c                 ó<  • Xl         SU l        [        U5      (       d  g[        R                  " U R                  S   U[        R
                  S9nU(       d  gUR                  5       UR                  5       S   UR                  5       S   4nU R                  XS   [        US   5      5      nU(       d  gUS   U l	        UR                  S5      [        US   5      -   U l        UR                  S5      [        US   5      -   U-   U l        U R                  S5      $ )z°Returns fully-formed (not fuzzy) link if it starts at the beginning
of the string, and null otherwise.

Args:
    text (str): text to search

Retuns:
    ``Match`` or ``None``
r   Nr­   rJ   r   r   rË   )r6   r4   rP   r   rN   rO   rQ   rÍ   rÎ   r7   r?   r5   r�   )r   r   rU   rÑ   rÒ   s        r
   Úmatch_at_startÚLinkifyIt.match_at_start3  sé   € ð  ÔØˆŒä�4�y‰yØä—’˜4Ÿ7™7Ð#4Ñ5°tÄ2Ç=Á=ÑQˆÞØà�\‰\‹^˜VŸ]™]›_¨QÑ/°·±³ÀÑ1CÐDˆØ×$Ñ$ T¨Q©4´°Q°q±T³Ó;ˆÞØà˜‘tˆŒØ—l‘l 1“o¬¨A¨a©D«	Ñ1ˆŒØ!Ÿ<™<¨›?¬S°°1±«YÑ6¸Ñ?ˆÔà×!Ñ! !Ó$Ð$r   c                 ó2  • [        U[        5      (       a  UOU/nU(       d  X0l        SU l        U R	                  5         U $ U R                  R                  U5        [        [        [        U R                  5      5      SS9U l        U R	                  5         U $ )u1  Load (or merge) new tlds list. (chainable)

Those are user for fuzzy links (without prefix) to avoid false positives.
By default this algorythm used:

* hostname with any 2-letter root zones are ok.
* biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|Ñ€Ñ„
  are ok.
* encoded (`xn--...`) root zones are ok.

If list is replaced, then exact match for 2-chars root zones will be checked.

Args:
    list_tlds (list or str): ``list of tlds`` or ``tlds string``
    keep_old (bool): merge with current list if q`True`q (q`Falseq` by default)
T)Úreverse)rq   Úlistr“   r”   r•   ÚextendÚsortedrÈ   )r   Ú	list_tldsÚkeep_oldÚ_lists       r
   r¼   ÚLinkifyIt.tldsS  sr   € ô" (¨	´4×8Ñ8‘	¸y¸kˆæØŒJØ"&ˆDÔØ�M‰MŒOØˆKà�
‰
×Ñ˜%Ô ÜœD¤ T§Z¡Z£Ó1¸4Ñ@ˆŒ
à�‰ŒØˆr   c                 ó   • UR                   (       d  SUR                  -   Ul        UR                   S:X  aI  [        R                  " SUR                  [        R                  S9(       d  SUR                  -   Ul        ggg)zyDefault normalizer (if schema does not define it's own).

Args:
    match (:class:`linkify_it.main.Match`): Match result
zhttp://r‰   z^mailto:rJ   N)r9   r<   r   rN   rO   )r   r{   s     r
   rz   ÚLinkifyIt.normalizer  s[   € ð �|�|Ø! E§I¡IÑ-ˆEŒIà�<‰<˜9Ó$¬R¯YªYØ˜Ÿ	™	¬¯©÷.
ð " E§I¡IÑ-ˆE�Ið.
Ð$r   c                 ó   • g)z"Override to modify basic RegExp-s.Nr"   r/   s    r
   r²   ÚLinkifyIt._on_compile€  s   € àr   )r€   r4   r5   r‘   r7   r’   r6   r“   r”   r‹   rŒ   r   r�   r�   )NN)F)r#   r$   r%   r&   r'   rV   rc   rj   rm   rv   r}   r�   r   r•   rÅ   rÈ   rÚ   r¯   rÎ   r{   rä   r¼   rz   r²   r(   r"   r   r
   rC   rC   B   so   † ñ&òPò$ò>òòò òô
0òdy!òvò(òL ò\ò"Pò"(òT%ô@ò>.õr   rC   )r°   r   r¸   Úucrer   ÚtypeÚcompiler·   r   r   Ú	Exceptionr   r+   rC   r"   r   r
   Ú<module>r÷      sR   ðÛ Û 	Û å ñ ˆr�zŠz˜#‹Ó
€ò=òô"�)ô "÷ñ ÷D@	ò @	r   