# Path: wikitextparser/_config.py
# def _plant_trie(strings: _Iterable[str]) -> dict:
# def _pattern(trie: dict) -> str:
# def regex_pattern(words: _Iterable[str]) -> bytes:
# _HTML_TAG_NAME = regex_pattern(_valid_html_tag_names) + br'\b'


from functools import partial
from typing import Callable, Dict, Optional
from regex import DOTALL, REVERSE, compile as regex_compile, IGNORECASE
from ._config import (
    _HTML_TAG_NAME, _bare_external_link_schemes, _parsable_tag_extensions,
    _parser_functions, _unparsable_tag_extensions, regex_pattern)
        rb')?+'
        rb'(?>'
            rb'(?<!\]\0*+)'
            rb'\]'
        rb')?+'
        # single matching brackets are allowed in text e.g. [[a|[b]]]
        rb'(?>'
            rb'[^\[\]\|]*+'
            rb'\['
            rb'[^\[\]\|]*+'
            rb'\]'
            rb'(?!(?:\0*+\]){3})'
        rb')?+'
        rb'[^\[\]\|]*+'
    rb')*+'
    rb'\]\0*+\]'
    rb'|\{\{\{('
        rb'[^{}]++'
        rb'|(?<!})}(?!})'
        rb'|(?<!{){'
    rb')++\}\}\}',
    REVERSE).finditer

# these characters interfere with detection of (args|tls|wlinks|wlists)
pbba_tt = b''.maketrans(b"|[]'{}", b'\1\2\3\7\5\6')
blank_sensitive_chars = partial(regex_compile(br'[\|\{\}\n]').sub, br' ')
blank_brackets = partial(regex_compile(br'[\[\]]').sub, br' ')

PARSABLE_TAG_EXTENSION_NAME = regex_pattern(
    _parsable_tag_extensions)

# Path: wikitextparser/_config.py
# def _plant_trie(strings: _Iterable[str]) -> dict:
# def _pattern(trie: dict) -> str:
# def regex_pattern(words: _Iterable[str]) -> bytes:
# _HTML_TAG_NAME = regex_pattern(_valid_html_tag_names) + br'\b'


# Path: wikitextparser/_spans.py
from functools import partial
from typing import Callable, Dict, Optional
from regex import DOTALL, REVERSE, compile as regex_compile, IGNORECASE
from ._config import (
    _HTML_TAG_NAME, _bare_external_link_schemes, _parsable_tag_extensions,
    _parser_functions, _unparsable_tag_extensions, regex_pattern)

        rb')?+'
        rb'(?>'
            rb'(?<!\]\0*+)'
            rb'\]'
        rb')?+'
        # single matching brackets are allowed in text e.g. [[a|[b]]]
        rb'(?>'
            rb'[^\[\]\|]*+'
            rb'\['
            rb'[^\[\]\|]*+'
            rb'\]'
            rb'(?!(?:\0*+\]){3})'
        rb')?+'
        rb'[^\[\]\|]*+'
    rb')*+'
    rb'\]\0*+\]'
    rb'|\{\{\{('
        rb'[^{}]++'
        rb'|(?<!})}(?!})'
        rb'|(?<!{){'
    rb')++\}\}\}',
    REVERSE).finditer

# these characters interfere with detection of (args|tls|wlinks|wlists)
pbba_tt = b''.maketrans(b"|[]'{}", b'\1\2\3\7\5\6')
blank_sensitive_chars = partial(regex_compile(br'[\|\{\}\n]').sub, br' ')
blank_brackets = partial(regex_compile(br'[\[\]]').sub, br' ')

PARSABLE_TAG_EXTENSION_NAME = regex_pattern(
    _parsable_tag_extensions)

UNPARSABLE_TAG_EXTENSION_NAME = regex_pattern(