Ë
    {�hºI  ã                   óÌ   — d dl Z d dlZ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
 d dlmZ  G d„ de«      Z e«       Zd„ Zd	Zed
z   Zd„ Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd„ Zy)é    N)ÚPath)Úvalidate_coerce_fig_to_dictÚvalidate_coerce_output_type)Ú
get_module)ÚImageUriValidatorc                   óZ   — e Zd ZdZd„ Zed„ «       Zej                  d„ «       Zed„ «       Z	y)Ú
JsonConfig)ÚjsonÚorjsonÚautoc                 ó   — d| _         y )Nr   ©Ú_default_engine©Úselfs    úM/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/plotly/io/_json.pyÚ__init__zJsonConfig.__init__   s
   € Ø%ˆÕó    c                 ó   — | j                   S ©Nr   r   s    r   Údefault_enginezJsonConfig.default_engine   s   € à×#Ñ#Ð#r   c                 ó´   — |t         j                  vr*t        dj                  t         j                  |¬«      «      ‚|dk(  r| j	                  «        || _        y )Nz9Supported JSON engines include {valid}
    Received {val})ÚvalidÚvalr   )r	   Ú_valid_enginesÚ
ValueErrorÚformatÚvalidate_orjsonr   )r   r   s     r   r   zJsonConfig.default_engine   sT   € à”j×/Ñ/Ñ/Üð%ß%+¡V´*×2KÑ2KÐQT VÓ%Uóð ð
 �(Š?Ø× Ñ Ô"à"ˆÕr   c                 ó4   — t        d«      }|€t        d«      ‚y )Nr   z-The orjson engine requires the orjson package)r   r   )Úclsr   s     r   r   zJsonConfig.validate_orjson%   s"   € ä˜HÓ%ˆØˆ>ÜÐLÓMÐMð r   N)
Ú__name__Ú
__module__Ú__qualname__r   r   Úpropertyr   ÚsetterÚclassmethodr   © r   r   r	   r	      sP   „ Ø/€Nò&ð ñ$ó ð$ð ×Ññ
#ó ð
#ð ñNó ñNr   r	   c                 ó   — | dv ry| S )zM
    This is used to ultimately *encode* into strict JSON, see `encode`

    )ÚInfinityz	-InfinityÚNaNNr'   )Úconsts    r   Úcoerce_to_strictr,   /   s   € ð Ð0Ñ0Øàˆr   ))ú<z\u003c)ú>z\u003e)ú/z\u002f))u   â€¨z\u2028)u   â€©z\u2029c                 óL   — | }|D ]  \  }}||v sŒ|j                  ||«      }Œ |S r   )Úreplace)Újson_strÚ_swapÚoutÚunsafe_charÚ	safe_chars        r   Ú_safer7   F   s:   € Ø
€CØ"'ò 6Ñˆ�YØ˜#ÒØ—+‘+˜k¨9Ó5‰Cð6ð €Jr   c                 ó*  — t        dd¬«      }|€t        j                  }|dk(  r|�d}nd}n|dvrt        d|z  «      ‚t        d	d
¬«      t        dd
¬«      t        dd
¬«      t        dd
¬«      dœ}|dk(  r;i }|rd|d<   nd|d<   ddlm} t        t        j                  | fd|i|¤Žt        «      S |dk(  r€t        j                  «        |j                  |j                  z  }|r||j                  z  }	 | j                  «       } 	 t        |j                  | |¬«      j#                  d«      t$        «      S y# t         $ r Y Œ=w xY w# t&        $ r Y nw xY wt)        | dd|¬«      }t        |j                  ||¬«      j#                  d«      t$        «      S )aÉ  
    Convert a plotly/Dash object to a JSON string representation

    Parameters
    ----------
    plotly_object:
        A plotly/Dash object represented as a dict, graph_object, or Dash component

    pretty: bool (default False)
        True if JSON representation should be pretty-printed, False if
        representation should be as compact as possible.

    engine: str (default None)
        The JSON encoding engine to use. One of:
          - "json" for an engine based on the built-in Python json module
          - "orjson" for a faster engine that requires the orjson package
          - "auto" for the "orjson" engine if available, otherwise "json"
        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.

    Returns
    -------
    str
        Representation of input object as a JSON string

    See Also
    --------
    to_json : Convert a plotly Figure to JSON with validation
    r   T©Úshould_loadNr   r
   ©r   r
   úInvalid json engine: %szsage.allFÚnumpyÚpandasz	PIL.Image)Úsage_allÚnpÚpdÚimageé   Úindent)ú,ú:Ú
