Ë
    {�h®  ã                   ón   — d dl m Z  d dlZd dlZd dlZdej                  j
                  _        d„ Zd„ ZdZ	y)é    )ÚglobNÚsphinx_gallery_pngc                 ó†  — t         j                  j                  |d   «      }t        t	        t         j                  j                  |d«      «      «      }t        t	        t         j                  j                  |d«      «      «      }|d   }t        «       }t        «       }	t        ||«      D ]…  \  }
}||	vsŒ|	t        |«      z  }	t        |«      }t         j                  j                  |«      d   dz   }|j                  |«       t        j                  ||«       t        j                  |
|«       Œ‡ t        ||d   «      S )a<  Scrape Plotly figures for galleries of examples using
    sphinx-gallery.

    Examples should use ``plotly.io.show()`` to display the figure with
    the custom sphinx_gallery renderer.

    Since the sphinx_gallery renderer generates both html and static png
    files, we simply crawl these files and give them the appropriate path.

    Parameters
    ----------
    block : tuple
        A tuple containing the (label, content, line_number) of the block.
    block_vars : dict
        Dict of block variables.
    gallery_conf : dict
        Contains the configuration of Sphinx-Gallery
    **kwargs : dict
        Additional keyword arguments to pass to
        :meth:`~matplotlib.figure.Figure.savefig`, e.g. ``format='svg'``.
        The ``format`` kwarg in particular is used to set the file extension
        of the output file (currently only 'png' and 'svg' are supported).

    Returns
    -------
    rst : str
        The ReSTructuredText that will be rendered to HTML containing
        the images.

    Notes
    -----
    Add this function to the image scrapers
    Úsrc_filez*.pngz*.htmlÚimage_path_iteratorr   z.htmlÚsrc_dir)ÚosÚpathÚdirnameÚsortedr   ÚjoinÚlistÚsetÚzipÚnextÚsplitextÚappendÚshutilÚmoveÚ
figure_rst)ÚblockÚ
block_varsÚgallery_confÚkwargsÚexamples_dirÚpngsÚhtmlsr   Úimage_namesÚseenÚhtmlÚpngÚthis_image_path_pngÚthis_image_path_htmls                 úS/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/io/_sg_scraper.pyÚplotly_sg_scraperr%      s  € ôD —7‘7—?‘? :¨jÑ#9Ó:€LÜ”$”r—w‘w—|‘| L°'Ó:Ó;Ó<€DÜ”4œŸ™Ÿ™ \°8Ó<Ó=Ó>€EØ$Ð%:Ñ;ÐÜ“&€KÜ‹5€DÜ˜ Ó%ò 4‰	ˆˆcØ�dŠ?Ø”C˜“HÑˆDÜ"&Ð':Ó";ÐÜ#%§7¡7×#3Ñ#3Ð4GÓ#HÈÑ#KÈgÑ#UÐ Ø×ÑÐ3Ô4Ü�K‰K˜Ð0Ô1Ü�K‰K˜Ð2Õ3ð4ô �k <°	Ñ#:Ó;Ð;ó    c                 óª  — | D �cg c]O  }t         j                  j                  ||«      j                  t         j                  d«      j                  d«      ‘ŒQ }}d}|s|S |d   }t         j                  j                  |«      d   }t         j                  j                  dt         j                  j                  |«      «      }t        |z  }|S c c}w )aÀ  Generate RST for a list of PNG filenames.

    Depending on whether we have one or more figures, we use a
    single rst call to 'image' or a horizontal list.

    Parameters
    ----------
    figure_list : list
        List of strings of the figures' absolute paths.
    sources_dir : str
        absolute path of Sphinx documentation sources

    Returns
    -------
    images_rst : str
        rst code to embed the images in the document
    ú/Ú r   é   Úimages)
r	   r
   ÚrelpathÚreplaceÚsepÚlstripr   r   ÚbasenameÚSINGLE_HTML)Úfigure_listÚsources_dirÚfigure_pathÚfigure_pathsÚ
images_rstÚfigure_nameÚexts          r$   r   r   A   s¶   € ð* 'öàô 	�‰�‰˜ [Ó1×9Ñ9¼"¿&¹&À#ÓF×MÑMÈcÕRð€Lð ð €JÙØÐØ˜q‘/€KÜ
�'‰'×
Ñ
˜;Ó
'¨Ñ
*€CÜ—'‘'—,‘,˜x¬¯©×)9Ñ)9¸+Ó)FÓG€KÜ˜{Ñ*€JØÐùòs   …ACz
.. raw:: html
    :file: %s
)
r   r	   r   ÚplotlyÚioÚ	renderersÚdefaultr%   r   r1   © r&   r$   ú<module>r>      s8   ðõ Û 	Û ã à2€‡	�	× Ñ Ô ò1<òhðB�r&   