+
    i]  c                  s  a  0 t $ 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
t
^RIHtHtHt R]R&    ^RIHt R R ltR	 R
 ltR tR]P.                  ! RR4      R]P.                  ! RR4      R]P0                  ! R]P2                  4      R]P4                  ! 4       R]R]P.                  ! RR4      /tR R ltR^ /R R lltR#   ] d
    ^RIHt  Li ; i)zThis is an alternative to python_reader which tries to emulate
the CPython prompt as closely as possible, with the exception of
allowing multiline input and multiline history entries.
)annotationsN)_get_readermultiline_inputappend_history_filez-tuple[type[Exception], ...] | type[Exception]_error)r   c               s    V ^8  d   QhRR/# )   returnstr Zformat   "0/usr/lib64/python3.14/_pyrepl/simple_interact.py__annotate__r   -   s      s     c                 s    \        4        R#   \         dp   p \        P                  P	                  RR4      ;p'       d   RT 2p\        \        T 4      ;'       g    \        T 4      ;'       g    R4      T,           u Rp ? # Rp ? ii ; i)zGReturns the error message if there is a problem initializing the state.ZTERM z; TERM=zunknown errorN)r   r   osZenvirongetr   Zrepr)eZterms     r   checkr   -   st    @
 	  @::>>&"--4-TF#D3q677T!W7784??@s'   
 BABB0B=BBc               s     V ^8  d   QhRRRR/# )r   textr   r   r   r	   r
   r   r   r   8   s      c c r   c                sx    V P                  R 4      p\        V4      pV^ 8  d   W^,
          ,          R8X  d   V# V # )z 	
)Zrstriplen)r   ZshortZns   &  r   _strip_final_indentr   8   s9     KKEE
A1u!e$Kr   c                 sP    \        4       p V P                  P                  R 4       R# )Zclear_screenN)r   Zscheduled_commandsZappend)readers    r   _clear_screenr   C   s    ]F
$$^4r   Zexitr   Zquit	copyrightZhelpZclearZc               $    V ^8  d   QhRRRRRR/# )r   consolecode.InteractiveConsoleunicodetextr   r   boolr   r	   r
   r   r   r   R   s"      0 s t r   c                s|   \        V4      p V P                  VR R4      pVRJ #   \        \        \        3 d    TP                  RR7      p\        T4      ^8X  d    R# TR,          pTP                  R	4      pTP                  4       R8g  pTP                  R4      '       * pT;'       g    T;'       d    Tu # i ; i)
z<stdin>singleNT)ZkeependsFr   r   i)Z Z	)
r   compileZOverflowErrorZSyntaxErrorZ
ValueErrorZ
splitlinesr   Z
startswithstripZendswith)	r   r   ZsrccodeZlinesZ	last_lineZwas_indentedZ	not_emptyZ
incompletes	   &&       r   _more_linesr#   R   s    
k
*CsIx8 t| ;
3 	:-u:?"I	 ++K8OO%+	"++D11
))	99z9	:s   $ 8B;AB;5B;:B;future_flagsc               r   )r   r   r   r$   Zintr   ZNoner   r	   r
   r   r   r   e   s-     P P$P P 
	Pr   c               s  a  ^RI Hp V! S P                  4       V'       d.   S P                  P                  ;P
                  V,          un        \        P                  ! \        S 4      p^ p\        P                  P                  R4      p\        \        R4      pT;'       d    TpR V 3R llp   \        P                  P                  4        \!        \        RR4      p	\!        \        R	R
4      p
 \#        W9V
4      pT! T4      '       d   K`  RT R2pS P'                  \)        T4      TRR7      pT'       d   Q h \+        4        T^,          pT'       g   K  S PM                  R\        PV                  ! 4        R\        PX                  ! 4        R24       K    \         d     Li ; i  \$         d     R# i ; i  \,        \.        \0        3 d$   p\2        P4                  ! RT 24        Rp?LRp?ii ; i  \6         d    \9        4       pTP;                  4        TP<                  TP>                  J d   TPA                  RR.34       \C        TPE                  4       4      Tn#        RTn$        TPK                  4        S PM                  R4       S PO                  4         ELU\P         d&    S PM                  R4       S PO                  4         EL\R         d    h  S PU                  4        S PO                  4         EL; i)i   )_setupZshowrefcountgettotalrefcountc               s     V ^8  d   QhRRRR/# )r   	statementr   r   r   r   r	   r
   r   r   Z7run_multiline_interactive_console.<locals>.__annotate__v   s      S T r   c           	     s  < V P                  4       p V SP                  9   g   V \        9  d   R # \        4       pVP                  P                  4        \        V ,          p\        V4      '       dL   VP                  4       ;_uu_ 4        VP                  4       ;_uu_ 4        V! 4        RRR4       RRR4       R# R #   + '       g   i     L; i  + '       g   i     R# ; i)FNT)	r!   localsREPL_COMMANDSr   ZhistoryZpopZcallableZsuspend_historyZsuspend_colorization)r'   r   Zcommandr   s   &  r   maybe_run_commandZ<run_multiline_interactive_console.<locals>.maybe_run_commandv   s    OO%	&)=*H	*G''))6+F+F+H+H	 ,I) ,I+H))s$   
C#B?	+C?C
CC#	Tps1z>>> ps2z... z<python-input-Z>r   )ZfilenameZ_symbolz-failed to open the history file for writing: Nzisearch-endr   z
KeyboardInterrupt
z
MemoryError
Z[z refs, z	 blocks]
)-readliner%   r(   r    ZcompilerZflags	functoolsZpartialr#   sysZ	_xoptionsr   ZhasattrZstdoutZflushZ	ExceptionZgetattrr   ZEOFErrorZpushr   r   ZFileNotFoundErrorZPermissionErrorZOSErrorwarningsZwarnZKeyboardInterruptr   Zcmpltn_resetZinput_transZisearch_transZdo_cmdr   Zget_unicodeZposZdirtyZrefreshZwriteZresetbufferZMemoryErrorZ
SystemExitZshowtracebackr&   Zgetallocatedblocks)r   r$   r%   Z
more_linesZinput_nZ_is_x_showrefcount_setZ_is_pydebug_buildZshow_ref_countr*   r+   r,   r'   Z
input_nameZmorer   Zrs   f$              r   !run_multiline_interactive_consoler1   e   s   
 !
7>>  &&,6&"";8JG ]]..~>%78+AA0AN  *	"

  " #uf-C#uf-C+JSA	 !++)'!4J<< 3I >]e<fDO8S#% qLG& >MMC((*+ ,**,-Z9S     &@ S MaSQRRS ! 		"ANN}}/-"./(AEAGIIKMM12! 	"MM+,! 		"!!#!s   3F "G: 4F,  G: -G: >
F> 	G: F)&G: (F))G: ,F;7G: :F;;G: >G7G2-G: 2G77G: :B)L&L/"LL#L)__conditional_annotations__Z__doc__Z
__future__r    Z_sitebuiltinsr.   r   r/   r"   r0   Zerrnor-   r   r   r   Z__annotations__Zunix_consoler   ZModuleNotFoundErrorZwindows_consoler   r   r   ZQuitterZ_Printerr   Z_Helperr)   r#   r1   )r2   s   @r   <module>r3      s   *
 #   	 
    G G 	6 5($5 M!!&"-
M!!&"-''S]]C
M!!#]
M!!&"-&P P Pw  ('(s   C CC