Ë
    Ìi  ã                   ó˜   — d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZ ddlmZ  edd	¬
«      Z	  G d„ d	e«      Zy)zV
This module provides :class:`.GitIgnoreSpec` which replicates
*.gitignore* behavior.
é    )
ÚAnyStrÚCallableÚIterableÚOptionalÚTupleÚTypeÚTypeVarÚUnionÚcastÚoverloadé   )ÚPathSpec)ÚPattern)ÚGitWildMatchPatternÚ	_DIR_MARK)Ú_is_iterableÚSelfÚGitIgnoreSpec)Úboundc                   ó`  ‡ — e Zd ZdZdedefˆ fd„Zeede	e
   deeeegef   f   dee   de
fd„«       «       Zee	 dde	e
   dee   deeeegef   d	f   de
fd
„«       «       Ze	 dde	e
   dee   deeeegef   d	f   de
fˆ fd„«       Zedeeeef      dedeee   ee   f   fd„«       Zˆ xZS )r   zu
	The :class:`GitIgnoreSpec` class extends :class:`pathspec.pathspec.PathSpec` to
	replicate *.gitignore* behavior.
	ÚotherÚreturnc                 óp   •— t        |t        «      rt        ‰| �  |«      S t        |t        «      ryt
        S )zÏ
		Tests the equality of this gitignore-spec with *other* (:class:`GitIgnoreSpec`)
		by comparing their :attr:`~pathspec.pattern.Pattern`
		attributes. A non-:class:`GitIgnoreSpec` will not compare equal.
		F)Ú
isinstancer   ÚsuperÚ__eq__r   ÚNotImplemented)Úselfr   Ú	__class__s     €úS/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/pathspec/gitignore.pyr   zGitIgnoreSpec.__eq__)   s1   ø€ ô �”}Ô%Ü
‰'‰.˜Ó
ÐÜ�%œÔ"Ø
ä
Ðó    ÚclsÚpattern_factoryÚlinesc                  ó   — y ©N© )r"   r#   r$   s      r    Ú
from_lineszGitIgnoreSpec.from_lines7   ó   € ð r!   Nc                  ó   — y r&   r'   )r"   r$   r#   s      r    r(   zGitIgnoreSpec.from_lines@   r)   r!   c                 ó¶   •— |€t         }n0t        |t        t        f«      st	        |«      rt        |«      r||}}t        ‰| �  ||«      }t        t        |«      S )aÊ  
		Compiles the pattern lines.

		*lines* (:class:`~collections.abc.Iterable`) yields each uncompiled
		pattern (:class:`str`). This simply has to yield each line so it can
		be a :class:`io.TextIOBase` (e.g., from :func:`open` or
		:class:`io.StringIO`) or the result from :meth:`str.splitlines`.

		*pattern_factory* can be :data:`None`, the name of a registered
		pattern factory (:class:`str`), or a :class:`~collections.abc.Callable`
		used to compile patterns. The callable must accept an uncompiled
		pattern (:class:`str`) and return the compiled pattern
		(:class:`pathspec.pattern.Pattern`).
		Default is :data:`None` for :class:`.GitWildMatchPattern`).

		Returns the :class:`GitIgnoreSpec` instance.
		)
r   r   ÚstrÚbytesÚcallabler   r   r(   r   r   )r"   r$   r#   r   r   s       €r    r(   zGitIgnoreSpec.from_linesI   sR   ø€ ð. ÐÜ(�?ä�5œ3¤˜,Ô'¬8°E¬?ÄÈ_Ô@]à! ?�E€?ä	‰Ñ	˜O¨UÓ	3€$Ü	Œd�DÓ	Ðr!   ÚpatternsÚfilec                 ó>  — d}d}d}| D ]�  \  }}|j                   €Œ|j                  |«      }|€Œ'|j                  j                  «       j	                  t
        «      }|rd}	nd}	|j                   r|r|j                   }|}|	}Œz|	|k\  sŒ€|j                   }|}|	}Œ‘ ||fS )aÖ  
		Check the file against the patterns.

		.. NOTE:: Subclasses of :class:`~pathspec.pathspec.PathSpec` may override
		   this method as an instance method. It does not have to be a static
		   method. The signature for this method is subject to change.

		*patterns* (:class:`~collections.abc.Iterable`) yields each indexed pattern
		(:class:`tuple`) which contains the pattern index (:class:`int`) and actual
		pattern (:class:`~pathspec.pattern.Pattern`).

		*file* (:class:`str`) is the normalized file path to be matched against
		*patterns*.

		Returns a :class:`tuple` containing whether to include *file* (:class:`bool`
		or :data:`None`), and the index of the last matched pattern (:class:`int` or
		:data:`None`).
		Nr   r   é   )ÚincludeÚ
match_fileÚmatchÚ	groupdictÚgetr   )
r/   r0   Úout_includeÚ	out_indexÚout_priorityÚindexÚpatternr5   Údir_markÚprioritys
             r    Ú_match_filezGitIgnoreSpec._match_filej   s¸   € ð. !%€+Ø!€)Ø€,Ø ò �n€eˆWØ‡o�oÑ!Ø×Ñ˜tÓ$€EØÑð —‘×%Ñ%Ó'×+Ñ+¬IÓ6€Xáà�hð €hà�Š™HØ—O‘O€kØ€iØ�lØ
�lÓ
"Ø—O‘O€kØ€iØ�lð/ð2 
�iÐ	Ðr!   r&   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚobjectÚboolr   r   Úclassmethodr   r   r
   r,   r   r   r   r   r(   Ústaticmethodr   Úintr   r   r?   Ú__classcell__)r   s   @r    r   r   #   s“  ø„ ñð
˜ð  Dõ ð ØðØˆD�zðà˜˜h¨ x°Ð'8Ñ9Ð9Ñ:ðð 
�&Ñ	ðð ò	ó ó ðð Øð DHñØˆD�zðà	�&Ñ	ðð ˜˜h¨ x°Ð'8Ñ9¸4Ð?Ñ@ðð ò	ó ó ðð ð DHñØˆD�zðà	�&Ñ	ðð ˜˜h¨ x°Ð'8Ñ9¸4Ð?Ñ@ðð ô	ó ðð@ ð2 Ø�U˜3Ð 3Ð3Ñ4Ñ5ð2 àð2 ð ˆH�T‰N˜H S™MÐ)Ñ*ò2 ó ô2 r!   N)rC   Útypingr   r   r   r   r   r   r	   r
   r   r   Úpathspecr   r<   r   Úpatterns.gitwildmatchr   r   Úutilr   r   r   r'   r!   r    ú<module>rN      sN   ðñ÷

÷ 
÷ 
õõ
÷õñ ˆv˜_Ô-€ðôz �Hõ z r!   