Ë
    Ìi~  ã                   ó¶   — d Z ddlZddlZddlZddlmZmZmZmZm	Z
mZmZmZmZ  G d„ de«      Z G d„ de«      Z ej$                  «        G d„ d	e«      «       Zy)
z8
This module provides the base definition for patterns.
é    N)	ÚAnyÚAnyStrÚIterableÚIteratorÚMatchÚOptionalÚPatternÚTupleÚUnionc                   ó\   — e Zd ZdZdZdee   ddfd„Zdee	   de
e	   fd„Zd	e	dee   fd
„Zy)r	   zG
	The :class:`Pattern` class is the abstract definition of a pattern.
	©Úincluder   ÚreturnNc                 ó   — || _         y)zâ
		Initializes the :class:`Pattern` instance.

		*include* (:class:`bool` or :data:`None`) is whether the matched files
		should be included (:data:`True`), excluded (:data:`False`), or is a
		null-operation (:data:`None`).
		Nr   )Úselfr   s     úQ/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/pathspec/pattern.pyÚ__init__zPattern.__init__   s   € ð €$„,ðó    Úfilesc              #   ó²   K  — t        j                  dj                  | j                  ¬«      t        d¬«       |D ]  }| j                  |«      €Œ|–— Œ y­w)aÖ  
		DEPRECATED: This method is no longer used and has been replaced by
		:meth:`.match_file`. Use the :meth:`.match_file` method with a loop for
		similar results.

		Matches this pattern against the specified files.

		*files* (:class:`~collections.abc.Iterable` of :class:`str`) contains each
		file relative to the root directory (e.g., ``"relative/path/to/file"``).

		Returns an :class:`~collections.abc.Iterable` yielding each matched file
		path (:class:`str`).
		z�{cls.__module__}.{cls.__qualname__}.match() is deprecated. Use {cls.__module__}.{cls.__qualname__}.match_file() with a loop for similar results.©Úclsé   )Ú
stacklevelN)ÚwarningsÚwarnÚformatÚ	__class__ÚDeprecationWarningÚ
match_file)r   r   Úfiles      r   ÚmatchzPattern.match.   sV   è ø€ ô ‡-�-ð÷ �Fˆt�~‰~€FÓÔ 2¸qõ	Bð ò €dØ
‡o�o�dÓÑ'Ø
ƒJñùs   ‚AAÁAr!   c                 óL   — t        dj                  | j                  ¬«      «      ‚)zÅ
		Matches this pattern against the specified file.

		*file* (:class:`str`) is the normalized file path to match against.

		Returns the match result if *file* matched; otherwise, :data:`None`.
		z?{cls.__module__}.{cls.__qualname__} must override match_file().r   )ÚNotImplementedErrorr   r   )r   r!   s     r   r    zPattern.match_fileF   s$   € ô 	ØDß
�Fˆt�~‰~€FÓó	 ð  r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   Úboolr   r   Ústrr   r"   r   r    © r   r   r	   r	      sW   „ ñð
€ð˜X d™^ð °ó ð ˜ ™ð ¨(°3©-ó ð0
 ˜Cð 
  H¨S¡Mô 
 r   r	   c                   ó”   ‡ — e Zd ZdZdZ	 ddeeedf   dee	   ddfˆ fd„Z
dd de	fd	„Zd
eded   fd„Zededeee	f   fd„«       Zˆ xZS )ÚRegexPatternza
	The :class:`RegexPattern` class is an implementation of a pattern using
	regular expressions.
	)ÚpatternÚregexNr/   r   r   c                 óR  •— t        |t        t        f«      r<|�J d|›d|›d�«       ‚| j                  |«      \  }}|�Ht	        j
                  |«      }n2|�t        |d«      r|}n!|€|�J d|›d|›d�«       ‚t        d|›d�«      ‚t        t        | �+  |«       || _        	 | _        y)	a(  
		Initializes the :class:`RegexPattern` instance.

		*pattern* (:class:`str`, :class:`bytes`, :class:`re.Pattern`, or
		:data:`None`) is the pattern to compile into a regular expression.

		*include* (:class:`bool` or :data:`None`) must be :data:`None` unless
		*pattern* is a precompiled regular expression (:class:`re.Pattern`) in which
		case it is whether matched files should be included (:data:`True`), excluded
		(:data:`False`), or is a null operation (:data:`None`).

			.. NOTE:: Subclasses do not need to support the *include* parameter.
		Nzinclude:z must be null when pattern:z is a string.r"   z	 is null.zpattern:z& is not a string, re.Pattern, or None.)Ú
isinstancer+   ÚbytesÚpattern_to_regexÚreÚcompileÚhasattrÚ	TypeErrorÚsuperr.   r   r/   r0   )r   r/   r   r0   r   s       €r   r   zRegexPattern.__init___   sä   ø€ ô& �œ#œu˜Ô&Ø
ˆ/ð ØˆwˆkÐ4°W°K¸}ÐMóˆ/ð ×)Ñ)¨'Ó2�>€5ˆ'ð ÐÜ�J‰J�uÓ�EàÐœw w°Ô8ð �5à€ð ˆ/ð ØˆwˆkÐ4°W°K¸yÐIóˆ/ô
 