separatorsr   )ÚPlotlyJSONEncoderr    )ÚoptionÚutf8)Únumpy_allowedÚdatetime_allowedÚmodules)r   Úconfigr   r   Ú_plotly_utils.utilsrH   r7   r
   ÚdumpsÚ
_swap_jsonr	   r   ÚOPT_NON_STR_KEYSÚOPT_SERIALIZE_NUMPYÚOPT_INDENT_2Úto_plotly_jsonÚAttributeErrorÚdecodeÚ_swap_orjsonÚ	TypeErrorÚclean_to_json_compatible)Úplotly_objectÚprettyÚenginer   rM   ÚoptsrH   Úcleaneds           r   Úto_json_plotlyr`   N   sÁ  € ô< ˜¨dÔ3€Fð €~Ü×&Ñ&ˆà�ÒØÐØ‰Fà‰FØ	Ð)Ñ	)ÜÐ2°VÑ;Ó<Ð<ô ˜z°uÔ=Ü˜¨eÔ4Ü˜¨uÔ5Ü˜K°UÔ;ñ	€Gð �ÒØˆÙØˆD�ŠNð ",ˆD�Ñå9äÜ�J‰J�}ÑDÐ*;ÐD¸tÑDÄjó
ð 	
ð 
�8Ò	Ü×"Ñ"Ô$Ø×&Ñ&¨×)CÑ)CÑCˆáØ�F×'Ñ'Ñ'ˆDð	Ø)×8Ñ8Ó:ˆMð
	ÜØ—‘˜]°4�Ó8×?Ñ?ÀÓGÌóð ð 
øô ò 	Ùð	ûô ò 	Ùð	úô +ØØØ!Øô	
ˆô �V—\‘\ '°$�\Ó7×>Ñ>¸vÓFÌÓUÐUs$   Ã6D8 Ä/E Ä8	EÅEÅ	EÅEc                 óŒ   — t        | |«      }|r)|j                  dg «      D ]  }|j                  dd«       Œ t        |||¬«      S )a¢  
    Convert a figure to a JSON string representation

    Parameters
    ----------
    fig:
        Figure object or dict representing a figure

    validate: bool (default True)
        True if the figure should be validated before being converted to
        JSON, False otherwise.

    pretty: bool (default False)
        True if JSON representation should be pretty-printed, False if
        representation should be as compact as possible.

    remove_uids: bool (default True)
        True if trace UIDs should be omitted from the JSON representation

    engine: str (default None)
        The JSON encoding engine to use. One of:
          - "json" for an engine based on the built-in Python json module
          - "orjson" for a faster engine that requires the orjson package
          - "auto" for the "orjson" engine if available, otherwise "json"
        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.

    Returns
    -------
    str
        Representation of figure as a JSON string

    See Also
    --------
    to_json_plotly : Convert an arbitrary plotly graph_object or Dash component to JSON
    ÚdataÚuidN)r\   r]   )r   ÚgetÚpopr`   )ÚfigÚvalidater\   Úremove_uidsr]   Úfig_dictÚtraces          r   Úto_jsonrk   ®   sO   € ôN +¨3°Ó9€Hñ Ø—\‘\ &¨"Ó-ò 	#ˆEØ�I‰I�e˜TÕ"ð	#ô ˜(¨6¸&ÔAÐAr   c                 ó&  — t        | ||||¬«      }t        |t        «      rt        |«      }nt        |t        «      r|}nd}|€	 |j	                  |«       y|j                  |«       y# t
        $ r Y nw xY wt        dj                  |¬«      «      ‚)a+  
    Convert a figure to JSON and write it to a file or writeable
    object

    Parameters
    ----------
    fig:
        Figure object or dict representing a figure

    file: str or writeable
        A string representing a local file path or a writeable object
        (e.g. a pathlib.Path object or an open file descriptor)

    pretty: bool (default False)
        True if JSON representation should be pretty-printed, False if
        representation should be as compact as possible.

    remove_uids: bool (default True)
        True if trace UIDs should be omitted from the JSON representation

    engine: str (default None)
        The JSON encoding engine to use. One of:
          - "json" for an engine based on the built-in Python json module
          - "orjson" for a faster engine that requires the orjson package
          - "auto" for the "orjson" engine if available, otherwise "json"
        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.
    Returns
    -------
    None
    )rg   r\   rh   r]   NzX
