"""HTML ID constants for HTMX targeting in the media gallery."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/core/html_ids.ipynb.

# %% auto #0
__all__ = ['GalleryHtmlIds']

# %% ../../nbs/core/html_ids.ipynb #c3d4e5f6
from dataclasses import dataclass

# %% ../../nbs/core/html_ids.ipynb #e5f6a7b8
@dataclass(frozen=True)
class GalleryHtmlIds:
    """Default HTML IDs for media gallery components."""
    
    # Main containers
    GALLERY: str = "media-gallery"
    CONTENT: str = "media-gallery-content"
    
    # Controls
    CONTROLS: str = "media-gallery-controls"
    VIEW_TOGGLE: str = "media-gallery-view-toggle"
    TYPE_FILTER: str = "media-gallery-type-filter"
    
    # Grid view
    GRID: str = "media-gallery-grid"
    GRID_ITEM_PREFIX: str = "media-gallery-item-"
    
    # List view
    LIST: str = "media-gallery-list"
    LIST_ITEM_PREFIX: str = "media-gallery-row-"
    
    # Preview modal
    PREVIEW_MODAL: str = "media-preview-modal"
    PREVIEW_CONTENT: str = "media-preview-content"
    PREVIEW_PLAYER: str = "media-preview-player"
    PREVIEW_INFO: str = "media-preview-info"
    
    # Pagination
    PAGINATION: str = "media-gallery-pagination"
    
    # Hidden inputs for HTMX
    CURRENT_PAGE_INPUT: str = "media-gallery-current-page"
    VIEW_MODE_INPUT: str = "media-gallery-view-mode"
    TYPE_FILTER_INPUT: str = "media-gallery-type-filter-value"
    SELECTED_PATHS_INPUT: str = "media-gallery-selected-paths"
    PREVIEW_PATH_INPUT: str = "media-gallery-preview-path"
    
    @classmethod
    def grid_item_id(
        cls,
        index: int  # Item index in the grid
    ) -> str:  # HTML ID for the grid item
        """Generate grid item ID for a specific index."""
        return f"{cls.GRID_ITEM_PREFIX}{index}"
    
    @classmethod
    def list_item_id(
        cls,
        index: int  # Item index in the list
    ) -> str:  # HTML ID for the list row
        """Generate list item ID for a specific index."""
        return f"{cls.LIST_ITEM_PREFIX}{index}"
    
    @classmethod
    def as_selector(
        cls,
        html_id: str  # HTML ID
    ) -> str:  # CSS selector for the ID
        """Convert HTML ID to CSS selector."""
        return f"#{html_id}"
