<commit_before>import 'core-js/modules/es6.array.for-each';

// here if you need pl only JS
document.addEventListener('DOMContentLoaded', () => {
  /**
   * Docs Edit README Link > Simple edit hover effect
   */
  const editLink = document.getElementsByClassName('c-bolt-docs__page-nav__link');
  const editWrap = document.getElementsByClassName('c-bolt-docs__lead');

  function toggleEditOn() {
    editWrap[0].classList.add('edit-this-readme');
  }

  function toggleEditOff() {
    editWrap[0].classList.remove('edit-this-readme');
  }

  if (editLink[0]) {
    editLink[0].addEventListener('mouseover', toggleEditOn, false);
  }

  if (editWrap[0]) {
    editLink[0].addEventListener('mouseout', toggleEditOff, false);
  }

  /**
   * Make sure all external facing links open in a new tab in PL.
   * Important as external links can behave strangely within the iframe setup of PL.
   */
  document.querySelectorAll('a').forEach((item) => {
    const href = item.getAttribute('href');
    if (href){
      if (href.startsWith('http')) {
        item.setAttribute('target', '_blank');
      }
    }
  });
});<commit_msg>fix: update Pattern Lab JS logic to work around IE 11 JS features supported<commit_after>import 'core-js/modules/es6.string.starts-with';

// here if you need pl only JS
document.addEventListener('DOMContentLoaded', () => {
  /**
   * Docs Edit README Link > Simple edit hover effect
   */
  const editLink = document.getElementsByClassName('c-bolt-docs__page-nav__link');
  const editWrap = document.getElementsByClassName('c-bolt-docs__lead');

  function toggleEditOn() {
    editWrap[0].classList.add('edit-this-readme');
  }

  function toggleEditOff() {
    editWrap[0].classList.remove('edit-this-readme');
  }

  if (editLink[0]) {
    editLink[0].addEventListener('mouseover', toggleEditOn, false);
  }

  if (editWrap[0]) {
    editLink[0].addEventListener('mouseout', toggleEditOff, false);
  }

  /**
   * Make sure all external facing links open in a new tab in PL.
   * Important as external links can behave strangely within the iframe setup of PL.
   */
  const docsSiteLinks = document.querySelectorAll('a');
  for (var i = 0, len = docsSiteLinks.length; i < len; i++) {
    const linkElem = docsSiteLinks[i];
    const href = linkElem.getAttribute('href');
    if (href) {
      if (href.startsWith('http')) {
        linkElem.setAttribute('target', '_blank');
      }
    }
  }
});
{'fraction_non_alphanumeric': 0.14279818406933553, 'fraction_numerical': 0.0070160957490713995, 'mean_word_length': 3.6885880077369437, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 8, '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': '5917225', 'n_tokens_mistral': 762, 'n_tokens_neox': 745, 'n_words': 179}