+
    yaÒj?  ã                   óà   € ^ 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 ]'       d   ^RIHt ^RIHt ^RIHt  ! R R4      t ! R	 R
4      t]]]3,          tR R ltR R ltR R ltR# )é    )ÚTYPE_CHECKINGÚOptionalÚUnionÚcast)Úlogger_warning)ÚArrayObjectÚDictionaryObjectÚIndirectObjectÚ	PdfObjectÚTextStringObjectÚis_null_or_none)Ú
PageObject)Ú	PdfReader)Ú	PdfWriterc                   óZ   a € ] tR t^*t o RtV 3R lR ltV 3R lR ltV 3R lR ltRtV t	R	# )
ÚNamedReferenceLinkzGNamed reference link being preserved until we can resolve it correctly.c                ó(   <€ V ^8„  d   QhRS[ RRRR/# )é   Ú	referenceÚ
source_pdfr   ÚreturnN)r   )ÚformatÚ__classdict__s   "€ÚI/opt/data/home/.local/lib/python3.14/site-packages/pypdf/generic/_link.pyÚ__annotate__ÚNamedReferenceLink.__annotate__-   s$   ø€ ÷ &ñ &Ñ"2ð &Àð &ÐPTñ &ó    c                ó   € Wn         W n        R# )z0reference: TextStringObject with named referenceN©Ú
_referenceÚ_source_pdf)Úselfr   r   s   &&&r   Ú__init__ÚNamedReferenceLink.__init__-   s   € à#ŒØ%Ör   c                ó4   <€ V ^8„  d   QhRS[ S[R3,          /# ©r   r   N©r   r
   )r   r   s   "€r   r   r   2   s   ø€ ÷ 9ñ 9¡e©N¸DÐ,@Õ&Añ 9r   c                óž   € V P                   P                  P                  \        V P                  4      4      pV'       d   VP
                  # R # ©N)r!   Únamed_destinationsÚgetÚstrr    Úpage)r"   Údestinations   & r   Úfind_referenced_pageÚ'NamedReferenceLink.find_referenced_page2   s:   € Ø×&Ñ&×9Ñ9×=Ñ=¼cÀ$Ç/Á/Ó>RÓSˆß#.ˆ{×ÑÐ8°DÐ8r   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# ©r   Ú
target_pdfr   Únew_pager   N©r
   )r   r   s   "€r   r   r   6   s(   ø€ ÷ Yñ Y¨+ð YÁð YÐTXñ Yr   c                ó°   € \        V P                  4      VP                  9  d2   VP                  \        V P                  4      VP                  4       R# R# ©z2target_pdf: PdfWriter which the new link went intoN)r,   r    r*   Úadd_named_destinationÚpage_number©r"   r3   r4   s   &&&r   Úpatch_referenceÚ"NamedReferenceLink.patch_reference6   s@   € ô ˆt�‰Ó z×'DÑ'DÔDØ×,Ñ,¬S°·±Ó-AÀ8×CWÑCWÖXñ Er   r   N©
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r#   r/   r;   Ú__static_attributes__Ú__classdictcell__©r   s   @r   r   r   *   s(   ø‡ € ÙQ÷&ð &÷
9ð 9÷Yö Yr   r   c                   óZ   a € ] tR t^=t o RtV 3R lR ltV 3R lR ltV 3R lR ltRtV t	R	# )
ÚDirectReferenceLinkzHDirect reference link being preserved until we can resolve it correctly.c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r   r   N)r   )r   r   s   "€r   r   Ú DirectReferenceLink.__annotate__@   s   ø€ ÷ $ñ $¡+ð $°$ñ $r   c                ó   € Wn         R# )zIreference: an ArrayObject whose first element is the Page indirect objectN©r    )r"   r   s   &&r   r#   ÚDirectReferenceLink.__init__@   s   € à#Žr   c                ó4   <€ V ^8„  d   QhRS[ S[R3,          /# r&   r'   )r   r   s   "€r   r   rI   D   s   ø€ ÷ 8ñ 8¡e©N¸DÐ,@Õ&Añ 8r   c                ól   € V P                   '       g   R # \        \        V P                   ^ ,          4      # r)   )r    r   r
   )r"   s   &r   r/   Ú(DirectReferenceLink.find_referenced_pageD   s$   € Ø��ˆÙÜ”N D§O¡O°AÕ$6Ó7Ð7r   c                ó(   <€ V ^8„  d   QhRRRS[ RR/# r2   r5   )r   r   s   "€r   r   rI   I   s#   ø€ ÷ &ñ &¨+ð &Áð &ÐTXñ &r   c                ó"   € W P                   ^ &   R# r7   rK   r:   s   &&&r   r;   Ú#DirectReferenceLink.patch_referenceI   s   € à%�‰˜Ór   rK   Nr=   rE   s   @r   rG   rG   =   s&   ø‡ € ÙR÷$ð $÷8ð 8÷