�X˜g˜[Ð(NÐOÓ	PÐPäŒ�dÑ$ WÔ-à3:€$„,ðð
 "€$„*ðr   Úotherc                 ó–   — t        |t        «      r4| j                  |j                  k(  xr | j                  |j                  k(  S t        S )z¯
		Tests the equality of this regex pattern with *other* (:class:`RegexPattern`)
		by comparing their :attr:`~Pattern.include` and :attr:`~RegexPattern.regex`
		attributes.
		)r2   r.   r   r0   ÚNotImplemented)r   r:   s     r   Ú__eq__zRegexPattern.__eq__˜   s9   € ô �”|Ô$Ø
�,‰,˜%Ÿ-™-Ñ
'Ò
E¨D¯J©J¸%¿+¹+Ñ,EÐEä
Ðr   r!   ÚRegexMatchResultc                 ól   — | j                   �(| j                  j                  |«      }|�t        |«      S y)a  
		Matches this pattern against the specified file.

		*file* (:class:`str`) contains each file relative to the root directory
		(e.g., "relative/path/to/file").

		Returns the match result (:class:`.RegexMatchResult`) if *file* matched;
		otherwise, :data:`None`.
		N)r   r0   r"   r>   )r   r!   r"   s      r   r    zRegexPattern.match_file£   s6   € ð 
‡\�\ÐØ�:‰:×Ñ˜DÓ!€5ØÐÜ˜EÓ"Ð"à	r   c                 ó
   — |dfS )a¼  
		Convert the pattern into an uncompiled regular expression.

		*pattern* (:class:`str`) is the pattern to convert into a regular
		expression.

		Returns the uncompiled regular expression (:class:`str` or :data:`None`),
		and whether matched files should be included (:data:`True`), excluded
		(:data:`False`), or is a null-operation (:data:`None`).

			.. NOTE:: The default implementation simply returns *pattern* and
			   :data:`True`.
		Tr,   )r   r/   s     r   r4   zRegexPattern.pattern_to_regex´   s   € ð 
�$ˆÐr   )N)r%   r&   r'   r(   r)   r   r   ÚPatternHintr   r*   r   r=   r+   r    Úclassmethodr
   r4   Ú__classcell__)r   s   @r   r.   r.   S   s�   ø„ ñð€ð !ñ7à�˜ dÐ*Ñ+ð7ð �D‰>ð7ð õ	7ðr	˜ð 	¨Dó 	ð˜Cð  HÐ-?Ñ$@ó ð" ð Cð ¨E°#°t°)Ñ,<ò ó ôr   r.   c                   ó    — e Zd ZU dZdZeed<   y)r>   zq
	The :class:`RegexMatchResult` data class is used to return information about
	the matched regular expression.
	)r"   r"   N)r%   r&   r'   r(   r)   Ú	MatchHintÚ__annotations__r,   r   r   r>   r>   Æ   s   … ñð€ð 	Óðr   r>   )r(   Údataclassesr5   r   Útypingr   r   r   r   r   rE   r   r	   rA   r
   r   Úobjectr.   Ú	dataclassr>   r,   r   r   ú<module>rK      sf   ðñó Û 	Û ÷	÷ 	õ 	ô< ˆfô < ô~p�7ô pðf €×ÑÓô�vó ó ñr   