+
    ŠvjXu  ã                  ób  € ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	H
t
HtHt ^RIHt ^RIHt ^R	IHt ^R
IHt ^RIHtHtHtHt ^RIHt ^RIHtHtHtH t H!t!H"t" ^RI#H$t$H%t% ]
'       d   ^ RI&H't' ^RI(H)t) ^t*] ! R R4      4       t+ ! R R]4      t, ! R R]4      t- ! R R],4      t.R# )é    )ÚannotationsN)Ú	dataclass)ÚIntEnum)ÚBytesIO)ÚTYPE_CHECKINGÚAnyÚcast)Úfill_from_encoding)ÚCORE_FONT_METRICS)ÚFont)Úlogger_warning)ÚAnnotationDictionaryAttributesÚBorderStylesÚFieldDictionaryAttributesÚPageAttributes)ÚPdfReadError)ÚDecodedStreamObjectÚDictionaryObjectÚIndirectObjectÚ
NameObjectÚNumberObjectÚRectangleObject)ÚByteStringObjectÚTextStringObject)Ú	PdfWriter)Ú
PageObjectc                  óZ   € ] tR t^!t$ RtR
tR]R&   ^tR]R&   ]P                  t
R]R&   RtR	# )ÚBaseStreamConfigzBA container representing the basic layout of an appearance stream.z3RectangleObject | tuple[float, float, float, float]Ú	rectangleÚintÚborder_widthÚstrÚborder_style© N)ç        r%   r%   r%   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__r!   r   ÚSOLIDr#   Ú__static_attributes__r$   ó    Úd/var/www/html/daimler-pipeline/venv/lib/python3.14/site-packages/pypdf/generic/_appearance_stream.pyr   r   !   s*   ‡ áLØEY€IÐBÓYØ€L�#ÓØ$×*Ñ*€L�#×*r.   r   c                  ó2   a € ] tR t^)tRtR V 3R lltRtV ;t# )ÚBaseStreamAppearancez^A class representing the very base of an appearance stream, that is, a rectangle and a border.c               ó    € V ^8„  d   QhRRRR/# )é   ÚlayoutúBaseStreamConfig | NoneÚreturnÚNoner$   )Úformats   "r/   Ú__annotate__Ú!BaseStreamAppearance.__annotate__,   s   € ÷ Lñ LÐ6ð L¸4ñ Lr.   c                ó  <€ \         SV `  4        T;'       g    \        4       V n        \	        R4      V \	        R4      &   \	        R4      V \	        R4      &   \        V P                  P                  4      V \	        R4      &   R# )zd
Takes the appearance stream layout as an argument.

Args:
    layout: The basic layout parameters.
z/XObjectú/Typez/Formú/Subtypeú/BBoxN)ÚsuperÚ__init__r   Ú_layoutr   r   r   )Úselfr4   Ú	__class__s   &&€r/   r@   ÚBaseStreamAppearance.__init__,   si   ø€ ô 	‰ÑÔØ×3Ð3Ô!1Ó!3ˆŒÜ$.¨zÓ$:ˆŒZ˜Ó Ñ!Ü'1°'Ó':ˆŒZ˜
Ó#Ñ$Ü$3°D·L±L×4JÑ4JÓ$KˆŒZ˜Ó Ó!r.   )rA   )r&   r'   r(   r)   r*   r@   r-   Ú__classcell__©rC   s   @r/   r1   r1   )   s   ø† Ùh÷Lö Lr.   r1   c                  ó&   € ] tR t^:tRt^ t^t^tRtR# )ÚTextAlignmentzODefines the alignment options for text within a form field's appearance stream.r$   N)	r&   r'   r(   r)   r*   ÚLEFTÚCENTERÚRIGHTr-   r$   r.   r/   rH   rH   :   s   † ÙYà€DØ€FØ„Er.   rH   c                  óð   a € ] tR t^BtRtRR R lltRRRRR]P                  RR3R	 R
 lltRRRRRRRRR]P                  RR3R V 3R lllt	]
R R l4       t]
RR R ll4       t]RR R ll4       tRtV ;t# )ÚTextStreamAppearancea4  
A class representing the appearance stream for a text-based form field.

This class generates the content stream (the `ap_stream_data`) that dictates
how text is rendered within a form field's bounding box. It handles properties
like font, font size, color, multiline text, and text selection highlighting.
c               ó<   € V ^8„  d   QhRRRRRRRRRRRR	R
RRRRR/	# )r3   Úfontr   Ú	font_sizeÚfloatÚleading_factorÚfield_widthÚfield_heightÚtextr"   Úmin_font_sizeÚfont_size_stepr6   z%tuple[list[tuple[float, str]], float]r$   )r8   s   "r/   r9   Ú!TextStreamAppearance.__annotate__K   so   € ÷ L2ñ L2àðL2ð ðL2ð ð	L2ð
 ðL2ð ðL2ð ðL2ð ðL2ð ðL2ð 
