
    yXh                     ~    d Z ddlmZmZ ddlmZmZ eeef         Z		 	 	 dde	d	ed
ee         de
de	f
dZdedefdZdS )z4Provides a wrpper for the Rust based implementation.    )OptionalUnion   )get_base_level_innerget_display_innerutf-8NFstr_or_bytesencodingbase_dirdebugreturnc                     t          | t                    r|                     |          }d}n| }d}t          |||          }|r|                    |          }|S )aa  Accepts string or bytes. In case of bytes, `encoding`
    is needed as the inner function expects a valid string (default:"utf-8").

    Set `base_dir` to 'L' or 'R' to override the calculated base_level.

    Set `debug` to True to return the calculated levels.

    Returns the display layout, either as unicode or `encoding` encoded
    string.

    TF)
isinstancebytesdecoder   encode)r	   r
   r   r   textwas_decodeddisplays          ^/var/www/tools.fuzzalab.pt/emblema-extractor/venv/lib/python3.11/site-packages/bidi/wrapper.pyget_displayr   	   si    " ,&& ""8,,h66G +..**N    r   c                      t          |           S )zxReturns the base unicode level of the 1st paragraph in `text`.

    Return value of 0 means LTR, while 1 means RTL.
    )r   )r   s    r   get_base_levelr   )   s    
  %%%r   )r   NF)__doc__typingr   r   bidir   r   strr   
StrOrBytesboolr   intr    r   r   <module>r#      s    : : " " " " " " " " 9 9 9 9 9 9 9 93:
 "	  sm 	
    @& & & & & & & &r   