The 'file' argument '{file}' is not a string, pathlib.Path object, or file descriptor.
)Úfile)	rk   Ú
isinstanceÚstrr   ÚwriterV   r   r   Ú
write_text)rf   rm   rg   r\   rh   r]   r2   Úpaths           r   Ú
write_jsonrs   à   s¦   € ôH Ø�h v¸;Èvô€Hô �$œÔä�D‹z‰Ü	�Dœ$Ô	à‰ð ˆð €|ð	Ø�J‰J�xÔ Øð 	�‰˜Õ!øô ò 	Ùð	úäðç
�FØð ó ó
ð 	
s   ÁA) Á)	A5Á4A5c                 ó¼  — t        dd¬«      }t        | t        t        f«      s%t	        dj                  t        | «      | ¬«      «      ‚|€t        j                  }|dk(  r|�d}nd}n|dvrt	        d	|z  «      ‚|dk(  r't        j                  «        |j                  | «      }|S t        | t        «      r| j                  d
«      } t        j                  | «      }|S )aß  
    Parse JSON string using the specified JSON engine

    Parameters
    ----------
    value: str or bytes
        A JSON string or bytes object

    engine: str (default None)
        The JSON decoding engine to use. One of:
          - if "json", parse JSON using built in json module
          - if "orjson", parse using the faster orjson module, requires the orjson
            package
          - if "auto" use orjson module if available, otherwise use the json module

        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.

    Returns
    -------
    dict

    See Also
    --------
    from_json_plotly : Parse JSON with plotly conventions into a dict
    r   Tr9   zr
from_json_plotly requires a string or bytes argument but received value of type {typ}
    Received value: {value})ÚtypÚvaluer   r
   r;   r<   zutf-8)r   rn   ro   Úbytesr   r   ÚtyperN   r   r	   r   ÚloadsrW   r
   )rv   r]   r   Ú
value_dicts       r   Úfrom_json_plotlyr{   ,  sæ   € ô6 ˜¨dÔ3€Fô �eœc¤5˜\Ô*Üðç%™vÜ˜“K uð  &ó  ó
ð 	
ð €~Ü×&Ñ&ˆà�ÒØÐØ‰Fà‰FØ	Ð)Ñ	)ÜÐ2°VÑ;Ó<Ð<à�ÒÜ×"Ñ"Ô$à—\‘\ %Ó(ˆ
ð Ðô	 �eœUÔ#Ø—L‘L Ó)ˆEÜ—Z‘Z Ó&ˆ
àÐr   c                 óJ   — t        | |¬«      }t        |«      } |||¬«      }|S )a®  
    Construct a figure from a JSON string

    Parameters
    ----------
    value: str or bytes
        String or bytes object containing the JSON representation of a figure

    output_type: type or str (default 'Figure')
        The output figure type or type name.
        One of:  graph_objs.Figure, 'Figure', graph_objs.FigureWidget, 'FigureWidget'

    skip_invalid: bool (default False)
        False if invalid figure properties should result in an exception.
        True if invalid figure properties should be silently ignored.

    engine: str (default None)
        The JSON decoding engine to use. One of:
          - if "json", parse JSON using built in json module
          - if "orjson", parse using the faster orjson module, requires the orjson
            package
          - if "auto" use orjson module if available, otherwise use the json module

        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.

    Raises
    ------
    ValueError
        if value is not a string, or if skip_invalid=False and value contains
        invalid figure properties

    Returns
    -------
    Figure or FigureWidget
    )r]   )Úskip_invalid)r{   r   )rv   Úoutput_typer}   r]   ri   r    rf   s          r   Ú	from_jsonr   m  s0   € ôP   ¨fÔ5€Hô & kÓ
