from ...common import (CONFIGURATION_PATTERN, COMPONENT_PATTERN, CONFIGURATION_BEFORE_STOP_WORDS,
                       COMPONENT_AFTER_STOP_WORDS, ATTACKER_BEFORE_STOP_WORDS,
                       ATTACKER_PATTERN, ATTACKER_AFTER_STOP_WORDS, IMPACT_BEFORE_STOP_WORDS, IMPACT_PATTERN,
                       VECTOR_BEFORE_STOP_WORDS, VECTOR_PATTERN, ROOT_CAUSE_BEFORE_STOP_WORD, ROOT_CAUSE_PATTERN,
                       CONDITION_BEFORE_STOP_WORDS, CONDITION_PATTERN)


# component config condition
COMPONENT_CONFIG_CONDITION_PATTERN = (
        r'(?:The |)' + COMPONENT_PATTERN + COMPONENT_AFTER_STOP_WORDS +  CONFIGURATION_BEFORE_STOP_WORDS +
        CONFIGURATION_PATTERN + CONDITION_BEFORE_STOP_WORDS + CONDITION_PATTERN
)

# component config condition root_cause attacker impact vector
DETAILS_7_1 = (COMPONENT_CONFIG_CONDITION_PATTERN + ROOT_CAUSE_BEFORE_STOP_WORD + ROOT_CAUSE_PATTERN +
               ATTACKER_BEFORE_STOP_WORDS + ATTACKER_PATTERN + ATTACKER_AFTER_STOP_WORDS + IMPACT_BEFORE_STOP_WORDS +
               IMPACT_PATTERN + VECTOR_BEFORE_STOP_WORDS + VECTOR_PATTERN + r'\.$')


COMPONENT_CONFIG_CONDITION_PATTERNS = {
    '7_1': DETAILS_7_1
}
