<commit_before>
<script>
  export default {
    props: ['pager', 'current-page'],
    computed: {
      pages() {
        return Math.ceil(this.pager.total / this.pager.per_page)
      },
    },
    methods: {
      navigate(page) {
        if (page !== this.currentPage) {
          this.dispatch(page)
        }
      },
      navigatePrevious() {
        if (this.currentPage > 1) {
          const page = this.currentPage - 1
          this.dispatch(page)
        }
      },
      navigateNext() {
        if (this.currentPage < this.pages) {
          const page = this.currentPage + 1
          this.dispatch(page)
        }
      },
      dispatch(page) {
        this.$bus.$emit('navigate', { page })
      },
    },
  }
</script>

<template>
  <div>
    <nav aria-label="Page navigation">
      <ul class="pagination">
        <li>
          <a href="#" aria-label="Previous" @click.prevent="navigatePrevious()">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
        <li v-for="page in pages" :class="{ active: currentPage === page }">
          <a href="#" @click.prevent="navigate(page)">{{ page }}</a>
        </li>
        <li>
          <a href="#" aria-label="Next" @click.prevent="navigateNext()">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>
  </div>
</template>
<commit_msg>Included 2 computed properties to<commit_after>
<script>
  export default {
    props: ['pager', 'current-page'],
    computed: {
      pages() {
        return Math.ceil(this.pager.total / this.pager.per_page)
      },
      isLast() {
        return this.currentPage === this.pages
      },
      isFirst() {
        return this.currentPage === 1
      },
    },
    methods: {
      navigate(page) {
        if (page !== this.currentPage) {
          this.dispatch(page)
        }
      },
      navigatePrevious() {
        if (!this.isFirst) {
          this.dispatch(this.currentPage - 1)
        }
      },
      navigateNext() {
        if (!this.isLast) {
          this.dispatch(this.currentPage + 1)
        }
      },
      dispatch(page) {
        this.$bus.$emit('navigate', { page })
      },
    },
  }
</script>

<template>
  <div>
    <nav aria-label="Page navigation">
      <ul class="pagination">
        <li :class="{ disabled: isFirst }">
          <a href="#" aria-label="Previous" @click.prevent="navigatePrevious()">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
        <li v-for="page in pages" :class="{ active: currentPage === page }">
          <a href="#" @click.prevent="navigate(page)">{{ page }}</a>
        </li>
        <li :class="{ disabled: isLast }">
          <a href="#" aria-label="Next" @click.prevent="navigateNext()">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>
      </ul>
    </nav>
  </div>
</template>

{'fraction_non_alphanumeric': 0.17931982136722777, 'fraction_numerical': 0.0024046719340432843, 'mean_word_length': 1.7919463087248322, 'pattern_counts': {'":': 0, '<': 56, '<?xml version=': 0, '>': 56, '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': '6634084', 'n_tokens_mistral': 931, 'n_tokens_neox': 917, 'n_words': 176}