"""Market defpage setup — registers layouts, page helpers, and loads .sx pages."""
from __future__ import annotations


def setup_market_pages() -> None:
    """Register market-specific layouts, page helpers, and load page definitions."""
    from .layouts import _register_market_layouts
    from .helpers import _register_market_helpers
    _register_market_layouts()
    _register_market_helpers()
    _load_market_page_files()


def _load_market_page_files() -> None:
    import os
    from shared.sx.pages import load_page_dir
    from shared.sx.jinja_bridge import load_service_components
    sxc_dir = os.path.dirname(os.path.dirname(__file__))
    service_root = os.path.dirname(sxc_dir)
    load_service_components(service_root, service_name="market")
    load_page_dir(os.path.dirname(__file__), "market")
