
    BUhC                     \   d Z dZdZddlmZ ddlmZmZmZm	Z	 ddl
mZ ddlmZmZmZmZmZmZmZmZmZmZ m!Z"m#Z$m%Z&  eedd      Z' eedd      Z( eedd      Z) G d	 d
      Z* G d de*      Z+ e,eeeee	      fdZ- G d de*      Z. G d de*      Z/ e0       Z1 G d d      Z2d Z3d Z4y)z3.3.0a  Classes for ParagraphStyle and similar things.

A style is a collection of attributes, but with some extra features
to allow 'inheritance' from a parent, and to ensure nobody makes
changes after construction.

ParagraphStyle shows all the attributes available for formatting
paragraphs.

getSampleStyleSheet()  returns a stylesheet you can use for initial
development, with a few basic heading and text styles.
)PropertySetParagraphStylestr2alignment	LineStyle	ListStyleStyleSheet1getSampleStyleSheet    )black)TA_LEFT	TA_CENTERTA_RIGHT
TA_JUSTIFY)tt2ps)canvas_basefontnameunderlineWidthunderlineOffsetunderlineGapstrikeWidthstrikeOffset	strikeGapspaceShrinkageplatypus_link_underlinehyphenationLanghyphenationMinWordLengthuriWasteReduceembeddedHyphenation   c                   :    e Zd Zi ZddZd Zd Zd Zd	dZddZ	y)
r   Nc                    d| j                   vsJ d       d| j                   vsJ d       |rN|j                  | j                  k(  s5J d|j                  j                  d| j                  j                         || _        || _        | j
                  j                  | j                          | j                           | j                  di | y)	zWhen initialized, it copies the class defaults;
        then takes a copy of the attributes of the parent
        if any.  All the work is done in init - styles
        should cost little to use at runtime.namez1Class Defaults may not contain a 'name' attributeparentz3Class Defaults may not contain a 'parent' attributezParent style z# must have same class as new style N )	defaults	__class____name__r    r!   __dict__updaterefresh_setKwds)selfr    r!   kws       U/var/www/html/profi_bot/bot/venv/lib/python3.12/site-packages/reportlab/lib/styles.py__init__zPropertySet.__init__6   s     T]]*_,__*t}},c.cc,##t~~5  dqw  rB  rB  rK  rK  LP  LZ  LZ  Lc  Lc  8d  d5 	T]]+
 	    c                 R    |j                         D ]  \  }}|| j                  |<    y N)itemsr&   )r*   r+   keyvalues       r,   r)   zPropertySet._setKwdsL   s$    ((*JC"'T]]3 %r.   c                 P    d| j                   j                  d| j                  dS )N<z 'z'>)r$   r%   r    r*   s    r,   __repr__zPropertySet.__repr__Q   s    "nn55tyyAAr.   c                     | j                   rA| j                   j                  j                         D ]  \  }}|dvs|| j                  |<    yy)zre-fetches attributes from the parent on demand;
        use if you have been hacking the styles.  This is
        used by __init__)r    r!   N)r!   r&   r1   )r*   r2   r3   s      r,   r(   zPropertySet.refreshT   sH     ;;"kk2288:
U00).DMM#& ; r.   c                 ~   t        |dz   | j                         t        |dz   | j                         t        | j                  j                               }|j                          |j                  d       |j                  d       |D ]1  }| j                  j                  |d       }t        ||d|z          3 y )Nzname =zparent =r    r!   z = )	printr    r!   listr&   keyssortremoveget)r*   indentkeylistr2   r3   s        r,   	listAttrszPropertySet.listAttrs]   s    fx+fz!4;;/t}}))+,vx CMM%%c40E&U334 r.   c                     | j                  ||      }| j                  j                         |_        ||_        |d u xr | xs ||_         |j
                  di | |S )Nr"   )r$   r&   copyr    r!   r)   )r*   r    r!   kwdsrs        r,   clonezPropertySet.cloneh   sX    NN4']]'')
T>*d4f

Tr.   r0   ) )
r%   
__module____qualname__r#   r-   r)   r7   r(   rB   rG   r"   r.   r,   r   r   3   s&    H,(
B/	5r.   r   c            	           e Zd Zi deddddddddd	dd
edddddedddddeddddddddi ddddddddddddddddded d!d"dd#dd$ed%ed&e	d'e
d(eeeddeeed)Zy)*r   fontNamefontSize
   leading   