/ñL2r.   c	           
     óê  € Tp	VP                  RR4      P                  R4      p
. p. p^ pVP                  V,          R,          pV
 EFG  pVP                  4       '       g   VP	                  R4       K-  VP                  R4      p\        V4       FÉ  w  ppVP                  V4      V,          R,          pVV,           V'       d   TM^ ,           pVV8”  d2   V'       d*   VP	                  VRP                  V4      34       V.pTpKw  V'       g!   VV8”  d   VP	                  VV34       . p^ pKŸ  V'       d	   WÞ,          pVP	                  V4       VV,          pKË  	  V'       g   EK!  VP	                  VRP                  V4      34       . p^ pEKJ  	  V\        V4      ^,
          V,          V,          ,           pVV8”  d(   W(,
          pVV8¼  d   V P                  VVVVVV	VV4      # V\        V^4      3# )aç  
Takes a piece of text and scales it to field_width or field_height, given font_name
and font_size. Wraps text where necessary.

Args:
    font: The font to be used.
    font_size: The font size in points.
    leading_factor: The line distance.
    field_width: The width of the field in which to fit the text.
    field_height: The height of the field in which to fit the text.
    text: The text to fit with the field.
    min_font_size: The minimum font size at which to scale the text.
    font_size_step: The amount by which to decrement font size per step while scaling.

Returns:
    The text in the form of list of tuples, each tuple containing the length of a line
    and its contents, and the font_size for these lines and lengths.
Ú
Úéè  Ú )r%   Ú )ÚreplaceÚsplitÚspace_widthÚstripÚappendÚ	enumerateÚ
text_widthÚjoinÚlenÚ_scale_textÚround)rB   rO   rP   rR   rS   rT   rU   rV   rW   Ú	orig_textÚ
paragraphsÚwrapped_linesÚcurrent_line_wordsÚcurrent_line_widthra   Ú	paragraphÚwordsÚiÚwordÚ
word_widthÚ
test_widthÚestimated_total_heightÚnew_font_sizes   &&&&&&&&&              r/   rh   Ú TextStreamAppearance._scale_textK   sï  € ð: ˆ	Ø—\‘\ $¨Ó-×3Ñ3°DÓ9ˆ
ØˆØ(*ÐØ$%ÐØ×&Ñ&¨Õ2°TÕ9ˆÜ#ˆIØ—?‘?×$Ò$Ø×$Ñ$ YÔ/ÙØ—O‘O CÓ(ˆEÜ$ UÖ+‘��4Ø!Ÿ_™_¨TÓ2°YÕ>ÀÕE�
Ø/°*Õ<ÏqÁÐVWÕX�
Ø Ô+×0BØ!×(Ñ(Ð*<¸c¿h¹hÐGYÓ>ZÐ)[Ô\Ø*.¨Ð&Ø)3Ò&ß+°
¸[Ô0HØ!×(Ñ(¨*°dÐ);Ô<Ø)+Ð&Ø)*Ò&ç)Ø*Õ9Ð*Ø&×-Ñ-¨dÔ3Ø&¨*Õ4Ò&ñ ,÷  "Ò!Ø×$Ñ$Ð&8¸#¿(¹(ÐCUÓ:VÐ%WÔXØ%'Ð"Ø%&Ó"ñ1 $ð4 "+¬c°-Ó.@À1Õ.DÈÕ-VÐYbÕ-bÕ!bÐØ! LÔ0à%Õ6ˆMØ Ô-Ø×'Ñ'ØØ!Ø"ØØ ØØ!Ø"ó	ð 	ð œe I¨qÓ1Ð1Ð1r.   Nú/Helvr%   z0 gFc               óH   € V ^8„  d   QhRRRRRRRRR	RR
RRRRRRRRRRRRR/# )r3   rU   r"   Ú	selectionúlist[str] | NonerO   r   Úfont_glyph_byte_mapzdict[str, bytes] | NoneÚ	font_namerP   rQ   Ú
font_colorÚis_multilineÚboolÚ	alignmentrH   Úis_combÚ
max_lengthú
int | Noner6   Úbytesr$   )r8   s   "r/   r9   rX   ™   s�   € ÷ eñ eàðeð $ðeð ð	eð
 5ðeð ðeð ðeð ðeð ðeð !ðeð ðeð ðeð 
