+
   U!g[                   N    R t ^ RIHt ^RIHt ^RIHt ^RIHt  ! R R4      tR# )zv
OS-independent base for an event and VT sequence scanner

See unix_eventqueue and windows_eventqueue for subclasses.
)deque)keymapEvent)tracec                      a  ] tR t^!t o V 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R	 lR
 ltV 3R lR lt	Rt
V tR# )BaseEventQueuec                @   < V ^8  d   QhRS[ RS[S[S[ 3,          RR/# )   encodingkeymap_dictreturnN)strdictbytes)format__classdict__s   "./usr/lib/python3.14/_pyrepl/base_eventqueue.py__annotate__BaseEventQueue.__annotate__"   s+       4s
3C      c                    \         P                  ! V4      V n        V P                  V n         \        R V P                   R7       Wn        \        4       V n        \        4       V n        R# )zkeymap {k!r}kN)	r   compile_keymapcompiled_keymapr   r   r   events	bytearraybuf)selfr   r   s   &&&r   __init__BaseEventQueue.__init__"   sG    %44[A**n, $)G;r   c                .   < V ^8  d   QhRS[ R,          /# )r
   r   Nr   )r   r   s   "r   r   r   *   s      UT\ r   c                ^    V P                   '       d   V P                   P                  4       # R# )z*
Retrieves the next event from the queue.
N)r   popleftr   s   &r   getBaseEventQueue.get*   s#     ;;;;;&&((r   c                    < V ^8  d   QhRS[ /# r
   r   )bool)r   r   s   "r   r   r   3   s      t r   c                $    V P                   '       * # )z
Checks if the queue is empty.
)r   r%   s   &r   emptyBaseEventQueue.empty3   s     ;;r   c                    < V ^8  d   QhRS[ /# r)   )r   )r   r   s   "r   r   r   9   s      9 r   c                <    V P                   p\        4       V n         V# )z.
Flushes the buffer and returns its contents.
)r   r   )r   olds   & r   	flush_bufBaseEventQueue.flush_buf9   s     hh;
r   c                $   < V ^8  d   QhRS[ RR/# )r
   eventr   Nr   )r   r   s   "r   r   r   A   s     " "E "d "r   c                V    \        RVR7       V P                  P                  V4       R# )z"
Inserts an event into the queue.
zadded event {event})r4   N)r   r   append)r   r4   s   &&r   insertBaseEventQueue.insertA   s!     	#515!r   c                4   < V ^8  d   QhRS[ S[,          RR/# )r
   charr   N)intr   )r   r   s   "r   r   r   H   s     &/ &/u &/ &/r   c           
        \        V\        \        34      '       g   Q h\        V\        4      '       d   TM
\        V4      pVP	                  4       pV P
                  P                  V4       WP                  9   d   V P                  V P                  J d   \        V P
                  4      ^8X  g   Q hV P                  V,          p\        RVR7       \        V\        4      '       d	   W0n        R# V P                  \        RV\        V P                  4       4      4      4       V P                  V n        R# V P
                  '       d   V P
                  ^ ,          ^8X  dj   \        R4       V P                  V n        V P                  \        RRR4      4       V P                  4       R,           F  pV P                  V4       K  	  R#  \        V P
                  4      P!                  V P"                  4      pV P                  \        RV\        V P                  4       4      4      4       T P                  T n        R#   \$         d     R# i ; i)	zQ
Processes a character by updating the buffer and handling special key mappings.
zfound map {k!r}r   keyz,unrecognized escape sequence, propagating...   :   NNN)
isinstancer;   r   ordto_bytesr   r6   r   r   lenr   r   r7   r   r1   pushdecoder   UnicodeError)r   r:   ord_charr   _cdecodeds   &&    r   rE   BaseEventQueue.pushH   s    $e----%dC004c$i  "!;;{{d222488})))D!A#q)!T""E%E$..2B,CDE"22XXX$((1++ @A..DKKKeVW56nn&r**		" +L/00? E%%8H2IJK..DK	   s   .H? ?II)r   r   r   r   r   N)__name__
__module____qualname____firstlineno__r    r&   r,   r1   r7   rE   __static_attributes____classdictcell__)r   s   @r   r   r   !   sA         " "&/ &/r   r   N)	__doc__collectionsr    r   consoler   r   r    r   r   <module>rW      s$   *    M/ M/r   