
    (h5F                       S r SSKrSSKrSSKrSSKrSSKJr  SSKJr  SSK	J
r
  SSKJrJrJr  SSKJrJrJrJrJrJrJr  SS	KJrJr  SS
KJr  SS0rS r\S 5       r\\\ \RB                  4   r"\\ \RB                  4r#\$" S5      r% \$" S5      r& \$" S5      r' \RP                  " S5      r)SSSSSSSSS.r* " S S\5      r+SS jr,S r-S  r. " S! S"\" S"S#\"4S$\"4S%\"4S&\\"   4/5      5      r/S\S''   S(\S)'   S*\S+'   S,\S-'   S.\S/'    " S0 S1\" S1S$\"4S&\\"   4/5      5      r0S\S2'   S3\S4'   S.\S5'    " S6 S7\" S7S8\"4S9\"4S:\"4S;\"4S&\\"   4/5      5      r1S\S<'   S=\S>'   S?\S@'   SA\SB'   SC\SD'   S.\SE'   SSF jr2SSG jr3SSH jr4SSI jr5SJ r6SK r7 " SL SM\5      r8 " SN SO\5      r9S\SP'   S\SQ'   S\SR'   S\SS'   S\ST'   S\SU'    " SV SW5      r:SX r;SY r<SZ r= " S[ S\\5      r> " S] S^\5      r? " S_ S`\5      r@ " Sa Sb\5      rA " Sc Sd\5      rB " Se Sf\5      rC " Sg Sh\5      rD " Si Sj\5      rE " Sk Sl\5      rF " Sm Sn\5      rG " So Sp\5      rH " Sq Sr\5      rI " Ss St\5      rJ " Su Sv\5      rK " Sw Sx\5      rL " Sy Sz\5      rM " S{ S|\5      rN " S} S~\5      rO " S S\5      rP " S S5      rQ " S S5      rR " S S\R5      rS " S S5      rTg)a
  
Vector drawing: managing colors, graphics states, paths, transforms...

The contents of this module are internal to fpdf2, and not part of the public API.
They may change at any time without prior warning or any deprecation period,
in non-backward-compatible ways.
    N)OrderedDict)Sequence)contextmanager)Optional
NamedTupleUnion   )	BlendModeClippingPathIntersectionRuleIntersectionRulePathPaintRuleStrokeCapStyleStrokeJoinStylePDFStyleKeys)NameRaw)escape_parensforce_nodocumentFc                 ,    S[         U R                  '   U $ )zQA decorator that forces pdoc not to document the decorated item (class or method)F__pdoc____qualname__items    HC:\Users\13-19\Desktop\PokeDex\pokedex\Lib\site-packages\fpdf/drawing.pyr   r      s    "'HTK    c                 ,    S[         U R                  '   U $ )zMA decorator that forces pdoc to document the decorated item (class or method)Tr   r   s    r   force_documentr   %   s     #'HTKr   z 	
 z
z
()<>[]{}/%z[\n\r\t\b\f()\\]z\nz\rz\tz\bz\fz\(z\)z\\)
	()\c                   "    \ rS rSrSrSS jrSrg)GraphicsStateDictRegistryF   zR
A container providing deduplication of graphics state dictionaries across a PDF.
c                     UR                  5       nU(       d  g  X   $ ! [         a     Of = f[        S[        U 5       35      nX0U'   U$ )NGS)	serializeKeyErrorr   len)selfstylesdictnames       r   register_style(GraphicsStateDictRegistry.register_styleK   sX    ! 	; 		 bT$%Us    
++ N)r0   GraphicsStyle)__name__
__module__r   __firstlineno____doc__r3   __static_attributes__r5   r   r   r(   r(   F   s    r   r(   c                 J    Xs=::  a  U::  d  O  [        U  SU SU S35      eU $ )Nz not in range [z, ])
ValueError)valueminimummaximums      r   _check_rangerB   ]   s0    &w&E7/'"WIQGHHLr   c                 F    U S R                  S5      R                  S5      $ )z
Convert a decimal number to a minimal string representation (no trailing 0 or .).

Args:
    number (Number): the number to be converted to a string.

Returns:
    The number's string representation.
z.4f0.)rstrip)numbers    r   number_to_strrH   d   s$     S\!!#&--c22r   c                    [        U [        5      (       a  U $ [        [        U SS5      5      (       a  U R	                  5       nGOpU c  SnGOi[        U [
        5      (       a  S[        U 5       S3nGOC[        U [        5      (       a  SU R                  5        S3nGO[        U [        5      (       a  SS	/U    nO[        U [        5      (       a  [        U 5      nO[        U [        [        45      (       a  S
SR                  S U  5       5      -   S-   nO[        U [        5      (       a|  / nU R!                  5        HN  u  p4[        U["        5      (       d  [%        S5      eUR'                  [)        U5      S-   [)        U5      -   5        MP     SSR                  U5      -   S-   nO[+        SU < 35      e[        U5      $ )a  
Render a Python value as a PDF primitive type.

Container types (tuples/lists and dicts) are rendered recursively. This supports
values of the type Name, str, bytes, numbers, booleans, list/tuple, and dict.

Any custom type can be passed in as long as it provides a `serialize` method that
takes no arguments and returns a string. The primitive object is returned directly
if it is an instance of the `Raw` class. Otherwise, The existence of the `serialize`
method is checked before any other type checking is performed, so, for example, a
`dict` subclass with a `serialize` method would be converted using its `pdf_repr`
method rather than the built-in `dict` conversion process.

Args:
    primitive: the primitive value to convert to its PDF representation.

Returns:
    Raw-wrapped str of the PDF representation.

Raises:
    ValueError: if a dictionary key is not a Name.
    TypeError: if `primitive` does not have a known conversion to a PDF
        representation.
r,   Nnullr$   r%   <>falsetrue[ c              3   8   #    U  H  n[        U5      v   M     g 7fN)render_pdf_primitive.0vals     r   	<genexpr>'render_pdf_primitive.<locals>.<genexpr>   s     OYc 4S 9 9Y   r=   zdict keys must be Namesz<< r   z >>z,cannot produce PDF representation for value )
isinstancer   callablegetattrr,   strr   byteshexboolNumberClassrH   listtuplejoindictitemsr   r>   appendrS   	TypeError)	primitiveoutput	item_listkeyrV   s        r   rS   rS   t   s   4 )S!!	;566$$&			Is	#	#]9-.a0	Iu	%	%Y]]_%Q'	It	$	$6"9-	I{	+	+y)	Ie}	-	-sxxOYOOORUU	It	$	$	!)HCc4(( !:;;$S)C/2Fs2KK	 * 9--5FymTUUv;r   c                   d   ^  \ rS rSrSrSr S
U 4S jjr\S 5       r\S 5       r	S\
4S jrS	rU =r$ )	DeviceRGB   z+A class representing a PDF DeviceRGB color.rgc                 |   > Ub  [        U5        [        TU ]	  U [        U5      [        U5      [        U5      U5      $ rR   rB   super__new__)clsrgba	__class__s        r   rt   DeviceRGB.__new__   s7    =Owa,q/<?A
 	
r   c                     U SS $ )zVThe color components as a tuple in order `(r, g, b)` with alpha omitted, in range 0-1.Nr5   r/   s    r   colorsDeviceRGB.colors        CRyr   c                 :    [        S U R                   5       5      $ )XThe color components as a tuple in order `(r, g, b)` with alpha omitted, in range 0-255.c              3   ,   #    U  H
  nS U-  v   M     g7f   Nr5   rU   vs     r   rW   &DeviceRGB.colors255.<locals>.<genexpr>        2kS1Wk   rc   r   r~   s    r   	colors255DeviceRGB.colors255        2dkk222r   returnc                 f    SR                  S U R                   5       5      SU R                   3-   $ )NrP   c              3   8   #    U  H  n[        U5      v   M     g 7frR   rH   rT   s     r   rW   &DeviceRGB.serialize.<locals>.<genexpr>        Bksc**krY   rd   r   OPERATORr~   s    r   r,   DeviceRGB.serialize   +    xxBdkkBBqEXXXr   r5   rR   r7   r8   r   r9   r:   r   rt   propertyr   r   r]   r,   r;   __classcell__rz   s   @r   rn   rn      sS     6  HF
   3 3Y3 Y Yr   rn   rv   rw   rx   ry   zDeviceRGB.OPERATORz8The red color component. Must be in the interval [0, 1].zDeviceRGB.rz:The green color component. Must be in the interval [0, 1].zDeviceRGB.gz9The blue color component. Must be in the interval [0, 1].zDeviceRGB.baD  
The alpha color component (i.e. opacity). Must be `None` or in the interval [0, 1].

An alpha value of 0 makes the color fully transparent, and a value of 1 makes it fully
opaque. If `None`, the color will be interpreted as not specifying a particular
transparency rather than specifying fully transparent or fully opaque.
zDeviceRGB.ac                   d   ^  \ rS rSrSrSr S
U 4S jjr\S 5       r\S 5       r	S\
4S jrS	rU =r$ )
DeviceGray   z,A class representing a PDF DeviceGray color.rw   c                 T   > Ub  [        U5        [        TU ]	  U [        U5      U5      $ rR   rr   )ru   rw   ry   rz   s      r   rt   DeviceGray.__new__  s&    =OwsLOQ77r   c                 H    U R                   U R                   U R                   4$ )zTThe color components as a tuple in order (r, g, b) with alpha omitted, in range 0-1.)rw   r~   s    r   r   DeviceGray.colors  s     vvtvvtvv%%r   c                 :    [        S U R                   5       5      $ )r   c              3   ,   #    U  H
  nS U-  v   M     g7fr   r5   r   s     r   rW   'DeviceGray.colors255.<locals>.<genexpr>  r   r   r   r~   s    r   r   DeviceGray.colors255  r   r   r   c                 J    [        U R                  5       SU R                   3$ )NrP   )rH   rw   r   r~   s    r   r,   DeviceGray.serialize  s!    '($--99r   r5   rR   r   r   s   @r   r   r      sN     7HF8 & & 3 3:3 : :r   r   zDeviceGray.OPERATORz}
The gray color component. Must be in the interval [0, 1].

A value of 0 represents black and a value of 1 represents white.
zDeviceGray.gzDeviceGray.ac                   T   ^  \ rS rSrSrSr S	U 4S jjr\S 5       rS\	4S jr
SrU =r$ )

DeviceCMYKi+  z,A class representing a PDF DeviceCMYK color.kc           	         > Ub  [        U5        [        TU ]	  U [        U5      [        U5      [        U5      [        U5      U5      $ rR   rr   )ru   cmyr   ry   rz   s         r   rt   DeviceCMYK.__new__<  s?    =Owa,q/<?LQROUV
 	
r   c                     U SS $ )zWThe color components as a tuple in order (c, m, y, k) with alpha omitted, in range 0-1.Nr}   r5   r~   s    r   r   DeviceCMYK.colorsD  r   r   r   c                 f    SR                  S U R                   5       5      SU R                   3-   $ )NrP   c              3   8   #    U  H  n[        U5      v   M     g 7frR   r   rT   s     r   rW   'DeviceCMYK.serialize.<locals>.<genexpr>J  r   rY   r   r~   s    r   r,   DeviceCMYK.serializeI  r   r   r5   rR   )r7   r8   r   r9   r:   r   rt   r   r   r]   r,   r;   r   r   s   @r   r   r   +  s=     7HF
  Y3 Y Yr   r   r   r   r   r   zDeviceCMYK.OPERATORz9The cyan color component. Must be in the interval [0, 1].zDeviceCMYK.cz<The magenta color component. Must be in the interval [0, 1].zDeviceCMYK.mz;The yellow color component. Must be in the interval [0, 1].zDeviceCMYK.yz:The black color component. Must be in the interval [0, 1].zDeviceCMYK.kzDeviceCMYK.ac                 |    Uc  Xs=:X  a  U:X  a  O  O[        U S-  5      $ OUS-  n[        U S-  US-  US-  U5      $ )a   
Produce a DeviceRGB color from the given 8-bit RGB values.

Args:
    r (Number): red color component. Must be in the interval [0, 255].
    g (Number): green color component. Must be in the interval [0, 255].
    b (Number): blue color component. Must be in the interval [0, 255].
    a (Optional[Number]): alpha component. Must be `None` or in the interval
        [0, 255]. 0 is fully transparent, 255 is fully opaque

Returns:
    DeviceRGB color representation.

Raises:
    ValueError: if any components are not in their valid interval.
     o@)r   rn   )rv   rw   rx   ry   s       r   rgb8r   _  sN    " 	y;Q;a%i((  	
U
QYE	1u9a88r   c                 0    Ub  US-  n[        U S-  U5      $ )a  
Produce a DeviceGray color from the given 8-bit gray value.

Args:
    g (Number): gray color component. Must be in the interval [0, 255]. 0 is black,
        255 is white.
    a (Optional[Number]): alpha component. Must be `None` or in the interval
        [0, 255]. 0 is fully transparent, 255 is fully opaque

Returns:
    DeviceGray color representation.

Raises:
    ValueError: if any components are not in their valid interval.
r   )r   )rw   ry   s     r   gray8r   y  s#      	}	U
a%i##r   c                 J   [        U [        [        [        45      (       a  U $ [        U [        5      (       a!  U R                  S5      (       a  [        U 5      $ [        U [        5      (       a  U u  pnXU4S:X  d  US:X  a  [        U S-  5      $ [        U S-  US-  US-  5      $ )N#)r   r   r   r}   r   )rZ   r   r   rn   r]   
startswithcolor_from_hex_stringr   )rv   rw   rx   s      r   convert_to_device_colorr     s    !j*i899!Sall3//$Q''!Xa	ayIb!c'""QWa#gq3w//r   c                 H    Ub  US-  n[        U S-  US-  US-  US-  U5      $ )ak  
Produce a DeviceCMYK color from the given 8-bit CMYK values.

Args:
    c (Number): red color component. Must be in the interval [0, 255].
    m (Number): green color component. Must be in the interval [0, 255].
    y (Number): blue color component. Must be in the interval [0, 255].
    k (Number): blue color component. Must be in the interval [0, 255].
    a (Optional[Number]): alpha component. Must be `None` or in the interval
        [0, 255]. 0 is fully transparent, 255 is fully opaque

Returns:
    DeviceCMYK color representation.

Raises:
    ValueError: if any components are not in their valid interval.
r   )r   )r   r   r   r   ry   s        r   cmyk8r     s5    $ 	}	U
a%iUAIq5y!DDr   c                    [        U [        5      (       d  [        U  S35      eU R                  S5      (       d  [	        U  S35      e[        U 5      nUS:X  a*  [        U SS  Vs/ s H  n[        US-  SS	9PM     snS
S06$ US:X  a'  [        U SS  Vs/ s H  n[        US-  SS	9PM     sn6 $ US:X  a4  [        [        SUS5       Vs/ s H  n[        XUS-    SS	9PM     snS
S06$ US:X  a1  [        [        SUS5       Vs/ s H  n[        XUS-    SS	9PM     sn6 $ [	        U  S35      es  snf s  snf s  snf s  snf )a  
Parse an RGB color from a css-style 8-bit hexadecimal color string.

Args:
    hexstr (str): of the form `#RGB`, `#RGBA`, `#RRGGBB`, or `#RRGGBBAA` (case
        insensitive). Must include the leading octothorp. Forms omitting the alpha
        field are interpreted as not specifying the opacity, so it will not be
        explicitly set.

        An alpha value of `00` is fully transparent and `FF` is fully opaque.

Returns:
    DeviceRGB representation of the color.
 is not of type strr   z does not start with #   r	   N      )basery         	   z0 could not be interpreted as a RGB(A) hex string)	rZ   r]   rh   r   r>   r.   r   intrange)hexstrhlencharidxs       r   r   r     sm    fc""6("5677S!!F8#9:;;v;DqyDc$(,DMMMqyDc$(,DEEqy=B1dA=NO=Ncc&sQw'b1=NO
SW
 	
 qyU1dTUEVWEVcc&sQw/b9EVWXX
xOP
QQ E E P Xs   %D/D4
D9D>c                    [        U [        5      (       d  [        U  S35      eU R                  SS5      n U R	                  S5      (       a  U R                  S5      (       d  [        U  S35      eU SS n U R                  S	5      n[        U5      S
:X  a%  [        U Vs/ s H  n[        U5      PM     snSS06$ [        U5      S:X  a"  [        U Vs/ s H  n[        U5      PM     sn6 $ [        U  S35      es  snf s  snf )z
Parse an RGB color from a css-style rgb(R, G, B, A) color string.

Args:
    rgbstr (str): of the form `rgb(R, G, B)` or `rgb(R, G, B, A)`.

Returns:
    DeviceRGB representation of the color.
r   rP    zrgb(r%   z- does not follow the expected rgb(...) formatr   r}   ,   ry   Nz6 could not be interpreted as a rgb(R, G, B[, A]) color)rZ   r]   rh   replacer   endswithr>   splitr.   r   r   )rgbstrr   r   s      r   color_from_rgb_stringr     s     fc""6("5677^^C$FV$$FOOC,@,@F8#PQRRAb\F\\#F
6{af-fc!ff-666
6{af-fc!ff-..
xUV
WW . .s   C9C>c                       \ rS rSr% Sr\\S'    \\S'    S rS rS r	S r
\S	 5       r\S
 5       r\S 5       r\S 5       r\r\S 5       r\S 5       r\S 5       rS rSrg)Pointi  zE
An x-y coordinate pair within the two-dimensional coordinate frame.
xr   c                 \    [        U R                  5       S[        U R                  5       3$ )z=Render the point to the string `"x y"` for emitting to a PDF.rP   rH   r   r   r~   s    r   renderPoint.render  s)      '(-*?)@AAr   c                     [        U[        5      (       d  [        SU< 35      eU R                  UR                  -  U R                  UR                  -  -   $ )z
Compute the dot product of two points.

Args:
    other (Point): the point with which to compute the dot product.

Returns:
    The scalar result of the dot product computation.

Raises:
    TypeError: if `other` is not a `Point`.
zcannot dot with )rZ   r   rh   r   r   r/   others     r   dot	Point.dot
  sI     %''.ui899vv$&&577"222r   c           	      n   [        U[        5      (       d  [        SU< 35      eU R                  UR                  -  U R                  UR                  -  -
  nUS:  US:  -
  nU[
        R                  " [        U R                  U5      U R                  5       UR                  5       -  -  S5      5      -  $ )a}  
Compute the angle between two points (interpreted as vectors from the origin).

The return value is in the interval (-pi, pi]. Sign is dependent on ordering,
with clockwise angle travel considered to be positive due to the orientation of
the coordinate frame basis vectors (i.e. the angle between `(1, 0)` and `(0, 1)`
is `+pi/2`, the angle between `(1, 0)` and `(0, -1)` is `-pi/2`, and the angle
between `(0, -1)` and `(1, 0)` is `+pi/2`).

Args:
    other (Point): the point to compute the angle sweep toward.

Returns:
    The scalar angle between the two points **in radians**.

Raises:
    TypeError: if `other` is not a `Point`.
zcannot compute angle with r      )
rZ   r   rh   r   r   mathacosroundr   mag)r/   r   	signifiersigns       r   anglePoint.angle  s    ( %''8	BCCVVegg%$&&577*:;	Q9q=1diidhhuoeiik9Q&RTU VWWWr   c                 F    U R                   S-  U R                  S-  -   S-  $ )z
Compute the Cartesian distance from this point to the origin

This is the same as computing the magnitude of the vector represented by this
point.

Returns:
    The scalar result of the distance computation.
r         ?r   r   r~   s    r   r   	Point.mag7  s$     	DFFAI%#--r   c                     [        U[        5      (       a8  [        U R                  UR                  -   U R                  UR                  -   S9$ [        $ )a.  
Produce the sum of two points.

Adding two points is the same as translating the source point by interpreting
the other point's x and y coordinates as distances.

Args:
    other (Point): right-hand side of the infix addition operation

Returns:
    A Point which is the sum of the two source points.
r   rZ   r   r   r   NotImplementedr   s     r   __add__Point.__add__D  s>     eU##466EGG+tvv/?@@r   c                     [        U[        5      (       a8  [        U R                  UR                  -
  U R                  UR                  -
  S9$ [        $ )z
Produce the difference between two points.

Unlike addition, this is not a commutative operation!

Args:
    other (Point): right-hand side of the infix subtraction operation

Returns:
    A Point which is the difference of the two source points.
r   r   r   s     r   __sub__Point.__sub__W  s>     eU##466EGG+tvv/?@@r   c                 B    [        U R                  * U R                  * S9$ )z
Produce a point by negating this point's coordinates.

Returns:
    A Point whose coordinates are this points coordinates negated.
r   )r   r   r   r~   s    r   __neg__Point.__neg__i  s     w466'**r   c                     [        U[        5      (       a&  [        U R                  U-  U R                  U-  5      $ [
        $ )z
Multiply a point by a scalar value.

Args:
    other (Number): the scalar value by which to multiply the point's
        coordinates.

Returns:
    A Point whose coordinates are the result of the multiplication.
rZ   ra   r   r   r   r   r   s     r   __mul__Point.__mul__s  s4     e[))%%88r   c                     [        U[        5      (       a&  [        U R                  U-  U R                  U-  5      $ [
        $ )aV  
Divide a point by a scalar value.

.. note::

    Because division is not commutative, `Point / scalar` is implemented, but
    `scalar / Point` is nonsensical and not implemented.

Args:
    other (Number): the scalar value by which to divide the point's coordinates.

Returns:
    A Point whose coordinates are the result of the division.
r  r   s     r   __truediv__Point.__truediv__  s4      e[))%%88r   c                     [        U[        5      (       a&  [        U R                  U-  U R                  U-  5      $ [
        $ )ao  
Divide a point by a scalar value using integer division.

.. note::

    Because division is not commutative, `Point // scalar` is implemented, but
    `scalar // Point` is nonsensical and not implemented.

Args:
    other (Number): the scalar value by which to divide the point's coordinates.

Returns:
    A Point whose coordinates are the result of the division.
r  r   s     r   __floordiv__Point.__floordiv__  s4      e[))5$&&E/::r   c                 D   [        U[        5      (       a  [        UR                  U R                  -  UR
                  U R                  -  -   UR                  -   UR                  U R                  -  UR                  U R                  -  -   UR                  -   S9$ [        $ )ad  
Transform a point with the given transform matrix.

.. note::
    This operator is only implemented for Transforms. This transform is not
    commutative, so `Point @ Transform` is implemented, but `Transform @ Point`
    is not implemented (technically speaking, the current implementation is
    commutative because of the way points and transforms are represented, but
    if that representation were to change this operation could stop being
    commutative)

Args:
    other (Transform): the transform to apply to the point

Returns:
    A Point whose coordinates are the result of applying the transform.
r   )rZ   	Transformr   ry   r   r   r   erx   dfr   r   s     r   
__matmul__Point.__matmul__  s|    & eY''''DFF"UWWtvv%55?''DFF"UWWtvv%55? 
 r   c                 `    S[        U R                  5       S[        U R                  5       S3$ )Nz(x=z, y=r%   r   r~   s    r   __str__Point.__str__  s+    ]466*+4dff0E/FaHHr   r5   N)r7   r8   r   r9   r:   Number__annotations__r   r   r   r   r   r   r   r   r  __rmul__r  r
  r  r  r;   r5   r   r   r   r     s     I$I$B
3$X6.  $  " + +    H (  ,  4Ir   r   c                      \ rS rSr% Sr\\S'   \\S'   \\S'   \\S'   \\S'   \\S'   \S	 5       r\S
 5       r	\SS j5       r
\S 5       r\S 5       r\SS j5       rS rSS jrS rS rSS jrS r\S 5       r\r\S 5       rS rS rSrg)r  i  a  
A representation of an affine transformation matrix for 2D shapes.

The actual matrix is:

```
                    [ a b 0 ]
[x' y' 1] = [x y 1] [ c d 0 ]
                    [ e f 1 ]
```

Complex transformation operations can be composed via a sequence of simple
transformations by performing successive matrix multiplication of the simple
transformations.

For example, scaling a set of points around a specific center point can be
represented by a translation-scale-translation sequence, where the first
translation translates the center to the origin, the scale transform scales the
points relative to the origin, and the second translation translates the points
back to the specified center point. Transform multiplication is performed using
python's dedicated matrix multiplication operator, `@`

The semantics of this representation mean composed transformations are specified
left-to-right in order of application (some other systems provide transposed
representations, in which case the application order is right-to-left).

For example, to rotate the square `(1,1) (1,3) (3,3) (3,1)` 45 degrees clockwise
about its center point (which is `(2,2)`) , the translate-rotate-translate
process described above may be applied:

```python
rotate_centered = (
    Transform.translation(-2, -2)
    @ Transform.rotation_d(45)
    @ Transform.translation(2, 2)
)
```

Instances of this class provide a chaining API, so the above transform could also be
constructed as follows:

```python
rotate_centered = Transform.translation(-2, -2).rotate_d(45).translate(2, 2)
```

Or, because the particular operation of performing some transformations about a
specific point is pretty common,

```python
rotate_centered = Transform.rotation_d(45).about(2, 2)
```

By convention, this class provides class method constructors following noun-ish
naming (`translation`, `scaling`, `rotation`, `shearing`) and instance method
manipulations following verb-ish naming (`translate`, `scale`, `rotate`, `shear`).
ry   rx   r   r  r  r  c                     U " SSSSSS5      $ )z]
Create a transform representing the identity transform.

The identity transform is a no-op.
r	   r   r5   )ru   s    r   identityTransform.identity  s     1aAq!$$r   c                     U " SSSSX5      $ )a  
Create a transform that performs translation.

Args:
    x (Number): distance to translate points along the x (horizontal) axis.
    y (Number): distance to translate points along the y (vertical) axis.

Returns:
    A Transform representing the specified translation.
r	   r   r5   ru   r   r   s      r   translationTransform.translation"  s     1aAq$$r   Nc                 &    Uc  UnU " USSUSS5      $ )a  
Create a transform that performs scaling.

Args:
    x (Number): scaling ratio in the x (horizontal) axis. A value of 1
        results in no scale change in the x axis.
    y (Number): optional scaling ratio in the y (vertical) axis. A value of 1
        results in no scale change in the y axis. If this value is omitted, it
        defaults to the value provided to the `x` argument.

Returns:
    A Transform representing the specified scaling.
r   r5   r  s      r   scalingTransform.scaling1  s#     9A1aAq!$$r   c                     U " [         R                  " U5      [         R                  " U5      [         R                  " U5      * [         R                  " U5      SS5      $ )z
Create a transform that performs rotation.

Args:
    theta (Number): the angle **in radians** by which to rotate. Positive
        values represent clockwise rotations.

Returns:
    A Transform representing the specified rotation.

r   )r   cossin)ru   thetas     r   rotationTransform.rotationE  sC     HHUOTXXe_txx.>QRTU
 	
r   c                 L    U R                  [        R                  " U5      5      $ )z
Create a transform that performs rotation **in degrees**.

Args:
    theta_d (Number): the angle **in degrees** by which to rotate. Positive
        values represent clockwise rotations.

Returns:
    A Transform representing the specified rotation.

)r(  r   radians)ru   theta_ds     r   
rotation_dTransform.rotation_dV  s     ||DLL122r   c                 $    Uc  UnU " SX!SSS5      $ )aX  
Create a transform that performs shearing (not of sheep).

Args:
    x (Number): The amount to shear along the x (horizontal) axis.
    y (Number): Optional amount to shear along the y (vertical) axis. If omitted,
        this defaults to the value provided to the `x` argument.

Returns:
    A Transform representing the specified shearing.

r	   r   r5   r  s      r   shearingTransform.shearinge  s!     9A1aAq!$$r   c                 2    U [         R                  X5      -  $ )a  
Produce a transform by composing the current transform with a translation.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    x (Number): distance to translate points along the x (horizontal) axis.
    y (Number): distance to translate points along the y (vertical) axis.

Returns:
    A Transform representing the composed transform.
r  r  r/   r   r   s      r   	translateTransform.translatew  s     i++A111r   c                 2    U [         R                  X5      -  $ )aH  
Produce a transform by composing the current transform with a scaling.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    x (Number): scaling ratio in the x (horizontal) axis. A value of 1
        results in no scale change in the x axis.
    y (Number): optional scaling ratio in the y (vertical) axis. A value of 1
        results in no scale change in the y axis. If this value is omitted, it
        defaults to the value provided to the `x` argument.

Returns:
    A Transform representing the composed transform.
)r  r"  r4  s      r   scaleTransform.scale  s    $ i''---r   c                 2    U [         R                  U5      -  $ )ao  
Produce a transform by composing the current transform with a rotation.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    theta (Number): the angle **in radians** by which to rotate. Positive
        values represent clockwise rotations.

Returns:
    A Transform representing the composed transform.
)r  r(  )r/   r'  s     r   rotateTransform.rotate  s     i((///r   c                 2    U [         R                  U5      -  $ )a  
Produce a transform by composing the current transform with a rotation
**in degrees**.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    theta_d (Number): the angle **in degrees** by which to rotate. Positive
        values represent clockwise rotations.

Returns:
    A Transform representing the composed transform.
)r  r-  )r/   r,  s     r   rotate_dTransform.rotate_d  s      i**7333r   c                 2    U [         R                  X5      -  $ )a  
Produce a transform by composing the current transform with a shearing.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    x (Number): The amount to shear along the x (horizontal) axis.
    y (Number): Optional amount to shear along the y (vertical) axis. If omitted,
        this defaults to the value provided to the `x` argument.

Returns:
    A Transform representing the composed transform.
)r  r0  r4  s      r   shearTransform.shear  s      i((...r   c                 d    [         R                  U* U* 5      U -  [         R                  X5      -  $ )aM  
Bracket the given transform in a pair of translations to make it appear about a
point that isn't the origin.

This is a useful shorthand for performing a transform like a rotation around the
center point of an object that isn't centered at the origin.

.. note::
    Transforms are immutable, so this returns a new transform rather than
    mutating self.

Args:
    x (Number): the point along the x (horizontal) axis about which to transform.
    y (Number): the point along the y (vertical) axis about which to transform.

Returns:
    A Transform representing the composed transform.
r3  r4  s      r   aboutTransform.about  s0    & $$aR!,t3i6K6KA6QQQr   c           	          [        U[        5      (       a\  [        U R                  U-  U R                  U-  U R
                  U-  U R                  U-  U R                  U-  U R                  U-  S9$ [        $ )z
Multiply the individual transform parameters by a scalar value.

Args:
    other (Number): the scalar value by which to multiply the parameters

Returns:
    A Transform with the modified parameters.
ry   rx   r   r  r  r  )
rZ   ra   r  ry   rx   r   r  r  r  r   r   s     r   r  Transform.__mul__  sh     e[))&&5.&&5.&&5.&&5.&&5.&&5.  r   c           
         [        U[        5      (       GaT  U R                  U R                  UR                  -  U R                  UR
                  -  -   U R                  UR                  -  U R                  UR                  -  -   U R
                  UR                  -  U R                  UR
                  -  -   U R
                  UR                  -  U R                  UR                  -  -   U R                  UR                  -  U R                  UR
                  -  -   UR                  -   U R                  UR                  -  U R                  UR                  -  -   UR                  -   S9$ [        $ )z
Compose two transforms into a single transform.

Args:
    other (Transform): the right-hand side transform of the infix operator.

Returns:
    A Transform representing the composed transform.
rG  )
rZ   r  rz   ry   rx   r   r  r  r  r   r   s     r   r  Transform.__matmul__   s    eY''>>&&577"TVVegg%55&&577"TVVegg%55&&577"TVVegg%55&&577"TVVegg%55&&577"TVVegg%55?&&577"TVVegg%55? "   r   c                    [        U R                  5       S[        U R                  5       S[        U R                  5       S[        U R                  5       S[        U R
                  5       S[        U R                  5       S3U4$ )z
Render the transform to its PDF output representation.

Args:
    last_item: the last path element this transform applies to

Returns:
    A tuple of `(str, last_item)`. `last_item` is returned unchanged.
rP   z cmrH   ry   rx   r   r  r  r  )r/   	last_items     r   r   Transform.render  s|     TVV$%Q}TVV'<&=QTVV$%Q}TVV'<&=QTVV$%Q}TVV'<&=SB 	
 	
r   c                    S[        U R                  5       S[        U R                  5       S[        U R                  5       S[        U R                  5       S[        U R
                  5       S[        U R                  5       S3$ )Nztransform: [rP   z 0; z 1]rL  r~   s    r   r  Transform.__str__(  ss    TVV$%Q}TVV'<&=TTVV$%Q}TVV'<&=TTVV$%Q}TVV'<&=SB	
r   r5   rR   )r7   r8   r   r9   r:   r  r  classmethodr  r  r"  r(  r-  r0  r5  r8  r;  r>  rA  rD  r   r  r  r  r   r  r;   r5   r   r   r  r    s    7r IIIIII % % % % % %& 
 
  3 3 % %"2".(0"4$/$R*  . H ,
"
r   r  zTransform.azTransform.bzTransform.czTransform.dzTransform.ezTransform.fc                     ^  \ rS rSrSrSr Sr \R                  R                  \R                  R                  \R                  R                  4r / S \ 5       Q7r \" 0 5      \R                   \" S15      \R"                  \" S\R&                  15      \R(                  \" S\R*                  15      \R,                  \" SS\R&                  15      \R.                  \" SS\R*                  15      \R0                  0r \S 5       rS	 rS
 rU 4S jr\S 5       r \ RB                  U 4S j5       r \S 5       r"\"RB                  U 4S j5       r"\S 5       r#\#RB                  U 4S j5       r#\S 5       r$\$RB                  U 4S j5       r$\S 5       r%\%RB                  U 4S j5       r%\S 5       r&\&RB                  U 4S j5       r&\S 5       r'\'RB                  U 4S j5       r'\S 5       r(\(RB                  U 4S j5       r(\S 5       r)\)RB                  U 4S j5       r)\S 5       r*\*RB                  U 4S j5       r*\S  5       r+\+RB                  U 4S! j5       r+\S" 5       r,\,RB                  U 4S# j5       r,\S$ 5       r-\-RB                  U 4S% j5       r-\S& 5       r.\.RB                  U 4S' j5       r.\S( 5       r/\/RB                  U 4S) j5       r/S* r0\1S+ 5       r2S,r3U =r4$ )-r6   i9  a  
A class representing various style attributes that determine drawing appearance.

This class uses the convention that the global Python singleton ellipsis (`...`) is
exclusively used to represent values that are inherited from the parent style. This
is to disambiguate the value None which is used for several values to signal an
explicitly disabled style. An example of this is the fill/stroke color styles,
which use None as hints to the auto paint style detection code.
.)
paint_ruleallow_transparency
auto_closeintersection_rule
fill_colorfill_opacitystroke_colorstroke_opacity
blend_modestroke_widthstroke_cap_stylestroke_join_stylestroke_miter_limitstroke_dash_patternstroke_dash_phasec              #   b   #    U  H%  o[         R                  Ld  M  UR                  v   M'     g 7frR   )r   STROKE_DASH_PATTERNr?   )rU   r   s     r   rW   GraphicsStyle.<genexpr>d  s!     	U<aL4T4T+T'!''<s   //strokefillc           	          U " 5       nU R                    H?  n[        X$5      nXPR                  L a  [        X4[        X5      5        M3  [        X4U5        MA     U$ )a  
Merge parent and child into a single GraphicsStyle.

The result contains the properties of the parent as overridden by any properties
explicitly set on the child. If both the parent and the child specify to
inherit a given property, that property will preserve the inherit value.
)MERGE_PROPERTIESr\   INHERITsetattr)ru   parentchildnewpropcvals         r   mergeGraphicsStyle.mergev  sO     e((D5'D{{"76#894( ) 
r   c                    U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l	        U R                   U l
        U R                   U l        U R                   U l        U R                   U l        U R                   U l        U R                   U l        g rR   )ri  rT  rS  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  r~   s    r   __init__GraphicsStyle.__init__  s    "&,,,,,,!%,, LL LL"ll,, LL $!%"&,,#'<< !%r   c           	      v    U R                  5       nU R                   H  n[        X#[        X5      5        M     U$ rR   )rz   rh  rj  r\   )r/   memocopiedrn  s       r   __deepcopy__GraphicsStyle.__deepcopy__  s4    !))DF'$"56 * r   c                    > [        U R                  U5      (       d  [        U R                   SU S35      e[        TU ]  X5        g )Nz does not have style "z" (a typo?))hasattrrz   AttributeErrorrs   __setattr__)r/   r2   r?   rz   s      r   r}  GraphicsStyle.__setattr__  sF    t~~t,, >>""8kJ  	D(r   c                     U R                   $ rR   )_allow_transparencyr~   s    r   rT   GraphicsStyle.allow_transparency  s    '''r   c                 $   > [         TU ]  SU5      $ )Nr  )rs   r}  r/   rm  rz   s     r   rT  r    s    w"#8#>>r   c                     U R                   $ )z*The paint rule to use for this path/group.)_paint_ruler~   s    r   rS  GraphicsStyle.paint_rule       r   c                    > Uc  [         TU ]  S[        R                  5        g XR                  L a  [         TU ]  SU5        g [         TU ]  S[        R
                  " U5      5        g )Nr  )rs   r}  r   
DONT_PAINTri  coercer  s     r   rS  r    sP    ;G}/G/GHLL Gs3G}/C/CC/HIr   c                     U R                   $ )zEIf True, unclosed paths will be automatically closed before stroking.)_auto_closer~   s    r   rU  GraphicsStyle.auto_close  r  r   c                 h   > USSU R                   1;  a  [        SU 35      e[        TU ]  SU5        g )NTFz/auto_close must be a bool or self.INHERIT, not r  )ri  rh   rs   r}  r  s     r   rU  r    s8    tUDLL11McUSTTM3/r   c                     U R                   $ )z2The desired intersection rule for this path/group.)_intersection_ruler~   s    r   rV  GraphicsStyle.intersection_rule       &&&r   c                    > XR                   L a  [        TU ]	  SU5        g [        TU ]	  S[        R                  " U5      5        g )Nr  )ri  rs   r}  r   r  r  s     r   rV  r    s;     ,,G 4c:G 46F6M6Mc6RSr   c                     U R                   $ )z
The desired fill color for this path/group.

When setting this property, if the color specifies an opacity value, that will
be used to set the fill_opacity property as well.
)_fill_colorr~   s    r   rW  GraphicsStyle.fill_color  s     r   c                 D  > [        U[        5      (       a  [        U5      n[        U[        [        [
        45      (       a0  [        TU ]  SU5        UR                  b  UR                  U l	        g g Ub  XR                  L a  [        TU ]  SU5        g [        U S35      e)Nr  " doesn't look like a drawing color)rZ   r]   r   rn   r   r   rs   r}  ry   rX  ri  rh   r/   colorrz   s     r   rW  r    s    eS!!)%0EeiZ@AAGu5ww"$)GG! # m,,!6Gu5 ug%GHIIr   c                 J    [        U [        R                  R                  5      $ )z-The desired fill opacity for this path/group.)r\   r   
FILL_ALPHAr?   r~   s    r   rX  GraphicsStyle.fill_opacity       t\44::;;r   c                    > US U R                   1;  a  [        U5        [        TU ]  [        R
                  R                  U5        g rR   )ri  rB   rs   r}  r   r  r?   r  s     r   rX  r    s7    tT\\**L33993?r   c                     U R                   $ )z
The desired stroke color for this path/group.

When setting this property, if the color specifies an opacity value, that will
be used to set the fill_opacity property as well.
)_stroke_colorr~   s    r   rY  GraphicsStyle.stroke_color  s     !!!r   c                   > [        U[        5      (       a  [        U5      n[        U[        [        [
        45      (       aP  [        TU ]  SU5        UR                  b  UR                  U l	        U R                  U R                  L a  SU l
        g g Ub  XR                  L a  [        TU ]  SU5        g [        U S35      e)Nr  r	   r  )rZ   r]   r   rn   r   r   rs   r}  ry   rZ  r\  ri  rh   r  s     r   rY  r    s    eS!!)%0EeiZ@AAG7ww"&+gg#  DLL0$%! 1 m,,!6G7 ug%GHIIr   c                 J    [        U [        R                  R                  5      $ )z/The desired stroke opacity for this path/group.)r\   r   STROKE_ALPHAr?   r~   s    r   rZ  GraphicsStyle.stroke_opacity       t\66<<==r   c                    > US U R                   1;  a  [        U5        [        TU ]  [        R
                  R                  U5        g rR   )ri  rB   rs   r}  r   r  r?   r  s     r   rZ  r  $  s7    tT\\**L55;;SAr   c                 J    [        U [        R                  R                  5      $ )z+The desired blend mode for this path/group.)r\   r   
BLEND_MODEr?   r~   s    r   r[  GraphicsStyle.blend_mode+  r  r   c                    > XR                   L a)  [        TU ]	  [        R                  R
                  U5        g [        TU ]	  [        R                  R
                  [        R                  " U5      R
                  5        g rR   )ri  rs   r}  r   r  r?   r
   r  r/   r?   rz   s     r   r[  r  0  sW    LL G 7 7 = =uEG''--y/?/?/F/L/Lr   c                 J    [        U [        R                  R                  5      $ )z-The desired stroke width for this path/group.)r\   r   STROKE_WIDTHr?   r~   s    r   r\  GraphicsStyle.stroke_width9  r  r   c           
        > [        U[        [        [        R                  [        S 5      [        U R                  5      45      (       d  [        S[        U5       35      e[        TU ]%  [        R                  R                  U5        g )Nz#stroke_width must be a number, not )rZ   r   floatdecimalDecimaltyperi  rh   rs   r}  r   r  r?   )r/   widthrz   s     r   r\  r  >  sf    %$t*d4<<6HI
 
 A$u+OPPL55;;UCr   c                 J    [        U [        R                  R                  5      $ )z1The desired stroke cap style for this path/group.)r\   r   STROKE_CAP_STYLEr?   r~   s    r   r]  GraphicsStyle.stroke_cap_styleH  s     t\::@@AAr   c                    > XR                   L a)  [        TU ]	  [        R                  R
                  U5        g [        TU ]	  [        R                  R
                  [        R                  " U5      5        g rR   )ri  rs   r}  r   r  r?   r   r  r  s     r   r]  r  M  sQ    LL G = = C CUKG--33^5J5J55Qr   c                 J    [        U [        R                  R                  5      $ )z2The desired stroke join style for this path/group.)r\   r   STROKE_JOIN_STYLEr?   r~   s    r   r^  GraphicsStyle.stroke_join_styleV  s     t\;;AABBr   c                    > XR                   L a)  [        TU ]	  [        R                  R
                  U5        g [        TU ]	  [        R                  R
                  [        R                  " U5      5        g rR   )ri  rs   r}  r   r  r?   r   r  r  s     r   r^  r  [  sR    LL G > > D DeLG..44&&u-r   c                 J    [        U [        R                  R                  5      $ )z3The desired stroke miter limit for this path/group.)r\   r   STROKE_MITER_LIMITr?   r~   s    r   r_   GraphicsStyle.stroke_miter_limite  s     t\<<BBCCr   c                    > XR                   L d  [        U[        5      (       a)  [        TU ]  [
        R                  R                  U5        g [        U S35      e)Nz is not a number)	ri  rZ   ra   rs   r}  r   r  r?   rh   r  s     r   r_  r  j  sG    \\!j&D&DG ? ? E EuMug%5677r   c                     U R                   $ )z4The desired stroke dash pattern for this path/group.)_stroke_dash_patternr~   s    r   r`  !GraphicsStyle.stroke_dash_patternq  s     (((r   c                 N  > Uc  SnOpXR                   L a  UnO_[        U[        5      (       a  U4nOF / nU H8  n[        U[        5      (       d  [        SU S35      eUR	                  U5        M:     / UQ7n[
        TU ]  SU5        g ! [         a    [        SU S35      S ef = f)Nr5   zstroke_dash_pattern z sequence has non-numeric valuez( must be a number or sequence of numbersr  )ri  rZ   ra   rh   rg   rs   r}  )r/   r?   resultaccumr   rz   s        r   r`  r  v  s    =Fll"F{++XF!D%dK88'25'9XY  LL& " uYF2F;  *5'1YZs   A B	 	B$c                     U R                   $ )zAThe desired stroke dash pattern phase offset for this path/group.)_stroke_dash_phaser~   s    r   ra  GraphicsStyle.stroke_dash_phase  r  r   c                    > XR                   L d  [        U[        5      (       a  [        TU ]  SU5      $ [        U S35      e)Nr  z( isn't a number or GraphicsStyle.INHERIT)ri  rZ   ra   rs   r}  rh   r  s     r   ra  r    s?    LL Juk$B$B7&';UCC5'!IJKKr   c                     [        5       nU R                   H2  n[        XU R                  5      nX0R                  Ld  M)  Uc  M.  X1U'   M4     U R                  (       aL  U R                  U R                  La3  U R                  U R
                  /U[        R                  R                  '   U R                  SL a  U R                   H  nX!;   d  M
  X	 M     U(       a3  [        S5      n[        S5      X'   UR                  USS9  [        U5      $ g)z{
Convert this style object to a PDF dictionary with appropriate style keys.

Only explicitly specified values are emitted.
NFType	ExtGState)last)r   PDF_STYLE_KEYSr\   ri  r`  ra  r   rc  r?   rT  TRANSPARENCY_KEYSr   move_to_endrS   )r/   r  rl   r?   	type_names        r   r,   GraphicsStyle.serialize  s     &&CDt||4E\\)0A $s ' ##(@(@(T((&&>F<3399:
 ""e+--= .  VI $[ 1Fyu5'// r   c                     U R                   [        R                  L a  [        5       nU R                  b  U R
                  b  UR                  S5        U R                  b;  UR                  S5        U R                  c   eUR                  U R                  5         U R                  [        U5         nU$ U R                   U R                  L a  [        R                  nU$ U R                   nU$ ! [         a    [        R                  n U$ f = f)zt
Resolve `PathPaintRule.AUTO` to a real paint rule based on this style.

Returns:
    the resolved `PathPaintRule`.
re  rf  )rS  r   AUTOsetr\  rY  addrW  rV  _PAINT_RULE_LOOKUP	frozensetr-   STROKE_FILL_NONZEROri  )r/   wantrules      r   resolve_paint_rule GraphicsStyle.resolve_paint_rule  s     ??m0005D  ,1B1B1N"*  --999//09..y?  __, !44D
  ??D  9 %88 9s   C/ /DD)rT  rU  r[  rW  rX  rV  rS  r]  rY  r`  ra  r^  r_  rZ  r\  )5r7   r8   r   r9   r:   ri  rh  r   r  r?   r  r  r  r  r  r   r  STROKEr   NONZEROFILL_NONZEROEVENODDFILL_EVENODDr  STROKE_FILL_EVENODDr  rQ  rp  rs  rx  r}  r   rT  setterrS  rU  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  r,   r   r  r;   r   r   s   @r   r6   r6   9  s&    G]" V 	%%!!''%%
 S	U<	UN U 	"}//8*}336+3345}7Q7Q6+3345}7Q7Qv/778	
,,v/778	
,, : $.") ( ( ? ?     J J     0 0 ' ' T T     J J < < @ @ " " J J" > > B B < <   > > D D B B   C C   D D 8 8 ) ) <  <0 ' ' L L(T " "r   r6   c                 (    U R                  5        S3$ )Nz mr   pts    r   _render_mover        iik]"r   c                 (    U R                  5        S3$ )Nz lr  r  s    r   _render_liner    r  r   c                 l    U R                  5        SUR                  5        SUR                  5        S3$ )NrP   z cr  )ctrl1ctrl2ends      r   _render_curver    s/    llnQu||~.a

~R@@r   c                   V    \ rS rSr% Sr\\S'    \S 5       r\	S 5       r
\	S 5       rSrg)	Movei  z
A path move element.

If a path has been created but not yet painted, this will create a new subpath.

See: `PaintedPath.move_to`
r  c                     U R                   $ z#The end point of this path element.r  r~   s    r   	end_pointMove.end_point       wwr   c                 D    [        U R                  5      X R                  4$ a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is `self`
)r  r  r/   gsd_registryr0   rM  initial_points        r   r   Move.render  s      DGG$dGG33r   c                 n    U R                  XX45      u  pxnUR                  [        U 5      S-   5        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Move.render`.
r   r   writer]   	r/   r  r0   rM  r   debug_streampfxrenderedresolveds	            r   render_debugMove.render_debug  @    0 -1KK-
)M 	3t9t+,=00r   r5   Nr7   r8   r   r9   r:   r   r  r   r  r   r   r
  r;   r5   r   r   r  r    sK     	I%  4 4" 1 1r   r  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)RelativeMovei:  z
A path move element with an end point relative to the end of the previous path
element.

If a path has been created but not yet painted, this will create a new subpath.

See: `PaintedPath.move_relative`
r  c                 b    UR                   U R                  -   n[        U5      [        U5      U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved
    `Move`
)r  r  r  r  r/   r  r0   rM  r   points         r   r   RelativeMove.renderG  s.    " ##dgg-E"DK66r   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeMove.render`.
 resolved to r   r   r  r  s	            r   r
  RelativeMove.render_debug[  D    0 -1KK-
)M 	dV=
"=>=00r   r5   Nr7   r8   r   r9   r:   r   r  r   r   r
  r;   r5   r   r   r  r  :  s7     	I&7 7& 1 1r   r  c                   V    \ rS rSr% Sr\\S'    \S 5       r\	S 5       r
\	S 5       rSrg)	Linei{  z
A path line element.

This draws a straight line from the end point of the previous path element to the
point specified by `pt`.

See: `PaintedPath.line_to`
r  c                     U R                   $ r  r  r~   s    r   r  Line.end_point  r  r   c                 0    [        U R                  5      X4$ r  )r  r  r  s        r   r   Line.render  s      DGG$d99r   c                 n    U R                  XX45      u  pxnUR                  [        U 5      S-   5        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Line.render`.
r   r  r  s	            r   r
  Line.render_debug  r  r   r5   Nr  r5   r   r   r  r  {  sK     	I/  : :" 1 1r   r  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)RelativeLinei  aL  
A path line element with an endpoint relative to the end of the previous element.

This draws a straight line from the end point of the previous path element to the
point specified by `last_item.end_point + pt`. The absolute coordinates of the end
point are resolved during the rendering process.

See: `PaintedPath.line_relative`
r  c                 b    UR                   U R                  -   n[        U5      [        U5      U4$ )  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved
    `Line`.
)r  r  r  r  r  s         r   r   RelativeLine.render  s.    " ##dgg-E"DK>>r   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeLine.render`.
r  r   r  r  s	            r   r
  RelativeLine.render_debug  r  r   r5   Nr  r5   r   r   r#  r#    s7     	II? ?& 1 1r   r#  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)HorizontalLinei  zz
A path line element that takes its ordinate from the end of the previous element.

See: `PaintedPath.horizontal_line_to`
r   c                     [        U R                  UR                  R                  S9n[	        U5      [        U5      U4$ r%  r   )r   r   r  r   r  r  r/   r  r0   rM  r   r  s         r   r   HorizontalLine.render  s6    " DFFi&9&9&;&;<	I&YFFr   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `HorizontalLine.render`.
r  r   r  r  s	            r   r
  HorizontalLine.render_debug  r  r   r5   Nr7   r8   r   r9   r:   r  r  r   r   r
  r;   r5   r   r   r*  r*    s9     I:G G& 1 1r   r*  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)RelativeHorizontalLinei?  z
A path line element that takes its ordinate from the end of the previous element and
computes its abscissa offset from the end of that element.

See: `PaintedPath.horizontal_line_relative`
r   c                     [        UR                  R                  U R                  -   UR                  R                  S9n[	        U5      [        U5      U4$ r,  r   r  r   r   r  r  r-  s         r   r   RelativeHorizontalLine.renderM  sG    " I//11DFF:i>Q>Q>S>ST	I&YFFr   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeHorizontalLine.render`.
r  r   r  r  s	            r   r
  #RelativeHorizontalLine.render_debuga  r  r   r5   Nr1  r5   r   r   r3  r3  ?  =     I
 G G& 1 1r   r3  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)VerticalLinei  zx
A path line element that takes its abscissa from the end of the previous element.

See: `PaintedPath.vertical_line_to`
r   c                     [        UR                  R                  U R                  S9n[	        U5      [        U5      U4$ r,  r5  r-  s         r   r   VerticalLine.render  s6    " I//11TVV<	I&YFFr   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `VerticalLine.render`.
r  r   r  r  s	            r   r
  VerticalLine.render_debug  r  r   r5   Nr1  r5   r   r   r;  r;    s9     I8G G& 1 1r   r;  c                   F    \ rS rSr% Sr\\S'    \S 5       r\S 5       r	Sr
g)RelativeVerticalLinei  z
A path line element that takes its abscissa from the end of the previous element and
computes its ordinate offset from the end of that element.

See: `PaintedPath.vertical_line_relative`
r   c                     [        UR                  R                  UR                  R                  U R                  -   S9n[	        U5      [        U5      U4$ r,  r5  r-  s         r   r   RelativeVerticalLine.render  sG    " I//11Y5H5H5J5JTVV5ST	I&YFFr   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeVerticalLine.render`.
r  r   r  r  s	            r   r
  !RelativeVerticalLine.render_debug  r  r   r5   Nr1  r5   r   r   rA  rA    r9  r   rA  c                   n    \ rS rSr% Sr\\S'    \\S'    \\S'    \S 5       r\	S 5       r
\	S 5       rS	rg
)BezierCurvei  u   
A cubic Bézier curve path element.

This draws a Bézier curve parameterized by the end point of the previous path
element, two off-curve control points, and an end point.

See: `PaintedPath.curve_to`
c1c2r  c                     U R                   $ r  r  r~   s    r   r  BezierCurve.end_point       xxr   c                 \    [        U R                  U R                  U R                  5      X4$ r  )r  rH  rI  r  r  s        r   r   BezierCurve.render  s$      TWWdggtxx8$MMr   c                 n    U R                  XX45      u  pxnUR                  [        U 5      S-   5        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `BezierCurve.render`.
r   r  r  s	            r   r
  BezierCurve.render_debug)  r  r   r5   Nr  r5   r   r   rG  rG    s]     	I*I+	J   N N" 1 1r   rG  c                   ^    \ rS rSr% Sr\\S'    \\S'    \\S'    \S 5       r\S 5       r	Sr
g	)
RelativeBezierCurveiI  u   
A cubic Bézier curve path element whose points are specified relative to the end
point of the previous path element.

See: `PaintedPath.curve_relative`
rH  rI  r  c                     UR                   nXPR                  -   nXPR                  -   nXPR                  -   n[	        XgU5      [        XgUS9U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved
    `BezierCurve`.
)rH  rI  r  )r  rH  rI  r  r  rG  )	r/   r  r0   rM  r   
last_pointrH  rI  r  s	            r   r   RelativeBezierCurve.render\  sV    " ((
''!''!88# "#&2#.
 	
r   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeBezierCurve.render`.
r  r   r  r  s	            r   r
   RelativeBezierCurve.render_debugy  r  r   r5   Nr  r5   r   r   rS  rS  I  sO     	I 	I 
JQ
 
8 1 1r   rS  c                   h    \ rS rSr% Sr\\S'    \\S'    \S 5       rS r	\
S 5       r\
S 5       rS	rg
)QuadraticBezierCurvei  u   
A quadratic Bézier curve path element.

This draws a Bézier curve parameterized by the end point of the previous path
element, one off-curve control point, and an end point.

See: `PaintedPath.quadratic_curve_to`
ctrlr  c                     U R                   $ r  rK  r~   s    r   r  QuadraticBezierCurve.end_point  rM  r   c                    U R                   nU R                  n[        UR                  SUR                  UR                  -
  -  S-  -   UR                  SUR                  UR                  -
  -  S-  -   S9n[        UR                  SUR                  UR                  -
  -  S-  -   UR                  SUR                  UR                  -
  -  S-  -   S9n[        XEU5      $ )Nr   r   r   )r[  r  r   r   r   rG  )r/   start_pointr[  r  r  r  s         r   to_cubic_curve#QuadraticBezierCurve.to_cubic_curve  s    yyhhmma466KMM#9:Q>>mma466KMM#9:Q>>
 eea466CEE>*Q..eea466CEE>*Q..

 5--r   c                 d    U R                  UR                  5      R                  XX45      S   U U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is `self`.
r   )r`  r  r   r  s        r   r   QuadraticBezierCurve.render  sB      	 3 34;;Y 
 	
r   c                     U R                  XX45      u  pxnUR                  U  SU R                  UR                  5       S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `QuadraticBezierCurve.render`.
r  r   r   r  r`  r  r  s	            r   r
  !QuadraticBezierCurve.render_debug  s[    0 -1KK-
)M 	fM$"5"5i6I6I"J!K2N	
 =00r   r5   N)r7   r8   r   r9   r:   r   r  r   r  r`  r   r   r
  r;   r5   r   r   rZ  rZ    sX     K$	J  . 
 
, 1 1r   rZ  c                   R    \ rS rSr% Sr\\S'    \\S'    \S 5       r\S 5       r	Sr
g)	RelativeQuadraticBezierCurvei  u   
A quadratic Bézier curve path element whose points are specified relative to the end
point of the previous path element.

See: `PaintedPath.quadratic_curve_relative`
r[  r  c                     UR                   nXPR                  -   nXPR                  -   n[        XgS9nUR	                  XX45      $ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is the resolved
    `QuadraticBezierCurve`.
)r[  r  )r  r[  r  rZ  r   )	r/   r  r0   rM  r   rU  r[  r  absolutes	            r   r   #RelativeQuadraticBezierCurve.render	  sB      ((
II%88#'T;|IMMr   c           	          U R                  XX45      u  pxnUR                  U  SU SUR                  UR                  5       S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeQuadraticBezierCurve.render`.
r  z	 then to r   re  r  s	            r   r
  )RelativeQuadraticBezierCurve.render_debug	  sh    0 -1KK-
)M 	fM( ,..y/B/BCDBH	

 =00r   r5   Nr  r5   r   r   rh  rh    sA     KU	JQN N. 1 1r   rh  c                       \ rS rSr% Sr\\S'    \\S'    \\S'    \\S'    \\S'    \	\
S 5       5       rS	 r\
S
 5       r\
S 5       rSrg)Arci=	  z
An elliptical arc path element.

The arc is drawn from the end of the current path element to its specified end point
using a number of parameters to determine how it is constructed.

See: `PaintedPath.arc_to`
radiir(  largesweepr  c              #     #    [        U 5      n U n[        R                  S-  n[        R                  " X-  5      nX-  n[        R                  " U5      n[        R
                  " U5      nS[        R                  " US-  5      -  n[        SU5      n[        XWU-  -   XgU-  -
  5      n	[        XV5      n
[        U5       H-  nX-
  n[        R                  U5      nX-  X-  X-  4v   X-  nM/     g7f)u  
A generator that subdivides a swept angle into segments no larger than a quarter
turn.

Any sweep that is larger than a quarter turn is subdivided into as many equally
sized segments as necessary to prevent any individual segment from being larger
than a quarter turn.

This is used for approximating a circular curve segment using cubic Bézier
curves. This computes the parameters used for the Bézier approximation up
front, as well as the transform necessary to place the segment in the correct
position.

Args:
    sweep_angle (Number): the angle to subdivide.

Yields:
    A tuple of (ctrl1, ctrl2, end) representing the control and end points of
    the cubic Bézier curve approximating the segment as a unit circle centered
    at the origin.
r   gUUUUUU?r   r	   N)absr   piceilr%  r&  tanr   r   r  r(  )sweep_angle
sweep_leftquarterturnchunkssweep_segmentcos_tsin_tkappar  r  r  _offset	transforms                 r   subdivde_sweepArc.subdivde_sweepT	  s     0 +& 
ggk;45#,''!233aeem+UU]-BCE!vA -F!**62I#U%6GG'J s   C/C1c           	         U R                   n[        R                  U R                  * 5      n[        R                  U R                  5      nUR                  U R                  -
  S-  U-  nUR
                  UR
                  -  S-  UR                  UR                  -  S-  -   nUS:  a*  [        US-  UR
                  -  US-  UR                  -  S9nU R                  U R                  :g  U R                  U R                  :H  -
  nUR
                  UR                  -  S-  nUR
                  UR                  -  S-  n	UR                  UR
                  -  S-  n
U[        R                  " [        X-
  U
-
  S5      X-   -  5      -  [        UR
                  UR                  -  UR                  -  UR                  * UR
                  -  UR
                  -  S9-  nX-  UR                  U R                  -   S-  -   n[        UR
                  UR
                  -
  UR
                  -  UR                  UR                  -
  UR                  -  S9n[        UR
                  * UR
                  -
  UR
                  -  UR                  * UR                  -
  UR                  -  S9n[        SS5      R                  U5      nUR                  U5      nU R                  SL a  US:  a  U[        R                  -  nO(U R                  SL a  US:  a  U[        R                  -  nUS:  US:  -
  n[        R                  SUS9R!                  U5      R#                  UR
                  UR                  5      R!                  U R                  5      R%                  UR
                  UR                  5      n/ nU R'                  U5       H,  u  nnnUR)                  [+        UU-  UU-  UU-  5      5        M.     U$ )	z
Approximate this arc with a sequence of `BezierCurve`.

Args:
    last_item: the previous path element (used for its end point)

Returns:
    a list of `BezierCurve`.
r   r   r	   r   r   r   FT)rp  r  r(  r  r  r   r   r   rq  rr  r   sqrtr   r   taur"  r;  r8  r5  r  rg   rG  )r/   rM  rp  reverseforwardprimelam_dar   rxry2rxpy2rypx2centerprimecenterarcstartarcendr'  
deltatheta
sweep_signfinal_tfcurvesr  r  r  s                          r   _approximate_arcArc._approximate_arc	  sL    

$$dmm^4$$T]]3%%0C77B''EGG#)UWWuww->1,DDA:VS[EGG3uww7NOE

djj(TZZ4::-EF577"q(577"q(577"q( iieme3Q75=IJK''EGG#egg-77(UWW$uww. 	 'Y-@-@488-Ks,RSww&%''1ww&%''1
 x+--'5772x+--'5772

 a!!(+^^F+
JJ%j1n$(("JjjD zA~$(("J Ao*q.9
Z0VE]U577EGG$VDMM"Yvxx* 	 !%!4!4Z!@E5#MMEH,eh.>hO "A
 r   c           	         ^^^ U R                  U5      nU(       d  SU4$ SR                  UUU4S j[        U/USS QU5       5       5      US   T4$ )  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved
    `BezierCurve`.
r   rP   c              3   V   >#    U  H  u  pUR                  TTUT5      S    v   M      g7fr   Nr  rU   prevcurver  r   r0   s      r   rW   Arc.render.<locals>.<genexpr>	  s.      #IKD \5$FqI#I   &)Nr}   )r  rd   zip)r/   r  r0   rM  r   r  s    `` ` r   r   
Arc.render	  sh      &&y1y=  HH #&	'@F3BK'@&#I  2J
 	
r   c                   ^^^ U R                  U5      nUR                  U  S35        U(       d  UR                  US-   5        SU4$ U/nUSS  H,  n	UR                  U	5        UR                  USU	 S3-   5        M.     UR                  USUS    S3-   5        S	R                  UUU4S
 j[	        X5       5       5      US   T4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Arc.render`.
 resolved to:
    └─ nothing
r   Nr}       ├─ r       └─ rP   c              3   V   >#    U  H  u  pUR                  TTUT5      S    v   M      g7fr  r  r  s      r   rW   #Arc.render_debug.<locals>.<genexpr>
  s.      #8KD \5$FqI#8r  )r  r  rg   rd   r  )
r/   r  r0   rM  r   r  r  r  previousr  s
    `` `     r   r
  Arc.render_debug	  s    . &&y1dV?34s%889y= ;CR[EOOE"sxwb%99: ! 	38F2J<r!::; HH #&x#8  2J
 	
r   r5   N)r7   r8   r   r9   r:   r   r  r  r`   staticmethodr   r  r  r   r
  r;   r5   r   r   ro  ro  =	  s     L VKTKF	J#+(  +(ZGR 
 
: *
 *
r   ro  c                   v    \ rS rSr% Sr\\S'    \\S'    \\S'    \\S'    \\S'    \	S 5       r
\	S	 5       rS
rg)RelativeArci
  z
An elliptical arc path element.

The arc is drawn from the end of the current path element to its specified end point
using a number of parameters to determine how it is constructed.

See: `PaintedPath.arc_relative`
rp  r(  rq  rr  r  c                     [        U R                  U R                  U R                  U R                  UR
                  U R                  -   5      R                  XX45      $ )r  )ro  rp  r(  rq  rr  r  r  r   r  s        r   r   RelativeArc.render/
  sN      JJMMJJJJ$((*
 &i
?	@r   c                     UR                  U  S35        [        U R                  U R                  U R                  U R
                  UR                  U R                  -   5      R                  XX4XV5      $ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RelativeArc.render`.
r  )	r  ro  rp  r(  rq  rr  r  r  r
  r/   r  r0   rM  r   r  r  s          r   r
  RelativeArc.render_debugG
  se    0 	dV=12JJMMJJJJ$((*
 ,|Il
X	Yr   r5   N)r7   r8   r   r9   r:   r   r  r  r`   r   r   r
  r;   r5   r   r   r  r  
  s`     L VKTKF	JT@ @. Y Yr   r  c                   R    \ rS rSr% Sr\\S'    \\S'    \S 5       r\S 5       r	Sr
g)		Rectangleij
  zA pdf primitive rectangle.orgsizec                     U R                   R                  5        SU R                  R                  5        S3[        U R                   5      U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is a `Line` back to
    the rectangle's origin.
rP   z re)r  r   r  r  r  s        r   r   Rectangle.renderr
  sF    & xx !499#3#3#5"6c:N
 	
r   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Rectangle.render`.
r  r   r  r  s	            r   r
  Rectangle.render_debug
  r  r   r5   Nr  r5   r   r   r  r  j
  s;    $	J/
K0
 
. 1 1r   r  c                   d    \ rS rSr% Sr\\S'    \\S'    \\S'    S r\S 5       r	\S 5       r
S	rg
)RoundedRectanglei
  zA
A rectangle with rounded corners.

See: `PaintedPath.rectangle`
r  r  corner_radiic                    / nU R                   R                  S:X  a  U R                   R                  S:X  a   U$ U R                   R                  S:X  d  U R                   R                  S:X  ap  UR                  [	        U R
                  5      5        UR                  [        U R
                  U R                   -   5      5        UR                  [        5       5        U$ U R                  R                  S:X  d  U R                  R                  S:X  a1  UR                  [        U R
                  U R                   5      5        U$ U R
                  u  p#U R                   u  pEU R                  u  pgU R                   R                  S:  U R                   R                  S:  -
  nU R                   R                  S:  U R                   R                  S:  -
  n	[        U5      [        U5      :  a  U R                   R                  n[        U5      [        U5      :  a  U R                   R                  nU[        U5      -  nU	[        U5      -  n[        Xg5      n
UR                  [	        [        X&-   U5      5      5        UR                  [        [        X$-   U-
  U5      5      5        UR                  [        U
SSS[        X$-   X7-   5      5      5        UR                  [        [        X$-   X5-   U-
  5      5      5        UR                  [        U
SSS[        X$-   U-
  X5-   5      5      5        UR                  [        [        X&-   X5-   5      5      5        UR                  [        U
SSS[        X#U-   U-
  5      5      5        UR                  [        [        X#U-   5      5      5        UR                  [        U
SSS[        X&-   U5      5      5        UR                  [        5       5        U$ Nr   FT)r  r   r   rg   r  r  r  Closer  r  rt  r   ro  )r/   rf   r   r   whrxry
sign_widthsign_heightarc_rads              r   
_decomposeRoundedRectangle._decompose
  s   IIKK1499;;!#3F E iikkQDIIKK1$4LLdhh(LLdhh234LL!> = !!Q&D,=,=,?,?1,DLL488TYY78: 7 88DA99DA&&FB))++*tyy{{Q?J99;;!+		a@K2wQYY[[2wQYY[[c"g%Bs2w&BBmGLLeAFA./0LLeAEBJ234LLWaeAE166JKLLLeAE152:678LLWaeAEBJ6NOPLLeAFAE234LLWaeA1urz6JKLLLeA2v./0LLWaeAFA6FGHLL!r   c                     U R                  5       nU(       d  SU4$ / nU H)  nUR                  XX45      u  pnUR                  U5        M+     SR                  U5      [	        U R
                  5      U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved
    `Line`.
r   rP   )r  r   rg   rd   r  r  	r/   r  r0   rM  r   
componentsrender_listr   r  s	            r   r   RoundedRectangle.render
  st      __&
y= D15Y2.H x(	  xx$d488nmCCr   c                    U R                  5       nUR                  U  S35        U(       d  UR                  US-   5        SU4$ / nUSS  HA  n	U	R                  XX45      u  pnUR                  USU	 S3-   5        UR                  U
5        MC     US   R                  XX45      u  pnUR                  USUS    S3-   5        UR                  U
5        S	R	                  U5      [        U R                  5      U4$ )
a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `RoundedRectangle.render`.
r  r  r   Nr}   r  r   r  rP   )r  r  r   rg   rd   r  r  r/   r  r0   rM  r   r  r  r  r  r   r  s              r   r
  RoundedRectangle.render_debug
  s   . __&
dV?34s%889y= sOD15Y2.H sxvR%889x( $ .8^-B-B.
*] 	38JrN+;2!>>?8$xx$d488nmCCr   r5   Nr7   r8   r   r9   r:   r   r  r  r   r   r
  r;   r5   r   r   r  r  
  sT     
J/
K0-'R D D: +D +Dr   r  c                   X    \ rS rSr% Sr\\S'    \\S'    S r\S 5       r	\S 5       r
Srg	)
Ellipsei.  z)
An ellipse.

See: `PaintedPath.ellipse`
rp  r  c                    / n[        U R                  R                  5      n[        U R                  R                  5      nU R                  u  pE[        X#5      nUS:w  a  US:w  a  UR                  [        [        XB-   U5      5      5        UR                  [        USSS[        XEU-   5      5      5        UR                  [        USSS[        XB-
  U5      5      5        UR                  [        USSS[        XEU-
  5      5      5        UR                  [        USSS[        XB-   U5      5      5        UR                  [        5       5        U$ r  )
rt  rp  r   r   r  r   rg   r  ro  r  )r/   rf   r  r  cxcyr  s          r   r  Ellipse._decompose:  s   - !G"'LLeBGR012LLWaeBR6HIJLLWaeBGR6HIJLLWaeBR6HIJLLWaeBGR6HIJLL!r   c                     U R                  5       nU(       d  SU4$ / nU H)  nUR                  XX45      u  pnUR                  U5        M+     SR                  U5      [	        U R
                  5      U4$ )a  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is a resolved
    `Move` to the center of the ellipse.
r   rP   )r  r   rg   rd   r  r  r  s	            r   r   Ellipse.renderO  su      __&
y= D15Y2.H x(	  xx$d4;;&7FFr   c                    U R                  5       nUR                  U  S35        U(       d  UR                  US-   5        SU4$ / nUSS  HA  n	U	R                  XX45      u  pnUR                  USU	 S3-   5        UR                  U
5        MC     US   R                  XX45      u  pnUR                  USUS    S3-   5        UR                  U
5        S	R	                  U5      [        U R                  5      U4$ )
a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Ellipse.render`.
r  r  r   Nr}   r  r   r  rP   )r  r  r   rg   rd   r  r  r  s              r   r
  Ellipse.render_debugm  s   . __&
dV?34s%889y= sOD15Y2.H sxvR%889x( $ .8^-B-B.
*] 	38JrN+;2!>>?8$xx$d4;;&7FFr   r5   Nr  r5   r   r   r  r  .  sJ     L+M@* G G: +G +Gr   r  c                   8    \ rS rSrSr\S 5       r\S 5       rSrg)ImplicitClosei  zk
A path close element that is conditionally rendered depending on the value of
`GraphicsStyle.auto_close`.
c                 4    UR                   (       a  SX44$ SX44$ )  
Render this path element to its PDF representation.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command

Returns:
    a tuple of `(str, new_last_item)`, where `new_last_item` is whatever the old
    last_item was.
r  r   )rU  r  s        r   r   ImplicitClose.render  s#    " 	009++r   c                 b    U R                  XX45      u  pxnUR                  U  SU S35        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `ImplicitClose.render`.
r  r   r  r  s	            r   r
  ImplicitClose.render_debug  r  r   r5   N	r7   r8   r   r9   r:   r   r   r
  r;   r5   r   r   r  r    s/     , ,* 1 1r   r  c                   8    \ rS rSrSr\S 5       r\S 5       rSrg)r  i  z
A path close element.

Instructs the renderer to draw a straight line from the end of the last path element
to the start of the current path.

See: `PaintedPath.close`
c                     S[        U5      U4$ )r  r  )r  r  s        r   r   Close.render  s    " D'66r   c                 n    U R                  XX45      u  pxnUR                  [        U 5      S-   5        XxU4$ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `Close.render`.
r   r  r  s	            r   r
  Close.render_debug  r  r   r5   Nr  r5   r   r   r  r    s/     7 7$ 1 1r   r  c                   D    \ rS rSrSrS rS
S jr\S 5       rS r	S r
Srg	)DrawingContexti  z
Base context for a drawing in a PDF

This context is not stylable and is mainly responsible for transforming path
drawing coordinates into user coordinates (i.e. it ensures that the output drawing
is correctly scaled).
c                     / U l         g rR   	_subitemsr~   s    r   rs  DrawingContext.__init__   s	    r   c                     [        U[        [        45      (       d  [        U S35      eU(       a  [        R
                  " U5      nU R                  R                  U5        g)ag  
Append an item to this drawing context

Args:
    item (GraphicsContext, PaintedPath): the item to be appended.
    _copy (bool): if true (the default), the item will be copied before being
        appended. This prevents modifications to a referenced object from
        "retroactively" altering its style/shape and should be disabled with
        caution.
z# doesn't belong in a DrawingContextN)rZ   GraphicsContextPaintedPathrh   copydeepcopyr  rg   r/   r   _copys      r   add_itemDrawingContext.add_item#  sL     $+ >??tf$GHII==&Dd#r   c                    SU l         [        R                  U l        [        R
                  U l        [        U5      n[        R                  SSS9R                  SUS-  S9R                  U5      R                  U5      u  p$SU/nXPU4$ )NTr	   r}   r   r   r   q)rU  r   r  rS  r   r  rV  r  r  r"  rD  r8  r   )r0   first_pointr8  heightrM  r  s         r   _setup_render_prereqs$DrawingContext._setup_render_prereqs7  s    (--"2":":%	R(UQ&1*U%U5\VI	 	 El9,,r   c                    U R                   (       d  gU R                  XRX45      u  pgnU R                    H2  n	U	R                  XX5      u  pnU
(       d  M!  UR                  U
5        M4     [	        U5      S:X  a  gUR                  U5      nUb]  UR                  S[        U5       S35        UR                  S[        UR                  5      S[        UR                  5       S3-   5        UR                  S5        SR                  U5      $ )a  
Render the drawing context to PDF format.

Args:
    gsd_registry (GraphicsStateDictRegistry): the parent document's graphics
        state registry.
    first_point (Point): the starting point to use if the first path element is
        a relative element.
    scale (Number): the scale factor to convert from PDF pt units into the
        document's semantic units (e.g. mm or in).
    height (Number): the page height. This is used to remap the coordinates to
        be from the top-left corner of the page (matching fpdf's behavior)
        instead of the PDF native behavior of bottom-left.
    starting_style (GraphicsStyle): the base style for this drawing context,
        derived from the document's current style defaults.

Returns:
    A string composed of the PDF representation of all the paths and groups in
    this context (an empty string is returned if there are no paths or groups)
r   r    gsr   rP    dQ)r  r  r   rg   r.   r3   insertrS   r`  rH   ra  rd   )r/   r  r  r8  r  starting_styler  r0   rM  r   r  style_dict_names               r   r   DrawingContext.renderI  s   * ~~(,(B(B)
%I NND/3{{Y0,H x""8, # {q &55e<&q%9/%J$K3"OP$U%>%>?mE$;$;<=R@A 	3xx$$r   c                    U R                  XRX45      u  pxn	UR                  S5        U R                  SS  HC  n
UR                  S5        U
R                  XXS5      u  pU(       d  M2  UR	                  U5        ME     U R                  (       a  UR                  S5        U R                  S   R                  XXUS5      u  pnU(       a  UR	                  U5        [        U5      S:X  a  g	UR                  U5      nUb]  UR                  S[        U5       S
35        UR                  S[        UR                  5      S[        UR                  5       S3-   5        UR	                  S5        SR                  U5      $ g	)a  
Render the drawing context to PDF format.

Args:
    gsd_registry (GraphicsStateDictRegistry): the parent document's graphics
        state registry.
    first_point (Point): the starting point to use if the first path element is
        a relative element.
    scale (Number): the scale factor to convert from PDF pt units into the
        document's semantic units (e.g. mm or in).
    height (Number): the page height. This is used to remap the coordinates to
        be from the top-left corner of the page (matching fpdf's behavior)
        instead of the PDF native behavior of bottom-left.
    starting_style (GraphicsStyle): the base style for this drawing context,
        derived from the document's current style defaults.
    debug_stream (TextIO): a text stream to which a debug representation of the
        drawing structure will be written.

Returns:
    A string composed of the PDF representation of all the paths and groups in
    this context (an empty string is returned if there are no paths or groups)
zROOT
Nr}   r      │  r      r   r   r  r   rP   r  r  )r  r  r  r
  rg   r.   r3   r  rS   r`  rH   ra  rd   )r/   r  r  r8  r  r  r  r  r0   rM  rl  r  r  s                r   r
  DrawingContext.render_debug~  sv   2 )-(B(B)
%I 	8$^^CR(Ez*"'"4"4Yh#H x""8, ) >>z*/3~~b/A/N/NY\60,H ""8, ;1$*99%@O*""1)=o)N(Os&ST""()B)BC-(?(?@ADE s#88K((r   r  NT)r7   r8   r   r9   r:   rs  r  r  r  r   r
  r;   r5   r   r   r  r    s1    $( - -"3%j@r   r  c                      \ rS rSrSrS)S jrS r\S 5       r\S 5       r	\	R                  S 5       r	\S 5       r\R                  S	 5       r\S
 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S*S j5       r\S 5       rS*S jrS rS)S jrS rS rS rS rS rS rS rS rS rS rS rS rS r S  r!S! r"S" r#S# r$S$ r% S+S& jr&S' r'S(r(g%),r  i  aJ  
A path to be drawn by the PDF renderer.

A painted path is defined by a style and an arbitrary sequence of path elements,
which include the primitive path elements (`Move`, `Line`, `BezierCurve`, ...) as
well as arbitrarily nested `GraphicsContext` containing their own sequence of
primitive path elements and `GraphicsContext`.
c                     [        5       U l        U R                  U l        SU l        U R                  U l        [        [        X5      5      U l        g )NT)r  _root_graphics_context_graphics_context_closed_close_contextr  r   _starter_mover4  s      r   rs  PaintedPath.__init__  sA    &5&7#!%!<!<"44!%+.r   c                 (   U R                   U R                  La  [        SU  S35      eU R                  5       n[        R
                  " U R                  U5      Ul        UR                  Ul         U R                  Ul        UR                   Ul        U$ )Nzcannot copy path z while it is being modified)r  r  RuntimeErrorrz   r  r  r  r  r/   rv  rw  s      r   rx  PaintedPath.__deepcopy__  s     !!)D)DD!24&8STUU!(,d6Q6QSW(X%#)#@#@  & 8 8r   c                 .    U R                   R                  $ )z9The `GraphicsStyle` applied to all elements of this path.)r  r0   r~   s    r   r0   PaintedPath.style  s     **000r   c                 .    U R                   R                  $ )zAThe `Transform` that applies to all of the elements of this path.r  r  r~   s    r   r  PaintedPath.transform  s     **444r   c                 $    XR                   l        g rR   r  r/   tfs     r   r  r    s    02##-r   c                 .    U R                   R                  $ )zDIf true, the path should automatically close itself before painting.r0   rU  r~   s    r   rU  PaintedPath.auto_close       zz$$$r   c                 $    XR                   l        g rR   r#  )r/   shoulds     r   rU  r$    s     &

r   c                 .    U R                   R                  $ )zCManually specify the `PathPaintRule` to use for rendering the path.r0   rS  r~   s    r   rS  PaintedPath.paint_rule  r%  r   c                 $    XR                   l        g rR   r)  )r/   r0   s     r   rS  r*    s     %

r   c                 .    U R                   R                  $ )z$Set the clipping path for this path.r  clipping_pathr~   s    r   r.  PaintedPath.clipping_path  s     **888r   c                 $    XR                   l        g rR   r-  r/   new_clipaths     r   r.  r/    s    4?##1r   c              #      #    U R                   n[        5       nX0l          Uv   U(       a  UR                  U5        X l         g ! X l         f = f7frR   )r  r  r  )r/   _attachold_graphics_contextnew_graphics_contexts       r   _new_graphics_context!PaintedPath._new_graphics_context  sJ     #55.0!5	:&&$--.BC%9"%9"s   AA AAAc              #   t   #    U R                  5        nXl        U v   SSS5        g! , (       d  f       g= f7f)zI
Apply the provided `Transform` to all points added within this context.
N)r7  r  )r/   r  ctxts      r   transform_groupPaintedPath.transform_group  s*     
 '')T&NJ *))s   8'	8
58c                     U R                   bC  SU l        U R                  R                  U R                   SS9  U R                  U l        SU l         U R                  R                  XS9  g)aY  
Add the given element as a path item of this path.

Args:
    item: the item to add to this path.
    _copy (bool): if true (the default), the item will be copied before being
        appended. This prevents modifications to a referenced object from
        "retroactively" altering its style/shape and should be disabled with
        caution.
NFr  )r  r  r  r  r  r  s      r   add_path_elementPaintedPath.add_path_element!  sc     ) DL""++D,>,>e+L"&"8"8D!%D''':r   c                 8    U R                   R                  5         g rR   )r  remove_last_itemr~   s    r   remove_last_path_element$PaintedPath.remove_last_path_element4  s    //1r   c           
          U R                  5         U R                  [        [        X5      [        X45      [        XV5      5      SS9  SU l        U R                  X5        U $ )aR  
Append a rectangle as a closed subpath to the current path.

If the width or the height are 0, the rectangle will be collapsed to a line
(unless they're both 0, in which case it's collapsed to nothing).

Args:
    x (Number): the abscissa of the starting corner of the rectangle.
    y (Number): the ordinate of the starting corner of the rectangle.
    w (Number): the width of the rectangle (if 0, the rectangle will be
        rendered as a vertical line).
    h (Number): the height of the rectangle (if 0, the rectangle will be
        rendered as a horizontal line).
    rx (Number): the x-radius of the rectangle rounded corner (if 0 the corners
        will not be rounded).
    ry (Number): the y-radius of the rectangle rounded corner (if 0 the corners
        will not be rounded).

Returns:
    The path, to allow chaining method calls.
Fr>  T)_insert_implicit_close_if_openr?  r  r   r  move_to)r/   r   r   r  r  r  r  s          r   	rectanglePaintedPath.rectangle7  sW    . 	++-U1[%+uR}EU 	 	
 Qr   c                 &    U R                  XX35      $ )a  
Append a circle as a closed subpath to the current path.

Args:
    cx (Number): the abscissa of the circle's center point.
    cy (Number): the ordinate of the circle's center point.
    r (Number): the radius of the circle.

Returns:
    The path, to allow chaining method calls.
)ellipse)r/   r  r  rv   s       r   circlePaintedPath.circleW  s     ||BA))r   c           	          U R                  5         U R                  [        [        X45      [        X5      5      SS9  SU l        U R                  X5        U $ )aQ  
Append an ellipse as a closed subpath to the current path.

Args:
    cx (Number): the abscissa of the ellipse's center point.
    cy (Number): the ordinate of the ellipse's center point.
    rx (Number): the x-radius of the ellipse.
    ry (Number): the y-radius of the ellipse.

Returns:
    The path, to allow chaining method calls.
Fr>  T)rF  r?  r  r   r  rG  )r/   r  r  r  r  s        r   rK  PaintedPath.ellipsee  sJ     	++-geBmU2]C5QRr   c                 X    U R                  5         [        [        X5      5      U l        U $ )a  
Start a new subpath or move the path starting point.

If no path elements have been added yet, this will change the path starting
point. If path elements have been added, this will insert an implicit close in
order to start a new subpath.

Args:
    x (Number): abscissa of the (sub)path starting point.
    y (Number): ordinate of the (sub)path starting point.

Returns:
    The path, to allow chaining method calls.
)rF  r  r   r  r4  s      r   rG  PaintedPath.move_toy  s&     	++-!%+.r   c                     U R                  5         U R                  b<  SU l        U R                  R	                  U R                  SS9  U R                  U l        [        [        X5      5      U l        U $ )a  
Start a new subpath or move the path start point relative to the previous point.

If no path elements have been added yet, this will change the path starting
point. If path elements have been added, this will insert an implicit close in
order to start a new subpath.

This will overwrite an absolute move_to as long as no non-move path items have
been appended. The relative position is resolved from the previous item when
the path is being rendered, or from 0, 0 if it is the first item.

Args:
    x (Number): abscissa of the (sub)path starting point relative to the.
    y (Number): ordinate of the (sub)path starting point relative to the.
Fr>  )rF  r  r  r  r  r  r  r   r4  s      r   move_relativePaintedPath.move_relative  sf      	++-) DL""++D,>,>e+L"&"8"8D)%+6r   c                 J    U R                  [        [        X5      5      SS9  U $ )z
Append a straight line to this path.

Args:
    x (Number): abscissa the line's end point.
    y (Number): ordinate of the line's end point.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  r  r   r4  s      r   line_toPaintedPath.line_to  s%     	d5;/u=r   c                 J    U R                  [        [        X5      5      SS9  U $ )a  
Append a straight line whose end is computed as an offset from the end of the
previous path element.

Args:
    x (Number): abscissa the line's end point relative to the end point of the
        previous path element.
    y (Number): ordinate of the line's end point relative to the end point of
        the previous path element.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  r#  r   )r/   dxdys      r   line_relativePaintedPath.line_relative  s%     	l5=9Gr   c                 8    U R                  [        U5      SS9  U $ )z
Append a straight horizontal line to the given abscissa. The ordinate is
retrieved from the end point of the previous path element.

Args:
    x (Number): abscissa of the line's end point.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  r*  )r/   r   s     r   horizontal_line_toPaintedPath.horizontal_line_to  s!     	nQ/u=r   c                 8    U R                  [        U5      SS9  U $ )aR  
Append a straight horizontal line to the given offset from the previous path
element. The ordinate is retrieved from the end point of the previous path
element.

Args:
    x (Number): abscissa of the line's end point relative to the end point of
        the previous path element.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  r3  )r/   rY  s     r   horizontal_line_relative$PaintedPath.horizontal_line_relative  s"     	4R8Fr   c                 8    U R                  [        U5      SS9  U $ )z
Append a straight vertical line to the given ordinate. The abscissa is
retrieved from the end point of the previous path element.

Args:
    y (Number): ordinate of the line's end point.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  r;  )r/   r   s     r   vertical_line_toPaintedPath.vertical_line_to  s      	l1oU;r   c                 8    U R                  [        U5      SS9  U $ )aP  
Append a straight vertical line to the given offset from the previous path
element. The abscissa is retrieved from the end point of the previous path
element.

Args:
    y (Number): ordinate of the line's end point relative to the end point of
        the previous path element.

Returns:
    The path, to allow chaining method calls.
Fr>  )r?  rA  )r/   rZ  s     r   vertical_line_relative"PaintedPath.vertical_line_relative  s"     	226eDr   c                 |    [        X5      n[        X45      n[        XV5      n	U R                  [        XxU	5      SS9  U $ )u  
Append a cubic Bézier curve to this path.

Args:
    x1 (Number): abscissa of the first control point
    y1 (Number): ordinate of the first control point
    x2 (Number): abscissa of the second control point
    y2 (Number): ordinate of the second control point
    x3 (Number): abscissa of the end point
    y3 (Number): ordinate of the end point

Returns:
    The path, to allow chaining method calls.
Fr>  )r   r?  rG  )
r/   x1y1x2y2x3y3r  r  r  s
             r   curve_toPaintedPath.curve_to  s>     bbBmk%<EJr   c                 |    [        X5      n[        X45      n[        XV5      n	U R                  [        XxU	5      SS9  U $ )u  
Append a cubic Bézier curve whose points are expressed relative to the
end point of the previous path element.

E.g. with a start point of (0, 0), given (1, 1), (2, 2), (3, 3), the output
curve would have the points:

(0, 0) c1 (1, 1) c2 (3, 3) e (6, 6)

Args:
    dx1 (Number): abscissa of the first control point relative to the end point
        of the previous path element
    dy1 (Number): ordinate of the first control point relative to the end point
        of the previous path element
    dx2 (Number): abscissa offset of the second control point relative to the
        end point of the previous path element
    dy2 (Number): ordinate offset of the second control point relative to the
        end point of the previous path element
    dx3 (Number): abscissa offset of the end point relative to the end point of
        the previous path element
    dy3 (Number): ordinate offset of the end point relative to the end point of
        the previous path element

Returns:
    The path, to allow chaining method calls.
Fr>  )r   r?  rS  )
r/   dx1dy1dx2dy2dx3dy3c1dc2dr  s
             r   curve_relativePaintedPath.curve_relative  s?    6 CoCoCo1#C@Nr   c                 d    [        X5      n[        X45      nU R                  [        XV5      SS9  U $ )uB  
Append a cubic Bézier curve mimicking the specified quadratic Bézier curve.

Args:
    x1 (Number): abscissa of the control point
    y1 (Number): ordinate of the control point
    x2 (Number): abscissa of the end point
    y2 (Number): ordinate of the end point

Returns:
    The path, to allow chaining method calls.
Fr>  )r   r?  rZ  )r/   rj  rk  rl  rm  r[  r  s          r   quadratic_curve_toPaintedPath.quadratic_curve_to7  s4     R}Bm24=UKr   c                 d    [        X5      n[        X45      nU R                  [        XV5      SS9  U $ )uP  
Append a cubic Bézier curve mimicking the specified quadratic Bézier curve.

Args:
    dx1 (Number): abscissa of the control point relative to the end point of
        the previous path element
    dy1 (Number): ordinate of the control point relative to the end point of
        the previous path element
    dx2 (Number): abscissa offset of the end point relative to the end point of
        the previous path element
    dy2 (Number): ordinate offset of the end point relative to the end point of
        the previous path element

Returns:
    The path, to allow chaining method calls.
Fr>  )r   r?  rh  )r/   rs  rt  ru  rv  r[  r  s          r   quadratic_curve_relative$PaintedPath.quadratic_curve_relativeI  s4    " SCo:4EUSr   c           	          US:X  d  US:X  a  U R                  Xg5      $ [        [        U5      [        U5      5      n[        U5      n[        R
                  " U5      n[        U5      n[        Xg5      n	U R                  [        XXEU	5      SS9  U $ )u  
Append an elliptical arc from the end of the previous path point to the
specified end point.

The arc is approximated using Bézier curves, so it is not perfectly accurate.
However, the error is small enough to not be noticeable at any reasonable
(and even most unreasonable) scales, with a worst-case deviation of around 3‱.

Notes:
    - The signs of the radii arguments (`rx` and `ry`) are ignored (i.e. their
      absolute values are used instead).
    - If either radius is 0, then a straight line will be emitted instead of an
      arc.
    - If the radii are too small for the arc to reach from the current point to
      the specified end point (`x` and `y`), then they will be proportionally
      scaled up until they are big enough, which will always result in a
      half-ellipse arc (i.e. an 180 degree sweep)

Args:
    rx (Number): radius in the x-direction.
    ry (Number): radius in the y-direction.
    rotation (Number): angle (in degrees) that the arc should be rotated
        clockwise from the principle axes. This parameter does not have
        a visual effect in the case that `rx == ry`.
    large_arc (bool): if True, the arc will cover a sweep angle of at least 180
        degrees. Otherwise, the sweep angle will be at most 180 degrees.
    positive_sweep (bool): if True, the arc will be swept over a positive angle,
        i.e. clockwise. Otherwise, the arc will be swept over a negative
        angle.
    x (Number): abscissa of the arc's end point.
    y (Number): ordinate of the arc's end point.
r   Fr>  )rV  r   rt  r`   r   r+  r?  ro  )
r/   r  r  r(  	large_arcpositive_sweepr   r   rp  r  s
             r   arc_toPaintedPath.arc_to_  s    D 7bAg<<%%c"gs2w'O	<<)n-AkC@ 	 	
 r   c           	          US:X  d  US:X  a  U R                  Xg5      $ [        [        U5      [        U5      5      n[        U5      n[        R
                  " U5      n[        U5      n[        Xg5      n	U R                  [        XXEU	5      SS9  U $ )u~  
Append an elliptical arc from the end of the previous path point to an offset
point.

The arc is approximated using Bézier curves, so it is not perfectly accurate.
However, the error is small enough to not be noticeable at any reasonable
(and even most unreasonable) scales, with a worst-case deviation of around 3‱.

Notes:
    - The signs of the radii arguments (`rx` and `ry`) are ignored (i.e. their
      absolute values are used instead).
    - If either radius is 0, then a straight line will be emitted instead of an
      arc.
    - If the radii are too small for the arc to reach from the current point to
      the specified end point (`x` and `y`), then they will be proportionally
      scaled up until they are big enough, which will always result in a
      half-ellipse arc (i.e. an 180 degree sweep)

Args:
    rx (Number): radius in the x-direction.
    ry (Number): radius in the y-direction.
    rotation (Number): angle (in degrees) that the arc should be rotated
        clockwise from the principle axes. This parameter does not have
        a visual effect in the case that `rx == ry`.
    large_arc (bool): if True, the arc will cover a sweep angle of at least 180
        degrees. Otherwise, the sweep angle will be at most 180 degrees.
    positive_sweep (bool): if True, the arc will be swept over a positive angle,
        i.e. clockwise. Otherwise, the arc will be swept over a negative
        angle.
    dx (Number): abscissa of the arc's end point relative to the end point of
        the previous path element.
    dy (Number): ordinate of the arc's end point relative to the end point of
        the previous path element.
r   Fr>  )r[  r   rt  r`   r   r+  r?  r  )
r/   r  r  r(  r  r  rY  rZ  rp  r  s
             r   arc_relativePaintedPath.arc_relative  s    F 7bAg%%b--c"gs2w'O	<<)n-BmCHPU 	 	
 r   c                 f    U R                  [        5       SS9  SU l        U R                  SS5        g)z)
Explicitly close the current (sub)path.
Fr>  Tr   N)r?  r  r  rS  r~   s    r   closePaintedPath.close  s0     	egU31a r   c                     U R                   (       d;  U R                  R                  [        5       SS9  U R                  U l        SU l         g g )NFr>  T)r  r  r  r  r  r~   s    r   rF  *PaintedPath._insert_implicit_close_if_open  s>    ||(((F"&"8"8DDL r   Nc                    U R                  5         U R                  R                  XX4XV5      u  nnn[        R	                  X R
                  5      R                  5       nUR                  SUR                  5        SR                  U5      X44$ )Nr}   rP   )
rF  r  build_render_listr6   rp  r0   r  r  r?   rd   )	r/   r  r0   rM  r   r  r  r  rS  s	            r   r   PaintedPath.render  s     	++- ''99<
		

 #((

;NNP
2z//0xx$i>>r   c                 (    U R                  XX4XV5      $ )a  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `PaintedPath.render`.
r  r  s          r   r
  PaintedPath.render_debug  s    , {{<
 	
r   )r  r  r  r  r  r   r   r  NN))r7   r8   r   r9   r:   rs  rx  r   r0   r  r  rU  rS  r.  r   r7  r;  r?  rC  rH  rL  rK  rG  rS  rV  r[  r^  ra  rd  rg  rp  r{  r~  r  r  r  r  rF  r   r
  r;   r5   r   r   r  r    s   / 1 1 5 5 3 3 % % ' ' % % & & 9 9 @ @ 	: 	:  ;&2@*(&0"  , D$,.`/b!  UY?&
r   r  c                   B   ^  \ rS rSrSrSU 4S jjr SS jrS rSrU =r	$ )	ClippingPathi  a  
The PaintedPath API but to be used to create clipping paths.

.. warning::
    Unless you really know what you're doing, changing attributes of the clipping
    path style is likely to produce unexpected results. This is because the
    clipping path styles override implicit style inheritance of the `PaintedPath`
    it applies to.

    For example, `clippath.style.stroke_width = 2` can unexpectedly override
    `paintpath.style.stroke_width = GraphicsStyle.INHERIT` and cause the painted
    path to be rendered with a stroke of 2 instead of what it would have normally
    inherited. Because a `ClippingPath` can be painted like a normal `PaintedPath`,
    it would be overly restrictive to remove the ability to style it, so instead
    this warning is here.
c                 J   > [         TU ]  XS9  [        R                  U l        g )Nr   )rs   rs  r   r  rS  )r/   r   r   rz   s      r   rs  ClippingPath.__init__  s     1"'22r   c           
         U(       a  UR                  S5        U R                  R                  UUUUUUSS9u  nnn[        R	                  X R
                  5      nUR                  n	XR                  L a  [        R                  n	O[        U	R                     n	UR                  5       n
UR                  U	R                  5        UR                  U
R                  5        SR                  U5      X44$ )Nz<ClippingPath> F_push_stackrP   )r  r  r  r6   rp  r0   rV  ri  r   r  r2   r  rg   r?   rd   )r/   r  r0   rM  r   r  r  r  merged_stylerV  rS  s              r   r   ClippingPath.render  s     01 ''99 : 
		
 %**5**=(:: 4 44 < D D <!&&! "446
,223:++,xx$i>>r   c                 (    U R                  XX4XV5      $ )a{  
Render this path element to its PDF representation and produce debug
information.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).

Returns:
    The same tuple as `ClippingPath.render`.
r  r  s          r   r
  ClippingPath.render_debugH  s    * {{<
 	
r   )rS  r  r  )
r7   r8   r   r9   r:   rs  r   r
  r;   r   r   s   @r   r  r    s$    63
 UY*?X
 
r   r  c                       \ rS rSrS rS r\S 5       r\R                  S 5       r\S 5       r	\	R                  S 5       r	SS jr
S	 rS
 r\   SS j5       r   SS\4S jjr SS\4S jjrSrg)r  ib  c                 L    [        5       U l        / U l        S U l        S U l        g rR   )r6   r0   
path_items
_transform_clipping_pathr~   s    r   rs  GraphicsContext.__init__c  s!    "_
"r   c                 V   U R                  5       n[        R                  " U R                  U5      Ul        [        R                  " U R                  U5      Ul        [        R                  " U R
                  U5      Ul        [        R                  " U R                  U5      Ul        U$ rR   )	rz   r  r  r0   r  r  r  r.  r  r  s      r   rx  GraphicsContext.__deepcopy__j  sp    !}}TZZ6 MM$//4@ MM$..$? $d.@.@$ Gr   c                     U R                   $ rR   r  r~   s    r   r  GraphicsContext.transformt  s    r   c                     Xl         g rR   r  r   s     r   r  r  x  s    r   c                     U R                   $ )z-The `ClippingPath` for this graphics context.r  r~   s    r   r.  GraphicsContext.clipping_path|  s     """r   c                     Xl         g rR   r  r1  s     r   r.  r    s    )r   c                 t    U(       a  [         R                  " U5      nU R                  R                  U5        g)a  
Add a path element to this graphics context.

Args:
    item: the path element to add. May be a primitive element or another
        `GraphicsContext` or a `PaintedPath`.
    _copy (bool): if true (the default), the item will be copied before being
        appended. This prevents modifications to a referenced object from
        "retroactively" altering its style/shape and should be disabled with
        caution.
N)r  r  r  rg   r  s      r   r  GraphicsContext.add_item  s'     ==&Dt$r   c                     U R                   S	 g )Nr}   )r  r~   s    r   rB   GraphicsContext.remove_last_item  s    OOBr   c                 N    U R                   R                  UR                   5        g)z:Copy another `GraphicsContext`'s path items into this one.N)r  extend)r/   other_contexts     r   rp  GraphicsContext.merge  s    }778r   Nc           
      
   / nU R                   (       GaP  Ub&  UR                  U R                  R                   5        UR                  R	                  X R
                  5      n	UGb  U R                  (       a  UR                  SU R                   S35        / n
U	R                   H^  n[        X5      nXR                  Ld  M  [        U R
                  U5      U	R                  L a  SnOSnU
R                  U SU U 35        M`     U
(       ae  UR                  S5        U
 H9  nUR                  US-   5        UR                  U5        UR                  S	5        M;     UR                  US
-   5        OUR                  S	5        SU	R                  1nU R
                  nU	R                  U R
                  R                  :w  a1  [        R                  " U R
                  5      nU	R                  Ul        U	R                  nU	R                  nUUR                  :w  d  UUR                  :w  a8  UU R
                  L a  [        R                  " U5      nUUl        UUl        UU4nOSnUR!                  U5      nUb  UR                  [#        U5       S35        U R
                  R$                  nU R
                  R&                  nUU;  a-  UR                  UR)                  5       R+                  5       5        UU;  a-  UR                  UR)                  5       R-                  5       5        Ub0  UR                  [#        US   5      S[/        US   5       S3-   5        U(       Ga  U R0                  bS  UR                  US-   5        U R0                  R3                  UU	UUUUS-   5      u  nnnU(       a  UR                  U5        U R                   SS  HM  nUR                  US-   5        UR3                  UU	UUUUS-   5      u  np4U(       d  M<  UR                  U5        MO     UR                  US-   5        U R                   S   R3                  UU	UUUUS-   5      u  np4U(       a  UR                  U5        OU R0                  b8  U R0                  R5                  XX45      u  nnnU(       a  UR                  U5        U R                    H2  nUR5                  XX45      u  np4U(       d  M!  UR                  U5        M4     U R6                  b.  UR9                  SU R6                  R5                  U5      S   5        U(       a#  UR9                  SS5        UR                  S5        XU4$ )aL  
Build a list composed of all all the individual elements rendered.

This is used by `PaintedPath` and `ClippingPath` to reuse the `GraphicsContext`
rendering process while still being able to inject some path specific items
(e.g. the painting directive) before the render is collapsed into a single
string.

Args:
    gsd_registry (GraphicsStateDictRegistry): the owner's graphics state
        dictionary registry.
    style (GraphicsStyle): the current resolved graphics style
    last_item: the previous path element.
    initial_point: last position set by a "M" or "m" command
    debug_stream (io.TextIO): the stream to which the debug output should be
        written. This is not guaranteed to be seekable (e.g. it may be stdout or
        stderr).
    pfx (str): the current debug output prefix string (only needed if emitting
        more than one line).
    _push_stack (bool): if True, wrap the resulting render list in a push/pop
        graphics stack directive pair.

Returns:
    `tuple[list[str], last_item]` where `last_item` is the past path element in
    this `GraphicsContext`
Nr$   r%   z (inherited)r   z: z {
r  r   u   }┐
r  r   rP   r	   r  r  r
  r}   r  r  r  )r  r  rz   r7   rp  r0   r  rh  r\   ri  rg   rT  r  r  r`  ra  r3   rS   rW  rY  r,   lowerupperrH   r.  r
  r   r  r  )r/   r  r0   rM  r   r  r  r  r  r  
styles_dbgattrrV   	inheritedstyle_dbg_lineNO_EMIT_SET
emit_styledash_pattern
dash_phase	emit_dashr  rW  rY  rendered_cpathr  __r   r  s                               r   r  !GraphicsContext.build_render_list  s   J ???'""dnn&=&=%>@ ??00

CL'?? &&4??*;1'=>
(99D!,5C"6"66"4::t48L8LL(6I(*I"))TF"SE)*EF :  &&v.*4$**3<8$**>:$**40 +5
 !&&sX~6 &&t,!5!56KJ..$**2O2OO!]]4::6
0<0O0O
- (;;L%77J 9 99e555+!%z!:J1=
./9
,):6	 	*99*EO*""&:?&K%LC#PQ ..J::22L,"":#7#7#9#?#?#AB;.""<#9#9#;#A#A#CD$""(16-	!56b9:
 %%1 &&sZ'78,0,>,>,K,K$$!%$h-)NAr &#**>: OOCR0D &&sZ'789=9J9J$$!%$h:6Hi  x#**84 1 ""3#3459__R5H5U5U  ! &L62) &&x0 %%1,0,>,>,E,E$I-)NAr &#**>: OOD9=$I:6Hi  x#**84 , ~~)""1dnn&;&;I&Fq&IJ""1c*""3'}44r   r0   c           
      X    U R                  UUUUUUUS9u  pnSR                  U5      X44$ )Nr  rP   )r  rd   )	r/   r  r0   rM  r   r  r  r  r  s	            r   r   GraphicsContext.renderU  sJ     150F0F# 1G 1
- xx$i>>r   c           
      ,    U R                  UUUUUUUS9$ )Nr  r  )r/   r  r0   rM  r   r  r  r  s           r   r
  GraphicsContext.render_debugk  s/     {{#  
 	
r   )r  r  r  r0   r  )NNT)r7   r8   r   r9   rs  rx  r   r  r  r.  r  rB  rp  r   r  r  r   r
  r;   r5   r   r   r  r  b  s    #     # # * *%" 9  u5 u5z ? ?< 
 
 
r   r  )g        g      ?rR   )r}   r}   )Ur:   r  r  r   recollectionsr   collections.abcr   
contextlibr   typingr   r   r   enumsr
   r   r   r   r   r   r   syntaxr   r   utilr   r   r   r   r   r  r  r  ra   r  
WHITESPACE	EOL_CHARS
DELIMITERScompileSTR_ESCSTR_ESC_MAPr(   rB   rH   rS   rn   r   r   r   r   r   r   r   r   r   r  r6   r  r  r  r  r  r  r#  r*  r3  r;  rA  rG  rS  rZ  rh  ro  r  r  r  r  r  r  r  r  r  r  r5   r   r   <module>r     s@     # $ % . .    &   
sE7??*	+E7??+ }%
 0f	 9|$
 " **(
)




		
	 .3 9F,Y
vfV}sHV<L6MN,Y^ "'	 T V U  	:
vhv./0:> #(	  	 	Y&M&M&M&M(6"#	
	YD #(	 V B 	  Y W  	94$,
0E0%RPX<TIJ TIn]

 ]
@        o odA@1: @1F>1: >1BA1: A1H?1: ?1D;1Z ;1|?1Z ?1D;1: ;1|?1: ?1DE1* E1PM1* M1`Y1: Y1xE1: E1PX
* X
vOY* OYd=1
 =1@ADz ADHkGj kG\:1J :1z;1J ;1|g gTx
 x
vc
; c
L[
 [
r   