<commit_before><template>
  <modal name="modal-switcher" :width="650">
    <p slot="header">
      {{ $t('Choose your country') }}
    </p>
    <div slot="content">
      <div :class="{ 'columns': enableColumns }">
        <div class="country country-current">
          <h3>{{ $t(config.i18n.fullCountryName) }}</h3>
          <ul>
            <li><a href="/">{{ $t(config.i18n.fullLanguageName) }}</a></li>
          </ul>
        </div>
        <div class="country country-available" v-for="(storeView, storeCode) in storeViews" :key="storeCode" v-if="!storeView.disabled && typeof storeView === 'object' && storeView.i18n">
          <h3>{{ $t(storeView.i18n.fullCountryName) }}</h3>
          <ul>
            <li><a :href="'/' + storeCode">{{ $t(storeView.i18n.fullLanguageName) }}</a></li>
          </ul>
        </div>
      </div>
    </div>
  </modal>
</template>
<script>
import Modal from 'theme/components/core/Modal.vue'
import config from 'config'
export default {
  components: {
    Modal
  },
  data () {
    return {
      minCountryPerColumn: 3
    }
  },
  computed: {
    storeViews () {
      return config.storeViews
    },
    config () {
      return config
    },
    enableColumns () {
      var totalEnableStoreViews = 0
      // @todo return count of total storeview which disabled attribute is false
      return totalEnableStoreViews > this.minCountryPerColumn
    }
  },
  methods: {
    close () {
      this.$bus.$emit('modal-hide', 'modal-switcher')
    }
  }
}
</script>
<style lang="scss" scoped>
  h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
  }
  .columns {
    -moz-column-count: 2;
    column-count: 2;
    column-gap: 15px;
    .country {
      -webkit-column-break-inside: avoid;
      page-break-inside: avoid;
      break-inside: avoid;
    }
  }
  .country {
    margin-bottom: 2em;
    color: #4f4f4f;
  }
  ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    margin-left: -1em;
    li {
      display: inline-block;
      margin-left: 1em;
      a {
        font-size: 0.9em;
      }
    }
  }
</style>
<commit_msg>ref. #881 #1135 add function returning number of storeview enabled<commit_after><template>
  <modal name="modal-switcher" :width="650">
    <p slot="header">
      {{ $t('Choose your country') }}
    </p>
    <div slot="content">
      <div :class="{ 'columns': enableColumns }">
        <div class="country country-current">
          <h3>{{ $t(config.i18n.fullCountryName) }}</h3>
          <ul>
            <li><a href="/">{{ $t(config.i18n.fullLanguageName) }}</a></li>
          </ul>
        </div>
        <div class="country country-available" v-for="(storeView, storeCode) in storeViews" :key="storeCode" v-if="!storeView.disabled && typeof storeView === 'object' && storeView.i18n">
          <h3>{{ $t(storeView.i18n.fullCountryName) }}</h3>
          <ul>
            <li><a :href="'/' + storeCode">{{ $t(storeView.i18n.fullLanguageName) }}</a></li>
          </ul>
        </div>
      </div>
    </div>
  </modal>
</template>
<script>
import Modal from 'theme/components/core/Modal.vue'
import config from 'config'
export default {
  components: {
    Modal
  },
  data () {
    return {
      minCountryPerColumn: 3
    }
  },
  computed: {
    storeViews () {
      return config.storeViews
    },
    config () {
      return config
    },
    enableColumns () {
      var enableStoreViews = Object.keys(config.storeViews).filter(function (key) {
        var value = config.storeViews[key]
        return (typeof value === 'object' && value.disabled === false)
      })
      return enableStoreViews.length > this.minCountryPerColumn
    }
  },
  methods: {
    close () {
      this.$bus.$emit('modal-hide', 'modal-switcher')
    }
  }
}
</script>
<style lang="scss" scoped>
  h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
  }
  .columns {
    -moz-column-count: 2;
    column-count: 2;
    column-gap: 15px;
    .country {
      -webkit-column-break-inside: avoid;
      page-break-inside: avoid;
      break-inside: avoid;
    }
  }
  .country {
    margin-bottom: 2em;
    color: #4f4f4f;
  }
  ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
    margin-left: -1em;
    li {
      display: inline-block;
      margin-left: 1em;
      a {
        font-size: 0.9em;
      }
    }
  }
</style>

{'fraction_non_alphanumeric': 0.1684039842483206, 'fraction_numerical': 0.018531387537641882, 'mean_word_length': 2.219985085756898, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 73, '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': '4440821', 'n_tokens_mistral': 1550, 'n_tokens_neox': 1490, 'n_words': 306}