2018-09-11 17:53:11 +02:00
|
|
|
// Include runtime-polyfills for older browsers.
|
2019-03-13 15:31:59 +01:00
|
|
|
// Due to babel.config.js's 'useBuiltIns', only polyfills actually
|
2018-09-11 17:53:11 +02:00
|
|
|
// required by the browsers we support will be included.
|
2020-01-30 13:40:06 +01:00
|
|
|
import 'core-js/stable';
|
2022-03-31 12:07:52 +02:00
|
|
|
import 'regenerator-runtime/runtime';
|
2018-09-11 17:53:11 +02:00
|
|
|
import 'dom4';
|
2020-01-30 13:40:06 +01:00
|
|
|
import 'intersection-observer';
|
2022-02-02 17:16:50 +01:00
|
|
|
import 'whatwg-fetch';
|
2022-04-29 14:11:00 +02:00
|
|
|
import '@webcomponents/custom-elements';
|
|
|
|
import '@webcomponents/template';
|
2022-04-28 11:14:26 +02:00
|
|
|
import '@stimulus/polyfills';
|
2022-04-29 14:11:00 +02:00
|
|
|
import 'formdata-polyfill';
|
|
|
|
import 'event-target-polyfill';
|
|
|
|
import 'yet-another-abortcontroller-polyfill';
|
2020-01-30 13:40:06 +01:00
|
|
|
|
2019-04-04 17:40:33 +02:00
|
|
|
import './polyfills/insertAdjacentElement';
|
|
|
|
import './polyfills/dataset';
|
2022-04-29 18:13:59 +02:00
|
|
|
|
2022-04-30 11:48:51 +02:00
|
|
|
// IE 11 has no baseURI (required by turbo)
|
2022-04-29 18:13:59 +02:00
|
|
|
if (document.baseURI == undefined) {
|
|
|
|
document.baseURI = document.URL;
|
|
|
|
}
|
2022-04-30 11:48:51 +02:00
|
|
|
|
|
|
|
// IE 11 has no children on DocumentFragment (required by turbo)
|
|
|
|
function polyfillChildren(proto) {
|
|
|
|
Object.defineProperty(proto, 'children', {
|
|
|
|
get: function () {
|
|
|
|
const children = [];
|
|
|
|
for (const node of this.childNodes) {
|
|
|
|
if (node.nodeType == 1) {
|
|
|
|
children.push(node);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return children;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
const fragment = document.createDocumentFragment();
|
|
|
|
if (fragment.children == undefined) {
|
|
|
|
polyfillChildren(DocumentFragment.prototype);
|
|
|
|
}
|
2022-05-11 11:46:06 +02:00
|
|
|
|
|
|
|
// IE 11 has no isConnected on Node
|
|
|
|
function polyfillIsConnected(proto) {
|
|
|
|
Object.defineProperty(proto, 'isConnected', {
|
|
|
|
get: function () {
|
|
|
|
return document.documentElement.contains(this);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!('isConnected' in Node.prototype)) {
|
|
|
|
polyfillIsConnected(Node.prototype);
|
|
|
|
}
|