+
    *:žgo#  ã                  óF  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
Ht ^ RIHtHtHt ^ RIHtHt ]! 4       t]! R4      tR R lt]P.                  ! R	]P0                  4      tR
 R lt]P.                  ! R4      tRR R lltR R lt ! R R]P<                  4      tRR R llt] t! ! R R]PD                  4      t#]PH                  t$]PJ                  t%]PL                  t&]PN                  t']PP                  t(]PR                  t)]PT                  t*R R lt+R# )zš
babel.util
~~~~~~~~~~

Various utility classes and functions.

:copyright: (c) 2013-2025 by the Babel Team.
:license: BSD, see LICENSE for more details.
)ÚannotationsN)Ú	GeneratorÚIterable)ÚIOÚAnyÚTypeVar)ÚdatesÚ	localtimeÚ_Tc               ó    € V ^8„  d   QhRRRR/# )é   ÚiterablezIterable[_T]ÚreturnzGenerator[_T, None, None]© )Úformats   "Ú,/usr/lib/python3/dist-packages/babel/util.pyÚ__annotate__r      s   € ÷ ñ �|ð Ð(Añ ó    c              #  ó€   "  € \        4       p\        V 4       F   pW!9  g   K  Vx € VP                  V4       K"  	  R# 5i)av  Yield all items in an iterable collection that are distinct.

Unlike when using sets for a similar effect, the original ordering of the
items in the collection is preserved by this function.

>>> print(list(distinct([1, 2, 1, 3, 4, 4])))
[1, 2, 3, 4]
>>> print(list(distinct('foobar')))
['f', 'o', 'b', 'a', 'r']

:param iterable: the iterable collection providing the data
N)ÚsetÚiterÚadd)r   ÚseenÚitems   &  r   Údistinctr      s2   é € ô ‹5€DÜ�X–ˆØÖØŠJØ�H‰H�TŽNó ùs   ‚>£>s(   [ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)c               ó    € V ^8„  d   QhRRRR/# )r   Úfpú	IO[bytes]r   ú
str | Noner   )r   s   "r   r   r   5   s   € ÷ -ñ -�yð - Zñ -r   c                ól  € V P                  4       pV P                  ^ 4        V P                  4       pVP                  \        P
                  4      pV'       d   V\        \        P
                  4      R p\        P                  V4      pV'       gK    ^ RI	pVP                  VP                  R4      4       V P                  4       p\        P                  V4      pV'       dS   V'       d7   VP                  ^4      P                  R4      pVR8w  d   \        RV R24      h V P                  V4       R# V'       d2   VP                  ^4      P                  R4      V P                  V4       #  V P                  V4       R#   \        \        \        3 d     L¿i ; i  T P                  T4       i ; i)a  Deduce the encoding of a source file from magic comment.

It does this in the same way as the `Python interpreter`__

.. __: https://docs.python.org/3.4/reference/lexical_analysis.html#encoding-declarations

The ``fp`` argument should be a seekable file object.

(From Jeff Dairiki)
Núlatin-1zutf-8zencoding problem: z	 with BOM)ÚtellÚseekÚreadlineÚ
startswithÚcodecsÚBOM_UTF8ÚlenÚPYTHON_MAGIC_COMMENT_reÚmatchÚastÚparseÚdecodeÚImportErrorÚSyntaxErrorÚUnicodeEncodeErrorÚgroup)r   ÚposÚline1Úhas_bomÚmr*   Úline2Úmagic_comment_encodings   &       r   Úparse_encodingr7   5   sW  € ð �'‰'‹)€CØ‡G�GˆA„Jð Ø—‘“ˆØ×"Ñ"¤6§?¡?Ó3ˆßØœ#œfŸo™oÓ.Ð/Ð0ˆEä#×)Ñ)¨%Ó0ˆßð9ÛØ—	‘	˜%Ÿ,™, yÓ1Ô2ð Ÿ™›�Ü+×1Ñ1°%Ó8�çßØ)*¯©°«×):Ñ):¸9Ó)EÐ&Ø)¨WÔ4Ü%Ð(:Ð;QÐ:RÐR[Ð&\Ó]Ð]Øð 	�‰�Ž÷ Ø—7‘7˜1“:×$Ñ$ YÓ/ð 	�‰��ð à
�‰�Žøô+  ¤Ô.@ÐAô ñ
 ðûð* 	�‰��úsM   £6F  Á8F  Â$F Â8,F  Ã%F  Ã-6F  Ä7F  Ä?F  ÆFÆF  ÆFÆF  Æ F3z'from\s+__future__\s+import\s+\(*(.+)\)*c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   ÚencodingÚstrr   Úintr   )r   s   "r   r   r   i   s!   € ÷ ñ ˜9ð °ð ÀCñ r   c                ó¬  € ^ RI pV P                  4       pV P                  ^ 4       ^ p V P                  4       P	                  V4      p\
        P                  ! RRV4      p\
        P                  ! RRV4      p\
        P                  ! RRV4      p\        P                  V4       F  pVP                  ^4      P                  R4       Uu. uF!  qwP                  4       P                  R	4      NK#  	  ppV F+  p	\        W)R4      p