2€Cñ ˆh \Ô
2€CØ€Jr   c                 óè   — t        | t        «      }t        | t        «      rt        | «      }nt        | t        «      r| }nd}|�|j                  «       }n| j	                  «       }t        ||||¬«      S )aŽ  
    Construct a figure from the JSON contents of a local file or readable
    Python object

    Parameters
    ----------
    file: str or readable
       A string containing the path to a local file or a read-able Python
       object (e.g. a pathlib.Path object or an open file descriptor)

    output_type: type or str (default 'Figure')
        The output figure type or type name.
        One of:  graph_objs.Figure, 'Figure', graph_objs.FigureWidget, 'FigureWidget'

    skip_invalid: bool (default False)
        False if invalid figure properties should result in an exception.
        True if invalid figure properties should be silently ignored.

    engine: str (default None)
        The JSON decoding engine to use. One of:
          - if "json", parse JSON using built in json module
          - if "orjson", parse using the faster orjson module, requires the orjson
            package
          - if "auto" use orjson module if available, otherwise use the json module

        If not specified, the default engine is set to the current value of
        plotly.io.json.config.default_engine.

    Returns
    -------
    Figure or FigureWidget
    N)r}   r~   r]   )rn   ro   r   Ú	read_textÚreadr   )rm   r~   r}   r]   Úfile_is_strrr   r2   s          r   Ú	read_jsonr„   ¡  sq   € ôJ ˜T¤3Ó'€KÜ�$œÔä�D‹z‰Ü	�Dœ$Ô	à‰ð ˆð ÐØ—>‘>Ó#‰à—9‘9“;ˆô Ø˜|¸ÈVôð r   c           
      óB
  — t        | t        t        t        f«      r| S t        | t        «      r.| j                  «       D ��ci c]  \  }}|t        |fi |¤Ž“Œ c}}S t        | t        t        f«      r| r| D �cg c]  }t        |fi |¤Ž‘Œ c}S |j                  dd«      }|j                  dd«      }|j                  di «      }|d   }|d   }|d   }	|d   }
|�2| |j                  v rt        | «      S | |j                  v rt        | «      S |��| |j                  j                  j                  u rt        d	«      S t        | |j                  «      r¶|r)| j                   j"                  d
v r|j%                  | «      S | j                   j"                  dk(  r|j'                  | «      j)                  «       S | j                   j"                  dk(  r| j)                  «       S | j                   j"                  dk(  r2| j)                  «       } n!t        | |j*                  «      rt        | «      S |	��d| |	j,                  u s| |	j.                  u ry t        | |	j0                  |	j2                  f«      �r$|r3| j                   j"                  d
v r|j%                  | j4                  «      S | j                   j"                  dk(  rÖt        | |	j0                  «      rot7        j8                  «       5  t7        j:                  dt<        «       |j?                  | j@                  jC                  «       «      j)                  «       }d d d «       n| jC                  «       j)                  «       }|s/tE        tG        «      «      D ]  }||   jI                  «       ||<   Œ S 	 | jC                  «       } |s	 | jI                  «       S t        | tN        jN                  «      r| S 	 | j)                  «       S c c}}w c c}w # 1 sw Y   Œ˜xY w# tJ        tL        f$ r Y Œhw xY w# tJ        tL        f$ r Y ŒNw xY w# tL        $ r Y nw xY wt        | tP        jR                  «      rt        | «      S |
�+t        | |
jT                  «      rtW        jX                  | «      S 	 | j[                  «       } n# tL        $ r Y nw xY wt        | t        «      r4| j                  «       D ��ci c]  \  }}|t        |fi |¤Ž“Œ c}}S c c}}w t        | t        t        f«      r!| r| D �cg c]  }t        |fi |¤Ž‘Œ c}S c c}w | S )NrK   FrL   rM   r?   r@   rA   rB   Únan)ÚbÚiÚuÚfÚMÚUÚOÚignore).rn   ÚintÚfloatro   ÚdictÚitemsrZ   ÚlistÚtuplerd   ÚRRÚZZÚmaÚcoreÚmaskedÚndarrayÚdtypeÚkindÚascontiguousarrayÚdatetime_as_stringÚtolistÚ
datetime64ÚNaTÚNAÚSeriesÚDatetimeIndexÚvaluesÚwarningsÚcatch_warningsÚsimplefilterÚFutureWarningÚarrayÚdtÚto_pydatetimeÚrangeÚlenÚ	isoformatrY   rV   ÚdatetimeÚdecimalÚDecimalÚImager   Úpil_image_to_urirU   )ÚobjÚkwargsÚkÚvrK   rL   rM   r?   r@   rA   rB   Ú	dt_valuesrˆ   s                r   rZ   rZ   à  s‡  € ô
 �#œœU¤CÐ(Ô)Øˆ