ñer.   c                óN  € V P                   P                  pT;'       g    / p\        V\        4      '       d   \	        V4      pVP
                  P                  ^,          VP
                  P                  ^,          ,
          R,          pV P                   P                  R9   d   ^M^p\        V P                   P                  V,          ^4      pVP                  ^V,          ,
          pVP                  ^V,          ,
          pV^ 8X  d˜   RpV'       d   RpV'       d#   \        pV P                  VVVVVVV4      w  ppEM>VV,          pVP                  V4      R,          pTT;'       g    ^,          p\        \        \!        VV4      V4      ^4      pVV,          V3.pMÝV
'       d‡   V'       d$   \#        V4      V8”  d   \%        R\&        VVR7       \)        V4       UUu. uFC  w  ppTT;'       g    \#        V4      8  g   K"  VP                  V4      V,          R,          V3NKE  	  pppMOVP+                  RR4      P-                  R4       Uu. uF$  pVP                  V4      V,          R,          V3NK&  	  ppV'       dE   VP                  V,           VP
                  P                  ^,          V,          R,          ,
          pM9VVVP
                  P.                  V,          R,          ,
          ^,          ,           pV R	V R
V 2pR^V,           R	V R	V R	V RV R2P1                  4       p^ p\)        V4       EFE  w  pw  ppV'       d`   VV9   dY   VRVVV,          V,          ,
          ^,
           R	VP                  ^,
           R	V^,            RV R2	P1                  4       ,          p^ p V
'       d=   V'       d5   VP                  V,          p!V!V,
          ^,          p"VV!,          V",           p MpV	\2        P4                  8X  d#   VP                  V^,          ,
          V,
          p M9V	\2        P6                  8X  d   VP                  V,
          ^,          p M	V^,          p V V,
          p#^ p$V^ 8X  d   Tp$MV
'       d   Rp$M
V) V,          p$VV# R	V$ R2P1                  4       ,          pT pV U%u. uF$  p%VP9                  V%V%P1                  R4      4      NK&  	  p&p%\:        ;QJ d    R V& 4       F  '       g   K   RM	  RM! R V& 4       4      '       dF   VRRP=                  V&4      P?                  4       P1                  4       ,           R,           ,          pEK  VRRP=                  V&4      ,           R,           ,          pEKH  	  VR,          pV# u uppi u upi u up%i )aL  
Generates the raw bytes of the PDF appearance stream for a text field.

This private method assembles the PDF content stream operators to draw
the provided text within the specified rectangle. It handles text positioning,
font application, color, and special formatting like selected text.

Args:
    text: The text to be rendered in the form field.
    selection: An optional list of strings that should be highlighted as selected.
    font: The font to use.
    font_glyph_byte_map: An optional dictionary mapping characters to their
        byte representation for glyph encoding.
    font_name: The name of the font resource to use (e.g., "/Helv").
    font_size: The font size. If 0, it is automatically calculated
        based on whether the field is multiline or not.
    font_color: The color to apply to the font, represented as a PDF
        graphics state string (e.g., "0 g" for black).
    is_multiline: A boolean indicating if the text field is multiline.
    alignment: Text alignment, can be TextAlignment.LEFT, .RIGHT, or .CENTER.
    is_comb: Boolean that designates fixed-length fields, where every character
        fills one "cell", such as in a postcode.
    max_length: Used if is_comb is set. The maximum number of characters for a fixed-
        length field.

Returns:
    A byte string containing the PDF content stream data.

