
    9i                     v    S r SSKJrJr  SSKJrJr  \\\4   r	   SS\	S\S\\   S	\
S
\	4
S jjrS\S
\4S jrg)z4Provides a wrpper for the Rust based implementation.    )OptionalUnion   )get_base_level_innerget_display_innerNstr_or_bytesencodingbase_dirdebugreturnc                     [        U [        5      (       a  U R                  U5      nSnOU nSn[        XBU5      nU(       a  UR	                  U5      nU$ )aI  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          L/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/bidi/wrapper.pyget_displayr   	   sR    " ,&&""8,6G..*N    r   c                     [        U 5      $ )zpReturns 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   )zutf-8NF)__doc__typingr   r   bidir   r   strr   
StrOrBytesboolr   intr    r   r   <module>r"      sr    : " 93:
 "	 sm 	
 @& & &r   