<commit_before>import { Services } from '../types'
import { Repository } from './Repository'
import { ViewStore } from './ViewStore'
import { InfoStore } from './InfoStore'
import { BookmarkStore } from './BookmarkStore'
import { HelpStore } from './HelpStore'

export class AppStore {
  private repository: Repository
  view: ViewStore
  info: InfoStore
  bookmark: BookmarkStore
  help: HelpStore

  constructor(services: Services) {
    const repository = new Repository(services)

    this.repository = repository
    this.view = new ViewStore(services, repository)
    this.info = new InfoStore(services.storage, repository)
    this.bookmark = new BookmarkStore(services, repository)
    this.help = new HelpStore(services.shortcut)
    services.shortcut.register({
      key: 'j',
      description: '次の作品へ',
      priority: 100,
      handler: () => {
        repository.cycle(false)
      }
    })
    services.shortcut.register({
      key: 'k',
      description: '前の作品へ',
      priority: 100,
      handler: () => {
        repository.cycle(true)
      }
    })
    services.shortcut.register({
      key: 'v',
      description: 'スケーリング方式を変更',
      priority: 100,
      handler: () => {
        this.view.cycleFit()
      }
    })
    services.shortcut.register({
      key: 'h',
      description: '見開き方式を変更',
      priority: 100,
      handler: () => {
        this.view.cycleSpread()
      }
    })
    services.shortcut.register({
      key: 'i',
      description: '情報欄のトグル',
      priority: 100,
      handler: () => {
        this.info.toggle()
      }
    })
    services.shortcut.register({
      key: 'b',
      description: 'ブックマークフォームを表示',
      handler: () => {
        this.bookmark.open()
      }
    })
    services.shortcut.register({
      key: 'l',
      description: 'いいね！',
      handler: () => {
        if (repository.isControllable) {
          repository.current!.likeItIfNeeded()
        }
      }
    })
    services.shortcut.register({
      key: 's',
      description: 'Twitterでシェア',
      handler: () => {
        if (repository.isControllable) {<commit_msg>add quick bookmark keyboard shortcut<commit_after>import { Services } from '../types'
import { Repository } from './Repository'
import { ViewStore } from './ViewStore'
import { InfoStore } from './InfoStore'
import { BookmarkStore } from './BookmarkStore'
import { HelpStore } from './HelpStore'

export class AppStore {
  private repository: Repository
  view: ViewStore
  info: InfoStore
  bookmark: BookmarkStore
  help: HelpStore

  constructor(services: Services) {
    const repository = new Repository(services)

    this.repository = repository
    this.view = new ViewStore(services, repository)
    this.info = new InfoStore(services.storage, repository)
    this.bookmark = new BookmarkStore(services, repository)
    this.help = new HelpStore(services.shortcut)
    services.shortcut.register({
      key: 'j',
      description: '次の作品へ',
      priority: 100,
      handler: () => {
        repository.cycle(false)
      }
    })
    services.shortcut.register({
      key: 'k',
      description: '前の作品へ',
      priority: 100,
      handler: () => {
        repository.cycle(true)
      }
    })
    services.shortcut.register({
      key: 'v',
      description: 'スケーリング方式を変更',
      priority: 100,
      handler: () => {
        this.view.cycleFit()
      }
    })
    services.shortcut.register({
      key: 'h',
      description: '見開き方式を変更',
      priority: 100,
      handler: () => {
        this.view.cycleSpread()
      }
    })
    services.shortcut.register({
      key: 'i',
      description: '情報欄のトグル',
      priority: 100,
      handler: () => {
        this.info.toggle()
      }
    })
    services.shortcut.register({
      key: 'b',
      description: 'ブックマークフォームを表示',
      handler: () => {
        this.bookmark.open()
      }
    })
    services.shortcut.register({
      key: 'q',
      description: 'クイックブックマーク',
      handler: () => {
        if (repository.isControllable) {
          const { bookmark } = repository.current!

          if (bookmark.isBookmarked === false) {
            bookmark.bookmarkIfNeeded({
              restrict: 0,
              comment: '',
              tags: ''
            })
          }
        }
      }
    })
    services.shortcut.register({
      key: 'l',
      description: 'いいね！',
      handler: () => {
        if (repository.isControllable) {
          repository.current!.likeItIfNeeded()
        }
      }
    })
    services.shortcut.register({
      key: 's',
      description: 'Twitterでシェア',
      handler: () => {
        if (repository.isControllable) {
{'fraction_non_alphanumeric': 0.13541442411194834, 'fraction_numerical': 0.006673842841765339, 'mean_word_length': 2.1713310580204777, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, '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': '7210294', 'n_tokens_mistral': 1479, 'n_tokens_neox': 1433, 'n_words': 283}