o
    h                     @  sv   d dl mZ d dlmZ d dlmZ d dlmZ er d dl	m
Z
 ddd	Zdd
dZdddZdddZdddZdS )    )annotations)version)TYPE_CHECKING)Version)
ModuleTypereturnr   c                  C  s   d} z6dd l }td}t|tdkr|W S td}||ks&t|t| k r6d|  d| d| d	}t||W S  ty] } zd
|  d|  d|  d|  d|jd  
}t||d }~ww )Nz1.5.0r   
vegafusionz2.0.0a0zvegafusion-python-embedzcThe versions of the vegafusion and vegafusion-python-embed packages must match
and must be version z# or greater.
Found:
 - vegafusion==z
 - vegafusion-python-embed==
zVThe "vegafusion" data transformer and chart.transformed_data feature requires
version z or greater of the 'vegafusion-python-embed' and 'vegafusion' packages.
These can be installed with pip using:
    pip install "vegafusion[embed]>=zR"
Or with conda using:
    conda install -c conda-forge "vegafusion-python-embed>=z" "vegafusion>="

ImportError: )r   importlib_versionr   RuntimeErrorImportErrorargs)min_versionvfr   embed_versionmsgerr r   K/var/www/vscode/kcb/lib/python3.10/site-packages/altair/utils/_importers.pyimport_vegafusion   sD   

r   c                  C  s   d} zt d}t|t| k rd|  d| }t|dd l}|W S  tyC } zd|  d|  d|  d	|jd  }t||d }~ww )
Nz1.6.0zvl-convert-pythonz.The vl-convert-python package must be version  or greater. Found version r   zKThe vl-convert Vega-Lite compiler and file export feature requires
version zz or greater of the 'vl-convert-python' package. 
This can be installed with pip using:
   pip install "vl-convert-python>=z@"
or conda:
   conda install -c conda-forge "vl-convert-python>=r
   )r   r   r   
vl_convertr   r   )r   r   r   vlcr   r   r   r   import_vl_convert/   s2   
	r   strc                  C  s$   ddl m}  d| dd d S )Nr   SCHEMA_VERSION_.   )altair.vegaliter   joinsplitr   r   r   r   vl_version_for_vl_convertI   s   r$   c                  C  s   d} z!t d}t|t| k rd|  d| }t|dd lm} |W S  tyE } zd|  d|  d|  d	|jd  }t||d }~ww )
Nz11.0.0pyarrowz$The pyarrow package must be version r   r   z=Usage of the DataFrame Interchange Protocol requires
version zd or greater of the pyarrow package. 
This can be installed with pip using:
   pip install "pyarrow>=z6"
or conda:
   conda install -c conda-forge "pyarrow>=r
   )r   r   r   pyarrow.interchangeinterchanger   r   )r   r   r   pir   r   r   r   import_pyarrow_interchangeQ   s2   
	r)   boolc                	   C  s&   zt   W dS  ttfy   Y dS w )NTF)r)   r   r   r   r   r   r   pyarrow_availablel   s   r+   N)r   r   )r   r   )r   r*   )
__future__r   importlib.metadatar   r   typingr   packaging.versionr   typesr   r   r   r$   r)   r+   r   r   r   r   <module>   s    

#

