
    Cj	                     x    S SK Jr  S SKJrJr  S SKJrJrJrJ	r	J
r
  S SKJr  S SKJrJr  S SKJr   " S S5      rg	)
    )cast)AlignAlignMethod)ConsoleConsoleOptionsJustifyMethodRenderableTypeRenderResult)Measurement)SegmentSegments)Stylec                   f    \ rS rSrSrS\S\S\S\S\SS	4S
 jr	S\
S\S\4S jrSSSSS\4S jrSrg	)HorizontalPad   zRich renderable to add padding on the left and right of a renderable.

Note that unlike Rich's Padding class this align each line independently.


renderableleftright	pad_stylejustifyreturnNc                 @    Xl         X l        X0l        X@l        XPl        g)z
Initialize HorizontalPad.

Args:
    renderable: A Rich renderable.
    left: Left padding.
    right: Right padding.
    pad_style: Style of padding.
    justify: Justify method.
N)r   r   r   r   r   )selfr   r   r   r   r   s         ]/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/textual/pad.py__init__HorizontalPad.__init__   s    $ %	
"    consoleoptionsc              #   @  #    UR                  UR                  U R                  -
  U R                  -
  S S9nUR	                  U R
                  USS9n[        SU R                  -  U R                  5      n[        SU R                  -  U R                  5      n[        [        U R                  S;   a  U R                  OS5      nU HS  nUnU R                  (       a  U/UQnU R                  (       a  UR                  U5        [        U5      n	[        XS9v   MU     g 7f)N)widthheightF)pad >   r   r   centerr   )align)update	max_widthr   r   render_linesr   r   r   r   r   r   appendr   r   )
r   r   r   linesleft_pad	right_padr&   linepad_linesegmentss
             r   __rich_console__HorizontalPad.__rich_console__/   s      ..##dii/$**<T ! 
 $$T__g5$I3?DNN;C$**,dnn=	! LL,GGDLLV

 DHyy$,t,zz	*)H.. s   DDr   r   c                     [         R                  " XU R                  5      nU R                  U R                  -   n[        UR
                  U-   UR                  U-   5      $ )N)r   getr   r   r   minimummaximum)r   r   r   measurementtotal_paddings        r   __rich_measure__HorizontalPad.__rich_measure__G   sS     "oogH		DJJ.-/-/
 	
r   )r   r   r   r   r   )__name__
__module____qualname____firstlineno____doc__r	   intr   r   r   r   r   r
   r1   r   r9   __static_attributes__ r   r   r   r      s    "  	
   
0//)7/	/0
 
+;
	
r   r   N)typingr   
rich.alignr   r   rich.consoler   r   r   r	   r
   rich.measurer   rich.segmentr   r   
rich.styler   r   rB   r   r   <module>rI      s*     )  % * ?
 ?
r   