+
     BiJ                         R t ^ RIt^ RItR t ! R R4      t]R8X  d'   R t]P                  ! ]4      t]	! R]
! ]4      4       R# R# )z:Simple textbox editing widget with Emacs-like keybindings.Nc                   V P                  V^,           V\        P                  W1,
          ^,
          4       V P                  W^,           \        P                  WB,
          ^,
          4       V P                  W2^,           \        P                  WB,
          ^,
          4       V P                  V^,           V\        P                  W1,
          ^,
          4       V P                  W\        P                  4       V P                  W\        P                  4       V P                  W4\        P                  4       V P                  W2\        P                  4       R# )zVDraw a rectangle with corners at the provided upper-left
and lower-right coordinates.
N)
vlinecurses	ACS_VLINEhline	ACS_HLINEaddchACS_ULCORNERACS_URCORNERACS_LRCORNERACS_LLCORNER)winulyulxlrylrxs   &&&&&%/usr/lib/python3.14/curses/textpad.py	rectangler      s     IIc!eS&**CIM:IIcq5&**CIM:IIcq5&**CIM:IIc!eS&**CIM:IIc++,IIc++,IIc++,IIc++,    c                   V   a  ] tR t^t o RtRR ltR tR tR tR t	R t
RR	 ltR
tV tR# )Textboxa  Editing widget using the interior of a window object.
 Supports the following Emacs-like key bindings:

Ctrl-A      Go to left edge of window.
Ctrl-B      Cursor left, wrapping to previous line if appropriate.
Ctrl-D      Delete character under cursor.
Ctrl-E      Go to right edge (stripspaces off) or end of line (stripspaces on).
Ctrl-F      Cursor right, wrapping to next line when appropriate.
Ctrl-G      Terminate, returning the window contents.
Ctrl-H      Delete character backward.
Ctrl-J      Terminate if the window is 1 line, otherwise insert newline.
Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
Ctrl-L      Refresh screen.
Ctrl-N      Cursor down; move down one line.
Ctrl-O      Insert a blank line at cursor location.
Ctrl-P      Cursor up; move up one line.

Move operations do nothing if the cursor is at an edge where the movement
is not possible.  The following synonyms are supported where possible:

KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
KEY_BACKSPACE = Ctrl-h
c                |    Wn         W n        V P                  4        ^V n        RV n        VP                  ^4       R#    N)r   insert_mode_update_max_yxstripspaceslastcmdkeypad)selfr   r   s   &&&r   __init__Textbox.__init__+   s3    &

1r   c                v    V P                   P                  4       w  rV^,
          V n        V^,
          V n        R# r   )r   getmaxyxmaxymaxx)r   r$   r%   s   &  r   r   Textbox._update_max_yx3   s,    XX&&(
1H	1H	r   c                P   V P                  4        V P                  p \        P                  P                  V P                  P                  W4      4      \        P                  P                  8w  d!   \        V P                  V^,           4      p V# V^ 8X  d    V# V^,
          pK  )zmGo to the location of the first blank on the given line,
