"""CSS class constants, type aliases, and default values for the card stack library."""

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

# %% auto #0
__all__ = ['CardRole', 'SCROLL_THRESHOLD', 'NAVIGATION_COOLDOWN', 'TRACKPAD_COOLDOWN', 'TOUCH_SWIPE_THRESHOLD',
           'TOUCH_MOMENTUM_MIN_VELOCITY', 'TOUCH_MOMENTUM_FRICTION', 'TOUCH_PINCH_THRESHOLD', 'TOUCH_VELOCITY_SAMPLES',
           'DEFAULT_VISIBLE_COUNT', 'DEFAULT_CARD_WIDTH', 'DEFAULT_CARD_SCALE', 'width_storage_key',
           'scale_storage_key', 'card_count_storage_key', 'auto_count_storage_key']

# %% ../../nbs/core/constants.ipynb #e1000003
from typing import Literal

# %% ../../nbs/core/constants.ipynb #e1000005
CardRole = Literal["focused", "context"]

# %% ../../nbs/core/constants.ipynb #e1000008
SCROLL_THRESHOLD: int = 1        # Pixels of wheel delta to trigger navigation
NAVIGATION_COOLDOWN: int = 100   # Milliseconds between mouse-wheel-triggered navigations
TRACKPAD_COOLDOWN: int = 250     # Milliseconds between trackpad-triggered navigations

# %% ../../nbs/core/constants.ipynb #3puzigsb6cl
TOUCH_SWIPE_THRESHOLD: int = 30        # Minimum pixels for a quick swipe to trigger one navigation step
TOUCH_MOMENTUM_MIN_VELOCITY: float = 0.5  # Minimum px/ms velocity at touchend to trigger momentum
TOUCH_MOMENTUM_FRICTION: float = 0.95  # Per-frame (16ms) velocity decay multiplier during momentum
TOUCH_PINCH_THRESHOLD: int = 30        # Minimum px change in pinch distance to trigger one scale step
TOUCH_VELOCITY_SAMPLES: int = 5        # Number of recent touchmove samples for velocity estimation

# %% ../../nbs/core/constants.ipynb #e1000011
def width_storage_key(
    prefix: str  # Card stack instance prefix
) -> str:  # localStorage key for card width
    """Generate localStorage key for card width."""
    return f"{prefix}-card-width"

def scale_storage_key(
    prefix: str  # Card stack instance prefix
) -> str:  # localStorage key for card scale
    """Generate localStorage key for card scale."""
    return f"{prefix}-card-scale"

def card_count_storage_key(
    prefix: str  # Card stack instance prefix
) -> str:  # localStorage key for card count
    """Generate localStorage key for card count."""
    return f"{prefix}-card-count"

def auto_count_storage_key(
    prefix: str  # Card stack instance prefix
) -> str:  # localStorage key for auto card count mode
    """Generate localStorage key for auto card count mode."""
    return f"{prefix}-card-count-auto"

# %% ../../nbs/core/constants.ipynb #e1000014
DEFAULT_VISIBLE_COUNT: int = 3  # Default number of cards visible in viewport
DEFAULT_CARD_WIDTH: int = 80    # Default card stack width in rem
DEFAULT_CARD_SCALE: int = 100   # Default card scale percentage
