
    Cj                        % S r SSKJr  SSKJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJrJrJr  SS	KJr  \S
   rS\S'    \ " S S\SS95       r\ " S S5      5       r " S S5      rg)z8Provides classes for holding and managing notifications.    )annotations)	dataclassfield)time)Iterator)uuid4)Result)LiteralSelf	TypeAlias)Message)informationwarningerrorr   SeverityLevelc                  $    \ rS rSr% SrS\S'   Srg)Notify   zMessage to show a notification.Notificationnotification N)__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r       g/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/notifications.pyr   r      s    )r   r   F)bubblec                      \ rS rSr% SrS\S'    SrS\S'    SrS\S	'    S
rS\S'    Sr	S\S'    \
" \S9rS\S'    \
" S S9rS\S'    \SS j5       r\SS j5       rSS jrSrg)r      z$Holds the details of a notification.strmessage titler   r   severity   floattimeoutFboolmarkup)default_factory	raised_atc                 (    [        [        5       5      $ N)r$   r   r   r   r    <lambda>Notification.<lambda>0   s
    #eg,r   identityc                J    U R                   U R                  -   [        5       -
  $ )z-The time left until this notification expires)r/   r+   r   selfs    r    	time_leftNotification.time_left3   s     -77r   c                     U R                   S:*  $ )zHas the notification expired?r   )r8   r6   s    r    has_expiredNotification.has_expired8   s     ~~""r   c              #     #    SU R                   4v   SU R                  S4v   SU R                  4v   SU R                  4v   SU R                  4v   SU R
                  4v   SU R                  4v   g 7f)	Nr%   r'   r&   r(   	raised_itr4   r8   r;   )r%   r'   r(   r/   r4   r8   r;   r6   s    r    __rich_repr__Notification.__rich_repr__=   sr     %%tzz2%%$--''4>>))$--''4>>))T----s   A3A5r   N)returnr*   )rA   r,   )rA   r	   )r   r   r   r   r   r   r'   r(   r+   r-   r   r   r/   r4   propertyr8   r;   r?   r   r   r   r    r   r      s    .L+E3O)+Hm+2GU8FD<T2Iu2C*>?Hc?28 8 # #.r   r   c                  h    \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
SS	 jrSS
 jrSrg)NotificationsG   z1Class for managing a collection of notifications.c                    0 U l         g)z'Initialise the notification collection.N_notificationsr6   s    r    __init__Notifications.__init__J   s
    79r   c                    [        U R                  R                  5       5       H-  nUR                  (       d  M  U R                  UR                  	 M/     U $ )zBRemove any expired notifications from the notification collection.)listrH   valuesr;   r4   r7   r   s     r    _reapNotifications._reapN   sG     !4!4!;!;!=>L'''''(=(=> ? r   c                R    XR                  5       R                  UR                  '   U $ )zAdd the given notification to the collection of managed notifications.

Args:
    notification: The notification to add.

Returns:
    Self.
)rO   rH   r4   rN   s     r    addNotifications.addU   s$     >J

##L$9$9:r   c                :    U R                   R                  5         U $ )zClear all the notifications.)rH   clearr6   s    r    rU   Notifications.cleara   s    !!#r   c                H    [        U R                  5       R                  5      $ )zThe number of notifications.)lenrO   rH   r6   s    r    __len__Notifications.__len__f   s    4::<..//r   c                d    [        U R                  5       R                  R                  5       5      $ r1   )iterrO   rH   rM   r6   s    r    __iter__Notifications.__iter__j   s"    DJJL//66899r   c                4    UR                   U R                  ;   $ r1   )r4   rH   rN   s     r    __contains__Notifications.__contains__m   s    $$(;(;;;r   c                p     U R                  5       R                  UR                  	 g ! [         a     g f = fr1   )rO   rH   r4   KeyErrorrN   s     r    __delitem__Notifications.__delitem__p   s5    	

++L,A,AB 	
 	s   %( 
55rG   N)rA   None)rA   r   )r   r   rA   r   )rA   int)rA   zIterator[Notification])r   r   rA   r,   )r   r   rA   rf   )r   r   r   r   r   rI   rO   rR   rU   rY   r]   r`   rd   r   r   r   r    rD   rD   G   s-    ;:

0:<r   rD   N)r   
__future__r   dataclassesr   r   r   typingr   uuidr   	rich.reprr	   typing_extensionsr
   r   r   textual.messager   r   r   r   r   rD   r   r   r    <module>ro      sw    > " (     6 6 #"#DEy E , WU   ). ). ).X1 1r   