returning the index of the last non-blank character.)r   r%   r   asciir   inchSPmin)r   ylasts   && r   _end_of_lineTextbox._end_of_line8   s     	yy||!!$((--"89V\\__L499d1f-   !8Dr   c                j   V P                  4        V P                  P                  4       w  r#R pW P                  8  g   W0P                  8  d   V P
                  '       d   V P                  P                  4       p V P                  P                  V4       V P
                  '       d&   \        P                  P                  X4      '       g   M)TpV P                  P                  4       w  r#Ve   K  W#3pK  Ve   V P                  P                  ! V!   R # R #   \        P                   d     Li ; iN)r   r   getyxr$   r%   r   r)   r   r   errorr(   isprintmove)r   chr,   xbackyxoldchs   &&    r   _insert_printable_charTextbox._insert_printable_charF   s    !))mq99}r" ###6<<+?+?+F+FBXX^^%FQ~HHMM6"  << s   <D D21D2c                6   V P                  4        V P                  P                  4       w  r#Wn        \        P
                  P                  V4      '       d4   W P                  8  g   W0P                  8  d   V P                  V4       ^# V\        P
                  P                  8X  d   V P                  P                  V^ 4       ^# V\        P
                  P                  \        P                  \        P
                  P                  \        P                  \        P
                  P                   39   Ed   V^ 8  d$   V P                  P                  W#^,
          4       MV^ 8X  d   MyV P"                  '       d;   V P                  P                  V^,
          V P%                  V^,
          4      4       M-V P                  P                  V^,
          V P                  4       V\        P
                  P                  \        P                  \        P
                  P                   39   d   V P                  P'                  4        ^# V\        P
                  P(                  8X  d   V P                  P'                  4        ^# V\        P
                  P*                  8X  dg   V P"                  '       d-   V P                  P                  W P%                  V4      4       ^# V P                  P                  W P                  4        ^# V\        P
                  P,                  \        P.                  39   dn   W0P                  8  d%   V P                  P                  W#^,           4       ^# W P                  8X  d    ^# V P                  P                  V^,           ^ 4        ^# V\        P
                  P0                  8X  d   ^ # V\        P
                  P2                  8X  dI   V P                  ^ 8X  d   ^ # W P                  8  d$   V P                  P                  V^,           ^ 4       ^# V\        P
                  P4                  8X  dr   V^ 8X  d3   V P%                  V4      ^ 8X  d   V P                  P7                  4        ^# V P                  P                  W#4       V P                  P9                  4         ^# V\        P
                  P:                  8X  d   V P                  P=                  4        ^# V\        P
                  P>                  \        P@                  39   d   W P                  8  dy   V P                  P                  V^,           V4       W0P%                  V^,           4      8  d:   V P                  P                  V^,           V P%                  V^,           4      4       ^# V\        P
                  PB                  8X  d   V P                  PE                  4        ^# V\        P
                  PF                  \        PH                  39   d   V^ 8  dy   V P                  P                  V^,
          V4       W0P%                  V^,
          4      8  d:   V P                  P                  V^,
          V P%                  V^,
          4      4       ^# )z!Process a single editing command.)%r   r   r2   r   r   r(   r4   r$   r%   r:   SOHr5   STXKEY_LEFTBSKEY_BACKSPACEDELr   r.   delchEOTENQACK	KEY_RIGHTBELNLVTdeletelnclrtoeolFFrefreshSOKEY_DOWNSIinsertlnDLEKEY_UP)r   r6   r,   r7   s   &&  r   
do_commandTextbox.do_command_   sv   !<<##99}II++B/v u 6<<###HHMM!Qr q FLL$$V__LLOO((LL$$& & 1ua1%a!!!ac4#4#4QqS#9:ac499-flloov';';V\\=M=MNN V U 6<<###HHNNR Q 6<<###a!2!21!56L I a+H G FLL$$f&6&67799}a1%B A ii> ; ac1%: 9 6<<###6<<??"yyA~YYac1%, + 6<<??"Av$++A.!3!!#& ! a#!!#  6<<??"HH  FLLOOV__5599}ac1%((1--HHMM!A#t'8'81'=>  6<<??"HH  FLL$$fmm441uac1%((1--HHMM!A#t'8'81'=>r   c                B   RpV P                  4        \        V P                  ^,           4       F  pV P                  P	                  V^ 4       V P                  V4      pV^ 8X  d   V P                  '       d   KK  \        V P                  ^,           4       Fe  pV P                  '       d	   WC8  d    MLV\        \        P                  P                  V P                  P                  W$4      4      4      ,           pKg  	  V P                  ^ 8  g   K  VR,           pK  	  V# )z.Collect and return the contents of the window. 
)r   ranger$   r   r5   r.   r   r%   chrr   r(   r)   )r   resultr,   stopr7   s   &    r   gatherTextbox.gather   s    tyy{#AHHMM!Q$$Q'DqyT---499Q;'####fll&8&8q9L&M"NN ( yy1}$ $ r   Nc                     V P                   P                  4       pV'       d	   V! V4      pV'       g   K5  V P                  V4      '       g    V P	                  4       # V P                   P                  4        Ky  )z2Edit in the widget window and collect the results.)r   getchrU   rN   r^   )r   validater6   s   && r   editTextbox.edit   sW    !Bb\??2&&{{} HHr   )r   r   r%   r$   r   r   )Fr1   )__name__
__module____qualname____firstlineno____doc__r    r   r.   r:   rU   r^   rc   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s4     .
#2BH" r   r   __main__c                    ^	^r!^^rCV P                  V^,
          VR4       \        P                  ! W!W44      p\        W^,
          V^,
          W2,           WA,           4       V P	                  4        \        V4      P                  4       # )	   zUse Ctrl-G to end editing.)addstrr   newwinr   rN   r   rc   )stdscrncolsnlinesr   r   r   s   &     r   test_editboxru      sl    1vrSc!eS">?mmF34&a%QckBs|  ""r   zContents of text box:)ri   r   curses.asciir   r   re   ru   wrapperstrprintrepr r   r   <module>r|      sS    @  -l l\ z# ..
&C	
!49- r   