diff --git a/config/rollup/pipeline.build.js b/config/rollup/pipeline.build.js
index 6182ffe..cce7414 100644
--- a/config/rollup/pipeline.build.js
+++ b/config/rollup/pipeline.build.js
@@ -59,32 +59,6 @@ module.exports = (esm, options, { declarationFiles = false, outputStyle = false
format: esm ? 'esm' : 'umd',
generatedCode: esm ? 'es2015' : 'es5',
file: path.resolve(distPath, `${file}${esm ? '.esm' : ''}.js`),
- plugins: [
- rollupTerser({
- ecma: esm ? 2015 : 5,
- safari10: true,
-
- mangle: {
- safari10: true,
- keep_fnames: true, // eslint-disable-line camelcase
- /*
- properties: {
- regex: /^_/,
- },
- */
- },
- compress: {
- defaults: false,
- hoist_funs: true, // eslint-disable-line camelcase
- },
- format: {
- beautify: true,
- max_line_len: 80, // eslint-disable-line camelcase
- braces: true,
- indent_level: 2, // eslint-disable-line camelcase
- },
- }),
- ],
},
esm,
buildMinifiedVersion
diff --git a/packages/overlayscrollbars/dist/overlayscrollbars.esm.js b/packages/overlayscrollbars/dist/overlayscrollbars.esm.js
index f5a91a1..efd48da 100644
--- a/packages/overlayscrollbars/dist/overlayscrollbars.esm.js
+++ b/packages/overlayscrollbars/dist/overlayscrollbars.esm.js
@@ -1,260 +1,236 @@
-function createCache(t, n) {
- const {o: e, u: s, _: o} = t;
- let c = e;
- let i;
- const cacheUpdateContextual = (t, n) => {
- const e = c;
- const r = t;
- const a = n || (s ? !s(e, r) : e !== r);
- if (a || o) {
- c = r;
- i = e;
- }
- return [ c, a, i ];
- };
- const cacheUpdateIsolated = t => cacheUpdateContextual(n(c, i), t);
- const getCurrentCache = t => [ c, !!t, i ];
- return [ n ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache ];
-}
-
-function isUndefined(t) {
- return void 0 === t;
-}
-
-function isNull(t) {
- return null === t;
-}
-
-function isNumber(t) {
- return "number" === typeof t;
-}
-
-function isString(t) {
- return "string" === typeof t;
-}
-
-function isBoolean(t) {
- return "boolean" === typeof t;
-}
-
-function isFunction(t) {
- return "function" === typeof t;
-}
-
-function isArray(t) {
- return Array.isArray(t);
-}
-
-function isObject(t) {
- return "object" === typeof t && !isArray(t) && !isNull(t);
-}
-
-function isArrayLike(t) {
- const n = !!t && t.length;
- const e = isNumber(n) && n > -1 && n % 1 == 0;
- return isArray(t) || !isFunction(t) && e ? n > 0 && isObject(t) ? n - 1 in t : true : false;
-}
-
-function isPlainObject(t) {
- if (!t || !isObject(t) || "object" !== type(t)) {
- return false;
- }
- let n;
- const s = "constructor";
- const o = t[s];
- const c = o && o.prototype;
- const i = e.call(t, s);
- const r = c && e.call(c, "isPrototypeOf");
- if (o && !i && !r) {
- return false;
- }
- for (n in t) {}
- return isUndefined(n) || e.call(t, n);
-}
-
-function isHTMLElement(n) {
- const e = window.HTMLElement;
- return n ? e ? n instanceof e : n.nodeType === t : false;
-}
-
-function isElement(n) {
- const e = window.Element;
- return n ? e ? n instanceof e : n.nodeType === t : false;
-}
-
function each(t, n) {
if (isArrayLike(t)) {
- for (let e = 0; e < t.length; e++) {
- if (false === n(t[e], e, t)) {
+ for (let o = 0; o < t.length; o++) {
+ if (false === n(t[o], o, t)) {
break;
}
}
} else if (t) {
- each(Object.keys(t), (e => n(t[e], e, t)));
+ each(Object.keys(t), (o => n(t[o], o, t)));
}
return t;
}
-function assignDeep(t, n, e, s, o, c, i) {
- const r = [ n, e, s, o, c, i ];
- if (("object" !== typeof t || isNull(t)) && !isFunction(t)) {
- t = {};
- }
- each(r, (n => {
- each(keys(n), (e => {
- const s = n[e];
- if (t === s) {
- return true;
- }
- const o = isArray(s);
- if (s && (isPlainObject(s) || o)) {
- const n = t[e];
- let c = n;
- if (o && !isArray(n)) {
- c = [];
- } else if (!o && !isPlainObject(n)) {
- c = {};
- }
- t[e] = assignDeep(c, s);
- } else {
- t[e] = s;
- }
- }));
- }));
- return t;
-}
-
-function isEmptyObject(t) {
- for (const n in t) {
- return false;
- }
- return true;
-}
-
-function getSetProp(t, n, e, s) {
- if (isUndefined(s)) {
- return e ? e[t] : n;
- }
- e && (e[t] = s);
-}
-
-function attr(t, n, e) {
- if (isUndefined(e)) {
- return t ? t.getAttribute(n) : null;
- }
- t && t.setAttribute(n, e);
-}
-
-function scrollLeft(t, n) {
- return getSetProp("scrollLeft", 0, t, n);
-}
-
-function scrollTop(t, n) {
- return getSetProp("scrollTop", 0, t, n);
-}
-
function style(t, n) {
- const e = isString(n);
- const s = isArray(n) || e;
+ const o = isString(n);
+ const s = isArray(n) || o;
if (s) {
- let s = e ? "" : {};
+ let s = o ? "" : {};
if (t) {
- const o = window.getComputedStyle(t, null);
- s = e ? getCSSVal(t, o, n) : n.reduce(((n, e) => {
- n[e] = getCSSVal(t, o, e);
+ const e = window.getComputedStyle(t, null);
+ s = o ? getCSSVal(t, e, n) : n.reduce(((n, o) => {
+ n[o] = getCSSVal(t, e, o);
return n;
}), s);
}
return s;
}
- each(keys(n), (e => setCSSVal(t, e, n[e])));
+ each(keys(n), (o => setCSSVal(t, o, n[o])));
}
function getDefaultExportFromCjs(t) {
- return t && t.g && Object.prototype.hasOwnProperty.call(t, "default") ? t["default"] : t;
+ return t && t.o && Object.prototype.hasOwnProperty.call(t, "default") ? t["default"] : t;
}
+const createCache = (t, n) => {
+ const {u: o, _: s, g: e} = t;
+ let c = o;
+ let i;
+ const cacheUpdateContextual = (t, n) => {
+ const o = c;
+ const r = t;
+ const l = n || (s ? !s(o, r) : o !== r);
+ if (l || e) {
+ c = r;
+ i = o;
+ }
+ return [ c, l, i ];
+ };
+ const cacheUpdateIsolated = t => cacheUpdateContextual(n(c, i), t);
+ const getCurrentCache = t => [ c, !!t, i ];
+ return [ n ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache ];
+};
+
const t = Node.ELEMENT_NODE;
-const {toString: n, hasOwnProperty: e} = Object.prototype;
+const {toString: n, hasOwnProperty: o} = Object.prototype;
+
+const isUndefined = t => void 0 === t;
+
+const isNull = t => null === t;
const type = t => isUndefined(t) || isNull(t) ? `${t}` : n.call(t).replace(/^\[object (.+)\]$/, "$1").toLowerCase();
-const indexOf = (t, n, e) => t.indexOf(n, e);
+const isNumber = t => "number" === typeof t;
-const push = (t, n, e) => {
- !e && !isString(n) && isArrayLike(n) ? Array.prototype.push.apply(t, n) : t.push(n);
+const isString = t => "string" === typeof t;
+
+const isBoolean = t => "boolean" === typeof t;
+
+const isFunction = t => "function" === typeof t;
+
+const isArray = t => Array.isArray(t);
+
+const isObject = t => "object" === typeof t && !isArray(t) && !isNull(t);
+
+const isArrayLike = t => {
+ const n = !!t && t.length;
+ const o = isNumber(n) && n > -1 && n % 1 == 0;
+ return isArray(t) || !isFunction(t) && o ? n > 0 && isObject(t) ? n - 1 in t : true : false;
+};
+
+const isPlainObject = t => {
+ if (!t || !isObject(t) || "object" !== type(t)) {
+ return false;
+ }
+ let n;
+ const s = "constructor";
+ const e = t[s];
+ const c = e && e.prototype;
+ const i = o.call(t, s);
+ const r = c && o.call(c, "isPrototypeOf");
+ if (e && !i && !r) {
+ return false;
+ }
+ for (n in t) {}
+ return isUndefined(n) || o.call(t, n);
+};
+
+const isHTMLElement = n => {
+ const o = window.HTMLElement;
+ return n ? o ? n instanceof o : n.nodeType === t : false;
+};
+
+const isElement = n => {
+ const o = window.Element;
+ return n ? o ? n instanceof o : n.nodeType === t : false;
+};
+
+const indexOf = (t, n, o) => t.indexOf(n, o);
+
+const push = (t, n, o) => {
+ !o && !isString(n) && isArrayLike(n) ? Array.prototype.push.apply(t, n) : t.push(n);
return t;
};
const from = t => {
- if (Array.from && t) {
- return Array.from(t);
+ const n = Array.from;
+ const o = [];
+ if (n && t) {
+ return n(t);
}
- const n = [];
if (t instanceof Set) {
t.forEach((t => {
- push(n, t);
+ push(o, t);
}));
} else {
each(t, (t => {
- push(n, t);
+ push(o, t);
}));
}
- return n;
+ return o;
};
const isEmptyArray = t => !!t && 0 === t.length;
-const runEachAndClear = (t, n, e) => {
+const runEachAndClear = (t, n, o) => {
const runFn = t => t && t.apply(void 0, n || []);
- if (t instanceof Set) {
- t.forEach(runFn);
- !e && t.clear();
- } else {
- each(t, runFn);
- !e && t.splice && t.splice(0, t.length);
- }
+ each(t, runFn);
+ !o && (t.length = 0);
};
const hasOwnProperty = (t, n) => Object.prototype.hasOwnProperty.call(t, n);
const keys = t => t ? Object.keys(t) : [];
-const attrClass = (t, n, e, s) => {
- const o = attr(t, n) || "";
- const c = new Set(o.split(" "));
- c[s ? "add" : "delete"](e);
+const assignDeep = (t, n, o, s, e, c, i) => {
+ const r = [ n, o, s, e, c, i ];
+ if (("object" !== typeof t || isNull(t)) && !isFunction(t)) {
+ t = {};
+ }
+ each(r, (n => {
+ each(keys(n), (o => {
+ const s = n[o];
+ if (t === s) {
+ return true;
+ }
+ const e = isArray(s);
+ if (s && (isPlainObject(s) || e)) {
+ const n = t[o];
+ let c = n;
+ if (e && !isArray(n)) {
+ c = [];
+ } else if (!e && !isPlainObject(n)) {
+ c = {};
+ }
+ t[o] = assignDeep(c, s);
+ } else {
+ t[o] = s;
+ }
+ }));
+ }));
+ return t;
+};
+
+const isEmptyObject = t => {
+ for (const n in t) {
+ return false;
+ }
+ return true;
+};
+
+const getSetProp = (t, n, o, s) => {
+ if (isUndefined(s)) {
+ return o ? o[t] : n;
+ }
+ o && (o[t] = s);
+};
+
+const attr = (t, n, o) => {
+ if (isUndefined(o)) {
+ return t ? t.getAttribute(n) : null;
+ }
+ t && t.setAttribute(n, o);
+};
+
+const attrClass = (t, n, o, s) => {
+ const e = attr(t, n) || "";
+ const c = new Set(e.split(" "));
+ c[s ? "add" : "delete"](o);
attr(t, n, from(c).join(" ").trim());
};
-const hasAttrClass = (t, n, e) => {
+const hasAttrClass = (t, n, o) => {
const s = attr(t, n) || "";
- const o = new Set(s.split(" "));
- return o.has(e);
+ const e = new Set(s.split(" "));
+ return e.has(o);
};
const removeAttr = (t, n) => {
t && t.removeAttribute(n);
};
+const scrollLeft = (t, n) => getSetProp("scrollLeft", 0, t, n);
+
+const scrollTop = (t, n) => getSetProp("scrollTop", 0, t, n);
+
const s = Element.prototype;
const find = (t, n) => {
- const e = [];
+ const o = [];
const s = n ? isElement(n) ? n : null : document;
- return s ? push(e, s.querySelectorAll(t)) : e;
+ return s ? push(o, s.querySelectorAll(t)) : o;
};
const findFirst = (t, n) => {
- const e = n ? isElement(n) ? n : null : document;
- return e ? e.querySelector(t) : null;
+ const o = n ? isElement(n) ? n : null : document;
+ return o ? o.querySelector(t) : null;
};
const is = (t, n) => {
if (isElement(t)) {
- const e = s.matches || s.msMatchesSelector;
- return e.call(t, n);
+ const o = s.matches || s.msMatchesSelector;
+ return o.call(t, n);
}
return false;
};
@@ -265,9 +241,9 @@ const parent = t => t ? t.parentElement : null;
const closest = (t, n) => {
if (isElement(t)) {
- const e = s.closest;
- if (e) {
- return e.call(t, n);
+ const o = s.closest;
+ if (o) {
+ return o.call(t, n);
}
do {
if (is(t, n)) {
@@ -279,27 +255,27 @@ const closest = (t, n) => {
return null;
};
-const liesBetween = (t, n, e) => {
+const liesBetween = (t, n, o) => {
const s = t && closest(t, n);
- const o = t && findFirst(e, s);
- return s && o ? s === t || o === t || closest(closest(t, e), n) !== s : false;
+ const e = t && findFirst(o, s);
+ return s && e ? s === t || e === t || closest(closest(t, o), n) !== s : false;
};
-const before = (t, n, e) => {
- if (e) {
+const before = (t, n, o) => {
+ if (o) {
let s = n;
- let o;
+ let e;
if (t) {
- if (isArrayLike(e)) {
- o = document.createDocumentFragment();
- each(e, (t => {
+ if (isArrayLike(o)) {
+ e = document.createDocumentFragment();
+ each(o, (t => {
if (t === s) {
s = t.previousSibling;
}
- o.appendChild(t);
+ e.appendChild(t);
}));
} else {
- o = e;
+ e = o;
}
if (n) {
if (!s) {
@@ -308,7 +284,7 @@ const before = (t, n, e) => {
s = s.nextSibling;
}
}
- t.insertBefore(o, s || null);
+ t.insertBefore(e, s || null);
}
}
};
@@ -358,7 +334,7 @@ const firstLetterToUpper = t => t.charAt(0).toUpperCase() + t.slice(1);
const getDummyStyle = () => createDiv().style;
-const o = [ "-webkit-", "-moz-", "-o-", "-ms-" ];
+const e = [ "-webkit-", "-moz-", "-o-", "-ms-" ];
const c = [ "WebKit", "Moz", "O", "MS", "webkit", "moz", "o", "ms" ];
@@ -371,11 +347,11 @@ const cssProperty = t => {
if (hasOwnProperty(r, t)) {
return n;
}
- const e = firstLetterToUpper(t);
+ const o = firstLetterToUpper(t);
const s = getDummyStyle();
- each(o, (o => {
- const c = o.replace(/-/g, "");
- const i = [ t, o + t, c + e, firstLetterToUpper(c) + e ];
+ each(e, (e => {
+ const c = e.replace(/-/g, "");
+ const i = [ t, e + t, c + o, firstLetterToUpper(c) + o ];
return !(n = i.find((t => void 0 !== s[t])));
}));
return r[t] = n || "";
@@ -386,35 +362,35 @@ const jsAPI = t => {
if (hasOwnProperty(i, t)) {
return n;
}
- each(c, (e => {
- n = n || window[e + firstLetterToUpper(t)];
+ each(c, (o => {
+ n = n || window[o + firstLetterToUpper(t)];
return !n;
}));
i[t] = n;
return n;
};
-const a = jsAPI("MutationObserver");
+const l = jsAPI("MutationObserver");
-const l = jsAPI("IntersectionObserver");
+const a = jsAPI("IntersectionObserver");
-const u = jsAPI("ResizeObserver");
+const f = jsAPI("ResizeObserver");
-const f = jsAPI("cancelAnimationFrame");
+const u = jsAPI("cancelAnimationFrame");
const d = jsAPI("requestAnimationFrame");
const _ = /[^\x20\t\r\n\f]+/g;
-const classListAction = (t, n, e) => {
+const classListAction = (t, n, o) => {
let s;
- let o = 0;
+ let e = 0;
let c = false;
if (t && n && isString(n)) {
const i = n.match(_) || [];
c = i.length > 0;
- while (s = i[o++]) {
- c = !!e(t.classList, s) && c;
+ while (s = i[e++]) {
+ c = !!o(t.classList, s) && c;
}
}
return c;
@@ -431,17 +407,17 @@ const addClass = (t, n) => {
return removeClass.bind(0, t, n);
};
-const equal = (t, n, e, s) => {
+const equal = (t, n, o, s) => {
if (t && n) {
- let o = true;
- each(e, (e => {
- const c = s ? s(t[e]) : t[e];
- const i = s ? s(n[e]) : n[e];
+ let e = true;
+ each(o, (o => {
+ const c = s ? s(t[o]) : t[o];
+ const i = s ? s(n[o]) : n[o];
if (c !== i) {
- o = false;
+ e = false;
}
}));
- return o;
+ return e;
}
return false;
};
@@ -452,57 +428,57 @@ const equalXY = (t, n) => equal(t, n, [ "x", "y" ]);
const equalTRBL = (t, n) => equal(t, n, [ "t", "r", "b", "l" ]);
-const equalBCRWH = (t, n, e) => equal(t, n, [ "width", "height" ], e && (t => Math.round(t)));
+const equalBCRWH = (t, n, o) => equal(t, n, [ "width", "height" ], o && (t => Math.round(t)));
const clearTimeouts = t => {
t && window.clearTimeout(t);
- t && f(t);
+ t && u(t);
};
const noop = () => {};
const debounce = (t, n) => {
- let e;
- let s;
let o;
+ let s;
+ let e;
let c;
- const {p: i, v: r, m: a} = n || {};
- const l = window.setTimeout;
- const u = function invokeFunctionToDebounce(n) {
- clearTimeouts(e);
+ const {v: i, p: r, m: l} = n || {};
+ const a = window.setTimeout;
+ const f = function invokeFunctionToDebounce(n) {
+ clearTimeouts(o);
clearTimeouts(s);
- s = e = o = void 0;
+ s = o = e = void 0;
t.apply(this, n);
};
- const mergeParms = t => a && o ? a(o, t) : t;
+ const mergeParms = t => l && e ? l(e, t) : t;
const flush = () => {
- if (e) {
- u(mergeParms(c) || c);
+ if (o) {
+ f(mergeParms(c) || c);
}
};
- const f = function debouncedFn() {
+ const u = function debouncedFn() {
const t = from(arguments);
const n = isFunction(i) ? i() : i;
- const a = isNumber(n) && n >= 0;
- if (a) {
+ const l = isNumber(n) && n >= 0;
+ if (l) {
const i = isFunction(r) ? r() : r;
- const a = isNumber(i) && i >= 0;
- const f = n > 0 ? l : d;
+ const l = isNumber(i) && i >= 0;
+ const u = n > 0 ? a : d;
const _ = mergeParms(t);
const g = _ || t;
- const h = u.bind(0, g);
- clearTimeouts(e);
- e = f(h, n);
- if (a && !s) {
- s = l(flush, i);
+ const h = f.bind(0, g);
+ clearTimeouts(o);
+ o = u(h, n);
+ if (l && !s) {
+ s = a(flush, i);
}
- o = c = g;
+ e = c = g;
} else {
- u(t);
+ f(t);
}
};
- f.S = flush;
- return f;
+ u.S = flush;
+ return u;
};
const g = {
@@ -511,40 +487,40 @@ const g = {
};
const parseToZeroOrNumber = (t, n) => {
- const e = n ? parseFloat(t) : parseInt(t, 10);
- return Number.isNaN(e) ? 0 : e;
+ const o = n ? parseFloat(t) : parseInt(t, 10);
+ return o === o ? o : 0;
};
const adaptCSSVal = (t, n) => !g[t.toLowerCase()] && isNumber(n) ? `${n}px` : n;
-const getCSSVal = (t, n, e) => null != n ? n[e] || n.getPropertyValue(e) : t.style[e];
+const getCSSVal = (t, n, o) => null != n ? n[o] || n.getPropertyValue(o) : t.style[o];
-const setCSSVal = (t, n, e) => {
+const setCSSVal = (t, n, o) => {
try {
if (t) {
const {style: s} = t;
if (!isUndefined(s[n])) {
- s[n] = adaptCSSVal(n, e);
+ s[n] = adaptCSSVal(n, o);
} else {
- s.setProperty(n, e);
+ s.setProperty(n, o);
}
}
} catch (s) {}
};
-const topRightBottomLeft = (t, n, e) => {
+const topRightBottomLeft = (t, n, o) => {
const s = n ? `${n}-` : "";
- const o = e ? `-${e}` : "";
- const c = `${s}top${o}`;
- const i = `${s}right${o}`;
- const r = `${s}bottom${o}`;
- const a = `${s}left${o}`;
- const l = style(t, [ c, i, r, a ]);
+ const e = o ? `-${o}` : "";
+ const c = `${s}top${e}`;
+ const i = `${s}right${e}`;
+ const r = `${s}bottom${e}`;
+ const l = `${s}left${e}`;
+ const a = style(t, [ c, i, r, l ]);
return {
- t: parseToZeroOrNumber(l[c]),
- r: parseToZeroOrNumber(l[i]),
- b: parseToZeroOrNumber(l[r]),
- l: parseToZeroOrNumber(l[a])
+ t: parseToZeroOrNumber(a[c]),
+ r: parseToZeroOrNumber(a[i]),
+ b: parseToZeroOrNumber(a[r]),
+ l: parseToZeroOrNumber(a[l])
};
};
@@ -575,58 +551,58 @@ const scrollSize = t => t ? {
const fractionalSize = t => {
const n = parseFloat(style(t, "height")) || 0;
- const e = parseFloat(style(t, "height")) || 0;
+ const o = parseFloat(style(t, "height")) || 0;
return {
- w: e - Math.round(e),
+ w: o - Math.round(o),
h: n - Math.round(n)
};
};
const getBoundingClientRect = t => t.getBoundingClientRect();
-let p;
+let v;
const supportPassiveEvents = () => {
- if (isUndefined(p)) {
- p = false;
+ if (isUndefined(v)) {
+ v = false;
try {
window.addEventListener("test", null, Object.defineProperty({}, "passive", {
- get: function() {
- p = true;
+ get() {
+ v = true;
}
}));
} catch (t) {}
}
- return p;
+ return v;
};
const splitEventNames = t => t.split(" ");
-const off = (t, n, e, s) => {
+const off = (t, n, o, s) => {
each(splitEventNames(n), (n => {
- t.removeEventListener(n, e, s);
+ t.removeEventListener(n, o, s);
}));
};
-const on = (t, n, e, s) => {
- const o = supportPassiveEvents();
- const c = o && s && s.C || false;
- const i = s && s.O || false;
- const r = s && s.$ || false;
- const a = [];
- const l = o ? {
+const on = (t, n, o, s) => {
+ const e = supportPassiveEvents();
+ const c = e && s && s.C || false;
+ const i = s && s.$ || false;
+ const r = s && s.O || false;
+ const l = [];
+ const a = e ? {
passive: c,
capture: i
} : i;
each(splitEventNames(n), (n => {
- const s = r ? o => {
+ const s = r ? e => {
t.removeEventListener(n, s, i);
- e && e(o);
- } : e;
- push(a, off.bind(null, t, n, s, i));
- t.addEventListener(n, s, l);
+ o && o(e);
+ } : o;
+ push(l, off.bind(null, t, n, s, i));
+ t.addEventListener(n, s, a);
}));
- return runEachAndClear.bind(0, a);
+ return runEachAndClear.bind(0, l);
};
const stopPropagation = t => t.stopPropagation();
@@ -635,7 +611,7 @@ const preventDefault = t => t.preventDefault();
const stopAndPrevent = t => stopPropagation(t) || preventDefault(t);
-const v = {
+const w = {
x: 0,
y: 0
};
@@ -645,7 +621,7 @@ const absoluteCoordinates = t => {
return n ? {
x: n.left + window.pageYOffset,
y: n.top + window.pageXOffset
- } : v;
+ } : w;
};
const manageListener = (t, n) => {
@@ -653,42 +629,42 @@ const manageListener = (t, n) => {
};
const createEventListenerHub = t => {
- function removeEvent(t, e) {
+ const n = new Map;
+ const removeEvent = (t, o) => {
if (t) {
const s = n.get(t);
manageListener((t => {
if (s) {
s[t ? "delete" : "clear"](t);
}
- }), e);
+ }), o);
} else {
n.forEach((t => {
t.clear();
}));
n.clear();
}
- }
- function addEvent(t, e) {
+ };
+ const addEvent = (t, o) => {
const s = n.get(t) || new Set;
n.set(t, s);
manageListener((t => {
t && s.add(t);
- }), e);
- return removeEvent.bind(0, t, e);
- }
- function triggerEvent(t, e) {
+ }), o);
+ return removeEvent.bind(0, t, o);
+ };
+ const triggerEvent = (t, o) => {
const s = n.get(t);
each(from(s), (t => {
- if (e && !isEmptyArray(e)) {
- t.apply(0, e);
+ if (o && !isEmptyArray(o)) {
+ t.apply(0, o);
} else {
t();
}
}));
- }
- const n = new Map;
- const e = keys(t);
- each(e, (n => {
+ };
+ const o = keys(t);
+ each(o, (n => {
addEvent(n, t[n]);
}));
return [ addEvent, removeEvent, triggerEvent ];
@@ -696,7 +672,7 @@ const createEventListenerHub = t => {
const getPropByPath = (t, n) => t ? n.split(".").reduce(((t, n) => t && hasOwnProperty(t, n) ? t[n] : void 0), t) : void 0;
-const createOptionCheck = (t, n, e) => s => [ getPropByPath(t, s), e || void 0 !== getPropByPath(n, s) ];
+const createOptionCheck = (t, n, o) => s => [ getPropByPath(t, s), o || void 0 !== getPropByPath(n, s) ];
const createState = t => {
let n = t;
@@ -705,11 +681,11 @@ const createState = t => {
} ];
};
-const b = "os-environment";
+const p = "os-environment";
-const w = `${b}-flexbox-glue`;
+const b = `${p}-flexbox-glue`;
-const y = `${w}-max`;
+const y = `${b}-max`;
const m = "data-overlayscrollbars";
@@ -719,43 +695,43 @@ const x = `${m}-overflow-y`;
const C = "overflowVisible";
-const O = "viewportStyled";
+const $ = "viewportStyled";
-const $ = "os-padding";
+const O = "os-padding";
-const A = "os-viewport";
+const z = "os-viewport";
-const L = `${A}-arrange`;
+const A = `${z}-arrange`;
-const T = "os-content";
+const I = "os-content";
-const z = `${A}-scrollbar-styled`;
+const T = `${z}-scrollbar-styled`;
-const D = `os-overflow-visible`;
+const P = `os-overflow-visible`;
-const E = "os-size-observer";
+const L = "os-size-observer";
-const P = `${E}-appear`;
+const M = `${L}-appear`;
-const I = `${E}-listener`;
+const H = `${L}-listener`;
-const j = `${I}-scroll`;
+const E = `${H}-scroll`;
-const M = `${I}-item`;
+const R = `${H}-item`;
-const H = `${M}-final`;
+const D = `${R}-final`;
-const N = "os-trinsic-observer";
+const j = "os-trinsic-observer";
-const R = "os-scrollbar";
+const V = "os-scrollbar";
-const F = `${R}-horizontal`;
+const B = `${V}-horizontal`;
-const V = `${R}-vertical`;
+const k = `${V}-vertical`;
-const k = "os-scrollbar-track";
+const F = "os-scrollbar-track";
-const B = "os-scrollbar-handle";
+const Y = "os-scrollbar-handle";
const opsStringify = t => JSON.stringify(t, ((t, n) => {
if (isFunction(n)) {
@@ -764,7 +740,7 @@ const opsStringify = t => JSON.stringify(t, ((t, n) => {
return n;
}));
-const U = {
+const q = {
paddingAbsolute: false,
updating: {
elementEvents: [ [ "img", "load" ] ],
@@ -791,91 +767,91 @@ const U = {
};
const getOptionsDiff = (t, n) => {
- const e = {};
+ const o = {};
const s = keys(n).concat(keys(t));
each(s, (s => {
- const o = t[s];
+ const e = t[s];
const c = n[s];
- if (isObject(o) && isObject(c)) {
- assignDeep(e[s] = {}, getOptionsDiff(o, c));
- } else if (hasOwnProperty(n, s) && c !== o) {
+ if (isObject(e) && isObject(c)) {
+ assignDeep(o[s] = {}, getOptionsDiff(e, c));
+ } else if (hasOwnProperty(n, s) && c !== e) {
let t = true;
- if (isArray(o) || isArray(c)) {
+ if (isArray(e) || isArray(c)) {
try {
- if (opsStringify(o) === opsStringify(c)) {
+ if (opsStringify(e) === opsStringify(c)) {
t = false;
}
} catch (i) {}
}
if (t) {
- e[s] = c;
+ o[s] = c;
}
}
}));
- return e;
+ return o;
};
-let Y;
+let G;
-const {abs: q, round: G} = Math;
+const {abs: N, round: U} = Math;
const diffBiggerThanOne = (t, n) => {
- const e = q(t);
- const s = q(n);
- return !(e === s || e + 1 === s || e - 1 === s);
+ const o = N(t);
+ const s = N(n);
+ return !(o === s || o + 1 === s || o - 1 === s);
};
-const getNativeScrollbarSize = (t, n, e) => {
+const getNativeScrollbarSize = (t, n, o) => {
appendChildren(t, n);
const s = clientSize(n);
- const o = offsetSize(n);
- const c = fractionalSize(e);
+ const e = offsetSize(n);
+ const c = fractionalSize(o);
return {
- x: o.h - s.h + c.h,
- y: o.w - s.w + c.w
+ x: e.h - s.h + c.h,
+ y: e.w - s.w + c.w
};
};
const getNativeScrollbarsHiding = t => {
let n = false;
- const e = addClass(t, z);
+ const o = addClass(t, T);
try {
n = "none" === style(t, cssProperty("scrollbar-width")) || "none" === window.getComputedStyle(t, "::-webkit-scrollbar").getPropertyValue("display");
} catch (s) {}
- e();
+ o();
return n;
};
const getRtlScrollBehavior = (t, n) => {
- const e = "hidden";
+ const o = "hidden";
style(t, {
- overflowX: e,
- overflowY: e,
+ overflowX: o,
+ overflowY: o,
direction: "rtl"
});
scrollLeft(t, 0);
const s = absoluteCoordinates(t);
- const o = absoluteCoordinates(n);
+ const e = absoluteCoordinates(n);
scrollLeft(t, -999);
const c = absoluteCoordinates(n);
return {
- i: s.x === o.x,
- n: o.x !== c.x
+ i: s.x === e.x,
+ n: e.x !== c.x
};
};
const getFlexboxGlue = (t, n) => {
- const e = addClass(t, w);
+ const o = addClass(t, b);
const s = getBoundingClientRect(t);
- const o = getBoundingClientRect(n);
- const c = equalBCRWH(o, s, true);
+ const e = getBoundingClientRect(n);
+ const c = equalBCRWH(e, s, true);
const i = addClass(t, y);
const r = getBoundingClientRect(t);
- const a = getBoundingClientRect(n);
- const l = equalBCRWH(a, r, true);
- e();
+ const l = getBoundingClientRect(n);
+ const a = equalBCRWH(l, r, true);
+ o();
i();
- return c && l;
+ return c && a;
};
const getWindowDPR = () => {
@@ -886,91 +862,91 @@ const getWindowDPR = () => {
const createEnvironment = () => {
const {body: t} = document;
- const n = createDOM(`
`);
- const e = n[0];
- const s = e.firstChild;
- const [o, , c] = createEventListenerHub();
+ const n = createDOM(``);
+ const o = n[0];
+ const s = o.firstChild;
+ const [e, , c] = createEventListenerHub();
const [i, r] = createCache({
- o: getNativeScrollbarSize(t, e, s),
- u: equalXY
+ u: getNativeScrollbarSize(t, o, s),
+ _: equalXY
});
- const [a] = r();
- const l = getNativeScrollbarsHiding(e);
- const u = {
- x: 0 === a.x,
- y: 0 === a.y
- };
+ const [l] = r();
+ const a = getNativeScrollbarsHiding(o);
const f = {
- A: !l,
- L: false
+ x: 0 === l.x,
+ y: 0 === l.y
};
- const d = assignDeep({}, U);
+ const u = {
+ A: !a,
+ I: false
+ };
+ const d = assignDeep({}, q);
const _ = {
- T: a,
- D: u,
- P: l,
- I: "-1" === style(e, "zIndex"),
- j: getRtlScrollBehavior(e, s),
- M: getFlexboxGlue(e, s),
- H: t => o("_", t),
- N: assignDeep.bind(0, {}, f),
- R(t) {
- assignDeep(f, t);
- },
- F: assignDeep.bind(0, {}, d),
+ T: l,
+ P: f,
+ L: a,
+ M: "-1" === style(o, "zIndex"),
+ H: getRtlScrollBehavior(o, s),
+ R: getFlexboxGlue(o, s),
+ D: t => e("_", t),
+ j: assignDeep.bind(0, {}, u),
V(t) {
+ assignDeep(u, t);
+ },
+ B: assignDeep.bind(0, {}, d),
+ k(t) {
assignDeep(d, t);
},
- k: assignDeep({}, f),
- B: assignDeep({}, d)
+ F: assignDeep({}, u),
+ Y: assignDeep({}, d)
};
- removeAttr(e, "style");
- removeElements(e);
- if (!l && (!u.x || !u.y)) {
+ removeAttr(o, "style");
+ removeElements(o);
+ if (!a && (!f.x || !f.y)) {
let n = windowSize();
- let o = getWindowDPR();
+ let e = getWindowDPR();
window.addEventListener("resize", (() => {
const r = windowSize();
- const a = {
+ const l = {
w: r.w - n.w,
h: r.h - n.h
};
- if (0 === a.w && 0 === a.h) {
+ if (0 === l.w && 0 === l.h) {
return;
}
- const l = {
- w: q(a.w),
- h: q(a.h)
+ const a = {
+ w: N(l.w),
+ h: N(l.h)
};
- const u = {
- w: q(G(r.w / (n.w / 100))),
- h: q(G(r.h / (n.h / 100)))
+ const f = {
+ w: N(U(r.w / (n.w / 100))),
+ h: N(U(r.h / (n.h / 100)))
};
- const f = getWindowDPR();
- const d = l.w > 2 && l.h > 2;
- const _ = !diffBiggerThanOne(u.w, u.h);
- const g = f !== o && o > 0;
+ const u = getWindowDPR();
+ const d = a.w > 2 && a.h > 2;
+ const _ = !diffBiggerThanOne(f.w, f.h);
+ const g = u !== e && e > 0;
const h = d && _ && g;
if (h) {
- const [n, o] = i(getNativeScrollbarSize(t, e, s));
- assignDeep(Y.T, n);
- removeElements(e);
- if (o) {
+ const [n, e] = i(getNativeScrollbarSize(t, o, s));
+ assignDeep(G.T, n);
+ removeElements(o);
+ if (e) {
c("_");
}
}
n = r;
- o = f;
+ e = u;
}));
}
return _;
};
const getEnvironment = () => {
- if (!Y) {
- Y = createEnvironment();
+ if (!G) {
+ G = createEnvironment();
}
- return Y;
+ return G;
};
const W = {};
@@ -991,18 +967,18 @@ var X = {
function _extends() {
t.exports = _extends = Object.assign ? Object.assign.bind() : function(t) {
for (var n = 1; n < arguments.length; n++) {
- var e = arguments[n];
- for (var s in e) {
- if (Object.prototype.hasOwnProperty.call(e, s)) {
- t[s] = e[s];
+ var o = arguments[n];
+ for (var s in o) {
+ if (Object.prototype.hasOwnProperty.call(o, s)) {
+ t[s] = o[s];
}
}
}
return t;
- }, t.exports.g = true, t.exports["default"] = t.exports;
+ }, t.exports.o = true, t.exports["default"] = t.exports;
return _extends.apply(this, arguments);
}
- t.exports = _extends, t.exports.g = true, t.exports["default"] = t.exports;
+ t.exports = _extends, t.exports.o = true, t.exports["default"] = t.exports;
})(X);
const J = getDefaultExportFromCjs(X.exports);
@@ -1017,60 +993,60 @@ const K = {
null: "__TPL_null_TYPE__"
};
-const validateRecursive = (t, n, e, s) => {
- const o = {};
+const validateRecursive = (t, n, o, s) => {
+ const e = {};
const c = J({}, n);
const i = keys(t).filter((t => hasOwnProperty(n, t)));
each(i, (i => {
const r = n[i];
- const a = t[i];
- const l = isPlainObject(a);
- const u = s ? `${s}.` : "";
- if (l && isPlainObject(r)) {
- const [t, n] = validateRecursive(a, r, e, u + i);
- o[i] = t;
+ const l = t[i];
+ const a = isPlainObject(l);
+ const f = s ? `${s}.` : "";
+ if (a && isPlainObject(r)) {
+ const [t, n] = validateRecursive(l, r, o, f + i);
+ e[i] = t;
c[i] = n;
- each([ c, o ], (t => {
+ each([ c, e ], (t => {
if (isEmptyObject(t[i])) {
delete t[i];
}
}));
- } else if (!l) {
+ } else if (!a) {
let t = false;
const n = [];
const s = [];
- const l = type(r);
- const f = !isArray(a) ? [ a ] : a;
- each(f, (e => {
- let o;
+ const a = type(r);
+ const u = !isArray(l) ? [ l ] : l;
+ each(u, (o => {
+ let e;
each(K, ((t, n) => {
- if (t === e) {
- o = n;
+ if (t === o) {
+ e = n;
}
}));
- const c = isUndefined(o);
+ const c = isUndefined(e);
if (c && isString(r)) {
- const s = e.split(" ");
+ const s = o.split(" ");
t = !!s.find((t => t === r));
push(n, s);
} else {
- t = K[l] === e;
+ t = K[a] === o;
}
- push(s, c ? K.string : o);
+ push(s, c ? K.string : e);
return !t;
}));
if (t) {
- o[i] = r;
- } else if (e) {
- console.warn(`${`The option "${u}${i}" wasn't set, because it doesn't accept the type [ ${l.toUpperCase()} ] with the value of "${r}".\r\n` + `Accepted types are: [ ${s.join(", ").toUpperCase()} ].\r\n`}${n.length > 0 ? `\r\nValid strings are: [ ${n.join(", ")} ].` : ""}`);
+ e[i] = r;
+ } else if (o) {
+ console.warn(`${`The option "${f}${i}" wasn't set, because it doesn't accept the type [ ${a.toUpperCase()} ] with the value of "${r}".\r\n` + `Accepted types are: [ ${s.join(", ").toUpperCase()} ].\r\n`}${n.length > 0 ? `\r\nValid strings are: [ ${n.join(", ")} ].` : ""}`);
}
delete c[i];
}
}));
- return [ o, c ];
+ return [ e, c ];
};
-const validateOptions = (t, n, e) => validateRecursive(t, n, e);
+const validateOptions = (t, n, o) => validateRecursive(t, n, o);
const Q = K.number;
@@ -1080,11 +1056,11 @@ const tt = [ K.array, K.null ];
const nt = "hidden scroll visible visible-hidden";
-const et = "visible hidden auto";
+const ot = "visible hidden auto";
const st = "never scroll leavemove";
-const ot = {
+const et = {
paddingAbsolute: Z,
updating: {
elementEvents: tt,
@@ -1097,7 +1073,7 @@ const ot = {
y: nt
},
scrollbars: {
- visibility: et,
+ visibility: ot,
autoHide: st,
autoHideDelay: Q,
dragScroll: Z,
@@ -1114,32 +1090,32 @@ const ct = "__osOptionsValidationPlugin";
const it = {
[ct]: {
- U: (t, n) => {
- const [e, s] = validateOptions(ot, t, n);
- return J({}, s, e);
+ q: (t, n) => {
+ const [o, s] = validateOptions(et, t, n);
+ return J({}, s, o);
}
}
};
const rt = 3333333;
-const at = "scroll";
+const lt = "scroll";
-const lt = "__osSizeObserverPlugin";
+const at = "__osSizeObserverPlugin";
-const ut = {
- [lt]: {
- U: (t, n, e) => {
- const s = createDOM(``);
+const ft = {
+ [at]: {
+ q: (t, n, o) => {
+ const s = createDOM(``);
appendChildren(t, s);
- addClass(t, j);
- const o = s[0];
- const c = o.lastChild;
- const i = o.firstChild;
+ addClass(t, E);
+ const e = s[0];
+ const c = e.lastChild;
+ const i = e.firstChild;
const r = null == i ? void 0 : i.firstChild;
- let a = offsetSize(o);
- let l = a;
- let u = false;
+ let l = offsetSize(e);
+ let a = l;
+ let f = false;
let _;
const reset = () => {
scrollLeft(i, rt);
@@ -1149,18 +1125,18 @@ const ut = {
};
const onResized = t => {
_ = 0;
- if (u) {
- a = l;
+ if (f) {
+ l = a;
n(true === t);
}
};
const onScroll = t => {
- l = offsetSize(o);
- u = !t || !equalWH(l, a);
+ a = offsetSize(e);
+ f = !t || !equalWH(a, l);
if (t) {
stopAndPrevent(t);
- if (u && !_) {
- f(_);
+ if (f && !_) {
+ u(_);
_ = d(onResized);
}
} else {
@@ -1168,81 +1144,81 @@ const ut = {
}
reset();
};
- const g = push([], [ on(i, at, onScroll), on(c, at, onScroll) ]);
+ const g = push([], [ on(i, lt, onScroll), on(c, lt, onScroll) ]);
style(r, {
width: rt,
height: rt
});
reset();
- return [ e ? onScroll.bind(0, false) : reset, g ];
+ return [ o ? onScroll.bind(0, false) : reset, g ];
}
}
};
-let ft = 0;
+let ut = 0;
const dt = "__osScrollbarsHidingPlugin";
const _t = {
[dt]: {
- Y: () => {
- const {P: t, D: n, I: e} = getEnvironment();
- const s = !e && !t && (n.x || n.y);
- const o = s ? document.createElement("style") : false;
- if (o) {
- attr(o, "id", `${L}-${ft}`);
- ft++;
+ G: () => {
+ const {L: t, P: n, M: o} = getEnvironment();
+ const s = !o && !t && (n.x || n.y);
+ const e = s ? document.createElement("style") : false;
+ if (e) {
+ attr(e, "id", `${A}-${ut}`);
+ ut++;
}
- return o;
+ return e;
},
- q: (t, n, e, s, o, c) => {
- const {M: i} = getEnvironment();
- const arrangeViewport = (o, c, i, r) => {
+ N: (t, n, o, s, e, c) => {
+ const {R: i} = getEnvironment();
+ const arrangeViewport = (e, c, i, r) => {
if (t) {
- const {G: t} = s();
- const {W: a, X: l} = o;
- const {x: u, y: f} = l;
- const {x: d, y: _} = a;
+ const {U: t} = s();
+ const {W: l, X: a} = e;
+ const {x: f, y: u} = a;
+ const {x: d, y: _} = l;
const g = r ? "paddingRight" : "paddingLeft";
const h = t[g];
- const p = t.paddingTop;
- const v = c.w + i.w;
- const b = c.h + i.h;
- const w = {
- w: _ && f ? `${_ + v - h}px` : "",
- h: d && u ? `${d + b - p}px` : ""
+ const v = t.paddingTop;
+ const w = c.w + i.w;
+ const p = c.h + i.h;
+ const b = {
+ w: _ && u ? `${_ + w - h}px` : "",
+ h: d && f ? `${d + p - v}px` : ""
};
- if (e) {
- const {sheet: t} = e;
+ if (o) {
+ const {sheet: t} = o;
if (t) {
const {cssRules: n} = t;
if (n) {
if (!n.length) {
- t.insertRule(`#${attr(e, "id")} + .${L}::before {}`, 0);
+ t.insertRule(`#${attr(o, "id")} + .${A}::before {}`, 0);
}
const s = n[0].style;
- s.width = w.w;
- s.height = w.h;
+ s.width = b.w;
+ s.height = b.h;
}
}
} else {
style(n, {
- "--os-vaw": w.w,
- "--os-vah": w.h
+ "--os-vaw": b.w,
+ "--os-vah": b.h
});
}
}
return t;
};
- const undoViewportArrange = (e, r, a) => {
+ const undoViewportArrange = (o, r, l) => {
if (t) {
- const l = a || o(e);
- const {G: u} = s();
- const {X: f} = l;
- const {x: d, y: _} = f;
+ const a = l || e(o);
+ const {U: f} = s();
+ const {X: u} = a;
+ const {x: d, y: _} = u;
const g = {};
const assignProps = t => each(t.split(" "), (t => {
- g[t] = u[t];
+ g[t] = f[t];
}));
if (d) {
assignProps("marginBottom paddingTop paddingBottom");
@@ -1251,16 +1227,16 @@ const _t = {
assignProps("marginLeft marginRight paddingLeft paddingRight");
}
const h = style(n, keys(g));
- removeClass(n, L);
+ removeClass(n, A);
if (!i) {
g.height = "";
}
style(n, g);
return [ () => {
- c(l, r, t, h);
+ c(a, r, t, h);
style(n, h);
- addClass(n, L);
- }, l ];
+ addClass(n, A);
+ }, a ];
}
return [ noop ];
};
@@ -1271,14 +1247,14 @@ const _t = {
const resolveInitialization = (t, n) => isFunction(t) ? t.apply(0, n) : t;
-const staticInitializationElement = (t, n, e, s) => resolveInitialization(s || resolveInitialization(e, t), t) || n.apply(0, t);
+const staticInitializationElement = (t, n, o, s) => resolveInitialization(s || resolveInitialization(o, t), t) || n.apply(0, t);
-const dynamicInitializationElement = (t, n, e, s) => {
- let o = resolveInitialization(s, t);
- if (isNull(o) || isUndefined(o)) {
- o = resolveInitialization(e, t);
+const dynamicInitializationElement = (t, n, o, s) => {
+ let e = resolveInitialization(s, t);
+ if (isNull(e) || isUndefined(e)) {
+ e = resolveInitialization(o, t);
}
- return true === o || isNull(o) || isUndefined(o) ? n.apply(0, t) : o;
+ return true === e || isNull(e) || isUndefined(e) ? n.apply(0, t) : e;
};
const gt = createDiv.bind(0, "");
@@ -1294,106 +1270,106 @@ const addDataAttrHost = (t, n) => {
};
const createStructureSetupElements = t => {
- const {N: n, P: e} = getEnvironment();
+ const {j: n, L: o} = getEnvironment();
const s = getPlugins()[dt];
- const o = s && s.Y;
- const {J: c, K: i, A: r, L: a} = n();
- const l = isHTMLElement(t);
- const f = t;
- const d = l ? t : f.target;
+ const e = s && s.G;
+ const {J: c, K: i, A: r, I: l} = n();
+ const a = isHTMLElement(t);
+ const u = t;
+ const d = a ? t : u.target;
const _ = is(d, "textarea");
const g = !_ && is(d, "body");
const h = d.ownerDocument;
- const p = h.body;
- const v = h.defaultView;
- const b = !!u && !_ && e;
- const w = staticInitializationElement.bind(0, [ d ]);
+ const v = h.body;
+ const w = h.defaultView;
+ const p = !!f && !_ && o;
+ const b = staticInitializationElement.bind(0, [ d ]);
const y = dynamicInitializationElement.bind(0, [ d ]);
- const C = [ w(gt, i, f.viewport), w(gt, i), w(gt) ].filter((t => !b ? t !== d : true))[0];
- const O = C === d;
- const L = {
+ const C = [ b(gt, i, u.viewport), b(gt, i), b(gt) ].filter((t => !p ? t !== d : true))[0];
+ const $ = C === d;
+ const A = {
Z: d,
- J: _ ? w(gt, c, f.host) : d,
+ J: _ ? b(gt, c, u.host) : d,
K: C,
- A: !O && y(gt, r, f.padding),
- L: !O && y(gt, a, f.content),
- tt: !O && !e && o && o(),
- nt: v,
- et: h,
- st: parent(p),
- ot: p,
+ A: !$ && y(gt, r, u.padding),
+ I: !$ && y(gt, l, u.content),
+ tt: !$ && !o && e && e(),
+ nt: w,
+ ot: h,
+ st: parent(v),
+ et: v,
ct: _,
it: g,
- rt: l,
- lt: O,
- ut: (t, n) => O ? hasAttrClass(C, m, n) : hasClass(C, t),
- ft: (t, n, e) => O ? attrClass(C, m, n, e) : (e ? addClass : removeClass)(C, t)
+ rt: a,
+ lt: $,
+ ft: (t, n) => $ ? hasAttrClass(C, m, n) : hasClass(C, t),
+ ut: (t, n, o) => $ ? attrClass(C, m, n, o) : (o ? addClass : removeClass)(C, t)
};
- const D = keys(L).reduce(((t, n) => {
- const e = L[n];
- return push(t, e && !parent(e) ? e : false);
+ const P = keys(A).reduce(((t, n) => {
+ const o = A[n];
+ return push(t, o && !parent(o) ? o : false);
}), []);
- const elementIsGenerated = t => t ? indexOf(D, t) > -1 : null;
- const {Z: E, J: P, A: I, K: j, L: M, tt: H} = L;
- const N = [];
- const R = _ && elementIsGenerated(P);
- const F = _ ? E : contents([ M, j, I, P, E ].find((t => false === elementIsGenerated(t))));
- const V = M || j;
+ const elementIsGenerated = t => t ? indexOf(P, t) > -1 : null;
+ const {Z: L, J: M, A: H, K: E, I: R, tt: D} = A;
+ const j = [];
+ const V = _ && elementIsGenerated(M);
+ const B = _ ? L : contents([ R, E, H, M, L ].find((t => false === elementIsGenerated(t))));
+ const k = R || E;
const appendElements = () => {
- const t = addDataAttrHost(P, O ? "viewport" : "host");
- const n = addClass(I, $);
- const s = addClass(j, !O && A);
- const o = addClass(M, T);
- if (R) {
- insertAfter(E, P);
- push(N, (() => {
- insertAfter(P, E);
- removeElements(P);
+ const t = addDataAttrHost(M, $ ? "viewport" : "host");
+ const n = addClass(H, O);
+ const s = addClass(E, !$ && z);
+ const e = addClass(R, I);
+ if (V) {
+ insertAfter(L, M);
+ push(j, (() => {
+ insertAfter(M, L);
+ removeElements(M);
}));
}
- appendChildren(V, F);
- appendChildren(P, I);
- appendChildren(I || P, !O && j);
- appendChildren(j, M);
- push(N, (() => {
+ appendChildren(k, B);
+ appendChildren(M, H);
+ appendChildren(H || M, !$ && E);
+ appendChildren(E, R);
+ push(j, (() => {
t();
- removeAttr(j, S);
- removeAttr(j, x);
- if (elementIsGenerated(M)) {
- unwrap(M);
+ removeAttr(E, S);
+ removeAttr(E, x);
+ if (elementIsGenerated(R)) {
+ unwrap(R);
}
- if (elementIsGenerated(j)) {
- unwrap(j);
+ if (elementIsGenerated(E)) {
+ unwrap(E);
}
- if (elementIsGenerated(I)) {
- unwrap(I);
+ if (elementIsGenerated(H)) {
+ unwrap(H);
}
n();
s();
- o();
+ e();
}));
- if (e && !O) {
- push(N, removeClass.bind(0, j, z));
+ if (o && !$) {
+ push(j, removeClass.bind(0, E, T));
}
- if (H) {
- insertBefore(j, H);
- push(N, removeElements.bind(0, H));
+ if (D) {
+ insertBefore(E, D);
+ push(j, removeElements.bind(0, D));
}
};
- return [ L, appendElements, runEachAndClear.bind(0, N) ];
+ return [ A, appendElements, runEachAndClear.bind(0, j) ];
};
const createTrinsicUpdate = (t, n) => {
- const {L: e} = t;
+ const {I: o} = t;
const [s] = n;
return t => {
- const {M: n} = getEnvironment();
- const {dt: o} = s();
+ const {R: n} = getEnvironment();
+ const {dt: e} = s();
const {_t: c} = t;
- const i = (e || !n) && c;
+ const i = (o || !n) && c;
if (i) {
- style(e, {
- height: o ? "" : "100%"
+ style(o, {
+ height: e ? "" : "100%"
});
}
return {
@@ -1404,48 +1380,48 @@ const createTrinsicUpdate = (t, n) => {
};
const createPaddingUpdate = (t, n) => {
- const [e, s] = n;
- const {J: o, A: c, K: i, lt: r} = t;
- const [a, l] = createCache({
- u: equalTRBL,
- o: topRightBottomLeft()
- }, topRightBottomLeft.bind(0, o, "padding", ""));
- return (t, n, o) => {
- let [u, f] = l(o);
- const {P: d, M: _} = getEnvironment();
- const {vt: g} = e();
- const {gt: h, ht: p, bt: v} = t;
- const [b, w] = n("paddingAbsolute");
- const y = !_ && p;
- if (h || f || y) {
- [u, f] = a(o);
+ const [o, s] = n;
+ const {J: e, A: c, K: i, lt: r} = t;
+ const [l, a] = createCache({
+ _: equalTRBL,
+ u: topRightBottomLeft()
+ }, topRightBottomLeft.bind(0, e, "padding", ""));
+ return (t, n, e) => {
+ let [f, u] = a(e);
+ const {L: d, R: _} = getEnvironment();
+ const {vt: g} = o();
+ const {gt: h, ht: v, wt: w} = t;
+ const [p, b] = n("paddingAbsolute");
+ const y = !_ && v;
+ if (h || u || y) {
+ [f, u] = l(e);
}
- const m = !r && (w || v || f);
+ const m = !r && (b || w || u);
if (m) {
- const t = !b || !c && !d;
- const n = u.r + u.l;
- const e = u.t + u.b;
- const o = {
+ const t = !p || !c && !d;
+ const n = f.r + f.l;
+ const o = f.t + f.b;
+ const e = {
marginRight: t && !g ? -n : 0,
- marginBottom: t ? -e : 0,
+ marginBottom: t ? -o : 0,
marginLeft: t && g ? -n : 0,
- top: t ? -u.t : 0,
- right: t ? g ? -u.r : "auto" : 0,
- left: t ? g ? "auto" : -u.l : 0,
+ top: t ? -f.t : 0,
+ right: t ? g ? -f.r : "auto" : 0,
+ left: t ? g ? "auto" : -f.l : 0,
width: t ? `calc(100% + ${n}px)` : ""
};
const r = {
- paddingTop: t ? u.t : 0,
- paddingRight: t ? u.r : 0,
- paddingBottom: t ? u.b : 0,
- paddingLeft: t ? u.l : 0
+ paddingTop: t ? f.t : 0,
+ paddingRight: t ? f.r : 0,
+ paddingBottom: t ? f.b : 0,
+ paddingLeft: t ? f.l : 0
};
- style(c || i, o);
+ style(c || i, e);
style(i, r);
s({
- A: u,
- wt: !t,
- G: c ? r : assignDeep({}, o, r)
+ A: f,
+ bt: !t,
+ U: c ? r : assignDeep({}, e, r)
});
}
return {
@@ -1456,96 +1432,96 @@ const createPaddingUpdate = (t, n) => {
const {max: ht} = Math;
-const pt = "visible";
+const vt = "visible";
-const vt = "hidden";
+const wt = "hidden";
-const bt = 42;
+const pt = 42;
-const wt = {
- u: equalWH,
- o: {
+const bt = {
+ _: equalWH,
+ u: {
w: 0,
h: 0
}
};
const yt = {
- u: equalXY,
- o: {
- x: vt,
- y: vt
+ _: equalXY,
+ u: {
+ x: wt,
+ y: wt
}
};
-const getOverflowAmount = (t, n, e) => {
+const getOverflowAmount = (t, n, o) => {
const s = window.devicePixelRatio % 1 !== 0 ? 1 : 0;
- const o = {
- w: ht(0, t.w - n.w - ht(0, e.w)),
- h: ht(0, t.h - n.h - ht(0, e.h))
+ const e = {
+ w: ht(0, t.w - n.w - ht(0, o.w)),
+ h: ht(0, t.h - n.h - ht(0, o.h))
};
return {
- w: o.w > s ? o.w : 0,
- h: o.h > s ? o.h : 0
+ w: e.w > s ? e.w : 0,
+ h: e.h > s ? e.h : 0
};
};
-const conditionalClass = (t, n, e) => e ? addClass(t, n) : removeClass(t, n);
+const conditionalClass = (t, n, o) => o ? addClass(t, n) : removeClass(t, n);
-const overflowIsVisible = t => 0 === t.indexOf(pt);
+const overflowIsVisible = t => 0 === t.indexOf(vt);
const createOverflowUpdate = (t, n) => {
- const [e, s] = n;
- const {J: o, A: c, K: i, tt: r, lt: a, ft: l} = t;
- const {T: u, M: f, P: d, D: _} = getEnvironment();
+ const [o, s] = n;
+ const {J: e, A: c, K: i, tt: r, lt: l, ut: a} = t;
+ const {T: f, R: u, L: d, P: _} = getEnvironment();
const g = getPlugins()[dt];
- const h = !a && !d && (_.x || _.y);
- const [p, v] = createCache(wt, fractionalSize.bind(0, i));
- const [b, w] = createCache(wt, scrollSize.bind(0, i));
- const [y, $] = createCache(wt);
- const [A] = createCache(yt);
+ const h = !l && !d && (_.x || _.y);
+ const [v, w] = createCache(bt, fractionalSize.bind(0, i));
+ const [p, b] = createCache(bt, scrollSize.bind(0, i));
+ const [y, O] = createCache(bt);
+ const [z] = createCache(yt);
const fixFlexboxGlue = (t, n) => {
style(i, {
height: ""
});
if (n) {
- const {wt: n, A: s} = e();
+ const {bt: n, A: s} = o();
const {St: c, W: r} = t;
- const a = fractionalSize(o);
- const l = clientSize(o);
- const u = "content-box" === style(i, "boxSizing");
- const f = n || u ? s.b + s.t : 0;
- const d = !(_.x && u);
+ const l = fractionalSize(e);
+ const a = clientSize(e);
+ const f = "content-box" === style(i, "boxSizing");
+ const u = n || f ? s.b + s.t : 0;
+ const d = !(_.x && f);
style(i, {
- height: l.h + a.h + (c.x && d ? r.x : 0) - f
+ height: a.h + l.h + (c.x && d ? r.x : 0) - u
});
}
};
const getViewportOverflowState = (t, n) => {
- const e = !d && !t ? bt : 0;
- const getStatePerAxis = (t, s, o) => {
+ const o = !d && !t ? pt : 0;
+ const getStatePerAxis = (t, s, e) => {
const c = style(i, t);
const r = n ? n[t] : c;
- const a = "scroll" === r;
- const l = s ? e : o;
- const u = a && !d ? l : 0;
- const f = s && !!e;
- return [ c, a, u, f ];
+ const l = "scroll" === r;
+ const a = s ? o : e;
+ const f = l && !d ? a : 0;
+ const u = s && !!o;
+ return [ c, l, f, u ];
};
- const [s, o, c, r] = getStatePerAxis("overflowX", _.x, u.x);
- const [a, l, f, g] = getStatePerAxis("overflowY", _.y, u.y);
+ const [s, e, c, r] = getStatePerAxis("overflowX", _.x, f.x);
+ const [l, a, u, g] = getStatePerAxis("overflowY", _.y, f.y);
return {
xt: {
x: s,
- y: a
+ y: l
},
St: {
- x: o,
- y: l
+ x: e,
+ y: a
},
W: {
x: c,
- y: f
+ y: u
},
X: {
x: r,
@@ -1553,91 +1529,91 @@ const createOverflowUpdate = (t, n) => {
}
};
};
- const setViewportOverflowState = (t, n, e, s) => {
+ const setViewportOverflowState = (t, n, o, s) => {
const setAxisOverflowStyle = (t, n) => {
- const e = overflowIsVisible(t);
- const s = n && e && t.replace(`${pt}-`, "") || "";
- return [ n && !e ? t : "", overflowIsVisible(s) ? "hidden" : s ];
+ const o = overflowIsVisible(t);
+ const s = n && o && t.replace(`${vt}-`, "") || "";
+ return [ n && !o ? t : "", overflowIsVisible(s) ? "hidden" : s ];
};
- const [o, c] = setAxisOverflowStyle(e.x, n.x);
- const [i, r] = setAxisOverflowStyle(e.y, n.y);
- s.overflowX = c && i ? c : o;
- s.overflowY = r && o ? r : i;
+ const [e, c] = setAxisOverflowStyle(o.x, n.x);
+ const [i, r] = setAxisOverflowStyle(o.y, n.y);
+ s.overflowX = c && i ? c : e;
+ s.overflowY = r && e ? r : i;
return getViewportOverflowState(t, s);
};
- const hideNativeScrollbars = (t, n, s, o) => {
+ const hideNativeScrollbars = (t, n, s, e) => {
const {W: c, X: i} = t;
- const {x: r, y: a} = i;
- const {x: l, y: u} = c;
- const {G: f} = e();
+ const {x: r, y: l} = i;
+ const {x: a, y: f} = c;
+ const {U: u} = o();
const d = n ? "marginLeft" : "marginRight";
const _ = n ? "paddingLeft" : "paddingRight";
- const g = f[d];
- const h = f.marginBottom;
- const p = f[_];
- const v = f.paddingBottom;
- o.width = `calc(100% + ${u + -1 * g}px)`;
- o[d] = -u + g;
- o.marginBottom = -l + h;
+ const g = u[d];
+ const h = u.marginBottom;
+ const v = u[_];
+ const w = u.paddingBottom;
+ e.width = `calc(100% + ${f + -1 * g}px)`;
+ e[d] = -f + g;
+ e.marginBottom = -a + h;
if (s) {
- o[_] = p + (a ? u : 0);
- o.paddingBottom = v + (r ? l : 0);
+ e[_] = v + (l ? f : 0);
+ e.paddingBottom = w + (r ? a : 0);
}
};
- const [L, T] = g ? g.q(h, i, r, e, getViewportOverflowState, hideNativeScrollbars) : [ () => h, () => [ noop ] ];
+ const [A, I] = g ? g.N(h, i, r, o, getViewportOverflowState, hideNativeScrollbars) : [ () => h, () => [ noop ] ];
return (t, n, r) => {
- const {gt: u, Ct: g, ht: h, yt: E, _t: P, bt: I} = t;
- const {dt: j, vt: M} = e();
- const [H, N] = n("nativeScrollbarsOverlaid.show");
- const [R, F] = n("overflow");
- const V = H && _.x && _.y;
- const k = !a && !f && (u || h || g || N || P);
- const B = overflowIsVisible(R.x);
- const U = overflowIsVisible(R.y);
- const Y = B || U;
- let q = v(r);
- let G = w(r);
- let W = $(r);
+ const {gt: f, Ct: g, ht: h, yt: L, _t: M, wt: H} = t;
+ const {dt: E, vt: R} = o();
+ const [D, j] = n("nativeScrollbarsOverlaid.show");
+ const [V, B] = n("overflow");
+ const k = D && _.x && _.y;
+ const F = !l && !u && (f || h || g || j || M);
+ const Y = overflowIsVisible(V.x);
+ const q = overflowIsVisible(V.y);
+ const G = Y || q;
+ let N = w(r);
+ let U = b(r);
+ let W = O(r);
let X;
- if (N && d) {
- l(z, O, !V);
+ if (j && d) {
+ a(T, $, !k);
}
- if (k) {
- X = getViewportOverflowState(V);
- fixFlexboxGlue(X, j);
+ if (F) {
+ X = getViewportOverflowState(k);
+ fixFlexboxGlue(X, E);
}
- if (u || E || h || I || N) {
- if (Y) {
- l(D, C, false);
+ if (f || L || h || H || j) {
+ if (G) {
+ a(P, C, false);
}
- const [t, n] = T(V, M, X);
- const [e, s] = q = p(r);
- const [o, c] = G = b(r);
- const a = clientSize(i);
- let u = o;
- let f = a;
+ const [t, n] = I(k, R, X);
+ const [o, s] = N = v(r);
+ const [e, c] = U = p(r);
+ const l = clientSize(i);
+ let f = e;
+ let u = l;
t();
- if ((c || s || N) && n && !V && L(n, o, e, M)) {
- f = clientSize(i);
- u = scrollSize(i);
+ if ((c || s || j) && n && !k && A(n, e, o, R)) {
+ u = clientSize(i);
+ f = scrollSize(i);
}
W = y(getOverflowAmount({
- w: ht(o.w, u.w),
- h: ht(o.h, u.h)
+ w: ht(e.w, f.w),
+ h: ht(e.h, f.h)
}, {
- w: f.w + ht(0, a.w - o.w),
- h: f.h + ht(0, a.h - o.h)
- }, e), r);
+ w: u.w + ht(0, l.w - e.w),
+ h: u.h + ht(0, l.h - e.h)
+ }, o), r);
}
const [J, K] = W;
- const [Q, Z] = G;
- const [tt, nt] = q;
- const et = {
+ const [Q, Z] = U;
+ const [tt, nt] = N;
+ const ot = {
x: J.w > 0,
y: J.h > 0
};
- const st = B && U && (et.x || et.y) || B && et.x && !et.y || U && et.y && !et.x;
- if (E || I || nt || Z || K || F || N || k) {
+ const st = Y && q && (ot.x || ot.y) || Y && ot.x && !ot.y || q && ot.y && !ot.x;
+ if (L || H || nt || Z || K || B || j || F) {
const t = {
marginRight: 0,
marginBottom: 0,
@@ -1646,82 +1622,82 @@ const createOverflowUpdate = (t, n) => {
overflowY: "",
overflowX: ""
};
- const n = setViewportOverflowState(V, et, R, t);
- const e = L(n, Q, tt, M);
- if (!a) {
- hideNativeScrollbars(n, M, e, t);
+ const n = setViewportOverflowState(k, ot, V, t);
+ const o = A(n, Q, tt, R);
+ if (!l) {
+ hideNativeScrollbars(n, R, o, t);
}
- if (k) {
- fixFlexboxGlue(n, j);
+ if (F) {
+ fixFlexboxGlue(n, E);
}
- if (a) {
- attr(o, S, t.overflowX);
- attr(o, x, t.overflowY);
+ if (l) {
+ attr(e, S, t.overflowX);
+ attr(e, x, t.overflowY);
} else {
style(i, t);
}
}
- attrClass(o, m, C, st);
- conditionalClass(c, D, st);
- !a && conditionalClass(i, D, Y);
- const [ot, ct] = A(getViewportOverflowState(V).xt);
+ attrClass(e, m, C, st);
+ conditionalClass(c, P, st);
+ !l && conditionalClass(i, P, G);
+ const [et, ct] = z(getViewportOverflowState(k).xt);
s({
- xt: ot,
- Ot: {
+ xt: et,
+ $t: {
x: J.w,
y: J.h
},
- $t: et
+ Ot: ot
});
return {
- At: ct,
- Lt: K
+ zt: ct,
+ At: K
};
};
};
-const prepareUpdateHints = (t, n, e) => {
+const prepareUpdateHints = (t, n, o) => {
const s = {};
- const o = n || {};
- const c = keys(t).concat(keys(o));
+ const e = n || {};
+ const c = keys(t).concat(keys(e));
each(c, (n => {
const c = t[n];
- const i = o[n];
- s[n] = !!(e || c || i);
+ const i = e[n];
+ s[n] = !!(o || c || i);
}));
return s;
};
const createStructureSetupUpdate = (t, n) => {
- const {K: e} = t;
- const {P: s, D: o, M: c} = getEnvironment();
- const i = !s && (o.x || o.y);
+ const {K: o} = t;
+ const {L: s, P: e, R: c} = getEnvironment();
+ const i = !s && (e.x || e.y);
const r = [ createTrinsicUpdate(t, n), createPaddingUpdate(t, n), createOverflowUpdate(t, n) ];
return (t, n, s) => {
- const o = prepareUpdateHints(assignDeep({
+ const e = prepareUpdateHints(assignDeep({
gt: false,
yt: false,
- bt: false,
+ wt: false,
_t: false,
- Lt: false,
At: false,
+ zt: false,
Ct: false,
ht: false
}, n), {}, s);
- const a = i || !c;
- const l = a && scrollLeft(e);
- const u = a && scrollTop(e);
- let f = o;
+ const l = i || !c;
+ const a = l && scrollLeft(o);
+ const f = l && scrollTop(o);
+ let u = e;
each(r, (n => {
- f = prepareUpdateHints(f, n(f, t, !!s) || {}, s);
+ u = prepareUpdateHints(u, n(u, t, !!s) || {}, s);
}));
- if (isNumber(l)) {
- scrollLeft(e, l);
+ if (isNumber(a)) {
+ scrollLeft(o, a);
}
- if (isNumber(u)) {
- scrollTop(e, u);
+ if (isNumber(f)) {
+ scrollTop(o, f);
}
- return f;
+ return u;
};
};
@@ -1735,163 +1711,163 @@ const getElmDirectionIsRTL = t => "rtl" === style(t, "direction");
const domRectHasDimensions = t => t && (t.height || t.width);
-const createSizeObserver = (t, n, e) => {
- const {Tt: s = false, zt: o = false} = e || {};
- const c = getPlugins()[lt];
- const {j: i} = getEnvironment();
- const r = createDOM(``);
- const a = r[0];
- const l = a.firstChild;
- const f = getElmDirectionIsRTL.bind(0, a);
+const createSizeObserver = (t, n, o) => {
+ const {It: s = false, Tt: e = false} = o || {};
+ const c = getPlugins()[at];
+ const {H: i} = getEnvironment();
+ const r = createDOM(``);
+ const l = r[0];
+ const a = l.firstChild;
+ const u = getElmDirectionIsRTL.bind(0, l);
const [d] = createCache({
- o: void 0,
- _: true,
- u: (t, n) => !(!t || !domRectHasDimensions(t) && domRectHasDimensions(n))
+ u: void 0,
+ g: true,
+ _: (t, n) => !(!t || !domRectHasDimensions(t) && domRectHasDimensions(n))
});
const onSizeChangedCallbackProxy = t => {
- const e = isArray(t) && t.length > 0 && isObject(t[0]);
- const o = !e && isBoolean(t[0]);
+ const o = isArray(t) && t.length > 0 && isObject(t[0]);
+ const e = !o && isBoolean(t[0]);
let c = false;
let r = false;
- let l = true;
- if (e) {
- const [n, , e] = d(t.pop().contentRect);
+ let a = true;
+ if (o) {
+ const [n, , o] = d(t.pop().contentRect);
const s = domRectHasDimensions(n);
- const o = domRectHasDimensions(e);
- c = !e || !s;
- r = !o && s;
- l = !c;
- } else if (o) {
- [, l] = t;
+ const e = domRectHasDimensions(o);
+ c = !o || !s;
+ r = !e && s;
+ a = !c;
+ } else if (e) {
+ [, a] = t;
} else {
r = true === t;
}
- if (s && l) {
- const n = o ? t[0] : getElmDirectionIsRTL(a);
- scrollLeft(a, n ? i.n ? -xt : i.i ? 0 : xt : xt);
- scrollTop(a, xt);
+ if (s && a) {
+ const n = e ? t[0] : getElmDirectionIsRTL(l);
+ scrollLeft(l, n ? i.n ? -xt : i.i ? 0 : xt : xt);
+ scrollTop(l, xt);
}
if (!c) {
n({
- gt: !o,
- Dt: o ? t : void 0,
- zt: !!r
+ gt: !e,
+ Pt: e ? t : void 0,
+ Tt: !!r
});
}
};
const _ = [];
- let g = o ? onSizeChangedCallbackProxy : false;
+ let g = e ? onSizeChangedCallbackProxy : false;
let h;
- if (u) {
- const t = new u(onSizeChangedCallbackProxy);
- t.observe(l);
+ if (f) {
+ const t = new f(onSizeChangedCallbackProxy);
+ t.observe(a);
push(_, (() => {
t.disconnect();
}));
} else if (c) {
- const [t, n] = c.U(l, onSizeChangedCallbackProxy, o);
+ const [t, n] = c.q(a, onSizeChangedCallbackProxy, e);
g = t;
push(_, n);
}
if (s) {
h = createCache({
- o: !f()
- }, f);
+ u: !u()
+ }, u);
const [t] = h;
- push(_, on(a, St, (n => {
- const e = t();
- const [s, o] = e;
- if (o) {
- removeClass(l, "ltr rtl");
+ push(_, on(l, St, (n => {
+ const o = t();
+ const [s, e] = o;
+ if (e) {
+ removeClass(a, "ltr rtl");
if (s) {
- addClass(l, "rtl");
+ addClass(a, "rtl");
} else {
- addClass(l, "ltr");
+ addClass(a, "ltr");
}
- onSizeChangedCallbackProxy(e);
+ onSizeChangedCallbackProxy(o);
}
stopAndPrevent(n);
})));
}
if (g) {
- addClass(a, P);
- push(_, on(a, mt, g, {
- $: !!u
+ addClass(l, M);
+ push(_, on(l, mt, g, {
+ O: !!f
}));
}
- prependChildren(t, a);
+ prependChildren(t, l);
return () => {
runEachAndClear(_);
- removeElements(a);
+ removeElements(l);
};
};
const isHeightIntrinsic = t => 0 === t.h || t.isIntersecting || t.intersectionRatio > 0;
const createTrinsicObserver = (t, n) => {
- const e = createDiv(N);
+ const o = createDiv(j);
const s = [];
- const [o] = createCache({
- o: false
+ const [e] = createCache({
+ u: false
});
const triggerOnTrinsicChangedCallback = t => {
if (t) {
- const e = o(isHeightIntrinsic(t));
- const [, s] = e;
+ const o = e(isHeightIntrinsic(t));
+ const [, s] = o;
if (s) {
- n(e);
+ n(o);
}
}
};
- if (l) {
- const n = new l((t => {
+ if (a) {
+ const n = new a((t => {
if (t && t.length > 0) {
triggerOnTrinsicChangedCallback(t.pop());
}
}), {
root: t
});
- n.observe(e);
+ n.observe(o);
push(s, (() => {
n.disconnect();
}));
} else {
const onSizeChanged = () => {
- const t = offsetSize(e);
+ const t = offsetSize(o);
triggerOnTrinsicChangedCallback(t);
};
- push(s, createSizeObserver(e, onSizeChanged));
+ push(s, createSizeObserver(o, onSizeChanged));
onSizeChanged();
}
- prependChildren(t, e);
+ prependChildren(t, o);
return () => {
runEachAndClear(s);
- removeElements(e);
+ removeElements(o);
};
};
-const createEventContentChange = (t, n, e) => {
+const createEventContentChange = (t, n, o) => {
let s;
- let o = false;
+ let e = false;
const destroy = () => {
- o = true;
+ e = true;
};
const updateElements = c => {
- if (e) {
- const i = e.reduce(((n, e) => {
- if (e) {
- const s = e[0];
- const o = e[1];
- const i = o && s && (c ? c(s) : find(s, t));
- if (i && i.length && o && isString(o)) {
- push(n, [ i, o.trim() ], true);
+ if (o) {
+ const i = o.reduce(((n, o) => {
+ if (o) {
+ const s = o[0];
+ const e = o[1];
+ const i = e && s && (c ? c(s) : find(s, t));
+ if (i && i.length && e && isString(e)) {
+ push(n, [ i, e.trim() ], true);
}
}
return n;
}), []);
- each(i, (t => each(t[0], (e => {
+ each(i, (t => each(t[0], (o => {
const c = t[1];
- const i = s.get(e);
+ const i = s.get(o);
if (i) {
const t = i[0];
const n = i[1];
@@ -1899,161 +1875,161 @@ const createEventContentChange = (t, n, e) => {
n();
}
}
- const r = on(e, c, (t => {
- if (o) {
+ const r = on(o, c, (t => {
+ if (e) {
r();
- s.delete(e);
+ s.delete(o);
} else {
n(t);
}
}));
- s.set(e, [ c, r ]);
+ s.set(o, [ c, r ]);
}))));
}
};
- if (e) {
+ if (o) {
s = new WeakMap;
updateElements();
}
return [ destroy, updateElements ];
};
-const createDOMObserver = (t, n, e, s) => {
- let o = false;
- const {Et: c, Pt: i, It: r, jt: l, Mt: u, Ht: f} = s || {};
+const createDOMObserver = (t, n, o, s) => {
+ let e = false;
+ const {Lt: c, Mt: i, Ht: r, Et: a, Rt: f, Dt: u} = s || {};
const [d, _] = createEventContentChange(t, debounce((() => {
- if (o) {
- e(true);
+ if (e) {
+ o(true);
}
}), {
- p: 33,
- v: 99
+ v: 33,
+ p: 99
}), r);
const g = c || [];
const h = i || [];
- const p = g.concat(h);
- const observerCallback = o => {
- const c = u || noop;
- const i = f || noop;
+ const v = g.concat(h);
+ const observerCallback = e => {
+ const c = f || noop;
+ const i = u || noop;
const r = [];
- const a = [];
+ const l = [];
let d = false;
let g = false;
- let p = false;
- each(o, (e => {
- const {attributeName: o, target: u, type: f, oldValue: _, addedNodes: v} = e;
- const b = "attributes" === f;
- const w = "childList" === f;
- const y = t === u;
- const m = b && isString(o) ? attr(u, o) : 0;
+ let v = false;
+ each(e, (o => {
+ const {attributeName: e, target: f, type: u, oldValue: _, addedNodes: w} = o;
+ const p = "attributes" === u;
+ const b = "childList" === u;
+ const y = t === f;
+ const m = p && isString(e) ? attr(f, e) : 0;
const S = 0 !== m && _ !== m;
- const x = indexOf(h, o) > -1 && S;
+ const x = indexOf(h, e) > -1 && S;
if (n && !y) {
- const n = !b;
- const r = b && x;
- const f = r && l && is(u, l);
- const d = f ? !c(u, o, _, m) : n || r;
- const h = d && !i(e, !!f, t, s);
- push(a, v);
+ const n = !p;
+ const r = p && x;
+ const u = r && a && is(f, a);
+ const d = u ? !c(f, e, _, m) : n || r;
+ const h = d && !i(o, !!u, t, s);
+ push(l, w);
g = g || h;
- p = p || w;
+ v = v || b;
}
- if (!n && y && S && !c(u, o, _, m)) {
- push(r, o);
+ if (!n && y && S && !c(f, e, _, m)) {
+ push(r, e);
d = d || x;
}
}));
- if (p && !isEmptyArray(a)) {
- _((t => a.reduce(((n, e) => {
- push(n, find(t, e));
- return is(e, t) ? push(n, e) : n;
+ if (v && !isEmptyArray(l)) {
+ _((t => l.reduce(((n, o) => {
+ push(n, find(t, o));
+ return is(o, t) ? push(n, o) : n;
}), [])));
}
if (n) {
- g && e(false);
+ g && o(false);
} else if (!isEmptyArray(r) || d) {
- e(r, d);
+ o(r, d);
}
};
- const v = new a(observerCallback);
- v.observe(t, {
+ const w = new l(observerCallback);
+ w.observe(t, {
attributes: true,
attributeOldValue: true,
- attributeFilter: p,
+ attributeFilter: v,
subtree: n,
childList: n,
characterData: n
});
- o = true;
+ e = true;
return [ () => {
- if (o) {
+ if (e) {
d();
- v.disconnect();
- o = false;
+ w.disconnect();
+ e = false;
}
}, () => {
- if (o) {
- observerCallback(v.takeRecords());
+ if (e) {
+ observerCallback(w.takeRecords());
}
} ];
};
const Ct = `[${m}]`;
-const Ot = `.${A}`;
+const $t = `.${z}`;
-const $t = [ "tabindex" ];
+const Ot = [ "tabindex" ];
-const At = [ "wrap", "cols", "rows" ];
+const zt = [ "wrap", "cols", "rows" ];
-const Lt = [ "id", "class", "style", "open" ];
+const At = [ "id", "class", "style", "open" ];
-const createStructureSetupObservers = (t, n, e) => {
+const createStructureSetupObservers = (t, n, o) => {
let s;
- let o;
+ let e;
let c;
const [, i] = n;
- const {J: r, K: a, L: l, ct: f, lt: d, ut: _, ft: g} = t;
- const {P: h, M: p} = getEnvironment();
- const [v] = createCache({
- u: equalWH,
- o: {
+ const {J: r, K: l, I: a, ct: u, lt: d, ft: _, ut: g} = t;
+ const {L: h, R: v} = getEnvironment();
+ const [w] = createCache({
+ _: equalWH,
+ u: {
w: 0,
h: 0
}
}, (() => {
- const t = _(D, C);
- t && g(D, C);
- const n = scrollSize(l);
- const e = scrollSize(a);
- const s = fractionalSize(a);
- t && g(D, C, true);
+ const t = _(P, C);
+ t && g(P, C);
+ const n = scrollSize(a);
+ const o = scrollSize(l);
+ const s = fractionalSize(l);
+ t && g(P, C, true);
return {
- w: e.w + n.w + s.w,
- h: e.h + n.h + s.h
+ w: o.w + n.w + s.w,
+ h: o.h + n.h + s.h
};
}));
- const b = f ? At : Lt.concat(At);
- const w = debounce(e, {
- p: () => s,
- v: () => o,
+ const p = u ? zt : At.concat(zt);
+ const b = debounce(o, {
+ v: () => s,
+ p: () => e,
m(t, n) {
- const [e] = t;
+ const [o] = t;
const [s] = n;
- return [ keys(e).concat(keys(s)).reduce(((t, n) => {
- t[n] = e[n] || s[n];
+ return [ keys(o).concat(keys(s)).reduce(((t, n) => {
+ t[n] = o[n] || s[n];
return t;
}), {}) ];
}
});
const updateViewportAttrsFromHost = t => {
- each(t || $t, (t => {
- if (indexOf($t, t) > -1) {
+ each(t || Ot, (t => {
+ if (indexOf(Ot, t) > -1) {
const n = attr(r, t);
if (isString(n)) {
- attr(a, t, n);
+ attr(l, t, n);
} else {
- removeAttr(a, t);
+ removeAttr(l, t);
}
}
}));
@@ -2063,28 +2039,28 @@ const createStructureSetupObservers = (t, n, e) => {
i({
dt: n
});
- e({
+ o({
_t: s
});
};
- const onSizeChanged = ({gt: t, Dt: n, zt: s}) => {
- const o = !t || s ? e : w;
+ const onSizeChanged = ({gt: t, Pt: n, Tt: s}) => {
+ const e = !t || s ? o : b;
let c = false;
if (n) {
- const [t, e] = n;
- c = e;
+ const [t, o] = n;
+ c = o;
i({
vt: t
});
}
- o({
+ e({
gt: t,
- bt: c
+ wt: c
});
};
const onContentMutation = t => {
- const [, n] = v();
- const s = t ? e : w;
+ const [, n] = w();
+ const s = t ? o : b;
if (n) {
s({
ht: true
@@ -2093,64 +2069,64 @@ const createStructureSetupObservers = (t, n, e) => {
};
const onHostMutation = (t, n) => {
if (n) {
- w({
+ b({
Ct: true
});
} else if (!d) {
updateViewportAttrsFromHost(t);
}
};
- const y = (l || !p) && createTrinsicObserver(r, onTrinsicChanged);
+ const y = (a || !v) && createTrinsicObserver(r, onTrinsicChanged);
const m = !d && createSizeObserver(r, onSizeChanged, {
- zt: true,
- Tt: !h
+ Tt: true,
+ It: !h
});
const [S] = createDOMObserver(r, false, onHostMutation, {
- Pt: Lt,
- Et: Lt.concat($t)
+ Mt: At,
+ Lt: At.concat(Ot)
});
- const x = d && new u(onSizeChanged.bind(0, {
+ const x = d && new f(onSizeChanged.bind(0, {
gt: true
}));
x && x.observe(r);
updateViewportAttrsFromHost();
return [ t => {
const [n] = t("updating.ignoreMutation");
- const [e, i] = t("updating.attributes");
- const [r, u] = t("updating.elementEvents");
- const [f, d] = t("updating.debounce");
- const _ = u || i;
+ const [o, i] = t("updating.attributes");
+ const [r, f] = t("updating.elementEvents");
+ const [u, d] = t("updating.debounce");
+ const _ = f || i;
const ignoreMutationFromOptions = t => isFunction(n) && n(t);
if (_) {
if (c) {
c[1]();
c[0]();
}
- c = createDOMObserver(l || a, true, onContentMutation, {
- Pt: b.concat(e || []),
- Et: b.concat(e || []),
- It: r,
- jt: Ct,
- Ht: (t, n) => {
- const {target: e, attributeName: s} = t;
- const o = !n && s ? liesBetween(e, Ct, Ot) : false;
- return o || !!ignoreMutationFromOptions(t);
+ c = createDOMObserver(a || l, true, onContentMutation, {
+ Mt: p.concat(o || []),
+ Lt: p.concat(o || []),
+ Ht: r,
+ Et: Ct,
+ Dt: (t, n) => {
+ const {target: o, attributeName: s} = t;
+ const e = !n && s ? liesBetween(o, Ct, $t) : false;
+ return e || !!ignoreMutationFromOptions(t);
}
});
}
if (d) {
- w.S();
- if (isArray(f)) {
- const t = f[0];
- const n = f[1];
+ b.S();
+ if (isArray(u)) {
+ const t = u[0];
+ const n = u[1];
s = isNumber(t) ? t : false;
- o = isNumber(n) ? n : false;
- } else if (isNumber(f)) {
- s = f;
- o = false;
+ e = isNumber(n) ? n : false;
+ } else if (isNumber(u)) {
+ s = u;
+ e = false;
} else {
s = false;
- o = false;
+ e = false;
}
}
}, () => {
@@ -2162,15 +2138,15 @@ const createStructureSetupObservers = (t, n, e) => {
} ];
};
-const Tt = {
+const It = {
A: {
t: 0,
r: 0,
b: 0,
l: 0
},
- wt: false,
- G: {
+ bt: false,
+ U: {
marginRight: 0,
marginBottom: 0,
marginLeft: 0,
@@ -2179,7 +2155,7 @@ const Tt = {
paddingBottom: 0,
paddingLeft: 0
},
- Ot: {
+ $t: {
x: 0,
y: 0
},
@@ -2187,7 +2163,7 @@ const Tt = {
x: "hidden",
y: "hidden"
},
- $t: {
+ Ot: {
x: false,
y: false
},
@@ -2196,125 +2172,125 @@ const Tt = {
};
const createStructureSetup = (t, n) => {
- const e = createOptionCheck(n, {});
- const s = createState(Tt);
- const [o, c, i] = createEventListenerHub();
+ const o = createOptionCheck(n, {});
+ const s = createState(It);
+ const [e, c, i] = createEventListenerHub();
const [r] = s;
- const [a, l, u] = createStructureSetupElements(t);
- const f = createStructureSetupUpdate(a, s);
- const [d, _] = createStructureSetupObservers(a, s, (t => {
- i("u", [ f(e, t), {}, false ]);
+ const [l, a, f] = createStructureSetupElements(t);
+ const u = createStructureSetupUpdate(l, s);
+ const [d, _] = createStructureSetupObservers(l, s, (t => {
+ i("u", [ u(o, t), {}, false ]);
}));
const g = r.bind(0);
- g.Nt = t => {
- o("u", t);
+ g.jt = t => {
+ e("u", t);
};
- g.Rt = l;
- g.Ft = a;
- return [ (t, e) => {
- const s = createOptionCheck(n, t, e);
+ g.Vt = a;
+ g.Bt = l;
+ return [ (t, o) => {
+ const s = createOptionCheck(n, t, o);
d(s);
- i("u", [ f(s, {}, e), t, !!e ]);
+ i("u", [ u(s, {}, o), t, !!o ]);
}, g, () => {
c();
_();
- u();
+ f();
} ];
};
const generateScrollbarDOM = t => {
- const n = createDiv(`${R} ${t}`);
- const e = createDiv(k);
- const s = createDiv(B);
- appendChildren(n, e);
- appendChildren(e, s);
+ const n = createDiv(`${V} ${t}`);
+ const o = createDiv(F);
+ const s = createDiv(Y);
+ appendChildren(n, o);
+ appendChildren(o, s);
return {
- Vt: n,
- kt: e,
- Bt: s
+ kt: n,
+ Ft: o,
+ Yt: s
};
};
const createScrollbarsSetupElements = (t, n) => {
- const {N: e} = getEnvironment();
- const {Ut: s} = e();
- const {Z: o, J: c, K: i, rt: r} = n;
- const a = !r && t.scrollbarsSlot;
- const l = dynamicInitializationElement([ o, c, i ], (() => c), s, a);
- const u = generateScrollbarDOM(F);
- const f = generateScrollbarDOM(V);
- const {Vt: d} = u;
- const {Vt: _} = f;
+ const {j: o} = getEnvironment();
+ const {qt: s} = o();
+ const {Z: e, J: c, K: i, rt: r} = n;
+ const l = !r && t.scrollbarsSlot;
+ const a = dynamicInitializationElement([ e, c, i ], (() => c), s, l);
+ const f = generateScrollbarDOM(B);
+ const u = generateScrollbarDOM(k);
+ const {kt: d} = f;
+ const {kt: _} = u;
const appendElements = () => {
- appendChildren(l, d);
- appendChildren(l, _);
+ appendChildren(a, d);
+ appendChildren(a, _);
};
return [ {
- Yt: u,
- qt: f
+ Gt: f,
+ Nt: u
}, appendElements, removeElements.bind(0, [ d, _ ]) ];
};
-const createScrollbarsSetup = (t, n, e) => {
+const createScrollbarsSetup = (t, n, o) => {
const s = createState({});
- const [o] = s;
- const [c, i, r] = createScrollbarsSetupElements(t, e);
- const a = o.bind(0);
- a.Ft = c;
- a.Rt = i;
- return [ (t, e) => {
- const s = createOptionCheck(n, t, e);
+ const [e] = s;
+ const [c, i, r] = createScrollbarsSetupElements(t, o);
+ const l = e.bind(0);
+ l.Bt = c;
+ l.Vt = i;
+ return [ (t, o) => {
+ const s = createOptionCheck(n, t, o);
console.log(s);
- }, a, () => {
+ }, l, () => {
r();
} ];
};
-const zt = new Set;
+const Tt = new Set;
-const Dt = new WeakMap;
+const Pt = new WeakMap;
const addInstance = (t, n) => {
- Dt.set(t, n);
- zt.add(t);
+ Pt.set(t, n);
+ Tt.add(t);
};
const removeInstance = t => {
- Dt.delete(t);
- zt.delete(t);
+ Pt.delete(t);
+ Tt.delete(t);
};
-const getInstance = t => Dt.get(t);
+const getInstance = t => Pt.get(t);
-const OverlayScrollbars = (t, n, e) => {
+const OverlayScrollbars = (t, n, o) => {
let s = false;
- const {F: o, D: c, H: i} = getEnvironment();
+ const {B: e, P: c, D: i} = getEnvironment();
const r = getPlugins();
- const a = isHTMLElement(t) ? t : t.target;
- const l = getInstance(a);
- if (l) {
- return l;
+ const l = isHTMLElement(t) ? t : t.target;
+ const a = getInstance(l);
+ if (a) {
+ return a;
}
- const u = r[ct];
+ const f = r[ct];
const validateOptions = t => {
const n = t || {};
- const e = u && u.U;
- return e ? e(n, true) : n;
+ const o = f && f.q;
+ return o ? o(n, true) : n;
};
- const f = assignDeep({}, o(), validateOptions(n));
- const [d, _, g] = createEventListenerHub(e);
- const [h, p, v] = createStructureSetup(t, f);
- const [b, w, y] = createScrollbarsSetup(t, f, p.Ft);
+ const u = assignDeep({}, e(), validateOptions(n));
+ const [d, _, g] = createEventListenerHub(o);
+ const [h, v, w] = createStructureSetup(t, u);
+ const [p, b, y] = createScrollbarsSetup(t, u, v.Bt);
const update = (t, n) => {
h(t, n);
- b(t, n);
+ p(t, n);
};
const m = i(update.bind(0, {}, true));
const destroy = t => {
- removeInstance(a);
+ removeInstance(l);
m();
y();
- v();
+ w();
s = true;
g("destroyed", [ S, !!t ]);
_();
@@ -2322,37 +2298,37 @@ const OverlayScrollbars = (t, n, e) => {
const S = {
options(t) {
if (t) {
- const n = getOptionsDiff(f, validateOptions(t));
+ const n = getOptionsDiff(u, validateOptions(t));
if (!isEmptyObject(n)) {
- assignDeep(f, n);
+ assignDeep(u, n);
update(n);
}
}
- return assignDeep({}, f);
+ return assignDeep({}, u);
},
on: d,
off: (t, n) => {
t && n && _(t, n);
},
state() {
- const {Ot: t, xt: n, $t: e, A: o, wt: c} = p();
+ const {$t: t, xt: n, Ot: o, A: e, bt: c} = v();
return assignDeep({}, {
overflowAmount: t,
overflowStyle: n,
- hasOverflow: e,
- padding: o,
+ hasOverflow: o,
+ padding: e,
paddingAbsolute: c,
destroyed: s
});
},
elements() {
- const {Z: t, J: n, A: e, K: s, L: o} = p.Ft;
+ const {Z: t, J: n, A: o, K: s, I: e} = v.Bt;
return assignDeep({}, {
target: t,
host: n,
- padding: e || s,
+ padding: o || s,
viewport: s,
- content: o || s
+ content: e || s
});
},
update(t) {
@@ -2367,28 +2343,28 @@ const OverlayScrollbars = (t, n, e) => {
n(OverlayScrollbars, S);
}
}));
- if (c.x && c.y && !f.nativeScrollbarsOverlaid.initialize) {
+ if (c.x && c.y && !u.nativeScrollbarsOverlaid.initialize) {
destroy(true);
return S;
}
- p.Rt();
- w.Rt();
- addInstance(a, S);
+ v.Vt();
+ b.Vt();
+ addInstance(l, S);
g("initialized", [ S ]);
- p.Nt(((t, n, e) => {
- const {gt: s, bt: o, _t: c, Lt: i, At: r, ht: a, Ct: l} = t;
+ v.jt(((t, n, o) => {
+ const {gt: s, wt: e, _t: c, At: i, zt: r, ht: l, Ct: a} = t;
g("updated", [ S, {
updateHints: {
sizeChanged: s,
- directionChanged: o,
+ directionChanged: e,
heightIntrinsicChanged: c,
overflowAmountChanged: i,
overflowStyleChanged: r,
- contentMutation: a,
- hostMutation: l
+ contentMutation: l,
+ hostMutation: a
},
changedOptions: n,
- force: e
+ force: o
} ]);
}));
return S.update(true);
@@ -2397,22 +2373,22 @@ const OverlayScrollbars = (t, n, e) => {
OverlayScrollbars.plugin = addPlugin;
OverlayScrollbars.env = () => {
- const {T: t, D: n, P: e, j: s, M: o, I: c, k: i, B: r, N: a, R: l, F: u, V: f} = getEnvironment();
+ const {T: t, P: n, L: o, H: s, R: e, M: c, F: i, Y: r, j: l, V: a, B: f, k: u} = getEnvironment();
return assignDeep({}, {
scrollbarsSize: t,
scrollbarsOverlaid: n,
- scrollbarsHiding: e,
+ scrollbarsHiding: o,
rtlScrollBehavior: s,
- flexboxGlue: o,
+ flexboxGlue: e,
cssCustomProperties: c,
defaultInitializationStrategy: i,
defaultDefaultOptions: r,
- getInitializationStrategy: a,
- setInitializationStrategy: l,
- getDefaultOptions: u,
- setDefaultOptions: f
+ getInitializationStrategy: l,
+ setInitializationStrategy: a,
+ getDefaultOptions: f,
+ setDefaultOptions: u
});
};
-export { OverlayScrollbars, it as optionsValidationPlugin, _t as scrollbarsHidingPlugin, ut as sizeObserverPlugin };
+export { OverlayScrollbars, it as optionsValidationPlugin, _t as scrollbarsHidingPlugin, ft as sizeObserverPlugin };
//# sourceMappingURL=overlayscrollbars.esm.js.map
diff --git a/packages/overlayscrollbars/dist/overlayscrollbars.esm.js.map b/packages/overlayscrollbars/dist/overlayscrollbars.esm.js.map
index 9427401..dc11e13 100644
--- a/packages/overlayscrollbars/dist/overlayscrollbars.esm.js.map
+++ b/packages/overlayscrollbars/dist/overlayscrollbars.esm.js.map
@@ -1 +1 @@
-{"version":3,"file":"overlayscrollbars.esm.js","sources":["../src/support/cache.ts","../src/support/utils/types.ts","../src/support/utils/array.ts","../src/support/utils/object.ts","../src/support/dom/attribute.ts","../src/support/dom/style.ts","../src/support/dom/traversal.ts","../src/support/dom/manipulation.ts","../src/support/dom/create.ts","../src/support/compatibility/vendors.ts","../src/support/compatibility/apis.ts","../src/support/dom/class.ts","../src/support/utils/equal.ts","../src/support/utils/function.ts","../src/support/dom/dimensions.ts","../src/support/dom/events.ts","../src/support/dom/offset.ts","../src/support/eventListeners.ts","../src/setups/setups.ts","../src/classnames.ts","../src/options.ts","../src/environment.ts","../src/plugins/plugins.ts","../../../node_modules/@babel/runtime/helpers/extends.js","../src/plugins/optionsValidationPlugin/validation.ts","../src/plugins/optionsValidationPlugin/optionsValidationPlugin.ts","../src/plugins/sizeObserverPlugin/sizeObserverPlugin.ts","../src/plugins/scrollbarsHidingPlugin/scrollbarsHidingPlugin.ts","../src/initialization.ts","../src/setups/structureSetup/structureSetup.elements.ts","../src/setups/structureSetup/updateSegments/trinsicUpdateSegment.ts","../src/setups/structureSetup/updateSegments/paddingUpdateSegment.ts","../src/setups/structureSetup/updateSegments/overflowUpdateSegment.ts","../src/setups/structureSetup/structureSetup.update.ts","../src/observers/sizeObserver.ts","../src/observers/trinsicObserver.ts","../src/observers/domObserver.ts","../src/setups/structureSetup/structureSetup.observers.ts","../src/setups/structureSetup/structureSetup.ts","../src/setups/scrollbarsSetup/scrollbarsSetup.elements.ts","../src/setups/scrollbarsSetup/scrollbarsSetup.ts","../src/instances.ts","../src/overlayscrollbars.ts"],"sourcesContent":["export interface CacheOptions {\r\n // initial value of _value.\r\n _initialValue: Value;\r\n // Custom comparison function if shallow compare isn't enough. Returns true if nothing changed.\r\n _equal?: EqualCachePropFunction;\r\n // If true always updates _value and _previous, otherwise they update only when they changed.\r\n _alwaysUpdateValues?: boolean;\r\n}\r\n\r\nexport type CacheValues = [value: T, changed: boolean, previous?: T];\r\n\r\nexport type EqualCachePropFunction = (currentVal: Value, newVal: Value) => boolean;\r\n\r\nexport type CacheUpdater = (current: Value, previous?: Value) => Value;\r\n\r\nexport type UpdateCacheContextual = (newValue: Value, force?: boolean) => CacheValues;\r\n\r\nexport type UpdateCache = (force?: boolean) => CacheValues;\r\n\r\nexport type GetCurrentCache = (force?: boolean) => CacheValues;\r\n\r\nexport type Cache = [UpdateCache, GetCurrentCache];\r\n\r\nexport type CacheContextual = [UpdateCacheContextual, GetCurrentCache];\r\n\r\nexport function createCache(options: CacheOptions): CacheContextual;\r\nexport function createCache(\r\n options: CacheOptions,\r\n update: CacheUpdater\r\n): Cache;\r\nexport function createCache(\r\n options: CacheOptions,\r\n update?: CacheUpdater\r\n): CacheContextual | Cache {\r\n const { _initialValue, _equal, _alwaysUpdateValues } = options;\r\n let _value: Value = _initialValue;\r\n let _previous: Value | undefined;\r\n\r\n const cacheUpdateContextual: UpdateCacheContextual = (newValue, force?) => {\r\n const curr = _value;\r\n\r\n const newVal = newValue;\r\n const changed = force || (_equal ? !_equal(curr, newVal) : curr !== newVal);\r\n\r\n if (changed || _alwaysUpdateValues) {\r\n _value = newVal;\r\n _previous = curr;\r\n }\r\n\r\n return [_value, changed, _previous];\r\n };\r\n const cacheUpdateIsolated: UpdateCache = (force?) =>\r\n cacheUpdateContextual(update!(_value, _previous), force);\r\n\r\n const getCurrentCache: GetCurrentCache = (force?: boolean) => [\r\n _value,\r\n !!force, // changed\r\n _previous,\r\n ];\r\n\r\n return [update ? cacheUpdateIsolated : cacheUpdateContextual, getCurrentCache] as\r\n | CacheContextual\r\n | Cache;\r\n}\r\n","import { PlainObject } from 'typings';\r\n\r\nconst ElementNodeType = Node.ELEMENT_NODE;\r\nconst { toString, hasOwnProperty } = Object.prototype;\r\n\r\nexport function isUndefined(obj: any): obj is undefined {\r\n return obj === undefined;\r\n}\r\n\r\nexport function isNull(obj: any): obj is null {\r\n return obj === null;\r\n}\r\n\r\nexport const type: (obj: any) => string = (obj) =>\r\n isUndefined(obj) || isNull(obj)\r\n ? `${obj}`\r\n : toString\r\n .call(obj)\r\n .replace(/^\\[object (.+)\\]$/, '$1')\r\n .toLowerCase();\r\n\r\nexport function isNumber(obj: any): obj is number {\r\n return typeof obj === 'number';\r\n}\r\n\r\nexport function isString(obj: any): obj is string {\r\n return typeof obj === 'string';\r\n}\r\n\r\nexport function isBoolean(obj: any): obj is boolean {\r\n return typeof obj === 'boolean';\r\n}\r\n\r\nexport function isFunction(obj: any): obj is (...args: any[]) => any {\r\n return typeof obj === 'function';\r\n}\r\n\r\nexport function isArray(obj: any): obj is Array {\r\n return Array.isArray(obj);\r\n}\r\n\r\nexport function isObject(obj: any): boolean {\r\n return typeof obj === 'object' && !isArray(obj) && !isNull(obj);\r\n}\r\n\r\n/**\r\n * Returns true if the given object is array like, false otherwise.\r\n * @param obj The Object\r\n */\r\nexport function isArrayLike(obj: any): obj is ArrayLike {\r\n const length = !!obj && obj.length;\r\n const lengthCorrectFormat = isNumber(length) && length > -1 && length % 1 == 0; // eslint-disable-line eqeqeq\r\n\r\n return isArray(obj) || (!isFunction(obj) && lengthCorrectFormat)\r\n ? length > 0 && isObject(obj)\r\n ? length - 1 in obj\r\n : true\r\n : false;\r\n}\r\n\r\n/**\r\n * Returns true if the given object is a \"plain\" (e.g. { key: value }) object, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport function isPlainObject(obj: any): obj is PlainObject {\r\n if (!obj || !isObject(obj) || type(obj) !== 'object') return false;\r\n\r\n let key;\r\n const cstr = 'constructor';\r\n const ctor = obj[cstr];\r\n const ctorProto = ctor && ctor.prototype;\r\n const hasOwnConstructor = hasOwnProperty.call(obj, cstr);\r\n const hasIsPrototypeOf = ctorProto && hasOwnProperty.call(ctorProto, 'isPrototypeOf');\r\n\r\n if (ctor && !hasOwnConstructor && !hasIsPrototypeOf) {\r\n return false;\r\n }\r\n\r\n /* eslint-disable no-restricted-syntax */\r\n for (key in obj) {\r\n /**/\r\n }\r\n /* eslint-enable */\r\n\r\n return isUndefined(key) || hasOwnProperty.call(obj, key);\r\n}\r\n\r\n/**\r\n * Checks whether the given object is a HTMLElement.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport function isHTMLElement(obj: any): obj is HTMLElement {\r\n const instanceofObj = window.HTMLElement;\r\n return obj\r\n ? instanceofObj\r\n ? obj instanceof instanceofObj\r\n : obj.nodeType === ElementNodeType\r\n : false;\r\n}\r\n\r\n/**\r\n * Checks whether the given object is a Element.\r\n * @param obj The object which shall be checked.\r\n */\r\nexport function isElement(obj: any): obj is Element {\r\n const instanceofObj = window.Element;\r\n return obj\r\n ? instanceofObj\r\n ? obj instanceof instanceofObj\r\n : obj.nodeType === ElementNodeType\r\n : false;\r\n}\r\n","import { isArrayLike, isString } from 'support/utils/types';\r\nimport { PlainObject } from 'typings';\r\n\r\ntype RunEachItem = ((...args: any) => any | any[]) | null | undefined;\r\n\r\n/**\r\n * Iterates through a array or object\r\n * @param arrayLikeOrObject The array or object through which shall be iterated.\r\n * @param callback The function which is responsible for the iteration.\r\n * If the function returns true its treated like a \"continue\" statement.\r\n * If the function returns false its treated like a \"break\" statement.\r\n */\r\nexport function each(\r\n array: Array | ReadonlyArray,\r\n callback: (value: T, indexOrKey: number, source: Array) => boolean | unknown\r\n): Array | ReadonlyArray;\r\nexport function each(\r\n array: Array | ReadonlyArray | null | undefined,\r\n callback: (value: T, indexOrKey: number, source: Array) => boolean | unknown\r\n): Array | ReadonlyArray | null | undefined;\r\nexport function each(\r\n arrayLikeObject: ArrayLike,\r\n callback: (value: T, indexOrKey: number, source: ArrayLike) => boolean | unknown\r\n): ArrayLike;\r\nexport function each(\r\n arrayLikeObject: ArrayLike | null | undefined,\r\n callback: (value: T, indexOrKey: number, source: ArrayLike) => boolean | unknown\r\n): ArrayLike | null | undefined;\r\nexport function each(\r\n obj: PlainObject,\r\n callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | unknown\r\n): PlainObject;\r\nexport function each(\r\n obj: PlainObject | null | undefined,\r\n callback: (value: any, indexOrKey: string, source: PlainObject) => boolean | unknown\r\n): PlainObject | null | undefined;\r\nexport function each(\r\n source: ArrayLike | PlainObject | null | undefined,\r\n callback: (value: T, indexOrKey: any, source: any) => boolean | unknown\r\n): Array | ReadonlyArray | ArrayLike | PlainObject | null | undefined {\r\n if (isArrayLike(source)) {\r\n for (let i = 0; i < source.length; i++) {\r\n if (callback(source[i], i, source) === false) {\r\n break;\r\n }\r\n }\r\n } else if (source) {\r\n each(Object.keys(source), (key) => callback(source[key], key, source));\r\n }\r\n return source;\r\n}\r\n\r\n/**\r\n * Returns the index of the given inside the given array or -1 if the given item isn't part of the given array.\r\n * @param arr The array.\r\n * @param item The item.\r\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\r\n */\r\nexport const indexOf = (arr: T[], item: T, fromIndex?: number): number =>\r\n arr.indexOf(item, fromIndex);\r\n\r\n/**\r\n * Pushesh all given items into the given array and returns it.\r\n * @param array The array the items shall be pushed into.\r\n * @param items The items which shall be pushed into the array.\r\n */\r\nexport const push = (array: T[], items: T | ArrayLike, arrayIsSingleItem?: boolean): T[] => {\r\n !arrayIsSingleItem && !isString(items) && isArrayLike(items)\r\n ? Array.prototype.push.apply(array, items as T[])\r\n : array.push(items as T);\r\n return array;\r\n};\r\n\r\n/**\r\n * Creates a shallow-copied Array instance from an array-like or iterable object.\r\n * @param arr The object from which the array instance shall be created.\r\n */\r\nexport const from = (arr?: ArrayLike | Set) => {\r\n if (Array.from && arr) {\r\n return Array.from(arr);\r\n }\r\n const result: T[] = [];\r\n\r\n if (arr instanceof Set) {\r\n arr.forEach((value) => {\r\n push(result, value);\r\n });\r\n } else {\r\n each(arr, (elm) => {\r\n push(result, elm);\r\n });\r\n }\r\n\r\n return result;\r\n};\r\n\r\n/**\r\n * Check whether the passed array is empty.\r\n * @param array The array which shall be checked.\r\n */\r\nexport const isEmptyArray = (array: any[] | null | undefined): boolean =>\r\n !!array && array.length === 0;\r\n\r\n/**\r\n * Calls all functions in the passed array/set of functions.\r\n * @param arr The array filled with function which shall be called.\r\n * @param args The args with which each function is called.\r\n * @param keep True when the Set / array should not be cleared afterwards, false otherwise.\r\n */\r\nexport const runEachAndClear = (\r\n arr: ArrayLike | Set,\r\n args?: any[],\r\n keep?: boolean\r\n): void => {\r\n // eslint-disable-next-line prefer-spread\r\n const runFn = (fn: RunEachItem) => fn && fn.apply(undefined, args || []);\r\n if (arr instanceof Set) {\r\n arr.forEach(runFn);\r\n !keep && arr.clear();\r\n } else {\r\n each(arr, runFn);\r\n !keep && (arr as any[]).splice && (arr as any[]).splice(0, arr.length);\r\n }\r\n};\r\n","import { isArray, isFunction, isPlainObject, isNull } from 'support/utils/types';\r\nimport { each } from 'support/utils/array';\r\n\r\n/**\r\n * Determines whether the passed object has a property with the passed name.\r\n * @param obj The object.\r\n * @param prop The name of the property.\r\n */\r\nexport const hasOwnProperty = (obj: any, prop: string | number | symbol): boolean =>\r\n Object.prototype.hasOwnProperty.call(obj, prop);\r\n\r\n/**\r\n * Returns the names of the enumerable string properties and methods of an object.\r\n * @param obj The object of which the properties shall be returned.\r\n */\r\nexport const keys = (obj: any): Array => (obj ? Object.keys(obj) : []);\r\n\r\n// https://github.com/jquery/jquery/blob/master/src/core.js#L116\r\nexport function assignDeep(target: T, object1: U): T & U;\r\nexport function assignDeep(target: T, object1: U, object2: V): T & U & V;\r\nexport function assignDeep(\r\n target: T,\r\n object1: U,\r\n object2: V,\r\n object3: W\r\n): T & U & V & W;\r\nexport function assignDeep(\r\n target: T,\r\n object1: U,\r\n object2: V,\r\n object3: W,\r\n object4: X\r\n): T & U & V & W & X;\r\nexport function assignDeep(\r\n target: T,\r\n object1: U,\r\n object2: V,\r\n object3: W,\r\n object4: X,\r\n object5: Y\r\n): T & U & V & W & X & Y;\r\nexport function assignDeep(\r\n target: T,\r\n object1?: U,\r\n object2?: V,\r\n object3?: W,\r\n object4?: X,\r\n object5?: Y,\r\n object6?: Z\r\n): T & U & V & W & X & Y & Z {\r\n const sources: Array = [object1, object2, object3, object4, object5, object6];\r\n\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if ((typeof target !== 'object' || isNull(target)) && !isFunction(target)) {\r\n target = {} as T;\r\n }\r\n\r\n each(sources, (source) => {\r\n // Extend the base object\r\n each(keys(source), (key) => {\r\n const copy: any = source[key];\r\n\r\n // Prevent Object.prototype pollution\r\n // Prevent never-ending loop\r\n if (target === copy) {\r\n return true;\r\n }\r\n\r\n const copyIsArray = isArray(copy);\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (copy && (isPlainObject(copy) || copyIsArray)) {\r\n const src = target[key];\r\n let clone: any = src;\r\n\r\n // Ensure proper type for the source value\r\n if (copyIsArray && !isArray(src)) {\r\n clone = [];\r\n } else if (!copyIsArray && !isPlainObject(src)) {\r\n clone = {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[key] = assignDeep(clone, copy) as any;\r\n } else {\r\n target[key] = copy;\r\n }\r\n });\r\n });\r\n\r\n // Return the modified object\r\n return target as any;\r\n}\r\n\r\n/**\r\n * Returns true if the given object is empty, false otherwise.\r\n * @param obj The Object.\r\n */\r\nexport function isEmptyObject(obj: any): boolean {\r\n /* eslint-disable no-restricted-syntax, guard-for-in */\r\n for (const name in obj) return false;\r\n return true;\r\n /* eslint-enable */\r\n}\r\n","import { from } from 'support/utils/array';\r\nimport { isUndefined } from 'support/utils/types';\r\n\r\ntype GetSetPropName = 'scrollLeft' | 'scrollTop' | 'value';\r\n\r\nfunction getSetProp(\r\n topLeft: GetSetPropName,\r\n fallback: number | string,\r\n elm: HTMLElement | HTMLInputElement | false | null | undefined,\r\n value?: number | string\r\n): number | string | void {\r\n if (isUndefined(value)) {\r\n return elm ? elm[topLeft] : fallback;\r\n }\r\n elm && (elm[topLeft] = value);\r\n}\r\n\r\n/**\r\n * Gets or sets a attribute with the given attribute of the given element depending whether the value attribute is given.\r\n * Returns null if the element has no attribute with the given name.\r\n * @param elm The element of which the attribute shall be get or set.\r\n * @param attrName The attribute name which shall be get or set.\r\n * @param value The value of the attribute which shall be set.\r\n */\r\nexport function attr(elm: HTMLElement | false | null | undefined, attrName: string): string | null;\r\nexport function attr(\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value: string\r\n): void;\r\nexport function attr(\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value?: string\r\n): string | null | void {\r\n if (isUndefined(value)) {\r\n return elm ? elm.getAttribute(attrName) : null;\r\n }\r\n elm && elm.setAttribute(attrName, value);\r\n}\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and adds or removes the given value from it.\r\n * @param elm The element.\r\n * @param attrName The attributeName to which the value shall be added or removed.\r\n * @param value The value which shall be added or removed.\r\n * @param add True if the value shall be added, false otherwise.\r\n */\r\nexport const attrClass = (\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value: string,\r\n add?: boolean\r\n) => {\r\n const currValues = attr(elm, attrName) || '';\r\n const currValuesSet = new Set(currValues.split(' '));\r\n currValuesSet[add ? 'add' : 'delete'](value);\r\n\r\n attr(elm, attrName, from(currValuesSet).join(' ').trim());\r\n};\r\n\r\n/**\r\n * Treats the given attribute like the \"class\" attribute and checks if the given value is in it.\r\n * @param elm The element.\r\n * @param attrName The attributeName from which the content shall be checked.\r\n * @param value The value.\r\n * @returns True if the given attribute has the value in it, false otherwise.\r\n */\r\nexport const hasAttrClass = (\r\n elm: HTMLElement | false | null | undefined,\r\n attrName: string,\r\n value: string\r\n) => {\r\n const currValues = attr(elm, attrName) || '';\r\n const currValuesSet = new Set(currValues.split(' '));\r\n return currValuesSet.has(value);\r\n};\r\n\r\n/**\r\n * Removes the given attribute from the given element.\r\n * @param elm The element of which the attribute shall be removed.\r\n * @param attrName The attribute name.\r\n */\r\nexport const removeAttr = (elm: Element | false | null | undefined, attrName: string): void => {\r\n elm && elm.removeAttribute(attrName);\r\n};\r\n\r\n/**\r\n * Gets or sets the scrollLeft value of the given element depending whether the value attribute is given.\r\n * @param elm The element of which the scrollLeft value shall be get or set.\r\n * @param value The scrollLeft value which shall be set.\r\n */\r\nexport function scrollLeft(elm: HTMLElement | false | null | undefined): number;\r\nexport function scrollLeft(elm: HTMLElement | false | null | undefined, value: number): void;\r\nexport function scrollLeft(\r\n elm: HTMLElement | false | null | undefined,\r\n value?: number\r\n): number | void {\r\n return getSetProp('scrollLeft', 0, elm, value) as number;\r\n}\r\n\r\n/**\r\n * Gets or sets the scrollTop value of the given element depending whether the value attribute is given.\r\n * @param elm The element of which the scrollTop value shall be get or set.\r\n * @param value The scrollTop value which shall be set.\r\n */\r\nexport function scrollTop(elm: HTMLElement | false | null | undefined): number;\r\nexport function scrollTop(elm: HTMLElement | false | null | undefined, value: number): void;\r\nexport function scrollTop(\r\n elm: HTMLElement | false | null | undefined,\r\n value?: number\r\n): number | void {\r\n return getSetProp('scrollTop', 0, elm, value) as number;\r\n}\r\n\r\n/**\r\n * Gets or sets the value of the given input element depending whether the value attribute is given.\r\n * @param elm The input element of which the value shall be get or set.\r\n * @param value The value which shall be set.\r\n */\r\nexport function val(elm: HTMLInputElement | false | null | undefined): string;\r\nexport function val(elm: HTMLInputElement | false | null | undefined, value: string): void;\r\nexport function val(\r\n elm: HTMLInputElement | false | null | undefined,\r\n value?: string\r\n): string | void {\r\n return getSetProp('value', '', elm, value) as string;\r\n}\r\n","import { each, keys } from 'support/utils';\r\nimport { isString, isNumber, isArray, isUndefined } from 'support/utils/types';\r\nimport { PlainObject, StyleObject } from 'typings';\r\n\r\nexport interface TRBL {\r\n t: number;\r\n r: number;\r\n b: number;\r\n l: number;\r\n}\r\n\r\nconst cssNumber = {\r\n // animationiterationcount: 1,\r\n // columncount: 1,\r\n // fillopacity: 1,\r\n // flexgrow: 1,\r\n // flexshrink: 1,\r\n // fontweight: 1,\r\n // lineheight: 1,\r\n // order: 1,\r\n // orphans: 1,\r\n // widows: 1,\r\n // zoom: 1,\r\n opacity: 1,\r\n zindex: 1,\r\n};\r\n\r\nconst parseToZeroOrNumber = (value: string, toFloat?: boolean): number => {\r\n /* istanbul ignore next */\r\n const num = toFloat ? parseFloat(value) : parseInt(value, 10);\r\n /* istanbul ignore next */\r\n return Number.isNaN(num) ? 0 : num;\r\n};\r\nconst adaptCSSVal = (prop: string, val: string | number): string | number =>\r\n !cssNumber[prop.toLowerCase()] && isNumber(val) ? `${val}px` : val;\r\nconst getCSSVal = (elm: HTMLElement, computedStyle: CSSStyleDeclaration, prop: string): string =>\r\n /* istanbul ignore next */\r\n computedStyle != null\r\n ? computedStyle[prop] || computedStyle.getPropertyValue(prop)\r\n : elm.style[prop];\r\nconst setCSSVal = (\r\n elm: HTMLElement | false | null | undefined,\r\n prop: string,\r\n val: string | number\r\n): void => {\r\n try {\r\n if (elm) {\r\n const { style: elmStyle } = elm;\r\n if (!isUndefined(elmStyle[prop])) {\r\n elmStyle[prop] = adaptCSSVal(prop, val);\r\n } else {\r\n elmStyle.setProperty(prop, val as string);\r\n }\r\n }\r\n } catch (e) {}\r\n};\r\n\r\n/**\r\n * Gets or sets the passed styles to the passed element.\r\n * @param elm The element to which the styles shall be applied to / be read from.\r\n * @param styles The styles which shall be set or read.\r\n */\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: StyleObject\r\n): void;\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: string\r\n): string;\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: Array | string\r\n): { [key: string]: string };\r\nexport function style(\r\n elm: HTMLElement | false | null | undefined,\r\n styles: StyleObject | Array | string\r\n): { [key: string]: string } | string | void {\r\n const getSingleStyle = isString(styles);\r\n const getStyles = isArray(styles) || getSingleStyle;\r\n\r\n if (getStyles) {\r\n let getStylesResult: string | PlainObject = getSingleStyle ? '' : {};\r\n if (elm) {\r\n const computedStyle: CSSStyleDeclaration = window.getComputedStyle(elm, null);\r\n getStylesResult = getSingleStyle\r\n ? getCSSVal(elm, computedStyle, styles as string)\r\n : (styles as Array).reduce((result, key) => {\r\n result[key] = getCSSVal(elm, computedStyle, key as string);\r\n return result;\r\n }, getStylesResult);\r\n }\r\n return getStylesResult;\r\n }\r\n each(keys(styles), (key) => setCSSVal(elm, key, styles[key]));\r\n}\r\n\r\n/**\r\n * Hides the passed element (display: none).\r\n * @param elm The element which shall be hidden.\r\n */\r\nexport const hide = (elm: HTMLElement | false | null | undefined): void => {\r\n style(elm, { display: 'none' });\r\n};\r\n\r\n/**\r\n * Shows the passed element (display: block).\r\n * @param elm The element which shall be shown.\r\n */\r\nexport const show = (elm: HTMLElement | false | null | undefined): void => {\r\n style(elm, { display: 'block' });\r\n};\r\n\r\n/**\r\n * Returns the top right bottom left values of the passed css property.\r\n * @param elm The element of which the values shall be returned.\r\n * @param propertyPrefix The css property prefix. (e.g. \"border\")\r\n * @param propertySuffix The css property suffix. (e.g. \"width\")\r\n */\r\nexport const topRightBottomLeft = (\r\n elm?: HTMLElement | false | null | undefined,\r\n propertyPrefix?: string,\r\n propertySuffix?: string\r\n): TRBL => {\r\n const finalPrefix = propertyPrefix ? `${propertyPrefix}-` : '';\r\n const finalSuffix = propertySuffix ? `-${propertySuffix}` : '';\r\n const top = `${finalPrefix}top${finalSuffix}`;\r\n const right = `${finalPrefix}right${finalSuffix}`;\r\n const bottom = `${finalPrefix}bottom${finalSuffix}`;\r\n const left = `${finalPrefix}left${finalSuffix}`;\r\n const result = style(elm, [top, right, bottom, left]);\r\n return {\r\n t: parseToZeroOrNumber(result[top]),\r\n r: parseToZeroOrNumber(result[right]),\r\n b: parseToZeroOrNumber(result[bottom]),\r\n l: parseToZeroOrNumber(result[left]),\r\n };\r\n};\r\n","import { isElement } from 'support/utils/types';\r\nimport { push, from } from 'support/utils/array';\r\n\r\ntype InputElementType = Element | Node | false | null | undefined;\r\ntype OutputElementType = Element | null;\r\n\r\nconst elmPrototype = Element.prototype;\r\n\r\n/**\r\n * Find all elements with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nconst find = (selector: string, elm?: InputElementType): Element[] => {\r\n const arr: Array = [];\r\n const rootElm = elm ? (isElement(elm) ? elm : null) : document;\r\n\r\n return rootElm ? push(arr, rootElm.querySelectorAll(selector)) : arr;\r\n};\r\n\r\n/**\r\n * Find the first element with the passed selector, outgoing (and including) the passed element or the document if no element was provided.\r\n * @param selector The selector which has to be searched by.\r\n * @param elm The element from which the search shall be outgoing.\r\n */\r\nconst findFirst = (selector: string, elm?: InputElementType): OutputElementType => {\r\n const rootElm = elm ? (isElement(elm) ? elm : null) : document;\r\n\r\n return rootElm ? rootElm.querySelector(selector) : null;\r\n};\r\n\r\n/**\r\n * Determines whether the passed element is matching with the passed selector.\r\n * @param elm The element which has to be compared with the passed selector.\r\n * @param selector The selector which has to be compared with the passed element. Additional selectors: ':visible' and ':hidden'.\r\n */\r\nconst is = (elm: InputElementType, selector: string): boolean => {\r\n if (isElement(elm)) {\r\n /* istanbul ignore next */\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const fn: (...args: any) => boolean = elmPrototype.matches || elmPrototype.msMatchesSelector;\r\n return fn.call(elm, selector);\r\n }\r\n return false;\r\n};\r\n\r\n/**\r\n * Returns the children (no text-nodes or comments) of the passed element which are matching the passed selector. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the children shall be returned.\r\n * @param selector The selector which must match with the children elements.\r\n */\r\nconst children = (elm: InputElementType, selector?: string): ReadonlyArray => {\r\n const childs: Array = [];\r\n\r\n return isElement(elm)\r\n ? push(\r\n childs,\r\n from(elm.children).filter((child) => (selector ? is(child, selector) : child))\r\n )\r\n : childs;\r\n};\r\n\r\n/**\r\n * Returns the childNodes (incl. text-nodes or comments etc.) of the passed element. An empty array is returned if the passed element is null.\r\n * @param elm The element of which the childNodes shall be returned.\r\n */\r\nconst contents = (elm: InputElementType): ReadonlyArray =>\r\n elm ? from(elm.childNodes) : [];\r\n\r\n/**\r\n * Returns the parent element of the passed element, or null if the passed element is null.\r\n * @param elm The element of which the parent element shall be returned.\r\n */\r\nconst parent = (elm: InputElementType): OutputElementType => (elm ? elm.parentElement : null);\r\n\r\nconst closest = (elm: InputElementType, selector: string): OutputElementType => {\r\n if (isElement(elm)) {\r\n const closestFn = elmPrototype.closest;\r\n if (closestFn) {\r\n return closestFn.call(elm, selector);\r\n }\r\n\r\n do {\r\n if (is(elm, selector)) {\r\n return elm as Element;\r\n }\r\n elm = parent(elm);\r\n } while (elm);\r\n }\r\n\r\n return null;\r\n};\r\n\r\n/**\r\n * Determines whether the given element lies between two selectors in the DOM.\r\n * @param elm The element.\r\n * @param highBoundarySelector The high boundary selector.\r\n * @param deepBoundarySelector The deep boundary selector.\r\n */\r\nconst liesBetween = (\r\n elm: InputElementType,\r\n highBoundarySelector: string,\r\n deepBoundarySelector: string\r\n): boolean => {\r\n const closestHighBoundaryElm = elm && closest(elm, highBoundarySelector);\r\n const closestDeepBoundaryElm = elm && findFirst(deepBoundarySelector, closestHighBoundaryElm);\r\n\r\n return closestHighBoundaryElm && closestDeepBoundaryElm\r\n ? closestHighBoundaryElm === elm ||\r\n closestDeepBoundaryElm === elm ||\r\n closest(closest(elm, deepBoundarySelector), highBoundarySelector) !== closestHighBoundaryElm\r\n : false;\r\n};\r\n\r\nexport { find, findFirst, is, children, contents, parent, liesBetween };\r\n","import { isArrayLike } from 'support/utils/types';\r\nimport { each, from } from 'support/utils/array';\r\nimport { parent } from 'support/dom/traversal';\r\n\r\ntype NodeCollection = ArrayLike | Node | false | null | undefined;\r\n\r\n/**\r\n * Inserts Nodes before the given preferredAnchor element.\r\n * @param parentElm The parent of the preferredAnchor element or the element which shall be the parent of the inserted Nodes.\r\n * @param preferredAnchor The element before which the Nodes shall be inserted or null if the elements shall be appended at the end.\r\n * @param insertedElms The Nodes which shall be inserted.\r\n */\r\nconst before = (\r\n parentElm: Node | false | null | undefined,\r\n preferredAnchor: Node | false | null | undefined,\r\n insertedElms: NodeCollection\r\n): void => {\r\n if (insertedElms) {\r\n let anchor: Node | false | null | undefined = preferredAnchor;\r\n let fragment: DocumentFragment | Node | null | undefined;\r\n\r\n // parent must be defined\r\n if (parentElm) {\r\n if (isArrayLike(insertedElms)) {\r\n fragment = document.createDocumentFragment();\r\n\r\n // append all insertedElms to the fragment and if one of these is the anchor, change the anchor\r\n each(insertedElms, (insertedElm) => {\r\n if (insertedElm === anchor) {\r\n anchor = insertedElm.previousSibling;\r\n }\r\n fragment!.appendChild(insertedElm);\r\n });\r\n } else {\r\n fragment = insertedElms;\r\n }\r\n\r\n // if the preferred anchor isn't null set it to a valid anchor\r\n if (preferredAnchor) {\r\n if (!anchor) {\r\n anchor = parentElm.firstChild;\r\n } else if (anchor !== preferredAnchor) {\r\n anchor = anchor.nextSibling;\r\n }\r\n }\r\n\r\n parentElm.insertBefore(fragment, anchor || null);\r\n }\r\n }\r\n};\r\n\r\n/**\r\n * Appends the given children at the end of the given Node.\r\n * @param node The Node to which the children shall be appended.\r\n * @param children The Nodes which shall be appended.\r\n */\r\nexport const appendChildren = (\r\n node: Node | false | null | undefined,\r\n children: NodeCollection\r\n): void => {\r\n before(node, null, children);\r\n};\r\n\r\n/**\r\n * Prepends the given children at the start of the given Node.\r\n * @param node The Node to which the children shall be prepended.\r\n * @param children The Nodes which shall be prepended.\r\n */\r\nexport const prependChildren = (\r\n node: Node | false | null | undefined,\r\n children: NodeCollection\r\n): void => {\r\n before(node, node && node.firstChild, children);\r\n};\r\n\r\n/**\r\n * Inserts the given Nodes before the given Node.\r\n * @param node The Node before which the given Nodes shall be inserted.\r\n * @param insertedNodes The Nodes which shall be inserted.\r\n */\r\nexport const insertBefore = (\r\n node: Node | false | null | undefined,\r\n insertedNodes: NodeCollection\r\n): void => {\r\n before(parent(node), node, insertedNodes);\r\n};\r\n\r\n/**\r\n * Inserts the given Nodes after the given Node.\r\n * @param node The Node after which the given Nodes shall be inserted.\r\n * @param insertedNodes The Nodes which shall be inserted.\r\n */\r\nexport const insertAfter = (\r\n node: Node | false | null | undefined,\r\n insertedNodes: NodeCollection\r\n): void => {\r\n before(parent(node), node && node.nextSibling, insertedNodes);\r\n};\r\n\r\n/**\r\n * Removes the given Nodes from their parent.\r\n * @param nodes The Nodes which shall be removed.\r\n */\r\nexport const removeElements = (nodes: NodeCollection): void => {\r\n if (isArrayLike(nodes)) {\r\n each(from(nodes), (e) => removeElements(e));\r\n } else if (nodes) {\r\n const parentElm = parent(nodes);\r\n if (parentElm) {\r\n parentElm.removeChild(nodes);\r\n }\r\n }\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { attr } from 'support/dom/attribute';\r\nimport { contents } from 'support/dom/traversal';\r\nimport { removeElements } from 'support/dom/manipulation';\r\n\r\n/**\r\n * Creates a div DOM node.\r\n */\r\nexport const createDiv = (classNames?: string): HTMLDivElement => {\r\n const div = document.createElement('div');\r\n if (classNames) {\r\n attr(div, 'class', classNames);\r\n }\r\n return div;\r\n};\r\n\r\n/**\r\n * Creates DOM nodes modeled after the passed html string and returns the root dom nodes as a array.\r\n * @param html The html string after which the DOM nodes shall be created.\r\n */\r\nexport const createDOM = (html: string): ReadonlyArray => {\r\n const createdDiv = createDiv();\r\n createdDiv.innerHTML = html.trim();\r\n\r\n return each(contents(createdDiv), (elm) => removeElements(elm));\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { hasOwnProperty } from 'support/utils/object';\r\nimport { createDiv } from 'support/dom/create';\r\n\r\nconst firstLetterToUpper = (str: string): string => str.charAt(0).toUpperCase() + str.slice(1);\r\nconst getDummyStyle = (): CSSStyleDeclaration => createDiv().style;\r\n\r\n// https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix\r\n\r\nexport const cssPrefixes: ReadonlyArray = ['-webkit-', '-moz-', '-o-', '-ms-'];\r\nexport const jsPrefixes: ReadonlyArray = [\r\n 'WebKit',\r\n 'Moz',\r\n 'O',\r\n 'MS',\r\n 'webkit',\r\n 'moz',\r\n 'o',\r\n 'ms',\r\n];\r\n\r\nexport const jsCache: { [key: string]: any } = {};\r\nexport const cssCache: { [key: string]: string } = {};\r\n\r\n/**\r\n * Gets the name of the given CSS property with vendor prefix if it isn't supported without it, or and empty string if unsupported.\r\n * @param name The name of the CSS property which shall be get.\r\n */\r\nexport const cssProperty = (name: string): string => {\r\n let result: string | undefined = cssCache[name];\r\n\r\n if (hasOwnProperty(cssCache, name)) {\r\n return result;\r\n }\r\n\r\n const uppercasedName: string = firstLetterToUpper(name);\r\n const elmStyle: CSSStyleDeclaration = getDummyStyle();\r\n\r\n each(cssPrefixes, (prefix: string) => {\r\n const prefixWithoutDashes: string = prefix.replace(/-/g, '');\r\n const resultPossibilities: Array = [\r\n name, // transition\r\n prefix + name, // -webkit-transition\r\n prefixWithoutDashes + uppercasedName, // webkitTransition\r\n firstLetterToUpper(prefixWithoutDashes) + uppercasedName, // WebkitTransition\r\n ];\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return !(result = resultPossibilities.find(\r\n (resultPossibility: string) => elmStyle[resultPossibility] !== undefined\r\n ));\r\n });\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return (cssCache[name] = result || '');\r\n};\r\n\r\n/**\r\n * Get the name of the given CSS property value(s), with vendor prefix if it isn't supported without it, or an empty string if no value is supported.\r\n * @param property The CSS property to which the CSS property value(s) belong.\r\n * @param values The value(s) separated by spaces which shall be get.\r\n * @param suffix A suffix which is added to each value in case the value is a function or something else more advanced.\r\n */\r\nexport const cssPropertyValue = (property: string, values: string, suffix?: string): string => {\r\n const name = `${property} ${values}`;\r\n let result: string | undefined = cssCache[name];\r\n\r\n if (hasOwnProperty(cssCache, name)) {\r\n return result;\r\n }\r\n\r\n const dummyStyle: CSSStyleDeclaration = getDummyStyle();\r\n const possbleValues: Array = values.split(' ');\r\n const preparedSuffix: string = suffix || '';\r\n const cssPrefixesWithFirstEmpty = [''].concat(cssPrefixes);\r\n\r\n each(possbleValues, (possibleValue: string) => {\r\n each(cssPrefixesWithFirstEmpty, (prefix: string) => {\r\n const prop = prefix + possibleValue;\r\n dummyStyle.cssText = `${property}:${prop}${preparedSuffix}`;\r\n if (dummyStyle.length) {\r\n result = prop;\r\n return false;\r\n }\r\n });\r\n return !result;\r\n });\r\n\r\n // eslint-disable-next-line no-return-assign\r\n return (cssCache[name] = result || '');\r\n};\r\n\r\n/**\r\n * Get the requested JS function, object or constructor with vendor prefix if it isn't supported without or undefined if unsupported.\r\n * @param name The name of the JS function, object or constructor.\r\n */\r\nexport const jsAPI = (name: string): T | undefined => {\r\n let result: any = jsCache[name] || window[name];\r\n\r\n if (hasOwnProperty(jsCache, name)) {\r\n return result;\r\n }\r\n\r\n each(jsPrefixes, (prefix: string) => {\r\n result = result || window[prefix + firstLetterToUpper(name)];\r\n return !result;\r\n });\r\n\r\n jsCache[name] = result;\r\n return result;\r\n};\r\n","import { jsAPI } from 'support/compatibility/vendors';\r\n\r\nexport const MutationObserverConstructor = jsAPI('MutationObserver');\r\nexport const IntersectionObserverConstructor = jsAPI(\r\n 'IntersectionObserver'\r\n);\r\nexport const ResizeObserverConstructor = jsAPI('ResizeObserver');\r\nexport const cAF = jsAPI('cancelAnimationFrame');\r\nexport const rAF = jsAPI('requestAnimationFrame');\r\n","import { isString } from 'support/utils/types';\r\nimport { each } from 'support/utils/array';\r\nimport { keys } from 'support/utils/object';\r\n\r\nconst rnothtmlwhite = /[^\\x20\\t\\r\\n\\f]+/g;\r\nconst classListAction = (\r\n elm: Element | false | null | undefined,\r\n className: string | false | null | undefined,\r\n action: (elmClassList: DOMTokenList, clazz: string) => boolean | void\r\n): boolean => {\r\n let clazz: string;\r\n let i = 0;\r\n let result = false;\r\n\r\n if (elm && className && isString(className)) {\r\n const classes: Array = className.match(rnothtmlwhite) || [];\r\n result = classes.length > 0;\r\n while ((clazz = classes[i++])) {\r\n result = !!action(elm.classList, clazz) && result;\r\n }\r\n }\r\n return result;\r\n};\r\n\r\n/**\r\n * Check whether the given element has the given class name(s).\r\n * @param elm The element.\r\n * @param className The class name(s).\r\n */\r\nexport const hasClass = (\r\n elm: Element | false | null | undefined,\r\n className: string | false | null | undefined\r\n): boolean => classListAction(elm, className, (classList, clazz) => classList.contains(clazz));\r\n\r\n/**\r\n * Removes the given class name(s) from the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be removed. (separated by spaces)\r\n */\r\nexport const removeClass = (\r\n elm: Element | false | null | undefined,\r\n className: string | false | null | undefined\r\n): void => {\r\n classListAction(elm, className, (classList, clazz) => classList.remove(clazz));\r\n};\r\n\r\n/**\r\n * Adds the given class name(s) to the given element.\r\n * @param elm The element.\r\n * @param className The class name(s) which shall be added. (separated by spaces)\r\n * @returns A function which removes the added class name(s).\r\n */\r\nexport const addClass = (\r\n elm: Element | false | null | undefined,\r\n className: string | false | null | undefined\r\n): (() => void) => {\r\n classListAction(elm, className, (classList, clazz) => classList.add(clazz));\r\n return removeClass.bind(0, elm, className);\r\n};\r\n\r\n/**\r\n * Takes two className strings, compares them and returns the difference as array.\r\n * @param classNameA ClassName A.\r\n * @param classNameB ClassName B.\r\n */\r\nexport const diffClass = (\r\n classNameA: string | null | undefined,\r\n classNameB: string | null | undefined\r\n) => {\r\n const classNameASplit = classNameA && classNameA.split(' ');\r\n const classNameBSplit = classNameB && classNameB.split(' ');\r\n const tempObj = {};\r\n\r\n each(classNameASplit, (className) => {\r\n tempObj[className] = 1;\r\n });\r\n each(classNameBSplit, (className) => {\r\n if (tempObj[className]) {\r\n delete tempObj[className];\r\n } else {\r\n tempObj[className] = 1;\r\n }\r\n });\r\n\r\n return keys(tempObj);\r\n};\r\n","import { each } from 'support/utils/array';\r\nimport { WH, XY, TRBL } from 'support/dom';\r\nimport { PlainObject } from 'typings';\r\n\r\n/**\r\n * Compares two objects and returns true if all values of the passed prop names are identical, false otherwise or if one of the two object is falsy.\r\n * @param a Object a.\r\n * @param b Object b.\r\n * @param props The props which shall be compared.\r\n */\r\nexport const equal = (\r\n a: T | undefined,\r\n b: T | undefined,\r\n props: Array,\r\n propMutation?: ((value: any) => any) | null | false\r\n): boolean => {\r\n if (a && b) {\r\n let result = true;\r\n each(props, (prop) => {\r\n const compareA = propMutation ? propMutation(a[prop]) : a[prop];\r\n const compareB = propMutation ? propMutation(b[prop]) : b[prop];\r\n if (compareA !== compareB) {\r\n result = false;\r\n }\r\n });\r\n return result;\r\n }\r\n return false;\r\n};\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalWH = (a?: WH, b?: WH) => equal>(a, b, ['w', 'h']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalXY = (a?: XY, b?: XY) => equal>(a, b, ['x', 'y']);\r\n\r\n/**\r\n * Compares object a with object b and returns true if both have the same property values, false otherwise.\r\n * Also returns false if one of the objects is undefined or null.\r\n * @param a Object a.\r\n * @param b Object b.\r\n */\r\nexport const equalTRBL = (a?: TRBL, b?: TRBL) => equal(a, b, ['t', 'r', 'b', 'l']);\r\n\r\n/**\r\n * Compares two DOM Rects for their equality of their width and height properties\r\n * Also returns false if one of the DOM Rects is undefined or null.\r\n * @param a DOM Rect a.\r\n * @param b DOM Rect b.\r\n * @param round Whether the values should be rounded.\r\n */\r\nexport const equalBCRWH = (a?: DOMRect, b?: DOMRect, round?: boolean) =>\r\n equal(a, b, ['width', 'height'], round && ((value) => Math.round(value)));\r\n","import { isNumber, isFunction } from 'support/utils/types';\r\nimport { from } from 'support/utils/array';\r\nimport { rAF, cAF } from 'support/compatibility/apis';\r\n\r\nconst clearTimeouts = (id: number | undefined) => {\r\n id && window.clearTimeout(id);\r\n id && cAF!(id);\r\n};\r\n\r\ntype DebounceTiming = number | false | null | undefined;\r\n\r\nexport interface DebounceOptions any> {\r\n /**\r\n * The timeout for debouncing. If null, no debounce is applied.\r\n */\r\n _timeout?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * A maximum amount of ms. before the function will be called even with debounce.\r\n */\r\n _maxDelay?: DebounceTiming | (() => DebounceTiming);\r\n /**\r\n * Function which merges parameters for each canceled debounce.\r\n * If parameters can't be merged the function will return null, otherwise it returns the merged parameters.\r\n */\r\n _mergeParams?: (\r\n prev: Parameters,\r\n curr: Parameters\r\n ) => Parameters | false | null | undefined;\r\n}\r\n\r\nexport interface Debounced any> {\r\n (...args: Parameters): ReturnType;\r\n _flush(): void;\r\n}\r\n\r\nexport const noop = () => {}; // eslint-disable-line\r\n\r\n/**\r\n * Debounces the given function either with a timeout or a animation frame.\r\n * @param functionToDebounce The function which shall be debounced.\r\n * @param options Options for debouncing.\r\n */\r\nexport const debounce = any>(\r\n functionToDebounce: FunctionToDebounce,\r\n options?: DebounceOptions\r\n): Debounced => {\r\n let timeoutId: number | undefined;\r\n let maxTimeoutId: number | undefined;\r\n let prevArguments: Parameters | null | undefined;\r\n let latestArguments: Parameters | null | undefined;\r\n const { _timeout, _maxDelay, _mergeParams } = options || {};\r\n const setT = window.setTimeout;\r\n\r\n const invokeFunctionToDebounce = function (args: IArguments) {\r\n clearTimeouts(timeoutId);\r\n clearTimeouts(maxTimeoutId);\r\n maxTimeoutId = timeoutId = prevArguments = undefined;\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n functionToDebounce.apply(this, args);\r\n };\r\n\r\n const mergeParms = (\r\n curr: Parameters\r\n ): Parameters | false | null | undefined =>\r\n _mergeParams && prevArguments ? _mergeParams(prevArguments, curr) : curr;\r\n\r\n const flush = () => {\r\n /* istanbul ignore next */\r\n if (timeoutId) {\r\n invokeFunctionToDebounce(mergeParms(latestArguments!) || latestArguments!);\r\n }\r\n };\r\n\r\n const debouncedFn = function () {\r\n // eslint-disable-next-line prefer-rest-params\r\n const args: Parameters = from(arguments) as Parameters;\r\n const finalTimeout = isFunction(_timeout) ? _timeout() : _timeout;\r\n const hasTimeout = isNumber(finalTimeout) && finalTimeout >= 0;\r\n\r\n if (hasTimeout) {\r\n const finalMaxWait = isFunction(_maxDelay) ? _maxDelay() : _maxDelay;\r\n const hasMaxWait = isNumber(finalMaxWait) && finalMaxWait >= 0;\r\n const setTimeoutFn = finalTimeout > 0 ? setT : rAF!;\r\n const mergeParamsResult = mergeParms(args);\r\n const invokedArgs = mergeParamsResult || args;\r\n const boundInvoke = invokeFunctionToDebounce.bind(0, invokedArgs);\r\n\r\n // if (!mergeParamsResult) {\r\n // invokeFunctionToDebounce(prevArguments || args);\r\n // }\r\n\r\n clearTimeouts(timeoutId);\r\n // @ts-ignore\r\n timeoutId = setTimeoutFn(boundInvoke, finalTimeout as number) as number;\r\n\r\n if (hasMaxWait && !maxTimeoutId) {\r\n maxTimeoutId = setT(flush, finalMaxWait as number);\r\n }\r\n\r\n prevArguments = latestArguments = invokedArgs;\r\n } else {\r\n invokeFunctionToDebounce(args);\r\n }\r\n };\r\n debouncedFn._flush = flush;\r\n\r\n return debouncedFn as Debounced;\r\n};\r\n","import { style } from 'support/dom/style';\r\n\r\nexport interface WH {\r\n w: T;\r\n h: T;\r\n}\r\n\r\nconst elementHasDimensions = (elm: HTMLElement): boolean =>\r\n !!(elm.offsetWidth || elm.offsetHeight || elm.getClientRects().length);\r\nconst zeroObj: WH = {\r\n w: 0,\r\n h: 0,\r\n};\r\n\r\n/**\r\n * Returns the window inner- width and height.\r\n */\r\nexport const windowSize = (): WH => ({\r\n w: window.innerWidth,\r\n h: window.innerHeight,\r\n});\r\n\r\n/**\r\n * Returns the scroll- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the scroll- width and height shall be returned.\r\n */\r\nexport const offsetSize = (elm: HTMLElement | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.offsetWidth,\r\n h: elm.offsetHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const clientSize = (elm: HTMLElement | false | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.clientWidth,\r\n h: elm.clientHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the client- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the client- width and height shall be returned.\r\n */\r\nexport const scrollSize = (elm: HTMLElement | false | null | undefined): WH =>\r\n elm\r\n ? {\r\n w: elm.scrollWidth,\r\n h: elm.scrollHeight,\r\n }\r\n : zeroObj;\r\n\r\n/**\r\n * Returns the fractional- width and height of the passed element. If the element is null the width and height values are 0.\r\n * @param elm The element of which the fractional- width and height shall be returned.\r\n */\r\nexport const fractionalSize = (elm: HTMLElement | false | null | undefined): WH => {\r\n const cssHeight = parseFloat(style(elm, 'height')) || 0;\r\n const cssWidth = parseFloat(style(elm, 'height')) || 0;\r\n return {\r\n w: cssWidth - Math.round(cssWidth),\r\n h: cssHeight - Math.round(cssHeight),\r\n };\r\n};\r\n\r\n/**\r\n * Returns the BoundingClientRect of the passed element.\r\n * @param elm The element of which the BoundingClientRect shall be returned.\r\n */\r\nexport const getBoundingClientRect = (elm: HTMLElement): DOMRect => elm.getBoundingClientRect();\r\n\r\n/**\r\n * Determines whether the passed element has any dimensions.\r\n * @param elm The element.\r\n */\r\nexport const hasDimensions = (elm: HTMLElement | false | null | undefined): boolean =>\r\n elm ? elementHasDimensions(elm as HTMLElement) : false;\r\n","import { isUndefined } from 'support/utils/types';\r\nimport { each, push, runEachAndClear } from 'support/utils/array';\r\n\r\nlet passiveEventsSupport: boolean;\r\nconst supportPassiveEvents = (): boolean => {\r\n if (isUndefined(passiveEventsSupport)) {\r\n passiveEventsSupport = false;\r\n try {\r\n /* eslint-disable */\r\n // @ts-ignore\r\n window.addEventListener(\r\n 'test',\r\n null,\r\n Object.defineProperty({}, 'passive', {\r\n get: function () {\r\n passiveEventsSupport = true;\r\n },\r\n })\r\n );\r\n /* eslint-enable */\r\n } catch (e) {}\r\n }\r\n return passiveEventsSupport;\r\n};\r\nconst splitEventNames = (eventNames: string) => eventNames.split(' ');\r\n\r\nexport interface OnOptions {\r\n _capture?: boolean;\r\n _passive?: boolean;\r\n _once?: boolean;\r\n}\r\n\r\n/**\r\n * Removes the passed event listener for the passed events with the passed options.\r\n * @param target The element from which the listener shall be removed.\r\n * @param eventNames The eventsnames for which the listener shall be removed.\r\n * @param listener The listener which shall be removed.\r\n * @param capture The options of the removed listener.\r\n */\r\nexport const off = (\r\n target: EventTarget,\r\n eventNames: string,\r\n listener: (event: T) => any,\r\n capture?: boolean\r\n): void => {\r\n each(splitEventNames(eventNames), (eventName) => {\r\n target.removeEventListener(eventName, listener as EventListener, capture);\r\n });\r\n};\r\n\r\n/**\r\n * Adds the passed event listener for the passed eventnames with the passed options.\r\n * @param target The element to which the listener shall be added.\r\n * @param eventNames The eventsnames for which the listener shall be called.\r\n * @param listener The listener which is called on the eventnames.\r\n * @param options The options of the added listener.\r\n */\r\nexport const on = (\r\n target: EventTarget,\r\n eventNames: string,\r\n listener: (event: T) => any,\r\n options?: OnOptions\r\n): (() => void) => {\r\n const doSupportPassiveEvents = supportPassiveEvents();\r\n const passive = (doSupportPassiveEvents && options && options._passive) || false;\r\n const capture = (options && options._capture) || false;\r\n const once = (options && options._once) || false;\r\n const offListeners: (() => void)[] = [];\r\n const nativeOptions: AddEventListenerOptions | boolean = doSupportPassiveEvents\r\n ? {\r\n passive,\r\n capture,\r\n }\r\n : capture;\r\n\r\n each(splitEventNames(eventNames), (eventName) => {\r\n const finalListener = (\r\n once\r\n ? (evt: T) => {\r\n target.removeEventListener(eventName, finalListener, capture);\r\n listener && listener(evt);\r\n }\r\n : listener\r\n ) as EventListener;\r\n\r\n push(offListeners, off.bind(null, target, eventName, finalListener, capture));\r\n target.addEventListener(eventName, finalListener, nativeOptions);\r\n });\r\n\r\n return runEachAndClear.bind(0, offListeners);\r\n};\r\n\r\n/**\r\n * Shorthand for the stopPropagation event Method.\r\n * @param evt The event of which the stopPropagation method shall be called.\r\n */\r\nexport const stopPropagation = (evt: Event): void => evt.stopPropagation();\r\n\r\n/**\r\n * Shorthand for the preventDefault event Method.\r\n * @param evt The event of which the preventDefault method shall be called.\r\n */\r\nexport const preventDefault = (evt: Event): void => evt.preventDefault();\r\n\r\n/**\r\n * Shorthand for the stopPropagation and preventDefault event Method.\r\n * @param evt The event of which the stopPropagation and preventDefault methods shall be called.\r\n */\r\nexport const stopAndPrevent = (evt: Event): void =>\r\n (stopPropagation(evt) as undefined) || (preventDefault(evt) as undefined);\r\n","import { getBoundingClientRect } from 'support/dom/dimensions';\r\n\r\nexport interface XY {\r\n x: T;\r\n y: T;\r\n}\r\n\r\nconst zeroObj: XY = {\r\n x: 0,\r\n y: 0,\r\n};\r\n\r\n/**\r\n * Returns the offset- left and top coordinates of the passed element relative to the document. If the element is null the top and left values are 0.\r\n * @param elm The element of which the offset- top and left coordinates shall be returned.\r\n */\r\nexport const absoluteCoordinates = (elm: HTMLElement | null | undefined): XY => {\r\n const rect = elm ? getBoundingClientRect(elm) : 0;\r\n return rect\r\n ? {\r\n x: rect.left + window.pageYOffset,\r\n y: rect.top + window.pageXOffset,\r\n }\r\n : zeroObj;\r\n};\r\n\r\n/**\r\n * Returns the offset- left and top coordinates of the passed element. If the element is null the top and left values are 0.\r\n * @param elm The element of which the offset- top and left coordinates shall be returned.\r\n */\r\nexport const offsetCoordinates = (elm: HTMLElement | null | undefined): XY =>\r\n elm\r\n ? {\r\n x: elm.offsetLeft,\r\n y: elm.offsetTop,\r\n }\r\n : zeroObj;\r\n","import { isArray } from 'support/utils/types';\r\nimport { keys } from 'support/utils/object';\r\nimport { each, from, isEmptyArray } from 'support/utils/array';\r\n\r\nexport type EventListener<\r\n EventMap extends Record,\r\n Name extends keyof EventMap = keyof EventMap\r\n> = (...args: EventMap[Name]) => void;\r\n\r\nexport type InitialEventListeners> = {\r\n [K in keyof EventMap]?: EventListener | EventListener[];\r\n};\r\n\r\nconst manageListener = >(\r\n callback: (listener?: EventListener) => void,\r\n listener?: EventListener | EventListener[]\r\n) => {\r\n each(isArray(listener) ? listener : [listener], callback);\r\n};\r\n\r\nexport const createEventListenerHub = >(\r\n initialEventListeners?: InitialEventListeners\r\n) => {\r\n type EventListener = (\r\n ...args: EventMap[Name]\r\n ) => void;\r\n\r\n const events = new Map>();\r\n\r\n function removeEvent(\r\n name?: Name,\r\n listener?: EventListener\r\n ): void;\r\n function removeEvent(\r\n name?: Name,\r\n listener?: EventListener[]\r\n ): void;\r\n function removeEvent(\r\n name?: Name,\r\n listener?: EventListener | EventListener[]\r\n ): void {\r\n if (name) {\r\n const eventSet = events.get(name);\r\n manageListener((currListener) => {\r\n if (eventSet) {\r\n eventSet[currListener ? 'delete' : 'clear'](currListener!);\r\n }\r\n }, listener as any);\r\n } else {\r\n events.forEach((eventSet) => {\r\n eventSet.clear();\r\n });\r\n events.clear();\r\n }\r\n }\r\n\r\n function addEvent(\r\n name: Name,\r\n listener: EventListener\r\n ): () => void;\r\n function addEvent(\r\n name: Name,\r\n listener: EventListener[]\r\n ): () => void;\r\n function addEvent(\r\n name: Name,\r\n listener: EventListener | EventListener[]\r\n ): () => void {\r\n const eventSet = events.get(name) || new Set();\r\n events.set(name, eventSet);\r\n\r\n manageListener((currListener) => {\r\n currListener && eventSet.add(currListener);\r\n }, listener as any);\r\n\r\n return removeEvent.bind(0, name as any, listener as any);\r\n }\r\n\r\n function triggerEvent(name: Name, args?: EventMap[Name]): void {\r\n const eventSet = events.get(name);\r\n\r\n each(from(eventSet), (event) => {\r\n if (args && !isEmptyArray(args)) {\r\n (event as (...args: EventMap[keyof EventMap]) => void).apply(0, args as any);\r\n } else {\r\n (event as () => void)();\r\n }\r\n });\r\n }\r\n\r\n const initialListenerKeys = keys(initialEventListeners) as Extract[];\r\n each(initialListenerKeys, (key) => {\r\n addEvent(key, initialEventListeners![key] as any);\r\n });\r\n\r\n return [addEvent, removeEvent, triggerEvent] as [\r\n typeof addEvent,\r\n typeof removeEvent,\r\n typeof triggerEvent\r\n ];\r\n};\r\n","import { assignDeep, hasOwnProperty } from 'support';\r\nimport type { Options, ReadonlyOSOptions } from 'options';\r\nimport type { PartialOptions } from 'typings';\r\n\r\nexport type SetupElements> = [elements: T, destroy: () => void];\r\n\r\nexport type SetupUpdate = (changedOptions: PartialOptions, force?: boolean) => T;\r\n\r\nexport type SetupUpdateCheckOption = (path: string) => [value: T, changed: boolean];\r\n\r\nexport type SetupUpdateSegment> = (\r\n updateHints: Hints,\r\n checkOption: SetupUpdateCheckOption,\r\n force: boolean\r\n) => Partial | void;\r\n\r\nexport type SetupState> = [\r\n get: () => T,\r\n set: (newState: Partial) => void\r\n];\r\n\r\nexport type Setup = Record> = [\r\n update: SetupUpdate,\r\n state: (() => DynamicState) & StaticState,\r\n destroy: () => void\r\n];\r\n\r\nconst getPropByPath = (obj: any, path: string): T =>\r\n obj\r\n ? path.split('.').reduce((o, prop) => (o && hasOwnProperty(o, prop) ? o[prop] : undefined), obj)\r\n : undefined;\r\n\r\nexport const createOptionCheck =\r\n (\r\n options: ReadonlyOSOptions,\r\n changedOptions: PartialOptions,\r\n force?: boolean\r\n ): SetupUpdateCheckOption =>\r\n (path: string) =>\r\n [getPropByPath(options, path), force || getPropByPath(changedOptions, path) !== undefined];\r\n\r\nexport const createState = (initialState: S): SetupState => {\r\n let state: S = initialState;\r\n return [\r\n () => state,\r\n (newState: Partial) => {\r\n state = assignDeep({}, state, newState);\r\n },\r\n ];\r\n};\r\n","export const classNameEnvironment = 'os-environment';\r\nexport const classNameEnvironmentFlexboxGlue = `${classNameEnvironment}-flexbox-glue`;\r\nexport const classNameEnvironmentFlexboxGlueMax = `${classNameEnvironmentFlexboxGlue}-max`;\r\n\r\nexport const dataAttributeHost = 'data-overlayscrollbars';\r\nexport const dataAttributeHostOverflowX = `${dataAttributeHost}-overflow-x`;\r\nexport const dataAttributeHostOverflowY = `${dataAttributeHost}-overflow-y`;\r\nexport const dataValueHostOverflowVisible = 'overflowVisible';\r\nexport const dataValueHostViewportScrollbarStyling = 'viewportStyled';\r\nexport const classNamePadding = 'os-padding';\r\nexport const classNameViewport = 'os-viewport';\r\nexport const classNameViewportArrange = `${classNameViewport}-arrange`;\r\nexport const classNameContent = 'os-content';\r\nexport const classNameViewportScrollbarStyling = `${classNameViewport}-scrollbar-styled`;\r\nexport const classNameOverflowVisible = `os-overflow-visible`;\r\n\r\nexport const classNameSizeObserver = 'os-size-observer';\r\nexport const classNameSizeObserverAppear = `${classNameSizeObserver}-appear`;\r\nexport const classNameSizeObserverListener = `${classNameSizeObserver}-listener`;\r\nexport const classNameSizeObserverListenerScroll = `${classNameSizeObserverListener}-scroll`;\r\nexport const classNameSizeObserverListenerItem = `${classNameSizeObserverListener}-item`;\r\nexport const classNameSizeObserverListenerItemFinal = `${classNameSizeObserverListenerItem}-final`;\r\n\r\nexport const classNameTrinsicObserver = 'os-trinsic-observer';\r\n\r\nexport const classNameScrollbar = 'os-scrollbar';\r\nexport const classNameScrollbarHorizontal = `${classNameScrollbar}-horizontal`;\r\nexport const classNameScrollbarVertical = `${classNameScrollbar}-vertical`;\r\nexport const classNameScrollbarTrack = 'os-scrollbar-track';\r\nexport const classNameScrollbarHandle = 'os-scrollbar-handle';\r\n","import { assignDeep, each, isObject, keys, isArray, hasOwnProperty, isFunction } from 'support';\r\nimport { PartialOptions, ReadonlyOptions } from 'typings';\r\n\r\nconst opsStringify = (value: any) =>\r\n JSON.stringify(value, (_, val) => {\r\n if (isFunction(val)) {\r\n throw new Error();\r\n }\r\n return val;\r\n });\r\n\r\nexport type ResizeBehavior = 'none' | 'both' | 'horizontal' | 'vertical';\r\n\r\nexport type OverflowBehavior =\r\n | 'hidden'\r\n | 'scroll'\r\n | 'visible'\r\n | 'visible-hidden'\r\n | 'visible-scroll';\r\n\r\nexport type VisibilityBehavior = 'visible' | 'hidden' | 'auto';\r\n\r\nexport type AutoHideBehavior = 'never' | 'scroll' | 'leave' | 'move';\r\n\r\nexport type ScrollBehavior = 'always' | 'ifneeded' | 'never';\r\n\r\nexport type BasicEventCallback = (this: any) => void;\r\n\r\nexport type ScrollEventCallback = (this: any, args?: UIEvent) => void;\r\n\r\nexport type OverflowChangedCallback = (this: any, args?: OverflowChangedArgs) => void;\r\n\r\nexport type OverflowAmountChangedCallback = (this: any, args?: OverflowAmountChangedArgs) => void;\r\n\r\nexport type DirectionChangedCallback = (this: any, args?: DirectionChangedArgs) => void;\r\n\r\nexport type SizeChangedCallback = (this: any, args?: SizeChangedArgs) => void;\r\n\r\nexport type UpdatedCallback = (this: any, args?: UpdatedArgs) => void;\r\n\r\nexport interface Options {\r\n paddingAbsolute: boolean;\r\n updating: {\r\n elementEvents: Array<[elementSelector: string, eventNames: string]> | null;\r\n attributes: string[] | null;\r\n debounce: [timeout: number, maxWait: number] | number | null; // (if tuple: [timeout: 0, maxWait: 33], if number: [timeout: number, maxWait: false]) debounce for content Changes\r\n ignoreMutation: ((mutation: MutationRecord) => any) | null;\r\n };\r\n overflow: {\r\n x: OverflowBehavior;\r\n y: OverflowBehavior;\r\n };\r\n scrollbars: {\r\n visibility: VisibilityBehavior;\r\n autoHide: AutoHideBehavior;\r\n autoHideDelay: number;\r\n dragScroll: boolean;\r\n clickScroll: boolean;\r\n touch: boolean;\r\n };\r\n nativeScrollbarsOverlaid: {\r\n show: boolean;\r\n initialize: boolean;\r\n };\r\n}\r\n\r\nexport type ReadonlyOSOptions = ReadonlyOptions;\r\n\r\nexport interface OverflowChangedArgs {\r\n x: boolean;\r\n y: boolean;\r\n xScrollable: boolean;\r\n yScrollable: boolean;\r\n clipped: boolean;\r\n}\r\n\r\nexport interface OverflowAmountChangedArgs {\r\n x: number;\r\n y: number;\r\n}\r\n\r\nexport interface DirectionChangedArgs {\r\n isRTL: number;\r\n dir: string;\r\n}\r\n\r\nexport interface SizeChangedArgs {\r\n width: number;\r\n height: number;\r\n}\r\n\r\nexport interface UpdatedArgs {\r\n forced: boolean;\r\n}\r\n\r\nexport const defaultOptions: Options = {\r\n // resize: 'none', // none || both || horizontal || vertical || n || b || h || v\r\n paddingAbsolute: false, // true || false\r\n updating: {\r\n elementEvents: [['img', 'load']], // array of tuples || null\r\n debounce: [0, 33], // number || number array || null\r\n attributes: null, // string array || null\r\n ignoreMutation: null, // () => any || null\r\n },\r\n overflow: {\r\n x: 'scroll', // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s\r\n y: 'scroll', // visible-hidden || visible-scroll || hidden || scroll || v-h || v-s || h || s\r\n },\r\n nativeScrollbarsOverlaid: {\r\n show: false, // true || false\r\n initialize: false, // true || false\r\n },\r\n scrollbars: {\r\n visibility: 'auto', // visible || hidden || auto || v || h || a\r\n autoHide: 'never', // never || scroll || leave || move || n || s || l || m\r\n autoHideDelay: 800, // number\r\n dragScroll: true, // true || false\r\n clickScroll: false, // true || false\r\n touch: true, // true || false\r\n },\r\n /*\r\n textarea: {\r\n dynWidth: false, // true || false\r\n dynHeight: false, // true || false\r\n inheritedAttrs: ['style', 'class'], // string || array || null\r\n },\r\n */\r\n};\r\n\r\nexport const getOptionsDiff = (\r\n currOptions: T,\r\n newOptions: PartialOptions\r\n): PartialOptions => {\r\n const diff: PartialOptions = {};\r\n const optionsKeys = keys(newOptions).concat(keys(currOptions));\r\n\r\n each(optionsKeys, (optionKey) => {\r\n const currOptionValue = currOptions[optionKey];\r\n const newOptionValue = newOptions[optionKey];\r\n\r\n if (isObject(currOptionValue) && isObject(newOptionValue)) {\r\n assignDeep((diff[optionKey] = {}), getOptionsDiff(currOptionValue, newOptionValue));\r\n } else if (hasOwnProperty(newOptions, optionKey) && newOptionValue !== currOptionValue) {\r\n let isDiff = true;\r\n\r\n if (isArray(currOptionValue) || isArray(newOptionValue)) {\r\n try {\r\n if (opsStringify(currOptionValue) === opsStringify(newOptionValue)) {\r\n isDiff = false;\r\n }\r\n } catch {}\r\n }\r\n\r\n if (isDiff) {\r\n diff[optionKey] = newOptionValue;\r\n }\r\n }\r\n });\r\n\r\n return diff;\r\n};\r\n","import {\r\n createDOM,\r\n addClass,\r\n style,\r\n appendChildren,\r\n fractionalSize,\r\n clientSize,\r\n absoluteCoordinates,\r\n offsetSize,\r\n scrollLeft,\r\n XY,\r\n removeAttr,\r\n removeElements,\r\n windowSize,\r\n equalBCRWH,\r\n getBoundingClientRect,\r\n assignDeep,\r\n cssProperty,\r\n createCache,\r\n equalXY,\r\n createEventListenerHub,\r\n EventListener,\r\n} from 'support';\r\nimport {\r\n classNameEnvironment,\r\n classNameEnvironmentFlexboxGlue,\r\n classNameEnvironmentFlexboxGlueMax,\r\n classNameViewportScrollbarStyling,\r\n} from 'classnames';\r\nimport { Options, defaultOptions } from 'options';\r\nimport { PartialOptions } from 'typings';\r\nimport { InitializationStrategy } from 'initialization';\r\n\r\ntype EnvironmentEventMap = {\r\n _: [];\r\n};\r\n\r\nexport interface InternalEnvironment {\r\n readonly _nativeScrollbarsSize: XY;\r\n readonly _nativeScrollbarsOverlaid: XY;\r\n readonly _nativeScrollbarsHiding: boolean;\r\n readonly _rtlScrollBehavior: { n: boolean; i: boolean };\r\n readonly _flexboxGlue: boolean;\r\n readonly _cssCustomProperties: boolean;\r\n readonly _defaultInitializationStrategy: InitializationStrategy;\r\n readonly _defaultDefaultOptions: Options;\r\n _addListener(listener: EventListener): () => void;\r\n _getInitializationStrategy(): InitializationStrategy;\r\n _setInitializationStrategy(newInitializationStrategy: Partial): void;\r\n _getDefaultOptions(): Options;\r\n _setDefaultOptions(newDefaultOptions: PartialOptions): void;\r\n}\r\n\r\nlet environmentInstance: InternalEnvironment;\r\nconst { abs, round } = Math;\r\n\r\nconst diffBiggerThanOne = (valOne: number, valTwo: number): boolean => {\r\n const absValOne = abs(valOne);\r\n const absValTwo = abs(valTwo);\r\n return !(absValOne === absValTwo || absValOne + 1 === absValTwo || absValOne - 1 === absValTwo);\r\n};\r\n\r\nconst getNativeScrollbarSize = (\r\n body: HTMLElement,\r\n measureElm: HTMLElement,\r\n measureElmChild: HTMLElement\r\n): XY => {\r\n appendChildren(body, measureElm);\r\n\r\n const cSize = clientSize(measureElm);\r\n const oSize = offsetSize(measureElm);\r\n const fSize = fractionalSize(measureElmChild);\r\n\r\n return {\r\n x: oSize.h - cSize.h + fSize.h,\r\n y: oSize.w - cSize.w + fSize.w,\r\n };\r\n};\r\n\r\nconst getNativeScrollbarsHiding = (testElm: HTMLElement): boolean => {\r\n let result = false;\r\n const revertClass = addClass(testElm, classNameViewportScrollbarStyling);\r\n try {\r\n result =\r\n style(testElm, cssProperty('scrollbar-width')) === 'none' ||\r\n window.getComputedStyle(testElm, '::-webkit-scrollbar').getPropertyValue('display') ===\r\n 'none';\r\n } catch (ex) {}\r\n revertClass();\r\n return result;\r\n};\r\n\r\nconst getRtlScrollBehavior = (\r\n parentElm: HTMLElement,\r\n childElm: HTMLElement\r\n): { i: boolean; n: boolean } => {\r\n const strHidden = 'hidden';\r\n style(parentElm, { overflowX: strHidden, overflowY: strHidden, direction: 'rtl' });\r\n scrollLeft(parentElm, 0);\r\n\r\n const parentOffset = absoluteCoordinates(parentElm);\r\n const childOffset = absoluteCoordinates(childElm);\r\n scrollLeft(parentElm, -999); // https://github.com/KingSora/OverlayScrollbars/issues/187\r\n const childOffsetAfterScroll = absoluteCoordinates(childElm);\r\n return {\r\n /**\r\n * origin direction = determines if the zero scroll position is on the left or right side\r\n * 'i' means 'invert' (i === true means that the axis must be inverted to be correct)\r\n * true = on the left side\r\n * false = on the right side\r\n */\r\n i: parentOffset.x === childOffset.x,\r\n /**\r\n * negative = determines if the maximum scroll is positive or negative\r\n * 'n' means 'negate' (n === true means that the axis must be negated to be correct)\r\n * true = negative\r\n * false = positive\r\n */\r\n n: childOffset.x !== childOffsetAfterScroll.x,\r\n };\r\n};\r\n\r\nconst getFlexboxGlue = (parentElm: HTMLElement, childElm: HTMLElement): boolean => {\r\n const revertFbxGlue = addClass(parentElm, classNameEnvironmentFlexboxGlue);\r\n const minOffsetsizeParent = getBoundingClientRect(parentElm);\r\n const minOffsetsize = getBoundingClientRect(childElm);\r\n const supportsMin = equalBCRWH(minOffsetsize, minOffsetsizeParent, true);\r\n\r\n const revertFbxGlueMax = addClass(parentElm, classNameEnvironmentFlexboxGlueMax);\r\n const maxOffsetsizeParent = getBoundingClientRect(parentElm);\r\n const maxOffsetsize = getBoundingClientRect(childElm);\r\n const supportsMax = equalBCRWH(maxOffsetsize, maxOffsetsizeParent, true);\r\n\r\n revertFbxGlue();\r\n revertFbxGlueMax();\r\n\r\n return supportsMin && supportsMax;\r\n};\r\n\r\nconst getWindowDPR = (): number => {\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const dDPI = window.screen.deviceXDPI || 0;\r\n // eslint-disable-next-line\r\n // @ts-ignore\r\n const sDPI = window.screen.logicalXDPI || 1;\r\n return window.devicePixelRatio || dDPI / sDPI;\r\n};\r\n\r\nconst createEnvironment = (): InternalEnvironment => {\r\n const { body } = document;\r\n const envDOM = createDOM(``);\r\n const envElm = envDOM[0] as HTMLElement;\r\n const envChildElm = envElm.firstChild as HTMLElement;\r\n const [addEvent, , triggerEvent] = createEventListenerHub();\r\n const [updateNativeScrollbarSizeCache, getNativeScrollbarSizeCache] = createCache({\r\n _initialValue: getNativeScrollbarSize(body, envElm, envChildElm),\r\n _equal: equalXY,\r\n });\r\n const [nativeScrollbarsSize] = getNativeScrollbarSizeCache();\r\n const nativeScrollbarsHiding = getNativeScrollbarsHiding(envElm);\r\n const nativeScrollbarsOverlaid = {\r\n x: nativeScrollbarsSize.x === 0,\r\n y: nativeScrollbarsSize.y === 0,\r\n };\r\n const initializationStrategy = {\r\n _padding: !nativeScrollbarsHiding,\r\n _content: false,\r\n };\r\n const defaultDefaultOptions = assignDeep({}, defaultOptions);\r\n\r\n const env: InternalEnvironment = {\r\n _nativeScrollbarsSize: nativeScrollbarsSize,\r\n _nativeScrollbarsOverlaid: nativeScrollbarsOverlaid,\r\n _nativeScrollbarsHiding: nativeScrollbarsHiding,\r\n _cssCustomProperties: style(envElm, 'zIndex') === '-1',\r\n _rtlScrollBehavior: getRtlScrollBehavior(envElm, envChildElm),\r\n _flexboxGlue: getFlexboxGlue(envElm, envChildElm),\r\n _addListener: (listener) => addEvent('_', listener),\r\n _getInitializationStrategy: assignDeep.bind(\r\n 0,\r\n {} as InitializationStrategy,\r\n initializationStrategy\r\n ),\r\n _setInitializationStrategy(newInitializationStrategy) {\r\n assignDeep(initializationStrategy, newInitializationStrategy);\r\n },\r\n _getDefaultOptions: assignDeep.bind(0, {} as Options, defaultDefaultOptions),\r\n _setDefaultOptions(newDefaultOptions) {\r\n assignDeep(defaultDefaultOptions, newDefaultOptions);\r\n },\r\n _defaultInitializationStrategy: assignDeep({}, initializationStrategy),\r\n _defaultDefaultOptions: assignDeep({}, defaultDefaultOptions),\r\n };\r\n\r\n removeAttr(envElm, 'style');\r\n removeElements(envElm);\r\n\r\n if (!nativeScrollbarsHiding && (!nativeScrollbarsOverlaid.x || !nativeScrollbarsOverlaid.y)) {\r\n let size = windowSize();\r\n let dpr = getWindowDPR();\r\n\r\n window.addEventListener('resize', () => {\r\n const sizeNew = windowSize();\r\n const deltaSize = {\r\n w: sizeNew.w - size.w,\r\n h: sizeNew.h - size.h,\r\n };\r\n\r\n if (deltaSize.w === 0 && deltaSize.h === 0) return;\r\n\r\n const deltaAbsSize = {\r\n w: abs(deltaSize.w),\r\n h: abs(deltaSize.h),\r\n };\r\n const deltaAbsRatio = {\r\n w: abs(round(sizeNew.w / (size.w / 100.0))),\r\n h: abs(round(sizeNew.h / (size.h / 100.0))),\r\n };\r\n const dprNew = getWindowDPR();\r\n const deltaIsBigger = deltaAbsSize.w > 2 && deltaAbsSize.h > 2;\r\n const difference = !diffBiggerThanOne(deltaAbsRatio.w, deltaAbsRatio.h);\r\n const dprChanged = dprNew !== dpr && dpr > 0;\r\n const isZoom = deltaIsBigger && difference && dprChanged;\r\n\r\n if (isZoom) {\r\n const [scrollbarSize, scrollbarSizeChanged] = updateNativeScrollbarSizeCache(\r\n getNativeScrollbarSize(body, envElm, envChildElm)\r\n );\r\n\r\n assignDeep(environmentInstance._nativeScrollbarsSize, scrollbarSize); // keep the object same!\r\n removeElements(envElm);\r\n\r\n if (scrollbarSizeChanged) {\r\n triggerEvent('_');\r\n }\r\n }\r\n\r\n size = sizeNew;\r\n dpr = dprNew;\r\n });\r\n }\r\n\r\n return env;\r\n};\r\n\r\nconst getEnvironment = (): InternalEnvironment => {\r\n if (!environmentInstance) {\r\n environmentInstance = createEnvironment();\r\n }\r\n return environmentInstance;\r\n};\r\n\r\nexport { getEnvironment };\r\n","import { assignDeep, each, isArray, keys } from 'support';\r\nimport { OverlayScrollbars, OverlayScrollbarsStatic } from 'overlayscrollbars';\r\n\r\nexport type PluginInstance =\r\n | Record\r\n | ((staticObj: OverlayScrollbarsStatic, instanceObj: OverlayScrollbars) => void);\r\nexport type Plugin = {\r\n [pluginName: string]: T;\r\n};\r\n\r\nconst pluginRegistry: Record = {};\r\n\r\nexport const getPlugins = () => assignDeep({}, pluginRegistry);\r\n\r\nexport const addPlugin = (addedPlugin: Plugin | Plugin[]) =>\r\n each((isArray(addedPlugin) ? addedPlugin : [addedPlugin]) as Plugin[], (plugin) => {\r\n each(keys(plugin), (pluginName) => {\r\n pluginRegistry[pluginName] = plugin[pluginName];\r\n });\r\n });\r\n","function _extends() {\n module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _extends.apply(this, arguments);\n}\n\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { each, hasOwnProperty, keys, push, isEmptyObject } from 'support/utils';\r\nimport { type, isArray, isUndefined, isPlainObject, isString } from 'support/utils/types';\r\nimport { PlainObject, PartialOptions } from 'typings';\r\n\r\nexport type OptionsObjectType = Record;\r\nexport type OptionsFunctionType = (this: any, ...args: any[]) => any;\r\nexport type OptionsTemplateType = ExtractPropsKey<\r\n OptionsTemplateTypeMap,\r\n T\r\n>;\r\nexport type OptionsTemplateTypes = keyof OptionsTemplateTypeMap;\r\nexport type OptionsTemplateNativeTypes = OptionsTemplateTypeMap[keyof OptionsTemplateTypeMap];\r\n\r\nexport type OptionsTemplateValue = T extends string\r\n ? string extends T\r\n ? OptionsTemplateValueNonEnum\r\n : string\r\n : OptionsTemplateValueNonEnum;\r\n\r\nexport type OptionsTemplate = {\r\n [P in keyof T]: T[P] extends OptionsObjectType\r\n ? OptionsTemplate\r\n : T[P] extends OptionsTemplateNativeTypes\r\n ? OptionsTemplateValue\r\n : never;\r\n};\r\n\r\nexport type OptionsValidationResult = [\r\n PartialOptions, // validated\r\n Record // foreign\r\n];\r\n\r\ntype OptionsTemplateTypeMap = {\r\n __TPL_boolean_TYPE__: boolean;\r\n __TPL_number_TYPE__: number;\r\n __TPL_string_TYPE__: string;\r\n __TPL_array_TYPE__: Array | ReadonlyArray;\r\n __TPL_function_TYPE__: OptionsFunctionType;\r\n __TPL_null_TYPE__: null;\r\n __TPL_object_TYPE__: OptionsObjectType;\r\n};\r\n\r\ntype OptionsTemplateValueNonEnum =\r\n | OptionsTemplateType\r\n | [OptionsTemplateType, ...Array];\r\n\r\ntype ExtractPropsKey = {\r\n [P in keyof T]: TProps extends T[P] ? P : never;\r\n}[keyof T];\r\n\r\ntype OptionsTemplateTypesDictionary = {\r\n readonly boolean: OptionsTemplateType;\r\n readonly number: OptionsTemplateType;\r\n readonly string: OptionsTemplateType;\r\n readonly array: OptionsTemplateType>;\r\n readonly object: OptionsTemplateType;\r\n readonly function: OptionsTemplateType;\r\n readonly null: OptionsTemplateType;\r\n};\r\n\r\nconst optionsTemplateTypes: OptionsTemplateTypesDictionary = {\r\n boolean: '__TPL_boolean_TYPE__',\r\n number: '__TPL_number_TYPE__',\r\n string: '__TPL_string_TYPE__',\r\n array: '__TPL_array_TYPE__',\r\n object: '__TPL_object_TYPE__',\r\n function: '__TPL_function_TYPE__',\r\n null: '__TPL_null_TYPE__',\r\n};\r\n\r\n/**\r\n * Validates the given options object according to the given template object and returns a object which looks like:\r\n * {\r\n * foreign : a object which consists of properties which aren't defined inside the template. (foreign properties)\r\n * validated : a object which consists only of valid properties. (property name is inside the template and value has a correct type)\r\n * }\r\n * @param template The template according to which the options object shall be validated.\r\n * @param options The options object which shall be validated.\r\n * @param optionsDiff When provided the returned validated object will only have properties which are different to this objects properties.\r\n * Example (assume all properties are valid to the template):\r\n * Options object : { a: 'a', b: 'b', c: 'c' }\r\n * optionsDiff object : { a: 'a', b: 'b', c: undefined }\r\n * Returned validated object : { c: 'c' }\r\n * Because the value of the properties a and b didn't change, they aren't included in the returned object.\r\n * Without the optionsDiff object the returned validated object would be: { a: 'a', b: 'b', c: 'c' }\r\n * @param doWriteErrors True if errors shall be logged into the console, false otherwise.\r\n * @param propPath The propertyPath which lead to this object. (used for error logging)\r\n */\r\nconst validateRecursive = (\r\n template: OptionsTemplate,\r\n options: PartialOptions,\r\n doWriteErrors?: boolean,\r\n propPath?: string\r\n): OptionsValidationResult => {\r\n const validatedOptions: PartialOptions = {};\r\n const optionsCopy: PartialOptions = { ...options };\r\n const props = keys(template).filter((prop) => hasOwnProperty(options, prop));\r\n\r\n each(props, (prop: Extract) => {\r\n const optionsValue: any = options[prop];\r\n const templateValue: PlainObject | string | OptionsTemplateTypes | Array =\r\n template[prop];\r\n const templateIsComplex = isPlainObject(templateValue);\r\n const propPrefix = propPath ? `${propPath}.` : '';\r\n\r\n // if the template has a object as value, it means that the options are complex (verschachtelt)\r\n if (templateIsComplex && isPlainObject(optionsValue)) {\r\n const [validated, foreign] = validateRecursive(\r\n templateValue as T,\r\n optionsValue,\r\n doWriteErrors,\r\n propPrefix + prop\r\n );\r\n validatedOptions[prop] = validated as any;\r\n optionsCopy[prop] = foreign as any;\r\n\r\n each([optionsCopy, validatedOptions], (value) => {\r\n if (isEmptyObject(value[prop])) {\r\n delete value[prop];\r\n }\r\n });\r\n } else if (!templateIsComplex) {\r\n let isValid = false;\r\n const errorEnumStrings: Array = [];\r\n const errorPossibleTypes: Array = [];\r\n const optionsValueType = type(optionsValue);\r\n const templateValueArr: Array = !isArray(templateValue)\r\n ? [templateValue as string | OptionsTemplateTypes]\r\n : (templateValue as Array);\r\n\r\n each(templateValueArr, (currTemplateType) => {\r\n // if currType value isn't inside possibleTemplateTypes we assume its a enum string value\r\n let typeString: string | undefined;\r\n each(optionsTemplateTypes, (value: string, key: string) => {\r\n if (value === currTemplateType) {\r\n typeString = key;\r\n }\r\n });\r\n const isEnumString = isUndefined(typeString);\r\n if (isEnumString && isString(optionsValue)) {\r\n // split it into a array which contains all possible values for example: [\"yes\", \"no\", \"maybe\"]\r\n const enumStringSplit = currTemplateType.split(' ');\r\n isValid = !!enumStringSplit.find((possibility) => possibility === optionsValue);\r\n\r\n // build error message\r\n push(errorEnumStrings, enumStringSplit);\r\n } else {\r\n isValid = optionsTemplateTypes[optionsValueType] === currTemplateType;\r\n }\r\n\r\n // build error message\r\n push(errorPossibleTypes, isEnumString ? optionsTemplateTypes.string : typeString!);\r\n\r\n // continue if invalid, break if valid\r\n return !isValid;\r\n });\r\n\r\n if (isValid) {\r\n validatedOptions[prop] = optionsValue;\r\n } else if (doWriteErrors) {\r\n console.warn(\r\n `${\r\n `The option \"${propPrefix}${prop}\" wasn't set, because it doesn't accept the type [ ${optionsValueType.toUpperCase()} ] with the value of \"${optionsValue}\".\\r\\n` +\r\n `Accepted types are: [ ${errorPossibleTypes.join(', ').toUpperCase()} ].\\r\\n`\r\n }${\r\n errorEnumStrings.length > 0\r\n ? `\\r\\nValid strings are: [ ${errorEnumStrings.join(', ')} ].`\r\n : ''\r\n }`\r\n );\r\n }\r\n\r\n delete optionsCopy[prop];\r\n }\r\n });\r\n\r\n return [validatedOptions, optionsCopy]; // optionsCopy equals now to foreign options\r\n};\r\n\r\n/**\r\n * Validates the given options object according to the given template object and returns a tuple which looks like:\r\n * [\r\n * validated : a object which consists only of valid properties. (property name is inside the template and value has a correct type)\r\n * foreign : a object which consists of properties which aren't defined inside the template. (foreign properties)\r\n * ]\r\n * @param template The template according to which the options object shall be validated.\r\n * @param options The options object which shall be validated.\r\n * @param doWriteErrors True if errors shall be logged into the console, false otherwise.\r\n */\r\nconst validateOptions = (\r\n template: OptionsTemplate,\r\n options: PartialOptions,\r\n doWriteErrors?: boolean\r\n): OptionsValidationResult => validateRecursive(template, options, doWriteErrors);\r\n\r\nexport { validateOptions, optionsTemplateTypes };\r\n","import { Options, OverflowBehavior, VisibilityBehavior, AutoHideBehavior } from 'options';\r\nimport {\r\n validateOptions,\r\n OptionsTemplate,\r\n OptionsTemplateValue,\r\n optionsTemplateTypes as oTypes,\r\n} from 'plugins/optionsValidationPlugin/validation';\r\nimport type { PartialOptions } from 'typings';\r\nimport type { Plugin } from 'plugins';\r\n\r\nconst numberAllowedValues: OptionsTemplateValue = oTypes.number;\r\nconst booleanAllowedValues: OptionsTemplateValue = oTypes.boolean;\r\nconst arrayNullValues: OptionsTemplateValue | null> = [oTypes.array, oTypes.null];\r\nconst overflowAllowedValues: OptionsTemplateValue =\r\n 'hidden scroll visible visible-hidden';\r\nconst scrollbarsVisibilityAllowedValues: OptionsTemplateValue =\r\n 'visible hidden auto';\r\nconst scrollbarsAutoHideAllowedValues: OptionsTemplateValue =\r\n 'never scroll leavemove';\r\n\r\nconst optionsTemplate: OptionsTemplate = {\r\n // resize: resizeAllowedValues, // none || both || horizontal || vertical || n || b ||\r\n paddingAbsolute: booleanAllowedValues, // true || false\r\n updating: {\r\n elementEvents: arrayNullValues, // array of tuples || null\r\n attributes: arrayNullValues,\r\n debounce: [oTypes.number, oTypes.array, oTypes.null], // number || number array || null\r\n ignoreMutation: [oTypes.function, oTypes.null], // function || null\r\n },\r\n overflow: {\r\n x: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scrol\r\n y: overflowAllowedValues, // visible-hidden || visible-scroll || hidden || scrol\r\n },\r\n scrollbars: {\r\n visibility: scrollbarsVisibilityAllowedValues, // visible || hidden || auto || v ||\r\n autoHide: scrollbarsAutoHideAllowedValues, // never || scroll || leave || move ||\r\n autoHideDelay: numberAllowedValues, // number\r\n dragScroll: booleanAllowedValues, // true || false\r\n clickScroll: booleanAllowedValues, // true || false\r\n touch: booleanAllowedValues, // true || false\r\n },\r\n /*\r\n textarea: {\r\n dynWidth: booleanAllowedValues, // true || false\r\n dynHeight: booleanAllowedValues, // true || false\r\n inheritedAttrs: stringArrayNullAllowedValues, // string || array || nul\r\n },\r\n */\r\n nativeScrollbarsOverlaid: {\r\n show: booleanAllowedValues, // true || false\r\n initialize: booleanAllowedValues, // true || false\r\n },\r\n};\r\n\r\nexport type OptionsValidationPluginInstance = {\r\n _: (options: PartialOptions, doWriteErrors?: boolean) => PartialOptions;\r\n};\r\n\r\nexport const optionsValidationPluginName = '__osOptionsValidationPlugin';\r\n\r\nexport const optionsValidationPlugin: Plugin = {\r\n [optionsValidationPluginName]: {\r\n _: (options: PartialOptions, doWriteErrors?: boolean) => {\r\n const [validated, foreign] = validateOptions(optionsTemplate, options, doWriteErrors);\r\n return { ...foreign, ...validated };\r\n },\r\n },\r\n};\r\n","import {\r\n createDOM,\r\n style,\r\n appendChildren,\r\n offsetSize,\r\n scrollLeft,\r\n scrollTop,\r\n on,\r\n stopAndPrevent,\r\n addClass,\r\n equalWH,\r\n push,\r\n cAF,\r\n rAF,\r\n} from 'support';\r\nimport {\r\n classNameSizeObserverListenerScroll,\r\n classNameSizeObserverListenerItem,\r\n classNameSizeObserverListenerItemFinal,\r\n} from 'classnames';\r\nimport type { Plugin } from 'plugins';\r\n\r\nexport type SizeObserverPluginInstance = {\r\n _: (\r\n listenerElement: HTMLElement,\r\n onSizeChangedCallback: (appear: boolean) => any,\r\n observeAppearChange: boolean\r\n ) => [appearCallback: () => any, offFns: (() => any)[]];\r\n};\r\n\r\nconst scrollAmount = 3333333;\r\nconst scrollEventName = 'scroll';\r\nexport const sizeObserverPluginName = '__osSizeObserverPlugin';\r\n\r\nexport const sizeObserverPlugin: Plugin = {\r\n [sizeObserverPluginName]: {\r\n _: (listenerElement, onSizeChangedCallback, observeAppearChange) => {\r\n const observerElementChildren = createDOM(\r\n ``\r\n );\r\n appendChildren(listenerElement, observerElementChildren);\r\n addClass(listenerElement, classNameSizeObserverListenerScroll);\r\n const observerElementChildrenRoot = observerElementChildren[0] as HTMLElement;\r\n const shrinkElement = observerElementChildrenRoot.lastChild as HTMLElement;\r\n const expandElement = observerElementChildrenRoot.firstChild as HTMLElement;\r\n const expandElementChild = expandElement?.firstChild as HTMLElement;\r\n\r\n let cacheSize = offsetSize(observerElementChildrenRoot);\r\n let currSize = cacheSize;\r\n let isDirty = false;\r\n let rAFId: number;\r\n\r\n const reset = () => {\r\n scrollLeft(expandElement, scrollAmount);\r\n scrollTop(expandElement, scrollAmount);\r\n scrollLeft(shrinkElement, scrollAmount);\r\n scrollTop(shrinkElement, scrollAmount);\r\n };\r\n const onResized = (appear?: unknown) => {\r\n rAFId = 0;\r\n if (isDirty) {\r\n cacheSize = currSize;\r\n onSizeChangedCallback(appear === true);\r\n }\r\n };\r\n const onScroll = (scrollEvent?: Event | false) => {\r\n currSize = offsetSize(observerElementChildrenRoot);\r\n isDirty = !scrollEvent || !equalWH(currSize, cacheSize);\r\n\r\n if (scrollEvent) {\r\n stopAndPrevent(scrollEvent);\r\n\r\n if (isDirty && !rAFId) {\r\n cAF!(rAFId);\r\n rAFId = rAF!(onResized);\r\n }\r\n } else {\r\n onResized(scrollEvent === false);\r\n }\r\n\r\n reset();\r\n };\r\n const offListeners = push(\r\n [],\r\n [on(expandElement, scrollEventName, onScroll), on(shrinkElement, scrollEventName, onScroll)]\r\n );\r\n\r\n // lets assume that the divs will never be that large and a constant value is enough\r\n style(expandElementChild, {\r\n width: scrollAmount,\r\n height: scrollAmount,\r\n });\r\n\r\n reset();\r\n\r\n return [observeAppearChange ? onScroll.bind(0, false) : reset, offListeners];\r\n },\r\n },\r\n};\r\n","import { keys, attr, WH, style, addClass, removeClass, noop, each } from 'support';\r\nimport { getEnvironment } from 'environment';\r\nimport { classNameViewportArrange } from 'classnames';\r\nimport type { StyleObject } from 'typings';\r\nimport type { StructureSetupState } from 'setups/structureSetup';\r\nimport type {\r\n ViewportOverflowState,\r\n GetViewportOverflowState,\r\n HideNativeScrollbars,\r\n} from 'setups/structureSetup/updateSegments/overflowUpdateSegment';\r\nimport type { Plugin } from 'plugins';\r\n\r\nexport type ArrangeViewport = (\r\n viewportOverflowState: ViewportOverflowState,\r\n viewportScrollSize: WH,\r\n sizeFraction: WH,\r\n directionIsRTL: boolean\r\n) => boolean;\r\n\r\nexport type UndoViewportArrangeResult = [\r\n redoViewportArrange: () => void,\r\n overflowState?: ViewportOverflowState\r\n];\r\n\r\nexport type UndoArrangeViewport = (\r\n showNativeOverlaidScrollbars: boolean,\r\n directionIsRTL: boolean,\r\n viewportOverflowState?: ViewportOverflowState\r\n) => UndoViewportArrangeResult;\r\n\r\nexport type ScrollbarsHidingPluginInstance = {\r\n _createUniqueViewportArrangeElement(): HTMLStyleElement | false;\r\n _overflowUpdateSegment(\r\n doViewportArrange: boolean,\r\n viewport: HTMLElement,\r\n viewportArrange: HTMLStyleElement | false | null | undefined,\r\n getState: () => StructureSetupState,\r\n getViewportOverflowState: GetViewportOverflowState,\r\n hideNativeScrollbars: HideNativeScrollbars\r\n ): [ArrangeViewport, UndoArrangeViewport];\r\n};\r\n\r\nlet contentArrangeCounter = 0;\r\n\r\nexport const scrollbarsHidingPluginName = '__osScrollbarsHidingPlugin';\r\n\r\nexport const scrollbarsHidingPlugin: Plugin