ó
    ‰*£h  ã                   óŽ   • S SK r S SKJr  S SKJrJr  S SKJr  S SKJ	r	  SSK
Jr   " S S	\5      r " S
 S\5      r " S S\5      rg)é    N)ÚSerialisable)ÚIntegerÚSequence)Ú
MergedCell)ÚBorderé   )Ú	CellRangec                   óT   ^ • \ rS rSrSr\R                  rSr SU 4S jjr	S r
SrU =r$ )Ú	MergeCellé   Ú	mergeCell)Úrefc                 ó$   >• [         TU ]  U5        g ©N)ÚsuperÚ__init__)Úselfr   Ú	__class__s     €ÚU/home/mande/repo/quber/.venv/lib/python3.13/site-packages/openpyxl/worksheet/merge.pyr   ÚMergeCell.__init__   s   ø€ ô 	‰Ñ˜Õó    c                 ó8   • U R                  U R                  5      $ r   )r   r   ©r   s    r   Ú__copy__ÚMergeCell.__copy__   s   € Ø�~‰~˜dŸh™hÓ'Ð'r   © r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Útagnamer	   Úcoordr   Ú	__attrs__r   r   Ú__static_attributes__Ú__classcell__©r   s   @r   r   r      s*   ø† à€GØ
�/‰/€Cà€Ið ÷÷(ð (r   r   c                   óV   • \ rS rSrSr\" SS9r\" \S9r	Sr
Sr  SS	 jr\S
 5       rSrg)Ú
MergeCellsé#   Ú
mergeCellsT)Ú
allow_none)Úexpected_type©r   )ÚcountNc                 ó   • X l         g r   r-   )r   r.   r   s      r   r   ÚMergeCells.__init__-   s	   € ð #�r   c                 ó,   • [        U R                  5      $ r   )Úlenr   r   s    r   r.   ÚMergeCells.count4   s   € ä�4—>‘>Ó"Ð"r   )Nr   )r   r   r   r    r!   r   r.   r   r   r   Ú__elements__r#   r   Úpropertyr$   r   r   r   r(   r(   #   sF   † à€Gá˜tÑ$€EÙ yÑ3€Ià!€LØ€Ið Øô#ð ñ#ó ó#r   r(   c                   óD   ^ • \ rS rSrSrU 4S jrS rS rS rS r	Sr
U =r$ )	ÚMergedCellRangeé9   zì
MergedCellRange stores the border information of a merged cell in the top
left cell of the merged cell.
The remaining cells in the merged cell are stored as MergedCell objects and
get their border information from the upper left cell.
c                 óZ   >• Xl         [        TU ]	  US9  S U l        U R	                  5         g )N)Úrange_string)Úwsr   r   Ú
start_cellÚ_get_borders)r   Ú	worksheetr"   r   s      €r   r   ÚMergedCellRange.__init__B   s+   ø€ ØŒÜ‰Ñ eÐÑ,ØˆŒØ×ÑÕr   c                 ó   • U R                   R                  R                  U R                  U R                  45      U l        U R
                  c3  U R                   R                  U R                  U R                  S9U l        U R                   R                  R                  U R                  U R                  45      nUbP  U R
                  =R                  [        UR                  R                  UR                  R                  S9-  sl	        gg)zÚ