ä�#”tÔØEHÇYÁYÃ[×Q¹T¸QÀ�Ô+¨AÑ8°Ñ8Ñ8ÓQÐQÜ	�Cœ$¤˜Ô	'ÙàCFÖG¸aÔ,¨QÑ9°&Ó9ÒGÐGð —J‘J˜°Ó6€MØ—z‘zÐ"4°eÓ<Ðà�j‰j˜ BÓ'€GØ�zÑ"€HØ	�‰€BØ	�‰€BØ�GÑ€Eð ÐØ�(—+‘+ÑÜ˜“:ÐØ�H—K‘KÑÜ�s“8ˆOð 
�~Ø�"—%‘%—*‘*×#Ñ#Ñ#Ü˜“<ÐÜ˜˜RŸZ™ZÔ(Ù §¡§¡Ð3GÑ!GØ×+Ñ+¨CÓ0Ð0Ø—‘—‘ 3Ò&à×,Ñ,¨SÓ1×8Ñ8Ó:Ð:Ø—‘—‘ 3Ò&Ø—z‘z“|Ð#Ø—‘—‘ 3Ò&à—j‘j“l‘Ü˜˜RŸ]™]Ô+Ü�s“8ˆOð 
�~Ø�"—&‘&‰=˜C 2§5¡5™LØÜ˜˜bŸi™i¨×)9Ñ)9Ð:Õ;Ù §¡§¡Ð3GÑ!GØ×+Ñ+¨C¯J©JÓ7Ð7Ø—‘—‘ 3Ò&Ü˜c 2§9¡9Ô-Ü!×0Ñ0Ó2ñ NÜ ×-Ñ-¨h¼ÔFð %'§H¡H¨S¯V©V×-AÑ-AÓ-CÓ$D×$KÑ$KÓ$M˜	÷	Nð Nð !$× 1Ñ 1Ó 3× :Ñ :Ó <�Iá'ô #¤3 y£>Ó2ò @˜Ø'0°¡|×'=Ñ'=Ó'?˜	 !šð@ð !Ð ðð ×ÑÓ!ˆñ ð	Ø—=‘=“?Ð"ô 
�Cœ×*Ñ*Ô	+Øˆ
ðØ�z‰z‹|Ðùók Rùò H÷\Nð Nûô, ”~Ð&ò Ùðûô œ>Ð*ò 	Ùð	ûô ò Ùðúô �#”w—‘Ô'Ü�S‹zÐð ÐœZ¨¨U¯[©[Ô9Ü ×1Ñ1°#Ó6Ð6ðØ× Ñ Ó"‰øÜò Ùðúô �#”tÔØEHÇYÁYÃ[×Q¹T¸QÀ�Ô+¨AÑ8°Ñ8Ñ8ÓQÐQùÓQÜ	�Cœ$¤˜Ô	'ÙàCFÖG¸aÔ,¨QÑ9°&Ó9ÒGÐGùÒGà€Jsm   ÁO!Á8O'Ë$AO,ÎO8 Î$P ÏP" Ï,O5Ï8P
Ð	P
ÐPÐPÐ"	P.Ð-P.ÒR Ò	R!Ò R!ÓS"ÔT)FN)TFTNr   )ÚFigureFN)r
   r±   r°   r¦   Úpathlibr   Úplotly.io._utilsr   r   Ú_plotly_utils.optional_importsr   Ú_plotly_utils.basevalidatorsr   Úobjectr	   rN   r,   rQ   rX   r7   r`   rk   rs   r{   r   r„   rZ   r'   r   r   ú<module>rÀ      s„   ðÛ Û Û Û Ý ç UÝ 5Ý :ô
N�ô Nñ< 
‹€ò	ð€
ð
 ð ñ €òó]Vó@/BódI"óX>óB1óh<ó~xr   