leftIndentr	   rightIndentfirstLineIndent	alignmentspaceBefore
spaceAfterbulletFontNamebulletFontSizebulletIndent	textColor	backColorNwordWrapshapingborderWidthborderPaddingborderColorborderRadiusallowWidowsr   allowOrphanstextTransformendDotssplitLongWordsr   bulletAnchorstartjustifyLastLinejustifyBreaksr   r   r   r   r   )r   linkUnderlineunderlineColorstrikeColorr   r   r   )r%   rI   rJ   _baseFontNamer   r
   _baseUnderlineWidth_spaceShrinkage_baseStrikeWidth_baseUnderlineOffset_baseUnderlineGap_baseStrikeOffset_baseStrikeGap_platypus_link_underline_hyphenationLang_embeddedHyphenation_uriWasteReducer#   r"   r.   r,   r   r   p   s   1
=1
21
 	"1
 	Q	1

 	a1
 	!1
 	G1
 	a1
 	Q1
 	1
 	1
 	q1
 	U1
 	D1
  	4!1
( 	1)1
* 	q+1
, 	-1
. 	t/1
0 	11
2 	q31
4 	51
6 	71
8 	$91
> 	?1
@ 	-A1
B 	C1
D 	1E1
F 	G1
H 	/I1
J 	'K1
L 	/M1
N 	)O1
P 	)Q1
R $1 +3)a1
Hr.   r   )centrecenterleftrightjustifyc                 f    |j                  | j                         d       }|t        | d      |S )Nz is illegal value for alignment)r?   lower
ValueError)v__map___s      r,   r   r      s6    
 	AGGId#Ay
aU*I#JKKHr.   c                       e Zd ZdedZd Zy)r   r   )widthcolorc                 &    |j                  d       y)zKYou can ask a LineStyle to set up the canvas for drawing
        the lines.r   N)setLineWidth)r*   canvass     r,   prepareCanvaszLineStyle.prepareCanvas   s     	Ar.   N)r%   rI   rJ   r
   r#   r   r"   r.   r,   r   r      s    
Hr.   r   c                   4    e Zd Z eddddedddddd	d	
      Zy	)r      r	   r|   1	HelveticarP   autoltrN)rQ   rR   bulletAlign
bulletTypebulletColorrW   rX   bulletOffsetYbulletDedent	bulletDirbulletFormatrh   )r%   rI   rJ   dictr
   r#   r"   r.   r,   r   r      s0    "!*!#!Hr.   r   c                   F    e Zd ZdZd Zd ZefdZd Zd Z	ddZ
