
    :Qg                        U d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZ d dlmZ d	Zd
ed<   	 dddddgdd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)    )annotations)IOAnyOptional)Element)&convert_file_to_html_text_using_pandoc)FileType)exactly_one)get_last_modified_date)partition_htmlepubstrDETECTION_ORIGINNautoF)filemetadata_filenamemetadata_last_modified	languagesdetect_language_per_elementc                   t        | |       | rt        |       nd}t        d| |      }t        d|d|xs | t        j
                  |xs |||t        d|S )a  Partitions an EPUB document. The document is first converted to HTML and then
    partitioned using partition_html.

    Parameters
    ----------
    filename
        A string defining the target filename path.
    file
        A file-like object using "rb" mode --> open(filename, "rb").
    metadata_last_modified
        The last modified date for the document.
    languages
        User defined value for `metadata.languages` if provided. Otherwise language is detected
        using naive Bayesian filter via `langdetect`. Multiple languages indicates text could be
        in either language.
        Additional Parameters:
            detect_language_per_element
                Detect language per element instead of at the document level.
    )filenamer   Nr   )source_formatr   r   unicode)textencodingr   metadata_file_typer   r   r   detection_origin )r
   r   r   r   r	   EPUBr   )	r   r   r   r   r   r   kwargslast_modified	html_texts	            X/var/www/html/answerous/venv/lib/python3.12/site-packages/unstructured/partition/epub.pypartition_epubr$      sr    : -8@*84dM6xdI  
+7x#==5F$?)
 
 
    )N)r   Optional[str]r   zOptional[IO[bytes]]r   r&   r   r&   r   zOptional[list[str]]r   boolr    r   returnzlist[Element])
__future__r   typingr   r   r   unstructured.documents.elementsr   'unstructured.file_utils.file_conversionr   unstructured.file_utils.modelr	   $unstructured.partition.common.commonr
   &unstructured.partition.common.metadatar   unstructured.partition.htmlr   r   __annotations__r$   r   r%   r#   <module>r2      s    " $ $ 3 Z 2 < I 6 #  #/ !%'+,0&,X(-// / %	/
 */ #/ "&/ / /r%   