g     @�@g      @Fr\   zZLength of text %(text)s exceeds maximum length (%(max_length)d) of field, input truncated.)ÚsourcerU   rƒ   rZ   r[   r]   z Tf zq
/Tx BMC 
q
z	 re
W
BT
z1 z re
0.5 0.5 0.5 rg s
r%   z Td
z	utf-16-bec              3  ó>   "  € T F  p\        V4      ^8¬  x € K  	  R# 5i)r3   N)rg   )Ú.0Úcs   & r/   Ú	<genexpr>ÚHTextStreamAppearance._generate_appearance_stream_data.<locals>.<genexpr>9  s   é € Ð5© 1”3�q“6˜Q–;«ùs   ‚Tó   <r.   s   > Tj
ó   (s   ) Tj
s   ET
Q
EMC
Q
>   ú/Bú/I) rA   r   Ú
isinstanceÚtupler   Úfont_descriptorÚbboxr#   Úmaxr!   ÚheightÚwidthÚDEFAULT_FONT_SIZE_IN_MULTILINErh   re   ri   Úminrg   r   r&   rd   r_   r`   ÚascentÚencoderH   rK   rJ   ÚgetÚanyrf   Úhex)'rB   rU   rz   rO   r|   r}   rP   r~   r   r�   r‚   rƒ   r   rR   ÚfactorÚmarginrT   rS   rV   ÚlinesÚmax_vertical_sizeÚtext_width_unscaledÚmax_horizontal_sizeÚindexÚcharÚlineÚy_offsetÚdefault_appearanceÚ	ap_streamÚcurrent_x_posÚline_numberÚ
line_widthÚdesired_abs_x_startÚ
cell_widthÚcentering_offset_in_cellÚx_rel_offsetÚy_rel_offsetrŠ   Úencoded_lines'   &&&&&&&&&&&&                           r/   Ú _generate_appearance_stream_dataÚ5TextStreamAppearance._generate_appearance_stream_data™   sV  € ðV —L‘L×*Ñ*ˆ	Ø1×7Ð7°RÐÜ�i¤×'Ò'Ü'¨	Ó2ˆIØ×.Ñ.×3Ñ3°AÕ6¸×9MÑ9M×9RÑ9RÐSTÕ9UÕUÐY_Õ_ˆð —l‘l×/Ñ/°<Ô?‘ÀQˆÜ�T—\‘\×.Ñ.°Õ7¸Ó;ˆØ ×'Ñ'¨!¨f­*Õ4ˆØ—o‘o¨¨F­
Õ2ˆð ˜Œ>ØˆMßØ$�ßÜ:�	Ø#'×#3Ñ#3ØØØ"ØØ ØØ!ó$Ñ �’yð %1°>Õ$AÐ!Ø&*§o¡o°dÓ&;¸dÕ&BÐ#Ø&1Ð5H×5MÐ5MÈAÕ&NÐ#Ü!¤#¤cÐ*;Ð=PÓ&QÐS`Ó"aÐcdÓe�	Ø-°	Õ9¸4Ð@ÐA‘ßßœc $›i¨*Ô4Üð5ô $ØØ)õô "+¨4¤ôWñ "1‘+�%˜°E¸Z×=TÐ=TÌ3ÈtË9Ñ4UôØ—‘ Ó%¨	Õ1°DÕ8Øóñ "1ð ñ WˆEð Ÿ,™, t¨TÓ2×8Ñ8¸Ô>ó@ñ ?�$ð —‘ Ó%¨	Õ1°DÕ8Øóñ ?ð ð @÷ Ø ×'Ñ'¨&Õ0°4×3GÑ3G×3LÑ3LÈQÕ3OÐR[Õ3[Ð^dÕ3dÕd‰Hà ,°×1EÑ1E×1LÑ1LÈyÕ1XÐ[_Õ1_Õ"_ÐcdÕ!dÕeˆHØ )˜{¨!¨I¨;°d¸:¸,ÐGÐð ˜q 6�z˜l¨!¨F¨8°1°[°MÀÀ<À.ð QØ,Ð-¨Rð1ç
‰&‹(ð 	ð  !ˆä/8¸×/?Ñ+ˆKÑ+˜* dß˜T YÔ.àØ˜ [°9Õ%<¸~Õ%MÕNÐQRÕRÐSÐSTØ —‘¨Õ*Ð+¨1¨Y¸­]¨Oð <)Ø);Ð(<¸Bð@÷ ‘&“(õ	�	ð *+ÐßŸ:à&Ÿ_™_¨zÕ9�
ð -7¸Õ,CÀqÕ+HÐ(à'2°ZÕ'?ÐC[Õ&[Ñ#Øœm×1Ñ1Ô1Ø&/§o¡o¸À½
Õ&BÀZÕ&OÑ#Øœm×2Ñ2Ô2Ø'0§¡¸Õ'CÀqÕ&HÑ#à&,¨q¥jÐ#ð /°Õ>ˆLð #$ˆLØ˜aÔØ'‘ßØ"‘à!*˜{¨^Õ;�ð ˜L˜>¨¨<¨.¸Ð>×EÑEÓGÕGˆIð 0ˆMñ LPó)ÙKOÀaÐ#×'Ñ'¨¨1¯8©8°KÓ+@ÖAÉ4ð ð )÷ ‹sÑ5©Ó5�s�sŠsÑ5©Ó5×5Ò5Ø˜T S§X¡X¨lÓ%;×$@Ñ$@Ó$B×$IÑ$IÓ$KÕKÈiÕWÕW“	à˜T C§H¡H¨\Ó$:Õ:¸YÕFÕF“	ñg 0@ðh 	Ð'Õ'ˆ	ØÐùóYWùò
@ùò~)s   Ç#VÇ5VÈ%VÉ*VÒ6*V"r^   c               óL   € V ^8„  d   QhRRRRRRRRR	R
RRRRRRRRRRRRRRRR/# )r3   r4   r5   rU   r"   rz   r{   rO   zFont | NoneÚfont_resourcez(DictionaryObject | IndirectObject | Noner}   rP   rQ   r~   r   r€   r�   rH   r‚   rƒ   r„   r6   r7   r$   )r8   s   "r/   r9   rX   @  sœ   € ÷ Wñ Wà'ðWð ðWð $ð	Wð
 ðWð @ðWð ðWð ðWð ðWð ðWð !ðWð ðWð ðWð 
ñWr.   c                ó¶  <€ \         SV `  V4       V'       d	   V'       gj   Rp\        R,          p\        R/ \	        \        \        R4      \        R4      4      4      RVP                  VP                  R7      pVP                  4       p/ p\        VP                  \        4      '       d`   VP                  P                  RR4       VP                  P!                  4        F$  w  ppVP#                  VP                  4      VV&   K&  	  M«VP                  P!                  4        UUu/ uF  w  ppV\%        V34      bK  	  pppVP                  P!                  4        UUu/ uF  w  ppV\%        V34      bK  	  pppVP                  P!                  4        F  w  ppVP'                  VV4      VV&   K  	  V P)                  VVVVVVVV	V
VVR7      pV P+                  \-        V4      4       \/        \1        V4      4      V \3        R	4      &   \5        \3        R
4      \5        \3        V4      \7        VRV4      /4      /4      V \3        R4      &   R# u uppi u uppi )a€  
Initializes a TextStreamAppearance object.

This constructor creates a new PDF stream object configured as an XObject
of subtype Form. It uses the `_appearance_stream_data` method to generate
the content for the stream.

Args:
    layout: The basic layout parameters.
    text: The text to be rendered in the form field.
    selection: An optional list of strings that should be highlighted as selected.
    font: A Font object. Falls back to Type 1 Helvetica if not given.
    font_resource: An optional variable that represents a PDF font dictionary. Falls back
        to Type 1 Helvetica if not given.
    font_name: The name of the font resource, e.g., "/Helv".
    font_size: The font size. If 0, it's auto-calculated.
    font_color: The font color string.
    is_multiline: A boolean indicating if the text field is multiline.
    alignment: Text alignment, can be TextAlignment.LEFT, .RIGHT, or .CENTER.
    is_comb: Boolean that designates fixed-length fields, where every character
        fills one "cell", such as in a postcode.
    max_length: Used if is_comb is set. The maximum number of characters for a fixed-
        length field.

rx   Ú	Helveticaé   Úcp1252ÚType1©ÚnameÚcharacter_mapÚencodingÚsub_typer“   Úcharacter_widthsN©r}   rP   r~   r   r�   r‚   rƒ   ú/Lengthú/FontÚindirect_referenceú
/Resourceséÿÿÿÿ)r?   r@   r   r   ÚdictÚzipÚranger
   r“   rÂ   Úas_font_resourcer‘   rÀ   r"   r¿   ÚpopÚitemsr›   r…   rœ   r´   Úset_datar   r   rg   r   r   Úgetattr)rB   r4   rU   rz   rO   r·   r}   rP   r~   r   r�   r‚   rƒ   Úcore_font_metricsr|   ÚkÚvÚfont_encoding_revÚkeyÚvalueÚap_stream_datarC   s   &&&&&&&&&&&&&        €r/   r@   ÚTextStreamAppearance.__init__@  s%  ø€ ôP 	‰Ñ˜Ô çŸ=ØˆIÜ 1°+Õ >ÐÜØ Ø Üœc¤%¨£*Ô.@ÀÓ.JÓKÓLØ Ø 1× AÑ AØ!2×!CÑ!CôˆDð !×1Ñ1Ó3ˆMà02ÐÜ�d—m‘m¤S×)Ò)Ø×Ñ×"Ñ" 2 tÔ,Ø×*Ñ*×0Ñ0Ö2‘��1Ø)*¯©°$·-±-Ó)@Ð# AÓ&ò 3ð ?C¿m¹m×>QÑ>QÔ>SÔ"TÑ>S±d°a¸ 1¤e¨Q¨D£k¢>Ñ>SÐÑ"TØ<@¿M¹M×<OÑ<OÔ<QÔ RÑ<Q±D°A°q ¤E¨1¨$£K¢Ñ<QÐÑ RØ"×0Ñ0×6Ñ6Ö8‘
��UØ->×-BÑ-BÀ3ÈÓ-LÐ# EÓ*ñ 9ð ×>Ñ>ØØØØØØØ!Ø%ØØØ!ð ?ó 
ˆð 	�‰Ô& ~Ó6Ô7Ü&2´3°~Ó3FÓ&GˆŒZ˜	Ó"Ñ#ä)9Ü�wÓÔ!1Ü˜9Ó%¤w¨}Ð>RÐTaÓ'bð3ó "ð;
ó *ˆŒZ˜Ó%Ó&ùó- #UùÛ Rs   Ä(IÅ!Ic          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r3   r}   r"   Ú
annotationr   Ú	acro_formrU   r6   ztuple[str, Font]r$   )r8   s   "r/   r9   rX   š  sA   € ÷ Bñ BØðBà(ðBð (ðBð ð	Bð
 ñBr.   c                	ó  € \        \        VP                  R VP                  R \        4       4      4      4      pVP                  R\        4       4      pVP                  V R4      pV'       d   \        P
                  ! V4      pM£V P                  R4      \        9  d   \        R\        V R7       Rp \        V P                  R4      ,          p\	        V P                  R4      / \        \        \        R4      \        R4      4      4      R	VP                  VP                  R
7      pVP!                  V4      p	V	'       g˜   VP                  P"                  '       db   VP$                  R8X  dQ    VP'                  \)        VP                  P"                  P+                  4       4      4      pRp VP!                  V4      p	V	'       g   \        R\        VR7       W3#   \,        \.        3 d   p
\        R\        T
R7        Rp
?
LERp
?
ii ; i)ú/DRrÅ   NÚ/zEFont dictionary for %(font_name)s not found; defaulting to Helvetica.)r‡   r}   z
/Helveticarº   r»   r¼   r½   ÚTrueTypez/PYPDF1z/Unable to use embedded font for encoding: %(e)s)r‡   Úez¿Text string '%(text)s' contains characters not supported by font encoding. This may result in text corruption. Consider calling writer.update_page_form_field_values with auto_regenerate=True.)r‡   rU   )r	   r   Úget_inheritedrœ   r   Úfrom_font_resourceÚremoveprefixr   r   r&   rÉ   rÊ   rË   r
   r“   rÂ   Ú
