Ë
    ÌiÉ  ã                   óh   — d dl Z d dlZd dlmZ d dlmZmZ d dlmZm	Z	 ddej                  dddfd„Zy)	é    N)Úformat_decimal)ÚconfigÚutils)ÚNumberÚTexté   é   é   c                 ó¸  ‡ ‡‡— |€t        ‰ j                  «      }|€t        ‰ j                  «      }|€t        d«      }t	        j
                  d«      }t	        j
                  d«      }t        |«      }	|xs t	        j
                  d«      }|t        ‰ j                  «      k  }
|t        ‰ j                  «      k  }t        ‰ j                  d| «      }|r|j                  |«       g }g }t        ‰ j                  «      D ]€  \  }}||k\  r nvt        |j                  t        «      rIt        j                  |d| «      }d}||kD  rd}|}|j                  t        j                  ||«      «       Œp|j                  d«       Œ‚ t        ‰ j                  «      D ]ª  \  }}||k\  r n g }t        |«      D ]}  \  }}||k\  r|}n<|€d}n7||   �'t!        j"                  |«      st%        |||   |¬	«      }nt'        |«      }|�t        |«      |kD  r|d||	z
   ›|›�}|j                  |«       ||k\  sŒ} n |j                  |«       Œ¬ ˆfd
„Šˆ ˆfd„} ‰d«        ‰d«        ‰d«       t        |«      D ]  \  }} ‰d|z  «       Œ  ‰d«        ‰d«        ‰d«       |D ]
  } ||«       Œ |
r ||D �cg c]  }|‘Œ c}«        ‰d«        ‰d«       yc c}w )as  
    Print an HTML version of this table.

    :param max_rows:
        The maximum number of rows to display before truncating the data. This
        defaults to :code:`20` to prevent accidental printing of the entire
        table. Pass :code:`None` to disable the limit.
    :param max_columns:
        The maximum number of columns to display before truncating the data.
        This defaults to :code:`6` to prevent wrapping in most cases. Pass
        :code:`None` to disable the limit.
    :param output:
        A file-like object to print to. Defaults to :code:`sys.stdout`, unless
        running in Jupyter. (See above.)
    :param max_column_width:
        Truncate all columns to at most this width. The remainder will be
        replaced with ellipsis.
    :param locale:
        Provide a locale you would like to be used to format the output.
        By default it will use the system's setting.
    :max_precision:
        Puts a limit on the maximum precision displayed for number types.
        Numbers with lesser precision won't be affected.
        This defaults to :code:`3`. Pass :code:`None` to disable limit.
    NÚinfÚellipsis_charsÚtext_truncation_charsÚdefault_localeFTÚ )ÚformatÚlocalec                 ó.   •— ‰j                  | dz   «       y )Nú
)Úwrite)ÚlineÚoutputs    €úW/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/agate/table/print_html.pyr   zprint_html.<locals>.writek   s   ø€ Ø�‰�T˜D‘[Õ!ó    c                 ó´   •—  ‰d«       t        | «      D ]9  \  }}t        ‰j                  |   t        «      r ‰d|z  «       Œ/ ‰d|z  «       Œ;  ‰d«       y)z?
        Helper function that formats individual rows.
        ú<tr>z%<td style="text-align: left;">%s</td>z&<td style="text-align: right;">%s</td>ú</tr>N)Ú	enumerateÚ
isinstanceÚ_column_typesr   )Úformatted_rowÚjÚdÚselfr   s      €€r   Ú	write_rowzprint_html.<locals>.write_rown   s`   ø€ ñ 	ˆfŒä˜mÓ,ò 	D‰DˆAˆqä˜$×,Ñ,¨QÑ/´Ô6ÙÐ=ÀÑAÕBáÐ>ÀÑBÕCð	Dñ 	ˆg�r   z<table>z<thead>r   z<th>%s</th>r   z</thead>z<tbody>z</tbody>z</table>)ÚlenÚ_rowsÚ_columnsÚfloatr   Ú
get_optionÚ_column_namesÚlistÚappendr   r   Ú	data_typer   r   Úmax_precisionÚmake_number_formatterÚmathÚisinfr   Ústr)r#   Úmax_rowsÚmax_columnsr   Úmax_column_widthr   r.   ÚellipsisÚ
truncationÚlen_truncationÚrows_truncatedÚcolumns_truncatedÚcolumn_namesÚnumber_formattersÚformatted_dataÚiÚcÚ
max_placesÚadd_ellipsisÚrowr    r!   Úvr$   ÚcolÚnr   s   `  `                      @r   Ú
print_htmlrF   
   só  ú€ ð4 ÐÜ�t—z‘z“?ˆàÐÜ˜$Ÿ-™-Ó(ˆàÐÜ˜e›ˆä× Ñ Ð!1Ó2€HÜ×"Ñ"Ð#:Ó;€JÜ˜“_€NØÒ:”v×(Ñ(Ð)9Ó:€Fà¤ D§J¡J£Ñ/€NØ#¤c¨$×*<Ñ*<Ó&=Ñ=Ðä˜×*Ñ*¨<¨KÐ8Ó9€LáØ×Ñ˜HÔ%àÐØ€Nô ˜$Ÿ-™-Ó(ò +‰ˆˆ1Ø�ÒÙä�a—k‘k¤6Ô*Ü×,Ñ,¨Q¨y°¨\Ó:ˆJØ ˆLØ˜MÒ)Ø#�Ø*�
Ø×$Ñ$¤U×%@Ñ%@ÀÈ\Ó%ZÕ[à×$Ñ$ TÕ*ð+ô ˜DŸJ™JÓ'ò -‰ˆˆ3Ø�Š=Ùàˆä˜c“Nò 	‰DˆAˆqØ�KÒØ‘Ø�Ø‘Ø" 1Ñ%Ð1¼$¿*¹*ÀQ¼-Ü"ØØ,¨QÑ/Ø!ô‘ô ˜“F�àÐ+´°A³Ð9IÒ0IØÐ BÐ!1°NÑ!BÑCÁZÐP�à× Ñ  Ô#à�KÓÙð)	ð, 	×Ñ˜mÕ,ð9-ô<"õñ  
ˆ)ÔÙ	ˆ)ÔÙ	ˆ&„Mä˜LÓ)ò #‰ˆˆ3Ùˆm˜cÑ!Õ"ð#ñ 
ˆ'„NÙ	ˆ*ÔÙ	ˆ)Ôð (ò !ˆÙ�-Õ ð!ñ Ù \Ö2 ’8Ò2Ô3ñ 
ˆ*ÔÙ	ˆ*Õùò	 3s   Ê6	K)r0   ÚsysÚbabel.numbersr   Úagater   r   Úagate.data_typesr   r   ÚstdoutrF   © r   r   ú<module>rM      s0   ðÛ Û 
å (ç ß )ð !¨a¸¿
¹
ÐUWÐ`dÐtuô Ir   