&ö &r   rG   c          	      ód   € V ^8„  d   QhRRRRR\         \        \        \        3,          ,          /# )r   r4   r   Úold_pager   )ÚlistÚtupleÚReferenceLink)r   s   "r   r   r   Q   s2   € ÷ (+ñ (+˜Lð (+°Lð (+ÄTÌ%ÔP]Ô_lÐPlÕJmÕEnñ (+r   c                óÐ  € V P                  R\        4       4      P                  4       pVP                  R\        4       4      P                  4       p\        V4      '       d   \        4       p\        V4      '       d   \        4       p\	        V\        4      '       d   \	        V\        4      '       g   \        R\        VVR7       . # V Uu. uF  p\        W@4      ;pf   K  VNK  	  ppV Uu. uF  p\        WA4      ;pf   K  VNK  	  pp\        V4      \        V4      8w  d&   \        R\        \        V4      \        V4      R7       \        \        Wg4      4      # u upi u upi )a  Extracts links from two pages on the assumption that the two pages are
the same. Produces one list of (new link, old link) tuples.

Non-link annotations are ignored before pairing to avoid dropping valid
links when one page includes additional non-link annotation entries.
z/AnnotszZExpected annotation arrays: %(old_annotations)s %(new_annotations)s. Ignoring annotations.)ÚsourceÚold_annotationsÚnew_annotationsz8Annotation sizes differ: %(old_count)d vs. %(new_count)d)rY   Ú	old_countÚ	new_count)r+   r   Ú
get_objectr   Ú
isinstancer   r>   Ú_build_linkÚlenrU   Úzip)r4   rT   r[   rZ   Ú
annotationÚlinkÚ	new_linksÚ	old_linkss   &&      r   Úextract_linksrg   Q   s?  € ð —l‘l 9¬k«mÓ<×GÑGÓI€OØ—l‘l 9¬k«mÓ<×GÑGÓI€OÜ�×'Ò'Ü%›-ˆÜ�×'Ò'Ü%›-ˆÜ�o¤{×3Ò3¼:ÀoÔWb×;cÒ;cÜØhÜØ+Ø+õ		
ð ˆ	ñ *óá)ˆJÜ 
Ó5Ð5ˆD÷ 	ˆÙ)ð ð ñ *óá)ˆJÜ 
Ó5Ð5ˆD÷ 	ˆÙ)ð ð ô ˆ9ƒ~œ˜Y›Ô'ÜØFÜÜ˜)“nÜ˜)“nõ		
ô ”�IÓ)Ó*Ð*ùò'ùò
s   ÃEÃ"EÃ.E#ÄE#c                óJ   € V ^8„  d   QhR\         RRR\        \        ,          /# )r   Úindirect_objectr-   r   r   )r
   r   rW   )r   s   "r   r   r   |   s'   € ÷ ñ ¤ð °|ð ÌÔQ^ÕH_ñ r   c                 ó¢  € \        R VP                  4      p\        \        V P                  4       4      p\	        V\        4      '       d   VP                  R4      R8w  d   R# RV9   dL   \        \        VR,          4      pVP                  R4      R8w  d   R# RV9  d   R# \        VR,          V4      # RV9   d   \        VR,          V4      # R# )	r   z/Subtypez/LinkNz/Az/Sz/GoToz/Dz/Dest)r   Úpdfr	   r^   r_   r+   Ú_create_link)ri   r-   Úsrcrd   Úactions   &&   r   r`   r`   |   s¬   € Ü
ˆ{˜DŸH™HÓ
%€CÜÔ  /×"<Ñ"<Ó">Ó?€DÜ�tÔ-×.Ò.°4·8±8¸JÓ3GÈ7Ô3RÙàˆt„|ÜÔ&¨¨T­
Ó3ˆØ�:‰:�dÓ˜wÔ&Ùà�vÔÙÜ˜F 4�L¨#Ó.Ð.à�$„Ü˜D �M¨3Ó/Ð/ár   c                óJ   € V ^8„  d   QhR\         RRR\        \        ,          /# )r   r   r   r   r   )r   r   rW   )r   s   "r   r   r   ‘   s&   € ÷ ñ œIð °;ð Ä8ÌMÕCZñ r   c                 óŠ   € \        V \        4      '       d   \        W4      # \        V \        4      '       d   \	        V 4      # R # r)   )r_   r   r   r   rG   )r   r   s   &&r   rl   rl   ‘   s6   € Ü�)Ô-×.Ò.Ü! )Ó8Ð8Ü�)œ[×)Ò)Ü" 9Ó-Ð-Ùr   N)Útypingr   r   r   r   Ú_utilsr   Ú r   r	   r
   r   r   r   Ú_pager   Ú_readerr   Ú_writerr   r   rG   rW   rg   r`   rl   © r   r   Ú<module>rx      s[   ð÷> 8Ó 7å #ß i× içÝ"Ý#Ý#÷Yñ Y÷&&ñ &ð" Ð(Ð*=Ð=Õ>€õ(+õV÷*r   