can_encodeÚ	font_filerÁ   Úfrom_truetype_font_filer   Úget_dataÚImportErrorr   )r}   rÚ   rÛ   rU   Úacro_form_resourcesÚacro_form_font_resourcesr·   rO   rÑ   Ú	encodablerà   s   &&&&       r/   Ú_find_annotation_font_resourceÚ3TextStreamAppearance._find_annotation_font_resource™  sÅ  € ô $(ÜØ×$Ñ$ØØ—‘˜eÔ%5Ó%7Ó8óó$
Ðð $7×#:Ñ#:¸7ÔDTÓDVÓ#WÐ Ø0×4Ñ4°YÀÓEˆßÜ×*Ò*¨=Ó9‰Dð
 ×%Ñ% cÓ*Ô2CÔCäØ[Ü#Ø'õð
 )�	Ü 1°)×2HÑ2HÈÓ2MÕ NÐÜØ×+Ñ+¨CÓ0Ø Üœc¤%¨£*Ô.@ÀÓ.JÓKÓLØ Ø 1× AÑ AØ!2×!CÑ!CôˆDð —O‘O DÓ)ˆ	çð ×#Ñ#×-×-Ð-°$·-±-À:Ô2MðlØ×7Ñ7¼À×@TÑ@T×@^Ñ@^×@gÑ@gÓ@iÓ8jÓk�DØ )�IØ $§¡°Ó 5�I÷ Üðkô $Øõð ˆÐøô $¤\Ð2ô lÜ"Ð#TÔ]eÐij×kÒkûðlús   Å.AG ÇHÇ+HÈHc               ó0   € V ^8„  d   QhRRRRRRRRR	R
