"""Normalizer config classes for meshulash-guard.

Import normalizers:
    from meshulash_guard.normalizers import UnicodeNormalizer, HomoglyphNormalizer
    from meshulash_guard import UnicodeNormalizer  # also works
"""

from .unicode import UnicodeNormalizer
from .invisible_text import InvisibleTextNormalizer
from .homoglyph import HomoglyphNormalizer
from .encoding import EncodingNormalizer
from .strip_html import StripHtmlNormalizer
from .strip_markdown import StripMarkdownNormalizer
from .lowercase import LowercaseNormalizer
from .collapse_whitespace import CollapseWhitespaceNormalizer

# Default-instantiated normalizers in canonical security order.
# normalizers="all" expands to this tuple.
ALL_NORMALIZERS = (
    InvisibleTextNormalizer(),
    UnicodeNormalizer(),
    EncodingNormalizer(),
    HomoglyphNormalizer(),
    StripHtmlNormalizer(),
    StripMarkdownNormalizer(),
    LowercaseNormalizer(),
    CollapseWhitespaceNormalizer(),
)

# Canonical security order for auto_order=True.
# invisible -> unicode -> encoding -> homoglyph -> extras
CANONICAL_ORDER: dict[str, int] = {
    "invisible_text": 1,
    "unicode": 2,
    "encoding": 3,
    "homoglyph": 4,
    "strip_html": 5,
    "strip_markdown": 6,
    "lowercase": 7,
    "collapse_whitespace": 8,
}

__all__ = [
    "UnicodeNormalizer",
    "InvisibleTextNormalizer",
    "HomoglyphNormalizer",
    "EncodingNormalizer",
    "StripHtmlNormalizer",
    "StripMarkdownNormalizer",
    "LowercaseNormalizer",
    "CollapseWhitespaceNormalizer",
    "ALL_NORMALIZERS",
    "CANONICAL_ORDER",
]
