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');
      }
    }
  });
});

@@ -25,21 +25,25 @@
 es6.
-array.for-eac
+string.starts-wit
 h';%0A
@@ -875,16 +875,38 @@
 %0A   */%0A 
+ const docsSiteLinks =
  documen
@@ -932,28 +932,110 @@
 'a')
-.forEach((it
+;%0A  for (var i = 0, len = docsSiteLinks.length; i %3C len; i++) %7B%0A    const linkEl
 em
-)
  =
-%3E %7B
+ docsSiteLinks%5Bi%5D;
 %0A   
@@ -1048,18 +1048,22 @@
  href = 
-it
+linkEl
 em.getAt
@@ -1092,16 +1092,17 @@
 f (href)
+ 
 %7B%0A      
@@ -1140,18 +1140,22 @@
         
-it
+linkEl
 em.setAt
@@ -1200,15 +1200,13 @@
    %7D%0A  %7D
-);
 %0A%7D);%0A

update Pattern Lab JS logic to work around IE 11 JS features supported