RR/# )r3   Úwriterr   r}   r"   rO   r   Útarget_resource_dictr   ÚpagezPageObject | Noner6   r   r$   )r8   s   "r/   r9   rX   ß  sD   € ÷ 'ñ 'Øð'àð'ð ð'ð /ð	'ð
  ð'ð 
ñ'r.   c                ó´  € VP                  \        R4      \        4       4      P                  4       pW9  d   VP	                  V V\        V4      4      pMWQ,          pV'       dt   \        \        V\        P                  ,          4      P                  \        R4      \        4       4      P                  4       pW9  d   \        VRV4      V\        V4      &   V# )z¯
Unified helper to sync fonts from an AP stream to a target resource dictionary (e.g., AcroForm /DR).
Will sync to page resources as well when page is added to the arguments.
rÅ   rÆ   )	Ú
setdefaultr   r   Ú
get_objectÚ_add_to_writerr	   r   Ú	RESOURCESrÐ   )rï   r}   rO   rð   rñ   Útarget_fontsÚfont_resource_referenceÚpage_fonts_resources   &&&&&   r/   Ú&_sync_appearance_stream_font_resourcesÚ;TextStreamAppearance._sync_appearance_stream_font_resourcesÞ  sÄ   € ð ,×6Ñ6´zÀ'Ó7JÔL\ÓL^Ó_×jÑjÓlˆØÔ(Ø&*×&9Ñ&9ØØÜ˜9Ó%ó'Ñ#ð '3Õ&=Ð#çÜ"&Ô'7¸¼n×>VÑ>VÕ9WÓ"X×"cÑ"cÜ˜7Ó#Ô%5Ó%7ó#ç‰j‹lð  ð Ô3Ü=DØ+Ð-AÐCZó>Ð#¤J¨yÓ$9Ñ:ð 'Ð&r.   c               ó<   € V ^8„  d   QhRRRRRRRRR	RR
RRRRRRR/	# )r3   rï   r   rñ   r   Úflattenr€   rÛ   r   ÚfieldrÚ   Úuser_font_namer"   Úuser_font_sizerQ   r6   rM   r$   )r8   s   "r/   r9   rX      so   € ÷ Z%ñ Z%àðZ%ð ðZ%ð ð	Z%ð
 $ðZ%ð  ðZ%ð %ðZ%ð ðZ%ð ðZ%ð 