V
'       g   K  WJP                  ,          pK-  	  K�  	  V P                  V4       V# u upi   T P                  T4       i ; i)
zJParse the compiler flags by :mod:`__future__` from the given Python
code.
Nzimport\s*\([\r\n]+zimport (z,\s*[\r\n]+z, z\\\s*[\r\n]+Ú Ú,z())Ú
__future__r!   r"   Úreadr,   ÚreÚsubÚPYTHON_FUTURE_IMPORT_reÚfinditerr0   ÚsplitÚstripÚgetattrÚcompiler_flag)r   r9   r?   r1   ÚflagsÚbodyr4   ÚxÚnamesÚnameÚfeatures   &&         r   Úparse_future_flagsrO   i   s  € ó Ø
�'‰'‹)€CØ‡G�GˆA„JØ€EðØ�w‰w‹y×Ñ Ó)ˆô �vŠvÐ+¨Z¸Ó>ˆä�vŠv�n d¨DÓ1ˆä�vŠv�o s¨DÓ1ˆä(×1Ñ1°$Ö7ˆAØ45·G±G¸A³J×4DÑ4DÀSÔ4IÓJÑ4I¨q—W‘W“Y—_‘_ TÖ*Ñ4IˆEÐJÛ�Ü! *°DÓ9�ß‘7Ø×2Ñ2Õ2’Eó ñ 8ð 	�‰�ŒØ€Lùò Køð 	�‰��ús$   ©B!E  Ã
'D;Ã1E  ÄE  Ä;E  Å Ec               ó$   € V ^8„  d   QhRRRRRR/# )r   Úpatternr:   Úfilenamer   Úboolr   )r   s   "r   r   r   ‰   s!   € ÷ >ñ >�sð > cð >¨dñ >r   c                óH  € RRRRRRRRR	R
RR/pV P                  R4      '       d   R.pV R,          p M&V P                  R4      '       d   R.pV R,          p M. p\        \        P                  ! RV 4      4       F\  w  rEV^,          '       d   VP	                  W%,          4       K-  V'       g   K7  VP	                  \        P
                  ! V4      4       K^  	  \        P                  ! RP                  V4       R2VP                  \        P                  R4      4      pVRJ# )aˆ  Extended pathname pattern matching.

This function is similar to what is provided by the ``fnmatch`` module in
the Python standard library, but:

 * can match complete (relative or absolute) path names, and not just file
   names, and
 * also supports a convenience pattern ("**") to match files at any
   directory level.

Examples:

>>> pathmatch('**.py', 'bar.py')
True
>>> pathmatch('**.py', 'foo/bar/baz.py')
True
>>> pathmatch('**.py', 'templates/index.html')
False

>>> pathmatch('./foo/**.py', 'foo/bar/baz.py')
True
>>> pathmatch('./foo/**.py', 'bar/baz.py')
False

>>> pathmatch('^foo/**.py', 'foo/bar/baz.py')
True
>>> pathmatch('^foo/**.py', 'bar/baz.py')
False

>>> pathmatch('**/templates/*.html', 'templates/index.html')
True
>>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
False

:param pattern: the glob pattern
:param filename: the path name of the file to match against
Ú?z[^/]z?/z[^/]/Ú*z[^/]+z*/z[^/]+/z**/z	(?:.+/)*?z**z(?:.+/)*?[^/]+Ú^:é   NNz./:r   NNz	([?*]+/?)Ú Ú$Ú/N)r$   Ú	enumeraterA   rE   ÚappendÚescaper)   ÚjoinÚreplaceÚosÚsep)rQ   rR   ÚsymbolsÚbufÚidxÚpartr)   s   &&     r   Ú	pathmatchrg   ‰   sý   € ðN 	ˆVØˆgØˆWØˆhØˆ{ØÐð€Gð ×Ñ˜#×ÒØˆeˆØ˜"•+‰Ø	×	Ñ	˜D×	!Ò	!ØˆeˆØ˜"•+‰àˆäœrŸxšx¨°WÓ=Ö>‰	ˆØ��7Œ7Ø�J‰J�w•}Ö%ß‰TØ�J‰J”r—y’y “Ö'ñ	 ?ô
 �HŠH˜Ÿ™ ›�~ QÐ'¨×)9Ñ)9¼"¿&¹&À#Ó)FÓG€EØ˜ÐÐr   c                  óp   a € ] tR t^Êt]P
                  ! R4      t]P
                  ! R4      tV 3R ltRt	V ;t