If the upper left cell of the merged cell does not yet exist, it is
created.
The upper left cell gets the border information of the bottom and right
border from the bottom right cell of the merged cell, if available.
N©ÚrowÚcolumn)ÚrightÚbottom)r;   Ú_cellsÚgetÚmin_rowÚmin_colr<   ÚcellÚmax_rowÚmax_colÚborderr   rD   rE   )r   Úend_cells     r   r=   ÚMergedCellRange._get_bordersI   s¾   € ð Ÿ'™'Ÿ.™.×,Ñ,¨d¯l©l¸D¿L¹LÐ-IÓJˆŒØ�?‰?Ñ"Ø"Ÿg™gŸl™l¨t¯|©|ÀDÇLÁL˜lÐQˆDŒOð —7‘7—>‘>×%Ñ% t§|¡|°T·\±\Ð&BÓCˆØÑØ�O‰O×"Ò"¤f°8·?±?×3HÑ3HØ4<·O±O×4JÑ4Jñ'Lñ LÖ"ð  r   c                 ó€  • / SQnU HÚ  n[        U R                  R                  U5      nU(       a  UR                  c  M9  [	        S0 X#0D6n[        X5       H†  nU R
                  R                  R                  U5      nUcF  Uu  px[        U R
                  XxS9nX`R
                  R                  UR                  UR                  4'   U=R                  U-  sl        Mˆ     MÜ     U R                  R                  SLn	U	(       a*  [        R                  " U R                  R                  5      n
U R                   H�  nU R
                  R                  R                  U5      nUcF  Uu  px[        U R
                  XxS9nX`R
                  R                  UR                  UR                  4'   U	(       d  Mz  W
Ul        Mƒ     g)aÅ  
Each cell of the merged cell is created as MergedCell if it does not
already exist.

The MergedCells at the edge of the merged cell gets its borders from
the upper left cell.

 - The top MergedCells get the top border from the top left cell.
 - The bottom MergedCells get the bottom border from the top left cell.
 - The left MergedCells get the left border from the top left cell.
 - The right MergedCells get the right border from the top left cell.
)ÚtopÚleftrD   rE   NrA   r   )Úgetattrr<   rM   Ústyler   r;   rF   rG   r   rB   rC   Ú
protectionÚcopyÚcells)r   ÚnamesÚnameÚsiderM   r"   rJ   rB   ÚcolÚ	protectedrU   s              r   ÚformatÚMergedCellRange.format]   sQ  € ò 3ˆãˆDÜ˜4Ÿ?™?×1Ñ1°4Ó8ˆDÞ˜Ÿ
™
Ñ*ÙÜÑ*˜t˜kÑ*ˆFÜ  Ö,�Ø—w‘w—~‘~×)Ñ)¨%Ó0�Ø‘<Ø$‘H�CÜ% d§g¡g°3ÑC�DØ>B—G‘G—N‘N D§H¡H¨d¯k©kÐ#:Ñ;Ø—’˜vÑ%—ó -ñ ð —O‘O×.Ñ.°dÐ:ˆ	ÞÜŸš 4§?¡?×#=Ñ#=Ó>ˆJØ—Z”ZˆEØ—7‘7—>‘>×%Ñ% eÓ,ˆDØ‰|Ø ‘�Ü! $§'¡'¨sÑ?�Ø:>—‘—‘ §¡¨$¯+©+Ð6Ñ7çˆyØ",�–ò  r   c                 ó2   • U[        U R                  5      ;   $ r   )r	   r"   )r   r"   s     r   Ú__contains__ÚMergedCellRange.__contains__ˆ   s   € Øœ	 $§*¡*Ó-Ñ-Ð-r   c                 óN   • U R                  U R                  U R                  5      $ r   )r   r;   r"   r   s    r   r   ÚMergedCellRange.__copy__Œ   s   € Ø�~‰~˜dŸg™g t§z¡zÓ2Ð2r   )r<   r;   )r   r   r   r    Ú__doc__r   r=   r]   r`   r   r$   r%   r&   s   @r   r7   r7   9   s(   ø† ñõòLò((-òV.÷3ð 3r   r7   )rV   Ú!openpyxl.descriptors.serialisabler   Úopenpyxl.descriptorsr   r   Úopenpyxl.cell.cellr   Úopenpyxl.styles.bordersr   Ú
cell_ranger	   r   r(   r7   r   r   r   Ú<module>rj      sC   ðó å :÷õ
 *Ý *å !ô(�	ô (ô$#�ô #ô,T3�iõ T3r   