import NormalisationRuleStore from './normalisation-rule-store' ; import SelectionInfoRegistry from './selection-info-registry' ; import TextTitleBuilder from './text-title-builder' ; const DiffModeSymbols = { NORMALISED : '\u007e' , AS_IS : '\u2194' } ; export default class DiffTitleBuilder { private textTitleBuilder : TextTitleBuilder ; constructor ( private readonly normalisationRuleStore , private readonly selectionInfoRegistry ) { this . textTitleBuilder = new TextTitleBuilder ( ) ; } build ( textKey1 , textKey2 ) { const title1 = this . buildTextTitle ( textKey1 ) ; const title2 = this . buildTextTitle ( textKey2 ) ; const comparisonSymbol = this . normalisationRuleStore . hasActiveRules ? DiffModeSymbols . NORMALISED : DiffModeSymbols . AS_IS ; return `${ title1 } ${ comparisonSymbol } ${ title2 }` ; } private buildTextTitle ( textKey ) { const textInfo = this . selectionInfoRegistry . get ( textKey ) ; return this . textTitleBuilder . build ( textInfo ) ; } }