// Polyfills "new CustomEvent()" for IE11
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent

(function() {
  if (typeof window.CustomEvent === "function") {
    return false;
  }
  function CustomEvent(event, params) {
    let p = params || { bubbles: false, cancelable: false, detail: undefined };
    let evt = document.createEvent("CustomEvent");
    evt.initCustomEvent(event, p.bubbles, p.cancelable, p.detail);
    return evt;
  }

  CustomEvent.prototype = window.Event.prototype;
  window.CustomEvent = CustomEvent;
})();
