<commit_before>import ListenerAdapter from '../Observer/ListenerAdapter';
import Observer from '../Observer/Observer';
import ThemesManager from './ThemesManager';
import ThemesRegistry, {Theme} from './ThemesRegistry';

class Container {
  registry: ThemesRegistry;
  currentThemeAdapter: ListenerAdapter<Theme>;
  currentTheme: Observer<Theme>;
  manager: ThemesManager;

  constructor() {
    this.registry = new ThemesRegistry();
    this.currentThemeAdapter = new ListenerAdapter<Theme>();
    this.currentTheme = new Observer<Theme>(this.registry.getTheme('unknown'), this.currentThemeAdapter);
    this.manager = new ThemesManager(this.currentTheme, this.registry);

    this.setupDefaults();
  }

  protected setupDefaults(): void {
    this.registry.registerTheme({
      isBuildIn: true,
      name: 'Google',
      url: 'Theme/Google'
    });
    this.registry.registerTheme({
      isBuildIn: true,
      name: 'Codefrog',
      url: 'Theme/Codefrog'
    });
    this.manager.changeTheme('Google');
  }
}

export default new Container();<commit_msg>Connect store to themes manager.<commit_after>import ListenerAdapter from '../Observer/ListenerAdapter';
import Observer from '../Observer/Observer';
import DataStorage from '../Storage/DataStorage';
import ThemesManager from './ThemesManager';
import ThemesRegistry, {Theme} from './ThemesRegistry';

class Container {
  registry: ThemesRegistry;
  currentThemeAdapter: ListenerAdapter<Theme>;
  currentTheme: Observer<Theme>;
  manager: ThemesManager;
  storage: DataStorage;

  constructor() {
    this.storage = new DataStorage('theme', window.localStorage);
    this.registry = new ThemesRegistry();
    this.currentThemeAdapter = new ListenerAdapter<Theme>();
    this.currentTheme = new Observer<Theme>(
      this.storage.loadData<Theme>(
        'currentTheme',
        {
          isBuildIn: true,
          name: 'Google',
          url: 'Theme/Google'
        }
      ),
      this.storage.attach<Theme>('currentTheme', this.currentThemeAdapter)
    );
    this.manager = new ThemesManager(this.currentTheme, this.registry);

    this.setupDefaults();
  }

  protected setupDefaults(): void {
    this.registry.registerTheme({
      isBuildIn: true,
      name: 'Google',
      url: 'Theme/Google'
    });
    this.registry.registerTheme({
      isBuildIn: true,
      name: 'Codefrog',
      url: 'Theme/Codefrog'
    });
  }
}

export default new Container();
{'fraction_non_alphanumeric': 0.1265406737880033, 'fraction_numerical': 0.0, 'mean_word_length': 3.6826923076923075, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1167592', 'n_tokens_mistral': 685, 'n_tokens_neox': 672, 'n_words': 151}