# )ÚTextWrapperz((\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))z$(\u2068[^\u2068]+?\u2069(?::-?\d+)?)c                óV  <€ RpW!9  d   \         SV `  V4      # . p\        P                  ! V P                  V4       FK  pVP                  V4      '       d   VP                  V4       K-  VP                  \         SV `  V4      4       KM  	  V Uu. uF  qU'       g   K  VNK  	  up# u upi )zlSplits the text into indivisible chunks while ensuring that file names
containing spaces are not broken up.
u   â�¨)ÚsuperÚ_splitrA   rE   Ú_enclosed_filename_rer$   r]   Úextend)ÚselfÚtextÚenclosed_filename_startÚchunksÚchunkÚcÚ	__class__s   &&    €r   rl   ÚTextWrapper._splitÓ   s’   ø€ ð #+ÐØ"Ô.ä‘7‘> $Ó'Ð'àˆÜ—X’X˜d×8Ñ8¸$Ö?ˆEØ×ÑÐ 7×8Ò8Ø—‘˜eÖ$à—‘œe™g™n¨UÓ3Ö4ñ	 @ñ
 "Ó'™6�a£Q—�™6Ñ'Ð'ùÒ's   Â	B&ÂB&r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__rA   ÚcompileÚ
wordsep_rerm   rl   Ú__static_attributes__Ú__classcell__)ru   s   @r   ri   ri   Ê   s2   ø† Ø—’ð	/ó€Jð ŸJšJÐ'NÓOÐ÷(ó (r   ri   c          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   rp   r:   Úwidthr;   Úinitial_indentÚsubsequent_indentr   z	list[str]r   )r   s   "r   r   r   å   s1   € ÷ ñ �3ð ˜sð ¸ð ÐVYð Ðclñ r   c                óz   € \         P                  ! R\        ^R7       \        WVRR7      pVP	                  V 4      # )aó  Simple wrapper around the ``textwrap.wrap`` function in the standard
library. This version does not wrap lines on hyphens in words. It also
does not wrap PO file locations containing spaces.

:param text: the text to wrap
:param width: the maximum line width
:param initial_indent: string that will be prepended to the first line of
                       wrapped output
:param subsequent_indent: string that will be prepended to all lines save
                          the first of wrapped output
z¦`babel.util.wraptext` is deprecated and will be removed in a future version of Babel. If you need this functionality, use the `babel.util.TextWrapper` class directly.)Ú
stacklevelF)r€   r�   r‚   Úbreak_long_words)ÚwarningsÚwarnÚDeprecationWarningri   Úwrap)rp   r€   r�   r‚   Úwrappers   &&&& r   Úwraptextr‹   å   sA   € ô ‡M‚Mð	[äØõ	ô  Ø,=Ø+0ô2€Gð �<‰<˜ÓÐr   c                  óf   € ] tR tRtRtRR R lltR R ltR R	 ltR
 R ltR R lt	R R lt