d	 Zd
 Zy)r   aG  
    This may or may not be used.  The idea is to:
    
    1. slightly simplify construction of stylesheets;
    
    2. enforce rules to validate styles when added
       (e.g. we may choose to disallow having both
       'heading1' and 'Heading1' - actual rules are
       open to discussion);
       
    3. allow aliases and alternate style lookup
       mechanisms
       
    4. Have a place to hang style-manipulation
       methods (save, load, maybe support a GUI
       editor)
   
    Access is via getitem, so they can be
    compatible with plain old dictionaries.
    c                      i | _         i | _        y r0   )byNamebyAliasr6   s    r,   r-   zStyleSheet1.__init__   s    r.   c                     	 | j                   |   S # t        $ r. 	 | j                  |   cY S # t        $ r t        d|z        w xY ww xY w)Nz"Style '%s' not found in stylesheet)r   KeyErrorr   r*   r2   s     r,   __getitem__zStyleSheet1.__getitem__   s_    	K<<$$ 	KK{{3'' KCcIJJK	Ks    	A,AAAc                 D    	 | |   S # t         $ r |t        k7  r|cY S  w xY wr0   )r   _stylesheet1_undefined)r*   r2   defaults      r,   r?   zStyleSheet1.get   s0    	9 	..w	s    c                 >    || j                   v xs || j                  v S r0   )r   r   r   s     r,   __contains__zStyleSheet1.__contains__   s    dll"8cT[[&88r.   c                 
    || v S r0   r"   r   s     r,   has_keyzStyleSheet1.has_key   s    d{r.   Nc                 B   |j                   }|| j                  v rt        d|z        || j                  v rt        d|z        |r8|| j                  v rt        d|z        || j                  v rt        d|z        || j                  |<   |r|| j                  |<   y y )Nz(Style '%s' already defined in stylesheetz1Style name '%s' is already an alias in stylesheetz1Alias name '%s' is already an alias in stylesheet)r    r   r   r   )r*   stylealiasr2   s       r,   addzStyleSheet1.add   s    jj$++EKLL$,,NQTTUU#IEQRR$RUZZ[[ C"'DLL r.   c                 t    || v r| j                  |      S t        | j                  j                   d|      )Nz instance has no attribute )r?   AttributeErrorr$   r%   )r*   as     r,   __getattr__zStyleSheet1.__getattr__  s:    9TXXa[( 7 788STUSXYZZr.   c                 T   t        | j                  j                               }|j                          i }t        | j                  j                               D ]
  \  }}|||<    |D ]>  \  }}|j                  |d       }t        ||       |j                  d       t                @ y )Nz    )r;   r   r1   r=   r   r?   r:   rB   )r*   stylesaliir   r   r    s         r,   r;   zStyleSheet1.list  s    dkk'')*"4<<#5#5#78NUEDK 9#MT5HHUD)E$OOF#G	 $r.   r0   )r%   rI   rJ   __doc__r-   r   r   r?   r   r   r   r   r;   r"   r.   r,   r   r      s6    *K 4 9("[
r.   r   c                      t        dd       } t        | _        d| _        d| _        | j                          t                t        d|       }d|_        |j                          | |fS )NNormalrP   g,@LiteralCourier)r   rn   rL   rM   rO   rB   r:   )pNormalpPres     r,   
testStylesr     s]    Xd+G$GGGO	G)W-DDMNND=r.   c                     t               } | j                  t        dt        dd             | j                  t        d| d   d             | j                  t        d| d   t        	             | j                  t        d
| d   t
        ddd      d       | j                  t        d| d   t
        ddt        d      d       | j                  t        d| d   t
        dddd      d       | j                  t        d| d   t        dddd      d       | j                  t        d| d   t        dddd      d       | j                  t        d| d   t
        dddd      d        | j                  t        d!| d   t
        d"d#dd$      d%       | j                  t        d&| d   d'd()      d*       | j                  t        d+| d   d'd,d'dt        -      d.       | j                  t        d/| d   d0dd1d'd,d23             | j                  t        d4d5dd'd6d7t        d8dd'd9d:d5d5;      d<       | j                  t        d=d5dd'd6d7t        d8dd'd9d:d5d5;      d>       | S )?zReturns a stylesheet objectr   rN   rP   )r    rL   rM   rO   BodyText   )r    r!   rU   Italic)r    r!   rL   Heading1r      )r    r!   rL   rM   rO   rV   h1)r   Title)r    r!   rL   rM   rO   rT   rV   titleHeading2   )r    r!   rL   rM   rO   rU   rV   h2Heading3h3Heading4   h4Heading5	   g%@   h5Heading6   g @   h6Bulletr	      )r    r!   rS   rU   bu
Definition$   )r    r!   rS   rQ   rY   rU   rW   dfCoder   g!@rH   )r    r!   rL   rM   rO   rS   rQ   r   UnorderedListNr|   r   r   r   r   )r    r!   rQ   rR   r   r   r   rW   rX   r   r   r   r   rh   ulOrderedListol)
r   r   r   rn   _baseFontNameI_baseFontNameBr   _baseFontNameBIr   r
   )
stylesheets    r,   r   r   (  s!   JNN>x+8+-*,.  NN>z)3H)=./1  NN>x)3J)?-;= 
 NN>z)3H)=-;+-*,-.0    NN>w)3H)=-;+-*,,5-.0 !  " NN>z)3H)=-;+-*,.0-.0    NN>z)3H)=-<+-*,.0-.0    NN>z)3H)=-<+-*,.0-.0    NN>z)3H)=-;+,*../-.0    NN>z)3H)=-;+,*-./-.0    NN>x)3H)=23./1 	   NN>|)3H)=23-//0./1@B    NN>v)3H)=+4+,*-23-/246 7 NN9/'++-,-,2+.,1/:/1./-3*/-1&*  !  $ NN9-'++-,-,2+.,1/:/1./-3*/-1&*  !  " r.   N)5__version__r   __all__reportlab.lib.colorsr
   reportlab.lib.enumsr   r   r   r   reportlab.lib.fontsr   reportlab.rl_configr   rn   r   ro   r   rr   r   rs   r   rq   r   rt   r   ru   r   rp   r   rv   r   rw   r   _hyphenationMinWordLengthr   ry   r   rx   r   r   r   r   r   r   r   r   r   objectr   r   r   r   r"   r.   r,   <module>r      s    		
 ' H H %L L L L }Qq)}Qq)a*; ;z2
[ 2
h !&&"(	*       O ObLr.   