ñZ%r.   c	                ó
  € \        \        V\        P                  ,          4      p	\        ^ ^ \	        V	^,          V	^ ,          ,
          4      \	        V	^,          V	^,          ,
          4      34      p
VP                  \        P                  VP                  \        P                  R4      4      pV'       g   \        R4      pMVP                  4       pVP                  \        P                  ^ 4      pVP                  \        P                  R4      R8X  d‚   V\        P                  P                  ,          ^ 8X  d\   RP                  VP                  \        P                   . 4      4      pVP                  R. 4      p\#        V\$        4      '       g   V.pMVP                  RR4      p. pVP'                  RR	4      P'                  R
R4      P'                  RR4      p\(        P*                  ! RV4       Uu. uF  qÿ'       g   K  VNK  	  ppVP-                  VP/                  R4      ^,
          4      p\1        VP-                  VP/                  R4      ^,
          4      4      pVP3                  R4       RP                  V4      pV'       d   TpMTpV^ 8”  d   TpV P5                  VWdV4      w  ppVV8w  d(   \        VP'                  VV4      4      V\7        R4      &   T P9                  TTTVP;                  \7        R4      \=        4       4      V'       d   TMR4      pRpRpV\        P                  P>                  ,          '       d   RpVP                  R4      pRpV\        P                  P@                  ,          '       d   RpVP                  R\B        PD                  4      p^p\F        PH                  pRV9   dO   \        \<        VR,          4      P                  RV4      p\        \<        VR,          4      P                  RV4      p\K        V
VVR7      pV ! VVVVVVVVVVVVR7      p\        PL                  V9   d¾   \        \<        V\        PL                  ,          4      P                  R/ 4      PO                  4        Fv  w  pp VR 9   d   K  VR8X  d\   RV 9  d%   \=        4       V P                  4       \7        R4      &   \Q        VRV4      V R,          P                  4       \7        V4      &   Kq  V VV&   Kx  	  V# u upi )!a¥  
Creates a TextStreamAppearance object from a text field annotation.

This class method is a factory for creating a `TextStreamAppearance`
instance by extracting all necessary information (bounding box, font,
text content, etc.) from the PDF field and annotation dictionaries.
It respects inheritance for properties like default appearance (`/DA`).

Args:
    writer: The PdfWriter instance that we are creating text stream appearances for.
    page: The page that we are processing annotations for.
    flatten: Whether we flatten text annotations or not. If true, add new font resource
        to the page font resources. Otherwise, add them to the AcroForm resources.
    acro_form: The root AcroForm dictionary from the PDF catalog.
    field: The field dictionary object.
    annotation: The widget annotation dictionary object associated with the field.
    user_font_name: An optional user-provided font name to override the
        default. Defaults to an empty string.
    user_font_size: An optional user-provided font size to override the
        default. A value of -1 indicates no override.

Returns:
    A new `TextStreamAppearance` instance configured for the given field.

