
    BiQ                       U d Z ddlmZ ddlmZ ddlmZmZmZ  G d de	e      Z
 G d de	e      Z G d	 d
e      Z edddej                         edddej                         edddej                         edddej                         edddej                         edddej                         eddd ej                         ed!d"d#ej                         ed$d%d&ej                         ed'd(d)ej                          ed*d+d,ej                          ed-d.d/ej                          ed0d1d2ej                          ed3d4d5ej"                         ed6d7d8ej"                        d9Zd:ed;<   d<d=d>d?Zd@edA<   dBe
j*                  dCdDdEdEdFdFdGZdHedI<   dDdJdKdLdKdLdMdNdOZdPedQ<   dRdRdSZdPedT<   dUdVdWdXdYdZd[d\d]ZdPed^<   ddd_Zded`ZdfdaZdgdbZdgdcZyF)ha  
Constants and style definitions for Napkin AI API.

This module centralizes:
- Supported output formats and style categories
- Built-in visual styles with metadata
- API endpoints, defaults, constraints, rate limits, and HTTP status codes

Design goals:
- Strong typing for safer usage across the codebase
- Immutable, read-only mappings to avoid accidental mutation
- Helper functions with clear errors and predictable behavior
    )annotations)Enum)ListMapping
NamedTuplec                      e Zd ZdZdZdZy)OutputFormatz%Supported output formats for visuals.svgpngN)__name__
__module____qualname____doc__SVGPNG     2/var/www/html/Napkin-AI-API/src/utils/constants.pyr	   r	      s    /
C
Cr   r	   c                  (    e Zd ZdZdZdZdZdZdZdZ	y)	StyleCategoryzVisual style categories.colorfulcasual
hand_drawnformal
monochromecustomN)
r   r   r   r   COLORFULCASUAL
HAND_DRAWNFORMAL
MONOCHROMECUSTOMr   r   r   r   r      s#    "HFJFJFr   r   c                  :    e Zd ZU dZded<   ded<   ded<   ded<   y)	StylezVisual style definition.stridnamedescriptionr   categoryN)r   r   r   r   __annotations__r   r   r   r$   r$   '   s    "G
Ir   r$   CDQPRVVJCSTPRBBCD5Q6AWRzVibrant Strokesz$A flow of vivid lines for bold notes)r&   r'   r(   r)   CDQPRVVJCSTPRBBKDXK78zGlowful Breezez0A swirl of cheerful color for laid-back planningCDQPRVVJCSTPRBB6DHGQ8zBold Canvasz(A vivid field of shapes for lively notesCDQPRVVJCSTPRBB6D5P6RSB4zRadiant Blocksz(A bright spread of solid color for tasksCDQPRVVJCSTPRBB7E9GP8TB5DST0zPragmatic Shadesz(A palette of blended hues for bold ideasCDGQ6XB1DGPQ6VV6EGzCarefree Mistz&A wisp of calm tones for playful tasksCDGQ6XB1DGPPCTBCDHJP8zLively Layersz'A breeze of soft color for bright ideasD1GPWS1DCDQPRVVJCSTPRzArtistic Flairz2A splash of hand-drawn color for creative thinkingD1GPWS1DDHMPWSBKzSketch Notesz)A hand-drawn style for free-flowing ideas CSQQ4VB1DGPP4V31CDNJTVKFBXK6JV3CzElegant Outlinez0A refined black outline for professional clarityCSQQ4VB1DGPPRTB7D1T0zSubtle Accentz1A light touch of color for professional documentsCSQQ4VB1DGPQ6TBECXP6ABB3DXP6YWGzMonochrome Proz1A single-color approach for focused presentations$CSQQ4VB1DGPPTVVEDXHPGWKFDNJJTSKCC5T0zCorporate Cleanz/A professional flat style for business diagramsDNQPWVV3D1S6YVB55NK6RRBMzMinimal Contrastz)A clean monochrome style for focused workCXS62Y9DCSQP6XBKzSilver Beamz2A spotlight of gray scale ease with striking focus)vibrant-strokeszglowful-breezezbold-canvaszradiant-blockszpragmatic-shadeszcarefree-mistzlively-layerszartistic-flairzsketch-noteszelegant-outlinezsubtle-accentzmonochrome-prozcorporate-cleanzminimal-contrastzsilver-beamzMapping[str, Style]STYLESz/visualz/visual/{request_id}/statusz#/visual/{request_id}/file/{file_id})create_visual
get_statusget_filezMapping[str, str]API_ENDPOINTSr:   zen-US   FN)styleformatlanguagenumber_of_visualstransparent_backgroundinverted_colorwidthheightzMapping[str, object]DEFAULTS   d   i   i'  i  )min_visualsmax_visuals	min_width	max_width
min_height
max_heightmax_content_lengthmax_context_lengthzMapping[str, int]CONSTRAINTS<   )requests_per_minuteretry_after_defaultRATE_LIMITS   i  i  i  i  i  i  i  )createdbad_requestunauthorized	forbidden	not_foundgone
rate_limitserver_errorHTTP_STATUSc                v    t         j                         D ]  }|j                  | k(  s|c S  t        d|       )z
    Get style by ID.

    Args:
        style_id: The style ID to look up.

    Returns:
        Style object if found.

    Raises:
        ValueError: If style ID is not found.
    zStyle ID not found: )r;   valuesr&   
ValueError)style_idrA   s     r   get_style_by_idrg      s:     88xL ! +H<8
99r   c                   | j                         j                         j                  dd      }|t        v r	t        |   S t        j	                         D ]?  }|j
                  j                         | j                         j                         k(  s=|c S  dj                  t        t        j                                     }t        d| d|       )z
    Get style by name or slug.

    Args:
        name: Style name or slug (e.g., "vibrant-strokes" or "Vibrant Strokes").

    Returns:
        Style object if found.

    Raises:
        ValueError: If style name is not found.
     -z, zStyle not found: z. Valid options: )
striplowerreplacer;   rd   r'   joinsortedkeysre   )r'   slugrA   valids       r   get_style_by_namers      s     ::<''S1Dv~d| ::!3!3!55L !
 IIfV[[]+,E
(0A%I
JJr   c                p    t         j                         D cg c]  }|j                  | k(  s| c}S c c}w )z
    Get all styles in a category.

    Args:
        category: The style category to filter by.

    Returns:
        List of styles in the category.
    )r;   rd   r)   )r)   rA   s     r   get_styles_by_categoryru      s-      &}}Me%..H2LEMMMs   33c                 <    t        t        j                               S )zc
    Get list of all available style names.

    Returns:
        List of style names (slugs).
    )listr;   rp   r   r   r   list_style_namesrx     s     r   c                 d    t         j                         D  cg c]  } | j                   c} S c c} w )zW
    Get list of all available style IDs.

    Returns:
        List of style IDs.
    )r;   rd   r&   )rA   s    r   list_style_idsrz     s&     #)--/2/EHH/222s   -)rf   r%   returnr$   )r'   r%   r{   r$   )r)   r   r{   zList[Style])r{   z	List[str])r   
__future__r   enumr   typingr   r   r   r%   r	   r   r$   r   r   r   r    r!   r;   r*   r?   r   rI   rT   rX   rb   rg   rs   ru   rx   rz   r   r   r   <module>r      s   #  , ,3 C J  $:''	 "F''	 ">''	 %>''	 )>''	 <%%	 "=%%	 "H))	 ?))	 -F%%	 !G%%	 ,G%%	 1E%%	 %?))	 H))	u` `J /5$   #	"
 	 	" 	 "  	" 	:(K8
N3r   