
    qZhy                    p    d dl mZ d dlZd dlZd dlmZ ddlmZmZ d
dZddZ	dddZ
ed	k(  r e
        yy)    )annotationsN)Any   )slugifyDEFAULT_SEPARATORc                   t        j                  d      j                  d      }|j                  ddd       |j                  dd	d
       j                  ddddd       j                  ddddd       j                  ddddd       j                  dt        dd       j                  dd	dd       j                  d d	dd!       j                  d"t
        t        d#t        z          j                  d$d%d&       j                  d'd()       j                  d*dd+dd,       j                  d-d%d.       j                  d/d	dd0       j                  | d1d        }|j                  r|j                  rj                  d2       |j                  r*fd3}|j                  D cg c]
  } ||       c}|_        |j                  r!d4j                  |j                        |_        n/|j                  r#t        j                  j                         |_        |j                  sd5|_        |S c c}w )6NzSlug string)descriptionInputinput_string*zText to slugify)nargshelpz--stdin
store_truezTake the text from STDIN)actionr   z--no-entitiesstore_falseentitiesTz'Do not convert HTML entities to unicode)r   destdefaultr   z--no-decimaldecimalz&Do not convert HTML decimal to unicodez--no-hexadecimalhexadecimalz*Do not convert HTML hexadecimal to unicodez--max-lengthr   z$Output string length, 0 for no limit)typer   r   z--word-boundaryFzJTruncate to complete word even if length ends up shorter than --max_length)r   r   r   z--save-orderzEWhen set and --max_length > 0 return whole words in the initial orderz--separatorz$Separator between words. By default z--stopwords+zWords to discountz--regex-patternz.Python regex pattern for disallowed characters)r   z--no-lowercase	lowercasezActivate case sensitivityz--replacementsz9Additional replacement rules e.g. "|->or", "%%->percent".z--allow-unicodezAllow unicode charactersr   z.Input strings and --stdin cannot work togetherc                v    d}|| vr!j                  dj                  |             | j                  |d      S )Nz->z7Replacements must be of the form: ORIGINAL{SEP}REPLACED)SEPr   )errorformatsplit)replr   parsers     l/var/www/html/wine-match-dev/backend/winematch-backend/venv/lib/python3.12/site-packages/slugify/__main__.pysplit_checkzparse_args.<locals>.split_check2   s<    C$V]]be]fg::c1%%      )argparseArgumentParseradd_argument_groupadd_argumentintstrr   
parse_argsr   stdinr   replacementsjoinsysread)argvinput_groupargsr"   r   r    s        @r!   r,   r,   
   s   $$?F+++@K^3"3  5Y|"<  > JX\F  H
}9VZE  G
*=}^bI  K
S!C  E
),i  k
|Ud  f
C9JCFWW  Y
S0  2
)M  O
([Z^8  :
(\  ^
),7  9 T!"X&DTZZEF	&
 <@;L;LM4[.MHHT%6%67	IINN,K Ns   =Ic                    t        | j                  | j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  | j                  | j                        S )N)textr   r   r   
max_lengthword_boundary
save_order	separator	stopwordsr   r.   allow_unicode)dictr   r   r   r   r7   r8   r9   r:   r;   r   r.   r<   )r4   s    r!   slugify_paramsr>   D   sm    $$??((??......&&(( r#   c                    | t         j                  } t        |       }t        |      }	 t	        t        di |       y# t        $ r t        j                  d       Y yw xY w)z Run this program N )r0   r2   r,   r>   printr   KeyboardInterruptexit)r2   r4   paramss      r!   mainrF   U   sS    |xxdDD!Fg  s   ? A A __main__)r2   z	list[str]returnargparse.Namespace)r4   rI   rH   zdict[str, Any])N)r2   zlist[str] | None)
__future__r   r&   r0   typingr   r   r   r,   r>   rF   __name__rA   r#   r!   <module>rM      s8    "  
  /7t"	 zF r#   