RtR# )ÚFixedOffsetTimezonei  z&Fixed offset in minutes east from UTC.Nc               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚoffsetÚfloatrM   r   r   ÚNoner   )r   s   "r   r   Ú FixedOffsetTimezone.__annotate__  s!   € ÷ ñ ˜uð ¨Jð À$ñ r   c                	ód   € \         P                  ! VR 7      V n        Vf
   RV,          pW n        R# ))ÚminutesNz
Etc/GMT%+d)ÚdatetimeÚ	timedeltaÚ_offsetÚzone)ro   r�   rM   s   &&&r   Ú__init__ÚFixedOffsetTimezone.__init__  s(   € ä×)Ò)°&Ô9ˆŒØŠ<Ø &Õ(ˆDØŽ	r   c               ó   € V ^8„  d   QhRR/# ©r   r   r:   r   )r   s   "r   r   r’     s   € ÷ ñ ˜ñ r   c                	ó   € V P                   # ©N©r˜   ©ro   s   &r   Ú__str__ÚFixedOffsetTimezone.__str__  ó   € Ø�y‰yÐr   c               ó   € V ^8„  d   QhRR/# rœ   r   )r   s   "r   r   r’     s   € ÷ =ñ =˜#ñ =r   c                	ó<   € R V P                    RV P                   R2# )z<FixedOffset "z" Ú>)r˜   r—   r    s   &r   Ú__repr__ÚFixedOffsetTimezone.__repr__  s   € Ø §	¡	˜{¨"¨T¯\©\¨N¸!Ð<Ð<r   c               ó    € V ^8„  d   QhRRRR/# ©r   Údtúdatetime.datetimer   zdatetime.timedeltar   )r   s   "r   r   r’     s   € ÷ ñ Ð-ð Ð2Dñ r   c                	ó   € V P                   # rž   )r—   ©ro   r«   s   &&r   Ú	utcoffsetÚFixedOffsetTimezone.utcoffset  s   € Ø�|‰|Ðr   c               ó    € V ^8„  d   QhRRRR/# )r   r«   r¬   r   r:   r   )r   s   "r   r   r’     s   € ÷ ñ Ð*ð ¨sñ r   c                	ó   € V P                   # rž   rŸ   r®   s   &&r   ÚtznameÚFixedOffsetTimezone.tzname  r£   r   c               ó    € V ^8„  d   QhRRRR/# rª   r   )r   s   "r   r   r’     s   € ÷ ñ Ð'ð Ð,>ñ r   c                	ó   € \         # rž   )ÚZEROr®   s   &&r   ÚdstÚFixedOffsetTimezone.dst  s   € Üˆr   )r—   r˜   rž   )rw   rx   ry   rz   Ú__doc__r™   r¡   r§   r¯   r³   r¸   r}   r   r   r   r�   r�     s(   † Ù0÷õõ=õõ÷ñ r   r�   c               ó    € V ^8„  d   QhRRRR/# )r   Úar   Úbr   )r   s   "r   r   r   '  s   € ÷ ñ ˆCð �Cñ r   c                ó   € W8„  W8  ,
          # rž   r   )r¼   r½   s   &&r   Ú_cmpr¿   '  s   € Ø‰E�a‘eÕÐr   )r    )éF   rY   rY   ),rº   r?   r   r%   r•   ra   rA   Útextwrapr†   Úcollections.abcr   r   Útypingr   r   r   Úbabelr   r	   ÚobjectÚmissingr
   r   r{   ÚVERBOSEr(   r7   rC   rO   rg   ri   r‹   ÚdictÚodictÚtzinfor�   ÚUTCÚLOCALTZÚget_localzoneÚ	STDOFFSETÚ	DSTOFFSETÚDSTDIFFr·   r¿   r   r   r   Ú<module>rÑ      sþ   ðñõ #ã Û Û 	Û 	Û Û ß /ß #Ñ #ç "á
‹(€áˆTƒ]€õð* Ÿ*š*Ø0°"·*±*ó>Ð õ-ð` Ÿ*š*Ø.ó0Ð ÷õ@>ôB(�(×&Ñ&ô (÷6ð2 	€ô˜(Ÿ/™/ô ð: ‡i�i€Ø
�-‰-€Ø×'Ñ'€Ø×Ñ€	Ø×Ñ€	Ø
×
Ñ
€Ø‡~�~€÷r   