Nz/Helv 0 Tf 0 gz/Txz/ChrZ   z/Vr^   Ú\z\\Ú(z\(Ú)z\)z\sÚTfr]   z/DArÝ   FTz/MaxLenz/Qz/BSz/Wz/S)r   r!   r#   rÃ   z/NrÇ   rÅ   rÆ   >   r>   r<   ú/FilterrÄ   r=   ))r	   r   r   ÚRectÚabsrá   ÚDArœ   r   rô   r   ÚFfÚFTÚFfBitsÚComborf   ÚOptr‘   Úlistr_   Úrer`   rÍ   r¥   rQ   Úremoverì   r   rú   ró   r   ÚCombÚ	MultilinerH   rI   r   r,   r   ÚAPrÎ   rÐ   )!Úclsrï   rñ   rý   rÛ   rþ   rÚ   rÿ   r   Ú
_rectangler   r©   Úfield_flagsrU   rz   ÚpropÚfont_propertiesÚda_font_namerP   r~   r}   rO   rø   r‚   rƒ   r   r�   r!   r#   r4   Únew_appearance_streamrÕ   rÖ   s!   &&&&&&&&&                        r/   Úfrom_text_annotationÚ)TextStreamAppearance.from_text_annotationÿ  sx  € ôL œ/¨:Ô6T×6YÑ6YÕ+ZÓ[ˆ
Ü# Q¨¬3¨z¸!­}¸zÈ!½}Õ/LÓ+MÌsÐS]Ð^_ÕS`ÐcmÐnoÕcpÕSpÓOqÐ$rÓsˆ	ð (×5Ñ5Ü*×-Ñ-Ø�M‰MÔ8×;Ñ;¸TÓBó
Ð÷ "ä!1Ð2BÓ!CÑà!3×!>Ñ!>Ó!@Ðð —i‘iÔ 9× <Ñ <¸aÓ@ˆà—	‘	Ô3×6Ñ6¸Ó>À%ÔGØÔ7×>Ñ>×DÑDÕDÈÔIà—9‘9˜Z×5Ñ5Ô6O×6SÑ6SÐUWÓXÓYˆDØŸ	™	 $¨Ó+ˆIÜ˜i¬×.Ò.Ø&˜K�	øà—9‘9˜T 2Ó&ˆDØˆIð �|‰|˜D &Ó)×1Ñ1°#°uÓ=×EÑEÀcÈ5ÓQˆô -/¯HªH°UÐ<NÔ,OÓXÑ,O DÓSWŸ4˜4Ñ,OˆÐXØ&×*Ñ*¨?×+@Ñ+@ÀÓ+FÈÕ+JÓKˆÜ˜/×-Ñ-¨o×.CÑ.CÀDÓ.IÈAÕ.MÓNÓOˆ	Ø×Ñ˜tÔ$Ø—X‘X˜oÓ.ˆ
çØ&‰Ià$ˆIà˜AÔØ&ˆIà×<Ñ<¸YÈ
Ð_cÓd‰ˆ	�4ð ˜Ô$Ü,<Ð=O×=WÑ=WÐXdÐfoÓ=pÓ,qˆJ”z %Ó(Ñ)ð #&×"LÑ"LØØØØ× Ñ ¤¨EÓ!2Ô4DÓ4FÓGß‰D ó#
Ðð ˆØˆ
ØÔ2×9Ñ9×>Ñ>×>Ô>ØˆGØ#Ÿ™¨	Ó2ˆJØˆØÔ2×9Ñ9×CÑC×CÔCØˆLØ—I‘I˜d¤M×$6Ñ$6Ó7ˆ	ØˆÜ#×)Ñ)ˆØ�EŒ>ÜÔ 0°%¸µ,Ó?×CÑCÀDÈ,ÓWˆLÜÔ 0°%¸µ,Ó?×CÑCÀDÈ,ÓWˆLô "¨IÀLÐ_kÔlˆÙ #ØØØØØ#ØØØ!Ø%ØØØ!ô!
Ðô *×,Ñ,°
Ô:äÔ% zÔ2P×2SÑ2SÕ'TÓU×YÑYÐZ^Ð`bÓc×iÑiÖkñ ��Uð ÐNÔNÙà˜,Ô&Ø eÔ+ÜBRÓBT˜×(Ñ(Ó*¬:°gÓ+>Ñ?ÜIPØ/Ð1EÐG^óJ�E˜'•N×-Ñ-Ó/´
¸9Ó0EÓFð 27Ð)¨#Ó.ñ lð %Ð$ùò] Ys   Ç8	TÈTr$   )gš™™™™™É?)N)r^   rÈ   )r&   r'   r(   r)   r*   rh   rH   rI   r´   r@   Ústaticmethodrì   rú   Úclassmethodr  r-   rE   rF   s   @r/   rM   rM   B   s±   ø† ñ÷L2ðf 8<Ø ØØØ"Ø#0×#5Ñ#5ØØ!%÷eðR +/ØØ&*Ø ØBFØ ØØØ"Ø#0×#5Ñ#5ØØ!%÷Wò Wðr ôBó ðBðH ö'ó ð'ð@ öZ%ó öZ%r.   rM   )/Ú
__future__r   r  Údataclassesr   Úenumr   Úior   Útypingr   r   r	   Ú_codecsr
   Ú_codecs.core_font_metricsr   Ú_fontr   Ú_utilsr   Ú	constantsr   r   r   r   Úerrorsr   Úgenericr   r   r   r   r   r   Úgeneric._baser   r   Úpypdf._writerr   Ú_pager   r˜   r   r1   rH   rM   r$   r.   r/   Ú<module>r/     s�   ðÝ "ã 	Ý !Ý Ý ß +Ñ +å (Ý 9Ý Ý #ß oÓ oÝ !÷÷ ÷ ?çÝ'å"à!#Ð ð ÷+ð +ó ð+ôLÐ.ô Lô"�Gô ôX	%Ð/ö X	%r.   