UNPKG

vite-plugin-inspect

Version:

Inspect the intermediate state of Vite plugins

39,082 lines 1.27 MB
import { Fragment, KeepAlive, Suspense, computed, createBaseVNode, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, resolveComponent, resolveDynamicComponent, toDisplayString, unref, watch, withCtx, withDirectives } from "./runtime-core.esm-bundler-BYdEh_Lp.js";
import { useRoute, useRouter, vModelCheckbox, vModelText } from "./vue-router-DP5m7_x8.js";
import { usePayloadStore } from "./payload-BKj06nBe.js";
import "./_plugin-vue_export-helper-DfavQbjy.js";
import { Container_default, NavBar_default, QuerySelector_default } from "./QuerySelector-CM_pgBDK.js";
import { useOptionsStore } from "./options-C60pcttb.js";
import { ModuleList_default } from "./ModuleList-DVacKD_e.js";
import { useSearchResults } from "./search-Bta8DXiP.js";
const _hoisted_1$3 = { flex: "~ gap-1" };
const _hoisted_2$3 = [
	"id",
	"name",
	"checked",
	"value"
];
var RadioGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "RadioGroup",
	props: {
		name: {},
		modelValue: {},
		options: {}
	},
	emits: ["update:modelValue"],
	setup(__props, { emit: __emit }) {
		const emit = __emit;
		function onChange(e) {
			const target = e.target;
			emit("update:modelValue", target.value);
		}
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("div", _hoisted_1$3, [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, (opt) => {
				return openBlock(), createElementBlock("label", {
					key: opt.value,
					flex: "~ gap-2"
				}, [createBaseVNode("input", {
					id: opt.value,
					name: _ctx.name,
					checked: _ctx.modelValue === opt.value,
					value: opt.value,
					type: "radio",
					onChange
				}, null, 40, _hoisted_2$3), createBaseVNode("div", null, toDisplayString(opt.label), 1)]);
			}), 128))]);
		};
	}
});
var RadioGroup_default = RadioGroup_vue_vue_type_script_setup_true_lang_default;
/**
* vis-data
* http://visjs.org/
*
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
*
* @version 7.1.7
* @date    2023-09-13T18:13:28.258Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
*   1. The Apache 2.0 License
*      http://www.apache.org/licenses/LICENSE-2.0
*
*   and
*
*   2. The MIT License
*      http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
function _classCallCheck$1(instance, Constructor) {
	if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
var commonjsGlobal$1 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs$1(x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var defineProperty$f$1 = { exports: {} };
var check$1 = function(it$1) {
	return it$1 && it$1.Math == Math && it$1;
};
var global$m = check$1(typeof globalThis == "object" && globalThis) || check$1(typeof window == "object" && window) || check$1(typeof self == "object" && self) || check$1(typeof commonjsGlobal$1 == "object" && commonjsGlobal$1) || function() {
	return this;
}() || Function("return this")();
var fails$t$1 = function(exec$4) {
	try {
		return !!exec$4();
	} catch (error) {
		return true;
	}
};
var fails$s$1 = fails$t$1;
var functionBindNative$1 = !fails$s$1(function() {
	var test$4 = function() {}.bind();
	return typeof test$4 != "function" || test$4.hasOwnProperty("prototype");
});
var NATIVE_BIND$4$1 = functionBindNative$1;
var FunctionPrototype$3$1 = Function.prototype;
var apply$6 = FunctionPrototype$3$1.apply;
var call$k = FunctionPrototype$3$1.call;
var functionApply$1 = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND$4$1 ? call$k.bind(apply$6) : function() {
	return call$k.apply(apply$6, arguments);
});
var NATIVE_BIND$3$1 = functionBindNative$1;
var FunctionPrototype$2$1 = Function.prototype;
var call$j = FunctionPrototype$2$1.call;
var uncurryThisWithBind$1 = NATIVE_BIND$3$1 && FunctionPrototype$2$1.bind.bind(call$j, call$j);
var functionUncurryThis$1 = NATIVE_BIND$3$1 ? uncurryThisWithBind$1 : function(fn) {
	return function() {
		return call$j.apply(fn, arguments);
	};
};
var uncurryThis$q$1 = functionUncurryThis$1;
var toString$9$1 = uncurryThis$q$1({}.toString);
var stringSlice$1$1 = uncurryThis$q$1("".slice);
var classofRaw$2$1 = function(it$1) {
	return stringSlice$1$1(toString$9$1(it$1), 8, -1);
};
var classofRaw$1$1 = classofRaw$2$1;
var uncurryThis$p$1 = functionUncurryThis$1;
var functionUncurryThisClause$1 = function(fn) {
	if (classofRaw$1$1(fn) === "Function") return uncurryThis$p$1(fn);
};
var documentAll$2$1 = typeof document == "object" && document.all;
var IS_HTMLDDA$1 = typeof documentAll$2$1 == "undefined" && documentAll$2$1 !== void 0;
var documentAll_1$1 = {
	all: documentAll$2$1,
	IS_HTMLDDA: IS_HTMLDDA$1
};
var $documentAll$1$1 = documentAll_1$1;
var documentAll$1$1 = $documentAll$1$1.all;
var isCallable$m = $documentAll$1$1.IS_HTMLDDA ? function(argument) {
	return typeof argument == "function" || argument === documentAll$1$1;
} : function(argument) {
	return typeof argument == "function";
};
var objectGetOwnPropertyDescriptor$1 = {};
var fails$r$1 = fails$t$1;
var descriptors$1 = !fails$r$1(function() {
	return Object.defineProperty({}, 1, { get: function() {
		return 7;
	} })[1] != 7;
});
var NATIVE_BIND$2$1 = functionBindNative$1;
var call$i = Function.prototype.call;
var functionCall$1 = NATIVE_BIND$2$1 ? call$i.bind(call$i) : function() {
	return call$i.apply(call$i, arguments);
};
var objectPropertyIsEnumerable$1 = {};
var $propertyIsEnumerable$1$1 = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor$7$1 = Object.getOwnPropertyDescriptor;
var NASHORN_BUG$1 = getOwnPropertyDescriptor$7$1 && !$propertyIsEnumerable$1$1.call({ 1: 2 }, 1);
objectPropertyIsEnumerable$1.f = NASHORN_BUG$1 ? function propertyIsEnumerable$1(V) {
	var descriptor = getOwnPropertyDescriptor$7$1(this, V);
	return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable$1$1;
var createPropertyDescriptor$7 = function(bitmap, value) {
	return {
		enumerable: !(bitmap & 1),
		configurable: !(bitmap & 2),
		writable: !(bitmap & 4),
		value
	};
};
var uncurryThis$o$1 = functionUncurryThis$1;
var fails$q$1 = fails$t$1;
var classof$f = classofRaw$2$1;
var $Object$4$1 = Object;
var split$1 = uncurryThis$o$1("".split);
var indexedObject$1 = fails$q$1(function() {
	return !$Object$4$1("z").propertyIsEnumerable(0);
}) ? function(it$1) {
	return classof$f(it$1) == "String" ? split$1(it$1, "") : $Object$4$1(it$1);
} : $Object$4$1;
var isNullOrUndefined$5$1 = function(it$1) {
	return it$1 === null || it$1 === void 0;
};
var isNullOrUndefined$4$1 = isNullOrUndefined$5$1;
var $TypeError$g$1 = TypeError;
var requireObjectCoercible$3$1 = function(it$1) {
	if (isNullOrUndefined$4$1(it$1)) throw $TypeError$g$1("Can't call method on " + it$1);
	return it$1;
};
var IndexedObject$3$1 = indexedObject$1;
var requireObjectCoercible$2$1 = requireObjectCoercible$3$1;
var toIndexedObject$a$1 = function(it$1) {
	return IndexedObject$3$1(requireObjectCoercible$2$1(it$1));
};
var isCallable$l = isCallable$m;
var $documentAll$2 = documentAll_1$1;
var documentAll$3 = $documentAll$2.all;
var isObject$h$1 = $documentAll$2.IS_HTMLDDA ? function(it$1) {
	return typeof it$1 == "object" ? it$1 !== null : isCallable$l(it$1) || it$1 === documentAll$3;
} : function(it$1) {
	return typeof it$1 == "object" ? it$1 !== null : isCallable$l(it$1);
};
var path$o$1 = {};
var path$n$1 = path$o$1;
var global$l$1 = global$m;
var isCallable$k = isCallable$m;
var aFunction$1 = function(variable) {
	return isCallable$k(variable) ? variable : void 0;
};
var getBuiltIn$f = function(namespace, method$11) {
	return arguments.length < 2 ? aFunction$1(path$n$1[namespace]) || aFunction$1(global$l$1[namespace]) : path$n$1[namespace] && path$n$1[namespace][method$11] || global$l$1[namespace] && global$l$1[namespace][method$11];
};
var uncurryThis$n$1 = functionUncurryThis$1;
var objectIsPrototypeOf$1 = uncurryThis$n$1({}.isPrototypeOf);
var engineUserAgent$1 = typeof navigator != "undefined" && String(navigator.userAgent) || "";
var global$k$1 = global$m;
var userAgent$5 = engineUserAgent$1;
var process$4 = global$k$1.process;
var Deno$1$1 = global$k$1.Deno;
var versions$1 = process$4 && process$4.versions || Deno$1$1 && Deno$1$1.version;
var v8$1 = versions$1 && versions$1.v8;
var match$1, version$1;
if (v8$1) {
	match$1 = v8$1.split(".");
	version$1 = match$1[0] > 0 && match$1[0] < 4 ? 1 : +(match$1[0] + match$1[1]);
}
if (!version$1 && userAgent$5) {
	match$1 = userAgent$5.match(/Edge\/(\d+)/);
	if (!match$1 || match$1[1] >= 74) {
		match$1 = userAgent$5.match(/Chrome\/(\d+)/);
		if (match$1) version$1 = +match$1[1];
	}
}
var engineV8Version$1 = version$1;
var V8_VERSION$3 = engineV8Version$1;
var fails$p$1 = fails$t$1;
var symbolConstructorDetection$1 = !!Object.getOwnPropertySymbols && !fails$p$1(function() {
	var symbol$8 = Symbol();
	return !String(symbol$8) || !(Object(symbol$8) instanceof Symbol) || !Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41;
});
var NATIVE_SYMBOL$5$1 = symbolConstructorDetection$1;
var useSymbolAsUid$1 = NATIVE_SYMBOL$5$1 && !Symbol.sham && typeof Symbol.iterator == "symbol";
var getBuiltIn$e = getBuiltIn$f;
var isCallable$j = isCallable$m;
var isPrototypeOf$j$1 = objectIsPrototypeOf$1;
var USE_SYMBOL_AS_UID$1$1 = useSymbolAsUid$1;
var $Object$3$1 = Object;
var isSymbol$5$1 = USE_SYMBOL_AS_UID$1$1 ? function(it$1) {
	return typeof it$1 == "symbol";
} : function(it$1) {
	var $Symbol$2 = getBuiltIn$e("Symbol");
	return isCallable$j($Symbol$2) && isPrototypeOf$j$1($Symbol$2.prototype, $Object$3$1(it$1));
};
var $String$4$1 = String;
var tryToString$6$1 = function(argument) {
	try {
		return $String$4$1(argument);
	} catch (error) {
		return "Object";
	}
};
var isCallable$i$1 = isCallable$m;
var tryToString$5$1 = tryToString$6$1;
var $TypeError$f$1 = TypeError;
var aCallable$e = function(argument) {
	if (isCallable$i$1(argument)) return argument;
	throw $TypeError$f$1(tryToString$5$1(argument) + " is not a function");
};
var aCallable$d = aCallable$e;
var isNullOrUndefined$3$1 = isNullOrUndefined$5$1;
var getMethod$3$1 = function(V, P) {
	var func = V[P];
	return isNullOrUndefined$3$1(func) ? void 0 : aCallable$d(func);
};
var call$h = functionCall$1;
var isCallable$h$1 = isCallable$m;
var isObject$g$1 = isObject$h$1;
var $TypeError$e$1 = TypeError;
var ordinaryToPrimitive$1$1 = function(input, pref) {
	var fn, val;
	if (pref === "string" && isCallable$h$1(fn = input.toString) && !isObject$g$1(val = call$h(fn, input))) return val;
	if (isCallable$h$1(fn = input.valueOf) && !isObject$g$1(val = call$h(fn, input))) return val;
	if (pref !== "string" && isCallable$h$1(fn = input.toString) && !isObject$g$1(val = call$h(fn, input))) return val;
	throw $TypeError$e$1("Can't convert object to primitive value");
};
var shared$7$1 = { exports: {} };
var isPure = true;
var global$j$1 = global$m;
var defineProperty$e$1 = Object.defineProperty;
var defineGlobalProperty$1$1 = function(key, value) {
	try {
		defineProperty$e$1(global$j$1, key, {
			value,
			configurable: true,
			writable: true
		});
	} catch (error) {
		global$j$1[key] = value;
	}
	return value;
};
var global$i$1 = global$m;
var defineGlobalProperty$2 = defineGlobalProperty$1$1;
var SHARED$1 = "__core-js_shared__";
var store$3$1 = global$i$1[SHARED$1] || defineGlobalProperty$2(SHARED$1, {});
var sharedStore$1 = store$3$1;
var store$2$1 = sharedStore$1;
(shared$7$1.exports = function(key, value) {
	return store$2$1[key] || (store$2$1[key] = value !== void 0 ? value : {});
})("versions", []).push({
	version: "3.29.0",
	mode: "pure",
	copyright: "© 2014-2023 Denis Pushkarev (zloirock.ru)",
	license: "https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE",
	source: "https://github.com/zloirock/core-js"
});
var sharedExports$1 = shared$7$1.exports;
var requireObjectCoercible$1$1 = requireObjectCoercible$3$1;
var $Object$2$1 = Object;
var toObject$d$1 = function(argument) {
	return $Object$2$1(requireObjectCoercible$1$1(argument));
};
var uncurryThis$m$1 = functionUncurryThis$1;
var toObject$c$1 = toObject$d$1;
var hasOwnProperty$1 = uncurryThis$m$1({}.hasOwnProperty);
var hasOwnProperty_1$1 = Object.hasOwn || function hasOwn$11(it$1, key) {
	return hasOwnProperty$1(toObject$c$1(it$1), key);
};
var uncurryThis$l$1 = functionUncurryThis$1;
var id$1$1 = 0;
var postfix$1 = Math.random();
var toString$8$1 = uncurryThis$l$1(1 .toString);
var uid$4$1 = function(key) {
	return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString$8$1(++id$1$1 + postfix$1, 36);
};
var global$h$1 = global$m;
var shared$6$1 = sharedExports$1;
var hasOwn$j = hasOwnProperty_1$1;
var uid$3$1 = uid$4$1;
var NATIVE_SYMBOL$4$1 = symbolConstructorDetection$1;
var USE_SYMBOL_AS_UID$2 = useSymbolAsUid$1;
var Symbol$3$1 = global$h$1.Symbol;
var WellKnownSymbolsStore$2$1 = shared$6$1("wks");
var createWellKnownSymbol$1 = USE_SYMBOL_AS_UID$2 ? Symbol$3$1["for"] || Symbol$3$1 : Symbol$3$1 && Symbol$3$1.withoutSetter || uid$3$1;
var wellKnownSymbol$m = function(name) {
	if (!hasOwn$j(WellKnownSymbolsStore$2$1, name)) WellKnownSymbolsStore$2$1[name] = NATIVE_SYMBOL$4$1 && hasOwn$j(Symbol$3$1, name) ? Symbol$3$1[name] : createWellKnownSymbol$1("Symbol." + name);
	return WellKnownSymbolsStore$2$1[name];
};
var call$g = functionCall$1;
var isObject$f$1 = isObject$h$1;
var isSymbol$4$1 = isSymbol$5$1;
var getMethod$2$1 = getMethod$3$1;
var ordinaryToPrimitive$2 = ordinaryToPrimitive$1$1;
var wellKnownSymbol$l$1 = wellKnownSymbol$m;
var $TypeError$d$1 = TypeError;
var TO_PRIMITIVE$1 = wellKnownSymbol$l$1("toPrimitive");
var toPrimitive$7$1 = function(input, pref) {
	if (!isObject$f$1(input) || isSymbol$4$1(input)) return input;
	var exoticToPrim = getMethod$2$1(input, TO_PRIMITIVE$1);
	var result;
	if (exoticToPrim) {
		if (pref === void 0) pref = "default";
		result = call$g(exoticToPrim, input, pref);
		if (!isObject$f$1(result) || isSymbol$4$1(result)) return result;
		throw $TypeError$d$1("Can't convert object to primitive value");
	}
	if (pref === void 0) pref = "number";
	return ordinaryToPrimitive$2(input, pref);
};
var toPrimitive$6$1 = toPrimitive$7$1;
var isSymbol$3$1 = isSymbol$5$1;
var toPropertyKey$4$1 = function(argument) {
	var key = toPrimitive$6$1(argument, "string");
	return isSymbol$3$1(key) ? key : key + "";
};
var global$g$1 = global$m;
var isObject$e$1 = isObject$h$1;
var document$3 = global$g$1.document;
var EXISTS$1$1 = isObject$e$1(document$3) && isObject$e$1(document$3.createElement);
var documentCreateElement$1$1 = function(it$1) {
	return EXISTS$1$1 ? document$3.createElement(it$1) : {};
};
var DESCRIPTORS$h$1 = descriptors$1;
var fails$o$1 = fails$t$1;
var createElement$1 = documentCreateElement$1$1;
var ie8DomDefine$1 = !DESCRIPTORS$h$1 && !fails$o$1(function() {
	return Object.defineProperty(createElement$1("div"), "a", { get: function() {
		return 7;
	} }).a != 7;
});
var DESCRIPTORS$g$1 = descriptors$1;
var call$f$1 = functionCall$1;
var propertyIsEnumerableModule$2$1 = objectPropertyIsEnumerable$1;
var createPropertyDescriptor$6 = createPropertyDescriptor$7;
var toIndexedObject$9$1 = toIndexedObject$a$1;
var toPropertyKey$3$1 = toPropertyKey$4$1;
var hasOwn$i = hasOwnProperty_1$1;
var IE8_DOM_DEFINE$1$1 = ie8DomDefine$1;
var $getOwnPropertyDescriptor$2$1 = Object.getOwnPropertyDescriptor;
objectGetOwnPropertyDescriptor$1.f = DESCRIPTORS$g$1 ? $getOwnPropertyDescriptor$2$1 : function getOwnPropertyDescriptor$11(O, P) {
	O = toIndexedObject$9$1(O);
	P = toPropertyKey$3$1(P);
	if (IE8_DOM_DEFINE$1$1) try {
		return $getOwnPropertyDescriptor$2$1(O, P);
	} catch (error) {}
	if (hasOwn$i(O, P)) return createPropertyDescriptor$6(!call$f$1(propertyIsEnumerableModule$2$1.f, O, P), O[P]);
};
var fails$n$1 = fails$t$1;
var isCallable$g$1 = isCallable$m;
var replacement$1 = /#|\.prototype\./;
var isForced$2 = function(feature, detection) {
	var value = data$1[normalize$1(feature)];
	return value == POLYFILL$1 ? true : value == NATIVE$1 ? false : isCallable$g$1(detection) ? fails$n$1(detection) : !!detection;
};
var normalize$1 = isForced$2.normalize = function(string$1) {
	return String(string$1).replace(replacement$1, ".").toLowerCase();
};
var data$1 = isForced$2.data = {};
var NATIVE$1 = isForced$2.NATIVE = "N";
var POLYFILL$1 = isForced$2.POLYFILL = "P";
var isForced_1$1 = isForced$2;
var uncurryThis$k$1 = functionUncurryThisClause$1;
var aCallable$c = aCallable$e;
var NATIVE_BIND$1$1 = functionBindNative$1;
var bind$j = uncurryThis$k$1(uncurryThis$k$1.bind);
var functionBindContext$1 = function(fn, that) {
	aCallable$c(fn);
	return that === void 0 ? fn : NATIVE_BIND$1$1 ? bind$j(fn, that) : function() {
		return fn.apply(that, arguments);
	};
};
var objectDefineProperty$1 = {};
var DESCRIPTORS$f$1 = descriptors$1;
var fails$m$1 = fails$t$1;
var v8PrototypeDefineBug$1 = DESCRIPTORS$f$1 && fails$m$1(function() {
	return Object.defineProperty(function() {}, "prototype", {
		value: 42,
		writable: false
	}).prototype != 42;
});
var isObject$d$1 = isObject$h$1;
var $String$3$1 = String;
var $TypeError$c$1 = TypeError;
var anObject$d$1 = function(argument) {
	if (isObject$d$1(argument)) return argument;
	throw $TypeError$c$1($String$3$1(argument) + " is not an object");
};
var DESCRIPTORS$e$1 = descriptors$1;
var IE8_DOM_DEFINE$2 = ie8DomDefine$1;
var V8_PROTOTYPE_DEFINE_BUG$1$1 = v8PrototypeDefineBug$1;
var anObject$c$1 = anObject$d$1;
var toPropertyKey$2$1 = toPropertyKey$4$1;
var $TypeError$b$1 = TypeError;
var $defineProperty$1$1 = Object.defineProperty;
var $getOwnPropertyDescriptor$1$1 = Object.getOwnPropertyDescriptor;
var ENUMERABLE$1 = "enumerable";
var CONFIGURABLE$1$1 = "configurable";
var WRITABLE$1 = "writable";
objectDefineProperty$1.f = DESCRIPTORS$e$1 ? V8_PROTOTYPE_DEFINE_BUG$1$1 ? function defineProperty$11(O, P, Attributes) {
	anObject$c$1(O);
	P = toPropertyKey$2$1(P);
	anObject$c$1(Attributes);
	if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE$1 in Attributes && !Attributes[WRITABLE$1]) {
		var current = $getOwnPropertyDescriptor$1$1(O, P);
		if (current && current[WRITABLE$1]) {
			O[P] = Attributes.value;
			Attributes = {
				configurable: CONFIGURABLE$1$1 in Attributes ? Attributes[CONFIGURABLE$1$1] : current[CONFIGURABLE$1$1],
				enumerable: ENUMERABLE$1 in Attributes ? Attributes[ENUMERABLE$1] : current[ENUMERABLE$1],
				writable: false
			};
		}
	}
	return $defineProperty$1$1(O, P, Attributes);
} : $defineProperty$1$1 : function defineProperty$11(O, P, Attributes) {
	anObject$c$1(O);
	P = toPropertyKey$2$1(P);
	anObject$c$1(Attributes);
	if (IE8_DOM_DEFINE$2) try {
		return $defineProperty$1$1(O, P, Attributes);
	} catch (error) {}
	if ("get" in Attributes || "set" in Attributes) throw $TypeError$b$1("Accessors not supported");
	if ("value" in Attributes) O[P] = Attributes.value;
	return O;
};
var DESCRIPTORS$d$1 = descriptors$1;
var definePropertyModule$4 = objectDefineProperty$1;
var createPropertyDescriptor$5$1 = createPropertyDescriptor$7;
var createNonEnumerableProperty$9 = DESCRIPTORS$d$1 ? function(object$1, key, value) {
	return definePropertyModule$4.f(object$1, key, createPropertyDescriptor$5$1(1, value));
} : function(object$1, key, value) {
	object$1[key] = value;
	return object$1;
};
var global$f$1 = global$m;
var apply$5$1 = functionApply$1;
var uncurryThis$j$1 = functionUncurryThisClause$1;
var isCallable$f$1 = isCallable$m;
var getOwnPropertyDescriptor$6$1 = objectGetOwnPropertyDescriptor$1.f;
var isForced$1$1 = isForced_1$1;
var path$m$1 = path$o$1;
var bind$i = functionBindContext$1;
var createNonEnumerableProperty$8 = createNonEnumerableProperty$9;
var hasOwn$h$1 = hasOwnProperty_1$1;
var wrapConstructor$1 = function(NativeConstructor) {
	var Wrapper = function(a, b, c$1) {
		if (this instanceof Wrapper) {
			switch (arguments.length) {
				case 0: return new NativeConstructor();
				case 1: return new NativeConstructor(a);
				case 2: return new NativeConstructor(a, b);
			}
			return new NativeConstructor(a, b, c$1);
		}
		return apply$5$1(NativeConstructor, this, arguments);
	};
	Wrapper.prototype = NativeConstructor.prototype;
	return Wrapper;
};
var _export$1 = function(options, source) {
	var TARGET = options.target;
	var GLOBAL = options.global;
	var STATIC = options.stat;
	var PROTO = options.proto;
	var nativeSource = GLOBAL ? global$f$1 : STATIC ? global$f$1[TARGET] : (global$f$1[TARGET] || {}).prototype;
	var target = GLOBAL ? path$m$1 : path$m$1[TARGET] || createNonEnumerableProperty$8(path$m$1, TARGET, {})[TARGET];
	var targetPrototype = target.prototype;
	var FORCED$11, USE_NATIVE, VIRTUAL_PROTOTYPE;
	var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
	for (key in source) {
		FORCED$11 = isForced$1$1(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
		USE_NATIVE = !FORCED$11 && nativeSource && hasOwn$h$1(nativeSource, key);
		targetProperty = target[key];
		if (USE_NATIVE) if (options.dontCallGetSet) {
			descriptor = getOwnPropertyDescriptor$6$1(nativeSource, key);
			nativeProperty = descriptor && descriptor.value;
		} else nativeProperty = nativeSource[key];
		sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
		if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
		if (options.bind && USE_NATIVE) resultProperty = bind$i(sourceProperty, global$f$1);
		else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor$1(sourceProperty);
		else if (PROTO && isCallable$f$1(sourceProperty)) resultProperty = uncurryThis$j$1(sourceProperty);
		else resultProperty = sourceProperty;
		if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) createNonEnumerableProperty$8(resultProperty, "sham", true);
		createNonEnumerableProperty$8(target, key, resultProperty);
		if (PROTO) {
			VIRTUAL_PROTOTYPE = TARGET + "Prototype";
			if (!hasOwn$h$1(path$m$1, VIRTUAL_PROTOTYPE)) createNonEnumerableProperty$8(path$m$1, VIRTUAL_PROTOTYPE, {});
			createNonEnumerableProperty$8(path$m$1[VIRTUAL_PROTOTYPE], key, sourceProperty);
			if (options.real && targetPrototype && (FORCED$11 || !targetPrototype[key])) createNonEnumerableProperty$8(targetPrototype, key, sourceProperty);
		}
	}
};
var $$L$1 = _export$1;
var DESCRIPTORS$c$1 = descriptors$1;
var defineProperty$d$1 = objectDefineProperty$1.f;
$$L$1({
	target: "Object",
	stat: true,
	forced: Object.defineProperty !== defineProperty$d$1,
	sham: !DESCRIPTORS$c$1
}, { defineProperty: defineProperty$d$1 });
var path$l$1 = path$o$1;
var Object$4$1 = path$l$1.Object;
var defineProperty$c$1 = defineProperty$f$1.exports = function defineProperty$11(it$1, key, desc) {
	return Object$4$1.defineProperty(it$1, key, desc);
};
if (Object$4$1.defineProperty.sham) defineProperty$c$1.sham = true;
var definePropertyExports$4 = defineProperty$f$1.exports;
var parent$15$1 = definePropertyExports$4;
var defineProperty$b$1 = parent$15$1;
var parent$14$1 = defineProperty$b$1;
var defineProperty$a$1 = parent$14$1;
var parent$13$1 = defineProperty$a$1;
var defineProperty$9$1 = parent$13$1;
var defineProperty$8$1 = defineProperty$9$1;
var defineProperty$7$1 = defineProperty$8$1;
var _Object$defineProperty$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(defineProperty$7$1);
var classof$e$1 = classofRaw$2$1;
var isArray$f$1 = Array.isArray || function isArray$11(argument) {
	return classof$e$1(argument) == "Array";
};
var ceil$1 = Math.ceil;
var floor$1$1 = Math.floor;
var mathTrunc$1 = Math.trunc || function trunc$2(x) {
	var n = +x;
	return (n > 0 ? floor$1$1 : ceil$1)(n);
};
var trunc$1 = mathTrunc$1;
var toIntegerOrInfinity$4$1 = function(argument) {
	var number$1 = +argument;
	return number$1 !== number$1 || number$1 === 0 ? 0 : trunc$1(number$1);
};
var toIntegerOrInfinity$3$1 = toIntegerOrInfinity$4$1;
var min$2$1 = Math.min;
var toLength$1$1 = function(argument) {
	return argument > 0 ? min$2$1(toIntegerOrInfinity$3$1(argument), 9007199254740991) : 0;
};
var toLength$2 = toLength$1$1;
var lengthOfArrayLike$c = function(obj) {
	return toLength$2(obj.length);
};
var $TypeError$a$1 = TypeError;
var MAX_SAFE_INTEGER$1 = 9007199254740991;
var doesNotExceedSafeInteger$3 = function(it$1) {
	if (it$1 > MAX_SAFE_INTEGER$1) throw $TypeError$a$1("Maximum allowed index exceeded");
	return it$1;
};
var toPropertyKey$1$1 = toPropertyKey$4$1;
var definePropertyModule$3$1 = objectDefineProperty$1;
var createPropertyDescriptor$4$1 = createPropertyDescriptor$7;
var createProperty$6$1 = function(object$1, key, value) {
	var propertyKey = toPropertyKey$1$1(key);
	if (propertyKey in object$1) definePropertyModule$3$1.f(object$1, propertyKey, createPropertyDescriptor$4$1(0, value));
	else object$1[propertyKey] = value;
};
var wellKnownSymbol$k$1 = wellKnownSymbol$m;
var TO_STRING_TAG$4 = wellKnownSymbol$k$1("toStringTag");
var test$2$1 = {};
test$2$1[TO_STRING_TAG$4] = "z";
var toStringTagSupport$1 = String(test$2$1) === "[object z]";
var TO_STRING_TAG_SUPPORT$2$1 = toStringTagSupport$1;
var isCallable$e$1 = isCallable$m;
var classofRaw$3 = classofRaw$2$1;
var wellKnownSymbol$j$1 = wellKnownSymbol$m;
var TO_STRING_TAG$3$1 = wellKnownSymbol$j$1("toStringTag");
var $Object$1$1 = Object;
var CORRECT_ARGUMENTS$1 = classofRaw$3(function() {
	return arguments;
}()) == "Arguments";
var tryGet$1 = function(it$1, key) {
	try {
		return it$1[key];
	} catch (error) {}
};
var classof$d$1 = TO_STRING_TAG_SUPPORT$2$1 ? classofRaw$3 : function(it$1) {
	var O, tag, result;
	return it$1 === void 0 ? "Undefined" : it$1 === null ? "Null" : typeof (tag = tryGet$1(O = $Object$1$1(it$1), TO_STRING_TAG$3$1)) == "string" ? tag : CORRECT_ARGUMENTS$1 ? classofRaw$3(O) : (result = classofRaw$3(O)) == "Object" && isCallable$e$1(O.callee) ? "Arguments" : result;
};
var uncurryThis$i$1 = functionUncurryThis$1;
var isCallable$d$1 = isCallable$m;
var store$1$1 = sharedStore$1;
var functionToString$1 = uncurryThis$i$1(Function.toString);
if (!isCallable$d$1(store$1$1.inspectSource)) store$1$1.inspectSource = function(it$1) {
	return functionToString$1(it$1);
};
var inspectSource$2 = store$1$1.inspectSource;
var uncurryThis$h$1 = functionUncurryThis$1;
var fails$l$1 = fails$t$1;
var isCallable$c$1 = isCallable$m;
var classof$c$1 = classof$d$1;
var getBuiltIn$d = getBuiltIn$f;
var inspectSource$1$1 = inspectSource$2;
var noop$1 = function() {};
var empty$1 = [];
var construct$4$1 = getBuiltIn$d("Reflect", "construct");
var constructorRegExp$1 = /^\s*(?:class|function)\b/;
var exec$1$1 = uncurryThis$h$1(constructorRegExp$1.exec);
var INCORRECT_TO_STRING$1 = !constructorRegExp$1.exec(noop$1);
var isConstructorModern$1 = function isConstructor$6(argument) {
	if (!isCallable$c$1(argument)) return false;
	try {
		construct$4$1(noop$1, empty$1, argument);
		return true;
	} catch (error) {
		return false;
	}
};
var isConstructorLegacy$1 = function isConstructor$6(argument) {
	if (!isCallable$c$1(argument)) return false;
	switch (classof$c$1(argument)) {
		case "AsyncFunction":
		case "GeneratorFunction":
		case "AsyncGeneratorFunction": return false;
	}
	try {
		return INCORRECT_TO_STRING$1 || !!exec$1$1(constructorRegExp$1, inspectSource$1$1(argument));
	} catch (error) {
		return true;
	}
};
isConstructorLegacy$1.sham = true;
var isConstructor$4$1 = !construct$4$1 || fails$l$1(function() {
	var called$2;
	return isConstructorModern$1(isConstructorModern$1.call) || !isConstructorModern$1(Object) || !isConstructorModern$1(function() {
		called$2 = true;
	}) || called$2;
}) ? isConstructorLegacy$1 : isConstructorModern$1;
var isArray$e$1 = isArray$f$1;
var isConstructor$3$1 = isConstructor$4$1;
var isObject$c$1 = isObject$h$1;
var wellKnownSymbol$i$1 = wellKnownSymbol$m;
var SPECIES$5 = wellKnownSymbol$i$1("species");
var $Array$3$1 = Array;
var arraySpeciesConstructor$1$1 = function(originalArray) {
	var C;
	if (isArray$e$1(originalArray)) {
		C = originalArray.constructor;
		if (isConstructor$3$1(C) && (C === $Array$3$1 || isArray$e$1(C.prototype))) C = void 0;
		else if (isObject$c$1(C)) {
			C = C[SPECIES$5];
			if (C === null) C = void 0;
		}
	}
	return C === void 0 ? $Array$3$1 : C;
};
var arraySpeciesConstructor$2 = arraySpeciesConstructor$1$1;
var arraySpeciesCreate$4 = function(originalArray, length$1) {
	return new (arraySpeciesConstructor$2(originalArray))(length$1 === 0 ? 0 : length$1);
};
var fails$k$1 = fails$t$1;
var wellKnownSymbol$h$1 = wellKnownSymbol$m;
var V8_VERSION$2$1 = engineV8Version$1;
var SPECIES$4 = wellKnownSymbol$h$1("species");
var arrayMethodHasSpeciesSupport$5$1 = function(METHOD_NAME) {
	return V8_VERSION$2$1 >= 51 || !fails$k$1(function() {
		var array$1 = [];
		var constructor = array$1.constructor = {};
		constructor[SPECIES$4] = function() {
			return { foo: 1 };
		};
		return array$1[METHOD_NAME](Boolean).foo !== 1;
	});
};
var $$K$1 = _export$1;
var fails$j$1 = fails$t$1;
var isArray$d$1 = isArray$f$1;
var isObject$b$1 = isObject$h$1;
var toObject$b$1 = toObject$d$1;
var lengthOfArrayLike$b$1 = lengthOfArrayLike$c;
var doesNotExceedSafeInteger$2$1 = doesNotExceedSafeInteger$3;
var createProperty$5$1 = createProperty$6$1;
var arraySpeciesCreate$3$1 = arraySpeciesCreate$4;
var arrayMethodHasSpeciesSupport$4$1 = arrayMethodHasSpeciesSupport$5$1;
var wellKnownSymbol$g$1 = wellKnownSymbol$m;
var V8_VERSION$1$1 = engineV8Version$1;
var IS_CONCAT_SPREADABLE$1 = wellKnownSymbol$g$1("isConcatSpreadable");
var IS_CONCAT_SPREADABLE_SUPPORT$1 = V8_VERSION$1$1 >= 51 || !fails$j$1(function() {
	var array$1 = [];
	array$1[IS_CONCAT_SPREADABLE$1] = false;
	return array$1.concat()[0] !== array$1;
});
var isConcatSpreadable$1 = function(O) {
	if (!isObject$b$1(O)) return false;
	var spreadable = O[IS_CONCAT_SPREADABLE$1];
	return spreadable !== void 0 ? !!spreadable : isArray$d$1(O);
};
var FORCED$5$1 = !IS_CONCAT_SPREADABLE_SUPPORT$1 || !arrayMethodHasSpeciesSupport$4$1("concat");
$$K$1({
	target: "Array",
	proto: true,
	arity: 1,
	forced: FORCED$5$1
}, { concat: function concat$8(arg) {
	var O = toObject$b$1(this);
	var A = arraySpeciesCreate$3$1(O, 0);
	var n = 0;
	var i$2, k, length$1, len, E;
	for (i$2 = -1, length$1 = arguments.length; i$2 < length$1; i$2++) {
		E = i$2 === -1 ? O : arguments[i$2];
		if (isConcatSpreadable$1(E)) {
			len = lengthOfArrayLike$b$1(E);
			doesNotExceedSafeInteger$2$1(n + len);
			for (k = 0; k < len; k++, n++) if (k in E) createProperty$5$1(A, n, E[k]);
		} else {
			doesNotExceedSafeInteger$2$1(n + 1);
			createProperty$5$1(A, n++, E);
		}
	}
	A.length = n;
	return A;
} });
var classof$b$1 = classof$d$1;
var $String$2$1 = String;
var toString$7$1 = function(argument) {
	if (classof$b$1(argument) === "Symbol") throw TypeError("Cannot convert a Symbol value to a string");
	return $String$2$1(argument);
};
var objectDefineProperties$1 = {};
var toIntegerOrInfinity$2$1 = toIntegerOrInfinity$4$1;
var max$3$1 = Math.max;
var min$1$1 = Math.min;
var toAbsoluteIndex$4$1 = function(index$1, length$1) {
	var integer = toIntegerOrInfinity$2$1(index$1);
	return integer < 0 ? max$3$1(integer + length$1, 0) : min$1$1(integer, length$1);
};
var toIndexedObject$8$1 = toIndexedObject$a$1;
var toAbsoluteIndex$3$1 = toAbsoluteIndex$4$1;
var lengthOfArrayLike$a$1 = lengthOfArrayLike$c;
var createMethod$3$1 = function(IS_INCLUDES) {
	return function($this, el, fromIndex) {
		var O = toIndexedObject$8$1($this);
		var length$1 = lengthOfArrayLike$a$1(O);
		var index$1 = toAbsoluteIndex$3$1(fromIndex, length$1);
		var value;
		if (IS_INCLUDES && el != el) while (length$1 > index$1) {
			value = O[index$1++];
			if (value != value) return true;
		}
		else for (; length$1 > index$1; index$1++) if ((IS_INCLUDES || index$1 in O) && O[index$1] === el) return IS_INCLUDES || index$1 || 0;
		return !IS_INCLUDES && -1;
	};
};
var arrayIncludes$1 = {
	includes: createMethod$3$1(true),
	indexOf: createMethod$3$1(false)
};
var hiddenKeys$6$1 = {};
var uncurryThis$g$1 = functionUncurryThis$1;
var hasOwn$g$1 = hasOwnProperty_1$1;
var toIndexedObject$7$1 = toIndexedObject$a$1;
var indexOf$5 = arrayIncludes$1.indexOf;
var hiddenKeys$5$1 = hiddenKeys$6$1;
var push$6$1 = uncurryThis$g$1([].push);
var objectKeysInternal$1 = function(object$1, names) {
	var O = toIndexedObject$7$1(object$1);
	var i$2 = 0;
	var result = [];
	var key;
	for (key in O) !hasOwn$g$1(hiddenKeys$5$1, key) && hasOwn$g$1(O, key) && push$6$1(result, key);
	while (names.length > i$2) if (hasOwn$g$1(O, key = names[i$2++])) ~indexOf$5(result, key) || push$6$1(result, key);
	return result;
};
var enumBugKeys$3$1 = [
	"constructor",
	"hasOwnProperty",
	"isPrototypeOf",
	"propertyIsEnumerable",
	"toLocaleString",
	"toString",
	"valueOf"
];
var internalObjectKeys$1$1 = objectKeysInternal$1;
var enumBugKeys$2$1 = enumBugKeys$3$1;
var objectKeys$3$1 = Object.keys || function keys$9(O) {
	return internalObjectKeys$1$1(O, enumBugKeys$2$1);
};
var DESCRIPTORS$b$1 = descriptors$1;
var V8_PROTOTYPE_DEFINE_BUG$2 = v8PrototypeDefineBug$1;
var definePropertyModule$2$1 = objectDefineProperty$1;
var anObject$b$1 = anObject$d$1;
var toIndexedObject$6$1 = toIndexedObject$a$1;
var objectKeys$2$1 = objectKeys$3$1;
objectDefineProperties$1.f = DESCRIPTORS$b$1 && !V8_PROTOTYPE_DEFINE_BUG$2 ? Object.defineProperties : function defineProperties$6(O, Properties) {
	anObject$b$1(O);
	var props = toIndexedObject$6$1(Properties);
	var keys$9 = objectKeys$2$1(Properties);
	var length$1 = keys$9.length;
	var index$1 = 0;
	var key;
	while (length$1 > index$1) definePropertyModule$2$1.f(O, key = keys$9[index$1++], props[key]);
	return O;
};
var getBuiltIn$c$1 = getBuiltIn$f;
var html$2 = getBuiltIn$c$1("document", "documentElement");
var shared$5$1 = sharedExports$1;
var uid$2$1 = uid$4$1;
var keys$7 = shared$5$1("keys");
var sharedKey$4$1 = function(key) {
	return keys$7[key] || (keys$7[key] = uid$2$1(key));
};
var anObject$a$1 = anObject$d$1;
var definePropertiesModule$1$1 = objectDefineProperties$1;
var enumBugKeys$1$1 = enumBugKeys$3$1;
var hiddenKeys$4$1 = hiddenKeys$6$1;
var html$1$1 = html$2;
var documentCreateElement$2 = documentCreateElement$1$1;
var sharedKey$3$1 = sharedKey$4$1;
var GT$1 = ">";
var LT$1 = "<";
var PROTOTYPE$1$1 = "prototype";
var SCRIPT$1 = "script";
var IE_PROTO$1$1 = sharedKey$3$1("IE_PROTO");
var EmptyConstructor$1 = function() {};
var scriptTag$1 = function(content) {
	return LT$1 + SCRIPT$1 + GT$1 + content + LT$1 + "/" + SCRIPT$1 + GT$1;
};
var NullProtoObjectViaActiveX$1 = function(activeXDocument$2) {
	activeXDocument$2.write(scriptTag$1(""));
	activeXDocument$2.close();
	var temp = activeXDocument$2.parentWindow.Object;
	activeXDocument$2 = null;
	return temp;
};
var NullProtoObjectViaIFrame$1 = function() {
	var iframe = documentCreateElement$2("iframe");
	var JS = "java" + SCRIPT$1 + ":";
	var iframeDocument;
	iframe.style.display = "none";
	html$1$1.appendChild(iframe);
	iframe.src = String(JS);
	iframeDocument = iframe.contentWindow.document;
	iframeDocument.open();
	iframeDocument.write(scriptTag$1("document.F=Object"));
	iframeDocument.close();
	return iframeDocument.F;
};
var activeXDocument$1;
var NullProtoObject$1 = function() {
	try {
		activeXDocument$1 = new ActiveXObject("htmlfile");
	} catch (error) {}
	NullProtoObject$1 = typeof document != "undefined" ? document.domain && activeXDocument$1 ? NullProtoObjectViaActiveX$1(activeXDocument$1) : NullProtoObjectViaIFrame$1() : NullProtoObjectViaActiveX$1(activeXDocument$1);
	var length$1 = enumBugKeys$1$1.length;
	while (length$1--) delete NullProtoObject$1[PROTOTYPE$1$1][enumBugKeys$1$1[length$1]];
	return NullProtoObject$1();
};
hiddenKeys$4$1[IE_PROTO$1$1] = true;
var objectCreate$1 = Object.create || function create$11(O, Properties) {
	var result;
	if (O !== null) {
		EmptyConstructor$1[PROTOTYPE$1$1] = anObject$a$1(O);
		result = new EmptyConstructor$1();
		EmptyConstructor$1[PROTOTYPE$1$1] = null;
		result[IE_PROTO$1$1] = O;
	} else result = NullProtoObject$1();
	return Properties === void 0 ? result : definePropertiesModule$1$1.f(result, Properties);
};
var objectGetOwnPropertyNames$1 = {};
var internalObjectKeys$2 = objectKeysInternal$1;
var enumBugKeys$4 = enumBugKeys$3$1;
var hiddenKeys$3$1 = enumBugKeys$4.concat("length", "prototype");
objectGetOwnPropertyNames$1.f = Object.getOwnPropertyNames || function getOwnPropertyNames$6(O) {
	return internalObjectKeys$2(O, hiddenKeys$3$1);
};
var objectGetOwnPropertyNamesExternal$1 = {};
var toAbsoluteIndex$2$1 = toAbsoluteIndex$4$1;
var lengthOfArrayLike$9$1 = lengthOfArrayLike$c;
var createProperty$4$1 = createProperty$6$1;
var $Array$2$1 = Array;
var max$2$1 = Math.max;
var arraySliceSimple$1 = function(O, start, end) {
	var length$1 = lengthOfArrayLike$9$1(O);
	var k = toAbsoluteIndex$2$1(start, length$1);
	var fin = toAbsoluteIndex$2$1(end === void 0 ? length$1 : end, length$1);
	var result = $Array$2$1(max$2$1(fin - k, 0));
	for (var n = 0; k < fin; k++, n++) createProperty$4$1(result, n, O[k]);
	result.length = n;
	return result;
};
var classof$a$1 = classofRaw$2$1;
var toIndexedObject$5$1 = toIndexedObject$a$1;
var $getOwnPropertyNames$1$1 = objectGetOwnPropertyNames$1.f;
var arraySlice$6 = arraySliceSimple$1;
var windowNames$1 = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
var getWindowNames$1 = function(it$1) {
	try {
		return $getOwnPropertyNames$1$1(it$1);
	} catch (error) {
		return arraySlice$6(windowNames$1);
	}
};
objectGetOwnPropertyNamesExternal$1.f = function getOwnPropertyNames$6(it$1) {
	return windowNames$1 && classof$a$1(it$1) == "Window" ? getWindowNames$1(it$1) : $getOwnPropertyNames$1$1(toIndexedObject$5$1(it$1));
};
var objectGetOwnPropertySymbols$1 = {};
objectGetOwnPropertySymbols$1.f = Object.getOwnPropertySymbols;
var createNonEnumerableProperty$7 = createNonEnumerableProperty$9;
var defineBuiltIn$6 = function(target, key, value, options) {
	if (options && options.enumerable) target[key] = value;
	else createNonEnumerableProperty$7(target, key, value);
	return target;
};
var defineProperty$6$1 = objectDefineProperty$1;
var defineBuiltInAccessor$3$1 = function(target, name, descriptor) {
	return defineProperty$6$1.f(target, name, descriptor);
};
var wellKnownSymbolWrapped$1 = {};
var wellKnownSymbol$f$1 = wellKnownSymbol$m;
wellKnownSymbolWrapped$1.f = wellKnownSymbol$f$1;
var path$k$1 = path$o$1;
var hasOwn$f$1 = hasOwnProperty_1$1;
var wrappedWellKnownSymbolModule$1$1 = wellKnownSymbolWrapped$1;
var defineProperty$5$1 = objectDefineProperty$1.f;
var wellKnownSymbolDefine$1 = function(NAME) {
	var Symbol$6 = path$k$1.Symbol || (path$k$1.Symbol = {});
	if (!hasOwn$f$1(Symbol$6, NAME)) defineProperty$5$1(Symbol$6, NAME, { value: wrappedWellKnownSymbolModule$1$1.f(NAME) });
};
var call$e$1 = functionCall$1;
var getBuiltIn$b$1 = getBuiltIn$f;
var wellKnownSymbol$e$1 = wellKnownSymbol$m;
var defineBuiltIn$5$1 = defineBuiltIn$6;
var symbolDefineToPrimitive$1 = function() {
	var Symbol$6 = getBuiltIn$b$1("Symbol");
	var SymbolPrototype$2 = Symbol$6 && Symbol$6.prototype;
	var valueOf = SymbolPrototype$2 && SymbolPrototype$2.valueOf;
	var TO_PRIMITIVE$2 = wellKnownSymbol$e$1("toPrimitive");
	if (SymbolPrototype$2 && !SymbolPrototype$2[TO_PRIMITIVE$2]) defineBuiltIn$5$1(SymbolPrototype$2, TO_PRIMITIVE$2, function(hint) {
		return call$e$1(valueOf, this);
	}, { arity: 1 });
};
var TO_STRING_TAG_SUPPORT$1$1 = toStringTagSupport$1;
var classof$9$1 = classof$d$1;
var objectToString$1 = TO_STRING_TAG_SUPPORT$1$1 ? {}.toString : function toString$11() {
	return "[object " + classof$9$1(this) + "]";
};
var TO_STRING_TAG_SUPPORT$3 = toStringTagSupport$1;
var defineProperty$4$1 = objectDefineProperty$1.f;
var createNonEnumerableProperty$6$1 = createNonEnumerableProperty$9;
var hasOwn$e$1 = hasOwnProperty_1$1;
var toString$6$1 = objectToString$1;
var wellKnownSymbol$d$1 = wellKnownSymbol$m;
var TO_STRING_TAG$2$1 = wellKnownSymbol$d$1("toStringTag");
var setToStringTag$7 = function(it$1, TAG, STATIC, SET_METHOD) {
	if (it$1) {
		var target = STATIC ? it$1 : it$1.prototype;
		if (!hasOwn$e$1(target, TO_STRING_TAG$2$1)) defineProperty$4$1(target, TO_STRING_TAG$2$1, {
			configurable: true,
			value: TAG
		});
		if (SET_METHOD && !TO_STRING_TAG_SUPPORT$3) createNonEnumerableProperty$6$1(target, "toString", toString$6$1);
	}
};
var global$e$1 = global$m;
var isCallable$b$1 = isCallable$m;
var WeakMap$1$1 = global$e$1.WeakMap;
var weakMapBasicDetection$1 = isCallable$b$1(WeakMap$1$1) && /native code/.test(String(WeakMap$1$1));
var NATIVE_WEAK_MAP$2 = weakMapBasicDetection$1;
var global$d$1 = global$m;
var isObject$a$1 = isObject$h$1;
var createNonEnumerableProperty$5$1 = createNonEnumerableProperty$9;
var hasOwn$d$1 = hasOwnProperty_1$1;
var shared$4$1 = sharedStore$1;
var sharedKey$2$1 = sharedKey$4$1;
var hiddenKeys$2$1 = hiddenKeys$6$1;
var OBJECT_ALREADY_INITIALIZED$1 = "Object already initialized";
var TypeError$3 = global$d$1.TypeError;
var WeakMap$2 = global$d$1.WeakMap;
var set$4, get$8, has$1;
var enforce$1 = function(it$1) {
	return has$1(it$1) ? get$8(it$1) : set$4(it$1, {});
};
var getterFor$1 = function(TYPE) {
	return function(it$1) {
		var state;
		if (!isObject$a$1(it$1) || (state = get$8(it$1)).type !== TYPE) throw TypeError$3("Incompatible receiver, " + TYPE + " required");
		return state;
	};
};
if (NATIVE_WEAK_MAP$2 || shared$4$1.state) {
	var store$4 = shared$4$1.state || (shared$4$1.state = new WeakMap$2());
	store$4.get = store$4.get;
	store$4.has = store$4.has;
	store$4.set = store$4.set;
	set$4 = function(it$1, metadata) {
		if (store$4.has(it$1)) throw TypeError$3(OBJECT_ALREADY_INITIALIZED$1);
		metadata.facade = it$1;
		store$4.set(it$1, metadata);
		return metadata;
	};
	get$8 = function(it$1) {
		return store$4.get(it$1) || {};
	};
	has$1 = function(it$1) {
		return store$4.has(it$1);
	};
} else {
	var STATE$1 = sharedKey$2$1("state");
	hiddenKeys$2$1[STATE$1] = true;
	set$4 = function(it$1, metadata) {
		if (hasOwn$d$1(it$1, STATE$1)) throw TypeError$3(OBJECT_ALREADY_INITIALIZED$1);
		metadata.facade = it$1;
		createNonEnumerableProperty$5$1(it$1, STATE$1, metadata);
		return metadata;
	};
	get$8 = function(it$1) {
		return hasOwn$d$1(it$1, STATE$1) ? it$1[STATE$1] : {};
	};
	has$1 = function(it$1) {
		return hasOwn$d$1(it$1, STATE$1);
	};
}
var internalState$1 = {
	set: set$4,
	get: get$8,
	has: has$1,
	enforce: enforce$1,
	getterFor: getterFor$1
};
var bind$h = functionBindContext$1;
var uncurryThis$f$1 = functionUncurryThis$1;
var IndexedObject$2$1 = indexedObject$1;
var toObject$a$1 = toObject$d$1;
var lengthOfArrayLike$8$1 = lengthOfArrayLike$c;
var arraySpeciesCreate$2$1 = arraySpeciesCreate$4;
var push$5$1 = uncurryThis$f$1([].push);
var createMethod$2$1 = function(TYPE) {
	var IS_MAP = TYPE == 1;
	var IS_FILTER = TYPE == 2;
	var IS_SOME = TYPE == 3;
	var IS_EVERY = TYPE == 4;
	var IS_FIND_INDEX = TYPE == 6;
	var IS_FILTER_REJECT = TYPE == 7;
	var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
	return function($this, callbackfn, that, specificCreate) {
		var O = toObject$a$1($this);
		var self$1 = IndexedObject$2$1(O);
		var boundFunction = bind$h(callbackfn, that);
		var length$1 = lengthOfArrayLike$8$1(self$1);
		var index$1 = 0;
		var create$11 = specificCreate || arraySpeciesCreate$2$1;
		var target = IS_MAP ? create$11($this, length$1) : IS_FILTER || IS_FILTER_REJECT ? create$11($this, 0) : void 0;
		var value, result;
		for (; length$1 > index$1; index$1++) if (NO_HOLES || index$1 in self$1) {
			value = self$1[index$1];
			result = boundFunction(value, index$1, O);
			if (TYPE) if (IS_MAP) target[index$1] = result;
			else if (result) switch (TYPE) {
				case 3: return true;
				case 5: return value;
				case 6: return index$1;
				case 2: push$5$1(target, value);
			}
			else switch (TYPE) {
				case 4: return false;
				case 7: push$5$1(target, value);
			}
		}
		return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
	};
};
var arrayIteration$1 = {
	forEach: createMethod$2$1(0),
	map: createMethod$2$1(1),
	filter: createMethod$2$1(2),
	some: createMethod$2$1(3),
	every: createMethod$2$1(4),
	find: createMethod$2$1(5),
	findIndex: createMethod$2$1(6),
	filterReject: createMethod$2$1(7)
};
var $$J$1 = _export$1;
var global$c$1 = global$m;
var call$d$1 = functionCall$1;
var uncurryThis$e$1 = functionUncurryThis$1;
var DESCRIPTORS$a$1 = descriptors$1;
var NATIVE_SYMBOL$3$1 = symbolConstructorDetection$1;
var fails$i$1 = fails$t$1;
var hasOwn$c$1 = hasOwnProperty_1$1;
var isPrototypeOf$i$1 = objectIsPrototypeOf$1;
var anObject$9$1 = anObject$d$1;
var toIndexedObject$4$1 = toIndexedObject$a$1;
var toPropertyKey$5 = toPropertyKey$4$1;
var $toString$1 = toString$7$1;
var createPropertyDescriptor$3$1 = createPropertyDescriptor$7;
var nativeObjectCreate$1 = objectCreate$1;
var objectKeys$1$1 = objectKeys$3$1;
var getOwnPropertyNamesModule$2$1 = objectGetOwnPropertyNames$1;
var getOwnPropertyNamesExternal$1 = objectGetOwnPropertyNamesExternal$1;
var getOwnPropertySymbolsModule$3$1 = objectGetOwnPropertySymbols$1;
var getOwnPropertyDescriptorModule$2$1 = objectGetOwnPropertyDescriptor$1;
var definePropertyModule$1$1 = objectDefineProperty$1;
var definePropertiesModule$2 = objectDefineProperties$1;
var propertyIsEnumerableModule$1$1 = objectPropertyIsEnumerable$1;
var defineBuiltIn$4$1 = defineBuiltIn$6;
var defineBuiltInAccessor$2$1 = defineBuiltInAccessor$3$1;
var shared$3$1 = sharedExports$1;
var sharedKey$1$1 = sharedKey$4$1;
var hiddenKeys$1$1 = hiddenKeys$6$1;
var uid$1$1 = uid$4$1;
var wellKnownSymbol$c$1 = wellKnownSymbol$m;
var wrappedWellKnownSymbolModule$2 = wellKnownSymbolWrapped$1;
var defineWellKnownSymbol$l$1 = wellKnownSymbolDefine$1;
var defineSymbolToPrimitive$1$1 = symbolDefineToPrimitive$1;
var setToStringTag$6$1 = setToStringTag$7;
var InternalStateModule$5$1 = internalState$1;
var $forEach$1$1 = arrayIteration$1.forEach;
var HIDDEN$1 = sharedKey$1$1("hidden");
var SYMBOL$1 = "Symbol";
var PROTOTYPE$2 = "prototype";
var setInternalState$5$1 = InternalStateModule$5$1.set;
var getInternalState$2$1 = InternalStateModule$5$1.getterFor(SYMBOL$1);
var ObjectPrototype$2$1 = Object[PROTOTYPE$2];
var $Symbol$1 = global$c$1.Symbol;
var SymbolPrototype$1 = $Symbol$1 && $Symbol$1[PROTOTYPE$2];
var TypeError$2$1 = global$c$1.TypeError;
var QObject$1 = global$c$1.QObject;
var nativeGetOwnPropertyDescriptor$1$1 = getOwnPropertyDescriptorModule$2$1.f;
var nativeDefineProperty$1 = definePropertyModule$1$1.f;
var nativeGetOwnPropertyNames$1 = getOwnPropertyNamesExternal$1.f;
var nativePropertyIsEnumerable$1 = propertyIsEnumerableModule$1$1.f;
var push$4$1 = uncurryThis$e$1([].push);
var AllSymbols$1 = shared$3$1("symbols");
var ObjectPrototypeSymbols$1 = shared$3$1("op-symbols");
var WellKnownSymbolsStore$1$1 = shared$3$1("wks");
var USE_SETTER$1 = !QObject$1 || !QObject$1[PROTOTYPE$2] || !QObject$1[PROTOTYPE$2].findChild;
var setSymbolDescriptor$1 = DESCRIPTORS$a$1 && fails$i$1(function() {
	return nativeObjectCreate$1(nativeDefineProperty$1({}, "a", { get: function() {
		return nativeDefineProperty$1(this, "a", { value: 7 }).a;
	} })).a != 7;
}) ? function(O, P, Attributes) {
	var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1$1(ObjectPrototype$2$1, P);
	if (ObjectPrototypeDescriptor) delete ObjectPrototype$2$1[P];
	nativeDefineProperty$1(O, P, Attributes);
	if (ObjectPrototypeDescriptor && O !== ObjectPrototype$2$1) nativeDefineProperty$1(ObjectPrototype$2$1, P, ObjectPrototypeDescriptor);
} : nativeDefineProperty$1;
var wrap$1 = function(tag, description) {
	var symbol$8 = AllSymbols$1[tag] = nativeObjectCreate$1(SymbolPrototype$1);
	setInternalState$5$1(symbol$8, {
		type: SYMBOL$1,
		tag,
		description
	});
	if (!DESCRIPTORS$a$1) symbol$8.description = description;
	return symbol$8;
};
var $defineProperty$2 = function defineProperty$11(O, P, Attributes) {
	if (O === ObjectPrototype$2$1) $defineProperty$2(ObjectPrototypeSymbols$1, P, Attributes);
	anObject$9$1(O);
	var key = toPropertyKey$5(P);
	anObject$9$1(Attributes);
	if (hasOwn$c$1(AllSymbols$1, key)) {
		if (!Attributes.enumerable) {
			if (!hasOwn$c$1(O, HIDDEN$1)) nativeDefineProperty$1(O, HIDDEN$1, createPropertyDescriptor$3$1(1, {}));
			O[HIDDEN$1][key] = true;
		} else {
			if (hasOwn$c$1(O, HIDDEN$1) && O[HIDDEN$1][key]) O[HIDDEN$1][key] = false;
			Attributes = nativeObjectCreate$1(Attributes, { enumerable: createPropertyDescriptor$3$1(0, false) });
		}
		return setSymbolDescriptor$1(O, key, Attributes);
	}
	return nativeDefineProperty$1(O, key, Attributes);
};
var $defineProperties$1 = function defineProperties$6(O, Properties) {
	anObject$9$1(O);
	var properties = toIndexedObject$4$1(Properties);
	var keys$9 = objectKeys$1$1(properties).concat($getOwnPropertySymbols$1(properties));
	$forEach$1$1(keys$9, function(key) {
		if (!DESCRIPTORS$a$1 || call$d$1($propertyIsEnumerable$3, properties, key)) $defineProperty$2(O, key, properties[key]);
	});
	return O;
};
var $create$1 = function create$11(O, Properties) {
	return Properties === void 0 ? nativeObjectCreate$1(O) : $defineProperties$1(nativeObjectCreate$1(O), Properties);
};
var $propertyIsEnumerable$3 = function propertyIsEnumerable$1(V) {
	var P = toPropertyKey$5(V);
	var enumerable = call$d$1(nativePropertyIsEnumerable$1, this, P);
	if (this === ObjectPrototype$2$1 && hasOwn$c$1(AllSymbols$1, P) && !hasOwn$c$1(ObjectPrototypeSymbols$1, P)) return false;
	return enumerable || !hasOwn$c$1(this, P) || !hasOwn$c$1(AllSymbols$1, P) || hasOwn$c$1(this, HIDDEN$1) && this[HIDDEN$1][P] ? enumerable : true;
};
var $getOwnPropertyDescriptor$3 = function getOwnPropertyDescriptor$11(O, P) {
	var it$1 = toIndexedObject$4$1(O);
	var key = toPropertyKey$5(P);
	if (it$1 === ObjectPrototype$2$1 && hasOwn$c$1(AllSymbols$1, key) && !hasOwn$c$1(ObjectPrototypeSymbols$1, key)) return;
	var descriptor = nativeGetOwnPropertyDescriptor$1$1(it$1, key);
	if (descriptor && hasOwn$c$1(AllSymbols$1, key) && !(hasOwn$c$1(it$1, HIDDEN$1) && it$1[HIDDEN$1][key])) descriptor.enumerable = true;
	return descriptor;
};
var $getOwnPropertyNames$2 = function getOwnPropertyNames$6(O) {
	var names = nativeGetOwnPropertyNames$1(toIndexedObject$4$1(O));
	var result = [];
	$forEach$1$1(names, function(key) {
		if (!hasOwn$c$1(AllSymbols$1, key) && !hasOwn$c$1(hiddenKeys$1$1, key)) push$4$1(result, key);
	});
	return result;
};
var $getOwnPropertySymbols$1 = function(O) {
	var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$2$1;
	var names = nativeGetOwnPropertyNames$1(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols$1 : toIndexedObject$4$1(O));
	var result = [];
	$forEach$1$1(names, function(key) {
		if (hasOwn$c$1(AllSymbols$1, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$c$1(ObjectPrototype$2$1, key))) push$4$1(result, AllSymbols$1[key]);
	});
	return result;
};
if (!NATIVE_SYMBOL$3$1) {
	$Symbol$1 = function Symbol$6() {
		if (isPrototypeOf$i$1(SymbolPrototype$1, this)) throw TypeError$2$1("Symbol is not a constructor");
		var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString$1(arguments[0]);
		var tag = uid$1$1(description);
		var setter = function(value) {
			if (this === ObjectPrototype$2$1) call$d$1(setter, ObjectPrototypeSymbols$1, value);
			if (hasOwn$c$1(this, HIDDEN$1) && hasOwn$c$1(this[HIDDEN$1], tag)) this[HIDDEN$1][tag] = false;
			setSymbolDescriptor$1(this, tag, createPropertyDescriptor$3$1(1, value));
		};
		if (DESCRIPTORS$a$1 && USE_SETTER$1) setSymbolDescriptor$1(ObjectPrototype$2$1, tag, {
			configurable: true,
			set: setter
		});
		return wrap$1(tag, description);
	};
	SymbolPrototype$1 = $Symbol$1[PROTOTYPE$2];
	defineBuiltIn$4$1(SymbolPrototype$1, "toString", function toString$11() {
		return getInternalState$2$1(this).tag;
	});
	defineBuiltIn$4$1($Symbol$1, "withoutSetter", function(description) {
		return wrap$1(uid$1$1(description), description);
	});
	propertyIsEnumerableModule$1$1.f = $propertyIsEnumerable$3;
	definePropertyModule$1$1.f = $defineProperty$2;
	definePropertiesModule$2.f = $defineProperties$1;
	getOwnPropertyDescriptorModule$2$1.f = $getOwnPropertyDescriptor$3;
	getOwnPropertyNamesModule$2$1.f = getOwnPropertyNamesExternal$1.f = $getOwnPropertyNames$2;
	getOwnPropertySymbolsModule$3$1.f = $getOwnPropertySymbols$1;
	wrappedWellKnownSymbolModule$2.f = function(name) {
		return wrap$1(wellKnownSymbol$c$1(name), name);
	};
	if (DESCRIPTORS$a$1) defineBuiltInAccessor$2$1(SymbolPrototype$1, "description", {
		configurable: true,
		get: function description() {
			return getInternalState$2$1(this).description;
		}
	});
}
$$J$1({
	global: true,
	constructor: true,
	wrap: true,
	forced: !NATIVE_SYMBOL$3$1,
	sham: !NATIVE_SYMBOL$3$1
}, { Symbol: $Symbol$1 });
$forEach$1$1(objectKeys$1$1(WellKnownSymbolsStore$1$1), function(name) {
	defineWellKnownSymbol$l$1(name);
});
$$J$1({
	target: SYMBOL$1,
	stat: true,
	forced: !NATIVE_SYMBOL$3$1
}, {
	useSetter: function() {
		USE_SETTER$1 = true;
	},
	useSimple: function() {
		USE_SETTER$1 = false;
	}
});
$$J$1({
	target: "Object",
	stat: true,
	forced: !NATIVE_SYMBOL$3$1,
	sham: !DESCRIPTORS$a$1
}, {
	create: $create$1,
	defineProperty: $defineProperty$2,
	defineProperties: $defineProperties$1,
	getOwnPropertyDescriptor: $getOwnPropertyDescriptor$3
});
$$J$1({
	target: "Object",
	stat: true,
	forced: !NATIVE_SYMBOL$3$1
}, { getOwnPropertyNames: $getOwnPropertyNames$2 });
defineSymbolToPrimitive$1$1();
setToStringTag$6$1($Symbol$1, SYMBOL$1);
hiddenKeys$1$1[HIDDEN$1] = true;
var NATIVE_SYMBOL$2$1 = symbolConstructorDetection$1;
var symbolRegistryDetection$1 = NATIVE_SYMBOL$2$1 && !!Symbol["for"] && !!Symbol.keyFor;
var $$I$1 = _export$1;
var getBuiltIn$a$1 = getBuiltIn$f;
var hasOwn$b$1 = hasOwnProperty_1$1;
var toString$5$1 = toString$7$1;
var shared$2$1 = sharedExports$1;
var NATIVE_SYMBOL_REGISTRY$1$1 = symbolRegistryDetection$1;
var StringToSymbolRegistry$1 = shared$2$1("string-to-symbol-registry");
var SymbolToStringRegistry$1$1 = shared$2$1("symbol-to-string-registry");
$$I$1({
	target: "Symbol",
	stat: true,
	forced: !NATIVE_SYMBOL_REGISTRY$1$1
}, { "for": function(key) {
	var string$1 = toString$5$1(key);
	if (hasOwn$b$1(StringToSymbolRegistry$1, string$1)) return StringToSymbolRegistry$1[string$1];
	var symbol$8 = getBuiltIn$a$1("Symbol")(string$1);
	StringToSymbolRegistry$1[string$1] = symbol$8;
	SymbolToStringRegistry$1$1[symbol$8] = string$1;
	return symbol$8;
} });
var $$H$1 = _export$1;
var hasOwn$a$1 = hasOwnProperty_1$1;
var isSymbol$2$1 = isSymbol$5$1;
var tryToString$4$1 = tryToString$6$1;
var shared$1$1 = sharedExports$1;
var NATIVE_SYMBOL_REGISTRY$2 = symbolRegistryDetection$1;
var SymbolToStringRegistry$2 = shared$1$1("symbol-to-string-registry");
$$H$1({
	target: "Symbol",
	stat: true,
	forced: !NATIVE_SYMBOL_REGISTRY$2
}, { keyFor: function keyFor$2(sym) {
	if (!isSymbol$2$1(sym)) throw TypeError(tryToString$4$1(sym) + " is not a symbol");
	if (hasOwn$a$1(SymbolToStringRegistry$2, sym)) return SymbolToStringRegistry$2[sym];
} });
var uncurryThis$d$1 = functionUncurryThis$1;
var arraySlice$5$1 = uncurryThis$d$1([].slice);
var uncurryThis$c$1 = functionUncurryThis$1;
var isArray$c$1 = isArray$f$1;
var isCallable$a$1 = isCallable$m;
var classof$8$1 = classofRaw$2$1;
var toString$4$1 = toString$7$1;
var push$3$1 = uncurryThis$c$1([].push);
var getJsonReplacerFunction$1 = function(replacer) {
	if (isCallable$a$1(replacer)) return replacer;
	if (!isArray$c$1(replacer)) return;
	var rawLength = replacer.length;
	var keys$9 = [];
	for (var i$2 = 0; i$2 < rawLength; i$2++) {
		var element = replacer[i$2];
		if (typeof element == "string") push$3$1(keys$9, element);
		else if (typeof element == "number" || classof$8$1(element) == "Number" || classof$8$1(element) == "String") push$3$1(keys$9, toString$4$1(element));
	}
	var keysLength = keys$9.length;
	var root = true;
	return function(key, value) {
		if (root) {
			root = false;
			return value;
		}
		if (isArray$c$1(this)) return value;
		for (var j = 0; j < keysLength; j++) if (keys$9[j] === key) return value;
	};
};
var $$G$1 = _export$1;
var getBuiltIn$9$1 = getBuiltIn$f;
var apply$4$1 = functionApply$1;
var call$c$1 = functionCall$1;
var uncurryThis$b$1 = functionUncurryThis$1;
var fails$h$1 = fails$t$1;
var isCallable$9$1 = isCallable$m;
var isSymbol$1$1 = isSymbol$5$1;
var arraySlice$4$1 = arraySlice$5$1;
var getReplacerFunction$1 = getJsonReplacerFunction$1;
var NATIVE_SYMBOL$1$1 = symbolConstructorDetection$1;
var $String$1$1 = String;
var $stringify$1 = getBuiltIn$9$1("JSON", "stringify");
var exec$3 = uncurryThis$b$1(/./.exec);
var charAt$2$1 = uncurryThis$b$1("".charAt);
var charCodeAt$1$1 = uncurryThis$b$1("".charCodeAt);
var replace$1$1 = uncurryThis$b$1("".replace);
var numberToString$1 = uncurryThis$b$1(1 .toString);
var tester$1 = /[\uD800-\uDFFF]/g;
var low$1 = /^[\uD800-\uDBFF]$/;
var hi$1 = /^[\uDC00-\uDFFF]$/;
var WRONG_SYMBOLS_CONVERSION$1 = !NATIVE_SYMBOL$1$1 || fails$h$1(function() {
	var symbol$8 = getBuiltIn$9$1("Symbol")();
	return $stringify$1([symbol$8]) != "[null]" || $stringify$1({ a: symbol$8 }) != "{}" || $stringify$1(Object(symbol$8)) != "{}";
});
var ILL_FORMED_UNICODE$1 = fails$h$1(function() {
	return $stringify$1('\uDF06\uD834') !== "\"\\udf06\\ud834\"" || $stringify$1('\uDEAD') !== "\"\\udead\"";
});
var stringifyWithSymbolsFix$1 = function(it$1, replacer) {
	var args = arraySlice$4$1(arguments);
	var $replacer = getReplacerFunction$1(replacer);
	if (!isCallable$9$1($replacer) && (it$1 === void 0 || isSymbol$1$1(it$1))) return;
	args[1] = function(key, value) {
		if (isCallable$9$1($replacer)) value = call$c$1($replacer, this, $String$1$1(key), value);
		if (!isSymbol$1$1(value)) return value;
	};
	return apply$4$1($stringify$1, null, args);
};
var fixIllFormed$1 = function(match$2, offset, string$1) {
	var prev = charAt$2$1(string$1, offset - 1);
	var next$1 = charAt$2$1(string$1, offset + 1);
	if (exec$3(low$1, match$2) && !exec$3(hi$1, next$1) || exec$3(hi$1, match$2) && !exec$3(low$1, prev)) return "\\u" + numberToString$1(charCodeAt$1$1(match$2, 0), 16);
	return match$2;
};
if ($stringify$1) $$G$1({
	target: "JSON",
	stat: true,
	arity: 3,
	forced: WRONG_SYMBOLS_CONVERSION$1 || ILL_FORMED_UNICODE$1
}, { stringify: function stringify$4(it$1, replacer, space) {
	var args = arraySlice$4$1(arguments);
	var result = apply$4$1(WRONG_SYMBOLS_CONVERSION$1 ? stringifyWithSymbolsFix$1 : $stringify$1, null, args);
	return ILL_FORMED_UNICODE$1 && typeof result == "string" ? replace$1$1(result, tester$1, fixIllFormed$1) : result;
} });
var $$F$1 = _export$1;
var NATIVE_SYMBOL$6 = symbolConstructorDetection$1;
var fails$g$1 = fails$t$1;
var getOwnPropertySymbolsModule$2$1 = objectGetOwnPropertySymbols$1;
var toObject$9$1 = toObject$d$1;
var FORCED$4$1 = !NATIVE_SYMBOL$6 || fails$g$1(function() {
	getOwnPropertySymbolsModule$2$1.f(1);
});
$$F$1({
	target: "Object",
	stat: true,
	forced: FORCED$4$1
}, { getOwnPropertySymbols: function getOwnPropertySymbols$4(it$1) {
	var $getOwnPropertySymbols$2 = getOwnPropertySymbolsModule$2$1.f;
	return $getOwnPropertySymbols$2 ? $getOwnPropertySymbols$2(toObject$9$1(it$1)) : [];
} });
var defineWellKnownSymbol$k$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$k$1("asyncIterator");
var defineWellKnownSymbol$j$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$j$1("hasInstance");
var defineWellKnownSymbol$i$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$i$1("isConcatSpreadable");
var defineWellKnownSymbol$h$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$h$1("iterator");
var defineWellKnownSymbol$g$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$g$1("match");
var defineWellKnownSymbol$f$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$f$1("matchAll");
var defineWellKnownSymbol$e$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$e$1("replace");
var defineWellKnownSymbol$d$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$d$1("search");
var defineWellKnownSymbol$c$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$c$1("species");
var defineWellKnownSymbol$b$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$b$1("split");
var defineWellKnownSymbol$a$1 = wellKnownSymbolDefine$1;
var defineSymbolToPrimitive$2 = symbolDefineToPrimitive$1;
defineWellKnownSymbol$a$1("toPrimitive");
defineSymbolToPrimitive$2();
var getBuiltIn$8$1 = getBuiltIn$f;
var defineWellKnownSymbol$9$1 = wellKnownSymbolDefine$1;
var setToStringTag$5$1 = setToStringTag$7;
defineWellKnownSymbol$9$1("toStringTag");
setToStringTag$5$1(getBuiltIn$8$1("Symbol"), "Symbol");
var defineWellKnownSymbol$8$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$8$1("unscopables");
var global$b$1 = global$m;
var setToStringTag$4$1 = setToStringTag$7;
setToStringTag$4$1(global$b$1.JSON, "JSON", true);
var path$j$1 = path$o$1;
var symbol$6$1 = path$j$1.Symbol;
var iterators$1 = {};
var DESCRIPTORS$9$1 = descriptors$1;
var hasOwn$9$1 = hasOwnProperty_1$1;
var FunctionPrototype$1$1 = Function.prototype;
var getDescriptor$1 = DESCRIPTORS$9$1 && Object.getOwnPropertyDescriptor;
var EXISTS$2 = hasOwn$9$1(FunctionPrototype$1$1, "name");
var PROPER$1 = EXISTS$2 && function something() {}.name === "something";
var CONFIGURABLE$2 = EXISTS$2 && (!DESCRIPTORS$9$1 || DESCRIPTORS$9$1 && getDescriptor$1(FunctionPrototype$1$1, "name").configurable);
var functionName$1 = {
	EXISTS: EXISTS$2,
	PROPER: PROPER$1,
	CONFIGURABLE: CONFIGURABLE$2
};
var fails$f$1 = fails$t$1;
var correctPrototypeGetter$1 = !fails$f$1(function() {
	function F() {}
	F.prototype.constructor = null;
	return Object.getPrototypeOf(new F()) !== F.prototype;
});
var hasOwn$8$1 = hasOwnProperty_1$1;
var isCallable$8$1 = isCallable$m;
var toObject$8$1 = toObject$d$1;
var sharedKey$5 = sharedKey$4$1;
var CORRECT_PROTOTYPE_GETTER$1$1 = correctPrototypeGetter$1;
var IE_PROTO$2 = sharedKey$5("IE_PROTO");
var $Object$6 = Object;
var ObjectPrototype$1$1 = $Object$6.prototype;
var objectGetPrototypeOf$1 = CORRECT_PROTOTYPE_GETTER$1$1 ? $Object$6.getPrototypeOf : function(O) {
	var object$1 = toObject$8$1(O);
	if (hasOwn$8$1(object$1, IE_PROTO$2)) return object$1[IE_PROTO$2];
	var constructor = object$1.constructor;
	if (isCallable$8$1(constructor) && object$1 instanceof constructor) return constructor.prototype;
	return object$1 instanceof $Object$6 ? ObjectPrototype$1$1 : null;
};
var fails$e$1 = fails$t$1;
var isCallable$7$1 = isCallable$m;
var isObject$9$1 = isObject$h$1;
var create$c = objectCreate$1;
var getPrototypeOf$8$1 = objectGetPrototypeOf$1;
var defineBuiltIn$3$1 = defineBuiltIn$6;
var wellKnownSymbol$b$1 = wellKnownSymbol$m;
var ITERATOR$4$1 = wellKnownSymbol$b$1("iterator");
var BUGGY_SAFARI_ITERATORS$1$1 = false;
var IteratorPrototype$1$1, PrototypeOfArrayIteratorPrototype$1, arrayIterator$1;
if ([].keys) {
	arrayIterator$1 = [].keys();
	if (!("next" in arrayIterator$1)) BUGGY_SAFARI_ITERATORS$1$1 = true;
	else {
		PrototypeOfArrayIteratorPrototype$1 = getPrototypeOf$8$1(getPrototypeOf$8$1(arrayIterator$1));
		if (PrototypeOfArrayIteratorPrototype$1 !== Object.prototype) IteratorPrototype$1$1 = PrototypeOfArrayIteratorPrototype$1;
	}
}
var NEW_ITERATOR_PROTOTYPE$1 = !isObject$9$1(IteratorPrototype$1$1) || fails$e$1(function() {
	var test$4 = {};
	return IteratorPrototype$1$1[ITERATOR$4$1].call(test$4) !== test$4;
});
if (NEW_ITERATOR_PROTOTYPE$1) IteratorPrototype$1$1 = {};
else IteratorPrototype$1$1 = create$c(IteratorPrototype$1$1);
if (!isCallable$7$1(IteratorPrototype$1$1[ITERATOR$4$1])) defineBuiltIn$3$1(IteratorPrototype$1$1, ITERATOR$4$1, function() {
	return this;
});
var iteratorsCore$1 = {
	IteratorPrototype: IteratorPrototype$1$1,
	BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1$1
};
var IteratorPrototype$2 = iteratorsCore$1.IteratorPrototype;
var create$b$1 = objectCreate$1;
var createPropertyDescriptor$2$1 = createPropertyDescriptor$7;
var setToStringTag$3$1 = setToStringTag$7;
var Iterators$5$1 = iterators$1;
var returnThis$1$1 = function() {
	return this;
};
var iteratorCreateConstructor$1 = function(IteratorConstructor, NAME, next$1, ENUMERABLE_NEXT) {
	var TO_STRING_TAG$6 = NAME + " Iterator";
	IteratorConstructor.prototype = create$b$1(IteratorPrototype$2, { next: createPropertyDescriptor$2$1(+!ENUMERABLE_NEXT, next$1) });
	setToStringTag$3$1(IteratorConstructor, TO_STRING_TAG$6, false, true);
	Iterators$5$1[TO_STRING_TAG$6] = returnThis$1$1;
	return IteratorConstructor;
};
var uncurryThis$a$1 = functionUncurryThis$1;
var aCallable$b = aCallable$e;
var functionUncurryThisAccessor$1 = function(object$1, key, method$11) {
	try {
		return uncurryThis$a$1(aCallable$b(Object.getOwnPropertyDescriptor(object$1, key)[method$11]));
	} catch (error) {}
};
var isCallable$6$1 = isCallable$m;
var $String$5 = String;
var $TypeError$9$1 = TypeError;
var aPossiblePrototype$1$1 = function(argument) {
	if (typeof argument == "object" || isCallable$6$1(argument)) return argument;
	throw $TypeError$9$1("Can't set " + $String$5(argument) + " as a prototype");
};
var uncurryThisAccessor$1 = functionUncurryThisAccessor$1;
var anObject$8$1 = anObject$d$1;
var aPossiblePrototype$2 = aPossiblePrototype$1$1;
var objectSetPrototypeOf$1 = Object.setPrototypeOf || ("__proto__" in {} ? function() {
	var CORRECT_SETTER = false;
	var test$4 = {};
	var setter;
	try {
		setter = uncurryThisAccessor$1(Object.prototype, "__proto__", "set");
		setter(test$4, []);
		CORRECT_SETTER = test$4 instanceof Array;
	} catch (error) {}
	return function setPrototypeOf$9(O, proto) {
		anObject$8$1(O);
		aPossiblePrototype$2(proto);
		if (CORRECT_SETTER) setter(O, proto);
		else O.__proto__ = proto;
		return O;
	};
}() : void 0);
var $$E$1 = _export$1;
var call$b$1 = functionCall$1;
var FunctionName$1 = functionName$1;
var createIteratorConstructor$1 = iteratorCreateConstructor$1;
var getPrototypeOf$7$1 = objectGetPrototypeOf$1;
var setToStringTag$2$1 = setToStringTag$7;
var defineBuiltIn$2$1 = defineBuiltIn$6;
var wellKnownSymbol$a$1 = wellKnownSymbol$m;
var Iterators$4$1 = iterators$1;
var IteratorsCore$1 = iteratorsCore$1;
var PROPER_FUNCTION_NAME$2 = FunctionName$1.PROPER;
FunctionName$1.CONFIGURABLE;
IteratorsCore$1.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS$2 = IteratorsCore$1.BUGGY_SAFARI_ITERATORS;
var ITERATOR$3$1 = wellKnownSymbol$a$1("iterator");
var KEYS$1 = "keys";
var VALUES$1 = "values";
var ENTRIES$1 = "entries";
var returnThis$2 = function() {
	return this;
};
var iteratorDefine$1 = function(Iterable, NAME, IteratorConstructor, next$1, DEFAULT, IS_SET, FORCED$11) {
	createIteratorConstructor$1(IteratorConstructor, NAME, next$1);
	var getIterationMethod = function(KIND) {
		if (KIND === DEFAULT && defaultIterator) return defaultIterator;
		if (!BUGGY_SAFARI_ITERATORS$2 && KIND in IterablePrototype) return IterablePrototype[KIND];
		switch (KIND) {
			case KEYS$1: return function keys$9() {
				return new IteratorConstructor(this, KIND);
			};
			case VALUES$1: return function values$8() {
				return new IteratorConstructor(this, KIND);
			};
			case ENTRIES$1: return function entries$4() {
				return new IteratorConstructor(this, KIND);
			};
		}
		return function() {
			return new IteratorConstructor(this);
		};
	};
	var TO_STRING_TAG$6 = NAME + " Iterator";
	var INCORRECT_VALUES_NAME = false;
	var IterablePrototype = Iterable.prototype;
	var nativeIterator = IterablePrototype[ITERATOR$3$1] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
	var defaultIterator = !BUGGY_SAFARI_ITERATORS$2 && nativeIterator || getIterationMethod(DEFAULT);
	var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
	var CurrentIteratorPrototype, methods, KEY;
	if (anyNativeIterator) {
		CurrentIteratorPrototype = getPrototypeOf$7$1(anyNativeIterator.call(new Iterable()));
		if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
			setToStringTag$2$1(CurrentIteratorPrototype, TO_STRING_TAG$6, true, true);
			Iterators$4$1[TO_STRING_TAG$6] = returnThis$2;
		}
	}
	if (PROPER_FUNCTION_NAME$2 && DEFAULT == VALUES$1 && nativeIterator && nativeIterator.name !== VALUES$1) {
		INCORRECT_VALUES_NAME = true;
		defaultIterator = function values$8() {
			return call$b$1(nativeIterator, this);
		};
	}
	if (DEFAULT) {
		methods = {
			values: getIterationMethod(VALUES$1),
			keys: IS_SET ? defaultIterator : getIterationMethod(KEYS$1),
			entries: getIterationMethod(ENTRIES$1)
		};
		if (FORCED$11) {
			for (KEY in methods) if (BUGGY_SAFARI_ITERATORS$2 || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) defineBuiltIn$2$1(IterablePrototype, KEY, methods[KEY]);
		} else $$E$1({
			target: NAME,
			proto: true,
			forced: BUGGY_SAFARI_ITERATORS$2 || INCORRECT_VALUES_NAME
		}, methods);
	}
	if (FORCED$11 && IterablePrototype[ITERATOR$3$1] !== defaultIterator) defineBuiltIn$2$1(IterablePrototype, ITERATOR$3$1, defaultIterator, { name: DEFAULT });
	Iterators$4$1[NAME] = defaultIterator;
	return methods;
};
var createIterResultObject$3$1 = function(value, done) {
	return {
		value,
		done
	};
};
var toIndexedObject$3$1 = toIndexedObject$a$1;
var Iterators$3$1 = iterators$1;
var InternalStateModule$4$1 = internalState$1;
objectDefineProperty$1.f;
var defineIterator$2$1 = iteratorDefine$1;
var createIterResultObject$2$1 = createIterResultObject$3$1;
var ARRAY_ITERATOR$1 = "Array Iterator";
var setInternalState$4$1 = InternalStateModule$4$1.set;
var getInternalState$1$1 = InternalStateModule$4$1.getterFor(ARRAY_ITERATOR$1);
defineIterator$2$1(Array, "Array", function(iterated, kind) {
	setInternalState$4$1(this, {
		type: ARRAY_ITERATOR$1,
		target: toIndexedObject$3$1(iterated),
		index: 0,
		kind
	});
}, function() {
	var state = getInternalState$1$1(this);
	var target = state.target;
	var kind = state.kind;
	var index$1 = state.index++;
	if (!target || index$1 >= target.length) {
		state.target = void 0;
		return createIterResultObject$2$1(void 0, true);
	}
	if (kind == "keys") return createIterResultObject$2$1(index$1, false);
	if (kind == "values") return createIterResultObject$2$1(target[index$1], false);
	return createIterResultObject$2$1([index$1, target[index$1]], false);
}, "values");
Iterators$3$1.Arguments = Iterators$3$1.Array;
var domIterables$1 = {
	CSSRuleList: 0,
	CSSStyleDeclaration: 0,
	CSSValueList: 0,
	ClientRectList: 0,
	DOMRectList: 0,
	DOMStringList: 0,
	DOMTokenList: 1,
	DataTransferItemList: 0,
	FileList: 0,
	HTMLAllCollection: 0,
	HTMLCollection: 0,
	HTMLFormElement: 0,
	HTMLSelectElement: 0,
	MediaList: 0,
	MimeTypeArray: 0,
	NamedNodeMap: 0,
	NodeList: 1,
	PaintRequestList: 0,
	Plugin: 0,
	PluginArray: 0,
	SVGLengthList: 0,
	SVGNumberList: 0,
	SVGPathSegList: 0,
	SVGPointList: 0,
	SVGStringList: 0,
	SVGTransformList: 0,
	SourceBufferList: 0,
	StyleSheetList: 0,
	TextTrackCueList: 0,
	TextTrackList: 0,
	TouchList: 0
};
var DOMIterables$4 = domIterables$1;
var global$a$1 = global$m;
var classof$7$1 = classof$d$1;
var createNonEnumerableProperty$4$1 = createNonEnumerableProperty$9;
var Iterators$2$1 = iterators$1;
var wellKnownSymbol$9$1 = wellKnownSymbol$m;
var TO_STRING_TAG$1$1 = wellKnownSymbol$9$1("toStringTag");
for (var COLLECTION_NAME$1 in DOMIterables$4) {
	var Collection$1 = global$a$1[COLLECTION_NAME$1];
	var CollectionPrototype$1 = Collection$1 && Collection$1.prototype;
	if (CollectionPrototype$1 && classof$7$1(CollectionPrototype$1) !== TO_STRING_TAG$1$1) createNonEnumerableProperty$4$1(CollectionPrototype$1, TO_STRING_TAG$1$1, COLLECTION_NAME$1);
	Iterators$2$1[COLLECTION_NAME$1] = Iterators$2$1.Array;
}
var parent$12$1 = symbol$6$1;
var symbol$5$1 = parent$12$1;
var defineWellKnownSymbol$7$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$7$1("dispose");
var parent$11$1 = symbol$5$1;
var symbol$4$1 = parent$11$1;
var defineWellKnownSymbol$6$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$6$1("asyncDispose");
var $$D$1 = _export$1;
var getBuiltIn$7$1 = getBuiltIn$f;
var uncurryThis$9$1 = functionUncurryThis$1;
var Symbol$2$1 = getBuiltIn$7$1("Symbol");
var keyFor$1 = Symbol$2$1.keyFor;
var thisSymbolValue$1$1 = uncurryThis$9$1(Symbol$2$1.prototype.valueOf);
$$D$1({
	target: "Symbol",
	stat: true
}, { isRegistered: function isRegistered(value) {
	try {
		return keyFor$1(thisSymbolValue$1$1(value)) !== void 0;
	} catch (error) {
		return false;
	}
} });
var $$C$1 = _export$1;
var shared$8 = sharedExports$1;
var getBuiltIn$6$1 = getBuiltIn$f;
var uncurryThis$8$1 = functionUncurryThis$1;
var isSymbol$6 = isSymbol$5$1;
var wellKnownSymbol$8$1 = wellKnownSymbol$m;
var Symbol$1$1 = getBuiltIn$6$1("Symbol");
var $isWellKnown$1 = Symbol$1$1.isWellKnown;
var getOwnPropertyNames$5 = getBuiltIn$6$1("Object", "getOwnPropertyNames");
var thisSymbolValue$2 = uncurryThis$8$1(Symbol$1$1.prototype.valueOf);
var WellKnownSymbolsStore$3 = shared$8("wks");
for (var i$1 = 0, symbolKeys$1 = getOwnPropertyNames$5(Symbol$1$1), symbolKeysLength$1 = symbolKeys$1.length; i$1 < symbolKeysLength$1; i$1++) try {
	var symbolKey$1 = symbolKeys$1[i$1];
	if (isSymbol$6(Symbol$1$1[symbolKey$1])) wellKnownSymbol$8$1(symbolKey$1);
} catch (error) {}
$$C$1({
	target: "Symbol",
	stat: true,
	forced: true
}, { isWellKnown: function isWellKnown(value) {
	if ($isWellKnown$1 && $isWellKnown$1(value)) return true;
	try {
		var symbol$8 = thisSymbolValue$2(value);
		for (var j = 0, keys$9 = getOwnPropertyNames$5(WellKnownSymbolsStore$3), keysLength = keys$9.length; j < keysLength; j++) if (WellKnownSymbolsStore$3[keys$9[j]] == symbol$8) return true;
	} catch (error) {}
	return false;
} });
var defineWellKnownSymbol$5$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$5$1("matcher");
var defineWellKnownSymbol$4$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$4$1("metadataKey");
var defineWellKnownSymbol$3$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$3$1("observable");
var defineWellKnownSymbol$2$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$2$1("metadata");
var defineWellKnownSymbol$1$1 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$1$1("patternMatch");
var defineWellKnownSymbol$10 = wellKnownSymbolDefine$1;
defineWellKnownSymbol$10("replaceAll");
var parent$10$1 = symbol$4$1;
var symbol$3$1 = parent$10$1;
var symbol$2$1 = symbol$3$1;
var symbol$1$1 = symbol$2$1;
var _Symbol$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(symbol$1$1);
var uncurryThis$7$1 = functionUncurryThis$1;
var toIntegerOrInfinity$1$1 = toIntegerOrInfinity$4$1;
var toString$3$1 = toString$7$1;
var requireObjectCoercible$6 = requireObjectCoercible$3$1;
var charAt$1$1 = uncurryThis$7$1("".charAt);
var charCodeAt$2 = uncurryThis$7$1("".charCodeAt);
var stringSlice$2 = uncurryThis$7$1("".slice);
var createMethod$1$1 = function(CONVERT_TO_STRING) {
	return function($this, pos) {
		var S = toString$3$1(requireObjectCoercible$6($this));
		var position = toIntegerOrInfinity$1$1(pos);
		var size = S.length;
		var first$1, second;
		if (position < 0 || position >= size) return CONVERT_TO_STRING ? "" : void 0;
		first$1 = charCodeAt$2(S, position);
		return first$1 < 55296 || first$1 > 56319 || position + 1 === size || (second = charCodeAt$2(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt$1$1(S, position) : first$1 : CONVERT_TO_STRING ? stringSlice$2(S, position, position + 2) : (first$1 - 55296 << 10) + (second - 56320) + 65536;
	};
};
var stringMultibyte$1 = {
	codeAt: createMethod$1$1(false),
	charAt: createMethod$1$1(true)
};
var charAt$4 = stringMultibyte$1.charAt;
var toString$2$1 = toString$7$1;
var InternalStateModule$3$1 = internalState$1;
var defineIterator$1$1 = iteratorDefine$1;
var createIterResultObject$1$1 = createIterResultObject$3$1;
var STRING_ITERATOR$1 = "String Iterator";
var setInternalState$3$1 = InternalStateModule$3$1.set;
var getInternalState$3 = InternalStateModule$3$1.getterFor(STRING_ITERATOR$1);
defineIterator$1$1(String, "String", function(iterated) {
	setInternalState$3$1(this, {
		type: STRING_ITERATOR$1,
		string: toString$2$1(iterated),
		index: 0
	});
}, function next$1() {
	var state = getInternalState$3(this);
	var string$1 = state.string;
	var index$1 = state.index;
	var point;
	if (index$1 >= string$1.length) return createIterResultObject$1$1(void 0, true);
	point = charAt$4(string$1, index$1);
	state.index += point.length;
	return createIterResultObject$1$1(point, false);
});
var WrappedWellKnownSymbolModule$1$1 = wellKnownSymbolWrapped$1;
var iterator$6 = WrappedWellKnownSymbolModule$1$1.f("iterator");
var parent$$$1 = iterator$6;
var iterator$5$1 = parent$$$1;
var parent$_$1 = iterator$5$1;
var iterator$4$1 = parent$_$1;
var parent$Z$1 = iterator$4$1;
var iterator$3$1 = parent$Z$1;
var iterator$2$1 = iterator$3$1;
var iterator$1$1 = iterator$2$1;
var _Symbol$iterator$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(iterator$1$1);
function _typeof$1(obj) {
	"@babel/helpers - typeof";
	return _typeof$1 = "function" == typeof _Symbol$1$1 && "symbol" == typeof _Symbol$iterator$2 ? function(obj$1) {
		return typeof obj$1;
	} : function(obj$1) {
		return obj$1 && "function" == typeof _Symbol$1$1 && obj$1.constructor === _Symbol$1$1 && obj$1 !== _Symbol$1$1.prototype ? "symbol" : typeof obj$1;
	}, _typeof$1(obj);
}
var WrappedWellKnownSymbolModule$2 = wellKnownSymbolWrapped$1;
var toPrimitive$5$1 = WrappedWellKnownSymbolModule$2.f("toPrimitive");
var parent$Y$1 = toPrimitive$5$1;
var toPrimitive$4$1 = parent$Y$1;
var parent$X$1 = toPrimitive$4$1;
var toPrimitive$3$1 = parent$X$1;
var parent$W$1 = toPrimitive$3$1;
var toPrimitive$2$1 = parent$W$1;
var toPrimitive$1$1 = toPrimitive$2$1;
var toPrimitive$8 = toPrimitive$1$1;
var _Symbol$toPrimitive$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(toPrimitive$8);
function _toPrimitive$1(input, hint) {
	if (_typeof$1(input) !== "object" || input === null) return input;
	var prim = input[_Symbol$toPrimitive$1];
	if (prim !== void 0) {
		var res = prim.call(input, hint || "default");
		if (_typeof$1(res) !== "object") return res;
		throw new TypeError("@@toPrimitive must return a primitive value.");
	}
	return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey$1(arg) {
	var key = _toPrimitive$1(arg, "string");
	return _typeof$1(key) === "symbol" ? key : String(key);
}
function _defineProperties$1(target, props) {
	for (var i$2 = 0; i$2 < props.length; i$2++) {
		var descriptor = props[i$2];
		descriptor.enumerable = descriptor.enumerable || false;
		descriptor.configurable = true;
		if ("value" in descriptor) descriptor.writable = true;
		_Object$defineProperty$1$1(target, _toPropertyKey$1(descriptor.key), descriptor);
	}
}
function _createClass$1(Constructor, protoProps, staticProps) {
	if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
	if (staticProps) _defineProperties$1(Constructor, staticProps);
	_Object$defineProperty$1$1(Constructor, "prototype", { writable: false });
	return Constructor;
}
function _defineProperty$1(obj, key, value) {
	key = _toPropertyKey$1(key);
	if (key in obj) _Object$defineProperty$1$1(obj, key, {
		value,
		enumerable: true,
		configurable: true,
		writable: true
	});
	else obj[key] = value;
	return obj;
}
var uncurryThis$6$1 = functionUncurryThis$1;
var aCallable$a = aCallable$e;
var isObject$8$1 = isObject$h$1;
var hasOwn$7$1 = hasOwnProperty_1$1;
var arraySlice$3$1 = arraySlice$5$1;
var NATIVE_BIND$5 = functionBindNative$1;
var $Function$1 = Function;
var concat$6$1 = uncurryThis$6$1([].concat);
var join$1 = uncurryThis$6$1([].join);
var factories$1 = {};
var construct$3$1 = function(C, argsLength, args) {
	if (!hasOwn$7$1(factories$1, argsLength)) {
		for (var list = [], i$2 = 0; i$2 < argsLength; i$2++) list[i$2] = "a[" + i$2 + "]";
		factories$1[argsLength] = $Function$1("C,a", "return new C(" + join$1(list, ",") + ")");
	}
	return factories$1[argsLength](C, args);
};
var functionBind$1 = NATIVE_BIND$5 ? $Function$1.bind : function bind$11(that) {
	var F = aCallable$a(this);
	var Prototype = F.prototype;
	var partArgs = arraySlice$3$1(arguments, 1);
	var boundFunction = function bound() {
		var args = concat$6$1(partArgs, arraySlice$3$1(arguments));
		return this instanceof boundFunction ? construct$3$1(F, args.length, args) : F.apply(that, args);
	};
	if (isObject$8$1(Prototype)) boundFunction.prototype = Prototype;
	return boundFunction;
};
var $$B$1 = _export$1;
var bind$g = functionBind$1;
$$B$1({
	target: "Function",
	proto: true,
	forced: Function.bind !== bind$g
}, { bind: bind$g });
var path$i$1 = path$o$1;
var entryVirtual$f$1 = function(CONSTRUCTOR) {
	return path$i$1[CONSTRUCTOR + "Prototype"];
};
var entryVirtual$e$1 = entryVirtual$f$1;
var bind$f$1 = entryVirtual$e$1("Function").bind;
var isPrototypeOf$h$1 = objectIsPrototypeOf$1;
var method$e$1 = bind$f$1;
var FunctionPrototype$4 = Function.prototype;
var bind$e$1 = function(it$1) {
	var own = it$1.bind;
	return it$1 === FunctionPrototype$4 || isPrototypeOf$h$1(FunctionPrototype$4, it$1) && own === FunctionPrototype$4.bind ? method$e$1 : own;
};
var parent$V$1 = bind$e$1;
var bind$d$1 = parent$V$1;
var bind$c$1 = bind$d$1;
var _bindInstanceProperty$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(bind$c$1);
var aCallable$9 = aCallable$e;
var toObject$7$1 = toObject$d$1;
var IndexedObject$1$1 = indexedObject$1;
var lengthOfArrayLike$7$1 = lengthOfArrayLike$c;
var $TypeError$8$1 = TypeError;
var createMethod$6 = function(IS_RIGHT) {
	return function(that, callbackfn, argumentsLength, memo) {
		aCallable$9(callbackfn);
		var O = toObject$7$1(that);
		var self$1 = IndexedObject$1$1(O);
		var length$1 = lengthOfArrayLike$7$1(O);
		var index$1 = IS_RIGHT ? length$1 - 1 : 0;
		var i$2 = IS_RIGHT ? -1 : 1;
		if (argumentsLength < 2) while (true) {
			if (index$1 in self$1) {
				memo = self$1[index$1];
				index$1 += i$2;
				break;
			}
			index$1 += i$2;
			if (IS_RIGHT ? index$1 < 0 : length$1 <= index$1) throw $TypeError$8$1("Reduce of empty array with no initial value");
		}
		for (; IS_RIGHT ? index$1 >= 0 : length$1 > index$1; index$1 += i$2) if (index$1 in self$1) memo = callbackfn(memo, self$1[index$1], index$1, O);
		return memo;
	};
};
var arrayReduce$1 = {
	left: createMethod$6(false),
	right: createMethod$6(true)
};
var fails$d$1 = fails$t$1;
var arrayMethodIsStrict$4$1 = function(METHOD_NAME, argument) {
	var method$11 = [][METHOD_NAME];
	return !!method$11 && fails$d$1(function() {
		method$11.call(null, argument || function() {
			return 1;
		}, 1);
	});
};
var classof$6$1 = classofRaw$2$1;
var engineIsNode$1 = typeof process != "undefined" && classof$6$1(process) == "process";
var $$A$1 = _export$1;
var $reduce$1 = arrayReduce$1.left;
var arrayMethodIsStrict$3$1 = arrayMethodIsStrict$4$1;
var CHROME_VERSION$1 = engineV8Version$1;
var IS_NODE$4 = engineIsNode$1;
var CHROME_BUG$1 = !IS_NODE$4 && CHROME_VERSION$1 > 79 && CHROME_VERSION$1 < 83;
var FORCED$3$1 = CHROME_BUG$1 || !arrayMethodIsStrict$3$1("reduce");
$$A$1({
	target: "Array",
	proto: true,
	forced: FORCED$3$1
}, { reduce: function reduce$5(callbackfn) {
	var length$1 = arguments.length;
	return $reduce$1(this, callbackfn, length$1, length$1 > 1 ? arguments[1] : void 0);
} });
var entryVirtual$d$1 = entryVirtual$f$1;
var reduce$3$1 = entryVirtual$d$1("Array").reduce;
var isPrototypeOf$g$1 = objectIsPrototypeOf$1;
var method$d$1 = reduce$3$1;
var ArrayPrototype$e$1 = Array.prototype;
var reduce$2$1 = function(it$1) {
	var own = it$1.reduce;
	return it$1 === ArrayPrototype$e$1 || isPrototypeOf$g$1(ArrayPrototype$e$1, it$1) && own === ArrayPrototype$e$1.reduce ? method$d$1 : own;
};
var parent$U$1 = reduce$2$1;
var reduce$1$1 = parent$U$1;
var reduce$4 = reduce$1$1;
var _reduceInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(reduce$4);
var $$z$1 = _export$1;
var $filter$1 = arrayIteration$1.filter;
var arrayMethodHasSpeciesSupport$3$1 = arrayMethodHasSpeciesSupport$5$1;
var HAS_SPECIES_SUPPORT$3$1 = arrayMethodHasSpeciesSupport$3$1("filter");
$$z$1({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$3$1
}, { filter: function filter$5(callbackfn) {
	return $filter$1(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$c$1 = entryVirtual$f$1;
var filter$3$1 = entryVirtual$c$1("Array").filter;
var isPrototypeOf$f$1 = objectIsPrototypeOf$1;
var method$c$1 = filter$3$1;
var ArrayPrototype$d$1 = Array.prototype;
var filter$2$1 = function(it$1) {
	var own = it$1.filter;
	return it$1 === ArrayPrototype$d$1 || isPrototypeOf$f$1(ArrayPrototype$d$1, it$1) && own === ArrayPrototype$d$1.filter ? method$c$1 : own;
};
var parent$T$1 = filter$2$1;
var filter$1$1 = parent$T$1;
var filter$4 = filter$1$1;
var _filterInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(filter$4);
var $$y$1 = _export$1;
var $map$1 = arrayIteration$1.map;
var arrayMethodHasSpeciesSupport$2$1 = arrayMethodHasSpeciesSupport$5$1;
var HAS_SPECIES_SUPPORT$2$1 = arrayMethodHasSpeciesSupport$2$1("map");
$$y$1({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$2$1
}, { map: function map$8(callbackfn) {
	return $map$1(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$b$1 = entryVirtual$f$1;
var map$6$1 = entryVirtual$b$1("Array").map;
var isPrototypeOf$e$1 = objectIsPrototypeOf$1;
var method$b$1 = map$6$1;
var ArrayPrototype$c$1 = Array.prototype;
var map$5$1 = function(it$1) {
	var own = it$1.map;
	return it$1 === ArrayPrototype$c$1 || isPrototypeOf$e$1(ArrayPrototype$c$1, it$1) && own === ArrayPrototype$c$1.map ? method$b$1 : own;
};
var parent$S$1 = map$5$1;
var map$4$1 = parent$S$1;
var map$3$1 = map$4$1;
var _mapInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(map$3$1);
var isArray$b$1 = isArray$f$1;
var lengthOfArrayLike$6$1 = lengthOfArrayLike$c;
var doesNotExceedSafeInteger$1$1 = doesNotExceedSafeInteger$3;
var bind$b$1 = functionBindContext$1;
var flattenIntoArray$1 = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
	var targetIndex = start;
	var sourceIndex = 0;
	var mapFn = mapper ? bind$b$1(mapper, thisArg) : false;
	var element, elementLen;
	while (sourceIndex < sourceLen) {
		if (sourceIndex in source) {
			element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
			if (depth > 0 && isArray$b$1(element)) {
				elementLen = lengthOfArrayLike$6$1(element);
				targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
			} else {
				doesNotExceedSafeInteger$1$1(targetIndex + 1);
				target[targetIndex] = element;
			}
			targetIndex++;
		}
		sourceIndex++;
	}
	return targetIndex;
};
var flattenIntoArray_1 = flattenIntoArray$1;
var $$x$1 = _export$1;
var flattenIntoArray = flattenIntoArray_1;
var aCallable$8 = aCallable$e;
var toObject$6$1 = toObject$d$1;
var lengthOfArrayLike$5$1 = lengthOfArrayLike$c;
var arraySpeciesCreate$1$1 = arraySpeciesCreate$4;
$$x$1({
	target: "Array",
	proto: true
}, { flatMap: function flatMap(callbackfn) {
	var O = toObject$6$1(this);
	var sourceLen = lengthOfArrayLike$5$1(O);
	var A;
	aCallable$8(callbackfn);
	A = arraySpeciesCreate$1$1(O, 0);
	A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
	return A;
} });
var entryVirtual$a$1 = entryVirtual$f$1;
var flatMap$3 = entryVirtual$a$1("Array").flatMap;
var ArrayPrototype$b$1 = Array.prototype;
var call$a$1 = functionCall$1;
var anObject$7$1 = anObject$d$1;
var getMethod$1$1 = getMethod$3$1;
var iteratorClose$2$1 = function(iterator$8, kind, value) {
	var innerResult, innerError;
	anObject$7$1(iterator$8);
	try {
		innerResult = getMethod$1$1(iterator$8, "return");
		if (!innerResult) {
			if (kind === "throw") throw value;
			return value;
		}
		innerResult = call$a$1(innerResult, iterator$8);
	} catch (error) {
		innerError = true;
		innerResult = error;
	}
	if (kind === "throw") throw value;
	if (innerError) throw innerResult;
	anObject$7$1(innerResult);
	return value;
};
var anObject$6$1 = anObject$d$1;
var iteratorClose$1$1 = iteratorClose$2$1;
var callWithSafeIterationClosing$1$1 = function(iterator$8, fn, value, ENTRIES$2) {
	try {
		return ENTRIES$2 ? fn(anObject$6$1(value)[0], value[1]) : fn(value);
	} catch (error) {
		iteratorClose$1$1(iterator$8, "throw", error);
	}
};
var wellKnownSymbol$7$1 = wellKnownSymbol$m;
var Iterators$1$1 = iterators$1;
var ITERATOR$2$1 = wellKnownSymbol$7$1("iterator");
var ArrayPrototype$a$1 = Array.prototype;
var isArrayIteratorMethod$2$1 = function(it$1) {
	return it$1 !== void 0 && (Iterators$1$1.Array === it$1 || ArrayPrototype$a$1[ITERATOR$2$1] === it$1);
};
var classof$5$1 = classof$d$1;
var getMethod$4 = getMethod$3$1;
var isNullOrUndefined$2$1 = isNullOrUndefined$5$1;
var Iterators$6 = iterators$1;
var wellKnownSymbol$6$1 = wellKnownSymbol$m;
var ITERATOR$1$1 = wellKnownSymbol$6$1("iterator");
var getIteratorMethod$9$1 = function(it$1) {
	if (!isNullOrUndefined$2$1(it$1)) return getMethod$4(it$1, ITERATOR$1$1) || getMethod$4(it$1, "@@iterator") || Iterators$6[classof$5$1(it$1)];
};
var call$9$1 = functionCall$1;
var aCallable$7$1 = aCallable$e;
var anObject$5$1 = anObject$d$1;
var tryToString$3$1 = tryToString$6$1;
var getIteratorMethod$8$1 = getIteratorMethod$9$1;
var $TypeError$7$1 = TypeError;
var getIterator$8 = function(argument, usingIterator) {
	var iteratorMethod = arguments.length < 2 ? getIteratorMethod$8$1(argument) : usingIterator;
	if (aCallable$7$1(iteratorMethod)) return anObject$5$1(call$9$1(iteratorMethod, argument));
	throw $TypeError$7$1(tryToString$3$1(argument) + " is not iterable");
};
var bind$a$1 = functionBindContext$1;
var call$8$1 = functionCall$1;
var toObject$5$1 = toObject$d$1;
var callWithSafeIterationClosing$2 = callWithSafeIterationClosing$1$1;
var isArrayIteratorMethod$1$1 = isArrayIteratorMethod$2$1;
var isConstructor$2$1 = isConstructor$4$1;
var lengthOfArrayLike$4$1 = lengthOfArrayLike$c;
var createProperty$3$1 = createProperty$6$1;
var getIterator$7 = getIterator$8;
var getIteratorMethod$7$1 = getIteratorMethod$9$1;
var $Array$1$1 = Array;
var arrayFrom$1 = function from$9(arrayLike) {
	var O = toObject$5$1(arrayLike);
	var IS_CONSTRUCTOR = isConstructor$2$1(this);
	var argumentsLength = arguments.length;
	var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
	var mapping = mapfn !== void 0;
	if (mapping) mapfn = bind$a$1(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
	var iteratorMethod = getIteratorMethod$7$1(O);
	var index$1 = 0;
	var length$1, result, step, iterator$8, next$1, value;
	if (iteratorMethod && !(this === $Array$1$1 && isArrayIteratorMethod$1$1(iteratorMethod))) {
		iterator$8 = getIterator$7(O, iteratorMethod);
		next$1 = iterator$8.next;
		result = IS_CONSTRUCTOR ? new this() : [];
		for (; !(step = call$8$1(next$1, iterator$8)).done; index$1++) {
			value = mapping ? callWithSafeIterationClosing$2(iterator$8, mapfn, [step.value, index$1], true) : step.value;
			createProperty$3$1(result, index$1, value);
		}
	} else {
		length$1 = lengthOfArrayLike$4$1(O);
		result = IS_CONSTRUCTOR ? new this(length$1) : $Array$1$1(length$1);
		for (; length$1 > index$1; index$1++) {
			value = mapping ? mapfn(O[index$1], index$1) : O[index$1];
			createProperty$3$1(result, index$1, value);
		}
	}
	result.length = index$1;
	return result;
};
var wellKnownSymbol$5$1 = wellKnownSymbol$m;
var ITERATOR$7 = wellKnownSymbol$5$1("iterator");
var SAFE_CLOSING$1 = false;
try {
	var called$1 = 0;
	var iteratorWithReturn$1 = {
		next: function() {
			return { done: !!called$1++ };
		},
		"return": function() {
			SAFE_CLOSING$1 = true;
		}
	};
	iteratorWithReturn$1[ITERATOR$7] = function() {
		return this;
	};
	Array.from(iteratorWithReturn$1, function() {
		throw 2;
	});
} catch (error) {}
var checkCorrectnessOfIteration$2 = function(exec$4, SKIP_CLOSING) {
	if (!SKIP_CLOSING && !SAFE_CLOSING$1) return false;
	var ITERATION_SUPPORT = false;
	try {
		var object$1 = {};
		object$1[ITERATOR$7] = function() {
			return { next: function() {
				return { done: ITERATION_SUPPORT = true };
			} };
		};
		exec$4(object$1);
	} catch (error) {}
	return ITERATION_SUPPORT;
};
var $$w$1 = _export$1;
var from$7$1 = arrayFrom$1;
var checkCorrectnessOfIteration$1$1 = checkCorrectnessOfIteration$2;
var INCORRECT_ITERATION$1 = !checkCorrectnessOfIteration$1$1(function(iterable) {
	Array.from(iterable);
});
$$w$1({
	target: "Array",
	stat: true,
	forced: INCORRECT_ITERATION$1
}, { from: from$7$1 });
var path$h$1 = path$o$1;
var from$6$1 = path$h$1.Array.from;
var parent$Q$1 = from$6$1;
var from$5$1 = parent$Q$1;
var from$4$1 = from$5$1;
var _Array$from$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(from$4$1);
var getIteratorMethod$6$1 = getIteratorMethod$9$1;
var getIteratorMethod_1$1 = getIteratorMethod$6$1;
var parent$P$1 = getIteratorMethod_1$1;
var getIteratorMethod$5$1 = parent$P$1;
var parent$O$1 = getIteratorMethod$5$1;
var getIteratorMethod$4$1 = parent$O$1;
var parent$N$1 = getIteratorMethod$4$1;
var getIteratorMethod$3$1 = parent$N$1;
var getIteratorMethod$2$1 = getIteratorMethod$3$1;
var getIteratorMethod$1$1 = getIteratorMethod$2$1;
var _getIteratorMethod$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(getIteratorMethod$1$1);
var path$g$1 = path$o$1;
var getOwnPropertySymbols$2$1 = path$g$1.Object.getOwnPropertySymbols;
var parent$M$1 = getOwnPropertySymbols$2$1;
var getOwnPropertySymbols$1$1 = parent$M$1;
var getOwnPropertySymbols$3 = getOwnPropertySymbols$1$1;
var _Object$getOwnPropertySymbols$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(getOwnPropertySymbols$3);
var getOwnPropertyDescriptor$5$1 = { exports: {} };
var $$v$1 = _export$1;
var fails$c$1 = fails$t$1;
var toIndexedObject$2$1 = toIndexedObject$a$1;
var nativeGetOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor$1.f;
var DESCRIPTORS$8$1 = descriptors$1;
var FORCED$2$1 = !DESCRIPTORS$8$1 || fails$c$1(function() {
	nativeGetOwnPropertyDescriptor$2(1);
});
$$v$1({
	target: "Object",
	stat: true,
	forced: FORCED$2$1,
	sham: !DESCRIPTORS$8$1
}, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor$11(it$1, key) {
	return nativeGetOwnPropertyDescriptor$2(toIndexedObject$2$1(it$1), key);
} });
var path$f$1 = path$o$1;
var Object$3$1 = path$f$1.Object;
var getOwnPropertyDescriptor$4$1 = getOwnPropertyDescriptor$5$1.exports = function getOwnPropertyDescriptor$11(it$1, key) {
	return Object$3$1.getOwnPropertyDescriptor(it$1, key);
};
if (Object$3$1.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$4$1.sham = true;
var getOwnPropertyDescriptorExports$4 = getOwnPropertyDescriptor$5$1.exports;
var parent$L$1 = getOwnPropertyDescriptorExports$4;
var getOwnPropertyDescriptor$3$1 = parent$L$1;
var getOwnPropertyDescriptor$2$1 = getOwnPropertyDescriptor$3$1;
var _Object$getOwnPropertyDescriptor$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(getOwnPropertyDescriptor$2$1);
var getBuiltIn$5$1 = getBuiltIn$f;
var uncurryThis$5$1 = functionUncurryThis$1;
var getOwnPropertyNamesModule$1$1 = objectGetOwnPropertyNames$1;
var getOwnPropertySymbolsModule$1$1 = objectGetOwnPropertySymbols$1;
var anObject$4$1 = anObject$d$1;
var concat$5$1 = uncurryThis$5$1([].concat);
var ownKeys$7$1 = getBuiltIn$5$1("Reflect", "ownKeys") || function ownKeys$11(it$1) {
	var keys$9 = getOwnPropertyNamesModule$1$1.f(anObject$4$1(it$1));
	var getOwnPropertySymbols$4 = getOwnPropertySymbolsModule$1$1.f;
	return getOwnPropertySymbols$4 ? concat$5$1(keys$9, getOwnPropertySymbols$4(it$1)) : keys$9;
};
var $$u$1 = _export$1;
var DESCRIPTORS$7$1 = descriptors$1;
var ownKeys$6$1 = ownKeys$7$1;
var toIndexedObject$1$1 = toIndexedObject$a$1;
var getOwnPropertyDescriptorModule$1$1 = objectGetOwnPropertyDescriptor$1;
var createProperty$2$1 = createProperty$6$1;
$$u$1({
	target: "Object",
	stat: true,
	sham: !DESCRIPTORS$7$1
}, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors$4(object$1) {
	var O = toIndexedObject$1$1(object$1);
	var getOwnPropertyDescriptor$11 = getOwnPropertyDescriptorModule$1$1.f;
	var keys$9 = ownKeys$6$1(O);
	var result = {};
	var index$1 = 0;
	var key, descriptor;
	while (keys$9.length > index$1) {
		descriptor = getOwnPropertyDescriptor$11(O, key = keys$9[index$1++]);
		if (descriptor !== void 0) createProperty$2$1(result, key, descriptor);
	}
	return result;
} });
var path$e$1 = path$o$1;
var getOwnPropertyDescriptors$2$1 = path$e$1.Object.getOwnPropertyDescriptors;
var parent$K$1 = getOwnPropertyDescriptors$2$1;
var getOwnPropertyDescriptors$1$1 = parent$K$1;
var getOwnPropertyDescriptors$3 = getOwnPropertyDescriptors$1$1;
var _Object$getOwnPropertyDescriptors$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(getOwnPropertyDescriptors$3);
var defineProperties$4$1 = { exports: {} };
var $$t$1 = _export$1;
var DESCRIPTORS$6$1 = descriptors$1;
var defineProperties$3$1 = objectDefineProperties$1.f;
$$t$1({
	target: "Object",
	stat: true,
	forced: Object.defineProperties !== defineProperties$3$1,
	sham: !DESCRIPTORS$6$1
}, { defineProperties: defineProperties$3$1 });
var path$d$1 = path$o$1;
var Object$2$1 = path$d$1.Object;
var defineProperties$2$1 = defineProperties$4$1.exports = function defineProperties$6(T, D) {
	return Object$2$1.defineProperties(T, D);
};
if (Object$2$1.defineProperties.sham) defineProperties$2$1.sham = true;
var definePropertiesExports$2 = defineProperties$4$1.exports;
var parent$J$1 = definePropertiesExports$2;
var defineProperties$1$1 = parent$J$1;
var defineProperties$5 = defineProperties$1$1;
var _Object$defineProperties$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(defineProperties$5);
var defineProperty$3$1 = defineProperty$b$1;
var _Object$defineProperty$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(defineProperty$3$1);
var $$s$1 = _export$1;
var isArray$a$1 = isArray$f$1;
$$s$1({
	target: "Array",
	stat: true
}, { isArray: isArray$a$1 });
var path$c$1 = path$o$1;
var isArray$9$1 = path$c$1.Array.isArray;
var parent$I$1 = isArray$9$1;
var isArray$8$1 = parent$I$1;
var parent$H$1 = isArray$8$1;
var isArray$7$1 = parent$H$1;
var parent$G$1 = isArray$7$1;
var isArray$6$1 = parent$G$1;
var isArray$5$1 = isArray$6$1;
var isArray$4$1 = isArray$5$1;
var _Array$isArray$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(isArray$4$1);
function _arrayWithHoles$1(arr) {
	if (_Array$isArray$1$1(arr)) return arr;
}
function _iterableToArrayLimit$1(arr, i$2) {
	var _i = null == arr ? null : "undefined" != typeof _Symbol$1$1 && _getIteratorMethod$1(arr) || arr["@@iterator"];
	if (null != _i) {
		var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1;
		try {
			if (_x = (_i = _i.call(arr)).next, 0 === i$2) {
				if (Object(_i) !== _i) return;
				_n = !1;
			} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i$2); _n = !0);
		} catch (err) {
			_d = !0, _e = err;
		} finally {
			try {
				if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
			} finally {
				if (_d) throw _e;
			}
		}
		return _arr;
	}
}
var $$r$1 = _export$1;
var isArray$3$1 = isArray$f$1;
var isConstructor$1$1 = isConstructor$4$1;
var isObject$7$1 = isObject$h$1;
var toAbsoluteIndex$1$1 = toAbsoluteIndex$4$1;
var lengthOfArrayLike$3$1 = lengthOfArrayLike$c;
var toIndexedObject$10 = toIndexedObject$a$1;
var createProperty$1$1 = createProperty$6$1;
var wellKnownSymbol$4$1 = wellKnownSymbol$m;
var arrayMethodHasSpeciesSupport$1$1 = arrayMethodHasSpeciesSupport$5$1;
var nativeSlice$1 = arraySlice$5$1;
var HAS_SPECIES_SUPPORT$1$1 = arrayMethodHasSpeciesSupport$1$1("slice");
var SPECIES$3$1 = wellKnownSymbol$4$1("species");
var $Array$4 = Array;
var max$1$1 = Math.max;
$$r$1({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$1$1
}, { slice: function slice$9(start, end) {
	var O = toIndexedObject$10(this);
	var length$1 = lengthOfArrayLike$3$1(O);
	var k = toAbsoluteIndex$1$1(start, length$1);
	var fin = toAbsoluteIndex$1$1(end === void 0 ? length$1 : end, length$1);
	var Constructor, result, n;
	if (isArray$3$1(O)) {
		Constructor = O.constructor;
		if (isConstructor$1$1(Constructor) && (Constructor === $Array$4 || isArray$3$1(Constructor.prototype))) Constructor = void 0;
		else if (isObject$7$1(Constructor)) {
			Constructor = Constructor[SPECIES$3$1];
			if (Constructor === null) Constructor = void 0;
		}
		if (Constructor === $Array$4 || Constructor === void 0) return nativeSlice$1(O, k, fin);
	}
	result = new (Constructor === void 0 ? $Array$4 : Constructor)(max$1$1(fin - k, 0));
	for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1$1(result, n, O[k]);
	result.length = n;
	return result;
} });
var entryVirtual$9$1 = entryVirtual$f$1;
var slice$7$1 = entryVirtual$9$1("Array").slice;
var isPrototypeOf$c$1 = objectIsPrototypeOf$1;
var method$9$1 = slice$7$1;
var ArrayPrototype$9$1 = Array.prototype;
var slice$6$1 = function(it$1) {
	var own = it$1.slice;
	return it$1 === ArrayPrototype$9$1 || isPrototypeOf$c$1(ArrayPrototype$9$1, it$1) && own === ArrayPrototype$9$1.slice ? method$9$1 : own;
};
var parent$F$1 = slice$6$1;
var slice$5$1 = parent$F$1;
var parent$E$1 = slice$5$1;
var slice$4$1 = parent$E$1;
var parent$D$1 = slice$4$1;
var slice$3$1 = parent$D$1;
var slice$2$1 = slice$3$1;
var slice$1$1 = slice$2$1;
var _sliceInstanceProperty$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(slice$1$1);
var parent$C$1 = from$5$1;
var from$3$1 = parent$C$1;
var parent$B$1 = from$3$1;
var from$2$1 = parent$B$1;
var from$1$1 = from$2$1;
var from$8 = from$1$1;
var _Array$from$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(from$8);
function _arrayLikeToArray$4$1(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
function _unsupportedIterableToArray$4$1(o, minLen) {
	var _context;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$4$1(o, minLen);
	var n = _sliceInstanceProperty$1$1(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$2(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4$1(o, minLen);
}
function _nonIterableRest$1() {
	throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray$1(arr, i$2) {
	return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i$2) || _unsupportedIterableToArray$4$1(arr, i$2) || _nonIterableRest$1();
}
function _arrayWithoutHoles$1(arr) {
	if (_Array$isArray$1$1(arr)) return _arrayLikeToArray$4$1(arr);
}
function _iterableToArray$1(iter) {
	if (typeof _Symbol$1$1 !== "undefined" && _getIteratorMethod$1(iter) != null || iter["@@iterator"] != null) return _Array$from$2(iter);
}
function _nonIterableSpread$1() {
	throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray$1(arr) {
	return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$4$1(arr) || _nonIterableSpread$1();
}
var symbol$7 = symbol$5$1;
var _Symbol$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(symbol$7);
var entryVirtual$8$1 = entryVirtual$f$1;
var concat$4$1 = entryVirtual$8$1("Array").concat;
var isPrototypeOf$b$1 = objectIsPrototypeOf$1;
var method$8$1 = concat$4$1;
var ArrayPrototype$8$1 = Array.prototype;
var concat$3$1 = function(it$1) {
	var own = it$1.concat;
	return it$1 === ArrayPrototype$8$1 || isPrototypeOf$b$1(ArrayPrototype$8$1, it$1) && own === ArrayPrototype$8$1.concat ? method$8$1 : own;
};
var parent$A$1 = concat$3$1;
var concat$2$1 = parent$A$1;
var concat$1$1 = concat$2$1;
var _concatInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(concat$1$1);
var slice$8 = slice$5$1;
var _sliceInstanceProperty$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(slice$8);
var $$q$1 = _export$1;
var ownKeys$5$1 = ownKeys$7$1;
$$q$1({
	target: "Reflect",
	stat: true
}, { ownKeys: ownKeys$5$1 });
var path$b$1 = path$o$1;
var ownKeys$4$1 = path$b$1.Reflect.ownKeys;
var parent$z$1 = ownKeys$4$1;
var ownKeys$3$1 = parent$z$1;
var ownKeys$2$1 = ownKeys$3$1;
var _Reflect$ownKeys = /* @__PURE__ */ getDefaultExportFromCjs$1(ownKeys$2$1);
var isArray$2$1 = isArray$8$1;
var _Array$isArray$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(isArray$2$1);
var $$p$1 = _export$1;
var toObject$4$1 = toObject$d$1;
var nativeKeys$1 = objectKeys$3$1;
var fails$b$1 = fails$t$1;
var FAILS_ON_PRIMITIVES$2$1 = fails$b$1(function() {
	nativeKeys$1(1);
});
$$p$1({
	target: "Object",
	stat: true,
	forced: FAILS_ON_PRIMITIVES$2$1
}, { keys: function keys$9(it$1) {
	return nativeKeys$1(toObject$4$1(it$1));
} });
var path$a$1 = path$o$1;
var keys$6 = path$a$1.Object.keys;
var parent$y$1 = keys$6;
var keys$5 = parent$y$1;
var keys$4 = keys$5;
var _Object$keys$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(keys$4);
var $forEach$2 = arrayIteration$1.forEach;
var arrayMethodIsStrict$2$1 = arrayMethodIsStrict$4$1;
var STRICT_METHOD$2$1 = arrayMethodIsStrict$2$1("forEach");
var arrayForEach$1 = !STRICT_METHOD$2$1 ? function forEach$11(callbackfn) {
	return $forEach$2(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} : [].forEach;
var $$o$1 = _export$1;
var forEach$9 = arrayForEach$1;
$$o$1({
	target: "Array",
	proto: true,
	forced: [].forEach != forEach$9
}, { forEach: forEach$9 });
var entryVirtual$7$1 = entryVirtual$f$1;
var forEach$8 = entryVirtual$7$1("Array").forEach;
var parent$x$1 = forEach$8;
var forEach$7 = parent$x$1;
var classof$4$1 = classof$d$1;
var hasOwn$6$1 = hasOwnProperty_1$1;
var isPrototypeOf$a$1 = objectIsPrototypeOf$1;
var method$7$1 = forEach$7;
var ArrayPrototype$7$1 = Array.prototype;
var DOMIterables$3 = {
	DOMTokenList: true,
	NodeList: true
};
var forEach$6$1 = function(it$1) {
	var own = it$1.forEach;
	return it$1 === ArrayPrototype$7$1 || isPrototypeOf$a$1(ArrayPrototype$7$1, it$1) && own === ArrayPrototype$7$1.forEach || hasOwn$6$1(DOMIterables$3, classof$4$1(it$1)) ? method$7$1 : own;
};
var forEach$5$1 = forEach$6$1;
var _forEachInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(forEach$5$1);
var $$n$1 = _export$1;
var uncurryThis$4$1 = functionUncurryThis$1;
var isArray$1$1 = isArray$f$1;
var nativeReverse$1 = uncurryThis$4$1([].reverse);
var test$1$1 = [1, 2];
$$n$1({
	target: "Array",
	proto: true,
	forced: String(test$1$1) === String(test$1$1.reverse())
}, { reverse: function reverse$9() {
	if (isArray$1$1(this)) this.length = this.length;
	return nativeReverse$1(this);
} });
var entryVirtual$6$1 = entryVirtual$f$1;
var reverse$7 = entryVirtual$6$1("Array").reverse;
var isPrototypeOf$9$1 = objectIsPrototypeOf$1;
var method$6$1 = reverse$7;
var ArrayPrototype$6$1 = Array.prototype;
var reverse$6 = function(it$1) {
	var own = it$1.reverse;
	return it$1 === ArrayPrototype$6$1 || isPrototypeOf$9$1(ArrayPrototype$6$1, it$1) && own === ArrayPrototype$6$1.reverse ? method$6$1 : own;
};
var parent$w$1 = reverse$6;
var reverse$5 = parent$w$1;
var reverse$4 = reverse$5;
var _reverseInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(reverse$4);
var DESCRIPTORS$5$1 = descriptors$1;
var isArray$10 = isArray$f$1;
var $TypeError$6$1 = TypeError;
var getOwnPropertyDescriptor$1$1 = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET$1 = DESCRIPTORS$5$1 && !function() {
	if (this !== void 0) return true;
	try {
		Object.defineProperty([], "length", { writable: false }).length = 1;
	} catch (error) {
		return error instanceof TypeError;
	}
}();
var arraySetLength$1 = SILENT_ON_NON_WRITABLE_LENGTH_SET$1 ? function(O, length$1) {
	if (isArray$10(O) && !getOwnPropertyDescriptor$1$1(O, "length").writable) throw $TypeError$6$1("Cannot set read only .length");
	return O.length = length$1;
} : function(O, length$1) {
	return O.length = length$1;
};
var tryToString$2$1 = tryToString$6$1;
var $TypeError$5$1 = TypeError;
var deletePropertyOrThrow$2$1 = function(O, P) {
	if (!delete O[P]) throw $TypeError$5$1("Cannot delete property " + tryToString$2$1(P) + " of " + tryToString$2$1(O));
};
var $$m$1 = _export$1;
var toObject$3$1 = toObject$d$1;
var toAbsoluteIndex$6 = toAbsoluteIndex$4$1;
var toIntegerOrInfinity$5 = toIntegerOrInfinity$4$1;
var lengthOfArrayLike$2$1 = lengthOfArrayLike$c;
var setArrayLength$1 = arraySetLength$1;
var doesNotExceedSafeInteger$4 = doesNotExceedSafeInteger$3;
var arraySpeciesCreate$5 = arraySpeciesCreate$4;
var createProperty$7 = createProperty$6$1;
var deletePropertyOrThrow$1$1 = deletePropertyOrThrow$2$1;
var arrayMethodHasSpeciesSupport$6 = arrayMethodHasSpeciesSupport$5$1;
var HAS_SPECIES_SUPPORT$4 = arrayMethodHasSpeciesSupport$6("splice");
var max$4 = Math.max;
var min$3 = Math.min;
$$m$1({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$4
}, { splice: function splice$6(start, deleteCount) {
	var O = toObject$3$1(this);
	var len = lengthOfArrayLike$2$1(O);
	var actualStart = toAbsoluteIndex$6(start, len);
	var argumentsLength = arguments.length;
	var insertCount, actualDeleteCount, A, k, from$9, to;
	if (argumentsLength === 0) insertCount = actualDeleteCount = 0;
	else if (argumentsLength === 1) {
		insertCount = 0;
		actualDeleteCount = len - actualStart;
	} else {
		insertCount = argumentsLength - 2;
		actualDeleteCount = min$3(max$4(toIntegerOrInfinity$5(deleteCount), 0), len - actualStart);
	}
	doesNotExceedSafeInteger$4(len + insertCount - actualDeleteCount);
	A = arraySpeciesCreate$5(O, actualDeleteCount);
	for (k = 0; k < actualDeleteCount; k++) {
		from$9 = actualStart + k;
		if (from$9 in O) createProperty$7(A, k, O[from$9]);
	}
	A.length = actualDeleteCount;
	if (insertCount < actualDeleteCount) {
		for (k = actualStart; k < len - actualDeleteCount; k++) {
			from$9 = k + actualDeleteCount;
			to = k + insertCount;
			if (from$9 in O) O[to] = O[from$9];
			else deletePropertyOrThrow$1$1(O, to);
		}
		for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow$1$1(O, k - 1);
	} else if (insertCount > actualDeleteCount) for (k = len - actualDeleteCount; k > actualStart; k--) {
		from$9 = k + actualDeleteCount - 1;
		to = k + insertCount - 1;
		if (from$9 in O) O[to] = O[from$9];
		else deletePropertyOrThrow$1$1(O, to);
	}
	for (k = 0; k < insertCount; k++) O[k + actualStart] = arguments[k + 2];
	setArrayLength$1(O, len - actualDeleteCount + insertCount);
	return A;
} });
var entryVirtual$5$1 = entryVirtual$f$1;
var splice$3$1 = entryVirtual$5$1("Array").splice;
var isPrototypeOf$8$1 = objectIsPrototypeOf$1;
var method$5$1 = splice$3$1;
var ArrayPrototype$5$1 = Array.prototype;
var splice$2$1 = function(it$1) {
	var own = it$1.splice;
	return it$1 === ArrayPrototype$5$1 || isPrototypeOf$8$1(ArrayPrototype$5$1, it$1) && own === ArrayPrototype$5$1.splice ? method$5$1 : own;
};
var parent$v$1 = splice$2$1;
var splice$1$1 = parent$v$1;
var splice$5 = splice$1$1;
var _spliceInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(splice$5);
var DESCRIPTORS$4$1 = descriptors$1;
var uncurryThis$3$1 = functionUncurryThis$1;
var call$7$1 = functionCall$1;
var fails$a$1 = fails$t$1;
var objectKeys$5 = objectKeys$3$1;
var getOwnPropertySymbolsModule$4 = objectGetOwnPropertySymbols$1;
var propertyIsEnumerableModule$3 = objectPropertyIsEnumerable$1;
var toObject$2$1 = toObject$d$1;
var IndexedObject$4 = indexedObject$1;
var $assign$1 = Object.assign;
var defineProperty$2$1 = Object.defineProperty;
var concat$7 = uncurryThis$3$1([].concat);
var objectAssign$1 = !$assign$1 || fails$a$1(function() {
	if (DESCRIPTORS$4$1 && $assign$1({ b: 1 }, $assign$1(defineProperty$2$1({}, "a", {
		enumerable: true,
		get: function() {
			defineProperty$2$1(this, "b", {
				value: 3,
				enumerable: false
			});
		}
	}), { b: 2 })).b !== 1) return true;
	var A = {};
	var B = {};
	var symbol$8 = Symbol();
	var alphabet = "abcdefghijklmnopqrst";
	A[symbol$8] = 7;
	alphabet.split("").forEach(function(chr) {
		B[chr] = chr;
	});
	return $assign$1({}, A)[symbol$8] != 7 || objectKeys$5($assign$1({}, B)).join("") != alphabet;
}) ? function assign$7(target, source) {
	var T = toObject$2$1(target);
	var argumentsLength = arguments.length;
	var index$1 = 1;
	var getOwnPropertySymbols$4 = getOwnPropertySymbolsModule$4.f;
	var propertyIsEnumerable$1 = propertyIsEnumerableModule$3.f;
	while (argumentsLength > index$1) {
		var S = IndexedObject$4(arguments[index$1++]);
		var keys$9 = getOwnPropertySymbols$4 ? concat$7(objectKeys$5(S), getOwnPropertySymbols$4(S)) : objectKeys$5(S);
		var length$1 = keys$9.length;
		var j = 0;
		var key;
		while (length$1 > j) {
			key = keys$9[j++];
			if (!DESCRIPTORS$4$1 || call$7$1(propertyIsEnumerable$1, S, key)) T[key] = S[key];
		}
	}
	return T;
} : $assign$1;
var $$l$1 = _export$1;
var assign$5$1 = objectAssign$1;
$$l$1({
	target: "Object",
	stat: true,
	arity: 2,
	forced: Object.assign !== assign$5$1
}, { assign: assign$5$1 });
var path$9$1 = path$o$1;
var assign$4$1 = path$9$1.Object.assign;
var parent$u$1 = assign$4$1;
var assign$3$1 = parent$u$1;
var assign$2$1 = assign$3$1;
var _Object$assign$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(assign$2$1);
var $$k$1 = _export$1;
var fails$9$1 = fails$t$1;
var toObject$1$1 = toObject$d$1;
var nativeGetPrototypeOf$1 = objectGetPrototypeOf$1;
var CORRECT_PROTOTYPE_GETTER$2 = correctPrototypeGetter$1;
var FAILS_ON_PRIMITIVES$1$1 = fails$9$1(function() {
	nativeGetPrototypeOf$1(1);
});
$$k$1({
	target: "Object",
	stat: true,
	forced: FAILS_ON_PRIMITIVES$1$1,
	sham: !CORRECT_PROTOTYPE_GETTER$2
}, { getPrototypeOf: function getPrototypeOf$11(it$1) {
	return nativeGetPrototypeOf$1(toObject$1$1(it$1));
} });
var path$8$1 = path$o$1;
var getPrototypeOf$6$1 = path$8$1.Object.getPrototypeOf;
var parent$t$1 = getPrototypeOf$6$1;
var getPrototypeOf$5$1 = parent$t$1;
var $$j$1 = _export$1;
var DESCRIPTORS$3$1 = descriptors$1;
var create$a$1 = objectCreate$1;
$$j$1({
	target: "Object",
	stat: true,
	sham: !DESCRIPTORS$3$1
}, { create: create$a$1 });
var path$7$1 = path$o$1;
var Object$1$1 = path$7$1.Object;
var create$9$1 = function create$11(P, D) {
	return Object$1$1.create(P, D);
};
var parent$s$1 = create$9$1;
var create$8$1 = parent$s$1;
var create$7$1 = create$8$1;
var _Object$create$1$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(create$7$1);
var path$6$1 = path$o$1;
var apply$3$1 = functionApply$1;
if (!path$6$1.JSON) path$6$1.JSON = { stringify: JSON.stringify };
var stringify$2$1 = function stringify$4(it$1, replacer, space) {
	return apply$3$1(path$6$1.JSON.stringify, null, arguments);
};
var parent$r$1 = stringify$2$1;
var stringify$1$1 = parent$r$1;
var stringify$3 = stringify$1$1;
var _JSON$stringify$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(stringify$3);
var engineIsBun$1 = typeof Bun == "function" && Bun && typeof Bun.version == "string";
var $TypeError$4$1 = TypeError;
var validateArgumentsLength$2 = function(passed, required) {
	if (passed < required) throw $TypeError$4$1("Not enough arguments");
	return passed;
};
var global$9$1 = global$m;
var apply$2$1 = functionApply$1;
var isCallable$5$1 = isCallable$m;
var ENGINE_IS_BUN$1 = engineIsBun$1;
var USER_AGENT$1 = engineUserAgent$1;
var arraySlice$2$1 = arraySlice$5$1;
var validateArgumentsLength$1$1 = validateArgumentsLength$2;
var Function$2 = global$9$1.Function;
var WRAP$1 = /MSIE .\./.test(USER_AGENT$1) || ENGINE_IS_BUN$1 && function() {
	var version$2 = global$9$1.Bun.version.split(".");
	return version$2.length < 3 || version$2[0] == 0 && (version$2[1] < 3 || version$2[1] == 3 && version$2[2] == 0);
}();
var schedulersFix$2$1 = function(scheduler, hasTimeArg) {
	var firstParamIndex = hasTimeArg ? 2 : 1;
	return WRAP$1 ? function(handler, timeout) {
		var boundArgs = validateArgumentsLength$1$1(arguments.length, 1) > firstParamIndex;
		var fn = isCallable$5$1(handler) ? handler : Function$2(handler);
		var params = boundArgs ? arraySlice$2$1(arguments, firstParamIndex) : [];
		var callback = boundArgs ? function() {
			apply$2$1(fn, this, params);
		} : fn;
		return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
	} : scheduler;
};
var $$i$1 = _export$1;
var global$8$1 = global$m;
var schedulersFix$1$1 = schedulersFix$2$1;
var setInterval$3 = schedulersFix$1$1(global$8$1.setInterval, true);
$$i$1({
	global: true,
	bind: true,
	forced: global$8$1.setInterval !== setInterval$3
}, { setInterval: setInterval$3 });
var $$h$1 = _export$1;
var global$7$1 = global$m;
var schedulersFix$3 = schedulersFix$2$1;
var setTimeout$3$1 = schedulersFix$3(global$7$1.setTimeout, true);
$$h$1({
	global: true,
	bind: true,
	forced: global$7$1.setTimeout !== setTimeout$3$1
}, { setTimeout: setTimeout$3$1 });
var path$5$1 = path$o$1;
var setTimeout$2$1 = path$5$1.setTimeout;
var setTimeout$1$1 = setTimeout$2$1;
var _setTimeout$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(setTimeout$1$1);
var componentEmitter$1 = { exports: {} };
(function(module) {
	module.exports = Emitter$2;
	/**
	
	* Initialize a new `Emitter`.
	
	*
	
	* @api public
	
	*/
	function Emitter$2(obj) {
		if (obj) return mixin(obj);
	}
	/**
	
	* Mixin the emitter properties.
	
	*
	
	* @param {Object} obj
	
	* @return {Object}
	
	* @api private
	
	*/
	function mixin(obj) {
		for (var key in Emitter$2.prototype) obj[key] = Emitter$2.prototype[key];
		return obj;
	}
	/**
	
	* Listen on the given `event` with `fn`.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.on = Emitter$2.prototype.addEventListener = function(event, fn) {
		this._callbacks = this._callbacks || {};
		(this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn);
		return this;
	};
	/**
	
	* Adds an `event` listener that will be invoked a single
	
	* time then automatically removed.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.once = function(event, fn) {
		function on() {
			this.off(event, on);
			fn.apply(this, arguments);
		}
		on.fn = fn;
		this.on(event, on);
		return this;
	};
	/**
	
	* Remove the given callback for `event` or all
	
	* registered callbacks.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.off = Emitter$2.prototype.removeListener = Emitter$2.prototype.removeAllListeners = Emitter$2.prototype.removeEventListener = function(event, fn) {
		this._callbacks = this._callbacks || {};
		if (0 == arguments.length) {
			this._callbacks = {};
			return this;
		}
		var callbacks = this._callbacks["$" + event];
		if (!callbacks) return this;
		if (1 == arguments.length) {
			delete this._callbacks["$" + event];
			return this;
		}
		var cb;
		for (var i$2 = 0; i$2 < callbacks.length; i$2++) {
			cb = callbacks[i$2];
			if (cb === fn || cb.fn === fn) {
				callbacks.splice(i$2, 1);
				break;
			}
		}
		if (callbacks.length === 0) delete this._callbacks["$" + event];
		return this;
	};
	/**
	
	* Emit `event` with the given args.
	
	*
	
	* @param {String} event
	
	* @param {Mixed} ...
	
	* @return {Emitter}
	
	*/
	Emitter$2.prototype.emit = function(event) {
		this._callbacks = this._callbacks || {};
		var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event];
		for (var i$2 = 1; i$2 < arguments.length; i$2++) args[i$2 - 1] = arguments[i$2];
		if (callbacks) {
			callbacks = callbacks.slice(0);
			for (var i$2 = 0, len = callbacks.length; i$2 < len; ++i$2) callbacks[i$2].apply(this, args);
		}
		return this;
	};
	/**
	
	* Return array of callbacks for `event`.
	
	*
	
	* @param {String} event
	
	* @return {Array}
	
	* @api public
	
	*/
	Emitter$2.prototype.listeners = function(event) {
		this._callbacks = this._callbacks || {};
		return this._callbacks["$" + event] || [];
	};
	/**
	
	* Check if this emitter has `event` handlers.
	
	*
	
	* @param {String} event
	
	* @return {Boolean}
	
	* @api public
	
	*/
	Emitter$2.prototype.hasListeners = function(event) {
		return !!this.listeners(event).length;
	};
})(componentEmitter$1);
var componentEmitterExports$1 = componentEmitter$1.exports;
var Emitter$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(componentEmitterExports$1);
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */
function _extends$1() {
	_extends$1 = Object.assign || function(target) {
		for (var i$2 = 1; i$2 < arguments.length; i$2++) {
			var source = arguments[i$2];
			for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
		}
		return target;
	};
	return _extends$1.apply(this, arguments);
}
function _inheritsLoose$1(subClass, superClass) {
	subClass.prototype = Object.create(superClass.prototype);
	subClass.prototype.constructor = subClass;
	subClass.__proto__ = superClass;
}
function _assertThisInitialized$1$1(self$1) {
	if (self$1 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
	return self$1;
}
/**
* @private
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} target
* @param {...Object} objects_to_assign
* @returns {Object} target
*/
var assign$6;
if (typeof Object.assign !== "function") assign$6 = function assign$7(target) {
	if (target === void 0 || target === null) throw new TypeError("Cannot convert undefined or null to object");
	var output = Object(target);
	for (var index$1 = 1; index$1 < arguments.length; index$1++) {
		var source = arguments[index$1];
		if (source !== void 0 && source !== null) {
			for (var nextKey in source) if (source.hasOwnProperty(nextKey)) output[nextKey] = source[nextKey];
		}
	}
	return output;
};
else assign$6 = Object.assign;
var assign$1$3 = assign$6;
var VENDOR_PREFIXES$1 = [
	"",
	"webkit",
	"Moz",
	"MS",
	"ms",
	"o"
];
var TEST_ELEMENT$1 = typeof document === "undefined" ? { style: {} } : document.createElement("div");
var TYPE_FUNCTION$1 = "function";
var round$1 = Math.round, abs$2 = Math.abs;
var now$4 = Date.now;
/**
* @private
* get the prefixed property
* @param {Object} obj
* @param {String} property
* @returns {String|Undefined} prefixed
*/
function prefixed$1(obj, property) {
	var prefix;
	var prop;
	var camelProp = property[0].toUpperCase() + property.slice(1);
	var i$2 = 0;
	while (i$2 < VENDOR_PREFIXES$1.length) {
		prefix = VENDOR_PREFIXES$1[i$2];
		prop = prefix ? prefix + camelProp : property;
		if (prop in obj) return prop;
		i$2++;
	}
	return void 0;
}
var win$1;
if (typeof window === "undefined") win$1 = {};
else win$1 = window;
var PREFIXED_TOUCH_ACTION$1 = prefixed$1(TEST_ELEMENT$1.style, "touchAction");
var NATIVE_TOUCH_ACTION$1 = PREFIXED_TOUCH_ACTION$1 !== void 0;
function getTouchActionProps$1() {
	if (!NATIVE_TOUCH_ACTION$1) return false;
	var touchMap = {};
	var cssSupports = win$1.CSS && win$1.CSS.supports;
	[
		"auto",
		"manipulation",
		"pan-y",
		"pan-x",
		"pan-x pan-y",
		"none"
	].forEach(function(val) {
		return touchMap[val] = cssSupports ? win$1.CSS.supports("touch-action", val) : true;
	});
	return touchMap;
}
var TOUCH_ACTION_COMPUTE$1 = "compute";
var TOUCH_ACTION_AUTO$1 = "auto";
var TOUCH_ACTION_MANIPULATION$1 = "manipulation";
var TOUCH_ACTION_NONE$1 = "none";
var TOUCH_ACTION_PAN_X$1 = "pan-x";
var TOUCH_ACTION_PAN_Y$1 = "pan-y";
var TOUCH_ACTION_MAP$1 = getTouchActionProps$1();
var MOBILE_REGEX$1 = /mobile|tablet|ip(ad|hone|od)|android/i;
var SUPPORT_TOUCH$1 = "ontouchstart" in win$1;
var SUPPORT_POINTER_EVENTS$1 = prefixed$1(win$1, "PointerEvent") !== void 0;
var SUPPORT_ONLY_TOUCH$1 = SUPPORT_TOUCH$1 && MOBILE_REGEX$1.test(navigator.userAgent);
var INPUT_TYPE_TOUCH$1 = "touch";
var INPUT_TYPE_PEN$1 = "pen";
var INPUT_TYPE_MOUSE$1 = "mouse";
var INPUT_TYPE_KINECT$1 = "kinect";
var COMPUTE_INTERVAL$1 = 25;
var INPUT_START$1 = 1;
var INPUT_MOVE$1 = 2;
var INPUT_END$1 = 4;
var INPUT_CANCEL$1 = 8;
var DIRECTION_NONE$1 = 1;
var DIRECTION_LEFT$1 = 2;
var DIRECTION_RIGHT$1 = 4;
var DIRECTION_UP$1 = 8;
var DIRECTION_DOWN$1 = 16;
var DIRECTION_HORIZONTAL$1 = DIRECTION_LEFT$1 | DIRECTION_RIGHT$1;
var DIRECTION_VERTICAL$1 = DIRECTION_UP$1 | DIRECTION_DOWN$1;
var DIRECTION_ALL$1 = DIRECTION_HORIZONTAL$1 | DIRECTION_VERTICAL$1;
var PROPS_XY$1 = ["x", "y"];
var PROPS_CLIENT_XY$1 = ["clientX", "clientY"];
/**
* @private
* walk objects and arrays
* @param {Object} obj
* @param {Function} iterator
* @param {Object} context
*/
function each$1(obj, iterator$8, context) {
	var i$2;
	if (!obj) return;
	if (obj.forEach) obj.forEach(iterator$8, context);
	else if (obj.length !== void 0) {
		i$2 = 0;
		while (i$2 < obj.length) {
			iterator$8.call(context, obj[i$2], i$2, obj);
			i$2++;
		}
	} else for (i$2 in obj) obj.hasOwnProperty(i$2) && iterator$8.call(context, obj[i$2], i$2, obj);
}
/**
* @private
* let a boolean value also be a function that must return a boolean
* this first item in args will be used as the context
* @param {Boolean|Function} val
* @param {Array} [args]
* @returns {Boolean}
*/
function boolOrFn$1(val, args) {
	if (typeof val === TYPE_FUNCTION$1) return val.apply(args ? args[0] || void 0 : void 0, args);
	return val;
}
/**
* @private
* small indexOf wrapper
* @param {String} str
* @param {String} find
* @returns {Boolean} found
*/
function inStr$1(str, find$1) {
	return str.indexOf(find$1) > -1;
}
/**
* @private
* when the touchActions are collected they are not a valid value, so we need to clean things up. *
* @param {String} actions
* @returns {*}
*/
function cleanTouchActions$1(actions) {
	if (inStr$1(actions, TOUCH_ACTION_NONE$1)) return TOUCH_ACTION_NONE$1;
	var hasPanX = inStr$1(actions, TOUCH_ACTION_PAN_X$1);
	var hasPanY = inStr$1(actions, TOUCH_ACTION_PAN_Y$1);
	if (hasPanX && hasPanY) return TOUCH_ACTION_NONE$1;
	if (hasPanX || hasPanY) return hasPanX ? TOUCH_ACTION_PAN_X$1 : TOUCH_ACTION_PAN_Y$1;
	if (inStr$1(actions, TOUCH_ACTION_MANIPULATION$1)) return TOUCH_ACTION_MANIPULATION$1;
	return TOUCH_ACTION_AUTO$1;
}
/**
* @private
* Touch Action
* sets the touchAction property or uses the js alternative
* @param {Manager} manager
* @param {String} value
* @constructor
*/
var TouchAction$1 = /* @__PURE__ */ function() {
	function TouchAction$2(manager, value) {
		this.manager = manager;
		this.set(value);
	}
	/**
	* @private
	* set the touchAction value on the element or enable the polyfill
	* @param {String} value
	*/
	var _proto = TouchAction$2.prototype;
	_proto.set = function set$6(value) {
		if (value === TOUCH_ACTION_COMPUTE$1) value = this.compute();
		if (NATIVE_TOUCH_ACTION$1 && this.manager.element.style && TOUCH_ACTION_MAP$1[value]) this.manager.element.style[PREFIXED_TOUCH_ACTION$1] = value;
		this.actions = value.toLowerCase().trim();
	};
	/**
	* @private
	* just re-set the touchAction value
	*/
	_proto.update = function update() {
		this.set(this.manager.options.touchAction);
	};
	/**
	* @private
	* compute the value for the touchAction property based on the recognizer's settings
	* @returns {String} value
	*/
	_proto.compute = function compute() {
		var actions = [];
		each$1(this.manager.recognizers, function(recognizer) {
			if (boolOrFn$1(recognizer.options.enable, [recognizer])) actions = actions.concat(recognizer.getTouchAction());
		});
		return cleanTouchActions$1(actions.join(" "));
	};
	/**
	* @private
	* this method is called on each input cycle and provides the preventing of the browser behavior
	* @param {Object} input
	*/
	_proto.preventDefaults = function preventDefaults(input) {
		var srcEvent = input.srcEvent;
		var direction = input.offsetDirection;
		if (this.manager.session.prevented) {
			srcEvent.preventDefault();
			return;
		}
		var actions = this.actions;
		var hasNone = inStr$1(actions, TOUCH_ACTION_NONE$1) && !TOUCH_ACTION_MAP$1[TOUCH_ACTION_NONE$1];
		var hasPanY = inStr$1(actions, TOUCH_ACTION_PAN_Y$1) && !TOUCH_ACTION_MAP$1[TOUCH_ACTION_PAN_Y$1];
		var hasPanX = inStr$1(actions, TOUCH_ACTION_PAN_X$1) && !TOUCH_ACTION_MAP$1[TOUCH_ACTION_PAN_X$1];
		if (hasNone) {
			var isTapPointer = input.pointers.length === 1;
			var isTapMovement = input.distance < 2;
			var isTapTouchTime = input.deltaTime < 250;
			if (isTapPointer && isTapMovement && isTapTouchTime) return;
		}
		if (hasPanX && hasPanY) return;
		if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL$1 || hasPanX && direction & DIRECTION_VERTICAL$1) return this.preventSrc(srcEvent);
	};
	/**
	* @private
	* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
	* @param {Object} srcEvent
	*/
	_proto.preventSrc = function preventSrc(srcEvent) {
		this.manager.session.prevented = true;
		srcEvent.preventDefault();
	};
	return TouchAction$2;
}();
/**
* @private
* find if a node is in the given parent
* @method hasParent
* @param {HTMLElement} node
* @param {HTMLElement} parent
* @return {Boolean} found
*/
function hasParent$1(node$1, parent$21) {
	while (node$1) {
		if (node$1 === parent$21) return true;
		node$1 = node$1.parentNode;
	}
	return false;
}
/**
* @private
* get the center of all the pointers
* @param {Array} pointers
* @return {Object} center contains `x` and `y` properties
*/
function getCenter$1(pointers) {
	var pointersLength = pointers.length;
	if (pointersLength === 1) return {
		x: round$1(pointers[0].clientX),
		y: round$1(pointers[0].clientY)
	};
	var x = 0;
	var y = 0;
	var i$2 = 0;
	while (i$2 < pointersLength) {
		x += pointers[i$2].clientX;
		y += pointers[i$2].clientY;
		i$2++;
	}
	return {
		x: round$1(x / pointersLength),
		y: round$1(y / pointersLength)
	};
}
/**
* @private
* create a simple clone from the input used for storage of firstInput and firstMultiple
* @param {Object} input
* @returns {Object} clonedInputData
*/
function simpleCloneInputData$1(input) {
	var pointers = [];
	var i$2 = 0;
	while (i$2 < input.pointers.length) {
		pointers[i$2] = {
			clientX: round$1(input.pointers[i$2].clientX),
			clientY: round$1(input.pointers[i$2].clientY)
		};
		i$2++;
	}
	return {
		timeStamp: now$4(),
		pointers,
		center: getCenter$1(pointers),
		deltaX: input.deltaX,
		deltaY: input.deltaY
	};
}
/**
* @private
* calculate the absolute distance between two points
* @param {Object} p1 {x, y}
* @param {Object} p2 {x, y}
* @param {Array} [props] containing x and y keys
* @return {Number} distance
*/
function getDistance$1(p1, p2, props) {
	if (!props) props = PROPS_XY$1;
	var x = p2[props[0]] - p1[props[0]];
	var y = p2[props[1]] - p1[props[1]];
	return Math.sqrt(x * x + y * y);
}
/**
* @private
* calculate the angle between two coordinates
* @param {Object} p1
* @param {Object} p2
* @param {Array} [props] containing x and y keys
* @return {Number} angle
*/
function getAngle$1(p1, p2, props) {
	if (!props) props = PROPS_XY$1;
	var x = p2[props[0]] - p1[props[0]];
	var y = p2[props[1]] - p1[props[1]];
	return Math.atan2(y, x) * 180 / Math.PI;
}
/**
* @private
* get the direction between two points
* @param {Number} x
* @param {Number} y
* @return {Number} direction
*/
function getDirection$1(x, y) {
	if (x === y) return DIRECTION_NONE$1;
	if (abs$2(x) >= abs$2(y)) return x < 0 ? DIRECTION_LEFT$1 : DIRECTION_RIGHT$1;
	return y < 0 ? DIRECTION_UP$1 : DIRECTION_DOWN$1;
}
function computeDeltaXY$1(session, input) {
	var center = input.center;
	var offset = session.offsetDelta || {};
	var prevDelta = session.prevDelta || {};
	var prevInput = session.prevInput || {};
	if (input.eventType === INPUT_START$1 || prevInput.eventType === INPUT_END$1) {
		prevDelta = session.prevDelta = {
			x: prevInput.deltaX || 0,
			y: prevInput.deltaY || 0
		};
		offset = session.offsetDelta = {
			x: center.x,
			y: center.y
		};
	}
	input.deltaX = prevDelta.x + (center.x - offset.x);
	input.deltaY = prevDelta.y + (center.y - offset.y);
}
/**
* @private
* calculate the velocity between two points. unit is in px per ms.
* @param {Number} deltaTime
* @param {Number} x
* @param {Number} y
* @return {Object} velocity `x` and `y`
*/
function getVelocity$1(deltaTime, x, y) {
	return {
		x: x / deltaTime || 0,
		y: y / deltaTime || 0
	};
}
/**
* @private
* calculate the scale factor between two pointersets
* no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} scale
*/
function getScale$1(start, end) {
	return getDistance$1(end[0], end[1], PROPS_CLIENT_XY$1) / getDistance$1(start[0], start[1], PROPS_CLIENT_XY$1);
}
/**
* @private
* calculate the rotation degrees between two pointersets
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} rotation
*/
function getRotation$1(start, end) {
	return getAngle$1(end[1], end[0], PROPS_CLIENT_XY$1) + getAngle$1(start[1], start[0], PROPS_CLIENT_XY$1);
}
/**
* @private
* velocity is calculated every x ms
* @param {Object} session
* @param {Object} input
*/
function computeIntervalInputData$1(session, input) {
	var last = session.lastInterval || input;
	var deltaTime = input.timeStamp - last.timeStamp;
	var velocity;
	var velocityX;
	var velocityY;
	var direction;
	if (input.eventType !== INPUT_CANCEL$1 && (deltaTime > COMPUTE_INTERVAL$1 || last.velocity === void 0)) {
		var deltaX = input.deltaX - last.deltaX;
		var deltaY = input.deltaY - last.deltaY;
		var v = getVelocity$1(deltaTime, deltaX, deltaY);
		velocityX = v.x;
		velocityY = v.y;
		velocity = abs$2(v.x) > abs$2(v.y) ? v.x : v.y;
		direction = getDirection$1(deltaX, deltaY);
		session.lastInterval = input;
	} else {
		velocity = last.velocity;
		velocityX = last.velocityX;
		velocityY = last.velocityY;
		direction = last.direction;
	}
	input.velocity = velocity;
	input.velocityX = velocityX;
	input.velocityY = velocityY;
	input.direction = direction;
}
/**
* @private
* extend the data with some usable properties like scale, rotate, velocity etc
* @param {Object} manager
* @param {Object} input
*/
function computeInputData$1(manager, input) {
	var session = manager.session;
	var pointers = input.pointers;
	var pointersLength = pointers.length;
	if (!session.firstInput) session.firstInput = simpleCloneInputData$1(input);
	if (pointersLength > 1 && !session.firstMultiple) session.firstMultiple = simpleCloneInputData$1(input);
	else if (pointersLength === 1) session.firstMultiple = false;
	var firstInput = session.firstInput, firstMultiple = session.firstMultiple;
	var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
	var center = input.center = getCenter$1(pointers);
	input.timeStamp = now$4();
	input.deltaTime = input.timeStamp - firstInput.timeStamp;
	input.angle = getAngle$1(offsetCenter, center);
	input.distance = getDistance$1(offsetCenter, center);
	computeDeltaXY$1(session, input);
	input.offsetDirection = getDirection$1(input.deltaX, input.deltaY);
	var overallVelocity = getVelocity$1(input.deltaTime, input.deltaX, input.deltaY);
	input.overallVelocityX = overallVelocity.x;
	input.overallVelocityY = overallVelocity.y;
	input.overallVelocity = abs$2(overallVelocity.x) > abs$2(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
	input.scale = firstMultiple ? getScale$1(firstMultiple.pointers, pointers) : 1;
	input.rotation = firstMultiple ? getRotation$1(firstMultiple.pointers, pointers) : 0;
	input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
	computeIntervalInputData$1(session, input);
	var target = manager.element;
	var srcEvent = input.srcEvent;
	var srcEventTarget;
	if (srcEvent.composedPath) srcEventTarget = srcEvent.composedPath()[0];
	else if (srcEvent.path) srcEventTarget = srcEvent.path[0];
	else srcEventTarget = srcEvent.target;
	if (hasParent$1(srcEventTarget, target)) target = srcEventTarget;
	input.target = target;
}
/**
* @private
* handle input events
* @param {Manager} manager
* @param {String} eventType
* @param {Object} input
*/
function inputHandler$1(manager, eventType, input) {
	var pointersLen = input.pointers.length;
	var changedPointersLen = input.changedPointers.length;
	var isFirst = eventType & INPUT_START$1 && pointersLen - changedPointersLen === 0;
	var isFinal = eventType & (INPUT_END$1 | INPUT_CANCEL$1) && pointersLen - changedPointersLen === 0;
	input.isFirst = !!isFirst;
	input.isFinal = !!isFinal;
	if (isFirst) manager.session = {};
	input.eventType = eventType;
	computeInputData$1(manager, input);
	manager.emit("hammer.input", input);
	manager.recognize(input);
	manager.session.prevInput = input;
}
/**
* @private
* split string on whitespace
* @param {String} str
* @returns {Array} words
*/
function splitStr$1(str) {
	return str.trim().split(/\s+/g);
}
/**
* @private
* addEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function addEventListeners$1(target, types, handler) {
	each$1(splitStr$1(types), function(type) {
		target.addEventListener(type, handler, false);
	});
}
/**
* @private
* removeEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function removeEventListeners$1(target, types, handler) {
	each$1(splitStr$1(types), function(type) {
		target.removeEventListener(type, handler, false);
	});
}
/**
* @private
* get the window object of an element
* @param {HTMLElement} element
* @returns {DocumentView|Window}
*/
function getWindowForElement$1(element) {
	var doc = element.ownerDocument || element;
	return doc.defaultView || doc.parentWindow || window;
}
/**
* @private
* create new input type manager
* @param {Manager} manager
* @param {Function} callback
* @returns {Input}
* @constructor
*/
var Input$1 = /* @__PURE__ */ function() {
	function Input$2(manager, callback) {
		var self$1 = this;
		this.manager = manager;
		this.callback = callback;
		this.element = manager.element;
		this.target = manager.options.inputTarget;
		this.domHandler = function(ev) {
			if (boolOrFn$1(manager.options.enable, [manager])) self$1.handler(ev);
		};
		this.init();
	}
	/**
	* @private
	* should handle the inputEvent data and trigger the callback
	* @virtual
	*/
	var _proto = Input$2.prototype;
	_proto.handler = function handler() {};
	/**
	* @private
	* bind the events
	*/
	_proto.init = function init() {
		this.evEl && addEventListeners$1(this.element, this.evEl, this.domHandler);
		this.evTarget && addEventListeners$1(this.target, this.evTarget, this.domHandler);
		this.evWin && addEventListeners$1(getWindowForElement$1(this.element), this.evWin, this.domHandler);
	};
	/**
	* @private
	* unbind the events
	*/
	_proto.destroy = function destroy() {
		this.evEl && removeEventListeners$1(this.element, this.evEl, this.domHandler);
		this.evTarget && removeEventListeners$1(this.target, this.evTarget, this.domHandler);
		this.evWin && removeEventListeners$1(getWindowForElement$1(this.element), this.evWin, this.domHandler);
	};
	return Input$2;
}();
/**
* @private
* find if a array contains the object using indexOf or a simple polyFill
* @param {Array} src
* @param {String} find
* @param {String} [findByKey]
* @return {Boolean|Number} false when not found, or the index
*/
function inArray$1(src, find$1, findByKey) {
	if (src.indexOf && !findByKey) return src.indexOf(find$1);
	else {
		var i$2 = 0;
		while (i$2 < src.length) {
			if (findByKey && src[i$2][findByKey] == find$1 || !findByKey && src[i$2] === find$1) return i$2;
			i$2++;
		}
		return -1;
	}
}
var POINTER_INPUT_MAP$1 = {
	pointerdown: INPUT_START$1,
	pointermove: INPUT_MOVE$1,
	pointerup: INPUT_END$1,
	pointercancel: INPUT_CANCEL$1,
	pointerout: INPUT_CANCEL$1
};
var IE10_POINTER_TYPE_ENUM$1 = {
	2: INPUT_TYPE_TOUCH$1,
	3: INPUT_TYPE_PEN$1,
	4: INPUT_TYPE_MOUSE$1,
	5: INPUT_TYPE_KINECT$1
};
var POINTER_ELEMENT_EVENTS$1 = "pointerdown";
var POINTER_WINDOW_EVENTS$1 = "pointermove pointerup pointercancel";
if (win$1.MSPointerEvent && !win$1.PointerEvent) {
	POINTER_ELEMENT_EVENTS$1 = "MSPointerDown";
	POINTER_WINDOW_EVENTS$1 = "MSPointerMove MSPointerUp MSPointerCancel";
}
/**
* @private
* Pointer events input
* @constructor
* @extends Input
*/
var PointerEventInput$1 = /* @__PURE__ */ function(_Input) {
	_inheritsLoose$1(PointerEventInput$2, _Input);
	function PointerEventInput$2() {
		var _this;
		var proto = PointerEventInput$2.prototype;
		proto.evEl = POINTER_ELEMENT_EVENTS$1;
		proto.evWin = POINTER_WINDOW_EVENTS$1;
		_this = _Input.apply(this, arguments) || this;
		_this.store = _this.manager.session.pointerEvents = [];
		return _this;
	}
	/**
	* @private
	* handle mouse events
	* @param {Object} ev
	*/
	var _proto = PointerEventInput$2.prototype;
	_proto.handler = function handler(ev) {
		var store$5 = this.store;
		var removePointer = false;
		var eventTypeNormalized = ev.type.toLowerCase().replace("ms", "");
		var eventType = POINTER_INPUT_MAP$1[eventTypeNormalized];
		var pointerType = IE10_POINTER_TYPE_ENUM$1[ev.pointerType] || ev.pointerType;
		var isTouch = pointerType === INPUT_TYPE_TOUCH$1;
		var storeIndex = inArray$1(store$5, ev.pointerId, "pointerId");
		if (eventType & INPUT_START$1 && (ev.button === 0 || isTouch)) {
			if (storeIndex < 0) {
				store$5.push(ev);
				storeIndex = store$5.length - 1;
			}
		} else if (eventType & (INPUT_END$1 | INPUT_CANCEL$1)) removePointer = true;
		if (storeIndex < 0) return;
		store$5[storeIndex] = ev;
		this.callback(this.manager, eventType, {
			pointers: store$5,
			changedPointers: [ev],
			pointerType,
			srcEvent: ev
		});
		if (removePointer) store$5.splice(storeIndex, 1);
	};
	return PointerEventInput$2;
}(Input$1);
/**
* @private
* convert array-like objects to real arrays
* @param {Object} obj
* @returns {Array}
*/
function toArray$1(obj) {
	return Array.prototype.slice.call(obj, 0);
}
/**
* @private
* unique array with objects based on a key (like 'id') or just by the array's value
* @param {Array} src [{id:1},{id:2},{id:1}]
* @param {String} [key]
* @param {Boolean} [sort=False]
* @returns {Array} [{id:1},{id:2}]
*/
function uniqueArray$1(src, key, sort$5) {
	var results = [];
	var values$8 = [];
	var i$2 = 0;
	while (i$2 < src.length) {
		var val = key ? src[i$2][key] : src[i$2];
		if (inArray$1(values$8, val) < 0) results.push(src[i$2]);
		values$8[i$2] = val;
		i$2++;
	}
	if (sort$5) if (!key) results = results.sort();
	else results = results.sort(function(a, b) {
		return a[key] > b[key];
	});
	return results;
}
var TOUCH_INPUT_MAP$1 = {
	touchstart: INPUT_START$1,
	touchmove: INPUT_MOVE$1,
	touchend: INPUT_END$1,
	touchcancel: INPUT_CANCEL$1
};
var TOUCH_TARGET_EVENTS$1 = "touchstart touchmove touchend touchcancel";
/**
* @private
* Multi-user touch events input
* @constructor
* @extends Input
*/
var TouchInput$1 = /* @__PURE__ */ function(_Input) {
	_inheritsLoose$1(TouchInput$2, _Input);
	function TouchInput$2() {
		var _this;
		TouchInput$2.prototype.evTarget = TOUCH_TARGET_EVENTS$1;
		_this = _Input.apply(this, arguments) || this;
		_this.targetIds = {};
		return _this;
	}
	var _proto = TouchInput$2.prototype;
	_proto.handler = function handler(ev) {
		var type = TOUCH_INPUT_MAP$1[ev.type];
		var touches = getTouches$1.call(this, ev, type);
		if (!touches) return;
		this.callback(this.manager, type, {
			pointers: touches[0],
			changedPointers: touches[1],
			pointerType: INPUT_TYPE_TOUCH$1,
			srcEvent: ev
		});
	};
	return TouchInput$2;
}(Input$1);
function getTouches$1(ev, type) {
	var allTouches = toArray$1(ev.touches);
	var targetIds = this.targetIds;
	if (type & (INPUT_START$1 | INPUT_MOVE$1) && allTouches.length === 1) {
		targetIds[allTouches[0].identifier] = true;
		return [allTouches, allTouches];
	}
	var i$2;
	var targetTouches;
	var changedTouches = toArray$1(ev.changedTouches);
	var changedTargetTouches = [];
	var target = this.target;
	targetTouches = allTouches.filter(function(touch) {
		return hasParent$1(touch.target, target);
	});
	if (type === INPUT_START$1) {
		i$2 = 0;
		while (i$2 < targetTouches.length) {
			targetIds[targetTouches[i$2].identifier] = true;
			i$2++;
		}
	}
	i$2 = 0;
	while (i$2 < changedTouches.length) {
		if (targetIds[changedTouches[i$2].identifier]) changedTargetTouches.push(changedTouches[i$2]);
		if (type & (INPUT_END$1 | INPUT_CANCEL$1)) delete targetIds[changedTouches[i$2].identifier];
		i$2++;
	}
	if (!changedTargetTouches.length) return;
	return [uniqueArray$1(targetTouches.concat(changedTargetTouches), "identifier", true), changedTargetTouches];
}
var MOUSE_INPUT_MAP$1 = {
	mousedown: INPUT_START$1,
	mousemove: INPUT_MOVE$1,
	mouseup: INPUT_END$1
};
var MOUSE_ELEMENT_EVENTS$1 = "mousedown";
var MOUSE_WINDOW_EVENTS$1 = "mousemove mouseup";
/**
* @private
* Mouse events input
* @constructor
* @extends Input
*/
var MouseInput$1 = /* @__PURE__ */ function(_Input) {
	_inheritsLoose$1(MouseInput$2, _Input);
	function MouseInput$2() {
		var _this;
		var proto = MouseInput$2.prototype;
		proto.evEl = MOUSE_ELEMENT_EVENTS$1;
		proto.evWin = MOUSE_WINDOW_EVENTS$1;
		_this = _Input.apply(this, arguments) || this;
		_this.pressed = false;
		return _this;
	}
	/**
	* @private
	* handle mouse events
	* @param {Object} ev
	*/
	var _proto = MouseInput$2.prototype;
	_proto.handler = function handler(ev) {
		var eventType = MOUSE_INPUT_MAP$1[ev.type];
		if (eventType & INPUT_START$1 && ev.button === 0) this.pressed = true;
		if (eventType & INPUT_MOVE$1 && ev.which !== 1) eventType = INPUT_END$1;
		if (!this.pressed) return;
		if (eventType & INPUT_END$1) this.pressed = false;
		this.callback(this.manager, eventType, {
			pointers: [ev],
			changedPointers: [ev],
			pointerType: INPUT_TYPE_MOUSE$1,
			srcEvent: ev
		});
	};
	return MouseInput$2;
}(Input$1);
/**
* @private
* Combined touch and mouse input
*
* Touch has a higher priority then mouse, and while touching no mouse events are allowed.
* This because touch devices also emit mouse events while doing a touch.
*
* @constructor
* @extends Input
*/
var DEDUP_TIMEOUT$1 = 2500;
var DEDUP_DISTANCE$1 = 25;
function setLastTouch$1(eventData) {
	var _eventData$changedPoi = eventData.changedPointers, touch = _eventData$changedPoi[0];
	if (touch.identifier === this.primaryTouch) {
		var lastTouch = {
			x: touch.clientX,
			y: touch.clientY
		};
		var lts = this.lastTouches;
		this.lastTouches.push(lastTouch);
		var removeLastTouch = function removeLastTouch$1() {
			var i$2 = lts.indexOf(lastTouch);
			if (i$2 > -1) lts.splice(i$2, 1);
		};
		setTimeout(removeLastTouch, DEDUP_TIMEOUT$1);
	}
}
function recordTouches$1(eventType, eventData) {
	if (eventType & INPUT_START$1) {
		this.primaryTouch = eventData.changedPointers[0].identifier;
		setLastTouch$1.call(this, eventData);
	} else if (eventType & (INPUT_END$1 | INPUT_CANCEL$1)) setLastTouch$1.call(this, eventData);
}
function isSyntheticEvent$1(eventData) {
	var x = eventData.srcEvent.clientX;
	var y = eventData.srcEvent.clientY;
	for (var i$2 = 0; i$2 < this.lastTouches.length; i$2++) {
		var t = this.lastTouches[i$2];
		var dx = Math.abs(x - t.x);
		var dy = Math.abs(y - t.y);
		if (dx <= DEDUP_DISTANCE$1 && dy <= DEDUP_DISTANCE$1) return true;
	}
	return false;
}
var TouchMouseInput$1 = /* @__PURE__ */ function() {
	var TouchMouseInput$2 = /* @__PURE__ */ function(_Input) {
		_inheritsLoose$1(TouchMouseInput$3, _Input);
		function TouchMouseInput$3(_manager, callback) {
			var _this;
			_this = _Input.call(this, _manager, callback) || this;
			_this.handler = function(manager, inputEvent, inputData) {
				var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH$1;
				var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE$1;
				if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) return;
				if (isTouch) recordTouches$1.call(_assertThisInitialized$1$1(_assertThisInitialized$1$1(_this)), inputEvent, inputData);
				else if (isMouse && isSyntheticEvent$1.call(_assertThisInitialized$1$1(_assertThisInitialized$1$1(_this)), inputData)) return;
				_this.callback(manager, inputEvent, inputData);
			};
			_this.touch = new TouchInput$1(_this.manager, _this.handler);
			_this.mouse = new MouseInput$1(_this.manager, _this.handler);
			_this.primaryTouch = null;
			_this.lastTouches = [];
			return _this;
		}
		/**
		* @private
		* handle mouse and touch events
		* @param {Hammer} manager
		* @param {String} inputEvent
		* @param {Object} inputData
		*/
		var _proto = TouchMouseInput$3.prototype;
		/**
		* @private
		* remove the event listeners
		*/
		_proto.destroy = function destroy() {
			this.touch.destroy();
			this.mouse.destroy();
		};
		return TouchMouseInput$3;
	}(Input$1);
	return TouchMouseInput$2;
}();
/**
* @private
* create new input type manager
* called by the Manager constructor
* @param {Hammer} manager
* @returns {Input}
*/
function createInputInstance$1(manager) {
	var Type;
	var inputClass = manager.options.inputClass;
	if (inputClass) Type = inputClass;
	else if (SUPPORT_POINTER_EVENTS$1) Type = PointerEventInput$1;
	else if (SUPPORT_ONLY_TOUCH$1) Type = TouchInput$1;
	else if (!SUPPORT_TOUCH$1) Type = MouseInput$1;
	else Type = TouchMouseInput$1;
	return new Type(manager, inputHandler$1);
}
/**
* @private
* if the argument is an array, we want to execute the fn on each entry
* if it aint an array we don't want to do a thing.
* this is used by all the methods that accept a single and array argument.
* @param {*|Array} arg
* @param {String} fn
* @param {Object} [context]
* @returns {Boolean}
*/
function invokeArrayArg$1(arg, fn, context) {
	if (Array.isArray(arg)) {
		each$1(arg, context[fn], context);
		return true;
	}
	return false;
}
var STATE_POSSIBLE$1 = 1;
var STATE_BEGAN$1 = 2;
var STATE_CHANGED$1 = 4;
var STATE_ENDED$1 = 8;
var STATE_RECOGNIZED$1 = STATE_ENDED$1;
var STATE_CANCELLED$1 = 16;
var STATE_FAILED$1 = 32;
/**
* @private
* get a unique id
* @returns {number} uniqueId
*/
var _uniqueId$1 = 1;
function uniqueId$1() {
	return _uniqueId$1++;
}
/**
* @private
* get a recognizer by name if it is bound to a manager
* @param {Recognizer|String} otherRecognizer
* @param {Recognizer} recognizer
* @returns {Recognizer}
*/
function getRecognizerByNameIfManager$1(otherRecognizer, recognizer) {
	var manager = recognizer.manager;
	if (manager) return manager.get(otherRecognizer);
	return otherRecognizer;
}
/**
* @private
* get a usable string, used as event postfix
* @param {constant} state
* @returns {String} state
*/
function stateStr$1(state) {
	if (state & STATE_CANCELLED$1) return "cancel";
	else if (state & STATE_ENDED$1) return "end";
	else if (state & STATE_CHANGED$1) return "move";
	else if (state & STATE_BEGAN$1) return "start";
	return "";
}
/**
* @private
* Recognizer flow explained; *
* All recognizers have the initial state of POSSIBLE when a input session starts.
* The definition of a input session is from the first input until the last input, with all it's movement in it. *
* Example session for mouse-input: mousedown -> mousemove -> mouseup
*
* On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
* which determines with state it should be.
*
* If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
* POSSIBLE to give it another change on the next cycle.
*
*               Possible
*                  |
*            +-----+---------------+
*            |                     |
*      +-----+-----+               |
*      |           |               |
*   Failed      Cancelled          |
*                          +-------+------+
*                          |              |
*                      Recognized       Began
*                                         |
*                                      Changed
*                                         |
*                                  Ended/Recognized
*/
/**
* @private
* Recognizer
* Every recognizer needs to extend from this class.
* @constructor
* @param {Object} options
*/
var Recognizer$1 = /* @__PURE__ */ function() {
	function Recognizer$2(options) {
		if (options === void 0) options = {};
		this.options = _extends$1({ enable: true }, options);
		this.id = uniqueId$1();
		this.manager = null;
		this.state = STATE_POSSIBLE$1;
		this.simultaneous = {};
		this.requireFail = [];
	}
	/**
	* @private
	* set options
	* @param {Object} options
	* @return {Recognizer}
	*/
	var _proto = Recognizer$2.prototype;
	_proto.set = function set$6(options) {
		assign$1$3(this.options, options);
		this.manager && this.manager.touchAction.update();
		return this;
	};
	/**
	* @private
	* recognize simultaneous with an other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.recognizeWith = function recognizeWith(otherRecognizer) {
		if (invokeArrayArg$1(otherRecognizer, "recognizeWith", this)) return this;
		var simultaneous = this.simultaneous;
		otherRecognizer = getRecognizerByNameIfManager$1(otherRecognizer, this);
		if (!simultaneous[otherRecognizer.id]) {
			simultaneous[otherRecognizer.id] = otherRecognizer;
			otherRecognizer.recognizeWith(this);
		}
		return this;
	};
	/**
	* @private
	* drop the simultaneous link. it doesnt remove the link on the other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
		if (invokeArrayArg$1(otherRecognizer, "dropRecognizeWith", this)) return this;
		otherRecognizer = getRecognizerByNameIfManager$1(otherRecognizer, this);
		delete this.simultaneous[otherRecognizer.id];
		return this;
	};
	/**
	* @private
	* recognizer can only run when an other is failing
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.requireFailure = function requireFailure(otherRecognizer) {
		if (invokeArrayArg$1(otherRecognizer, "requireFailure", this)) return this;
		var requireFail = this.requireFail;
		otherRecognizer = getRecognizerByNameIfManager$1(otherRecognizer, this);
		if (inArray$1(requireFail, otherRecognizer) === -1) {
			requireFail.push(otherRecognizer);
			otherRecognizer.requireFailure(this);
		}
		return this;
	};
	/**
	* @private
	* drop the requireFailure link. it does not remove the link on the other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
		if (invokeArrayArg$1(otherRecognizer, "dropRequireFailure", this)) return this;
		otherRecognizer = getRecognizerByNameIfManager$1(otherRecognizer, this);
		var index$1 = inArray$1(this.requireFail, otherRecognizer);
		if (index$1 > -1) this.requireFail.splice(index$1, 1);
		return this;
	};
	/**
	* @private
	* has require failures boolean
	* @returns {boolean}
	*/
	_proto.hasRequireFailures = function hasRequireFailures() {
		return this.requireFail.length > 0;
	};
	/**
	* @private
	* if the recognizer can recognize simultaneous with an other recognizer
	* @param {Recognizer} otherRecognizer
	* @returns {Boolean}
	*/
	_proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
		return !!this.simultaneous[otherRecognizer.id];
	};
	/**
	* @private
	* You should use `tryEmit` instead of `emit` directly to check
	* that all the needed recognizers has failed before emitting.
	* @param {Object} input
	*/
	_proto.emit = function emit(input) {
		var self$1 = this;
		var state = this.state;
		function emit(event) {
			self$1.manager.emit(event, input);
		}
		if (state < STATE_ENDED$1) emit(self$1.options.event + stateStr$1(state));
		emit(self$1.options.event);
		if (input.additionalEvent) emit(input.additionalEvent);
		if (state >= STATE_ENDED$1) emit(self$1.options.event + stateStr$1(state));
	};
	/**
	* @private
	* Check that all the require failure recognizers has failed,
	* if true, it emits a gesture event,
	* otherwise, setup the state to FAILED.
	* @param {Object} input
	*/
	_proto.tryEmit = function tryEmit(input) {
		if (this.canEmit()) return this.emit(input);
		this.state = STATE_FAILED$1;
	};
	/**
	* @private
	* can we emit?
	* @returns {boolean}
	*/
	_proto.canEmit = function canEmit() {
		var i$2 = 0;
		while (i$2 < this.requireFail.length) {
			if (!(this.requireFail[i$2].state & (STATE_FAILED$1 | STATE_POSSIBLE$1))) return false;
			i$2++;
		}
		return true;
	};
	/**
	* @private
	* update the recognizer
	* @param {Object} inputData
	*/
	_proto.recognize = function recognize(inputData) {
		var inputDataClone = assign$1$3({}, inputData);
		if (!boolOrFn$1(this.options.enable, [this, inputDataClone])) {
			this.reset();
			this.state = STATE_FAILED$1;
			return;
		}
		if (this.state & (STATE_RECOGNIZED$1 | STATE_CANCELLED$1 | STATE_FAILED$1)) this.state = STATE_POSSIBLE$1;
		this.state = this.process(inputDataClone);
		if (this.state & (STATE_BEGAN$1 | STATE_CHANGED$1 | STATE_ENDED$1 | STATE_CANCELLED$1)) this.tryEmit(inputDataClone);
	};
	/**
	* @private
	* return the state of the recognizer
	* the actual recognizing happens in this method
	* @virtual
	* @param {Object} inputData
	* @returns {constant} STATE
	*/
	_proto.process = function process$5(inputData) {};
	/**
	* @private
	* return the preferred touch-action
	* @virtual
	* @returns {Array}
	*/
	_proto.getTouchAction = function getTouchAction() {};
	/**
	* @private
	* called when the gesture isn't allowed to recognize
	* like when another is being recognized or it is disabled
	* @virtual
	*/
	_proto.reset = function reset() {};
	return Recognizer$2;
}();
/**
* @private
* A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
* between the given interval and position. The delay option can be used to recognize multi-taps without firing
* a single tap.
*
* The eventData from the emitted event contains the property `tapCount`, which contains the amount of
* multi-taps being recognized.
* @constructor
* @extends Recognizer
*/
var TapRecognizer$1 = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose$1(TapRecognizer$2, _Recognizer);
	function TapRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _Recognizer.call(this, _extends$1({
			event: "tap",
			pointers: 1,
			taps: 1,
			interval: 300,
			time: 250,
			threshold: 9,
			posThreshold: 10
		}, options)) || this;
		_this.pTime = false;
		_this.pCenter = false;
		_this._timer = null;
		_this._input = null;
		_this.count = 0;
		return _this;
	}
	var _proto = TapRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_MANIPULATION$1];
	};
	_proto.process = function process$5(input) {
		var _this2 = this;
		var options = this.options;
		var validPointers = input.pointers.length === options.pointers;
		var validMovement = input.distance < options.threshold;
		var validTouchTime = input.deltaTime < options.time;
		this.reset();
		if (input.eventType & INPUT_START$1 && this.count === 0) return this.failTimeout();
		if (validMovement && validTouchTime && validPointers) {
			if (input.eventType !== INPUT_END$1) return this.failTimeout();
			var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
			var validMultiTap = !this.pCenter || getDistance$1(this.pCenter, input.center) < options.posThreshold;
			this.pTime = input.timeStamp;
			this.pCenter = input.center;
			if (!validMultiTap || !validInterval) this.count = 1;
			else this.count += 1;
			this._input = input;
			var tapCount = this.count % options.taps;
			if (tapCount === 0) if (!this.hasRequireFailures()) return STATE_RECOGNIZED$1;
			else {
				this._timer = setTimeout(function() {
					_this2.state = STATE_RECOGNIZED$1;
					_this2.tryEmit();
				}, options.interval);
				return STATE_BEGAN$1;
			}
		}
		return STATE_FAILED$1;
	};
	_proto.failTimeout = function failTimeout() {
		var _this3 = this;
		this._timer = setTimeout(function() {
			_this3.state = STATE_FAILED$1;
		}, this.options.interval);
		return STATE_FAILED$1;
	};
	_proto.reset = function reset() {
		clearTimeout(this._timer);
	};
	_proto.emit = function emit() {
		if (this.state === STATE_RECOGNIZED$1) {
			this._input.tapCount = this.count;
			this.manager.emit(this.options.event, this._input);
		}
	};
	return TapRecognizer$2;
}(Recognizer$1);
/**
* @private
* This recognizer is just used as a base for the simple attribute recognizers.
* @constructor
* @extends Recognizer
*/
var AttrRecognizer$1 = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose$1(AttrRecognizer$2, _Recognizer);
	function AttrRecognizer$2(options) {
		if (options === void 0) options = {};
		return _Recognizer.call(this, _extends$1({ pointers: 1 }, options)) || this;
	}
	/**
	* @private
	* Used to check if it the recognizer receives valid input, like input.distance > 10.
	* @memberof AttrRecognizer
	* @param {Object} input
	* @returns {Boolean} recognized
	*/
	var _proto = AttrRecognizer$2.prototype;
	_proto.attrTest = function attrTest(input) {
		var optionPointers = this.options.pointers;
		return optionPointers === 0 || input.pointers.length === optionPointers;
	};
	/**
	* @private
	* Process the input and return the state for the recognizer
	* @memberof AttrRecognizer
	* @param {Object} input
	* @returns {*} State
	*/
	_proto.process = function process$5(input) {
		var state = this.state;
		var eventType = input.eventType;
		var isRecognized = state & (STATE_BEGAN$1 | STATE_CHANGED$1);
		var isValid = this.attrTest(input);
		if (isRecognized && (eventType & INPUT_CANCEL$1 || !isValid)) return state | STATE_CANCELLED$1;
		else if (isRecognized || isValid) {
			if (eventType & INPUT_END$1) return state | STATE_ENDED$1;
			else if (!(state & STATE_BEGAN$1)) return STATE_BEGAN$1;
			return state | STATE_CHANGED$1;
		}
		return STATE_FAILED$1;
	};
	return AttrRecognizer$2;
}(Recognizer$1);
/**
* @private
* direction cons to string
* @param {constant} direction
* @returns {String}
*/
function directionStr$1(direction) {
	if (direction === DIRECTION_DOWN$1) return "down";
	else if (direction === DIRECTION_UP$1) return "up";
	else if (direction === DIRECTION_LEFT$1) return "left";
	else if (direction === DIRECTION_RIGHT$1) return "right";
	return "";
}
/**
* @private
* Pan
* Recognized when the pointer is down and moved in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
var PanRecognizer$1 = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose$1(PanRecognizer$2, _AttrRecognizer);
	function PanRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _AttrRecognizer.call(this, _extends$1({
			event: "pan",
			threshold: 10,
			pointers: 1,
			direction: DIRECTION_ALL$1
		}, options)) || this;
		_this.pX = null;
		_this.pY = null;
		return _this;
	}
	var _proto = PanRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		var direction = this.options.direction;
		var actions = [];
		if (direction & DIRECTION_HORIZONTAL$1) actions.push(TOUCH_ACTION_PAN_Y$1);
		if (direction & DIRECTION_VERTICAL$1) actions.push(TOUCH_ACTION_PAN_X$1);
		return actions;
	};
	_proto.directionTest = function directionTest(input) {
		var options = this.options;
		var hasMoved = true;
		var distance = input.distance;
		var direction = input.direction;
		var x = input.deltaX;
		var y = input.deltaY;
		if (!(direction & options.direction)) if (options.direction & DIRECTION_HORIZONTAL$1) {
			direction = x === 0 ? DIRECTION_NONE$1 : x < 0 ? DIRECTION_LEFT$1 : DIRECTION_RIGHT$1;
			hasMoved = x !== this.pX;
			distance = Math.abs(input.deltaX);
		} else {
			direction = y === 0 ? DIRECTION_NONE$1 : y < 0 ? DIRECTION_UP$1 : DIRECTION_DOWN$1;
			hasMoved = y !== this.pY;
			distance = Math.abs(input.deltaY);
		}
		input.direction = direction;
		return hasMoved && distance > options.threshold && direction & options.direction;
	};
	_proto.attrTest = function attrTest(input) {
		return AttrRecognizer$1.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN$1 || !(this.state & STATE_BEGAN$1) && this.directionTest(input));
	};
	_proto.emit = function emit(input) {
		this.pX = input.deltaX;
		this.pY = input.deltaY;
		var direction = directionStr$1(input.direction);
		if (direction) input.additionalEvent = this.options.event + direction;
		_AttrRecognizer.prototype.emit.call(this, input);
	};
	return PanRecognizer$2;
}(AttrRecognizer$1);
/**
* @private
* Swipe
* Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
var SwipeRecognizer$1 = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose$1(SwipeRecognizer$2, _AttrRecognizer);
	function SwipeRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends$1({
			event: "swipe",
			threshold: 10,
			velocity: .3,
			direction: DIRECTION_HORIZONTAL$1 | DIRECTION_VERTICAL$1,
			pointers: 1
		}, options)) || this;
	}
	var _proto = SwipeRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return PanRecognizer$1.prototype.getTouchAction.call(this);
	};
	_proto.attrTest = function attrTest(input) {
		var direction = this.options.direction;
		var velocity;
		if (direction & (DIRECTION_HORIZONTAL$1 | DIRECTION_VERTICAL$1)) velocity = input.overallVelocity;
		else if (direction & DIRECTION_HORIZONTAL$1) velocity = input.overallVelocityX;
		else if (direction & DIRECTION_VERTICAL$1) velocity = input.overallVelocityY;
		return _AttrRecognizer.prototype.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs$2(velocity) > this.options.velocity && input.eventType & INPUT_END$1;
	};
	_proto.emit = function emit(input) {
		var direction = directionStr$1(input.offsetDirection);
		if (direction) this.manager.emit(this.options.event + direction, input);
		this.manager.emit(this.options.event, input);
	};
	return SwipeRecognizer$2;
}(AttrRecognizer$1);
/**
* @private
* Pinch
* Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
* @constructor
* @extends AttrRecognizer
*/
var PinchRecognizer$1 = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose$1(PinchRecognizer$2, _AttrRecognizer);
	function PinchRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends$1({
			event: "pinch",
			threshold: 0,
			pointers: 2
		}, options)) || this;
	}
	var _proto = PinchRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_NONE$1];
	};
	_proto.attrTest = function attrTest(input) {
		return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN$1);
	};
	_proto.emit = function emit(input) {
		if (input.scale !== 1) {
			var inOut = input.scale < 1 ? "in" : "out";
			input.additionalEvent = this.options.event + inOut;
		}
		_AttrRecognizer.prototype.emit.call(this, input);
	};
	return PinchRecognizer$2;
}(AttrRecognizer$1);
/**
* @private
* Rotate
* Recognized when two or more pointer are moving in a circular motion.
* @constructor
* @extends AttrRecognizer
*/
var RotateRecognizer$1 = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose$1(RotateRecognizer$2, _AttrRecognizer);
	function RotateRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends$1({
			event: "rotate",
			threshold: 0,
			pointers: 2
		}, options)) || this;
	}
	var _proto = RotateRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_NONE$1];
	};
	_proto.attrTest = function attrTest(input) {
		return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN$1);
	};
	return RotateRecognizer$2;
}(AttrRecognizer$1);
/**
* @private
* Press
* Recognized when the pointer is down for x ms without any movement.
* @constructor
* @extends Recognizer
*/
var PressRecognizer$1 = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose$1(PressRecognizer$2, _Recognizer);
	function PressRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _Recognizer.call(this, _extends$1({
			event: "press",
			pointers: 1,
			time: 251,
			threshold: 9
		}, options)) || this;
		_this._timer = null;
		_this._input = null;
		return _this;
	}
	var _proto = PressRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_AUTO$1];
	};
	_proto.process = function process$5(input) {
		var _this2 = this;
		var options = this.options;
		var validPointers = input.pointers.length === options.pointers;
		var validMovement = input.distance < options.threshold;
		var validTime = input.deltaTime > options.time;
		this._input = input;
		if (!validMovement || !validPointers || input.eventType & (INPUT_END$1 | INPUT_CANCEL$1) && !validTime) this.reset();
		else if (input.eventType & INPUT_START$1) {
			this.reset();
			this._timer = setTimeout(function() {
				_this2.state = STATE_RECOGNIZED$1;
				_this2.tryEmit();
			}, options.time);
		} else if (input.eventType & INPUT_END$1) return STATE_RECOGNIZED$1;
		return STATE_FAILED$1;
	};
	_proto.reset = function reset() {
		clearTimeout(this._timer);
	};
	_proto.emit = function emit(input) {
		if (this.state !== STATE_RECOGNIZED$1) return;
		if (input && input.eventType & INPUT_END$1) this.manager.emit(this.options.event + "up", input);
		else {
			this._input.timeStamp = now$4();
			this.manager.emit(this.options.event, this._input);
		}
	};
	return PressRecognizer$2;
}(Recognizer$1);
var defaults$1 = {
	domEvents: false,
	touchAction: TOUCH_ACTION_COMPUTE$1,
	enable: true,
	inputTarget: null,
	inputClass: null,
	cssProps: {
		userSelect: "none",
		touchSelect: "none",
		touchCallout: "none",
		contentZooming: "none",
		userDrag: "none",
		tapHighlightColor: "rgba(0,0,0,0)"
	}
};
/**
* @private
* Default recognizer setup when calling `Hammer()`
* When creating a new Manager these will be skipped.
* This is separated with other defaults because of tree-shaking.
* @type {Array}
*/
var preset$1 = [
	[RotateRecognizer$1, { enable: false }],
	[
		PinchRecognizer$1,
		{ enable: false },
		["rotate"]
	],
	[SwipeRecognizer$1, { direction: DIRECTION_HORIZONTAL$1 }],
	[
		PanRecognizer$1,
		{ direction: DIRECTION_HORIZONTAL$1 },
		["swipe"]
	],
	[TapRecognizer$1],
	[
		TapRecognizer$1,
		{
			event: "doubletap",
			taps: 2
		},
		["tap"]
	],
	[PressRecognizer$1]
];
var STOP$1 = 1;
var FORCED_STOP$1 = 2;
/**
* @private
* add/remove the css properties as defined in manager.options.cssProps
* @param {Manager} manager
* @param {Boolean} add
*/
function toggleCssProps$1(manager, add) {
	var element = manager.element;
	if (!element.style) return;
	var prop;
	each$1(manager.options.cssProps, function(value, name) {
		prop = prefixed$1(element.style, name);
		if (add) {
			manager.oldCssProps[prop] = element.style[prop];
			element.style[prop] = value;
		} else element.style[prop] = manager.oldCssProps[prop] || "";
	});
	if (!add) manager.oldCssProps = {};
}
/**
* @private
* trigger dom event
* @param {String} event
* @param {Object} data
*/
function triggerDomEvent$1(event, data$2) {
	var gestureEvent = document.createEvent("Event");
	gestureEvent.initEvent(event, true, true);
	gestureEvent.gesture = data$2;
	data$2.target.dispatchEvent(gestureEvent);
}
/**
* @private
* Manager
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
var Manager$1 = /* @__PURE__ */ function() {
	function Manager$2(element, options) {
		var _this = this;
		this.options = assign$1$3({}, defaults$1, options || {});
		this.options.inputTarget = this.options.inputTarget || element;
		this.handlers = {};
		this.session = {};
		this.recognizers = [];
		this.oldCssProps = {};
		this.element = element;
		this.input = createInputInstance$1(this);
		this.touchAction = new TouchAction$1(this, this.options.touchAction);
		toggleCssProps$1(this, true);
		each$1(this.options.recognizers, function(item) {
			var recognizer = _this.add(new item[0](item[1]));
			item[2] && recognizer.recognizeWith(item[2]);
			item[3] && recognizer.requireFailure(item[3]);
		}, this);
	}
	/**
	* @private
	* set options
	* @param {Object} options
	* @returns {Manager}
	*/
	var _proto = Manager$2.prototype;
	_proto.set = function set$6(options) {
		assign$1$3(this.options, options);
		if (options.touchAction) this.touchAction.update();
		if (options.inputTarget) {
			this.input.destroy();
			this.input.target = options.inputTarget;
			this.input.init();
		}
		return this;
	};
	/**
	* @private
	* stop recognizing for this session.
	* This session will be discarded, when a new [input]start event is fired.
	* When forced, the recognizer cycle is stopped immediately.
	* @param {Boolean} [force]
	*/
	_proto.stop = function stop(force) {
		this.session.stopped = force ? FORCED_STOP$1 : STOP$1;
	};
	/**
	* @private
	* run the recognizers!
	* called by the inputHandler function on every movement of the pointers (touches)
	* it walks through all the recognizers and tries to detect the gesture that is being made
	* @param {Object} inputData
	*/
	_proto.recognize = function recognize(inputData) {
		var session = this.session;
		if (session.stopped) return;
		this.touchAction.preventDefaults(inputData);
		var recognizer;
		var recognizers = this.recognizers;
		var curRecognizer = session.curRecognizer;
		if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED$1) {
			session.curRecognizer = null;
			curRecognizer = null;
		}
		var i$2 = 0;
		while (i$2 < recognizers.length) {
			recognizer = recognizers[i$2];
			if (session.stopped !== FORCED_STOP$1 && (!curRecognizer || recognizer === curRecognizer || recognizer.canRecognizeWith(curRecognizer))) recognizer.recognize(inputData);
			else recognizer.reset();
			if (!curRecognizer && recognizer.state & (STATE_BEGAN$1 | STATE_CHANGED$1 | STATE_ENDED$1)) {
				session.curRecognizer = recognizer;
				curRecognizer = recognizer;
			}
			i$2++;
		}
	};
	/**
	* @private
	* get a recognizer by its event name.
	* @param {Recognizer|String} recognizer
	* @returns {Recognizer|Null}
	*/
	_proto.get = function get$9(recognizer) {
		if (recognizer instanceof Recognizer$1) return recognizer;
		var recognizers = this.recognizers;
		for (var i$2 = 0; i$2 < recognizers.length; i$2++) if (recognizers[i$2].options.event === recognizer) return recognizers[i$2];
		return null;
	};
	/**
	* @private add a recognizer to the manager
	* existing recognizers with the same event name will be removed
	* @param {Recognizer} recognizer
	* @returns {Recognizer|Manager}
	*/
	_proto.add = function add(recognizer) {
		if (invokeArrayArg$1(recognizer, "add", this)) return this;
		var existing = this.get(recognizer.options.event);
		if (existing) this.remove(existing);
		this.recognizers.push(recognizer);
		recognizer.manager = this;
		this.touchAction.update();
		return recognizer;
	};
	/**
	* @private
	* remove a recognizer by name or instance
	* @param {Recognizer|String} recognizer
	* @returns {Manager}
	*/
	_proto.remove = function remove(recognizer) {
		if (invokeArrayArg$1(recognizer, "remove", this)) return this;
		var targetRecognizer = this.get(recognizer);
		if (recognizer) {
			var recognizers = this.recognizers;
			var index$1 = inArray$1(recognizers, targetRecognizer);
			if (index$1 !== -1) {
				recognizers.splice(index$1, 1);
				this.touchAction.update();
			}
		}
		return this;
	};
	/**
	* @private
	* bind event
	* @param {String} events
	* @param {Function} handler
	* @returns {EventEmitter} this
	*/
	_proto.on = function on(events, handler) {
		if (events === void 0 || handler === void 0) return this;
		var handlers = this.handlers;
		each$1(splitStr$1(events), function(event) {
			handlers[event] = handlers[event] || [];
			handlers[event].push(handler);
		});
		return this;
	};
	/**
	* @private unbind event, leave emit blank to remove all handlers
	* @param {String} events
	* @param {Function} [handler]
	* @returns {EventEmitter} this
	*/
	_proto.off = function off(events, handler) {
		if (events === void 0) return this;
		var handlers = this.handlers;
		each$1(splitStr$1(events), function(event) {
			if (!handler) delete handlers[event];
			else handlers[event] && handlers[event].splice(inArray$1(handlers[event], handler), 1);
		});
		return this;
	};
	/**
	* @private emit event to the listeners
	* @param {String} event
	* @param {Object} data
	*/
	_proto.emit = function emit(event, data$2) {
		if (this.options.domEvents) triggerDomEvent$1(event, data$2);
		var handlers = this.handlers[event] && this.handlers[event].slice();
		if (!handlers || !handlers.length) return;
		data$2.type = event;
		data$2.preventDefault = function() {
			data$2.srcEvent.preventDefault();
		};
		var i$2 = 0;
		while (i$2 < handlers.length) {
			handlers[i$2](data$2);
			i$2++;
		}
	};
	/**
	* @private
	* destroy the manager and unbinds all events
	* it doesn't unbind dom events, that is the user own responsibility
	*/
	_proto.destroy = function destroy() {
		this.element && toggleCssProps$1(this, false);
		this.handlers = {};
		this.session = {};
		this.input.destroy();
		this.element = null;
	};
	return Manager$2;
}();
var SINGLE_TOUCH_INPUT_MAP$1 = {
	touchstart: INPUT_START$1,
	touchmove: INPUT_MOVE$1,
	touchend: INPUT_END$1,
	touchcancel: INPUT_CANCEL$1
};
var SINGLE_TOUCH_TARGET_EVENTS$1 = "touchstart";
var SINGLE_TOUCH_WINDOW_EVENTS$1 = "touchstart touchmove touchend touchcancel";
/**
* @private
* Touch events input
* @constructor
* @extends Input
*/
var SingleTouchInput$1 = /* @__PURE__ */ function(_Input) {
	_inheritsLoose$1(SingleTouchInput$2, _Input);
	function SingleTouchInput$2() {
		var _this;
		var proto = SingleTouchInput$2.prototype;
		proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS$1;
		proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS$1;
		_this = _Input.apply(this, arguments) || this;
		_this.started = false;
		return _this;
	}
	var _proto = SingleTouchInput$2.prototype;
	_proto.handler = function handler(ev) {
		var type = SINGLE_TOUCH_INPUT_MAP$1[ev.type];
		if (type === INPUT_START$1) this.started = true;
		if (!this.started) return;
		var touches = normalizeSingleTouches$1.call(this, ev, type);
		if (type & (INPUT_END$1 | INPUT_CANCEL$1) && touches[0].length - touches[1].length === 0) this.started = false;
		this.callback(this.manager, type, {
			pointers: touches[0],
			changedPointers: touches[1],
			pointerType: INPUT_TYPE_TOUCH$1,
			srcEvent: ev
		});
	};
	return SingleTouchInput$2;
}(Input$1);
function normalizeSingleTouches$1(ev, type) {
	var all = toArray$1(ev.touches);
	var changed = toArray$1(ev.changedTouches);
	if (type & (INPUT_END$1 | INPUT_CANCEL$1)) all = uniqueArray$1(all.concat(changed), "identifier", true);
	return [all, changed];
}
/**
* @private
* wrap a method with a deprecation warning and stack trace
* @param {Function} method
* @param {String} name
* @param {String} message
* @returns {Function} A new function wrapping the supplied method.
*/
function deprecate$1(method$11, name, message) {
	var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
	return function() {
		var e = new Error("get-stack-trace");
		var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace";
		var log = window.console && (window.console.warn || window.console.log);
		if (log) log.call(window.console, deprecationMessage, stack);
		return method$11.apply(this, arguments);
	};
}
/**
* @private
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} dest
* @param {Object} src
* @param {Boolean} [merge=false]
* @returns {Object} dest
*/
var extend$1 = deprecate$1(function(dest, src, merge$4) {
	var keys$9 = Object.keys(src);
	var i$2 = 0;
	while (i$2 < keys$9.length) {
		if (!merge$4 || merge$4 && dest[keys$9[i$2]] === void 0) dest[keys$9[i$2]] = src[keys$9[i$2]];
		i$2++;
	}
	return dest;
}, "extend", "Use `assign`.");
/**
* @private
* merge the values from src in the dest.
* means that properties that exist in dest will not be overwritten by src
* @param {Object} dest
* @param {Object} src
* @returns {Object} dest
*/
var merge$1$1 = deprecate$1(function(dest, src) {
	return extend$1(dest, src, true);
}, "merge", "Use `assign`.");
/**
* @private
* simple class inheritance
* @param {Function} child
* @param {Function} base
* @param {Object} [properties]
*/
function inherit$1(child, base, properties) {
	var baseP = base.prototype;
	var childP;
	childP = child.prototype = Object.create(baseP);
	childP.constructor = child;
	childP._super = baseP;
	if (properties) assign$1$3(childP, properties);
}
/**
* @private
* simple function bind
* @param {Function} fn
* @param {Object} context
* @returns {Function}
*/
function bindFn$1(fn, context) {
	return function boundFn() {
		return fn.apply(context, arguments);
	};
}
/**
* @private
* Simple way to create a manager with a default set of recognizers.
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
var Hammer$3 = /* @__PURE__ */ function() {
	var Hammer$4 = function Hammer$5(element, options) {
		if (options === void 0) options = {};
		return new Manager$1(element, _extends$1({ recognizers: preset$1.concat() }, options));
	};
	Hammer$4.VERSION = "2.0.17-rc";
	Hammer$4.DIRECTION_ALL = DIRECTION_ALL$1;
	Hammer$4.DIRECTION_DOWN = DIRECTION_DOWN$1;
	Hammer$4.DIRECTION_LEFT = DIRECTION_LEFT$1;
	Hammer$4.DIRECTION_RIGHT = DIRECTION_RIGHT$1;
	Hammer$4.DIRECTION_UP = DIRECTION_UP$1;
	Hammer$4.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL$1;
	Hammer$4.DIRECTION_VERTICAL = DIRECTION_VERTICAL$1;
	Hammer$4.DIRECTION_NONE = DIRECTION_NONE$1;
	Hammer$4.DIRECTION_DOWN = DIRECTION_DOWN$1;
	Hammer$4.INPUT_START = INPUT_START$1;
	Hammer$4.INPUT_MOVE = INPUT_MOVE$1;
	Hammer$4.INPUT_END = INPUT_END$1;
	Hammer$4.INPUT_CANCEL = INPUT_CANCEL$1;
	Hammer$4.STATE_POSSIBLE = STATE_POSSIBLE$1;
	Hammer$4.STATE_BEGAN = STATE_BEGAN$1;
	Hammer$4.STATE_CHANGED = STATE_CHANGED$1;
	Hammer$4.STATE_ENDED = STATE_ENDED$1;
	Hammer$4.STATE_RECOGNIZED = STATE_RECOGNIZED$1;
	Hammer$4.STATE_CANCELLED = STATE_CANCELLED$1;
	Hammer$4.STATE_FAILED = STATE_FAILED$1;
	Hammer$4.Manager = Manager$1;
	Hammer$4.Input = Input$1;
	Hammer$4.TouchAction = TouchAction$1;
	Hammer$4.TouchInput = TouchInput$1;
	Hammer$4.MouseInput = MouseInput$1;
	Hammer$4.PointerEventInput = PointerEventInput$1;
	Hammer$4.TouchMouseInput = TouchMouseInput$1;
	Hammer$4.SingleTouchInput = SingleTouchInput$1;
	Hammer$4.Recognizer = Recognizer$1;
	Hammer$4.AttrRecognizer = AttrRecognizer$1;
	Hammer$4.Tap = TapRecognizer$1;
	Hammer$4.Pan = PanRecognizer$1;
	Hammer$4.Swipe = SwipeRecognizer$1;
	Hammer$4.Pinch = PinchRecognizer$1;
	Hammer$4.Rotate = RotateRecognizer$1;
	Hammer$4.Press = PressRecognizer$1;
	Hammer$4.on = addEventListeners$1;
	Hammer$4.off = removeEventListeners$1;
	Hammer$4.each = each$1;
	Hammer$4.merge = merge$1$1;
	Hammer$4.extend = extend$1;
	Hammer$4.bindFn = bindFn$1;
	Hammer$4.assign = assign$1$3;
	Hammer$4.inherit = inherit$1;
	Hammer$4.bindFn = bindFn$1;
	Hammer$4.prefixed = prefixed$1;
	Hammer$4.toArray = toArray$1;
	Hammer$4.inArray = inArray$1;
	Hammer$4.uniqueArray = uniqueArray$1;
	Hammer$4.splitStr = splitStr$1;
	Hammer$4.boolOrFn = boolOrFn$1;
	Hammer$4.hasParent = hasParent$1;
	Hammer$4.addEventListeners = addEventListeners$1;
	Hammer$4.removeEventListeners = removeEventListeners$1;
	Hammer$4.defaults = assign$1$3({}, defaults$1, { preset: preset$1 });
	return Hammer$4;
}();
var RealHammer$1 = Hammer$3;
function _createForOfIteratorHelper$3$1(o, allowArrayLike) {
	var it$1 = typeof _Symbol$2 !== "undefined" && _getIteratorMethod$1(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray$2(o) || (it$1 = _unsupportedIterableToArray$3$1(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$3$1(o, minLen) {
	var _context21;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$3$1(o, minLen);
	var n = _sliceInstanceProperty$2(_context21 = Object.prototype.toString.call(o)).call(_context21, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3$1(o, minLen);
}
function _arrayLikeToArray$3$1(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**

* Use this symbol to delete properies in deepObjectAssign.

*/
var DELETE = _Symbol$2("DELETE");
/**

* Pure version of deepObjectAssign, it doesn't modify any of it's arguments.

*

* @param base - The base object that fullfils the whole interface T.

* @param updates - Updates that may change or delete props.

* @returns A brand new instance with all the supplied objects deeply merged.

*/
function pureDeepObjectAssign(base) {
	var _context;
	for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) updates[_key - 1] = arguments[_key];
	return deepObjectAssign.apply(void 0, _concatInstanceProperty$1(_context = [{}, base]).call(_context, updates));
}
/**

* Deep version of object assign with additional deleting by the DELETE symbol.

*

* @param values - Objects to be deeply merged.

* @returns The first object from values.

*/
function deepObjectAssign() {
	var merged = deepObjectAssignNonentry.apply(void 0, arguments);
	stripDelete(merged);
	return merged;
}
/**

* Deep version of object assign with additional deleting by the DELETE symbol.

*

* @remarks

* This doesn't strip the DELETE symbols so they may end up in the final object.

* @param values - Objects to be deeply merged.

* @returns The first object from values.

*/
function deepObjectAssignNonentry() {
	for (var _len2 = arguments.length, values$8 = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) values$8[_key2] = arguments[_key2];
	if (values$8.length < 2) return values$8[0];
	else if (values$8.length > 2) {
		var _context2;
		return deepObjectAssignNonentry.apply(void 0, _concatInstanceProperty$1(_context2 = [deepObjectAssign(values$8[0], values$8[1])]).call(_context2, _toConsumableArray$1(_sliceInstanceProperty$2(values$8).call(values$8, 2))));
	}
	var a = values$8[0];
	var b = values$8[1];
	var _iterator = _createForOfIteratorHelper$3$1(_Reflect$ownKeys(b)), _step;
	try {
		for (_iterator.s(); !(_step = _iterator.n()).done;) {
			var prop = _step.value;
			if (!Object.prototype.propertyIsEnumerable.call(b, prop));
			else if (b[prop] === DELETE) delete a[prop];
			else if (a[prop] !== null && b[prop] !== null && _typeof$1(a[prop]) === "object" && _typeof$1(b[prop]) === "object" && !_Array$isArray$2(a[prop]) && !_Array$isArray$2(b[prop])) a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);
			else a[prop] = clone(b[prop]);
		}
	} catch (err) {
		_iterator.e(err);
	} finally {
		_iterator.f();
	}
	return a;
}
/**

* Deep clone given object or array. In case of primitive simply return.

*

* @param a - Anything.

* @returns Deep cloned object/array or unchanged a.

*/
function clone(a) {
	if (_Array$isArray$2(a)) return _mapInstanceProperty$1(a).call(a, function(value) {
		return clone(value);
	});
	else if (_typeof$1(a) === "object" && a !== null) return deepObjectAssignNonentry({}, a);
	else return a;
}
/**

* Strip DELETE from given object.

*

* @param a - Object which may contain DELETE but won't after this is executed.

*/
function stripDelete(a) {
	for (var _i = 0, _Object$keys$1$1 = _Object$keys$1(a); _i < _Object$keys$1$1.length; _i++) {
		var prop = _Object$keys$1$1[_i];
		if (a[prop] === DELETE) delete a[prop];
		else if (_typeof$1(a[prop]) === "object" && a[prop] !== null) stripDelete(a[prop]);
	}
}
/**
* Setup a mock hammer.js object, for unit testing.
*
* Inspiration: https://github.com/uber/deck.gl/pull/658
*
* @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
*/
function hammerMock$1() {
	var noop$2 = function noop$3() {};
	return {
		on: noop$2,
		off: noop$2,
		destroy: noop$2,
		emit: noop$2,
		get: function get$9() {
			return { set: noop$2 };
		}
	};
}
var Hammer$1$4 = typeof window !== "undefined" ? window.Hammer || RealHammer$1 : function() {
	return hammerMock$1();
};
/**
* Turn an element into an clickToUse element.
* When not active, the element has a transparent overlay. When the overlay is
* clicked, the mode is changed to active.
* When active, the element is displayed with a blue border around it, and
* the interactive contents of the element can be used. When clicked outside
* the element, the elements mode is changed to inactive.
*
* @param {Element} container
* @class Activator
*/
function Activator$1$1(container) {
	var _this = this, _context3;
	this._cleanupQueue = [];
	this.active = false;
	this._dom = {
		container,
		overlay: document.createElement("div")
	};
	this._dom.overlay.classList.add("vis-overlay");
	this._dom.container.appendChild(this._dom.overlay);
	this._cleanupQueue.push(function() {
		_this._dom.overlay.parentNode.removeChild(_this._dom.overlay);
	});
	var hammer = Hammer$1$4(this._dom.overlay);
	hammer.on("tap", _bindInstanceProperty$1$1(_context3 = this._onTapOverlay).call(_context3, this));
	this._cleanupQueue.push(function() {
		hammer.destroy();
	});
	var events = [
		"tap",
		"doubletap",
		"press",
		"pinch",
		"pan",
		"panstart",
		"panmove",
		"panend"
	];
	_forEachInstanceProperty$1(events).call(events, function(event) {
		hammer.on(event, function(event$1) {
			event$1.srcEvent.stopPropagation();
		});
	});
	if (document && document.body) {
		this._onClick = function(event) {
			if (!_hasParent$1(event.target, container)) _this.deactivate();
		};
		document.body.addEventListener("click", this._onClick);
		this._cleanupQueue.push(function() {
			document.body.removeEventListener("click", _this._onClick);
		});
	}
	this._escListener = function(event) {
		if ("key" in event ? event.key === "Escape" : event.keyCode === 27) _this.deactivate();
	};
}
Emitter$1(Activator$1$1.prototype);
Activator$1$1.current = null;
/**
* Destroy the activator. Cleans up all created DOM and event listeners
*/
Activator$1$1.prototype.destroy = function() {
	var _context4, _context5;
	this.deactivate();
	var _iterator2 = _createForOfIteratorHelper$3$1(_reverseInstanceProperty$1(_context4 = _spliceInstanceProperty$1(_context5 = this._cleanupQueue).call(_context5, 0)).call(_context4)), _step2;
	try {
		for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
			var callback = _step2.value;
			callback();
		}
	} catch (err) {
		_iterator2.e(err);
	} finally {
		_iterator2.f();
	}
};
/**
* Activate the element
* Overlay is hidden, element is decorated with a blue shadow border
*/
Activator$1$1.prototype.activate = function() {
	if (Activator$1$1.current) Activator$1$1.current.deactivate();
	Activator$1$1.current = this;
	this.active = true;
	this._dom.overlay.style.display = "none";
	this._dom.container.classList.add("vis-active");
	this.emit("change");
	this.emit("activate");
	document.body.addEventListener("keydown", this._escListener);
};
/**
* Deactivate the element
* Overlay is displayed on top of the element
*/
Activator$1$1.prototype.deactivate = function() {
	this.active = false;
	this._dom.overlay.style.display = "block";
	this._dom.container.classList.remove("vis-active");
	document.body.removeEventListener("keydown", this._escListener);
	this.emit("change");
	this.emit("deactivate");
};
/**
* Handle a tap event: activate the container
*
* @param {Event}  event   The event
* @private
*/
Activator$1$1.prototype._onTapOverlay = function(event) {
	this.activate();
	event.srcEvent.stopPropagation();
};
/**
* Test whether the element has the requested parent element somewhere in
* its chain of parent nodes.
*
* @param {HTMLElement} element
* @param {HTMLElement} parent
* @returns {boolean} Returns true when the parent is found somewhere in the
*                    chain of parent nodes.
* @private
*/
function _hasParent$1(element, parent$21) {
	while (element) {
		if (element === parent$21) return true;
		element = element.parentNode;
	}
	return false;
}
var isConstructor$5 = isConstructor$4$1;
var tryToString$1$1 = tryToString$6$1;
var $TypeError$3$1 = TypeError;
var aConstructor$2 = function(argument) {
	if (isConstructor$5(argument)) return argument;
	throw $TypeError$3$1(tryToString$1$1(argument) + " is not a constructor");
};
var $$g$1 = _export$1;
var getBuiltIn$4$1 = getBuiltIn$f;
var apply$1$1 = functionApply$1;
var bind$9$1 = functionBind$1;
var aConstructor$1$1 = aConstructor$2;
var anObject$3$1 = anObject$d$1;
var isObject$6$1 = isObject$h$1;
var create$6$1 = objectCreate$1;
var fails$8$1 = fails$t$1;
var nativeConstruct$1 = getBuiltIn$4$1("Reflect", "construct");
var ObjectPrototype$3 = Object.prototype;
var push$2$1 = [].push;
var NEW_TARGET_BUG$1 = fails$8$1(function() {
	function F() {}
	return !(nativeConstruct$1(function() {}, [], F) instanceof F);
});
var ARGS_BUG$1 = !fails$8$1(function() {
	nativeConstruct$1(function() {});
});
var FORCED$1$1 = NEW_TARGET_BUG$1 || ARGS_BUG$1;
$$g$1({
	target: "Reflect",
	stat: true,
	forced: FORCED$1$1,
	sham: FORCED$1$1
}, { construct: function construct$6(Target, args) {
	aConstructor$1$1(Target);
	anObject$3$1(args);
	var newTarget = arguments.length < 3 ? Target : aConstructor$1$1(arguments[2]);
	if (ARGS_BUG$1 && !NEW_TARGET_BUG$1) return nativeConstruct$1(Target, args, newTarget);
	if (Target == newTarget) {
		switch (args.length) {
			case 0: return new Target();
			case 1: return new Target(args[0]);
			case 2: return new Target(args[0], args[1]);
			case 3: return new Target(args[0], args[1], args[2]);
			case 4: return new Target(args[0], args[1], args[2], args[3]);
		}
		var $args = [null];
		apply$1$1(push$2$1, $args, args);
		return new (apply$1$1(bind$9$1, Target, $args))();
	}
	var proto = newTarget.prototype;
	var instance = create$6$1(isObject$6$1(proto) ? proto : ObjectPrototype$3);
	var result = apply$1$1(Target, instance, args);
	return isObject$6$1(result) ? result : instance;
} });
var path$4$1 = path$o$1;
var construct$2$1 = path$4$1.Reflect.construct;
var parent$q$1 = construct$2$1;
var construct$1$1 = parent$q$1;
var construct$5 = construct$1$1;
var _Reflect$construct$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(construct$5);
function _assertThisInitialized$2(self$1) {
	if (self$1 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
	return self$1;
}
var parent$p$1 = create$8$1;
var create$5$1 = parent$p$1;
var parent$o$1 = create$5$1;
var create$4$1 = parent$o$1;
var create$3$1 = create$4$1;
var create$2$1 = create$3$1;
var _Object$create$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(create$2$1);
var $$f$1 = _export$1;
var setPrototypeOf$7 = objectSetPrototypeOf$1;
$$f$1({
	target: "Object",
	stat: true
}, { setPrototypeOf: setPrototypeOf$7 });
var path$3$1 = path$o$1;
var setPrototypeOf$6$1 = path$3$1.Object.setPrototypeOf;
var parent$n$1 = setPrototypeOf$6$1;
var setPrototypeOf$5$1 = parent$n$1;
var parent$m$1 = setPrototypeOf$5$1;
var setPrototypeOf$4$1 = parent$m$1;
var parent$l$1 = setPrototypeOf$4$1;
var setPrototypeOf$3$1 = parent$l$1;
var setPrototypeOf$2$1 = setPrototypeOf$3$1;
var setPrototypeOf$1$1 = setPrototypeOf$2$1;
var _Object$setPrototypeOf$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(setPrototypeOf$1$1);
var parent$k$1 = bind$d$1;
var bind$8$1 = parent$k$1;
var parent$j$1 = bind$8$1;
var bind$7$1 = parent$j$1;
var bind$6$1 = bind$7$1;
var bind$5$1 = bind$6$1;
var _bindInstanceProperty$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(bind$5$1);
function _setPrototypeOf$1(o, p) {
	var _context;
	_setPrototypeOf$1 = _Object$setPrototypeOf$1 ? _bindInstanceProperty$2(_context = _Object$setPrototypeOf$1).call(_context) : function _setPrototypeOf$2(o$1, p$1) {
		o$1.__proto__ = p$1;
		return o$1;
	};
	return _setPrototypeOf$1(o, p);
}
function _inherits$1(subClass, superClass) {
	if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
	subClass.prototype = _Object$create$2(superClass && superClass.prototype, { constructor: {
		value: subClass,
		writable: true,
		configurable: true
	} });
	_Object$defineProperty$1$1(subClass, "prototype", { writable: false });
	if (superClass) _setPrototypeOf$1(subClass, superClass);
}
function _possibleConstructorReturn$1(self$1, call$11) {
	if (call$11 && (_typeof$1(call$11) === "object" || typeof call$11 === "function")) return call$11;
	else if (call$11 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
	return _assertThisInitialized$2(self$1);
}
var parent$i$1 = getPrototypeOf$5$1;
var getPrototypeOf$4$1 = parent$i$1;
var parent$h$1 = getPrototypeOf$4$1;
var getPrototypeOf$3$1 = parent$h$1;
var getPrototypeOf$2$1 = getPrototypeOf$3$1;
var getPrototypeOf$1$1 = getPrototypeOf$2$1;
var _Object$getPrototypeOf$2 = /* @__PURE__ */ getDefaultExportFromCjs$1(getPrototypeOf$1$1);
function _getPrototypeOf$1(o) {
	var _context;
	_getPrototypeOf$1 = _Object$setPrototypeOf$1 ? _bindInstanceProperty$2(_context = _Object$getPrototypeOf$2).call(_context) : function _getPrototypeOf$2(o$1) {
		return o$1.__proto__ || _Object$getPrototypeOf$2(o$1);
	};
	return _getPrototypeOf$1(o);
}
var regeneratorRuntime$1 = { exports: {} };
var _typeof$2 = { exports: {} };
(function(module) {
	var _Symbol$3 = symbol$1$1;
	var _Symbol$iterator$4 = iterator$1$1;
	function _typeof$3(obj) {
		"@babel/helpers - typeof";
		return module.exports = _typeof$3 = "function" == typeof _Symbol$3 && "symbol" == typeof _Symbol$iterator$4 ? function(obj$1) {
			return typeof obj$1;
		} : function(obj$1) {
			return obj$1 && "function" == typeof _Symbol$3 && obj$1.constructor === _Symbol$3 && obj$1 !== _Symbol$3.prototype ? "symbol" : typeof obj$1;
		}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$3(obj);
	}
	module.exports = _typeof$3, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(_typeof$2);
var _typeofExports = _typeof$2.exports;
var parent$g$1 = forEach$6$1;
var forEach$4$1 = parent$g$1;
var parent$f$1 = forEach$4$1;
var forEach$3$1 = parent$f$1;
var forEach$2$1 = forEach$3$1;
var forEach$1$1 = forEach$2$1;
var hasOwn$5$1 = hasOwnProperty_1$1;
var ownKeys$1$1 = ownKeys$7$1;
var getOwnPropertyDescriptorModule$3 = objectGetOwnPropertyDescriptor$1;
var definePropertyModule$5 = objectDefineProperty$1;
var copyConstructorProperties$1 = function(target, source, exceptions) {
	var keys$9 = ownKeys$1$1(source);
	var defineProperty$11 = definePropertyModule$5.f;
	var getOwnPropertyDescriptor$11 = getOwnPropertyDescriptorModule$3.f;
	for (var i$2 = 0; i$2 < keys$9.length; i$2++) {
		var key = keys$9[i$2];
		if (!hasOwn$5$1(target, key) && !(exceptions && hasOwn$5$1(exceptions, key))) defineProperty$11(target, key, getOwnPropertyDescriptor$11(source, key));
	}
};
var isObject$5$1 = isObject$h$1;
var createNonEnumerableProperty$3$1 = createNonEnumerableProperty$9;
var installErrorCause$1 = function(O, options) {
	if (isObject$5$1(options) && "cause" in options) createNonEnumerableProperty$3$1(O, "cause", options.cause);
};
var uncurryThis$2$1 = functionUncurryThis$1;
var $Error$1 = Error;
var replace$2 = uncurryThis$2$1("".replace);
var TEST = function(arg) {
	return String($Error$1(arg).stack);
}("zxcasd");
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
var errorStackClear = function(stack, dropEntries) {
	if (IS_V8_OR_CHAKRA_STACK && typeof stack == "string" && !$Error$1.prepareStackTrace) while (dropEntries--) stack = replace$2(stack, V8_OR_CHAKRA_STACK_ENTRY, "");
	return stack;
};
var fails$7$1 = fails$t$1;
var createPropertyDescriptor$1$1 = createPropertyDescriptor$7;
var errorStackInstallable = !fails$7$1(function() {
	var error = Error("a");
	if (!("stack" in error)) return true;
	Object.defineProperty(error, "stack", createPropertyDescriptor$1$1(1, 7));
	return error.stack !== 7;
});
var createNonEnumerableProperty$2$1 = createNonEnumerableProperty$9;
var clearErrorStack = errorStackClear;
var ERROR_STACK_INSTALLABLE = errorStackInstallable;
var captureStackTrace = Error.captureStackTrace;
var errorStackInstall = function(error, C, stack, dropEntries) {
	if (ERROR_STACK_INSTALLABLE) if (captureStackTrace) captureStackTrace(error, C);
	else createNonEnumerableProperty$2$1(error, "stack", clearErrorStack(stack, dropEntries));
};
var bind$4$1 = functionBindContext$1;
var call$6$1 = functionCall$1;
var anObject$2$1 = anObject$d$1;
var tryToString$7 = tryToString$6$1;
var isArrayIteratorMethod$3 = isArrayIteratorMethod$2$1;
var lengthOfArrayLike$1$1 = lengthOfArrayLike$c;
var isPrototypeOf$7$1 = objectIsPrototypeOf$1;
var getIterator$6 = getIterator$8;
var getIteratorMethod$10 = getIteratorMethod$9$1;
var iteratorClose$3 = iteratorClose$2$1;
var $TypeError$2$1 = TypeError;
var Result$1 = function(stopped, result) {
	this.stopped = stopped;
	this.result = result;
};
var ResultPrototype$1 = Result$1.prototype;
var iterate$7 = function(iterable, unboundFunction, options) {
	var that = options && options.that;
	var AS_ENTRIES = !!(options && options.AS_ENTRIES);
	var IS_RECORD = !!(options && options.IS_RECORD);
	var IS_ITERATOR = !!(options && options.IS_ITERATOR);
	var INTERRUPTED = !!(options && options.INTERRUPTED);
	var fn = bind$4$1(unboundFunction, that);
	var iterator$8, iterFn, index$1, length$1, result, next$1, step;
	var stop = function(condition) {
		if (iterator$8) iteratorClose$3(iterator$8, "normal", condition);
		return new Result$1(true, condition);
	};
	var callFn = function(value) {
		if (AS_ENTRIES) {
			anObject$2$1(value);
			return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
		}
		return INTERRUPTED ? fn(value, stop) : fn(value);
	};
	if (IS_RECORD) iterator$8 = iterable.iterator;
	else if (IS_ITERATOR) iterator$8 = iterable;
	else {
		iterFn = getIteratorMethod$10(iterable);
		if (!iterFn) throw $TypeError$2$1(tryToString$7(iterable) + " is not iterable");
		if (isArrayIteratorMethod$3(iterFn)) {
			for (index$1 = 0, length$1 = lengthOfArrayLike$1$1(iterable); length$1 > index$1; index$1++) {
				result = callFn(iterable[index$1]);
				if (result && isPrototypeOf$7$1(ResultPrototype$1, result)) return result;
			}
			return new Result$1(false);
		}
		iterator$8 = getIterator$6(iterable, iterFn);
	}
	next$1 = IS_RECORD ? iterable.next : iterator$8.next;
	while (!(step = call$6$1(next$1, iterator$8)).done) {
		try {
			result = callFn(step.value);
		} catch (error) {
			iteratorClose$3(iterator$8, "throw", error);
		}
		if (typeof result == "object" && result && isPrototypeOf$7$1(ResultPrototype$1, result)) return result;
	}
	return new Result$1(false);
};
var toString$1$1 = toString$7$1;
var normalizeStringArgument$1 = function(argument, $default) {
	return argument === void 0 ? arguments.length < 2 ? "" : $default : toString$1$1(argument);
};
var $$e$1 = _export$1;
var isPrototypeOf$6$1 = objectIsPrototypeOf$1;
var getPrototypeOf$10 = objectGetPrototypeOf$1;
var setPrototypeOf$8 = objectSetPrototypeOf$1;
var copyConstructorProperties = copyConstructorProperties$1;
var create$1$1 = objectCreate$1;
var createNonEnumerableProperty$1$1 = createNonEnumerableProperty$9;
var createPropertyDescriptor$8 = createPropertyDescriptor$7;
var installErrorCause = installErrorCause$1;
var installErrorStack = errorStackInstall;
var iterate$6 = iterate$7;
var normalizeStringArgument = normalizeStringArgument$1;
var wellKnownSymbol$3$1 = wellKnownSymbol$m;
var TO_STRING_TAG$5 = wellKnownSymbol$3$1("toStringTag");
var $Error = Error;
var push$1$1 = [].push;
var $AggregateError = function AggregateError(errors, message) {
	var isInstance = isPrototypeOf$6$1(AggregateErrorPrototype, this);
	var that;
	if (setPrototypeOf$8) that = setPrototypeOf$8($Error(), isInstance ? getPrototypeOf$10(this) : AggregateErrorPrototype);
	else {
		that = isInstance ? this : create$1$1(AggregateErrorPrototype);
		createNonEnumerableProperty$1$1(that, TO_STRING_TAG$5, "Error");
	}
	if (message !== void 0) createNonEnumerableProperty$1$1(that, "message", normalizeStringArgument(message));
	installErrorStack(that, $AggregateError, that.stack, 1);
	if (arguments.length > 2) installErrorCause(that, arguments[2]);
	var errorsArray = [];
	iterate$6(errors, push$1$1, { that: errorsArray });
	createNonEnumerableProperty$1$1(that, "errors", errorsArray);
	return that;
};
if (setPrototypeOf$8) setPrototypeOf$8($AggregateError, $Error);
else copyConstructorProperties($AggregateError, $Error, { name: true });
var AggregateErrorPrototype = $AggregateError.prototype = create$1$1($Error.prototype, {
	constructor: createPropertyDescriptor$8(1, $AggregateError),
	message: createPropertyDescriptor$8(1, ""),
	name: createPropertyDescriptor$8(1, "AggregateError")
});
$$e$1({
	global: true,
	constructor: true,
	arity: 2
}, { AggregateError: $AggregateError });
var getBuiltIn$3$1 = getBuiltIn$f;
var defineBuiltInAccessor$1$1 = defineBuiltInAccessor$3$1;
var wellKnownSymbol$2$1 = wellKnownSymbol$m;
var DESCRIPTORS$2$1 = descriptors$1;
var SPECIES$2$1 = wellKnownSymbol$2$1("species");
var setSpecies$2 = function(CONSTRUCTOR_NAME) {
	var Constructor = getBuiltIn$3$1(CONSTRUCTOR_NAME);
	if (DESCRIPTORS$2$1 && Constructor && !Constructor[SPECIES$2$1]) defineBuiltInAccessor$1$1(Constructor, SPECIES$2$1, {
		configurable: true,
		get: function() {
			return this;
		}
	});
};
var isPrototypeOf$5$1 = objectIsPrototypeOf$1;
var $TypeError$1$1 = TypeError;
var anInstance$3$1 = function(it$1, Prototype) {
	if (isPrototypeOf$5$1(Prototype, it$1)) return it$1;
	throw $TypeError$1$1("Incorrect invocation");
};
var anObject$1$1 = anObject$d$1;
var aConstructor$3 = aConstructor$2;
var isNullOrUndefined$1$1 = isNullOrUndefined$5$1;
var wellKnownSymbol$1$1 = wellKnownSymbol$m;
var SPECIES$1$1 = wellKnownSymbol$1$1("species");
var speciesConstructor$2 = function(O, defaultConstructor) {
	var C = anObject$1$1(O).constructor;
	var S;
	return C === void 0 || isNullOrUndefined$1$1(S = anObject$1$1(C)[SPECIES$1$1]) ? defaultConstructor : aConstructor$3(S);
};
var userAgent$4 = engineUserAgent$1;
var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4);
var global$6$1 = global$m;
var apply$7 = functionApply$1;
var bind$3$1 = functionBindContext$1;
var isCallable$4$1 = isCallable$m;
var hasOwn$4$1 = hasOwnProperty_1$1;
var fails$6$1 = fails$t$1;
var html$3 = html$2;
var arraySlice$1$1 = arraySlice$5$1;
var createElement$2 = documentCreateElement$1$1;
var validateArgumentsLength$3 = validateArgumentsLength$2;
var IS_IOS$1 = engineIsIos;
var IS_NODE$3 = engineIsNode$1;
var set$3$1 = global$6$1.setImmediate;
var clear = global$6$1.clearImmediate;
var process$3 = global$6$1.process;
var Dispatch = global$6$1.Dispatch;
var Function$1$1 = global$6$1.Function;
var MessageChannel = global$6$1.MessageChannel;
var String$1 = global$6$1.String;
var counter = 0;
var queue$2 = {};
var ONREADYSTATECHANGE = "onreadystatechange";
var $location, defer, channel, port;
fails$6$1(function() {
	$location = global$6$1.location;
});
var run = function(id$4) {
	if (hasOwn$4$1(queue$2, id$4)) {
		var fn = queue$2[id$4];
		delete queue$2[id$4];
		fn();
	}
};
var runner = function(id$4) {
	return function() {
		run(id$4);
	};
};
var eventListener = function(event) {
	run(event.data);
};
var globalPostMessageDefer = function(id$4) {
	global$6$1.postMessage(String$1(id$4), $location.protocol + "//" + $location.host);
};
if (!set$3$1 || !clear) {
	set$3$1 = function setImmediate(handler) {
		validateArgumentsLength$3(arguments.length, 1);
		var fn = isCallable$4$1(handler) ? handler : Function$1$1(handler);
		var args = arraySlice$1$1(arguments, 1);
		queue$2[++counter] = function() {
			apply$7(fn, void 0, args);
		};
		defer(counter);
		return counter;
	};
	clear = function clearImmediate(id$4) {
		delete queue$2[id$4];
	};
	if (IS_NODE$3) defer = function(id$4) {
		process$3.nextTick(runner(id$4));
	};
	else if (Dispatch && Dispatch.now) defer = function(id$4) {
		Dispatch.now(runner(id$4));
	};
	else if (MessageChannel && !IS_IOS$1) {
		channel = new MessageChannel();
		port = channel.port2;
		channel.port1.onmessage = eventListener;
		defer = bind$3$1(port.postMessage, port);
	} else if (global$6$1.addEventListener && isCallable$4$1(global$6$1.postMessage) && !global$6$1.importScripts && $location && $location.protocol !== "file:" && !fails$6$1(globalPostMessageDefer)) {
		defer = globalPostMessageDefer;
		global$6$1.addEventListener("message", eventListener, false);
	} else if (ONREADYSTATECHANGE in createElement$2("script")) defer = function(id$4) {
		html$3.appendChild(createElement$2("script"))[ONREADYSTATECHANGE] = function() {
			html$3.removeChild(this);
			run(id$4);
		};
	};
	else defer = function(id$4) {
		setTimeout(runner(id$4), 0);
	};
}
var task$1 = {
	set: set$3$1,
	clear
};
var Queue$3 = function() {
	this.head = null;
	this.tail = null;
};
Queue$3.prototype = {
	add: function(item) {
		var entry = {
			item,
			next: null
		};
		var tail = this.tail;
		if (tail) tail.next = entry;
		else this.head = entry;
		this.tail = entry;
	},
	get: function() {
		var entry = this.head;
		if (entry) {
			var next$1 = this.head = entry.next;
			if (next$1 === null) this.tail = null;
			return entry.item;
		}
	}
};
var queue$1 = Queue$3;
var userAgent$3 = engineUserAgent$1;
var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && typeof Pebble != "undefined";
var userAgent$2$1 = engineUserAgent$1;
var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2$1);
var global$5$1 = global$m;
var bind$2$1 = functionBindContext$1;
var getOwnPropertyDescriptor$10 = objectGetOwnPropertyDescriptor$1.f;
var macrotask = task$1.set;
var Queue$2 = queue$1;
var IS_IOS = engineIsIos;
var IS_IOS_PEBBLE = engineIsIosPebble;
var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
var IS_NODE$2 = engineIsNode$1;
var MutationObserver = global$5$1.MutationObserver || global$5$1.WebKitMutationObserver;
var document$2 = global$5$1.document;
var process$2 = global$5$1.process;
var Promise$1 = global$5$1.Promise;
var queueMicrotaskDescriptor = getOwnPropertyDescriptor$10(global$5$1, "queueMicrotask");
var microtask$1 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
var notify$1, toggle, node, promise$6, then;
if (!microtask$1) {
	var queue = new Queue$2();
	var flush = function() {
		var parent$21, fn;
		if (IS_NODE$2 && (parent$21 = process$2.domain)) parent$21.exit();
		while (fn = queue.get()) try {
			fn();
		} catch (error) {
			if (queue.head) notify$1();
			throw error;
		}
		if (parent$21) parent$21.enter();
	};
	if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
		toggle = true;
		node = document$2.createTextNode("");
		new MutationObserver(flush).observe(node, { characterData: true });
		notify$1 = function() {
			node.data = toggle = !toggle;
		};
	} else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
		promise$6 = Promise$1.resolve(void 0);
		promise$6.constructor = Promise$1;
		then = bind$2$1(promise$6.then, promise$6);
		notify$1 = function() {
			then(flush);
		};
	} else if (IS_NODE$2) notify$1 = function() {
		process$2.nextTick(flush);
	};
	else {
		macrotask = bind$2$1(macrotask, global$5$1);
		notify$1 = function() {
			macrotask(flush);
		};
	}
	microtask$1 = function(fn) {
		if (!queue.head) notify$1();
		queue.add(fn);
	};
}
var microtask_1 = microtask$1;
var hostReportErrors$1 = function(a, b) {
	try {
		arguments.length == 1 ? console.error(a) : console.error(a, b);
	} catch (error) {}
};
var perform$6 = function(exec$4) {
	try {
		return {
			error: false,
			value: exec$4()
		};
	} catch (error) {
		return {
			error: true,
			value: error
		};
	}
};
var global$4$1 = global$m;
var promiseNativeConstructor = global$4$1.Promise;
var engineIsDeno = typeof Deno == "object" && Deno && typeof Deno.version == "object";
var IS_DENO$1 = engineIsDeno;
var IS_NODE$1 = engineIsNode$1;
var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1 && typeof window == "object" && typeof document == "object";
var global$3$1 = global$m;
var NativePromiseConstructor$5 = promiseNativeConstructor;
var isCallable$3$1 = isCallable$m;
var isForced$3 = isForced_1$1;
var inspectSource$3 = inspectSource$2;
var wellKnownSymbol$10 = wellKnownSymbol$m;
var IS_BROWSER = engineIsBrowser;
var IS_DENO = engineIsDeno;
var V8_VERSION$4 = engineV8Version$1;
var NativePromisePrototype$2 = NativePromiseConstructor$5 && NativePromiseConstructor$5.prototype;
var SPECIES$6 = wellKnownSymbol$10("species");
var SUBCLASSING = false;
var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3$1(global$3$1.PromiseRejectionEvent);
var FORCED_PROMISE_CONSTRUCTOR$5 = isForced$3("Promise", function() {
	var PROMISE_CONSTRUCTOR_SOURCE = inspectSource$3(NativePromiseConstructor$5);
	var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$5);
	if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION$4 === 66) return true;
	if (!(NativePromisePrototype$2["catch"] && NativePromisePrototype$2["finally"])) return true;
	if (!V8_VERSION$4 || V8_VERSION$4 < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
		var promise$7 = new NativePromiseConstructor$5(function(resolve) {
			resolve(1);
		});
		var FakePromise = function(exec$4) {
			exec$4(function() {}, function() {});
		};
		var constructor = promise$7.constructor = {};
		constructor[SPECIES$6] = FakePromise;
		SUBCLASSING = promise$7.then(function() {}) instanceof FakePromise;
		if (!SUBCLASSING) return true;
	}
	return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
});
var promiseConstructorDetection = {
	CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
	REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
	SUBCLASSING
};
var newPromiseCapability$2 = {};
var aCallable$6$1 = aCallable$e;
var $TypeError$10 = TypeError;
var PromiseCapability = function(C) {
	var resolve, reject;
	this.promise = new C(function($$resolve, $$reject) {
		if (resolve !== void 0 || reject !== void 0) throw $TypeError$10("Bad Promise constructor");
		resolve = $$resolve;
		reject = $$reject;
	});
	this.resolve = aCallable$6$1(resolve);
	this.reject = aCallable$6$1(reject);
};
newPromiseCapability$2.f = function(C) {
	return new PromiseCapability(C);
};
var $$d$1 = _export$1;
var IS_NODE$5 = engineIsNode$1;
var global$2$1 = global$m;
var call$5$1 = functionCall$1;
var defineBuiltIn$1$1 = defineBuiltIn$6;
var setToStringTag$1$1 = setToStringTag$7;
var setSpecies$1$1 = setSpecies$2;
var aCallable$5$1 = aCallable$e;
var isCallable$2$1 = isCallable$m;
var isObject$4$1 = isObject$h$1;
var anInstance$2$1 = anInstance$3$1;
var speciesConstructor$1 = speciesConstructor$2;
var task = task$1.set;
var microtask = microtask_1;
var hostReportErrors = hostReportErrors$1;
var perform$5 = perform$6;
var Queue$1 = queue$1;
var InternalStateModule$2$1 = internalState$1;
var NativePromiseConstructor$4 = promiseNativeConstructor;
var PromiseConstructorDetection = promiseConstructorDetection;
var newPromiseCapabilityModule$6 = newPromiseCapability$2;
var PROMISE = "Promise";
var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
PromiseConstructorDetection.SUBCLASSING;
var getInternalPromiseState = InternalStateModule$2$1.getterFor(PROMISE);
var setInternalState$2$1 = InternalStateModule$2$1.set;
var NativePromisePrototype$1 = NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
var PromiseConstructor = NativePromiseConstructor$4;
var PromisePrototype = NativePromisePrototype$1;
var TypeError$1$1 = global$2$1.TypeError;
var document$1$1 = global$2$1.document;
var process$1$1 = global$2$1.process;
var newPromiseCapability$1 = newPromiseCapabilityModule$6.f;
var newGenericPromiseCapability = newPromiseCapability$1;
var DISPATCH_EVENT = !!(document$1$1 && document$1$1.createEvent && global$2$1.dispatchEvent);
var UNHANDLED_REJECTION = "unhandledrejection";
var REJECTION_HANDLED = "rejectionhandled";
var PENDING = 0;
var FULFILLED = 1;
var REJECTED = 2;
var HANDLED = 1;
var UNHANDLED = 2;
var Internal, OwnPromiseCapability, PromiseWrapper;
var isThenable = function(it$1) {
	var then$1;
	return isObject$4$1(it$1) && isCallable$2$1(then$1 = it$1.then) ? then$1 : false;
};
var callReaction = function(reaction, state) {
	var value = state.value;
	var ok = state.state == FULFILLED;
	var handler = ok ? reaction.ok : reaction.fail;
	var resolve = reaction.resolve;
	var reject = reaction.reject;
	var domain = reaction.domain;
	var result, then$1, exited;
	try {
		if (handler) {
			if (!ok) {
				if (state.rejection === UNHANDLED) onHandleUnhandled(state);
				state.rejection = HANDLED;
			}
			if (handler === true) result = value;
			else {
				if (domain) domain.enter();
				result = handler(value);
				if (domain) {
					domain.exit();
					exited = true;
				}
			}
			if (result === reaction.promise) reject(TypeError$1$1("Promise-chain cycle"));
			else if (then$1 = isThenable(result)) call$5$1(then$1, result, resolve, reject);
			else resolve(result);
		} else reject(value);
	} catch (error) {
		if (domain && !exited) domain.exit();
		reject(error);
	}
};
var notify = function(state, isReject) {
	if (state.notified) return;
	state.notified = true;
	microtask(function() {
		var reactions = state.reactions;
		var reaction;
		while (reaction = reactions.get()) callReaction(reaction, state);
		state.notified = false;
		if (isReject && !state.rejection) onUnhandled(state);
	});
};
var dispatchEvent = function(name, promise$7, reason) {
	var event, handler;
	if (DISPATCH_EVENT) {
		event = document$1$1.createEvent("Event");
		event.promise = promise$7;
		event.reason = reason;
		event.initEvent(name, false, true);
		global$2$1.dispatchEvent(event);
	} else event = {
		promise: promise$7,
		reason
	};
	if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$2$1["on" + name])) handler(event);
	else if (name === UNHANDLED_REJECTION) hostReportErrors("Unhandled promise rejection", reason);
};
var onUnhandled = function(state) {
	call$5$1(task, global$2$1, function() {
		var promise$7 = state.facade;
		var value = state.value;
		var IS_UNHANDLED = isUnhandled(state);
		var result;
		if (IS_UNHANDLED) {
			result = perform$5(function() {
				if (IS_NODE$5) process$1$1.emit("unhandledRejection", value, promise$7);
				else dispatchEvent(UNHANDLED_REJECTION, promise$7, value);
			});
			state.rejection = IS_NODE$5 || isUnhandled(state) ? UNHANDLED : HANDLED;
			if (result.error) throw result.value;
		}
	});
};
var isUnhandled = function(state) {
	return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function(state) {
	call$5$1(task, global$2$1, function() {
		var promise$7 = state.facade;
		if (IS_NODE$5) process$1$1.emit("rejectionHandled", promise$7);
		else dispatchEvent(REJECTION_HANDLED, promise$7, state.value);
	});
};
var bind$1$1 = function(fn, state, unwrap) {
	return function(value) {
		fn(state, value, unwrap);
	};
};
var internalReject = function(state, value, unwrap) {
	if (state.done) return;
	state.done = true;
	if (unwrap) state = unwrap;
	state.value = value;
	state.state = REJECTED;
	notify(state, true);
};
var internalResolve = function(state, value, unwrap) {
	if (state.done) return;
	state.done = true;
	if (unwrap) state = unwrap;
	try {
		if (state.facade === value) throw TypeError$1$1("Promise can't be resolved itself");
		var then$1 = isThenable(value);
		if (then$1) microtask(function() {
			var wrapper$1 = { done: false };
			try {
				call$5$1(then$1, value, bind$1$1(internalResolve, wrapper$1, state), bind$1$1(internalReject, wrapper$1, state));
			} catch (error) {
				internalReject(wrapper$1, error, state);
			}
		});
		else {
			state.value = value;
			state.state = FULFILLED;
			notify(state, false);
		}
	} catch (error) {
		internalReject({ done: false }, error, state);
	}
};
if (FORCED_PROMISE_CONSTRUCTOR$4) {
	PromiseConstructor = function Promise$2(executor) {
		anInstance$2$1(this, PromisePrototype);
		aCallable$5$1(executor);
		call$5$1(Internal, this);
		var state = getInternalPromiseState(this);
		try {
			executor(bind$1$1(internalResolve, state), bind$1$1(internalReject, state));
		} catch (error) {
			internalReject(state, error);
		}
	};
	PromisePrototype = PromiseConstructor.prototype;
	Internal = function Promise$2(executor) {
		setInternalState$2$1(this, {
			type: PROMISE,
			done: false,
			notified: false,
			parent: false,
			reactions: new Queue$1(),
			rejection: false,
			state: PENDING,
			value: void 0
		});
	};
	Internal.prototype = defineBuiltIn$1$1(PromisePrototype, "then", function then$1(onFulfilled, onRejected) {
		var state = getInternalPromiseState(this);
		var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
		state.parent = true;
		reaction.ok = isCallable$2$1(onFulfilled) ? onFulfilled : true;
		reaction.fail = isCallable$2$1(onRejected) && onRejected;
		reaction.domain = IS_NODE$5 ? process$1$1.domain : void 0;
		if (state.state == PENDING) state.reactions.add(reaction);
		else microtask(function() {
			callReaction(reaction, state);
		});
		return reaction.promise;
	});
	OwnPromiseCapability = function() {
		var promise$7 = new Internal();
		var state = getInternalPromiseState(promise$7);
		this.promise = promise$7;
		this.resolve = bind$1$1(internalResolve, state);
		this.reject = bind$1$1(internalReject, state);
	};
	newPromiseCapabilityModule$6.f = newPromiseCapability$1 = function(C) {
		return C === PromiseConstructor || C === PromiseWrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C);
	};
}
$$d$1({
	global: true,
	constructor: true,
	wrap: true,
	forced: FORCED_PROMISE_CONSTRUCTOR$4
}, { Promise: PromiseConstructor });
setToStringTag$1$1(PromiseConstructor, PROMISE, false, true);
setSpecies$1$1(PROMISE);
var NativePromiseConstructor$3 = promiseNativeConstructor;
var checkCorrectnessOfIteration$3 = checkCorrectnessOfIteration$2;
var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration$3(function(iterable) {
	NativePromiseConstructor$3.all(iterable).then(void 0, function() {});
});
var $$c$1 = _export$1;
var call$4$1 = functionCall$1;
var aCallable$4$1 = aCallable$e;
var newPromiseCapabilityModule$5 = newPromiseCapability$2;
var perform$4 = perform$6;
var iterate$5 = iterate$7;
var PROMISE_STATICS_INCORRECT_ITERATION$3 = promiseStaticsIncorrectIteration;
$$c$1({
	target: "Promise",
	stat: true,
	forced: PROMISE_STATICS_INCORRECT_ITERATION$3
}, { all: function all(iterable) {
	var C = this;
	var capability = newPromiseCapabilityModule$5.f(C);
	var resolve = capability.resolve;
	var reject = capability.reject;
	var result = perform$4(function() {
		var $promiseResolve = aCallable$4$1(C.resolve);
		var values$8 = [];
		var counter$1 = 0;
		var remaining = 1;
		iterate$5(iterable, function(promise$7) {
			var index$1 = counter$1++;
			var alreadyCalled = false;
			remaining++;
			call$4$1($promiseResolve, C, promise$7).then(function(value) {
				if (alreadyCalled) return;
				alreadyCalled = true;
				values$8[index$1] = value;
				--remaining || resolve(values$8);
			}, reject);
		});
		--remaining || resolve(values$8);
	});
	if (result.error) reject(result.value);
	return capability.promise;
} });
var $$b$1 = _export$1;
var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
var NativePromiseConstructor$2 = promiseNativeConstructor;
NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
$$b$1({
	target: "Promise",
	proto: true,
	forced: FORCED_PROMISE_CONSTRUCTOR$2,
	real: true
}, { "catch": function(onRejected) {
	return this.then(void 0, onRejected);
} });
var $$a$1 = _export$1;
var call$3$1 = functionCall$1;
var aCallable$3$1 = aCallable$e;
var newPromiseCapabilityModule$4 = newPromiseCapability$2;
var perform$3 = perform$6;
var iterate$4 = iterate$7;
var PROMISE_STATICS_INCORRECT_ITERATION$2 = promiseStaticsIncorrectIteration;
$$a$1({
	target: "Promise",
	stat: true,
	forced: PROMISE_STATICS_INCORRECT_ITERATION$2
}, { race: function race(iterable) {
	var C = this;
	var capability = newPromiseCapabilityModule$4.f(C);
	var reject = capability.reject;
	var result = perform$3(function() {
		var $promiseResolve = aCallable$3$1(C.resolve);
		iterate$4(iterable, function(promise$7) {
			call$3$1($promiseResolve, C, promise$7).then(capability.resolve, reject);
		});
	});
	if (result.error) reject(result.value);
	return capability.promise;
} });
var $$9$1 = _export$1;
var call$2$1 = functionCall$1;
var newPromiseCapabilityModule$3 = newPromiseCapability$2;
var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
$$9$1({
	target: "Promise",
	stat: true,
	forced: FORCED_PROMISE_CONSTRUCTOR$1
}, { reject: function reject(r) {
	var capability = newPromiseCapabilityModule$3.f(this);
	call$2$1(capability.reject, void 0, r);
	return capability.promise;
} });
var anObject$10 = anObject$d$1;
var isObject$3$1 = isObject$h$1;
var newPromiseCapability = newPromiseCapability$2;
var promiseResolve$2 = function(C, x) {
	anObject$10(C);
	if (isObject$3$1(x) && x.constructor === C) return x;
	var promiseCapability = newPromiseCapability.f(C);
	var resolve = promiseCapability.resolve;
	resolve(x);
	return promiseCapability.promise;
};
var $$8$1 = _export$1;
var getBuiltIn$2$1 = getBuiltIn$f;
var IS_PURE = isPure;
var NativePromiseConstructor$1 = promiseNativeConstructor;
var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
var promiseResolve$1 = promiseResolve$2;
var PromiseConstructorWrapper = getBuiltIn$2$1("Promise");
var CHECK_WRAPPER = !FORCED_PROMISE_CONSTRUCTOR;
$$8$1({
	target: "Promise",
	stat: true,
	forced: IS_PURE
}, { resolve: function resolve(x) {
	return promiseResolve$1(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor$1 : this, x);
} });
var $$7$1 = _export$1;
var call$1$1 = functionCall$1;
var aCallable$2$1 = aCallable$e;
var newPromiseCapabilityModule$2 = newPromiseCapability$2;
var perform$2 = perform$6;
var iterate$3$1 = iterate$7;
var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
$$7$1({
	target: "Promise",
	stat: true,
	forced: PROMISE_STATICS_INCORRECT_ITERATION$1
}, { allSettled: function allSettled(iterable) {
	var C = this;
	var capability = newPromiseCapabilityModule$2.f(C);
	var resolve = capability.resolve;
	var reject = capability.reject;
	var result = perform$2(function() {
		var promiseResolve$3 = aCallable$2$1(C.resolve);
		var values$8 = [];
		var counter$1 = 0;
		var remaining = 1;
		iterate$3$1(iterable, function(promise$7) {
			var index$1 = counter$1++;
			var alreadyCalled = false;
			remaining++;
			call$1$1(promiseResolve$3, C, promise$7).then(function(value) {
				if (alreadyCalled) return;
				alreadyCalled = true;
				values$8[index$1] = {
					status: "fulfilled",
					value
				};
				--remaining || resolve(values$8);
			}, function(error) {
				if (alreadyCalled) return;
				alreadyCalled = true;
				values$8[index$1] = {
					status: "rejected",
					reason: error
				};
				--remaining || resolve(values$8);
			});
		});
		--remaining || resolve(values$8);
	});
	if (result.error) reject(result.value);
	return capability.promise;
} });
var $$6$1 = _export$1;
var call$10 = functionCall$1;
var aCallable$1$1 = aCallable$e;
var getBuiltIn$1$1 = getBuiltIn$f;
var newPromiseCapabilityModule$1 = newPromiseCapability$2;
var perform$1 = perform$6;
var iterate$2$1 = iterate$7;
var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
var PROMISE_ANY_ERROR = "No one promise resolved";
$$6$1({
	target: "Promise",
	stat: true,
	forced: PROMISE_STATICS_INCORRECT_ITERATION
}, { any: function any$1(iterable) {
	var C = this;
	var AggregateError = getBuiltIn$1$1("AggregateError");
	var capability = newPromiseCapabilityModule$1.f(C);
	var resolve = capability.resolve;
	var reject = capability.reject;
	var result = perform$1(function() {
		var promiseResolve$3 = aCallable$1$1(C.resolve);
		var errors = [];
		var counter$1 = 0;
		var remaining = 1;
		var alreadyResolved = false;
		iterate$2$1(iterable, function(promise$7) {
			var index$1 = counter$1++;
			var alreadyRejected = false;
			remaining++;
			call$10(promiseResolve$3, C, promise$7).then(function(value) {
				if (alreadyRejected || alreadyResolved) return;
				alreadyResolved = true;
				resolve(value);
			}, function(error) {
				if (alreadyRejected || alreadyResolved) return;
				alreadyRejected = true;
				errors[index$1] = error;
				--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
			});
		});
		--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
	});
	if (result.error) reject(result.value);
	return capability.promise;
} });
var $$5$1 = _export$1;
var NativePromiseConstructor = promiseNativeConstructor;
var fails$5$1 = fails$t$1;
var getBuiltIn$10 = getBuiltIn$f;
var isCallable$1$1 = isCallable$m;
var speciesConstructor = speciesConstructor$2;
var promiseResolve = promiseResolve$2;
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var NON_GENERIC = !!NativePromiseConstructor && fails$5$1(function() {
	NativePromisePrototype["finally"].call({ then: function() {} }, function() {});
});
$$5$1({
	target: "Promise",
	proto: true,
	real: true,
	forced: NON_GENERIC
}, { "finally": function(onFinally) {
	var C = speciesConstructor(this, getBuiltIn$10("Promise"));
	var isFunction = isCallable$1$1(onFinally);
	return this.then(isFunction ? function(x) {
		return promiseResolve(C, onFinally()).then(function() {
			return x;
		});
	} : onFinally, isFunction ? function(e) {
		return promiseResolve(C, onFinally()).then(function() {
			throw e;
		});
	} : onFinally);
} });
var path$2$1 = path$o$1;
var promise$5 = path$2$1.Promise;
var parent$e$1 = promise$5;
var promise$4 = parent$e$1;
var parent$d$1 = promise$4;
var promise$3 = parent$d$1;
var $$4$1 = _export$1;
var newPromiseCapabilityModule = newPromiseCapability$2;
var perform = perform$6;
$$4$1({
	target: "Promise",
	stat: true,
	forced: true
}, { "try": function(callbackfn) {
	var promiseCapability = newPromiseCapabilityModule.f(this);
	var result = perform(callbackfn);
	(result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);
	return promiseCapability.promise;
} });
var parent$c$1 = promise$3;
var promise$2 = parent$c$1;
var promise$1 = promise$2;
var promise = promise$1;
var parent$b$1 = reverse$5;
var reverse$3$1 = parent$b$1;
var parent$a$1 = reverse$3$1;
var reverse$2$1 = parent$a$1;
var reverse$1$1 = reverse$2$1;
var reverse$8 = reverse$1$1;
(function(module) {
	var _typeof$3 = _typeofExports["default"];
	var _Object$defineProperty$3 = defineProperty$7$1;
	var _Symbol$3 = symbol$1$1;
	var _Object$create$3 = create$2$1;
	var _Object$getPrototypeOf$3 = getPrototypeOf$1$1;
	var _forEachInstanceProperty$2 = forEach$1$1;
	var _Object$setPrototypeOf$2 = setPrototypeOf$1$1;
	var _Promise = promise;
	var _reverseInstanceProperty$2 = reverse$8;
	var _sliceInstanceProperty$3 = slice$1$1;
	function _regeneratorRuntime$1() {
		module.exports = _regeneratorRuntime$1 = function _regeneratorRuntime$2() {
			return exports;
		}, module.exports.__esModule = true, module.exports["default"] = module.exports;
		var exports = {}, Op = Object.prototype, hasOwn$11 = Op.hasOwnProperty, defineProperty$11 = _Object$defineProperty$3 || function(obj, key, desc) {
			obj[key] = desc.value;
		}, $Symbol$2 = "function" == typeof _Symbol$3 ? _Symbol$3 : {}, iteratorSymbol = $Symbol$2.iterator || "@@iterator", asyncIteratorSymbol = $Symbol$2.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol$2.toStringTag || "@@toStringTag";
		function define(obj, key, value) {
			return _Object$defineProperty$3(obj, key, {
				value,
				enumerable: !0,
				configurable: !0,
				writable: !0
			}), obj[key];
		}
		try {
			define({}, "");
		} catch (err) {
			define = function define$1(obj, key, value) {
				return obj[key] = value;
			};
		}
		function wrap$2(innerFn, outerFn, self$1, tryLocsList) {
			var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create$3(protoGenerator.prototype), context = new Context(tryLocsList || []);
			return defineProperty$11(generator, "_invoke", { value: makeInvokeMethod(innerFn, self$1, context) }), generator;
		}
		function tryCatch(fn, obj, arg) {
			try {
				return {
					type: "normal",
					arg: fn.call(obj, arg)
				};
			} catch (err) {
				return {
					type: "throw",
					arg: err
				};
			}
		}
		exports.wrap = wrap$2;
		var ContinueSentinel = {};
		function Generator() {}
		function GeneratorFunction() {}
		function GeneratorFunctionPrototype() {}
		var IteratorPrototype$3 = {};
		define(IteratorPrototype$3, iteratorSymbol, function() {
			return this;
		});
		var getProto = _Object$getPrototypeOf$3, NativeIteratorPrototype = getProto && getProto(getProto(values$8([])));
		NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn$11.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype$3 = NativeIteratorPrototype);
		var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create$3(IteratorPrototype$3);
		function defineIteratorMethods(prototype) {
			var _context;
			_forEachInstanceProperty$2(_context = [
				"next",
				"throw",
				"return"
			]).call(_context, function(method$11) {
				define(prototype, method$11, function(arg) {
					return this._invoke(method$11, arg);
				});
			});
		}
		function AsyncIterator(generator, PromiseImpl) {
			function invoke(method$11, arg, resolve, reject) {
				var record = tryCatch(generator[method$11], generator, arg);
				if ("throw" !== record.type) {
					var result = record.arg, value = result.value;
					return value && "object" == _typeof$3(value) && hasOwn$11.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value$1) {
						invoke("next", value$1, resolve, reject);
					}, function(err) {
						invoke("throw", err, resolve, reject);
					}) : PromiseImpl.resolve(value).then(function(unwrapped) {
						result.value = unwrapped, resolve(result);
					}, function(error) {
						return invoke("throw", error, resolve, reject);
					});
				}
				reject(record.arg);
			}
			var previousPromise;
			defineProperty$11(this, "_invoke", { value: function value(method$11, arg) {
				function callInvokeWithMethodAndArg() {
					return new PromiseImpl(function(resolve, reject) {
						invoke(method$11, arg, resolve, reject);
					});
				}
				return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
			} });
		}
		function makeInvokeMethod(innerFn, self$1, context) {
			var state = "suspendedStart";
			return function(method$11, arg) {
				if ("executing" === state) throw new Error("Generator is already running");
				if ("completed" === state) {
					if ("throw" === method$11) throw arg;
					return doneResult();
				}
				for (context.method = method$11, context.arg = arg;;) {
					var delegate = context.delegate;
					if (delegate) {
						var delegateResult = maybeInvokeDelegate(delegate, context);
						if (delegateResult) {
							if (delegateResult === ContinueSentinel) continue;
							return delegateResult;
						}
					}
					if ("next" === context.method) context.sent = context._sent = context.arg;
					else if ("throw" === context.method) {
						if ("suspendedStart" === state) throw state = "completed", context.arg;
						context.dispatchException(context.arg);
					} else "return" === context.method && context.abrupt("return", context.arg);
					state = "executing";
					var record = tryCatch(innerFn, self$1, context);
					if ("normal" === record.type) {
						if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
						return {
							value: record.arg,
							done: context.done
						};
					}
					"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
				}
			};
		}
		function maybeInvokeDelegate(delegate, context) {
			var methodName = context.method, method$11 = delegate.iterator[methodName];
			if (void 0 === method$11) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
			var record = tryCatch(method$11, delegate.iterator, context.arg);
			if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
			var info = record.arg;
			return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
		}
		function pushTryEntry(locs) {
			var entry = { tryLoc: locs[0] };
			1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
		}
		function resetTryEntry(entry) {
			var record = entry.completion || {};
			record.type = "normal", delete record.arg, entry.completion = record;
		}
		function Context(tryLocsList) {
			this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty$2(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0);
		}
		function values$8(iterable) {
			if (iterable) {
				var iteratorMethod = iterable[iteratorSymbol];
				if (iteratorMethod) return iteratorMethod.call(iterable);
				if ("function" == typeof iterable.next) return iterable;
				if (!isNaN(iterable.length)) {
					var i$2 = -1, next$1 = function next$2() {
						for (; ++i$2 < iterable.length;) if (hasOwn$11.call(iterable, i$2)) return next$2.value = iterable[i$2], next$2.done = !1, next$2;
						return next$2.value = void 0, next$2.done = !0, next$2;
					};
					return next$1.next = next$1;
				}
			}
			return { next: doneResult };
		}
		function doneResult() {
			return {
				value: void 0,
				done: !0
			};
		}
		return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty$11(Gp, "constructor", {
			value: GeneratorFunctionPrototype,
			configurable: !0
		}), defineProperty$11(GeneratorFunctionPrototype, "constructor", {
			value: GeneratorFunction,
			configurable: !0
		}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
			var ctor = "function" == typeof genFun && genFun.constructor;
			return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
		}, exports.mark = function(genFun) {
			return _Object$setPrototypeOf$2 ? _Object$setPrototypeOf$2(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create$3(Gp), genFun;
		}, exports.awrap = function(arg) {
			return { __await: arg };
		}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
			return this;
		}), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self$1, tryLocsList, PromiseImpl) {
			void 0 === PromiseImpl && (PromiseImpl = _Promise);
			var iter = new AsyncIterator(wrap$2(innerFn, outerFn, self$1, tryLocsList), PromiseImpl);
			return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
				return result.done ? result.value : iter.next();
			});
		}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function() {
			return this;
		}), define(Gp, "toString", function() {
			return "[object Generator]";
		}), exports.keys = function(val) {
			var object$1 = Object(val), keys$9 = [];
			for (var key in object$1) keys$9.push(key);
			return _reverseInstanceProperty$2(keys$9).call(keys$9), function next$1() {
				for (; keys$9.length;) {
					var key$1 = keys$9.pop();
					if (key$1 in object$1) return next$1.value = key$1, next$1.done = !1, next$1;
				}
				return next$1.done = !0, next$1;
			};
		}, exports.values = values$8, Context.prototype = {
			constructor: Context,
			reset: function reset(skipTempReset) {
				var _context2;
				if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, _forEachInstanceProperty$2(_context2 = this.tryEntries).call(_context2, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn$11.call(this, name) && !isNaN(+_sliceInstanceProperty$3(name).call(name, 1)) && (this[name] = void 0);
			},
			stop: function stop() {
				this.done = !0;
				var rootRecord = this.tryEntries[0].completion;
				if ("throw" === rootRecord.type) throw rootRecord.arg;
				return this.rval;
			},
			dispatchException: function dispatchException(exception) {
				if (this.done) throw exception;
				var context = this;
				function handle(loc, caught) {
					return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
				}
				for (var i$2 = this.tryEntries.length - 1; i$2 >= 0; --i$2) {
					var entry = this.tryEntries[i$2], record = entry.completion;
					if ("root" === entry.tryLoc) return handle("end");
					if (entry.tryLoc <= this.prev) {
						var hasCatch = hasOwn$11.call(entry, "catchLoc"), hasFinally = hasOwn$11.call(entry, "finallyLoc");
						if (hasCatch && hasFinally) {
							if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
							if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
						} else if (hasCatch) {
							if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
						} else {
							if (!hasFinally) throw new Error("try statement without catch or finally");
							if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
						}
					}
				}
			},
			abrupt: function abrupt(type, arg) {
				for (var i$2 = this.tryEntries.length - 1; i$2 >= 0; --i$2) {
					var entry = this.tryEntries[i$2];
					if (entry.tryLoc <= this.prev && hasOwn$11.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
						var finallyEntry = entry;
						break;
					}
				}
				finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
				var record = finallyEntry ? finallyEntry.completion : {};
				return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
			},
			complete: function complete(record, afterLoc) {
				if ("throw" === record.type) throw record.arg;
				return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
			},
			finish: function finish(finallyLoc) {
				for (var i$2 = this.tryEntries.length - 1; i$2 >= 0; --i$2) {
					var entry = this.tryEntries[i$2];
					if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
				}
			},
			"catch": function _catch(tryLoc) {
				for (var i$2 = this.tryEntries.length - 1; i$2 >= 0; --i$2) {
					var entry = this.tryEntries[i$2];
					if (entry.tryLoc === tryLoc) {
						var record = entry.completion;
						if ("throw" === record.type) {
							var thrown = record.arg;
							resetTryEntry(entry);
						}
						return thrown;
					}
				}
				throw new Error("illegal catch attempt");
			},
			delegateYield: function delegateYield(iterable, resultName, nextLoc) {
				return this.delegate = {
					iterator: values$8(iterable),
					resultName,
					nextLoc
				}, "next" === this.method && (this.arg = void 0), ContinueSentinel;
			}
		}, exports;
	}
	module.exports = _regeneratorRuntime$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
})(regeneratorRuntime$1);
var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
var runtime = regeneratorRuntimeExports();
var regenerator = runtime;
try {
	regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
	if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime;
	else Function("r", "regeneratorRuntime = r")(runtime);
}
var _regeneratorRuntime = /* @__PURE__ */ getDefaultExportFromCjs$1(regenerator);
var internalMetadata$1 = { exports: {} };
var fails$4$1 = fails$t$1;
var arrayBufferNonExtensible$1 = fails$4$1(function() {
	if (typeof ArrayBuffer == "function") {
		var buffer = new ArrayBuffer(8);
		if (Object.isExtensible(buffer)) Object.defineProperty(buffer, "a", { value: 8 });
	}
});
var fails$3$1 = fails$t$1;
var isObject$2$1 = isObject$h$1;
var classof$3$1 = classofRaw$2$1;
var ARRAY_BUFFER_NON_EXTENSIBLE$1 = arrayBufferNonExtensible$1;
var $isExtensible$1 = Object.isExtensible;
var FAILS_ON_PRIMITIVES$4 = fails$3$1(function() {
	$isExtensible$1(1);
});
var objectIsExtensible$1 = FAILS_ON_PRIMITIVES$4 || ARRAY_BUFFER_NON_EXTENSIBLE$1 ? function isExtensible$3(it$1) {
	if (!isObject$2$1(it$1)) return false;
	if (ARRAY_BUFFER_NON_EXTENSIBLE$1 && classof$3$1(it$1) == "ArrayBuffer") return false;
	return $isExtensible$1 ? $isExtensible$1(it$1) : true;
} : $isExtensible$1;
var fails$2$1 = fails$t$1;
var freezing$1 = !fails$2$1(function() {
	return Object.isExtensible(Object.preventExtensions({}));
});
var $$3$1 = _export$1;
var uncurryThis$1$1 = functionUncurryThis$1;
var hiddenKeys$7 = hiddenKeys$6$1;
var isObject$1$1 = isObject$h$1;
var hasOwn$3$1 = hasOwnProperty_1$1;
var defineProperty$1$1 = objectDefineProperty$1.f;
var getOwnPropertyNamesModule$3 = objectGetOwnPropertyNames$1;
var getOwnPropertyNamesExternalModule$1 = objectGetOwnPropertyNamesExternal$1;
var isExtensible$2 = objectIsExtensible$1;
var uid$5 = uid$4$1;
var FREEZING$2 = freezing$1;
var REQUIRED$1 = false;
var METADATA$1 = uid$5("meta");
var id$3 = 0;
var setMetadata$1 = function(it$1) {
	defineProperty$1$1(it$1, METADATA$1, { value: {
		objectID: "O" + id$3++,
		weakData: {}
	} });
};
var fastKey$1$1 = function(it$1, create$11) {
	if (!isObject$1$1(it$1)) return typeof it$1 == "symbol" ? it$1 : (typeof it$1 == "string" ? "S" : "P") + it$1;
	if (!hasOwn$3$1(it$1, METADATA$1)) {
		if (!isExtensible$2(it$1)) return "F";
		if (!create$11) return "E";
		setMetadata$1(it$1);
	}
	return it$1[METADATA$1].objectID;
};
var getWeakData$2 = function(it$1, create$11) {
	if (!hasOwn$3$1(it$1, METADATA$1)) {
		if (!isExtensible$2(it$1)) return true;
		if (!create$11) return false;
		setMetadata$1(it$1);
	}
	return it$1[METADATA$1].weakData;
};
var onFreeze$1 = function(it$1) {
	if (FREEZING$2 && REQUIRED$1 && isExtensible$2(it$1) && !hasOwn$3$1(it$1, METADATA$1)) setMetadata$1(it$1);
	return it$1;
};
var enable$1 = function() {
	meta$1.enable = function() {};
	REQUIRED$1 = true;
	var getOwnPropertyNames$6 = getOwnPropertyNamesModule$3.f;
	var splice$6 = uncurryThis$1$1([].splice);
	var test$4 = {};
	test$4[METADATA$1] = 1;
	if (getOwnPropertyNames$6(test$4).length) {
		getOwnPropertyNamesModule$3.f = function(it$1) {
			var result = getOwnPropertyNames$6(it$1);
			for (var i$2 = 0, length$1 = result.length; i$2 < length$1; i$2++) if (result[i$2] === METADATA$1) {
				splice$6(result, i$2, 1);
				break;
			}
			return result;
		};
		$$3$1({
			target: "Object",
			stat: true,
			forced: true
		}, { getOwnPropertyNames: getOwnPropertyNamesExternalModule$1.f });
	}
};
var meta$1 = internalMetadata$1.exports = {
	enable: enable$1,
	fastKey: fastKey$1$1,
	getWeakData: getWeakData$2,
	onFreeze: onFreeze$1
};
hiddenKeys$7[METADATA$1] = true;
var internalMetadataExports$1 = internalMetadata$1.exports;
var $$2$1 = _export$1;
var global$1$1 = global$m;
var InternalMetadataModule$2 = internalMetadataExports$1;
var fails$1$1 = fails$t$1;
var createNonEnumerableProperty$10 = createNonEnumerableProperty$9;
var iterate$1$1 = iterate$7;
var anInstance$1$1 = anInstance$3$1;
var isCallable$10 = isCallable$m;
var isObject$10 = isObject$h$1;
var setToStringTag$8 = setToStringTag$7;
var defineProperty$10 = objectDefineProperty$1.f;
var forEach$10 = arrayIteration$1.forEach;
var DESCRIPTORS$1$1 = descriptors$1;
var InternalStateModule$1$1 = internalState$1;
var setInternalState$1$1 = InternalStateModule$1$1.set;
var internalStateGetterFor$1$1 = InternalStateModule$1$1.getterFor;
var collection$2$1 = function(CONSTRUCTOR_NAME, wrapper$1, common) {
	var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1;
	var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1;
	var ADDER = IS_MAP ? "set" : "add";
	var NativeConstructor = global$1$1[CONSTRUCTOR_NAME];
	var NativePrototype = NativeConstructor && NativeConstructor.prototype;
	var exported = {};
	var Constructor;
	if (!DESCRIPTORS$1$1 || !isCallable$10(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$1$1(function() {
		new NativeConstructor().entries().next();
	}))) {
		Constructor = common.getConstructor(wrapper$1, CONSTRUCTOR_NAME, IS_MAP, ADDER);
		InternalMetadataModule$2.enable();
	} else {
		Constructor = wrapper$1(function(target, iterable) {
			setInternalState$1$1(anInstance$1$1(target, Prototype), {
				type: CONSTRUCTOR_NAME,
				collection: new NativeConstructor()
			});
			if (iterable != void 0) iterate$1$1(iterable, target[ADDER], {
				that: target,
				AS_ENTRIES: IS_MAP
			});
		});
		var Prototype = Constructor.prototype;
		var getInternalState$4 = internalStateGetterFor$1$1(CONSTRUCTOR_NAME);
		forEach$10([
			"add",
			"clear",
			"delete",
			"forEach",
			"get",
			"has",
			"set",
			"keys",
			"values",
			"entries"
		], function(KEY) {
			var IS_ADDER = KEY == "add" || KEY == "set";
			if (KEY in NativePrototype && !(IS_WEAK && KEY == "clear")) createNonEnumerableProperty$10(Prototype, KEY, function(a, b) {
				var collection$5 = getInternalState$4(this).collection;
				if (!IS_ADDER && IS_WEAK && !isObject$10(a)) return KEY == "get" ? void 0 : false;
				var result = collection$5[KEY](a === 0 ? 0 : a, b);
				return IS_ADDER ? this : result;
			});
		});
		IS_WEAK || defineProperty$10(Prototype, "size", {
			configurable: true,
			get: function() {
				return getInternalState$4(this).collection.size;
			}
		});
	}
	setToStringTag$8(Constructor, CONSTRUCTOR_NAME, false, true);
	exported[CONSTRUCTOR_NAME] = Constructor;
	$$2$1({
		global: true,
		forced: true
	}, exported);
	if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
	return Constructor;
};
var defineBuiltIn$7 = defineBuiltIn$6;
var defineBuiltIns$1$1 = function(target, src, options) {
	for (var key in src) if (options && options.unsafe && target[key]) target[key] = src[key];
	else defineBuiltIn$7(target, key, src[key], options);
	return target;
};
var create$10 = objectCreate$1;
var defineBuiltInAccessor$4 = defineBuiltInAccessor$3$1;
var defineBuiltIns$4 = defineBuiltIns$1$1;
var bind$10 = functionBindContext$1;
var anInstance$4 = anInstance$3$1;
var isNullOrUndefined$6 = isNullOrUndefined$5$1;
var iterate$8 = iterate$7;
var defineIterator$3 = iteratorDefine$1;
var createIterResultObject$4 = createIterResultObject$3$1;
var setSpecies$3 = setSpecies$2;
var DESCRIPTORS$10 = descriptors$1;
var fastKey$2 = internalMetadataExports$1.fastKey;
var InternalStateModule$6 = internalState$1;
var setInternalState$6 = InternalStateModule$6.set;
var internalStateGetterFor$3 = InternalStateModule$6.getterFor;
var collectionStrong$2$1 = {
	getConstructor: function(wrapper$1, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
		var Constructor = wrapper$1(function(that, iterable) {
			anInstance$4(that, Prototype);
			setInternalState$6(that, {
				type: CONSTRUCTOR_NAME,
				index: create$10(null),
				first: void 0,
				last: void 0,
				size: 0
			});
			if (!DESCRIPTORS$10) that.size = 0;
			if (!isNullOrUndefined$6(iterable)) iterate$8(iterable, that[ADDER], {
				that,
				AS_ENTRIES: IS_MAP
			});
		});
		var Prototype = Constructor.prototype;
		var getInternalState$4 = internalStateGetterFor$3(CONSTRUCTOR_NAME);
		var define = function(that, key, value) {
			var state = getInternalState$4(that);
			var entry = getEntry(that, key);
			var previous, index$1;
			if (entry) entry.value = value;
			else {
				state.last = entry = {
					index: index$1 = fastKey$2(key, true),
					key,
					value,
					previous: previous = state.last,
					next: void 0,
					removed: false
				};
				if (!state.first) state.first = entry;
				if (previous) previous.next = entry;
				if (DESCRIPTORS$10) state.size++;
				else that.size++;
				if (index$1 !== "F") state.index[index$1] = entry;
			}
			return that;
		};
		var getEntry = function(that, key) {
			var state = getInternalState$4(that);
			var index$1 = fastKey$2(key);
			var entry;
			if (index$1 !== "F") return state.index[index$1];
			for (entry = state.first; entry; entry = entry.next) if (entry.key == key) return entry;
		};
		defineBuiltIns$4(Prototype, {
			clear: function clear$1() {
				var that = this;
				var state = getInternalState$4(that);
				var data$2 = state.index;
				var entry = state.first;
				while (entry) {
					entry.removed = true;
					if (entry.previous) entry.previous = entry.previous.next = void 0;
					delete data$2[entry.index];
					entry = entry.next;
				}
				state.first = state.last = void 0;
				if (DESCRIPTORS$10) state.size = 0;
				else that.size = 0;
			},
			"delete": function(key) {
				var that = this;
				var state = getInternalState$4(that);
				var entry = getEntry(that, key);
				if (entry) {
					var next$1 = entry.next;
					var prev = entry.previous;
					delete state.index[entry.index];
					entry.removed = true;
					if (prev) prev.next = next$1;
					if (next$1) next$1.previous = prev;
					if (state.first == entry) state.first = next$1;
					if (state.last == entry) state.last = prev;
					if (DESCRIPTORS$10) state.size--;
					else that.size--;
				}
				return !!entry;
			},
			forEach: function forEach$11(callbackfn) {
				var state = getInternalState$4(this);
				var boundFunction = bind$10(callbackfn, arguments.length > 1 ? arguments[1] : void 0);
				var entry;
				while (entry = entry ? entry.next : state.first) {
					boundFunction(entry.value, entry.key, this);
					while (entry && entry.removed) entry = entry.previous;
				}
			},
			has: function has$2(key) {
				return !!getEntry(this, key);
			}
		});
		defineBuiltIns$4(Prototype, IS_MAP ? {
			get: function get$9(key) {
				var entry = getEntry(this, key);
				return entry && entry.value;
			},
			set: function set$6(key, value) {
				return define(this, key === 0 ? 0 : key, value);
			}
		} : { add: function add(value) {
			return define(this, value = value === 0 ? 0 : value, value);
		} });
		if (DESCRIPTORS$10) defineBuiltInAccessor$4(Prototype, "size", {
			configurable: true,
			get: function() {
				return getInternalState$4(this).size;
			}
		});
		return Constructor;
	},
	setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) {
		var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator";
		var getInternalCollectionState = internalStateGetterFor$3(CONSTRUCTOR_NAME);
		var getInternalIteratorState = internalStateGetterFor$3(ITERATOR_NAME);
		defineIterator$3(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) {
			setInternalState$6(this, {
				type: ITERATOR_NAME,
				target: iterated,
				state: getInternalCollectionState(iterated),
				kind,
				last: void 0
			});
		}, function() {
			var state = getInternalIteratorState(this);
			var kind = state.kind;
			var entry = state.last;
			while (entry && entry.removed) entry = entry.previous;
			if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
				state.target = void 0;
				return createIterResultObject$4(void 0, true);
			}
			if (kind == "keys") return createIterResultObject$4(entry.key, false);
			if (kind == "values") return createIterResultObject$4(entry.value, false);
			return createIterResultObject$4([entry.key, entry.value], false);
		}, IS_MAP ? "entries" : "values", !IS_MAP, true);
		setSpecies$3(CONSTRUCTOR_NAME);
	}
};
var collection$1$1 = collection$2$1;
var collectionStrong$1$1 = collectionStrong$2$1;
collection$1$1("Map", function(init) {
	return function Map() {
		return init(this, arguments.length ? arguments[0] : void 0);
	};
}, collectionStrong$1$1);
var path$1$1 = path$o$1;
var map$2$1 = path$1$1.Map;
var parent$9$1 = map$2$1;
var map$1$1 = parent$9$1;
var map$7 = map$1$1;
var _Map$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(map$7);
var $$1$1 = _export$1;
var $some$1 = arrayIteration$1.some;
var arrayMethodIsStrict$1$1 = arrayMethodIsStrict$4$1;
var STRICT_METHOD$1$1 = arrayMethodIsStrict$1$1("some");
$$1$1({
	target: "Array",
	proto: true,
	forced: !STRICT_METHOD$1$1
}, { some: function some$5(callbackfn) {
	return $some$1(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$4$1 = entryVirtual$f$1;
var some$3$1 = entryVirtual$4$1("Array").some;
var isPrototypeOf$4$1 = objectIsPrototypeOf$1;
var method$4$1 = some$3$1;
var ArrayPrototype$4$1 = Array.prototype;
var some$2$1 = function(it$1) {
	var own = it$1.some;
	return it$1 === ArrayPrototype$4$1 || isPrototypeOf$4$1(ArrayPrototype$4$1, it$1) && own === ArrayPrototype$4$1.some ? method$4$1 : own;
};
var parent$8$1 = some$2$1;
var some$1$1 = parent$8$1;
var some$4 = some$1$1;
var _someInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(some$4);
var entryVirtual$3$1 = entryVirtual$f$1;
var keys$3$1 = entryVirtual$3$1("Array").keys;
var parent$7$1 = keys$3$1;
var keys$2$1 = parent$7$1;
var classof$2$1 = classof$d$1;
var hasOwn$2$1 = hasOwnProperty_1$1;
var isPrototypeOf$3$1 = objectIsPrototypeOf$1;
var method$3$1 = keys$2$1;
var ArrayPrototype$3$1 = Array.prototype;
var DOMIterables$2$1 = {
	DOMTokenList: true,
	NodeList: true
};
var keys$1$1 = function(it$1) {
	var own = it$1.keys;
	return it$1 === ArrayPrototype$3$1 || isPrototypeOf$3$1(ArrayPrototype$3$1, it$1) && own === ArrayPrototype$3$1.keys || hasOwn$2$1(DOMIterables$2$1, classof$2$1(it$1)) ? method$3$1 : own;
};
var keys$8 = keys$1$1;
var _keysInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs$1(keys$8);
var arraySlice$7 = arraySliceSimple$1;
var floor$2 = Math.floor;
var mergeSort$1 = function(array$1, comparefn) {
	var length$1 = array$1.length;
	var middle = floor$2(length$1 / 2);
	return length$1 < 8 ? insertionSort$1(array$1, comparefn) : merge$3(array$1, mergeSort$1(arraySlice$7(array$1, 0, middle), comparefn), mergeSort$1(arraySlice$7(array$1, middle), comparefn), comparefn);
};
var insertionSort$1 = function(array$1, comparefn) {
	var length$1 = array$1.length;
	var i$2 = 1;
	var element, j;
	while (i$2 < length$1) {
		j = i$2;
		element = array$1[i$2];
		while (j && comparefn(array$1[j - 1], element) > 0) array$1[j] = array$1[--j];
		if (j !== i$2++) array$1[j] = element;
	}
	return array$1;
};
var merge$3 = function(array$1, left, right, comparefn) {
	var llength = left.length;
	var rlength = right.length;
	var lindex = 0;
	var rindex = 0;
	while (lindex < llength || rindex < rlength) array$1[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
	return array$1;
};
var arraySort$1 = mergeSort$1;
var userAgent$1$1 = engineUserAgent$1;
var firefox$1 = userAgent$1$1.match(/firefox\/(\d+)/i);
var engineFfVersion$1 = !!firefox$1 && +firefox$1[1];
var UA$1 = engineUserAgent$1;
var engineIsIeOrEdge$1 = /MSIE|Trident/.test(UA$1);
var userAgent$6 = engineUserAgent$1;
var webkit$1 = userAgent$6.match(/AppleWebKit\/(\d+)\./);
var engineWebkitVersion$1 = !!webkit$1 && +webkit$1[1];
var $$10 = _export$1;
var uncurryThis$10 = functionUncurryThis$1;
var aCallable$10 = aCallable$e;
var toObject$10 = toObject$d$1;
var lengthOfArrayLike$10 = lengthOfArrayLike$c;
var deletePropertyOrThrow$3 = deletePropertyOrThrow$2$1;
var toString$10 = toString$7$1;
var fails$10 = fails$t$1;
var internalSort$1 = arraySort$1;
var arrayMethodIsStrict$7 = arrayMethodIsStrict$4$1;
var FF$1 = engineFfVersion$1;
var IE_OR_EDGE$1 = engineIsIeOrEdge$1;
var V8$1 = engineV8Version$1;
var WEBKIT$1 = engineWebkitVersion$1;
var test$3 = [];
var nativeSort$1 = uncurryThis$10(test$3.sort);
var push$7 = uncurryThis$10(test$3.push);
var FAILS_ON_UNDEFINED$1 = fails$10(function() {
	test$3.sort(void 0);
});
var FAILS_ON_NULL$1 = fails$10(function() {
	test$3.sort(null);
});
var STRICT_METHOD$4 = arrayMethodIsStrict$7("sort");
var STABLE_SORT$1 = !fails$10(function() {
	if (V8$1) return V8$1 < 70;
	if (FF$1 && FF$1 > 3) return;
	if (IE_OR_EDGE$1) return true;
	if (WEBKIT$1) return WEBKIT$1 < 603;
	var result = "";
	var code, chr, value, index$1;
	for (code = 65; code < 76; code++) {
		chr = String.fromCharCode(code);
		switch (code) {
			case 66:
			case 69:
			case 70:
			case 72:
				value = 3;
				break;
			case 68:
			case 71:
				value = 4;
				break;
			default: value = 2;
		}
		for (index$1 = 0; index$1 < 47; index$1++) test$3.push({
			k: chr + index$1,
			v: value
		});
	}
	test$3.sort(function(a, b) {
		return b.v - a.v;
	});
	for (index$1 = 0; index$1 < test$3.length; index$1++) {
		chr = test$3[index$1].k.charAt(0);
		if (result.charAt(result.length - 1) !== chr) result += chr;
	}
	return result !== "DGBEFHACIJK";
});
var FORCED$10 = FAILS_ON_UNDEFINED$1 || !FAILS_ON_NULL$1 || !STRICT_METHOD$4 || !STABLE_SORT$1;
var getSortCompare$1 = function(comparefn) {
	return function(x, y) {
		if (y === void 0) return -1;
		if (x === void 0) return 1;
		if (comparefn !== void 0) return +comparefn(x, y) || 0;
		return toString$10(x) > toString$10(y) ? 1 : -1;
	};
};
$$10({
	target: "Array",
	proto: true,
	forced: FORCED$10
}, { sort: function sort$5(comparefn) {
	if (comparefn !== void 0) aCallable$10(comparefn);
	var array$1 = toObject$10(this);
	if (STABLE_SORT$1) return comparefn === void 0 ? nativeSort$1(array$1) : nativeSort$1(array$1, comparefn);
	var items = [];
	var arrayLength = lengthOfArrayLike$10(array$1);
	var itemsLength, index$1;
	for (index$1 = 0; index$1 < arrayLength; index$1++) if (index$1 in array$1) push$7(items, array$1[index$1]);
	internalSort$1(items, getSortCompare$1(comparefn));
	itemsLength = lengthOfArrayLike$10(items);
	index$1 = 0;
	while (index$1 < itemsLength) array$1[index$1] = items[index$1++];
	while (index$1 < arrayLength) deletePropertyOrThrow$3(array$1, index$1++);
	return array$1;
} });
var entryVirtual$2$1 = entryVirtual$f$1;
var sort$3$1 = entryVirtual$2$1("Array").sort;
var isPrototypeOf$2$1 = objectIsPrototypeOf$1;
var method$2$1 = sort$3$1;
var ArrayPrototype$2$1 = Array.prototype;
var sort$2$1 = function(it$1) {
	var own = it$1.sort;
	return it$1 === ArrayPrototype$2$1 || isPrototypeOf$2$1(ArrayPrototype$2$1, it$1) && own === ArrayPrototype$2$1.sort ? method$2$1 : own;
};
var parent$6$1 = sort$2$1;
var sort$1$1 = parent$6$1;
var sort$4 = sort$1$1;
var _sortInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(sort$4);
var entryVirtual$1$1 = entryVirtual$f$1;
var values$3$1 = entryVirtual$1$1("Array").values;
var parent$5$1 = values$3$1;
var values$2$1 = parent$5$1;
var classof$1$1 = classof$d$1;
var hasOwn$1$1 = hasOwnProperty_1$1;
var isPrototypeOf$1$1 = objectIsPrototypeOf$1;
var method$1$1 = values$2$1;
var ArrayPrototype$1$1 = Array.prototype;
var DOMIterables$1$1 = {
	DOMTokenList: true,
	NodeList: true
};
var values$1$1 = function(it$1) {
	var own = it$1.values;
	return it$1 === ArrayPrototype$1$1 || isPrototypeOf$1$1(ArrayPrototype$1$1, it$1) && own === ArrayPrototype$1$1.values || hasOwn$1$1(DOMIterables$1$1, classof$1$1(it$1)) ? method$1$1 : own;
};
var values$7 = values$1$1;
var _valuesInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(values$7);
var iterator$7 = iterator$5$1;
var _Symbol$iterator$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(iterator$7);
var entryVirtual$10 = entryVirtual$f$1;
var entries$3 = entryVirtual$10("Array").entries;
var parent$4$1 = entries$3;
var entries$2 = parent$4$1;
var classof$10 = classof$d$1;
var hasOwn$10 = hasOwnProperty_1$1;
var isPrototypeOf$10 = objectIsPrototypeOf$1;
var method$10 = entries$2;
var ArrayPrototype$10 = Array.prototype;
var DOMIterables$5 = {
	DOMTokenList: true,
	NodeList: true
};
var entries$1 = function(it$1) {
	var own = it$1.entries;
	return it$1 === ArrayPrototype$10 || isPrototypeOf$10(ArrayPrototype$10, it$1) && own === ArrayPrototype$10.entries || hasOwn$10(DOMIterables$5, classof$10(it$1)) ? method$10 : own;
};
var entries = entries$1;
var _entriesInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs$1(entries);
let getRandomValues$1;
const rnds8$1 = new Uint8Array(16);
function rng$1() {
	if (!getRandomValues$1) {
		getRandomValues$1 = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
		if (!getRandomValues$1) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
	}
	return getRandomValues$1(rnds8$1);
}
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex$1 = [];
for (let i$2 = 0; i$2 < 256; ++i$2) byteToHex$1.push((i$2 + 256).toString(16).slice(1));
function unsafeStringify$1(arr, offset = 0) {
	return byteToHex$1[arr[offset + 0]] + byteToHex$1[arr[offset + 1]] + byteToHex$1[arr[offset + 2]] + byteToHex$1[arr[offset + 3]] + "-" + byteToHex$1[arr[offset + 4]] + byteToHex$1[arr[offset + 5]] + "-" + byteToHex$1[arr[offset + 6]] + byteToHex$1[arr[offset + 7]] + "-" + byteToHex$1[arr[offset + 8]] + byteToHex$1[arr[offset + 9]] + "-" + byteToHex$1[arr[offset + 10]] + byteToHex$1[arr[offset + 11]] + byteToHex$1[arr[offset + 12]] + byteToHex$1[arr[offset + 13]] + byteToHex$1[arr[offset + 14]] + byteToHex$1[arr[offset + 15]];
}
const randomUUID$1 = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
var native$1 = { randomUUID: randomUUID$1 };
function v4$1(options, buf, offset) {
	if (native$1.randomUUID && !buf && !options) return native$1.randomUUID();
	options = options || {};
	const rnds = options.random || (options.rng || rng$1)();
	rnds[6] = rnds[6] & 15 | 64;
	rnds[8] = rnds[8] & 63 | 128;
	if (buf) {
		offset = offset || 0;
		for (let i$2 = 0; i$2 < 16; ++i$2) buf[offset + i$2] = rnds[i$2];
		return buf;
	}
	return unsafeStringify$1(rnds);
}
/**

* Determine whether a value can be used as an id.

*

* @param value - Input value of unknown type.

* @returns True if the value is valid id, false otherwise.

*/
function isId(value) {
	return typeof value === "string" || typeof value === "number";
}
/**

* A queue.

*

* @typeParam T - The type of method names to be replaced by queued versions.

*/
var Queue = /* @__PURE__ */ function() {
	/** Delay in milliseconds. If defined the queue will be periodically flushed. */
	/** Maximum number of entries in the queue before it will be flushed. */
	/**
	
	* Construct a new Queue.
	
	*
	
	* @param options - Queue configuration.
	
	*/
	function Queue$4(options) {
		_classCallCheck$1(this, Queue$4);
		_defineProperty$1(this, "delay", void 0);
		_defineProperty$1(this, "max", void 0);
		_defineProperty$1(this, "_queue", []);
		_defineProperty$1(this, "_timeout", null);
		_defineProperty$1(this, "_extended", null);
		this.delay = null;
		this.max = Infinity;
		this.setOptions(options);
	}
	/**
	
	* Update the configuration of the queue.
	
	*
	
	* @param options - Queue configuration.
	
	*/
	_createClass$1(Queue$4, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options && typeof options.delay !== "undefined") this.delay = options.delay;
				if (options && typeof options.max !== "undefined") this.max = options.max;
				this._flushIfNeeded();
			}
		},
		{
			key: "destroy",
			value: function destroy() {
				this.flush();
				if (this._extended) {
					var object$1 = this._extended.object;
					var methods = this._extended.methods;
					for (var i$2 = 0; i$2 < methods.length; i$2++) {
						var method$11 = methods[i$2];
						if (method$11.original) object$1[method$11.name] = method$11.original;
						else delete object$1[method$11.name];
					}
					this._extended = null;
				}
			}
		},
		{
			key: "replace",
			value: function replace$3(object$1, method$11) {
				var me = this;
				var original = object$1[method$11];
				if (!original) throw new Error("Method " + method$11 + " undefined");
				object$1[method$11] = function() {
					for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
					me.queue({
						args,
						fn: original,
						context: this
					});
				};
			}
		},
		{
			key: "queue",
			value: function queue$3(entry) {
				if (typeof entry === "function") this._queue.push({ fn: entry });
				else this._queue.push(entry);
				this._flushIfNeeded();
			}
		},
		{
			key: "_flushIfNeeded",
			value: function _flushIfNeeded() {
				var _this = this;
				if (this._queue.length > this.max) this.flush();
				if (this._timeout != null) {
					clearTimeout(this._timeout);
					this._timeout = null;
				}
				if (this.queue.length > 0 && typeof this.delay === "number") this._timeout = _setTimeout$1(function() {
					_this.flush();
				}, this.delay);
			}
		},
		{
			key: "flush",
			value: function flush$1() {
				var _context, _context2;
				_forEachInstanceProperty$1(_context = _spliceInstanceProperty$1(_context2 = this._queue).call(_context2, 0)).call(_context, function(entry) {
					entry.fn.apply(entry.context || entry.fn, entry.args || []);
				});
			}
		}
	], [{
		key: "extend",
		value: function extend$2(object$1, options) {
			var queue$3 = new Queue$4(options);
			if (object$1.flush !== void 0) throw new Error("Target object already has a property flush");
			object$1.flush = function() {
				queue$3.flush();
			};
			var methods = [{
				name: "flush",
				original: void 0
			}];
			if (options && options.replace) for (var i$2 = 0; i$2 < options.replace.length; i$2++) {
				var name = options.replace[i$2];
				methods.push({
					name,
					original: object$1[name]
				});
				queue$3.replace(object$1, name);
			}
			queue$3._extended = {
				object: object$1,
				methods
			};
			return queue$3;
		}
	}]);
	return Queue$4;
}();
/**

* {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.

*

* @typeParam Item - Item type that may or may not have an id.

* @typeParam IdProp - Name of the property that contains the id.

*/
var DataSetPart = /* @__PURE__ */ function() {
	function DataSetPart$1() {
		_classCallCheck$1(this, DataSetPart$1);
		_defineProperty$1(this, "_subscribers", {
			"*": [],
			add: [],
			remove: [],
			update: []
		});
		/**
		
		* @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
		
		*/
		_defineProperty$1(this, "subscribe", DataSetPart$1.prototype.on);
		/**
		
		* @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).
		
		*/
		_defineProperty$1(this, "unsubscribe", DataSetPart$1.prototype.off);
	}
	_createClass$1(DataSetPart$1, [
		{
			key: "_trigger",
			value: function _trigger(event, payload, senderId) {
				var _context, _context2;
				if (event === "*") throw new Error("Cannot trigger event *");
				_forEachInstanceProperty$1(_context = _concatInstanceProperty$1(_context2 = []).call(_context2, _toConsumableArray$1(this._subscribers[event]), _toConsumableArray$1(this._subscribers["*"]))).call(_context, function(subscriber) {
					subscriber(event, payload, senderId != null ? senderId : null);
				});
			}
		},
		{
			key: "on",
			value: function on(event, callback) {
				if (typeof callback === "function") this._subscribers[event].push(callback);
			}
		},
		{
			key: "off",
			value: function off(event, callback) {
				var _context3;
				this._subscribers[event] = _filterInstanceProperty$1(_context3 = this._subscribers[event]).call(_context3, function(subscriber) {
					return subscriber !== callback;
				});
			}
		}
	]);
	return DataSetPart$1;
}();
var collection$4 = collection$2$1;
var collectionStrong$3 = collectionStrong$2$1;
collection$4("Set", function(init) {
	return function Set() {
		return init(this, arguments.length ? arguments[0] : void 0);
	};
}, collectionStrong$3);
var path$10 = path$o$1;
var set$2$1 = path$10.Set;
var parent$3$1 = set$2$1;
var set$1$1 = parent$3$1;
var set$5 = set$1$1;
var _Set$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(set$5);
var getIterator$5 = getIterator$8;
var getIterator_1 = getIterator$5;
var parent$2$1 = getIterator_1;
var getIterator$4 = parent$2$1;
var parent$1$1 = getIterator$4;
var getIterator$3 = parent$1$1;
var parent$20 = getIterator$3;
var getIterator$2$1 = parent$20;
var getIterator$1$1 = getIterator$2$1;
var getIterator$9 = getIterator$1$1;
var _getIterator = /* @__PURE__ */ getDefaultExportFromCjs$1(getIterator$9);
var _Symbol$iterator$3;
function _createForOfIteratorHelper$2$1(o, allowArrayLike) {
	var it$1 = typeof _Symbol$2 !== "undefined" && _getIteratorMethod$1(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray$2(o) || (it$1 = _unsupportedIterableToArray$2$1(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$2$1(o, minLen) {
	var _context10;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$2$1(o, minLen);
	var n = _sliceInstanceProperty$2(_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2$1(o, minLen);
}
function _arrayLikeToArray$2$1(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
_Symbol$iterator$3 = _Symbol$iterator$1;
/**

* Data stream

*

* @remarks

* {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.

* That means that the stream is evaluated at the time of iteration, conversion to another data type or when {@link cache} is called, not when the {@link DataStream} was created.

* Multiple invocations of for example {@link toItemArray} may yield different results (if the data source like for example {@link DataSet} gets modified).

* @typeParam Item - The item type this stream is going to work with.

*/
var DataStream = /* @__PURE__ */ function() {
	/**
	
	* Create a new data stream.
	
	*
	
	* @param pairs - The id, item pairs.
	
	*/
	function DataStream$1(pairs) {
		_classCallCheck$1(this, DataStream$1);
		_defineProperty$1(this, "_pairs", void 0);
		this._pairs = pairs;
	}
	/**
	
	* Return an iterable of key, value pairs for every entry in the stream.
	
	*/
	_createClass$1(DataStream$1, [
		{
			key: _Symbol$iterator$3,
			value: /* @__PURE__ */ _regeneratorRuntime.mark(function value() {
				var _iterator, _step, _step$value, id$4, item;
				return _regeneratorRuntime.wrap(function value$(_context) {
					while (1) switch (_context.prev = _context.next) {
						case 0:
							_iterator = _createForOfIteratorHelper$2$1(this._pairs);
							_context.prev = 1;
							_iterator.s();
						case 3:
							if ((_step = _iterator.n()).done) {
								_context.next = 9;
								break;
							}
							_step$value = _slicedToArray$1(_step.value, 2), id$4 = _step$value[0], item = _step$value[1];
							_context.next = 7;
							return [id$4, item];
						case 7:
							_context.next = 3;
							break;
						case 9:
							_context.next = 14;
							break;
						case 11:
							_context.prev = 11;
							_context.t0 = _context["catch"](1);
							_iterator.e(_context.t0);
						case 14:
							_context.prev = 14;
							_iterator.f();
							return _context.finish(14);
						case 17:
						case "end": return _context.stop();
					}
				}, value, this, [[
					1,
					11,
					14,
					17
				]]);
			})
		},
		{
			key: "entries",
			value: /* @__PURE__ */ _regeneratorRuntime.mark(function entries$4() {
				var _iterator2, _step2, _step2$value, id$4, item;
				return _regeneratorRuntime.wrap(function entries$(_context2) {
					while (1) switch (_context2.prev = _context2.next) {
						case 0:
							_iterator2 = _createForOfIteratorHelper$2$1(this._pairs);
							_context2.prev = 1;
							_iterator2.s();
						case 3:
							if ((_step2 = _iterator2.n()).done) {
								_context2.next = 9;
								break;
							}
							_step2$value = _slicedToArray$1(_step2.value, 2), id$4 = _step2$value[0], item = _step2$value[1];
							_context2.next = 7;
							return [id$4, item];
						case 7:
							_context2.next = 3;
							break;
						case 9:
							_context2.next = 14;
							break;
						case 11:
							_context2.prev = 11;
							_context2.t0 = _context2["catch"](1);
							_iterator2.e(_context2.t0);
						case 14:
							_context2.prev = 14;
							_iterator2.f();
							return _context2.finish(14);
						case 17:
						case "end": return _context2.stop();
					}
				}, entries$4, this, [[
					1,
					11,
					14,
					17
				]]);
			})
		},
		{
			key: "keys",
			value: /* @__PURE__ */ _regeneratorRuntime.mark(function keys$9() {
				var _iterator3, _step3, _step3$value, id$4;
				return _regeneratorRuntime.wrap(function keys$(_context3) {
					while (1) switch (_context3.prev = _context3.next) {
						case 0:
							_iterator3 = _createForOfIteratorHelper$2$1(this._pairs);
							_context3.prev = 1;
							_iterator3.s();
						case 3:
							if ((_step3 = _iterator3.n()).done) {
								_context3.next = 9;
								break;
							}
							_step3$value = _slicedToArray$1(_step3.value, 1), id$4 = _step3$value[0];
							_context3.next = 7;
							return id$4;
						case 7:
							_context3.next = 3;
							break;
						case 9:
							_context3.next = 14;
							break;
						case 11:
							_context3.prev = 11;
							_context3.t0 = _context3["catch"](1);
							_iterator3.e(_context3.t0);
						case 14:
							_context3.prev = 14;
							_iterator3.f();
							return _context3.finish(14);
						case 17:
						case "end": return _context3.stop();
					}
				}, keys$9, this, [[
					1,
					11,
					14,
					17
				]]);
			})
		},
		{
			key: "values",
			value: /* @__PURE__ */ _regeneratorRuntime.mark(function values$8() {
				var _iterator4, _step4, _step4$value, item;
				return _regeneratorRuntime.wrap(function values$(_context4) {
					while (1) switch (_context4.prev = _context4.next) {
						case 0:
							_iterator4 = _createForOfIteratorHelper$2$1(this._pairs);
							_context4.prev = 1;
							_iterator4.s();
						case 3:
							if ((_step4 = _iterator4.n()).done) {
								_context4.next = 9;
								break;
							}
							_step4$value = _slicedToArray$1(_step4.value, 2), item = _step4$value[1];
							_context4.next = 7;
							return item;
						case 7:
							_context4.next = 3;
							break;
						case 9:
							_context4.next = 14;
							break;
						case 11:
							_context4.prev = 11;
							_context4.t0 = _context4["catch"](1);
							_iterator4.e(_context4.t0);
						case 14:
							_context4.prev = 14;
							_iterator4.f();
							return _context4.finish(14);
						case 17:
						case "end": return _context4.stop();
					}
				}, values$8, this, [[
					1,
					11,
					14,
					17
				]]);
			})
		},
		{
			key: "toIdArray",
			value: function toIdArray() {
				var _context5;
				return _mapInstanceProperty$1(_context5 = _toConsumableArray$1(this._pairs)).call(_context5, function(pair) {
					return pair[0];
				});
			}
		},
		{
			key: "toItemArray",
			value: function toItemArray() {
				var _context6;
				return _mapInstanceProperty$1(_context6 = _toConsumableArray$1(this._pairs)).call(_context6, function(pair) {
					return pair[1];
				});
			}
		},
		{
			key: "toEntryArray",
			value: function toEntryArray() {
				return _toConsumableArray$1(this._pairs);
			}
		},
		{
			key: "toObjectMap",
			value: function toObjectMap() {
				var map$8 = _Object$create$1$1(null);
				var _iterator5 = _createForOfIteratorHelper$2$1(this._pairs), _step5;
				try {
					for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
						var _step5$value = _slicedToArray$1(_step5.value, 2), id$4 = _step5$value[0], item = _step5$value[1];
						map$8[id$4] = item;
					}
				} catch (err) {
					_iterator5.e(err);
				} finally {
					_iterator5.f();
				}
				return map$8;
			}
		},
		{
			key: "toMap",
			value: function toMap() {
				return new _Map$1(this._pairs);
			}
		},
		{
			key: "toIdSet",
			value: function toIdSet() {
				return new _Set$1(this.toIdArray());
			}
		},
		{
			key: "toItemSet",
			value: function toItemSet() {
				return new _Set$1(this.toItemArray());
			}
		},
		{
			key: "cache",
			value: function cache() {
				return new DataStream$1(_toConsumableArray$1(this._pairs));
			}
		},
		{
			key: "distinct",
			value: function distinct(callback) {
				var set$6 = new _Set$1();
				var _iterator6 = _createForOfIteratorHelper$2$1(this._pairs), _step6;
				try {
					for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
						var _step6$value = _slicedToArray$1(_step6.value, 2), id$4 = _step6$value[0], item = _step6$value[1];
						set$6.add(callback(item, id$4));
					}
				} catch (err) {
					_iterator6.e(err);
				} finally {
					_iterator6.f();
				}
				return set$6;
			}
		},
		{
			key: "filter",
			value: function filter$5(callback) {
				var pairs = this._pairs;
				return new DataStream$1(_defineProperty$1({}, _Symbol$iterator$1, /* @__PURE__ */ _regeneratorRuntime.mark(function _callee() {
					var _iterator7, _step7, _step7$value, id$4, item;
					return _regeneratorRuntime.wrap(function _callee$(_context7) {
						while (1) switch (_context7.prev = _context7.next) {
							case 0:
								_iterator7 = _createForOfIteratorHelper$2$1(pairs);
								_context7.prev = 1;
								_iterator7.s();
							case 3:
								if ((_step7 = _iterator7.n()).done) {
									_context7.next = 10;
									break;
								}
								_step7$value = _slicedToArray$1(_step7.value, 2), id$4 = _step7$value[0], item = _step7$value[1];
								if (!callback(item, id$4)) {
									_context7.next = 8;
									break;
								}
								_context7.next = 8;
								return [id$4, item];
							case 8:
								_context7.next = 3;
								break;
							case 10:
								_context7.next = 15;
								break;
							case 12:
								_context7.prev = 12;
								_context7.t0 = _context7["catch"](1);
								_iterator7.e(_context7.t0);
							case 15:
								_context7.prev = 15;
								_iterator7.f();
								return _context7.finish(15);
							case 18:
							case "end": return _context7.stop();
						}
					}, _callee, null, [[
						1,
						12,
						15,
						18
					]]);
				})));
			}
		},
		{
			key: "forEach",
			value: function forEach$11(callback) {
				var _iterator8 = _createForOfIteratorHelper$2$1(this._pairs), _step8;
				try {
					for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
						var _step8$value = _slicedToArray$1(_step8.value, 2), id$4 = _step8$value[0], item = _step8$value[1];
						callback(item, id$4);
					}
				} catch (err) {
					_iterator8.e(err);
				} finally {
					_iterator8.f();
				}
			}
		},
		{
			key: "map",
			value: function map$8(callback) {
				var pairs = this._pairs;
				return new DataStream$1(_defineProperty$1({}, _Symbol$iterator$1, /* @__PURE__ */ _regeneratorRuntime.mark(function _callee2() {
					var _iterator9, _step9, _step9$value, id$4, item;
					return _regeneratorRuntime.wrap(function _callee2$(_context8) {
						while (1) switch (_context8.prev = _context8.next) {
							case 0:
								_iterator9 = _createForOfIteratorHelper$2$1(pairs);
								_context8.prev = 1;
								_iterator9.s();
							case 3:
								if ((_step9 = _iterator9.n()).done) {
									_context8.next = 9;
									break;
								}
								_step9$value = _slicedToArray$1(_step9.value, 2), id$4 = _step9$value[0], item = _step9$value[1];
								_context8.next = 7;
								return [id$4, callback(item, id$4)];
							case 7:
								_context8.next = 3;
								break;
							case 9:
								_context8.next = 14;
								break;
							case 11:
								_context8.prev = 11;
								_context8.t0 = _context8["catch"](1);
								_iterator9.e(_context8.t0);
							case 14:
								_context8.prev = 14;
								_iterator9.f();
								return _context8.finish(14);
							case 17:
							case "end": return _context8.stop();
						}
					}, _callee2, null, [[
						1,
						11,
						14,
						17
					]]);
				})));
			}
		},
		{
			key: "max",
			value: function max$5(callback) {
				var iter = _getIterator(this._pairs);
				var curr = iter.next();
				if (curr.done) return null;
				var maxItem = curr.value[1];
				var maxValue = callback(curr.value[1], curr.value[0]);
				while (!(curr = iter.next()).done) {
					var _curr$value = _slicedToArray$1(curr.value, 2), id$4 = _curr$value[0], item = _curr$value[1];
					var _value = callback(item, id$4);
					if (_value > maxValue) {
						maxValue = _value;
						maxItem = item;
					}
				}
				return maxItem;
			}
		},
		{
			key: "min",
			value: function min$4(callback) {
				var iter = _getIterator(this._pairs);
				var curr = iter.next();
				if (curr.done) return null;
				var minItem = curr.value[1];
				var minValue = callback(curr.value[1], curr.value[0]);
				while (!(curr = iter.next()).done) {
					var _curr$value2 = _slicedToArray$1(curr.value, 2), id$4 = _curr$value2[0], item = _curr$value2[1];
					var _value2 = callback(item, id$4);
					if (_value2 < minValue) {
						minValue = _value2;
						minItem = item;
					}
				}
				return minItem;
			}
		},
		{
			key: "reduce",
			value: function reduce$5(callback, accumulator) {
				var _iterator10 = _createForOfIteratorHelper$2$1(this._pairs), _step10;
				try {
					for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
						var _step10$value = _slicedToArray$1(_step10.value, 2), id$4 = _step10$value[0], item = _step10$value[1];
						accumulator = callback(accumulator, item, id$4);
					}
				} catch (err) {
					_iterator10.e(err);
				} finally {
					_iterator10.f();
				}
				return accumulator;
			}
		},
		{
			key: "sort",
			value: function sort$5(callback) {
				var _this = this;
				return new DataStream$1(_defineProperty$1({}, _Symbol$iterator$1, function() {
					var _context9;
					return _getIterator(_sortInstanceProperty$1(_context9 = _toConsumableArray$1(_this._pairs)).call(_context9, function(_ref, _ref2) {
						var _ref3 = _slicedToArray$1(_ref, 2), idA = _ref3[0], itemA = _ref3[1];
						var _ref4 = _slicedToArray$1(_ref2, 2), idB = _ref4[0], itemB = _ref4[1];
						return callback(itemA, itemB, idA, idB);
					}));
				}));
			}
		}
	]);
	return DataStream$1;
}();
function ownKeys$10(e, r) {
	var t = _Object$keys$1(e);
	if (_Object$getOwnPropertySymbols$1) {
		var o = _Object$getOwnPropertySymbols$1(e);
		r && (o = _filterInstanceProperty$1(o).call(o, function(r$1) {
			return _Object$getOwnPropertyDescriptor$2(e, r$1).enumerable;
		})), t.push.apply(t, o);
	}
	return t;
}
function _objectSpread$4(e) {
	for (var r = 1; r < arguments.length; r++) {
		var _context10, _context11;
		var t = null != arguments[r] ? arguments[r] : {};
		r % 2 ? _forEachInstanceProperty$1(_context10 = ownKeys$10(Object(t), !0)).call(_context10, function(r$1) {
			_defineProperty$1(e, r$1, t[r$1]);
		}) : _Object$getOwnPropertyDescriptors$1 ? _Object$defineProperties$1(e, _Object$getOwnPropertyDescriptors$1(t)) : _forEachInstanceProperty$1(_context11 = ownKeys$10(Object(t))).call(_context11, function(r$1) {
			_Object$defineProperty$2(e, r$1, _Object$getOwnPropertyDescriptor$2(t, r$1));
		});
	}
	return e;
}
function _createForOfIteratorHelper$1$1(o, allowArrayLike) {
	var it$1 = typeof _Symbol$2 !== "undefined" && _getIteratorMethod$1(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray$2(o) || (it$1 = _unsupportedIterableToArray$1$1(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$1$1(o, minLen) {
	var _context9;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$1$1(o, minLen);
	var n = _sliceInstanceProperty$2(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1$1(o, minLen);
}
function _arrayLikeToArray$1$1(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
function _createSuper$1$1(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$1$1();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf$1(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf$1(this).constructor;
			result = _Reflect$construct$1(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn$1(this, result);
	};
}
function _isNativeReflectConstruct$1$1() {
	if (typeof Reflect === "undefined" || !_Reflect$construct$1) return false;
	if (_Reflect$construct$1.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct$1(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* Add an id to given item if it doesn't have one already.

*

* @remarks

* The item will be modified.

* @param item - The item that will have an id after a call to this function.

* @param idProp - The key of the id property.

* @typeParam Item - Item type that may or may not have an id.

* @typeParam IdProp - Name of the property that contains the id.

* @returns true

*/
function ensureFullItem(item, idProp) {
	if (item[idProp] == null) item[idProp] = v4$1();
	return item;
}
/**

* # DataSet

*

* Vis.js comes with a flexible DataSet, which can be used to hold and

* manipulate unstructured data and listen for changes in the data. The DataSet

* is key/value based. Data items can be added, updated and removed from the

* DataSet, and one can subscribe to changes in the DataSet. The data in the

* DataSet can be filtered and ordered. Data can be normalized when appending it

* to the DataSet as well.

*

* ## Example

*

* The following example shows how to use a DataSet.

*

* ```javascript

* // create a DataSet

* var options = {};

* var data = new vis.DataSet(options);

*

* // add items

* // note that the data items can contain different properties and data formats

* data.add([

*   {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},

*   {id: 2, text: 'item 2', date: '2013-06-23', group: 2},

*   {id: 3, text: 'item 3', date: '2013-06-25', group: 2},

*   {id: 4, text: 'item 4'}

* ]);

*

* // subscribe to any change in the DataSet

* data.on('*', function (event, properties, senderId) {

*   console.log('event', event, properties);

* });

*

* // update an existing item

* data.update({id: 2, group: 1});

*

* // remove an item

* data.remove(4);

*

* // get all ids

* var ids = data.getIds();

* console.log('ids', ids);

*

* // get a specific item

* var item1 = data.get(1);

* console.log('item1', item1);

*

* // retrieve a filtered subset of the data

* var items = data.get({

*   filter: function (item) {

*     return item.group == 1;

*   }

* });

* console.log('filtered items', items);

* ```

*

* @typeParam Item - Item type that may or may not have an id.

* @typeParam IdProp - Name of the property that contains the id.

*/
var DataSet = /* @__PURE__ */ function(_DataSetPart) {
	_inherits$1(DataSet$1, _DataSetPart);
	var _super = _createSuper$1$1(DataSet$1);
	/**
	
	* Construct a new DataSet.
	
	*
	
	* @param data - Initial data or options.
	
	* @param options - Options (type error if data is also options).
	
	*/
	function DataSet$1(data$2, options) {
		var _this;
		_classCallCheck$1(this, DataSet$1);
		_this = _super.call(this);
		/** Flush all queued calls. */
		_defineProperty$1(_assertThisInitialized$2(_this), "flush", void 0);
		/** @inheritDoc */
		_defineProperty$1(_assertThisInitialized$2(_this), "length", void 0);
		_defineProperty$1(_assertThisInitialized$2(_this), "_options", void 0);
		_defineProperty$1(_assertThisInitialized$2(_this), "_data", void 0);
		_defineProperty$1(_assertThisInitialized$2(_this), "_idProp", void 0);
		_defineProperty$1(_assertThisInitialized$2(_this), "_queue", null);
		if (data$2 && !_Array$isArray$2(data$2)) {
			options = data$2;
			data$2 = [];
		}
		_this._options = options || {};
		_this._data = new _Map$1();
		_this.length = 0;
		_this._idProp = _this._options.fieldId || "id";
		if (data$2 && data$2.length) _this.add(data$2);
		_this.setOptions(options);
		return _this;
	}
	/**
	
	* Set new options.
	
	*
	
	* @param options - The new options.
	
	*/
	_createClass$1(DataSet$1, [
		{
			key: "idProp",
			get: function get$9() {
				return this._idProp;
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options && options.queue !== void 0) if (options.queue === false) {
					if (this._queue) {
						this._queue.destroy();
						this._queue = null;
					}
				} else {
					if (!this._queue) this._queue = Queue.extend(this, { replace: [
						"add",
						"update",
						"remove"
					] });
					if (options.queue && _typeof$1(options.queue) === "object") this._queue.setOptions(options.queue);
				}
			}
		},
		{
			key: "add",
			value: function add(data$2, senderId) {
				var _this2 = this;
				var addedIds = [];
				var id$4;
				if (_Array$isArray$2(data$2)) {
					var idsToAdd = _mapInstanceProperty$1(data$2).call(data$2, function(d) {
						return d[_this2._idProp];
					});
					if (_someInstanceProperty$1(idsToAdd).call(idsToAdd, function(id$5) {
						return _this2._data.has(id$5);
					})) throw new Error("A duplicate id was found in the parameter array.");
					for (var i$2 = 0, len = data$2.length; i$2 < len; i$2++) {
						id$4 = this._addItem(data$2[i$2]);
						addedIds.push(id$4);
					}
				} else if (data$2 && _typeof$1(data$2) === "object") {
					id$4 = this._addItem(data$2);
					addedIds.push(id$4);
				} else throw new Error("Unknown dataType");
				if (addedIds.length) this._trigger("add", { items: addedIds }, senderId);
				return addedIds;
			}
		},
		{
			key: "update",
			value: function update(data$2, senderId) {
				var _this3 = this;
				var addedIds = [];
				var updatedIds = [];
				var oldData = [];
				var updatedData = [];
				var idProp = this._idProp;
				var addOrUpdate = function addOrUpdate$1(item) {
					var origId = item[idProp];
					if (origId != null && _this3._data.has(origId)) {
						var fullItem = item;
						var oldItem = _Object$assign$1({}, _this3._data.get(origId));
						var id$4 = _this3._updateItem(fullItem);
						updatedIds.push(id$4);
						updatedData.push(fullItem);
						oldData.push(oldItem);
					} else {
						var _id = _this3._addItem(item);
						addedIds.push(_id);
					}
				};
				if (_Array$isArray$2(data$2)) for (var i$2 = 0, len = data$2.length; i$2 < len; i$2++) if (data$2[i$2] && _typeof$1(data$2[i$2]) === "object") addOrUpdate(data$2[i$2]);
				else console.warn("Ignoring input item, which is not an object at index " + i$2);
				else if (data$2 && _typeof$1(data$2) === "object") addOrUpdate(data$2);
				else throw new Error("Unknown dataType");
				if (addedIds.length) this._trigger("add", { items: addedIds }, senderId);
				if (updatedIds.length) {
					var props = {
						items: updatedIds,
						oldData,
						data: updatedData
					};
					this._trigger("update", props, senderId);
				}
				return _concatInstanceProperty$1(addedIds).call(addedIds, updatedIds);
			}
		},
		{
			key: "updateOnly",
			value: function updateOnly(data$2, senderId) {
				var _context, _this4 = this;
				if (!_Array$isArray$2(data$2)) data$2 = [data$2];
				var updateEventData = _mapInstanceProperty$1(_context = _mapInstanceProperty$1(data$2).call(data$2, function(update) {
					var oldData = _this4._data.get(update[_this4._idProp]);
					if (oldData == null) throw new Error("Updating non-existent items is not allowed.");
					return {
						oldData,
						update
					};
				})).call(_context, function(_ref) {
					var oldData = _ref.oldData, update = _ref.update;
					var id$4 = oldData[_this4._idProp];
					var updatedData = pureDeepObjectAssign(oldData, update);
					_this4._data.set(id$4, updatedData);
					return {
						id: id$4,
						oldData,
						updatedData
					};
				});
				if (updateEventData.length) {
					var props = {
						items: _mapInstanceProperty$1(updateEventData).call(updateEventData, function(value) {
							return value.id;
						}),
						oldData: _mapInstanceProperty$1(updateEventData).call(updateEventData, function(value) {
							return value.oldData;
						}),
						data: _mapInstanceProperty$1(updateEventData).call(updateEventData, function(value) {
							return value.updatedData;
						})
					};
					this._trigger("update", props, senderId);
					return props.items;
				} else return [];
			}
		},
		{
			key: "get",
			value: function get$9(first$1, second) {
				var id$4 = void 0;
				var ids = void 0;
				var options = void 0;
				if (isId(first$1)) {
					id$4 = first$1;
					options = second;
				} else if (_Array$isArray$2(first$1)) {
					ids = first$1;
					options = second;
				} else options = first$1;
				var returnType = options && options.returnType === "Object" ? "Object" : "Array";
				var filter$5 = options && _filterInstanceProperty$1(options);
				var items = [];
				var item = void 0;
				var itemIds = void 0;
				var itemId = void 0;
				if (id$4 != null) {
					item = this._data.get(id$4);
					if (item && filter$5 && !filter$5(item)) item = void 0;
				} else if (ids != null) for (var i$2 = 0, len = ids.length; i$2 < len; i$2++) {
					item = this._data.get(ids[i$2]);
					if (item != null && (!filter$5 || filter$5(item))) items.push(item);
				}
				else {
					var _context2;
					itemIds = _toConsumableArray$1(_keysInstanceProperty(_context2 = this._data).call(_context2));
					for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
						itemId = itemIds[_i];
						item = this._data.get(itemId);
						if (item != null && (!filter$5 || filter$5(item))) items.push(item);
					}
				}
				if (options && options.order && id$4 == void 0) this._sort(items, options.order);
				if (options && options.fields) {
					var fields = options.fields;
					if (id$4 != void 0 && item != null) item = this._filterFields(item, fields);
					else for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) items[_i2] = this._filterFields(items[_i2], fields);
				}
				if (returnType == "Object") {
					var result = {};
					for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
						var resultant = items[_i3];
						var _id2 = resultant[this._idProp];
						result[_id2] = resultant;
					}
					return result;
				} else if (id$4 != null) {
					var _item;
					return (_item = item) !== null && _item !== void 0 ? _item : null;
				} else return items;
			}
		},
		{
			key: "getIds",
			value: function getIds(options) {
				var data$2 = this._data;
				var filter$5 = options && _filterInstanceProperty$1(options);
				var order = options && options.order;
				var itemIds = _toConsumableArray$1(_keysInstanceProperty(data$2).call(data$2));
				var ids = [];
				if (filter$5) if (order) {
					var items = [];
					for (var i$2 = 0, len = itemIds.length; i$2 < len; i$2++) {
						var id$4 = itemIds[i$2];
						var item = this._data.get(id$4);
						if (item != null && filter$5(item)) items.push(item);
					}
					this._sort(items, order);
					for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) ids.push(items[_i4][this._idProp]);
				} else for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
					var _id3 = itemIds[_i5];
					var _item2 = this._data.get(_id3);
					if (_item2 != null && filter$5(_item2)) ids.push(_item2[this._idProp]);
				}
				else if (order) {
					var _items = [];
					for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
						var _id4 = itemIds[_i6];
						_items.push(data$2.get(_id4));
					}
					this._sort(_items, order);
					for (var _i7 = 0, _len7 = _items.length; _i7 < _len7; _i7++) ids.push(_items[_i7][this._idProp]);
				} else for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
					var _id5 = itemIds[_i8];
					var _item3 = data$2.get(_id5);
					if (_item3 != null) ids.push(_item3[this._idProp]);
				}
				return ids;
			}
		},
		{
			key: "getDataSet",
			value: function getDataSet() {
				return this;
			}
		},
		{
			key: "forEach",
			value: function forEach$11(callback, options) {
				var filter$5 = options && _filterInstanceProperty$1(options);
				var data$2 = this._data;
				var itemIds = _toConsumableArray$1(_keysInstanceProperty(data$2).call(data$2));
				if (options && options.order) {
					var items = this.get(options);
					for (var i$2 = 0, len = items.length; i$2 < len; i$2++) {
						var item = items[i$2];
						var id$4 = item[this._idProp];
						callback(item, id$4);
					}
				} else for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
					var _id6 = itemIds[_i9];
					var _item4 = this._data.get(_id6);
					if (_item4 != null && (!filter$5 || filter$5(_item4))) callback(_item4, _id6);
				}
			}
		},
		{
			key: "map",
			value: function map$8(callback, options) {
				var filter$5 = options && _filterInstanceProperty$1(options);
				var mappedItems = [];
				var data$2 = this._data;
				var itemIds = _toConsumableArray$1(_keysInstanceProperty(data$2).call(data$2));
				for (var i$2 = 0, len = itemIds.length; i$2 < len; i$2++) {
					var id$4 = itemIds[i$2];
					var item = this._data.get(id$4);
					if (item != null && (!filter$5 || filter$5(item))) mappedItems.push(callback(item, id$4));
				}
				if (options && options.order) this._sort(mappedItems, options.order);
				return mappedItems;
			}
		},
		{
			key: "_filterFields",
			value: function _filterFields(item, fields) {
				var _context3;
				if (!item) return item;
				return _reduceInstanceProperty$1(_context3 = _Array$isArray$2(fields) ? fields : _Object$keys$1(fields)).call(_context3, function(filteredItem, field) {
					filteredItem[field] = item[field];
					return filteredItem;
				}, {});
			}
		},
		{
			key: "_sort",
			value: function _sort(items, order) {
				if (typeof order === "string") {
					var name = order;
					_sortInstanceProperty$1(items).call(items, function(a, b) {
						var av = a[name];
						var bv = b[name];
						return av > bv ? 1 : av < bv ? -1 : 0;
					});
				} else if (typeof order === "function") _sortInstanceProperty$1(items).call(items, order);
				else throw new TypeError("Order must be a function or a string");
			}
		},
		{
			key: "remove",
			value: function remove(id$4, senderId) {
				var removedIds = [];
				var removedItems = [];
				var ids = _Array$isArray$2(id$4) ? id$4 : [id$4];
				for (var i$2 = 0, len = ids.length; i$2 < len; i$2++) {
					var item = this._remove(ids[i$2]);
					if (item) {
						var itemId = item[this._idProp];
						if (itemId != null) {
							removedIds.push(itemId);
							removedItems.push(item);
						}
					}
				}
				if (removedIds.length) this._trigger("remove", {
					items: removedIds,
					oldData: removedItems
				}, senderId);
				return removedIds;
			}
		},
		{
			key: "_remove",
			value: function _remove(id$4) {
				var ident;
				if (isId(id$4)) ident = id$4;
				else if (id$4 && _typeof$1(id$4) === "object") ident = id$4[this._idProp];
				if (ident != null && this._data.has(ident)) {
					var item = this._data.get(ident) || null;
					this._data.delete(ident);
					--this.length;
					return item;
				}
				return null;
			}
		},
		{
			key: "clear",
			value: function clear$1(senderId) {
				var _context4;
				var ids = _toConsumableArray$1(_keysInstanceProperty(_context4 = this._data).call(_context4));
				var items = [];
				for (var i$2 = 0, len = ids.length; i$2 < len; i$2++) items.push(this._data.get(ids[i$2]));
				this._data.clear();
				this.length = 0;
				this._trigger("remove", {
					items: ids,
					oldData: items
				}, senderId);
				return ids;
			}
		},
		{
			key: "max",
			value: function max$5(field) {
				var _context5;
				var max$5 = null;
				var maxField = null;
				var _iterator = _createForOfIteratorHelper$1$1(_valuesInstanceProperty$1(_context5 = this._data).call(_context5)), _step;
				try {
					for (_iterator.s(); !(_step = _iterator.n()).done;) {
						var item = _step.value;
						var itemField = item[field];
						if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
							max$5 = item;
							maxField = itemField;
						}
					}
				} catch (err) {
					_iterator.e(err);
				} finally {
					_iterator.f();
				}
				return max$5 || null;
			}
		},
		{
			key: "min",
			value: function min$4(field) {
				var _context6;
				var min$4 = null;
				var minField = null;
				var _iterator2 = _createForOfIteratorHelper$1$1(_valuesInstanceProperty$1(_context6 = this._data).call(_context6)), _step2;
				try {
					for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
						var item = _step2.value;
						var itemField = item[field];
						if (typeof itemField === "number" && (minField == null || itemField < minField)) {
							min$4 = item;
							minField = itemField;
						}
					}
				} catch (err) {
					_iterator2.e(err);
				} finally {
					_iterator2.f();
				}
				return min$4 || null;
			}
		},
		{
			key: "distinct",
			value: function distinct(prop) {
				var data$2 = this._data;
				var itemIds = _toConsumableArray$1(_keysInstanceProperty(data$2).call(data$2));
				var values$8 = [];
				var count = 0;
				for (var i$2 = 0, len = itemIds.length; i$2 < len; i$2++) {
					var id$4 = itemIds[i$2];
					var item = data$2.get(id$4);
					var value = item[prop];
					var exists = false;
					for (var j = 0; j < count; j++) if (values$8[j] == value) {
						exists = true;
						break;
					}
					if (!exists && value !== void 0) {
						values$8[count] = value;
						count++;
					}
				}
				return values$8;
			}
		},
		{
			key: "_addItem",
			value: function _addItem(item) {
				var fullItem = ensureFullItem(item, this._idProp);
				var id$4 = fullItem[this._idProp];
				if (this._data.has(id$4)) throw new Error("Cannot add item: item with id " + id$4 + " already exists");
				this._data.set(id$4, fullItem);
				++this.length;
				return id$4;
			}
		},
		{
			key: "_updateItem",
			value: function _updateItem(update) {
				var id$4 = update[this._idProp];
				if (id$4 == null) throw new Error("Cannot update item: item has no id (item: " + _JSON$stringify$1(update) + ")");
				var item = this._data.get(id$4);
				if (!item) throw new Error("Cannot update item: no item with id " + id$4 + " found");
				this._data.set(id$4, _objectSpread$4(_objectSpread$4({}, item), update));
				return id$4;
			}
		},
		{
			key: "stream",
			value: function stream(ids) {
				if (ids) {
					var data$2 = this._data;
					return new DataStream(_defineProperty$1({}, _Symbol$iterator$1, /* @__PURE__ */ _regeneratorRuntime.mark(function _callee() {
						var _iterator3, _step3, id$4, item;
						return _regeneratorRuntime.wrap(function _callee$(_context7) {
							while (1) switch (_context7.prev = _context7.next) {
								case 0:
									_iterator3 = _createForOfIteratorHelper$1$1(ids);
									_context7.prev = 1;
									_iterator3.s();
								case 3:
									if ((_step3 = _iterator3.n()).done) {
										_context7.next = 11;
										break;
									}
									id$4 = _step3.value;
									item = data$2.get(id$4);
									if (!(item != null)) {
										_context7.next = 9;
										break;
									}
									_context7.next = 9;
									return [id$4, item];
								case 9:
									_context7.next = 3;
									break;
								case 11:
									_context7.next = 16;
									break;
								case 13:
									_context7.prev = 13;
									_context7.t0 = _context7["catch"](1);
									_iterator3.e(_context7.t0);
								case 16:
									_context7.prev = 16;
									_iterator3.f();
									return _context7.finish(16);
								case 19:
								case "end": return _context7.stop();
							}
						}, _callee, null, [[
							1,
							13,
							16,
							19
						]]);
					})));
				} else {
					var _context8;
					return new DataStream(_defineProperty$1({}, _Symbol$iterator$1, _bindInstanceProperty$1$1(_context8 = _entriesInstanceProperty(this._data)).call(_context8, this._data)));
				}
			}
		}
	]);
	return DataSet$1;
}(DataSetPart);
/**

* Check that given value is compatible with Vis Data Set interface.

*

* @param idProp - The expected property to contain item id.

* @param v - The value to be tested.

* @returns True if all expected values and methods match, false otherwise.

*/
function isDataSetLike(idProp, v) {
	return _typeof$1(v) === "object" && v !== null && idProp === v.idProp && typeof v.add === "function" && typeof v.clear === "function" && typeof v.distinct === "function" && typeof _forEachInstanceProperty$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty$1(v) === "function" && typeof v.max === "function" && typeof v.min === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.remove === "function" && typeof v.setOptions === "function" && typeof v.stream === "function" && typeof v.update === "function" && typeof v.updateOnly === "function";
}
/**

* Check that given value is compatible with Vis Data View interface.

*

* @param idProp - The expected property to contain item id.

* @param v - The value to be tested.

* @returns True if all expected values and methods match, false otherwise.

*/
function isDataViewLike(idProp, v) {
	return _typeof$1(v) === "object" && v !== null && idProp === v.idProp && typeof _forEachInstanceProperty$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty$1(v) === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.stream === "function" && isDataSetLike(idProp, v.getDataSet());
}
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var assignExports = {};
var assign$5 = {
	get exports() {
		return assignExports;
	},
	set exports(v) {
		assignExports = v;
	}
};
var check = function(it$1) {
	return it$1 && it$1.Math == Math && it$1;
};
var global$l = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof commonjsGlobal == "object" && commonjsGlobal) || function() {
	return this;
}() || Function("return this")();
var fails$w = function(exec$4) {
	try {
		return !!exec$4();
	} catch (error) {
		return true;
	}
};
var fails$v = fails$w;
var functionBindNative = !fails$v(function() {
	var test$4 = function() {}.bind();
	return typeof test$4 != "function" || test$4.hasOwnProperty("prototype");
});
var NATIVE_BIND$4 = functionBindNative;
var FunctionPrototype$3 = Function.prototype;
var apply$5 = FunctionPrototype$3.apply;
var call$f = FunctionPrototype$3.call;
var functionApply = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND$4 ? call$f.bind(apply$5) : function() {
	return call$f.apply(apply$5, arguments);
});
var NATIVE_BIND$3 = functionBindNative;
var FunctionPrototype$2 = Function.prototype;
var call$e = FunctionPrototype$2.call;
var uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$2.bind.bind(call$e, call$e);
var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function(fn) {
	return function() {
		return call$e.apply(fn, arguments);
	};
};
var uncurryThis$y = functionUncurryThis;
var toString$c = uncurryThis$y({}.toString);
var stringSlice$1 = uncurryThis$y("".slice);
var classofRaw$2 = function(it$1) {
	return stringSlice$1(toString$c(it$1), 8, -1);
};
var classofRaw$1 = classofRaw$2;
var uncurryThis$x = functionUncurryThis;
var functionUncurryThisClause = function(fn) {
	if (classofRaw$1(fn) === "Function") return uncurryThis$x(fn);
};
var documentAll$2 = typeof document == "object" && document.all;
var IS_HTMLDDA = typeof documentAll$2 == "undefined" && documentAll$2 !== void 0;
var documentAll_1 = {
	all: documentAll$2,
	IS_HTMLDDA
};
var $documentAll$1 = documentAll_1;
var documentAll$1 = $documentAll$1.all;
var isCallable$i = $documentAll$1.IS_HTMLDDA ? function(argument) {
	return typeof argument == "function" || argument === documentAll$1;
} : function(argument) {
	return typeof argument == "function";
};
var objectGetOwnPropertyDescriptor = {};
var fails$u = fails$w;
var descriptors = !fails$u(function() {
	return Object.defineProperty({}, 1, { get: function() {
		return 7;
	} })[1] != 7;
});
var NATIVE_BIND$2 = functionBindNative;
var call$d = Function.prototype.call;
var functionCall = NATIVE_BIND$2 ? call$d.bind(call$d) : function() {
	return call$d.apply(call$d, arguments);
};
var objectPropertyIsEnumerable = {};
var $propertyIsEnumerable$2 = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor$a = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor$a && !$propertyIsEnumerable$2.call({ 1: 2 }, 1);
objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable$1(V) {
	var descriptor = getOwnPropertyDescriptor$a(this, V);
	return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable$2;
var createPropertyDescriptor$5 = function(bitmap, value) {
	return {
		enumerable: !(bitmap & 1),
		configurable: !(bitmap & 2),
		writable: !(bitmap & 4),
		value
	};
};
var uncurryThis$w = functionUncurryThis;
var fails$t = fails$w;
var classof$e = classofRaw$2;
var $Object$5 = Object;
var split = uncurryThis$w("".split);
var indexedObject = fails$t(function() {
	return !$Object$5("z").propertyIsEnumerable(0);
}) ? function(it$1) {
	return classof$e(it$1) == "String" ? split(it$1, "") : $Object$5(it$1);
} : $Object$5;
var isNullOrUndefined$5 = function(it$1) {
	return it$1 === null || it$1 === void 0;
};
var isNullOrUndefined$4 = isNullOrUndefined$5;
var $TypeError$g = TypeError;
var requireObjectCoercible$5 = function(it$1) {
	if (isNullOrUndefined$4(it$1)) throw $TypeError$g("Can't call method on " + it$1);
	return it$1;
};
var IndexedObject$3 = indexedObject;
var requireObjectCoercible$4 = requireObjectCoercible$5;
var toIndexedObject$b = function(it$1) {
	return IndexedObject$3(requireObjectCoercible$4(it$1));
};
var isCallable$h = isCallable$i;
var $documentAll = documentAll_1;
var documentAll = $documentAll.all;
var isObject$j = $documentAll.IS_HTMLDDA ? function(it$1) {
	return typeof it$1 == "object" ? it$1 !== null : isCallable$h(it$1) || it$1 === documentAll;
} : function(it$1) {
	return typeof it$1 == "object" ? it$1 !== null : isCallable$h(it$1);
};
var path$y = {};
var path$x = path$y;
var global$k = global$l;
var isCallable$g = isCallable$i;
var aFunction = function(variable) {
	return isCallable$g(variable) ? variable : void 0;
};
var getBuiltIn$c = function(namespace, method$11) {
	return arguments.length < 2 ? aFunction(path$x[namespace]) || aFunction(global$k[namespace]) : path$x[namespace] && path$x[namespace][method$11] || global$k[namespace] && global$k[namespace][method$11];
};
var uncurryThis$v = functionUncurryThis;
var objectIsPrototypeOf = uncurryThis$v({}.isPrototypeOf);
var engineUserAgent = typeof navigator != "undefined" && String(navigator.userAgent) || "";
var global$j = global$l;
var userAgent$2 = engineUserAgent;
var process$1 = global$j.process;
var Deno$1 = global$j.Deno;
var versions = process$1 && process$1.versions || Deno$1 && Deno$1.version;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
	match = v8.split(".");
	version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}
if (!version && userAgent$2) {
	match = userAgent$2.match(/Edge\/(\d+)/);
	if (!match || match[1] >= 74) {
		match = userAgent$2.match(/Chrome\/(\d+)/);
		if (match) version = +match[1];
	}
}
var engineV8Version = version;
var V8_VERSION$2 = engineV8Version;
var fails$s = fails$w;
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$s(function() {
	var symbol$8 = Symbol();
	return !String(symbol$8) || !(Object(symbol$8) instanceof Symbol) || !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
});
var NATIVE_SYMBOL$5 = symbolConstructorDetection;
var useSymbolAsUid = NATIVE_SYMBOL$5 && !Symbol.sham && typeof Symbol.iterator == "symbol";
var getBuiltIn$b = getBuiltIn$c;
var isCallable$f = isCallable$i;
var isPrototypeOf$k = objectIsPrototypeOf;
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
var $Object$4 = Object;
var isSymbol$5 = USE_SYMBOL_AS_UID$1 ? function(it$1) {
	return typeof it$1 == "symbol";
} : function(it$1) {
	var $Symbol$2 = getBuiltIn$b("Symbol");
	return isCallable$f($Symbol$2) && isPrototypeOf$k($Symbol$2.prototype, $Object$4(it$1));
};
var $String$4 = String;
var tryToString$6 = function(argument) {
	try {
		return $String$4(argument);
	} catch (error) {
		return "Object";
	}
};
var isCallable$e = isCallable$i;
var tryToString$5 = tryToString$6;
var $TypeError$f = TypeError;
var aCallable$7 = function(argument) {
	if (isCallable$e(argument)) return argument;
	throw $TypeError$f(tryToString$5(argument) + " is not a function");
};
var aCallable$6 = aCallable$7;
var isNullOrUndefined$3 = isNullOrUndefined$5;
var getMethod$3 = function(V, P) {
	var func = V[P];
	return isNullOrUndefined$3(func) ? void 0 : aCallable$6(func);
};
var call$c = functionCall;
var isCallable$d = isCallable$i;
var isObject$i = isObject$j;
var $TypeError$e = TypeError;
var ordinaryToPrimitive$1 = function(input, pref) {
	var fn, val;
	if (pref === "string" && isCallable$d(fn = input.toString) && !isObject$i(val = call$c(fn, input))) return val;
	if (isCallable$d(fn = input.valueOf) && !isObject$i(val = call$c(fn, input))) return val;
	if (pref !== "string" && isCallable$d(fn = input.toString) && !isObject$i(val = call$c(fn, input))) return val;
	throw $TypeError$e("Can't convert object to primitive value");
};
var sharedExports = {};
var shared$7 = {
	get exports() {
		return sharedExports;
	},
	set exports(v) {
		sharedExports = v;
	}
};
var global$i = global$l;
var defineProperty$f = Object.defineProperty;
var defineGlobalProperty$1 = function(key, value) {
	try {
		defineProperty$f(global$i, key, {
			value,
			configurable: true,
			writable: true
		});
	} catch (error) {
		global$i[key] = value;
	}
	return value;
};
var global$h = global$l;
var defineGlobalProperty = defineGlobalProperty$1;
var SHARED = "__core-js_shared__";
var store$3 = global$h[SHARED] || defineGlobalProperty(SHARED, {});
var sharedStore = store$3;
var store$2 = sharedStore;
(shared$7.exports = function(key, value) {
	return store$2[key] || (store$2[key] = value !== void 0 ? value : {});
})("versions", []).push({
	version: "3.29.0",
	mode: "pure",
	copyright: "© 2014-2023 Denis Pushkarev (zloirock.ru)",
	license: "https://github.com/zloirock/core-js/blob/v3.29.0/LICENSE",
	source: "https://github.com/zloirock/core-js"
});
var requireObjectCoercible$3 = requireObjectCoercible$5;
var $Object$3 = Object;
var toObject$d = function(argument) {
	return $Object$3(requireObjectCoercible$3(argument));
};
var uncurryThis$u = functionUncurryThis;
var toObject$c = toObject$d;
var hasOwnProperty = uncurryThis$u({}.hasOwnProperty);
var hasOwnProperty_1 = Object.hasOwn || function hasOwn$11(it$1, key) {
	return hasOwnProperty(toObject$c(it$1), key);
};
var uncurryThis$t = functionUncurryThis;
var id$2 = 0;
var postfix = Math.random();
var toString$b = uncurryThis$t(1 .toString);
var uid$4 = function(key) {
	return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString$b(++id$2 + postfix, 36);
};
var global$g = global$l;
var shared$6 = sharedExports;
var hasOwn$h = hasOwnProperty_1;
var uid$3 = uid$4;
var NATIVE_SYMBOL$4 = symbolConstructorDetection;
var USE_SYMBOL_AS_UID = useSymbolAsUid;
var Symbol$5 = global$g.Symbol;
var WellKnownSymbolsStore$2 = shared$6("wks");
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$5["for"] || Symbol$5 : Symbol$5 && Symbol$5.withoutSetter || uid$3;
var wellKnownSymbol$l = function(name) {
	if (!hasOwn$h(WellKnownSymbolsStore$2, name)) WellKnownSymbolsStore$2[name] = NATIVE_SYMBOL$4 && hasOwn$h(Symbol$5, name) ? Symbol$5[name] : createWellKnownSymbol("Symbol." + name);
	return WellKnownSymbolsStore$2[name];
};
var call$b = functionCall;
var isObject$h = isObject$j;
var isSymbol$4 = isSymbol$5;
var getMethod$2 = getMethod$3;
var ordinaryToPrimitive = ordinaryToPrimitive$1;
var wellKnownSymbol$k = wellKnownSymbol$l;
var $TypeError$d = TypeError;
var TO_PRIMITIVE = wellKnownSymbol$k("toPrimitive");
var toPrimitive$7 = function(input, pref) {
	if (!isObject$h(input) || isSymbol$4(input)) return input;
	var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
	var result;
	if (exoticToPrim) {
		if (pref === void 0) pref = "default";
		result = call$b(exoticToPrim, input, pref);
		if (!isObject$h(result) || isSymbol$4(result)) return result;
		throw $TypeError$d("Can't convert object to primitive value");
	}
	if (pref === void 0) pref = "number";
	return ordinaryToPrimitive(input, pref);
};
var toPrimitive$6 = toPrimitive$7;
var isSymbol$3 = isSymbol$5;
var toPropertyKey$4 = function(argument) {
	var key = toPrimitive$6(argument, "string");
	return isSymbol$3(key) ? key : key + "";
};
var global$f = global$l;
var isObject$g = isObject$j;
var document$1 = global$f.document;
var EXISTS$1 = isObject$g(document$1) && isObject$g(document$1.createElement);
var documentCreateElement$1 = function(it$1) {
	return EXISTS$1 ? document$1.createElement(it$1) : {};
};
var DESCRIPTORS$i = descriptors;
var fails$r = fails$w;
var createElement = documentCreateElement$1;
var ie8DomDefine = !DESCRIPTORS$i && !fails$r(function() {
	return Object.defineProperty(createElement("div"), "a", { get: function() {
		return 7;
	} }).a != 7;
});
var DESCRIPTORS$h = descriptors;
var call$a = functionCall;
var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable;
var createPropertyDescriptor$4 = createPropertyDescriptor$5;
var toIndexedObject$a = toIndexedObject$b;
var toPropertyKey$3 = toPropertyKey$4;
var hasOwn$g = hasOwnProperty_1;
var IE8_DOM_DEFINE$1 = ie8DomDefine;
var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$h ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor$11(O, P) {
	O = toIndexedObject$a(O);
	P = toPropertyKey$3(P);
	if (IE8_DOM_DEFINE$1) try {
		return $getOwnPropertyDescriptor$2(O, P);
	} catch (error) {}
	if (hasOwn$g(O, P)) return createPropertyDescriptor$4(!call$a(propertyIsEnumerableModule$2.f, O, P), O[P]);
};
var fails$q = fails$w;
var isCallable$c = isCallable$i;
var replacement = /#|\.prototype\./;
var isForced$1 = function(feature, detection) {
	var value = data[normalize(feature)];
	return value == POLYFILL ? true : value == NATIVE ? false : isCallable$c(detection) ? fails$q(detection) : !!detection;
};
var normalize = isForced$1.normalize = function(string$1) {
	return String(string$1).replace(replacement, ".").toLowerCase();
};
var data = isForced$1.data = {};
var NATIVE = isForced$1.NATIVE = "N";
var POLYFILL = isForced$1.POLYFILL = "P";
var isForced_1 = isForced$1;
var uncurryThis$s = functionUncurryThisClause;
var aCallable$5 = aCallable$7;
var NATIVE_BIND$1 = functionBindNative;
var bind$f = uncurryThis$s(uncurryThis$s.bind);
var functionBindContext = function(fn, that) {
	aCallable$5(fn);
	return that === void 0 ? fn : NATIVE_BIND$1 ? bind$f(fn, that) : function() {
		return fn.apply(that, arguments);
	};
};
var objectDefineProperty = {};
var DESCRIPTORS$g = descriptors;
var fails$p = fails$w;
var v8PrototypeDefineBug = DESCRIPTORS$g && fails$p(function() {
	return Object.defineProperty(function() {}, "prototype", {
		value: 42,
		writable: false
	}).prototype != 42;
});
var isObject$f = isObject$j;
var $String$3 = String;
var $TypeError$c = TypeError;
var anObject$d = function(argument) {
	if (isObject$f(argument)) return argument;
	throw $TypeError$c($String$3(argument) + " is not an object");
};
var DESCRIPTORS$f = descriptors;
var IE8_DOM_DEFINE = ie8DomDefine;
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
var anObject$c = anObject$d;
var toPropertyKey$2 = toPropertyKey$4;
var $TypeError$b = TypeError;
var $defineProperty$1 = Object.defineProperty;
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
var ENUMERABLE = "enumerable";
var CONFIGURABLE$1 = "configurable";
var WRITABLE = "writable";
objectDefineProperty.f = DESCRIPTORS$f ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty$11(O, P, Attributes) {
	anObject$c(O);
	P = toPropertyKey$2(P);
	anObject$c(Attributes);
	if (typeof O === "function" && P === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
		var current = $getOwnPropertyDescriptor$1(O, P);
		if (current && current[WRITABLE]) {
			O[P] = Attributes.value;
			Attributes = {
				configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
				enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
				writable: false
			};
		}
	}
	return $defineProperty$1(O, P, Attributes);
} : $defineProperty$1 : function defineProperty$11(O, P, Attributes) {
	anObject$c(O);
	P = toPropertyKey$2(P);
	anObject$c(Attributes);
	if (IE8_DOM_DEFINE) try {
		return $defineProperty$1(O, P, Attributes);
	} catch (error) {}
	if ("get" in Attributes || "set" in Attributes) throw $TypeError$b("Accessors not supported");
	if ("value" in Attributes) O[P] = Attributes.value;
	return O;
};
var DESCRIPTORS$e = descriptors;
var definePropertyModule$3 = objectDefineProperty;
var createPropertyDescriptor$3 = createPropertyDescriptor$5;
var createNonEnumerableProperty$6 = DESCRIPTORS$e ? function(object$1, key, value) {
	return definePropertyModule$3.f(object$1, key, createPropertyDescriptor$3(1, value));
} : function(object$1, key, value) {
	object$1[key] = value;
	return object$1;
};
var global$e = global$l;
var apply$4 = functionApply;
var uncurryThis$r = functionUncurryThisClause;
var isCallable$b = isCallable$i;
var getOwnPropertyDescriptor$9 = objectGetOwnPropertyDescriptor.f;
var isForced = isForced_1;
var path$w = path$y;
var bind$e = functionBindContext;
var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
var hasOwn$f = hasOwnProperty_1;
var wrapConstructor = function(NativeConstructor) {
	var Wrapper = function(a, b, c$1) {
		if (this instanceof Wrapper) {
			switch (arguments.length) {
				case 0: return new NativeConstructor();
				case 1: return new NativeConstructor(a);
				case 2: return new NativeConstructor(a, b);
			}
			return new NativeConstructor(a, b, c$1);
		}
		return apply$4(NativeConstructor, this, arguments);
	};
	Wrapper.prototype = NativeConstructor.prototype;
	return Wrapper;
};
var _export = function(options, source) {
	var TARGET = options.target;
	var GLOBAL = options.global;
	var STATIC = options.stat;
	var PROTO = options.proto;
	var nativeSource = GLOBAL ? global$e : STATIC ? global$e[TARGET] : (global$e[TARGET] || {}).prototype;
	var target = GLOBAL ? path$w : path$w[TARGET] || createNonEnumerableProperty$5(path$w, TARGET, {})[TARGET];
	var targetPrototype = target.prototype;
	var FORCED$11, USE_NATIVE, VIRTUAL_PROTOTYPE;
	var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
	for (key in source) {
		FORCED$11 = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
		USE_NATIVE = !FORCED$11 && nativeSource && hasOwn$f(nativeSource, key);
		targetProperty = target[key];
		if (USE_NATIVE) if (options.dontCallGetSet) {
			descriptor = getOwnPropertyDescriptor$9(nativeSource, key);
			nativeProperty = descriptor && descriptor.value;
		} else nativeProperty = nativeSource[key];
		sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
		if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
		if (options.bind && USE_NATIVE) resultProperty = bind$e(sourceProperty, global$e);
		else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
		else if (PROTO && isCallable$b(sourceProperty)) resultProperty = uncurryThis$r(sourceProperty);
		else resultProperty = sourceProperty;
		if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) createNonEnumerableProperty$5(resultProperty, "sham", true);
		createNonEnumerableProperty$5(target, key, resultProperty);
		if (PROTO) {
			VIRTUAL_PROTOTYPE = TARGET + "Prototype";
			if (!hasOwn$f(path$w, VIRTUAL_PROTOTYPE)) createNonEnumerableProperty$5(path$w, VIRTUAL_PROTOTYPE, {});
			createNonEnumerableProperty$5(path$w[VIRTUAL_PROTOTYPE], key, sourceProperty);
			if (options.real && targetPrototype && (FORCED$11 || !targetPrototype[key])) createNonEnumerableProperty$5(targetPrototype, key, sourceProperty);
		}
	}
};
var ceil = Math.ceil;
var floor$1 = Math.floor;
var mathTrunc = Math.trunc || function trunc$2(x) {
	var n = +x;
	return (n > 0 ? floor$1 : ceil)(n);
};
var trunc = mathTrunc;
var toIntegerOrInfinity$4 = function(argument) {
	var number$1 = +argument;
	return number$1 !== number$1 || number$1 === 0 ? 0 : trunc(number$1);
};
var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
var max$3 = Math.max;
var min$2 = Math.min;
var toAbsoluteIndex$5 = function(index$1, length$1) {
	var integer = toIntegerOrInfinity$3(index$1);
	return integer < 0 ? max$3(integer + length$1, 0) : min$2(integer, length$1);
};
var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
var min$1 = Math.min;
var toLength$1 = function(argument) {
	return argument > 0 ? min$1(toIntegerOrInfinity$2(argument), 9007199254740991) : 0;
};
var toLength = toLength$1;
var lengthOfArrayLike$b = function(obj) {
	return toLength(obj.length);
};
var toIndexedObject$9 = toIndexedObject$b;
var toAbsoluteIndex$4 = toAbsoluteIndex$5;
var lengthOfArrayLike$a = lengthOfArrayLike$b;
var createMethod$5 = function(IS_INCLUDES) {
	return function($this, el, fromIndex) {
		var O = toIndexedObject$9($this);
		var length$1 = lengthOfArrayLike$a(O);
		var index$1 = toAbsoluteIndex$4(fromIndex, length$1);
		var value;
		if (IS_INCLUDES && el != el) while (length$1 > index$1) {
			value = O[index$1++];
			if (value != value) return true;
		}
		else for (; length$1 > index$1; index$1++) if ((IS_INCLUDES || index$1 in O) && O[index$1] === el) return IS_INCLUDES || index$1 || 0;
		return !IS_INCLUDES && -1;
	};
};
var arrayIncludes = {
	includes: createMethod$5(true),
	indexOf: createMethod$5(false)
};
var hiddenKeys$6 = {};
var uncurryThis$q = functionUncurryThis;
var hasOwn$e = hasOwnProperty_1;
var toIndexedObject$8 = toIndexedObject$b;
var indexOf$4 = arrayIncludes.indexOf;
var hiddenKeys$5 = hiddenKeys$6;
var push$6 = uncurryThis$q([].push);
var objectKeysInternal = function(object$1, names) {
	var O = toIndexedObject$8(object$1);
	var i$2 = 0;
	var result = [];
	var key;
	for (key in O) !hasOwn$e(hiddenKeys$5, key) && hasOwn$e(O, key) && push$6(result, key);
	while (names.length > i$2) if (hasOwn$e(O, key = names[i$2++])) ~indexOf$4(result, key) || push$6(result, key);
	return result;
};
var enumBugKeys$3 = [
	"constructor",
	"hasOwnProperty",
	"isPrototypeOf",
	"propertyIsEnumerable",
	"toLocaleString",
	"toString",
	"valueOf"
];
var internalObjectKeys$1 = objectKeysInternal;
var enumBugKeys$2 = enumBugKeys$3;
var objectKeys$4 = Object.keys || function keys$9(O) {
	return internalObjectKeys$1(O, enumBugKeys$2);
};
var objectGetOwnPropertySymbols = {};
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
var DESCRIPTORS$d = descriptors;
var uncurryThis$p = functionUncurryThis;
var call$9 = functionCall;
var fails$o = fails$w;
var objectKeys$3 = objectKeys$4;
var getOwnPropertySymbolsModule$3 = objectGetOwnPropertySymbols;
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
var toObject$b = toObject$d;
var IndexedObject$2 = indexedObject;
var $assign = Object.assign;
var defineProperty$e = Object.defineProperty;
var concat$6 = uncurryThis$p([].concat);
var objectAssign = !$assign || fails$o(function() {
	if (DESCRIPTORS$d && $assign({ b: 1 }, $assign(defineProperty$e({}, "a", {
		enumerable: true,
		get: function() {
			defineProperty$e(this, "b", {
				value: 3,
				enumerable: false
			});
		}
	}), { b: 2 })).b !== 1) return true;
	var A = {};
	var B = {};
	var symbol$8 = Symbol();
	var alphabet = "abcdefghijklmnopqrst";
	A[symbol$8] = 7;
	alphabet.split("").forEach(function(chr) {
		B[chr] = chr;
	});
	return $assign({}, A)[symbol$8] != 7 || objectKeys$3($assign({}, B)).join("") != alphabet;
}) ? function assign$7(target, source) {
	var T = toObject$b(target);
	var argumentsLength = arguments.length;
	var index$1 = 1;
	var getOwnPropertySymbols$4 = getOwnPropertySymbolsModule$3.f;
	var propertyIsEnumerable$1 = propertyIsEnumerableModule$1.f;
	while (argumentsLength > index$1) {
		var S = IndexedObject$2(arguments[index$1++]);
		var keys$9 = getOwnPropertySymbols$4 ? concat$6(objectKeys$3(S), getOwnPropertySymbols$4(S)) : objectKeys$3(S);
		var length$1 = keys$9.length;
		var j = 0;
		var key;
		while (length$1 > j) {
			key = keys$9[j++];
			if (!DESCRIPTORS$d || call$9(propertyIsEnumerable$1, S, key)) T[key] = S[key];
		}
	}
	return T;
} : $assign;
var $$O = _export;
var assign$4 = objectAssign;
$$O({
	target: "Object",
	stat: true,
	arity: 2,
	forced: Object.assign !== assign$4
}, { assign: assign$4 });
var path$v = path$y;
var assign$3 = path$v.Object.assign;
var parent$1b = assign$3;
var assign$2 = parent$1b;
(function(module) {
	module.exports = assign$2;
})(assign$5);
var _Object$assign = /* @__PURE__ */ getDefaultExportFromCjs(assignExports);
var bindExports$2 = {};
var bind$d = {
	get exports() {
		return bindExports$2;
	},
	set exports(v) {
		bindExports$2 = v;
	}
};
var uncurryThis$o = functionUncurryThis;
var arraySlice$5 = uncurryThis$o([].slice);
var uncurryThis$n = functionUncurryThis;
var aCallable$4 = aCallable$7;
var isObject$e = isObject$j;
var hasOwn$d = hasOwnProperty_1;
var arraySlice$4 = arraySlice$5;
var NATIVE_BIND = functionBindNative;
var $Function = Function;
var concat$5 = uncurryThis$n([].concat);
var join = uncurryThis$n([].join);
var factories = {};
var construct$4 = function(C, argsLength, args) {
	if (!hasOwn$d(factories, argsLength)) {
		for (var list = [], i$2 = 0; i$2 < argsLength; i$2++) list[i$2] = "a[" + i$2 + "]";
		factories[argsLength] = $Function("C,a", "return new C(" + join(list, ",") + ")");
	}
	return factories[argsLength](C, args);
};
var functionBind = NATIVE_BIND ? $Function.bind : function bind$11(that) {
	var F = aCallable$4(this);
	var Prototype = F.prototype;
	var partArgs = arraySlice$4(arguments, 1);
	var boundFunction = function bound() {
		var args = concat$5(partArgs, arraySlice$4(arguments));
		return this instanceof boundFunction ? construct$4(F, args.length, args) : F.apply(that, args);
	};
	if (isObject$e(Prototype)) boundFunction.prototype = Prototype;
	return boundFunction;
};
var $$N = _export;
var bind$c = functionBind;
$$N({
	target: "Function",
	proto: true,
	forced: Function.bind !== bind$c
}, { bind: bind$c });
var path$u = path$y;
var entryVirtual$i = function(CONSTRUCTOR) {
	return path$u[CONSTRUCTOR + "Prototype"];
};
var entryVirtual$h = entryVirtual$i;
var bind$b = entryVirtual$h("Function").bind;
var isPrototypeOf$j = objectIsPrototypeOf;
var method$f = bind$b;
var FunctionPrototype$1 = Function.prototype;
var bind$a = function(it$1) {
	var own = it$1.bind;
	return it$1 === FunctionPrototype$1 || isPrototypeOf$j(FunctionPrototype$1, it$1) && own === FunctionPrototype$1.bind ? method$f : own;
};
var parent$1a = bind$a;
var bind$9 = parent$1a;
(function(module) {
	module.exports = bind$9;
})(bind$d);
var _bindInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs(bindExports$2);
/**

* Draw a circle.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - The radius of the circle.

*/
function drawCircle(ctx, x, y, r) {
	ctx.beginPath();
	ctx.arc(x, y, r, 0, 2 * Math.PI, false);
	ctx.closePath();
}
/**

* Draw a square.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - Half of the width and height of the square.

*/
function drawSquare(ctx, x, y, r) {
	ctx.beginPath();
	ctx.rect(x - r, y - r, r * 2, r * 2);
	ctx.closePath();
}
/**

* Draw an equilateral triangle standing on a side.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - Half of the length of the sides.

* @remarks

* http://en.wikipedia.org/wiki/Equilateral_triangle

*/
function drawTriangle(ctx, x, y, r) {
	ctx.beginPath();
	r *= 1.15;
	y += .275 * r;
	var s = r * 2;
	var s2 = s / 2;
	var ir = Math.sqrt(3) / 6 * s;
	var h = Math.sqrt(s * s - s2 * s2);
	ctx.moveTo(x, y - (h - ir));
	ctx.lineTo(x + s2, y + ir);
	ctx.lineTo(x - s2, y + ir);
	ctx.lineTo(x, y - (h - ir));
	ctx.closePath();
}
/**

* Draw an equilateral triangle standing on a vertex.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - Half of the length of the sides.

* @remarks

* http://en.wikipedia.org/wiki/Equilateral_triangle

*/
function drawTriangleDown(ctx, x, y, r) {
	ctx.beginPath();
	r *= 1.15;
	y -= .275 * r;
	var s = r * 2;
	var s2 = s / 2;
	var ir = Math.sqrt(3) / 6 * s;
	var h = Math.sqrt(s * s - s2 * s2);
	ctx.moveTo(x, y + (h - ir));
	ctx.lineTo(x + s2, y - ir);
	ctx.lineTo(x - s2, y - ir);
	ctx.lineTo(x, y + (h - ir));
	ctx.closePath();
}
/**

* Draw a star.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - The outer radius of the star.

*/
function drawStar(ctx, x, y, r) {
	ctx.beginPath();
	r *= .82;
	y += .1 * r;
	for (var n = 0; n < 10; n++) {
		var radius = n % 2 === 0 ? r * 1.3 : r * .5;
		ctx.lineTo(x + radius * Math.sin(n * 2 * Math.PI / 10), y - radius * Math.cos(n * 2 * Math.PI / 10));
	}
	ctx.closePath();
}
/**

* Draw a diamond.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - Half of the width and height of the diamond.

* @remarks

* http://www.html5canvastutorials.com/labs/html5-canvas-star-spinner/

*/
function drawDiamond(ctx, x, y, r) {
	ctx.beginPath();
	ctx.lineTo(x, y + r);
	ctx.lineTo(x + r, y);
	ctx.lineTo(x, y - r);
	ctx.lineTo(x - r, y);
	ctx.closePath();
}
/**

* Draw a rectangle with rounded corners.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param w - The width of the rectangle.

* @param h - The height of the rectangle.

* @param r - The radius of the corners.

* @remarks

* http://stackoverflow.com/questions/1255512/how-to-draw-a-rounded-rectangle-on-html-canvas

*/
function drawRoundRect(ctx, x, y, w, h, r) {
	var r2d = Math.PI / 180;
	if (w - 2 * r < 0) r = w / 2;
	if (h - 2 * r < 0) r = h / 2;
	ctx.beginPath();
	ctx.moveTo(x + r, y);
	ctx.lineTo(x + w - r, y);
	ctx.arc(x + w - r, y + r, r, r2d * 270, r2d * 360, false);
	ctx.lineTo(x + w, y + h - r);
	ctx.arc(x + w - r, y + h - r, r, 0, r2d * 90, false);
	ctx.lineTo(x + r, y + h);
	ctx.arc(x + r, y + h - r, r, r2d * 90, r2d * 180, false);
	ctx.lineTo(x, y + r);
	ctx.arc(x + r, y + r, r, r2d * 180, r2d * 270, false);
	ctx.closePath();
}
/**

* Draw an ellipse.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param w - The width of the ellipse.

* @param h - The height of the ellipse.

* @remarks

* http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas

*

* Postfix '_vis' added to discern it from standard method ellipse().

*/
function drawEllipse(ctx, x, y, w, h) {
	var kappa = .5522848, ox = w / 2 * kappa, oy = h / 2 * kappa, xe = x + w, ye = y + h, xm = x + w / 2, ym = y + h / 2;
	ctx.beginPath();
	ctx.moveTo(x, ym);
	ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
	ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
	ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
	ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
	ctx.closePath();
}
/**

* Draw an isometric cylinder.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param w - The width of the database.

* @param h - The height of the database.

* @remarks

* http://stackoverflow.com/questions/2172798/how-to-draw-an-oval-in-html5-canvas

*/
function drawDatabase(ctx, x, y, w, h) {
	var f = 1 / 3;
	var wEllipse = w;
	var hEllipse = h * f;
	var kappa = .5522848, ox = wEllipse / 2 * kappa, oy = hEllipse / 2 * kappa, xe = x + wEllipse, ye = y + hEllipse, xm = x + wEllipse / 2, ym = y + hEllipse / 2, ymb = y + (h - hEllipse / 2), yeb = y + h;
	ctx.beginPath();
	ctx.moveTo(xe, ym);
	ctx.bezierCurveTo(xe, ym + oy, xm + ox, ye, xm, ye);
	ctx.bezierCurveTo(xm - ox, ye, x, ym + oy, x, ym);
	ctx.bezierCurveTo(x, ym - oy, xm - ox, y, xm, y);
	ctx.bezierCurveTo(xm + ox, y, xe, ym - oy, xe, ym);
	ctx.lineTo(xe, ymb);
	ctx.bezierCurveTo(xe, ymb + oy, xm + ox, yeb, xm, yeb);
	ctx.bezierCurveTo(xm - ox, yeb, x, ymb + oy, x, ymb);
	ctx.lineTo(x, ym);
}
/**

* Draw a dashed line.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The start position on the x axis.

* @param y - The start position on the y axis.

* @param x2 - The end position on the x axis.

* @param y2 - The end position on the y axis.

* @param pattern - List of lengths starting with line and then alternating between space and line.

* @author David Jordan

* @remarks

* date 2012-08-08

* http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas

*/
function drawDashedLine(ctx, x, y, x2, y2, pattern) {
	ctx.beginPath();
	ctx.moveTo(x, y);
	var patternLength = pattern.length;
	var dx = x2 - x;
	var dy = y2 - y;
	var slope = dy / dx;
	var distRemaining = Math.sqrt(dx * dx + dy * dy);
	var patternIndex = 0;
	var draw = true;
	var xStep = 0;
	var dashLength = +pattern[0];
	while (distRemaining >= .1) {
		dashLength = +pattern[patternIndex++ % patternLength];
		if (dashLength > distRemaining) dashLength = distRemaining;
		xStep = Math.sqrt(dashLength * dashLength / (1 + slope * slope));
		xStep = dx < 0 ? -xStep : xStep;
		x += xStep;
		y += slope * xStep;
		if (draw === true) ctx.lineTo(x, y);
		else ctx.moveTo(x, y);
		distRemaining -= dashLength;
		draw = !draw;
	}
}
/**

* Draw a hexagon.

*

* @param ctx - The context this shape will be rendered to.

* @param x - The position of the center on the x axis.

* @param y - The position of the center on the y axis.

* @param r - The radius of the hexagon.

*/
function drawHexagon(ctx, x, y, r) {
	ctx.beginPath();
	var sides = 6;
	var a = Math.PI * 2 / sides;
	ctx.moveTo(x + r, y);
	for (var i$2 = 1; i$2 < sides; i$2++) ctx.lineTo(x + r * Math.cos(a * i$2), y + r * Math.sin(a * i$2));
	ctx.closePath();
}
var shapeMap = {
	circle: drawCircle,
	dashedLine: drawDashedLine,
	database: drawDatabase,
	diamond: drawDiamond,
	ellipse: drawEllipse,
	ellipse_vis: drawEllipse,
	hexagon: drawHexagon,
	roundRect: drawRoundRect,
	square: drawSquare,
	star: drawStar,
	triangle: drawTriangle,
	triangleDown: drawTriangleDown
};
/**

* Returns either custom or native drawing function base on supplied name.

*

* @param name - The name of the function. Either the name of a

* CanvasRenderingContext2D property or an export from shapes.ts without the

* draw prefix.

* @returns The function that can be used for rendering. In case of native

* CanvasRenderingContext2D function the API is normalized to

* `(ctx: CanvasRenderingContext2D, ...originalArgs) => void`.

*/
function getShape(name) {
	if (Object.prototype.hasOwnProperty.call(shapeMap, name)) return shapeMap[name];
	else return function(ctx) {
		for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
		CanvasRenderingContext2D.prototype[name].call(ctx, args);
	};
}
var componentEmitterExports = {};
var componentEmitter = {
	get exports() {
		return componentEmitterExports;
	},
	set exports(v) {
		componentEmitterExports = v;
	}
};
(function(module) {
	module.exports = Emitter$2;
	/**
	
	* Initialize a new `Emitter`.
	
	*
	
	* @api public
	
	*/
	function Emitter$2(obj) {
		if (obj) return mixin(obj);
	}
	/**
	
	* Mixin the emitter properties.
	
	*
	
	* @param {Object} obj
	
	* @return {Object}
	
	* @api private
	
	*/
	function mixin(obj) {
		for (var key in Emitter$2.prototype) obj[key] = Emitter$2.prototype[key];
		return obj;
	}
	/**
	
	* Listen on the given `event` with `fn`.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.on = Emitter$2.prototype.addEventListener = function(event, fn) {
		this._callbacks = this._callbacks || {};
		(this._callbacks["$" + event] = this._callbacks["$" + event] || []).push(fn);
		return this;
	};
	/**
	
	* Adds an `event` listener that will be invoked a single
	
	* time then automatically removed.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.once = function(event, fn) {
		function on() {
			this.off(event, on);
			fn.apply(this, arguments);
		}
		on.fn = fn;
		this.on(event, on);
		return this;
	};
	/**
	
	* Remove the given callback for `event` or all
	
	* registered callbacks.
	
	*
	
	* @param {String} event
	
	* @param {Function} fn
	
	* @return {Emitter}
	
	* @api public
	
	*/
	Emitter$2.prototype.off = Emitter$2.prototype.removeListener = Emitter$2.prototype.removeAllListeners = Emitter$2.prototype.removeEventListener = function(event, fn) {
		this._callbacks = this._callbacks || {};
		if (0 == arguments.length) {
			this._callbacks = {};
			return this;
		}
		var callbacks = this._callbacks["$" + event];
		if (!callbacks) return this;
		if (1 == arguments.length) {
			delete this._callbacks["$" + event];
			return this;
		}
		var cb;
		for (var i$2 = 0; i$2 < callbacks.length; i$2++) {
			cb = callbacks[i$2];
			if (cb === fn || cb.fn === fn) {
				callbacks.splice(i$2, 1);
				break;
			}
		}
		if (callbacks.length === 0) delete this._callbacks["$" + event];
		return this;
	};
	/**
	
	* Emit `event` with the given args.
	
	*
	
	* @param {String} event
	
	* @param {Mixed} ...
	
	* @return {Emitter}
	
	*/
	Emitter$2.prototype.emit = function(event) {
		this._callbacks = this._callbacks || {};
		var args = new Array(arguments.length - 1), callbacks = this._callbacks["$" + event];
		for (var i$2 = 1; i$2 < arguments.length; i$2++) args[i$2 - 1] = arguments[i$2];
		if (callbacks) {
			callbacks = callbacks.slice(0);
			for (var i$2 = 0, len = callbacks.length; i$2 < len; ++i$2) callbacks[i$2].apply(this, args);
		}
		return this;
	};
	/**
	
	* Return array of callbacks for `event`.
	
	*
	
	* @param {String} event
	
	* @return {Array}
	
	* @api public
	
	*/
	Emitter$2.prototype.listeners = function(event) {
		this._callbacks = this._callbacks || {};
		return this._callbacks["$" + event] || [];
	};
	/**
	
	* Check if this emitter has `event` handlers.
	
	*
	
	* @param {String} event
	
	* @return {Boolean}
	
	* @api public
	
	*/
	Emitter$2.prototype.hasListeners = function(event) {
		return !!this.listeners(event).length;
	};
})(componentEmitter);
var Emitter = componentEmitterExports;
var fromExports$2 = {};
var from$7 = {
	get exports() {
		return fromExports$2;
	},
	set exports(v) {
		fromExports$2 = v;
	}
};
var wellKnownSymbol$j = wellKnownSymbol$l;
var TO_STRING_TAG$3 = wellKnownSymbol$j("toStringTag");
var test$2 = {};
test$2[TO_STRING_TAG$3] = "z";
var toStringTagSupport = String(test$2) === "[object z]";
var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
var isCallable$a = isCallable$i;
var classofRaw = classofRaw$2;
var wellKnownSymbol$i = wellKnownSymbol$l;
var TO_STRING_TAG$2 = wellKnownSymbol$i("toStringTag");
var $Object$2 = Object;
var CORRECT_ARGUMENTS = classofRaw(function() {
	return arguments;
}()) == "Arguments";
var tryGet = function(it$1, key) {
	try {
		return it$1[key];
	} catch (error) {}
};
var classof$d = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function(it$1) {
	var O, tag, result;
	return it$1 === void 0 ? "Undefined" : it$1 === null ? "Null" : typeof (tag = tryGet(O = $Object$2(it$1), TO_STRING_TAG$2)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && isCallable$a(O.callee) ? "Arguments" : result;
};
var classof$c = classof$d;
var $String$2 = String;
var toString$a = function(argument) {
	if (classof$c(argument) === "Symbol") throw TypeError("Cannot convert a Symbol value to a string");
	return $String$2(argument);
};
var uncurryThis$m = functionUncurryThis;
var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
var toString$9 = toString$a;
var requireObjectCoercible$2 = requireObjectCoercible$5;
var charAt$3 = uncurryThis$m("".charAt);
var charCodeAt$1 = uncurryThis$m("".charCodeAt);
var stringSlice = uncurryThis$m("".slice);
var createMethod$4 = function(CONVERT_TO_STRING) {
	return function($this, pos) {
		var S = toString$9(requireObjectCoercible$2($this));
		var position = toIntegerOrInfinity$1(pos);
		var size = S.length;
		var first$1, second;
		if (position < 0 || position >= size) return CONVERT_TO_STRING ? "" : void 0;
		first$1 = charCodeAt$1(S, position);
		return first$1 < 55296 || first$1 > 56319 || position + 1 === size || (second = charCodeAt$1(S, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt$3(S, position) : first$1 : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first$1 - 55296 << 10) + (second - 56320) + 65536;
	};
};
var stringMultibyte = {
	codeAt: createMethod$4(false),
	charAt: createMethod$4(true)
};
var global$d = global$l;
var isCallable$9 = isCallable$i;
var WeakMap$1 = global$d.WeakMap;
var weakMapBasicDetection = isCallable$9(WeakMap$1) && /native code/.test(String(WeakMap$1));
var shared$5 = sharedExports;
var uid$2 = uid$4;
var keys$3 = shared$5("keys");
var sharedKey$4 = function(key) {
	return keys$3[key] || (keys$3[key] = uid$2(key));
};
var NATIVE_WEAK_MAP$1 = weakMapBasicDetection;
var global$c = global$l;
var isObject$d = isObject$j;
var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
var hasOwn$c = hasOwnProperty_1;
var shared$4 = sharedStore;
var sharedKey$3 = sharedKey$4;
var hiddenKeys$4 = hiddenKeys$6;
var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
var TypeError$2 = global$c.TypeError;
var WeakMap = global$c.WeakMap;
var set$3, get$7, has;
var enforce = function(it$1) {
	return has(it$1) ? get$7(it$1) : set$3(it$1, {});
};
var getterFor = function(TYPE) {
	return function(it$1) {
		var state;
		if (!isObject$d(it$1) || (state = get$7(it$1)).type !== TYPE) throw TypeError$2("Incompatible receiver, " + TYPE + " required");
		return state;
	};
};
if (NATIVE_WEAK_MAP$1 || shared$4.state) {
	var store$1 = shared$4.state || (shared$4.state = new WeakMap());
	store$1.get = store$1.get;
	store$1.has = store$1.has;
	store$1.set = store$1.set;
	set$3 = function(it$1, metadata) {
		if (store$1.has(it$1)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
		metadata.facade = it$1;
		store$1.set(it$1, metadata);
		return metadata;
	};
	get$7 = function(it$1) {
		return store$1.get(it$1) || {};
	};
	has = function(it$1) {
		return store$1.has(it$1);
	};
} else {
	var STATE = sharedKey$3("state");
	hiddenKeys$4[STATE] = true;
	set$3 = function(it$1, metadata) {
		if (hasOwn$c(it$1, STATE)) throw TypeError$2(OBJECT_ALREADY_INITIALIZED);
		metadata.facade = it$1;
		createNonEnumerableProperty$4(it$1, STATE, metadata);
		return metadata;
	};
	get$7 = function(it$1) {
		return hasOwn$c(it$1, STATE) ? it$1[STATE] : {};
	};
	has = function(it$1) {
		return hasOwn$c(it$1, STATE);
	};
}
var internalState = {
	set: set$3,
	get: get$7,
	has,
	enforce,
	getterFor
};
var DESCRIPTORS$c = descriptors;
var hasOwn$b = hasOwnProperty_1;
var FunctionPrototype = Function.prototype;
var getDescriptor = DESCRIPTORS$c && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn$b(FunctionPrototype, "name");
var PROPER = EXISTS && function something() {}.name === "something";
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$c || DESCRIPTORS$c && getDescriptor(FunctionPrototype, "name").configurable);
var functionName = {
	EXISTS,
	PROPER,
	CONFIGURABLE
};
var objectDefineProperties = {};
var DESCRIPTORS$b = descriptors;
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
var definePropertyModule$2 = objectDefineProperty;
var anObject$b = anObject$d;
var toIndexedObject$7 = toIndexedObject$b;
var objectKeys$2 = objectKeys$4;
objectDefineProperties.f = DESCRIPTORS$b && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties$6(O, Properties) {
	anObject$b(O);
	var props = toIndexedObject$7(Properties);
	var keys$9 = objectKeys$2(Properties);
	var length$1 = keys$9.length;
	var index$1 = 0;
	var key;
	while (length$1 > index$1) definePropertyModule$2.f(O, key = keys$9[index$1++], props[key]);
	return O;
};
var getBuiltIn$a = getBuiltIn$c;
var html$1 = getBuiltIn$a("document", "documentElement");
var anObject$a = anObject$d;
var definePropertiesModule$1 = objectDefineProperties;
var enumBugKeys$1 = enumBugKeys$3;
var hiddenKeys$3 = hiddenKeys$6;
var html = html$1;
var documentCreateElement = documentCreateElement$1;
var sharedKey$2 = sharedKey$4;
var GT = ">";
var LT = "<";
var PROTOTYPE$1 = "prototype";
var SCRIPT = "script";
var IE_PROTO$1 = sharedKey$2("IE_PROTO");
var EmptyConstructor = function() {};
var scriptTag = function(content) {
	return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function(activeXDocument$2) {
	activeXDocument$2.write(scriptTag(""));
	activeXDocument$2.close();
	var temp = activeXDocument$2.parentWindow.Object;
	activeXDocument$2 = null;
	return temp;
};
var NullProtoObjectViaIFrame = function() {
	var iframe = documentCreateElement("iframe");
	var JS = "java" + SCRIPT + ":";
	var iframeDocument;
	iframe.style.display = "none";
	html.appendChild(iframe);
	iframe.src = String(JS);
	iframeDocument = iframe.contentWindow.document;
	iframeDocument.open();
	iframeDocument.write(scriptTag("document.F=Object"));
	iframeDocument.close();
	return iframeDocument.F;
};
var activeXDocument;
var NullProtoObject = function() {
	try {
		activeXDocument = new ActiveXObject("htmlfile");
	} catch (error) {}
	NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
	var length$1 = enumBugKeys$1.length;
	while (length$1--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length$1]];
	return NullProtoObject();
};
hiddenKeys$3[IE_PROTO$1] = true;
var objectCreate = Object.create || function create$11(O, Properties) {
	var result;
	if (O !== null) {
		EmptyConstructor[PROTOTYPE$1] = anObject$a(O);
		result = new EmptyConstructor();
		EmptyConstructor[PROTOTYPE$1] = null;
		result[IE_PROTO$1] = O;
	} else result = NullProtoObject();
	return Properties === void 0 ? result : definePropertiesModule$1.f(result, Properties);
};
var fails$n = fails$w;
var correctPrototypeGetter = !fails$n(function() {
	function F() {}
	F.prototype.constructor = null;
	return Object.getPrototypeOf(new F()) !== F.prototype;
});
var hasOwn$a = hasOwnProperty_1;
var isCallable$8 = isCallable$i;
var toObject$a = toObject$d;
var sharedKey$1 = sharedKey$4;
var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
var IE_PROTO = sharedKey$1("IE_PROTO");
var $Object$1 = Object;
var ObjectPrototype$2 = $Object$1.prototype;
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? $Object$1.getPrototypeOf : function(O) {
	var object$1 = toObject$a(O);
	if (hasOwn$a(object$1, IE_PROTO)) return object$1[IE_PROTO];
	var constructor = object$1.constructor;
	if (isCallable$8(constructor) && object$1 instanceof constructor) return constructor.prototype;
	return object$1 instanceof $Object$1 ? ObjectPrototype$2 : null;
};
var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
var defineBuiltIn$5 = function(target, key, value, options) {
	if (options && options.enumerable) target[key] = value;
	else createNonEnumerableProperty$3(target, key, value);
	return target;
};
var fails$m = fails$w;
var isCallable$7 = isCallable$i;
var isObject$c = isObject$j;
var create$b = objectCreate;
var getPrototypeOf$9 = objectGetPrototypeOf;
var defineBuiltIn$4 = defineBuiltIn$5;
var wellKnownSymbol$h = wellKnownSymbol$l;
var ITERATOR$6 = wellKnownSymbol$h("iterator");
var BUGGY_SAFARI_ITERATORS$1 = false;
var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator;
if ([].keys) {
	arrayIterator = [].keys();
	if (!("next" in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
	else {
		PrototypeOfArrayIteratorPrototype = getPrototypeOf$9(getPrototypeOf$9(arrayIterator));
		if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype;
	}
}
var NEW_ITERATOR_PROTOTYPE = !isObject$c(IteratorPrototype$1) || fails$m(function() {
	var test$4 = {};
	return IteratorPrototype$1[ITERATOR$6].call(test$4) !== test$4;
});
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {};
else IteratorPrototype$1 = create$b(IteratorPrototype$1);
if (!isCallable$7(IteratorPrototype$1[ITERATOR$6])) defineBuiltIn$4(IteratorPrototype$1, ITERATOR$6, function() {
	return this;
});
var iteratorsCore = {
	IteratorPrototype: IteratorPrototype$1,
	BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
};
var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
var classof$b = classof$d;
var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString$11() {
	return "[object " + classof$b(this) + "]";
};
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
var defineProperty$d = objectDefineProperty.f;
var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
var hasOwn$9 = hasOwnProperty_1;
var toString$8 = objectToString;
var wellKnownSymbol$g = wellKnownSymbol$l;
var TO_STRING_TAG$1 = wellKnownSymbol$g("toStringTag");
var setToStringTag$6 = function(it$1, TAG, STATIC, SET_METHOD) {
	if (it$1) {
		var target = STATIC ? it$1 : it$1.prototype;
		if (!hasOwn$9(target, TO_STRING_TAG$1)) defineProperty$d(target, TO_STRING_TAG$1, {
			configurable: true,
			value: TAG
		});
		if (SET_METHOD && !TO_STRING_TAG_SUPPORT) createNonEnumerableProperty$2(target, "toString", toString$8);
	}
};
var iterators = {};
var IteratorPrototype = iteratorsCore.IteratorPrototype;
var create$a = objectCreate;
var createPropertyDescriptor$2 = createPropertyDescriptor$5;
var setToStringTag$5 = setToStringTag$6;
var Iterators$5 = iterators;
var returnThis$1 = function() {
	return this;
};
var iteratorCreateConstructor = function(IteratorConstructor, NAME, next$1, ENUMERABLE_NEXT) {
	var TO_STRING_TAG$6 = NAME + " Iterator";
	IteratorConstructor.prototype = create$a(IteratorPrototype, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next$1) });
	setToStringTag$5(IteratorConstructor, TO_STRING_TAG$6, false, true);
	Iterators$5[TO_STRING_TAG$6] = returnThis$1;
	return IteratorConstructor;
};
var uncurryThis$l = functionUncurryThis;
var aCallable$3 = aCallable$7;
var functionUncurryThisAccessor = function(object$1, key, method$11) {
	try {
		return uncurryThis$l(aCallable$3(Object.getOwnPropertyDescriptor(object$1, key)[method$11]));
	} catch (error) {}
};
var isCallable$6 = isCallable$i;
var $String$1 = String;
var $TypeError$a = TypeError;
var aPossiblePrototype$1 = function(argument) {
	if (typeof argument == "object" || isCallable$6(argument)) return argument;
	throw $TypeError$a("Can't set " + $String$1(argument) + " as a prototype");
};
var uncurryThisAccessor = functionUncurryThisAccessor;
var anObject$9 = anObject$d;
var aPossiblePrototype = aPossiblePrototype$1;
var objectSetPrototypeOf = Object.setPrototypeOf || ("__proto__" in {} ? function() {
	var CORRECT_SETTER = false;
	var test$4 = {};
	var setter;
	try {
		setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
		setter(test$4, []);
		CORRECT_SETTER = test$4 instanceof Array;
	} catch (error) {}
	return function setPrototypeOf$9(O, proto) {
		anObject$9(O);
		aPossiblePrototype(proto);
		if (CORRECT_SETTER) setter(O, proto);
		else O.__proto__ = proto;
		return O;
	};
}() : void 0);
var $$M = _export;
var call$8 = functionCall;
var FunctionName = functionName;
var createIteratorConstructor = iteratorCreateConstructor;
var getPrototypeOf$8 = objectGetPrototypeOf;
var setToStringTag$4 = setToStringTag$6;
var defineBuiltIn$3 = defineBuiltIn$5;
var wellKnownSymbol$f = wellKnownSymbol$l;
var Iterators$4 = iterators;
var IteratorsCore = iteratorsCore;
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR$5 = wellKnownSymbol$f("iterator");
var KEYS = "keys";
var VALUES = "values";
var ENTRIES = "entries";
var returnThis = function() {
	return this;
};
var iteratorDefine = function(Iterable, NAME, IteratorConstructor, next$1, DEFAULT, IS_SET, FORCED$11) {
	createIteratorConstructor(IteratorConstructor, NAME, next$1);
	var getIterationMethod = function(KIND) {
		if (KIND === DEFAULT && defaultIterator) return defaultIterator;
		if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
		switch (KIND) {
			case KEYS: return function keys$9() {
				return new IteratorConstructor(this, KIND);
			};
			case VALUES: return function values$8() {
				return new IteratorConstructor(this, KIND);
			};
			case ENTRIES: return function entries$4() {
				return new IteratorConstructor(this, KIND);
			};
		}
		return function() {
			return new IteratorConstructor(this);
		};
	};
	var TO_STRING_TAG$6 = NAME + " Iterator";
	var INCORRECT_VALUES_NAME = false;
	var IterablePrototype = Iterable.prototype;
	var nativeIterator = IterablePrototype[ITERATOR$5] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
	var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
	var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
	var CurrentIteratorPrototype, methods, KEY;
	if (anyNativeIterator) {
		CurrentIteratorPrototype = getPrototypeOf$8(anyNativeIterator.call(new Iterable()));
		if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
			setToStringTag$4(CurrentIteratorPrototype, TO_STRING_TAG$6, true, true);
			Iterators$4[TO_STRING_TAG$6] = returnThis;
		}
	}
	if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
		INCORRECT_VALUES_NAME = true;
		defaultIterator = function values$8() {
			return call$8(nativeIterator, this);
		};
	}
	if (DEFAULT) {
		methods = {
			values: getIterationMethod(VALUES),
			keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
			entries: getIterationMethod(ENTRIES)
		};
		if (FORCED$11) {
			for (KEY in methods) if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) defineBuiltIn$3(IterablePrototype, KEY, methods[KEY]);
		} else $$M({
			target: NAME,
			proto: true,
			forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
		}, methods);
	}
	if (FORCED$11 && IterablePrototype[ITERATOR$5] !== defaultIterator) defineBuiltIn$3(IterablePrototype, ITERATOR$5, defaultIterator, { name: DEFAULT });
	Iterators$4[NAME] = defaultIterator;
	return methods;
};
var createIterResultObject$3 = function(value, done) {
	return {
		value,
		done
	};
};
var charAt$2 = stringMultibyte.charAt;
var toString$7 = toString$a;
var InternalStateModule$5 = internalState;
var defineIterator$2 = iteratorDefine;
var createIterResultObject$2 = createIterResultObject$3;
var STRING_ITERATOR = "String Iterator";
var setInternalState$5 = InternalStateModule$5.set;
var getInternalState$2 = InternalStateModule$5.getterFor(STRING_ITERATOR);
defineIterator$2(String, "String", function(iterated) {
	setInternalState$5(this, {
		type: STRING_ITERATOR,
		string: toString$7(iterated),
		index: 0
	});
}, function next$1() {
	var state = getInternalState$2(this);
	var string$1 = state.string;
	var index$1 = state.index;
	var point;
	if (index$1 >= string$1.length) return createIterResultObject$2(void 0, true);
	point = charAt$2(string$1, index$1);
	state.index += point.length;
	return createIterResultObject$2(point, false);
});
var call$7 = functionCall;
var anObject$8 = anObject$d;
var getMethod$1 = getMethod$3;
var iteratorClose$2 = function(iterator$8, kind, value) {
	var innerResult, innerError;
	anObject$8(iterator$8);
	try {
		innerResult = getMethod$1(iterator$8, "return");
		if (!innerResult) {
			if (kind === "throw") throw value;
			return value;
		}
		innerResult = call$7(innerResult, iterator$8);
	} catch (error) {
		innerError = true;
		innerResult = error;
	}
	if (kind === "throw") throw value;
	if (innerError) throw innerResult;
	anObject$8(innerResult);
	return value;
};
var anObject$7 = anObject$d;
var iteratorClose$1 = iteratorClose$2;
var callWithSafeIterationClosing$1 = function(iterator$8, fn, value, ENTRIES$2) {
	try {
		return ENTRIES$2 ? fn(anObject$7(value)[0], value[1]) : fn(value);
	} catch (error) {
		iteratorClose$1(iterator$8, "throw", error);
	}
};
var wellKnownSymbol$e = wellKnownSymbol$l;
var Iterators$3 = iterators;
var ITERATOR$4 = wellKnownSymbol$e("iterator");
var ArrayPrototype$f = Array.prototype;
var isArrayIteratorMethod$2 = function(it$1) {
	return it$1 !== void 0 && (Iterators$3.Array === it$1 || ArrayPrototype$f[ITERATOR$4] === it$1);
};
var uncurryThis$k = functionUncurryThis;
var isCallable$5 = isCallable$i;
var store = sharedStore;
var functionToString = uncurryThis$k(Function.toString);
if (!isCallable$5(store.inspectSource)) store.inspectSource = function(it$1) {
	return functionToString(it$1);
};
var inspectSource$1 = store.inspectSource;
var uncurryThis$j = functionUncurryThis;
var fails$l = fails$w;
var isCallable$4 = isCallable$i;
var classof$a = classof$d;
var getBuiltIn$9 = getBuiltIn$c;
var inspectSource = inspectSource$1;
var noop = function() {};
var empty = [];
var construct$3 = getBuiltIn$9("Reflect", "construct");
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec$2 = uncurryThis$j(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
var isConstructorModern = function isConstructor$6(argument) {
	if (!isCallable$4(argument)) return false;
	try {
		construct$3(noop, empty, argument);
		return true;
	} catch (error) {
		return false;
	}
};
var isConstructorLegacy = function isConstructor$6(argument) {
	if (!isCallable$4(argument)) return false;
	switch (classof$a(argument)) {
		case "AsyncFunction":
		case "GeneratorFunction":
		case "AsyncGeneratorFunction": return false;
	}
	try {
		return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource(argument));
	} catch (error) {
		return true;
	}
};
isConstructorLegacy.sham = true;
var isConstructor$4 = !construct$3 || fails$l(function() {
	var called$2;
	return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
		called$2 = true;
	}) || called$2;
}) ? isConstructorLegacy : isConstructorModern;
var toPropertyKey$1 = toPropertyKey$4;
var definePropertyModule$1 = objectDefineProperty;
var createPropertyDescriptor$1 = createPropertyDescriptor$5;
var createProperty$6 = function(object$1, key, value) {
	var propertyKey = toPropertyKey$1(key);
	if (propertyKey in object$1) definePropertyModule$1.f(object$1, propertyKey, createPropertyDescriptor$1(0, value));
	else object$1[propertyKey] = value;
};
var classof$9 = classof$d;
var getMethod = getMethod$3;
var isNullOrUndefined$2 = isNullOrUndefined$5;
var Iterators$2 = iterators;
var wellKnownSymbol$d = wellKnownSymbol$l;
var ITERATOR$3 = wellKnownSymbol$d("iterator");
var getIteratorMethod$9 = function(it$1) {
	if (!isNullOrUndefined$2(it$1)) return getMethod(it$1, ITERATOR$3) || getMethod(it$1, "@@iterator") || Iterators$2[classof$9(it$1)];
};
var call$6 = functionCall;
var aCallable$2 = aCallable$7;
var anObject$6 = anObject$d;
var tryToString$4 = tryToString$6;
var getIteratorMethod$8 = getIteratorMethod$9;
var $TypeError$9 = TypeError;
var getIterator$2 = function(argument, usingIterator) {
	var iteratorMethod = arguments.length < 2 ? getIteratorMethod$8(argument) : usingIterator;
	if (aCallable$2(iteratorMethod)) return anObject$6(call$6(iteratorMethod, argument));
	throw $TypeError$9(tryToString$4(argument) + " is not iterable");
};
var bind$8 = functionBindContext;
var call$5 = functionCall;
var toObject$9 = toObject$d;
var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
var isConstructor$3 = isConstructor$4;
var lengthOfArrayLike$9 = lengthOfArrayLike$b;
var createProperty$5 = createProperty$6;
var getIterator$1 = getIterator$2;
var getIteratorMethod$7 = getIteratorMethod$9;
var $Array$3 = Array;
var arrayFrom = function from$9(arrayLike) {
	var O = toObject$9(arrayLike);
	var IS_CONSTRUCTOR = isConstructor$3(this);
	var argumentsLength = arguments.length;
	var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
	var mapping = mapfn !== void 0;
	if (mapping) mapfn = bind$8(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
	var iteratorMethod = getIteratorMethod$7(O);
	var index$1 = 0;
	var length$1, result, step, iterator$8, next$1, value;
	if (iteratorMethod && !(this === $Array$3 && isArrayIteratorMethod$1(iteratorMethod))) {
		iterator$8 = getIterator$1(O, iteratorMethod);
		next$1 = iterator$8.next;
		result = IS_CONSTRUCTOR ? new this() : [];
		for (; !(step = call$5(next$1, iterator$8)).done; index$1++) {
			value = mapping ? callWithSafeIterationClosing(iterator$8, mapfn, [step.value, index$1], true) : step.value;
			createProperty$5(result, index$1, value);
		}
	} else {
		length$1 = lengthOfArrayLike$9(O);
		result = IS_CONSTRUCTOR ? new this(length$1) : $Array$3(length$1);
		for (; length$1 > index$1; index$1++) {
			value = mapping ? mapfn(O[index$1], index$1) : O[index$1];
			createProperty$5(result, index$1, value);
		}
	}
	result.length = index$1;
	return result;
};
var wellKnownSymbol$c = wellKnownSymbol$l;
var ITERATOR$2 = wellKnownSymbol$c("iterator");
var SAFE_CLOSING = false;
try {
	var called = 0;
	var iteratorWithReturn = {
		next: function() {
			return { done: !!called++ };
		},
		"return": function() {
			SAFE_CLOSING = true;
		}
	};
	iteratorWithReturn[ITERATOR$2] = function() {
		return this;
	};
	Array.from(iteratorWithReturn, function() {
		throw 2;
	});
} catch (error) {}
var checkCorrectnessOfIteration$1 = function(exec$4, SKIP_CLOSING) {
	if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
	var ITERATION_SUPPORT = false;
	try {
		var object$1 = {};
		object$1[ITERATOR$2] = function() {
			return { next: function() {
				return { done: ITERATION_SUPPORT = true };
			} };
		};
		exec$4(object$1);
	} catch (error) {}
	return ITERATION_SUPPORT;
};
var $$L = _export;
var from$6 = arrayFrom;
var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
	Array.from(iterable);
});
$$L({
	target: "Array",
	stat: true,
	forced: INCORRECT_ITERATION
}, { from: from$6 });
var path$t = path$y;
var from$5 = path$t.Array.from;
var parent$19 = from$5;
var from$4 = parent$19;
(function(module) {
	module.exports = from$4;
})(from$7);
var _Array$from$1 = /* @__PURE__ */ getDefaultExportFromCjs(fromExports$2);
var getIteratorMethodExports$1 = {};
var getIteratorMethod$6 = {
	get exports() {
		return getIteratorMethodExports$1;
	},
	set exports(v) {
		getIteratorMethodExports$1 = v;
	}
};
var getIteratorMethodExports = {};
var getIteratorMethod$5 = {
	get exports() {
		return getIteratorMethodExports;
	},
	set exports(v) {
		getIteratorMethodExports = v;
	}
};
var toIndexedObject$6 = toIndexedObject$b;
var Iterators$1 = iterators;
var InternalStateModule$4 = internalState;
objectDefineProperty.f;
var defineIterator$1 = iteratorDefine;
var createIterResultObject$1 = createIterResultObject$3;
var ARRAY_ITERATOR = "Array Iterator";
var setInternalState$4 = InternalStateModule$4.set;
var getInternalState$1 = InternalStateModule$4.getterFor(ARRAY_ITERATOR);
defineIterator$1(Array, "Array", function(iterated, kind) {
	setInternalState$4(this, {
		type: ARRAY_ITERATOR,
		target: toIndexedObject$6(iterated),
		index: 0,
		kind
	});
}, function() {
	var state = getInternalState$1(this);
	var target = state.target;
	var kind = state.kind;
	var index$1 = state.index++;
	if (!target || index$1 >= target.length) {
		state.target = void 0;
		return createIterResultObject$1(void 0, true);
	}
	if (kind == "keys") return createIterResultObject$1(index$1, false);
	if (kind == "values") return createIterResultObject$1(target[index$1], false);
	return createIterResultObject$1([index$1, target[index$1]], false);
}, "values");
Iterators$1.Arguments = Iterators$1.Array;
var getIteratorMethod$4 = getIteratorMethod$9;
var getIteratorMethod_1 = getIteratorMethod$4;
var domIterables = {
	CSSRuleList: 0,
	CSSStyleDeclaration: 0,
	CSSValueList: 0,
	ClientRectList: 0,
	DOMRectList: 0,
	DOMStringList: 0,
	DOMTokenList: 1,
	DataTransferItemList: 0,
	FileList: 0,
	HTMLAllCollection: 0,
	HTMLCollection: 0,
	HTMLFormElement: 0,
	HTMLSelectElement: 0,
	MediaList: 0,
	MimeTypeArray: 0,
	NamedNodeMap: 0,
	NodeList: 1,
	PaintRequestList: 0,
	Plugin: 0,
	PluginArray: 0,
	SVGLengthList: 0,
	SVGNumberList: 0,
	SVGPathSegList: 0,
	SVGPointList: 0,
	SVGStringList: 0,
	SVGTransformList: 0,
	SourceBufferList: 0,
	StyleSheetList: 0,
	TextTrackCueList: 0,
	TextTrackList: 0,
	TouchList: 0
};
var DOMIterables$2 = domIterables;
var global$b = global$l;
var classof$8 = classof$d;
var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
var Iterators = iterators;
var wellKnownSymbol$b = wellKnownSymbol$l;
var TO_STRING_TAG = wellKnownSymbol$b("toStringTag");
for (var COLLECTION_NAME in DOMIterables$2) {
	var Collection = global$b[COLLECTION_NAME];
	var CollectionPrototype = Collection && Collection.prototype;
	if (CollectionPrototype && classof$8(CollectionPrototype) !== TO_STRING_TAG) createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
	Iterators[COLLECTION_NAME] = Iterators.Array;
}
var parent$18 = getIteratorMethod_1;
var getIteratorMethod$3 = parent$18;
var parent$17 = getIteratorMethod$3;
var getIteratorMethod$2 = parent$17;
var parent$16 = getIteratorMethod$2;
var getIteratorMethod$1 = parent$16;
(function(module) {
	module.exports = getIteratorMethod$1;
})(getIteratorMethod$5);
(function(module) {
	module.exports = getIteratorMethodExports;
})(getIteratorMethod$6);
var _getIteratorMethod = /* @__PURE__ */ getDefaultExportFromCjs(getIteratorMethodExports$1);
var getOwnPropertySymbolsExports = {};
var getOwnPropertySymbols$2 = {
	get exports() {
		return getOwnPropertySymbolsExports;
	},
	set exports(v) {
		getOwnPropertySymbolsExports = v;
	}
};
var objectGetOwnPropertyNames = {};
var internalObjectKeys = objectKeysInternal;
var enumBugKeys = enumBugKeys$3;
var hiddenKeys$2 = enumBugKeys.concat("length", "prototype");
objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames$6(O) {
	return internalObjectKeys(O, hiddenKeys$2);
};
var objectGetOwnPropertyNamesExternal = {};
var toAbsoluteIndex$3 = toAbsoluteIndex$5;
var lengthOfArrayLike$8 = lengthOfArrayLike$b;
var createProperty$4 = createProperty$6;
var $Array$2 = Array;
var max$2 = Math.max;
var arraySliceSimple = function(O, start, end) {
	var length$1 = lengthOfArrayLike$8(O);
	var k = toAbsoluteIndex$3(start, length$1);
	var fin = toAbsoluteIndex$3(end === void 0 ? length$1 : end, length$1);
	var result = $Array$2(max$2(fin - k, 0));
	for (var n = 0; k < fin; k++, n++) createProperty$4(result, n, O[k]);
	result.length = n;
	return result;
};
var classof$7 = classofRaw$2;
var toIndexedObject$5 = toIndexedObject$b;
var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
var arraySlice$3 = arraySliceSimple;
var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it$1) {
	try {
		return $getOwnPropertyNames$1(it$1);
	} catch (error) {
		return arraySlice$3(windowNames);
	}
};
objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames$6(it$1) {
	return windowNames && classof$7(it$1) == "Window" ? getWindowNames(it$1) : $getOwnPropertyNames$1(toIndexedObject$5(it$1));
};
var defineProperty$c = objectDefineProperty;
var defineBuiltInAccessor$3 = function(target, name, descriptor) {
	return defineProperty$c.f(target, name, descriptor);
};
var wellKnownSymbolWrapped = {};
var wellKnownSymbol$a = wellKnownSymbol$l;
wellKnownSymbolWrapped.f = wellKnownSymbol$a;
var path$s = path$y;
var hasOwn$8 = hasOwnProperty_1;
var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
var defineProperty$b = objectDefineProperty.f;
var wellKnownSymbolDefine = function(NAME) {
	var Symbol$6 = path$s.Symbol || (path$s.Symbol = {});
	if (!hasOwn$8(Symbol$6, NAME)) defineProperty$b(Symbol$6, NAME, { value: wrappedWellKnownSymbolModule$1.f(NAME) });
};
var call$4 = functionCall;
var getBuiltIn$8 = getBuiltIn$c;
var wellKnownSymbol$9 = wellKnownSymbol$l;
var defineBuiltIn$2 = defineBuiltIn$5;
var symbolDefineToPrimitive = function() {
	var Symbol$6 = getBuiltIn$8("Symbol");
	var SymbolPrototype$2 = Symbol$6 && Symbol$6.prototype;
	var valueOf = SymbolPrototype$2 && SymbolPrototype$2.valueOf;
	var TO_PRIMITIVE$2 = wellKnownSymbol$9("toPrimitive");
	if (SymbolPrototype$2 && !SymbolPrototype$2[TO_PRIMITIVE$2]) defineBuiltIn$2(SymbolPrototype$2, TO_PRIMITIVE$2, function(hint) {
		return call$4(valueOf, this);
	}, { arity: 1 });
};
var classof$6 = classofRaw$2;
var isArray$f = Array.isArray || function isArray$11(argument) {
	return classof$6(argument) == "Array";
};
var isArray$e = isArray$f;
var isConstructor$2 = isConstructor$4;
var isObject$b = isObject$j;
var wellKnownSymbol$8 = wellKnownSymbol$l;
var SPECIES$3 = wellKnownSymbol$8("species");
var $Array$1 = Array;
var arraySpeciesConstructor$1 = function(originalArray) {
	var C;
	if (isArray$e(originalArray)) {
		C = originalArray.constructor;
		if (isConstructor$2(C) && (C === $Array$1 || isArray$e(C.prototype))) C = void 0;
		else if (isObject$b(C)) {
			C = C[SPECIES$3];
			if (C === null) C = void 0;
		}
	}
	return C === void 0 ? $Array$1 : C;
};
var arraySpeciesConstructor = arraySpeciesConstructor$1;
var arraySpeciesCreate$3 = function(originalArray, length$1) {
	return new (arraySpeciesConstructor(originalArray))(length$1 === 0 ? 0 : length$1);
};
var bind$7 = functionBindContext;
var uncurryThis$i = functionUncurryThis;
var IndexedObject$1 = indexedObject;
var toObject$8 = toObject$d;
var lengthOfArrayLike$7 = lengthOfArrayLike$b;
var arraySpeciesCreate$2 = arraySpeciesCreate$3;
var push$5 = uncurryThis$i([].push);
var createMethod$3 = function(TYPE) {
	var IS_MAP = TYPE == 1;
	var IS_FILTER = TYPE == 2;
	var IS_SOME = TYPE == 3;
	var IS_EVERY = TYPE == 4;
	var IS_FIND_INDEX = TYPE == 6;
	var IS_FILTER_REJECT = TYPE == 7;
	var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
	return function($this, callbackfn, that, specificCreate) {
		var O = toObject$8($this);
		var self$1 = IndexedObject$1(O);
		var boundFunction = bind$7(callbackfn, that);
		var length$1 = lengthOfArrayLike$7(self$1);
		var index$1 = 0;
		var create$11 = specificCreate || arraySpeciesCreate$2;
		var target = IS_MAP ? create$11($this, length$1) : IS_FILTER || IS_FILTER_REJECT ? create$11($this, 0) : void 0;
		var value, result;
		for (; length$1 > index$1; index$1++) if (NO_HOLES || index$1 in self$1) {
			value = self$1[index$1];
			result = boundFunction(value, index$1, O);
			if (TYPE) if (IS_MAP) target[index$1] = result;
			else if (result) switch (TYPE) {
				case 3: return true;
				case 5: return value;
				case 6: return index$1;
				case 2: push$5(target, value);
			}
			else switch (TYPE) {
				case 4: return false;
				case 7: push$5(target, value);
			}
		}
		return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
	};
};
var arrayIteration = {
	forEach: createMethod$3(0),
	map: createMethod$3(1),
	filter: createMethod$3(2),
	some: createMethod$3(3),
	every: createMethod$3(4),
	find: createMethod$3(5),
	findIndex: createMethod$3(6),
	filterReject: createMethod$3(7)
};
var $$K = _export;
var global$a = global$l;
var call$3 = functionCall;
var uncurryThis$h = functionUncurryThis;
var DESCRIPTORS$a = descriptors;
var NATIVE_SYMBOL$3 = symbolConstructorDetection;
var fails$k = fails$w;
var hasOwn$7 = hasOwnProperty_1;
var isPrototypeOf$i = objectIsPrototypeOf;
var anObject$5 = anObject$d;
var toIndexedObject$4 = toIndexedObject$b;
var toPropertyKey = toPropertyKey$4;
var $toString = toString$a;
var createPropertyDescriptor = createPropertyDescriptor$5;
var nativeObjectCreate = objectCreate;
var objectKeys$1 = objectKeys$4;
var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames;
var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal;
var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols;
var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor;
var definePropertyModule = objectDefineProperty;
var definePropertiesModule = objectDefineProperties;
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
var defineBuiltIn$1 = defineBuiltIn$5;
var defineBuiltInAccessor$2 = defineBuiltInAccessor$3;
var shared$3 = sharedExports;
var sharedKey = sharedKey$4;
var hiddenKeys$1 = hiddenKeys$6;
var uid$1 = uid$4;
var wellKnownSymbol$7 = wellKnownSymbol$l;
var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
var defineWellKnownSymbol$l = wellKnownSymbolDefine;
var defineSymbolToPrimitive$1 = symbolDefineToPrimitive;
var setToStringTag$3 = setToStringTag$6;
var InternalStateModule$3 = internalState;
var $forEach$1 = arrayIteration.forEach;
var HIDDEN = sharedKey("hidden");
var SYMBOL = "Symbol";
var PROTOTYPE = "prototype";
var setInternalState$3 = InternalStateModule$3.set;
var getInternalState = InternalStateModule$3.getterFor(SYMBOL);
var ObjectPrototype$1 = Object[PROTOTYPE];
var $Symbol = global$a.Symbol;
var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
var TypeError$1 = global$a.TypeError;
var QObject = global$a.QObject;
var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$2.f;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
var push$4 = uncurryThis$h([].push);
var AllSymbols = shared$3("symbols");
var ObjectPrototypeSymbols = shared$3("op-symbols");
var WellKnownSymbolsStore$1 = shared$3("wks");
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
var setSymbolDescriptor = DESCRIPTORS$a && fails$k(function() {
	return nativeObjectCreate(nativeDefineProperty({}, "a", { get: function() {
		return nativeDefineProperty(this, "a", { value: 7 }).a;
	} })).a != 7;
}) ? function(O, P, Attributes) {
	var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$1, P);
	if (ObjectPrototypeDescriptor) delete ObjectPrototype$1[P];
	nativeDefineProperty(O, P, Attributes);
	if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1) nativeDefineProperty(ObjectPrototype$1, P, ObjectPrototypeDescriptor);
} : nativeDefineProperty;
var wrap = function(tag, description) {
	var symbol$8 = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
	setInternalState$3(symbol$8, {
		type: SYMBOL,
		tag,
		description
	});
	if (!DESCRIPTORS$a) symbol$8.description = description;
	return symbol$8;
};
var $defineProperty = function defineProperty$11(O, P, Attributes) {
	if (O === ObjectPrototype$1) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
	anObject$5(O);
	var key = toPropertyKey(P);
	anObject$5(Attributes);
	if (hasOwn$7(AllSymbols, key)) {
		if (!Attributes.enumerable) {
			if (!hasOwn$7(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
			O[HIDDEN][key] = true;
		} else {
			if (hasOwn$7(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
			Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
		}
		return setSymbolDescriptor(O, key, Attributes);
	}
	return nativeDefineProperty(O, key, Attributes);
};
var $defineProperties = function defineProperties$6(O, Properties) {
	anObject$5(O);
	var properties = toIndexedObject$4(Properties);
	var keys$9 = objectKeys$1(properties).concat($getOwnPropertySymbols(properties));
	$forEach$1(keys$9, function(key) {
		if (!DESCRIPTORS$a || call$3($propertyIsEnumerable$1, properties, key)) $defineProperty(O, key, properties[key]);
	});
	return O;
};
var $create = function create$11(O, Properties) {
	return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
};
var $propertyIsEnumerable$1 = function propertyIsEnumerable$1(V) {
	var P = toPropertyKey(V);
	var enumerable = call$3(nativePropertyIsEnumerable, this, P);
	if (this === ObjectPrototype$1 && hasOwn$7(AllSymbols, P) && !hasOwn$7(ObjectPrototypeSymbols, P)) return false;
	return enumerable || !hasOwn$7(this, P) || !hasOwn$7(AllSymbols, P) || hasOwn$7(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor$11(O, P) {
	var it$1 = toIndexedObject$4(O);
	var key = toPropertyKey(P);
	if (it$1 === ObjectPrototype$1 && hasOwn$7(AllSymbols, key) && !hasOwn$7(ObjectPrototypeSymbols, key)) return;
	var descriptor = nativeGetOwnPropertyDescriptor$1(it$1, key);
	if (descriptor && hasOwn$7(AllSymbols, key) && !(hasOwn$7(it$1, HIDDEN) && it$1[HIDDEN][key])) descriptor.enumerable = true;
	return descriptor;
};
var $getOwnPropertyNames = function getOwnPropertyNames$6(O) {
	var names = nativeGetOwnPropertyNames(toIndexedObject$4(O));
	var result = [];
	$forEach$1(names, function(key) {
		if (!hasOwn$7(AllSymbols, key) && !hasOwn$7(hiddenKeys$1, key)) push$4(result, key);
	});
	return result;
};
var $getOwnPropertySymbols = function(O) {
	var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1;
	var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$4(O));
	var result = [];
	$forEach$1(names, function(key) {
		if (hasOwn$7(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$7(ObjectPrototype$1, key))) push$4(result, AllSymbols[key]);
	});
	return result;
};
if (!NATIVE_SYMBOL$3) {
	$Symbol = function Symbol$6() {
		if (isPrototypeOf$i(SymbolPrototype, this)) throw TypeError$1("Symbol is not a constructor");
		var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]);
		var tag = uid$1(description);
		var setter = function(value) {
			if (this === ObjectPrototype$1) call$3(setter, ObjectPrototypeSymbols, value);
			if (hasOwn$7(this, HIDDEN) && hasOwn$7(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
			setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
		};
		if (DESCRIPTORS$a && USE_SETTER) setSymbolDescriptor(ObjectPrototype$1, tag, {
			configurable: true,
			set: setter
		});
		return wrap(tag, description);
	};
	SymbolPrototype = $Symbol[PROTOTYPE];
	defineBuiltIn$1(SymbolPrototype, "toString", function toString$11() {
		return getInternalState(this).tag;
	});
	defineBuiltIn$1($Symbol, "withoutSetter", function(description) {
		return wrap(uid$1(description), description);
	});
	propertyIsEnumerableModule.f = $propertyIsEnumerable$1;
	definePropertyModule.f = $defineProperty;
	definePropertiesModule.f = $defineProperties;
	getOwnPropertyDescriptorModule$2.f = $getOwnPropertyDescriptor;
	getOwnPropertyNamesModule$2.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
	getOwnPropertySymbolsModule$2.f = $getOwnPropertySymbols;
	wrappedWellKnownSymbolModule.f = function(name) {
		return wrap(wellKnownSymbol$7(name), name);
	};
	if (DESCRIPTORS$a) defineBuiltInAccessor$2(SymbolPrototype, "description", {
		configurable: true,
		get: function description() {
			return getInternalState(this).description;
		}
	});
}
$$K({
	global: true,
	constructor: true,
	wrap: true,
	forced: !NATIVE_SYMBOL$3,
	sham: !NATIVE_SYMBOL$3
}, { Symbol: $Symbol });
$forEach$1(objectKeys$1(WellKnownSymbolsStore$1), function(name) {
	defineWellKnownSymbol$l(name);
});
$$K({
	target: SYMBOL,
	stat: true,
	forced: !NATIVE_SYMBOL$3
}, {
	useSetter: function() {
		USE_SETTER = true;
	},
	useSimple: function() {
		USE_SETTER = false;
	}
});
$$K({
	target: "Object",
	stat: true,
	forced: !NATIVE_SYMBOL$3,
	sham: !DESCRIPTORS$a
}, {
	create: $create,
	defineProperty: $defineProperty,
	defineProperties: $defineProperties,
	getOwnPropertyDescriptor: $getOwnPropertyDescriptor
});
$$K({
	target: "Object",
	stat: true,
	forced: !NATIVE_SYMBOL$3
}, { getOwnPropertyNames: $getOwnPropertyNames });
defineSymbolToPrimitive$1();
setToStringTag$3($Symbol, SYMBOL);
hiddenKeys$1[HIDDEN] = true;
var NATIVE_SYMBOL$2 = symbolConstructorDetection;
var symbolRegistryDetection = NATIVE_SYMBOL$2 && !!Symbol["for"] && !!Symbol.keyFor;
var $$J = _export;
var getBuiltIn$7 = getBuiltIn$c;
var hasOwn$6 = hasOwnProperty_1;
var toString$6 = toString$a;
var shared$2 = sharedExports;
var NATIVE_SYMBOL_REGISTRY$1 = symbolRegistryDetection;
var StringToSymbolRegistry = shared$2("string-to-symbol-registry");
var SymbolToStringRegistry$1 = shared$2("symbol-to-string-registry");
$$J({
	target: "Symbol",
	stat: true,
	forced: !NATIVE_SYMBOL_REGISTRY$1
}, { "for": function(key) {
	var string$1 = toString$6(key);
	if (hasOwn$6(StringToSymbolRegistry, string$1)) return StringToSymbolRegistry[string$1];
	var symbol$8 = getBuiltIn$7("Symbol")(string$1);
	StringToSymbolRegistry[string$1] = symbol$8;
	SymbolToStringRegistry$1[symbol$8] = string$1;
	return symbol$8;
} });
var $$I = _export;
var hasOwn$5 = hasOwnProperty_1;
var isSymbol$2 = isSymbol$5;
var tryToString$3 = tryToString$6;
var shared$1 = sharedExports;
var NATIVE_SYMBOL_REGISTRY = symbolRegistryDetection;
var SymbolToStringRegistry = shared$1("symbol-to-string-registry");
$$I({
	target: "Symbol",
	stat: true,
	forced: !NATIVE_SYMBOL_REGISTRY
}, { keyFor: function keyFor$2(sym) {
	if (!isSymbol$2(sym)) throw TypeError(tryToString$3(sym) + " is not a symbol");
	if (hasOwn$5(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
} });
var uncurryThis$g = functionUncurryThis;
var isArray$d = isArray$f;
var isCallable$3 = isCallable$i;
var classof$5 = classofRaw$2;
var toString$5 = toString$a;
var push$3 = uncurryThis$g([].push);
var getJsonReplacerFunction = function(replacer) {
	if (isCallable$3(replacer)) return replacer;
	if (!isArray$d(replacer)) return;
	var rawLength = replacer.length;
	var keys$9 = [];
	for (var i$2 = 0; i$2 < rawLength; i$2++) {
		var element = replacer[i$2];
		if (typeof element == "string") push$3(keys$9, element);
		else if (typeof element == "number" || classof$5(element) == "Number" || classof$5(element) == "String") push$3(keys$9, toString$5(element));
	}
	var keysLength = keys$9.length;
	var root = true;
	return function(key, value) {
		if (root) {
			root = false;
			return value;
		}
		if (isArray$d(this)) return value;
		for (var j = 0; j < keysLength; j++) if (keys$9[j] === key) return value;
	};
};
var $$H = _export;
var getBuiltIn$6 = getBuiltIn$c;
var apply$3 = functionApply;
var call$2 = functionCall;
var uncurryThis$f = functionUncurryThis;
var fails$j = fails$w;
var isCallable$2 = isCallable$i;
var isSymbol$1 = isSymbol$5;
var arraySlice$2 = arraySlice$5;
var getReplacerFunction = getJsonReplacerFunction;
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
var $String = String;
var $stringify = getBuiltIn$6("JSON", "stringify");
var exec$1 = uncurryThis$f(/./.exec);
var charAt$1 = uncurryThis$f("".charAt);
var charCodeAt = uncurryThis$f("".charCodeAt);
var replace$1 = uncurryThis$f("".replace);
var numberToString = uncurryThis$f(1 .toString);
var tester = /[\uD800-\uDFFF]/g;
var low = /^[\uD800-\uDBFF]$/;
var hi = /^[\uDC00-\uDFFF]$/;
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$j(function() {
	var symbol$8 = getBuiltIn$6("Symbol")();
	return $stringify([symbol$8]) != "[null]" || $stringify({ a: symbol$8 }) != "{}" || $stringify(Object(symbol$8)) != "{}";
});
var ILL_FORMED_UNICODE = fails$j(function() {
	return $stringify('\uDF06\uD834') !== "\"\\udf06\\ud834\"" || $stringify('\uDEAD') !== "\"\\udead\"";
});
var stringifyWithSymbolsFix = function(it$1, replacer) {
	var args = arraySlice$2(arguments);
	var $replacer = getReplacerFunction(replacer);
	if (!isCallable$2($replacer) && (it$1 === void 0 || isSymbol$1(it$1))) return;
	args[1] = function(key, value) {
		if (isCallable$2($replacer)) value = call$2($replacer, this, $String(key), value);
		if (!isSymbol$1(value)) return value;
	};
	return apply$3($stringify, null, args);
};
var fixIllFormed = function(match$2, offset, string$1) {
	var prev = charAt$1(string$1, offset - 1);
	var next$1 = charAt$1(string$1, offset + 1);
	if (exec$1(low, match$2) && !exec$1(hi, next$1) || exec$1(hi, match$2) && !exec$1(low, prev)) return "\\u" + numberToString(charCodeAt(match$2, 0), 16);
	return match$2;
};
if ($stringify) $$H({
	target: "JSON",
	stat: true,
	arity: 3,
	forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE
}, { stringify: function stringify$4(it$1, replacer, space) {
	var args = arraySlice$2(arguments);
	var result = apply$3(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
	return ILL_FORMED_UNICODE && typeof result == "string" ? replace$1(result, tester, fixIllFormed) : result;
} });
var $$G = _export;
var NATIVE_SYMBOL = symbolConstructorDetection;
var fails$i = fails$w;
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
var toObject$7 = toObject$d;
var FORCED$9 = !NATIVE_SYMBOL || fails$i(function() {
	getOwnPropertySymbolsModule$1.f(1);
});
$$G({
	target: "Object",
	stat: true,
	forced: FORCED$9
}, { getOwnPropertySymbols: function getOwnPropertySymbols$4(it$1) {
	var $getOwnPropertySymbols$2 = getOwnPropertySymbolsModule$1.f;
	return $getOwnPropertySymbols$2 ? $getOwnPropertySymbols$2(toObject$7(it$1)) : [];
} });
var path$r = path$y;
var getOwnPropertySymbols$1 = path$r.Object.getOwnPropertySymbols;
var parent$15 = getOwnPropertySymbols$1;
var getOwnPropertySymbols = parent$15;
(function(module) {
	module.exports = getOwnPropertySymbols;
})(getOwnPropertySymbols$2);
var _Object$getOwnPropertySymbols = /* @__PURE__ */ getDefaultExportFromCjs(getOwnPropertySymbolsExports);
var getOwnPropertyDescriptorExports$3 = {};
var getOwnPropertyDescriptor$8 = {
	get exports() {
		return getOwnPropertyDescriptorExports$3;
	},
	set exports(v) {
		getOwnPropertyDescriptorExports$3 = v;
	}
};
var getOwnPropertyDescriptorExports$2 = {};
var getOwnPropertyDescriptor$7 = {
	get exports() {
		return getOwnPropertyDescriptorExports$2;
	},
	set exports(v) {
		getOwnPropertyDescriptorExports$2 = v;
	}
};
var $$F = _export;
var fails$h = fails$w;
var toIndexedObject$3 = toIndexedObject$b;
var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
var DESCRIPTORS$9 = descriptors;
var FORCED$8 = !DESCRIPTORS$9 || fails$h(function() {
	nativeGetOwnPropertyDescriptor(1);
});
$$F({
	target: "Object",
	stat: true,
	forced: FORCED$8,
	sham: !DESCRIPTORS$9
}, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor$11(it$1, key) {
	return nativeGetOwnPropertyDescriptor(toIndexedObject$3(it$1), key);
} });
var path$q = path$y;
var Object$5 = path$q.Object;
var getOwnPropertyDescriptor$6 = getOwnPropertyDescriptor$7.exports = function getOwnPropertyDescriptor$11(it$1, key) {
	return Object$5.getOwnPropertyDescriptor(it$1, key);
};
if (Object$5.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$6.sham = true;
var parent$14 = getOwnPropertyDescriptorExports$2;
var getOwnPropertyDescriptor$5 = parent$14;
(function(module) {
	module.exports = getOwnPropertyDescriptor$5;
})(getOwnPropertyDescriptor$8);
var _Object$getOwnPropertyDescriptor$1 = /* @__PURE__ */ getDefaultExportFromCjs(getOwnPropertyDescriptorExports$3);
var getOwnPropertyDescriptorsExports = {};
var getOwnPropertyDescriptors$2 = {
	get exports() {
		return getOwnPropertyDescriptorsExports;
	},
	set exports(v) {
		getOwnPropertyDescriptorsExports = v;
	}
};
var getBuiltIn$5 = getBuiltIn$c;
var uncurryThis$e = functionUncurryThis;
var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
var anObject$4 = anObject$d;
var concat$4 = uncurryThis$e([].concat);
var ownKeys$9 = getBuiltIn$5("Reflect", "ownKeys") || function ownKeys$11(it$1) {
	var keys$9 = getOwnPropertyNamesModule$1.f(anObject$4(it$1));
	var getOwnPropertySymbols$4 = getOwnPropertySymbolsModule.f;
	return getOwnPropertySymbols$4 ? concat$4(keys$9, getOwnPropertySymbols$4(it$1)) : keys$9;
};
var $$E = _export;
var DESCRIPTORS$8 = descriptors;
var ownKeys$8 = ownKeys$9;
var toIndexedObject$2 = toIndexedObject$b;
var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
var createProperty$3 = createProperty$6;
$$E({
	target: "Object",
	stat: true,
	sham: !DESCRIPTORS$8
}, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors$4(object$1) {
	var O = toIndexedObject$2(object$1);
	var getOwnPropertyDescriptor$11 = getOwnPropertyDescriptorModule$1.f;
	var keys$9 = ownKeys$8(O);
	var result = {};
	var index$1 = 0;
	var key, descriptor;
	while (keys$9.length > index$1) {
		descriptor = getOwnPropertyDescriptor$11(O, key = keys$9[index$1++]);
		if (descriptor !== void 0) createProperty$3(result, key, descriptor);
	}
	return result;
} });
var path$p = path$y;
var getOwnPropertyDescriptors$1 = path$p.Object.getOwnPropertyDescriptors;
var parent$13 = getOwnPropertyDescriptors$1;
var getOwnPropertyDescriptors = parent$13;
(function(module) {
	module.exports = getOwnPropertyDescriptors;
})(getOwnPropertyDescriptors$2);
var _Object$getOwnPropertyDescriptors = /* @__PURE__ */ getDefaultExportFromCjs(getOwnPropertyDescriptorsExports);
var definePropertiesExports$1 = {};
var defineProperties$4 = {
	get exports() {
		return definePropertiesExports$1;
	},
	set exports(v) {
		definePropertiesExports$1 = v;
	}
};
var definePropertiesExports = {};
var defineProperties$3 = {
	get exports() {
		return definePropertiesExports;
	},
	set exports(v) {
		definePropertiesExports = v;
	}
};
var $$D = _export;
var DESCRIPTORS$7 = descriptors;
var defineProperties$2 = objectDefineProperties.f;
$$D({
	target: "Object",
	stat: true,
	forced: Object.defineProperties !== defineProperties$2,
	sham: !DESCRIPTORS$7
}, { defineProperties: defineProperties$2 });
var path$o = path$y;
var Object$4 = path$o.Object;
var defineProperties$1 = defineProperties$3.exports = function defineProperties$6(T, D) {
	return Object$4.defineProperties(T, D);
};
if (Object$4.defineProperties.sham) defineProperties$1.sham = true;
var parent$12 = definePropertiesExports;
var defineProperties = parent$12;
(function(module) {
	module.exports = defineProperties;
})(defineProperties$4);
var _Object$defineProperties = /* @__PURE__ */ getDefaultExportFromCjs(definePropertiesExports$1);
var definePropertyExports$3 = {};
var defineProperty$a = {
	get exports() {
		return definePropertyExports$3;
	},
	set exports(v) {
		definePropertyExports$3 = v;
	}
};
var definePropertyExports$2 = {};
var defineProperty$9 = {
	get exports() {
		return definePropertyExports$2;
	},
	set exports(v) {
		definePropertyExports$2 = v;
	}
};
var $$C = _export;
var DESCRIPTORS$6 = descriptors;
var defineProperty$8 = objectDefineProperty.f;
$$C({
	target: "Object",
	stat: true,
	forced: Object.defineProperty !== defineProperty$8,
	sham: !DESCRIPTORS$6
}, { defineProperty: defineProperty$8 });
var path$n = path$y;
var Object$3 = path$n.Object;
var defineProperty$7 = defineProperty$9.exports = function defineProperty$11(it$1, key, desc) {
	return Object$3.defineProperty(it$1, key, desc);
};
if (Object$3.defineProperty.sham) defineProperty$7.sham = true;
var parent$11 = definePropertyExports$2;
var defineProperty$6 = parent$11;
(function(module) {
	module.exports = defineProperty$6;
})(defineProperty$a);
var _Object$defineProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs(definePropertyExports$3);
function _classCallCheck(instance, Constructor) {
	if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
var definePropertyExports$1 = {};
var defineProperty$5 = {
	get exports() {
		return definePropertyExports$1;
	},
	set exports(v) {
		definePropertyExports$1 = v;
	}
};
var definePropertyExports = {};
var defineProperty$4 = {
	get exports() {
		return definePropertyExports;
	},
	set exports(v) {
		definePropertyExports = v;
	}
};
var parent$10 = defineProperty$6;
var defineProperty$3 = parent$10;
var parent$$ = defineProperty$3;
var defineProperty$2 = parent$$;
(function(module) {
	module.exports = defineProperty$2;
})(defineProperty$4);
(function(module) {
	module.exports = definePropertyExports;
})(defineProperty$5);
var _Object$defineProperty = /* @__PURE__ */ getDefaultExportFromCjs(definePropertyExports$1);
var symbolExports$2 = {};
var symbol$6 = {
	get exports() {
		return symbolExports$2;
	},
	set exports(v) {
		symbolExports$2 = v;
	}
};
var symbolExports$1 = {};
var symbol$5 = {
	get exports() {
		return symbolExports$1;
	},
	set exports(v) {
		symbolExports$1 = v;
	}
};
var $TypeError$8 = TypeError;
var MAX_SAFE_INTEGER = 9007199254740991;
var doesNotExceedSafeInteger$2 = function(it$1) {
	if (it$1 > MAX_SAFE_INTEGER) throw $TypeError$8("Maximum allowed index exceeded");
	return it$1;
};
var fails$g = fails$w;
var wellKnownSymbol$6 = wellKnownSymbol$l;
var V8_VERSION$1 = engineV8Version;
var SPECIES$2 = wellKnownSymbol$6("species");
var arrayMethodHasSpeciesSupport$5 = function(METHOD_NAME) {
	return V8_VERSION$1 >= 51 || !fails$g(function() {
		var array$1 = [];
		var constructor = array$1.constructor = {};
		constructor[SPECIES$2] = function() {
			return { foo: 1 };
		};
		return array$1[METHOD_NAME](Boolean).foo !== 1;
	});
};
var $$B = _export;
var fails$f = fails$w;
var isArray$c = isArray$f;
var isObject$a = isObject$j;
var toObject$6 = toObject$d;
var lengthOfArrayLike$6 = lengthOfArrayLike$b;
var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
var createProperty$2 = createProperty$6;
var arraySpeciesCreate$1 = arraySpeciesCreate$3;
var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
var wellKnownSymbol$5 = wellKnownSymbol$l;
var V8_VERSION = engineV8Version;
var IS_CONCAT_SPREADABLE = wellKnownSymbol$5("isConcatSpreadable");
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$f(function() {
	var array$1 = [];
	array$1[IS_CONCAT_SPREADABLE] = false;
	return array$1.concat()[0] !== array$1;
});
var isConcatSpreadable = function(O) {
	if (!isObject$a(O)) return false;
	var spreadable = O[IS_CONCAT_SPREADABLE];
	return spreadable !== void 0 ? !!spreadable : isArray$c(O);
};
var FORCED$7 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4("concat");
$$B({
	target: "Array",
	proto: true,
	arity: 1,
	forced: FORCED$7
}, { concat: function concat$8(arg) {
	var O = toObject$6(this);
	var A = arraySpeciesCreate$1(O, 0);
	var n = 0;
	var i$2, k, length$1, len, E;
	for (i$2 = -1, length$1 = arguments.length; i$2 < length$1; i$2++) {
		E = i$2 === -1 ? O : arguments[i$2];
		if (isConcatSpreadable(E)) {
			len = lengthOfArrayLike$6(E);
			doesNotExceedSafeInteger$1(n + len);
			for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
		} else {
			doesNotExceedSafeInteger$1(n + 1);
			createProperty$2(A, n++, E);
		}
	}
	A.length = n;
	return A;
} });
var defineWellKnownSymbol$k = wellKnownSymbolDefine;
defineWellKnownSymbol$k("asyncIterator");
var defineWellKnownSymbol$j = wellKnownSymbolDefine;
defineWellKnownSymbol$j("hasInstance");
var defineWellKnownSymbol$i = wellKnownSymbolDefine;
defineWellKnownSymbol$i("isConcatSpreadable");
var defineWellKnownSymbol$h = wellKnownSymbolDefine;
defineWellKnownSymbol$h("iterator");
var defineWellKnownSymbol$g = wellKnownSymbolDefine;
defineWellKnownSymbol$g("match");
var defineWellKnownSymbol$f = wellKnownSymbolDefine;
defineWellKnownSymbol$f("matchAll");
var defineWellKnownSymbol$e = wellKnownSymbolDefine;
defineWellKnownSymbol$e("replace");
var defineWellKnownSymbol$d = wellKnownSymbolDefine;
defineWellKnownSymbol$d("search");
var defineWellKnownSymbol$c = wellKnownSymbolDefine;
defineWellKnownSymbol$c("species");
var defineWellKnownSymbol$b = wellKnownSymbolDefine;
defineWellKnownSymbol$b("split");
var defineWellKnownSymbol$a = wellKnownSymbolDefine;
var defineSymbolToPrimitive = symbolDefineToPrimitive;
defineWellKnownSymbol$a("toPrimitive");
defineSymbolToPrimitive();
var getBuiltIn$4 = getBuiltIn$c;
var defineWellKnownSymbol$9 = wellKnownSymbolDefine;
var setToStringTag$2 = setToStringTag$6;
defineWellKnownSymbol$9("toStringTag");
setToStringTag$2(getBuiltIn$4("Symbol"), "Symbol");
var defineWellKnownSymbol$8 = wellKnownSymbolDefine;
defineWellKnownSymbol$8("unscopables");
var global$9 = global$l;
var setToStringTag$1 = setToStringTag$6;
setToStringTag$1(global$9.JSON, "JSON", true);
var path$m = path$y;
var symbol$4 = path$m.Symbol;
var parent$_ = symbol$4;
var symbol$3 = parent$_;
var defineWellKnownSymbol$7 = wellKnownSymbolDefine;
defineWellKnownSymbol$7("dispose");
var parent$Z = symbol$3;
var symbol$2 = parent$Z;
var defineWellKnownSymbol$6 = wellKnownSymbolDefine;
defineWellKnownSymbol$6("asyncDispose");
var $$A = _export;
var getBuiltIn$3 = getBuiltIn$c;
var uncurryThis$d = functionUncurryThis;
var Symbol$4 = getBuiltIn$3("Symbol");
var keyFor = Symbol$4.keyFor;
var thisSymbolValue$1 = uncurryThis$d(Symbol$4.prototype.valueOf);
$$A({
	target: "Symbol",
	stat: true
}, { isRegistered: function isRegistered(value) {
	try {
		return keyFor(thisSymbolValue$1(value)) !== void 0;
	} catch (error) {
		return false;
	}
} });
var $$z = _export;
var shared = sharedExports;
var getBuiltIn$2 = getBuiltIn$c;
var uncurryThis$c = functionUncurryThis;
var isSymbol = isSymbol$5;
var wellKnownSymbol$4 = wellKnownSymbol$l;
var Symbol$3 = getBuiltIn$2("Symbol");
var $isWellKnown = Symbol$3.isWellKnown;
var getOwnPropertyNames$4 = getBuiltIn$2("Object", "getOwnPropertyNames");
var thisSymbolValue = uncurryThis$c(Symbol$3.prototype.valueOf);
var WellKnownSymbolsStore = shared("wks");
for (var i = 0, symbolKeys = getOwnPropertyNames$4(Symbol$3), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) try {
	var symbolKey = symbolKeys[i];
	if (isSymbol(Symbol$3[symbolKey])) wellKnownSymbol$4(symbolKey);
} catch (error) {}
$$z({
	target: "Symbol",
	stat: true,
	forced: true
}, { isWellKnown: function isWellKnown(value) {
	if ($isWellKnown && $isWellKnown(value)) return true;
	try {
		var symbol$8 = thisSymbolValue(value);
		for (var j = 0, keys$9 = getOwnPropertyNames$4(WellKnownSymbolsStore), keysLength = keys$9.length; j < keysLength; j++) if (WellKnownSymbolsStore[keys$9[j]] == symbol$8) return true;
	} catch (error) {}
	return false;
} });
var defineWellKnownSymbol$5 = wellKnownSymbolDefine;
defineWellKnownSymbol$5("matcher");
var defineWellKnownSymbol$4 = wellKnownSymbolDefine;
defineWellKnownSymbol$4("metadataKey");
var defineWellKnownSymbol$3 = wellKnownSymbolDefine;
defineWellKnownSymbol$3("observable");
var defineWellKnownSymbol$2 = wellKnownSymbolDefine;
defineWellKnownSymbol$2("metadata");
var defineWellKnownSymbol$1 = wellKnownSymbolDefine;
defineWellKnownSymbol$1("patternMatch");
var defineWellKnownSymbol = wellKnownSymbolDefine;
defineWellKnownSymbol("replaceAll");
var parent$Y = symbol$2;
var symbol$1 = parent$Y;
(function(module) {
	module.exports = symbol$1;
})(symbol$5);
(function(module) {
	module.exports = symbolExports$1;
})(symbol$6);
var _Symbol$1 = /* @__PURE__ */ getDefaultExportFromCjs(symbolExports$2);
var iteratorExports$1 = {};
var iterator$5 = {
	get exports() {
		return iteratorExports$1;
	},
	set exports(v) {
		iteratorExports$1 = v;
	}
};
var iteratorExports = {};
var iterator$4 = {
	get exports() {
		return iteratorExports;
	},
	set exports(v) {
		iteratorExports = v;
	}
};
var WrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
var iterator$3 = WrappedWellKnownSymbolModule$1.f("iterator");
var parent$X = iterator$3;
var iterator$2 = parent$X;
var parent$W = iterator$2;
var iterator$1 = parent$W;
var parent$V = iterator$1;
var iterator = parent$V;
(function(module) {
	module.exports = iterator;
})(iterator$4);
(function(module) {
	module.exports = iteratorExports;
})(iterator$5);
var _Symbol$iterator = /* @__PURE__ */ getDefaultExportFromCjs(iteratorExports$1);
function _typeof(obj) {
	"@babel/helpers - typeof";
	return _typeof = "function" == typeof _Symbol$1 && "symbol" == typeof _Symbol$iterator ? function(obj$1) {
		return typeof obj$1;
	} : function(obj$1) {
		return obj$1 && "function" == typeof _Symbol$1 && obj$1.constructor === _Symbol$1 && obj$1 !== _Symbol$1.prototype ? "symbol" : typeof obj$1;
	}, _typeof(obj);
}
var toPrimitiveExports$1 = {};
var toPrimitive$5 = {
	get exports() {
		return toPrimitiveExports$1;
	},
	set exports(v) {
		toPrimitiveExports$1 = v;
	}
};
var toPrimitiveExports = {};
var toPrimitive$4 = {
	get exports() {
		return toPrimitiveExports;
	},
	set exports(v) {
		toPrimitiveExports = v;
	}
};
var WrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
var toPrimitive$3 = WrappedWellKnownSymbolModule.f("toPrimitive");
var parent$U = toPrimitive$3;
var toPrimitive$2 = parent$U;
var parent$T = toPrimitive$2;
var toPrimitive$1 = parent$T;
var parent$S = toPrimitive$1;
var toPrimitive = parent$S;
(function(module) {
	module.exports = toPrimitive;
})(toPrimitive$4);
(function(module) {
	module.exports = toPrimitiveExports;
})(toPrimitive$5);
var _Symbol$toPrimitive = /* @__PURE__ */ getDefaultExportFromCjs(toPrimitiveExports$1);
function _toPrimitive(input, hint) {
	if (_typeof(input) !== "object" || input === null) return input;
	var prim = input[_Symbol$toPrimitive];
	if (prim !== void 0) {
		var res = prim.call(input, hint || "default");
		if (_typeof(res) !== "object") return res;
		throw new TypeError("@@toPrimitive must return a primitive value.");
	}
	return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
	var key = _toPrimitive(arg, "string");
	return _typeof(key) === "symbol" ? key : String(key);
}
function _defineProperties(target, props) {
	for (var i$2 = 0; i$2 < props.length; i$2++) {
		var descriptor = props[i$2];
		descriptor.enumerable = descriptor.enumerable || false;
		descriptor.configurable = true;
		if ("value" in descriptor) descriptor.writable = true;
		_Object$defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
	}
}
function _createClass(Constructor, protoProps, staticProps) {
	if (protoProps) _defineProperties(Constructor.prototype, protoProps);
	if (staticProps) _defineProperties(Constructor, staticProps);
	_Object$defineProperty(Constructor, "prototype", { writable: false });
	return Constructor;
}
function _defineProperty(obj, key, value) {
	key = _toPropertyKey(key);
	if (key in obj) _Object$defineProperty(obj, key, {
		value,
		enumerable: true,
		configurable: true,
		writable: true
	});
	else obj[key] = value;
	return obj;
}
var isArrayExports$2 = {};
var isArray$b = {
	get exports() {
		return isArrayExports$2;
	},
	set exports(v) {
		isArrayExports$2 = v;
	}
};
var isArrayExports$1 = {};
var isArray$a = {
	get exports() {
		return isArrayExports$1;
	},
	set exports(v) {
		isArrayExports$1 = v;
	}
};
var $$y = _export;
var isArray$9 = isArray$f;
$$y({
	target: "Array",
	stat: true
}, { isArray: isArray$9 });
var path$l = path$y;
var isArray$8 = path$l.Array.isArray;
var parent$R = isArray$8;
var isArray$7 = parent$R;
var parent$Q = isArray$7;
var isArray$6 = parent$Q;
var parent$P = isArray$6;
var isArray$5 = parent$P;
(function(module) {
	module.exports = isArray$5;
})(isArray$a);
(function(module) {
	module.exports = isArrayExports$1;
})(isArray$b);
var _Array$isArray$1 = /* @__PURE__ */ getDefaultExportFromCjs(isArrayExports$2);
function _arrayWithHoles(arr) {
	if (_Array$isArray$1(arr)) return arr;
}
function _iterableToArrayLimit(arr, i$2) {
	var _i = null == arr ? null : "undefined" != typeof _Symbol$1 && _getIteratorMethod(arr) || arr["@@iterator"];
	if (null != _i) {
		var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1;
		try {
			if (_x = (_i = _i.call(arr)).next, 0 === i$2) {
				if (Object(_i) !== _i) return;
				_n = !1;
			} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i$2); _n = !0);
		} catch (err) {
			_d = !0, _e = err;
		} finally {
			try {
				if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
			} finally {
				if (_d) throw _e;
			}
		}
		return _arr;
	}
}
var sliceExports$2 = {};
var slice$7 = {
	get exports() {
		return sliceExports$2;
	},
	set exports(v) {
		sliceExports$2 = v;
	}
};
var sliceExports$1 = {};
var slice$6 = {
	get exports() {
		return sliceExports$1;
	},
	set exports(v) {
		sliceExports$1 = v;
	}
};
var $$x = _export;
var isArray$4 = isArray$f;
var isConstructor$1 = isConstructor$4;
var isObject$9 = isObject$j;
var toAbsoluteIndex$2 = toAbsoluteIndex$5;
var lengthOfArrayLike$5 = lengthOfArrayLike$b;
var toIndexedObject$1 = toIndexedObject$b;
var createProperty$1 = createProperty$6;
var wellKnownSymbol$3 = wellKnownSymbol$l;
var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
var nativeSlice = arraySlice$5;
var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3("slice");
var SPECIES$1 = wellKnownSymbol$3("species");
var $Array = Array;
var max$1 = Math.max;
$$x({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$3
}, { slice: function slice$9(start, end) {
	var O = toIndexedObject$1(this);
	var length$1 = lengthOfArrayLike$5(O);
	var k = toAbsoluteIndex$2(start, length$1);
	var fin = toAbsoluteIndex$2(end === void 0 ? length$1 : end, length$1);
	var Constructor, result, n;
	if (isArray$4(O)) {
		Constructor = O.constructor;
		if (isConstructor$1(Constructor) && (Constructor === $Array || isArray$4(Constructor.prototype))) Constructor = void 0;
		else if (isObject$9(Constructor)) {
			Constructor = Constructor[SPECIES$1];
			if (Constructor === null) Constructor = void 0;
		}
		if (Constructor === $Array || Constructor === void 0) return nativeSlice(O, k, fin);
	}
	result = new (Constructor === void 0 ? $Array : Constructor)(max$1(fin - k, 0));
	for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
	result.length = n;
	return result;
} });
var entryVirtual$g = entryVirtual$i;
var slice$5 = entryVirtual$g("Array").slice;
var isPrototypeOf$h = objectIsPrototypeOf;
var method$e = slice$5;
var ArrayPrototype$e = Array.prototype;
var slice$4 = function(it$1) {
	var own = it$1.slice;
	return it$1 === ArrayPrototype$e || isPrototypeOf$h(ArrayPrototype$e, it$1) && own === ArrayPrototype$e.slice ? method$e : own;
};
var parent$O = slice$4;
var slice$3 = parent$O;
var parent$N = slice$3;
var slice$2 = parent$N;
var parent$M = slice$2;
var slice$1 = parent$M;
(function(module) {
	module.exports = slice$1;
})(slice$6);
(function(module) {
	module.exports = sliceExports$1;
})(slice$7);
var _sliceInstanceProperty$1 = /* @__PURE__ */ getDefaultExportFromCjs(sliceExports$2);
var fromExports$1 = {};
var from$3 = {
	get exports() {
		return fromExports$1;
	},
	set exports(v) {
		fromExports$1 = v;
	}
};
var fromExports = {};
var from$2 = {
	get exports() {
		return fromExports;
	},
	set exports(v) {
		fromExports = v;
	}
};
var parent$L = from$4;
var from$1 = parent$L;
var parent$K = from$1;
var from = parent$K;
(function(module) {
	module.exports = from;
})(from$2);
(function(module) {
	module.exports = fromExports;
})(from$3);
var _Array$from = /* @__PURE__ */ getDefaultExportFromCjs(fromExports$1);
function _arrayLikeToArray$7(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
function _unsupportedIterableToArray$7(o, minLen) {
	var _context;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$7(o, minLen);
	var n = _sliceInstanceProperty$1(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$7(o, minLen);
}
function _nonIterableRest() {
	throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(arr, i$2) {
	return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i$2) || _unsupportedIterableToArray$7(arr, i$2) || _nonIterableRest();
}
function _arrayWithoutHoles(arr) {
	if (_Array$isArray$1(arr)) return _arrayLikeToArray$7(arr);
}
function _iterableToArray(iter) {
	if (typeof _Symbol$1 !== "undefined" && _getIteratorMethod(iter) != null || iter["@@iterator"] != null) return _Array$from(iter);
}
function _nonIterableSpread() {
	throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray(arr) {
	return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$7(arr) || _nonIterableSpread();
}
var symbolExports = {};
var symbol = {
	get exports() {
		return symbolExports;
	},
	set exports(v) {
		symbolExports = v;
	}
};
(function(module) {
	module.exports = symbol$3;
})(symbol);
var _Symbol = /* @__PURE__ */ getDefaultExportFromCjs(symbolExports);
var concatExports = {};
var concat$3 = {
	get exports() {
		return concatExports;
	},
	set exports(v) {
		concatExports = v;
	}
};
var entryVirtual$f = entryVirtual$i;
var concat$2 = entryVirtual$f("Array").concat;
var isPrototypeOf$g = objectIsPrototypeOf;
var method$d = concat$2;
var ArrayPrototype$d = Array.prototype;
var concat$1 = function(it$1) {
	var own = it$1.concat;
	return it$1 === ArrayPrototype$d || isPrototypeOf$g(ArrayPrototype$d, it$1) && own === ArrayPrototype$d.concat ? method$d : own;
};
var parent$J = concat$1;
var concat = parent$J;
(function(module) {
	module.exports = concat;
})(concat$3);
var _concatInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(concatExports);
var sliceExports = {};
var slice = {
	get exports() {
		return sliceExports;
	},
	set exports(v) {
		sliceExports = v;
	}
};
(function(module) {
	module.exports = slice$3;
})(slice);
var _sliceInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(sliceExports);
var ownKeysExports = {};
var ownKeys$7 = {
	get exports() {
		return ownKeysExports;
	},
	set exports(v) {
		ownKeysExports = v;
	}
};
var $$w = _export;
var ownKeys$6 = ownKeys$9;
$$w({
	target: "Reflect",
	stat: true
}, { ownKeys: ownKeys$6 });
var path$k = path$y;
var ownKeys$5 = path$k.Reflect.ownKeys;
var parent$I = ownKeys$5;
var ownKeys$4 = parent$I;
(function(module) {
	module.exports = ownKeys$4;
})(ownKeys$7);
var isArrayExports = {};
var isArray$3 = {
	get exports() {
		return isArrayExports;
	},
	set exports(v) {
		isArrayExports = v;
	}
};
(function(module) {
	module.exports = isArray$7;
})(isArray$3);
var _Array$isArray = /* @__PURE__ */ getDefaultExportFromCjs(isArrayExports);
var mapExports$1 = {};
var map$6 = {
	get exports() {
		return mapExports$1;
	},
	set exports(v) {
		mapExports$1 = v;
	}
};
var $$v = _export;
var $map = arrayIteration.map;
var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2("map");
$$v({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$2
}, { map: function map$8(callbackfn) {
	return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$e = entryVirtual$i;
var map$5 = entryVirtual$e("Array").map;
var isPrototypeOf$f = objectIsPrototypeOf;
var method$c = map$5;
var ArrayPrototype$c = Array.prototype;
var map$4 = function(it$1) {
	var own = it$1.map;
	return it$1 === ArrayPrototype$c || isPrototypeOf$f(ArrayPrototype$c, it$1) && own === ArrayPrototype$c.map ? method$c : own;
};
var parent$H = map$4;
var map$3 = parent$H;
(function(module) {
	module.exports = map$3;
})(map$6);
var _mapInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(mapExports$1);
var keysExports = {};
var keys$2 = {
	get exports() {
		return keysExports;
	},
	set exports(v) {
		keysExports = v;
	}
};
var $$u = _export;
var toObject$5 = toObject$d;
var nativeKeys = objectKeys$4;
var fails$e = fails$w;
var FAILS_ON_PRIMITIVES$3 = fails$e(function() {
	nativeKeys(1);
});
$$u({
	target: "Object",
	stat: true,
	forced: FAILS_ON_PRIMITIVES$3
}, { keys: function keys$9(it$1) {
	return nativeKeys(toObject$5(it$1));
} });
var path$j = path$y;
var keys$1 = path$j.Object.keys;
var parent$G = keys$1;
var keys = parent$G;
(function(module) {
	module.exports = keys;
})(keys$2);
var _Object$keys = /* @__PURE__ */ getDefaultExportFromCjs(keysExports);
var nowExports = {};
var now$3 = {
	get exports() {
		return nowExports;
	},
	set exports(v) {
		nowExports = v;
	}
};
var $$t = _export;
var uncurryThis$b = functionUncurryThis;
var $Date = Date;
var thisTimeValue = uncurryThis$b($Date.prototype.getTime);
$$t({
	target: "Date",
	stat: true
}, { now: function now$5() {
	return thisTimeValue(new $Date());
} });
var path$i = path$y;
var now$2 = path$i.Date.now;
var parent$F = now$2;
var now$1 = parent$F;
(function(module) {
	module.exports = now$1;
})(now$3);
var _Date$now = /* @__PURE__ */ getDefaultExportFromCjs(nowExports);
var forEachExports = {};
var forEach$6 = {
	get exports() {
		return forEachExports;
	},
	set exports(v) {
		forEachExports = v;
	}
};
var fails$d = fails$w;
var arrayMethodIsStrict$6 = function(METHOD_NAME, argument) {
	var method$11 = [][METHOD_NAME];
	return !!method$11 && fails$d(function() {
		method$11.call(null, argument || function() {
			return 1;
		}, 1);
	});
};
var $forEach = arrayIteration.forEach;
var arrayMethodIsStrict$5 = arrayMethodIsStrict$6;
var STRICT_METHOD$3 = arrayMethodIsStrict$5("forEach");
var arrayForEach = !STRICT_METHOD$3 ? function forEach$11(callbackfn) {
	return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} : [].forEach;
var $$s = _export;
var forEach$5 = arrayForEach;
$$s({
	target: "Array",
	proto: true,
	forced: [].forEach != forEach$5
}, { forEach: forEach$5 });
var entryVirtual$d = entryVirtual$i;
var forEach$4 = entryVirtual$d("Array").forEach;
var parent$E = forEach$4;
var forEach$3 = parent$E;
var classof$4 = classof$d;
var hasOwn$4 = hasOwnProperty_1;
var isPrototypeOf$e = objectIsPrototypeOf;
var method$b = forEach$3;
var ArrayPrototype$b = Array.prototype;
var DOMIterables$1 = {
	DOMTokenList: true,
	NodeList: true
};
var forEach$2 = function(it$1) {
	var own = it$1.forEach;
	return it$1 === ArrayPrototype$b || isPrototypeOf$e(ArrayPrototype$b, it$1) && own === ArrayPrototype$b.forEach || hasOwn$4(DOMIterables$1, classof$4(it$1)) ? method$b : own;
};
(function(module) {
	module.exports = forEach$2;
})(forEach$6);
var _forEachInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(forEachExports);
var reverseExports = {};
var reverse$3 = {
	get exports() {
		return reverseExports;
	},
	set exports(v) {
		reverseExports = v;
	}
};
var $$r = _export;
var uncurryThis$a = functionUncurryThis;
var isArray$2 = isArray$f;
var nativeReverse = uncurryThis$a([].reverse);
var test$1 = [1, 2];
$$r({
	target: "Array",
	proto: true,
	forced: String(test$1) === String(test$1.reverse())
}, { reverse: function reverse$9() {
	if (isArray$2(this)) this.length = this.length;
	return nativeReverse(this);
} });
var entryVirtual$c = entryVirtual$i;
var reverse$2 = entryVirtual$c("Array").reverse;
var isPrototypeOf$d = objectIsPrototypeOf;
var method$a = reverse$2;
var ArrayPrototype$a = Array.prototype;
var reverse$1 = function(it$1) {
	var own = it$1.reverse;
	return it$1 === ArrayPrototype$a || isPrototypeOf$d(ArrayPrototype$a, it$1) && own === ArrayPrototype$a.reverse ? method$a : own;
};
var parent$D = reverse$1;
var reverse = parent$D;
(function(module) {
	module.exports = reverse;
})(reverse$3);
var _reverseInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(reverseExports);
var spliceExports = {};
var splice$4 = {
	get exports() {
		return spliceExports;
	},
	set exports(v) {
		spliceExports = v;
	}
};
var DESCRIPTORS$5 = descriptors;
var isArray$1 = isArray$f;
var $TypeError$7 = TypeError;
var getOwnPropertyDescriptor$4 = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$5 && !function() {
	if (this !== void 0) return true;
	try {
		Object.defineProperty([], "length", { writable: false }).length = 1;
	} catch (error) {
		return error instanceof TypeError;
	}
}();
var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function(O, length$1) {
	if (isArray$1(O) && !getOwnPropertyDescriptor$4(O, "length").writable) throw $TypeError$7("Cannot set read only .length");
	return O.length = length$1;
} : function(O, length$1) {
	return O.length = length$1;
};
var tryToString$2 = tryToString$6;
var $TypeError$6 = TypeError;
var deletePropertyOrThrow$2 = function(O, P) {
	if (!delete O[P]) throw $TypeError$6("Cannot delete property " + tryToString$2(P) + " of " + tryToString$2(O));
};
var $$q = _export;
var toObject$4 = toObject$d;
var toAbsoluteIndex$1 = toAbsoluteIndex$5;
var toIntegerOrInfinity = toIntegerOrInfinity$4;
var lengthOfArrayLike$4 = lengthOfArrayLike$b;
var setArrayLength = arraySetLength;
var doesNotExceedSafeInteger = doesNotExceedSafeInteger$2;
var arraySpeciesCreate = arraySpeciesCreate$3;
var createProperty = createProperty$6;
var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1("splice");
var max = Math.max;
var min = Math.min;
$$q({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT$1
}, { splice: function splice$6(start, deleteCount) {
	var O = toObject$4(this);
	var len = lengthOfArrayLike$4(O);
	var actualStart = toAbsoluteIndex$1(start, len);
	var argumentsLength = arguments.length;
	var insertCount, actualDeleteCount, A, k, from$9, to;
	if (argumentsLength === 0) insertCount = actualDeleteCount = 0;
	else if (argumentsLength === 1) {
		insertCount = 0;
		actualDeleteCount = len - actualStart;
	} else {
		insertCount = argumentsLength - 2;
		actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
	}
	doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
	A = arraySpeciesCreate(O, actualDeleteCount);
	for (k = 0; k < actualDeleteCount; k++) {
		from$9 = actualStart + k;
		if (from$9 in O) createProperty(A, k, O[from$9]);
	}
	A.length = actualDeleteCount;
	if (insertCount < actualDeleteCount) {
		for (k = actualStart; k < len - actualDeleteCount; k++) {
			from$9 = k + actualDeleteCount;
			to = k + insertCount;
			if (from$9 in O) O[to] = O[from$9];
			else deletePropertyOrThrow$1(O, to);
		}
		for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow$1(O, k - 1);
	} else if (insertCount > actualDeleteCount) for (k = len - actualDeleteCount; k > actualStart; k--) {
		from$9 = k + actualDeleteCount - 1;
		to = k + insertCount - 1;
		if (from$9 in O) O[to] = O[from$9];
		else deletePropertyOrThrow$1(O, to);
	}
	for (k = 0; k < insertCount; k++) O[k + actualStart] = arguments[k + 2];
	setArrayLength(O, len - actualDeleteCount + insertCount);
	return A;
} });
var entryVirtual$b = entryVirtual$i;
var splice$3 = entryVirtual$b("Array").splice;
var isPrototypeOf$c = objectIsPrototypeOf;
var method$9 = splice$3;
var ArrayPrototype$9 = Array.prototype;
var splice$2 = function(it$1) {
	var own = it$1.splice;
	return it$1 === ArrayPrototype$9 || isPrototypeOf$c(ArrayPrototype$9, it$1) && own === ArrayPrototype$9.splice ? method$9 : own;
};
var parent$C = splice$2;
var splice$1 = parent$C;
(function(module) {
	module.exports = splice$1;
})(splice$4);
var _spliceInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(spliceExports);
var includesExports = {};
var includes$4 = {
	get exports() {
		return includesExports;
	},
	set exports(v) {
		includesExports = v;
	}
};
var $$p = _export;
var $includes = arrayIncludes.includes;
var fails$c = fails$w;
var BROKEN_ON_SPARSE = fails$c(function() {
	return !Array(1).includes();
});
$$p({
	target: "Array",
	proto: true,
	forced: BROKEN_ON_SPARSE
}, { includes: function includes$5(el) {
	return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$a = entryVirtual$i;
var includes$3 = entryVirtual$a("Array").includes;
var isObject$8 = isObject$j;
var classof$3 = classofRaw$2;
var wellKnownSymbol$2 = wellKnownSymbol$l;
var MATCH$1 = wellKnownSymbol$2("match");
var isRegexp = function(it$1) {
	var isRegExp$1;
	return isObject$8(it$1) && ((isRegExp$1 = it$1[MATCH$1]) !== void 0 ? !!isRegExp$1 : classof$3(it$1) == "RegExp");
};
var isRegExp = isRegexp;
var $TypeError$5 = TypeError;
var notARegexp = function(it$1) {
	if (isRegExp(it$1)) throw $TypeError$5("The method doesn't accept regular expressions");
	return it$1;
};
var wellKnownSymbol$1 = wellKnownSymbol$l;
var MATCH = wellKnownSymbol$1("match");
var correctIsRegexpLogic = function(METHOD_NAME) {
	var regexp = /./;
	try {
		"/./"[METHOD_NAME](regexp);
	} catch (error1) {
		try {
			regexp[MATCH] = false;
			return "/./"[METHOD_NAME](regexp);
		} catch (error2) {}
	}
	return false;
};
var $$o = _export;
var uncurryThis$9 = functionUncurryThis;
var notARegExp = notARegexp;
var requireObjectCoercible$1 = requireObjectCoercible$5;
var toString$4 = toString$a;
var correctIsRegExpLogic = correctIsRegexpLogic;
var stringIndexOf = uncurryThis$9("".indexOf);
$$o({
	target: "String",
	proto: true,
	forced: !correctIsRegExpLogic("includes")
}, { includes: function includes$5(searchString) {
	return !!~stringIndexOf(toString$4(requireObjectCoercible$1(this)), toString$4(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$9 = entryVirtual$i;
var includes$2 = entryVirtual$9("String").includes;
var isPrototypeOf$b = objectIsPrototypeOf;
var arrayMethod = includes$3;
var stringMethod = includes$2;
var ArrayPrototype$8 = Array.prototype;
var StringPrototype$1 = String.prototype;
var includes$1 = function(it$1) {
	var own = it$1.includes;
	if (it$1 === ArrayPrototype$8 || isPrototypeOf$b(ArrayPrototype$8, it$1) && own === ArrayPrototype$8.includes) return arrayMethod;
	if (typeof it$1 == "string" || it$1 === StringPrototype$1 || isPrototypeOf$b(StringPrototype$1, it$1) && own === StringPrototype$1.includes) return stringMethod;
	return own;
};
var parent$B = includes$1;
var includes = parent$B;
(function(module) {
	module.exports = includes;
})(includes$4);
var _includesInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(includesExports);
var getPrototypeOfExports$2 = {};
var getPrototypeOf$7 = {
	get exports() {
		return getPrototypeOfExports$2;
	},
	set exports(v) {
		getPrototypeOfExports$2 = v;
	}
};
var $$n = _export;
var fails$b = fails$w;
var toObject$3 = toObject$d;
var nativeGetPrototypeOf = objectGetPrototypeOf;
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
var FAILS_ON_PRIMITIVES$2 = fails$b(function() {
	nativeGetPrototypeOf(1);
});
$$n({
	target: "Object",
	stat: true,
	forced: FAILS_ON_PRIMITIVES$2,
	sham: !CORRECT_PROTOTYPE_GETTER
}, { getPrototypeOf: function getPrototypeOf$11(it$1) {
	return nativeGetPrototypeOf(toObject$3(it$1));
} });
var path$h = path$y;
var getPrototypeOf$6 = path$h.Object.getPrototypeOf;
var parent$A = getPrototypeOf$6;
var getPrototypeOf$5 = parent$A;
(function(module) {
	module.exports = getPrototypeOf$5;
})(getPrototypeOf$7);
var _Object$getPrototypeOf$1 = /* @__PURE__ */ getDefaultExportFromCjs(getPrototypeOfExports$2);
var filterExports = {};
var filter$3 = {
	get exports() {
		return filterExports;
	},
	set exports(v) {
		filterExports = v;
	}
};
var $$m = _export;
var $filter = arrayIteration.filter;
var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
$$m({
	target: "Array",
	proto: true,
	forced: !HAS_SPECIES_SUPPORT
}, { filter: function filter$5(callbackfn) {
	return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$8 = entryVirtual$i;
var filter$2 = entryVirtual$8("Array").filter;
var isPrototypeOf$a = objectIsPrototypeOf;
var method$8 = filter$2;
var ArrayPrototype$7 = Array.prototype;
var filter$1 = function(it$1) {
	var own = it$1.filter;
	return it$1 === ArrayPrototype$7 || isPrototypeOf$a(ArrayPrototype$7, it$1) && own === ArrayPrototype$7.filter ? method$8 : own;
};
var parent$z = filter$1;
var filter = parent$z;
(function(module) {
	module.exports = filter;
})(filter$3);
var _filterInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(filterExports);
var valuesExports$1 = {};
var values$6 = {
	get exports() {
		return valuesExports$1;
	},
	set exports(v) {
		valuesExports$1 = v;
	}
};
var DESCRIPTORS$4 = descriptors;
var uncurryThis$8 = functionUncurryThis;
var objectKeys = objectKeys$4;
var toIndexedObject = toIndexedObject$b;
var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
var propertyIsEnumerable = uncurryThis$8($propertyIsEnumerable);
var push$2 = uncurryThis$8([].push);
var createMethod$2 = function(TO_ENTRIES) {
	return function(it$1) {
		var O = toIndexedObject(it$1);
		var keys$9 = objectKeys(O);
		var length$1 = keys$9.length;
		var i$2 = 0;
		var result = [];
		var key;
		while (length$1 > i$2) {
			key = keys$9[i$2++];
			if (!DESCRIPTORS$4 || propertyIsEnumerable(O, key)) push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
		}
		return result;
	};
};
var objectToArray = {
	entries: createMethod$2(true),
	values: createMethod$2(false)
};
var $$l = _export;
var $values = objectToArray.values;
$$l({
	target: "Object",
	stat: true
}, { values: function values$8(O) {
	return $values(O);
} });
var path$g = path$y;
var values$5 = path$g.Object.values;
var parent$y = values$5;
var values$4 = parent$y;
(function(module) {
	module.exports = values$4;
})(values$6);
var _parseIntExports = {};
var _parseInt$3 = {
	get exports() {
		return _parseIntExports;
	},
	set exports(v) {
		_parseIntExports = v;
	}
};
var whitespaces$4 = "	\n\v\f\r \xA0               \u2028\u2029";
var uncurryThis$7 = functionUncurryThis;
var requireObjectCoercible = requireObjectCoercible$5;
var toString$3 = toString$a;
var whitespaces$3 = whitespaces$4;
var replace = uncurryThis$7("".replace);
var ltrim = RegExp("^[" + whitespaces$3 + "]+");
var rtrim = RegExp("(^|[^" + whitespaces$3 + "])[" + whitespaces$3 + "]+$");
var createMethod$1 = function(TYPE) {
	return function($this) {
		var string$1 = toString$3(requireObjectCoercible($this));
		if (TYPE & 1) string$1 = replace(string$1, ltrim, "");
		if (TYPE & 2) string$1 = replace(string$1, rtrim, "$1");
		return string$1;
	};
};
var stringTrim = {
	start: createMethod$1(1),
	end: createMethod$1(2),
	trim: createMethod$1(3)
};
var global$8 = global$l;
var fails$a = fails$w;
var uncurryThis$6 = functionUncurryThis;
var toString$2 = toString$a;
var trim$5 = stringTrim.trim;
var whitespaces$2 = whitespaces$4;
var $parseInt$1 = global$8.parseInt;
var Symbol$2 = global$8.Symbol;
var ITERATOR$1 = Symbol$2 && Symbol$2.iterator;
var hex = /^[+-]?0x/i;
var exec = uncurryThis$6(hex.exec);
var FORCED$6 = $parseInt$1(whitespaces$2 + "08") !== 8 || $parseInt$1(whitespaces$2 + "0x16") !== 22 || ITERATOR$1 && !fails$a(function() {
	$parseInt$1(Object(ITERATOR$1));
});
var numberParseInt = FORCED$6 ? function parseInt$1(string$1, radix) {
	var S = trim$5(toString$2(string$1));
	return $parseInt$1(S, radix >>> 0 || (exec(hex, S) ? 16 : 10));
} : $parseInt$1;
var $$k = _export;
var $parseInt = numberParseInt;
$$k({
	global: true,
	forced: parseInt != $parseInt
}, { parseInt: $parseInt });
var path$f = path$y;
var _parseInt$2 = path$f.parseInt;
var parent$x = _parseInt$2;
var _parseInt$1 = parent$x;
(function(module) {
	module.exports = _parseInt$1;
})(_parseInt$3);
var _parseInt = /* @__PURE__ */ getDefaultExportFromCjs(_parseIntExports);
var indexOfExports = {};
var indexOf$3 = {
	get exports() {
		return indexOfExports;
	},
	set exports(v) {
		indexOfExports = v;
	}
};
var $$j = _export;
var uncurryThis$5 = functionUncurryThisClause;
var $indexOf = arrayIncludes.indexOf;
var arrayMethodIsStrict$4 = arrayMethodIsStrict$6;
var nativeIndexOf = uncurryThis$5([].indexOf);
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED$5 = NEGATIVE_ZERO || !arrayMethodIsStrict$4("indexOf");
$$j({
	target: "Array",
	proto: true,
	forced: FORCED$5
}, { indexOf: function indexOf$6(searchElement) {
	var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
	return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
} });
var entryVirtual$7 = entryVirtual$i;
var indexOf$2 = entryVirtual$7("Array").indexOf;
var isPrototypeOf$9 = objectIsPrototypeOf;
var method$7 = indexOf$2;
var ArrayPrototype$6 = Array.prototype;
var indexOf$1 = function(it$1) {
	var own = it$1.indexOf;
	return it$1 === ArrayPrototype$6 || isPrototypeOf$9(ArrayPrototype$6, it$1) && own === ArrayPrototype$6.indexOf ? method$7 : own;
};
var parent$w = indexOf$1;
var indexOf = parent$w;
(function(module) {
	module.exports = indexOf;
})(indexOf$3);
var _indexOfInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(indexOfExports);
var trimExports = {};
var trim$4 = {
	get exports() {
		return trimExports;
	},
	set exports(v) {
		trimExports = v;
	}
};
var PROPER_FUNCTION_NAME = functionName.PROPER;
var fails$9 = fails$w;
var whitespaces$1 = whitespaces$4;
var non = "​…᠎";
var stringTrimForced = function(METHOD_NAME) {
	return fails$9(function() {
		return !!whitespaces$1[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces$1[METHOD_NAME].name !== METHOD_NAME;
	});
};
var $$i = _export;
var $trim = stringTrim.trim;
var forcedStringTrimMethod = stringTrimForced;
$$i({
	target: "String",
	proto: true,
	forced: forcedStringTrimMethod("trim")
}, { trim: function trim$6() {
	return $trim(this);
} });
var entryVirtual$6 = entryVirtual$i;
var trim$3 = entryVirtual$6("String").trim;
var isPrototypeOf$8 = objectIsPrototypeOf;
var method$6 = trim$3;
var StringPrototype = String.prototype;
var trim$2 = function(it$1) {
	var own = it$1.trim;
	return typeof it$1 == "string" || it$1 === StringPrototype || isPrototypeOf$8(StringPrototype, it$1) && own === StringPrototype.trim ? method$6 : own;
};
var parent$v = trim$2;
var trim$1 = parent$v;
(function(module) {
	module.exports = trim$1;
})(trim$4);
var createExports$2 = {};
var create$9 = {
	get exports() {
		return createExports$2;
	},
	set exports(v) {
		createExports$2 = v;
	}
};
var $$h = _export;
var DESCRIPTORS$3 = descriptors;
var create$8 = objectCreate;
$$h({
	target: "Object",
	stat: true,
	sham: !DESCRIPTORS$3
}, { create: create$8 });
var path$e = path$y;
var Object$2 = path$e.Object;
var create$7 = function create$11(P, D) {
	return Object$2.create(P, D);
};
var parent$u = create$7;
var create$6 = parent$u;
(function(module) {
	module.exports = create$6;
})(create$9);
var _Object$create$1 = /* @__PURE__ */ getDefaultExportFromCjs(createExports$2);
var stringifyExports = {};
var stringify$2 = {
	get exports() {
		return stringifyExports;
	},
	set exports(v) {
		stringifyExports = v;
	}
};
var path$d = path$y;
var apply$2 = functionApply;
if (!path$d.JSON) path$d.JSON = { stringify: JSON.stringify };
var stringify$1 = function stringify$4(it$1, replacer, space) {
	return apply$2(path$d.JSON.stringify, null, arguments);
};
var parent$t = stringify$1;
var stringify = parent$t;
(function(module) {
	module.exports = stringify;
})(stringify$2);
var _JSON$stringify = /* @__PURE__ */ getDefaultExportFromCjs(stringifyExports);
var setTimeoutExports = {};
var setTimeout$3 = {
	get exports() {
		return setTimeoutExports;
	},
	set exports(v) {
		setTimeoutExports = v;
	}
};
var engineIsBun = typeof Bun == "function" && Bun && typeof Bun.version == "string";
var $TypeError$4 = TypeError;
var validateArgumentsLength$1 = function(passed, required) {
	if (passed < required) throw $TypeError$4("Not enough arguments");
	return passed;
};
var global$7 = global$l;
var apply$1 = functionApply;
var isCallable$1 = isCallable$i;
var ENGINE_IS_BUN = engineIsBun;
var USER_AGENT = engineUserAgent;
var arraySlice$1 = arraySlice$5;
var validateArgumentsLength = validateArgumentsLength$1;
var Function$1 = global$7.Function;
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && function() {
	var version$2 = global$7.Bun.version.split(".");
	return version$2.length < 3 || version$2[0] == 0 && (version$2[1] < 3 || version$2[1] == 3 && version$2[2] == 0);
}();
var schedulersFix$2 = function(scheduler, hasTimeArg) {
	var firstParamIndex = hasTimeArg ? 2 : 1;
	return WRAP ? function(handler, timeout) {
		var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
		var fn = isCallable$1(handler) ? handler : Function$1(handler);
		var params = boundArgs ? arraySlice$1(arguments, firstParamIndex) : [];
		var callback = boundArgs ? function() {
			apply$1(fn, this, params);
		} : fn;
		return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
	} : scheduler;
};
var $$g = _export;
var global$6 = global$l;
var schedulersFix$1 = schedulersFix$2;
var setInterval$2 = schedulersFix$1(global$6.setInterval, true);
$$g({
	global: true,
	bind: true,
	forced: global$6.setInterval !== setInterval$2
}, { setInterval: setInterval$2 });
var $$f = _export;
var global$5 = global$l;
var schedulersFix = schedulersFix$2;
var setTimeout$2 = schedulersFix(global$5.setTimeout, true);
$$f({
	global: true,
	bind: true,
	forced: global$5.setTimeout !== setTimeout$2
}, { setTimeout: setTimeout$2 });
var path$c = path$y;
var setTimeout$1 = path$c.setTimeout;
(function(module) {
	module.exports = setTimeout$1;
})(setTimeout$3);
var _setTimeout = /* @__PURE__ */ getDefaultExportFromCjs(setTimeoutExports);
var fillExports = {};
var fill$4 = {
	get exports() {
		return fillExports;
	},
	set exports(v) {
		fillExports = v;
	}
};
var toObject$2 = toObject$d;
var toAbsoluteIndex = toAbsoluteIndex$5;
var lengthOfArrayLike$3 = lengthOfArrayLike$b;
var arrayFill = function fill$5(value) {
	var O = toObject$2(this);
	var length$1 = lengthOfArrayLike$3(O);
	var argumentsLength = arguments.length;
	var index$1 = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : void 0, length$1);
	var end = argumentsLength > 2 ? arguments[2] : void 0;
	var endPos = end === void 0 ? length$1 : toAbsoluteIndex(end, length$1);
	while (endPos > index$1) O[index$1++] = value;
	return O;
};
var $$e = _export;
var fill$3 = arrayFill;
$$e({
	target: "Array",
	proto: true
}, { fill: fill$3 });
var entryVirtual$5 = entryVirtual$i;
var fill$2 = entryVirtual$5("Array").fill;
var isPrototypeOf$7 = objectIsPrototypeOf;
var method$5 = fill$2;
var ArrayPrototype$5 = Array.prototype;
var fill$1 = function(it$1) {
	var own = it$1.fill;
	return it$1 === ArrayPrototype$5 || isPrototypeOf$7(ArrayPrototype$5, it$1) && own === ArrayPrototype$5.fill ? method$5 : own;
};
var parent$s = fill$1;
var fill = parent$s;
(function(module) {
	module.exports = fill;
})(fill$4);
var _fillInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(fillExports);
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */
function _extends() {
	_extends = Object.assign || function(target) {
		for (var i$2 = 1; i$2 < arguments.length; i$2++) {
			var source = arguments[i$2];
			for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
		}
		return target;
	};
	return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
	subClass.prototype = Object.create(superClass.prototype);
	subClass.prototype.constructor = subClass;
	subClass.__proto__ = superClass;
}
function _assertThisInitialized$1(self$1) {
	if (self$1 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
	return self$1;
}
/**
* @private
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} target
* @param {...Object} objects_to_assign
* @returns {Object} target
*/
var assign;
if (typeof Object.assign !== "function") assign = function assign$7(target) {
	if (target === void 0 || target === null) throw new TypeError("Cannot convert undefined or null to object");
	var output = Object(target);
	for (var index$1 = 1; index$1 < arguments.length; index$1++) {
		var source = arguments[index$1];
		if (source !== void 0 && source !== null) {
			for (var nextKey in source) if (source.hasOwnProperty(nextKey)) output[nextKey] = source[nextKey];
		}
	}
	return output;
};
else assign = Object.assign;
var assign$1 = assign;
var VENDOR_PREFIXES = [
	"",
	"webkit",
	"Moz",
	"MS",
	"ms",
	"o"
];
var TEST_ELEMENT = typeof document === "undefined" ? { style: {} } : document.createElement("div");
var TYPE_FUNCTION = "function";
var round = Math.round, abs$1 = Math.abs;
var now = Date.now;
/**
* @private
* get the prefixed property
* @param {Object} obj
* @param {String} property
* @returns {String|Undefined} prefixed
*/
function prefixed(obj, property) {
	var prefix;
	var prop;
	var camelProp = property[0].toUpperCase() + property.slice(1);
	var i$2 = 0;
	while (i$2 < VENDOR_PREFIXES.length) {
		prefix = VENDOR_PREFIXES[i$2];
		prop = prefix ? prefix + camelProp : property;
		if (prop in obj) return prop;
		i$2++;
	}
	return void 0;
}
var win;
if (typeof window === "undefined") win = {};
else win = window;
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, "touchAction");
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== void 0;
function getTouchActionProps() {
	if (!NATIVE_TOUCH_ACTION) return false;
	var touchMap = {};
	var cssSupports = win.CSS && win.CSS.supports;
	[
		"auto",
		"manipulation",
		"pan-y",
		"pan-x",
		"pan-x pan-y",
		"none"
	].forEach(function(val) {
		return touchMap[val] = cssSupports ? win.CSS.supports("touch-action", val) : true;
	});
	return touchMap;
}
var TOUCH_ACTION_COMPUTE = "compute";
var TOUCH_ACTION_AUTO = "auto";
var TOUCH_ACTION_MANIPULATION = "manipulation";
var TOUCH_ACTION_NONE = "none";
var TOUCH_ACTION_PAN_X = "pan-x";
var TOUCH_ACTION_PAN_Y = "pan-y";
var TOUCH_ACTION_MAP = getTouchActionProps();
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
var SUPPORT_TOUCH = "ontouchstart" in win;
var SUPPORT_POINTER_EVENTS = prefixed(win, "PointerEvent") !== void 0;
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
var INPUT_TYPE_TOUCH = "touch";
var INPUT_TYPE_PEN = "pen";
var INPUT_TYPE_MOUSE = "mouse";
var INPUT_TYPE_KINECT = "kinect";
var COMPUTE_INTERVAL = 25;
var INPUT_START = 1;
var INPUT_MOVE = 2;
var INPUT_END = 4;
var INPUT_CANCEL = 8;
var DIRECTION_NONE = 1;
var DIRECTION_LEFT = 2;
var DIRECTION_RIGHT = 4;
var DIRECTION_UP = 8;
var DIRECTION_DOWN = 16;
var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
var PROPS_XY = ["x", "y"];
var PROPS_CLIENT_XY = ["clientX", "clientY"];
/**
* @private
* walk objects and arrays
* @param {Object} obj
* @param {Function} iterator
* @param {Object} context
*/
function each(obj, iterator$8, context) {
	var i$2;
	if (!obj) return;
	if (obj.forEach) obj.forEach(iterator$8, context);
	else if (obj.length !== void 0) {
		i$2 = 0;
		while (i$2 < obj.length) {
			iterator$8.call(context, obj[i$2], i$2, obj);
			i$2++;
		}
	} else for (i$2 in obj) obj.hasOwnProperty(i$2) && iterator$8.call(context, obj[i$2], i$2, obj);
}
/**
* @private
* let a boolean value also be a function that must return a boolean
* this first item in args will be used as the context
* @param {Boolean|Function} val
* @param {Array} [args]
* @returns {Boolean}
*/
function boolOrFn(val, args) {
	if (typeof val === TYPE_FUNCTION) return val.apply(args ? args[0] || void 0 : void 0, args);
	return val;
}
/**
* @private
* small indexOf wrapper
* @param {String} str
* @param {String} find
* @returns {Boolean} found
*/
function inStr(str, find$1) {
	return str.indexOf(find$1) > -1;
}
/**
* @private
* when the touchActions are collected they are not a valid value, so we need to clean things up. *
* @param {String} actions
* @returns {*}
*/
function cleanTouchActions(actions) {
	if (inStr(actions, TOUCH_ACTION_NONE)) return TOUCH_ACTION_NONE;
	var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
	var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
	if (hasPanX && hasPanY) return TOUCH_ACTION_NONE;
	if (hasPanX || hasPanY) return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
	if (inStr(actions, TOUCH_ACTION_MANIPULATION)) return TOUCH_ACTION_MANIPULATION;
	return TOUCH_ACTION_AUTO;
}
/**
* @private
* Touch Action
* sets the touchAction property or uses the js alternative
* @param {Manager} manager
* @param {String} value
* @constructor
*/
var TouchAction = /* @__PURE__ */ function() {
	function TouchAction$2(manager, value) {
		this.manager = manager;
		this.set(value);
	}
	/**
	* @private
	* set the touchAction value on the element or enable the polyfill
	* @param {String} value
	*/
	var _proto = TouchAction$2.prototype;
	_proto.set = function set$6(value) {
		if (value === TOUCH_ACTION_COMPUTE) value = this.compute();
		if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
		this.actions = value.toLowerCase().trim();
	};
	/**
	* @private
	* just re-set the touchAction value
	*/
	_proto.update = function update() {
		this.set(this.manager.options.touchAction);
	};
	/**
	* @private
	* compute the value for the touchAction property based on the recognizer's settings
	* @returns {String} value
	*/
	_proto.compute = function compute() {
		var actions = [];
		each(this.manager.recognizers, function(recognizer) {
			if (boolOrFn(recognizer.options.enable, [recognizer])) actions = actions.concat(recognizer.getTouchAction());
		});
		return cleanTouchActions(actions.join(" "));
	};
	/**
	* @private
	* this method is called on each input cycle and provides the preventing of the browser behavior
	* @param {Object} input
	*/
	_proto.preventDefaults = function preventDefaults(input) {
		var srcEvent = input.srcEvent;
		var direction = input.offsetDirection;
		if (this.manager.session.prevented) {
			srcEvent.preventDefault();
			return;
		}
		var actions = this.actions;
		var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
		var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
		var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
		if (hasNone) {
			var isTapPointer = input.pointers.length === 1;
			var isTapMovement = input.distance < 2;
			var isTapTouchTime = input.deltaTime < 250;
			if (isTapPointer && isTapMovement && isTapTouchTime) return;
		}
		if (hasPanX && hasPanY) return;
		if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) return this.preventSrc(srcEvent);
	};
	/**
	* @private
	* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
	* @param {Object} srcEvent
	*/
	_proto.preventSrc = function preventSrc(srcEvent) {
		this.manager.session.prevented = true;
		srcEvent.preventDefault();
	};
	return TouchAction$2;
}();
/**
* @private
* find if a node is in the given parent
* @method hasParent
* @param {HTMLElement} node
* @param {HTMLElement} parent
* @return {Boolean} found
*/
function hasParent(node$1, parent$21) {
	while (node$1) {
		if (node$1 === parent$21) return true;
		node$1 = node$1.parentNode;
	}
	return false;
}
/**
* @private
* get the center of all the pointers
* @param {Array} pointers
* @return {Object} center contains `x` and `y` properties
*/
function getCenter(pointers) {
	var pointersLength = pointers.length;
	if (pointersLength === 1) return {
		x: round(pointers[0].clientX),
		y: round(pointers[0].clientY)
	};
	var x = 0;
	var y = 0;
	var i$2 = 0;
	while (i$2 < pointersLength) {
		x += pointers[i$2].clientX;
		y += pointers[i$2].clientY;
		i$2++;
	}
	return {
		x: round(x / pointersLength),
		y: round(y / pointersLength)
	};
}
/**
* @private
* create a simple clone from the input used for storage of firstInput and firstMultiple
* @param {Object} input
* @returns {Object} clonedInputData
*/
function simpleCloneInputData(input) {
	var pointers = [];
	var i$2 = 0;
	while (i$2 < input.pointers.length) {
		pointers[i$2] = {
			clientX: round(input.pointers[i$2].clientX),
			clientY: round(input.pointers[i$2].clientY)
		};
		i$2++;
	}
	return {
		timeStamp: now(),
		pointers,
		center: getCenter(pointers),
		deltaX: input.deltaX,
		deltaY: input.deltaY
	};
}
/**
* @private
* calculate the absolute distance between two points
* @param {Object} p1 {x, y}
* @param {Object} p2 {x, y}
* @param {Array} [props] containing x and y keys
* @return {Number} distance
*/
function getDistance(p1, p2, props) {
	if (!props) props = PROPS_XY;
	var x = p2[props[0]] - p1[props[0]];
	var y = p2[props[1]] - p1[props[1]];
	return Math.sqrt(x * x + y * y);
}
/**
* @private
* calculate the angle between two coordinates
* @param {Object} p1
* @param {Object} p2
* @param {Array} [props] containing x and y keys
* @return {Number} angle
*/
function getAngle(p1, p2, props) {
	if (!props) props = PROPS_XY;
	var x = p2[props[0]] - p1[props[0]];
	var y = p2[props[1]] - p1[props[1]];
	return Math.atan2(y, x) * 180 / Math.PI;
}
/**
* @private
* get the direction between two points
* @param {Number} x
* @param {Number} y
* @return {Number} direction
*/
function getDirection(x, y) {
	if (x === y) return DIRECTION_NONE;
	if (abs$1(x) >= abs$1(y)) return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
	return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
}
function computeDeltaXY(session, input) {
	var center = input.center;
	var offset = session.offsetDelta || {};
	var prevDelta = session.prevDelta || {};
	var prevInput = session.prevInput || {};
	if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
		prevDelta = session.prevDelta = {
			x: prevInput.deltaX || 0,
			y: prevInput.deltaY || 0
		};
		offset = session.offsetDelta = {
			x: center.x,
			y: center.y
		};
	}
	input.deltaX = prevDelta.x + (center.x - offset.x);
	input.deltaY = prevDelta.y + (center.y - offset.y);
}
/**
* @private
* calculate the velocity between two points. unit is in px per ms.
* @param {Number} deltaTime
* @param {Number} x
* @param {Number} y
* @return {Object} velocity `x` and `y`
*/
function getVelocity(deltaTime, x, y) {
	return {
		x: x / deltaTime || 0,
		y: y / deltaTime || 0
	};
}
/**
* @private
* calculate the scale factor between two pointersets
* no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} scale
*/
function getScale(start, end) {
	return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
}
/**
* @private
* calculate the rotation degrees between two pointersets
* @param {Array} start array of pointers
* @param {Array} end array of pointers
* @return {Number} rotation
*/
function getRotation(start, end) {
	return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
}
/**
* @private
* velocity is calculated every x ms
* @param {Object} session
* @param {Object} input
*/
function computeIntervalInputData(session, input) {
	var last = session.lastInterval || input;
	var deltaTime = input.timeStamp - last.timeStamp;
	var velocity;
	var velocityX;
	var velocityY;
	var direction;
	if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === void 0)) {
		var deltaX = input.deltaX - last.deltaX;
		var deltaY = input.deltaY - last.deltaY;
		var v = getVelocity(deltaTime, deltaX, deltaY);
		velocityX = v.x;
		velocityY = v.y;
		velocity = abs$1(v.x) > abs$1(v.y) ? v.x : v.y;
		direction = getDirection(deltaX, deltaY);
		session.lastInterval = input;
	} else {
		velocity = last.velocity;
		velocityX = last.velocityX;
		velocityY = last.velocityY;
		direction = last.direction;
	}
	input.velocity = velocity;
	input.velocityX = velocityX;
	input.velocityY = velocityY;
	input.direction = direction;
}
/**
* @private
* extend the data with some usable properties like scale, rotate, velocity etc
* @param {Object} manager
* @param {Object} input
*/
function computeInputData(manager, input) {
	var session = manager.session;
	var pointers = input.pointers;
	var pointersLength = pointers.length;
	if (!session.firstInput) session.firstInput = simpleCloneInputData(input);
	if (pointersLength > 1 && !session.firstMultiple) session.firstMultiple = simpleCloneInputData(input);
	else if (pointersLength === 1) session.firstMultiple = false;
	var firstInput = session.firstInput, firstMultiple = session.firstMultiple;
	var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
	var center = input.center = getCenter(pointers);
	input.timeStamp = now();
	input.deltaTime = input.timeStamp - firstInput.timeStamp;
	input.angle = getAngle(offsetCenter, center);
	input.distance = getDistance(offsetCenter, center);
	computeDeltaXY(session, input);
	input.offsetDirection = getDirection(input.deltaX, input.deltaY);
	var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
	input.overallVelocityX = overallVelocity.x;
	input.overallVelocityY = overallVelocity.y;
	input.overallVelocity = abs$1(overallVelocity.x) > abs$1(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
	input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
	input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
	input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
	computeIntervalInputData(session, input);
	var target = manager.element;
	var srcEvent = input.srcEvent;
	var srcEventTarget;
	if (srcEvent.composedPath) srcEventTarget = srcEvent.composedPath()[0];
	else if (srcEvent.path) srcEventTarget = srcEvent.path[0];
	else srcEventTarget = srcEvent.target;
	if (hasParent(srcEventTarget, target)) target = srcEventTarget;
	input.target = target;
}
/**
* @private
* handle input events
* @param {Manager} manager
* @param {String} eventType
* @param {Object} input
*/
function inputHandler(manager, eventType, input) {
	var pointersLen = input.pointers.length;
	var changedPointersLen = input.changedPointers.length;
	var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
	var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
	input.isFirst = !!isFirst;
	input.isFinal = !!isFinal;
	if (isFirst) manager.session = {};
	input.eventType = eventType;
	computeInputData(manager, input);
	manager.emit("hammer.input", input);
	manager.recognize(input);
	manager.session.prevInput = input;
}
/**
* @private
* split string on whitespace
* @param {String} str
* @returns {Array} words
*/
function splitStr(str) {
	return str.trim().split(/\s+/g);
}
/**
* @private
* addEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function addEventListeners(target, types, handler) {
	each(splitStr(types), function(type) {
		target.addEventListener(type, handler, false);
	});
}
/**
* @private
* removeEventListener with multiple events at once
* @param {EventTarget} target
* @param {String} types
* @param {Function} handler
*/
function removeEventListeners(target, types, handler) {
	each(splitStr(types), function(type) {
		target.removeEventListener(type, handler, false);
	});
}
/**
* @private
* get the window object of an element
* @param {HTMLElement} element
* @returns {DocumentView|Window}
*/
function getWindowForElement(element) {
	var doc = element.ownerDocument || element;
	return doc.defaultView || doc.parentWindow || window;
}
/**
* @private
* create new input type manager
* @param {Manager} manager
* @param {Function} callback
* @returns {Input}
* @constructor
*/
var Input = /* @__PURE__ */ function() {
	function Input$2(manager, callback) {
		var self$1 = this;
		this.manager = manager;
		this.callback = callback;
		this.element = manager.element;
		this.target = manager.options.inputTarget;
		this.domHandler = function(ev) {
			if (boolOrFn(manager.options.enable, [manager])) self$1.handler(ev);
		};
		this.init();
	}
	/**
	* @private
	* should handle the inputEvent data and trigger the callback
	* @virtual
	*/
	var _proto = Input$2.prototype;
	_proto.handler = function handler() {};
	/**
	* @private
	* bind the events
	*/
	_proto.init = function init() {
		this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
		this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
		this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
	};
	/**
	* @private
	* unbind the events
	*/
	_proto.destroy = function destroy() {
		this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
		this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
		this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
	};
	return Input$2;
}();
/**
* @private
* find if a array contains the object using indexOf or a simple polyFill
* @param {Array} src
* @param {String} find
* @param {String} [findByKey]
* @return {Boolean|Number} false when not found, or the index
*/
function inArray(src, find$1, findByKey) {
	if (src.indexOf && !findByKey) return src.indexOf(find$1);
	else {
		var i$2 = 0;
		while (i$2 < src.length) {
			if (findByKey && src[i$2][findByKey] == find$1 || !findByKey && src[i$2] === find$1) return i$2;
			i$2++;
		}
		return -1;
	}
}
var POINTER_INPUT_MAP = {
	pointerdown: INPUT_START,
	pointermove: INPUT_MOVE,
	pointerup: INPUT_END,
	pointercancel: INPUT_CANCEL,
	pointerout: INPUT_CANCEL
};
var IE10_POINTER_TYPE_ENUM = {
	2: INPUT_TYPE_TOUCH,
	3: INPUT_TYPE_PEN,
	4: INPUT_TYPE_MOUSE,
	5: INPUT_TYPE_KINECT
};
var POINTER_ELEMENT_EVENTS = "pointerdown";
var POINTER_WINDOW_EVENTS = "pointermove pointerup pointercancel";
if (win.MSPointerEvent && !win.PointerEvent) {
	POINTER_ELEMENT_EVENTS = "MSPointerDown";
	POINTER_WINDOW_EVENTS = "MSPointerMove MSPointerUp MSPointerCancel";
}
/**
* @private
* Pointer events input
* @constructor
* @extends Input
*/
var PointerEventInput = /* @__PURE__ */ function(_Input) {
	_inheritsLoose(PointerEventInput$2, _Input);
	function PointerEventInput$2() {
		var _this;
		var proto = PointerEventInput$2.prototype;
		proto.evEl = POINTER_ELEMENT_EVENTS;
		proto.evWin = POINTER_WINDOW_EVENTS;
		_this = _Input.apply(this, arguments) || this;
		_this.store = _this.manager.session.pointerEvents = [];
		return _this;
	}
	/**
	* @private
	* handle mouse events
	* @param {Object} ev
	*/
	var _proto = PointerEventInput$2.prototype;
	_proto.handler = function handler(ev) {
		var store$5 = this.store;
		var removePointer = false;
		var eventTypeNormalized = ev.type.toLowerCase().replace("ms", "");
		var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
		var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
		var isTouch = pointerType === INPUT_TYPE_TOUCH;
		var storeIndex = inArray(store$5, ev.pointerId, "pointerId");
		if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
			if (storeIndex < 0) {
				store$5.push(ev);
				storeIndex = store$5.length - 1;
			}
		} else if (eventType & (INPUT_END | INPUT_CANCEL)) removePointer = true;
		if (storeIndex < 0) return;
		store$5[storeIndex] = ev;
		this.callback(this.manager, eventType, {
			pointers: store$5,
			changedPointers: [ev],
			pointerType,
			srcEvent: ev
		});
		if (removePointer) store$5.splice(storeIndex, 1);
	};
	return PointerEventInput$2;
}(Input);
/**
* @private
* convert array-like objects to real arrays
* @param {Object} obj
* @returns {Array}
*/
function toArray(obj) {
	return Array.prototype.slice.call(obj, 0);
}
/**
* @private
* unique array with objects based on a key (like 'id') or just by the array's value
* @param {Array} src [{id:1},{id:2},{id:1}]
* @param {String} [key]
* @param {Boolean} [sort=False]
* @returns {Array} [{id:1},{id:2}]
*/
function uniqueArray(src, key, sort$5) {
	var results = [];
	var values$8 = [];
	var i$2 = 0;
	while (i$2 < src.length) {
		var val = key ? src[i$2][key] : src[i$2];
		if (inArray(values$8, val) < 0) results.push(src[i$2]);
		values$8[i$2] = val;
		i$2++;
	}
	if (sort$5) if (!key) results = results.sort();
	else results = results.sort(function(a, b) {
		return a[key] > b[key];
	});
	return results;
}
var TOUCH_INPUT_MAP = {
	touchstart: INPUT_START,
	touchmove: INPUT_MOVE,
	touchend: INPUT_END,
	touchcancel: INPUT_CANCEL
};
var TOUCH_TARGET_EVENTS = "touchstart touchmove touchend touchcancel";
/**
* @private
* Multi-user touch events input
* @constructor
* @extends Input
*/
var TouchInput = /* @__PURE__ */ function(_Input) {
	_inheritsLoose(TouchInput$2, _Input);
	function TouchInput$2() {
		var _this;
		TouchInput$2.prototype.evTarget = TOUCH_TARGET_EVENTS;
		_this = _Input.apply(this, arguments) || this;
		_this.targetIds = {};
		return _this;
	}
	var _proto = TouchInput$2.prototype;
	_proto.handler = function handler(ev) {
		var type = TOUCH_INPUT_MAP[ev.type];
		var touches = getTouches.call(this, ev, type);
		if (!touches) return;
		this.callback(this.manager, type, {
			pointers: touches[0],
			changedPointers: touches[1],
			pointerType: INPUT_TYPE_TOUCH,
			srcEvent: ev
		});
	};
	return TouchInput$2;
}(Input);
function getTouches(ev, type) {
	var allTouches = toArray(ev.touches);
	var targetIds = this.targetIds;
	if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
		targetIds[allTouches[0].identifier] = true;
		return [allTouches, allTouches];
	}
	var i$2;
	var targetTouches;
	var changedTouches = toArray(ev.changedTouches);
	var changedTargetTouches = [];
	var target = this.target;
	targetTouches = allTouches.filter(function(touch) {
		return hasParent(touch.target, target);
	});
	if (type === INPUT_START) {
		i$2 = 0;
		while (i$2 < targetTouches.length) {
			targetIds[targetTouches[i$2].identifier] = true;
			i$2++;
		}
	}
	i$2 = 0;
	while (i$2 < changedTouches.length) {
		if (targetIds[changedTouches[i$2].identifier]) changedTargetTouches.push(changedTouches[i$2]);
		if (type & (INPUT_END | INPUT_CANCEL)) delete targetIds[changedTouches[i$2].identifier];
		i$2++;
	}
	if (!changedTargetTouches.length) return;
	return [uniqueArray(targetTouches.concat(changedTargetTouches), "identifier", true), changedTargetTouches];
}
var MOUSE_INPUT_MAP = {
	mousedown: INPUT_START,
	mousemove: INPUT_MOVE,
	mouseup: INPUT_END
};
var MOUSE_ELEMENT_EVENTS = "mousedown";
var MOUSE_WINDOW_EVENTS = "mousemove mouseup";
/**
* @private
* Mouse events input
* @constructor
* @extends Input
*/
var MouseInput = /* @__PURE__ */ function(_Input) {
	_inheritsLoose(MouseInput$2, _Input);
	function MouseInput$2() {
		var _this;
		var proto = MouseInput$2.prototype;
		proto.evEl = MOUSE_ELEMENT_EVENTS;
		proto.evWin = MOUSE_WINDOW_EVENTS;
		_this = _Input.apply(this, arguments) || this;
		_this.pressed = false;
		return _this;
	}
	/**
	* @private
	* handle mouse events
	* @param {Object} ev
	*/
	var _proto = MouseInput$2.prototype;
	_proto.handler = function handler(ev) {
		var eventType = MOUSE_INPUT_MAP[ev.type];
		if (eventType & INPUT_START && ev.button === 0) this.pressed = true;
		if (eventType & INPUT_MOVE && ev.which !== 1) eventType = INPUT_END;
		if (!this.pressed) return;
		if (eventType & INPUT_END) this.pressed = false;
		this.callback(this.manager, eventType, {
			pointers: [ev],
			changedPointers: [ev],
			pointerType: INPUT_TYPE_MOUSE,
			srcEvent: ev
		});
	};
	return MouseInput$2;
}(Input);
/**
* @private
* Combined touch and mouse input
*
* Touch has a higher priority then mouse, and while touching no mouse events are allowed.
* This because touch devices also emit mouse events while doing a touch.
*
* @constructor
* @extends Input
*/
var DEDUP_TIMEOUT = 2500;
var DEDUP_DISTANCE = 25;
function setLastTouch(eventData) {
	var _eventData$changedPoi = eventData.changedPointers, touch = _eventData$changedPoi[0];
	if (touch.identifier === this.primaryTouch) {
		var lastTouch = {
			x: touch.clientX,
			y: touch.clientY
		};
		var lts = this.lastTouches;
		this.lastTouches.push(lastTouch);
		var removeLastTouch = function removeLastTouch$1() {
			var i$2 = lts.indexOf(lastTouch);
			if (i$2 > -1) lts.splice(i$2, 1);
		};
		setTimeout(removeLastTouch, DEDUP_TIMEOUT);
	}
}
function recordTouches(eventType, eventData) {
	if (eventType & INPUT_START) {
		this.primaryTouch = eventData.changedPointers[0].identifier;
		setLastTouch.call(this, eventData);
	} else if (eventType & (INPUT_END | INPUT_CANCEL)) setLastTouch.call(this, eventData);
}
function isSyntheticEvent(eventData) {
	var x = eventData.srcEvent.clientX;
	var y = eventData.srcEvent.clientY;
	for (var i$2 = 0; i$2 < this.lastTouches.length; i$2++) {
		var t = this.lastTouches[i$2];
		var dx = Math.abs(x - t.x);
		var dy = Math.abs(y - t.y);
		if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) return true;
	}
	return false;
}
var TouchMouseInput = /* @__PURE__ */ function() {
	var TouchMouseInput$2 = /* @__PURE__ */ function(_Input) {
		_inheritsLoose(TouchMouseInput$3, _Input);
		function TouchMouseInput$3(_manager, callback) {
			var _this;
			_this = _Input.call(this, _manager, callback) || this;
			_this.handler = function(manager, inputEvent, inputData) {
				var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;
				var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;
				if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) return;
				if (isTouch) recordTouches.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputEvent, inputData);
				else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputData)) return;
				_this.callback(manager, inputEvent, inputData);
			};
			_this.touch = new TouchInput(_this.manager, _this.handler);
			_this.mouse = new MouseInput(_this.manager, _this.handler);
			_this.primaryTouch = null;
			_this.lastTouches = [];
			return _this;
		}
		/**
		* @private
		* handle mouse and touch events
		* @param {Hammer} manager
		* @param {String} inputEvent
		* @param {Object} inputData
		*/
		var _proto = TouchMouseInput$3.prototype;
		/**
		* @private
		* remove the event listeners
		*/
		_proto.destroy = function destroy() {
			this.touch.destroy();
			this.mouse.destroy();
		};
		return TouchMouseInput$3;
	}(Input);
	return TouchMouseInput$2;
}();
/**
* @private
* create new input type manager
* called by the Manager constructor
* @param {Hammer} manager
* @returns {Input}
*/
function createInputInstance(manager) {
	var Type;
	var inputClass = manager.options.inputClass;
	if (inputClass) Type = inputClass;
	else if (SUPPORT_POINTER_EVENTS) Type = PointerEventInput;
	else if (SUPPORT_ONLY_TOUCH) Type = TouchInput;
	else if (!SUPPORT_TOUCH) Type = MouseInput;
	else Type = TouchMouseInput;
	return new Type(manager, inputHandler);
}
/**
* @private
* if the argument is an array, we want to execute the fn on each entry
* if it aint an array we don't want to do a thing.
* this is used by all the methods that accept a single and array argument.
* @param {*|Array} arg
* @param {String} fn
* @param {Object} [context]
* @returns {Boolean}
*/
function invokeArrayArg(arg, fn, context) {
	if (Array.isArray(arg)) {
		each(arg, context[fn], context);
		return true;
	}
	return false;
}
var STATE_POSSIBLE = 1;
var STATE_BEGAN = 2;
var STATE_CHANGED = 4;
var STATE_ENDED = 8;
var STATE_RECOGNIZED = STATE_ENDED;
var STATE_CANCELLED = 16;
var STATE_FAILED = 32;
/**
* @private
* get a unique id
* @returns {number} uniqueId
*/
var _uniqueId = 1;
function uniqueId() {
	return _uniqueId++;
}
/**
* @private
* get a recognizer by name if it is bound to a manager
* @param {Recognizer|String} otherRecognizer
* @param {Recognizer} recognizer
* @returns {Recognizer}
*/
function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
	var manager = recognizer.manager;
	if (manager) return manager.get(otherRecognizer);
	return otherRecognizer;
}
/**
* @private
* get a usable string, used as event postfix
* @param {constant} state
* @returns {String} state
*/
function stateStr(state) {
	if (state & STATE_CANCELLED) return "cancel";
	else if (state & STATE_ENDED) return "end";
	else if (state & STATE_CHANGED) return "move";
	else if (state & STATE_BEGAN) return "start";
	return "";
}
/**
* @private
* Recognizer flow explained; *
* All recognizers have the initial state of POSSIBLE when a input session starts.
* The definition of a input session is from the first input until the last input, with all it's movement in it. *
* Example session for mouse-input: mousedown -> mousemove -> mouseup
*
* On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
* which determines with state it should be.
*
* If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
* POSSIBLE to give it another change on the next cycle.
*
*               Possible
*                  |
*            +-----+---------------+
*            |                     |
*      +-----+-----+               |
*      |           |               |
*   Failed      Cancelled          |
*                          +-------+------+
*                          |              |
*                      Recognized       Began
*                                         |
*                                      Changed
*                                         |
*                                  Ended/Recognized
*/
/**
* @private
* Recognizer
* Every recognizer needs to extend from this class.
* @constructor
* @param {Object} options
*/
var Recognizer = /* @__PURE__ */ function() {
	function Recognizer$2(options) {
		if (options === void 0) options = {};
		this.options = _extends({ enable: true }, options);
		this.id = uniqueId();
		this.manager = null;
		this.state = STATE_POSSIBLE;
		this.simultaneous = {};
		this.requireFail = [];
	}
	/**
	* @private
	* set options
	* @param {Object} options
	* @return {Recognizer}
	*/
	var _proto = Recognizer$2.prototype;
	_proto.set = function set$6(options) {
		assign$1(this.options, options);
		this.manager && this.manager.touchAction.update();
		return this;
	};
	/**
	* @private
	* recognize simultaneous with an other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.recognizeWith = function recognizeWith(otherRecognizer) {
		if (invokeArrayArg(otherRecognizer, "recognizeWith", this)) return this;
		var simultaneous = this.simultaneous;
		otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
		if (!simultaneous[otherRecognizer.id]) {
			simultaneous[otherRecognizer.id] = otherRecognizer;
			otherRecognizer.recognizeWith(this);
		}
		return this;
	};
	/**
	* @private
	* drop the simultaneous link. it doesnt remove the link on the other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
		if (invokeArrayArg(otherRecognizer, "dropRecognizeWith", this)) return this;
		otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
		delete this.simultaneous[otherRecognizer.id];
		return this;
	};
	/**
	* @private
	* recognizer can only run when an other is failing
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.requireFailure = function requireFailure(otherRecognizer) {
		if (invokeArrayArg(otherRecognizer, "requireFailure", this)) return this;
		var requireFail = this.requireFail;
		otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
		if (inArray(requireFail, otherRecognizer) === -1) {
			requireFail.push(otherRecognizer);
			otherRecognizer.requireFailure(this);
		}
		return this;
	};
	/**
	* @private
	* drop the requireFailure link. it does not remove the link on the other recognizer.
	* @param {Recognizer} otherRecognizer
	* @returns {Recognizer} this
	*/
	_proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
		if (invokeArrayArg(otherRecognizer, "dropRequireFailure", this)) return this;
		otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
		var index$1 = inArray(this.requireFail, otherRecognizer);
		if (index$1 > -1) this.requireFail.splice(index$1, 1);
		return this;
	};
	/**
	* @private
	* has require failures boolean
	* @returns {boolean}
	*/
	_proto.hasRequireFailures = function hasRequireFailures() {
		return this.requireFail.length > 0;
	};
	/**
	* @private
	* if the recognizer can recognize simultaneous with an other recognizer
	* @param {Recognizer} otherRecognizer
	* @returns {Boolean}
	*/
	_proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
		return !!this.simultaneous[otherRecognizer.id];
	};
	/**
	* @private
	* You should use `tryEmit` instead of `emit` directly to check
	* that all the needed recognizers has failed before emitting.
	* @param {Object} input
	*/
	_proto.emit = function emit(input) {
		var self$1 = this;
		var state = this.state;
		function emit(event) {
			self$1.manager.emit(event, input);
		}
		if (state < STATE_ENDED) emit(self$1.options.event + stateStr(state));
		emit(self$1.options.event);
		if (input.additionalEvent) emit(input.additionalEvent);
		if (state >= STATE_ENDED) emit(self$1.options.event + stateStr(state));
	};
	/**
	* @private
	* Check that all the require failure recognizers has failed,
	* if true, it emits a gesture event,
	* otherwise, setup the state to FAILED.
	* @param {Object} input
	*/
	_proto.tryEmit = function tryEmit(input) {
		if (this.canEmit()) return this.emit(input);
		this.state = STATE_FAILED;
	};
	/**
	* @private
	* can we emit?
	* @returns {boolean}
	*/
	_proto.canEmit = function canEmit() {
		var i$2 = 0;
		while (i$2 < this.requireFail.length) {
			if (!(this.requireFail[i$2].state & (STATE_FAILED | STATE_POSSIBLE))) return false;
			i$2++;
		}
		return true;
	};
	/**
	* @private
	* update the recognizer
	* @param {Object} inputData
	*/
	_proto.recognize = function recognize(inputData) {
		var inputDataClone = assign$1({}, inputData);
		if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
			this.reset();
			this.state = STATE_FAILED;
			return;
		}
		if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) this.state = STATE_POSSIBLE;
		this.state = this.process(inputDataClone);
		if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) this.tryEmit(inputDataClone);
	};
	/**
	* @private
	* return the state of the recognizer
	* the actual recognizing happens in this method
	* @virtual
	* @param {Object} inputData
	* @returns {constant} STATE
	*/
	_proto.process = function process$5(inputData) {};
	/**
	* @private
	* return the preferred touch-action
	* @virtual
	* @returns {Array}
	*/
	_proto.getTouchAction = function getTouchAction() {};
	/**
	* @private
	* called when the gesture isn't allowed to recognize
	* like when another is being recognized or it is disabled
	* @virtual
	*/
	_proto.reset = function reset() {};
	return Recognizer$2;
}();
/**
* @private
* A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
* between the given interval and position. The delay option can be used to recognize multi-taps without firing
* a single tap.
*
* The eventData from the emitted event contains the property `tapCount`, which contains the amount of
* multi-taps being recognized.
* @constructor
* @extends Recognizer
*/
var TapRecognizer = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose(TapRecognizer$2, _Recognizer);
	function TapRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _Recognizer.call(this, _extends({
			event: "tap",
			pointers: 1,
			taps: 1,
			interval: 300,
			time: 250,
			threshold: 9,
			posThreshold: 10
		}, options)) || this;
		_this.pTime = false;
		_this.pCenter = false;
		_this._timer = null;
		_this._input = null;
		_this.count = 0;
		return _this;
	}
	var _proto = TapRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_MANIPULATION];
	};
	_proto.process = function process$5(input) {
		var _this2 = this;
		var options = this.options;
		var validPointers = input.pointers.length === options.pointers;
		var validMovement = input.distance < options.threshold;
		var validTouchTime = input.deltaTime < options.time;
		this.reset();
		if (input.eventType & INPUT_START && this.count === 0) return this.failTimeout();
		if (validMovement && validTouchTime && validPointers) {
			if (input.eventType !== INPUT_END) return this.failTimeout();
			var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
			var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
			this.pTime = input.timeStamp;
			this.pCenter = input.center;
			if (!validMultiTap || !validInterval) this.count = 1;
			else this.count += 1;
			this._input = input;
			var tapCount = this.count % options.taps;
			if (tapCount === 0) if (!this.hasRequireFailures()) return STATE_RECOGNIZED;
			else {
				this._timer = setTimeout(function() {
					_this2.state = STATE_RECOGNIZED;
					_this2.tryEmit();
				}, options.interval);
				return STATE_BEGAN;
			}
		}
		return STATE_FAILED;
	};
	_proto.failTimeout = function failTimeout() {
		var _this3 = this;
		this._timer = setTimeout(function() {
			_this3.state = STATE_FAILED;
		}, this.options.interval);
		return STATE_FAILED;
	};
	_proto.reset = function reset() {
		clearTimeout(this._timer);
	};
	_proto.emit = function emit() {
		if (this.state === STATE_RECOGNIZED) {
			this._input.tapCount = this.count;
			this.manager.emit(this.options.event, this._input);
		}
	};
	return TapRecognizer$2;
}(Recognizer);
/**
* @private
* This recognizer is just used as a base for the simple attribute recognizers.
* @constructor
* @extends Recognizer
*/
var AttrRecognizer = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose(AttrRecognizer$2, _Recognizer);
	function AttrRecognizer$2(options) {
		if (options === void 0) options = {};
		return _Recognizer.call(this, _extends({ pointers: 1 }, options)) || this;
	}
	/**
	* @private
	* Used to check if it the recognizer receives valid input, like input.distance > 10.
	* @memberof AttrRecognizer
	* @param {Object} input
	* @returns {Boolean} recognized
	*/
	var _proto = AttrRecognizer$2.prototype;
	_proto.attrTest = function attrTest(input) {
		var optionPointers = this.options.pointers;
		return optionPointers === 0 || input.pointers.length === optionPointers;
	};
	/**
	* @private
	* Process the input and return the state for the recognizer
	* @memberof AttrRecognizer
	* @param {Object} input
	* @returns {*} State
	*/
	_proto.process = function process$5(input) {
		var state = this.state;
		var eventType = input.eventType;
		var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
		var isValid = this.attrTest(input);
		if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) return state | STATE_CANCELLED;
		else if (isRecognized || isValid) {
			if (eventType & INPUT_END) return state | STATE_ENDED;
			else if (!(state & STATE_BEGAN)) return STATE_BEGAN;
			return state | STATE_CHANGED;
		}
		return STATE_FAILED;
	};
	return AttrRecognizer$2;
}(Recognizer);
/**
* @private
* direction cons to string
* @param {constant} direction
* @returns {String}
*/
function directionStr(direction) {
	if (direction === DIRECTION_DOWN) return "down";
	else if (direction === DIRECTION_UP) return "up";
	else if (direction === DIRECTION_LEFT) return "left";
	else if (direction === DIRECTION_RIGHT) return "right";
	return "";
}
/**
* @private
* Pan
* Recognized when the pointer is down and moved in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
var PanRecognizer = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose(PanRecognizer$2, _AttrRecognizer);
	function PanRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _AttrRecognizer.call(this, _extends({
			event: "pan",
			threshold: 10,
			pointers: 1,
			direction: DIRECTION_ALL
		}, options)) || this;
		_this.pX = null;
		_this.pY = null;
		return _this;
	}
	var _proto = PanRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		var direction = this.options.direction;
		var actions = [];
		if (direction & DIRECTION_HORIZONTAL) actions.push(TOUCH_ACTION_PAN_Y);
		if (direction & DIRECTION_VERTICAL) actions.push(TOUCH_ACTION_PAN_X);
		return actions;
	};
	_proto.directionTest = function directionTest(input) {
		var options = this.options;
		var hasMoved = true;
		var distance = input.distance;
		var direction = input.direction;
		var x = input.deltaX;
		var y = input.deltaY;
		if (!(direction & options.direction)) if (options.direction & DIRECTION_HORIZONTAL) {
			direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
			hasMoved = x !== this.pX;
			distance = Math.abs(input.deltaX);
		} else {
			direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
			hasMoved = y !== this.pY;
			distance = Math.abs(input.deltaY);
		}
		input.direction = direction;
		return hasMoved && distance > options.threshold && direction & options.direction;
	};
	_proto.attrTest = function attrTest(input) {
		return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
	};
	_proto.emit = function emit(input) {
		this.pX = input.deltaX;
		this.pY = input.deltaY;
		var direction = directionStr(input.direction);
		if (direction) input.additionalEvent = this.options.event + direction;
		_AttrRecognizer.prototype.emit.call(this, input);
	};
	return PanRecognizer$2;
}(AttrRecognizer);
/**
* @private
* Swipe
* Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
* @constructor
* @extends AttrRecognizer
*/
var SwipeRecognizer = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose(SwipeRecognizer$2, _AttrRecognizer);
	function SwipeRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends({
			event: "swipe",
			threshold: 10,
			velocity: .3,
			direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
			pointers: 1
		}, options)) || this;
	}
	var _proto = SwipeRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return PanRecognizer.prototype.getTouchAction.call(this);
	};
	_proto.attrTest = function attrTest(input) {
		var direction = this.options.direction;
		var velocity;
		if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) velocity = input.overallVelocity;
		else if (direction & DIRECTION_HORIZONTAL) velocity = input.overallVelocityX;
		else if (direction & DIRECTION_VERTICAL) velocity = input.overallVelocityY;
		return _AttrRecognizer.prototype.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs$1(velocity) > this.options.velocity && input.eventType & INPUT_END;
	};
	_proto.emit = function emit(input) {
		var direction = directionStr(input.offsetDirection);
		if (direction) this.manager.emit(this.options.event + direction, input);
		this.manager.emit(this.options.event, input);
	};
	return SwipeRecognizer$2;
}(AttrRecognizer);
/**
* @private
* Pinch
* Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
* @constructor
* @extends AttrRecognizer
*/
var PinchRecognizer = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose(PinchRecognizer$2, _AttrRecognizer);
	function PinchRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends({
			event: "pinch",
			threshold: 0,
			pointers: 2
		}, options)) || this;
	}
	var _proto = PinchRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_NONE];
	};
	_proto.attrTest = function attrTest(input) {
		return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
	};
	_proto.emit = function emit(input) {
		if (input.scale !== 1) {
			var inOut = input.scale < 1 ? "in" : "out";
			input.additionalEvent = this.options.event + inOut;
		}
		_AttrRecognizer.prototype.emit.call(this, input);
	};
	return PinchRecognizer$2;
}(AttrRecognizer);
/**
* @private
* Rotate
* Recognized when two or more pointer are moving in a circular motion.
* @constructor
* @extends AttrRecognizer
*/
var RotateRecognizer = /* @__PURE__ */ function(_AttrRecognizer) {
	_inheritsLoose(RotateRecognizer$2, _AttrRecognizer);
	function RotateRecognizer$2(options) {
		if (options === void 0) options = {};
		return _AttrRecognizer.call(this, _extends({
			event: "rotate",
			threshold: 0,
			pointers: 2
		}, options)) || this;
	}
	var _proto = RotateRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_NONE];
	};
	_proto.attrTest = function attrTest(input) {
		return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
	};
	return RotateRecognizer$2;
}(AttrRecognizer);
/**
* @private
* Press
* Recognized when the pointer is down for x ms without any movement.
* @constructor
* @extends Recognizer
*/
var PressRecognizer = /* @__PURE__ */ function(_Recognizer) {
	_inheritsLoose(PressRecognizer$2, _Recognizer);
	function PressRecognizer$2(options) {
		var _this;
		if (options === void 0) options = {};
		_this = _Recognizer.call(this, _extends({
			event: "press",
			pointers: 1,
			time: 251,
			threshold: 9
		}, options)) || this;
		_this._timer = null;
		_this._input = null;
		return _this;
	}
	var _proto = PressRecognizer$2.prototype;
	_proto.getTouchAction = function getTouchAction() {
		return [TOUCH_ACTION_AUTO];
	};
	_proto.process = function process$5(input) {
		var _this2 = this;
		var options = this.options;
		var validPointers = input.pointers.length === options.pointers;
		var validMovement = input.distance < options.threshold;
		var validTime = input.deltaTime > options.time;
		this._input = input;
		if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) this.reset();
		else if (input.eventType & INPUT_START) {
			this.reset();
			this._timer = setTimeout(function() {
				_this2.state = STATE_RECOGNIZED;
				_this2.tryEmit();
			}, options.time);
		} else if (input.eventType & INPUT_END) return STATE_RECOGNIZED;
		return STATE_FAILED;
	};
	_proto.reset = function reset() {
		clearTimeout(this._timer);
	};
	_proto.emit = function emit(input) {
		if (this.state !== STATE_RECOGNIZED) return;
		if (input && input.eventType & INPUT_END) this.manager.emit(this.options.event + "up", input);
		else {
			this._input.timeStamp = now();
			this.manager.emit(this.options.event, this._input);
		}
	};
	return PressRecognizer$2;
}(Recognizer);
var defaults = {
	domEvents: false,
	touchAction: TOUCH_ACTION_COMPUTE,
	enable: true,
	inputTarget: null,
	inputClass: null,
	cssProps: {
		userSelect: "none",
		touchSelect: "none",
		touchCallout: "none",
		contentZooming: "none",
		userDrag: "none",
		tapHighlightColor: "rgba(0,0,0,0)"
	}
};
/**
* @private
* Default recognizer setup when calling `Hammer()`
* When creating a new Manager these will be skipped.
* This is separated with other defaults because of tree-shaking.
* @type {Array}
*/
var preset = [
	[RotateRecognizer, { enable: false }],
	[
		PinchRecognizer,
		{ enable: false },
		["rotate"]
	],
	[SwipeRecognizer, { direction: DIRECTION_HORIZONTAL }],
	[
		PanRecognizer,
		{ direction: DIRECTION_HORIZONTAL },
		["swipe"]
	],
	[TapRecognizer],
	[
		TapRecognizer,
		{
			event: "doubletap",
			taps: 2
		},
		["tap"]
	],
	[PressRecognizer]
];
var STOP = 1;
var FORCED_STOP = 2;
/**
* @private
* add/remove the css properties as defined in manager.options.cssProps
* @param {Manager} manager
* @param {Boolean} add
*/
function toggleCssProps(manager, add) {
	var element = manager.element;
	if (!element.style) return;
	var prop;
	each(manager.options.cssProps, function(value, name) {
		prop = prefixed(element.style, name);
		if (add) {
			manager.oldCssProps[prop] = element.style[prop];
			element.style[prop] = value;
		} else element.style[prop] = manager.oldCssProps[prop] || "";
	});
	if (!add) manager.oldCssProps = {};
}
/**
* @private
* trigger dom event
* @param {String} event
* @param {Object} data
*/
function triggerDomEvent(event, data$2) {
	var gestureEvent = document.createEvent("Event");
	gestureEvent.initEvent(event, true, true);
	gestureEvent.gesture = data$2;
	data$2.target.dispatchEvent(gestureEvent);
}
/**
* @private
* Manager
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
var Manager = /* @__PURE__ */ function() {
	function Manager$2(element, options) {
		var _this = this;
		this.options = assign$1({}, defaults, options || {});
		this.options.inputTarget = this.options.inputTarget || element;
		this.handlers = {};
		this.session = {};
		this.recognizers = [];
		this.oldCssProps = {};
		this.element = element;
		this.input = createInputInstance(this);
		this.touchAction = new TouchAction(this, this.options.touchAction);
		toggleCssProps(this, true);
		each(this.options.recognizers, function(item) {
			var recognizer = _this.add(new item[0](item[1]));
			item[2] && recognizer.recognizeWith(item[2]);
			item[3] && recognizer.requireFailure(item[3]);
		}, this);
	}
	/**
	* @private
	* set options
	* @param {Object} options
	* @returns {Manager}
	*/
	var _proto = Manager$2.prototype;
	_proto.set = function set$6(options) {
		assign$1(this.options, options);
		if (options.touchAction) this.touchAction.update();
		if (options.inputTarget) {
			this.input.destroy();
			this.input.target = options.inputTarget;
			this.input.init();
		}
		return this;
	};
	/**
	* @private
	* stop recognizing for this session.
	* This session will be discarded, when a new [input]start event is fired.
	* When forced, the recognizer cycle is stopped immediately.
	* @param {Boolean} [force]
	*/
	_proto.stop = function stop(force) {
		this.session.stopped = force ? FORCED_STOP : STOP;
	};
	/**
	* @private
	* run the recognizers!
	* called by the inputHandler function on every movement of the pointers (touches)
	* it walks through all the recognizers and tries to detect the gesture that is being made
	* @param {Object} inputData
	*/
	_proto.recognize = function recognize(inputData) {
		var session = this.session;
		if (session.stopped) return;
		this.touchAction.preventDefaults(inputData);
		var recognizer;
		var recognizers = this.recognizers;
		var curRecognizer = session.curRecognizer;
		if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
			session.curRecognizer = null;
			curRecognizer = null;
		}
		var i$2 = 0;
		while (i$2 < recognizers.length) {
			recognizer = recognizers[i$2];
			if (session.stopped !== FORCED_STOP && (!curRecognizer || recognizer === curRecognizer || recognizer.canRecognizeWith(curRecognizer))) recognizer.recognize(inputData);
			else recognizer.reset();
			if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
				session.curRecognizer = recognizer;
				curRecognizer = recognizer;
			}
			i$2++;
		}
	};
	/**
	* @private
	* get a recognizer by its event name.
	* @param {Recognizer|String} recognizer
	* @returns {Recognizer|Null}
	*/
	_proto.get = function get$9(recognizer) {
		if (recognizer instanceof Recognizer) return recognizer;
		var recognizers = this.recognizers;
		for (var i$2 = 0; i$2 < recognizers.length; i$2++) if (recognizers[i$2].options.event === recognizer) return recognizers[i$2];
		return null;
	};
	/**
	* @private add a recognizer to the manager
	* existing recognizers with the same event name will be removed
	* @param {Recognizer} recognizer
	* @returns {Recognizer|Manager}
	*/
	_proto.add = function add(recognizer) {
		if (invokeArrayArg(recognizer, "add", this)) return this;
		var existing = this.get(recognizer.options.event);
		if (existing) this.remove(existing);
		this.recognizers.push(recognizer);
		recognizer.manager = this;
		this.touchAction.update();
		return recognizer;
	};
	/**
	* @private
	* remove a recognizer by name or instance
	* @param {Recognizer|String} recognizer
	* @returns {Manager}
	*/
	_proto.remove = function remove(recognizer) {
		if (invokeArrayArg(recognizer, "remove", this)) return this;
		var targetRecognizer = this.get(recognizer);
		if (recognizer) {
			var recognizers = this.recognizers;
			var index$1 = inArray(recognizers, targetRecognizer);
			if (index$1 !== -1) {
				recognizers.splice(index$1, 1);
				this.touchAction.update();
			}
		}
		return this;
	};
	/**
	* @private
	* bind event
	* @param {String} events
	* @param {Function} handler
	* @returns {EventEmitter} this
	*/
	_proto.on = function on(events, handler) {
		if (events === void 0 || handler === void 0) return this;
		var handlers = this.handlers;
		each(splitStr(events), function(event) {
			handlers[event] = handlers[event] || [];
			handlers[event].push(handler);
		});
		return this;
	};
	/**
	* @private unbind event, leave emit blank to remove all handlers
	* @param {String} events
	* @param {Function} [handler]
	* @returns {EventEmitter} this
	*/
	_proto.off = function off(events, handler) {
		if (events === void 0) return this;
		var handlers = this.handlers;
		each(splitStr(events), function(event) {
			if (!handler) delete handlers[event];
			else handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
		});
		return this;
	};
	/**
	* @private emit event to the listeners
	* @param {String} event
	* @param {Object} data
	*/
	_proto.emit = function emit(event, data$2) {
		if (this.options.domEvents) triggerDomEvent(event, data$2);
		var handlers = this.handlers[event] && this.handlers[event].slice();
		if (!handlers || !handlers.length) return;
		data$2.type = event;
		data$2.preventDefault = function() {
			data$2.srcEvent.preventDefault();
		};
		var i$2 = 0;
		while (i$2 < handlers.length) {
			handlers[i$2](data$2);
			i$2++;
		}
	};
	/**
	* @private
	* destroy the manager and unbinds all events
	* it doesn't unbind dom events, that is the user own responsibility
	*/
	_proto.destroy = function destroy() {
		this.element && toggleCssProps(this, false);
		this.handlers = {};
		this.session = {};
		this.input.destroy();
		this.element = null;
	};
	return Manager$2;
}();
var SINGLE_TOUCH_INPUT_MAP = {
	touchstart: INPUT_START,
	touchmove: INPUT_MOVE,
	touchend: INPUT_END,
	touchcancel: INPUT_CANCEL
};
var SINGLE_TOUCH_TARGET_EVENTS = "touchstart";
var SINGLE_TOUCH_WINDOW_EVENTS = "touchstart touchmove touchend touchcancel";
/**
* @private
* Touch events input
* @constructor
* @extends Input
*/
var SingleTouchInput = /* @__PURE__ */ function(_Input) {
	_inheritsLoose(SingleTouchInput$2, _Input);
	function SingleTouchInput$2() {
		var _this;
		var proto = SingleTouchInput$2.prototype;
		proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
		proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
		_this = _Input.apply(this, arguments) || this;
		_this.started = false;
		return _this;
	}
	var _proto = SingleTouchInput$2.prototype;
	_proto.handler = function handler(ev) {
		var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
		if (type === INPUT_START) this.started = true;
		if (!this.started) return;
		var touches = normalizeSingleTouches.call(this, ev, type);
		if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) this.started = false;
		this.callback(this.manager, type, {
			pointers: touches[0],
			changedPointers: touches[1],
			pointerType: INPUT_TYPE_TOUCH,
			srcEvent: ev
		});
	};
	return SingleTouchInput$2;
}(Input);
function normalizeSingleTouches(ev, type) {
	var all = toArray(ev.touches);
	var changed = toArray(ev.changedTouches);
	if (type & (INPUT_END | INPUT_CANCEL)) all = uniqueArray(all.concat(changed), "identifier", true);
	return [all, changed];
}
/**
* @private
* wrap a method with a deprecation warning and stack trace
* @param {Function} method
* @param {String} name
* @param {String} message
* @returns {Function} A new function wrapping the supplied method.
*/
function deprecate(method$11, name, message) {
	var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
	return function() {
		var e = new Error("get-stack-trace");
		var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace";
		var log = window.console && (window.console.warn || window.console.log);
		if (log) log.call(window.console, deprecationMessage, stack);
		return method$11.apply(this, arguments);
	};
}
/**
* @private
* extend object.
* means that properties in dest will be overwritten by the ones in src.
* @param {Object} dest
* @param {Object} src
* @param {Boolean} [merge=false]
* @returns {Object} dest
*/
var extend = deprecate(function(dest, src, merge$4) {
	var keys$9 = Object.keys(src);
	var i$2 = 0;
	while (i$2 < keys$9.length) {
		if (!merge$4 || merge$4 && dest[keys$9[i$2]] === void 0) dest[keys$9[i$2]] = src[keys$9[i$2]];
		i$2++;
	}
	return dest;
}, "extend", "Use `assign`.");
/**
* @private
* merge the values from src in the dest.
* means that properties that exist in dest will not be overwritten by src
* @param {Object} dest
* @param {Object} src
* @returns {Object} dest
*/
var merge$2 = deprecate(function(dest, src) {
	return extend(dest, src, true);
}, "merge", "Use `assign`.");
/**
* @private
* simple class inheritance
* @param {Function} child
* @param {Function} base
* @param {Object} [properties]
*/
function inherit(child, base, properties) {
	var baseP = base.prototype;
	var childP;
	childP = child.prototype = Object.create(baseP);
	childP.constructor = child;
	childP._super = baseP;
	if (properties) assign$1(childP, properties);
}
/**
* @private
* simple function bind
* @param {Function} fn
* @param {Object} context
* @returns {Function}
*/
function bindFn(fn, context) {
	return function boundFn() {
		return fn.apply(context, arguments);
	};
}
/**
* @private
* Simple way to create a manager with a default set of recognizers.
* @param {HTMLElement} element
* @param {Object} [options]
* @constructor
*/
var Hammer$2 = /* @__PURE__ */ function() {
	var Hammer$4 = function Hammer$5(element, options) {
		if (options === void 0) options = {};
		return new Manager(element, _extends({ recognizers: preset.concat() }, options));
	};
	Hammer$4.VERSION = "2.0.17-rc";
	Hammer$4.DIRECTION_ALL = DIRECTION_ALL;
	Hammer$4.DIRECTION_DOWN = DIRECTION_DOWN;
	Hammer$4.DIRECTION_LEFT = DIRECTION_LEFT;
	Hammer$4.DIRECTION_RIGHT = DIRECTION_RIGHT;
	Hammer$4.DIRECTION_UP = DIRECTION_UP;
	Hammer$4.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
	Hammer$4.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
	Hammer$4.DIRECTION_NONE = DIRECTION_NONE;
	Hammer$4.DIRECTION_DOWN = DIRECTION_DOWN;
	Hammer$4.INPUT_START = INPUT_START;
	Hammer$4.INPUT_MOVE = INPUT_MOVE;
	Hammer$4.INPUT_END = INPUT_END;
	Hammer$4.INPUT_CANCEL = INPUT_CANCEL;
	Hammer$4.STATE_POSSIBLE = STATE_POSSIBLE;
	Hammer$4.STATE_BEGAN = STATE_BEGAN;
	Hammer$4.STATE_CHANGED = STATE_CHANGED;
	Hammer$4.STATE_ENDED = STATE_ENDED;
	Hammer$4.STATE_RECOGNIZED = STATE_RECOGNIZED;
	Hammer$4.STATE_CANCELLED = STATE_CANCELLED;
	Hammer$4.STATE_FAILED = STATE_FAILED;
	Hammer$4.Manager = Manager;
	Hammer$4.Input = Input;
	Hammer$4.TouchAction = TouchAction;
	Hammer$4.TouchInput = TouchInput;
	Hammer$4.MouseInput = MouseInput;
	Hammer$4.PointerEventInput = PointerEventInput;
	Hammer$4.TouchMouseInput = TouchMouseInput;
	Hammer$4.SingleTouchInput = SingleTouchInput;
	Hammer$4.Recognizer = Recognizer;
	Hammer$4.AttrRecognizer = AttrRecognizer;
	Hammer$4.Tap = TapRecognizer;
	Hammer$4.Pan = PanRecognizer;
	Hammer$4.Swipe = SwipeRecognizer;
	Hammer$4.Pinch = PinchRecognizer;
	Hammer$4.Rotate = RotateRecognizer;
	Hammer$4.Press = PressRecognizer;
	Hammer$4.on = addEventListeners;
	Hammer$4.off = removeEventListeners;
	Hammer$4.each = each;
	Hammer$4.merge = merge$2;
	Hammer$4.extend = extend;
	Hammer$4.bindFn = bindFn;
	Hammer$4.assign = assign$1;
	Hammer$4.inherit = inherit;
	Hammer$4.bindFn = bindFn;
	Hammer$4.prefixed = prefixed;
	Hammer$4.toArray = toArray;
	Hammer$4.inArray = inArray;
	Hammer$4.uniqueArray = uniqueArray;
	Hammer$4.splitStr = splitStr;
	Hammer$4.boolOrFn = boolOrFn;
	Hammer$4.hasParent = hasParent;
	Hammer$4.addEventListeners = addEventListeners;
	Hammer$4.removeEventListeners = removeEventListeners;
	Hammer$4.defaults = assign$1({}, defaults, { preset });
	return Hammer$4;
}();
Hammer$2.defaults;
var RealHammer = Hammer$2;
function _createForOfIteratorHelper$6(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$6(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$6(o, minLen) {
	var _context21;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$6(o, minLen);
	var n = _sliceInstanceProperty(_context21 = Object.prototype.toString.call(o)).call(_context21, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$6(o, minLen);
}
function _arrayLikeToArray$6(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**

* Use this symbol to delete properies in deepObjectAssign.

*/
_Symbol("DELETE");
/**

* Seedable, fast and reasonably good (not crypto but more than okay for our

* needs) random number generator.

*

* @remarks

* Adapted from {@link https://web.archive.org/web/20110429100736/http://baagoe.com:80/en/RandomMusings/javascript}.

* Original algorithm created by Johannes Baagøe \<baagoe\@baagoe.com\> in 2010.

*/
/**

* Create a seeded pseudo random generator based on Alea by Johannes Baagøe.

*

* @param seed - All supplied arguments will be used as a seed. In case nothing

* is supplied the current time will be used to seed the generator.

* @returns A ready to use seeded generator.

*/
function Alea() {
	for (var _len3 = arguments.length, seed = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) seed[_key3] = arguments[_key3];
	return AleaImplementation(seed.length ? seed : [_Date$now()]);
}
/**

* An implementation of [[Alea]] without user input validation.

*

* @param seed - The data that will be used to seed the generator.

* @returns A ready to use seeded generator.

*/
function AleaImplementation(seed) {
	var _mashSeed = mashSeed(seed), _mashSeed2 = _slicedToArray(_mashSeed, 3), s0 = _mashSeed2[0], s1 = _mashSeed2[1], s2 = _mashSeed2[2];
	var c$1 = 1;
	var random = function random$1() {
		var t = 2091639 * s0 + c$1 * 23283064365386963e-26;
		s0 = s1;
		s1 = s2;
		return s2 = t - (c$1 = t | 0);
	};
	random.uint32 = function() {
		return random() * 4294967296;
	};
	random.fract53 = function() {
		return random() + (random() * 2097152 | 0) * 11102230246251565e-32;
	};
	random.algorithm = "Alea";
	random.seed = seed;
	random.version = "0.9";
	return random;
}
/**

* Turn arbitrary data into values [[AleaImplementation]] can use to generate

* random numbers.

*

* @param seed - Arbitrary data that will be used as the seed.

* @returns Three numbers to use as initial values for [[AleaImplementation]].

*/
function mashSeed() {
	var mash = Mash();
	var s0 = mash(" ");
	var s1 = mash(" ");
	var s2 = mash(" ");
	for (var i$2 = 0; i$2 < arguments.length; i$2++) {
		s0 -= mash(i$2 < 0 || arguments.length <= i$2 ? void 0 : arguments[i$2]);
		if (s0 < 0) s0 += 1;
		s1 -= mash(i$2 < 0 || arguments.length <= i$2 ? void 0 : arguments[i$2]);
		if (s1 < 0) s1 += 1;
		s2 -= mash(i$2 < 0 || arguments.length <= i$2 ? void 0 : arguments[i$2]);
		if (s2 < 0) s2 += 1;
	}
	return [
		s0,
		s1,
		s2
	];
}
/**

* Create a new mash function.

*

* @returns A nonpure function that takes arbitrary [[Mashable]] data and turns

* them into numbers.

*/
function Mash() {
	var n = 4022871197;
	return function(data$2) {
		var string$1 = data$2.toString();
		for (var i$2 = 0; i$2 < string$1.length; i$2++) {
			n += string$1.charCodeAt(i$2);
			var h = .02519603282416938 * n;
			n = h >>> 0;
			h -= n;
			h *= n;
			n = h >>> 0;
			h -= n;
			n += h * 4294967296;
		}
		return (n >>> 0) * 23283064365386963e-26;
	};
}
/**
* Setup a mock hammer.js object, for unit testing.
*
* Inspiration: https://github.com/uber/deck.gl/pull/658
*
* @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
*/
function hammerMock() {
	var noop$2 = function noop$3() {};
	return {
		on: noop$2,
		off: noop$2,
		destroy: noop$2,
		emit: noop$2,
		get: function get$9() {
			return { set: noop$2 };
		}
	};
}
var Hammer$1 = typeof window !== "undefined" ? window.Hammer || RealHammer : function() {
	return hammerMock();
};
/**
* Turn an element into an clickToUse element.
* When not active, the element has a transparent overlay. When the overlay is
* clicked, the mode is changed to active.
* When active, the element is displayed with a blue border around it, and
* the interactive contents of the element can be used. When clicked outside
* the element, the elements mode is changed to inactive.
*
* @param {Element} container
* @class Activator
*/
function Activator$1(container) {
	var _this = this, _context3;
	this._cleanupQueue = [];
	this.active = false;
	this._dom = {
		container,
		overlay: document.createElement("div")
	};
	this._dom.overlay.classList.add("vis-overlay");
	this._dom.container.appendChild(this._dom.overlay);
	this._cleanupQueue.push(function() {
		_this._dom.overlay.parentNode.removeChild(_this._dom.overlay);
	});
	var hammer = Hammer$1(this._dom.overlay);
	hammer.on("tap", _bindInstanceProperty$1(_context3 = this._onTapOverlay).call(_context3, this));
	this._cleanupQueue.push(function() {
		hammer.destroy();
	});
	var events = [
		"tap",
		"doubletap",
		"press",
		"pinch",
		"pan",
		"panstart",
		"panmove",
		"panend"
	];
	_forEachInstanceProperty(events).call(events, function(event) {
		hammer.on(event, function(event$1) {
			event$1.srcEvent.stopPropagation();
		});
	});
	if (document && document.body) {
		this._onClick = function(event) {
			if (!_hasParent(event.target, container)) _this.deactivate();
		};
		document.body.addEventListener("click", this._onClick);
		this._cleanupQueue.push(function() {
			document.body.removeEventListener("click", _this._onClick);
		});
	}
	this._escListener = function(event) {
		if ("key" in event ? event.key === "Escape" : event.keyCode === 27) _this.deactivate();
	};
}
Emitter(Activator$1.prototype);
Activator$1.current = null;
/**
* Destroy the activator. Cleans up all created DOM and event listeners
*/
Activator$1.prototype.destroy = function() {
	var _context4, _context5;
	this.deactivate();
	var _iterator2 = _createForOfIteratorHelper$6(_reverseInstanceProperty(_context4 = _spliceInstanceProperty(_context5 = this._cleanupQueue).call(_context5, 0)).call(_context4)), _step2;
	try {
		for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
			var callback = _step2.value;
			callback();
		}
	} catch (err) {
		_iterator2.e(err);
	} finally {
		_iterator2.f();
	}
};
/**
* Activate the element
* Overlay is hidden, element is decorated with a blue shadow border
*/
Activator$1.prototype.activate = function() {
	if (Activator$1.current) Activator$1.current.deactivate();
	Activator$1.current = this;
	this.active = true;
	this._dom.overlay.style.display = "none";
	this._dom.container.classList.add("vis-active");
	this.emit("change");
	this.emit("activate");
	document.body.addEventListener("keydown", this._escListener);
};
/**
* Deactivate the element
* Overlay is displayed on top of the element
*/
Activator$1.prototype.deactivate = function() {
	this.active = false;
	this._dom.overlay.style.display = "block";
	this._dom.container.classList.remove("vis-active");
	document.body.removeEventListener("keydown", this._escListener);
	this.emit("change");
	this.emit("deactivate");
};
/**
* Handle a tap event: activate the container
*
* @param {Event}  event   The event
* @private
*/
Activator$1.prototype._onTapOverlay = function(event) {
	this.activate();
	event.srcEvent.stopPropagation();
};
/**
* Test whether the element has the requested parent element somewhere in
* its chain of parent nodes.
*
* @param {HTMLElement} element
* @param {HTMLElement} parent
* @returns {boolean} Returns true when the parent is found somewhere in the
*                    chain of parent nodes.
* @private
*/
function _hasParent(element, parent$21) {
	while (element) {
		if (element === parent$21) return true;
		element = element.parentNode;
	}
	return false;
}
var fullHexRE = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
var shortHexRE = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
var rgbRE = /^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i;
var rgbaRE = /^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;
/**

* Remove everything in the DOM object.

*

* @param DOMobject - Node whose child nodes will be recursively deleted.

*/
function recursiveDOMDelete(DOMobject) {
	if (DOMobject) while (DOMobject.hasChildNodes() === true) {
		var child = DOMobject.firstChild;
		if (child) {
			recursiveDOMDelete(child);
			DOMobject.removeChild(child);
		}
	}
}
/**

* Test whether given object is a string.

*

* @param value - Input value of unknown type.

* @returns True if string, false otherwise.

*/
function isString(value) {
	return value instanceof String || typeof value === "string";
}
/**

* Test whether given object is a object (not primitive or null).

*

* @param value - Input value of unknown type.

* @returns True if not null object, false otherwise.

*/
function isObject$7(value) {
	return _typeof(value) === "object" && value !== null;
}
/**

* Copy property from b to a if property present in a.

* If property in b explicitly set to null, delete it if `allowDeletion` set.

*

* Internal helper routine, should not be exported. Not added to `exports` for that reason.

*

* @param a - Target object.

* @param b - Source object.

* @param prop - Name of property to copy from b to a.

* @param allowDeletion - If true, delete property in a if explicitly set to null in b.

*/
function copyOrDelete(a, b, prop, allowDeletion) {
	var doDeletion = false;
	if (allowDeletion === true) doDeletion = b[prop] === null && a[prop] !== void 0;
	if (doDeletion) delete a[prop];
	else a[prop] = b[prop];
}
/**

* Fill an object with a possibly partially defined other object.

*

* Only copies values for the properties already present in a.

* That means an object is not created on a property if only the b object has it.

*

* @param a - The object that will have it's properties updated.

* @param b - The object with property updates.

* @param allowDeletion - If true, delete properties in a that are explicitly set to null in b.

*/
function fillIfDefined(a, b) {
	var allowDeletion = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
	for (var prop in a) if (b[prop] !== void 0) if (b[prop] === null || _typeof(b[prop]) !== "object") copyOrDelete(a, b, prop, allowDeletion);
	else {
		var aProp = a[prop];
		var bProp = b[prop];
		if (isObject$7(aProp) && isObject$7(bProp)) fillIfDefined(aProp, bProp, allowDeletion);
	}
}
/**

* Extend object a with selected properties of object b.

* Only properties with defined values are copied.

*

* @remarks

* Previous version of this routine implied that multiple source objects could

* be used; however, the implementation was **wrong**. Since multiple (\>1)

* sources weren't used anywhere in the `vis.js` code, this has been removed

* @param props - Names of first-level properties to copy over.

* @param a - Target object.

* @param b - Source object.

* @param allowDeletion - If true, delete property in a if explicitly set to null in b.

* @returns Argument a.

*/
function selectiveDeepExtend(props, a, b) {
	var allowDeletion = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
	if (_Array$isArray(b)) throw new TypeError("Arrays are not supported by deepExtend");
	for (var p = 0; p < props.length; p++) {
		var prop = props[p];
		if (Object.prototype.hasOwnProperty.call(b, prop)) if (b[prop] && b[prop].constructor === Object) {
			if (a[prop] === void 0) a[prop] = {};
			if (a[prop].constructor === Object) deepExtend(a[prop], b[prop], false, allowDeletion);
			else copyOrDelete(a, b, prop, allowDeletion);
		} else if (_Array$isArray(b[prop])) throw new TypeError("Arrays are not supported by deepExtend");
		else copyOrDelete(a, b, prop, allowDeletion);
	}
	return a;
}
/**

* Extend object `a` with properties of object `b`, ignoring properties which

* are explicitly specified to be excluded.

*

* @remarks

* The properties of `b` are considered for copying. Properties which are

* themselves objects are are also extended. Only properties with defined

* values are copied.

* @param propsToExclude - Names of properties which should *not* be copied.

* @param a - Object to extend.

* @param b - Object to take properties from for extension.

* @param allowDeletion - If true, delete properties in a that are explicitly

* set to null in b.

* @returns Argument a.

*/
function selectiveNotDeepExtend(propsToExclude, a, b) {
	var allowDeletion = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
	if (_Array$isArray(b)) throw new TypeError("Arrays are not supported by deepExtend");
	for (var prop in b) {
		if (!Object.prototype.hasOwnProperty.call(b, prop)) continue;
		if (_includesInstanceProperty(propsToExclude).call(propsToExclude, prop)) continue;
		if (b[prop] && b[prop].constructor === Object) {
			if (a[prop] === void 0) a[prop] = {};
			if (a[prop].constructor === Object) deepExtend(a[prop], b[prop]);
			else copyOrDelete(a, b, prop, allowDeletion);
		} else if (_Array$isArray(b[prop])) {
			a[prop] = [];
			for (var i$2 = 0; i$2 < b[prop].length; i$2++) a[prop].push(b[prop][i$2]);
		} else copyOrDelete(a, b, prop, allowDeletion);
	}
	return a;
}
/**

* Deep extend an object a with the properties of object b.

*

* @param a - Target object.

* @param b - Source object.

* @param protoExtend - If true, the prototype values will also be extended.

* (That is the options objects that inherit from others will also get the

* inherited options).

* @param allowDeletion - If true, the values of fields that are null will be deleted.

* @returns Argument a.

*/
function deepExtend(a, b) {
	var protoExtend = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
	var allowDeletion = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
	for (var prop in b) if (Object.prototype.hasOwnProperty.call(b, prop) || protoExtend === true) if (_typeof(b[prop]) === "object" && b[prop] !== null && _Object$getPrototypeOf$1(b[prop]) === Object.prototype) if (a[prop] === void 0) a[prop] = deepExtend({}, b[prop], protoExtend);
	else if (_typeof(a[prop]) === "object" && a[prop] !== null && _Object$getPrototypeOf$1(a[prop]) === Object.prototype) deepExtend(a[prop], b[prop], protoExtend);
	else copyOrDelete(a, b, prop, allowDeletion);
	else if (_Array$isArray(b[prop])) {
		var _context6;
		a[prop] = _sliceInstanceProperty(_context6 = b[prop]).call(_context6);
	} else copyOrDelete(a, b, prop, allowDeletion);
	return a;
}
/**

* Used to extend an array and copy it. This is used to propagate paths recursively.

*

* @param arr - First part.

* @param newValue - The value to be aadded into the array.

* @returns A new array with all items from arr and newValue (which is last).

*/
function copyAndExtendArray(arr, newValue) {
	var _context7;
	return _concatInstanceProperty(_context7 = []).call(_context7, _toConsumableArray(arr), [newValue]);
}
/**

* Used to extend an array and copy it. This is used to propagate paths recursively.

*

* @param arr - The array to be copied.

* @returns Shallow copy of arr.

*/
function copyArray(arr) {
	return _sliceInstanceProperty(arr).call(arr);
}
/**

* Retrieve the absolute left value of a DOM element.

*

* @param elem - A dom element, for example a div.

* @returns The absolute left position of this element in the browser page.

*/
function getAbsoluteLeft(elem) {
	return elem.getBoundingClientRect().left;
}
/**

* Retrieve the absolute top value of a DOM element.

*

* @param elem - A dom element, for example a div.

* @returns The absolute top position of this element in the browser page.

*/
function getAbsoluteTop(elem) {
	return elem.getBoundingClientRect().top;
}
/**

* For each method for both arrays and objects.

* In case of an array, the built-in Array.forEach() is applied (**No, it's not!**).

* In case of an Object, the method loops over all properties of the object.

*

* @param object - An Object or Array to be iterated over.

* @param callback - Array.forEach-like callback.

*/
function forEach$1(object$1, callback) {
	if (_Array$isArray(object$1)) {
		var len = object$1.length;
		for (var i$2 = 0; i$2 < len; i$2++) callback(object$1[i$2], i$2, object$1);
	} else for (var key in object$1) if (Object.prototype.hasOwnProperty.call(object$1, key)) callback(object$1[key], key, object$1);
}
/**

* Add and event listener. Works for all browsers.

*

* @param element - The element to bind the event listener to.

* @param action - Same as Element.addEventListener(action, —, —).

* @param listener - Same as Element.addEventListener(—, listener, —).

* @param useCapture - Same as Element.addEventListener(—, —, useCapture).

*/
function addEventListener(element, action, listener, useCapture) {
	if (element.addEventListener) {
		var _context8;
		if (useCapture === void 0) useCapture = false;
		if (action === "mousewheel" && _includesInstanceProperty(_context8 = navigator.userAgent).call(_context8, "Firefox")) action = "DOMMouseScroll";
		element.addEventListener(action, listener, useCapture);
	} else element.attachEvent("on" + action, listener);
}
/**

* Remove an event listener from an element.

*

* @param element - The element to bind the event listener to.

* @param action - Same as Element.removeEventListener(action, —, —).

* @param listener - Same as Element.removeEventListener(—, listener, —).

* @param useCapture - Same as Element.removeEventListener(—, —, useCapture).

*/
function removeEventListener(element, action, listener, useCapture) {
	if (element.removeEventListener) {
		var _context9;
		if (useCapture === void 0) useCapture = false;
		if (action === "mousewheel" && _includesInstanceProperty(_context9 = navigator.userAgent).call(_context9, "Firefox")) action = "DOMMouseScroll";
		element.removeEventListener(action, listener, useCapture);
	} else element.detachEvent("on" + action, listener);
}
/**

* Convert hex color string into RGB color object.

*

* @remarks

* {@link http://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb}

* @param hex - Hex color string (3 or 6 digits, with or without #).

* @returns RGB color object.

*/
function hexToRGB(hex$1) {
	var result;
	switch (hex$1.length) {
		case 3:
		case 4:
			result = shortHexRE.exec(hex$1);
			return result ? {
				r: _parseInt(result[1] + result[1], 16),
				g: _parseInt(result[2] + result[2], 16),
				b: _parseInt(result[3] + result[3], 16)
			} : null;
		case 6:
		case 7:
			result = fullHexRE.exec(hex$1);
			return result ? {
				r: _parseInt(result[1], 16),
				g: _parseInt(result[2], 16),
				b: _parseInt(result[3], 16)
			} : null;
		default: return null;
	}
}
/**

* This function takes string color in hex or RGB format and adds the opacity, RGBA is passed through unchanged.

*

* @param color - The color string (hex, RGB, RGBA).

* @param opacity - The new opacity.

* @returns RGBA string, for example 'rgba(255, 0, 127, 0.3)'.

*/
function overrideOpacity(color, opacity) {
	if (_includesInstanceProperty(color).call(color, "rgba")) return color;
	else if (_includesInstanceProperty(color).call(color, "rgb")) {
		var rgb = color.substr(_indexOfInstanceProperty(color).call(color, "(") + 1).replace(")", "").split(",");
		return "rgba(" + rgb[0] + "," + rgb[1] + "," + rgb[2] + "," + opacity + ")";
	} else {
		var _rgb = hexToRGB(color);
		if (_rgb == null) return color;
		else return "rgba(" + _rgb.r + "," + _rgb.g + "," + _rgb.b + "," + opacity + ")";
	}
}
/**

* Convert RGB \<0, 255\> into hex color string.

*

* @param red - Red channel.

* @param green - Green channel.

* @param blue - Blue channel.

* @returns Hex color string (for example: '#0acdc0').

*/
function RGBToHex(red, green, blue) {
	var _context10;
	return "#" + _sliceInstanceProperty(_context10 = ((1 << 24) + (red << 16) + (green << 8) + blue).toString(16)).call(_context10, 1);
}
/**

* Parse a color property into an object with border, background, and highlight colors.

*

* @param inputColor - Shorthand color string or input color object.

* @param defaultColor - Full color object to fill in missing values in inputColor.

* @returns Color object.

*/
function parseColor(inputColor, defaultColor) {
	if (isString(inputColor)) {
		var colorStr = inputColor;
		if (isValidRGB(colorStr)) {
			var _context11;
			var rgb = _mapInstanceProperty(_context11 = colorStr.substr(4).substr(0, colorStr.length - 5).split(",")).call(_context11, function(value) {
				return _parseInt(value);
			});
			colorStr = RGBToHex(rgb[0], rgb[1], rgb[2]);
		}
		if (isValidHex(colorStr) === true) {
			var hsv = hexToHSV(colorStr);
			var lighterColorHSV = {
				h: hsv.h,
				s: hsv.s * .8,
				v: Math.min(1, hsv.v * 1.02)
			};
			var darkerColorHSV = {
				h: hsv.h,
				s: Math.min(1, hsv.s * 1.25),
				v: hsv.v * .8
			};
			var darkerColorHex = HSVToHex(darkerColorHSV.h, darkerColorHSV.s, darkerColorHSV.v);
			var lighterColorHex = HSVToHex(lighterColorHSV.h, lighterColorHSV.s, lighterColorHSV.v);
			return {
				background: colorStr,
				border: darkerColorHex,
				highlight: {
					background: lighterColorHex,
					border: darkerColorHex
				},
				hover: {
					background: lighterColorHex,
					border: darkerColorHex
				}
			};
		} else return {
			background: colorStr,
			border: colorStr,
			highlight: {
				background: colorStr,
				border: colorStr
			},
			hover: {
				background: colorStr,
				border: colorStr
			}
		};
	} else if (defaultColor) {
		var color = {
			background: inputColor.background || defaultColor.background,
			border: inputColor.border || defaultColor.border,
			highlight: isString(inputColor.highlight) ? {
				border: inputColor.highlight,
				background: inputColor.highlight
			} : {
				background: inputColor.highlight && inputColor.highlight.background || defaultColor.highlight.background,
				border: inputColor.highlight && inputColor.highlight.border || defaultColor.highlight.border
			},
			hover: isString(inputColor.hover) ? {
				border: inputColor.hover,
				background: inputColor.hover
			} : {
				border: inputColor.hover && inputColor.hover.border || defaultColor.hover.border,
				background: inputColor.hover && inputColor.hover.background || defaultColor.hover.background
			}
		};
		return color;
	} else {
		var _color = {
			background: inputColor.background || void 0,
			border: inputColor.border || void 0,
			highlight: isString(inputColor.highlight) ? {
				border: inputColor.highlight,
				background: inputColor.highlight
			} : {
				background: inputColor.highlight && inputColor.highlight.background || void 0,
				border: inputColor.highlight && inputColor.highlight.border || void 0
			},
			hover: isString(inputColor.hover) ? {
				border: inputColor.hover,
				background: inputColor.hover
			} : {
				border: inputColor.hover && inputColor.hover.border || void 0,
				background: inputColor.hover && inputColor.hover.background || void 0
			}
		};
		return _color;
	}
}
/**

* Convert RGB \<0, 255\> into HSV object.

*

* @remarks

* {@link http://www.javascripter.net/faq/rgb2hsv.htm}

* @param red - Red channel.

* @param green - Green channel.

* @param blue - Blue channel.

* @returns HSV color object.

*/
function RGBToHSV(red, green, blue) {
	red = red / 255;
	green = green / 255;
	blue = blue / 255;
	var minRGB = Math.min(red, Math.min(green, blue));
	var maxRGB = Math.max(red, Math.max(green, blue));
	if (minRGB === maxRGB) return {
		h: 0,
		s: 0,
		v: minRGB
	};
	var d = red === minRGB ? green - blue : blue === minRGB ? red - green : blue - red;
	var h = red === minRGB ? 3 : blue === minRGB ? 1 : 5;
	var hue = 60 * (h - d / (maxRGB - minRGB)) / 360;
	var saturation = (maxRGB - minRGB) / maxRGB;
	var value = maxRGB;
	return {
		h: hue,
		s: saturation,
		v: value
	};
}
/**

* Convert HSV \<0, 1\> into RGB color object.

*

* @remarks

* {@link https://gist.github.com/mjijackson/5311256}

* @param h - Hue.

* @param s - Saturation.

* @param v - Value.

* @returns RGB color object.

*/
function HSVToRGB(h, s, v) {
	var r;
	var g;
	var b;
	var i$2 = Math.floor(h * 6);
	var f = h * 6 - i$2;
	var p = v * (1 - s);
	var q = v * (1 - f * s);
	var t = v * (1 - (1 - f) * s);
	switch (i$2 % 6) {
		case 0:
			r = v, g = t, b = p;
			break;
		case 1:
			r = q, g = v, b = p;
			break;
		case 2:
			r = p, g = v, b = t;
			break;
		case 3:
			r = p, g = q, b = v;
			break;
		case 4:
			r = t, g = p, b = v;
			break;
		case 5:
			r = v, g = p, b = q;
			break;
	}
	return {
		r: Math.floor(r * 255),
		g: Math.floor(g * 255),
		b: Math.floor(b * 255)
	};
}
/**

* Convert HSV \<0, 1\> into hex color string.

*

* @param h - Hue.

* @param s - Saturation.

* @param v - Value.

* @returns Hex color string.

*/
function HSVToHex(h, s, v) {
	var rgb = HSVToRGB(h, s, v);
	return RGBToHex(rgb.r, rgb.g, rgb.b);
}
/**

* Convert hex color string into HSV \<0, 1\>.

*

* @param hex - Hex color string.

* @returns HSV color object.

*/
function hexToHSV(hex$1) {
	var rgb = hexToRGB(hex$1);
	if (!rgb) throw new TypeError("'".concat(hex$1, "' is not a valid color."));
	return RGBToHSV(rgb.r, rgb.g, rgb.b);
}
/**

* Validate hex color string.

*

* @param hex - Unknown string that may contain a color.

* @returns True if the string is valid, false otherwise.

*/
function isValidHex(hex$1) {
	var isOk = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(hex$1);
	return isOk;
}
/**

* Validate RGB color string.

*

* @param rgb - Unknown string that may contain a color.

* @returns True if the string is valid, false otherwise.

*/
function isValidRGB(rgb) {
	return rgbRE.test(rgb);
}
/**

* Validate RGBA color string.

*

* @param rgba - Unknown string that may contain a color.

* @returns True if the string is valid, false otherwise.

*/
function isValidRGBA(rgba) {
	return rgbaRE.test(rgba);
}
/**

* This recursively redirects the prototype of JSON objects to the referenceObject.

* This is used for default options.

*

* @param referenceObject - The original object.

* @returns The Element if the referenceObject is an Element, or a new object inheriting from the referenceObject.

*/
function bridgeObject(referenceObject) {
	if (referenceObject === null || _typeof(referenceObject) !== "object") return null;
	if (referenceObject instanceof Element) return referenceObject;
	var objectTo = _Object$create$1(referenceObject);
	for (var i$2 in referenceObject) if (Object.prototype.hasOwnProperty.call(referenceObject, i$2)) {
		if (_typeof(referenceObject[i$2]) == "object") objectTo[i$2] = bridgeObject(referenceObject[i$2]);
	}
	return objectTo;
}
/**

* This is used to set the options of subobjects in the options object.

*

* A requirement of these subobjects is that they have an 'enabled' element

* which is optional for the user but mandatory for the program.

*

* The added value here of the merge is that option 'enabled' is set as required.

*

* @param mergeTarget - Either this.options or the options used for the groups.

* @param options - Options.

* @param option - Option key in the options argument.

* @param globalOptions - Global options, passed in to determine value of option 'enabled'.

*/
function mergeOptions(mergeTarget, options, option) {
	var globalOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
	var isPresent = function isPresent$1(obj) {
		return obj !== null && obj !== void 0;
	};
	var isObject$11 = function isObject$12(obj) {
		return obj !== null && _typeof(obj) === "object";
	};
	var isEmpty = function isEmpty$1(obj) {
		for (var x in obj) if (Object.prototype.hasOwnProperty.call(obj, x)) return false;
		return true;
	};
	if (!isObject$11(mergeTarget)) throw new Error("Parameter mergeTarget must be an object");
	if (!isObject$11(options)) throw new Error("Parameter options must be an object");
	if (!isPresent(option)) throw new Error("Parameter option must have a value");
	if (!isObject$11(globalOptions)) throw new Error("Parameter globalOptions must be an object");
	var doMerge = function doMerge$1(target, options$1, option$1) {
		if (!isObject$11(target[option$1])) target[option$1] = {};
		var src = options$1[option$1];
		var dst = target[option$1];
		for (var prop in src) if (Object.prototype.hasOwnProperty.call(src, prop)) dst[prop] = src[prop];
	};
	var srcOption = options[option];
	var globalPassed = isObject$11(globalOptions) && !isEmpty(globalOptions);
	var globalOption = globalPassed ? globalOptions[option] : void 0;
	var globalEnabled = globalOption ? globalOption.enabled : void 0;
	if (srcOption === void 0) return;
	if (typeof srcOption === "boolean") {
		if (!isObject$11(mergeTarget[option])) mergeTarget[option] = {};
		mergeTarget[option].enabled = srcOption;
		return;
	}
	if (srcOption === null && !isObject$11(mergeTarget[option])) if (isPresent(globalOption)) mergeTarget[option] = _Object$create$1(globalOption);
	else return;
	if (!isObject$11(srcOption)) return;
	var enabled = true;
	if (srcOption.enabled !== void 0) enabled = srcOption.enabled;
	else if (globalEnabled !== void 0) enabled = globalOption.enabled;
	doMerge(mergeTarget, options, option);
	mergeTarget[option].enabled = enabled;
}
var easingFunctions = {
	linear: function linear(t) {
		return t;
	},
	easeInQuad: function easeInQuad(t) {
		return t * t;
	},
	easeOutQuad: function easeOutQuad(t) {
		return t * (2 - t);
	},
	easeInOutQuad: function easeInOutQuad(t) {
		return t < .5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
	},
	easeInCubic: function easeInCubic(t) {
		return t * t * t;
	},
	easeOutCubic: function easeOutCubic(t) {
		return --t * t * t + 1;
	},
	easeInOutCubic: function easeInOutCubic(t) {
		return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
	},
	easeInQuart: function easeInQuart(t) {
		return t * t * t * t;
	},
	easeOutQuart: function easeOutQuart(t) {
		return 1 - --t * t * t * t;
	},
	easeInOutQuart: function easeInOutQuart(t) {
		return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t;
	},
	easeInQuint: function easeInQuint(t) {
		return t * t * t * t * t;
	},
	easeOutQuint: function easeOutQuint(t) {
		return 1 + --t * t * t * t * t;
	},
	easeInOutQuint: function easeInOutQuint(t) {
		return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t;
	}
};
/**

* Get the top most property value from a pile of objects.

*

* @param pile - Array of objects, no required format.

* @param accessors - Array of property names.

* For example `object['foo']['bar']` → `['foo', 'bar']`.

* @returns Value of the property with given accessors path from the first pile item where it's not undefined.

*/
function topMost(pile, accessors) {
	var candidate;
	if (!_Array$isArray(accessors)) accessors = [accessors];
	var _iterator3 = _createForOfIteratorHelper$6(pile), _step3;
	try {
		for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
			var member = _step3.value;
			if (member) {
				candidate = member[accessors[0]];
				for (var i$2 = 1; i$2 < accessors.length; i$2++) if (candidate) candidate = candidate[accessors[i$2]];
				if (typeof candidate !== "undefined") break;
			}
		}
	} catch (err) {
		_iterator3.e(err);
	} finally {
		_iterator3.f();
	}
	return candidate;
}
var htmlColors = {
	black: "#000000",
	navy: "#000080",
	darkblue: "#00008B",
	mediumblue: "#0000CD",
	blue: "#0000FF",
	darkgreen: "#006400",
	green: "#008000",
	teal: "#008080",
	darkcyan: "#008B8B",
	deepskyblue: "#00BFFF",
	darkturquoise: "#00CED1",
	mediumspringgreen: "#00FA9A",
	lime: "#00FF00",
	springgreen: "#00FF7F",
	aqua: "#00FFFF",
	cyan: "#00FFFF",
	midnightblue: "#191970",
	dodgerblue: "#1E90FF",
	lightseagreen: "#20B2AA",
	forestgreen: "#228B22",
	seagreen: "#2E8B57",
	darkslategray: "#2F4F4F",
	limegreen: "#32CD32",
	mediumseagreen: "#3CB371",
	turquoise: "#40E0D0",
	royalblue: "#4169E1",
	steelblue: "#4682B4",
	darkslateblue: "#483D8B",
	mediumturquoise: "#48D1CC",
	indigo: "#4B0082",
	darkolivegreen: "#556B2F",
	cadetblue: "#5F9EA0",
	cornflowerblue: "#6495ED",
	mediumaquamarine: "#66CDAA",
	dimgray: "#696969",
	slateblue: "#6A5ACD",
	olivedrab: "#6B8E23",
	slategray: "#708090",
	lightslategray: "#778899",
	mediumslateblue: "#7B68EE",
	lawngreen: "#7CFC00",
	chartreuse: "#7FFF00",
	aquamarine: "#7FFFD4",
	maroon: "#800000",
	purple: "#800080",
	olive: "#808000",
	gray: "#808080",
	skyblue: "#87CEEB",
	lightskyblue: "#87CEFA",
	blueviolet: "#8A2BE2",
	darkred: "#8B0000",
	darkmagenta: "#8B008B",
	saddlebrown: "#8B4513",
	darkseagreen: "#8FBC8F",
	lightgreen: "#90EE90",
	mediumpurple: "#9370D8",
	darkviolet: "#9400D3",
	palegreen: "#98FB98",
	darkorchid: "#9932CC",
	yellowgreen: "#9ACD32",
	sienna: "#A0522D",
	brown: "#A52A2A",
	darkgray: "#A9A9A9",
	lightblue: "#ADD8E6",
	greenyellow: "#ADFF2F",
	paleturquoise: "#AFEEEE",
	lightsteelblue: "#B0C4DE",
	powderblue: "#B0E0E6",
	firebrick: "#B22222",
	darkgoldenrod: "#B8860B",
	mediumorchid: "#BA55D3",
	rosybrown: "#BC8F8F",
	darkkhaki: "#BDB76B",
	silver: "#C0C0C0",
	mediumvioletred: "#C71585",
	indianred: "#CD5C5C",
	peru: "#CD853F",
	chocolate: "#D2691E",
	tan: "#D2B48C",
	lightgrey: "#D3D3D3",
	palevioletred: "#D87093",
	thistle: "#D8BFD8",
	orchid: "#DA70D6",
	goldenrod: "#DAA520",
	crimson: "#DC143C",
	gainsboro: "#DCDCDC",
	plum: "#DDA0DD",
	burlywood: "#DEB887",
	lightcyan: "#E0FFFF",
	lavender: "#E6E6FA",
	darksalmon: "#E9967A",
	violet: "#EE82EE",
	palegoldenrod: "#EEE8AA",
	lightcoral: "#F08080",
	khaki: "#F0E68C",
	aliceblue: "#F0F8FF",
	honeydew: "#F0FFF0",
	azure: "#F0FFFF",
	sandybrown: "#F4A460",
	wheat: "#F5DEB3",
	beige: "#F5F5DC",
	whitesmoke: "#F5F5F5",
	mintcream: "#F5FFFA",
	ghostwhite: "#F8F8FF",
	salmon: "#FA8072",
	antiquewhite: "#FAEBD7",
	linen: "#FAF0E6",
	lightgoldenrodyellow: "#FAFAD2",
	oldlace: "#FDF5E6",
	red: "#FF0000",
	fuchsia: "#FF00FF",
	magenta: "#FF00FF",
	deeppink: "#FF1493",
	orangered: "#FF4500",
	tomato: "#FF6347",
	hotpink: "#FF69B4",
	coral: "#FF7F50",
	darkorange: "#FF8C00",
	lightsalmon: "#FFA07A",
	orange: "#FFA500",
	lightpink: "#FFB6C1",
	pink: "#FFC0CB",
	gold: "#FFD700",
	peachpuff: "#FFDAB9",
	navajowhite: "#FFDEAD",
	moccasin: "#FFE4B5",
	bisque: "#FFE4C4",
	mistyrose: "#FFE4E1",
	blanchedalmond: "#FFEBCD",
	papayawhip: "#FFEFD5",
	lavenderblush: "#FFF0F5",
	seashell: "#FFF5EE",
	cornsilk: "#FFF8DC",
	lemonchiffon: "#FFFACD",
	floralwhite: "#FFFAF0",
	snow: "#FFFAFA",
	yellow: "#FFFF00",
	lightyellow: "#FFFFE0",
	ivory: "#FFFFF0",
	white: "#FFFFFF"
};
/**
* @param {number} [pixelRatio=1]
*/
var ColorPicker$1 = /* @__PURE__ */ function() {
	/**
	* @param {number} [pixelRatio=1]
	*/
	function ColorPicker$1$1() {
		var pixelRatio = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
		_classCallCheck(this, ColorPicker$1$1);
		this.pixelRatio = pixelRatio;
		this.generated = false;
		this.centerCoordinates = {
			x: 289 / 2,
			y: 289 / 2
		};
		this.r = 289 * .49;
		this.color = {
			r: 255,
			g: 255,
			b: 255,
			a: 1
		};
		this.hueCircle = void 0;
		this.initialColor = {
			r: 255,
			g: 255,
			b: 255,
			a: 1
		};
		this.previousColor = void 0;
		this.applied = false;
		this.updateCallback = function() {};
		this.closeCallback = function() {};
		this._create();
	}
	/**
	* this inserts the colorPicker into a div from the DOM
	*
	* @param {Element} container
	*/
	_createClass(ColorPicker$1$1, [
		{
			key: "insertTo",
			value: function insertTo(container) {
				if (this.hammer !== void 0) {
					this.hammer.destroy();
					this.hammer = void 0;
				}
				this.container = container;
				this.container.appendChild(this.frame);
				this._bindHammer();
				this._setSize();
			}
		},
		{
			key: "setUpdateCallback",
			value: function setUpdateCallback(callback) {
				if (typeof callback === "function") this.updateCallback = callback;
				else throw new Error("Function attempted to set as colorPicker update callback is not a function.");
			}
		},
		{
			key: "setCloseCallback",
			value: function setCloseCallback(callback) {
				if (typeof callback === "function") this.closeCallback = callback;
				else throw new Error("Function attempted to set as colorPicker closing callback is not a function.");
			}
		},
		{
			key: "_isColorString",
			value: function _isColorString(color) {
				if (typeof color === "string") return htmlColors[color];
			}
		},
		{
			key: "setColor",
			value: function setColor(color) {
				var setInitial = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				if (color === "none") return;
				var rgba;
				var htmlColor = this._isColorString(color);
				if (htmlColor !== void 0) color = htmlColor;
				if (isString(color) === true) {
					if (isValidRGB(color) === true) {
						var rgbaArray = color.substr(4).substr(0, color.length - 5).split(",");
						rgba = {
							r: rgbaArray[0],
							g: rgbaArray[1],
							b: rgbaArray[2],
							a: 1
						};
					} else if (isValidRGBA(color) === true) {
						var _rgbaArray = color.substr(5).substr(0, color.length - 6).split(",");
						rgba = {
							r: _rgbaArray[0],
							g: _rgbaArray[1],
							b: _rgbaArray[2],
							a: _rgbaArray[3]
						};
					} else if (isValidHex(color) === true) {
						var rgbObj = hexToRGB(color);
						rgba = {
							r: rgbObj.r,
							g: rgbObj.g,
							b: rgbObj.b,
							a: 1
						};
					}
				} else if (color instanceof Object) {
					if (color.r !== void 0 && color.g !== void 0 && color.b !== void 0) {
						var alpha = color.a !== void 0 ? color.a : "1.0";
						rgba = {
							r: color.r,
							g: color.g,
							b: color.b,
							a: alpha
						};
					}
				}
				if (rgba === void 0) throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: " + _JSON$stringify(color));
				else this._setColor(rgba, setInitial);
			}
		},
		{
			key: "show",
			value: function show() {
				if (this.closeCallback !== void 0) {
					this.closeCallback();
					this.closeCallback = void 0;
				}
				this.applied = false;
				this.frame.style.display = "block";
				this._generateHueCircle();
			}
		},
		{
			key: "_hide",
			value: function _hide() {
				var _this2 = this;
				var storePrevious = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
				if (storePrevious === true) this.previousColor = _Object$assign({}, this.color);
				if (this.applied === true) this.updateCallback(this.initialColor);
				this.frame.style.display = "none";
				_setTimeout(function() {
					if (_this2.closeCallback !== void 0) {
						_this2.closeCallback();
						_this2.closeCallback = void 0;
					}
				}, 0);
			}
		},
		{
			key: "_save",
			value: function _save() {
				this.updateCallback(this.color);
				this.applied = false;
				this._hide();
			}
		},
		{
			key: "_apply",
			value: function _apply() {
				this.applied = true;
				this.updateCallback(this.color);
				this._updatePicker(this.color);
			}
		},
		{
			key: "_loadLast",
			value: function _loadLast() {
				if (this.previousColor !== void 0) this.setColor(this.previousColor, false);
				else alert("There is no last color to load...");
			}
		},
		{
			key: "_setColor",
			value: function _setColor(rgba) {
				var setInitial = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				if (setInitial === true) this.initialColor = _Object$assign({}, rgba);
				this.color = rgba;
				var hsv = RGBToHSV(rgba.r, rgba.g, rgba.b);
				var angleConvert = 2 * Math.PI;
				var radius = this.r * hsv.s;
				var x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);
				var y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);
				this.colorPickerSelector.style.left = x - .5 * this.colorPickerSelector.clientWidth + "px";
				this.colorPickerSelector.style.top = y - .5 * this.colorPickerSelector.clientHeight + "px";
				this._updatePicker(rgba);
			}
		},
		{
			key: "_setOpacity",
			value: function _setOpacity(value) {
				this.color.a = value / 100;
				this._updatePicker(this.color);
			}
		},
		{
			key: "_setBrightness",
			value: function _setBrightness(value) {
				var hsv = RGBToHSV(this.color.r, this.color.g, this.color.b);
				hsv.v = value / 100;
				var rgba = HSVToRGB(hsv.h, hsv.s, hsv.v);
				rgba["a"] = this.color.a;
				this.color = rgba;
				this._updatePicker();
			}
		},
		{
			key: "_updatePicker",
			value: function _updatePicker() {
				var rgba = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.color;
				var hsv = RGBToHSV(rgba.r, rgba.g, rgba.b);
				var ctx = this.colorPickerCanvas.getContext("2d");
				if (this.pixelRation === void 0) this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
				ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
				var w = this.colorPickerCanvas.clientWidth;
				var h = this.colorPickerCanvas.clientHeight;
				ctx.clearRect(0, 0, w, h);
				ctx.putImageData(this.hueCircle, 0, 0);
				ctx.fillStyle = "rgba(0,0,0," + (1 - hsv.v) + ")";
				ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
				_fillInstanceProperty(ctx).call(ctx);
				this.brightnessRange.value = 100 * hsv.v;
				this.opacityRange.value = 100 * rgba.a;
				this.initialColorDiv.style.backgroundColor = "rgba(" + this.initialColor.r + "," + this.initialColor.g + "," + this.initialColor.b + "," + this.initialColor.a + ")";
				this.newColorDiv.style.backgroundColor = "rgba(" + this.color.r + "," + this.color.g + "," + this.color.b + "," + this.color.a + ")";
			}
		},
		{
			key: "_setSize",
			value: function _setSize() {
				this.colorPickerCanvas.style.width = "100%";
				this.colorPickerCanvas.style.height = "100%";
				this.colorPickerCanvas.width = 289 * this.pixelRatio;
				this.colorPickerCanvas.height = 289 * this.pixelRatio;
			}
		},
		{
			key: "_create",
			value: function _create() {
				var _context16, _context17, _context18, _context19;
				this.frame = document.createElement("div");
				this.frame.className = "vis-color-picker";
				this.colorPickerDiv = document.createElement("div");
				this.colorPickerSelector = document.createElement("div");
				this.colorPickerSelector.className = "vis-selector";
				this.colorPickerDiv.appendChild(this.colorPickerSelector);
				this.colorPickerCanvas = document.createElement("canvas");
				this.colorPickerDiv.appendChild(this.colorPickerCanvas);
				if (!this.colorPickerCanvas.getContext) {
					var noCanvas = document.createElement("DIV");
					noCanvas.style.color = "red";
					noCanvas.style.fontWeight = "bold";
					noCanvas.style.padding = "10px";
					noCanvas.innerText = "Error: your browser does not support HTML canvas";
					this.colorPickerCanvas.appendChild(noCanvas);
				} else {
					var ctx = this.colorPickerCanvas.getContext("2d");
					this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
					this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
				}
				this.colorPickerDiv.className = "vis-color";
				this.opacityDiv = document.createElement("div");
				this.opacityDiv.className = "vis-opacity";
				this.brightnessDiv = document.createElement("div");
				this.brightnessDiv.className = "vis-brightness";
				this.arrowDiv = document.createElement("div");
				this.arrowDiv.className = "vis-arrow";
				this.opacityRange = document.createElement("input");
				try {
					this.opacityRange.type = "range";
					this.opacityRange.min = "0";
					this.opacityRange.max = "100";
				} catch (err) {}
				this.opacityRange.value = "100";
				this.opacityRange.className = "vis-range";
				this.brightnessRange = document.createElement("input");
				try {
					this.brightnessRange.type = "range";
					this.brightnessRange.min = "0";
					this.brightnessRange.max = "100";
				} catch (err) {}
				this.brightnessRange.value = "100";
				this.brightnessRange.className = "vis-range";
				this.opacityDiv.appendChild(this.opacityRange);
				this.brightnessDiv.appendChild(this.brightnessRange);
				var me = this;
				this.opacityRange.onchange = function() {
					me._setOpacity(this.value);
				};
				this.opacityRange.oninput = function() {
					me._setOpacity(this.value);
				};
				this.brightnessRange.onchange = function() {
					me._setBrightness(this.value);
				};
				this.brightnessRange.oninput = function() {
					me._setBrightness(this.value);
				};
				this.brightnessLabel = document.createElement("div");
				this.brightnessLabel.className = "vis-label vis-brightness";
				this.brightnessLabel.innerText = "brightness:";
				this.opacityLabel = document.createElement("div");
				this.opacityLabel.className = "vis-label vis-opacity";
				this.opacityLabel.innerText = "opacity:";
				this.newColorDiv = document.createElement("div");
				this.newColorDiv.className = "vis-new-color";
				this.newColorDiv.innerText = "new";
				this.initialColorDiv = document.createElement("div");
				this.initialColorDiv.className = "vis-initial-color";
				this.initialColorDiv.innerText = "initial";
				this.cancelButton = document.createElement("div");
				this.cancelButton.className = "vis-button vis-cancel";
				this.cancelButton.innerText = "cancel";
				this.cancelButton.onclick = _bindInstanceProperty$1(_context16 = this._hide).call(_context16, this, false);
				this.applyButton = document.createElement("div");
				this.applyButton.className = "vis-button vis-apply";
				this.applyButton.innerText = "apply";
				this.applyButton.onclick = _bindInstanceProperty$1(_context17 = this._apply).call(_context17, this);
				this.saveButton = document.createElement("div");
				this.saveButton.className = "vis-button vis-save";
				this.saveButton.innerText = "save";
				this.saveButton.onclick = _bindInstanceProperty$1(_context18 = this._save).call(_context18, this);
				this.loadButton = document.createElement("div");
				this.loadButton.className = "vis-button vis-load";
				this.loadButton.innerText = "load last";
				this.loadButton.onclick = _bindInstanceProperty$1(_context19 = this._loadLast).call(_context19, this);
				this.frame.appendChild(this.colorPickerDiv);
				this.frame.appendChild(this.arrowDiv);
				this.frame.appendChild(this.brightnessLabel);
				this.frame.appendChild(this.brightnessDiv);
				this.frame.appendChild(this.opacityLabel);
				this.frame.appendChild(this.opacityDiv);
				this.frame.appendChild(this.newColorDiv);
				this.frame.appendChild(this.initialColorDiv);
				this.frame.appendChild(this.cancelButton);
				this.frame.appendChild(this.applyButton);
				this.frame.appendChild(this.saveButton);
				this.frame.appendChild(this.loadButton);
			}
		},
		{
			key: "_bindHammer",
			value: function _bindHammer() {
				var _this3 = this;
				this.drag = {};
				this.pinch = {};
				this.hammer = new Hammer$1(this.colorPickerCanvas);
				this.hammer.get("pinch").set({ enable: true });
				this.hammer.on("hammer.input", function(event) {
					if (event.isFirst) _this3._moveSelector(event);
				});
				this.hammer.on("tap", function(event) {
					_this3._moveSelector(event);
				});
				this.hammer.on("panstart", function(event) {
					_this3._moveSelector(event);
				});
				this.hammer.on("panmove", function(event) {
					_this3._moveSelector(event);
				});
				this.hammer.on("panend", function(event) {
					_this3._moveSelector(event);
				});
			}
		},
		{
			key: "_generateHueCircle",
			value: function _generateHueCircle() {
				if (this.generated === false) {
					var ctx = this.colorPickerCanvas.getContext("2d");
					if (this.pixelRation === void 0) this.pixelRatio = (window.devicePixelRatio || 1) / (ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1);
					ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
					var w = this.colorPickerCanvas.clientWidth;
					var h = this.colorPickerCanvas.clientHeight;
					ctx.clearRect(0, 0, w, h);
					var x, y, hue, sat;
					this.centerCoordinates = {
						x: w * .5,
						y: h * .5
					};
					this.r = .49 * w;
					var angleConvert = 2 * Math.PI / 360;
					var hfac = 1 / 360;
					var sfac = 1 / this.r;
					var rgb;
					for (hue = 0; hue < 360; hue++) for (sat = 0; sat < this.r; sat++) {
						x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);
						y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);
						rgb = HSVToRGB(hue * hfac, sat * sfac, 1);
						ctx.fillStyle = "rgb(" + rgb.r + "," + rgb.g + "," + rgb.b + ")";
						ctx.fillRect(x - .5, y - .5, 2, 2);
					}
					ctx.strokeStyle = "rgba(0,0,0,1)";
					ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);
					ctx.stroke();
					this.hueCircle = ctx.getImageData(0, 0, w, h);
				}
				this.generated = true;
			}
		},
		{
			key: "_moveSelector",
			value: function _moveSelector(event) {
				var rect = this.colorPickerDiv.getBoundingClientRect();
				var left = event.center.x - rect.left;
				var top = event.center.y - rect.top;
				var centerY = .5 * this.colorPickerDiv.clientHeight;
				var centerX = .5 * this.colorPickerDiv.clientWidth;
				var x = left - centerX;
				var y = top - centerY;
				var angle = Math.atan2(x, y);
				var radius = .98 * Math.min(Math.sqrt(x * x + y * y), centerX);
				var newTop = Math.cos(angle) * radius + centerY;
				var newLeft = Math.sin(angle) * radius + centerX;
				this.colorPickerSelector.style.top = newTop - .5 * this.colorPickerSelector.clientHeight + "px";
				this.colorPickerSelector.style.left = newLeft - .5 * this.colorPickerSelector.clientWidth + "px";
				var h = angle / (2 * Math.PI);
				h = h < 0 ? h + 1 : h;
				var s = radius / this.r;
				var hsv = RGBToHSV(this.color.r, this.color.g, this.color.b);
				hsv.h = h;
				hsv.s = s;
				var rgba = HSVToRGB(hsv.h, hsv.s, hsv.v);
				rgba["a"] = this.color.a;
				this.color = rgba;
				this.initialColorDiv.style.backgroundColor = "rgba(" + this.initialColor.r + "," + this.initialColor.g + "," + this.initialColor.b + "," + this.initialColor.a + ")";
				this.newColorDiv.style.backgroundColor = "rgba(" + this.color.r + "," + this.color.g + "," + this.color.b + "," + this.color.a + ")";
			}
		}
	]);
	return ColorPicker$1$1;
}();
/**
* Wrap given text (last argument) in HTML elements (all preceding arguments).
*
* @param {...any} rest - List of tag names followed by inner text.
* @returns An element or a text node.
*/
function wrapInTag() {
	for (var _len5 = arguments.length, rest = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) rest[_key5] = arguments[_key5];
	if (rest.length < 1) throw new TypeError("Invalid arguments.");
	else if (rest.length === 1) return document.createTextNode(rest[0]);
	else {
		var element = document.createElement(rest[0]);
		element.appendChild(wrapInTag.apply(void 0, _toConsumableArray(_sliceInstanceProperty(rest).call(rest, 1))));
		return element;
	}
}
/**
* The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.
* Boolean options are recognised as Boolean
* Number options should be written as array: [default value, min value, max value, stepsize]
* Colors should be written as array: ['color', '#ffffff']
* Strings with should be written as array: [option1, option2, option3, ..]
*
* The options are matched with their counterparts in each of the modules and the values used in the configuration are
*/
var Configurator$1 = /* @__PURE__ */ function() {
	/**
	* @param {object} parentModule        | the location where parentModule.setOptions() can be called
	* @param {object} defaultContainer    | the default container of the module
	* @param {object} configureOptions    | the fully configured and predefined options set found in allOptions.js
	* @param {number} pixelRatio          | canvas pixel ratio
	* @param {Function} hideOption        | custom logic to dynamically hide options
	*/
	function Configurator$1$1(parentModule, defaultContainer, configureOptions$1) {
		var pixelRatio = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
		var hideOption = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : function() {
			return false;
		};
		_classCallCheck(this, Configurator$1$1);
		this.parent = parentModule;
		this.changedOptions = [];
		this.container = defaultContainer;
		this.allowCreation = false;
		this.hideOption = hideOption;
		this.options = {};
		this.initialized = false;
		this.popupCounter = 0;
		this.defaultOptions = {
			enabled: false,
			filter: true,
			container: void 0,
			showButton: true
		};
		_Object$assign(this.options, this.defaultOptions);
		this.configureOptions = configureOptions$1;
		this.moduleOptions = {};
		this.domElements = [];
		this.popupDiv = {};
		this.popupLimit = 5;
		this.popupHistory = {};
		this.colorPicker = new ColorPicker$1(pixelRatio);
		this.wrapper = void 0;
	}
	/**
	* refresh all options.
	* Because all modules parse their options by themselves, we just use their options. We copy them here.
	*
	* @param {object} options
	*/
	_createClass(Configurator$1$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					this.popupHistory = {};
					this._removePopup();
					var enabled = true;
					if (typeof options === "string") this.options.filter = options;
					else if (_Array$isArray(options)) this.options.filter = options.join();
					else if (_typeof(options) === "object") {
						if (options == null) throw new TypeError("options cannot be null");
						if (options.container !== void 0) this.options.container = options.container;
						if (_filterInstanceProperty(options) !== void 0) this.options.filter = _filterInstanceProperty(options);
						if (options.showButton !== void 0) this.options.showButton = options.showButton;
						if (options.enabled !== void 0) enabled = options.enabled;
					} else if (typeof options === "boolean") {
						this.options.filter = true;
						enabled = options;
					} else if (typeof options === "function") {
						this.options.filter = options;
						enabled = true;
					}
					if (_filterInstanceProperty(this.options) === false) enabled = false;
					this.options.enabled = enabled;
				}
				this._clean();
			}
		},
		{
			key: "setModuleOptions",
			value: function setModuleOptions(moduleOptions) {
				this.moduleOptions = moduleOptions;
				if (this.options.enabled === true) {
					this._clean();
					if (this.options.container !== void 0) this.container = this.options.container;
					this._create();
				}
			}
		},
		{
			key: "_create",
			value: function _create() {
				this._clean();
				this.changedOptions = [];
				var filter$5 = _filterInstanceProperty(this.options);
				var counter$1 = 0;
				var show = false;
				for (var _option in this.configureOptions) if (Object.prototype.hasOwnProperty.call(this.configureOptions, _option)) {
					this.allowCreation = false;
					show = false;
					if (typeof filter$5 === "function") {
						show = filter$5(_option, []);
						show = show || this._handleObject(this.configureOptions[_option], [_option], true);
					} else if (filter$5 === true || _indexOfInstanceProperty(filter$5).call(filter$5, _option) !== -1) show = true;
					if (show !== false) {
						this.allowCreation = true;
						if (counter$1 > 0) this._makeItem([]);
						this._makeHeader(_option);
						this._handleObject(this.configureOptions[_option], [_option]);
					}
					counter$1++;
				}
				this._makeButton();
				this._push();
			}
		},
		{
			key: "_push",
			value: function _push() {
				this.wrapper = document.createElement("div");
				this.wrapper.className = "vis-configuration-wrapper";
				this.container.appendChild(this.wrapper);
				for (var i$2 = 0; i$2 < this.domElements.length; i$2++) this.wrapper.appendChild(this.domElements[i$2]);
				this._showPopupIfNeeded();
			}
		},
		{
			key: "_clean",
			value: function _clean() {
				for (var i$2 = 0; i$2 < this.domElements.length; i$2++) this.wrapper.removeChild(this.domElements[i$2]);
				if (this.wrapper !== void 0) {
					this.container.removeChild(this.wrapper);
					this.wrapper = void 0;
				}
				this.domElements = [];
				this._removePopup();
			}
		},
		{
			key: "_getValue",
			value: function _getValue(path$11) {
				var base = this.moduleOptions;
				for (var i$2 = 0; i$2 < path$11.length; i$2++) if (base[path$11[i$2]] !== void 0) base = base[path$11[i$2]];
				else {
					base = void 0;
					break;
				}
				return base;
			}
		},
		{
			key: "_makeItem",
			value: function _makeItem(path$11) {
				if (this.allowCreation === true) {
					var item = document.createElement("div");
					item.className = "vis-configuration vis-config-item vis-config-s" + path$11.length;
					for (var _len6 = arguments.length, domElements = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) domElements[_key6 - 1] = arguments[_key6];
					_forEachInstanceProperty(domElements).call(domElements, function(element) {
						item.appendChild(element);
					});
					this.domElements.push(item);
					return this.domElements.length;
				}
				return 0;
			}
		},
		{
			key: "_makeHeader",
			value: function _makeHeader(name) {
				var div = document.createElement("div");
				div.className = "vis-configuration vis-config-header";
				div.innerText = name;
				this._makeItem([], div);
			}
		},
		{
			key: "_makeLabel",
			value: function _makeLabel(name, path$11) {
				var objectLabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				var div = document.createElement("div");
				div.className = "vis-configuration vis-config-label vis-config-s" + path$11.length;
				if (objectLabel === true) {
					while (div.firstChild) div.removeChild(div.firstChild);
					div.appendChild(wrapInTag("i", "b", name));
				} else div.innerText = name + ":";
				return div;
			}
		},
		{
			key: "_makeDropdown",
			value: function _makeDropdown(arr, value, path$11) {
				var select = document.createElement("select");
				select.className = "vis-configuration vis-config-select";
				var selectedValue = 0;
				if (value !== void 0) {
					if (_indexOfInstanceProperty(arr).call(arr, value) !== -1) selectedValue = _indexOfInstanceProperty(arr).call(arr, value);
				}
				for (var i$2 = 0; i$2 < arr.length; i$2++) {
					var _option2 = document.createElement("option");
					_option2.value = arr[i$2];
					if (i$2 === selectedValue) _option2.selected = "selected";
					_option2.innerText = arr[i$2];
					select.appendChild(_option2);
				}
				var me = this;
				select.onchange = function() {
					me._update(this.value, path$11);
				};
				var label = this._makeLabel(path$11[path$11.length - 1], path$11);
				this._makeItem(path$11, label, select);
			}
		},
		{
			key: "_makeRange",
			value: function _makeRange(arr, value, path$11) {
				var defaultValue = arr[0];
				var min$4 = arr[1];
				var max$5 = arr[2];
				var step = arr[3];
				var range = document.createElement("input");
				range.className = "vis-configuration vis-config-range";
				try {
					range.type = "range";
					range.min = min$4;
					range.max = max$5;
				} catch (err) {}
				range.step = step;
				var popupString = "";
				var popupValue = 0;
				if (value !== void 0) {
					var factor = 1.2;
					if (value < 0 && value * factor < min$4) {
						range.min = Math.ceil(value * factor);
						popupValue = range.min;
						popupString = "range increased";
					} else if (value / factor < min$4) {
						range.min = Math.ceil(value / factor);
						popupValue = range.min;
						popupString = "range increased";
					}
					if (value * factor > max$5 && max$5 !== 1) {
						range.max = Math.ceil(value * factor);
						popupValue = range.max;
						popupString = "range increased";
					}
					range.value = value;
				} else range.value = defaultValue;
				var input = document.createElement("input");
				input.className = "vis-configuration vis-config-rangeinput";
				input.value = range.value;
				var me = this;
				range.onchange = function() {
					input.value = this.value;
					me._update(Number(this.value), path$11);
				};
				range.oninput = function() {
					input.value = this.value;
				};
				var label = this._makeLabel(path$11[path$11.length - 1], path$11);
				var itemIndex = this._makeItem(path$11, label, range, input);
				if (popupString !== "" && this.popupHistory[itemIndex] !== popupValue) {
					this.popupHistory[itemIndex] = popupValue;
					this._setupPopup(popupString, itemIndex);
				}
			}
		},
		{
			key: "_makeButton",
			value: function _makeButton() {
				var _this4 = this;
				if (this.options.showButton === true) {
					var generateButton = document.createElement("div");
					generateButton.className = "vis-configuration vis-config-button";
					generateButton.innerText = "generate options";
					generateButton.onclick = function() {
						_this4._printOptions();
					};
					generateButton.onmouseover = function() {
						generateButton.className = "vis-configuration vis-config-button hover";
					};
					generateButton.onmouseout = function() {
						generateButton.className = "vis-configuration vis-config-button";
					};
					this.optionsContainer = document.createElement("div");
					this.optionsContainer.className = "vis-configuration vis-config-option-container";
					this.domElements.push(this.optionsContainer);
					this.domElements.push(generateButton);
				}
			}
		},
		{
			key: "_setupPopup",
			value: function _setupPopup(string$1, index$1) {
				var _this5 = this;
				if (this.initialized === true && this.allowCreation === true && this.popupCounter < this.popupLimit) {
					var div = document.createElement("div");
					div.id = "vis-configuration-popup";
					div.className = "vis-configuration-popup";
					div.innerText = string$1;
					div.onclick = function() {
						_this5._removePopup();
					};
					this.popupCounter += 1;
					this.popupDiv = {
						html: div,
						index: index$1
					};
				}
			}
		},
		{
			key: "_removePopup",
			value: function _removePopup() {
				if (this.popupDiv.html !== void 0) {
					this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);
					clearTimeout(this.popupDiv.hideTimeout);
					clearTimeout(this.popupDiv.deleteTimeout);
					this.popupDiv = {};
				}
			}
		},
		{
			key: "_showPopupIfNeeded",
			value: function _showPopupIfNeeded() {
				var _this6 = this;
				if (this.popupDiv.html !== void 0) {
					var correspondingElement = this.domElements[this.popupDiv.index];
					var rect = correspondingElement.getBoundingClientRect();
					this.popupDiv.html.style.left = rect.left + "px";
					this.popupDiv.html.style.top = rect.top - 30 + "px";
					document.body.appendChild(this.popupDiv.html);
					this.popupDiv.hideTimeout = _setTimeout(function() {
						_this6.popupDiv.html.style.opacity = 0;
					}, 1500);
					this.popupDiv.deleteTimeout = _setTimeout(function() {
						_this6._removePopup();
					}, 1800);
				}
			}
		},
		{
			key: "_makeCheckbox",
			value: function _makeCheckbox(defaultValue, value, path$11) {
				var checkbox = document.createElement("input");
				checkbox.type = "checkbox";
				checkbox.className = "vis-configuration vis-config-checkbox";
				checkbox.checked = defaultValue;
				if (value !== void 0) {
					checkbox.checked = value;
					if (value !== defaultValue) if (_typeof(defaultValue) === "object") {
						if (value !== defaultValue.enabled) this.changedOptions.push({
							path: path$11,
							value
						});
					} else this.changedOptions.push({
						path: path$11,
						value
					});
				}
				var me = this;
				checkbox.onchange = function() {
					me._update(this.checked, path$11);
				};
				var label = this._makeLabel(path$11[path$11.length - 1], path$11);
				this._makeItem(path$11, label, checkbox);
			}
		},
		{
			key: "_makeTextInput",
			value: function _makeTextInput(defaultValue, value, path$11) {
				var checkbox = document.createElement("input");
				checkbox.type = "text";
				checkbox.className = "vis-configuration vis-config-text";
				checkbox.value = value;
				if (value !== defaultValue) this.changedOptions.push({
					path: path$11,
					value
				});
				var me = this;
				checkbox.onchange = function() {
					me._update(this.value, path$11);
				};
				var label = this._makeLabel(path$11[path$11.length - 1], path$11);
				this._makeItem(path$11, label, checkbox);
			}
		},
		{
			key: "_makeColorField",
			value: function _makeColorField(arr, value, path$11) {
				var _this7 = this;
				var defaultColor = arr[1];
				var div = document.createElement("div");
				value = value === void 0 ? defaultColor : value;
				if (value !== "none") {
					div.className = "vis-configuration vis-config-colorBlock";
					div.style.backgroundColor = value;
				} else div.className = "vis-configuration vis-config-colorBlock none";
				value = value === void 0 ? defaultColor : value;
				div.onclick = function() {
					_this7._showColorPicker(value, div, path$11);
				};
				var label = this._makeLabel(path$11[path$11.length - 1], path$11);
				this._makeItem(path$11, label, div);
			}
		},
		{
			key: "_showColorPicker",
			value: function _showColorPicker(value, div, path$11) {
				var _this8 = this;
				div.onclick = function() {};
				this.colorPicker.insertTo(div);
				this.colorPicker.show();
				this.colorPicker.setColor(value);
				this.colorPicker.setUpdateCallback(function(color) {
					var colorString = "rgba(" + color.r + "," + color.g + "," + color.b + "," + color.a + ")";
					div.style.backgroundColor = colorString;
					_this8._update(colorString, path$11);
				});
				this.colorPicker.setCloseCallback(function() {
					div.onclick = function() {
						_this8._showColorPicker(value, div, path$11);
					};
				});
			}
		},
		{
			key: "_handleObject",
			value: function _handleObject(obj) {
				var path$11 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
				var checkOnly = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				var show = false;
				var filter$5 = _filterInstanceProperty(this.options);
				var visibleInSet = false;
				for (var subObj in obj) if (Object.prototype.hasOwnProperty.call(obj, subObj)) {
					show = true;
					var item = obj[subObj];
					var newPath = copyAndExtendArray(path$11, subObj);
					if (typeof filter$5 === "function") {
						show = filter$5(subObj, path$11);
						if (show === false) {
							if (!_Array$isArray(item) && typeof item !== "string" && typeof item !== "boolean" && item instanceof Object) {
								this.allowCreation = false;
								show = this._handleObject(item, newPath, true);
								this.allowCreation = checkOnly === false;
							}
						}
					}
					if (show !== false) {
						visibleInSet = true;
						var value = this._getValue(newPath);
						if (_Array$isArray(item)) this._handleArray(item, value, newPath);
						else if (typeof item === "string") this._makeTextInput(item, value, newPath);
						else if (typeof item === "boolean") this._makeCheckbox(item, value, newPath);
						else if (item instanceof Object) {
							if (!this.hideOption(path$11, subObj, this.moduleOptions)) if (item.enabled !== void 0) {
								var enabledPath = copyAndExtendArray(newPath, "enabled");
								var enabledValue = this._getValue(enabledPath);
								if (enabledValue === true) {
									var label = this._makeLabel(subObj, newPath, true);
									this._makeItem(newPath, label);
									visibleInSet = this._handleObject(item, newPath) || visibleInSet;
								} else this._makeCheckbox(item, enabledValue, newPath);
							} else {
								var _label = this._makeLabel(subObj, newPath, true);
								this._makeItem(newPath, _label);
								visibleInSet = this._handleObject(item, newPath) || visibleInSet;
							}
						} else console.error("dont know how to handle", item, subObj, newPath);
					}
				}
				return visibleInSet;
			}
		},
		{
			key: "_handleArray",
			value: function _handleArray(arr, value, path$11) {
				if (typeof arr[0] === "string" && arr[0] === "color") {
					this._makeColorField(arr, value, path$11);
					if (arr[1] !== value) this.changedOptions.push({
						path: path$11,
						value
					});
				} else if (typeof arr[0] === "string") {
					this._makeDropdown(arr, value, path$11);
					if (arr[0] !== value) this.changedOptions.push({
						path: path$11,
						value
					});
				} else if (typeof arr[0] === "number") {
					this._makeRange(arr, value, path$11);
					if (arr[0] !== value) this.changedOptions.push({
						path: path$11,
						value: Number(value)
					});
				}
			}
		},
		{
			key: "_update",
			value: function _update(value, path$11) {
				var options = this._constructOptions(value, path$11);
				if (this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit) this.parent.body.emitter.emit("configChange", options);
				this.initialized = true;
				this.parent.setOptions(options);
			}
		},
		{
			key: "_constructOptions",
			value: function _constructOptions(value, path$11) {
				var optionsObj = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
				var pointer = optionsObj;
				value = value === "true" ? true : value;
				value = value === "false" ? false : value;
				for (var i$2 = 0; i$2 < path$11.length; i$2++) if (path$11[i$2] !== "global") {
					if (pointer[path$11[i$2]] === void 0) pointer[path$11[i$2]] = {};
					if (i$2 !== path$11.length - 1) pointer = pointer[path$11[i$2]];
					else pointer[path$11[i$2]] = value;
				}
				return optionsObj;
			}
		},
		{
			key: "_printOptions",
			value: function _printOptions() {
				var options = this.getOptions();
				while (this.optionsContainer.firstChild) this.optionsContainer.removeChild(this.optionsContainer.firstChild);
				this.optionsContainer.appendChild(wrapInTag("pre", "const options = " + _JSON$stringify(options, null, 2)));
			}
		},
		{
			key: "getOptions",
			value: function getOptions() {
				var options = {};
				for (var i$2 = 0; i$2 < this.changedOptions.length; i$2++) this._constructOptions(this.changedOptions[i$2].value, this.changedOptions[i$2].path, options);
				return options;
			}
		}
	]);
	return Configurator$1$1;
}();
/**
* Popup is a class to create a popup window with some text
*/
var Popup$1 = /* @__PURE__ */ function() {
	/**
	* @param {Element} container       The container object.
	* @param {string}  overflowMethod  How the popup should act to overflowing ('flip' or 'cap')
	*/
	function Popup$1$1(container, overflowMethod) {
		_classCallCheck(this, Popup$1$1);
		this.container = container;
		this.overflowMethod = overflowMethod || "cap";
		this.x = 0;
		this.y = 0;
		this.padding = 5;
		this.hidden = false;
		this.frame = document.createElement("div");
		this.frame.className = "vis-tooltip";
		this.container.appendChild(this.frame);
	}
	/**
	* @param {number} x   Horizontal position of the popup window
	* @param {number} y   Vertical position of the popup window
	*/
	_createClass(Popup$1$1, [
		{
			key: "setPosition",
			value: function setPosition(x, y) {
				this.x = _parseInt(x);
				this.y = _parseInt(y);
			}
		},
		{
			key: "setText",
			value: function setText(content) {
				if (content instanceof Element) {
					while (this.frame.firstChild) this.frame.removeChild(this.frame.firstChild);
					this.frame.appendChild(content);
				} else this.frame.innerText = content;
			}
		},
		{
			key: "show",
			value: function show(doShow) {
				if (doShow === void 0) doShow = true;
				if (doShow === true) {
					var height = this.frame.clientHeight;
					var width = this.frame.clientWidth;
					var maxHeight = this.frame.parentNode.clientHeight;
					var maxWidth = this.frame.parentNode.clientWidth;
					var left = 0, top = 0;
					if (this.overflowMethod == "flip") {
						var isLeft = false, isTop = true;
						if (this.y - height < this.padding) isTop = false;
						if (this.x + width > maxWidth - this.padding) isLeft = true;
						if (isLeft) left = this.x - width;
						else left = this.x;
						if (isTop) top = this.y - height;
						else top = this.y;
					} else {
						top = this.y - height;
						if (top + height + this.padding > maxHeight) top = maxHeight - height - this.padding;
						if (top < this.padding) top = this.padding;
						left = this.x;
						if (left + width + this.padding > maxWidth) left = maxWidth - width - this.padding;
						if (left < this.padding) left = this.padding;
					}
					this.frame.style.left = left + "px";
					this.frame.style.top = top + "px";
					this.frame.style.visibility = "visible";
					this.hidden = false;
				} else this.hide();
			}
		},
		{
			key: "hide",
			value: function hide() {
				this.hidden = true;
				this.frame.style.left = "0";
				this.frame.style.top = "0";
				this.frame.style.visibility = "hidden";
			}
		},
		{
			key: "destroy",
			value: function destroy() {
				this.frame.parentNode.removeChild(this.frame);
			}
		}
	]);
	return Popup$1$1;
}();
var errorFound = false;
var allOptions$1;
var VALIDATOR_PRINT_STYLE$1 = "background: #FFeeee; color: #dd0000";
/**
*  Used to validate options.
*/
var Validator$1 = /* @__PURE__ */ function() {
	function Validator$1$1() {
		_classCallCheck(this, Validator$1$1);
	}
	_createClass(Validator$1$1, null, [
		{
			key: "validate",
			value: function validate(options, referenceOptions, subObject) {
				errorFound = false;
				allOptions$1 = referenceOptions;
				var usedOptions = referenceOptions;
				if (subObject !== void 0) usedOptions = referenceOptions[subObject];
				Validator$1$1.parse(options, usedOptions, []);
				return errorFound;
			}
		},
		{
			key: "parse",
			value: function parse(options, referenceOptions, path$11) {
				for (var _option3 in options) if (Object.prototype.hasOwnProperty.call(options, _option3)) Validator$1$1.check(_option3, options, referenceOptions, path$11);
			}
		},
		{
			key: "check",
			value: function check$2(option, options, referenceOptions, path$11) {
				if (referenceOptions[option] === void 0 && referenceOptions.__any__ === void 0) {
					Validator$1$1.getSuggestion(option, referenceOptions, path$11);
					return;
				}
				var referenceOption = option;
				var is_object = true;
				if (referenceOptions[option] === void 0 && referenceOptions.__any__ !== void 0) {
					referenceOption = "__any__";
					is_object = Validator$1$1.getType(options[option]) === "object";
				}
				var refOptionObj = referenceOptions[referenceOption];
				if (is_object && refOptionObj.__type__ !== void 0) refOptionObj = refOptionObj.__type__;
				Validator$1$1.checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path$11);
			}
		},
		{
			key: "checkFields",
			value: function checkFields(option, options, referenceOptions, referenceOption, refOptionObj, path$11) {
				var log = function log$1(message) {
					console.error("%c" + message + Validator$1$1.printLocation(path$11, option), VALIDATOR_PRINT_STYLE$1);
				};
				var optionType = Validator$1$1.getType(options[option]);
				var refOptionType = refOptionObj[optionType];
				if (refOptionType !== void 0) {
					if (Validator$1$1.getType(refOptionType) === "array" && _indexOfInstanceProperty(refOptionType).call(refOptionType, options[option]) === -1) {
						log("Invalid option detected in \"" + option + "\". Allowed values are:" + Validator$1$1.print(refOptionType) + " not \"" + options[option] + "\". ");
						errorFound = true;
					} else if (optionType === "object" && referenceOption !== "__any__") {
						path$11 = copyAndExtendArray(path$11, option);
						Validator$1$1.parse(options[option], referenceOptions[referenceOption], path$11);
					}
				} else if (refOptionObj["any"] === void 0) {
					log("Invalid type received for \"" + option + "\". Expected: " + Validator$1$1.print(_Object$keys(refOptionObj)) + ". Received [" + optionType + "] \"" + options[option] + "\"");
					errorFound = true;
				}
			}
		},
		{
			key: "getType",
			value: function getType(object$1) {
				var type = _typeof(object$1);
				if (type === "object") {
					if (object$1 === null) return "null";
					if (object$1 instanceof Boolean) return "boolean";
					if (object$1 instanceof Number) return "number";
					if (object$1 instanceof String) return "string";
					if (_Array$isArray(object$1)) return "array";
					if (object$1 instanceof Date) return "date";
					if (object$1.nodeType !== void 0) return "dom";
					if (object$1._isAMomentObject === true) return "moment";
					return "object";
				} else if (type === "number") return "number";
				else if (type === "boolean") return "boolean";
				else if (type === "string") return "string";
				else if (type === void 0) return "undefined";
				return type;
			}
		},
		{
			key: "getSuggestion",
			value: function getSuggestion(option, options, path$11) {
				var localSearch = Validator$1$1.findInOptions(option, options, path$11, false);
				var globalSearch = Validator$1$1.findInOptions(option, allOptions$1, [], true);
				var localSearchThreshold = 8;
				var globalSearchThreshold = 4;
				var msg;
				if (localSearch.indexMatch !== void 0) msg = " in " + Validator$1$1.printLocation(localSearch.path, option, "") + "Perhaps it was incomplete? Did you mean: \"" + localSearch.indexMatch + "\"?\n\n";
				else if (globalSearch.distance <= globalSearchThreshold && localSearch.distance > globalSearch.distance) msg = " in " + Validator$1$1.printLocation(localSearch.path, option, "") + "Perhaps it was misplaced? Matching option found at: " + Validator$1$1.printLocation(globalSearch.path, globalSearch.closestMatch, "");
				else if (localSearch.distance <= localSearchThreshold) msg = ". Did you mean \"" + localSearch.closestMatch + "\"?" + Validator$1$1.printLocation(localSearch.path, option);
				else msg = ". Did you mean one of these: " + Validator$1$1.print(_Object$keys(options)) + Validator$1$1.printLocation(path$11, option);
				console.error("%cUnknown option detected: \"" + option + "\"" + msg, VALIDATOR_PRINT_STYLE$1);
				errorFound = true;
			}
		},
		{
			key: "findInOptions",
			value: function findInOptions(option, options, path$11) {
				var recursive = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
				var min$4 = 1e9;
				var closestMatch = "";
				var closestMatchPath = [];
				var lowerCaseOption = option.toLowerCase();
				var indexMatch = void 0;
				for (var op in options) {
					var distance = void 0;
					if (options[op].__type__ !== void 0 && recursive === true) {
						var result = Validator$1$1.findInOptions(option, options[op], copyAndExtendArray(path$11, op));
						if (min$4 > result.distance) {
							closestMatch = result.closestMatch;
							closestMatchPath = result.path;
							min$4 = result.distance;
							indexMatch = result.indexMatch;
						}
					} else {
						var _context20;
						if (_indexOfInstanceProperty(_context20 = op.toLowerCase()).call(_context20, lowerCaseOption) !== -1) indexMatch = op;
						distance = Validator$1$1.levenshteinDistance(option, op);
						if (min$4 > distance) {
							closestMatch = op;
							closestMatchPath = copyArray(path$11);
							min$4 = distance;
						}
					}
				}
				return {
					closestMatch,
					path: closestMatchPath,
					distance: min$4,
					indexMatch
				};
			}
		},
		{
			key: "printLocation",
			value: function printLocation(path$11, option) {
				var prefix = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "Problem value found at: \n";
				var str = "\n\n" + prefix + "options = {\n";
				for (var i$2 = 0; i$2 < path$11.length; i$2++) {
					for (var j = 0; j < i$2 + 1; j++) str += "  ";
					str += path$11[i$2] + ": {\n";
				}
				for (var _j = 0; _j < path$11.length + 1; _j++) str += "  ";
				str += option + "\n";
				for (var _i3 = 0; _i3 < path$11.length + 1; _i3++) {
					for (var _j2 = 0; _j2 < path$11.length - _i3; _j2++) str += "  ";
					str += "}\n";
				}
				return str + "\n\n";
			}
		},
		{
			key: "print",
			value: function print(options) {
				return _JSON$stringify(options).replace(/(")|(\[)|(\])|(,"__type__")/g, "").replace(/(,)/g, ", ");
			}
		},
		{
			key: "levenshteinDistance",
			value: function levenshteinDistance(a, b) {
				if (a.length === 0) return b.length;
				if (b.length === 0) return a.length;
				var matrix = [];
				var i$2;
				for (i$2 = 0; i$2 <= b.length; i$2++) matrix[i$2] = [i$2];
				var j;
				for (j = 0; j <= a.length; j++) matrix[0][j] = j;
				for (i$2 = 1; i$2 <= b.length; i$2++) for (j = 1; j <= a.length; j++) if (b.charAt(i$2 - 1) == a.charAt(j - 1)) matrix[i$2][j] = matrix[i$2 - 1][j - 1];
				else matrix[i$2][j] = Math.min(
					matrix[i$2 - 1][j - 1] + 1,
					// substitution
					Math.min(
						matrix[i$2][j - 1] + 1,
						// insertion
						matrix[i$2 - 1][j] + 1
)
);
				return matrix[b.length][a.length];
			}
		}
	]);
	return Validator$1$1;
}();
var Activator = Activator$1;
var Configurator = Configurator$1;
var Hammer = Hammer$1;
var Popup = Popup$1;
var VALIDATOR_PRINT_STYLE = VALIDATOR_PRINT_STYLE$1;
var Validator = Validator$1;
/**
* Parse a text source containing data in DOT language into a JSON object.
* The object contains two lists: one with nodes and one with edges.
*
* DOT language reference: http://www.graphviz.org/doc/info/lang.html
*
* DOT language attributes: http://graphviz.org/content/attrs
*
* @param {string} data     Text containing a graph in DOT-notation
* @returns {object} graph   An object containing two parameters:
*                          {Object[]} nodes
*                          {Object[]} edges
*
* -------------------------------------------
* TODO
* ====
*
* For label handling, this is an incomplete implementation. From docs (quote #3015):
*
* > the escape sequences "\n", "\l" and "\r" divide the label into lines, centered,
* > left-justified, and right-justified, respectively.
*
* Source: http://www.graphviz.org/content/attrs#kescString
*
* > As another aid for readability, dot allows double-quoted strings to span multiple physical
* > lines using the standard C convention of a backslash immediately preceding a newline
* > character
* > In addition, double-quoted strings can be concatenated using a '+' operator.
* > As HTML strings can contain newline characters, which are used solely for formatting,
* > the language does not allow escaped newlines or concatenation operators to be used
* > within them.
*
* - Currently, only '\\n' is handled
* - Note that text explicitly says 'labels'; the dot parser currently handles escape
*   sequences in **all** strings.
*/
function parseDOT(data$2) {
	dot = data$2;
	return parseGraph();
}
var NODE_ATTR_MAPPING = {
	fontsize: "font.size",
	fontcolor: "font.color",
	labelfontcolor: "font.color",
	fontname: "font.face",
	color: ["color.border", "color.background"],
	fillcolor: "color.background",
	tooltip: "title",
	labeltooltip: "title"
};
var EDGE_ATTR_MAPPING = _Object$create$1(NODE_ATTR_MAPPING);
EDGE_ATTR_MAPPING.color = "color.color";
EDGE_ATTR_MAPPING.style = "dashes";
var TOKENTYPE = {
	NULL: 0,
	DELIMITER: 1,
	IDENTIFIER: 2,
	UNKNOWN: 3
};
var DELIMITERS = {
	"{": true,
	"}": true,
	"[": true,
	"]": true,
	";": true,
	"=": true,
	",": true,
	"->": true,
	"--": true
};
var dot = "";
var index = 0;
var c = "";
var token = "";
var tokenType = TOKENTYPE.NULL;
/**
* Get the first character from the dot file.
* The character is stored into the char c. If the end of the dot file is
* reached, the function puts an empty string in c.
*/
function first() {
	index = 0;
	c = dot.charAt(0);
}
/**
* Get the next character from the dot file.
* The character is stored into the char c. If the end of the dot file is
* reached, the function puts an empty string in c.
*/
function next() {
	index++;
	c = dot.charAt(index);
}
/**
* Preview the next character from the dot file.
*
* @returns {string} cNext
*/
function nextPreview() {
	return dot.charAt(index + 1);
}
/**
* Test whether given character is alphabetic or numeric ( a-zA-Z_0-9.:# )
*
* @param {string} c
* @returns {boolean} isAlphaNumeric
*/
function isAlphaNumeric(c$1) {
	var charCode = c$1.charCodeAt(0);
	if (charCode < 47) return charCode === 35 || charCode === 46;
	if (charCode < 59) return charCode > 47;
	if (charCode < 91) return charCode > 64;
	if (charCode < 96) return charCode === 95;
	if (charCode < 123) return charCode > 96;
	return false;
}
/**
* Merge all options of object b into object b
*
* @param {object} a
* @param {object} b
* @returns {object} a
*/
function merge$1(a, b) {
	if (!a) a = {};
	if (b) {
		for (var name in b) if (b.hasOwnProperty(name)) a[name] = b[name];
	}
	return a;
}
/**
* Set a value in an object, where the provided parameter name can be a
* path with nested parameters. For example:
*
*     var obj = {a: 2};
*     setValue(obj, 'b.c', 3);     // obj = {a: 2, b: {c: 3}}
*
* @param {object} obj
* @param {string} path  A parameter name or dot-separated parameter path,
*                      like "color.highlight.border".
* @param {*} value
*/
function setValue(obj, path$11, value) {
	var keys$9 = path$11.split(".");
	var o = obj;
	while (keys$9.length) {
		var key = keys$9.shift();
		if (keys$9.length) {
			if (!o[key]) o[key] = {};
			o = o[key];
		} else o[key] = value;
	}
}
/**
* Add a node to a graph object. If there is already a node with
* the same id, their attributes will be merged.
*
* @param {object} graph
* @param {object} node
*/
function addNode(graph, node$1) {
	var i$2, len;
	var current = null;
	var graphs = [graph];
	var root = graph;
	while (root.parent) {
		graphs.push(root.parent);
		root = root.parent;
	}
	if (root.nodes) {
		for (i$2 = 0, len = root.nodes.length; i$2 < len; i$2++) if (node$1.id === root.nodes[i$2].id) {
			current = root.nodes[i$2];
			break;
		}
	}
	if (!current) {
		current = { id: node$1.id };
		if (graph.node) current.attr = merge$1(current.attr, graph.node);
	}
	for (i$2 = graphs.length - 1; i$2 >= 0; i$2--) {
		var _context;
		var g = graphs[i$2];
		if (!g.nodes) g.nodes = [];
		if (_indexOfInstanceProperty(_context = g.nodes).call(_context, current) === -1) g.nodes.push(current);
	}
	if (node$1.attr) current.attr = merge$1(current.attr, node$1.attr);
}
/**
* Add an edge to a graph object
*
* @param {object} graph
* @param {object} edge
*/
function addEdge(graph, edge) {
	if (!graph.edges) graph.edges = [];
	graph.edges.push(edge);
	if (graph.edge) {
		var attr = merge$1({}, graph.edge);
		edge.attr = merge$1(attr, edge.attr);
	}
}
/**
* Create an edge to a graph object
*
* @param {object} graph
* @param {string | number | object} from
* @param {string | number | object} to
* @param {string} type
* @param {object | null} attr
* @returns {object} edge
*/
function createEdge(graph, from$9, to, type, attr) {
	var edge = {
		from: from$9,
		to,
		type
	};
	if (graph.edge) edge.attr = merge$1({}, graph.edge);
	edge.attr = merge$1(edge.attr || {}, attr);
	if (attr != null) {
		if (attr.hasOwnProperty("arrows") && attr["arrows"] != null) {
			edge["arrows"] = { to: {
				enabled: true,
				type: attr.arrows.type
			} };
			attr["arrows"] = null;
		}
	}
	return edge;
}
/**
* Get next token in the current dot file.
* The token and token type are available as token and tokenType
*/
function getToken() {
	tokenType = TOKENTYPE.NULL;
	token = "";
	while (c === " " || c === "	" || c === "\n" || c === "\r") next();
	do {
		var isComment = false;
		if (c === "#") {
			var i$2 = index - 1;
			while (dot.charAt(i$2) === " " || dot.charAt(i$2) === "	") i$2--;
			if (dot.charAt(i$2) === "\n" || dot.charAt(i$2) === "") {
				while (c != "" && c != "\n") next();
				isComment = true;
			}
		}
		if (c === "/" && nextPreview() === "/") {
			while (c != "" && c != "\n") next();
			isComment = true;
		}
		if (c === "/" && nextPreview() === "*") {
			while (c != "") if (c === "*" && nextPreview() === "/") {
				next();
				next();
				break;
			} else next();
			isComment = true;
		}
		while (c === " " || c === "	" || c === "\n" || c === "\r") next();
	} while (isComment);
	if (c === "") {
		tokenType = TOKENTYPE.DELIMITER;
		return;
	}
	var c2 = c + nextPreview();
	if (DELIMITERS[c2]) {
		tokenType = TOKENTYPE.DELIMITER;
		token = c2;
		next();
		next();
		return;
	}
	if (DELIMITERS[c]) {
		tokenType = TOKENTYPE.DELIMITER;
		token = c;
		next();
		return;
	}
	if (isAlphaNumeric(c) || c === "-") {
		token += c;
		next();
		while (isAlphaNumeric(c)) {
			token += c;
			next();
		}
		if (token === "false") token = false;
		else if (token === "true") token = true;
		else if (!isNaN(Number(token))) token = Number(token);
		tokenType = TOKENTYPE.IDENTIFIER;
		return;
	}
	if (c === "\"") {
		next();
		while (c != "" && (c != "\"" || c === "\"" && nextPreview() === "\"")) {
			if (c === "\"") {
				token += c;
				next();
			} else if (c === "\\" && nextPreview() === "n") {
				token += "\n";
				next();
			} else token += c;
			next();
		}
		if (c != "\"") throw newSyntaxError("End of string \" expected");
		next();
		tokenType = TOKENTYPE.IDENTIFIER;
		return;
	}
	tokenType = TOKENTYPE.UNKNOWN;
	while (c != "") {
		token += c;
		next();
	}
	throw new SyntaxError("Syntax error in part \"" + chop(token, 30) + "\"");
}
/**
* Parse a graph.
*
* @returns {object} graph
*/
function parseGraph() {
	var graph = {};
	first();
	getToken();
	if (token === "strict") {
		graph.strict = true;
		getToken();
	}
	if (token === "graph" || token === "digraph") {
		graph.type = token;
		getToken();
	}
	if (tokenType === TOKENTYPE.IDENTIFIER) {
		graph.id = token;
		getToken();
	}
	if (token != "{") throw newSyntaxError("Angle bracket { expected");
	getToken();
	parseStatements(graph);
	if (token != "}") throw newSyntaxError("Angle bracket } expected");
	getToken();
	if (token !== "") throw newSyntaxError("End of file expected");
	getToken();
	delete graph.node;
	delete graph.edge;
	delete graph.graph;
	return graph;
}
/**
* Parse a list with statements.
*
* @param {object} graph
*/
function parseStatements(graph) {
	while (token !== "" && token != "}") {
		parseStatement(graph);
		if (token === ";") getToken();
	}
}
/**
* Parse a single statement. Can be a an attribute statement, node
* statement, a series of node statements and edge statements, or a
* parameter.
*
* @param {object} graph
*/
function parseStatement(graph) {
	var subgraph = parseSubgraph(graph);
	if (subgraph) {
		parseEdge(graph, subgraph);
		return;
	}
	var attr = parseAttributeStatement(graph);
	if (attr) return;
	if (tokenType != TOKENTYPE.IDENTIFIER) throw newSyntaxError("Identifier expected");
	var id$4 = token;
	getToken();
	if (token === "=") {
		getToken();
		if (tokenType != TOKENTYPE.IDENTIFIER) throw newSyntaxError("Identifier expected");
		graph[id$4] = token;
		getToken();
	} else parseNodeStatement(graph, id$4);
}
/**
* Parse a subgraph
*
* @param {object} graph    parent graph object
* @returns {object | null} subgraph
*/
function parseSubgraph(graph) {
	var subgraph = null;
	if (token === "subgraph") {
		subgraph = {};
		subgraph.type = "subgraph";
		getToken();
		if (tokenType === TOKENTYPE.IDENTIFIER) {
			subgraph.id = token;
			getToken();
		}
	}
	if (token === "{") {
		getToken();
		if (!subgraph) subgraph = {};
		subgraph.parent = graph;
		subgraph.node = graph.node;
		subgraph.edge = graph.edge;
		subgraph.graph = graph.graph;
		parseStatements(subgraph);
		if (token != "}") throw newSyntaxError("Angle bracket } expected");
		getToken();
		delete subgraph.node;
		delete subgraph.edge;
		delete subgraph.graph;
		delete subgraph.parent;
		if (!graph.subgraphs) graph.subgraphs = [];
		graph.subgraphs.push(subgraph);
	}
	return subgraph;
}
/**
* parse an attribute statement like "node [shape=circle fontSize=16]".
* Available keywords are 'node', 'edge', 'graph'.
* The previous list with default attributes will be replaced
*
* @param {object} graph
* @returns {string | null} keyword Returns the name of the parsed attribute
*                                  (node, edge, graph), or null if nothing
*                                  is parsed.
*/
function parseAttributeStatement(graph) {
	if (token === "node") {
		getToken();
		graph.node = parseAttributeList();
		return "node";
	} else if (token === "edge") {
		getToken();
		graph.edge = parseAttributeList();
		return "edge";
	} else if (token === "graph") {
		getToken();
		graph.graph = parseAttributeList();
		return "graph";
	}
	return null;
}
/**
* parse a node statement
*
* @param {object} graph
* @param {string | number} id
*/
function parseNodeStatement(graph, id$4) {
	var node$1 = { id: id$4 };
	var attr = parseAttributeList();
	if (attr) node$1.attr = attr;
	addNode(graph, node$1);
	parseEdge(graph, id$4);
}
/**
* Parse an edge or a series of edges
*
* @param {object} graph
* @param {string | number} from        Id of the from node
*/
function parseEdge(graph, from$9) {
	while (token === "->" || token === "--") {
		var to;
		var type = token;
		getToken();
		var subgraph = parseSubgraph(graph);
		if (subgraph) to = subgraph;
		else {
			if (tokenType != TOKENTYPE.IDENTIFIER) throw newSyntaxError("Identifier or subgraph expected");
			to = token;
			addNode(graph, { id: to });
			getToken();
		}
		var attr = parseAttributeList();
		var edge = createEdge(graph, from$9, to, type, attr);
		addEdge(graph, edge);
		from$9 = to;
	}
}
/**
* Parse a set with attributes,
* for example [label="1.000", shape=solid]
*
* @returns {object | null} attr
*/
function parseAttributeList() {
	var i$2;
	var attr = null;
	var edgeStyles = {
		dashed: true,
		solid: false,
		dotted: [1, 5]
	};
	/**
	* Define arrow types.
	* vis currently supports types defined in 'arrowTypes'.
	* Details of arrow shapes are described in
	* http://www.graphviz.org/content/arrow-shapes
	*/
	var arrowTypes = {
		dot: "circle",
		box: "box",
		crow: "crow",
		curve: "curve",
		icurve: "inv_curve",
		normal: "triangle",
		inv: "inv_triangle",
		diamond: "diamond",
		tee: "bar",
		vee: "vee"
	};
	/**
	* 'attr_list' contains attributes for checking if some of them are affected
	* later. For instance, both of 'arrowhead' and 'dir' (edge style defined
	* in DOT) make changes to 'arrows' attribute in vis.
	*/
	var attr_list = new Array();
	var attr_names = new Array();
	while (token === "[") {
		getToken();
		attr = {};
		while (token !== "" && token != "]") {
			if (tokenType != TOKENTYPE.IDENTIFIER) throw newSyntaxError("Attribute name expected");
			var name = token;
			getToken();
			if (token != "=") throw newSyntaxError("Equal sign = expected");
			getToken();
			if (tokenType != TOKENTYPE.IDENTIFIER) throw newSyntaxError("Attribute value expected");
			var value = token;
			if (name === "style") value = edgeStyles[value];
			var arrowType;
			if (name === "arrowhead") {
				arrowType = arrowTypes[value];
				name = "arrows";
				value = { to: {
					enabled: true,
					type: arrowType
				} };
			}
			if (name === "arrowtail") {
				arrowType = arrowTypes[value];
				name = "arrows";
				value = { from: {
					enabled: true,
					type: arrowType
				} };
			}
			attr_list.push({
				attr,
				name,
				value
			});
			attr_names.push(name);
			getToken();
			if (token == ",") getToken();
		}
		if (token != "]") throw newSyntaxError("Bracket ] expected");
		getToken();
	}
	/**
	* As explained in [1], graphviz has limitations for combination of
	* arrow[head|tail] and dir. If attribute list includes 'dir',
	* following cases just be supported.
	*   1. both or none + arrowhead, arrowtail
	*   2. forward + arrowhead (arrowtail is not affedted)
	*   3. back + arrowtail (arrowhead is not affected)
	* [1] https://www.graphviz.org/doc/info/attrs.html#h:undir_note
	*/
	if (_includesInstanceProperty(attr_names).call(attr_names, "dir")) {
		var idx = {};
		idx.arrows = {};
		for (i$2 = 0; i$2 < attr_list.length; i$2++) if (attr_list[i$2].name === "arrows") if (attr_list[i$2].value.to != null) idx.arrows.to = i$2;
		else if (attr_list[i$2].value.from != null) idx.arrows.from = i$2;
		else throw newSyntaxError("Invalid value of arrows");
		else if (attr_list[i$2].name === "dir") idx.dir = i$2;
		var dir_type = attr_list[idx.dir].value;
		if (!_includesInstanceProperty(attr_names).call(attr_names, "arrows")) if (dir_type === "both") {
			attr_list.push({
				attr: attr_list[idx.dir].attr,
				name: "arrows",
				value: { to: { enabled: true } }
			});
			idx.arrows.to = attr_list.length - 1;
			attr_list.push({
				attr: attr_list[idx.dir].attr,
				name: "arrows",
				value: { from: { enabled: true } }
			});
			idx.arrows.from = attr_list.length - 1;
		} else if (dir_type === "forward") {
			attr_list.push({
				attr: attr_list[idx.dir].attr,
				name: "arrows",
				value: { to: { enabled: true } }
			});
			idx.arrows.to = attr_list.length - 1;
		} else if (dir_type === "back") {
			attr_list.push({
				attr: attr_list[idx.dir].attr,
				name: "arrows",
				value: { from: { enabled: true } }
			});
			idx.arrows.from = attr_list.length - 1;
		} else if (dir_type === "none") {
			attr_list.push({
				attr: attr_list[idx.dir].attr,
				name: "arrows",
				value: ""
			});
			idx.arrows.to = attr_list.length - 1;
		} else throw newSyntaxError("Invalid dir type \"" + dir_type + "\"");
		var from_type;
		var to_type;
		if (dir_type === "both") {
			if (idx.arrows.to && idx.arrows.from) {
				to_type = attr_list[idx.arrows.to].value.to.type;
				from_type = attr_list[idx.arrows.from].value.from.type;
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.to].attr,
					name: attr_list[idx.arrows.to].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
				_spliceInstanceProperty(attr_list).call(attr_list, idx.arrows.from, 1);
			} else if (idx.arrows.to) {
				to_type = attr_list[idx.arrows.to].value.to.type;
				from_type = "arrow";
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.to].attr,
					name: attr_list[idx.arrows.to].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			} else if (idx.arrows.from) {
				to_type = "arrow";
				from_type = attr_list[idx.arrows.from].value.from.type;
				attr_list[idx.arrows.from] = {
					attr: attr_list[idx.arrows.from].attr,
					name: attr_list[idx.arrows.from].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			}
		} else if (dir_type === "back") {
			if (idx.arrows.to && idx.arrows.from) {
				to_type = "";
				from_type = attr_list[idx.arrows.from].value.from.type;
				attr_list[idx.arrows.from] = {
					attr: attr_list[idx.arrows.from].attr,
					name: attr_list[idx.arrows.from].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			} else if (idx.arrows.to) {
				to_type = "";
				from_type = "arrow";
				idx.arrows.from = idx.arrows.to;
				attr_list[idx.arrows.from] = {
					attr: attr_list[idx.arrows.from].attr,
					name: attr_list[idx.arrows.from].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			} else if (idx.arrows.from) {
				to_type = "";
				from_type = attr_list[idx.arrows.from].value.from.type;
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.from].attr,
					name: attr_list[idx.arrows.from].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			}
			attr_list[idx.arrows.from] = {
				attr: attr_list[idx.arrows.from].attr,
				name: attr_list[idx.arrows.from].name,
				value: { from: {
					enabled: true,
					type: attr_list[idx.arrows.from].value.from.type
				} }
			};
		} else if (dir_type === "none") {
			var idx_arrow;
			if (idx.arrows.to) idx_arrow = idx.arrows.to;
			else idx_arrow = idx.arrows.from;
			attr_list[idx_arrow] = {
				attr: attr_list[idx_arrow].attr,
				name: attr_list[idx_arrow].name,
				value: ""
			};
		} else if (dir_type === "forward") {
			if (idx.arrows.to && idx.arrows.from) {
				to_type = attr_list[idx.arrows.to].value.to.type;
				from_type = "";
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.to].attr,
					name: attr_list[idx.arrows.to].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			} else if (idx.arrows.to) {
				to_type = attr_list[idx.arrows.to].value.to.type;
				from_type = "";
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.to].attr,
					name: attr_list[idx.arrows.to].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			} else if (idx.arrows.from) {
				to_type = "arrow";
				from_type = "";
				idx.arrows.to = idx.arrows.from;
				attr_list[idx.arrows.to] = {
					attr: attr_list[idx.arrows.to].attr,
					name: attr_list[idx.arrows.to].name,
					value: {
						to: {
							enabled: true,
							type: to_type
						},
						from: {
							enabled: true,
							type: from_type
						}
					}
				};
			}
			attr_list[idx.arrows.to] = {
				attr: attr_list[idx.arrows.to].attr,
				name: attr_list[idx.arrows.to].name,
				value: { to: {
					enabled: true,
					type: attr_list[idx.arrows.to].value.to.type
				} }
			};
		} else throw newSyntaxError("Invalid dir type \"" + dir_type + "\"");
		_spliceInstanceProperty(attr_list).call(attr_list, idx.dir, 1);
	}
	var nof_attr_list;
	if (_includesInstanceProperty(attr_names).call(attr_names, "penwidth")) {
		var tmp_attr_list = [];
		nof_attr_list = attr_list.length;
		for (i$2 = 0; i$2 < nof_attr_list; i$2++) if (attr_list[i$2].name !== "width") {
			if (attr_list[i$2].name === "penwidth") attr_list[i$2].name = "width";
			tmp_attr_list.push(attr_list[i$2]);
		}
		attr_list = tmp_attr_list;
	}
	nof_attr_list = attr_list.length;
	for (i$2 = 0; i$2 < nof_attr_list; i$2++) setValue(attr_list[i$2].attr, attr_list[i$2].name, attr_list[i$2].value);
	return attr;
}
/**
* Create a syntax error with extra information on current token and index.
*
* @param {string} message
* @returns {SyntaxError} err
*/
function newSyntaxError(message) {
	return new SyntaxError(message + ", got \"" + chop(token, 30) + "\" (char " + index + ")");
}
/**
* Chop off text after a maximum length
*
* @param {string} text
* @param {number} maxLength
* @returns {string}
*/
function chop(text, maxLength) {
	return text.length <= maxLength ? text : text.substr(0, 27) + "...";
}
/**
* Execute a function fn for each pair of elements in two arrays
*
* @param {Array | *} array1
* @param {Array | *} array2
* @param {Function} fn
*/
function forEach2(array1, array2, fn) {
	if (_Array$isArray(array1)) _forEachInstanceProperty(array1).call(array1, function(elem1) {
		if (_Array$isArray(array2)) _forEachInstanceProperty(array2).call(array2, function(elem2) {
			fn(elem1, elem2);
		});
		else fn(elem1, array2);
	});
	else if (_Array$isArray(array2)) _forEachInstanceProperty(array2).call(array2, function(elem2) {
		fn(array1, elem2);
	});
	else fn(array1, array2);
}
/**
* Set a nested property on an object
* When nested objects are missing, they will be created.
* For example setProp({}, 'font.color', 'red') will return {font: {color: 'red'}}
*
* @param {object} object
* @param {string} path   A dot separated string like 'font.color'
* @param {*} value       Value for the property
* @returns {object} Returns the original object, allows for chaining.
*/
function setProp(object$1, path$11, value) {
	var names = path$11.split(".");
	var prop = names.pop();
	var obj = object$1;
	for (var i$2 = 0; i$2 < names.length; i$2++) {
		var name = names[i$2];
		if (!(name in obj)) obj[name] = {};
		obj = obj[name];
	}
	obj[prop] = value;
	return object$1;
}
/**
* Convert an object with DOT attributes to their vis.js equivalents.
*
* @param {object} attr     Object with DOT attributes
* @param {object} mapping
* @returns {object}         Returns an object with vis.js attributes
*/
function convertAttr(attr, mapping) {
	var converted = {};
	for (var prop in attr) if (attr.hasOwnProperty(prop)) {
		var visProp = mapping[prop];
		if (_Array$isArray(visProp)) _forEachInstanceProperty(visProp).call(visProp, function(visPropI) {
			setProp(converted, visPropI, attr[prop]);
		});
		else if (typeof visProp === "string") setProp(converted, visProp, attr[prop]);
		else setProp(converted, prop, attr[prop]);
	}
	return converted;
}
/**
* Convert a string containing a graph in DOT language into a map containing
* with nodes and edges in the format of graph.
*
* @param {string} data         Text containing a graph in DOT-notation
* @returns {object} graphData
*/
function DOTToGraph(data$2) {
	var dotData = parseDOT(data$2);
	var graphData = {
		nodes: [],
		edges: [],
		options: {}
	};
	if (dotData.nodes) {
		var _context2;
		_forEachInstanceProperty(_context2 = dotData.nodes).call(_context2, function(dotNode) {
			var graphNode = {
				id: dotNode.id,
				label: String(dotNode.label || dotNode.id)
			};
			merge$1(graphNode, convertAttr(dotNode.attr, NODE_ATTR_MAPPING));
			if (graphNode.image) graphNode.shape = "image";
			graphData.nodes.push(graphNode);
		});
	}
	if (dotData.edges) {
		var _context3;
		/**
		* Convert an edge in DOT format to an edge with VisGraph format
		*
		* @param {object} dotEdge
		* @returns {object} graphEdge
		*/
		var convertEdge = function convertEdge$1(dotEdge) {
			var graphEdge = {
				from: dotEdge.from,
				to: dotEdge.to
			};
			merge$1(graphEdge, convertAttr(dotEdge.attr, EDGE_ATTR_MAPPING));
			if (graphEdge.arrows == null && dotEdge.type === "->") graphEdge.arrows = "to";
			return graphEdge;
		};
		_forEachInstanceProperty(_context3 = dotData.edges).call(_context3, function(dotEdge) {
			var from$9, to;
			if (dotEdge.from instanceof Object) from$9 = dotEdge.from.nodes;
			else from$9 = { id: dotEdge.from };
			if (dotEdge.to instanceof Object) to = dotEdge.to.nodes;
			else to = { id: dotEdge.to };
			if (dotEdge.from instanceof Object && dotEdge.from.edges) {
				var _context4;
				_forEachInstanceProperty(_context4 = dotEdge.from.edges).call(_context4, function(subEdge) {
					var graphEdge = convertEdge(subEdge);
					graphData.edges.push(graphEdge);
				});
			}
			forEach2(from$9, to, function(from$10, to$1) {
				var subEdge = createEdge(graphData, from$10.id, to$1.id, dotEdge.type, dotEdge.attr);
				var graphEdge = convertEdge(subEdge);
				graphData.edges.push(graphEdge);
			});
			if (dotEdge.to instanceof Object && dotEdge.to.edges) {
				var _context5;
				_forEachInstanceProperty(_context5 = dotEdge.to.edges).call(_context5, function(subEdge) {
					var graphEdge = convertEdge(subEdge);
					graphData.edges.push(graphEdge);
				});
			}
		});
	}
	if (dotData.attr) graphData.options = dotData.attr;
	return graphData;
}
/**

* Convert Gephi to Vis.

*

* @param gephiJSON - The parsed JSON data in Gephi format.

* @param optionsObj - Additional options.

* @returns The converted data ready to be used in Vis.

*/
function parseGephi(gephiJSON, optionsObj) {
	var _context;
	var options = {
		edges: { inheritColor: false },
		nodes: {
			fixed: false,
			parseColor: false
		}
	};
	if (optionsObj != null) {
		if (optionsObj.fixed != null) options.nodes.fixed = optionsObj.fixed;
		if (optionsObj.parseColor != null) options.nodes.parseColor = optionsObj.parseColor;
		if (optionsObj.inheritColor != null) options.edges.inheritColor = optionsObj.inheritColor;
	}
	var gEdges = gephiJSON.edges;
	var vEdges = _mapInstanceProperty(gEdges).call(gEdges, function(gEdge) {
		var vEdge = {
			from: gEdge.source,
			id: gEdge.id,
			to: gEdge.target
		};
		if (gEdge.attributes != null) vEdge.attributes = gEdge.attributes;
		if (gEdge.label != null) vEdge.label = gEdge.label;
		if (gEdge.attributes != null && gEdge.attributes.title != null) vEdge.title = gEdge.attributes.title;
		if (gEdge.type === "Directed") vEdge.arrows = "to";
		if (gEdge.color && options.edges.inheritColor === false) vEdge.color = gEdge.color;
		return vEdge;
	});
	var vNodes = _mapInstanceProperty(_context = gephiJSON.nodes).call(_context, function(gNode) {
		var vNode = {
			id: gNode.id,
			fixed: options.nodes.fixed && gNode.x != null && gNode.y != null
		};
		if (gNode.attributes != null) vNode.attributes = gNode.attributes;
		if (gNode.label != null) vNode.label = gNode.label;
		if (gNode.size != null) vNode.size = gNode.size;
		if (gNode.attributes != null && gNode.attributes.title != null) vNode.title = gNode.attributes.title;
		if (gNode.title != null) vNode.title = gNode.title;
		if (gNode.x != null) vNode.x = gNode.x;
		if (gNode.y != null) vNode.y = gNode.y;
		if (gNode.color != null) if (options.nodes.parseColor === true) vNode.color = gNode.color;
		else vNode.color = {
			background: gNode.color,
			border: gNode.color,
			highlight: {
				background: gNode.color,
				border: gNode.color
			},
			hover: {
				background: gNode.color,
				border: gNode.color
			}
		};
		return vNode;
	});
	return {
		nodes: vNodes,
		edges: vEdges
	};
}
var en = {
	addDescription: "Click in an empty space to place a new node.",
	addEdge: "Add Edge",
	addNode: "Add Node",
	back: "Back",
	close: "Close",
	createEdgeError: "Cannot link edges to a cluster.",
	del: "Delete selected",
	deleteClusterError: "Clusters cannot be deleted.",
	edgeDescription: "Click on a node and drag the edge to another node to connect them.",
	edit: "Edit",
	editClusterError: "Clusters cannot be edited.",
	editEdge: "Edit Edge",
	editEdgeDescription: "Click on the control points and drag them to a node to connect to it.",
	editNode: "Edit Node"
};
var de = {
	addDescription: "Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.",
	addEdge: "Kante hinzufügen",
	addNode: "Knoten hinzufügen",
	back: "Zurück",
	close: "Schließen",
	createEdgeError: "Es ist nicht möglich, Kanten mit Clustern zu verbinden.",
	del: "Lösche Auswahl",
	deleteClusterError: "Cluster können nicht gelöscht werden.",
	edgeDescription: "Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.",
	edit: "Editieren",
	editClusterError: "Cluster können nicht editiert werden.",
	editEdge: "Kante editieren",
	editEdgeDescription: "Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.",
	editNode: "Knoten editieren"
};
var es = {
	addDescription: "Haga clic en un lugar vacío para colocar un nuevo nodo.",
	addEdge: "Añadir arista",
	addNode: "Añadir nodo",
	back: "Atrás",
	close: "Cerrar",
	createEdgeError: "No se puede conectar una arista a un grupo.",
	del: "Eliminar selección",
	deleteClusterError: "No es posible eliminar grupos.",
	edgeDescription: "Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.",
	edit: "Editar",
	editClusterError: "No es posible editar grupos.",
	editEdge: "Editar arista",
	editEdgeDescription: "Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.",
	editNode: "Editar nodo"
};
var it = {
	addDescription: "Clicca per aggiungere un nuovo nodo",
	addEdge: "Aggiungi un vertice",
	addNode: "Aggiungi un nodo",
	back: "Indietro",
	close: "Chiudere",
	createEdgeError: "Non si possono collegare vertici ad un cluster",
	del: "Cancella la selezione",
	deleteClusterError: "I cluster non possono essere cancellati",
	edgeDescription: "Clicca su un nodo e trascinalo ad un altro nodo per connetterli.",
	edit: "Modifica",
	editClusterError: "I clusters non possono essere modificati.",
	editEdge: "Modifica il vertice",
	editEdgeDescription: "Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.",
	editNode: "Modifica il nodo"
};
var nl = {
	addDescription: "Klik op een leeg gebied om een nieuwe node te maken.",
	addEdge: "Link toevoegen",
	addNode: "Node toevoegen",
	back: "Terug",
	close: "Sluiten",
	createEdgeError: "Kan geen link maken naar een cluster.",
	del: "Selectie verwijderen",
	deleteClusterError: "Clusters kunnen niet worden verwijderd.",
	edgeDescription: "Klik op een node en sleep de link naar een andere node om ze te verbinden.",
	edit: "Wijzigen",
	editClusterError: "Clusters kunnen niet worden aangepast.",
	editEdge: "Link wijzigen",
	editEdgeDescription: "Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.",
	editNode: "Node wijzigen"
};
var pt = {
	addDescription: "Clique em um espaço em branco para adicionar um novo nó",
	addEdge: "Adicionar aresta",
	addNode: "Adicionar nó",
	back: "Voltar",
	close: "Fechar",
	createEdgeError: "Não foi possível linkar arestas a um cluster.",
	del: "Remover selecionado",
	deleteClusterError: "Clusters não puderam ser removidos.",
	edgeDescription: "Clique em um nó e arraste a aresta até outro nó para conectá-los",
	edit: "Editar",
	editClusterError: "Clusters não puderam ser editados.",
	editEdge: "Editar aresta",
	editEdgeDescription: "Clique nos pontos de controle e os arraste para um nó para conectá-los",
	editNode: "Editar nó"
};
var ru = {
	addDescription: "Кликните в свободное место, чтобы добавить новый узел.",
	addEdge: "Добавить ребро",
	addNode: "Добавить узел",
	back: "Назад",
	close: "Закрывать",
	createEdgeError: "Невозможно соединить ребра в кластер.",
	del: "Удалить выбранное",
	deleteClusterError: "Кластеры не могут быть удалены",
	edgeDescription: "Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.",
	edit: "Редактировать",
	editClusterError: "Кластеры недоступны для редактирования.",
	editEdge: "Редактировать ребро",
	editEdgeDescription: "Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.",
	editNode: "Редактировать узел"
};
var cn = {
	addDescription: "单击空白处放置新节点。",
	addEdge: "添加连接线",
	addNode: "添加节点",
	back: "返回",
	close: "關閉",
	createEdgeError: "无法将连接线连接到群集。",
	del: "删除选定",
	deleteClusterError: "无法删除群集。",
	edgeDescription: "单击某个节点并将该连接线拖动到另一个节点以连接它们。",
	edit: "编辑",
	editClusterError: "无法编辑群集。",
	editEdge: "编辑连接线",
	editEdgeDescription: "单击控制节点并将它们拖到节点上连接。",
	editNode: "编辑节点"
};
var uk = {
	addDescription: "Kлікніть на вільне місце, щоб додати новий вузол.",
	addEdge: "Додати край",
	addNode: "Додати вузол",
	back: "Назад",
	close: "Закрити",
	createEdgeError: "Не можливо об'єднати краї в групу.",
	del: "Видалити обране",
	deleteClusterError: "Групи не можуть бути видалені.",
	edgeDescription: "Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.",
	edit: "Редагувати",
	editClusterError: "Групи недоступні для редагування.",
	editEdge: "Редагувати край",
	editEdgeDescription: "Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.",
	editNode: "Редагувати вузол"
};
var fr = {
	addDescription: "Cliquez dans un endroit vide pour placer un nœud.",
	addEdge: "Ajouter un lien",
	addNode: "Ajouter un nœud",
	back: "Retour",
	close: "Fermer",
	createEdgeError: "Impossible de créer un lien vers un cluster.",
	del: "Effacer la sélection",
	deleteClusterError: "Les clusters ne peuvent pas être effacés.",
	edgeDescription: "Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.",
	edit: "Éditer",
	editClusterError: "Les clusters ne peuvent pas être édités.",
	editEdge: "Éditer le lien",
	editEdgeDescription: "Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.",
	editNode: "Éditer le nœud"
};
var cs = {
	addDescription: "Kluknutím do prázdného prostoru můžete přidat nový vrchol.",
	addEdge: "Přidat hranu",
	addNode: "Přidat vrchol",
	back: "Zpět",
	close: "Zavřít",
	createEdgeError: "Nelze připojit hranu ke shluku.",
	del: "Smazat výběr",
	deleteClusterError: "Nelze mazat shluky.",
	edgeDescription: "Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.",
	edit: "Upravit",
	editClusterError: "Nelze upravovat shluky.",
	editEdge: "Upravit hranu",
	editEdgeDescription: "Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.",
	editNode: "Upravit vrchol"
};
var locales = /* @__PURE__ */ Object.freeze({
	__proto__: null,
	cn,
	cs,
	de,
	en,
	es,
	fr,
	it,
	nl,
	pt,
	ru,
	uk
});
/**

* Normalizes language code into the format used internally.

*

* @param locales - All the available locales.

* @param rawCode - The original code as supplied by the user.

* @returns Language code in the format language-COUNTRY or language, eventually

* fallbacks to en.

*/
function normalizeLanguageCode(locales$1, rawCode) {
	try {
		var _rawCode$split = rawCode.split(/[-_ /]/, 2), _rawCode$split2 = _slicedToArray(_rawCode$split, 2), rawLanguage = _rawCode$split2[0], rawCountry = _rawCode$split2[1];
		var language = rawLanguage != null ? rawLanguage.toLowerCase() : null;
		var country = rawCountry != null ? rawCountry.toUpperCase() : null;
		if (language && country) {
			var code = language + "-" + country;
			if (Object.prototype.hasOwnProperty.call(locales$1, code)) return code;
			else {
				var _context;
				console.warn(_concatInstanceProperty(_context = "Unknown variant ".concat(country, " of language ")).call(_context, language, "."));
			}
		}
		if (language) {
			var _code = language;
			if (Object.prototype.hasOwnProperty.call(locales$1, _code)) return _code;
			else console.warn("Unknown language ".concat(language));
		}
		console.warn("Unknown locale ".concat(rawCode, ", falling back to English."));
		return "en";
	} catch (error) {
		console.error(error);
		console.warn("Unexpected error while normalizing locale ".concat(rawCode, ", falling back to English."));
		return "en";
	}
}
/**
* Associates a canvas to a given image, containing a number of renderings
* of the image at various sizes.
*
* This technique is known as 'mipmapping'.
*
* NOTE: Images can also be of type 'data:svg+xml`. This code also works
*       for svg, but the mipmapping may not be necessary.
*
* @param {Image} image
*/
var CachedImage = /* @__PURE__ */ function() {
	/**
	* @ignore
	*/
	function CachedImage$1() {
		_classCallCheck(this, CachedImage$1);
		this.NUM_ITERATIONS = 4;
		this.image = new Image();
		this.canvas = document.createElement("canvas");
	}
	/**
	* Called when the image has been successfully loaded.
	*/
	_createClass(CachedImage$1, [
		{
			key: "init",
			value: function init() {
				if (this.initialized()) return;
				this.src = this.image.src;
				var w = this.image.width;
				var h = this.image.height;
				this.width = w;
				this.height = h;
				var h2 = Math.floor(h / 2);
				var h4 = Math.floor(h / 4);
				var h8 = Math.floor(h / 8);
				var h16 = Math.floor(h / 16);
				var w2 = Math.floor(w / 2);
				var w4 = Math.floor(w / 4);
				var w8 = Math.floor(w / 8);
				var w16 = Math.floor(w / 16);
				this.canvas.width = 3 * w4;
				this.canvas.height = h2;
				this.coordinates = [
					[
						0,
						0,
						w2,
						h2
					],
					[
						w2,
						0,
						w4,
						h4
					],
					[
						w2,
						h4,
						w8,
						h8
					],
					[
						5 * w8,
						h4,
						w16,
						h16
					]
				];
				this._fillMipMap();
			}
		},
		{
			key: "initialized",
			value: function initialized() {
				return this.coordinates !== void 0;
			}
		},
		{
			key: "_fillMipMap",
			value: function _fillMipMap() {
				var ctx = this.canvas.getContext("2d");
				var to = this.coordinates[0];
				ctx.drawImage(this.image, to[0], to[1], to[2], to[3]);
				for (var iterations = 1; iterations < this.NUM_ITERATIONS; iterations++) {
					var from$9 = this.coordinates[iterations - 1];
					var _to = this.coordinates[iterations];
					ctx.drawImage(this.canvas, from$9[0], from$9[1], from$9[2], from$9[3], _to[0], _to[1], _to[2], _to[3]);
				}
			}
		},
		{
			key: "drawImageAtPosition",
			value: function drawImageAtPosition(ctx, factor, left, top, width, height) {
				if (!this.initialized()) return;
				if (factor > 2) {
					factor *= .5;
					var iterations = 0;
					while (factor > 2 && iterations < this.NUM_ITERATIONS) {
						factor *= .5;
						iterations += 1;
					}
					if (iterations >= this.NUM_ITERATIONS) iterations = this.NUM_ITERATIONS - 1;
					var from$9 = this.coordinates[iterations];
					ctx.drawImage(this.canvas, from$9[0], from$9[1], from$9[2], from$9[3], left, top, width, height);
				} else ctx.drawImage(this.image, left, top, width, height);
			}
		}
	]);
	return CachedImage$1;
}();
/**
* This callback is a callback that accepts an Image.
*
* @callback ImageCallback
* @param {Image} image
*/
/**
* This class loads images and keeps them stored.
*
* @param {ImageCallback} callback
*/
var Images = /* @__PURE__ */ function() {
	/**
	* @param {ImageCallback} callback
	*/
	function Images$1(callback) {
		_classCallCheck(this, Images$1);
		this.images = {};
		this.imageBroken = {};
		this.callback = callback;
	}
	/**
	* @param {string} url                      The original Url that failed to load, if the broken image is successfully loaded it will be added to the cache using this Url as the key so that subsequent requests for this Url will return the broken image
	* @param {string} brokenUrl                Url the broken image to try and load
	* @param {Image} imageToLoadBrokenUrlOn   The image object
	*/
	_createClass(Images$1, [
		{
			key: "_tryloadBrokenUrl",
			value: function _tryloadBrokenUrl(url, brokenUrl, imageToLoadBrokenUrlOn) {
				if (url === void 0 || imageToLoadBrokenUrlOn === void 0) return;
				if (brokenUrl === void 0) {
					console.warn("No broken url image defined");
					return;
				}
				imageToLoadBrokenUrlOn.image.onerror = function() {
					console.error("Could not load brokenImage:", brokenUrl);
				};
				imageToLoadBrokenUrlOn.image.src = brokenUrl;
			}
		},
		{
			key: "_redrawWithImage",
			value: function _redrawWithImage(imageToRedrawWith) {
				if (this.callback) this.callback(imageToRedrawWith);
			}
		},
		{
			key: "load",
			value: function load(url, brokenUrl) {
				var _this = this;
				var cachedImage = this.images[url];
				if (cachedImage) return cachedImage;
				var img = new CachedImage();
				this.images[url] = img;
				img.image.onload = function() {
					_this._fixImageCoordinates(img.image);
					img.init();
					_this._redrawWithImage(img);
				};
				img.image.onerror = function() {
					console.error("Could not load image:", url);
					_this._tryloadBrokenUrl(url, brokenUrl, img);
				};
				img.image.src = url;
				return img;
			}
		},
		{
			key: "_fixImageCoordinates",
			value: function _fixImageCoordinates(imageToCache) {
				if (imageToCache.width === 0) {
					document.body.appendChild(imageToCache);
					imageToCache.width = imageToCache.offsetWidth;
					imageToCache.height = imageToCache.offsetHeight;
					document.body.removeChild(imageToCache);
				}
			}
		}
	]);
	return Images$1;
}();
var mapExports = {};
var map$2 = {
	get exports() {
		return mapExports;
	},
	set exports(v) {
		mapExports = v;
	}
};
var internalMetadataExports = {};
var internalMetadata = {
	get exports() {
		return internalMetadataExports;
	},
	set exports(v) {
		internalMetadataExports = v;
	}
};
var fails$8 = fails$w;
var arrayBufferNonExtensible = fails$8(function() {
	if (typeof ArrayBuffer == "function") {
		var buffer = new ArrayBuffer(8);
		if (Object.isExtensible(buffer)) Object.defineProperty(buffer, "a", { value: 8 });
	}
});
var fails$7 = fails$w;
var isObject$6 = isObject$j;
var classof$2 = classofRaw$2;
var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible;
var $isExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES$1 = fails$7(function() {
	$isExtensible(1);
});
var objectIsExtensible = FAILS_ON_PRIMITIVES$1 || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible$3(it$1) {
	if (!isObject$6(it$1)) return false;
	if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$2(it$1) == "ArrayBuffer") return false;
	return $isExtensible ? $isExtensible(it$1) : true;
} : $isExtensible;
var fails$6 = fails$w;
var freezing = !fails$6(function() {
	return Object.isExtensible(Object.preventExtensions({}));
});
var $$d = _export;
var uncurryThis$4 = functionUncurryThis;
var hiddenKeys = hiddenKeys$6;
var isObject$5 = isObject$j;
var hasOwn$3 = hasOwnProperty_1;
var defineProperty$1 = objectDefineProperty.f;
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
var isExtensible$1 = objectIsExtensible;
var uid = uid$4;
var FREEZING$1 = freezing;
var REQUIRED = false;
var METADATA = uid("meta");
var id$1 = 0;
var setMetadata = function(it$1) {
	defineProperty$1(it$1, METADATA, { value: {
		objectID: "O" + id$1++,
		weakData: {}
	} });
};
var fastKey$1 = function(it$1, create$11) {
	if (!isObject$5(it$1)) return typeof it$1 == "symbol" ? it$1 : (typeof it$1 == "string" ? "S" : "P") + it$1;
	if (!hasOwn$3(it$1, METADATA)) {
		if (!isExtensible$1(it$1)) return "F";
		if (!create$11) return "E";
		setMetadata(it$1);
	}
	return it$1[METADATA].objectID;
};
var getWeakData$1 = function(it$1, create$11) {
	if (!hasOwn$3(it$1, METADATA)) {
		if (!isExtensible$1(it$1)) return true;
		if (!create$11) return false;
		setMetadata(it$1);
	}
	return it$1[METADATA].weakData;
};
var onFreeze = function(it$1) {
	if (FREEZING$1 && REQUIRED && isExtensible$1(it$1) && !hasOwn$3(it$1, METADATA)) setMetadata(it$1);
	return it$1;
};
var enable = function() {
	meta.enable = function() {};
	REQUIRED = true;
	var getOwnPropertyNames$6 = getOwnPropertyNamesModule.f;
	var splice$6 = uncurryThis$4([].splice);
	var test$4 = {};
	test$4[METADATA] = 1;
	if (getOwnPropertyNames$6(test$4).length) {
		getOwnPropertyNamesModule.f = function(it$1) {
			var result = getOwnPropertyNames$6(it$1);
			for (var i$2 = 0, length$1 = result.length; i$2 < length$1; i$2++) if (result[i$2] === METADATA) {
				splice$6(result, i$2, 1);
				break;
			}
			return result;
		};
		$$d({
			target: "Object",
			stat: true,
			forced: true
		}, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f });
	}
};
var meta = internalMetadata.exports = {
	enable,
	fastKey: fastKey$1,
	getWeakData: getWeakData$1,
	onFreeze
};
hiddenKeys[METADATA] = true;
var bind$6 = functionBindContext;
var call$1 = functionCall;
var anObject$3 = anObject$d;
var tryToString$1 = tryToString$6;
var isArrayIteratorMethod = isArrayIteratorMethod$2;
var lengthOfArrayLike$2 = lengthOfArrayLike$b;
var isPrototypeOf$6 = objectIsPrototypeOf;
var getIterator = getIterator$2;
var getIteratorMethod = getIteratorMethod$9;
var iteratorClose = iteratorClose$2;
var $TypeError$3 = TypeError;
var Result = function(stopped, result) {
	this.stopped = stopped;
	this.result = result;
};
var ResultPrototype = Result.prototype;
var iterate$3 = function(iterable, unboundFunction, options) {
	var that = options && options.that;
	var AS_ENTRIES = !!(options && options.AS_ENTRIES);
	var IS_RECORD = !!(options && options.IS_RECORD);
	var IS_ITERATOR = !!(options && options.IS_ITERATOR);
	var INTERRUPTED = !!(options && options.INTERRUPTED);
	var fn = bind$6(unboundFunction, that);
	var iterator$8, iterFn, index$1, length$1, result, next$1, step;
	var stop = function(condition) {
		if (iterator$8) iteratorClose(iterator$8, "normal", condition);
		return new Result(true, condition);
	};
	var callFn = function(value) {
		if (AS_ENTRIES) {
			anObject$3(value);
			return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
		}
		return INTERRUPTED ? fn(value, stop) : fn(value);
	};
	if (IS_RECORD) iterator$8 = iterable.iterator;
	else if (IS_ITERATOR) iterator$8 = iterable;
	else {
		iterFn = getIteratorMethod(iterable);
		if (!iterFn) throw $TypeError$3(tryToString$1(iterable) + " is not iterable");
		if (isArrayIteratorMethod(iterFn)) {
			for (index$1 = 0, length$1 = lengthOfArrayLike$2(iterable); length$1 > index$1; index$1++) {
				result = callFn(iterable[index$1]);
				if (result && isPrototypeOf$6(ResultPrototype, result)) return result;
			}
			return new Result(false);
		}
		iterator$8 = getIterator(iterable, iterFn);
	}
	next$1 = IS_RECORD ? iterable.next : iterator$8.next;
	while (!(step = call$1(next$1, iterator$8)).done) {
		try {
			result = callFn(step.value);
		} catch (error) {
			iteratorClose(iterator$8, "throw", error);
		}
		if (typeof result == "object" && result && isPrototypeOf$6(ResultPrototype, result)) return result;
	}
	return new Result(false);
};
var isPrototypeOf$5 = objectIsPrototypeOf;
var $TypeError$2 = TypeError;
var anInstance$3 = function(it$1, Prototype) {
	if (isPrototypeOf$5(Prototype, it$1)) return it$1;
	throw $TypeError$2("Incorrect invocation");
};
var $$c = _export;
var global$4 = global$l;
var InternalMetadataModule$1 = internalMetadataExports;
var fails$5 = fails$w;
var createNonEnumerableProperty = createNonEnumerableProperty$6;
var iterate$2 = iterate$3;
var anInstance$2 = anInstance$3;
var isCallable = isCallable$i;
var isObject$4 = isObject$j;
var setToStringTag = setToStringTag$6;
var defineProperty = objectDefineProperty.f;
var forEach = arrayIteration.forEach;
var DESCRIPTORS$2 = descriptors;
var InternalStateModule$2 = internalState;
var setInternalState$2 = InternalStateModule$2.set;
var internalStateGetterFor$2 = InternalStateModule$2.getterFor;
var collection$3 = function(CONSTRUCTOR_NAME, wrapper$1, common) {
	var IS_MAP = CONSTRUCTOR_NAME.indexOf("Map") !== -1;
	var IS_WEAK = CONSTRUCTOR_NAME.indexOf("Weak") !== -1;
	var ADDER = IS_MAP ? "set" : "add";
	var NativeConstructor = global$4[CONSTRUCTOR_NAME];
	var NativePrototype = NativeConstructor && NativeConstructor.prototype;
	var exported = {};
	var Constructor;
	if (!DESCRIPTORS$2 || !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$5(function() {
		new NativeConstructor().entries().next();
	}))) {
		Constructor = common.getConstructor(wrapper$1, CONSTRUCTOR_NAME, IS_MAP, ADDER);
		InternalMetadataModule$1.enable();
	} else {
		Constructor = wrapper$1(function(target, iterable) {
			setInternalState$2(anInstance$2(target, Prototype), {
				type: CONSTRUCTOR_NAME,
				collection: new NativeConstructor()
			});
			if (iterable != void 0) iterate$2(iterable, target[ADDER], {
				that: target,
				AS_ENTRIES: IS_MAP
			});
		});
		var Prototype = Constructor.prototype;
		var getInternalState$4 = internalStateGetterFor$2(CONSTRUCTOR_NAME);
		forEach([
			"add",
			"clear",
			"delete",
			"forEach",
			"get",
			"has",
			"set",
			"keys",
			"values",
			"entries"
		], function(KEY) {
			var IS_ADDER = KEY == "add" || KEY == "set";
			if (KEY in NativePrototype && !(IS_WEAK && KEY == "clear")) createNonEnumerableProperty(Prototype, KEY, function(a, b) {
				var collection$5 = getInternalState$4(this).collection;
				if (!IS_ADDER && IS_WEAK && !isObject$4(a)) return KEY == "get" ? void 0 : false;
				var result = collection$5[KEY](a === 0 ? 0 : a, b);
				return IS_ADDER ? this : result;
			});
		});
		IS_WEAK || defineProperty(Prototype, "size", {
			configurable: true,
			get: function() {
				return getInternalState$4(this).collection.size;
			}
		});
	}
	setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
	exported[CONSTRUCTOR_NAME] = Constructor;
	$$c({
		global: true,
		forced: true
	}, exported);
	if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
	return Constructor;
};
var defineBuiltIn = defineBuiltIn$5;
var defineBuiltIns$3 = function(target, src, options) {
	for (var key in src) if (options && options.unsafe && target[key]) target[key] = src[key];
	else defineBuiltIn(target, key, src[key], options);
	return target;
};
var getBuiltIn$1 = getBuiltIn$c;
var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
var wellKnownSymbol = wellKnownSymbol$l;
var DESCRIPTORS$1 = descriptors;
var SPECIES = wellKnownSymbol("species");
var setSpecies$1 = function(CONSTRUCTOR_NAME) {
	var Constructor = getBuiltIn$1(CONSTRUCTOR_NAME);
	if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES]) defineBuiltInAccessor$1(Constructor, SPECIES, {
		configurable: true,
		get: function() {
			return this;
		}
	});
};
var create$5 = objectCreate;
var defineBuiltInAccessor = defineBuiltInAccessor$3;
var defineBuiltIns$2 = defineBuiltIns$3;
var bind$5 = functionBindContext;
var anInstance$1 = anInstance$3;
var isNullOrUndefined$1 = isNullOrUndefined$5;
var iterate$1 = iterate$3;
var defineIterator = iteratorDefine;
var createIterResultObject = createIterResultObject$3;
var setSpecies = setSpecies$1;
var DESCRIPTORS = descriptors;
var fastKey = internalMetadataExports.fastKey;
var InternalStateModule$1 = internalState;
var setInternalState$1 = InternalStateModule$1.set;
var internalStateGetterFor$1 = InternalStateModule$1.getterFor;
var collectionStrong$2 = {
	getConstructor: function(wrapper$1, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
		var Constructor = wrapper$1(function(that, iterable) {
			anInstance$1(that, Prototype);
			setInternalState$1(that, {
				type: CONSTRUCTOR_NAME,
				index: create$5(null),
				first: void 0,
				last: void 0,
				size: 0
			});
			if (!DESCRIPTORS) that.size = 0;
			if (!isNullOrUndefined$1(iterable)) iterate$1(iterable, that[ADDER], {
				that,
				AS_ENTRIES: IS_MAP
			});
		});
		var Prototype = Constructor.prototype;
		var getInternalState$4 = internalStateGetterFor$1(CONSTRUCTOR_NAME);
		var define = function(that, key, value) {
			var state = getInternalState$4(that);
			var entry = getEntry(that, key);
			var previous, index$1;
			if (entry) entry.value = value;
			else {
				state.last = entry = {
					index: index$1 = fastKey(key, true),
					key,
					value,
					previous: previous = state.last,
					next: void 0,
					removed: false
				};
				if (!state.first) state.first = entry;
				if (previous) previous.next = entry;
				if (DESCRIPTORS) state.size++;
				else that.size++;
				if (index$1 !== "F") state.index[index$1] = entry;
			}
			return that;
		};
		var getEntry = function(that, key) {
			var state = getInternalState$4(that);
			var index$1 = fastKey(key);
			var entry;
			if (index$1 !== "F") return state.index[index$1];
			for (entry = state.first; entry; entry = entry.next) if (entry.key == key) return entry;
		};
		defineBuiltIns$2(Prototype, {
			clear: function clear$1() {
				var that = this;
				var state = getInternalState$4(that);
				var data$2 = state.index;
				var entry = state.first;
				while (entry) {
					entry.removed = true;
					if (entry.previous) entry.previous = entry.previous.next = void 0;
					delete data$2[entry.index];
					entry = entry.next;
				}
				state.first = state.last = void 0;
				if (DESCRIPTORS) state.size = 0;
				else that.size = 0;
			},
			"delete": function(key) {
				var that = this;
				var state = getInternalState$4(that);
				var entry = getEntry(that, key);
				if (entry) {
					var next$1 = entry.next;
					var prev = entry.previous;
					delete state.index[entry.index];
					entry.removed = true;
					if (prev) prev.next = next$1;
					if (next$1) next$1.previous = prev;
					if (state.first == entry) state.first = next$1;
					if (state.last == entry) state.last = prev;
					if (DESCRIPTORS) state.size--;
					else that.size--;
				}
				return !!entry;
			},
			forEach: function forEach$11(callbackfn) {
				var state = getInternalState$4(this);
				var boundFunction = bind$5(callbackfn, arguments.length > 1 ? arguments[1] : void 0);
				var entry;
				while (entry = entry ? entry.next : state.first) {
					boundFunction(entry.value, entry.key, this);
					while (entry && entry.removed) entry = entry.previous;
				}
			},
			has: function has$2(key) {
				return !!getEntry(this, key);
			}
		});
		defineBuiltIns$2(Prototype, IS_MAP ? {
			get: function get$9(key) {
				var entry = getEntry(this, key);
				return entry && entry.value;
			},
			set: function set$6(key, value) {
				return define(this, key === 0 ? 0 : key, value);
			}
		} : { add: function add(value) {
			return define(this, value = value === 0 ? 0 : value, value);
		} });
		if (DESCRIPTORS) defineBuiltInAccessor(Prototype, "size", {
			configurable: true,
			get: function() {
				return getInternalState$4(this).size;
			}
		});
		return Constructor;
	},
	setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) {
		var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator";
		var getInternalCollectionState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
		var getInternalIteratorState = internalStateGetterFor$1(ITERATOR_NAME);
		defineIterator(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) {
			setInternalState$1(this, {
				type: ITERATOR_NAME,
				target: iterated,
				state: getInternalCollectionState(iterated),
				kind,
				last: void 0
			});
		}, function() {
			var state = getInternalIteratorState(this);
			var kind = state.kind;
			var entry = state.last;
			while (entry && entry.removed) entry = entry.previous;
			if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
				state.target = void 0;
				return createIterResultObject(void 0, true);
			}
			if (kind == "keys") return createIterResultObject(entry.key, false);
			if (kind == "values") return createIterResultObject(entry.value, false);
			return createIterResultObject([entry.key, entry.value], false);
		}, IS_MAP ? "entries" : "values", !IS_MAP, true);
		setSpecies(CONSTRUCTOR_NAME);
	}
};
var collection$2 = collection$3;
var collectionStrong$1 = collectionStrong$2;
collection$2("Map", function(init) {
	return function Map() {
		return init(this, arguments.length ? arguments[0] : void 0);
	};
}, collectionStrong$1);
var path$b = path$y;
var map$1 = path$b.Map;
var parent$r = map$1;
var map = parent$r;
(function(module) {
	module.exports = map;
})(map$2);
var _Map = /* @__PURE__ */ getDefaultExportFromCjs(mapExports);
/**
* This class can store groups and options specific for groups.
*/
var Groups = /* @__PURE__ */ function() {
	/**
	* @ignore
	*/
	function Groups$1() {
		_classCallCheck(this, Groups$1);
		this.clear();
		this._defaultIndex = 0;
		this._groupIndex = 0;
		this._defaultGroups = [
			{
				border: "#2B7CE9",
				background: "#97C2FC",
				highlight: {
					border: "#2B7CE9",
					background: "#D2E5FF"
				},
				hover: {
					border: "#2B7CE9",
					background: "#D2E5FF"
				}
			},
			{
				border: "#FFA500",
				background: "#FFFF00",
				highlight: {
					border: "#FFA500",
					background: "#FFFFA3"
				},
				hover: {
					border: "#FFA500",
					background: "#FFFFA3"
				}
			},
			{
				border: "#FA0A10",
				background: "#FB7E81",
				highlight: {
					border: "#FA0A10",
					background: "#FFAFB1"
				},
				hover: {
					border: "#FA0A10",
					background: "#FFAFB1"
				}
			},
			{
				border: "#41A906",
				background: "#7BE141",
				highlight: {
					border: "#41A906",
					background: "#A1EC76"
				},
				hover: {
					border: "#41A906",
					background: "#A1EC76"
				}
			},
			{
				border: "#E129F0",
				background: "#EB7DF4",
				highlight: {
					border: "#E129F0",
					background: "#F0B3F5"
				},
				hover: {
					border: "#E129F0",
					background: "#F0B3F5"
				}
			},
			{
				border: "#7C29F0",
				background: "#AD85E4",
				highlight: {
					border: "#7C29F0",
					background: "#D3BDF0"
				},
				hover: {
					border: "#7C29F0",
					background: "#D3BDF0"
				}
			},
			{
				border: "#C37F00",
				background: "#FFA807",
				highlight: {
					border: "#C37F00",
					background: "#FFCA66"
				},
				hover: {
					border: "#C37F00",
					background: "#FFCA66"
				}
			},
			{
				border: "#4220FB",
				background: "#6E6EFD",
				highlight: {
					border: "#4220FB",
					background: "#9B9BFD"
				},
				hover: {
					border: "#4220FB",
					background: "#9B9BFD"
				}
			},
			{
				border: "#FD5A77",
				background: "#FFC0CB",
				highlight: {
					border: "#FD5A77",
					background: "#FFD1D9"
				},
				hover: {
					border: "#FD5A77",
					background: "#FFD1D9"
				}
			},
			{
				border: "#4AD63A",
				background: "#C2FABC",
				highlight: {
					border: "#4AD63A",
					background: "#E6FFE3"
				},
				hover: {
					border: "#4AD63A",
					background: "#E6FFE3"
				}
			},
			{
				border: "#990000",
				background: "#EE0000",
				highlight: {
					border: "#BB0000",
					background: "#FF3333"
				},
				hover: {
					border: "#BB0000",
					background: "#FF3333"
				}
			},
			{
				border: "#FF6000",
				background: "#FF6000",
				highlight: {
					border: "#FF6000",
					background: "#FF6000"
				},
				hover: {
					border: "#FF6000",
					background: "#FF6000"
				}
			},
			{
				border: "#97C2FC",
				background: "#2B7CE9",
				highlight: {
					border: "#D2E5FF",
					background: "#2B7CE9"
				},
				hover: {
					border: "#D2E5FF",
					background: "#2B7CE9"
				}
			},
			{
				border: "#399605",
				background: "#255C03",
				highlight: {
					border: "#399605",
					background: "#255C03"
				},
				hover: {
					border: "#399605",
					background: "#255C03"
				}
			},
			{
				border: "#B70054",
				background: "#FF007E",
				highlight: {
					border: "#B70054",
					background: "#FF007E"
				},
				hover: {
					border: "#B70054",
					background: "#FF007E"
				}
			},
			{
				border: "#AD85E4",
				background: "#7C29F0",
				highlight: {
					border: "#D3BDF0",
					background: "#7C29F0"
				},
				hover: {
					border: "#D3BDF0",
					background: "#7C29F0"
				}
			},
			{
				border: "#4557FA",
				background: "#000EA1",
				highlight: {
					border: "#6E6EFD",
					background: "#000EA1"
				},
				hover: {
					border: "#6E6EFD",
					background: "#000EA1"
				}
			},
			{
				border: "#FFC0CB",
				background: "#FD5A77",
				highlight: {
					border: "#FFD1D9",
					background: "#FD5A77"
				},
				hover: {
					border: "#FFD1D9",
					background: "#FD5A77"
				}
			},
			{
				border: "#C2FABC",
				background: "#74D66A",
				highlight: {
					border: "#E6FFE3",
					background: "#74D66A"
				},
				hover: {
					border: "#E6FFE3",
					background: "#74D66A"
				}
			},
			{
				border: "#EE0000",
				background: "#990000",
				highlight: {
					border: "#FF3333",
					background: "#BB0000"
				},
				hover: {
					border: "#FF3333",
					background: "#BB0000"
				}
			}
		];
		this.options = {};
		this.defaultOptions = { useDefaultGroups: true };
		_Object$assign(this.options, this.defaultOptions);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(Groups$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				var optionFields = ["useDefaultGroups"];
				if (options !== void 0) {
					for (var groupName in options) if (Object.prototype.hasOwnProperty.call(options, groupName)) {
						if (_indexOfInstanceProperty(optionFields).call(optionFields, groupName) === -1) {
							var group = options[groupName];
							this.add(groupName, group);
						}
					}
				}
			}
		},
		{
			key: "clear",
			value: function clear$1() {
				this._groups = new _Map();
				this._groupNames = [];
			}
		},
		{
			key: "get",
			value: function get$9(groupname) {
				var shouldCreate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				var group = this._groups.get(groupname);
				if (group === void 0 && shouldCreate) if (this.options.useDefaultGroups === false && this._groupNames.length > 0) {
					var index$1 = this._groupIndex % this._groupNames.length;
					++this._groupIndex;
					group = {};
					group.color = this._groups.get(this._groupNames[index$1]);
					this._groups.set(groupname, group);
				} else {
					var _index = this._defaultIndex % this._defaultGroups.length;
					this._defaultIndex++;
					group = {};
					group.color = this._defaultGroups[_index];
					this._groups.set(groupname, group);
				}
				return group;
			}
		},
		{
			key: "add",
			value: function add(groupName, style) {
				if (!this._groups.has(groupName)) this._groupNames.push(groupName);
				this._groups.set(groupName, style);
				return style;
			}
		}
	]);
	return Groups$1;
}();
var isNanExports = {};
var isNan$2 = {
	get exports() {
		return isNanExports;
	},
	set exports(v) {
		isNanExports = v;
	}
};
var $$b = _export;
$$b({
	target: "Number",
	stat: true
}, { isNaN: function isNaN$1(number$1) {
	return number$1 != number$1;
} });
var path$a = path$y;
var isNan$1 = path$a.Number.isNaN;
var parent$q = isNan$1;
var isNan = parent$q;
(function(module) {
	module.exports = isNan;
})(isNan$2);
var _Number$isNaN = /* @__PURE__ */ getDefaultExportFromCjs(isNanExports);
var _isFiniteExports = {};
var _isFinite$2 = {
	get exports() {
		return _isFiniteExports;
	},
	set exports(v) {
		_isFiniteExports = v;
	}
};
var global$3 = global$l;
var globalIsFinite = global$3.isFinite;
var numberIsFinite$1 = Number.isFinite || function isFinite(it$1) {
	return typeof it$1 == "number" && globalIsFinite(it$1);
};
var $$a = _export;
var numberIsFinite = numberIsFinite$1;
$$a({
	target: "Number",
	stat: true
}, { isFinite: numberIsFinite });
var path$9 = path$y;
var _isFinite$1 = path$9.Number.isFinite;
var parent$p = _isFinite$1;
var _isFinite = parent$p;
(function(module) {
	module.exports = _isFinite;
})(_isFinite$2);
var _Number$isFinite = /* @__PURE__ */ getDefaultExportFromCjs(_isFiniteExports);
var someExports = {};
var some$3 = {
	get exports() {
		return someExports;
	},
	set exports(v) {
		someExports = v;
	}
};
var $$9 = _export;
var $some = arrayIteration.some;
var arrayMethodIsStrict$3 = arrayMethodIsStrict$6;
var STRICT_METHOD$2 = arrayMethodIsStrict$3("some");
$$9({
	target: "Array",
	proto: true,
	forced: !STRICT_METHOD$2
}, { some: function some$5(callbackfn) {
	return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual$4 = entryVirtual$i;
var some$2 = entryVirtual$4("Array").some;
var isPrototypeOf$4 = objectIsPrototypeOf;
var method$4 = some$2;
var ArrayPrototype$4 = Array.prototype;
var some$1 = function(it$1) {
	var own = it$1.some;
	return it$1 === ArrayPrototype$4 || isPrototypeOf$4(ArrayPrototype$4, it$1) && own === ArrayPrototype$4.some ? method$4 : own;
};
var parent$o = some$1;
var some = parent$o;
(function(module) {
	module.exports = some;
})(some$3);
var _someInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(someExports);
var _parseFloatExports = {};
var _parseFloat$3 = {
	get exports() {
		return _parseFloatExports;
	},
	set exports(v) {
		_parseFloatExports = v;
	}
};
var global$2 = global$l;
var fails$4 = fails$w;
var uncurryThis$3 = functionUncurryThis;
var toString$1 = toString$a;
var trim = stringTrim.trim;
var whitespaces = whitespaces$4;
var charAt = uncurryThis$3("".charAt);
var $parseFloat$1 = global$2.parseFloat;
var Symbol$1 = global$2.Symbol;
var ITERATOR = Symbol$1 && Symbol$1.iterator;
var FORCED$4 = 1 / $parseFloat$1(whitespaces + "-0") !== -Infinity || ITERATOR && !fails$4(function() {
	$parseFloat$1(Object(ITERATOR));
});
var numberParseFloat = FORCED$4 ? function parseFloat$1(string$1) {
	var trimmedString = trim(toString$1(string$1));
	var result = $parseFloat$1(trimmedString);
	return result === 0 && charAt(trimmedString, 0) == "-" ? -0 : result;
} : $parseFloat$1;
var $$8 = _export;
var $parseFloat = numberParseFloat;
$$8({
	global: true,
	forced: parseFloat != $parseFloat
}, { parseFloat: $parseFloat });
var path$8 = path$y;
var _parseFloat$2 = path$8.parseFloat;
var parent$n = _parseFloat$2;
var _parseFloat$1 = parent$n;
(function(module) {
	module.exports = _parseFloat$1;
})(_parseFloat$3);
var _parseFloat = /* @__PURE__ */ getDefaultExportFromCjs(_parseFloatExports);
var getOwnPropertyNamesExports = {};
var getOwnPropertyNames$3 = {
	get exports() {
		return getOwnPropertyNamesExports;
	},
	set exports(v) {
		getOwnPropertyNamesExports = v;
	}
};
var $$7 = _export;
var fails$3 = fails$w;
var getOwnPropertyNames$2 = objectGetOwnPropertyNamesExternal.f;
var FAILS_ON_PRIMITIVES = fails$3(function() {
	return !Object.getOwnPropertyNames(1);
});
$$7({
	target: "Object",
	stat: true,
	forced: FAILS_ON_PRIMITIVES
}, { getOwnPropertyNames: getOwnPropertyNames$2 });
var path$7 = path$y;
var Object$1 = path$7.Object;
var getOwnPropertyNames$1 = function getOwnPropertyNames$6(it$1) {
	return Object$1.getOwnPropertyNames(it$1);
};
var parent$m = getOwnPropertyNames$1;
var getOwnPropertyNames = parent$m;
(function(module) {
	module.exports = getOwnPropertyNames;
})(getOwnPropertyNames$3);
var _Object$getOwnPropertyNames = /* @__PURE__ */ getDefaultExportFromCjs(getOwnPropertyNamesExports);
/**
* Helper functions for components
*/
/**
* Determine values to use for (sub)options of 'chosen'.
*
* This option is either a boolean or an object whose values should be examined further.
* The relevant structures are:
*
* - chosen: <boolean value>
* - chosen: { subOption: <boolean or function> }
*
* Where subOption is 'node', 'edge' or 'label'.
*
* The intention of this method appears to be to set a specific priority to the options;
* Since most properties are either bridged or merged into the local options objects, there
* is not much point in handling them separately.
* TODO: examine if 'most' in previous sentence can be replaced with 'all'. In that case, we
*       should be able to get rid of this method.
*
* @param {string}  subOption  option within object 'chosen' to consider; either 'node', 'edge' or 'label'
* @param {object}  pile       array of options objects to consider
* @returns {boolean | Function}  value for passed subOption of 'chosen' to use
*/
function choosify(subOption, pile) {
	var allowed = [
		"node",
		"edge",
		"label"
	];
	var value = true;
	var chosen = topMost(pile, "chosen");
	if (typeof chosen === "boolean") value = chosen;
	else if (_typeof(chosen) === "object") {
		if (_indexOfInstanceProperty(allowed).call(allowed, subOption) === -1) throw new Error("choosify: subOption '" + subOption + "' should be one of '" + allowed.join("', '") + "'");
		var chosenEdge = topMost(pile, ["chosen", subOption]);
		if (typeof chosenEdge === "boolean" || typeof chosenEdge === "function") value = chosenEdge;
	}
	return value;
}
/**
* Check if the point falls within the given rectangle.
*
* @param {rect} rect
* @param {point} point
* @param {rotationPoint} [rotationPoint] if specified, the rotation that applies to the rectangle.
* @returns {boolean}  true if point within rectangle, false otherwise
*/
function pointInRect(rect, point, rotationPoint) {
	if (rect.width <= 0 || rect.height <= 0) return false;
	if (rotationPoint !== void 0) {
		var tmp = {
			x: point.x - rotationPoint.x,
			y: point.y - rotationPoint.y
		};
		if (rotationPoint.angle !== 0) {
			var angle = -rotationPoint.angle;
			var tmp2 = {
				x: Math.cos(angle) * tmp.x - Math.sin(angle) * tmp.y,
				y: Math.sin(angle) * tmp.x + Math.cos(angle) * tmp.y
			};
			point = tmp2;
		} else point = tmp;
	}
	var right = rect.x + rect.width;
	var bottom = rect.y + rect.width;
	return rect.left < point.x && right > point.x && rect.top < point.y && bottom > point.y;
}
/**
* Check if given value is acceptable as a label text.
*
* @param {*} text value to check; can be anything at this point
* @returns {boolean} true if valid label value, false otherwise
*/
function isValidLabel(text) {
	return typeof text === "string" && text !== "";
}
/**
* Returns x, y of self reference circle based on provided angle
*
* @param {object} ctx
* @param {number} angle
* @param {number} radius
* @param {VisNode} node
* @returns {object} x and y coordinates
*/
function getSelfRefCoordinates(ctx, angle, radius, node$1) {
	var x = node$1.x;
	var y = node$1.y;
	if (typeof node$1.distanceToBorder === "function") {
		var toBorderDist = node$1.distanceToBorder(ctx, angle);
		var yFromNodeCenter = Math.sin(angle) * toBorderDist;
		var xFromNodeCenter = Math.cos(angle) * toBorderDist;
		if (xFromNodeCenter === toBorderDist) {
			x += toBorderDist;
			y = node$1.y;
		} else if (yFromNodeCenter === toBorderDist) {
			x = node$1.x;
			y -= toBorderDist;
		} else {
			x += xFromNodeCenter;
			y -= yFromNodeCenter;
		}
	} else if (node$1.shape.width > node$1.shape.height) {
		x = node$1.x + node$1.shape.width * .5;
		y = node$1.y - radius;
	} else {
		x = node$1.x + radius;
		y = node$1.y - node$1.shape.height * .5;
	}
	return {
		x,
		y
	};
}
var valuesExports = {};
var values$3 = {
	get exports() {
		return valuesExports;
	},
	set exports(v) {
		valuesExports = v;
	}
};
var entryVirtual$3 = entryVirtual$i;
var values$2 = entryVirtual$3("Array").values;
var parent$l = values$2;
var values$1 = parent$l;
var classof$1 = classof$d;
var hasOwn$2 = hasOwnProperty_1;
var isPrototypeOf$3 = objectIsPrototypeOf;
var method$3 = values$1;
var ArrayPrototype$3 = Array.prototype;
var DOMIterables = {
	DOMTokenList: true,
	NodeList: true
};
var values = function(it$1) {
	var own = it$1.values;
	return it$1 === ArrayPrototype$3 || isPrototypeOf$3(ArrayPrototype$3, it$1) && own === ArrayPrototype$3.values || hasOwn$2(DOMIterables, classof$1(it$1)) ? method$3 : own;
};
(function(module) {
	module.exports = values;
})(values$3);
var _valuesInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(valuesExports);
/**
* Callback to determine text dimensions, using the parent label settings.
*
* @callback MeasureText
* @param {text} text
* @param {text} mod
* @returns {object} { width, values} width in pixels and font attributes
*/
/**
* Helper class for Label which collects results of splitting labels into lines and blocks.
*
* @private
*/
var LabelAccumulator = /* @__PURE__ */ function() {
	/**
	* @param {MeasureText} measureText
	*/
	function LabelAccumulator$1(measureText) {
		_classCallCheck(this, LabelAccumulator$1);
		this.measureText = measureText;
		this.current = 0;
		this.width = 0;
		this.height = 0;
		this.lines = [];
	}
	/**
	* Append given text to the given line.
	*
	* @param {number}  l    index of line to add to
	* @param {string}  text string to append to line
	* @param {'bold'|'ital'|'boldital'|'mono'|'normal'} [mod='normal']
	* @private
	*/
	_createClass(LabelAccumulator$1, [
		{
			key: "_add",
			value: function _add(l, text) {
				var mod = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "normal";
				if (this.lines[l] === void 0) this.lines[l] = {
					width: 0,
					height: 0,
					blocks: []
				};
				var tmpText = text;
				if (text === void 0 || text === "") tmpText = " ";
				var result = this.measureText(tmpText, mod);
				var block = _Object$assign({}, _valuesInstanceProperty(result));
				block.text = text;
				block.width = result.width;
				block.mod = mod;
				if (text === void 0 || text === "") block.width = 0;
				this.lines[l].blocks.push(block);
				this.lines[l].width += block.width;
			}
		},
		{
			key: "curWidth",
			value: function curWidth() {
				var line = this.lines[this.current];
				if (line === void 0) return 0;
				return line.width;
			}
		},
		{
			key: "append",
			value: function append(text) {
				var mod = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "normal";
				this._add(this.current, text, mod);
			}
		},
		{
			key: "newLine",
			value: function newLine(text) {
				var mod = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "normal";
				this._add(this.current, text, mod);
				this.current++;
			}
		},
		{
			key: "determineLineHeights",
			value: function determineLineHeights() {
				for (var k = 0; k < this.lines.length; k++) {
					var line = this.lines[k];
					var height = 0;
					if (line.blocks !== void 0) for (var l = 0; l < line.blocks.length; l++) {
						var block = line.blocks[l];
						if (height < block.height) height = block.height;
					}
					line.height = height;
				}
			}
		},
		{
			key: "determineLabelSize",
			value: function determineLabelSize() {
				var width = 0;
				var height = 0;
				for (var k = 0; k < this.lines.length; k++) {
					var line = this.lines[k];
					if (line.width > width) width = line.width;
					height += line.height;
				}
				this.width = width;
				this.height = height;
			}
		},
		{
			key: "removeEmptyBlocks",
			value: function removeEmptyBlocks() {
				var tmpLines = [];
				for (var k = 0; k < this.lines.length; k++) {
					var line = this.lines[k];
					if (line.blocks.length === 0) continue;
					if (k === this.lines.length - 1) {
						if (line.width === 0) continue;
					}
					var tmpLine = {};
					_Object$assign(tmpLine, line);
					tmpLine.blocks = [];
					var firstEmptyBlock = void 0;
					var tmpBlocks = [];
					for (var l = 0; l < line.blocks.length; l++) {
						var block = line.blocks[l];
						if (block.width !== 0) tmpBlocks.push(block);
						else if (firstEmptyBlock === void 0) firstEmptyBlock = block;
					}
					if (tmpBlocks.length === 0 && firstEmptyBlock !== void 0) tmpBlocks.push(firstEmptyBlock);
					tmpLine.blocks = tmpBlocks;
					tmpLines.push(tmpLine);
				}
				return tmpLines;
			}
		},
		{
			key: "finalize",
			value: function finalize() {
				this.determineLineHeights();
				this.determineLabelSize();
				var tmpLines = this.removeEmptyBlocks();
				return {
					width: this.width,
					height: this.height,
					lines: tmpLines
				};
			}
		}
	]);
	return LabelAccumulator$1;
}();
var tagPattern = {
	"<b>": /<b>/,
	"<i>": /<i>/,
	"<code>": /<code>/,
	"</b>": /<\/b>/,
	"</i>": /<\/i>/,
	"</code>": /<\/code>/,
	"*": /\*/,
	_: /_/,
	"`": /`/,
	afterBold: /[^*]/,
	afterItal: /[^_]/,
	afterMono: /[^`]/
};
/**
* Internal helper class for parsing the markup tags for HTML and Markdown.
*
* NOTE: Sequences of tabs and spaces are reduced to single space.
*       Scan usage of `this.spacing` within method
*/
var MarkupAccumulator = /* @__PURE__ */ function() {
	/**
	* Create an instance
	*
	* @param {string} text  text to parse for markup
	*/
	function MarkupAccumulator$1(text) {
		_classCallCheck(this, MarkupAccumulator$1);
		this.text = text;
		this.bold = false;
		this.ital = false;
		this.mono = false;
		this.spacing = false;
		this.position = 0;
		this.buffer = "";
		this.modStack = [];
		this.blocks = [];
	}
	/**
	* Return the mod label currently on the top of the stack
	*
	* @returns {string}  label of topmost mod
	* @private
	*/
	_createClass(MarkupAccumulator$1, [
		{
			key: "mod",
			value: function mod() {
				return this.modStack.length === 0 ? "normal" : this.modStack[0];
			}
		},
		{
			key: "modName",
			value: function modName() {
				if (this.modStack.length === 0) return "normal";
				else if (this.modStack[0] === "mono") return "mono";
				else if (this.bold && this.ital) return "boldital";
				else if (this.bold) return "bold";
				else if (this.ital) return "ital";
			}
		},
		{
			key: "emitBlock",
			value: function emitBlock() {
				if (this.spacing) {
					this.add(" ");
					this.spacing = false;
				}
				if (this.buffer.length > 0) {
					this.blocks.push({
						text: this.buffer,
						mod: this.modName()
					});
					this.buffer = "";
				}
			}
		},
		{
			key: "add",
			value: function add(text) {
				if (text === " ") this.spacing = true;
				if (this.spacing) {
					this.buffer += " ";
					this.spacing = false;
				}
				if (text != " ") this.buffer += text;
			}
		},
		{
			key: "parseWS",
			value: function parseWS(ch) {
				if (/[ \t]/.test(ch)) {
					if (!this.mono) this.spacing = true;
					else this.add(ch);
					return true;
				}
				return false;
			}
		},
		{
			key: "setTag",
			value: function setTag(tagName) {
				this.emitBlock();
				this[tagName] = true;
				this.modStack.unshift(tagName);
			}
		},
		{
			key: "unsetTag",
			value: function unsetTag(tagName) {
				this.emitBlock();
				this[tagName] = false;
				this.modStack.shift();
			}
		},
		{
			key: "parseStartTag",
			value: function parseStartTag(tagName, tag) {
				if (!this.mono && !this[tagName] && this.match(tag)) {
					this.setTag(tagName);
					return true;
				}
				return false;
			}
		},
		{
			key: "match",
			value: function match$2(tag) {
				var advance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				var _this$prepareRegExp = this.prepareRegExp(tag), _this$prepareRegExp2 = _slicedToArray(_this$prepareRegExp, 2), regExp = _this$prepareRegExp2[0], length$1 = _this$prepareRegExp2[1];
				var matched = regExp.test(this.text.substr(this.position, length$1));
				if (matched && advance) this.position += length$1 - 1;
				return matched;
			}
		},
		{
			key: "parseEndTag",
			value: function parseEndTag(tagName, tag, nextTag) {
				var checkTag = this.mod() === tagName;
				if (tagName === "mono") checkTag = checkTag && this.mono;
				else checkTag = checkTag && !this.mono;
				if (checkTag && this.match(tag)) {
					if (nextTag !== void 0) {
						if (this.position === this.text.length - 1 || this.match(nextTag, false)) this.unsetTag(tagName);
					} else this.unsetTag(tagName);
					return true;
				}
				return false;
			}
		},
		{
			key: "replace",
			value: function replace$3(tag, value) {
				if (this.match(tag)) {
					this.add(value);
					this.position += length - 1;
					return true;
				}
				return false;
			}
		},
		{
			key: "prepareRegExp",
			value: function prepareRegExp(tag) {
				var length$1;
				var regExp;
				if (tag instanceof RegExp) {
					regExp = tag;
					length$1 = 1;
				} else {
					var prepared = tagPattern[tag];
					if (prepared !== void 0) regExp = prepared;
					else regExp = new RegExp(tag);
					length$1 = tag.length;
				}
				return [regExp, length$1];
			}
		}
	]);
	return MarkupAccumulator$1;
}();
/**
* Helper class for Label which explodes the label text into lines and blocks within lines
*
* @private
*/
var LabelSplitter = /* @__PURE__ */ function() {
	/**
	* @param {CanvasRenderingContext2D} ctx Canvas rendering context
	* @param {Label} parent reference to the Label instance using current instance
	* @param {boolean} selected
	* @param {boolean} hover
	*/
	function LabelSplitter$1(ctx, parent$21, selected, hover) {
		var _this = this;
		_classCallCheck(this, LabelSplitter$1);
		this.ctx = ctx;
		this.parent = parent$21;
		this.selected = selected;
		this.hover = hover;
		/**
		* Callback to determine text width; passed to LabelAccumulator instance
		*
		* @param  {string} text string to determine width of
		* @param  {string} mod  font type to use for this text
		* @returns {object} { width, values} width in pixels and font attributes
		*/
		var textWidth = function textWidth$1(text, mod) {
			if (text === void 0) return 0;
			var values$8 = _this.parent.getFormattingValues(ctx, selected, hover, mod);
			var width = 0;
			if (text !== "") {
				var measure = _this.ctx.measureText(text);
				width = measure.width;
			}
			return {
				width,
				values: values$8
			};
		};
		this.lines = new LabelAccumulator(textWidth);
	}
	/**
	* Split passed text of a label into lines and blocks.
	*
	* # NOTE
	*
	* The handling of spacing is option dependent:
	*
	* - if `font.multi : false`, all spaces are retained
	* - if `font.multi : true`, every sequence of spaces is compressed to a single space
	*
	* This might not be the best way to do it, but this is as it has been working till now.
	* In order not to break existing functionality, for the time being this behaviour will
	* be retained in any code changes.
	*
	* @param {string} text  text to split
	* @returns {Array<line>}
	*/
	_createClass(LabelSplitter$1, [
		{
			key: "process",
			value: function process$5(text) {
				if (!isValidLabel(text)) return this.lines.finalize();
				var font = this.parent.fontOptions;
				text = text.replace(/\r\n/g, "\n");
				text = text.replace(/\r/g, "\n");
				var nlLines = String(text).split("\n");
				var lineCount = nlLines.length;
				if (font.multi) for (var i$2 = 0; i$2 < lineCount; i$2++) {
					var blocks = this.splitBlocks(nlLines[i$2], font.multi);
					if (blocks === void 0) continue;
					if (blocks.length === 0) {
						this.lines.newLine("");
						continue;
					}
					if (font.maxWdt > 0) for (var j = 0; j < blocks.length; j++) {
						var mod = blocks[j].mod;
						var _text = blocks[j].text;
						this.splitStringIntoLines(_text, mod, true);
					}
					else for (var _j = 0; _j < blocks.length; _j++) {
						var _mod = blocks[_j].mod;
						var _text2 = blocks[_j].text;
						this.lines.append(_text2, _mod);
					}
					this.lines.newLine();
				}
				else if (font.maxWdt > 0) for (var _i = 0; _i < lineCount; _i++) this.splitStringIntoLines(nlLines[_i]);
				else for (var _i2 = 0; _i2 < lineCount; _i2++) this.lines.newLine(nlLines[_i2]);
				return this.lines.finalize();
			}
		},
		{
			key: "decodeMarkupSystem",
			value: function decodeMarkupSystem(markupSystem) {
				var system = "none";
				if (markupSystem === "markdown" || markupSystem === "md") system = "markdown";
				else if (markupSystem === true || markupSystem === "html") system = "html";
				return system;
			}
		},
		{
			key: "splitHtmlBlocks",
			value: function splitHtmlBlocks(text) {
				var s = new MarkupAccumulator(text);
				var parseEntities = function parseEntities$1(ch$1) {
					if (/&/.test(ch$1)) {
						var parsed$1 = s.replace(s.text, "&lt;", "<") || s.replace(s.text, "&amp;", "&");
						if (!parsed$1) s.add("&");
						return true;
					}
					return false;
				};
				while (s.position < s.text.length) {
					var ch = s.text.charAt(s.position);
					var parsed = s.parseWS(ch) || /</.test(ch) && (s.parseStartTag("bold", "<b>") || s.parseStartTag("ital", "<i>") || s.parseStartTag("mono", "<code>") || s.parseEndTag("bold", "</b>") || s.parseEndTag("ital", "</i>") || s.parseEndTag("mono", "</code>")) || parseEntities(ch);
					if (!parsed) s.add(ch);
					s.position++;
				}
				s.emitBlock();
				return s.blocks;
			}
		},
		{
			key: "splitMarkdownBlocks",
			value: function splitMarkdownBlocks(text) {
				var _this2 = this;
				var s = new MarkupAccumulator(text);
				var beginable = true;
				var parseOverride = function parseOverride$1(ch$1) {
					if (/\\/.test(ch$1)) {
						if (s.position < _this2.text.length + 1) {
							s.position++;
							ch$1 = _this2.text.charAt(s.position);
							if (/ \t/.test(ch$1)) s.spacing = true;
							else {
								s.add(ch$1);
								beginable = false;
							}
						}
						return true;
					}
					return false;
				};
				while (s.position < s.text.length) {
					var ch = s.text.charAt(s.position);
					var parsed = s.parseWS(ch) || parseOverride(ch) || (beginable || s.spacing) && (s.parseStartTag("bold", "*") || s.parseStartTag("ital", "_") || s.parseStartTag("mono", "`")) || s.parseEndTag("bold", "*", "afterBold") || s.parseEndTag("ital", "_", "afterItal") || s.parseEndTag("mono", "`", "afterMono");
					if (!parsed) {
						s.add(ch);
						beginable = false;
					}
					s.position++;
				}
				s.emitBlock();
				return s.blocks;
			}
		},
		{
			key: "splitBlocks",
			value: function splitBlocks(text, markupSystem) {
				var system = this.decodeMarkupSystem(markupSystem);
				if (system === "none") return [{
					text,
					mod: "normal"
				}];
				else if (system === "markdown") return this.splitMarkdownBlocks(text);
				else if (system === "html") return this.splitHtmlBlocks(text);
			}
		},
		{
			key: "overMaxWidth",
			value: function overMaxWidth(text) {
				var width = this.ctx.measureText(text).width;
				return this.lines.curWidth() + width > this.parent.fontOptions.maxWdt;
			}
		},
		{
			key: "getLongestFit",
			value: function getLongestFit(words) {
				var text = "";
				var w = 0;
				while (w < words.length) {
					var pre = text === "" ? "" : " ";
					var newText = text + pre + words[w];
					if (this.overMaxWidth(newText)) break;
					text = newText;
					w++;
				}
				return w;
			}
		},
		{
			key: "getLongestFitWord",
			value: function getLongestFitWord(words) {
				var w = 0;
				while (w < words.length) {
					if (this.overMaxWidth(_sliceInstanceProperty(words).call(words, 0, w))) break;
					w++;
				}
				return w;
			}
		},
		{
			key: "splitStringIntoLines",
			value: function splitStringIntoLines(str) {
				var mod = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "normal";
				var appendLast = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				this.parent.getFormattingValues(this.ctx, this.selected, this.hover, mod);
				str = str.replace(/^( +)/g, "$1\r");
				str = str.replace(/([^\r][^ ]*)( +)/g, "$1\r$2\r");
				var words = str.split("\r");
				while (words.length > 0) {
					var w = this.getLongestFit(words);
					if (w === 0) {
						var word = words[0];
						var x = this.getLongestFitWord(word);
						this.lines.newLine(_sliceInstanceProperty(word).call(word, 0, x), mod);
						words[0] = _sliceInstanceProperty(word).call(word, x);
					} else {
						var newW = w;
						if (words[w - 1] === " ") w--;
						else if (words[newW] === " ") newW++;
						var text = _sliceInstanceProperty(words).call(words, 0, w).join("");
						if (w == words.length && appendLast) this.lines.append(text, mod);
						else this.lines.newLine(text, mod);
						words = _sliceInstanceProperty(words).call(words, newW);
					}
				}
			}
		}
	]);
	return LabelSplitter$1;
}();
/**
* List of special styles for multi-fonts
*
* @private
*/
var multiFontStyle = [
	"bold",
	"ital",
	"boldital",
	"mono"
];
/**
* A Label to be used for Nodes or Edges.
*/
var Label = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {object} options
	* @param {boolean} [edgelabel=false]
	*/
	function Label$1(body, options) {
		var edgelabel = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
		_classCallCheck(this, Label$1);
		this.body = body;
		this.pointToSelf = false;
		this.baseSize = void 0;
		this.fontOptions = {};
		this.setOptions(options);
		this.size = {
			top: 0,
			left: 0,
			width: 0,
			height: 0,
			yLine: 0
		};
		this.isEdgeLabel = edgelabel;
	}
	/**
	* @param {object} options the options of the parent Node-instance
	*/
	_createClass(Label$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.elementOptions = options;
				this.initFontOptions(options.font);
				if (isValidLabel(options.label)) this.labelDirty = true;
				else options.label = void 0;
				if (options.font !== void 0 && options.font !== null) {
					if (typeof options.font === "string") this.baseSize = this.fontOptions.size;
					else if (_typeof(options.font) === "object") {
						var size = options.font.size;
						if (size !== void 0) this.baseSize = size;
					}
				}
			}
		},
		{
			key: "initFontOptions",
			value: function initFontOptions(newFontOptions) {
				var _this = this;
				forEach$1(multiFontStyle, function(style) {
					_this.fontOptions[style] = {};
				});
				if (Label$1.parseFontString(this.fontOptions, newFontOptions)) {
					this.fontOptions.vadjust = 0;
					return;
				}
				forEach$1(newFontOptions, function(prop, n) {
					if (prop !== void 0 && prop !== null && _typeof(prop) !== "object") _this.fontOptions[n] = prop;
				});
			}
		},
		{
			key: "constrain",
			value: function constrain(pile) {
				var fontOptions = {
					constrainWidth: false,
					maxWdt: -1,
					minWdt: -1,
					constrainHeight: false,
					minHgt: -1,
					valign: "middle"
				};
				var widthConstraint = topMost(pile, "widthConstraint");
				if (typeof widthConstraint === "number") {
					fontOptions.maxWdt = Number(widthConstraint);
					fontOptions.minWdt = Number(widthConstraint);
				} else if (_typeof(widthConstraint) === "object") {
					var widthConstraintMaximum = topMost(pile, ["widthConstraint", "maximum"]);
					if (typeof widthConstraintMaximum === "number") fontOptions.maxWdt = Number(widthConstraintMaximum);
					var widthConstraintMinimum = topMost(pile, ["widthConstraint", "minimum"]);
					if (typeof widthConstraintMinimum === "number") fontOptions.minWdt = Number(widthConstraintMinimum);
				}
				var heightConstraint = topMost(pile, "heightConstraint");
				if (typeof heightConstraint === "number") fontOptions.minHgt = Number(heightConstraint);
				else if (_typeof(heightConstraint) === "object") {
					var heightConstraintMinimum = topMost(pile, ["heightConstraint", "minimum"]);
					if (typeof heightConstraintMinimum === "number") fontOptions.minHgt = Number(heightConstraintMinimum);
					var heightConstraintValign = topMost(pile, ["heightConstraint", "valign"]);
					if (typeof heightConstraintValign === "string") {
						if (heightConstraintValign === "top" || heightConstraintValign === "bottom") fontOptions.valign = heightConstraintValign;
					}
				}
				return fontOptions;
			}
		},
		{
			key: "update",
			value: function update(options, pile) {
				this.setOptions(options, true);
				this.propagateFonts(pile);
				deepExtend(this.fontOptions, this.constrain(pile));
				this.fontOptions.chooser = choosify("label", pile);
			}
		},
		{
			key: "adjustSizes",
			value: function adjustSizes(margins) {
				var widthBias = margins ? margins.right + margins.left : 0;
				if (this.fontOptions.constrainWidth) {
					this.fontOptions.maxWdt -= widthBias;
					this.fontOptions.minWdt -= widthBias;
				}
				var heightBias = margins ? margins.top + margins.bottom : 0;
				if (this.fontOptions.constrainHeight) this.fontOptions.minHgt -= heightBias;
			}
		},
		{
			key: "addFontOptionsToPile",
			value: function addFontOptionsToPile(dstPile, srcPile) {
				for (var i$2 = 0; i$2 < srcPile.length; ++i$2) this.addFontToPile(dstPile, srcPile[i$2]);
			}
		},
		{
			key: "addFontToPile",
			value: function addFontToPile(pile, options) {
				if (options === void 0) return;
				if (options.font === void 0 || options.font === null) return;
				var item = options.font;
				pile.push(item);
			}
		},
		{
			key: "getBasicOptions",
			value: function getBasicOptions(pile) {
				var ret = {};
				for (var n = 0; n < pile.length; ++n) {
					var fontOptions = pile[n];
					var tmpShorthand = {};
					if (Label$1.parseFontString(tmpShorthand, fontOptions)) fontOptions = tmpShorthand;
					forEach$1(fontOptions, function(opt, name) {
						if (opt === void 0) return;
						if (Object.prototype.hasOwnProperty.call(ret, name)) return;
						if (_indexOfInstanceProperty(multiFontStyle).call(multiFontStyle, name) !== -1) ret[name] = {};
						else ret[name] = opt;
					});
				}
				return ret;
			}
		},
		{
			key: "getFontOption",
			value: function getFontOption(pile, multiName, option) {
				var multiFont;
				for (var n = 0; n < pile.length; ++n) {
					var fontOptions = pile[n];
					if (Object.prototype.hasOwnProperty.call(fontOptions, multiName)) {
						multiFont = fontOptions[multiName];
						if (multiFont === void 0 || multiFont === null) continue;
						var tmpShorthand = {};
						if (Label$1.parseFontString(tmpShorthand, multiFont)) multiFont = tmpShorthand;
						if (Object.prototype.hasOwnProperty.call(multiFont, option)) return multiFont[option];
					}
				}
				if (Object.prototype.hasOwnProperty.call(this.fontOptions, option)) return this.fontOptions[option];
				throw new Error("Did not find value for multi-font for property: '" + option + "'");
			}
		},
		{
			key: "getFontOptions",
			value: function getFontOptions(pile, multiName) {
				var result = {};
				var optionNames = [
					"color",
					"size",
					"face",
					"mod",
					"vadjust"
				];
				for (var i$2 = 0; i$2 < optionNames.length; ++i$2) {
					var mod = optionNames[i$2];
					result[mod] = this.getFontOption(pile, multiName, mod);
				}
				return result;
			}
		},
		{
			key: "propagateFonts",
			value: function propagateFonts(pile) {
				var _this2 = this;
				var fontPile = [];
				this.addFontOptionsToPile(fontPile, pile);
				this.fontOptions = this.getBasicOptions(fontPile);
				var _loop = function _loop$1() {
					var mod = multiFontStyle[i$2];
					var modOptions = _this2.fontOptions[mod];
					var tmpMultiFontOptions = _this2.getFontOptions(fontPile, mod);
					forEach$1(tmpMultiFontOptions, function(option, n) {
						modOptions[n] = option;
					});
					modOptions.size = Number(modOptions.size);
					modOptions.vadjust = Number(modOptions.vadjust);
				};
				for (var i$2 = 0; i$2 < multiFontStyle.length; ++i$2) _loop();
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover) {
				var baseline = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "middle";
				if (this.elementOptions.label === void 0) return;
				var viewFontSize = this.fontOptions.size * this.body.view.scale;
				if (this.elementOptions.label && viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1) return;
				if (viewFontSize >= this.elementOptions.scaling.label.maxVisible) viewFontSize = Number(this.elementOptions.scaling.label.maxVisible) / this.body.view.scale;
				this.calculateLabelSize(ctx, selected, hover, x, y, baseline);
				this._drawBackground(ctx);
				this._drawText(ctx, x, this.size.yLine, baseline, viewFontSize);
			}
		},
		{
			key: "_drawBackground",
			value: function _drawBackground(ctx) {
				if (this.fontOptions.background !== void 0 && this.fontOptions.background !== "none") {
					ctx.fillStyle = this.fontOptions.background;
					var size = this.getSize();
					ctx.fillRect(size.left, size.top, size.width, size.height);
				}
			}
		},
		{
			key: "_drawText",
			value: function _drawText(ctx, x, y) {
				var baseline = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "middle";
				var viewFontSize = arguments.length > 4 ? arguments[4] : void 0;
				var _this$_setAlignment = this._setAlignment(ctx, x, y, baseline);
				var _this$_setAlignment2 = _slicedToArray(_this$_setAlignment, 2);
				x = _this$_setAlignment2[0];
				y = _this$_setAlignment2[1];
				ctx.textAlign = "left";
				x = x - this.size.width / 2;
				if (this.fontOptions.valign && this.size.height > this.size.labelHeight) {
					if (this.fontOptions.valign === "top") y -= (this.size.height - this.size.labelHeight) / 2;
					if (this.fontOptions.valign === "bottom") y += (this.size.height - this.size.labelHeight) / 2;
				}
				for (var i$2 = 0; i$2 < this.lineCount; i$2++) {
					var line = this.lines[i$2];
					if (line && line.blocks) {
						var width = 0;
						if (this.isEdgeLabel || this.fontOptions.align === "center") width += (this.size.width - line.width) / 2;
						else if (this.fontOptions.align === "right") width += this.size.width - line.width;
						for (var j = 0; j < line.blocks.length; j++) {
							var block = line.blocks[j];
							ctx.font = block.font;
							var _this$_getColor = this._getColor(block.color, viewFontSize, block.strokeColor), _this$_getColor2 = _slicedToArray(_this$_getColor, 2), fontColor = _this$_getColor2[0], strokeColor = _this$_getColor2[1];
							if (block.strokeWidth > 0) {
								ctx.lineWidth = block.strokeWidth;
								ctx.strokeStyle = strokeColor;
								ctx.lineJoin = "round";
							}
							ctx.fillStyle = fontColor;
							if (block.strokeWidth > 0) ctx.strokeText(block.text, x + width, y + block.vadjust);
							ctx.fillText(block.text, x + width, y + block.vadjust);
							width += block.width;
						}
						y += line.height;
					}
				}
			}
		},
		{
			key: "_setAlignment",
			value: function _setAlignment(ctx, x, y, baseline) {
				if (this.isEdgeLabel && this.fontOptions.align !== "horizontal" && this.pointToSelf === false) {
					x = 0;
					y = 0;
					var lineMargin = 2;
					if (this.fontOptions.align === "top") {
						ctx.textBaseline = "alphabetic";
						y -= 2 * lineMargin;
					} else if (this.fontOptions.align === "bottom") {
						ctx.textBaseline = "hanging";
						y += 2 * lineMargin;
					} else ctx.textBaseline = "middle";
				} else ctx.textBaseline = baseline;
				return [x, y];
			}
		},
		{
			key: "_getColor",
			value: function _getColor(color, viewFontSize, initialStrokeColor) {
				var fontColor = color || "#000000";
				var strokeColor = initialStrokeColor || "#ffffff";
				if (viewFontSize <= this.elementOptions.scaling.label.drawThreshold) {
					var opacity = Math.max(0, Math.min(1, 1 - (this.elementOptions.scaling.label.drawThreshold - viewFontSize)));
					fontColor = overrideOpacity(fontColor, opacity);
					strokeColor = overrideOpacity(strokeColor, opacity);
				}
				return [fontColor, strokeColor];
			}
		},
		{
			key: "getTextSize",
			value: function getTextSize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				this._processLabel(ctx, selected, hover);
				return {
					width: this.size.width,
					height: this.size.height,
					lineCount: this.lineCount
				};
			}
		},
		{
			key: "getSize",
			value: function getSize() {
				var lineMargin = 2;
				var x = this.size.left;
				var y = this.size.top - .5 * lineMargin;
				if (this.isEdgeLabel) {
					var x2 = -this.size.width * .5;
					switch (this.fontOptions.align) {
						case "middle":
							x = x2;
							y = -this.size.height * .5;
							break;
						case "top":
							x = x2;
							y = -(this.size.height + lineMargin);
							break;
						case "bottom":
							x = x2;
							y = lineMargin;
							break;
					}
				}
				var ret = {
					left: x,
					top: y,
					width: this.size.width,
					height: this.size.height
				};
				return ret;
			}
		},
		{
			key: "calculateLabelSize",
			value: function calculateLabelSize(ctx, selected, hover) {
				var x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
				var y = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0;
				var baseline = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : "middle";
				this._processLabel(ctx, selected, hover);
				this.size.left = x - this.size.width * .5;
				this.size.top = y - this.size.height * .5;
				this.size.yLine = y + (1 - this.lineCount) * .5 * this.fontOptions.size;
				if (baseline === "hanging") {
					this.size.top += .5 * this.fontOptions.size;
					this.size.top += 4;
					this.size.yLine += 4;
				}
			}
		},
		{
			key: "getFormattingValues",
			value: function getFormattingValues(ctx, selected, hover, mod) {
				var getValue = function getValue$1(fontOptions, mod$1, option) {
					if (mod$1 === "normal") {
						if (option === "mod") return "";
						return fontOptions[option];
					}
					if (fontOptions[mod$1][option] !== void 0) return fontOptions[mod$1][option];
					else return fontOptions[option];
				};
				var values$8 = {
					color: getValue(this.fontOptions, mod, "color"),
					size: getValue(this.fontOptions, mod, "size"),
					face: getValue(this.fontOptions, mod, "face"),
					mod: getValue(this.fontOptions, mod, "mod"),
					vadjust: getValue(this.fontOptions, mod, "vadjust"),
					strokeWidth: this.fontOptions.strokeWidth,
					strokeColor: this.fontOptions.strokeColor
				};
				if (selected || hover) {
					if (mod === "normal" && this.fontOptions.chooser === true && this.elementOptions.labelHighlightBold) values$8.mod = "bold";
					else if (typeof this.fontOptions.chooser === "function") this.fontOptions.chooser(values$8, this.elementOptions.id, selected, hover);
				}
				var fontString = "";
				if (values$8.mod !== void 0 && values$8.mod !== "") fontString += values$8.mod + " ";
				fontString += values$8.size + "px " + values$8.face;
				ctx.font = fontString.replace(/"/g, "");
				values$8.font = ctx.font;
				values$8.height = values$8.size;
				return values$8;
			}
		},
		{
			key: "differentState",
			value: function differentState(selected, hover) {
				return selected !== this.selectedState || hover !== this.hoverState;
			}
		},
		{
			key: "_processLabelText",
			value: function _processLabelText(ctx, selected, hover, inText) {
				var splitter = new LabelSplitter(ctx, this, selected, hover);
				return splitter.process(inText);
			}
		},
		{
			key: "_processLabel",
			value: function _processLabel(ctx, selected, hover) {
				if (this.labelDirty === false && !this.differentState(selected, hover)) return;
				var state = this._processLabelText(ctx, selected, hover, this.elementOptions.label);
				if (this.fontOptions.minWdt > 0 && state.width < this.fontOptions.minWdt) state.width = this.fontOptions.minWdt;
				this.size.labelHeight = state.height;
				if (this.fontOptions.minHgt > 0 && state.height < this.fontOptions.minHgt) state.height = this.fontOptions.minHgt;
				this.lines = state.lines;
				this.lineCount = state.lines.length;
				this.size.width = state.width;
				this.size.height = state.height;
				this.selectedState = selected;
				this.hoverState = hover;
				this.labelDirty = false;
			}
		},
		{
			key: "visible",
			value: function visible() {
				if (this.size.width === 0 || this.size.height === 0 || this.elementOptions.label === void 0) return false;
				var viewFontSize = this.fontOptions.size * this.body.view.scale;
				if (viewFontSize < this.elementOptions.scaling.label.drawThreshold - 1) return false;
				return true;
			}
		}
	], [{
		key: "parseFontString",
		value: function parseFontString(outOptions, inOptions) {
			if (!inOptions || typeof inOptions !== "string") return false;
			var newOptionsArray = inOptions.split(" ");
			outOptions.size = +newOptionsArray[0].replace("px", "");
			outOptions.face = newOptionsArray[1];
			outOptions.color = newOptionsArray[2];
			return true;
		}
	}]);
	return Label$1;
}();
var constructExports = {};
var construct$2 = {
	get exports() {
		return constructExports;
	},
	set exports(v) {
		constructExports = v;
	}
};
var isConstructor = isConstructor$4;
var tryToString = tryToString$6;
var $TypeError$1 = TypeError;
var aConstructor$1 = function(argument) {
	if (isConstructor(argument)) return argument;
	throw $TypeError$1(tryToString(argument) + " is not a constructor");
};
var $$6 = _export;
var getBuiltIn = getBuiltIn$c;
var apply = functionApply;
var bind$4 = functionBind;
var aConstructor = aConstructor$1;
var anObject$2 = anObject$d;
var isObject$3 = isObject$j;
var create$4 = objectCreate;
var fails$2 = fails$w;
var nativeConstruct = getBuiltIn("Reflect", "construct");
var ObjectPrototype = Object.prototype;
var push$1 = [].push;
var NEW_TARGET_BUG = fails$2(function() {
	function F() {}
	return !(nativeConstruct(function() {}, [], F) instanceof F);
});
var ARGS_BUG = !fails$2(function() {
	nativeConstruct(function() {});
});
var FORCED$3 = NEW_TARGET_BUG || ARGS_BUG;
$$6({
	target: "Reflect",
	stat: true,
	forced: FORCED$3,
	sham: FORCED$3
}, { construct: function construct$6(Target, args) {
	aConstructor(Target);
	anObject$2(args);
	var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
	if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
	if (Target == newTarget) {
		switch (args.length) {
			case 0: return new Target();
			case 1: return new Target(args[0]);
			case 2: return new Target(args[0], args[1]);
			case 3: return new Target(args[0], args[1], args[2]);
			case 4: return new Target(args[0], args[1], args[2], args[3]);
		}
		var $args = [null];
		apply(push$1, $args, args);
		return new (apply(bind$4, Target, $args))();
	}
	var proto = newTarget.prototype;
	var instance = create$4(isObject$3(proto) ? proto : ObjectPrototype);
	var result = apply(Target, instance, args);
	return isObject$3(result) ? result : instance;
} });
var path$6 = path$y;
var construct$1 = path$6.Reflect.construct;
var parent$k = construct$1;
var construct = parent$k;
(function(module) {
	module.exports = construct;
})(construct$2);
var _Reflect$construct = /* @__PURE__ */ getDefaultExportFromCjs(constructExports);
var createExports$1 = {};
var create$3 = {
	get exports() {
		return createExports$1;
	},
	set exports(v) {
		createExports$1 = v;
	}
};
var createExports = {};
var create$2 = {
	get exports() {
		return createExports;
	},
	set exports(v) {
		createExports = v;
	}
};
var parent$j = create$6;
var create$1 = parent$j;
var parent$i = create$1;
var create = parent$i;
(function(module) {
	module.exports = create;
})(create$2);
(function(module) {
	module.exports = createExports;
})(create$3);
var _Object$create = /* @__PURE__ */ getDefaultExportFromCjs(createExports$1);
var setPrototypeOfExports$1 = {};
var setPrototypeOf$6 = {
	get exports() {
		return setPrototypeOfExports$1;
	},
	set exports(v) {
		setPrototypeOfExports$1 = v;
	}
};
var setPrototypeOfExports = {};
var setPrototypeOf$5 = {
	get exports() {
		return setPrototypeOfExports;
	},
	set exports(v) {
		setPrototypeOfExports = v;
	}
};
var $$5 = _export;
var setPrototypeOf$4 = objectSetPrototypeOf;
$$5({
	target: "Object",
	stat: true
}, { setPrototypeOf: setPrototypeOf$4 });
var path$5 = path$y;
var setPrototypeOf$3 = path$5.Object.setPrototypeOf;
var parent$h = setPrototypeOf$3;
var setPrototypeOf$2 = parent$h;
var parent$g = setPrototypeOf$2;
var setPrototypeOf$1 = parent$g;
var parent$f = setPrototypeOf$1;
var setPrototypeOf = parent$f;
(function(module) {
	module.exports = setPrototypeOf;
})(setPrototypeOf$5);
(function(module) {
	module.exports = setPrototypeOfExports;
})(setPrototypeOf$6);
var _Object$setPrototypeOf = /* @__PURE__ */ getDefaultExportFromCjs(setPrototypeOfExports$1);
var bindExports$1 = {};
var bind$3 = {
	get exports() {
		return bindExports$1;
	},
	set exports(v) {
		bindExports$1 = v;
	}
};
var bindExports = {};
var bind$2 = {
	get exports() {
		return bindExports;
	},
	set exports(v) {
		bindExports = v;
	}
};
var parent$e = bind$9;
var bind$1 = parent$e;
var parent$d = bind$1;
var bind = parent$d;
(function(module) {
	module.exports = bind;
})(bind$2);
(function(module) {
	module.exports = bindExports;
})(bind$3);
var _bindInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(bindExports$1);
function _setPrototypeOf(o, p) {
	var _context;
	_setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf$2(o$1, p$1) {
		o$1.__proto__ = p$1;
		return o$1;
	};
	return _setPrototypeOf(o, p);
}
function _inherits(subClass, superClass) {
	if (typeof superClass !== "function" && superClass !== null) throw new TypeError("Super expression must either be null or a function");
	subClass.prototype = _Object$create(superClass && superClass.prototype, { constructor: {
		value: subClass,
		writable: true,
		configurable: true
	} });
	_Object$defineProperty(subClass, "prototype", { writable: false });
	if (superClass) _setPrototypeOf(subClass, superClass);
}
function _assertThisInitialized(self$1) {
	if (self$1 === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
	return self$1;
}
function _possibleConstructorReturn(self$1, call$11) {
	if (call$11 && (_typeof(call$11) === "object" || typeof call$11 === "function")) return call$11;
	else if (call$11 !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
	return _assertThisInitialized(self$1);
}
var getPrototypeOfExports$1 = {};
var getPrototypeOf$4 = {
	get exports() {
		return getPrototypeOfExports$1;
	},
	set exports(v) {
		getPrototypeOfExports$1 = v;
	}
};
var getPrototypeOfExports = {};
var getPrototypeOf$3 = {
	get exports() {
		return getPrototypeOfExports;
	},
	set exports(v) {
		getPrototypeOfExports = v;
	}
};
var parent$c = getPrototypeOf$5;
var getPrototypeOf$2 = parent$c;
var parent$b = getPrototypeOf$2;
var getPrototypeOf$1 = parent$b;
(function(module) {
	module.exports = getPrototypeOf$1;
})(getPrototypeOf$3);
(function(module) {
	module.exports = getPrototypeOfExports;
})(getPrototypeOf$4);
var _Object$getPrototypeOf = /* @__PURE__ */ getDefaultExportFromCjs(getPrototypeOfExports$1);
function _getPrototypeOf(o) {
	var _context;
	_getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf$2(o$1) {
		return o$1.__proto__ || _Object$getPrototypeOf(o$1);
	};
	return _getPrototypeOf(o);
}
/**
* The Base class for all Nodes.
*/
var NodeBase = /* @__PURE__ */ function() {
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function NodeBase$1(options, body, labelModule) {
		_classCallCheck(this, NodeBase$1);
		this.body = body;
		this.labelModule = labelModule;
		this.setOptions(options);
		this.top = void 0;
		this.left = void 0;
		this.height = void 0;
		this.width = void 0;
		this.radius = void 0;
		this.margin = void 0;
		this.refreshNeeded = true;
		this.boundingBox = {
			top: 0,
			left: 0,
			right: 0,
			bottom: 0
		};
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(NodeBase$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.options = options;
			}
		},
		{
			key: "_setMargins",
			value: function _setMargins(labelModule) {
				this.margin = {};
				if (this.options.margin) if (_typeof(this.options.margin) == "object") {
					this.margin.top = this.options.margin.top;
					this.margin.right = this.options.margin.right;
					this.margin.bottom = this.options.margin.bottom;
					this.margin.left = this.options.margin.left;
				} else {
					this.margin.top = this.options.margin;
					this.margin.right = this.options.margin;
					this.margin.bottom = this.options.margin;
					this.margin.left = this.options.margin;
				}
				labelModule.adjustSizes(this.margin);
			}
		},
		{
			key: "_distanceToBorder",
			value: function _distanceToBorder(ctx, angle) {
				var borderWidth = this.options.borderWidth;
				if (ctx) this.resize(ctx);
				return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
			}
		},
		{
			key: "enableShadow",
			value: function enableShadow(ctx, values$8) {
				if (values$8.shadow) {
					ctx.shadowColor = values$8.shadowColor;
					ctx.shadowBlur = values$8.shadowSize;
					ctx.shadowOffsetX = values$8.shadowX;
					ctx.shadowOffsetY = values$8.shadowY;
				}
			}
		},
		{
			key: "disableShadow",
			value: function disableShadow(ctx, values$8) {
				if (values$8.shadow) {
					ctx.shadowColor = "rgba(0,0,0,0)";
					ctx.shadowBlur = 0;
					ctx.shadowOffsetX = 0;
					ctx.shadowOffsetY = 0;
				}
			}
		},
		{
			key: "enableBorderDashes",
			value: function enableBorderDashes(ctx, values$8) {
				if (values$8.borderDashes !== false) if (ctx.setLineDash !== void 0) {
					var dashes = values$8.borderDashes;
					if (dashes === true) dashes = [5, 15];
					ctx.setLineDash(dashes);
				} else {
					console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used.");
					this.options.shapeProperties.borderDashes = false;
					values$8.borderDashes = false;
				}
			}
		},
		{
			key: "disableBorderDashes",
			value: function disableBorderDashes(ctx, values$8) {
				if (values$8.borderDashes !== false) if (ctx.setLineDash !== void 0) ctx.setLineDash([0]);
				else {
					console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used.");
					this.options.shapeProperties.borderDashes = false;
					values$8.borderDashes = false;
				}
			}
		},
		{
			key: "needsRefresh",
			value: function needsRefresh(selected, hover) {
				if (this.refreshNeeded === true) {
					this.refreshNeeded = false;
					return true;
				}
				return this.width === void 0 || this.labelModule.differentState(selected, hover);
			}
		},
		{
			key: "initContextForDraw",
			value: function initContextForDraw(ctx, values$8) {
				var borderWidth = values$8.borderWidth / this.body.view.scale;
				ctx.lineWidth = Math.min(this.width, borderWidth);
				ctx.strokeStyle = values$8.borderColor;
				ctx.fillStyle = values$8.color;
			}
		},
		{
			key: "performStroke",
			value: function performStroke(ctx, values$8) {
				var borderWidth = values$8.borderWidth / this.body.view.scale;
				ctx.save();
				if (borderWidth > 0) {
					this.enableBorderDashes(ctx, values$8);
					ctx.stroke();
					this.disableBorderDashes(ctx, values$8);
				}
				ctx.restore();
			}
		},
		{
			key: "performFill",
			value: function performFill(ctx, values$8) {
				ctx.save();
				ctx.fillStyle = values$8.color;
				this.enableShadow(ctx, values$8);
				_fillInstanceProperty(ctx).call(ctx);
				this.disableShadow(ctx, values$8);
				ctx.restore();
				this.performStroke(ctx, values$8);
			}
		},
		{
			key: "_addBoundingBoxMargin",
			value: function _addBoundingBoxMargin(margin) {
				this.boundingBox.left -= margin;
				this.boundingBox.top -= margin;
				this.boundingBox.bottom += margin;
				this.boundingBox.right += margin;
			}
		},
		{
			key: "_updateBoundingBox",
			value: function _updateBoundingBox(x, y, ctx, selected, hover) {
				if (ctx !== void 0) this.resize(ctx, selected, hover);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this.boundingBox.left = this.left;
				this.boundingBox.top = this.top;
				this.boundingBox.bottom = this.top + this.height;
				this.boundingBox.right = this.left + this.width;
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y, ctx, selected, hover) {
				this._updateBoundingBox(x, y, ctx, selected, hover);
			}
		},
		{
			key: "getDimensionsFromLabel",
			value: function getDimensionsFromLabel(ctx, selected, hover) {
				this.textSize = this.labelModule.getTextSize(ctx, selected, hover);
				var width = this.textSize.width;
				var height = this.textSize.height;
				var DEFAULT_SIZE = 14;
				if (width === 0) {
					width = DEFAULT_SIZE;
					height = DEFAULT_SIZE;
				}
				return {
					width,
					height
				};
			}
		}
	]);
	return NodeBase$1;
}();
function _createSuper$s(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$s();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$s() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Box Node/Cluster shape.
*
* @augments NodeBase
*/
var Box$1 = /* @__PURE__ */ function(_NodeBase) {
	_inherits(Box$2, _NodeBase);
	var _super = _createSuper$s(Box$2);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Box$2(options, body, labelModule) {
		var _this;
		_classCallCheck(this, Box$2);
		_this = _super.call(this, options, body, labelModule);
		_this._setMargins(labelModule);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(Box$2, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				if (this.needsRefresh(selected, hover)) {
					var dimensions = this.getDimensionsFromLabel(ctx, selected, hover);
					this.width = dimensions.width + this.margin.right + this.margin.left;
					this.height = dimensions.height + this.margin.top + this.margin.bottom;
					this.radius = this.width / 2;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.resize(ctx, selected, hover);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this.initContextForDraw(ctx, values$8);
				drawRoundRect(ctx, this.left, this.top, this.width, this.height, values$8.borderRadius);
				this.performFill(ctx, values$8);
				this.updateBoundingBox(x, y, ctx, selected, hover);
				this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover);
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y, ctx, selected, hover) {
				this._updateBoundingBox(x, y, ctx, selected, hover);
				var borderRadius = this.options.shapeProperties.borderRadius;
				this._addBoundingBoxMargin(borderRadius);
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				if (ctx) this.resize(ctx);
				var borderWidth = this.options.borderWidth;
				return Math.min(Math.abs(this.width / 2 / Math.cos(angle)), Math.abs(this.height / 2 / Math.sin(angle))) + borderWidth;
			}
		}
	]);
	return Box$2;
}(NodeBase);
function _createSuper$r(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$r();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$r() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* NOTE: This is a bad base class
*
* Child classes are:
*
*   Image       - uses *only* image methods
*   Circle      - uses *only* _drawRawCircle
*   CircleImage - uses all
*
* TODO: Refactor, move _drawRawCircle to different module, derive Circle from NodeBase
*       Rename this to ImageBase
*       Consolidate common code in Image and CircleImage to base class
*
* @augments NodeBase
*/
var CircleImageBase = /* @__PURE__ */ function(_NodeBase) {
	_inherits(CircleImageBase$1, _NodeBase);
	var _super = _createSuper$r(CircleImageBase$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function CircleImageBase$1(options, body, labelModule) {
		var _this;
		_classCallCheck(this, CircleImageBase$1);
		_this = _super.call(this, options, body, labelModule);
		_this.labelOffset = 0;
		_this.selected = false;
		return _this;
	}
	/**
	*
	* @param {object} options
	* @param {object} [imageObj]
	* @param {object} [imageObjAlt]
	*/
	_createClass(CircleImageBase$1, [
		{
			key: "setOptions",
			value: function setOptions(options, imageObj, imageObjAlt) {
				this.options = options;
				if (!(imageObj === void 0 && imageObjAlt === void 0)) this.setImages(imageObj, imageObjAlt);
			}
		},
		{
			key: "setImages",
			value: function setImages(imageObj, imageObjAlt) {
				if (imageObjAlt && this.selected) {
					this.imageObj = imageObjAlt;
					this.imageObjAlt = imageObj;
				} else {
					this.imageObj = imageObj;
					this.imageObjAlt = imageObjAlt;
				}
			}
		},
		{
			key: "switchImages",
			value: function switchImages(selected) {
				var selection_changed = selected && !this.selected || !selected && this.selected;
				this.selected = selected;
				if (this.imageObjAlt !== void 0 && selection_changed) {
					var imageTmp = this.imageObj;
					this.imageObj = this.imageObjAlt;
					this.imageObjAlt = imageTmp;
				}
			}
		},
		{
			key: "_getImagePadding",
			value: function _getImagePadding() {
				var imgPadding = {
					top: 0,
					right: 0,
					bottom: 0,
					left: 0
				};
				if (this.options.imagePadding) {
					var optImgPadding = this.options.imagePadding;
					if (_typeof(optImgPadding) == "object") {
						imgPadding.top = optImgPadding.top;
						imgPadding.right = optImgPadding.right;
						imgPadding.bottom = optImgPadding.bottom;
						imgPadding.left = optImgPadding.left;
					} else {
						imgPadding.top = optImgPadding;
						imgPadding.right = optImgPadding;
						imgPadding.bottom = optImgPadding;
						imgPadding.left = optImgPadding;
					}
				}
				return imgPadding;
			}
		},
		{
			key: "_resizeImage",
			value: function _resizeImage() {
				var width, height;
				if (this.options.shapeProperties.useImageSize === false) {
					var ratio_width = 1;
					var ratio_height = 1;
					if (this.imageObj.width && this.imageObj.height) if (this.imageObj.width > this.imageObj.height) ratio_width = this.imageObj.width / this.imageObj.height;
					else ratio_height = this.imageObj.height / this.imageObj.width;
					width = this.options.size * 2 * ratio_width;
					height = this.options.size * 2 * ratio_height;
				} else {
					var imgPadding = this._getImagePadding();
					width = this.imageObj.width + imgPadding.left + imgPadding.right;
					height = this.imageObj.height + imgPadding.top + imgPadding.bottom;
				}
				this.width = width;
				this.height = height;
				this.radius = .5 * this.width;
			}
		},
		{
			key: "_drawRawCircle",
			value: function _drawRawCircle(ctx, x, y, values$8) {
				this.initContextForDraw(ctx, values$8);
				drawCircle(ctx, x, y, values$8.size);
				this.performFill(ctx, values$8);
			}
		},
		{
			key: "_drawImageAtPosition",
			value: function _drawImageAtPosition(ctx, values$8) {
				if (this.imageObj.width != 0) {
					ctx.globalAlpha = values$8.opacity !== void 0 ? values$8.opacity : 1;
					this.enableShadow(ctx, values$8);
					var factor = 1;
					if (this.options.shapeProperties.interpolation === true) factor = this.imageObj.width / this.width / this.body.view.scale;
					var imgPadding = this._getImagePadding();
					var imgPosLeft = this.left + imgPadding.left;
					var imgPosTop = this.top + imgPadding.top;
					var imgWidth = this.width - imgPadding.left - imgPadding.right;
					var imgHeight = this.height - imgPadding.top - imgPadding.bottom;
					this.imageObj.drawImageAtPosition(ctx, factor, imgPosLeft, imgPosTop, imgWidth, imgHeight);
					this.disableShadow(ctx, values$8);
				}
			}
		},
		{
			key: "_drawImageLabel",
			value: function _drawImageLabel(ctx, x, y, selected, hover) {
				var offset = 0;
				if (this.height !== void 0) {
					offset = this.height * .5;
					var labelDimensions = this.labelModule.getTextSize(ctx, selected, hover);
					if (labelDimensions.lineCount >= 1) offset += labelDimensions.height / 2;
				}
				var yLabel = y + offset;
				if (this.options.label) this.labelOffset = offset;
				this.labelModule.draw(ctx, x, yLabel, selected, hover, "hanging");
			}
		}
	]);
	return CircleImageBase$1;
}(NodeBase);
function _createSuper$q(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$q();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$q() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Circle Node/Cluster shape.
*
* @augments CircleImageBase
*/
var Circle$1 = /* @__PURE__ */ function(_CircleImageBase) {
	_inherits(Circle$2, _CircleImageBase);
	var _super = _createSuper$q(Circle$2);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Circle$2(options, body, labelModule) {
		var _this;
		_classCallCheck(this, Circle$2);
		_this = _super.call(this, options, body, labelModule);
		_this._setMargins(labelModule);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(Circle$2, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				if (this.needsRefresh(selected, hover)) {
					var dimensions = this.getDimensionsFromLabel(ctx, selected, hover);
					var diameter = Math.max(dimensions.width + this.margin.right + this.margin.left, dimensions.height + this.margin.top + this.margin.bottom);
					this.options.size = diameter / 2;
					this.width = diameter;
					this.height = diameter;
					this.radius = this.width / 2;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.resize(ctx, selected, hover);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this._drawRawCircle(ctx, x, y, values$8);
				this.updateBoundingBox(x, y);
				this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, y, selected, hover);
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y) {
				this.boundingBox.top = y - this.options.size;
				this.boundingBox.left = x - this.options.size;
				this.boundingBox.right = x + this.options.size;
				this.boundingBox.bottom = y + this.options.size;
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx) {
				if (ctx) this.resize(ctx);
				return this.width * .5;
			}
		}
	]);
	return Circle$2;
}(CircleImageBase);
function _createSuper$p(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$p();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$p() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A CircularImage Node/Cluster shape.
*
* @augments CircleImageBase
*/
var CircularImage = /* @__PURE__ */ function(_CircleImageBase) {
	_inherits(CircularImage$1, _CircleImageBase);
	var _super = _createSuper$p(CircularImage$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	* @param {Image} imageObj
	* @param {Image} imageObjAlt
	*/
	function CircularImage$1(options, body, labelModule, imageObj, imageObjAlt) {
		var _this;
		_classCallCheck(this, CircularImage$1);
		_this = _super.call(this, options, body, labelModule);
		_this.setImages(imageObj, imageObjAlt);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(CircularImage$1, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				var imageAbsent = this.imageObj.src === void 0 || this.imageObj.width === void 0 || this.imageObj.height === void 0;
				if (imageAbsent) {
					var diameter = this.options.size * 2;
					this.width = diameter;
					this.height = diameter;
					this.radius = .5 * this.width;
					return;
				}
				if (this.needsRefresh(selected, hover)) this._resizeImage();
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.switchImages(selected);
				this.resize();
				var labelX = x, labelY = y;
				if (this.options.shapeProperties.coordinateOrigin === "top-left") {
					this.left = x;
					this.top = y;
					labelX += this.width / 2;
					labelY += this.height / 2;
				} else {
					this.left = x - this.width / 2;
					this.top = y - this.height / 2;
				}
				this._drawRawCircle(ctx, labelX, labelY, values$8);
				ctx.save();
				ctx.clip();
				this._drawImageAtPosition(ctx, values$8);
				ctx.restore();
				this._drawImageLabel(ctx, labelX, labelY, selected, hover);
				this.updateBoundingBox(x, y);
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y) {
				if (this.options.shapeProperties.coordinateOrigin === "top-left") {
					this.boundingBox.top = y;
					this.boundingBox.left = x;
					this.boundingBox.right = x + this.options.size * 2;
					this.boundingBox.bottom = y + this.options.size * 2;
				} else {
					this.boundingBox.top = y - this.options.size;
					this.boundingBox.left = x - this.options.size;
					this.boundingBox.right = x + this.options.size;
					this.boundingBox.bottom = y + this.options.size;
				}
				this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
				this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
				this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx) {
				if (ctx) this.resize(ctx);
				return this.width * .5;
			}
		}
	]);
	return CircularImage$1;
}(CircleImageBase);
function _createSuper$o(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$o();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$o() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* Base class for constructing Node/Cluster Shapes.
*
* @augments NodeBase
*/
var ShapeBase = /* @__PURE__ */ function(_NodeBase) {
	_inherits(ShapeBase$1, _NodeBase);
	var _super = _createSuper$o(ShapeBase$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function ShapeBase$1(options, body, labelModule) {
		_classCallCheck(this, ShapeBase$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	* @param {object} [values={size: this.options.size}]
	*/
	_createClass(ShapeBase$1, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				var values$8 = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : { size: this.options.size };
				if (this.needsRefresh(selected, hover)) {
					var _this$customSizeWidth, _this$customSizeHeigh;
					this.labelModule.getTextSize(ctx, selected, hover);
					var size = 2 * values$8.size;
					this.width = (_this$customSizeWidth = this.customSizeWidth) !== null && _this$customSizeWidth !== void 0 ? _this$customSizeWidth : size;
					this.height = (_this$customSizeHeigh = this.customSizeHeight) !== null && _this$customSizeHeigh !== void 0 ? _this$customSizeHeigh : size;
					this.radius = .5 * this.width;
				}
			}
		},
		{
			key: "_drawShape",
			value: function _drawShape(ctx, shape, sizeMultiplier, x, y, selected, hover, values$8) {
				var _this = this;
				this.resize(ctx, selected, hover, values$8);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this.initContextForDraw(ctx, values$8);
				getShape(shape)(ctx, x, y, values$8.size);
				this.performFill(ctx, values$8);
				if (this.options.icon !== void 0) {
					if (this.options.icon.code !== void 0) {
						ctx.font = (selected ? "bold " : "") + this.height / 2 + "px " + (this.options.icon.face || "FontAwesome");
						ctx.fillStyle = this.options.icon.color || "black";
						ctx.textAlign = "center";
						ctx.textBaseline = "middle";
						ctx.fillText(this.options.icon.code, x, y);
					}
				}
				return { drawExternalLabel: function drawExternalLabel() {
					if (_this.options.label !== void 0) {
						_this.labelModule.calculateLabelSize(ctx, selected, hover, x, y, "hanging");
						var yLabel = y + .5 * _this.height + .5 * _this.labelModule.size.height;
						_this.labelModule.draw(ctx, x, yLabel, selected, hover, "hanging");
					}
					_this.updateBoundingBox(x, y);
				} };
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y) {
				this.boundingBox.top = y - this.options.size;
				this.boundingBox.left = x - this.options.size;
				this.boundingBox.right = x + this.options.size;
				this.boundingBox.bottom = y + this.options.size;
				if (this.options.label !== void 0 && this.labelModule.size.width > 0) {
					this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
					this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
					this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height);
				}
			}
		}
	]);
	return ShapeBase$1;
}(NodeBase);
function ownKeys$3(object$1, enumerableOnly) {
	var keys$9 = _Object$keys(object$1);
	if (_Object$getOwnPropertySymbols) {
		var symbols = _Object$getOwnPropertySymbols(object$1);
		enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function(sym) {
			return _Object$getOwnPropertyDescriptor$1(object$1, sym).enumerable;
		})), keys$9.push.apply(keys$9, symbols);
	}
	return keys$9;
}
function _objectSpread$3(target) {
	for (var i$2 = 1; i$2 < arguments.length; i$2++) {
		var _context, _context2;
		var source = null != arguments[i$2] ? arguments[i$2] : {};
		i$2 % 2 ? _forEachInstanceProperty(_context = ownKeys$3(Object(source), !0)).call(_context, function(key) {
			_defineProperty(target, key, source[key]);
		}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys$3(Object(source))).call(_context2, function(key) {
			_Object$defineProperty$1(target, key, _Object$getOwnPropertyDescriptor$1(source, key));
		});
	}
	return target;
}
function _createSuper$n(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$n();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$n() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A CustomShape Node/Cluster shape.
*
* @augments ShapeBase
*/
var CustomShape = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(CustomShape$1, _ShapeBase);
	var _super = _createSuper$n(CustomShape$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	* @param {Function} ctxRenderer
	*/
	function CustomShape$1(options, body, labelModule, ctxRenderer) {
		var _this;
		_classCallCheck(this, CustomShape$1);
		_this = _super.call(this, options, body, labelModule, ctxRenderer);
		_this.ctxRenderer = ctxRenderer;
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on different layers.
	*/
	_createClass(CustomShape$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			this.resize(ctx, selected, hover, values$8);
			this.left = x - this.width / 2;
			this.top = y - this.height / 2;
			ctx.save();
			var drawLater = this.ctxRenderer({
				ctx,
				id: this.options.id,
				x,
				y,
				state: {
					selected,
					hover
				},
				style: _objectSpread$3({}, values$8),
				label: this.options.label
			});
			if (drawLater.drawNode != null) drawLater.drawNode();
			ctx.restore();
			if (drawLater.drawExternalLabel) {
				var drawExternalLabel = drawLater.drawExternalLabel;
				drawLater.drawExternalLabel = function() {
					ctx.save();
					drawExternalLabel();
					ctx.restore();
				};
			}
			if (drawLater.nodeDimensions) {
				this.customSizeWidth = drawLater.nodeDimensions.width;
				this.customSizeHeight = drawLater.nodeDimensions.height;
			}
			return drawLater;
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return CustomShape$1;
}(ShapeBase);
function _createSuper$m(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$m();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$m() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Database Node/Cluster shape.
*
* @augments NodeBase
*/
var Database = /* @__PURE__ */ function(_NodeBase) {
	_inherits(Database$1, _NodeBase);
	var _super = _createSuper$m(Database$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Database$1(options, body, labelModule) {
		var _this;
		_classCallCheck(this, Database$1);
		_this = _super.call(this, options, body, labelModule);
		_this._setMargins(labelModule);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} selected
	* @param {boolean} hover
	*/
	_createClass(Database$1, [
		{
			key: "resize",
			value: function resize(ctx, selected, hover) {
				if (this.needsRefresh(selected, hover)) {
					var dimensions = this.getDimensionsFromLabel(ctx, selected, hover);
					var size = dimensions.width + this.margin.right + this.margin.left;
					this.width = size;
					this.height = size;
					this.radius = this.width / 2;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.resize(ctx, selected, hover);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this.initContextForDraw(ctx, values$8);
				drawDatabase(ctx, x - this.width / 2, y - this.height / 2, this.width, this.height);
				this.performFill(ctx, values$8);
				this.updateBoundingBox(x, y, ctx, selected, hover);
				this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover);
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				return this._distanceToBorder(ctx, angle);
			}
		}
	]);
	return Database$1;
}(NodeBase);
function _createSuper$l(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$l();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$l() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Diamond Node/Cluster shape.
*
* @augments ShapeBase
*/
var Diamond$1 = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Diamond$2, _ShapeBase);
	var _super = _createSuper$l(Diamond$2);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Diamond$2(options, body, labelModule) {
		_classCallCheck(this, Diamond$2);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Diamond$2, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "diamond", 4, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return Diamond$2;
}(ShapeBase);
function _createSuper$k(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$k();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$k() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Dot Node/Cluster shape.
*
* @augments ShapeBase
*/
var Dot = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Dot$1, _ShapeBase);
	var _super = _createSuper$k(Dot$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Dot$1(options, body, labelModule) {
		_classCallCheck(this, Dot$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Dot$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "circle", 2, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx) {
			if (ctx) this.resize(ctx);
			return this.options.size;
		}
	}]);
	return Dot$1;
}(ShapeBase);
function _createSuper$j(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$j();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$j() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* Am Ellipse Node/Cluster shape.
*
* @augments NodeBase
*/
var Ellipse = /* @__PURE__ */ function(_NodeBase) {
	_inherits(Ellipse$1, _NodeBase);
	var _super = _createSuper$j(Ellipse$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Ellipse$1(options, body, labelModule) {
		_classCallCheck(this, Ellipse$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(Ellipse$1, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				if (this.needsRefresh(selected, hover)) {
					var dimensions = this.getDimensionsFromLabel(ctx, selected, hover);
					this.height = dimensions.height * 2;
					this.width = dimensions.width + dimensions.height;
					this.radius = .5 * this.width;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.resize(ctx, selected, hover);
				this.left = x - this.width * .5;
				this.top = y - this.height * .5;
				this.initContextForDraw(ctx, values$8);
				drawEllipse(ctx, this.left, this.top, this.width, this.height);
				this.performFill(ctx, values$8);
				this.updateBoundingBox(x, y, ctx, selected, hover);
				this.labelModule.draw(ctx, x, y, selected, hover);
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				if (ctx) this.resize(ctx);
				var a = this.width * .5;
				var b = this.height * .5;
				var w = Math.sin(angle) * a;
				var h = Math.cos(angle) * b;
				return a * b / Math.sqrt(w * w + h * h);
			}
		}
	]);
	return Ellipse$1;
}(NodeBase);
function _createSuper$i(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$i();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$i() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* An icon replacement for the default Node shape.
*
* @augments NodeBase
*/
var Icon = /* @__PURE__ */ function(_NodeBase) {
	_inherits(Icon$1, _NodeBase);
	var _super = _createSuper$i(Icon$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Icon$1(options, body, labelModule) {
		var _this;
		_classCallCheck(this, Icon$1);
		_this = _super.call(this, options, body, labelModule);
		_this._setMargins(labelModule);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx - Unused.
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(Icon$1, [
		{
			key: "resize",
			value: function resize(ctx, selected, hover) {
				if (this.needsRefresh(selected, hover)) {
					this.iconSize = {
						width: Number(this.options.icon.size),
						height: Number(this.options.icon.size)
					};
					this.width = this.iconSize.width + this.margin.right + this.margin.left;
					this.height = this.iconSize.height + this.margin.top + this.margin.bottom;
					this.radius = .5 * this.width;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				var _this2 = this;
				this.resize(ctx, selected, hover);
				this.options.icon.size = this.options.icon.size || 50;
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this._icon(ctx, x, y, selected, hover, values$8);
				return { drawExternalLabel: function drawExternalLabel() {
					if (_this2.options.label !== void 0) {
						var iconTextSpacing = 5;
						_this2.labelModule.draw(ctx, _this2.left + _this2.iconSize.width / 2 + _this2.margin.left, y + _this2.height / 2 + iconTextSpacing, selected);
					}
					_this2.updateBoundingBox(x, y);
				} };
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y) {
				this.boundingBox.top = y - this.options.icon.size * .5;
				this.boundingBox.left = x - this.options.icon.size * .5;
				this.boundingBox.right = x + this.options.icon.size * .5;
				this.boundingBox.bottom = y + this.options.icon.size * .5;
				if (this.options.label !== void 0 && this.labelModule.size.width > 0) {
					var iconTextSpacing = 5;
					this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
					this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
					this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + iconTextSpacing);
				}
			}
		},
		{
			key: "_icon",
			value: function _icon(ctx, x, y, selected, hover, values$8) {
				var iconSize = Number(this.options.icon.size);
				if (this.options.icon.code !== void 0) {
					ctx.font = [
						this.options.icon.weight != null ? this.options.icon.weight : selected ? "bold" : "",
						(this.options.icon.weight != null && selected ? 5 : 0) + iconSize + "px",
						this.options.icon.face
					].join(" ");
					ctx.fillStyle = this.options.icon.color || "black";
					ctx.textAlign = "center";
					ctx.textBaseline = "middle";
					this.enableShadow(ctx, values$8);
					ctx.fillText(this.options.icon.code, x, y);
					this.disableShadow(ctx, values$8);
				} else console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.");
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				return this._distanceToBorder(ctx, angle);
			}
		}
	]);
	return Icon$1;
}(NodeBase);
function _createSuper$h(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$h();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$h() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* An image-based replacement for the default Node shape.
*
* @augments CircleImageBase
*/
var Image$2 = /* @__PURE__ */ function(_CircleImageBase) {
	_inherits(Image$3, _CircleImageBase);
	var _super = _createSuper$h(Image$3);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	* @param {Image} imageObj
	* @param {Image} imageObjAlt
	*/
	function Image$3(options, body, labelModule, imageObj, imageObjAlt) {
		var _this;
		_classCallCheck(this, Image$3);
		_this = _super.call(this, options, body, labelModule);
		_this.setImages(imageObj, imageObjAlt);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx - Unused.
	* @param {boolean} [selected]
	* @param {boolean} [hover]
	*/
	_createClass(Image$3, [
		{
			key: "resize",
			value: function resize(ctx) {
				var selected = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.selected;
				var hover = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.hover;
				var imageAbsent = this.imageObj.src === void 0 || this.imageObj.width === void 0 || this.imageObj.height === void 0;
				if (imageAbsent) {
					var side = this.options.size * 2;
					this.width = side;
					this.height = side;
					return;
				}
				if (this.needsRefresh(selected, hover)) this._resizeImage();
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				ctx.save();
				this.switchImages(selected);
				this.resize();
				var labelX = x, labelY = y;
				if (this.options.shapeProperties.coordinateOrigin === "top-left") {
					this.left = x;
					this.top = y;
					labelX += this.width / 2;
					labelY += this.height / 2;
				} else {
					this.left = x - this.width / 2;
					this.top = y - this.height / 2;
				}
				if (this.options.shapeProperties.useBorderWithImage === true) {
					var neutralborderWidth = this.options.borderWidth;
					var selectionLineWidth = this.options.borderWidthSelected || 2 * this.options.borderWidth;
					var borderWidth = (selected ? selectionLineWidth : neutralborderWidth) / this.body.view.scale;
					ctx.lineWidth = Math.min(this.width, borderWidth);
					ctx.beginPath();
					var strokeStyle = selected ? this.options.color.highlight.border : hover ? this.options.color.hover.border : this.options.color.border;
					var fillStyle = selected ? this.options.color.highlight.background : hover ? this.options.color.hover.background : this.options.color.background;
					if (values$8.opacity !== void 0) {
						strokeStyle = overrideOpacity(strokeStyle, values$8.opacity);
						fillStyle = overrideOpacity(fillStyle, values$8.opacity);
					}
					ctx.strokeStyle = strokeStyle;
					ctx.fillStyle = fillStyle;
					ctx.rect(this.left - .5 * ctx.lineWidth, this.top - .5 * ctx.lineWidth, this.width + ctx.lineWidth, this.height + ctx.lineWidth);
					_fillInstanceProperty(ctx).call(ctx);
					this.performStroke(ctx, values$8);
					ctx.closePath();
				}
				this._drawImageAtPosition(ctx, values$8);
				this._drawImageLabel(ctx, labelX, labelY, selected, hover);
				this.updateBoundingBox(x, y);
				ctx.restore();
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(x, y) {
				this.resize();
				if (this.options.shapeProperties.coordinateOrigin === "top-left") {
					this.left = x;
					this.top = y;
				} else {
					this.left = x - this.width / 2;
					this.top = y - this.height / 2;
				}
				this.boundingBox.left = this.left;
				this.boundingBox.top = this.top;
				this.boundingBox.bottom = this.top + this.height;
				this.boundingBox.right = this.left + this.width;
				if (this.options.label !== void 0 && this.labelModule.size.width > 0) {
					this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left);
					this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width);
					this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset);
				}
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				return this._distanceToBorder(ctx, angle);
			}
		}
	]);
	return Image$3;
}(CircleImageBase);
function _createSuper$g(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$g();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$g() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Square Node/Cluster shape.
*
* @augments ShapeBase
*/
var Square = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Square$1, _ShapeBase);
	var _super = _createSuper$g(Square$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Square$1(options, body, labelModule) {
		_classCallCheck(this, Square$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Square$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "square", 2, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return Square$1;
}(ShapeBase);
function _createSuper$f(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$f();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$f() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Hexagon Node/Cluster shape.
*
* @augments ShapeBase
*/
var Hexagon = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Hexagon$1, _ShapeBase);
	var _super = _createSuper$f(Hexagon$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Hexagon$1(options, body, labelModule) {
		_classCallCheck(this, Hexagon$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Hexagon$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "hexagon", 4, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return Hexagon$1;
}(ShapeBase);
function _createSuper$e(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$e();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$e() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Star Node/Cluster shape.
*
* @augments ShapeBase
*/
var Star = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Star$1, _ShapeBase);
	var _super = _createSuper$e(Star$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Star$1(options, body, labelModule) {
		_classCallCheck(this, Star$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x width
	* @param {number} y height
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Star$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "star", 4, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return Star$1;
}(ShapeBase);
function _createSuper$d(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$d();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$d() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A text-based replacement for the default Node shape.
*
* @augments NodeBase
*/
var Text = /* @__PURE__ */ function(_NodeBase) {
	_inherits(Text$1, _NodeBase);
	var _super = _createSuper$d(Text$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Text$1(options, body, labelModule) {
		var _this;
		_classCallCheck(this, Text$1);
		_this = _super.call(this, options, body, labelModule);
		_this._setMargins(labelModule);
		return _this;
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {boolean} selected
	* @param {boolean} hover
	*/
	_createClass(Text$1, [
		{
			key: "resize",
			value: function resize(ctx, selected, hover) {
				if (this.needsRefresh(selected, hover)) {
					this.textSize = this.labelModule.getTextSize(ctx, selected, hover);
					this.width = this.textSize.width + this.margin.right + this.margin.left;
					this.height = this.textSize.height + this.margin.top + this.margin.bottom;
					this.radius = .5 * this.width;
				}
			}
		},
		{
			key: "draw",
			value: function draw(ctx, x, y, selected, hover, values$8) {
				this.resize(ctx, selected, hover);
				this.left = x - this.width / 2;
				this.top = y - this.height / 2;
				this.enableShadow(ctx, values$8);
				this.labelModule.draw(ctx, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, selected, hover);
				this.disableShadow(ctx, values$8);
				this.updateBoundingBox(x, y, ctx, selected, hover);
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				return this._distanceToBorder(ctx, angle);
			}
		}
	]);
	return Text$1;
}(NodeBase);
function _createSuper$c(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$c();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$c() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Triangle Node/Cluster shape.
*
* @augments ShapeBase
*/
var Triangle$1 = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(Triangle$2, _ShapeBase);
	var _super = _createSuper$c(Triangle$2);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function Triangle$2(options, body, labelModule) {
		_classCallCheck(this, Triangle$2);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x
	* @param {number} y
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(Triangle$2, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "triangle", 3, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return Triangle$2;
}(ShapeBase);
function _createSuper$b(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$b();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$b() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A downward facing Triangle Node/Cluster shape.
*
* @augments ShapeBase
*/
var TriangleDown = /* @__PURE__ */ function(_ShapeBase) {
	_inherits(TriangleDown$1, _ShapeBase);
	var _super = _createSuper$b(TriangleDown$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Label} labelModule
	*/
	function TriangleDown$1(options, body, labelModule) {
		_classCallCheck(this, TriangleDown$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	*
	* @param {CanvasRenderingContext2D} ctx
	* @param {number} x
	* @param {number} y
	* @param {boolean} selected
	* @param {boolean} hover
	* @param {ArrowOptions} values
	* @returns {object} Callbacks to draw later on higher layers.
	*/
	_createClass(TriangleDown$1, [{
		key: "draw",
		value: function draw(ctx, x, y, selected, hover, values$8) {
			return this._drawShape(ctx, "triangleDown", 3, x, y, selected, hover, values$8);
		}
	}, {
		key: "distanceToBorder",
		value: function distanceToBorder(ctx, angle) {
			return this._distanceToBorder(ctx, angle);
		}
	}]);
	return TriangleDown$1;
}(ShapeBase);
function ownKeys$2(object$1, enumerableOnly) {
	var keys$9 = _Object$keys(object$1);
	if (_Object$getOwnPropertySymbols) {
		var symbols = _Object$getOwnPropertySymbols(object$1);
		enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function(sym) {
			return _Object$getOwnPropertyDescriptor$1(object$1, sym).enumerable;
		})), keys$9.push.apply(keys$9, symbols);
	}
	return keys$9;
}
function _objectSpread$2(target) {
	for (var i$2 = 1; i$2 < arguments.length; i$2++) {
		var _context5, _context6;
		var source = null != arguments[i$2] ? arguments[i$2] : {};
		i$2 % 2 ? _forEachInstanceProperty(_context5 = ownKeys$2(Object(source), !0)).call(_context5, function(key) {
			_defineProperty(target, key, source[key]);
		}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context6 = ownKeys$2(Object(source))).call(_context6, function(key) {
			_Object$defineProperty$1(target, key, _Object$getOwnPropertyDescriptor$1(source, key));
		});
	}
	return target;
}
/**
* A node. A node can be connected to other nodes via one or multiple edges.
*/
var Node = /* @__PURE__ */ function() {
	/**
	*
	* @param {object} options An object containing options for the node. All
	*                            options are optional, except for the id.
	*                              {number} id     Id of the node. Required
	*                              {string} label  Text label for the node
	*                              {number} x      Horizontal position of the node
	*                              {number} y      Vertical position of the node
	*                              {string} shape  Node shape
	*                              {string} image  An image url
	*                              {string} title  A title text, can be HTML
	*                              {anytype} group A group name or number
	* @param {object} body               Shared state of current network instance
	* @param {Network.Images} imagelist  A list with images. Only needed when the node has an image
	* @param {Groups} grouplist          A list with groups. Needed for retrieving group options
	* @param {object} globalOptions      Current global node options; these serve as defaults for the node instance
	* @param {object} defaultOptions     Global default options for nodes; note that this is also the prototype
	*                                    for parameter `globalOptions`.
	*/
	function Node$1(options, body, imagelist, grouplist, globalOptions, defaultOptions) {
		_classCallCheck(this, Node$1);
		this.options = bridgeObject(globalOptions);
		this.globalOptions = globalOptions;
		this.defaultOptions = defaultOptions;
		this.body = body;
		this.edges = [];
		this.id = void 0;
		this.imagelist = imagelist;
		this.grouplist = grouplist;
		this.x = void 0;
		this.y = void 0;
		this.baseSize = this.options.size;
		this.baseFontSize = this.options.font.size;
		this.predefinedPosition = false;
		this.selected = false;
		this.hover = false;
		this.labelModule = new Label(
			this.body,
			this.options,
			false
			/* Not edge label */
);
		this.setOptions(options);
	}
	/**
	* Attach a edge to the node
	*
	* @param {Edge} edge
	*/
	_createClass(Node$1, [
		{
			key: "attachEdge",
			value: function attachEdge(edge) {
				var _context;
				if (_indexOfInstanceProperty(_context = this.edges).call(_context, edge) === -1) this.edges.push(edge);
			}
		},
		{
			key: "detachEdge",
			value: function detachEdge(edge) {
				var _context2;
				var index$1 = _indexOfInstanceProperty(_context2 = this.edges).call(_context2, edge);
				if (index$1 != -1) {
					var _context3;
					_spliceInstanceProperty(_context3 = this.edges).call(_context3, index$1, 1);
				}
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				var currentShape = this.options.shape;
				if (!options) return;
				if (typeof options.color !== "undefined") this._localColor = options.color;
				if (options.id !== void 0) this.id = options.id;
				if (this.id === void 0) throw new Error("Node must have an id");
				Node$1.checkMass(options, this.id);
				if (options.x !== void 0) if (options.x === null) {
					this.x = void 0;
					this.predefinedPosition = false;
				} else {
					this.x = _parseInt(options.x);
					this.predefinedPosition = true;
				}
				if (options.y !== void 0) if (options.y === null) {
					this.y = void 0;
					this.predefinedPosition = false;
				} else {
					this.y = _parseInt(options.y);
					this.predefinedPosition = true;
				}
				if (options.size !== void 0) this.baseSize = options.size;
				if (options.value !== void 0) options.value = _parseFloat(options.value);
				Node$1.parseOptions(this.options, options, true, this.globalOptions, this.grouplist);
				var pile = [
					options,
					this.options,
					this.defaultOptions
				];
				this.chooser = choosify("node", pile);
				this._load_images();
				this.updateLabelModule(options);
				if (options.opacity !== void 0 && Node$1.checkOpacity(options.opacity)) this.options.opacity = options.opacity;
				this.updateShape(currentShape);
				return options.hidden !== void 0 || options.physics !== void 0;
			}
		},
		{
			key: "_load_images",
			value: function _load_images() {
				if (this.options.shape === "circularImage" || this.options.shape === "image") {
					if (this.options.image === void 0) throw new Error("Option image must be defined for node type '" + this.options.shape + "'");
				}
				if (this.options.image === void 0) return;
				if (this.imagelist === void 0) throw new Error("Internal Error: No images provided");
				if (typeof this.options.image === "string") this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id);
				else {
					if (this.options.image.unselected === void 0) throw new Error("No unselected image provided");
					this.imageObj = this.imagelist.load(this.options.image.unselected, this.options.brokenImage, this.id);
					if (this.options.image.selected !== void 0) this.imageObjAlt = this.imagelist.load(this.options.image.selected, this.options.brokenImage, this.id);
					else this.imageObjAlt = void 0;
				}
			}
		},
		{
			key: "getFormattingValues",
			value: function getFormattingValues() {
				var values$8 = {
					color: this.options.color.background,
					opacity: this.options.opacity,
					borderWidth: this.options.borderWidth,
					borderColor: this.options.color.border,
					size: this.options.size,
					borderDashes: this.options.shapeProperties.borderDashes,
					borderRadius: this.options.shapeProperties.borderRadius,
					shadow: this.options.shadow.enabled,
					shadowColor: this.options.shadow.color,
					shadowSize: this.options.shadow.size,
					shadowX: this.options.shadow.x,
					shadowY: this.options.shadow.y
				};
				if (this.selected || this.hover) {
					if (this.chooser === true) {
						if (this.selected) {
							if (this.options.borderWidthSelected != null) values$8.borderWidth = this.options.borderWidthSelected;
							else values$8.borderWidth *= 2;
							values$8.color = this.options.color.highlight.background;
							values$8.borderColor = this.options.color.highlight.border;
							values$8.shadow = this.options.shadow.enabled;
						} else if (this.hover) {
							values$8.color = this.options.color.hover.background;
							values$8.borderColor = this.options.color.hover.border;
							values$8.shadow = this.options.shadow.enabled;
						}
					} else if (typeof this.chooser === "function") {
						this.chooser(values$8, this.options.id, this.selected, this.hover);
						if (values$8.shadow === false) {
							if (values$8.shadowColor !== this.options.shadow.color || values$8.shadowSize !== this.options.shadow.size || values$8.shadowX !== this.options.shadow.x || values$8.shadowY !== this.options.shadow.y) values$8.shadow = true;
						}
					}
				} else values$8.shadow = this.options.shadow.enabled;
				if (this.options.opacity !== void 0) {
					var opacity = this.options.opacity;
					values$8.borderColor = overrideOpacity(values$8.borderColor, opacity);
					values$8.color = overrideOpacity(values$8.color, opacity);
					values$8.shadowColor = overrideOpacity(values$8.shadowColor, opacity);
				}
				return values$8;
			}
		},
		{
			key: "updateLabelModule",
			value: function updateLabelModule(options) {
				if (this.options.label === void 0 || this.options.label === null) this.options.label = "";
				Node$1.updateGroupOptions(this.options, _objectSpread$2(_objectSpread$2({}, options), {}, { color: options && options.color || this._localColor || void 0 }), this.grouplist);
				var currentGroup = this.grouplist.get(this.options.group, false);
				var pile = [
					options,
					this.options,
					currentGroup,
					this.globalOptions,
					this.defaultOptions
				];
				this.labelModule.update(this.options, pile);
				if (this.labelModule.baseSize !== void 0) this.baseFontSize = this.labelModule.baseSize;
			}
		},
		{
			key: "updateShape",
			value: function updateShape(currentShape) {
				if (currentShape === this.options.shape && this.shape) this.shape.setOptions(this.options, this.imageObj, this.imageObjAlt);
				else switch (this.options.shape) {
					case "box":
						this.shape = new Box$1(this.options, this.body, this.labelModule);
						break;
					case "circle":
						this.shape = new Circle$1(this.options, this.body, this.labelModule);
						break;
					case "circularImage":
						this.shape = new CircularImage(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt);
						break;
					case "custom":
						this.shape = new CustomShape(this.options, this.body, this.labelModule, this.options.ctxRenderer);
						break;
					case "database":
						this.shape = new Database(this.options, this.body, this.labelModule);
						break;
					case "diamond":
						this.shape = new Diamond$1(this.options, this.body, this.labelModule);
						break;
					case "dot":
						this.shape = new Dot(this.options, this.body, this.labelModule);
						break;
					case "ellipse":
						this.shape = new Ellipse(this.options, this.body, this.labelModule);
						break;
					case "icon":
						this.shape = new Icon(this.options, this.body, this.labelModule);
						break;
					case "image":
						this.shape = new Image$2(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt);
						break;
					case "square":
						this.shape = new Square(this.options, this.body, this.labelModule);
						break;
					case "hexagon":
						this.shape = new Hexagon(this.options, this.body, this.labelModule);
						break;
					case "star":
						this.shape = new Star(this.options, this.body, this.labelModule);
						break;
					case "text":
						this.shape = new Text(this.options, this.body, this.labelModule);
						break;
					case "triangle":
						this.shape = new Triangle$1(this.options, this.body, this.labelModule);
						break;
					case "triangleDown":
						this.shape = new TriangleDown(this.options, this.body, this.labelModule);
						break;
					default:
						this.shape = new Ellipse(this.options, this.body, this.labelModule);
						break;
				}
				this.needsRefresh();
			}
		},
		{
			key: "select",
			value: function select() {
				this.selected = true;
				this.needsRefresh();
			}
		},
		{
			key: "unselect",
			value: function unselect() {
				this.selected = false;
				this.needsRefresh();
			}
		},
		{
			key: "needsRefresh",
			value: function needsRefresh() {
				this.shape.refreshNeeded = true;
			}
		},
		{
			key: "getTitle",
			value: function getTitle() {
				return this.options.title;
			}
		},
		{
			key: "distanceToBorder",
			value: function distanceToBorder(ctx, angle) {
				return this.shape.distanceToBorder(ctx, angle);
			}
		},
		{
			key: "isFixed",
			value: function isFixed() {
				return this.options.fixed.x && this.options.fixed.y;
			}
		},
		{
			key: "isSelected",
			value: function isSelected() {
				return this.selected;
			}
		},
		{
			key: "getValue",
			value: function getValue() {
				return this.options.value;
			}
		},
		{
			key: "getLabelSize",
			value: function getLabelSize() {
				return this.labelModule.size();
			}
		},
		{
			key: "setValueRange",
			value: function setValueRange(min$4, max$5, total) {
				if (this.options.value !== void 0) {
					var scale = this.options.scaling.customScalingFunction(min$4, max$5, total, this.options.value);
					var sizeDiff = this.options.scaling.max - this.options.scaling.min;
					if (this.options.scaling.label.enabled === true) {
						var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
						this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
					}
					this.options.size = this.options.scaling.min + scale * sizeDiff;
				} else {
					this.options.size = this.baseSize;
					this.options.font.size = this.baseFontSize;
				}
				this.updateLabelModule();
			}
		},
		{
			key: "draw",
			value: function draw(ctx) {
				var values$8 = this.getFormattingValues();
				return this.shape.draw(ctx, this.x, this.y, this.selected, this.hover, values$8) || {};
			}
		},
		{
			key: "updateBoundingBox",
			value: function updateBoundingBox(ctx) {
				this.shape.updateBoundingBox(this.x, this.y, ctx);
			}
		},
		{
			key: "resize",
			value: function resize(ctx) {
				var values$8 = this.getFormattingValues();
				this.shape.resize(ctx, this.selected, this.hover, values$8);
			}
		},
		{
			key: "getItemsOnPoint",
			value: function getItemsOnPoint(point) {
				var ret = [];
				if (this.labelModule.visible()) {
					if (pointInRect(this.labelModule.getSize(), point)) ret.push({
						nodeId: this.id,
						labelId: 0
					});
				}
				if (pointInRect(this.shape.boundingBox, point)) ret.push({ nodeId: this.id });
				return ret;
			}
		},
		{
			key: "isOverlappingWith",
			value: function isOverlappingWith(obj) {
				return this.shape.left < obj.right && this.shape.left + this.shape.width > obj.left && this.shape.top < obj.bottom && this.shape.top + this.shape.height > obj.top;
			}
		},
		{
			key: "isBoundingBoxOverlappingWith",
			value: function isBoundingBoxOverlappingWith(obj) {
				return this.shape.boundingBox.left < obj.right && this.shape.boundingBox.right > obj.left && this.shape.boundingBox.top < obj.bottom && this.shape.boundingBox.bottom > obj.top;
			}
		}
	], [
		{
			key: "checkOpacity",
			value: function checkOpacity(opacity) {
				return 0 <= opacity && opacity <= 1;
			}
		},
		{
			key: "checkCoordinateOrigin",
			value: function checkCoordinateOrigin(origin) {
				return origin === void 0 || origin === "center" || origin === "top-left";
			}
		},
		{
			key: "updateGroupOptions",
			value: function updateGroupOptions(parentOptions, newOptions, groupList) {
				var _context4;
				if (groupList === void 0) return;
				var group = parentOptions.group;
				if (newOptions !== void 0 && newOptions.group !== void 0 && group !== newOptions.group) throw new Error("updateGroupOptions: group values in options don't match.");
				var hasGroup = typeof group === "number" || typeof group === "string" && group != "";
				if (!hasGroup) return;
				var groupObj = groupList.get(group);
				if (groupObj.opacity !== void 0 && newOptions.opacity === void 0) {
					if (!Node$1.checkOpacity(groupObj.opacity)) {
						console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + groupObj.opacity);
						groupObj.opacity = void 0;
					}
				}
				var skipProperties = _filterInstanceProperty(_context4 = _Object$getOwnPropertyNames(newOptions)).call(_context4, function(p) {
					return newOptions[p] != null;
				});
				skipProperties.push("font");
				selectiveNotDeepExtend(skipProperties, parentOptions, groupObj);
				parentOptions.color = parseColor(parentOptions.color);
			}
		},
		{
			key: "parseOptions",
			value: function parseOptions(parentOptions, newOptions) {
				var allowDeletion = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				var globalOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
				var groupList = arguments.length > 4 ? arguments[4] : void 0;
				var fields = [
					"color",
					"fixed",
					"shadow"
				];
				selectiveNotDeepExtend(fields, parentOptions, newOptions, allowDeletion);
				Node$1.checkMass(newOptions);
				if (parentOptions.opacity !== void 0) {
					if (!Node$1.checkOpacity(parentOptions.opacity)) {
						console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + parentOptions.opacity);
						parentOptions.opacity = void 0;
					}
				}
				if (newOptions.opacity !== void 0) {
					if (!Node$1.checkOpacity(newOptions.opacity)) {
						console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + newOptions.opacity);
						newOptions.opacity = void 0;
					}
				}
				if (newOptions.shapeProperties && !Node$1.checkCoordinateOrigin(newOptions.shapeProperties.coordinateOrigin)) console.error("Invalid option for node coordinateOrigin, found: " + newOptions.shapeProperties.coordinateOrigin);
				mergeOptions(parentOptions, newOptions, "shadow", globalOptions);
				if (newOptions.color !== void 0 && newOptions.color !== null) {
					var parsedColor = parseColor(newOptions.color);
					fillIfDefined(parentOptions.color, parsedColor);
				} else if (allowDeletion === true && newOptions.color === null) parentOptions.color = bridgeObject(globalOptions.color);
				if (newOptions.fixed !== void 0 && newOptions.fixed !== null) if (typeof newOptions.fixed === "boolean") {
					parentOptions.fixed.x = newOptions.fixed;
					parentOptions.fixed.y = newOptions.fixed;
				} else {
					if (newOptions.fixed.x !== void 0 && typeof newOptions.fixed.x === "boolean") parentOptions.fixed.x = newOptions.fixed.x;
					if (newOptions.fixed.y !== void 0 && typeof newOptions.fixed.y === "boolean") parentOptions.fixed.y = newOptions.fixed.y;
				}
				if (allowDeletion === true && newOptions.font === null) parentOptions.font = bridgeObject(globalOptions.font);
				Node$1.updateGroupOptions(parentOptions, newOptions, groupList);
				if (newOptions.scaling !== void 0) mergeOptions(parentOptions.scaling, newOptions.scaling, "label", globalOptions.scaling);
			}
		},
		{
			key: "checkMass",
			value: function checkMass(options, id$4) {
				if (options.mass !== void 0 && options.mass <= 0) {
					var strId = "";
					if (id$4 !== void 0) strId = " in node id: " + id$4;
					console.error("%cNegative or zero mass disallowed" + strId + ", setting mass to 1.", VALIDATOR_PRINT_STYLE);
					options.mass = 1;
				}
			}
		}
	]);
	return Node$1;
}();
function _createForOfIteratorHelper$5(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$5(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$5(o, minLen) {
	var _context4;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$5(o, minLen);
	var n = _sliceInstanceProperty(_context4 = Object.prototype.toString.call(o)).call(_context4, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$5(o, minLen);
}
function _arrayLikeToArray$5(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**
* Handler for Nodes
*/
var NodesHandler = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Images} images
	* @param {Array.<Group>} groups
	* @param {LayoutEngine} layoutEngine
	*/
	function NodesHandler$1(body, images, groups, layoutEngine) {
		var _context, _this = this;
		_classCallCheck(this, NodesHandler$1);
		this.body = body;
		this.images = images;
		this.groups = groups;
		this.layoutEngine = layoutEngine;
		this.body.functions.createNode = _bindInstanceProperty$1(_context = this.create).call(_context, this);
		this.nodesListeners = {
			add: function add(event, params) {
				_this.add(params.items);
			},
			update: function update(event, params) {
				_this.update(params.items, params.data, params.oldData);
			},
			remove: function remove(event, params) {
				_this.remove(params.items);
			}
		};
		this.defaultOptions = {
			borderWidth: 1,
			borderWidthSelected: void 0,
			brokenImage: void 0,
			color: {
				border: "#2B7CE9",
				background: "#97C2FC",
				highlight: {
					border: "#2B7CE9",
					background: "#D2E5FF"
				},
				hover: {
					border: "#2B7CE9",
					background: "#D2E5FF"
				}
			},
			opacity: void 0,
			fixed: {
				x: false,
				y: false
			},
			font: {
				color: "#343434",
				size: 14,
				face: "arial",
				background: "none",
				strokeWidth: 0,
				strokeColor: "#ffffff",
				align: "center",
				vadjust: 0,
				multi: false,
				bold: { mod: "bold" },
				boldital: { mod: "bold italic" },
				ital: { mod: "italic" },
				mono: {
					mod: "",
					size: 15,
					face: "monospace",
					vadjust: 2
				}
			},
			group: void 0,
			hidden: false,
			icon: {
				face: "FontAwesome",
				code: void 0,
				size: 50,
				color: "#2B7CE9"
			},
			image: void 0,
			imagePadding: {
				top: 0,
				right: 0,
				bottom: 0,
				left: 0
			},
			label: void 0,
			labelHighlightBold: true,
			level: void 0,
			margin: {
				top: 5,
				right: 5,
				bottom: 5,
				left: 5
			},
			mass: 1,
			physics: true,
			scaling: {
				min: 10,
				max: 30,
				label: {
					enabled: false,
					min: 14,
					max: 30,
					maxVisible: 30,
					drawThreshold: 5
				},
				customScalingFunction: function customScalingFunction(min$4, max$5, total, value) {
					if (max$5 === min$4) return .5;
					else {
						var scale = 1 / (max$5 - min$4);
						return Math.max(0, (value - min$4) * scale);
					}
				}
			},
			shadow: {
				enabled: false,
				color: "rgba(0,0,0,0.5)",
				size: 10,
				x: 5,
				y: 5
			},
			shape: "ellipse",
			shapeProperties: {
				borderDashes: false,
				borderRadius: 6,
				interpolation: true,
				useImageSize: false,
				useBorderWithImage: false,
				coordinateOrigin: "center"
			},
			size: 25,
			title: void 0,
			value: void 0,
			x: void 0,
			y: void 0
		};
		if (this.defaultOptions.mass <= 0) throw "Internal error: mass in defaultOptions of NodesHandler may not be zero or negative";
		this.options = bridgeObject(this.defaultOptions);
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(NodesHandler$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _context2, _context3, _this2 = this;
				this.body.emitter.on("refreshNodes", _bindInstanceProperty$1(_context2 = this.refresh).call(_context2, this));
				this.body.emitter.on("refresh", _bindInstanceProperty$1(_context3 = this.refresh).call(_context3, this));
				this.body.emitter.on("destroy", function() {
					forEach$1(_this2.nodesListeners, function(callback, event) {
						if (_this2.body.data.nodes) _this2.body.data.nodes.off(event, callback);
					});
					delete _this2.body.functions.createNode;
					delete _this2.nodesListeners.add;
					delete _this2.nodesListeners.update;
					delete _this2.nodesListeners.remove;
					delete _this2.nodesListeners;
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					Node.parseOptions(this.options, options);
					if (options.opacity !== void 0) if (_Number$isNaN(options.opacity) || !_Number$isFinite(options.opacity) || options.opacity < 0 || options.opacity > 1) console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + options.opacity);
					else this.options.opacity = options.opacity;
					if (options.shape !== void 0) {
						for (var nodeId in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) this.body.nodes[nodeId].updateShape();
					}
					if (typeof options.font !== "undefined" || typeof options.widthConstraint !== "undefined" || typeof options.heightConstraint !== "undefined") for (var _i = 0, _Object$keys$1$1 = _Object$keys(this.body.nodes); _i < _Object$keys$1$1.length; _i++) {
						var _nodeId = _Object$keys$1$1[_i];
						this.body.nodes[_nodeId].updateLabelModule();
						this.body.nodes[_nodeId].needsRefresh();
					}
					if (options.size !== void 0) {
						for (var _nodeId2 in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, _nodeId2)) this.body.nodes[_nodeId2].needsRefresh();
					}
					if (options.hidden !== void 0 || options.physics !== void 0) this.body.emitter.emit("_dataChanged");
				}
			}
		},
		{
			key: "setData",
			value: function setData(nodes) {
				var doNotEmit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var oldNodesData = this.body.data.nodes;
				if (isDataViewLike("id", nodes)) this.body.data.nodes = nodes;
				else if (_Array$isArray(nodes)) {
					this.body.data.nodes = new DataSet();
					this.body.data.nodes.add(nodes);
				} else if (!nodes) this.body.data.nodes = new DataSet();
				else throw new TypeError("Array or DataSet expected");
				if (oldNodesData) forEach$1(this.nodesListeners, function(callback, event) {
					oldNodesData.off(event, callback);
				});
				this.body.nodes = {};
				if (this.body.data.nodes) {
					var me = this;
					forEach$1(this.nodesListeners, function(callback, event) {
						me.body.data.nodes.on(event, callback);
					});
					var ids = this.body.data.nodes.getIds();
					this.add(ids, true);
				}
				if (doNotEmit === false) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "add",
			value: function add(ids) {
				var doNotEmit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var id$4;
				var newNodes = [];
				for (var i$2 = 0; i$2 < ids.length; i$2++) {
					id$4 = ids[i$2];
					var properties = this.body.data.nodes.get(id$4);
					var node$1 = this.create(properties);
					newNodes.push(node$1);
					this.body.nodes[id$4] = node$1;
				}
				this.layoutEngine.positionInitially(newNodes);
				if (doNotEmit === false) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "update",
			value: function update(ids, changedData, oldData) {
				var nodes = this.body.nodes;
				var dataChanged = false;
				for (var i$2 = 0; i$2 < ids.length; i$2++) {
					var id$4 = ids[i$2];
					var node$1 = nodes[id$4];
					var data$2 = changedData[i$2];
					if (node$1 !== void 0) {
						if (node$1.setOptions(data$2)) dataChanged = true;
					} else {
						dataChanged = true;
						node$1 = this.create(data$2);
						nodes[id$4] = node$1;
					}
				}
				if (!dataChanged && oldData !== void 0) dataChanged = _someInstanceProperty(changedData).call(changedData, function(newValue, index$1) {
					var oldValue = oldData[index$1];
					return oldValue && oldValue.level !== newValue.level;
				});
				if (dataChanged === true) this.body.emitter.emit("_dataChanged");
				else this.body.emitter.emit("_dataUpdated");
			}
		},
		{
			key: "remove",
			value: function remove(ids) {
				var nodes = this.body.nodes;
				for (var i$2 = 0; i$2 < ids.length; i$2++) {
					var id$4 = ids[i$2];
					delete nodes[id$4];
				}
				this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "create",
			value: function create$11(properties) {
				var constructorClass = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Node;
				return new constructorClass(properties, this.body, this.images, this.groups, this.options, this.defaultOptions);
			}
		},
		{
			key: "refresh",
			value: function refresh() {
				var _this3 = this;
				var clearPositions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
				forEach$1(this.body.nodes, function(node$1, nodeId) {
					var data$2 = _this3.body.data.nodes.get(nodeId);
					if (data$2 !== void 0) {
						if (clearPositions === true) node$1.setOptions({
							x: null,
							y: null
						});
						node$1.setOptions({ fixed: false });
						node$1.setOptions(data$2);
					}
				});
			}
		},
		{
			key: "getPositions",
			value: function getPositions(ids) {
				var dataArray = {};
				if (ids !== void 0) {
					if (_Array$isArray(ids) === true) {
						for (var i$2 = 0; i$2 < ids.length; i$2++) if (this.body.nodes[ids[i$2]] !== void 0) {
							var node$1 = this.body.nodes[ids[i$2]];
							dataArray[ids[i$2]] = {
								x: Math.round(node$1.x),
								y: Math.round(node$1.y)
							};
						}
					} else if (this.body.nodes[ids] !== void 0) {
						var _node = this.body.nodes[ids];
						dataArray[ids] = {
							x: Math.round(_node.x),
							y: Math.round(_node.y)
						};
					}
				} else for (var _i2 = 0; _i2 < this.body.nodeIndices.length; _i2++) {
					var _node2 = this.body.nodes[this.body.nodeIndices[_i2]];
					dataArray[this.body.nodeIndices[_i2]] = {
						x: Math.round(_node2.x),
						y: Math.round(_node2.y)
					};
				}
				return dataArray;
			}
		},
		{
			key: "getPosition",
			value: function getPosition(id$4) {
				if (id$4 == void 0) throw new TypeError("No id was specified for getPosition method.");
				else if (this.body.nodes[id$4] == void 0) throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(id$4));
				else return {
					x: Math.round(this.body.nodes[id$4].x),
					y: Math.round(this.body.nodes[id$4].y)
				};
			}
		},
		{
			key: "storePositions",
			value: function storePositions() {
				var dataArray = [];
				var dataset = this.body.data.nodes.getDataSet();
				var _iterator = _createForOfIteratorHelper$5(dataset.get()), _step;
				try {
					for (_iterator.s(); !(_step = _iterator.n()).done;) {
						var dsNode = _step.value;
						var id$4 = dsNode.id;
						var bodyNode = this.body.nodes[id$4];
						var x = Math.round(bodyNode.x);
						var y = Math.round(bodyNode.y);
						if (dsNode.x !== x || dsNode.y !== y) dataArray.push({
							id: id$4,
							x,
							y
						});
					}
				} catch (err) {
					_iterator.e(err);
				} finally {
					_iterator.f();
				}
				dataset.update(dataArray);
			}
		},
		{
			key: "getBoundingBox",
			value: function getBoundingBox(nodeId) {
				if (this.body.nodes[nodeId] !== void 0) return this.body.nodes[nodeId].shape.boundingBox;
			}
		},
		{
			key: "getConnectedNodes",
			value: function getConnectedNodes(nodeId, direction) {
				var nodeList = [];
				if (this.body.nodes[nodeId] !== void 0) {
					var node$1 = this.body.nodes[nodeId];
					var nodeObj = {};
					for (var i$2 = 0; i$2 < node$1.edges.length; i$2++) {
						var edge = node$1.edges[i$2];
						if (direction !== "to" && edge.toId == node$1.id) {
							if (nodeObj[edge.fromId] === void 0) {
								nodeList.push(edge.fromId);
								nodeObj[edge.fromId] = true;
							}
						} else if (direction !== "from" && edge.fromId == node$1.id) {
							if (nodeObj[edge.toId] === void 0) {
								nodeList.push(edge.toId);
								nodeObj[edge.toId] = true;
							}
						}
					}
				}
				return nodeList;
			}
		},
		{
			key: "getConnectedEdges",
			value: function getConnectedEdges(nodeId) {
				var edgeList = [];
				if (this.body.nodes[nodeId] !== void 0) {
					var node$1 = this.body.nodes[nodeId];
					for (var i$2 = 0; i$2 < node$1.edges.length; i$2++) edgeList.push(node$1.edges[i$2].id);
				} else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ", nodeId);
				return edgeList;
			}
		},
		{
			key: "moveNode",
			value: function moveNode(nodeId, x, y) {
				var _this4 = this;
				if (this.body.nodes[nodeId] !== void 0) {
					this.body.nodes[nodeId].x = Number(x);
					this.body.nodes[nodeId].y = Number(y);
					_setTimeout(function() {
						_this4.body.emitter.emit("startSimulation");
					}, 0);
				} else console.error("Node id supplied to moveNode does not exist. Provided: ", nodeId);
			}
		}
	]);
	return NodesHandler$1;
}();
var getExports$1 = {};
var get$6 = {
	get exports() {
		return getExports$1;
	},
	set exports(v) {
		getExports$1 = v;
	}
};
var getExports = {};
var get$5 = {
	get exports() {
		return getExports;
	},
	set exports(v) {
		getExports = v;
	}
};
var hasOwn$1 = hasOwnProperty_1;
var isDataDescriptor$1 = function(descriptor) {
	return descriptor !== void 0 && (hasOwn$1(descriptor, "value") || hasOwn$1(descriptor, "writable"));
};
var $$4 = _export;
var call = functionCall;
var isObject$2 = isObject$j;
var anObject$1 = anObject$d;
var isDataDescriptor = isDataDescriptor$1;
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
var getPrototypeOf = objectGetPrototypeOf;
function get$4(target, propertyKey) {
	var receiver = arguments.length < 3 ? target : arguments[2];
	var descriptor, prototype;
	if (anObject$1(target) === receiver) return target[propertyKey];
	descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
	if (descriptor) return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call(descriptor.get, receiver);
	if (isObject$2(prototype = getPrototypeOf(target))) return get$4(prototype, propertyKey, receiver);
}
$$4({
	target: "Reflect",
	stat: true
}, { get: get$4 });
var path$4 = path$y;
var get$3 = path$4.Reflect.get;
var parent$a = get$3;
var get$2 = parent$a;
var parent$9 = get$2;
var get$1 = parent$9;
var parent$8 = get$1;
var get = parent$8;
(function(module) {
	module.exports = get;
})(get$5);
(function(module) {
	module.exports = getExports;
})(get$6);
var _Reflect$get = /* @__PURE__ */ getDefaultExportFromCjs(getExports$1);
var getOwnPropertyDescriptorExports$1 = {};
var getOwnPropertyDescriptor$3 = {
	get exports() {
		return getOwnPropertyDescriptorExports$1;
	},
	set exports(v) {
		getOwnPropertyDescriptorExports$1 = v;
	}
};
var getOwnPropertyDescriptorExports = {};
var getOwnPropertyDescriptor$2 = {
	get exports() {
		return getOwnPropertyDescriptorExports;
	},
	set exports(v) {
		getOwnPropertyDescriptorExports = v;
	}
};
var parent$7 = getOwnPropertyDescriptor$5;
var getOwnPropertyDescriptor$1 = parent$7;
var parent$6 = getOwnPropertyDescriptor$1;
var getOwnPropertyDescriptor = parent$6;
(function(module) {
	module.exports = getOwnPropertyDescriptor;
})(getOwnPropertyDescriptor$2);
(function(module) {
	module.exports = getOwnPropertyDescriptorExports;
})(getOwnPropertyDescriptor$3);
var _Object$getOwnPropertyDescriptor = /* @__PURE__ */ getDefaultExportFromCjs(getOwnPropertyDescriptorExports$1);
function _superPropBase(object$1, property) {
	while (!Object.prototype.hasOwnProperty.call(object$1, property)) {
		object$1 = _getPrototypeOf(object$1);
		if (object$1 === null) break;
	}
	return object$1;
}
function _get() {
	if (typeof Reflect !== "undefined" && _Reflect$get) {
		var _context;
		_get = _bindInstanceProperty(_context = _Reflect$get).call(_context);
	} else _get = function _get$1(target, property, receiver) {
		var base = _superPropBase(target, property);
		if (!base) return;
		var desc = _Object$getOwnPropertyDescriptor(base, property);
		if (desc.get) return desc.get.call(arguments.length < 3 ? target : receiver);
		return desc.value;
	};
	return _get.apply(this, arguments);
}
var hypotExports = {};
var hypot$2 = {
	get exports() {
		return hypotExports;
	},
	set exports(v) {
		hypotExports = v;
	}
};
var $$3 = _export;
var $hypot = Math.hypot;
var abs = Math.abs;
var sqrt = Math.sqrt;
var FORCED$2 = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
$$3({
	target: "Math",
	stat: true,
	arity: 2,
	forced: FORCED$2
}, { hypot: function hypot$3(value1, value2) {
	var sum = 0;
	var i$2 = 0;
	var aLen = arguments.length;
	var larg = 0;
	var arg, div;
	while (i$2 < aLen) {
		arg = abs(arguments[i$2++]);
		if (larg < arg) {
			div = larg / arg;
			sum = sum * div * div + 1;
			larg = arg;
		} else if (arg > 0) {
			div = arg / larg;
			sum += div * div;
		} else sum += arg;
	}
	return larg === Infinity ? Infinity : larg * sqrt(sum);
} });
var path$3 = path$y;
var hypot$1 = path$3.Math.hypot;
var parent$5 = hypot$1;
var hypot = parent$5;
(function(module) {
	module.exports = hypot;
})(hypot$2);
var _Math$hypot = /* @__PURE__ */ getDefaultExportFromCjs(hypotExports);
function _createSuper$a(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$a() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* Common methods for endpoints

*

* @class

*/
var EndPoint = /* @__PURE__ */ function() {
	function EndPoint$1() {
		_classCallCheck(this, EndPoint$1);
	}
	_createClass(EndPoint$1, null, [{
		key: "transform",
		value: function transform(points, arrowData) {
			if (!_Array$isArray(points)) points = [points];
			var x = arrowData.point.x;
			var y = arrowData.point.y;
			var angle = arrowData.angle;
			var length$1 = arrowData.length;
			for (var i$2 = 0; i$2 < points.length; ++i$2) {
				var p = points[i$2];
				var xt = p.x * Math.cos(angle) - p.y * Math.sin(angle);
				var yt = p.x * Math.sin(angle) + p.y * Math.cos(angle);
				p.x = x + length$1 * xt;
				p.y = y + length$1 * yt;
			}
		}
	}, {
		key: "drawPath",
		value: function drawPath(ctx, points) {
			ctx.beginPath();
			ctx.moveTo(points[0].x, points[0].y);
			for (var i$2 = 1; i$2 < points.length; ++i$2) ctx.lineTo(points[i$2].x, points[i$2].y);
			ctx.closePath();
		}
	}]);
	return EndPoint$1;
}();
/**

* Drawing methods for the arrow endpoint.

*/
var Image$1 = /* @__PURE__ */ function(_EndPoint) {
	_inherits(Image$3, _EndPoint);
	var _super = _createSuper$a(Image$3);
	function Image$3() {
		_classCallCheck(this, Image$3);
		return _super.apply(this, arguments);
	}
	_createClass(Image$3, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			if (arrowData.image) {
				ctx.save();
				ctx.translate(arrowData.point.x, arrowData.point.y);
				ctx.rotate(Math.PI / 2 + arrowData.angle);
				var width = arrowData.imageWidth != null ? arrowData.imageWidth : arrowData.image.width;
				var height = arrowData.imageHeight != null ? arrowData.imageHeight : arrowData.image.height;
				arrowData.image.drawImageAtPosition(
					ctx,
					1,
					// scale
					-width / 2,
					// x
					0,
					// y
					width,
					height
);
				ctx.restore();
			}
			return false;
		}
	}]);
	return Image$3;
}(EndPoint);
/**

* Drawing methods for the arrow endpoint.

*/
var Arrow = /* @__PURE__ */ function(_EndPoint2) {
	_inherits(Arrow$1, _EndPoint2);
	var _super2 = _createSuper$a(Arrow$1);
	function Arrow$1() {
		_classCallCheck(this, Arrow$1);
		return _super2.apply(this, arguments);
	}
	_createClass(Arrow$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: 0,
					y: 0
				},
				{
					x: -1,
					y: .3
				},
				{
					x: -.9,
					y: 0
				},
				{
					x: -1,
					y: -.3
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Arrow$1;
}(EndPoint);
/**

* Drawing methods for the crow endpoint.

*/
var Crow = /* @__PURE__ */ function() {
	function Crow$1() {
		_classCallCheck(this, Crow$1);
	}
	_createClass(Crow$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: -1,
					y: 0
				},
				{
					x: 0,
					y: .3
				},
				{
					x: -.4,
					y: 0
				},
				{
					x: 0,
					y: -.3
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Crow$1;
}();
/**

* Drawing methods for the curve endpoint.

*/
var Curve = /* @__PURE__ */ function() {
	function Curve$1() {
		_classCallCheck(this, Curve$1);
	}
	_createClass(Curve$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var point = {
				x: -.4,
				y: 0
			};
			EndPoint.transform(point, arrowData);
			ctx.strokeStyle = ctx.fillStyle;
			ctx.fillStyle = "rgba(0, 0, 0, 0)";
			var pi = Math.PI;
			var startAngle = arrowData.angle - pi / 2;
			var endAngle = arrowData.angle + pi / 2;
			ctx.beginPath();
			ctx.arc(point.x, point.y, arrowData.length * .4, startAngle, endAngle, false);
			ctx.stroke();
			return true;
		}
	}]);
	return Curve$1;
}();
/**

* Drawing methods for the inverted curve endpoint.

*/
var InvertedCurve = /* @__PURE__ */ function() {
	function InvertedCurve$1() {
		_classCallCheck(this, InvertedCurve$1);
	}
	_createClass(InvertedCurve$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var point = {
				x: -.3,
				y: 0
			};
			EndPoint.transform(point, arrowData);
			ctx.strokeStyle = ctx.fillStyle;
			ctx.fillStyle = "rgba(0, 0, 0, 0)";
			var pi = Math.PI;
			var startAngle = arrowData.angle + pi / 2;
			var endAngle = arrowData.angle + 3 * pi / 2;
			ctx.beginPath();
			ctx.arc(point.x, point.y, arrowData.length * .4, startAngle, endAngle, false);
			ctx.stroke();
			return true;
		}
	}]);
	return InvertedCurve$1;
}();
/**

* Drawing methods for the trinagle endpoint.

*/
var Triangle = /* @__PURE__ */ function() {
	function Triangle$2() {
		_classCallCheck(this, Triangle$2);
	}
	_createClass(Triangle$2, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: .02,
					y: 0
				},
				{
					x: -1,
					y: .3
				},
				{
					x: -1,
					y: -.3
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Triangle$2;
}();
/**

* Drawing methods for the inverted trinagle endpoint.

*/
var InvertedTriangle = /* @__PURE__ */ function() {
	function InvertedTriangle$1() {
		_classCallCheck(this, InvertedTriangle$1);
	}
	_createClass(InvertedTriangle$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: 0,
					y: .3
				},
				{
					x: 0,
					y: -.3
				},
				{
					x: -1,
					y: 0
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return InvertedTriangle$1;
}();
/**

* Drawing methods for the circle endpoint.

*/
var Circle = /* @__PURE__ */ function() {
	function Circle$2() {
		_classCallCheck(this, Circle$2);
	}
	_createClass(Circle$2, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var point = {
				x: -.4,
				y: 0
			};
			EndPoint.transform(point, arrowData);
			drawCircle(ctx, point.x, point.y, arrowData.length * .4);
			return true;
		}
	}]);
	return Circle$2;
}();
/**

* Drawing methods for the bar endpoint.

*/
var Bar = /* @__PURE__ */ function() {
	function Bar$1() {
		_classCallCheck(this, Bar$1);
	}
	_createClass(Bar$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: 0,
					y: .5
				},
				{
					x: 0,
					y: -.5
				},
				{
					x: -.15,
					y: -.5
				},
				{
					x: -.15,
					y: .5
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Bar$1;
}();
/**

* Drawing methods for the box endpoint.

*/
var Box = /* @__PURE__ */ function() {
	function Box$2() {
		_classCallCheck(this, Box$2);
	}
	_createClass(Box$2, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: 0,
					y: .3
				},
				{
					x: 0,
					y: -.3
				},
				{
					x: -.6,
					y: -.3
				},
				{
					x: -.6,
					y: .3
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Box$2;
}();
/**

* Drawing methods for the diamond endpoint.

*/
var Diamond = /* @__PURE__ */ function() {
	function Diamond$2() {
		_classCallCheck(this, Diamond$2);
	}
	_createClass(Diamond$2, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: 0,
					y: 0
				},
				{
					x: -.5,
					y: -.3
				},
				{
					x: -1,
					y: 0
				},
				{
					x: -.5,
					y: .3
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Diamond$2;
}();
/**

* Drawing methods for the vee endpoint.

*/
var Vee = /* @__PURE__ */ function() {
	function Vee$1() {
		_classCallCheck(this, Vee$1);
	}
	_createClass(Vee$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var points = [
				{
					x: -1,
					y: .3
				},
				{
					x: -.5,
					y: 0
				},
				{
					x: -1,
					y: -.3
				},
				{
					x: 0,
					y: 0
				}
			];
			EndPoint.transform(points, arrowData);
			EndPoint.drawPath(ctx, points);
			return true;
		}
	}]);
	return Vee$1;
}();
/**

* Drawing methods for the endpoints.

*/
var EndPoints = /* @__PURE__ */ function() {
	function EndPoints$1() {
		_classCallCheck(this, EndPoints$1);
	}
	_createClass(EndPoints$1, null, [{
		key: "draw",
		value: function draw(ctx, arrowData) {
			var type;
			if (arrowData.type) type = arrowData.type.toLowerCase();
			switch (type) {
				case "image": return Image$1.draw(ctx, arrowData);
				case "circle": return Circle.draw(ctx, arrowData);
				case "box": return Box.draw(ctx, arrowData);
				case "crow": return Crow.draw(ctx, arrowData);
				case "curve": return Curve.draw(ctx, arrowData);
				case "diamond": return Diamond.draw(ctx, arrowData);
				case "inv_curve": return InvertedCurve.draw(ctx, arrowData);
				case "triangle": return Triangle.draw(ctx, arrowData);
				case "inv_triangle": return InvertedTriangle.draw(ctx, arrowData);
				case "bar": return Bar.draw(ctx, arrowData);
				case "vee": return Vee.draw(ctx, arrowData);
				case "arrow":
				default: return Arrow.draw(ctx, arrowData);
			}
		}
	}]);
	return EndPoints$1;
}();
function ownKeys$1(object$1, enumerableOnly) {
	var keys$9 = _Object$keys(object$1);
	if (_Object$getOwnPropertySymbols) {
		var symbols = _Object$getOwnPropertySymbols(object$1);
		enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function(sym) {
			return _Object$getOwnPropertyDescriptor$1(object$1, sym).enumerable;
		})), keys$9.push.apply(keys$9, symbols);
	}
	return keys$9;
}
function _objectSpread$1(target) {
	for (var i$2 = 1; i$2 < arguments.length; i$2++) {
		var _context2, _context3;
		var source = null != arguments[i$2] ? arguments[i$2] : {};
		i$2 % 2 ? _forEachInstanceProperty(_context2 = ownKeys$1(Object(source), !0)).call(_context2, function(key) {
			_defineProperty(target, key, source[key]);
		}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys$1(Object(source))).call(_context3, function(key) {
			_Object$defineProperty$1(target, key, _Object$getOwnPropertyDescriptor$1(source, key));
		});
	}
	return target;
}
/**

* The Base Class for all edges.

*/
var EdgeBase = /* @__PURE__ */ function() {
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param _body - The body of the network.
	
	* @param _labelModule - Label module.
	
	*/
	function EdgeBase$1(options, _body, _labelModule) {
		_classCallCheck(this, EdgeBase$1);
		this._body = _body;
		this._labelModule = _labelModule;
		this.color = {};
		this.colorDirty = true;
		this.hoverWidth = 1.5;
		this.selectionWidth = 2;
		this.setOptions(options);
		this.fromPoint = this.from;
		this.toPoint = this.to;
	}
	/** @inheritDoc */
	_createClass(EdgeBase$1, [
		{
			key: "connect",
			value: function connect() {
				this.from = this._body.nodes[this.options.from];
				this.to = this._body.nodes[this.options.to];
			}
		},
		{
			key: "cleanup",
			value: function cleanup() {
				return false;
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.options = options;
				this.from = this._body.nodes[this.options.from];
				this.to = this._body.nodes[this.options.to];
				this.id = this.options.id;
			}
		},
		{
			key: "drawLine",
			value: function drawLine(ctx, values$8, _selected, _hover) {
				var viaNode = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.getViaNode();
				ctx.strokeStyle = this.getColor(ctx, values$8);
				ctx.lineWidth = values$8.width;
				if (values$8.dashes !== false) this._drawDashedLine(ctx, values$8, viaNode);
				else this._drawLine(ctx, values$8, viaNode);
			}
		},
		{
			key: "_drawLine",
			value: function _drawLine(ctx, values$8, viaNode, fromPoint, toPoint) {
				if (this.from != this.to) this._line(ctx, values$8, viaNode, fromPoint, toPoint);
				else {
					var _this$_getCircleData = this._getCircleData(ctx), _this$_getCircleData2 = _slicedToArray(_this$_getCircleData, 3), x = _this$_getCircleData2[0], y = _this$_getCircleData2[1], radius = _this$_getCircleData2[2];
					this._circle(ctx, values$8, x, y, radius);
				}
			}
		},
		{
			key: "_drawDashedLine",
			value: function _drawDashedLine(ctx, values$8, viaNode, _fromPoint, _toPoint) {
				ctx.lineCap = "round";
				var pattern = _Array$isArray(values$8.dashes) ? values$8.dashes : [5, 5];
				if (ctx.setLineDash !== void 0) {
					ctx.save();
					ctx.setLineDash(pattern);
					ctx.lineDashOffset = 0;
					if (this.from != this.to) this._line(ctx, values$8, viaNode);
					else {
						var _this$_getCircleData3 = this._getCircleData(ctx), _this$_getCircleData4 = _slicedToArray(_this$_getCircleData3, 3), x = _this$_getCircleData4[0], y = _this$_getCircleData4[1], radius = _this$_getCircleData4[2];
						this._circle(ctx, values$8, x, y, radius);
					}
					ctx.setLineDash([0]);
					ctx.lineDashOffset = 0;
					ctx.restore();
				} else {
					if (this.from != this.to) drawDashedLine(ctx, this.from.x, this.from.y, this.to.x, this.to.y, pattern);
					else {
						var _this$_getCircleData5 = this._getCircleData(ctx), _this$_getCircleData6 = _slicedToArray(_this$_getCircleData5, 3), _x = _this$_getCircleData6[0], _y = _this$_getCircleData6[1], _radius = _this$_getCircleData6[2];
						this._circle(ctx, values$8, _x, _y, _radius);
					}
					this.enableShadow(ctx, values$8);
					ctx.stroke();
					this.disableShadow(ctx, values$8);
				}
			}
		},
		{
			key: "findBorderPosition",
			value: function findBorderPosition(node$1, ctx, options) {
				if (this.from != this.to) return this._findBorderPosition(node$1, ctx, options);
				else return this._findBorderPositionCircle(node$1, ctx, options);
			}
		},
		{
			key: "findBorderPositions",
			value: function findBorderPositions(ctx) {
				if (this.from != this.to) return {
					from: this._findBorderPosition(this.from, ctx),
					to: this._findBorderPosition(this.to, ctx)
				};
				else {
					var _context;
					var _this$_getCircleData$ = _sliceInstanceProperty(_context = this._getCircleData(ctx)).call(_context, 0, 2), _this$_getCircleData$2 = _slicedToArray(_this$_getCircleData$, 2), x = _this$_getCircleData$2[0], y = _this$_getCircleData$2[1];
					return {
						from: this._findBorderPositionCircle(this.from, ctx, {
							x,
							y,
							low: .25,
							high: .6,
							direction: -1
						}),
						to: this._findBorderPositionCircle(this.from, ctx, {
							x,
							y,
							low: .6,
							high: .8,
							direction: 1
						})
					};
				}
			}
		},
		{
			key: "_getCircleData",
			value: function _getCircleData(ctx) {
				var radius = this.options.selfReference.size;
				if (ctx !== void 0) {
					if (this.from.shape.width === void 0) this.from.shape.resize(ctx);
				}
				var coordinates = getSelfRefCoordinates(ctx, this.options.selfReference.angle, radius, this.from);
				return [
					coordinates.x,
					coordinates.y,
					radius
				];
			}
		},
		{
			key: "_pointOnCircle",
			value: function _pointOnCircle(x, y, radius, position) {
				var angle = position * 2 * Math.PI;
				return {
					x: x + radius * Math.cos(angle),
					y: y - radius * Math.sin(angle)
				};
			}
		},
		{
			key: "_findBorderPositionCircle",
			value: function _findBorderPositionCircle(nearNode, ctx, options) {
				var x = options.x;
				var y = options.y;
				var low$2 = options.low;
				var high = options.high;
				var direction = options.direction;
				var maxIterations = 10;
				var radius = this.options.selfReference.size;
				var threshold = .05;
				var pos;
				var middle = (low$2 + high) * .5;
				var endPointOffset = 0;
				if (this.options.arrowStrikethrough === true) {
					if (direction === -1) endPointOffset = this.options.endPointOffset.from;
					else if (direction === 1) endPointOffset = this.options.endPointOffset.to;
				}
				var iteration = 0;
				do {
					middle = (low$2 + high) * .5;
					pos = this._pointOnCircle(x, y, radius, middle);
					var angle = Math.atan2(nearNode.y - pos.y, nearNode.x - pos.x);
					var distanceToBorder = nearNode.distanceToBorder(ctx, angle) + endPointOffset;
					var distanceToPoint = Math.sqrt(Math.pow(pos.x - nearNode.x, 2) + Math.pow(pos.y - nearNode.y, 2));
					var difference = distanceToBorder - distanceToPoint;
					if (Math.abs(difference) < threshold) break;
					else if (difference > 0) if (direction > 0) low$2 = middle;
					else high = middle;
					else if (direction > 0) high = middle;
					else low$2 = middle;
					++iteration;
				} while (low$2 <= high && iteration < maxIterations);
				return _objectSpread$1(_objectSpread$1({}, pos), {}, { t: middle });
			}
		},
		{
			key: "getLineWidth",
			value: function getLineWidth(selected, hover) {
				if (selected === true) return Math.max(this.selectionWidth, .3 / this._body.view.scale);
				else if (hover === true) return Math.max(this.hoverWidth, .3 / this._body.view.scale);
				else return Math.max(this.options.width, .3 / this._body.view.scale);
			}
		},
		{
			key: "getColor",
			value: function getColor(ctx, values$8) {
				if (values$8.inheritsColor !== false) {
					if (values$8.inheritsColor === "both" && this.from.id !== this.to.id) {
						var grd = ctx.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y);
						var fromColor = this.from.options.color.highlight.border;
						var toColor = this.to.options.color.highlight.border;
						if (this.from.selected === false && this.to.selected === false) {
							fromColor = overrideOpacity(this.from.options.color.border, values$8.opacity);
							toColor = overrideOpacity(this.to.options.color.border, values$8.opacity);
						} else if (this.from.selected === true && this.to.selected === false) toColor = this.to.options.color.border;
						else if (this.from.selected === false && this.to.selected === true) fromColor = this.from.options.color.border;
						grd.addColorStop(0, fromColor);
						grd.addColorStop(1, toColor);
						return grd;
					}
					if (values$8.inheritsColor === "to") return overrideOpacity(this.to.options.color.border, values$8.opacity);
					else return overrideOpacity(this.from.options.color.border, values$8.opacity);
				} else return overrideOpacity(values$8.color, values$8.opacity);
			}
		},
		{
			key: "_circle",
			value: function _circle(ctx, values$8, x, y, radius) {
				this.enableShadow(ctx, values$8);
				var angleFrom = 0;
				var angleTo = Math.PI * 2;
				if (!this.options.selfReference.renderBehindTheNode) {
					var low$2 = this.options.selfReference.angle;
					var high = this.options.selfReference.angle + Math.PI;
					var pointTFrom = this._findBorderPositionCircle(this.from, ctx, {
						x,
						y,
						low: low$2,
						high,
						direction: -1
					});
					var pointTTo = this._findBorderPositionCircle(this.from, ctx, {
						x,
						y,
						low: low$2,
						high,
						direction: 1
					});
					angleFrom = Math.atan2(pointTFrom.y - y, pointTFrom.x - x);
					angleTo = Math.atan2(pointTTo.y - y, pointTTo.x - x);
				}
				ctx.beginPath();
				ctx.arc(x, y, radius, angleFrom, angleTo, false);
				ctx.stroke();
				this.disableShadow(ctx, values$8);
			}
		},
		{
			key: "getDistanceToEdge",
			value: function getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
				if (this.from != this.to) return this._getDistanceToEdge(x1, y1, x2, y2, x3, y3);
				else {
					var _this$_getCircleData7 = this._getCircleData(void 0), _this$_getCircleData8 = _slicedToArray(_this$_getCircleData7, 3), x = _this$_getCircleData8[0], y = _this$_getCircleData8[1], radius = _this$_getCircleData8[2];
					var dx = x - x3;
					var dy = y - y3;
					return Math.abs(Math.sqrt(dx * dx + dy * dy) - radius);
				}
			}
		},
		{
			key: "_getDistanceToLine",
			value: function _getDistanceToLine(x1, y1, x2, y2, x3, y3) {
				var px = x2 - x1;
				var py = y2 - y1;
				var something = px * px + py * py;
				var u = ((x3 - x1) * px + (y3 - y1) * py) / something;
				if (u > 1) u = 1;
				else if (u < 0) u = 0;
				var x = x1 + u * px;
				var y = y1 + u * py;
				var dx = x - x3;
				var dy = y - y3;
				return Math.sqrt(dx * dx + dy * dy);
			}
		},
		{
			key: "getArrowData",
			value: function getArrowData(ctx, position, viaNode, _selected, _hover, values$8) {
				var angle;
				var arrowPoint;
				var node1;
				var node2;
				var reversed;
				var scaleFactor;
				var type;
				var lineWidth = values$8.width;
				if (position === "from") {
					node1 = this.from;
					node2 = this.to;
					reversed = values$8.fromArrowScale < 0;
					scaleFactor = Math.abs(values$8.fromArrowScale);
					type = values$8.fromArrowType;
				} else if (position === "to") {
					node1 = this.to;
					node2 = this.from;
					reversed = values$8.toArrowScale < 0;
					scaleFactor = Math.abs(values$8.toArrowScale);
					type = values$8.toArrowType;
				} else {
					node1 = this.to;
					node2 = this.from;
					reversed = values$8.middleArrowScale < 0;
					scaleFactor = Math.abs(values$8.middleArrowScale);
					type = values$8.middleArrowType;
				}
				var length$1 = 15 * scaleFactor + 3 * lineWidth;
				if (node1 != node2) {
					var approximateEdgeLength = _Math$hypot(node1.x - node2.x, node1.y - node2.y);
					var relativeLength = length$1 / approximateEdgeLength;
					if (position !== "middle") if (this.options.smooth.enabled === true) {
						var pointT = this._findBorderPosition(node1, ctx, { via: viaNode });
						var guidePos = this.getPoint(pointT.t + relativeLength * (position === "from" ? 1 : -1), viaNode);
						angle = Math.atan2(pointT.y - guidePos.y, pointT.x - guidePos.x);
						arrowPoint = pointT;
					} else {
						angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
						arrowPoint = this._findBorderPosition(node1, ctx);
					}
					else {
						var halfLength = (reversed ? -relativeLength : relativeLength) / 2;
						var guidePos1 = this.getPoint(.5 + halfLength, viaNode);
						var guidePos2 = this.getPoint(.5 - halfLength, viaNode);
						angle = Math.atan2(guidePos1.y - guidePos2.y, guidePos1.x - guidePos2.x);
						arrowPoint = this.getPoint(.5, viaNode);
					}
				} else {
					var _this$_getCircleData9 = this._getCircleData(ctx), _this$_getCircleData10 = _slicedToArray(_this$_getCircleData9, 3), x = _this$_getCircleData10[0], y = _this$_getCircleData10[1], radius = _this$_getCircleData10[2];
					if (position === "from") {
						var low$2 = this.options.selfReference.angle;
						var high = this.options.selfReference.angle + Math.PI;
						var _pointT = this._findBorderPositionCircle(this.from, ctx, {
							x,
							y,
							low: low$2,
							high,
							direction: -1
						});
						angle = _pointT.t * -2 * Math.PI + 1.5 * Math.PI + .1 * Math.PI;
						arrowPoint = _pointT;
					} else if (position === "to") {
						var _low = this.options.selfReference.angle;
						var _high = this.options.selfReference.angle + Math.PI;
						var _pointT2 = this._findBorderPositionCircle(this.from, ctx, {
							x,
							y,
							low: _low,
							high: _high,
							direction: 1
						});
						angle = _pointT2.t * -2 * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI;
						arrowPoint = _pointT2;
					} else {
						var pos = this.options.selfReference.angle / (2 * Math.PI);
						arrowPoint = this._pointOnCircle(x, y, radius, pos);
						angle = pos * -2 * Math.PI + 1.5 * Math.PI + .1 * Math.PI;
					}
				}
				var xi = arrowPoint.x - length$1 * .9 * Math.cos(angle);
				var yi = arrowPoint.y - length$1 * .9 * Math.sin(angle);
				var arrowCore = {
					x: xi,
					y: yi
				};
				return {
					point: arrowPoint,
					core: arrowCore,
					angle,
					length: length$1,
					type
				};
			}
		},
		{
			key: "drawArrowHead",
			value: function drawArrowHead(ctx, values$8, _selected, _hover, arrowData) {
				ctx.strokeStyle = this.getColor(ctx, values$8);
				ctx.fillStyle = ctx.strokeStyle;
				ctx.lineWidth = values$8.width;
				var canFill = EndPoints.draw(ctx, arrowData);
				if (canFill) {
					this.enableShadow(ctx, values$8);
					_fillInstanceProperty(ctx).call(ctx);
					this.disableShadow(ctx, values$8);
				}
			}
		},
		{
			key: "enableShadow",
			value: function enableShadow(ctx, values$8) {
				if (values$8.shadow === true) {
					ctx.shadowColor = values$8.shadowColor;
					ctx.shadowBlur = values$8.shadowSize;
					ctx.shadowOffsetX = values$8.shadowX;
					ctx.shadowOffsetY = values$8.shadowY;
				}
			}
		},
		{
			key: "disableShadow",
			value: function disableShadow(ctx, values$8) {
				if (values$8.shadow === true) {
					ctx.shadowColor = "rgba(0,0,0,0)";
					ctx.shadowBlur = 0;
					ctx.shadowOffsetX = 0;
					ctx.shadowOffsetY = 0;
				}
			}
		},
		{
			key: "drawBackground",
			value: function drawBackground(ctx, values$8) {
				if (values$8.background !== false) {
					var origCtxAttr = {
						strokeStyle: ctx.strokeStyle,
						lineWidth: ctx.lineWidth,
						dashes: ctx.dashes
					};
					ctx.strokeStyle = values$8.backgroundColor;
					ctx.lineWidth = values$8.backgroundSize;
					this.setStrokeDashed(ctx, values$8.backgroundDashes);
					ctx.stroke();
					ctx.strokeStyle = origCtxAttr.strokeStyle;
					ctx.lineWidth = origCtxAttr.lineWidth;
					ctx.dashes = origCtxAttr.dashes;
					this.setStrokeDashed(ctx, values$8.dashes);
				}
			}
		},
		{
			key: "setStrokeDashed",
			value: function setStrokeDashed(ctx, dashes) {
				if (dashes !== false) if (ctx.setLineDash !== void 0) {
					var pattern = _Array$isArray(dashes) ? dashes : [5, 5];
					ctx.setLineDash(pattern);
				} else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");
				else if (ctx.setLineDash !== void 0) ctx.setLineDash([]);
				else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.");
			}
		}
	]);
	return EdgeBase$1;
}();
function ownKeys(object$1, enumerableOnly) {
	var keys$9 = _Object$keys(object$1);
	if (_Object$getOwnPropertySymbols) {
		var symbols = _Object$getOwnPropertySymbols(object$1);
		enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function(sym) {
			return _Object$getOwnPropertyDescriptor$1(object$1, sym).enumerable;
		})), keys$9.push.apply(keys$9, symbols);
	}
	return keys$9;
}
function _objectSpread(target) {
	for (var i$2 = 1; i$2 < arguments.length; i$2++) {
		var _context, _context2;
		var source = null != arguments[i$2] ? arguments[i$2] : {};
		i$2 % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function(key) {
			_defineProperty(target, key, source[key]);
		}) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function(key) {
			_Object$defineProperty$1(target, key, _Object$getOwnPropertyDescriptor$1(source, key));
		});
	}
	return target;
}
function _createSuper$9(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$9();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$9() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* The Base Class for all Bezier edges.

* Bezier curves are used to model smooth gradual curves in paths between nodes.

*/
var BezierEdgeBase = /* @__PURE__ */ function(_EdgeBase) {
	_inherits(BezierEdgeBase$1, _EdgeBase);
	var _super = _createSuper$9(BezierEdgeBase$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function BezierEdgeBase$1(options, body, labelModule) {
		_classCallCheck(this, BezierEdgeBase$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	
	* Find the intersection between the border of the node and the edge.
	
	*
	
	* @remarks
	
	* This function uses binary search to look for the point where the bezier curve crosses the border of the node.
	
	* @param nearNode - The node (either from or to node of the edge).
	
	* @param ctx - The context that will be used for rendering.
	
	* @param viaNode - Additional node(s) the edge passes through.
	
	* @returns Cartesian coordinates of the intersection between the border of the node and the edge.
	
	*/
	_createClass(BezierEdgeBase$1, [
		{
			key: "_findBorderPositionBezier",
			value: function _findBorderPositionBezier(nearNode, ctx) {
				var viaNode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this._getViaCoordinates();
				var maxIterations = 10;
				var threshold = .2;
				var from$9 = false;
				var high = 1;
				var low$2 = 0;
				var node$1 = this.to;
				var pos;
				var middle;
				var endPointOffset = this.options.endPointOffset ? this.options.endPointOffset.to : 0;
				if (nearNode.id === this.from.id) {
					node$1 = this.from;
					from$9 = true;
					endPointOffset = this.options.endPointOffset ? this.options.endPointOffset.from : 0;
				}
				if (this.options.arrowStrikethrough === false) endPointOffset = 0;
				var iteration = 0;
				do {
					middle = (low$2 + high) * .5;
					pos = this.getPoint(middle, viaNode);
					var angle = Math.atan2(node$1.y - pos.y, node$1.x - pos.x);
					var distanceToBorder = node$1.distanceToBorder(ctx, angle) + endPointOffset;
					var distanceToPoint = Math.sqrt(Math.pow(pos.x - node$1.x, 2) + Math.pow(pos.y - node$1.y, 2));
					var difference = distanceToBorder - distanceToPoint;
					if (Math.abs(difference) < threshold) break;
					else if (difference < 0) if (from$9 === false) low$2 = middle;
					else high = middle;
					else if (from$9 === false) high = middle;
					else low$2 = middle;
					++iteration;
				} while (low$2 <= high && iteration < maxIterations);
				return _objectSpread(_objectSpread({}, pos), {}, { t: middle });
			}
		},
		{
			key: "_getDistanceToBezierEdge",
			value: function _getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, via) {
				var minDistance = 1e9;
				var distance;
				var i$2, t, x, y;
				var lastX = x1;
				var lastY = y1;
				for (i$2 = 1; i$2 < 10; i$2++) {
					t = .1 * i$2;
					x = Math.pow(1 - t, 2) * x1 + 2 * t * (1 - t) * via.x + Math.pow(t, 2) * x2;
					y = Math.pow(1 - t, 2) * y1 + 2 * t * (1 - t) * via.y + Math.pow(t, 2) * y2;
					if (i$2 > 0) {
						distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
						minDistance = distance < minDistance ? distance : minDistance;
					}
					lastX = x;
					lastY = y;
				}
				return minDistance;
			}
		},
		{
			key: "_bezierCurve",
			value: function _bezierCurve(ctx, values$8, viaNode1, viaNode2) {
				ctx.beginPath();
				ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
				if (viaNode1 != null && viaNode1.x != null) if (viaNode2 != null && viaNode2.x != null) ctx.bezierCurveTo(viaNode1.x, viaNode1.y, viaNode2.x, viaNode2.y, this.toPoint.x, this.toPoint.y);
				else ctx.quadraticCurveTo(viaNode1.x, viaNode1.y, this.toPoint.x, this.toPoint.y);
				else ctx.lineTo(this.toPoint.x, this.toPoint.y);
				this.drawBackground(ctx, values$8);
				this.enableShadow(ctx, values$8);
				ctx.stroke();
				this.disableShadow(ctx, values$8);
			}
		},
		{
			key: "getViaNode",
			value: function getViaNode() {
				return this._getViaCoordinates();
			}
		}
	]);
	return BezierEdgeBase$1;
}(EdgeBase);
function _createSuper$8(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$8();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$8() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* A Dynamic Bezier Edge. Bezier curves are used to model smooth gradual

* curves in paths between nodes. The Dynamic piece refers to how the curve

* reacts to physics changes.

*

* @augments BezierEdgeBase

*/
var BezierEdgeDynamic = /* @__PURE__ */ function(_BezierEdgeBase) {
	_inherits(BezierEdgeDynamic$1, _BezierEdgeBase);
	var _super = _createSuper$8(BezierEdgeDynamic$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function BezierEdgeDynamic$1(options, body, labelModule) {
		var _this;
		_classCallCheck(this, BezierEdgeDynamic$1);
		_this = _super.call(this, options, body, labelModule);
		_this.via = _this.via;
		_this._boundFunction = function() {
			_this.positionBezierNode();
		};
		_this._body.emitter.on("_repositionBezierNodes", _this._boundFunction);
		return _this;
	}
	/** @inheritDoc */
	_createClass(BezierEdgeDynamic$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				_get(_getPrototypeOf(BezierEdgeDynamic$1.prototype), "setOptions", this).call(this, options);
				var physicsChange = false;
				if (this.options.physics !== options.physics) physicsChange = true;
				this.options = options;
				this.id = this.options.id;
				this.from = this._body.nodes[this.options.from];
				this.to = this._body.nodes[this.options.to];
				this.setupSupportNode();
				this.connect();
				if (physicsChange === true) {
					this.via.setOptions({ physics: this.options.physics });
					this.positionBezierNode();
				}
			}
		},
		{
			key: "connect",
			value: function connect() {
				this.from = this._body.nodes[this.options.from];
				this.to = this._body.nodes[this.options.to];
				if (this.from === void 0 || this.to === void 0 || this.options.physics === false) this.via.setOptions({ physics: false });
				else if (this.from.id === this.to.id) this.via.setOptions({ physics: false });
				else this.via.setOptions({ physics: true });
			}
		},
		{
			key: "cleanup",
			value: function cleanup() {
				this._body.emitter.off("_repositionBezierNodes", this._boundFunction);
				if (this.via !== void 0) {
					delete this._body.nodes[this.via.id];
					this.via = void 0;
					return true;
				}
				return false;
			}
		},
		{
			key: "setupSupportNode",
			value: function setupSupportNode() {
				if (this.via === void 0) {
					var nodeId = "edgeId:" + this.id;
					var node$1 = this._body.functions.createNode({
						id: nodeId,
						shape: "circle",
						physics: true,
						hidden: true
					});
					this._body.nodes[nodeId] = node$1;
					this.via = node$1;
					this.via.parentEdgeId = this.id;
					this.positionBezierNode();
				}
			}
		},
		{
			key: "positionBezierNode",
			value: function positionBezierNode() {
				if (this.via !== void 0 && this.from !== void 0 && this.to !== void 0) {
					this.via.x = .5 * (this.from.x + this.to.x);
					this.via.y = .5 * (this.from.y + this.to.y);
				} else if (this.via !== void 0) {
					this.via.x = 0;
					this.via.y = 0;
				}
			}
		},
		{
			key: "_line",
			value: function _line(ctx, values$8, viaNode) {
				this._bezierCurve(ctx, values$8, viaNode);
			}
		},
		{
			key: "_getViaCoordinates",
			value: function _getViaCoordinates() {
				return this.via;
			}
		},
		{
			key: "getViaNode",
			value: function getViaNode() {
				return this.via;
			}
		},
		{
			key: "getPoint",
			value: function getPoint(position) {
				var viaNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.via;
				if (this.from === this.to) {
					var _this$_getCircleData = this._getCircleData(), _this$_getCircleData2 = _slicedToArray(_this$_getCircleData, 3), cx = _this$_getCircleData2[0], cy = _this$_getCircleData2[1], cr = _this$_getCircleData2[2];
					var a = 2 * Math.PI * (1 - position);
					return {
						x: cx + cr * Math.sin(a),
						y: cy + cr - cr * (1 - Math.cos(a))
					};
				} else return {
					x: Math.pow(1 - position, 2) * this.fromPoint.x + 2 * position * (1 - position) * viaNode.x + Math.pow(position, 2) * this.toPoint.x,
					y: Math.pow(1 - position, 2) * this.fromPoint.y + 2 * position * (1 - position) * viaNode.y + Math.pow(position, 2) * this.toPoint.y
				};
			}
		},
		{
			key: "_findBorderPosition",
			value: function _findBorderPosition(nearNode, ctx) {
				return this._findBorderPositionBezier(nearNode, ctx, this.via);
			}
		},
		{
			key: "_getDistanceToEdge",
			value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
				return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, this.via);
			}
		}
	]);
	return BezierEdgeDynamic$1;
}(BezierEdgeBase);
function _createSuper$7(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$7();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$7() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* A Static Bezier Edge. Bezier curves are used to model smooth gradual curves in paths between nodes.

*/
var BezierEdgeStatic = /* @__PURE__ */ function(_BezierEdgeBase) {
	_inherits(BezierEdgeStatic$1, _BezierEdgeBase);
	var _super = _createSuper$7(BezierEdgeStatic$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function BezierEdgeStatic$1(options, body, labelModule) {
		_classCallCheck(this, BezierEdgeStatic$1);
		return _super.call(this, options, body, labelModule);
	}
	/** @inheritDoc */
	_createClass(BezierEdgeStatic$1, [
		{
			key: "_line",
			value: function _line(ctx, values$8, viaNode) {
				this._bezierCurve(ctx, values$8, viaNode);
			}
		},
		{
			key: "getViaNode",
			value: function getViaNode() {
				return this._getViaCoordinates();
			}
		},
		{
			key: "_getViaCoordinates",
			value: function _getViaCoordinates() {
				var factor = this.options.smooth.roundness;
				var type = this.options.smooth.type;
				var dx = Math.abs(this.from.x - this.to.x);
				var dy = Math.abs(this.from.y - this.to.y);
				if (type === "discrete" || type === "diagonalCross") {
					var stepX;
					var stepY;
					if (dx <= dy) stepX = stepY = factor * dy;
					else stepX = stepY = factor * dx;
					if (this.from.x > this.to.x) stepX = -stepX;
					if (this.from.y >= this.to.y) stepY = -stepY;
					var xVia = this.from.x + stepX;
					var yVia = this.from.y + stepY;
					if (type === "discrete") if (dx <= dy) xVia = dx < factor * dy ? this.from.x : xVia;
					else yVia = dy < factor * dx ? this.from.y : yVia;
					return {
						x: xVia,
						y: yVia
					};
				} else if (type === "straightCross") {
					var _stepX = (1 - factor) * dx;
					var _stepY = (1 - factor) * dy;
					if (dx <= dy) {
						_stepX = 0;
						if (this.from.y < this.to.y) _stepY = -_stepY;
					} else {
						if (this.from.x < this.to.x) _stepX = -_stepX;
						_stepY = 0;
					}
					return {
						x: this.to.x + _stepX,
						y: this.to.y + _stepY
					};
				} else if (type === "horizontal") {
					var _stepX2 = (1 - factor) * dx;
					if (this.from.x < this.to.x) _stepX2 = -_stepX2;
					return {
						x: this.to.x + _stepX2,
						y: this.from.y
					};
				} else if (type === "vertical") {
					var _stepY2 = (1 - factor) * dy;
					if (this.from.y < this.to.y) _stepY2 = -_stepY2;
					return {
						x: this.from.x,
						y: this.to.y + _stepY2
					};
				} else if (type === "curvedCW") {
					dx = this.to.x - this.from.x;
					dy = this.from.y - this.to.y;
					var radius = Math.sqrt(dx * dx + dy * dy);
					var pi = Math.PI;
					var originalAngle = Math.atan2(dy, dx);
					var myAngle = (originalAngle + (factor * .5 + .5) * pi) % (2 * pi);
					return {
						x: this.from.x + (factor * .5 + .5) * radius * Math.sin(myAngle),
						y: this.from.y + (factor * .5 + .5) * radius * Math.cos(myAngle)
					};
				} else if (type === "curvedCCW") {
					dx = this.to.x - this.from.x;
					dy = this.from.y - this.to.y;
					var _radius = Math.sqrt(dx * dx + dy * dy);
					var _pi = Math.PI;
					var _originalAngle = Math.atan2(dy, dx);
					var _myAngle = (_originalAngle + (-factor * .5 + .5) * _pi) % (2 * _pi);
					return {
						x: this.from.x + (factor * .5 + .5) * _radius * Math.sin(_myAngle),
						y: this.from.y + (factor * .5 + .5) * _radius * Math.cos(_myAngle)
					};
				} else {
					var _stepX3;
					var _stepY3;
					if (dx <= dy) _stepX3 = _stepY3 = factor * dy;
					else _stepX3 = _stepY3 = factor * dx;
					if (this.from.x > this.to.x) _stepX3 = -_stepX3;
					if (this.from.y >= this.to.y) _stepY3 = -_stepY3;
					var _xVia = this.from.x + _stepX3;
					var _yVia = this.from.y + _stepY3;
					if (dx <= dy) if (this.from.x <= this.to.x) _xVia = this.to.x < _xVia ? this.to.x : _xVia;
					else _xVia = this.to.x > _xVia ? this.to.x : _xVia;
					else if (this.from.y >= this.to.y) _yVia = this.to.y > _yVia ? this.to.y : _yVia;
					else _yVia = this.to.y < _yVia ? this.to.y : _yVia;
					return {
						x: _xVia,
						y: _yVia
					};
				}
			}
		},
		{
			key: "_findBorderPosition",
			value: function _findBorderPosition(nearNode, ctx) {
				var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
				return this._findBorderPositionBezier(nearNode, ctx, options.via);
			}
		},
		{
			key: "_getDistanceToEdge",
			value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
				var viaNode = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : this._getViaCoordinates();
				return this._getDistanceToBezierEdge(x1, y1, x2, y2, x3, y3, viaNode);
			}
		},
		{
			key: "getPoint",
			value: function getPoint(position) {
				var viaNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this._getViaCoordinates();
				var t = position;
				var x = Math.pow(1 - t, 2) * this.fromPoint.x + 2 * t * (1 - t) * viaNode.x + Math.pow(t, 2) * this.toPoint.x;
				var y = Math.pow(1 - t, 2) * this.fromPoint.y + 2 * t * (1 - t) * viaNode.y + Math.pow(t, 2) * this.toPoint.y;
				return {
					x,
					y
				};
			}
		}
	]);
	return BezierEdgeStatic$1;
}(BezierEdgeBase);
function _createSuper$6(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$6();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$6() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* A Base Class for all Cubic Bezier Edges. Bezier curves are used to model

* smooth gradual curves in paths between nodes.

*

* @augments BezierEdgeBase

*/
var CubicBezierEdgeBase = /* @__PURE__ */ function(_BezierEdgeBase) {
	_inherits(CubicBezierEdgeBase$1, _BezierEdgeBase);
	var _super = _createSuper$6(CubicBezierEdgeBase$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function CubicBezierEdgeBase$1(options, body, labelModule) {
		_classCallCheck(this, CubicBezierEdgeBase$1);
		return _super.call(this, options, body, labelModule);
	}
	/**
	
	* Calculate the distance between a point (x3,y3) and a line segment from (x1,y1) to (x2,y2).
	
	*
	
	* @remarks
	
	* http://stackoverflow.com/questions/849211/shortest-distancae-between-a-point-and-a-line-segment
	
	* https://en.wikipedia.org/wiki/B%C3%A9zier_curve
	
	* @param x1 - First end of the line segment on the x axis.
	
	* @param y1 - First end of the line segment on the y axis.
	
	* @param x2 - Second end of the line segment on the x axis.
	
	* @param y2 - Second end of the line segment on the y axis.
	
	* @param x3 - Position of the point on the x axis.
	
	* @param y3 - Position of the point on the y axis.
	
	* @param via1 - The first point this edge passes through.
	
	* @param via2 - The second point this edge passes through.
	
	* @returns The distance between the line segment and the point.
	
	*/
	_createClass(CubicBezierEdgeBase$1, [{
		key: "_getDistanceToBezierEdge2",
		value: function _getDistanceToBezierEdge2(x1, y1, x2, y2, x3, y3, via1, via2) {
			var minDistance = 1e9;
			var lastX = x1;
			var lastY = y1;
			var vec = [
				0,
				0,
				0,
				0
			];
			for (var i$2 = 1; i$2 < 10; i$2++) {
				var t = .1 * i$2;
				vec[0] = Math.pow(1 - t, 3);
				vec[1] = 3 * t * Math.pow(1 - t, 2);
				vec[2] = 3 * Math.pow(t, 2) * (1 - t);
				vec[3] = Math.pow(t, 3);
				var x = vec[0] * x1 + vec[1] * via1.x + vec[2] * via2.x + vec[3] * x2;
				var y = vec[0] * y1 + vec[1] * via1.y + vec[2] * via2.y + vec[3] * y2;
				if (i$2 > 0) {
					var distance = this._getDistanceToLine(lastX, lastY, x, y, x3, y3);
					minDistance = distance < minDistance ? distance : minDistance;
				}
				lastX = x;
				lastY = y;
			}
			return minDistance;
		}
	}]);
	return CubicBezierEdgeBase$1;
}(BezierEdgeBase);
function _createSuper$5(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$5();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$5() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* A Cubic Bezier Edge. Bezier curves are used to model smooth gradual curves in paths between nodes.

*/
var CubicBezierEdge = /* @__PURE__ */ function(_CubicBezierEdgeBase) {
	_inherits(CubicBezierEdge$1, _CubicBezierEdgeBase);
	var _super = _createSuper$5(CubicBezierEdge$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function CubicBezierEdge$1(options, body, labelModule) {
		_classCallCheck(this, CubicBezierEdge$1);
		return _super.call(this, options, body, labelModule);
	}
	/** @inheritDoc */
	_createClass(CubicBezierEdge$1, [
		{
			key: "_line",
			value: function _line(ctx, values$8, viaNodes) {
				var via1 = viaNodes[0];
				var via2 = viaNodes[1];
				this._bezierCurve(ctx, values$8, via1, via2);
			}
		},
		{
			key: "_getViaCoordinates",
			value: function _getViaCoordinates() {
				var dx = this.from.x - this.to.x;
				var dy = this.from.y - this.to.y;
				var x1;
				var y1;
				var x2;
				var y2;
				var roundness = this.options.smooth.roundness;
				if ((Math.abs(dx) > Math.abs(dy) || this.options.smooth.forceDirection === true || this.options.smooth.forceDirection === "horizontal") && this.options.smooth.forceDirection !== "vertical") {
					y1 = this.from.y;
					y2 = this.to.y;
					x1 = this.from.x - roundness * dx;
					x2 = this.to.x + roundness * dx;
				} else {
					y1 = this.from.y - roundness * dy;
					y2 = this.to.y + roundness * dy;
					x1 = this.from.x;
					x2 = this.to.x;
				}
				return [{
					x: x1,
					y: y1
				}, {
					x: x2,
					y: y2
				}];
			}
		},
		{
			key: "getViaNode",
			value: function getViaNode() {
				return this._getViaCoordinates();
			}
		},
		{
			key: "_findBorderPosition",
			value: function _findBorderPosition(nearNode, ctx) {
				return this._findBorderPositionBezier(nearNode, ctx);
			}
		},
		{
			key: "_getDistanceToEdge",
			value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
				var _ref = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : this._getViaCoordinates(), _ref2 = _slicedToArray(_ref, 2), via1 = _ref2[0], via2 = _ref2[1];
				return this._getDistanceToBezierEdge2(x1, y1, x2, y2, x3, y3, via1, via2);
			}
		},
		{
			key: "getPoint",
			value: function getPoint(position) {
				var _ref3 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this._getViaCoordinates(), _ref4 = _slicedToArray(_ref3, 2), via1 = _ref4[0], via2 = _ref4[1];
				var t = position;
				var vec = [
					Math.pow(1 - t, 3),
					3 * t * Math.pow(1 - t, 2),
					3 * Math.pow(t, 2) * (1 - t),
					Math.pow(t, 3)
				];
				var x = vec[0] * this.fromPoint.x + vec[1] * via1.x + vec[2] * via2.x + vec[3] * this.toPoint.x;
				var y = vec[0] * this.fromPoint.y + vec[1] * via1.y + vec[2] * via2.y + vec[3] * this.toPoint.y;
				return {
					x,
					y
				};
			}
		}
	]);
	return CubicBezierEdge$1;
}(CubicBezierEdgeBase);
function _createSuper$4(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$4();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$4() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**

* A Straight Edge.

*/
var StraightEdge = /* @__PURE__ */ function(_EdgeBase) {
	_inherits(StraightEdge$1, _EdgeBase);
	var _super = _createSuper$4(StraightEdge$1);
	/**
	
	* Create a new instance.
	
	*
	
	* @param options - The options object of given edge.
	
	* @param body - The body of the network.
	
	* @param labelModule - Label module.
	
	*/
	function StraightEdge$1(options, body, labelModule) {
		_classCallCheck(this, StraightEdge$1);
		return _super.call(this, options, body, labelModule);
	}
	/** @inheritDoc */
	_createClass(StraightEdge$1, [
		{
			key: "_line",
			value: function _line(ctx, values$8) {
				ctx.beginPath();
				ctx.moveTo(this.fromPoint.x, this.fromPoint.y);
				ctx.lineTo(this.toPoint.x, this.toPoint.y);
				this.enableShadow(ctx, values$8);
				ctx.stroke();
				this.disableShadow(ctx, values$8);
			}
		},
		{
			key: "getViaNode",
			value: function getViaNode() {
				return void 0;
			}
		},
		{
			key: "getPoint",
			value: function getPoint(position) {
				return {
					x: (1 - position) * this.fromPoint.x + position * this.toPoint.x,
					y: (1 - position) * this.fromPoint.y + position * this.toPoint.y
				};
			}
		},
		{
			key: "_findBorderPosition",
			value: function _findBorderPosition(nearNode, ctx) {
				var node1 = this.to;
				var node2 = this.from;
				if (nearNode.id === this.from.id) {
					node1 = this.from;
					node2 = this.to;
				}
				var angle = Math.atan2(node1.y - node2.y, node1.x - node2.x);
				var dx = node1.x - node2.x;
				var dy = node1.y - node2.y;
				var edgeSegmentLength = Math.sqrt(dx * dx + dy * dy);
				var toBorderDist = nearNode.distanceToBorder(ctx, angle);
				var toBorderPoint = (edgeSegmentLength - toBorderDist) / edgeSegmentLength;
				return {
					x: (1 - toBorderPoint) * node2.x + toBorderPoint * node1.x,
					y: (1 - toBorderPoint) * node2.y + toBorderPoint * node1.y,
					t: 0
				};
			}
		},
		{
			key: "_getDistanceToEdge",
			value: function _getDistanceToEdge(x1, y1, x2, y2, x3, y3) {
				return this._getDistanceToLine(x1, y1, x2, y2, x3, y3);
			}
		}
	]);
	return StraightEdge$1;
}(EdgeBase);
/**
* An edge connects two nodes and has a specific direction.
*/
var Edge = /* @__PURE__ */ function() {
	/**
	* @param {object} options        values specific to this edge, must contain at least 'from' and 'to'
	* @param {object} body           shared state from Network instance
	* @param {Network.Images} imagelist  A list with images. Only needed when the edge has image arrows.
	* @param {object} globalOptions  options from the EdgesHandler instance
	* @param {object} defaultOptions default options from the EdgeHandler instance. Value and reference are constant
	*/
	function Edge$1(options, body, imagelist, globalOptions, defaultOptions) {
		_classCallCheck(this, Edge$1);
		if (body === void 0) throw new Error("No body provided");
		this.options = bridgeObject(globalOptions);
		this.globalOptions = globalOptions;
		this.defaultOptions = defaultOptions;
		this.body = body;
		this.imagelist = imagelist;
		this.id = void 0;
		this.fromId = void 0;
		this.toId = void 0;
		this.selected = false;
		this.hover = false;
		this.labelDirty = true;
		this.baseWidth = this.options.width;
		this.baseFontSize = this.options.font.size;
		this.from = void 0;
		this.to = void 0;
		this.edgeType = void 0;
		this.connected = false;
		this.labelModule = new Label(
			this.body,
			this.options,
			true
			/* It's an edge label */
);
		this.setOptions(options);
	}
	/**
	* Set or overwrite options for the edge
	*
	* @param {object} options  an object with options
	* @returns {undefined|boolean} undefined if no options, true if layout affecting data changed, false otherwise.
	*/
	_createClass(Edge$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (!options) return;
				var affectsLayout = typeof options.physics !== "undefined" && this.options.physics !== options.physics || typeof options.hidden !== "undefined" && (this.options.hidden || false) !== (options.hidden || false) || typeof options.from !== "undefined" && this.options.from !== options.from || typeof options.to !== "undefined" && this.options.to !== options.to;
				Edge$1.parseOptions(this.options, options, true, this.globalOptions);
				if (options.id !== void 0) this.id = options.id;
				if (options.from !== void 0) this.fromId = options.from;
				if (options.to !== void 0) this.toId = options.to;
				if (options.title !== void 0) this.title = options.title;
				if (options.value !== void 0) options.value = _parseFloat(options.value);
				var pile = [
					options,
					this.options,
					this.defaultOptions
				];
				this.chooser = choosify("edge", pile);
				this.updateLabelModule(options);
				affectsLayout = this.updateEdgeType() || affectsLayout;
				this._setInteractionWidths();
				this.connect();
				return affectsLayout;
			}
		},
		{
			key: "getFormattingValues",
			value: function getFormattingValues() {
				var toArrow = this.options.arrows.to === true || this.options.arrows.to.enabled === true;
				var fromArrow = this.options.arrows.from === true || this.options.arrows.from.enabled === true;
				var middleArrow = this.options.arrows.middle === true || this.options.arrows.middle.enabled === true;
				var inheritsColor = this.options.color.inherit;
				var values$8 = {
					toArrow,
					toArrowScale: this.options.arrows.to.scaleFactor,
					toArrowType: this.options.arrows.to.type,
					toArrowSrc: this.options.arrows.to.src,
					toArrowImageWidth: this.options.arrows.to.imageWidth,
					toArrowImageHeight: this.options.arrows.to.imageHeight,
					middleArrow,
					middleArrowScale: this.options.arrows.middle.scaleFactor,
					middleArrowType: this.options.arrows.middle.type,
					middleArrowSrc: this.options.arrows.middle.src,
					middleArrowImageWidth: this.options.arrows.middle.imageWidth,
					middleArrowImageHeight: this.options.arrows.middle.imageHeight,
					fromArrow,
					fromArrowScale: this.options.arrows.from.scaleFactor,
					fromArrowType: this.options.arrows.from.type,
					fromArrowSrc: this.options.arrows.from.src,
					fromArrowImageWidth: this.options.arrows.from.imageWidth,
					fromArrowImageHeight: this.options.arrows.from.imageHeight,
					arrowStrikethrough: this.options.arrowStrikethrough,
					color: inheritsColor ? void 0 : this.options.color.color,
					inheritsColor,
					opacity: this.options.color.opacity,
					hidden: this.options.hidden,
					length: this.options.length,
					shadow: this.options.shadow.enabled,
					shadowColor: this.options.shadow.color,
					shadowSize: this.options.shadow.size,
					shadowX: this.options.shadow.x,
					shadowY: this.options.shadow.y,
					dashes: this.options.dashes,
					width: this.options.width,
					background: this.options.background.enabled,
					backgroundColor: this.options.background.color,
					backgroundSize: this.options.background.size,
					backgroundDashes: this.options.background.dashes
				};
				if (this.selected || this.hover) {
					if (this.chooser === true) {
						if (this.selected) {
							var selectedWidth = this.options.selectionWidth;
							if (typeof selectedWidth === "function") values$8.width = selectedWidth(values$8.width);
							else if (typeof selectedWidth === "number") values$8.width += selectedWidth;
							values$8.width = Math.max(values$8.width, .3 / this.body.view.scale);
							values$8.color = this.options.color.highlight;
							values$8.shadow = this.options.shadow.enabled;
						} else if (this.hover) {
							var hoverWidth = this.options.hoverWidth;
							if (typeof hoverWidth === "function") values$8.width = hoverWidth(values$8.width);
							else if (typeof hoverWidth === "number") values$8.width += hoverWidth;
							values$8.width = Math.max(values$8.width, .3 / this.body.view.scale);
							values$8.color = this.options.color.hover;
							values$8.shadow = this.options.shadow.enabled;
						}
					} else if (typeof this.chooser === "function") {
						this.chooser(values$8, this.options.id, this.selected, this.hover);
						if (values$8.color !== void 0) values$8.inheritsColor = false;
						if (values$8.shadow === false) {
							if (values$8.shadowColor !== this.options.shadow.color || values$8.shadowSize !== this.options.shadow.size || values$8.shadowX !== this.options.shadow.x || values$8.shadowY !== this.options.shadow.y) values$8.shadow = true;
						}
					}
				} else {
					values$8.shadow = this.options.shadow.enabled;
					values$8.width = Math.max(values$8.width, .3 / this.body.view.scale);
				}
				return values$8;
			}
		},
		{
			key: "updateLabelModule",
			value: function updateLabelModule(options) {
				var pile = [
					options,
					this.options,
					this.globalOptions,
					this.defaultOptions
				];
				this.labelModule.update(this.options, pile);
				if (this.labelModule.baseSize !== void 0) this.baseFontSize = this.labelModule.baseSize;
			}
		},
		{
			key: "updateEdgeType",
			value: function updateEdgeType() {
				var smooth = this.options.smooth;
				var dataChanged = false;
				var changeInType = true;
				if (this.edgeType !== void 0) {
					if (this.edgeType instanceof BezierEdgeDynamic && smooth.enabled === true && smooth.type === "dynamic" || this.edgeType instanceof CubicBezierEdge && smooth.enabled === true && smooth.type === "cubicBezier" || this.edgeType instanceof BezierEdgeStatic && smooth.enabled === true && smooth.type !== "dynamic" && smooth.type !== "cubicBezier" || this.edgeType instanceof StraightEdge && smooth.type.enabled === false) changeInType = false;
					if (changeInType === true) dataChanged = this.cleanup();
				}
				if (changeInType === true) if (smooth.enabled === true) if (smooth.type === "dynamic") {
					dataChanged = true;
					this.edgeType = new BezierEdgeDynamic(this.options, this.body, this.labelModule);
				} else if (smooth.type === "cubicBezier") this.edgeType = new CubicBezierEdge(this.options, this.body, this.labelModule);
				else this.edgeType = new BezierEdgeStatic(this.options, this.body, this.labelModule);
				else this.edgeType = new StraightEdge(this.options, this.body, this.labelModule);
				else this.edgeType.setOptions(this.options);
				return dataChanged;
			}
		},
		{
			key: "connect",
			value: function connect() {
				this.disconnect();
				this.from = this.body.nodes[this.fromId] || void 0;
				this.to = this.body.nodes[this.toId] || void 0;
				this.connected = this.from !== void 0 && this.to !== void 0;
				if (this.connected === true) {
					this.from.attachEdge(this);
					this.to.attachEdge(this);
				} else {
					if (this.from) this.from.detachEdge(this);
					if (this.to) this.to.detachEdge(this);
				}
				this.edgeType.connect();
			}
		},
		{
			key: "disconnect",
			value: function disconnect() {
				if (this.from) {
					this.from.detachEdge(this);
					this.from = void 0;
				}
				if (this.to) {
					this.to.detachEdge(this);
					this.to = void 0;
				}
				this.connected = false;
			}
		},
		{
			key: "getTitle",
			value: function getTitle() {
				return this.title;
			}
		},
		{
			key: "isSelected",
			value: function isSelected() {
				return this.selected;
			}
		},
		{
			key: "getValue",
			value: function getValue() {
				return this.options.value;
			}
		},
		{
			key: "setValueRange",
			value: function setValueRange(min$4, max$5, total) {
				if (this.options.value !== void 0) {
					var scale = this.options.scaling.customScalingFunction(min$4, max$5, total, this.options.value);
					var widthDiff = this.options.scaling.max - this.options.scaling.min;
					if (this.options.scaling.label.enabled === true) {
						var fontDiff = this.options.scaling.label.max - this.options.scaling.label.min;
						this.options.font.size = this.options.scaling.label.min + scale * fontDiff;
					}
					this.options.width = this.options.scaling.min + scale * widthDiff;
				} else {
					this.options.width = this.baseWidth;
					this.options.font.size = this.baseFontSize;
				}
				this._setInteractionWidths();
				this.updateLabelModule();
			}
		},
		{
			key: "_setInteractionWidths",
			value: function _setInteractionWidths() {
				if (typeof this.options.hoverWidth === "function") this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width);
				else this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width;
				if (typeof this.options.selectionWidth === "function") this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width);
				else this.edgeType.selectionWidth = this.options.selectionWidth + this.options.width;
			}
		},
		{
			key: "draw",
			value: function draw(ctx) {
				var values$8 = this.getFormattingValues();
				if (values$8.hidden) return;
				var viaNode = this.edgeType.getViaNode();
				this.edgeType.drawLine(ctx, values$8, this.selected, this.hover, viaNode);
				this.drawLabel(ctx, viaNode);
			}
		},
		{
			key: "drawArrows",
			value: function drawArrows(ctx) {
				var values$8 = this.getFormattingValues();
				if (values$8.hidden) return;
				var viaNode = this.edgeType.getViaNode();
				var arrowData = {};
				this.edgeType.fromPoint = this.edgeType.from;
				this.edgeType.toPoint = this.edgeType.to;
				if (values$8.fromArrow) {
					arrowData.from = this.edgeType.getArrowData(ctx, "from", viaNode, this.selected, this.hover, values$8);
					if (values$8.arrowStrikethrough === false) this.edgeType.fromPoint = arrowData.from.core;
					if (values$8.fromArrowSrc) arrowData.from.image = this.imagelist.load(values$8.fromArrowSrc);
					if (values$8.fromArrowImageWidth) arrowData.from.imageWidth = values$8.fromArrowImageWidth;
					if (values$8.fromArrowImageHeight) arrowData.from.imageHeight = values$8.fromArrowImageHeight;
				}
				if (values$8.toArrow) {
					arrowData.to = this.edgeType.getArrowData(ctx, "to", viaNode, this.selected, this.hover, values$8);
					if (values$8.arrowStrikethrough === false) this.edgeType.toPoint = arrowData.to.core;
					if (values$8.toArrowSrc) arrowData.to.image = this.imagelist.load(values$8.toArrowSrc);
					if (values$8.toArrowImageWidth) arrowData.to.imageWidth = values$8.toArrowImageWidth;
					if (values$8.toArrowImageHeight) arrowData.to.imageHeight = values$8.toArrowImageHeight;
				}
				if (values$8.middleArrow) {
					arrowData.middle = this.edgeType.getArrowData(ctx, "middle", viaNode, this.selected, this.hover, values$8);
					if (values$8.middleArrowSrc) arrowData.middle.image = this.imagelist.load(values$8.middleArrowSrc);
					if (values$8.middleArrowImageWidth) arrowData.middle.imageWidth = values$8.middleArrowImageWidth;
					if (values$8.middleArrowImageHeight) arrowData.middle.imageHeight = values$8.middleArrowImageHeight;
				}
				if (values$8.fromArrow) this.edgeType.drawArrowHead(ctx, values$8, this.selected, this.hover, arrowData.from);
				if (values$8.middleArrow) this.edgeType.drawArrowHead(ctx, values$8, this.selected, this.hover, arrowData.middle);
				if (values$8.toArrow) this.edgeType.drawArrowHead(ctx, values$8, this.selected, this.hover, arrowData.to);
			}
		},
		{
			key: "drawLabel",
			value: function drawLabel(ctx, viaNode) {
				if (this.options.label !== void 0) {
					var node1 = this.from;
					var node2 = this.to;
					if (this.labelModule.differentState(this.selected, this.hover)) this.labelModule.getTextSize(ctx, this.selected, this.hover);
					var point;
					if (node1.id != node2.id) {
						this.labelModule.pointToSelf = false;
						point = this.edgeType.getPoint(.5, viaNode);
						ctx.save();
						var rotationPoint = this._getRotation(ctx);
						if (rotationPoint.angle != 0) {
							ctx.translate(rotationPoint.x, rotationPoint.y);
							ctx.rotate(rotationPoint.angle);
						}
						this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover);
						ctx.restore();
					} else {
						this.labelModule.pointToSelf = true;
						var coordinates = getSelfRefCoordinates(ctx, this.options.selfReference.angle, this.options.selfReference.size, node1);
						point = this._pointOnCircle(coordinates.x, coordinates.y, this.options.selfReference.size, this.options.selfReference.angle);
						this.labelModule.draw(ctx, point.x, point.y, this.selected, this.hover);
					}
				}
			}
		},
		{
			key: "getItemsOnPoint",
			value: function getItemsOnPoint(point) {
				var ret = [];
				if (this.labelModule.visible()) {
					var rotationPoint = this._getRotation();
					if (pointInRect(this.labelModule.getSize(), point, rotationPoint)) ret.push({
						edgeId: this.id,
						labelId: 0
					});
				}
				var obj = {
					left: point.x,
					top: point.y
				};
				if (this.isOverlappingWith(obj)) ret.push({ edgeId: this.id });
				return ret;
			}
		},
		{
			key: "isOverlappingWith",
			value: function isOverlappingWith(obj) {
				if (this.connected) {
					var distMax = 10;
					var xFrom = this.from.x;
					var yFrom = this.from.y;
					var xTo = this.to.x;
					var yTo = this.to.y;
					var xObj = obj.left;
					var yObj = obj.top;
					var dist = this.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, xObj, yObj);
					return dist < distMax;
				} else return false;
			}
		},
		{
			key: "_getRotation",
			value: function _getRotation(ctx) {
				var viaNode = this.edgeType.getViaNode();
				var point = this.edgeType.getPoint(.5, viaNode);
				if (ctx !== void 0) this.labelModule.calculateLabelSize(ctx, this.selected, this.hover, point.x, point.y);
				var ret = {
					x: point.x,
					y: this.labelModule.size.yLine,
					angle: 0
				};
				if (!this.labelModule.visible()) return ret;
				if (this.options.font.align === "horizontal") return ret;
				var dy = this.from.y - this.to.y;
				var dx = this.from.x - this.to.x;
				var angle = Math.atan2(dy, dx);
				if (angle < -1 && dx < 0 || angle > 0 && dx < 0) angle += Math.PI;
				ret.angle = angle;
				return ret;
			}
		},
		{
			key: "_pointOnCircle",
			value: function _pointOnCircle(x, y, radius, angle) {
				return {
					x: x + radius * Math.cos(angle),
					y: y - radius * Math.sin(angle)
				};
			}
		},
		{
			key: "select",
			value: function select() {
				this.selected = true;
			}
		},
		{
			key: "unselect",
			value: function unselect() {
				this.selected = false;
			}
		},
		{
			key: "cleanup",
			value: function cleanup() {
				return this.edgeType.cleanup();
			}
		},
		{
			key: "remove",
			value: function remove() {
				this.cleanup();
				this.disconnect();
				delete this.body.edges[this.id];
			}
		},
		{
			key: "endPointsValid",
			value: function endPointsValid() {
				return this.body.nodes[this.fromId] !== void 0 && this.body.nodes[this.toId] !== void 0;
			}
		}
	], [{
		key: "parseOptions",
		value: function parseOptions(parentOptions, newOptions) {
			var allowDeletion = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
			var globalOptions = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
			var copyFromGlobals = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
			var fields = [
				"endPointOffset",
				"arrowStrikethrough",
				"id",
				"from",
				"hidden",
				"hoverWidth",
				"labelHighlightBold",
				"length",
				"line",
				"opacity",
				"physics",
				"scaling",
				"selectionWidth",
				"selfReferenceSize",
				"selfReference",
				"to",
				"title",
				"value",
				"width",
				"font",
				"chosen",
				"widthConstraint"
			];
			selectiveDeepExtend(fields, parentOptions, newOptions, allowDeletion);
			if (newOptions.endPointOffset !== void 0 && newOptions.endPointOffset.from !== void 0) if (_Number$isFinite(newOptions.endPointOffset.from)) parentOptions.endPointOffset.from = newOptions.endPointOffset.from;
			else {
				parentOptions.endPointOffset.from = globalOptions.endPointOffset.from !== void 0 ? globalOptions.endPointOffset.from : 0;
				console.error("endPointOffset.from is not a valid number");
			}
			if (newOptions.endPointOffset !== void 0 && newOptions.endPointOffset.to !== void 0) if (_Number$isFinite(newOptions.endPointOffset.to)) parentOptions.endPointOffset.to = newOptions.endPointOffset.to;
			else {
				parentOptions.endPointOffset.to = globalOptions.endPointOffset.to !== void 0 ? globalOptions.endPointOffset.to : 0;
				console.error("endPointOffset.to is not a valid number");
			}
			if (isValidLabel(newOptions.label)) parentOptions.label = newOptions.label;
			else if (!isValidLabel(parentOptions.label)) parentOptions.label = void 0;
			mergeOptions(parentOptions, newOptions, "smooth", globalOptions);
			mergeOptions(parentOptions, newOptions, "shadow", globalOptions);
			mergeOptions(parentOptions, newOptions, "background", globalOptions);
			if (newOptions.dashes !== void 0 && newOptions.dashes !== null) parentOptions.dashes = newOptions.dashes;
			else if (allowDeletion === true && newOptions.dashes === null) parentOptions.dashes = _Object$create$1(globalOptions.dashes);
			if (newOptions.scaling !== void 0 && newOptions.scaling !== null) {
				if (newOptions.scaling.min !== void 0) parentOptions.scaling.min = newOptions.scaling.min;
				if (newOptions.scaling.max !== void 0) parentOptions.scaling.max = newOptions.scaling.max;
				mergeOptions(parentOptions.scaling, newOptions.scaling, "label", globalOptions.scaling);
			} else if (allowDeletion === true && newOptions.scaling === null) parentOptions.scaling = _Object$create$1(globalOptions.scaling);
			if (newOptions.arrows !== void 0 && newOptions.arrows !== null) if (typeof newOptions.arrows === "string") {
				var arrows = newOptions.arrows.toLowerCase();
				parentOptions.arrows.to.enabled = _indexOfInstanceProperty(arrows).call(arrows, "to") != -1;
				parentOptions.arrows.middle.enabled = _indexOfInstanceProperty(arrows).call(arrows, "middle") != -1;
				parentOptions.arrows.from.enabled = _indexOfInstanceProperty(arrows).call(arrows, "from") != -1;
			} else if (_typeof(newOptions.arrows) === "object") {
				mergeOptions(parentOptions.arrows, newOptions.arrows, "to", globalOptions.arrows);
				mergeOptions(parentOptions.arrows, newOptions.arrows, "middle", globalOptions.arrows);
				mergeOptions(parentOptions.arrows, newOptions.arrows, "from", globalOptions.arrows);
			} else throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:" + _JSON$stringify(newOptions.arrows));
			else if (allowDeletion === true && newOptions.arrows === null) parentOptions.arrows = _Object$create$1(globalOptions.arrows);
			if (newOptions.color !== void 0 && newOptions.color !== null) {
				var fromColor = isString(newOptions.color) ? {
					color: newOptions.color,
					highlight: newOptions.color,
					hover: newOptions.color,
					inherit: false,
					opacity: 1
				} : newOptions.color;
				var toColor = parentOptions.color;
				if (copyFromGlobals) deepExtend(toColor, globalOptions.color, false, allowDeletion);
				else for (var i$2 in toColor) if (Object.prototype.hasOwnProperty.call(toColor, i$2)) delete toColor[i$2];
				if (isString(toColor)) {
					toColor.color = toColor;
					toColor.highlight = toColor;
					toColor.hover = toColor;
					toColor.inherit = false;
					if (fromColor.opacity === void 0) toColor.opacity = 1;
				} else {
					var colorsDefined = false;
					if (fromColor.color !== void 0) {
						toColor.color = fromColor.color;
						colorsDefined = true;
					}
					if (fromColor.highlight !== void 0) {
						toColor.highlight = fromColor.highlight;
						colorsDefined = true;
					}
					if (fromColor.hover !== void 0) {
						toColor.hover = fromColor.hover;
						colorsDefined = true;
					}
					if (fromColor.inherit !== void 0) toColor.inherit = fromColor.inherit;
					if (fromColor.opacity !== void 0) toColor.opacity = Math.min(1, Math.max(0, fromColor.opacity));
					if (colorsDefined === true) toColor.inherit = false;
					else if (toColor.inherit === void 0) toColor.inherit = "from";
				}
			} else if (allowDeletion === true && newOptions.color === null) parentOptions.color = bridgeObject(globalOptions.color);
			if (allowDeletion === true && newOptions.font === null) parentOptions.font = bridgeObject(globalOptions.font);
			if (Object.prototype.hasOwnProperty.call(newOptions, "selfReferenceSize")) {
				console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}");
				parentOptions.selfReference.size = newOptions.selfReferenceSize;
			}
		}
	}]);
	return Edge$1;
}();
/**
* Handler for Edges
*/
var EdgesHandler = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Array.<Image>} images
	* @param {Array.<Group>} groups
	*/
	function EdgesHandler$1(body, images, groups) {
		var _context, _this = this;
		_classCallCheck(this, EdgesHandler$1);
		this.body = body;
		this.images = images;
		this.groups = groups;
		this.body.functions.createEdge = _bindInstanceProperty$1(_context = this.create).call(_context, this);
		this.edgesListeners = {
			add: function add(event, params) {
				_this.add(params.items);
			},
			update: function update(event, params) {
				_this.update(params.items);
			},
			remove: function remove(event, params) {
				_this.remove(params.items);
			}
		};
		this.options = {};
		this.defaultOptions = {
			arrows: {
				to: {
					enabled: false,
					scaleFactor: 1,
					type: "arrow"
				},
				middle: {
					enabled: false,
					scaleFactor: 1,
					type: "arrow"
				},
				from: {
					enabled: false,
					scaleFactor: 1,
					type: "arrow"
				}
			},
			endPointOffset: {
				from: 0,
				to: 0
			},
			arrowStrikethrough: true,
			color: {
				color: "#848484",
				highlight: "#848484",
				hover: "#848484",
				inherit: "from",
				opacity: 1
			},
			dashes: false,
			font: {
				color: "#343434",
				size: 14,
				face: "arial",
				background: "none",
				strokeWidth: 2,
				strokeColor: "#ffffff",
				align: "horizontal",
				multi: false,
				vadjust: 0,
				bold: { mod: "bold" },
				boldital: { mod: "bold italic" },
				ital: { mod: "italic" },
				mono: {
					mod: "",
					size: 15,
					face: "courier new",
					vadjust: 2
				}
			},
			hidden: false,
			hoverWidth: 1.5,
			label: void 0,
			labelHighlightBold: true,
			length: void 0,
			physics: true,
			scaling: {
				min: 1,
				max: 15,
				label: {
					enabled: true,
					min: 14,
					max: 30,
					maxVisible: 30,
					drawThreshold: 5
				},
				customScalingFunction: function customScalingFunction(min$4, max$5, total, value) {
					if (max$5 === min$4) return .5;
					else {
						var scale = 1 / (max$5 - min$4);
						return Math.max(0, (value - min$4) * scale);
					}
				}
			},
			selectionWidth: 1.5,
			selfReference: {
				size: 20,
				angle: Math.PI / 4,
				renderBehindTheNode: true
			},
			shadow: {
				enabled: false,
				color: "rgba(0,0,0,0.5)",
				size: 10,
				x: 5,
				y: 5
			},
			background: {
				enabled: false,
				color: "rgba(111,111,111,1)",
				size: 10,
				dashes: false
			},
			smooth: {
				enabled: true,
				type: "dynamic",
				forceDirection: "none",
				roundness: .5
			},
			title: void 0,
			width: 1,
			value: void 0
		};
		deepExtend(this.options, this.defaultOptions);
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(EdgesHandler$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this2 = this, _context2, _context3;
				this.body.emitter.on("_forceDisableDynamicCurves", function(type) {
					var emit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
					if (type === "dynamic") type = "continuous";
					var dataChanged = false;
					for (var edgeId in _this2.body.edges) if (Object.prototype.hasOwnProperty.call(_this2.body.edges, edgeId)) {
						var edge = _this2.body.edges[edgeId];
						var edgeData = _this2.body.data.edges.get(edgeId);
						if (edgeData != null) {
							var smoothOptions = edgeData.smooth;
							if (smoothOptions !== void 0) {
								if (smoothOptions.enabled === true && smoothOptions.type === "dynamic") {
									if (type === void 0) edge.setOptions({ smooth: false });
									else edge.setOptions({ smooth: { type } });
									dataChanged = true;
								}
							}
						}
					}
					if (emit === true && dataChanged === true) _this2.body.emitter.emit("_dataChanged");
				});
				this.body.emitter.on("_dataUpdated", function() {
					_this2.reconnectEdges();
				});
				this.body.emitter.on("refreshEdges", _bindInstanceProperty$1(_context2 = this.refresh).call(_context2, this));
				this.body.emitter.on("refresh", _bindInstanceProperty$1(_context3 = this.refresh).call(_context3, this));
				this.body.emitter.on("destroy", function() {
					forEach$1(_this2.edgesListeners, function(callback, event) {
						if (_this2.body.data.edges) _this2.body.data.edges.off(event, callback);
					});
					delete _this2.body.functions.createEdge;
					delete _this2.edgesListeners.add;
					delete _this2.edgesListeners.update;
					delete _this2.edgesListeners.remove;
					delete _this2.edgesListeners;
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					Edge.parseOptions(this.options, options, true, this.defaultOptions, true);
					var dataChanged = false;
					if (options.smooth !== void 0) {
						for (var edgeId in this.body.edges) if (Object.prototype.hasOwnProperty.call(this.body.edges, edgeId)) dataChanged = this.body.edges[edgeId].updateEdgeType() || dataChanged;
					}
					if (options.font !== void 0) {
						for (var _edgeId in this.body.edges) if (Object.prototype.hasOwnProperty.call(this.body.edges, _edgeId)) this.body.edges[_edgeId].updateLabelModule();
					}
					if (options.hidden !== void 0 || options.physics !== void 0 || dataChanged === true) this.body.emitter.emit("_dataChanged");
				}
			}
		},
		{
			key: "setData",
			value: function setData(edges) {
				var _this3 = this;
				var doNotEmit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var oldEdgesData = this.body.data.edges;
				if (isDataViewLike("id", edges)) this.body.data.edges = edges;
				else if (_Array$isArray(edges)) {
					this.body.data.edges = new DataSet();
					this.body.data.edges.add(edges);
				} else if (!edges) this.body.data.edges = new DataSet();
				else throw new TypeError("Array or DataSet expected");
				if (oldEdgesData) forEach$1(this.edgesListeners, function(callback, event) {
					oldEdgesData.off(event, callback);
				});
				this.body.edges = {};
				if (this.body.data.edges) {
					forEach$1(this.edgesListeners, function(callback, event) {
						_this3.body.data.edges.on(event, callback);
					});
					var ids = this.body.data.edges.getIds();
					this.add(ids, true);
				}
				this.body.emitter.emit("_adjustEdgesForHierarchicalLayout");
				if (doNotEmit === false) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "add",
			value: function add(ids) {
				var doNotEmit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var edges = this.body.edges;
				var edgesData = this.body.data.edges;
				for (var i$2 = 0; i$2 < ids.length; i$2++) {
					var id$4 = ids[i$2];
					var oldEdge = edges[id$4];
					if (oldEdge) oldEdge.disconnect();
					var data$2 = edgesData.get(id$4, { showInternalIds: true });
					edges[id$4] = this.create(data$2);
				}
				this.body.emitter.emit("_adjustEdgesForHierarchicalLayout");
				if (doNotEmit === false) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "update",
			value: function update(ids) {
				var edges = this.body.edges;
				var edgesData = this.body.data.edges;
				var dataChanged = false;
				for (var i$2 = 0; i$2 < ids.length; i$2++) {
					var id$4 = ids[i$2];
					var data$2 = edgesData.get(id$4);
					var edge = edges[id$4];
					if (edge !== void 0) {
						edge.disconnect();
						dataChanged = edge.setOptions(data$2) || dataChanged;
						edge.connect();
					} else {
						this.body.edges[id$4] = this.create(data$2);
						dataChanged = true;
					}
				}
				if (dataChanged === true) {
					this.body.emitter.emit("_adjustEdgesForHierarchicalLayout");
					this.body.emitter.emit("_dataChanged");
				} else this.body.emitter.emit("_dataUpdated");
			}
		},
		{
			key: "remove",
			value: function remove(ids) {
				var emit = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				if (ids.length === 0) return;
				var edges = this.body.edges;
				forEach$1(ids, function(id$4) {
					var edge = edges[id$4];
					if (edge !== void 0) edge.remove();
				});
				if (emit) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "refresh",
			value: function refresh() {
				var _this4 = this;
				forEach$1(this.body.edges, function(edge, edgeId) {
					var data$2 = _this4.body.data.edges.get(edgeId);
					if (data$2 !== void 0) edge.setOptions(data$2);
				});
			}
		},
		{
			key: "create",
			value: function create$11(properties) {
				return new Edge(properties, this.body, this.images, this.options, this.defaultOptions);
			}
		},
		{
			key: "reconnectEdges",
			value: function reconnectEdges() {
				var id$4;
				var nodes = this.body.nodes;
				var edges = this.body.edges;
				for (id$4 in nodes) if (Object.prototype.hasOwnProperty.call(nodes, id$4)) nodes[id$4].edges = [];
				for (id$4 in edges) if (Object.prototype.hasOwnProperty.call(edges, id$4)) {
					var edge = edges[id$4];
					edge.from = null;
					edge.to = null;
					edge.connect();
				}
			}
		},
		{
			key: "getConnectedNodes",
			value: function getConnectedNodes(edgeId) {
				var nodeList = [];
				if (this.body.edges[edgeId] !== void 0) {
					var edge = this.body.edges[edgeId];
					if (edge.fromId !== void 0) nodeList.push(edge.fromId);
					if (edge.toId !== void 0) nodeList.push(edge.toId);
				}
				return nodeList;
			}
		},
		{
			key: "_updateState",
			value: function _updateState() {
				this._addMissingEdges();
				this._removeInvalidEdges();
			}
		},
		{
			key: "_removeInvalidEdges",
			value: function _removeInvalidEdges() {
				var _this5 = this;
				var edgesToDelete = [];
				forEach$1(this.body.edges, function(edge, id$4) {
					var toNode = _this5.body.nodes[edge.toId];
					var fromNode = _this5.body.nodes[edge.fromId];
					if (toNode !== void 0 && toNode.isCluster === true || fromNode !== void 0 && fromNode.isCluster === true) return;
					if (toNode === void 0 || fromNode === void 0) edgesToDelete.push(id$4);
				});
				this.remove(edgesToDelete, false);
			}
		},
		{
			key: "_addMissingEdges",
			value: function _addMissingEdges() {
				var edgesData = this.body.data.edges;
				if (edgesData === void 0 || edgesData === null) return;
				var edges = this.body.edges;
				var addIds = [];
				_forEachInstanceProperty(edgesData).call(edgesData, function(edgeData, edgeId) {
					var edge = edges[edgeId];
					if (edge === void 0) addIds.push(edgeId);
				});
				this.add(addIds, true);
			}
		}
	]);
	return EdgesHandler$1;
}();
/**
* Barnes Hut Solver
*/
var BarnesHutSolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function BarnesHutSolver$1(body, physicsBody, options) {
		_classCallCheck(this, BarnesHutSolver$1);
		this.body = body;
		this.physicsBody = physicsBody;
		this.barnesHutTree;
		this.setOptions(options);
		this._rng = Alea("BARNES HUT SOLVER");
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(BarnesHutSolver$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.options = options;
				this.thetaInversed = 1 / this.options.theta;
				this.overlapAvoidanceFactor = 1 - Math.max(0, Math.min(1, this.options.avoidOverlap));
			}
		},
		{
			key: "solve",
			value: function solve() {
				if (this.options.gravitationalConstant !== 0 && this.physicsBody.physicsNodeIndices.length > 0) {
					var node$1;
					var nodes = this.body.nodes;
					var nodeIndices = this.physicsBody.physicsNodeIndices;
					var nodeCount = nodeIndices.length;
					var barnesHutTree = this._formBarnesHutTree(nodes, nodeIndices);
					this.barnesHutTree = barnesHutTree;
					for (var i$2 = 0; i$2 < nodeCount; i$2++) {
						node$1 = nodes[nodeIndices[i$2]];
						if (node$1.options.mass > 0) this._getForceContributions(barnesHutTree.root, node$1);
					}
				}
			}
		},
		{
			key: "_getForceContributions",
			value: function _getForceContributions(parentBranch, node$1) {
				this._getForceContribution(parentBranch.children.NW, node$1);
				this._getForceContribution(parentBranch.children.NE, node$1);
				this._getForceContribution(parentBranch.children.SW, node$1);
				this._getForceContribution(parentBranch.children.SE, node$1);
			}
		},
		{
			key: "_getForceContribution",
			value: function _getForceContribution(parentBranch, node$1) {
				if (parentBranch.childrenCount > 0) {
					var dx = parentBranch.centerOfMass.x - node$1.x;
					var dy = parentBranch.centerOfMass.y - node$1.y;
					var distance = Math.sqrt(dx * dx + dy * dy);
					if (distance * parentBranch.calcSize > this.thetaInversed) this._calculateForces(distance, dx, dy, node$1, parentBranch);
					else if (parentBranch.childrenCount === 4) this._getForceContributions(parentBranch, node$1);
					else if (parentBranch.children.data.id != node$1.id) this._calculateForces(distance, dx, dy, node$1, parentBranch);
				}
			}
		},
		{
			key: "_calculateForces",
			value: function _calculateForces(distance, dx, dy, node$1, parentBranch) {
				if (distance === 0) {
					distance = .1;
					dx = distance;
				}
				if (this.overlapAvoidanceFactor < 1 && node$1.shape.radius) distance = Math.max(.1 + this.overlapAvoidanceFactor * node$1.shape.radius, distance - node$1.shape.radius);
				var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node$1.options.mass / Math.pow(distance, 3);
				var fx = dx * gravityForce;
				var fy = dy * gravityForce;
				this.physicsBody.forces[node$1.id].x += fx;
				this.physicsBody.forces[node$1.id].y += fy;
			}
		},
		{
			key: "_formBarnesHutTree",
			value: function _formBarnesHutTree(nodes, nodeIndices) {
				var node$1;
				var nodeCount = nodeIndices.length;
				var minX = nodes[nodeIndices[0]].x;
				var minY = nodes[nodeIndices[0]].y;
				var maxX = nodes[nodeIndices[0]].x;
				var maxY = nodes[nodeIndices[0]].y;
				for (var i$2 = 1; i$2 < nodeCount; i$2++) {
					var _node = nodes[nodeIndices[i$2]];
					var x = _node.x;
					var y = _node.y;
					if (_node.options.mass > 0) {
						if (x < minX) minX = x;
						if (x > maxX) maxX = x;
						if (y < minY) minY = y;
						if (y > maxY) maxY = y;
					}
				}
				var sizeDiff = Math.abs(maxX - minX) - Math.abs(maxY - minY);
				if (sizeDiff > 0) {
					minY -= .5 * sizeDiff;
					maxY += .5 * sizeDiff;
				} else {
					minX += .5 * sizeDiff;
					maxX -= .5 * sizeDiff;
				}
				var minimumTreeSize = 1e-5;
				var rootSize = Math.max(minimumTreeSize, Math.abs(maxX - minX));
				var halfRootSize = .5 * rootSize;
				var centerX = .5 * (minX + maxX), centerY = .5 * (minY + maxY);
				var barnesHutTree = { root: {
					centerOfMass: {
						x: 0,
						y: 0
					},
					mass: 0,
					range: {
						minX: centerX - halfRootSize,
						maxX: centerX + halfRootSize,
						minY: centerY - halfRootSize,
						maxY: centerY + halfRootSize
					},
					size: rootSize,
					calcSize: 1 / rootSize,
					children: { data: null },
					maxWidth: 0,
					level: 0,
					childrenCount: 4
				} };
				this._splitBranch(barnesHutTree.root);
				for (var _i = 0; _i < nodeCount; _i++) {
					node$1 = nodes[nodeIndices[_i]];
					if (node$1.options.mass > 0) this._placeInTree(barnesHutTree.root, node$1);
				}
				return barnesHutTree;
			}
		},
		{
			key: "_updateBranchMass",
			value: function _updateBranchMass(parentBranch, node$1) {
				var centerOfMass = parentBranch.centerOfMass;
				var totalMass = parentBranch.mass + node$1.options.mass;
				var totalMassInv = 1 / totalMass;
				centerOfMass.x = centerOfMass.x * parentBranch.mass + node$1.x * node$1.options.mass;
				centerOfMass.x *= totalMassInv;
				centerOfMass.y = centerOfMass.y * parentBranch.mass + node$1.y * node$1.options.mass;
				centerOfMass.y *= totalMassInv;
				parentBranch.mass = totalMass;
				var biggestSize = Math.max(Math.max(node$1.height, node$1.radius), node$1.width);
				parentBranch.maxWidth = parentBranch.maxWidth < biggestSize ? biggestSize : parentBranch.maxWidth;
			}
		},
		{
			key: "_placeInTree",
			value: function _placeInTree(parentBranch, node$1, skipMassUpdate) {
				if (skipMassUpdate != true || skipMassUpdate === void 0) this._updateBranchMass(parentBranch, node$1);
				var range = parentBranch.children.NW.range;
				var region;
				if (range.maxX > node$1.x) if (range.maxY > node$1.y) region = "NW";
				else region = "SW";
				else if (range.maxY > node$1.y) region = "NE";
				else region = "SE";
				this._placeInRegion(parentBranch, node$1, region);
			}
		},
		{
			key: "_placeInRegion",
			value: function _placeInRegion(parentBranch, node$1, region) {
				var children = parentBranch.children[region];
				switch (children.childrenCount) {
					case 0:
						children.children.data = node$1;
						children.childrenCount = 1;
						this._updateBranchMass(children, node$1);
						break;
					case 1:
						if (children.children.data.x === node$1.x && children.children.data.y === node$1.y) {
							node$1.x += this._rng();
							node$1.y += this._rng();
						} else {
							this._splitBranch(children);
							this._placeInTree(children, node$1);
						}
						break;
					case 4:
						this._placeInTree(children, node$1);
						break;
				}
			}
		},
		{
			key: "_splitBranch",
			value: function _splitBranch(parentBranch) {
				var containedNode = null;
				if (parentBranch.childrenCount === 1) {
					containedNode = parentBranch.children.data;
					parentBranch.mass = 0;
					parentBranch.centerOfMass.x = 0;
					parentBranch.centerOfMass.y = 0;
				}
				parentBranch.childrenCount = 4;
				parentBranch.children.data = null;
				this._insertRegion(parentBranch, "NW");
				this._insertRegion(parentBranch, "NE");
				this._insertRegion(parentBranch, "SW");
				this._insertRegion(parentBranch, "SE");
				if (containedNode != null) this._placeInTree(parentBranch, containedNode);
			}
		},
		{
			key: "_insertRegion",
			value: function _insertRegion(parentBranch, region) {
				var minX, maxX, minY, maxY;
				var childSize = .5 * parentBranch.size;
				switch (region) {
					case "NW":
						minX = parentBranch.range.minX;
						maxX = parentBranch.range.minX + childSize;
						minY = parentBranch.range.minY;
						maxY = parentBranch.range.minY + childSize;
						break;
					case "NE":
						minX = parentBranch.range.minX + childSize;
						maxX = parentBranch.range.maxX;
						minY = parentBranch.range.minY;
						maxY = parentBranch.range.minY + childSize;
						break;
					case "SW":
						minX = parentBranch.range.minX;
						maxX = parentBranch.range.minX + childSize;
						minY = parentBranch.range.minY + childSize;
						maxY = parentBranch.range.maxY;
						break;
					case "SE":
						minX = parentBranch.range.minX + childSize;
						maxX = parentBranch.range.maxX;
						minY = parentBranch.range.minY + childSize;
						maxY = parentBranch.range.maxY;
						break;
				}
				parentBranch.children[region] = {
					centerOfMass: {
						x: 0,
						y: 0
					},
					mass: 0,
					range: {
						minX,
						maxX,
						minY,
						maxY
					},
					size: .5 * parentBranch.size,
					calcSize: 2 * parentBranch.calcSize,
					children: { data: null },
					maxWidth: 0,
					level: parentBranch.level + 1,
					childrenCount: 0
				};
			}
		},
		{
			key: "_debug",
			value: function _debug(ctx, color) {
				if (this.barnesHutTree !== void 0) {
					ctx.lineWidth = 1;
					this._drawBranch(this.barnesHutTree.root, ctx, color);
				}
			}
		},
		{
			key: "_drawBranch",
			value: function _drawBranch(branch, ctx, color) {
				if (color === void 0) color = "#FF0000";
				if (branch.childrenCount === 4) {
					this._drawBranch(branch.children.NW, ctx);
					this._drawBranch(branch.children.NE, ctx);
					this._drawBranch(branch.children.SE, ctx);
					this._drawBranch(branch.children.SW, ctx);
				}
				ctx.strokeStyle = color;
				ctx.beginPath();
				ctx.moveTo(branch.range.minX, branch.range.minY);
				ctx.lineTo(branch.range.maxX, branch.range.minY);
				ctx.stroke();
				ctx.beginPath();
				ctx.moveTo(branch.range.maxX, branch.range.minY);
				ctx.lineTo(branch.range.maxX, branch.range.maxY);
				ctx.stroke();
				ctx.beginPath();
				ctx.moveTo(branch.range.maxX, branch.range.maxY);
				ctx.lineTo(branch.range.minX, branch.range.maxY);
				ctx.stroke();
				ctx.beginPath();
				ctx.moveTo(branch.range.minX, branch.range.maxY);
				ctx.lineTo(branch.range.minX, branch.range.minY);
				ctx.stroke();
			}
		}
	]);
	return BarnesHutSolver$1;
}();
/**
* Repulsion Solver
*/
var RepulsionSolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function RepulsionSolver$1(body, physicsBody, options) {
		_classCallCheck(this, RepulsionSolver$1);
		this._rng = Alea("REPULSION SOLVER");
		this.body = body;
		this.physicsBody = physicsBody;
		this.setOptions(options);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(RepulsionSolver$1, [{
		key: "setOptions",
		value: function setOptions(options) {
			this.options = options;
		}
	}, {
		key: "solve",
		value: function solve() {
			var dx, dy, distance, fx, fy, repulsingForce, node1, node2;
			var nodes = this.body.nodes;
			var nodeIndices = this.physicsBody.physicsNodeIndices;
			var forces = this.physicsBody.forces;
			var nodeDistance = this.options.nodeDistance;
			var a = -2 / 3 / nodeDistance;
			var b = 4 / 3;
			for (var i$2 = 0; i$2 < nodeIndices.length - 1; i$2++) {
				node1 = nodes[nodeIndices[i$2]];
				for (var j = i$2 + 1; j < nodeIndices.length; j++) {
					node2 = nodes[nodeIndices[j]];
					dx = node2.x - node1.x;
					dy = node2.y - node1.y;
					distance = Math.sqrt(dx * dx + dy * dy);
					if (distance === 0) {
						distance = .1 * this._rng();
						dx = distance;
					}
					if (distance < 2 * nodeDistance) {
						if (distance < .5 * nodeDistance) repulsingForce = 1;
						else repulsingForce = a * distance + b;
						repulsingForce = repulsingForce / distance;
						fx = dx * repulsingForce;
						fy = dy * repulsingForce;
						forces[node1.id].x -= fx;
						forces[node1.id].y -= fy;
						forces[node2.id].x += fx;
						forces[node2.id].y += fy;
					}
				}
			}
		}
	}]);
	return RepulsionSolver$1;
}();
/**
* Hierarchical Repulsion Solver
*/
var HierarchicalRepulsionSolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function HierarchicalRepulsionSolver$1(body, physicsBody, options) {
		_classCallCheck(this, HierarchicalRepulsionSolver$1);
		this.body = body;
		this.physicsBody = physicsBody;
		this.setOptions(options);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(HierarchicalRepulsionSolver$1, [{
		key: "setOptions",
		value: function setOptions(options) {
			this.options = options;
			this.overlapAvoidanceFactor = Math.max(0, Math.min(1, this.options.avoidOverlap || 0));
		}
	}, {
		key: "solve",
		value: function solve() {
			var nodes = this.body.nodes;
			var nodeIndices = this.physicsBody.physicsNodeIndices;
			var forces = this.physicsBody.forces;
			var nodeDistance = this.options.nodeDistance;
			for (var i$2 = 0; i$2 < nodeIndices.length - 1; i$2++) {
				var node1 = nodes[nodeIndices[i$2]];
				for (var j = i$2 + 1; j < nodeIndices.length; j++) {
					var node2 = nodes[nodeIndices[j]];
					if (node1.level === node2.level) {
						var theseNodesDistance = nodeDistance + this.overlapAvoidanceFactor * ((node1.shape.radius || 0) / 2 + (node2.shape.radius || 0) / 2);
						var dx = node2.x - node1.x;
						var dy = node2.y - node1.y;
						var distance = Math.sqrt(dx * dx + dy * dy);
						var steepness = .05;
						var repulsingForce = void 0;
						if (distance < theseNodesDistance) repulsingForce = -Math.pow(steepness * distance, 2) + Math.pow(steepness * theseNodesDistance, 2);
						else repulsingForce = 0;
						if (distance !== 0) repulsingForce = repulsingForce / distance;
						var fx = dx * repulsingForce;
						var fy = dy * repulsingForce;
						forces[node1.id].x -= fx;
						forces[node1.id].y -= fy;
						forces[node2.id].x += fx;
						forces[node2.id].y += fy;
					}
				}
			}
		}
	}]);
	return HierarchicalRepulsionSolver$1;
}();
/**
* Spring Solver
*/
var SpringSolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function SpringSolver$1(body, physicsBody, options) {
		_classCallCheck(this, SpringSolver$1);
		this.body = body;
		this.physicsBody = physicsBody;
		this.setOptions(options);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(SpringSolver$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.options = options;
			}
		},
		{
			key: "solve",
			value: function solve() {
				var edgeLength, edge;
				var edgeIndices = this.physicsBody.physicsEdgeIndices;
				var edges = this.body.edges;
				var node1, node2, node3;
				for (var i$2 = 0; i$2 < edgeIndices.length; i$2++) {
					edge = edges[edgeIndices[i$2]];
					if (edge.connected === true && edge.toId !== edge.fromId) {
						if (this.body.nodes[edge.toId] !== void 0 && this.body.nodes[edge.fromId] !== void 0) if (edge.edgeType.via !== void 0) {
							edgeLength = edge.options.length === void 0 ? this.options.springLength : edge.options.length;
							node1 = edge.to;
							node2 = edge.edgeType.via;
							node3 = edge.from;
							this._calculateSpringForce(node1, node2, .5 * edgeLength);
							this._calculateSpringForce(node2, node3, .5 * edgeLength);
						} else {
							edgeLength = edge.options.length === void 0 ? this.options.springLength * 1.5 : edge.options.length;
							this._calculateSpringForce(edge.from, edge.to, edgeLength);
						}
					}
				}
			}
		},
		{
			key: "_calculateSpringForce",
			value: function _calculateSpringForce(node1, node2, edgeLength) {
				var dx = node1.x - node2.x;
				var dy = node1.y - node2.y;
				var distance = Math.max(Math.sqrt(dx * dx + dy * dy), .01);
				var springForce = this.options.springConstant * (edgeLength - distance) / distance;
				var fx = dx * springForce;
				var fy = dy * springForce;
				if (this.physicsBody.forces[node1.id] !== void 0) {
					this.physicsBody.forces[node1.id].x += fx;
					this.physicsBody.forces[node1.id].y += fy;
				}
				if (this.physicsBody.forces[node2.id] !== void 0) {
					this.physicsBody.forces[node2.id].x -= fx;
					this.physicsBody.forces[node2.id].y -= fy;
				}
			}
		}
	]);
	return SpringSolver$1;
}();
/**
* Hierarchical Spring Solver
*/
var HierarchicalSpringSolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function HierarchicalSpringSolver$1(body, physicsBody, options) {
		_classCallCheck(this, HierarchicalSpringSolver$1);
		this.body = body;
		this.physicsBody = physicsBody;
		this.setOptions(options);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(HierarchicalSpringSolver$1, [{
		key: "setOptions",
		value: function setOptions(options) {
			this.options = options;
		}
	}, {
		key: "solve",
		value: function solve() {
			var edgeLength, edge;
			var dx, dy, fx, fy, springForce, distance;
			var edges = this.body.edges;
			var factor = .5;
			var edgeIndices = this.physicsBody.physicsEdgeIndices;
			var nodeIndices = this.physicsBody.physicsNodeIndices;
			var forces = this.physicsBody.forces;
			for (var i$2 = 0; i$2 < nodeIndices.length; i$2++) {
				var nodeId = nodeIndices[i$2];
				forces[nodeId].springFx = 0;
				forces[nodeId].springFy = 0;
			}
			for (var _i = 0; _i < edgeIndices.length; _i++) {
				edge = edges[edgeIndices[_i]];
				if (edge.connected === true) {
					edgeLength = edge.options.length === void 0 ? this.options.springLength : edge.options.length;
					dx = edge.from.x - edge.to.x;
					dy = edge.from.y - edge.to.y;
					distance = Math.sqrt(dx * dx + dy * dy);
					distance = distance === 0 ? .01 : distance;
					springForce = this.options.springConstant * (edgeLength - distance) / distance;
					fx = dx * springForce;
					fy = dy * springForce;
					if (edge.to.level != edge.from.level) {
						if (forces[edge.toId] !== void 0) {
							forces[edge.toId].springFx -= fx;
							forces[edge.toId].springFy -= fy;
						}
						if (forces[edge.fromId] !== void 0) {
							forces[edge.fromId].springFx += fx;
							forces[edge.fromId].springFy += fy;
						}
					} else {
						if (forces[edge.toId] !== void 0) {
							forces[edge.toId].x -= factor * fx;
							forces[edge.toId].y -= factor * fy;
						}
						if (forces[edge.fromId] !== void 0) {
							forces[edge.fromId].x += factor * fx;
							forces[edge.fromId].y += factor * fy;
						}
					}
				}
			}
			springForce = 1;
			var springFx, springFy;
			for (var _i2 = 0; _i2 < nodeIndices.length; _i2++) {
				var _nodeId = nodeIndices[_i2];
				springFx = Math.min(springForce, Math.max(-springForce, forces[_nodeId].springFx));
				springFy = Math.min(springForce, Math.max(-springForce, forces[_nodeId].springFy));
				forces[_nodeId].x += springFx;
				forces[_nodeId].y += springFy;
			}
			var totalFx = 0;
			var totalFy = 0;
			for (var _i3 = 0; _i3 < nodeIndices.length; _i3++) {
				var _nodeId2 = nodeIndices[_i3];
				totalFx += forces[_nodeId2].x;
				totalFy += forces[_nodeId2].y;
			}
			var correctionFx = totalFx / nodeIndices.length;
			var correctionFy = totalFy / nodeIndices.length;
			for (var _i4 = 0; _i4 < nodeIndices.length; _i4++) {
				var _nodeId3 = nodeIndices[_i4];
				forces[_nodeId3].x -= correctionFx;
				forces[_nodeId3].y -= correctionFy;
			}
		}
	}]);
	return HierarchicalSpringSolver$1;
}();
/**
* Central Gravity Solver
*/
var CentralGravitySolver = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function CentralGravitySolver$1(body, physicsBody, options) {
		_classCallCheck(this, CentralGravitySolver$1);
		this.body = body;
		this.physicsBody = physicsBody;
		this.setOptions(options);
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(CentralGravitySolver$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				this.options = options;
			}
		},
		{
			key: "solve",
			value: function solve() {
				var dx, dy, distance, node$1;
				var nodes = this.body.nodes;
				var nodeIndices = this.physicsBody.physicsNodeIndices;
				var forces = this.physicsBody.forces;
				for (var i$2 = 0; i$2 < nodeIndices.length; i$2++) {
					var nodeId = nodeIndices[i$2];
					node$1 = nodes[nodeId];
					dx = -node$1.x;
					dy = -node$1.y;
					distance = Math.sqrt(dx * dx + dy * dy);
					this._calculateForces(distance, dx, dy, forces, node$1);
				}
			}
		},
		{
			key: "_calculateForces",
			value: function _calculateForces(distance, dx, dy, forces, node$1) {
				var gravityForce = distance === 0 ? 0 : this.options.centralGravity / distance;
				forces[node$1.id].x = dx * gravityForce;
				forces[node$1.id].y = dy * gravityForce;
			}
		}
	]);
	return CentralGravitySolver$1;
}();
function _createSuper$3(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$3();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$3() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* @augments BarnesHutSolver
*/
var ForceAtlas2BasedRepulsionSolver = /* @__PURE__ */ function(_BarnesHutSolver) {
	_inherits(ForceAtlas2BasedRepulsionSolver$1, _BarnesHutSolver);
	var _super = _createSuper$3(ForceAtlas2BasedRepulsionSolver$1);
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function ForceAtlas2BasedRepulsionSolver$1(body, physicsBody, options) {
		var _this;
		_classCallCheck(this, ForceAtlas2BasedRepulsionSolver$1);
		_this = _super.call(this, body, physicsBody, options);
		_this._rng = Alea("FORCE ATLAS 2 BASED REPULSION SOLVER");
		return _this;
	}
	/**
	* Calculate the forces based on the distance.
	*
	* @param {number} distance
	* @param {number} dx
	* @param {number} dy
	* @param {Node} node
	* @param {object} parentBranch
	* @private
	*/
	_createClass(ForceAtlas2BasedRepulsionSolver$1, [{
		key: "_calculateForces",
		value: function _calculateForces(distance, dx, dy, node$1, parentBranch) {
			if (distance === 0) {
				distance = .1 * this._rng();
				dx = distance;
			}
			if (this.overlapAvoidanceFactor < 1 && node$1.shape.radius) distance = Math.max(.1 + this.overlapAvoidanceFactor * node$1.shape.radius, distance - node$1.shape.radius);
			var degree = node$1.edges.length + 1;
			var gravityForce = this.options.gravitationalConstant * parentBranch.mass * node$1.options.mass * degree / Math.pow(distance, 2);
			var fx = dx * gravityForce;
			var fy = dy * gravityForce;
			this.physicsBody.forces[node$1.id].x += fx;
			this.physicsBody.forces[node$1.id].y += fy;
		}
	}]);
	return ForceAtlas2BasedRepulsionSolver$1;
}(BarnesHutSolver);
function _createSuper$2(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$2();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$2() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* @augments CentralGravitySolver
*/
var ForceAtlas2BasedCentralGravitySolver = /* @__PURE__ */ function(_CentralGravitySolver) {
	_inherits(ForceAtlas2BasedCentralGravitySolver$1, _CentralGravitySolver);
	var _super = _createSuper$2(ForceAtlas2BasedCentralGravitySolver$1);
	/**
	* @param {object} body
	* @param {{physicsNodeIndices: Array, physicsEdgeIndices: Array, forces: {}, velocities: {}}} physicsBody
	* @param {object} options
	*/
	function ForceAtlas2BasedCentralGravitySolver$1(body, physicsBody, options) {
		_classCallCheck(this, ForceAtlas2BasedCentralGravitySolver$1);
		return _super.call(this, body, physicsBody, options);
	}
	/**
	* Calculate the forces based on the distance.
	*
	* @param {number} distance
	* @param {number} dx
	* @param {number} dy
	* @param {Object<Node.id, Node>} forces
	* @param {Node} node
	* @private
	*/
	_createClass(ForceAtlas2BasedCentralGravitySolver$1, [{
		key: "_calculateForces",
		value: function _calculateForces(distance, dx, dy, forces, node$1) {
			if (distance > 0) {
				var degree = node$1.edges.length + 1;
				var gravityForce = this.options.centralGravity * degree * node$1.options.mass;
				forces[node$1.id].x = dx * gravityForce;
				forces[node$1.id].y = dy * gravityForce;
			}
		}
	}]);
	return ForceAtlas2BasedCentralGravitySolver$1;
}(CentralGravitySolver);
/**
* The physics engine
*/
var PhysicsEngine = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	*/
	function PhysicsEngine$1(body) {
		_classCallCheck(this, PhysicsEngine$1);
		this.body = body;
		this.physicsBody = {
			physicsNodeIndices: [],
			physicsEdgeIndices: [],
			forces: {},
			velocities: {}
		};
		this.physicsEnabled = true;
		this.simulationInterval = 1e3 / 60;
		this.requiresTimeout = true;
		this.previousStates = {};
		this.referenceState = {};
		this.freezeCache = {};
		this.renderTimer = void 0;
		this.adaptiveTimestep = false;
		this.adaptiveTimestepEnabled = false;
		this.adaptiveCounter = 0;
		this.adaptiveInterval = 3;
		this.stabilized = false;
		this.startedStabilization = false;
		this.stabilizationIterations = 0;
		this.ready = false;
		this.options = {};
		this.defaultOptions = {
			enabled: true,
			barnesHut: {
				theta: .5,
				gravitationalConstant: -2e3,
				centralGravity: .3,
				springLength: 95,
				springConstant: .04,
				damping: .09,
				avoidOverlap: 0
			},
			forceAtlas2Based: {
				theta: .5,
				gravitationalConstant: -50,
				centralGravity: .01,
				springConstant: .08,
				springLength: 100,
				damping: .4,
				avoidOverlap: 0
			},
			repulsion: {
				centralGravity: .2,
				springLength: 200,
				springConstant: .05,
				nodeDistance: 100,
				damping: .09,
				avoidOverlap: 0
			},
			hierarchicalRepulsion: {
				centralGravity: 0,
				springLength: 100,
				springConstant: .01,
				nodeDistance: 120,
				damping: .09
			},
			maxVelocity: 50,
			minVelocity: .75,
			solver: "barnesHut",
			stabilization: {
				enabled: true,
				iterations: 1e3,
				updateInterval: 50,
				onlyDynamicEdges: false,
				fit: true
			},
			timestep: .5,
			adaptiveTimestep: true,
			wind: {
				x: 0,
				y: 0
			}
		};
		_Object$assign(this.options, this.defaultOptions);
		this.timestep = .5;
		this.layoutFailed = false;
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(PhysicsEngine$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this = this;
				this.body.emitter.on("initPhysics", function() {
					_this.initPhysics();
				});
				this.body.emitter.on("_layoutFailed", function() {
					_this.layoutFailed = true;
				});
				this.body.emitter.on("resetPhysics", function() {
					_this.stopSimulation();
					_this.ready = false;
				});
				this.body.emitter.on("disablePhysics", function() {
					_this.physicsEnabled = false;
					_this.stopSimulation();
				});
				this.body.emitter.on("restorePhysics", function() {
					_this.setOptions(_this.options);
					if (_this.ready === true) _this.startSimulation();
				});
				this.body.emitter.on("startSimulation", function() {
					if (_this.ready === true) _this.startSimulation();
				});
				this.body.emitter.on("stopSimulation", function() {
					_this.stopSimulation();
				});
				this.body.emitter.on("destroy", function() {
					_this.stopSimulation(false);
					_this.body.emitter.off();
				});
				this.body.emitter.on("_dataChanged", function() {
					_this.updatePhysicsData();
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) if (options === false) {
					this.options.enabled = false;
					this.physicsEnabled = false;
					this.stopSimulation();
				} else if (options === true) {
					this.options.enabled = true;
					this.physicsEnabled = true;
					this.startSimulation();
				} else {
					this.physicsEnabled = true;
					selectiveNotDeepExtend(["stabilization"], this.options, options);
					mergeOptions(this.options, options, "stabilization");
					if (options.enabled === void 0) this.options.enabled = true;
					if (this.options.enabled === false) {
						this.physicsEnabled = false;
						this.stopSimulation();
					}
					var wind = this.options.wind;
					if (wind) {
						if (typeof wind.x !== "number" || _Number$isNaN(wind.x)) wind.x = 0;
						if (typeof wind.y !== "number" || _Number$isNaN(wind.y)) wind.y = 0;
					}
					this.timestep = this.options.timestep;
				}
				this.init();
			}
		},
		{
			key: "init",
			value: function init() {
				var options;
				if (this.options.solver === "forceAtlas2Based") {
					options = this.options.forceAtlas2Based;
					this.nodesSolver = new ForceAtlas2BasedRepulsionSolver(this.body, this.physicsBody, options);
					this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);
					this.gravitySolver = new ForceAtlas2BasedCentralGravitySolver(this.body, this.physicsBody, options);
				} else if (this.options.solver === "repulsion") {
					options = this.options.repulsion;
					this.nodesSolver = new RepulsionSolver(this.body, this.physicsBody, options);
					this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);
					this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);
				} else if (this.options.solver === "hierarchicalRepulsion") {
					options = this.options.hierarchicalRepulsion;
					this.nodesSolver = new HierarchicalRepulsionSolver(this.body, this.physicsBody, options);
					this.edgesSolver = new HierarchicalSpringSolver(this.body, this.physicsBody, options);
					this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);
				} else {
					options = this.options.barnesHut;
					this.nodesSolver = new BarnesHutSolver(this.body, this.physicsBody, options);
					this.edgesSolver = new SpringSolver(this.body, this.physicsBody, options);
					this.gravitySolver = new CentralGravitySolver(this.body, this.physicsBody, options);
				}
				this.modelOptions = options;
			}
		},
		{
			key: "initPhysics",
			value: function initPhysics() {
				if (this.physicsEnabled === true && this.options.enabled === true) if (this.options.stabilization.enabled === true) this.stabilize();
				else {
					this.stabilized = false;
					this.ready = true;
					this.body.emitter.emit("fit", {}, this.layoutFailed);
					this.startSimulation();
				}
				else {
					this.ready = true;
					this.body.emitter.emit("fit");
				}
			}
		},
		{
			key: "startSimulation",
			value: function startSimulation() {
				if (this.physicsEnabled === true && this.options.enabled === true) {
					this.stabilized = false;
					this.adaptiveTimestep = false;
					this.body.emitter.emit("_resizeNodes");
					if (this.viewFunction === void 0) {
						var _context;
						this.viewFunction = _bindInstanceProperty$1(_context = this.simulationStep).call(_context, this);
						this.body.emitter.on("initRedraw", this.viewFunction);
						this.body.emitter.emit("_startRendering");
					}
				} else this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "stopSimulation",
			value: function stopSimulation() {
				var emit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
				this.stabilized = true;
				if (emit === true) this._emitStabilized();
				if (this.viewFunction !== void 0) {
					this.body.emitter.off("initRedraw", this.viewFunction);
					this.viewFunction = void 0;
					if (emit === true) this.body.emitter.emit("_stopRendering");
				}
			}
		},
		{
			key: "simulationStep",
			value: function simulationStep() {
				var startTime = _Date$now();
				this.physicsTick();
				var physicsTime = _Date$now() - startTime;
				if ((physicsTime < .4 * this.simulationInterval || this.runDoubleSpeed === true) && this.stabilized === false) {
					this.physicsTick();
					this.runDoubleSpeed = true;
				}
				if (this.stabilized === true) this.stopSimulation();
			}
		},
		{
			key: "_emitStabilized",
			value: function _emitStabilized() {
				var _this2 = this;
				var amountOfIterations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.stabilizationIterations;
				if (this.stabilizationIterations > 1 || this.startedStabilization === true) _setTimeout(function() {
					_this2.body.emitter.emit("stabilized", { iterations: amountOfIterations });
					_this2.startedStabilization = false;
					_this2.stabilizationIterations = 0;
				}, 0);
			}
		},
		{
			key: "physicsStep",
			value: function physicsStep() {
				this.gravitySolver.solve();
				this.nodesSolver.solve();
				this.edgesSolver.solve();
				this.moveNodes();
			}
		},
		{
			key: "adjustTimeStep",
			value: function adjustTimeStep() {
				var factor = 1.2;
				if (this._evaluateStepQuality() === true) this.timestep = factor * this.timestep;
				else if (this.timestep / factor < this.options.timestep) this.timestep = this.options.timestep;
				else {
					this.adaptiveCounter = -1;
					this.timestep = Math.max(this.options.timestep, this.timestep / factor);
				}
			}
		},
		{
			key: "physicsTick",
			value: function physicsTick() {
				this._startStabilizing();
				if (this.stabilized === true) return;
				if (this.adaptiveTimestep === true && this.adaptiveTimestepEnabled === true) {
					var doAdaptive = this.adaptiveCounter % this.adaptiveInterval === 0;
					if (doAdaptive) {
						this.timestep = 2 * this.timestep;
						this.physicsStep();
						this.revert();
						this.timestep = .5 * this.timestep;
						this.physicsStep();
						this.physicsStep();
						this.adjustTimeStep();
					} else this.physicsStep();
					this.adaptiveCounter += 1;
				} else {
					this.timestep = this.options.timestep;
					this.physicsStep();
				}
				if (this.stabilized === true) this.revert();
				this.stabilizationIterations++;
			}
		},
		{
			key: "updatePhysicsData",
			value: function updatePhysicsData() {
				this.physicsBody.forces = {};
				this.physicsBody.physicsNodeIndices = [];
				this.physicsBody.physicsEdgeIndices = [];
				var nodes = this.body.nodes;
				var edges = this.body.edges;
				for (var nodeId in nodes) if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {
					if (nodes[nodeId].options.physics === true) this.physicsBody.physicsNodeIndices.push(nodes[nodeId].id);
				}
				for (var edgeId in edges) if (Object.prototype.hasOwnProperty.call(edges, edgeId)) {
					if (edges[edgeId].options.physics === true) this.physicsBody.physicsEdgeIndices.push(edges[edgeId].id);
				}
				for (var i$2 = 0; i$2 < this.physicsBody.physicsNodeIndices.length; i$2++) {
					var _nodeId = this.physicsBody.physicsNodeIndices[i$2];
					this.physicsBody.forces[_nodeId] = {
						x: 0,
						y: 0
					};
					if (this.physicsBody.velocities[_nodeId] === void 0) this.physicsBody.velocities[_nodeId] = {
						x: 0,
						y: 0
					};
				}
				for (var _nodeId2 in this.physicsBody.velocities) if (nodes[_nodeId2] === void 0) delete this.physicsBody.velocities[_nodeId2];
			}
		},
		{
			key: "revert",
			value: function revert() {
				var nodeIds = _Object$keys(this.previousStates);
				var nodes = this.body.nodes;
				var velocities = this.physicsBody.velocities;
				this.referenceState = {};
				for (var i$2 = 0; i$2 < nodeIds.length; i$2++) {
					var nodeId = nodeIds[i$2];
					if (nodes[nodeId] !== void 0) {
						if (nodes[nodeId].options.physics === true) {
							this.referenceState[nodeId] = { positions: {
								x: nodes[nodeId].x,
								y: nodes[nodeId].y
							} };
							velocities[nodeId].x = this.previousStates[nodeId].vx;
							velocities[nodeId].y = this.previousStates[nodeId].vy;
							nodes[nodeId].x = this.previousStates[nodeId].x;
							nodes[nodeId].y = this.previousStates[nodeId].y;
						}
					} else delete this.previousStates[nodeId];
				}
			}
		},
		{
			key: "_evaluateStepQuality",
			value: function _evaluateStepQuality() {
				var dx, dy, dpos;
				var nodes = this.body.nodes;
				var reference = this.referenceState;
				var posThreshold = .3;
				for (var nodeId in this.referenceState) if (Object.prototype.hasOwnProperty.call(this.referenceState, nodeId) && nodes[nodeId] !== void 0) {
					dx = nodes[nodeId].x - reference[nodeId].positions.x;
					dy = nodes[nodeId].y - reference[nodeId].positions.y;
					dpos = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
					if (dpos > posThreshold) return false;
				}
				return true;
			}
		},
		{
			key: "moveNodes",
			value: function moveNodes() {
				var nodeIndices = this.physicsBody.physicsNodeIndices;
				var maxNodeVelocity = 0;
				var averageNodeVelocity = 0;
				var velocityAdaptiveThreshold = 5;
				for (var i$2 = 0; i$2 < nodeIndices.length; i$2++) {
					var nodeId = nodeIndices[i$2];
					var nodeVelocity = this._performStep(nodeId);
					maxNodeVelocity = Math.max(maxNodeVelocity, nodeVelocity);
					averageNodeVelocity += nodeVelocity;
				}
				this.adaptiveTimestepEnabled = averageNodeVelocity / nodeIndices.length < velocityAdaptiveThreshold;
				this.stabilized = maxNodeVelocity < this.options.minVelocity;
			}
		},
		{
			key: "calculateComponentVelocity",
			value: function calculateComponentVelocity(v, f, m) {
				var df = this.modelOptions.damping * v;
				var a = (f - df) / m;
				v += a * this.timestep;
				var maxV = this.options.maxVelocity || 1e9;
				if (Math.abs(v) > maxV) v = v > 0 ? maxV : -maxV;
				return v;
			}
		},
		{
			key: "_performStep",
			value: function _performStep(nodeId) {
				var node$1 = this.body.nodes[nodeId];
				var force = this.physicsBody.forces[nodeId];
				if (this.options.wind) {
					force.x += this.options.wind.x;
					force.y += this.options.wind.y;
				}
				var velocity = this.physicsBody.velocities[nodeId];
				this.previousStates[nodeId] = {
					x: node$1.x,
					y: node$1.y,
					vx: velocity.x,
					vy: velocity.y
				};
				if (node$1.options.fixed.x === false) {
					velocity.x = this.calculateComponentVelocity(velocity.x, force.x, node$1.options.mass);
					node$1.x += velocity.x * this.timestep;
				} else {
					force.x = 0;
					velocity.x = 0;
				}
				if (node$1.options.fixed.y === false) {
					velocity.y = this.calculateComponentVelocity(velocity.y, force.y, node$1.options.mass);
					node$1.y += velocity.y * this.timestep;
				} else {
					force.y = 0;
					velocity.y = 0;
				}
				var totalVelocity = Math.sqrt(Math.pow(velocity.x, 2) + Math.pow(velocity.y, 2));
				return totalVelocity;
			}
		},
		{
			key: "_freezeNodes",
			value: function _freezeNodes() {
				var nodes = this.body.nodes;
				for (var id$4 in nodes) if (Object.prototype.hasOwnProperty.call(nodes, id$4)) {
					if (nodes[id$4].x && nodes[id$4].y) {
						var fixed = nodes[id$4].options.fixed;
						this.freezeCache[id$4] = {
							x: fixed.x,
							y: fixed.y
						};
						fixed.x = true;
						fixed.y = true;
					}
				}
			}
		},
		{
			key: "_restoreFrozenNodes",
			value: function _restoreFrozenNodes() {
				var nodes = this.body.nodes;
				for (var id$4 in nodes) if (Object.prototype.hasOwnProperty.call(nodes, id$4)) {
					if (this.freezeCache[id$4] !== void 0) {
						nodes[id$4].options.fixed.x = this.freezeCache[id$4].x;
						nodes[id$4].options.fixed.y = this.freezeCache[id$4].y;
					}
				}
				this.freezeCache = {};
			}
		},
		{
			key: "stabilize",
			value: function stabilize() {
				var _this3 = this;
				var iterations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.stabilization.iterations;
				if (typeof iterations !== "number") {
					iterations = this.options.stabilization.iterations;
					console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ", iterations);
				}
				if (this.physicsBody.physicsNodeIndices.length === 0) {
					this.ready = true;
					return;
				}
				this.adaptiveTimestep = this.options.adaptiveTimestep;
				this.body.emitter.emit("_resizeNodes");
				this.stopSimulation();
				this.stabilized = false;
				this.body.emitter.emit("_blockRedraw");
				this.targetIterations = iterations;
				if (this.options.stabilization.onlyDynamicEdges === true) this._freezeNodes();
				this.stabilizationIterations = 0;
				_setTimeout(function() {
					return _this3._stabilizationBatch();
				}, 0);
			}
		},
		{
			key: "_startStabilizing",
			value: function _startStabilizing() {
				if (this.startedStabilization === true) return false;
				this.body.emitter.emit("startStabilizing");
				this.startedStabilization = true;
				return true;
			}
		},
		{
			key: "_stabilizationBatch",
			value: function _stabilizationBatch() {
				var _this4 = this;
				var running = function running$1() {
					return _this4.stabilized === false && _this4.stabilizationIterations < _this4.targetIterations;
				};
				var sendProgress = function sendProgress$1() {
					_this4.body.emitter.emit("stabilizationProgress", {
						iterations: _this4.stabilizationIterations,
						total: _this4.targetIterations
					});
				};
				if (this._startStabilizing()) sendProgress();
				var count = 0;
				while (running() && count < this.options.stabilization.updateInterval) {
					this.physicsTick();
					count++;
				}
				sendProgress();
				if (running()) {
					var _context2;
					_setTimeout(_bindInstanceProperty$1(_context2 = this._stabilizationBatch).call(_context2, this), 0);
				} else this._finalizeStabilization();
			}
		},
		{
			key: "_finalizeStabilization",
			value: function _finalizeStabilization() {
				this.body.emitter.emit("_allowRedraw");
				if (this.options.stabilization.fit === true) this.body.emitter.emit("fit");
				if (this.options.stabilization.onlyDynamicEdges === true) this._restoreFrozenNodes();
				this.body.emitter.emit("stabilizationIterationsDone");
				this.body.emitter.emit("_requestRedraw");
				if (this.stabilized === true) this._emitStabilized();
				else this.startSimulation();
				this.ready = true;
			}
		},
		{
			key: "_drawForces",
			value: function _drawForces(ctx) {
				for (var i$2 = 0; i$2 < this.physicsBody.physicsNodeIndices.length; i$2++) {
					var index$1 = this.physicsBody.physicsNodeIndices[i$2];
					var node$1 = this.body.nodes[index$1];
					var force = this.physicsBody.forces[index$1];
					var factor = 20;
					var colorFactor = .03;
					var forceSize = Math.sqrt(Math.pow(force.x, 2) + Math.pow(force.x, 2));
					var size = Math.min(Math.max(5, forceSize), 15);
					var arrowSize = 3 * size;
					var color = HSVToHex((180 - Math.min(1, Math.max(0, colorFactor * forceSize)) * 180) / 360, 1, 1);
					var point = {
						x: node$1.x + factor * force.x,
						y: node$1.y + factor * force.y
					};
					ctx.lineWidth = size;
					ctx.strokeStyle = color;
					ctx.beginPath();
					ctx.moveTo(node$1.x, node$1.y);
					ctx.lineTo(point.x, point.y);
					ctx.stroke();
					var angle = Math.atan2(force.y, force.x);
					ctx.fillStyle = color;
					EndPoints.draw(ctx, {
						type: "arrow",
						point,
						angle,
						length: arrowSize
					});
					_fillInstanceProperty(ctx).call(ctx);
				}
			}
		}
	]);
	return PhysicsEngine$1;
}();
let getRandomValues;
const rnds8 = new Uint8Array(16);
function rng() {
	if (!getRandomValues) {
		getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
		if (!getRandomValues) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
	}
	return getRandomValues(rnds8);
}
/**
* Convert array of 16 byte values to UUID string format of the form:
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
*/
const byteToHex = [];
for (let i$2 = 0; i$2 < 256; ++i$2) byteToHex.push((i$2 + 256).toString(16).slice(1));
function unsafeStringify(arr, offset = 0) {
	return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
}
const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
var native = { randomUUID };
function v4(options, buf, offset) {
	if (native.randomUUID && !buf && !options) return native.randomUUID();
	options = options || {};
	const rnds = options.random || (options.rng || rng)();
	rnds[6] = rnds[6] & 15 | 64;
	rnds[8] = rnds[8] & 63 | 128;
	if (buf) {
		offset = offset || 0;
		for (let i$2 = 0; i$2 < 16; ++i$2) buf[offset + i$2] = rnds[i$2];
		return buf;
	}
	return unsafeStringify(rnds);
}
/**
* Utility Class
*/
var NetworkUtil = /* @__PURE__ */ function() {
	/**
	* @ignore
	*/
	function NetworkUtil$1() {
		_classCallCheck(this, NetworkUtil$1);
	}
	/**
	* Find the center position of the network considering the bounding boxes
	*
	* @param {Array.<Node>} allNodes
	* @param {Array.<Node>} [specificNodes=[]]
	* @returns {{minX: number, maxX: number, minY: number, maxY: number}}
	* @static
	*/
	_createClass(NetworkUtil$1, null, [
		{
			key: "getRange",
			value: function getRange(allNodes) {
				var specificNodes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
				var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node$1;
				if (specificNodes.length > 0) for (var i$2 = 0; i$2 < specificNodes.length; i$2++) {
					node$1 = allNodes[specificNodes[i$2]];
					if (minX > node$1.shape.boundingBox.left) minX = node$1.shape.boundingBox.left;
					if (maxX < node$1.shape.boundingBox.right) maxX = node$1.shape.boundingBox.right;
					if (minY > node$1.shape.boundingBox.top) minY = node$1.shape.boundingBox.top;
					if (maxY < node$1.shape.boundingBox.bottom) maxY = node$1.shape.boundingBox.bottom;
				}
				if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) minY = 0, maxY = 0, minX = 0, maxX = 0;
				return {
					minX,
					maxX,
					minY,
					maxY
				};
			}
		},
		{
			key: "getRangeCore",
			value: function getRangeCore(allNodes) {
				var specificNodes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
				var minY = 1e9, maxY = -1e9, minX = 1e9, maxX = -1e9, node$1;
				if (specificNodes.length > 0) for (var i$2 = 0; i$2 < specificNodes.length; i$2++) {
					node$1 = allNodes[specificNodes[i$2]];
					if (minX > node$1.x) minX = node$1.x;
					if (maxX < node$1.x) maxX = node$1.x;
					if (minY > node$1.y) minY = node$1.y;
					if (maxY < node$1.y) maxY = node$1.y;
				}
				if (minX === 1e9 && maxX === -1e9 && minY === 1e9 && maxY === -1e9) minY = 0, maxY = 0, minX = 0, maxX = 0;
				return {
					minX,
					maxX,
					minY,
					maxY
				};
			}
		},
		{
			key: "findCenter",
			value: function findCenter(range) {
				return {
					x: .5 * (range.maxX + range.minX),
					y: .5 * (range.maxY + range.minY)
				};
			}
		},
		{
			key: "cloneOptions",
			value: function cloneOptions(item, type) {
				var clonedOptions = {};
				if (type === void 0 || type === "node") {
					deepExtend(clonedOptions, item.options, true);
					clonedOptions.x = item.x;
					clonedOptions.y = item.y;
					clonedOptions.amountOfConnections = item.edges.length;
				} else deepExtend(clonedOptions, item.options, true);
				return clonedOptions;
			}
		}
	]);
	return NetworkUtil$1;
}();
function _createSuper$1(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct$1();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct$1() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* A Cluster is a special Node that allows a group of Nodes positioned closely together
* to be represented by a single Cluster Node.
*
* @augments Node
*/
var Cluster = /* @__PURE__ */ function(_Node) {
	_inherits(Cluster$1, _Node);
	var _super = _createSuper$1(Cluster$1);
	/**
	* @param {object} options
	* @param {object} body
	* @param {Array.<HTMLImageElement>}imagelist
	* @param {Array} grouplist
	* @param {object} globalOptions
	* @param {object} defaultOptions     Global default options for nodes
	*/
	function Cluster$1(options, body, imagelist, grouplist, globalOptions, defaultOptions) {
		var _this;
		_classCallCheck(this, Cluster$1);
		_this = _super.call(this, options, body, imagelist, grouplist, globalOptions, defaultOptions);
		_this.isCluster = true;
		_this.containedNodes = {};
		_this.containedEdges = {};
		return _this;
	}
	/**
	* Transfer child cluster data to current and disconnect the child cluster.
	*
	* Please consult the header comment in 'Clustering.js' for the fields set here.
	*
	* @param {string|number} childClusterId  id of child cluster to open
	*/
	_createClass(Cluster$1, [{
		key: "_openChildCluster",
		value: function _openChildCluster(childClusterId) {
			var _this2 = this;
			var childCluster = this.body.nodes[childClusterId];
			if (this.containedNodes[childClusterId] === void 0) throw new Error("node with id: " + childClusterId + " not in current cluster");
			if (!childCluster.isCluster) throw new Error("node with id: " + childClusterId + " is not a cluster");
			delete this.containedNodes[childClusterId];
			forEach$1(childCluster.edges, function(edge) {
				delete _this2.containedEdges[edge.id];
			});
			forEach$1(childCluster.containedNodes, function(node$1, nodeId) {
				_this2.containedNodes[nodeId] = node$1;
			});
			childCluster.containedNodes = {};
			forEach$1(childCluster.containedEdges, function(edge, edgeId) {
				_this2.containedEdges[edgeId] = edge;
			});
			childCluster.containedEdges = {};
			forEach$1(childCluster.edges, function(clusterEdge) {
				forEach$1(_this2.edges, function(parentClusterEdge) {
					var _context, _context2;
					var index$1 = _indexOfInstanceProperty(_context = parentClusterEdge.clusteringEdgeReplacingIds).call(_context, clusterEdge.id);
					if (index$1 === -1) return;
					forEach$1(clusterEdge.clusteringEdgeReplacingIds, function(srcId) {
						parentClusterEdge.clusteringEdgeReplacingIds.push(srcId);
						_this2.body.edges[srcId].edgeReplacedById = parentClusterEdge.id;
					});
					_spliceInstanceProperty(_context2 = parentClusterEdge.clusteringEdgeReplacingIds).call(_context2, index$1, 1);
				});
			});
			childCluster.edges = [];
		}
	}]);
	return Cluster$1;
}(Node);
/**
* The clustering engine
*/
var ClusterEngine = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	*/
	function ClusterEngine$1(body) {
		var _this = this;
		_classCallCheck(this, ClusterEngine$1);
		this.body = body;
		this.clusteredNodes = {};
		this.clusteredEdges = {};
		this.options = {};
		this.defaultOptions = {};
		_Object$assign(this.options, this.defaultOptions);
		this.body.emitter.on("_resetData", function() {
			_this.clusteredNodes = {};
			_this.clusteredEdges = {};
		});
	}
	/**
	*
	* @param {number} hubsize
	* @param {object} options
	*/
	_createClass(ClusterEngine$1, [
		{
			key: "clusterByHubsize",
			value: function clusterByHubsize(hubsize, options) {
				if (hubsize === void 0) hubsize = this._getHubSize();
				else if (_typeof(hubsize) === "object") {
					options = this._checkOptions(hubsize);
					hubsize = this._getHubSize();
				}
				var nodesToCluster = [];
				for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) {
					var node$1 = this.body.nodes[this.body.nodeIndices[i$2]];
					if (node$1.edges.length >= hubsize) nodesToCluster.push(node$1.id);
				}
				for (var _i = 0; _i < nodesToCluster.length; _i++) this.clusterByConnection(nodesToCluster[_i], options, true);
				this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "cluster",
			value: function cluster() {
				var _this2 = this;
				var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
				var refreshData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				if (options.joinCondition === void 0) throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options.");
				options = this._checkOptions(options);
				var childNodesObj = {};
				var childEdgesObj = {};
				forEach$1(this.body.nodes, function(node$1, nodeId) {
					if (node$1.options && options.joinCondition(node$1.options) === true) {
						childNodesObj[nodeId] = node$1;
						forEach$1(node$1.edges, function(edge) {
							if (_this2.clusteredEdges[edge.id] === void 0) childEdgesObj[edge.id] = edge;
						});
					}
				});
				this._cluster(childNodesObj, childEdgesObj, options, refreshData);
			}
		},
		{
			key: "clusterByEdgeCount",
			value: function clusterByEdgeCount(edgeCount, options) {
				var _this3 = this;
				var refreshData = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
				options = this._checkOptions(options);
				var clusters = [];
				var usedNodes = {};
				var edge, edges, relevantEdgeCount;
				var _loop = function _loop$1() {
					var childNodesObj = {};
					var childEdgesObj = {};
					var nodeId = _this3.body.nodeIndices[i$2];
					var node$1 = _this3.body.nodes[nodeId];
					if (usedNodes[nodeId] === void 0) {
						relevantEdgeCount = 0;
						edges = [];
						for (var j = 0; j < node$1.edges.length; j++) {
							edge = node$1.edges[j];
							if (_this3.clusteredEdges[edge.id] === void 0) {
								if (edge.toId !== edge.fromId) relevantEdgeCount++;
								edges.push(edge);
							}
						}
						if (relevantEdgeCount === edgeCount) {
							var checkJoinCondition = function checkJoinCondition$1(node$2) {
								if (options.joinCondition === void 0 || options.joinCondition === null) return true;
								var clonedOptions = NetworkUtil.cloneOptions(node$2);
								return options.joinCondition(clonedOptions);
							};
							var gatheringSuccessful = true;
							for (var _j = 0; _j < edges.length; _j++) {
								edge = edges[_j];
								var childNodeId = _this3._getConnectedId(edge, nodeId);
								if (checkJoinCondition(node$1)) {
									childEdgesObj[edge.id] = edge;
									childNodesObj[nodeId] = node$1;
									childNodesObj[childNodeId] = _this3.body.nodes[childNodeId];
									usedNodes[nodeId] = true;
								} else {
									gatheringSuccessful = false;
									break;
								}
							}
							if (_Object$keys(childNodesObj).length > 0 && _Object$keys(childEdgesObj).length > 0 && gatheringSuccessful === true) {
								/**
								* Search for cluster data that contains any of the node id's
								*
								* @returns {boolean} true if no joinCondition, otherwise return value of joinCondition
								*/
								var findClusterData = function findClusterData$1() {
									for (var n = 0; n < clusters.length; ++n) for (var m$1 in childNodesObj) if (clusters[n].nodes[m$1] !== void 0) return clusters[n];
									return void 0;
								};
								var foundCluster = findClusterData();
								if (foundCluster !== void 0) {
									for (var m in childNodesObj) if (foundCluster.nodes[m] === void 0) foundCluster.nodes[m] = childNodesObj[m];
									for (var _m in childEdgesObj) if (foundCluster.edges[_m] === void 0) foundCluster.edges[_m] = childEdgesObj[_m];
								} else clusters.push({
									nodes: childNodesObj,
									edges: childEdgesObj
								});
							}
						}
					}
				};
				for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) _loop();
				for (var _i2 = 0; _i2 < clusters.length; _i2++) this._cluster(clusters[_i2].nodes, clusters[_i2].edges, options, false);
				if (refreshData === true) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "clusterOutliers",
			value: function clusterOutliers(options) {
				var refreshData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				this.clusterByEdgeCount(1, options, refreshData);
			}
		},
		{
			key: "clusterBridges",
			value: function clusterBridges(options) {
				var refreshData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				this.clusterByEdgeCount(2, options, refreshData);
			}
		},
		{
			key: "clusterByConnection",
			value: function clusterByConnection(nodeId, options) {
				var _context;
				var refreshData = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
				if (nodeId === void 0) throw new Error("No nodeId supplied to clusterByConnection!");
				if (this.body.nodes[nodeId] === void 0) throw new Error("The nodeId given to clusterByConnection does not exist!");
				var node$1 = this.body.nodes[nodeId];
				options = this._checkOptions(options, node$1);
				if (options.clusterNodeProperties.x === void 0) options.clusterNodeProperties.x = node$1.x;
				if (options.clusterNodeProperties.y === void 0) options.clusterNodeProperties.y = node$1.y;
				if (options.clusterNodeProperties.fixed === void 0) {
					options.clusterNodeProperties.fixed = {};
					options.clusterNodeProperties.fixed.x = node$1.options.fixed.x;
					options.clusterNodeProperties.fixed.y = node$1.options.fixed.y;
				}
				var childNodesObj = {};
				var childEdgesObj = {};
				var parentNodeId = node$1.id;
				var parentClonedOptions = NetworkUtil.cloneOptions(node$1);
				childNodesObj[parentNodeId] = node$1;
				for (var i$2 = 0; i$2 < node$1.edges.length; i$2++) {
					var edge = node$1.edges[i$2];
					if (this.clusteredEdges[edge.id] === void 0) {
						var childNodeId = this._getConnectedId(edge, parentNodeId);
						if (this.clusteredNodes[childNodeId] === void 0) if (childNodeId !== parentNodeId) if (options.joinCondition === void 0) {
							childEdgesObj[edge.id] = edge;
							childNodesObj[childNodeId] = this.body.nodes[childNodeId];
						} else {
							var childClonedOptions = NetworkUtil.cloneOptions(this.body.nodes[childNodeId]);
							if (options.joinCondition(parentClonedOptions, childClonedOptions) === true) {
								childEdgesObj[edge.id] = edge;
								childNodesObj[childNodeId] = this.body.nodes[childNodeId];
							}
						}
						else childEdgesObj[edge.id] = edge;
					}
				}
				var childNodeIDs = _mapInstanceProperty(_context = _Object$keys(childNodesObj)).call(_context, function(childNode$1) {
					return childNodesObj[childNode$1].id;
				});
				for (var childNodeKey in childNodesObj) {
					if (!Object.prototype.hasOwnProperty.call(childNodesObj, childNodeKey)) continue;
					var childNode = childNodesObj[childNodeKey];
					for (var y = 0; y < childNode.edges.length; y++) {
						var childEdge = childNode.edges[y];
						if (_indexOfInstanceProperty(childNodeIDs).call(childNodeIDs, this._getConnectedId(childEdge, childNode.id)) > -1) childEdgesObj[childEdge.id] = childEdge;
					}
				}
				this._cluster(childNodesObj, childEdgesObj, options, refreshData);
			}
		},
		{
			key: "_createClusterEdges",
			value: function _createClusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, clusterEdgeProperties) {
				var edge, childNodeId, childNode, toId, fromId, otherNodeId;
				var childKeys = _Object$keys(childNodesObj);
				var createEdges = [];
				for (var i$2 = 0; i$2 < childKeys.length; i$2++) {
					childNodeId = childKeys[i$2];
					childNode = childNodesObj[childNodeId];
					for (var j = 0; j < childNode.edges.length; j++) {
						edge = childNode.edges[j];
						if (this.clusteredEdges[edge.id] === void 0) {
							if (edge.toId == edge.fromId) childEdgesObj[edge.id] = edge;
							else if (edge.toId == childNodeId) {
								toId = clusterNodeProperties.id;
								fromId = edge.fromId;
								otherNodeId = fromId;
							} else {
								toId = edge.toId;
								fromId = clusterNodeProperties.id;
								otherNodeId = toId;
							}
							if (childNodesObj[otherNodeId] === void 0) createEdges.push({
								edge,
								fromId,
								toId
							});
						}
					}
				}
				var newEdges = [];
				/**
				* Find a cluster edge which matches the given created edge.
				*
				* @param {vis.Edge} createdEdge
				* @returns {vis.Edge}
				*/
				var getNewEdge = function getNewEdge$1(createdEdge$1) {
					for (var _j2 = 0; _j2 < newEdges.length; _j2++) {
						var newEdge$1 = newEdges[_j2];
						var matchToDirection = createdEdge$1.fromId === newEdge$1.fromId && createdEdge$1.toId === newEdge$1.toId;
						var matchFromDirection = createdEdge$1.fromId === newEdge$1.toId && createdEdge$1.toId === newEdge$1.fromId;
						if (matchToDirection || matchFromDirection) return newEdge$1;
					}
					return null;
				};
				for (var _j3 = 0; _j3 < createEdges.length; _j3++) {
					var createdEdge = createEdges[_j3];
					var _edge = createdEdge.edge;
					var newEdge = getNewEdge(createdEdge);
					if (newEdge === null) {
						newEdge = this._createClusteredEdge(createdEdge.fromId, createdEdge.toId, _edge, clusterEdgeProperties);
						newEdges.push(newEdge);
					} else newEdge.clusteringEdgeReplacingIds.push(_edge.id);
					this.body.edges[_edge.id].edgeReplacedById = newEdge.id;
					this._backupEdgeOptions(_edge);
					_edge.setOptions({ physics: false });
				}
			}
		},
		{
			key: "_checkOptions",
			value: function _checkOptions() {
				var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
				if (options.clusterEdgeProperties === void 0) options.clusterEdgeProperties = {};
				if (options.clusterNodeProperties === void 0) options.clusterNodeProperties = {};
				return options;
			}
		},
		{
			key: "_cluster",
			value: function _cluster(childNodesObj, childEdgesObj, options) {
				var refreshData = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
				var tmpNodesToRemove = [];
				for (var nodeId in childNodesObj) if (Object.prototype.hasOwnProperty.call(childNodesObj, nodeId)) {
					if (this.clusteredNodes[nodeId] !== void 0) tmpNodesToRemove.push(nodeId);
				}
				for (var n = 0; n < tmpNodesToRemove.length; ++n) delete childNodesObj[tmpNodesToRemove[n]];
				if (_Object$keys(childNodesObj).length == 0) return;
				if (_Object$keys(childNodesObj).length == 1 && options.clusterNodeProperties.allowSingleNodeCluster != true) return;
				var clusterNodeProperties = deepExtend({}, options.clusterNodeProperties);
				if (options.processProperties !== void 0) {
					var childNodesOptions = [];
					for (var _nodeId in childNodesObj) if (Object.prototype.hasOwnProperty.call(childNodesObj, _nodeId)) {
						var clonedOptions = NetworkUtil.cloneOptions(childNodesObj[_nodeId]);
						childNodesOptions.push(clonedOptions);
					}
					var childEdgesOptions = [];
					for (var edgeId in childEdgesObj) if (Object.prototype.hasOwnProperty.call(childEdgesObj, edgeId)) {
						if (edgeId.substr(0, 12) !== "clusterEdge:") {
							var _clonedOptions = NetworkUtil.cloneOptions(childEdgesObj[edgeId], "edge");
							childEdgesOptions.push(_clonedOptions);
						}
					}
					clusterNodeProperties = options.processProperties(clusterNodeProperties, childNodesOptions, childEdgesOptions);
					if (!clusterNodeProperties) throw new Error("The processProperties function does not return properties!");
				}
				if (clusterNodeProperties.id === void 0) clusterNodeProperties.id = "cluster:" + v4();
				var clusterId = clusterNodeProperties.id;
				if (clusterNodeProperties.label === void 0) clusterNodeProperties.label = "cluster";
				var pos = void 0;
				if (clusterNodeProperties.x === void 0) {
					pos = this._getClusterPosition(childNodesObj);
					clusterNodeProperties.x = pos.x;
				}
				if (clusterNodeProperties.y === void 0) {
					if (pos === void 0) pos = this._getClusterPosition(childNodesObj);
					clusterNodeProperties.y = pos.y;
				}
				clusterNodeProperties.id = clusterId;
				var clusterNode = this.body.functions.createNode(clusterNodeProperties, Cluster);
				clusterNode.containedNodes = childNodesObj;
				clusterNode.containedEdges = childEdgesObj;
				clusterNode.clusterEdgeProperties = options.clusterEdgeProperties;
				this.body.nodes[clusterNodeProperties.id] = clusterNode;
				this._clusterEdges(childNodesObj, childEdgesObj, clusterNodeProperties, options.clusterEdgeProperties);
				clusterNodeProperties.id = void 0;
				if (refreshData === true) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "_backupEdgeOptions",
			value: function _backupEdgeOptions(edge) {
				if (this.clusteredEdges[edge.id] === void 0) this.clusteredEdges[edge.id] = { physics: edge.options.physics };
			}
		},
		{
			key: "_restoreEdge",
			value: function _restoreEdge(edge) {
				var originalOptions = this.clusteredEdges[edge.id];
				if (originalOptions !== void 0) {
					edge.setOptions({ physics: originalOptions.physics });
					delete this.clusteredEdges[edge.id];
				}
			}
		},
		{
			key: "isCluster",
			value: function isCluster(nodeId) {
				if (this.body.nodes[nodeId] !== void 0) return this.body.nodes[nodeId].isCluster === true;
				else {
					console.error("Node does not exist.");
					return false;
				}
			}
		},
		{
			key: "_getClusterPosition",
			value: function _getClusterPosition(childNodesObj) {
				var childKeys = _Object$keys(childNodesObj);
				var minX = childNodesObj[childKeys[0]].x;
				var maxX = childNodesObj[childKeys[0]].x;
				var minY = childNodesObj[childKeys[0]].y;
				var maxY = childNodesObj[childKeys[0]].y;
				var node$1;
				for (var i$2 = 1; i$2 < childKeys.length; i$2++) {
					node$1 = childNodesObj[childKeys[i$2]];
					minX = node$1.x < minX ? node$1.x : minX;
					maxX = node$1.x > maxX ? node$1.x : maxX;
					minY = node$1.y < minY ? node$1.y : minY;
					maxY = node$1.y > maxY ? node$1.y : maxY;
				}
				return {
					x: .5 * (minX + maxX),
					y: .5 * (minY + maxY)
				};
			}
		},
		{
			key: "openCluster",
			value: function openCluster(clusterNodeId, options) {
				var refreshData = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
				if (clusterNodeId === void 0) throw new Error("No clusterNodeId supplied to openCluster.");
				var clusterNode = this.body.nodes[clusterNodeId];
				if (clusterNode === void 0) throw new Error("The clusterNodeId supplied to openCluster does not exist.");
				if (clusterNode.isCluster !== true || clusterNode.containedNodes === void 0 || clusterNode.containedEdges === void 0) throw new Error("The node:" + clusterNodeId + " is not a valid cluster.");
				var stack = this.findNode(clusterNodeId);
				var parentIndex = _indexOfInstanceProperty(stack).call(stack, clusterNodeId) - 1;
				if (parentIndex >= 0) {
					var parentClusterNodeId = stack[parentIndex];
					var parentClusterNode = this.body.nodes[parentClusterNodeId];
					parentClusterNode._openChildCluster(clusterNodeId);
					delete this.body.nodes[clusterNodeId];
					if (refreshData === true) this.body.emitter.emit("_dataChanged");
					return;
				}
				var containedNodes = clusterNode.containedNodes;
				var containedEdges = clusterNode.containedEdges;
				if (options !== void 0 && options.releaseFunction !== void 0 && typeof options.releaseFunction === "function") {
					var positions = {};
					var clusterPosition = {
						x: clusterNode.x,
						y: clusterNode.y
					};
					for (var nodeId in containedNodes) if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) {
						var containedNode = this.body.nodes[nodeId];
						positions[nodeId] = {
							x: containedNode.x,
							y: containedNode.y
						};
					}
					var newPositions = options.releaseFunction(clusterPosition, positions);
					for (var _nodeId2 in containedNodes) if (Object.prototype.hasOwnProperty.call(containedNodes, _nodeId2)) {
						var _containedNode = this.body.nodes[_nodeId2];
						if (newPositions[_nodeId2] !== void 0) {
							_containedNode.x = newPositions[_nodeId2].x === void 0 ? clusterNode.x : newPositions[_nodeId2].x;
							_containedNode.y = newPositions[_nodeId2].y === void 0 ? clusterNode.y : newPositions[_nodeId2].y;
						}
					}
				} else forEach$1(containedNodes, function(containedNode$1) {
					if (containedNode$1.options.fixed.x === false) containedNode$1.x = clusterNode.x;
					if (containedNode$1.options.fixed.y === false) containedNode$1.y = clusterNode.y;
				});
				for (var _nodeId3 in containedNodes) if (Object.prototype.hasOwnProperty.call(containedNodes, _nodeId3)) {
					var _containedNode2 = this.body.nodes[_nodeId3];
					_containedNode2.vx = clusterNode.vx;
					_containedNode2.vy = clusterNode.vy;
					_containedNode2.setOptions({ physics: true });
					delete this.clusteredNodes[_nodeId3];
				}
				var edgesToBeDeleted = [];
				for (var i$2 = 0; i$2 < clusterNode.edges.length; i$2++) edgesToBeDeleted.push(clusterNode.edges[i$2]);
				for (var _i3 = 0; _i3 < edgesToBeDeleted.length; _i3++) {
					var edge = edgesToBeDeleted[_i3];
					var otherNodeId = this._getConnectedId(edge, clusterNodeId);
					var otherNode = this.clusteredNodes[otherNodeId];
					for (var j = 0; j < edge.clusteringEdgeReplacingIds.length; j++) {
						var transferId = edge.clusteringEdgeReplacingIds[j];
						var transferEdge = this.body.edges[transferId];
						if (transferEdge === void 0) continue;
						if (otherNode !== void 0) {
							var otherCluster = this.body.nodes[otherNode.clusterId];
							otherCluster.containedEdges[transferEdge.id] = transferEdge;
							delete containedEdges[transferEdge.id];
							var fromId = transferEdge.fromId;
							var toId = transferEdge.toId;
							if (transferEdge.toId == otherNodeId) toId = otherNode.clusterId;
							else fromId = otherNode.clusterId;
							this._createClusteredEdge(fromId, toId, transferEdge, otherCluster.clusterEdgeProperties, {
								hidden: false,
								physics: true
							});
						} else this._restoreEdge(transferEdge);
					}
					edge.remove();
				}
				for (var edgeId in containedEdges) if (Object.prototype.hasOwnProperty.call(containedEdges, edgeId)) this._restoreEdge(containedEdges[edgeId]);
				delete this.body.nodes[clusterNodeId];
				if (refreshData === true) this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "getNodesInCluster",
			value: function getNodesInCluster(clusterId) {
				var nodesArray = [];
				if (this.isCluster(clusterId) === true) {
					var containedNodes = this.body.nodes[clusterId].containedNodes;
					for (var nodeId in containedNodes) if (Object.prototype.hasOwnProperty.call(containedNodes, nodeId)) nodesArray.push(this.body.nodes[nodeId].id);
				}
				return nodesArray;
			}
		},
		{
			key: "findNode",
			value: function findNode(nodeId) {
				var stack = [];
				var max$5 = 100;
				var counter$1 = 0;
				var node$1;
				while (this.clusteredNodes[nodeId] !== void 0 && counter$1 < max$5) {
					node$1 = this.body.nodes[nodeId];
					if (node$1 === void 0) return [];
					stack.push(node$1.id);
					nodeId = this.clusteredNodes[nodeId].clusterId;
					counter$1++;
				}
				node$1 = this.body.nodes[nodeId];
				if (node$1 === void 0) return [];
				stack.push(node$1.id);
				_reverseInstanceProperty(stack).call(stack);
				return stack;
			}
		},
		{
			key: "updateClusteredNode",
			value: function updateClusteredNode(clusteredNodeId, newOptions) {
				if (clusteredNodeId === void 0) throw new Error("No clusteredNodeId supplied to updateClusteredNode.");
				if (newOptions === void 0) throw new Error("No newOptions supplied to updateClusteredNode.");
				if (this.body.nodes[clusteredNodeId] === void 0) throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist.");
				this.body.nodes[clusteredNodeId].setOptions(newOptions);
				this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "updateEdge",
			value: function updateEdge(startEdgeId, newOptions) {
				if (startEdgeId === void 0) throw new Error("No startEdgeId supplied to updateEdge.");
				if (newOptions === void 0) throw new Error("No newOptions supplied to updateEdge.");
				if (this.body.edges[startEdgeId] === void 0) throw new Error("The startEdgeId supplied to updateEdge does not exist.");
				var allEdgeIds = this.getClusteredEdges(startEdgeId);
				for (var i$2 = 0; i$2 < allEdgeIds.length; i$2++) {
					var edge = this.body.edges[allEdgeIds[i$2]];
					edge.setOptions(newOptions);
				}
				this.body.emitter.emit("_dataChanged");
			}
		},
		{
			key: "getClusteredEdges",
			value: function getClusteredEdges(edgeId) {
				var stack = [];
				var max$5 = 100;
				var counter$1 = 0;
				while (edgeId !== void 0 && this.body.edges[edgeId] !== void 0 && counter$1 < max$5) {
					stack.push(this.body.edges[edgeId].id);
					edgeId = this.body.edges[edgeId].edgeReplacedById;
					counter$1++;
				}
				_reverseInstanceProperty(stack).call(stack);
				return stack;
			}
		},
		{
			key: "getBaseEdge",
			value: function getBaseEdge(clusteredEdgeId) {
				return this.getBaseEdges(clusteredEdgeId)[0];
			}
		},
		{
			key: "getBaseEdges",
			value: function getBaseEdges(clusteredEdgeId) {
				var IdsToHandle = [clusteredEdgeId];
				var doneIds = [];
				var foundIds = [];
				var max$5 = 100;
				var counter$1 = 0;
				while (IdsToHandle.length > 0 && counter$1 < max$5) {
					var nextId = IdsToHandle.pop();
					if (nextId === void 0) continue;
					var nextEdge = this.body.edges[nextId];
					if (nextEdge === void 0) continue;
					counter$1++;
					var replacingIds = nextEdge.clusteringEdgeReplacingIds;
					if (replacingIds === void 0) foundIds.push(nextId);
					else for (var i$2 = 0; i$2 < replacingIds.length; ++i$2) {
						var replacingId = replacingIds[i$2];
						if (_indexOfInstanceProperty(IdsToHandle).call(IdsToHandle, replacingIds) !== -1 || _indexOfInstanceProperty(doneIds).call(doneIds, replacingIds) !== -1) continue;
						IdsToHandle.push(replacingId);
					}
					doneIds.push(nextId);
				}
				return foundIds;
			}
		},
		{
			key: "_getConnectedId",
			value: function _getConnectedId(edge, nodeId) {
				if (edge.toId != nodeId) return edge.toId;
				else if (edge.fromId != nodeId) return edge.fromId;
				else return edge.fromId;
			}
		},
		{
			key: "_getHubSize",
			value: function _getHubSize() {
				var average = 0;
				var averageSquared = 0;
				var hubCounter = 0;
				var largestHub = 0;
				for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) {
					var node$1 = this.body.nodes[this.body.nodeIndices[i$2]];
					if (node$1.edges.length > largestHub) largestHub = node$1.edges.length;
					average += node$1.edges.length;
					averageSquared += Math.pow(node$1.edges.length, 2);
					hubCounter += 1;
				}
				average = average / hubCounter;
				averageSquared = averageSquared / hubCounter;
				var variance = averageSquared - Math.pow(average, 2);
				var standardDeviation = Math.sqrt(variance);
				var hubThreshold = Math.floor(average + 2 * standardDeviation);
				if (hubThreshold > largestHub) hubThreshold = largestHub;
				return hubThreshold;
			}
		},
		{
			key: "_createClusteredEdge",
			value: function _createClusteredEdge(fromId, toId, baseEdge, clusterEdgeProperties, extraOptions) {
				var clonedOptions = NetworkUtil.cloneOptions(baseEdge, "edge");
				deepExtend(clonedOptions, clusterEdgeProperties);
				clonedOptions.from = fromId;
				clonedOptions.to = toId;
				clonedOptions.id = "clusterEdge:" + v4();
				if (extraOptions !== void 0) deepExtend(clonedOptions, extraOptions);
				var newEdge = this.body.functions.createEdge(clonedOptions);
				newEdge.clusteringEdgeReplacingIds = [baseEdge.id];
				newEdge.connect();
				this.body.edges[newEdge.id] = newEdge;
				return newEdge;
			}
		},
		{
			key: "_clusterEdges",
			value: function _clusterEdges(childNodes, childEdges, clusterNode, clusterEdgeProperties) {
				if (childEdges instanceof Edge) {
					var edge = childEdges;
					var obj = {};
					obj[edge.id] = edge;
					childEdges = obj;
				}
				if (childNodes instanceof Node) {
					var node$1 = childNodes;
					var _obj = {};
					_obj[node$1.id] = node$1;
					childNodes = _obj;
				}
				if (clusterNode === void 0 || clusterNode === null) throw new Error("_clusterEdges: parameter clusterNode required");
				if (clusterEdgeProperties === void 0) clusterEdgeProperties = clusterNode.clusterEdgeProperties;
				this._createClusterEdges(childNodes, childEdges, clusterNode, clusterEdgeProperties);
				for (var edgeId in childEdges) if (Object.prototype.hasOwnProperty.call(childEdges, edgeId)) {
					if (this.body.edges[edgeId] !== void 0) {
						var _edge2 = this.body.edges[edgeId];
						this._backupEdgeOptions(_edge2);
						_edge2.setOptions({ physics: false });
					}
				}
				for (var nodeId in childNodes) if (Object.prototype.hasOwnProperty.call(childNodes, nodeId)) {
					this.clusteredNodes[nodeId] = {
						clusterId: clusterNode.id,
						node: this.body.nodes[nodeId]
					};
					this.body.nodes[nodeId].setOptions({ physics: false });
				}
			}
		},
		{
			key: "_getClusterNodeForNode",
			value: function _getClusterNodeForNode(nodeId) {
				if (nodeId === void 0) return void 0;
				var clusteredNode = this.clusteredNodes[nodeId];
				if (clusteredNode === void 0) return void 0;
				var clusterId = clusteredNode.clusterId;
				if (clusterId === void 0) return void 0;
				return this.body.nodes[clusterId];
			}
		},
		{
			key: "_filter",
			value: function _filter(arr, callback) {
				var ret = [];
				forEach$1(arr, function(item) {
					if (callback(item)) ret.push(item);
				});
				return ret;
			}
		},
		{
			key: "_updateState",
			value: function _updateState() {
				var _this4 = this;
				var nodeId;
				var deletedNodeIds = [];
				var deletedEdgeIds = {};
				/**
				* Utility function to iterate over clustering nodes only
				*
				* @param {Function} callback  function to call for each cluster node
				*/
				var eachClusterNode = function eachClusterNode$1(callback) {
					forEach$1(_this4.body.nodes, function(node$2) {
						if (node$2.isCluster === true) callback(node$2);
					});
				};
				for (nodeId in this.clusteredNodes) {
					if (!Object.prototype.hasOwnProperty.call(this.clusteredNodes, nodeId)) continue;
					var node$1 = this.body.nodes[nodeId];
					if (node$1 === void 0) deletedNodeIds.push(nodeId);
				}
				eachClusterNode(function(clusterNode) {
					for (var n$1 = 0; n$1 < deletedNodeIds.length; n$1++) delete clusterNode.containedNodes[deletedNodeIds[n$1]];
				});
				for (var n = 0; n < deletedNodeIds.length; n++) delete this.clusteredNodes[deletedNodeIds[n]];
				forEach$1(this.clusteredEdges, function(edgeId) {
					var edge = _this4.body.edges[edgeId];
					if (edge === void 0 || !edge.endPointsValid()) deletedEdgeIds[edgeId] = edgeId;
				});
				eachClusterNode(function(clusterNode) {
					forEach$1(clusterNode.containedEdges, function(edge, edgeId) {
						if (!edge.endPointsValid() && !deletedEdgeIds[edgeId]) deletedEdgeIds[edgeId] = edgeId;
					});
				});
				forEach$1(this.body.edges, function(edge, edgeId) {
					var isValid = true;
					var replacedIds = edge.clusteringEdgeReplacingIds;
					if (replacedIds !== void 0) {
						var numValid = 0;
						forEach$1(replacedIds, function(containedEdgeId) {
							var containedEdge = _this4.body.edges[containedEdgeId];
							if (containedEdge !== void 0 && containedEdge.endPointsValid()) numValid += 1;
						});
						isValid = numValid > 0;
					}
					if (!edge.endPointsValid() || !isValid) deletedEdgeIds[edgeId] = edgeId;
				});
				eachClusterNode(function(clusterNode) {
					forEach$1(deletedEdgeIds, function(deletedEdgeId) {
						delete clusterNode.containedEdges[deletedEdgeId];
						forEach$1(clusterNode.edges, function(edge, m) {
							if (edge.id === deletedEdgeId) {
								clusterNode.edges[m] = null;
								return;
							}
							edge.clusteringEdgeReplacingIds = _this4._filter(edge.clusteringEdgeReplacingIds, function(id$4) {
								return !deletedEdgeIds[id$4];
							});
						});
						clusterNode.edges = _this4._filter(clusterNode.edges, function(item) {
							return item !== null;
						});
					});
				});
				forEach$1(deletedEdgeIds, function(edgeId) {
					delete _this4.clusteredEdges[edgeId];
				});
				forEach$1(deletedEdgeIds, function(edgeId) {
					delete _this4.body.edges[edgeId];
				});
				var ids = _Object$keys(this.body.edges);
				forEach$1(ids, function(edgeId) {
					var edge = _this4.body.edges[edgeId];
					var shouldBeClustered = _this4._isClusteredNode(edge.fromId) || _this4._isClusteredNode(edge.toId);
					if (shouldBeClustered === _this4._isClusteredEdge(edge.id)) return;
					if (shouldBeClustered) {
						var clusterFrom = _this4._getClusterNodeForNode(edge.fromId);
						if (clusterFrom !== void 0) _this4._clusterEdges(_this4.body.nodes[edge.fromId], edge, clusterFrom);
						var clusterTo = _this4._getClusterNodeForNode(edge.toId);
						if (clusterTo !== void 0) _this4._clusterEdges(_this4.body.nodes[edge.toId], edge, clusterTo);
					} else {
						delete _this4._clusterEdges[edgeId];
						_this4._restoreEdge(edge);
					}
				});
				var changed = false;
				var continueLoop = true;
				var _loop2 = function _loop2$1() {
					var clustersToOpen = [];
					eachClusterNode(function(clusterNode) {
						var numNodes = _Object$keys(clusterNode.containedNodes).length;
						var allowSingle = clusterNode.options.allowSingleNodeCluster === true;
						if (allowSingle && numNodes < 1 || !allowSingle && numNodes < 2) clustersToOpen.push(clusterNode.id);
					});
					for (var _n = 0; _n < clustersToOpen.length; ++_n) _this4.openCluster(
						clustersToOpen[_n],
						{},
						false
						/* Don't refresh, we're in an refresh/update already */
);
					continueLoop = clustersToOpen.length > 0;
					changed = changed || continueLoop;
				};
				while (continueLoop) _loop2();
				if (changed) this._updateState();
			}
		},
		{
			key: "_isClusteredNode",
			value: function _isClusteredNode(nodeId) {
				return this.clusteredNodes[nodeId] !== void 0;
			}
		},
		{
			key: "_isClusteredEdge",
			value: function _isClusteredEdge(edgeId) {
				return this.clusteredEdges[edgeId] !== void 0;
			}
		}
	]);
	return ClusterEngine$1;
}();
/**
* Initializes window.requestAnimationFrame() to a usable form.
*
* Specifically, set up this method for the case of running on node.js with jsdom enabled.
*
* NOTES:
*
* On node.js, when calling this directly outside of this class, `window` is not defined.
*   This happens even if jsdom is used.
* For node.js + jsdom, `window` is available at the moment the constructor is called.
*   For this reason, the called is placed within the constructor.
* Even then, `window.requestAnimationFrame()` is not defined, so it still needs to be added.
* During unit testing, it happens that the window object is reset during execution, causing
*   a runtime error due to missing `requestAnimationFrame()`. This needs to be compensated for,
*   see `_requestNextFrame()`.
* Since this is a global object, it may affect other modules besides `Network`. With normal
*   usage, this does not cause any problems. During unit testing, errors may occur. These have
*   been compensated for, see comment block in _requestNextFrame().
*
* @private
*/
function _initRequestAnimationFrame() {
	var func;
	if (window !== void 0) func = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
	if (func === void 0) window.requestAnimationFrame = function(callback) {
		callback();
	};
	else window.requestAnimationFrame = func;
}
/**
* The canvas renderer
*/
var CanvasRenderer = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	*/
	function CanvasRenderer$1(body, canvas) {
		_classCallCheck(this, CanvasRenderer$1);
		_initRequestAnimationFrame();
		this.body = body;
		this.canvas = canvas;
		this.redrawRequested = false;
		this.renderTimer = void 0;
		this.requiresTimeout = true;
		this.renderingActive = false;
		this.renderRequests = 0;
		this.allowRedraw = true;
		this.dragging = false;
		this.zooming = false;
		this.options = {};
		this.defaultOptions = {
			hideEdgesOnDrag: false,
			hideEdgesOnZoom: false,
			hideNodesOnDrag: false
		};
		_Object$assign(this.options, this.defaultOptions);
		this._determineBrowserMethod();
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(CanvasRenderer$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this = this, _context2;
				this.body.emitter.on("dragStart", function() {
					_this.dragging = true;
				});
				this.body.emitter.on("dragEnd", function() {
					_this.dragging = false;
				});
				this.body.emitter.on("zoom", function() {
					_this.zooming = true;
					window.clearTimeout(_this.zoomTimeoutId);
					_this.zoomTimeoutId = _setTimeout(function() {
						var _context;
						_this.zooming = false;
						_bindInstanceProperty$1(_context = _this._requestRedraw).call(_context, _this)();
					}, 250);
				});
				this.body.emitter.on("_resizeNodes", function() {
					_this._resizeNodes();
				});
				this.body.emitter.on("_redraw", function() {
					if (_this.renderingActive === false) _this._redraw();
				});
				this.body.emitter.on("_blockRedraw", function() {
					_this.allowRedraw = false;
				});
				this.body.emitter.on("_allowRedraw", function() {
					_this.allowRedraw = true;
					_this.redrawRequested = false;
				});
				this.body.emitter.on("_requestRedraw", _bindInstanceProperty$1(_context2 = this._requestRedraw).call(_context2, this));
				this.body.emitter.on("_startRendering", function() {
					_this.renderRequests += 1;
					_this.renderingActive = true;
					_this._startRendering();
				});
				this.body.emitter.on("_stopRendering", function() {
					_this.renderRequests -= 1;
					_this.renderingActive = _this.renderRequests > 0;
					_this.renderTimer = void 0;
				});
				this.body.emitter.on("destroy", function() {
					_this.renderRequests = 0;
					_this.allowRedraw = false;
					_this.renderingActive = false;
					if (_this.requiresTimeout === true) clearTimeout(_this.renderTimer);
					else window.cancelAnimationFrame(_this.renderTimer);
					_this.body.emitter.off();
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					var fields = [
						"hideEdgesOnDrag",
						"hideEdgesOnZoom",
						"hideNodesOnDrag"
					];
					selectiveDeepExtend(fields, this.options, options);
				}
			}
		},
		{
			key: "_requestNextFrame",
			value: function _requestNextFrame(callback, delay) {
				if (typeof window === "undefined") return;
				var timer;
				var myWindow = window;
				if (this.requiresTimeout === true) timer = _setTimeout(callback, delay);
				else if (myWindow.requestAnimationFrame) timer = myWindow.requestAnimationFrame(callback);
				return timer;
			}
		},
		{
			key: "_startRendering",
			value: function _startRendering() {
				if (this.renderingActive === true) {
					if (this.renderTimer === void 0) {
						var _context3;
						this.renderTimer = this._requestNextFrame(_bindInstanceProperty$1(_context3 = this._renderStep).call(_context3, this), this.simulationInterval);
					}
				}
			}
		},
		{
			key: "_renderStep",
			value: function _renderStep() {
				if (this.renderingActive === true) {
					this.renderTimer = void 0;
					if (this.requiresTimeout === true) this._startRendering();
					this._redraw();
					if (this.requiresTimeout === false) this._startRendering();
				}
			}
		},
		{
			key: "redraw",
			value: function redraw() {
				this.body.emitter.emit("setSize");
				this._redraw();
			}
		},
		{
			key: "_requestRedraw",
			value: function _requestRedraw() {
				var _this2 = this;
				if (this.redrawRequested !== true && this.renderingActive === false && this.allowRedraw === true) {
					this.redrawRequested = true;
					this._requestNextFrame(function() {
						_this2._redraw(false);
					}, 0);
				}
			}
		},
		{
			key: "_redraw",
			value: function _redraw() {
				var hidden = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
				if (this.allowRedraw === true) {
					this.body.emitter.emit("initRedraw");
					this.redrawRequested = false;
					var drawLater = { drawExternalLabels: null };
					if (this.canvas.frame.canvas.width === 0 || this.canvas.frame.canvas.height === 0) this.canvas.setSize();
					this.canvas.setTransform();
					var ctx = this.canvas.getContext();
					var w = this.canvas.frame.canvas.clientWidth;
					var h = this.canvas.frame.canvas.clientHeight;
					ctx.clearRect(0, 0, w, h);
					if (this.canvas.frame.clientWidth === 0) return;
					ctx.save();
					ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
					ctx.scale(this.body.view.scale, this.body.view.scale);
					ctx.beginPath();
					this.body.emitter.emit("beforeDrawing", ctx);
					ctx.closePath();
					if (hidden === false) {
						if ((this.dragging === false || this.dragging === true && this.options.hideEdgesOnDrag === false) && (this.zooming === false || this.zooming === true && this.options.hideEdgesOnZoom === false)) this._drawEdges(ctx);
					}
					if (this.dragging === false || this.dragging === true && this.options.hideNodesOnDrag === false) {
						var _this$_drawNodes = this._drawNodes(ctx, hidden), drawExternalLabels = _this$_drawNodes.drawExternalLabels;
						drawLater.drawExternalLabels = drawExternalLabels;
					}
					if (hidden === false) {
						if ((this.dragging === false || this.dragging === true && this.options.hideEdgesOnDrag === false) && (this.zooming === false || this.zooming === true && this.options.hideEdgesOnZoom === false)) this._drawArrows(ctx);
					}
					if (drawLater.drawExternalLabels != null) drawLater.drawExternalLabels();
					if (hidden === false) this._drawSelectionBox(ctx);
					ctx.beginPath();
					this.body.emitter.emit("afterDrawing", ctx);
					ctx.closePath();
					ctx.restore();
					if (hidden === true) ctx.clearRect(0, 0, w, h);
				}
			}
		},
		{
			key: "_resizeNodes",
			value: function _resizeNodes() {
				this.canvas.setTransform();
				var ctx = this.canvas.getContext();
				ctx.save();
				ctx.translate(this.body.view.translation.x, this.body.view.translation.y);
				ctx.scale(this.body.view.scale, this.body.view.scale);
				var nodes = this.body.nodes;
				var node$1;
				for (var nodeId in nodes) if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {
					node$1 = nodes[nodeId];
					node$1.resize(ctx);
					node$1.updateBoundingBox(ctx, node$1.selected);
				}
				ctx.restore();
			}
		},
		{
			key: "_drawNodes",
			value: function _drawNodes(ctx) {
				var alwaysShow = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				var nodes = this.body.nodes;
				var nodeIndices = this.body.nodeIndices;
				var node$1;
				var selected = [];
				var hovered = [];
				var margin = 20;
				var topLeft = this.canvas.DOMtoCanvas({
					x: -margin,
					y: -margin
				});
				var bottomRight = this.canvas.DOMtoCanvas({
					x: this.canvas.frame.canvas.clientWidth + margin,
					y: this.canvas.frame.canvas.clientHeight + margin
				});
				var viewableArea = {
					top: topLeft.y,
					left: topLeft.x,
					bottom: bottomRight.y,
					right: bottomRight.x
				};
				var _drawExternalLabels = [];
				for (var _i = 0; _i < nodeIndices.length; _i++) {
					node$1 = nodes[nodeIndices[_i]];
					if (node$1.hover) hovered.push(nodeIndices[_i]);
					else if (node$1.isSelected()) selected.push(nodeIndices[_i]);
					else if (alwaysShow === true) {
						var drawLater = node$1.draw(ctx);
						if (drawLater.drawExternalLabel != null) _drawExternalLabels.push(drawLater.drawExternalLabel);
					} else if (node$1.isBoundingBoxOverlappingWith(viewableArea) === true) {
						var _drawLater = node$1.draw(ctx);
						if (_drawLater.drawExternalLabel != null) _drawExternalLabels.push(_drawLater.drawExternalLabel);
					} else node$1.updateBoundingBox(ctx, node$1.selected);
				}
				var i$2;
				var selectedLength = selected.length;
				var hoveredLength = hovered.length;
				for (i$2 = 0; i$2 < selectedLength; i$2++) {
					node$1 = nodes[selected[i$2]];
					var _drawLater2 = node$1.draw(ctx);
					if (_drawLater2.drawExternalLabel != null) _drawExternalLabels.push(_drawLater2.drawExternalLabel);
				}
				for (i$2 = 0; i$2 < hoveredLength; i$2++) {
					node$1 = nodes[hovered[i$2]];
					var _drawLater3 = node$1.draw(ctx);
					if (_drawLater3.drawExternalLabel != null) _drawExternalLabels.push(_drawLater3.drawExternalLabel);
				}
				return { drawExternalLabels: function drawExternalLabels() {
					for (var _i2 = 0, _drawExternalLabels2 = _drawExternalLabels; _i2 < _drawExternalLabels2.length; _i2++) {
						var draw = _drawExternalLabels2[_i2];
						draw();
					}
				} };
			}
		},
		{
			key: "_drawEdges",
			value: function _drawEdges(ctx) {
				var edges = this.body.edges;
				var edgeIndices = this.body.edgeIndices;
				for (var i$2 = 0; i$2 < edgeIndices.length; i$2++) {
					var edge = edges[edgeIndices[i$2]];
					if (edge.connected === true) edge.draw(ctx);
				}
			}
		},
		{
			key: "_drawArrows",
			value: function _drawArrows(ctx) {
				var edges = this.body.edges;
				var edgeIndices = this.body.edgeIndices;
				for (var i$2 = 0; i$2 < edgeIndices.length; i$2++) {
					var edge = edges[edgeIndices[i$2]];
					if (edge.connected === true) edge.drawArrows(ctx);
				}
			}
		},
		{
			key: "_determineBrowserMethod",
			value: function _determineBrowserMethod() {
				if (typeof window !== "undefined") {
					var browserType = navigator.userAgent.toLowerCase();
					this.requiresTimeout = false;
					if (_indexOfInstanceProperty(browserType).call(browserType, "msie 9.0") != -1) this.requiresTimeout = true;
					else if (_indexOfInstanceProperty(browserType).call(browserType, "safari") != -1) {
						if (_indexOfInstanceProperty(browserType).call(browserType, "chrome") <= -1) this.requiresTimeout = true;
					}
				} else this.requiresTimeout = true;
			}
		},
		{
			key: "_drawSelectionBox",
			value: function _drawSelectionBox(ctx) {
				if (this.body.selectionBox.show) {
					ctx.beginPath();
					var width = this.body.selectionBox.position.end.x - this.body.selectionBox.position.start.x;
					var height = this.body.selectionBox.position.end.y - this.body.selectionBox.position.start.y;
					ctx.rect(this.body.selectionBox.position.start.x, this.body.selectionBox.position.start.y, width, height);
					ctx.fillStyle = "rgba(151, 194, 252, 0.2)";
					ctx.fillRect(this.body.selectionBox.position.start.x, this.body.selectionBox.position.start.y, width, height);
					ctx.strokeStyle = "rgba(151, 194, 252, 1)";
					ctx.stroke();
				} else ctx.closePath();
			}
		}
	]);
	return CanvasRenderer$1;
}();
var setIntervalExports = {};
var setInterval$1 = {
	get exports() {
		return setIntervalExports;
	},
	set exports(v) {
		setIntervalExports = v;
	}
};
var path$2 = path$y;
var setInterval = path$2.setInterval;
(function(module) {
	module.exports = setInterval;
})(setInterval$1);
var _setInterval = /* @__PURE__ */ getDefaultExportFromCjs(setIntervalExports);
/**
* Register a touch event, taking place before a gesture
*
* @param {Hammer} hammer       A hammer instance
* @param {Function} callback   Callback, called as callback(event)
*/
function onTouch(hammer, callback) {
	callback.inputHandler = function(event) {
		if (event.isFirst) callback(event);
	};
	hammer.on("hammer.input", callback.inputHandler);
}
/**
* Register a release event, taking place after a gesture
*
* @param {Hammer} hammer       A hammer instance
* @param {Function} callback   Callback, called as callback(event)
* @returns {*}
*/
function onRelease(hammer, callback) {
	callback.inputHandler = function(event) {
		if (event.isFinal) callback(event);
	};
	return hammer.on("hammer.input", callback.inputHandler);
}
/**
* Create the main frame for the Network.
* This function is executed once when a Network object is created. The frame
* contains a canvas, and this canvas contains all objects like the axis and
* nodes.
*/
var Canvas = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	*/
	function Canvas$1(body) {
		_classCallCheck(this, Canvas$1);
		this.body = body;
		this.pixelRatio = 1;
		this.cameraState = {};
		this.initialized = false;
		this.canvasViewCenter = {};
		this._cleanupCallbacks = [];
		this.options = {};
		this.defaultOptions = {
			autoResize: true,
			height: "100%",
			width: "100%"
		};
		_Object$assign(this.options, this.defaultOptions);
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(Canvas$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this = this, _context;
				this.body.emitter.once("resize", function(obj) {
					if (obj.width !== 0) _this.body.view.translation.x = obj.width * .5;
					if (obj.height !== 0) _this.body.view.translation.y = obj.height * .5;
				});
				this.body.emitter.on("setSize", _bindInstanceProperty$1(_context = this.setSize).call(_context, this));
				this.body.emitter.on("destroy", function() {
					_this.hammerFrame.destroy();
					_this.hammer.destroy();
					_this._cleanUp();
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				var _this2 = this;
				if (options !== void 0) {
					var fields = [
						"width",
						"height",
						"autoResize"
					];
					selectiveDeepExtend(fields, this.options, options);
				}
				this._cleanUp();
				if (this.options.autoResize === true) {
					var _context2;
					if (window.ResizeObserver) {
						var observer = new ResizeObserver(function() {
							var changed = _this2.setSize();
							if (changed === true) _this2.body.emitter.emit("_requestRedraw");
						});
						var frame = this.frame;
						observer.observe(frame);
						this._cleanupCallbacks.push(function() {
							observer.unobserve(frame);
						});
					} else {
						var resizeTimer = _setInterval(function() {
							var changed = _this2.setSize();
							if (changed === true) _this2.body.emitter.emit("_requestRedraw");
						}, 1e3);
						this._cleanupCallbacks.push(function() {
							clearInterval(resizeTimer);
						});
					}
					var resizeFunction = _bindInstanceProperty$1(_context2 = this._onResize).call(_context2, this);
					addEventListener(window, "resize", resizeFunction);
					this._cleanupCallbacks.push(function() {
						removeEventListener(window, "resize", resizeFunction);
					});
				}
			}
		},
		{
			key: "_cleanUp",
			value: function _cleanUp() {
				var _context3, _context4, _context5;
				_forEachInstanceProperty(_context3 = _reverseInstanceProperty(_context4 = _spliceInstanceProperty(_context5 = this._cleanupCallbacks).call(_context5, 0)).call(_context4)).call(_context3, function(callback) {
					try {
						callback();
					} catch (error) {
						console.error(error);
					}
				});
			}
		},
		{
			key: "_onResize",
			value: function _onResize() {
				this.setSize();
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "_getCameraState",
			value: function _getCameraState() {
				var pixelRatio = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.pixelRatio;
				if (this.initialized === true) {
					this.cameraState.previousWidth = this.frame.canvas.width / pixelRatio;
					this.cameraState.previousHeight = this.frame.canvas.height / pixelRatio;
					this.cameraState.scale = this.body.view.scale;
					this.cameraState.position = this.DOMtoCanvas({
						x: .5 * this.frame.canvas.width / pixelRatio,
						y: .5 * this.frame.canvas.height / pixelRatio
					});
				}
			}
		},
		{
			key: "_setCameraState",
			value: function _setCameraState() {
				if (this.cameraState.scale !== void 0 && this.frame.canvas.clientWidth !== 0 && this.frame.canvas.clientHeight !== 0 && this.pixelRatio !== 0 && this.cameraState.previousWidth > 0 && this.cameraState.previousHeight > 0) {
					var widthRatio = this.frame.canvas.width / this.pixelRatio / this.cameraState.previousWidth;
					var heightRatio = this.frame.canvas.height / this.pixelRatio / this.cameraState.previousHeight;
					var newScale = this.cameraState.scale;
					if (widthRatio != 1 && heightRatio != 1) newScale = this.cameraState.scale * .5 * (widthRatio + heightRatio);
					else if (widthRatio != 1) newScale = this.cameraState.scale * widthRatio;
					else if (heightRatio != 1) newScale = this.cameraState.scale * heightRatio;
					this.body.view.scale = newScale;
					var currentViewCenter = this.DOMtoCanvas({
						x: .5 * this.frame.canvas.clientWidth,
						y: .5 * this.frame.canvas.clientHeight
					});
					var distanceFromCenter = {
						x: currentViewCenter.x - this.cameraState.position.x,
						y: currentViewCenter.y - this.cameraState.position.y
					};
					this.body.view.translation.x += distanceFromCenter.x * this.body.view.scale;
					this.body.view.translation.y += distanceFromCenter.y * this.body.view.scale;
				}
			}
		},
		{
			key: "_prepareValue",
			value: function _prepareValue(value) {
				if (typeof value === "number") return value + "px";
				else if (typeof value === "string") {
					if (_indexOfInstanceProperty(value).call(value, "%") !== -1 || _indexOfInstanceProperty(value).call(value, "px") !== -1) return value;
					else if (_indexOfInstanceProperty(value).call(value, "%") === -1) return value + "px";
				}
				throw new Error("Could not use the value supplied for width or height:" + value);
			}
		},
		{
			key: "_create",
			value: function _create() {
				while (this.body.container.hasChildNodes()) this.body.container.removeChild(this.body.container.firstChild);
				this.frame = document.createElement("div");
				this.frame.className = "vis-network";
				this.frame.style.position = "relative";
				this.frame.style.overflow = "hidden";
				this.frame.tabIndex = 0;
				this.frame.canvas = document.createElement("canvas");
				this.frame.canvas.style.position = "relative";
				this.frame.appendChild(this.frame.canvas);
				if (!this.frame.canvas.getContext) {
					var noCanvas = document.createElement("DIV");
					noCanvas.style.color = "red";
					noCanvas.style.fontWeight = "bold";
					noCanvas.style.padding = "10px";
					noCanvas.innerText = "Error: your browser does not support HTML canvas";
					this.frame.canvas.appendChild(noCanvas);
				} else {
					this._setPixelRatio();
					this.setTransform();
				}
				this.body.container.appendChild(this.frame);
				this.body.view.scale = 1;
				this.body.view.translation = {
					x: .5 * this.frame.canvas.clientWidth,
					y: .5 * this.frame.canvas.clientHeight
				};
				this._bindHammer();
			}
		},
		{
			key: "_bindHammer",
			value: function _bindHammer() {
				var _this3 = this;
				if (this.hammer !== void 0) this.hammer.destroy();
				this.drag = {};
				this.pinch = {};
				this.hammer = new Hammer(this.frame.canvas);
				this.hammer.get("pinch").set({ enable: true });
				this.hammer.get("pan").set({
					threshold: 5,
					direction: Hammer.DIRECTION_ALL
				});
				onTouch(this.hammer, function(event) {
					_this3.body.eventListeners.onTouch(event);
				});
				this.hammer.on("tap", function(event) {
					_this3.body.eventListeners.onTap(event);
				});
				this.hammer.on("doubletap", function(event) {
					_this3.body.eventListeners.onDoubleTap(event);
				});
				this.hammer.on("press", function(event) {
					_this3.body.eventListeners.onHold(event);
				});
				this.hammer.on("panstart", function(event) {
					_this3.body.eventListeners.onDragStart(event);
				});
				this.hammer.on("panmove", function(event) {
					_this3.body.eventListeners.onDrag(event);
				});
				this.hammer.on("panend", function(event) {
					_this3.body.eventListeners.onDragEnd(event);
				});
				this.hammer.on("pinch", function(event) {
					_this3.body.eventListeners.onPinch(event);
				});
				this.frame.canvas.addEventListener("wheel", function(event) {
					_this3.body.eventListeners.onMouseWheel(event);
				});
				this.frame.canvas.addEventListener("mousemove", function(event) {
					_this3.body.eventListeners.onMouseMove(event);
				});
				this.frame.canvas.addEventListener("contextmenu", function(event) {
					_this3.body.eventListeners.onContext(event);
				});
				this.hammerFrame = new Hammer(this.frame);
				onRelease(this.hammerFrame, function(event) {
					_this3.body.eventListeners.onRelease(event);
				});
			}
		},
		{
			key: "setSize",
			value: function setSize() {
				var width = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.options.width;
				var height = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.height;
				width = this._prepareValue(width);
				height = this._prepareValue(height);
				var emitEvent = false;
				var oldWidth = this.frame.canvas.width;
				var oldHeight = this.frame.canvas.height;
				var previousRatio = this.pixelRatio;
				this._setPixelRatio();
				if (width != this.options.width || height != this.options.height || this.frame.style.width != width || this.frame.style.height != height) {
					this._getCameraState(previousRatio);
					this.frame.style.width = width;
					this.frame.style.height = height;
					this.frame.canvas.style.width = "100%";
					this.frame.canvas.style.height = "100%";
					this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);
					this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);
					this.options.width = width;
					this.options.height = height;
					this.canvasViewCenter = {
						x: .5 * this.frame.clientWidth,
						y: .5 * this.frame.clientHeight
					};
					emitEvent = true;
				} else {
					var newWidth = Math.round(this.frame.canvas.clientWidth * this.pixelRatio);
					var newHeight = Math.round(this.frame.canvas.clientHeight * this.pixelRatio);
					if (this.frame.canvas.width !== newWidth || this.frame.canvas.height !== newHeight) this._getCameraState(previousRatio);
					if (this.frame.canvas.width !== newWidth) {
						this.frame.canvas.width = newWidth;
						emitEvent = true;
					}
					if (this.frame.canvas.height !== newHeight) {
						this.frame.canvas.height = newHeight;
						emitEvent = true;
					}
				}
				if (emitEvent === true) {
					this.body.emitter.emit("resize", {
						width: Math.round(this.frame.canvas.width / this.pixelRatio),
						height: Math.round(this.frame.canvas.height / this.pixelRatio),
						oldWidth: Math.round(oldWidth / this.pixelRatio),
						oldHeight: Math.round(oldHeight / this.pixelRatio)
					});
					this._setCameraState();
				}
				this.initialized = true;
				return emitEvent;
			}
		},
		{
			key: "getContext",
			value: function getContext() {
				return this.frame.canvas.getContext("2d");
			}
		},
		{
			key: "_determinePixelRatio",
			value: function _determinePixelRatio() {
				var ctx = this.getContext();
				if (ctx === void 0) throw new Error("Could not get canvax context");
				var numerator = 1;
				if (typeof window !== "undefined") numerator = window.devicePixelRatio || 1;
				var denominator = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.msBackingStorePixelRatio || ctx.oBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;
				return numerator / denominator;
			}
		},
		{
			key: "_setPixelRatio",
			value: function _setPixelRatio() {
				this.pixelRatio = this._determinePixelRatio();
			}
		},
		{
			key: "setTransform",
			value: function setTransform() {
				var ctx = this.getContext();
				if (ctx === void 0) throw new Error("Could not get canvax context");
				ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);
			}
		},
		{
			key: "_XconvertDOMtoCanvas",
			value: function _XconvertDOMtoCanvas(x) {
				return (x - this.body.view.translation.x) / this.body.view.scale;
			}
		},
		{
			key: "_XconvertCanvasToDOM",
			value: function _XconvertCanvasToDOM(x) {
				return x * this.body.view.scale + this.body.view.translation.x;
			}
		},
		{
			key: "_YconvertDOMtoCanvas",
			value: function _YconvertDOMtoCanvas(y) {
				return (y - this.body.view.translation.y) / this.body.view.scale;
			}
		},
		{
			key: "_YconvertCanvasToDOM",
			value: function _YconvertCanvasToDOM(y) {
				return y * this.body.view.scale + this.body.view.translation.y;
			}
		},
		{
			key: "canvasToDOM",
			value: function canvasToDOM(pos) {
				return {
					x: this._XconvertCanvasToDOM(pos.x),
					y: this._YconvertCanvasToDOM(pos.y)
				};
			}
		},
		{
			key: "DOMtoCanvas",
			value: function DOMtoCanvas(pos) {
				return {
					x: this._XconvertDOMtoCanvas(pos.x),
					y: this._YconvertDOMtoCanvas(pos.y)
				};
			}
		}
	]);
	return Canvas$1;
}();
/**

* Validate the fit options, replace missing optional values by defaults etc.

*

* @param rawOptions - The raw options.

* @param allNodeIds - All node ids that will be used if nodes are omitted in

* the raw options.

* @returns Options with everything filled in and validated.

*/
function normalizeFitOptions(rawOptions, allNodeIds) {
	var options = _Object$assign({
		nodes: allNodeIds,
		minZoomLevel: Number.MIN_VALUE,
		maxZoomLevel: 1
	}, rawOptions !== null && rawOptions !== void 0 ? rawOptions : {});
	if (!_Array$isArray(options.nodes)) throw new TypeError("Nodes has to be an array of ids.");
	if (options.nodes.length === 0) options.nodes = allNodeIds;
	if (!(typeof options.minZoomLevel === "number" && options.minZoomLevel > 0)) throw new TypeError("Min zoom level has to be a number higher than zero.");
	if (!(typeof options.maxZoomLevel === "number" && options.minZoomLevel <= options.maxZoomLevel)) throw new TypeError("Max zoom level has to be a number higher than min zoom level.");
	return options;
}
/**
* The view
*/
var View = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	*/
	function View$1(body, canvas) {
		var _context, _this = this, _context2;
		_classCallCheck(this, View$1);
		this.body = body;
		this.canvas = canvas;
		this.animationSpeed = 1 / this.renderRefreshRate;
		this.animationEasingFunction = "easeInOutQuint";
		this.easingTime = 0;
		this.sourceScale = 0;
		this.targetScale = 0;
		this.sourceTranslation = 0;
		this.targetTranslation = 0;
		this.lockedOnNodeId = void 0;
		this.lockedOnNodeOffset = void 0;
		this.touchTime = 0;
		this.viewFunction = void 0;
		this.body.emitter.on("fit", _bindInstanceProperty$1(_context = this.fit).call(_context, this));
		this.body.emitter.on("animationFinished", function() {
			_this.body.emitter.emit("_stopRendering");
		});
		this.body.emitter.on("unlockNode", _bindInstanceProperty$1(_context2 = this.releaseNode).call(_context2, this));
	}
	/**
	*
	* @param {object} [options={}]
	*/
	_createClass(View$1, [
		{
			key: "setOptions",
			value: function setOptions() {
				var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
				this.options = options;
			}
		},
		{
			key: "fit",
			value: function fit(options) {
				var initialZoom = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				options = normalizeFitOptions(options, this.body.nodeIndices);
				var canvasWidth = this.canvas.frame.canvas.clientWidth;
				var canvasHeight = this.canvas.frame.canvas.clientHeight;
				var range;
				var zoomLevel;
				if (canvasWidth === 0 || canvasHeight === 0) {
					zoomLevel = 1;
					range = NetworkUtil.getRange(this.body.nodes, options.nodes);
				} else if (initialZoom === true) {
					var positionDefined = 0;
					for (var nodeId in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {
						var node$1 = this.body.nodes[nodeId];
						if (node$1.predefinedPosition === true) positionDefined += 1;
					}
					if (positionDefined > .5 * this.body.nodeIndices.length) {
						this.fit(options, false);
						return;
					}
					range = NetworkUtil.getRange(this.body.nodes, options.nodes);
					var numberOfNodes = this.body.nodeIndices.length;
					zoomLevel = 12.662 / (numberOfNodes + 7.4147) + .0964822;
					var factor = Math.min(canvasWidth / 600, canvasHeight / 600);
					zoomLevel *= factor;
				} else {
					this.body.emitter.emit("_resizeNodes");
					range = NetworkUtil.getRange(this.body.nodes, options.nodes);
					var xDistance = Math.abs(range.maxX - range.minX) * 1.1;
					var yDistance = Math.abs(range.maxY - range.minY) * 1.1;
					var xZoomLevel = canvasWidth / xDistance;
					var yZoomLevel = canvasHeight / yDistance;
					zoomLevel = xZoomLevel <= yZoomLevel ? xZoomLevel : yZoomLevel;
				}
				if (zoomLevel > options.maxZoomLevel) zoomLevel = options.maxZoomLevel;
				else if (zoomLevel < options.minZoomLevel) zoomLevel = options.minZoomLevel;
				var center = NetworkUtil.findCenter(range);
				var animationOptions = {
					position: center,
					scale: zoomLevel,
					animation: options.animation
				};
				this.moveTo(animationOptions);
			}
		},
		{
			key: "focus",
			value: function focus(nodeId) {
				var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
				if (this.body.nodes[nodeId] !== void 0) {
					var nodePosition = {
						x: this.body.nodes[nodeId].x,
						y: this.body.nodes[nodeId].y
					};
					options.position = nodePosition;
					options.lockedOnNode = nodeId;
					this.moveTo(options);
				} else console.error("Node: " + nodeId + " cannot be found.");
			}
		},
		{
			key: "moveTo",
			value: function moveTo(options) {
				if (options === void 0) {
					options = {};
					return;
				}
				if (options.offset != null) {
					if (options.offset.x != null) {
						options.offset.x = +options.offset.x;
						if (!_Number$isFinite(options.offset.x)) throw new TypeError("The option \"offset.x\" has to be a finite number.");
					} else options.offset.x = 0;
					if (options.offset.y != null) {
						options.offset.y = +options.offset.y;
						if (!_Number$isFinite(options.offset.y)) throw new TypeError("The option \"offset.y\" has to be a finite number.");
					} else options.offset.x = 0;
				} else options.offset = {
					x: 0,
					y: 0
				};
				if (options.position != null) {
					if (options.position.x != null) {
						options.position.x = +options.position.x;
						if (!_Number$isFinite(options.position.x)) throw new TypeError("The option \"position.x\" has to be a finite number.");
					} else options.position.x = 0;
					if (options.position.y != null) {
						options.position.y = +options.position.y;
						if (!_Number$isFinite(options.position.y)) throw new TypeError("The option \"position.y\" has to be a finite number.");
					} else options.position.x = 0;
				} else options.position = this.getViewPosition();
				if (options.scale != null) {
					options.scale = +options.scale;
					if (!(options.scale > 0)) throw new TypeError("The option \"scale\" has to be a number greater than zero.");
				} else options.scale = this.body.view.scale;
				if (options.animation === void 0) options.animation = { duration: 0 };
				if (options.animation === false) options.animation = { duration: 0 };
				if (options.animation === true) options.animation = {};
				if (options.animation.duration === void 0) options.animation.duration = 1e3;
				if (options.animation.easingFunction === void 0) options.animation.easingFunction = "easeInOutQuad";
				this.animateView(options);
			}
		},
		{
			key: "animateView",
			value: function animateView(options) {
				if (options === void 0) return;
				this.animationEasingFunction = options.animation.easingFunction;
				this.releaseNode();
				if (options.locked === true) {
					this.lockedOnNodeId = options.lockedOnNode;
					this.lockedOnNodeOffset = options.offset;
				}
				if (this.easingTime != 0) this._transitionRedraw(true);
				this.sourceScale = this.body.view.scale;
				this.sourceTranslation = this.body.view.translation;
				this.targetScale = options.scale;
				this.body.view.scale = this.targetScale;
				var viewCenter = this.canvas.DOMtoCanvas({
					x: .5 * this.canvas.frame.canvas.clientWidth,
					y: .5 * this.canvas.frame.canvas.clientHeight
				});
				var distanceFromCenter = {
					x: viewCenter.x - options.position.x,
					y: viewCenter.y - options.position.y
				};
				this.targetTranslation = {
					x: this.sourceTranslation.x + distanceFromCenter.x * this.targetScale + options.offset.x,
					y: this.sourceTranslation.y + distanceFromCenter.y * this.targetScale + options.offset.y
				};
				if (options.animation.duration === 0) if (this.lockedOnNodeId != void 0) {
					var _context3;
					this.viewFunction = _bindInstanceProperty$1(_context3 = this._lockedRedraw).call(_context3, this);
					this.body.emitter.on("initRedraw", this.viewFunction);
				} else {
					this.body.view.scale = this.targetScale;
					this.body.view.translation = this.targetTranslation;
					this.body.emitter.emit("_requestRedraw");
				}
				else {
					var _context4;
					this.animationSpeed = 1 / (60 * options.animation.duration * .001) || 1 / 60;
					this.animationEasingFunction = options.animation.easingFunction;
					this.viewFunction = _bindInstanceProperty$1(_context4 = this._transitionRedraw).call(_context4, this);
					this.body.emitter.on("initRedraw", this.viewFunction);
					this.body.emitter.emit("_startRendering");
				}
			}
		},
		{
			key: "_lockedRedraw",
			value: function _lockedRedraw() {
				var nodePosition = {
					x: this.body.nodes[this.lockedOnNodeId].x,
					y: this.body.nodes[this.lockedOnNodeId].y
				};
				var viewCenter = this.canvas.DOMtoCanvas({
					x: .5 * this.canvas.frame.canvas.clientWidth,
					y: .5 * this.canvas.frame.canvas.clientHeight
				});
				var distanceFromCenter = {
					x: viewCenter.x - nodePosition.x,
					y: viewCenter.y - nodePosition.y
				};
				var sourceTranslation = this.body.view.translation;
				var targetTranslation = {
					x: sourceTranslation.x + distanceFromCenter.x * this.body.view.scale + this.lockedOnNodeOffset.x,
					y: sourceTranslation.y + distanceFromCenter.y * this.body.view.scale + this.lockedOnNodeOffset.y
				};
				this.body.view.translation = targetTranslation;
			}
		},
		{
			key: "releaseNode",
			value: function releaseNode() {
				if (this.lockedOnNodeId !== void 0 && this.viewFunction !== void 0) {
					this.body.emitter.off("initRedraw", this.viewFunction);
					this.lockedOnNodeId = void 0;
					this.lockedOnNodeOffset = void 0;
				}
			}
		},
		{
			key: "_transitionRedraw",
			value: function _transitionRedraw() {
				var finished = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
				this.easingTime += this.animationSpeed;
				this.easingTime = finished === true ? 1 : this.easingTime;
				var progress = easingFunctions[this.animationEasingFunction](this.easingTime);
				this.body.view.scale = this.sourceScale + (this.targetScale - this.sourceScale) * progress;
				this.body.view.translation = {
					x: this.sourceTranslation.x + (this.targetTranslation.x - this.sourceTranslation.x) * progress,
					y: this.sourceTranslation.y + (this.targetTranslation.y - this.sourceTranslation.y) * progress
				};
				if (this.easingTime >= 1) {
					this.body.emitter.off("initRedraw", this.viewFunction);
					this.easingTime = 0;
					if (this.lockedOnNodeId != void 0) {
						var _context5;
						this.viewFunction = _bindInstanceProperty$1(_context5 = this._lockedRedraw).call(_context5, this);
						this.body.emitter.on("initRedraw", this.viewFunction);
					}
					this.body.emitter.emit("animationFinished");
				}
			}
		},
		{
			key: "getScale",
			value: function getScale$2() {
				return this.body.view.scale;
			}
		},
		{
			key: "getViewPosition",
			value: function getViewPosition() {
				return this.canvas.DOMtoCanvas({
					x: .5 * this.canvas.frame.canvas.clientWidth,
					y: .5 * this.canvas.frame.canvas.clientHeight
				});
			}
		}
	]);
	return View$1;
}();
/**

* Created by Alex on 11/6/2014.

*/
function keycharm(options) {
	var preventDefault = options && options.preventDefault || false;
	var container = options && options.container || window;
	var _exportFunctions = {};
	var _bound = {
		keydown: {},
		keyup: {}
	};
	var _keys = {};
	var i$2;
	for (i$2 = 97; i$2 <= 122; i$2++) _keys[String.fromCharCode(i$2)] = {
		code: 65 + (i$2 - 97),
		shift: false
	};
	for (i$2 = 65; i$2 <= 90; i$2++) _keys[String.fromCharCode(i$2)] = {
		code: i$2,
		shift: true
	};
	for (i$2 = 0; i$2 <= 9; i$2++) _keys["" + i$2] = {
		code: 48 + i$2,
		shift: false
	};
	for (i$2 = 1; i$2 <= 12; i$2++) _keys["F" + i$2] = {
		code: 111 + i$2,
		shift: false
	};
	for (i$2 = 0; i$2 <= 9; i$2++) _keys["num" + i$2] = {
		code: 96 + i$2,
		shift: false
	};
	_keys["num*"] = {
		code: 106,
		shift: false
	};
	_keys["num+"] = {
		code: 107,
		shift: false
	};
	_keys["num-"] = {
		code: 109,
		shift: false
	};
	_keys["num/"] = {
		code: 111,
		shift: false
	};
	_keys["num."] = {
		code: 110,
		shift: false
	};
	_keys["left"] = {
		code: 37,
		shift: false
	};
	_keys["up"] = {
		code: 38,
		shift: false
	};
	_keys["right"] = {
		code: 39,
		shift: false
	};
	_keys["down"] = {
		code: 40,
		shift: false
	};
	_keys["space"] = {
		code: 32,
		shift: false
	};
	_keys["enter"] = {
		code: 13,
		shift: false
	};
	_keys["shift"] = {
		code: 16,
		shift: void 0
	};
	_keys["esc"] = {
		code: 27,
		shift: false
	};
	_keys["backspace"] = {
		code: 8,
		shift: false
	};
	_keys["tab"] = {
		code: 9,
		shift: false
	};
	_keys["ctrl"] = {
		code: 17,
		shift: false
	};
	_keys["alt"] = {
		code: 18,
		shift: false
	};
	_keys["delete"] = {
		code: 46,
		shift: false
	};
	_keys["pageup"] = {
		code: 33,
		shift: false
	};
	_keys["pagedown"] = {
		code: 34,
		shift: false
	};
	_keys["="] = {
		code: 187,
		shift: false
	};
	_keys["-"] = {
		code: 189,
		shift: false
	};
	_keys["]"] = {
		code: 221,
		shift: false
	};
	_keys["["] = {
		code: 219,
		shift: false
	};
	var down = function(event) {
		handleEvent(event, "keydown");
	};
	var up = function(event) {
		handleEvent(event, "keyup");
	};
	var handleEvent = function(event, type) {
		if (_bound[type][event.keyCode] !== void 0) {
			var bound = _bound[type][event.keyCode];
			for (var i$3 = 0; i$3 < bound.length; i$3++) if (bound[i$3].shift === void 0) bound[i$3].fn(event);
			else if (bound[i$3].shift == true && event.shiftKey == true) bound[i$3].fn(event);
			else if (bound[i$3].shift == false && event.shiftKey == false) bound[i$3].fn(event);
			if (preventDefault == true) event.preventDefault();
		}
	};
	_exportFunctions.bind = function(key, callback, type) {
		if (type === void 0) type = "keydown";
		if (_keys[key] === void 0) throw new Error("unsupported key: " + key);
		if (_bound[type][_keys[key].code] === void 0) _bound[type][_keys[key].code] = [];
		_bound[type][_keys[key].code].push({
			fn: callback,
			shift: _keys[key].shift
		});
	};
	_exportFunctions.bindAll = function(callback, type) {
		if (type === void 0) type = "keydown";
		for (var key in _keys) if (_keys.hasOwnProperty(key)) _exportFunctions.bind(key, callback, type);
	};
	_exportFunctions.getKey = function(event) {
		for (var key in _keys) if (_keys.hasOwnProperty(key)) {
			if (event.shiftKey == true && _keys[key].shift == true && event.keyCode == _keys[key].code) return key;
			else if (event.shiftKey == false && _keys[key].shift == false && event.keyCode == _keys[key].code) return key;
			else if (event.keyCode == _keys[key].code && key == "shift") return key;
		}
		return "unknown key, currently not supported";
	};
	_exportFunctions.unbind = function(key, callback, type) {
		if (type === void 0) type = "keydown";
		if (_keys[key] === void 0) throw new Error("unsupported key: " + key);
		if (callback !== void 0) {
			var newBindings = [];
			var bound = _bound[type][_keys[key].code];
			if (bound !== void 0) {
				for (var i$3 = 0; i$3 < bound.length; i$3++) if (!(bound[i$3].fn == callback && bound[i$3].shift == _keys[key].shift)) newBindings.push(_bound[type][_keys[key].code][i$3]);
			}
			_bound[type][_keys[key].code] = newBindings;
		} else _bound[type][_keys[key].code] = [];
	};
	_exportFunctions.reset = function() {
		_bound = {
			keydown: {},
			keyup: {}
		};
	};
	_exportFunctions.destroy = function() {
		_bound = {
			keydown: {},
			keyup: {}
		};
		container.removeEventListener("keydown", down, true);
		container.removeEventListener("keyup", up, true);
	};
	container.addEventListener("keydown", down, true);
	container.addEventListener("keyup", up, true);
	return _exportFunctions;
}
/**
* Navigation Handler
*/
var NavigationHandler = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	*/
	function NavigationHandler$1(body, canvas) {
		var _this = this;
		_classCallCheck(this, NavigationHandler$1);
		this.body = body;
		this.canvas = canvas;
		this.iconsCreated = false;
		this.navigationHammers = [];
		this.boundFunctions = {};
		this.touchTime = 0;
		this.activated = false;
		this.body.emitter.on("activate", function() {
			_this.activated = true;
			_this.configureKeyboardBindings();
		});
		this.body.emitter.on("deactivate", function() {
			_this.activated = false;
			_this.configureKeyboardBindings();
		});
		this.body.emitter.on("destroy", function() {
			if (_this.keycharm !== void 0) _this.keycharm.destroy();
		});
		this.options = {};
	}
	/**
	*
	* @param {object} options
	*/
	_createClass(NavigationHandler$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					this.options = options;
					this.create();
				}
			}
		},
		{
			key: "create",
			value: function create$11() {
				if (this.options.navigationButtons === true) {
					if (this.iconsCreated === false) this.loadNavigationElements();
				} else if (this.iconsCreated === true) this.cleanNavigation();
				this.configureKeyboardBindings();
			}
		},
		{
			key: "cleanNavigation",
			value: function cleanNavigation() {
				if (this.navigationHammers.length != 0) {
					for (var i$2 = 0; i$2 < this.navigationHammers.length; i$2++) this.navigationHammers[i$2].destroy();
					this.navigationHammers = [];
				}
				if (this.navigationDOM && this.navigationDOM["wrapper"] && this.navigationDOM["wrapper"].parentNode) this.navigationDOM["wrapper"].parentNode.removeChild(this.navigationDOM["wrapper"]);
				this.iconsCreated = false;
			}
		},
		{
			key: "loadNavigationElements",
			value: function loadNavigationElements() {
				var _this2 = this;
				this.cleanNavigation();
				this.navigationDOM = {};
				var navigationDivs = [
					"up",
					"down",
					"left",
					"right",
					"zoomIn",
					"zoomOut",
					"zoomExtends"
				];
				var navigationDivActions = [
					"_moveUp",
					"_moveDown",
					"_moveLeft",
					"_moveRight",
					"_zoomIn",
					"_zoomOut",
					"_fit"
				];
				this.navigationDOM["wrapper"] = document.createElement("div");
				this.navigationDOM["wrapper"].className = "vis-navigation";
				this.canvas.frame.appendChild(this.navigationDOM["wrapper"]);
				for (var i$2 = 0; i$2 < navigationDivs.length; i$2++) {
					this.navigationDOM[navigationDivs[i$2]] = document.createElement("div");
					this.navigationDOM[navigationDivs[i$2]].className = "vis-button vis-" + navigationDivs[i$2];
					this.navigationDOM["wrapper"].appendChild(this.navigationDOM[navigationDivs[i$2]]);
					var hammer = new Hammer(this.navigationDOM[navigationDivs[i$2]]);
					if (navigationDivActions[i$2] === "_fit") {
						var _context;
						onTouch(hammer, _bindInstanceProperty$1(_context = this._fit).call(_context, this));
					} else {
						var _context2;
						onTouch(hammer, _bindInstanceProperty$1(_context2 = this.bindToRedraw).call(_context2, this, navigationDivActions[i$2]));
					}
					this.navigationHammers.push(hammer);
				}
				var hammerFrame = new Hammer(this.canvas.frame);
				onRelease(hammerFrame, function() {
					_this2._stopMovement();
				});
				this.navigationHammers.push(hammerFrame);
				this.iconsCreated = true;
			}
		},
		{
			key: "bindToRedraw",
			value: function bindToRedraw(action) {
				if (this.boundFunctions[action] === void 0) {
					var _context3;
					this.boundFunctions[action] = _bindInstanceProperty$1(_context3 = this[action]).call(_context3, this);
					this.body.emitter.on("initRedraw", this.boundFunctions[action]);
					this.body.emitter.emit("_startRendering");
				}
			}
		},
		{
			key: "unbindFromRedraw",
			value: function unbindFromRedraw(action) {
				if (this.boundFunctions[action] !== void 0) {
					this.body.emitter.off("initRedraw", this.boundFunctions[action]);
					this.body.emitter.emit("_stopRendering");
					delete this.boundFunctions[action];
				}
			}
		},
		{
			key: "_fit",
			value: function _fit() {
				if (new Date().valueOf() - this.touchTime > 700) {
					this.body.emitter.emit("fit", { duration: 700 });
					this.touchTime = new Date().valueOf();
				}
			}
		},
		{
			key: "_stopMovement",
			value: function _stopMovement() {
				for (var boundAction in this.boundFunctions) if (Object.prototype.hasOwnProperty.call(this.boundFunctions, boundAction)) {
					this.body.emitter.off("initRedraw", this.boundFunctions[boundAction]);
					this.body.emitter.emit("_stopRendering");
				}
				this.boundFunctions = {};
			}
		},
		{
			key: "_moveUp",
			value: function _moveUp() {
				this.body.view.translation.y += this.options.keyboard.speed.y;
			}
		},
		{
			key: "_moveDown",
			value: function _moveDown() {
				this.body.view.translation.y -= this.options.keyboard.speed.y;
			}
		},
		{
			key: "_moveLeft",
			value: function _moveLeft() {
				this.body.view.translation.x += this.options.keyboard.speed.x;
			}
		},
		{
			key: "_moveRight",
			value: function _moveRight() {
				this.body.view.translation.x -= this.options.keyboard.speed.x;
			}
		},
		{
			key: "_zoomIn",
			value: function _zoomIn() {
				var scaleOld = this.body.view.scale;
				var scale = this.body.view.scale * (1 + this.options.keyboard.speed.zoom);
				var translation = this.body.view.translation;
				var scaleFrac = scale / scaleOld;
				var tx = (1 - scaleFrac) * this.canvas.canvasViewCenter.x + translation.x * scaleFrac;
				var ty = (1 - scaleFrac) * this.canvas.canvasViewCenter.y + translation.y * scaleFrac;
				this.body.view.scale = scale;
				this.body.view.translation = {
					x: tx,
					y: ty
				};
				this.body.emitter.emit("zoom", {
					direction: "+",
					scale: this.body.view.scale,
					pointer: null
				});
			}
		},
		{
			key: "_zoomOut",
			value: function _zoomOut() {
				var scaleOld = this.body.view.scale;
				var scale = this.body.view.scale / (1 + this.options.keyboard.speed.zoom);
				var translation = this.body.view.translation;
				var scaleFrac = scale / scaleOld;
				var tx = (1 - scaleFrac) * this.canvas.canvasViewCenter.x + translation.x * scaleFrac;
				var ty = (1 - scaleFrac) * this.canvas.canvasViewCenter.y + translation.y * scaleFrac;
				this.body.view.scale = scale;
				this.body.view.translation = {
					x: tx,
					y: ty
				};
				this.body.emitter.emit("zoom", {
					direction: "-",
					scale: this.body.view.scale,
					pointer: null
				});
			}
		},
		{
			key: "configureKeyboardBindings",
			value: function configureKeyboardBindings() {
				var _this3 = this;
				if (this.keycharm !== void 0) this.keycharm.destroy();
				if (this.options.keyboard.enabled === true) {
					if (this.options.keyboard.bindToWindow === true) this.keycharm = keycharm({
						container: window,
						preventDefault: true
					});
					else this.keycharm = keycharm({
						container: this.canvas.frame,
						preventDefault: true
					});
					this.keycharm.reset();
					if (this.activated === true) {
						var _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20, _context21, _context22, _context23, _context24, _context25, _context26, _context27;
						_bindInstanceProperty$1(_context4 = this.keycharm).call(_context4, "up", function() {
							_this3.bindToRedraw("_moveUp");
						}, "keydown");
						_bindInstanceProperty$1(_context5 = this.keycharm).call(_context5, "down", function() {
							_this3.bindToRedraw("_moveDown");
						}, "keydown");
						_bindInstanceProperty$1(_context6 = this.keycharm).call(_context6, "left", function() {
							_this3.bindToRedraw("_moveLeft");
						}, "keydown");
						_bindInstanceProperty$1(_context7 = this.keycharm).call(_context7, "right", function() {
							_this3.bindToRedraw("_moveRight");
						}, "keydown");
						_bindInstanceProperty$1(_context8 = this.keycharm).call(_context8, "=", function() {
							_this3.bindToRedraw("_zoomIn");
						}, "keydown");
						_bindInstanceProperty$1(_context9 = this.keycharm).call(_context9, "num+", function() {
							_this3.bindToRedraw("_zoomIn");
						}, "keydown");
						_bindInstanceProperty$1(_context10 = this.keycharm).call(_context10, "num-", function() {
							_this3.bindToRedraw("_zoomOut");
						}, "keydown");
						_bindInstanceProperty$1(_context11 = this.keycharm).call(_context11, "-", function() {
							_this3.bindToRedraw("_zoomOut");
						}, "keydown");
						_bindInstanceProperty$1(_context12 = this.keycharm).call(_context12, "[", function() {
							_this3.bindToRedraw("_zoomOut");
						}, "keydown");
						_bindInstanceProperty$1(_context13 = this.keycharm).call(_context13, "]", function() {
							_this3.bindToRedraw("_zoomIn");
						}, "keydown");
						_bindInstanceProperty$1(_context14 = this.keycharm).call(_context14, "pageup", function() {
							_this3.bindToRedraw("_zoomIn");
						}, "keydown");
						_bindInstanceProperty$1(_context15 = this.keycharm).call(_context15, "pagedown", function() {
							_this3.bindToRedraw("_zoomOut");
						}, "keydown");
						_bindInstanceProperty$1(_context16 = this.keycharm).call(_context16, "up", function() {
							_this3.unbindFromRedraw("_moveUp");
						}, "keyup");
						_bindInstanceProperty$1(_context17 = this.keycharm).call(_context17, "down", function() {
							_this3.unbindFromRedraw("_moveDown");
						}, "keyup");
						_bindInstanceProperty$1(_context18 = this.keycharm).call(_context18, "left", function() {
							_this3.unbindFromRedraw("_moveLeft");
						}, "keyup");
						_bindInstanceProperty$1(_context19 = this.keycharm).call(_context19, "right", function() {
							_this3.unbindFromRedraw("_moveRight");
						}, "keyup");
						_bindInstanceProperty$1(_context20 = this.keycharm).call(_context20, "=", function() {
							_this3.unbindFromRedraw("_zoomIn");
						}, "keyup");
						_bindInstanceProperty$1(_context21 = this.keycharm).call(_context21, "num+", function() {
							_this3.unbindFromRedraw("_zoomIn");
						}, "keyup");
						_bindInstanceProperty$1(_context22 = this.keycharm).call(_context22, "num-", function() {
							_this3.unbindFromRedraw("_zoomOut");
						}, "keyup");
						_bindInstanceProperty$1(_context23 = this.keycharm).call(_context23, "-", function() {
							_this3.unbindFromRedraw("_zoomOut");
						}, "keyup");
						_bindInstanceProperty$1(_context24 = this.keycharm).call(_context24, "[", function() {
							_this3.unbindFromRedraw("_zoomOut");
						}, "keyup");
						_bindInstanceProperty$1(_context25 = this.keycharm).call(_context25, "]", function() {
							_this3.unbindFromRedraw("_zoomIn");
						}, "keyup");
						_bindInstanceProperty$1(_context26 = this.keycharm).call(_context26, "pageup", function() {
							_this3.unbindFromRedraw("_zoomIn");
						}, "keyup");
						_bindInstanceProperty$1(_context27 = this.keycharm).call(_context27, "pagedown", function() {
							_this3.unbindFromRedraw("_zoomOut");
						}, "keyup");
					}
				}
			}
		}
	]);
	return NavigationHandler$1;
}();
function _createForOfIteratorHelper$4(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$4(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$4(o, minLen) {
	var _context15;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
	var n = _sliceInstanceProperty(_context15 = Object.prototype.toString.call(o)).call(_context15, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
}
function _arrayLikeToArray$4(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**
* Handler for interactions
*/
var InteractionHandler = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	* @param {SelectionHandler} selectionHandler
	*/
	function InteractionHandler$1(body, canvas, selectionHandler) {
		var _context, _context2, _context3, _context4, _context5, _context6, _context7, _context8, _context9, _context10, _context11, _context12, _context13;
		_classCallCheck(this, InteractionHandler$1);
		this.body = body;
		this.canvas = canvas;
		this.selectionHandler = selectionHandler;
		this.navigationHandler = new NavigationHandler(body, canvas);
		this.body.eventListeners.onTap = _bindInstanceProperty$1(_context = this.onTap).call(_context, this);
		this.body.eventListeners.onTouch = _bindInstanceProperty$1(_context2 = this.onTouch).call(_context2, this);
		this.body.eventListeners.onDoubleTap = _bindInstanceProperty$1(_context3 = this.onDoubleTap).call(_context3, this);
		this.body.eventListeners.onHold = _bindInstanceProperty$1(_context4 = this.onHold).call(_context4, this);
		this.body.eventListeners.onDragStart = _bindInstanceProperty$1(_context5 = this.onDragStart).call(_context5, this);
		this.body.eventListeners.onDrag = _bindInstanceProperty$1(_context6 = this.onDrag).call(_context6, this);
		this.body.eventListeners.onDragEnd = _bindInstanceProperty$1(_context7 = this.onDragEnd).call(_context7, this);
		this.body.eventListeners.onMouseWheel = _bindInstanceProperty$1(_context8 = this.onMouseWheel).call(_context8, this);
		this.body.eventListeners.onPinch = _bindInstanceProperty$1(_context9 = this.onPinch).call(_context9, this);
		this.body.eventListeners.onMouseMove = _bindInstanceProperty$1(_context10 = this.onMouseMove).call(_context10, this);
		this.body.eventListeners.onRelease = _bindInstanceProperty$1(_context11 = this.onRelease).call(_context11, this);
		this.body.eventListeners.onContext = _bindInstanceProperty$1(_context12 = this.onContext).call(_context12, this);
		this.touchTime = 0;
		this.drag = {};
		this.pinch = {};
		this.popup = void 0;
		this.popupObj = void 0;
		this.popupTimer = void 0;
		this.body.functions.getPointer = _bindInstanceProperty$1(_context13 = this.getPointer).call(_context13, this);
		this.options = {};
		this.defaultOptions = {
			dragNodes: true,
			dragView: true,
			hover: false,
			keyboard: {
				enabled: false,
				speed: {
					x: 10,
					y: 10,
					zoom: .02
				},
				bindToWindow: true,
				autoFocus: true
			},
			navigationButtons: false,
			tooltipDelay: 300,
			zoomView: true,
			zoomSpeed: 1
		};
		_Object$assign(this.options, this.defaultOptions);
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(InteractionHandler$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this = this;
				this.body.emitter.on("destroy", function() {
					clearTimeout(_this.popupTimer);
					delete _this.body.functions.getPointer;
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					var fields = [
						"hideEdgesOnDrag",
						"hideEdgesOnZoom",
						"hideNodesOnDrag",
						"keyboard",
						"multiselect",
						"selectable",
						"selectConnectedEdges"
					];
					selectiveNotDeepExtend(fields, this.options, options);
					mergeOptions(this.options, options, "keyboard");
					if (options.tooltip) {
						_Object$assign(this.options.tooltip, options.tooltip);
						if (options.tooltip.color) this.options.tooltip.color = parseColor(options.tooltip.color);
					}
				}
				this.navigationHandler.setOptions(this.options);
			}
		},
		{
			key: "getPointer",
			value: function getPointer(touch) {
				return {
					x: touch.x - getAbsoluteLeft(this.canvas.frame.canvas),
					y: touch.y - getAbsoluteTop(this.canvas.frame.canvas)
				};
			}
		},
		{
			key: "onTouch",
			value: function onTouch$1(event) {
				if (new Date().valueOf() - this.touchTime > 50) {
					this.drag.pointer = this.getPointer(event.center);
					this.drag.pinched = false;
					this.pinch.scale = this.body.view.scale;
					this.touchTime = new Date().valueOf();
				}
			}
		},
		{
			key: "onTap",
			value: function onTap(event) {
				var pointer = this.getPointer(event.center);
				var multiselect = this.selectionHandler.options.multiselect && (event.changedPointers[0].ctrlKey || event.changedPointers[0].metaKey);
				this.checkSelectionChanges(pointer, multiselect);
				this.selectionHandler.commitAndEmit(pointer, event);
				this.selectionHandler.generateClickEvent("click", event, pointer);
			}
		},
		{
			key: "onDoubleTap",
			value: function onDoubleTap(event) {
				var pointer = this.getPointer(event.center);
				this.selectionHandler.generateClickEvent("doubleClick", event, pointer);
			}
		},
		{
			key: "onHold",
			value: function onHold(event) {
				var pointer = this.getPointer(event.center);
				var multiselect = this.selectionHandler.options.multiselect;
				this.checkSelectionChanges(pointer, multiselect);
				this.selectionHandler.commitAndEmit(pointer, event);
				this.selectionHandler.generateClickEvent("click", event, pointer);
				this.selectionHandler.generateClickEvent("hold", event, pointer);
			}
		},
		{
			key: "onRelease",
			value: function onRelease$1(event) {
				if (new Date().valueOf() - this.touchTime > 10) {
					var pointer = this.getPointer(event.center);
					this.selectionHandler.generateClickEvent("release", event, pointer);
					this.touchTime = new Date().valueOf();
				}
			}
		},
		{
			key: "onContext",
			value: function onContext(event) {
				var pointer = this.getPointer({
					x: event.clientX,
					y: event.clientY
				});
				this.selectionHandler.generateClickEvent("oncontext", event, pointer);
			}
		},
		{
			key: "checkSelectionChanges",
			value: function checkSelectionChanges(pointer) {
				var add = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
				if (add === true) this.selectionHandler.selectAdditionalOnPoint(pointer);
				else this.selectionHandler.selectOnPoint(pointer);
			}
		},
		{
			key: "_determineDifference",
			value: function _determineDifference(firstSet, secondSet) {
				var arrayDiff = function arrayDiff$1(firstArr, secondArr) {
					var result = [];
					for (var i$2 = 0; i$2 < firstArr.length; i$2++) {
						var value = firstArr[i$2];
						if (_indexOfInstanceProperty(secondArr).call(secondArr, value) === -1) result.push(value);
					}
					return result;
				};
				return {
					nodes: arrayDiff(firstSet.nodes, secondSet.nodes),
					edges: arrayDiff(firstSet.edges, secondSet.edges)
				};
			}
		},
		{
			key: "onDragStart",
			value: function onDragStart(event) {
				if (this.drag.dragging) return;
				if (this.drag.pointer === void 0) this.onTouch(event);
				var node$1 = this.selectionHandler.getNodeAt(this.drag.pointer);
				this.drag.dragging = true;
				this.drag.selection = [];
				this.drag.translation = _Object$assign({}, this.body.view.translation);
				this.drag.nodeId = void 0;
				if (event.srcEvent.shiftKey) {
					this.body.selectionBox.show = true;
					var pointer = this.getPointer(event.center);
					this.body.selectionBox.position.start = {
						x: this.canvas._XconvertDOMtoCanvas(pointer.x),
						y: this.canvas._YconvertDOMtoCanvas(pointer.y)
					};
					this.body.selectionBox.position.end = {
						x: this.canvas._XconvertDOMtoCanvas(pointer.x),
						y: this.canvas._YconvertDOMtoCanvas(pointer.y)
					};
				} else if (node$1 !== void 0 && this.options.dragNodes === true) {
					this.drag.nodeId = node$1.id;
					if (node$1.isSelected() === false) this.selectionHandler.setSelection({ nodes: [node$1.id] });
					this.selectionHandler.generateClickEvent("dragStart", event, this.drag.pointer);
					var _iterator = _createForOfIteratorHelper$4(this.selectionHandler.getSelectedNodes()), _step;
					try {
						for (_iterator.s(); !(_step = _iterator.n()).done;) {
							var _node = _step.value;
							var s = {
								id: _node.id,
								node: _node,
								x: _node.x,
								y: _node.y,
								xFixed: _node.options.fixed.x,
								yFixed: _node.options.fixed.y
							};
							_node.options.fixed.x = true;
							_node.options.fixed.y = true;
							this.drag.selection.push(s);
						}
					} catch (err) {
						_iterator.e(err);
					} finally {
						_iterator.f();
					}
				} else this.selectionHandler.generateClickEvent("dragStart", event, this.drag.pointer, void 0, true);
			}
		},
		{
			key: "onDrag",
			value: function onDrag(event) {
				var _this2 = this;
				if (this.drag.pinched === true) return;
				this.body.emitter.emit("unlockNode");
				var pointer = this.getPointer(event.center);
				var selection = this.drag.selection;
				if (selection && selection.length && this.options.dragNodes === true) {
					this.selectionHandler.generateClickEvent("dragging", event, pointer);
					var deltaX = pointer.x - this.drag.pointer.x;
					var deltaY = pointer.y - this.drag.pointer.y;
					_forEachInstanceProperty(selection).call(selection, function(selection$1) {
						var node$1 = selection$1.node;
						if (selection$1.xFixed === false) node$1.x = _this2.canvas._XconvertDOMtoCanvas(_this2.canvas._XconvertCanvasToDOM(selection$1.x) + deltaX);
						if (selection$1.yFixed === false) node$1.y = _this2.canvas._YconvertDOMtoCanvas(_this2.canvas._YconvertCanvasToDOM(selection$1.y) + deltaY);
					});
					this.body.emitter.emit("startSimulation");
				} else {
					if (event.srcEvent.shiftKey) {
						this.selectionHandler.generateClickEvent("dragging", event, pointer, void 0, true);
						if (this.drag.pointer === void 0) {
							this.onDragStart(event);
							return;
						}
						this.body.selectionBox.position.end = {
							x: this.canvas._XconvertDOMtoCanvas(pointer.x),
							y: this.canvas._YconvertDOMtoCanvas(pointer.y)
						};
						this.body.emitter.emit("_requestRedraw");
					}
					if (this.options.dragView === true && !event.srcEvent.shiftKey) {
						this.selectionHandler.generateClickEvent("dragging", event, pointer, void 0, true);
						if (this.drag.pointer === void 0) {
							this.onDragStart(event);
							return;
						}
						var diffX = pointer.x - this.drag.pointer.x;
						var diffY = pointer.y - this.drag.pointer.y;
						this.body.view.translation = {
							x: this.drag.translation.x + diffX,
							y: this.drag.translation.y + diffY
						};
						this.body.emitter.emit("_requestRedraw");
					}
				}
			}
		},
		{
			key: "onDragEnd",
			value: function onDragEnd(event) {
				var _this3 = this;
				this.drag.dragging = false;
				if (this.body.selectionBox.show) {
					var _context14;
					this.body.selectionBox.show = false;
					var selectionBoxPosition = this.body.selectionBox.position;
					var selectionBoxPositionMinMax = {
						minX: Math.min(selectionBoxPosition.start.x, selectionBoxPosition.end.x),
						minY: Math.min(selectionBoxPosition.start.y, selectionBoxPosition.end.y),
						maxX: Math.max(selectionBoxPosition.start.x, selectionBoxPosition.end.x),
						maxY: Math.max(selectionBoxPosition.start.y, selectionBoxPosition.end.y)
					};
					var toBeSelectedNodes = _filterInstanceProperty(_context14 = this.body.nodeIndices).call(_context14, function(nodeId) {
						var node$1 = _this3.body.nodes[nodeId];
						return node$1.x >= selectionBoxPositionMinMax.minX && node$1.x <= selectionBoxPositionMinMax.maxX && node$1.y >= selectionBoxPositionMinMax.minY && node$1.y <= selectionBoxPositionMinMax.maxY;
					});
					_forEachInstanceProperty(toBeSelectedNodes).call(toBeSelectedNodes, function(nodeId) {
						return _this3.selectionHandler.selectObject(_this3.body.nodes[nodeId]);
					});
					var pointer = this.getPointer(event.center);
					this.selectionHandler.commitAndEmit(pointer, event);
					this.selectionHandler.generateClickEvent("dragEnd", event, this.getPointer(event.center), void 0, true);
					this.body.emitter.emit("_requestRedraw");
				} else {
					var selection = this.drag.selection;
					if (selection && selection.length) {
						_forEachInstanceProperty(selection).call(selection, function(s) {
							s.node.options.fixed.x = s.xFixed;
							s.node.options.fixed.y = s.yFixed;
						});
						this.selectionHandler.generateClickEvent("dragEnd", event, this.getPointer(event.center));
						this.body.emitter.emit("startSimulation");
					} else {
						this.selectionHandler.generateClickEvent("dragEnd", event, this.getPointer(event.center), void 0, true);
						this.body.emitter.emit("_requestRedraw");
					}
				}
			}
		},
		{
			key: "onPinch",
			value: function onPinch(event) {
				var pointer = this.getPointer(event.center);
				this.drag.pinched = true;
				if (this.pinch["scale"] === void 0) this.pinch.scale = 1;
				var scale = this.pinch.scale * event.scale;
				this.zoom(scale, pointer);
			}
		},
		{
			key: "zoom",
			value: function zoom(scale, pointer) {
				if (this.options.zoomView === true) {
					var scaleOld = this.body.view.scale;
					if (scale < 1e-5) scale = 1e-5;
					if (scale > 10) scale = 10;
					var preScaleDragPointer = void 0;
					if (this.drag !== void 0) {
						if (this.drag.dragging === true) preScaleDragPointer = this.canvas.DOMtoCanvas(this.drag.pointer);
					}
					var translation = this.body.view.translation;
					var scaleFrac = scale / scaleOld;
					var tx = (1 - scaleFrac) * pointer.x + translation.x * scaleFrac;
					var ty = (1 - scaleFrac) * pointer.y + translation.y * scaleFrac;
					this.body.view.scale = scale;
					this.body.view.translation = {
						x: tx,
						y: ty
					};
					if (preScaleDragPointer != void 0) {
						var postScaleDragPointer = this.canvas.canvasToDOM(preScaleDragPointer);
						this.drag.pointer.x = postScaleDragPointer.x;
						this.drag.pointer.y = postScaleDragPointer.y;
					}
					this.body.emitter.emit("_requestRedraw");
					if (scaleOld < scale) this.body.emitter.emit("zoom", {
						direction: "+",
						scale: this.body.view.scale,
						pointer
					});
					else this.body.emitter.emit("zoom", {
						direction: "-",
						scale: this.body.view.scale,
						pointer
					});
				}
			}
		},
		{
			key: "onMouseWheel",
			value: function onMouseWheel(event) {
				if (this.options.zoomView === true) {
					if (event.deltaY !== 0) {
						var scale = this.body.view.scale;
						scale *= 1 + (event.deltaY < 0 ? 1 : -1) * (this.options.zoomSpeed * .1);
						var pointer = this.getPointer({
							x: event.clientX,
							y: event.clientY
						});
						this.zoom(scale, pointer);
					}
					event.preventDefault();
				}
			}
		},
		{
			key: "onMouseMove",
			value: function onMouseMove(event) {
				var _this4 = this;
				var pointer = this.getPointer({
					x: event.clientX,
					y: event.clientY
				});
				var popupVisible = false;
				if (this.popup !== void 0) {
					if (this.popup.hidden === false) this._checkHidePopup(pointer);
					if (this.popup.hidden === false) {
						popupVisible = true;
						this.popup.setPosition(pointer.x + 3, pointer.y - 5);
						this.popup.show();
					}
				}
				if (this.options.keyboard.autoFocus && this.options.keyboard.bindToWindow === false && this.options.keyboard.enabled === true) this.canvas.frame.focus();
				if (popupVisible === false) {
					if (this.popupTimer !== void 0) {
						clearInterval(this.popupTimer);
						this.popupTimer = void 0;
					}
					if (!this.drag.dragging) this.popupTimer = _setTimeout(function() {
						return _this4._checkShowPopup(pointer);
					}, this.options.tooltipDelay);
				}
				if (this.options.hover === true) this.selectionHandler.hoverObject(event, pointer);
			}
		},
		{
			key: "_checkShowPopup",
			value: function _checkShowPopup(pointer) {
				var x = this.canvas._XconvertDOMtoCanvas(pointer.x);
				var y = this.canvas._YconvertDOMtoCanvas(pointer.y);
				var pointerObj = {
					left: x,
					top: y,
					right: x,
					bottom: y
				};
				var previousPopupObjId = this.popupObj === void 0 ? void 0 : this.popupObj.id;
				var nodeUnderCursor = false;
				var popupType = "node";
				if (this.popupObj === void 0) {
					var nodeIndices = this.body.nodeIndices;
					var nodes = this.body.nodes;
					var node$1;
					var overlappingNodes = [];
					for (var i$2 = 0; i$2 < nodeIndices.length; i$2++) {
						node$1 = nodes[nodeIndices[i$2]];
						if (node$1.isOverlappingWith(pointerObj) === true) {
							nodeUnderCursor = true;
							if (node$1.getTitle() !== void 0) overlappingNodes.push(nodeIndices[i$2]);
						}
					}
					if (overlappingNodes.length > 0) {
						this.popupObj = nodes[overlappingNodes[overlappingNodes.length - 1]];
						nodeUnderCursor = true;
					}
				}
				if (this.popupObj === void 0 && nodeUnderCursor === false) {
					var edgeIndices = this.body.edgeIndices;
					var edges = this.body.edges;
					var edge;
					var overlappingEdges = [];
					for (var _i = 0; _i < edgeIndices.length; _i++) {
						edge = edges[edgeIndices[_i]];
						if (edge.isOverlappingWith(pointerObj) === true) {
							if (edge.connected === true && edge.getTitle() !== void 0) overlappingEdges.push(edgeIndices[_i]);
						}
					}
					if (overlappingEdges.length > 0) {
						this.popupObj = edges[overlappingEdges[overlappingEdges.length - 1]];
						popupType = "edge";
					}
				}
				if (this.popupObj !== void 0) {
					if (this.popupObj.id !== previousPopupObjId) {
						if (this.popup === void 0) this.popup = new Popup(this.canvas.frame);
						this.popup.popupTargetType = popupType;
						this.popup.popupTargetId = this.popupObj.id;
						this.popup.setPosition(pointer.x + 3, pointer.y - 5);
						this.popup.setText(this.popupObj.getTitle());
						this.popup.show();
						this.body.emitter.emit("showPopup", this.popupObj.id);
					}
				} else if (this.popup !== void 0) {
					this.popup.hide();
					this.body.emitter.emit("hidePopup");
				}
			}
		},
		{
			key: "_checkHidePopup",
			value: function _checkHidePopup(pointer) {
				var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
				var stillOnObj = false;
				if (this.popup.popupTargetType === "node") {
					if (this.body.nodes[this.popup.popupTargetId] !== void 0) {
						stillOnObj = this.body.nodes[this.popup.popupTargetId].isOverlappingWith(pointerObj);
						if (stillOnObj === true) {
							var overNode = this.selectionHandler.getNodeAt(pointer);
							stillOnObj = overNode === void 0 ? false : overNode.id === this.popup.popupTargetId;
						}
					}
				} else if (this.selectionHandler.getNodeAt(pointer) === void 0) {
					if (this.body.edges[this.popup.popupTargetId] !== void 0) stillOnObj = this.body.edges[this.popup.popupTargetId].isOverlappingWith(pointerObj);
				}
				if (stillOnObj === false) {
					this.popupObj = void 0;
					this.popup.hide();
					this.body.emitter.emit("hidePopup");
				}
			}
		}
	]);
	return InteractionHandler$1;
}();
var setExports = {};
var set$2 = {
	get exports() {
		return setExports;
	},
	set exports(v) {
		setExports = v;
	}
};
var collection$1 = collection$3;
var collectionStrong = collectionStrong$2;
collection$1("Set", function(init) {
	return function Set() {
		return init(this, arguments.length ? arguments[0] : void 0);
	};
}, collectionStrong);
var path$1 = path$y;
var set$1 = path$1.Set;
var parent$4 = set$1;
var set = parent$4;
(function(module) {
	module.exports = set;
})(set$2);
var _Set = /* @__PURE__ */ getDefaultExportFromCjs(setExports);
var weakMapExports = {};
var weakMap$2 = {
	get exports() {
		return weakMapExports;
	},
	set exports(v) {
		weakMapExports = v;
	}
};
var uncurryThis$2 = functionUncurryThis;
var defineBuiltIns$1 = defineBuiltIns$3;
var getWeakData = internalMetadataExports.getWeakData;
var anInstance = anInstance$3;
var anObject = anObject$d;
var isNullOrUndefined = isNullOrUndefined$5;
var isObject$1 = isObject$j;
var iterate = iterate$3;
var ArrayIterationModule = arrayIteration;
var hasOwn = hasOwnProperty_1;
var InternalStateModule = internalState;
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
var find = ArrayIterationModule.find;
var findIndex = ArrayIterationModule.findIndex;
var splice = uncurryThis$2([].splice);
var id = 0;
var uncaughtFrozenStore = function(state) {
	return state.frozen || (state.frozen = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function() {
	this.entries = [];
};
var findUncaughtFrozen = function(store$5, key) {
	return find(store$5.entries, function(it$1) {
		return it$1[0] === key;
	});
};
UncaughtFrozenStore.prototype = {
	get: function(key) {
		var entry = findUncaughtFrozen(this, key);
		if (entry) return entry[1];
	},
	has: function(key) {
		return !!findUncaughtFrozen(this, key);
	},
	set: function(key, value) {
		var entry = findUncaughtFrozen(this, key);
		if (entry) entry[1] = value;
		else this.entries.push([key, value]);
	},
	"delete": function(key) {
		var index$1 = findIndex(this.entries, function(it$1) {
			return it$1[0] === key;
		});
		if (~index$1) splice(this.entries, index$1, 1);
		return !!~index$1;
	}
};
var collectionWeak$1 = { getConstructor: function(wrapper$1, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
	var Constructor = wrapper$1(function(that, iterable) {
		anInstance(that, Prototype);
		setInternalState(that, {
			type: CONSTRUCTOR_NAME,
			id: id++,
			frozen: void 0
		});
		if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], {
			that,
			AS_ENTRIES: IS_MAP
		});
	});
	var Prototype = Constructor.prototype;
	var getInternalState$4 = internalStateGetterFor(CONSTRUCTOR_NAME);
	var define = function(that, key, value) {
		var state = getInternalState$4(that);
		var data$2 = getWeakData(anObject(key), true);
		if (data$2 === true) uncaughtFrozenStore(state).set(key, value);
		else data$2[state.id] = value;
		return that;
	};
	defineBuiltIns$1(Prototype, {
		"delete": function(key) {
			var state = getInternalState$4(this);
			if (!isObject$1(key)) return false;
			var data$2 = getWeakData(key);
			if (data$2 === true) return uncaughtFrozenStore(state)["delete"](key);
			return data$2 && hasOwn(data$2, state.id) && delete data$2[state.id];
		},
		has: function has$2(key) {
			var state = getInternalState$4(this);
			if (!isObject$1(key)) return false;
			var data$2 = getWeakData(key);
			if (data$2 === true) return uncaughtFrozenStore(state).has(key);
			return data$2 && hasOwn(data$2, state.id);
		}
	});
	defineBuiltIns$1(Prototype, IS_MAP ? {
		get: function get$9(key) {
			var state = getInternalState$4(this);
			if (isObject$1(key)) {
				var data$2 = getWeakData(key);
				if (data$2 === true) return uncaughtFrozenStore(state).get(key);
				return data$2 ? data$2[state.id] : void 0;
			}
		},
		set: function set$6(key, value) {
			return define(this, key, value);
		}
	} : { add: function add(value) {
		return define(this, value, true);
	} });
	return Constructor;
} };
var FREEZING = freezing;
var global$1 = global$l;
var uncurryThis$1 = functionUncurryThis;
var defineBuiltIns = defineBuiltIns$3;
var InternalMetadataModule = internalMetadataExports;
var collection = collection$3;
var collectionWeak = collectionWeak$1;
var isObject = isObject$j;
var enforceInternalState = internalState.enforce;
var fails$1 = fails$w;
var NATIVE_WEAK_MAP = weakMapBasicDetection;
var $Object = Object;
var isArray = Array.isArray;
var isExtensible = $Object.isExtensible;
var isFrozen = $Object.isFrozen;
var isSealed = $Object.isSealed;
var freeze = $Object.freeze;
var seal = $Object.seal;
var FROZEN = {};
var SEALED = {};
var IS_IE11 = !global$1.ActiveXObject && "ActiveXObject" in global$1;
var InternalWeakMap;
var wrapper = function(init) {
	return function WeakMap$3() {
		return init(this, arguments.length ? arguments[0] : void 0);
	};
};
var $WeakMap = collection("WeakMap", wrapper, collectionWeak);
var WeakMapPrototype = $WeakMap.prototype;
var nativeSet = uncurryThis$1(WeakMapPrototype.set);
var hasMSEdgeFreezingBug = function() {
	return FREEZING && fails$1(function() {
		var frozenArray = freeze([]);
		nativeSet(new $WeakMap(), frozenArray, 1);
		return !isFrozen(frozenArray);
	});
};
if (NATIVE_WEAK_MAP) {
	if (IS_IE11) {
		InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true);
		InternalMetadataModule.enable();
		var nativeDelete = uncurryThis$1(WeakMapPrototype["delete"]);
		var nativeHas = uncurryThis$1(WeakMapPrototype.has);
		var nativeGet = uncurryThis$1(WeakMapPrototype.get);
		defineBuiltIns(WeakMapPrototype, {
			"delete": function(key) {
				if (isObject(key) && !isExtensible(key)) {
					var state = enforceInternalState(this);
					if (!state.frozen) state.frozen = new InternalWeakMap();
					return nativeDelete(this, key) || state.frozen["delete"](key);
				}
				return nativeDelete(this, key);
			},
			has: function has$2(key) {
				if (isObject(key) && !isExtensible(key)) {
					var state = enforceInternalState(this);
					if (!state.frozen) state.frozen = new InternalWeakMap();
					return nativeHas(this, key) || state.frozen.has(key);
				}
				return nativeHas(this, key);
			},
			get: function get$9(key) {
				if (isObject(key) && !isExtensible(key)) {
					var state = enforceInternalState(this);
					if (!state.frozen) state.frozen = new InternalWeakMap();
					return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
				}
				return nativeGet(this, key);
			},
			set: function set$6(key, value) {
				if (isObject(key) && !isExtensible(key)) {
					var state = enforceInternalState(this);
					if (!state.frozen) state.frozen = new InternalWeakMap();
					nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
				} else nativeSet(this, key, value);
				return this;
			}
		});
	} else if (hasMSEdgeFreezingBug()) defineBuiltIns(WeakMapPrototype, { set: function set$6(key, value) {
		var arrayIntegrityLevel;
		if (isArray(key)) {
			if (isFrozen(key)) arrayIntegrityLevel = FROZEN;
			else if (isSealed(key)) arrayIntegrityLevel = SEALED;
		}
		nativeSet(this, key, value);
		if (arrayIntegrityLevel == FROZEN) freeze(key);
		if (arrayIntegrityLevel == SEALED) seal(key);
		return this;
	} });
}
var path = path$y;
var weakMap$1 = path.WeakMap;
var parent$3 = weakMap$1;
var weakMap = parent$3;
(function(module) {
	module.exports = weakMap;
})(weakMap$2);
var _WeakMap = /* @__PURE__ */ getDefaultExportFromCjs(weakMapExports);
/******************************************************************************

Copyright (c) Microsoft Corporation.



Permission to use, copy, modify, and/or distribute this software for any

purpose with or without fee is hereby granted.



THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH

REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY

AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,

INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM

LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR

OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR

PERFORMANCE OF THIS SOFTWARE.

***************************************************************************** */
function __classPrivateFieldGet(receiver, state, kind, f) {
	if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
	if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
	return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
	if (kind === "m") throw new TypeError("Private method is not writable");
	if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
	if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
	return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
}
function _createForOfIteratorHelper$3(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$3(o, minLen) {
	var _context2;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
	var n = _sliceInstanceProperty(_context2 = Object.prototype.toString.call(o)).call(_context2, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
}
function _arrayLikeToArray$3(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
var _SingleTypeSelectionAccumulator_previousSelection, _SingleTypeSelectionAccumulator_selection, _SelectionAccumulator_nodes, _SelectionAccumulator_edges, _SelectionAccumulator_commitHandler;
/**

* @param prev

* @param next

*/
function diffSets(prev, next$1) {
	var diff = new _Set();
	var _iterator = _createForOfIteratorHelper$3(next$1), _step;
	try {
		for (_iterator.s(); !(_step = _iterator.n()).done;) {
			var item = _step.value;
			if (!prev.has(item)) diff.add(item);
		}
	} catch (err) {
		_iterator.e(err);
	} finally {
		_iterator.f();
	}
	return diff;
}
var SingleTypeSelectionAccumulator = /* @__PURE__ */ function() {
	function SingleTypeSelectionAccumulator$1() {
		_classCallCheck(this, SingleTypeSelectionAccumulator$1);
		_SingleTypeSelectionAccumulator_previousSelection.set(this, new _Set());
		_SingleTypeSelectionAccumulator_selection.set(this, new _Set());
	}
	_createClass(SingleTypeSelectionAccumulator$1, [
		{
			key: "size",
			get: function get$9() {
				return __classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f").size;
			}
		},
		{
			key: "add",
			value: function add() {
				for (var _len = arguments.length, items = new Array(_len), _key = 0; _key < _len; _key++) items[_key] = arguments[_key];
				for (var _i = 0, _items = items; _i < _items.length; _i++) {
					var item = _items[_i];
					__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f").add(item);
				}
			}
		},
		{
			key: "delete",
			value: function _delete() {
				for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) items[_key2] = arguments[_key2];
				for (var _i2 = 0, _items2 = items; _i2 < _items2.length; _i2++) {
					var item = _items2[_i2];
					__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f").delete(item);
				}
			}
		},
		{
			key: "clear",
			value: function clear$1() {
				__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f").clear();
			}
		},
		{
			key: "getSelection",
			value: function getSelection() {
				return _toConsumableArray(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f"));
			}
		},
		{
			key: "getChanges",
			value: function getChanges() {
				return {
					added: _toConsumableArray(diffSets(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_previousSelection, "f"), __classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f"))),
					deleted: _toConsumableArray(diffSets(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f"), __classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_previousSelection, "f"))),
					previous: _toConsumableArray(new _Set(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_previousSelection, "f"))),
					current: _toConsumableArray(new _Set(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f")))
				};
			}
		},
		{
			key: "commit",
			value: function commit() {
				var changes = this.getChanges();
				__classPrivateFieldSet(this, _SingleTypeSelectionAccumulator_previousSelection, __classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_selection, "f"), "f");
				__classPrivateFieldSet(this, _SingleTypeSelectionAccumulator_selection, new _Set(__classPrivateFieldGet(this, _SingleTypeSelectionAccumulator_previousSelection, "f")), "f");
				var _iterator2 = _createForOfIteratorHelper$3(changes.added), _step2;
				try {
					for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
						var item = _step2.value;
						item.select();
					}
				} catch (err) {
					_iterator2.e(err);
				} finally {
					_iterator2.f();
				}
				var _iterator3 = _createForOfIteratorHelper$3(changes.deleted), _step3;
				try {
					for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
						var _item = _step3.value;
						_item.unselect();
					}
				} catch (err) {
					_iterator3.e(err);
				} finally {
					_iterator3.f();
				}
				return changes;
			}
		}
	]);
	return SingleTypeSelectionAccumulator$1;
}();
_SingleTypeSelectionAccumulator_previousSelection = new _WeakMap(), _SingleTypeSelectionAccumulator_selection = new _WeakMap();
var SelectionAccumulator = /* @__PURE__ */ function() {
	function SelectionAccumulator$1() {
		var commitHandler = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {};
		_classCallCheck(this, SelectionAccumulator$1);
		_SelectionAccumulator_nodes.set(this, new SingleTypeSelectionAccumulator());
		_SelectionAccumulator_edges.set(this, new SingleTypeSelectionAccumulator());
		_SelectionAccumulator_commitHandler.set(this, void 0);
		__classPrivateFieldSet(this, _SelectionAccumulator_commitHandler, commitHandler, "f");
	}
	_createClass(SelectionAccumulator$1, [
		{
			key: "sizeNodes",
			get: function get$9() {
				return __classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f").size;
			}
		},
		{
			key: "sizeEdges",
			get: function get$9() {
				return __classPrivateFieldGet(this, _SelectionAccumulator_edges, "f").size;
			}
		},
		{
			key: "getNodes",
			value: function getNodes() {
				return __classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f").getSelection();
			}
		},
		{
			key: "getEdges",
			value: function getEdges() {
				return __classPrivateFieldGet(this, _SelectionAccumulator_edges, "f").getSelection();
			}
		},
		{
			key: "addNodes",
			value: function addNodes() {
				var _classPrivateFieldGe;
				(_classPrivateFieldGe = __classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f")).add.apply(_classPrivateFieldGe, arguments);
			}
		},
		{
			key: "addEdges",
			value: function addEdges() {
				var _classPrivateFieldGe2;
				(_classPrivateFieldGe2 = __classPrivateFieldGet(this, _SelectionAccumulator_edges, "f")).add.apply(_classPrivateFieldGe2, arguments);
			}
		},
		{
			key: "deleteNodes",
			value: function deleteNodes(node$1) {
				__classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f").delete(node$1);
			}
		},
		{
			key: "deleteEdges",
			value: function deleteEdges(edge) {
				__classPrivateFieldGet(this, _SelectionAccumulator_edges, "f").delete(edge);
			}
		},
		{
			key: "clear",
			value: function clear$1() {
				__classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f").clear();
				__classPrivateFieldGet(this, _SelectionAccumulator_edges, "f").clear();
			}
		},
		{
			key: "commit",
			value: function commit() {
				var _classPrivateFieldGe3, _context;
				var summary = {
					nodes: __classPrivateFieldGet(this, _SelectionAccumulator_nodes, "f").commit(),
					edges: __classPrivateFieldGet(this, _SelectionAccumulator_edges, "f").commit()
				};
				for (var _len3 = arguments.length, rest = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) rest[_key3] = arguments[_key3];
				(_classPrivateFieldGe3 = __classPrivateFieldGet(this, _SelectionAccumulator_commitHandler, "f")).call.apply(_classPrivateFieldGe3, _concatInstanceProperty(_context = [this, summary]).call(_context, rest));
				return summary;
			}
		}
	]);
	return SelectionAccumulator$1;
}();
_SelectionAccumulator_nodes = new _WeakMap(), _SelectionAccumulator_edges = new _WeakMap(), _SelectionAccumulator_commitHandler = new _WeakMap();
function _createForOfIteratorHelper$2(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$2(o, minLen) {
	var _context3;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
	var n = _sliceInstanceProperty(_context3 = Object.prototype.toString.call(o)).call(_context3, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen);
}
function _arrayLikeToArray$2(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**
* The handler for selections
*/
var SelectionHandler = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	*/
	function SelectionHandler$1(body, canvas) {
		var _this = this;
		_classCallCheck(this, SelectionHandler$1);
		this.body = body;
		this.canvas = canvas;
		this._selectionAccumulator = new SelectionAccumulator();
		this.hoverObj = {
			nodes: {},
			edges: {}
		};
		this.options = {};
		this.defaultOptions = {
			multiselect: false,
			selectable: true,
			selectConnectedEdges: true,
			hoverConnectedEdges: true
		};
		_Object$assign(this.options, this.defaultOptions);
		this.body.emitter.on("_dataChanged", function() {
			_this.updateSelection();
		});
	}
	/**
	*
	* @param {object} [options]
	*/
	_createClass(SelectionHandler$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options !== void 0) {
					var fields = [
						"multiselect",
						"hoverConnectedEdges",
						"selectable",
						"selectConnectedEdges"
					];
					selectiveDeepExtend(fields, this.options, options);
				}
			}
		},
		{
			key: "selectOnPoint",
			value: function selectOnPoint(pointer) {
				var selected = false;
				if (this.options.selectable === true) {
					var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
					this.unselectAll();
					if (obj !== void 0) selected = this.selectObject(obj);
					this.body.emitter.emit("_requestRedraw");
				}
				return selected;
			}
		},
		{
			key: "selectAdditionalOnPoint",
			value: function selectAdditionalOnPoint(pointer) {
				var selectionChanged = false;
				if (this.options.selectable === true) {
					var obj = this.getNodeAt(pointer) || this.getEdgeAt(pointer);
					if (obj !== void 0) {
						selectionChanged = true;
						if (obj.isSelected() === true) this.deselectObject(obj);
						else this.selectObject(obj);
						this.body.emitter.emit("_requestRedraw");
					}
				}
				return selectionChanged;
			}
		},
		{
			key: "_initBaseEvent",
			value: function _initBaseEvent(event, pointer) {
				var properties = {};
				properties["pointer"] = {
					DOM: {
						x: pointer.x,
						y: pointer.y
					},
					canvas: this.canvas.DOMtoCanvas(pointer)
				};
				properties["event"] = event;
				return properties;
			}
		},
		{
			key: "generateClickEvent",
			value: function generateClickEvent(eventType, event, pointer, oldSelection) {
				var emptySelection = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
				var properties = this._initBaseEvent(event, pointer);
				if (emptySelection === true) {
					properties.nodes = [];
					properties.edges = [];
				} else {
					var tmp = this.getSelection();
					properties.nodes = tmp.nodes;
					properties.edges = tmp.edges;
				}
				if (oldSelection !== void 0) properties["previousSelection"] = oldSelection;
				if (eventType == "click") properties.items = this.getClickedItems(pointer);
				if (event.controlEdge !== void 0) properties.controlEdge = event.controlEdge;
				this.body.emitter.emit(eventType, properties);
			}
		},
		{
			key: "selectObject",
			value: function selectObject(obj) {
				var highlightEdges = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.options.selectConnectedEdges;
				if (obj !== void 0) {
					if (obj instanceof Node) {
						if (highlightEdges === true) {
							var _this$_selectionAccum;
							(_this$_selectionAccum = this._selectionAccumulator).addEdges.apply(_this$_selectionAccum, _toConsumableArray(obj.edges));
						}
						this._selectionAccumulator.addNodes(obj);
					} else this._selectionAccumulator.addEdges(obj);
					return true;
				}
				return false;
			}
		},
		{
			key: "deselectObject",
			value: function deselectObject(obj) {
				if (obj.isSelected() === true) {
					obj.selected = false;
					this._removeFromSelection(obj);
				}
			}
		},
		{
			key: "_getAllNodesOverlappingWith",
			value: function _getAllNodesOverlappingWith(object$1) {
				var overlappingNodes = [];
				var nodes = this.body.nodes;
				for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) {
					var nodeId = this.body.nodeIndices[i$2];
					if (nodes[nodeId].isOverlappingWith(object$1)) overlappingNodes.push(nodeId);
				}
				return overlappingNodes;
			}
		},
		{
			key: "_pointerToPositionObject",
			value: function _pointerToPositionObject(pointer) {
				var canvasPos = this.canvas.DOMtoCanvas(pointer);
				return {
					left: canvasPos.x - 1,
					top: canvasPos.y + 1,
					right: canvasPos.x + 1,
					bottom: canvasPos.y - 1
				};
			}
		},
		{
			key: "getNodeAt",
			value: function getNodeAt(pointer) {
				var returnNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				var positionObject = this._pointerToPositionObject(pointer);
				var overlappingNodes = this._getAllNodesOverlappingWith(positionObject);
				if (overlappingNodes.length > 0) if (returnNode === true) return this.body.nodes[overlappingNodes[overlappingNodes.length - 1]];
				else return overlappingNodes[overlappingNodes.length - 1];
				else return void 0;
			}
		},
		{
			key: "_getEdgesOverlappingWith",
			value: function _getEdgesOverlappingWith(object$1, overlappingEdges) {
				var edges = this.body.edges;
				for (var i$2 = 0; i$2 < this.body.edgeIndices.length; i$2++) {
					var edgeId = this.body.edgeIndices[i$2];
					if (edges[edgeId].isOverlappingWith(object$1)) overlappingEdges.push(edgeId);
				}
			}
		},
		{
			key: "_getAllEdgesOverlappingWith",
			value: function _getAllEdgesOverlappingWith(object$1) {
				var overlappingEdges = [];
				this._getEdgesOverlappingWith(object$1, overlappingEdges);
				return overlappingEdges;
			}
		},
		{
			key: "getEdgeAt",
			value: function getEdgeAt(pointer) {
				var returnEdge = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				var canvasPos = this.canvas.DOMtoCanvas(pointer);
				var mindist = 10;
				var overlappingEdge = null;
				var edges = this.body.edges;
				for (var i$2 = 0; i$2 < this.body.edgeIndices.length; i$2++) {
					var edgeId = this.body.edgeIndices[i$2];
					var edge = edges[edgeId];
					if (edge.connected) {
						var xFrom = edge.from.x;
						var yFrom = edge.from.y;
						var xTo = edge.to.x;
						var yTo = edge.to.y;
						var dist = edge.edgeType.getDistanceToEdge(xFrom, yFrom, xTo, yTo, canvasPos.x, canvasPos.y);
						if (dist < mindist) {
							overlappingEdge = edgeId;
							mindist = dist;
						}
					}
				}
				if (overlappingEdge !== null) if (returnEdge === true) return this.body.edges[overlappingEdge];
				else return overlappingEdge;
				else return void 0;
			}
		},
		{
			key: "_addToHover",
			value: function _addToHover(obj) {
				if (obj instanceof Node) this.hoverObj.nodes[obj.id] = obj;
				else this.hoverObj.edges[obj.id] = obj;
			}
		},
		{
			key: "_removeFromSelection",
			value: function _removeFromSelection(obj) {
				if (obj instanceof Node) {
					var _this$_selectionAccum2;
					this._selectionAccumulator.deleteNodes(obj);
					(_this$_selectionAccum2 = this._selectionAccumulator).deleteEdges.apply(_this$_selectionAccum2, _toConsumableArray(obj.edges));
				} else this._selectionAccumulator.deleteEdges(obj);
			}
		},
		{
			key: "unselectAll",
			value: function unselectAll() {
				this._selectionAccumulator.clear();
			}
		},
		{
			key: "getSelectedNodeCount",
			value: function getSelectedNodeCount() {
				return this._selectionAccumulator.sizeNodes;
			}
		},
		{
			key: "getSelectedEdgeCount",
			value: function getSelectedEdgeCount() {
				return this._selectionAccumulator.sizeEdges;
			}
		},
		{
			key: "_hoverConnectedEdges",
			value: function _hoverConnectedEdges(node$1) {
				for (var i$2 = 0; i$2 < node$1.edges.length; i$2++) {
					var edge = node$1.edges[i$2];
					edge.hover = true;
					this._addToHover(edge);
				}
			}
		},
		{
			key: "emitBlurEvent",
			value: function emitBlurEvent(event, pointer, object$1) {
				var properties = this._initBaseEvent(event, pointer);
				if (object$1.hover === true) {
					object$1.hover = false;
					if (object$1 instanceof Node) {
						properties.node = object$1.id;
						this.body.emitter.emit("blurNode", properties);
					} else {
						properties.edge = object$1.id;
						this.body.emitter.emit("blurEdge", properties);
					}
				}
			}
		},
		{
			key: "emitHoverEvent",
			value: function emitHoverEvent(event, pointer, object$1) {
				var properties = this._initBaseEvent(event, pointer);
				var hoverChanged = false;
				if (object$1.hover === false) {
					object$1.hover = true;
					this._addToHover(object$1);
					hoverChanged = true;
					if (object$1 instanceof Node) {
						properties.node = object$1.id;
						this.body.emitter.emit("hoverNode", properties);
					} else {
						properties.edge = object$1.id;
						this.body.emitter.emit("hoverEdge", properties);
					}
				}
				return hoverChanged;
			}
		},
		{
			key: "hoverObject",
			value: function hoverObject(event, pointer) {
				var object$1 = this.getNodeAt(pointer);
				if (object$1 === void 0) object$1 = this.getEdgeAt(pointer);
				var hoverChanged = false;
				for (var nodeId in this.hoverObj.nodes) if (Object.prototype.hasOwnProperty.call(this.hoverObj.nodes, nodeId)) {
					if (object$1 === void 0 || object$1 instanceof Node && object$1.id != nodeId || object$1 instanceof Edge) {
						this.emitBlurEvent(event, pointer, this.hoverObj.nodes[nodeId]);
						delete this.hoverObj.nodes[nodeId];
						hoverChanged = true;
					}
				}
				for (var edgeId in this.hoverObj.edges) if (Object.prototype.hasOwnProperty.call(this.hoverObj.edges, edgeId)) {
					if (hoverChanged === true) {
						this.hoverObj.edges[edgeId].hover = false;
						delete this.hoverObj.edges[edgeId];
					} else if (object$1 === void 0 || object$1 instanceof Edge && object$1.id != edgeId || object$1 instanceof Node && !object$1.hover) {
						this.emitBlurEvent(event, pointer, this.hoverObj.edges[edgeId]);
						delete this.hoverObj.edges[edgeId];
						hoverChanged = true;
					}
				}
				if (object$1 !== void 0) {
					var hoveredEdgesCount = _Object$keys(this.hoverObj.edges).length;
					var hoveredNodesCount = _Object$keys(this.hoverObj.nodes).length;
					var newOnlyHoveredEdge = object$1 instanceof Edge && hoveredEdgesCount === 0 && hoveredNodesCount === 0;
					var newOnlyHoveredNode = object$1 instanceof Node && hoveredEdgesCount === 0 && hoveredNodesCount === 0;
					if (hoverChanged || newOnlyHoveredEdge || newOnlyHoveredNode) hoverChanged = this.emitHoverEvent(event, pointer, object$1);
					if (object$1 instanceof Node && this.options.hoverConnectedEdges === true) this._hoverConnectedEdges(object$1);
				}
				if (hoverChanged === true) this.body.emitter.emit("_requestRedraw");
			}
		},
		{
			key: "commitWithoutEmitting",
			value: function commitWithoutEmitting() {
				this._selectionAccumulator.commit();
			}
		},
		{
			key: "commitAndEmit",
			value: function commitAndEmit(pointer, event) {
				var selected = false;
				var selectionChanges = this._selectionAccumulator.commit();
				var previousSelection = {
					nodes: selectionChanges.nodes.previous,
					edges: selectionChanges.edges.previous
				};
				if (selectionChanges.edges.deleted.length > 0) {
					this.generateClickEvent("deselectEdge", event, pointer, previousSelection);
					selected = true;
				}
				if (selectionChanges.nodes.deleted.length > 0) {
					this.generateClickEvent("deselectNode", event, pointer, previousSelection);
					selected = true;
				}
				if (selectionChanges.nodes.added.length > 0) {
					this.generateClickEvent("selectNode", event, pointer);
					selected = true;
				}
				if (selectionChanges.edges.added.length > 0) {
					this.generateClickEvent("selectEdge", event, pointer);
					selected = true;
				}
				if (selected === true) this.generateClickEvent("select", event, pointer);
			}
		},
		{
			key: "getSelection",
			value: function getSelection() {
				return {
					nodes: this.getSelectedNodeIds(),
					edges: this.getSelectedEdgeIds()
				};
			}
		},
		{
			key: "getSelectedNodes",
			value: function getSelectedNodes() {
				return this._selectionAccumulator.getNodes();
			}
		},
		{
			key: "getSelectedEdges",
			value: function getSelectedEdges() {
				return this._selectionAccumulator.getEdges();
			}
		},
		{
			key: "getSelectedNodeIds",
			value: function getSelectedNodeIds() {
				var _context;
				return _mapInstanceProperty(_context = this._selectionAccumulator.getNodes()).call(_context, function(node$1) {
					return node$1.id;
				});
			}
		},
		{
			key: "getSelectedEdgeIds",
			value: function getSelectedEdgeIds() {
				var _context2;
				return _mapInstanceProperty(_context2 = this._selectionAccumulator.getEdges()).call(_context2, function(edge) {
					return edge.id;
				});
			}
		},
		{
			key: "setSelection",
			value: function setSelection(selection) {
				var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
				if (!selection || !selection.nodes && !selection.edges) throw new TypeError("Selection must be an object with nodes and/or edges properties");
				if (options.unselectAll || options.unselectAll === void 0) this.unselectAll();
				if (selection.nodes) {
					var _iterator = _createForOfIteratorHelper$2(selection.nodes), _step;
					try {
						for (_iterator.s(); !(_step = _iterator.n()).done;) {
							var id$4 = _step.value;
							var node$1 = this.body.nodes[id$4];
							if (!node$1) throw new RangeError("Node with id \"" + id$4 + "\" not found");
							this.selectObject(node$1, options.highlightEdges);
						}
					} catch (err) {
						_iterator.e(err);
					} finally {
						_iterator.f();
					}
				}
				if (selection.edges) {
					var _iterator2 = _createForOfIteratorHelper$2(selection.edges), _step2;
					try {
						for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
							var _id = _step2.value;
							var edge = this.body.edges[_id];
							if (!edge) throw new RangeError("Edge with id \"" + _id + "\" not found");
							this.selectObject(edge);
						}
					} catch (err) {
						_iterator2.e(err);
					} finally {
						_iterator2.f();
					}
				}
				this.body.emitter.emit("_requestRedraw");
				this._selectionAccumulator.commit();
			}
		},
		{
			key: "selectNodes",
			value: function selectNodes(selection) {
				var highlightEdges = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
				if (!selection || selection.length === void 0) throw "Selection must be an array with ids";
				this.setSelection({ nodes: selection }, { highlightEdges });
			}
		},
		{
			key: "selectEdges",
			value: function selectEdges(selection) {
				if (!selection || selection.length === void 0) throw "Selection must be an array with ids";
				this.setSelection({ edges: selection });
			}
		},
		{
			key: "updateSelection",
			value: function updateSelection() {
				for (var node$1 in this._selectionAccumulator.getNodes()) if (!Object.prototype.hasOwnProperty.call(this.body.nodes, node$1.id)) this._selectionAccumulator.deleteNodes(node$1);
				for (var edge in this._selectionAccumulator.getEdges()) if (!Object.prototype.hasOwnProperty.call(this.body.edges, edge.id)) this._selectionAccumulator.deleteEdges(edge);
			}
		},
		{
			key: "getClickedItems",
			value: function getClickedItems(pointer) {
				var point = this.canvas.DOMtoCanvas(pointer);
				var items = [];
				var nodeIndices = this.body.nodeIndices;
				var nodes = this.body.nodes;
				for (var i$2 = nodeIndices.length - 1; i$2 >= 0; i$2--) {
					var node$1 = nodes[nodeIndices[i$2]];
					var ret = node$1.getItemsOnPoint(point);
					items.push.apply(items, ret);
				}
				var edgeIndices = this.body.edgeIndices;
				var edges = this.body.edges;
				for (var _i = edgeIndices.length - 1; _i >= 0; _i--) {
					var edge = edges[edgeIndices[_i]];
					var _ret = edge.getItemsOnPoint(point);
					items.push.apply(items, _ret);
				}
				return items;
			}
		}
	]);
	return SelectionHandler$1;
}();
var sortExports = {};
var sort$3 = {
	get exports() {
		return sortExports;
	},
	set exports(v) {
		sortExports = v;
	}
};
var arraySlice = arraySliceSimple;
var floor = Math.floor;
var mergeSort = function(array$1, comparefn) {
	var length$1 = array$1.length;
	var middle = floor(length$1 / 2);
	return length$1 < 8 ? insertionSort(array$1, comparefn) : merge(array$1, mergeSort(arraySlice(array$1, 0, middle), comparefn), mergeSort(arraySlice(array$1, middle), comparefn), comparefn);
};
var insertionSort = function(array$1, comparefn) {
	var length$1 = array$1.length;
	var i$2 = 1;
	var element, j;
	while (i$2 < length$1) {
		j = i$2;
		element = array$1[i$2];
		while (j && comparefn(array$1[j - 1], element) > 0) array$1[j] = array$1[--j];
		if (j !== i$2++) array$1[j] = element;
	}
	return array$1;
};
var merge = function(array$1, left, right, comparefn) {
	var llength = left.length;
	var rlength = right.length;
	var lindex = 0;
	var rindex = 0;
	while (lindex < llength || rindex < rlength) array$1[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
	return array$1;
};
var arraySort = mergeSort;
var userAgent$1 = engineUserAgent;
var firefox = userAgent$1.match(/firefox\/(\d+)/i);
var engineFfVersion = !!firefox && +firefox[1];
var UA = engineUserAgent;
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
var userAgent = engineUserAgent;
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
var engineWebkitVersion = !!webkit && +webkit[1];
var $$2 = _export;
var uncurryThis = functionUncurryThis;
var aCallable$1 = aCallable$7;
var toObject$1 = toObject$d;
var lengthOfArrayLike$1 = lengthOfArrayLike$b;
var deletePropertyOrThrow = deletePropertyOrThrow$2;
var toString = toString$a;
var fails = fails$w;
var internalSort = arraySort;
var arrayMethodIsStrict$2 = arrayMethodIsStrict$6;
var FF = engineFfVersion;
var IE_OR_EDGE = engineIsIeOrEdge;
var V8 = engineV8Version;
var WEBKIT = engineWebkitVersion;
var test = [];
var nativeSort = uncurryThis(test.sort);
var push = uncurryThis(test.push);
var FAILS_ON_UNDEFINED = fails(function() {
	test.sort(void 0);
});
var FAILS_ON_NULL = fails(function() {
	test.sort(null);
});
var STRICT_METHOD$1 = arrayMethodIsStrict$2("sort");
var STABLE_SORT = !fails(function() {
	if (V8) return V8 < 70;
	if (FF && FF > 3) return;
	if (IE_OR_EDGE) return true;
	if (WEBKIT) return WEBKIT < 603;
	var result = "";
	var code, chr, value, index$1;
	for (code = 65; code < 76; code++) {
		chr = String.fromCharCode(code);
		switch (code) {
			case 66:
			case 69:
			case 70:
			case 72:
				value = 3;
				break;
			case 68:
			case 71:
				value = 4;
				break;
			default: value = 2;
		}
		for (index$1 = 0; index$1 < 47; index$1++) test.push({
			k: chr + index$1,
			v: value
		});
	}
	test.sort(function(a, b) {
		return b.v - a.v;
	});
	for (index$1 = 0; index$1 < test.length; index$1++) {
		chr = test[index$1].k.charAt(0);
		if (result.charAt(result.length - 1) !== chr) result += chr;
	}
	return result !== "DGBEFHACIJK";
});
var FORCED$1 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$1 || !STABLE_SORT;
var getSortCompare = function(comparefn) {
	return function(x, y) {
		if (y === void 0) return -1;
		if (x === void 0) return 1;
		if (comparefn !== void 0) return +comparefn(x, y) || 0;
		return toString(x) > toString(y) ? 1 : -1;
	};
};
$$2({
	target: "Array",
	proto: true,
	forced: FORCED$1
}, { sort: function sort$5(comparefn) {
	if (comparefn !== void 0) aCallable$1(comparefn);
	var array$1 = toObject$1(this);
	if (STABLE_SORT) return comparefn === void 0 ? nativeSort(array$1) : nativeSort(array$1, comparefn);
	var items = [];
	var arrayLength = lengthOfArrayLike$1(array$1);
	var itemsLength, index$1;
	for (index$1 = 0; index$1 < arrayLength; index$1++) if (index$1 in array$1) push(items, array$1[index$1]);
	internalSort(items, getSortCompare(comparefn));
	itemsLength = lengthOfArrayLike$1(items);
	index$1 = 0;
	while (index$1 < itemsLength) array$1[index$1] = items[index$1++];
	while (index$1 < arrayLength) deletePropertyOrThrow(array$1, index$1++);
	return array$1;
} });
var entryVirtual$2 = entryVirtual$i;
var sort$2 = entryVirtual$2("Array").sort;
var isPrototypeOf$2 = objectIsPrototypeOf;
var method$2 = sort$2;
var ArrayPrototype$2 = Array.prototype;
var sort$1 = function(it$1) {
	var own = it$1.sort;
	return it$1 === ArrayPrototype$2 || isPrototypeOf$2(ArrayPrototype$2, it$1) && own === ArrayPrototype$2.sort ? method$2 : own;
};
var parent$2 = sort$1;
var sort = parent$2;
(function(module) {
	module.exports = sort;
})(sort$3);
var _sortInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(sortExports);
var reduceExports = {};
var reduce$3 = {
	get exports() {
		return reduceExports;
	},
	set exports(v) {
		reduceExports = v;
	}
};
var aCallable = aCallable$7;
var toObject = toObject$d;
var IndexedObject = indexedObject;
var lengthOfArrayLike = lengthOfArrayLike$b;
var $TypeError = TypeError;
var createMethod = function(IS_RIGHT) {
	return function(that, callbackfn, argumentsLength, memo) {
		aCallable(callbackfn);
		var O = toObject(that);
		var self$1 = IndexedObject(O);
		var length$1 = lengthOfArrayLike(O);
		var index$1 = IS_RIGHT ? length$1 - 1 : 0;
		var i$2 = IS_RIGHT ? -1 : 1;
		if (argumentsLength < 2) while (true) {
			if (index$1 in self$1) {
				memo = self$1[index$1];
				index$1 += i$2;
				break;
			}
			index$1 += i$2;
			if (IS_RIGHT ? index$1 < 0 : length$1 <= index$1) throw $TypeError("Reduce of empty array with no initial value");
		}
		for (; IS_RIGHT ? index$1 >= 0 : length$1 > index$1; index$1 += i$2) if (index$1 in self$1) memo = callbackfn(memo, self$1[index$1], index$1, O);
		return memo;
	};
};
var arrayReduce = {
	left: createMethod(false),
	right: createMethod(true)
};
var classof = classofRaw$2;
var engineIsNode = typeof process != "undefined" && classof(process) == "process";
var $$1 = _export;
var $reduce = arrayReduce.left;
var arrayMethodIsStrict$1 = arrayMethodIsStrict$6;
var CHROME_VERSION = engineV8Version;
var IS_NODE = engineIsNode;
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict$1("reduce");
$$1({
	target: "Array",
	proto: true,
	forced: FORCED
}, { reduce: function reduce$5(callbackfn) {
	var length$1 = arguments.length;
	return $reduce(this, callbackfn, length$1, length$1 > 1 ? arguments[1] : void 0);
} });
var entryVirtual$1 = entryVirtual$i;
var reduce$2 = entryVirtual$1("Array").reduce;
var isPrototypeOf$1 = objectIsPrototypeOf;
var method$1 = reduce$2;
var ArrayPrototype$1 = Array.prototype;
var reduce$1 = function(it$1) {
	var own = it$1.reduce;
	return it$1 === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it$1) && own === ArrayPrototype$1.reduce ? method$1 : own;
};
var parent$1 = reduce$1;
var reduce = parent$1;
(function(module) {
	module.exports = reduce;
})(reduce$3);
var _reduceInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(reduceExports);
var timsortExports = {};
var timsort$1 = {
	get exports() {
		return timsortExports;
	},
	set exports(v) {
		timsortExports = v;
	}
};
var timsort = {};
/****
* The MIT License
*
* Copyright (c) 2015 Marco Ziccardi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
****/
(function(exports) {
	(function(global$10, factory) {
		factory(exports);
	})(commonjsGlobal, function(exports$1) {
		exports$1.__esModule = true;
		exports$1.sort = sort$5;
		function _classCallCheck$2(instance, Constructor) {
			if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
		}
		var DEFAULT_MIN_MERGE = 32;
		var DEFAULT_MIN_GALLOPING = 7;
		var DEFAULT_TMP_STORAGE_LENGTH = 256;
		var POWERS_OF_TEN = [
			1,
			10,
			100,
			1e3,
			1e4,
			1e5,
			1e6,
			1e7,
			1e8,
			1e9
		];
		function log10(x) {
			if (x < 1e5) {
				if (x < 100) return x < 10 ? 0 : 1;
				if (x < 1e4) return x < 1e3 ? 2 : 3;
				return 4;
			}
			if (x < 1e7) return x < 1e6 ? 5 : 6;
			if (x < 1e9) return x < 1e8 ? 7 : 8;
			return 9;
		}
		function alphabeticalCompare(a, b) {
			if (a === b) return 0;
			if (~~a === a && ~~b === b) {
				if (a === 0 || b === 0) return a < b ? -1 : 1;
				if (a < 0 || b < 0) {
					if (b >= 0) return -1;
					if (a >= 0) return 1;
					a = -a;
					b = -b;
				}
				var al = log10(a);
				var bl = log10(b);
				var t = 0;
				if (al < bl) {
					a *= POWERS_OF_TEN[bl - al - 1];
					b /= 10;
					t = -1;
				} else if (al > bl) {
					b *= POWERS_OF_TEN[al - bl - 1];
					a /= 10;
					t = 1;
				}
				if (a === b) return t;
				return a < b ? -1 : 1;
			}
			var aStr = String(a);
			var bStr = String(b);
			if (aStr === bStr) return 0;
			return aStr < bStr ? -1 : 1;
		}
		function minRunLength(n) {
			var r = 0;
			while (n >= DEFAULT_MIN_MERGE) {
				r |= n & 1;
				n >>= 1;
			}
			return n + r;
		}
		function makeAscendingRun(array$1, lo, hi$2, compare) {
			var runHi = lo + 1;
			if (runHi === hi$2) return 1;
			if (compare(array$1[runHi++], array$1[lo]) < 0) {
				while (runHi < hi$2 && compare(array$1[runHi], array$1[runHi - 1]) < 0) runHi++;
				reverseRun(array$1, lo, runHi);
			} else while (runHi < hi$2 && compare(array$1[runHi], array$1[runHi - 1]) >= 0) runHi++;
			return runHi - lo;
		}
		function reverseRun(array$1, lo, hi$2) {
			hi$2--;
			while (lo < hi$2) {
				var t = array$1[lo];
				array$1[lo++] = array$1[hi$2];
				array$1[hi$2--] = t;
			}
		}
		function binaryInsertionSort(array$1, lo, hi$2, start, compare) {
			if (start === lo) start++;
			for (; start < hi$2; start++) {
				var pivot = array$1[start];
				var left = lo;
				var right = start;
				while (left < right) {
					var mid = left + right >>> 1;
					if (compare(pivot, array$1[mid]) < 0) right = mid;
					else left = mid + 1;
				}
				var n = start - left;
				switch (n) {
					case 3: array$1[left + 3] = array$1[left + 2];
					case 2: array$1[left + 2] = array$1[left + 1];
					case 1:
						array$1[left + 1] = array$1[left];
						break;
					default: while (n > 0) {
						array$1[left + n] = array$1[left + n - 1];
						n--;
					}
				}
				array$1[left] = pivot;
			}
		}
		function gallopLeft(value, array$1, start, length$1, hint, compare) {
			var lastOffset = 0;
			var maxOffset = 0;
			var offset = 1;
			if (compare(value, array$1[start + hint]) > 0) {
				maxOffset = length$1 - hint;
				while (offset < maxOffset && compare(value, array$1[start + hint + offset]) > 0) {
					lastOffset = offset;
					offset = (offset << 1) + 1;
					if (offset <= 0) offset = maxOffset;
				}
				if (offset > maxOffset) offset = maxOffset;
				lastOffset += hint;
				offset += hint;
			} else {
				maxOffset = hint + 1;
				while (offset < maxOffset && compare(value, array$1[start + hint - offset]) <= 0) {
					lastOffset = offset;
					offset = (offset << 1) + 1;
					if (offset <= 0) offset = maxOffset;
				}
				if (offset > maxOffset) offset = maxOffset;
				var tmp = lastOffset;
				lastOffset = hint - offset;
				offset = hint - tmp;
			}
			lastOffset++;
			while (lastOffset < offset) {
				var m = lastOffset + (offset - lastOffset >>> 1);
				if (compare(value, array$1[start + m]) > 0) lastOffset = m + 1;
				else offset = m;
			}
			return offset;
		}
		function gallopRight(value, array$1, start, length$1, hint, compare) {
			var lastOffset = 0;
			var maxOffset = 0;
			var offset = 1;
			if (compare(value, array$1[start + hint]) < 0) {
				maxOffset = hint + 1;
				while (offset < maxOffset && compare(value, array$1[start + hint - offset]) < 0) {
					lastOffset = offset;
					offset = (offset << 1) + 1;
					if (offset <= 0) offset = maxOffset;
				}
				if (offset > maxOffset) offset = maxOffset;
				var tmp = lastOffset;
				lastOffset = hint - offset;
				offset = hint - tmp;
			} else {
				maxOffset = length$1 - hint;
				while (offset < maxOffset && compare(value, array$1[start + hint + offset]) >= 0) {
					lastOffset = offset;
					offset = (offset << 1) + 1;
					if (offset <= 0) offset = maxOffset;
				}
				if (offset > maxOffset) offset = maxOffset;
				lastOffset += hint;
				offset += hint;
			}
			lastOffset++;
			while (lastOffset < offset) {
				var m = lastOffset + (offset - lastOffset >>> 1);
				if (compare(value, array$1[start + m]) < 0) offset = m;
				else lastOffset = m + 1;
			}
			return offset;
		}
		var TimSort$1 = function() {
			function TimSort$2(array$1, compare) {
				_classCallCheck$2(this, TimSort$2);
				this.array = null;
				this.compare = null;
				this.minGallop = DEFAULT_MIN_GALLOPING;
				this.length = 0;
				this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
				this.stackLength = 0;
				this.runStart = null;
				this.runLength = null;
				this.stackSize = 0;
				this.array = array$1;
				this.compare = compare;
				this.length = array$1.length;
				if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) this.tmpStorageLength = this.length >>> 1;
				this.tmp = new Array(this.tmpStorageLength);
				this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
				this.runStart = new Array(this.stackLength);
				this.runLength = new Array(this.stackLength);
			}
			TimSort$2.prototype.pushRun = function pushRun(runStart, runLength) {
				this.runStart[this.stackSize] = runStart;
				this.runLength[this.stackSize] = runLength;
				this.stackSize += 1;
			};
			TimSort$2.prototype.mergeRuns = function mergeRuns() {
				while (this.stackSize > 1) {
					var n = this.stackSize - 2;
					if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
						if (this.runLength[n - 1] < this.runLength[n + 1]) n--;
					} else if (this.runLength[n] > this.runLength[n + 1]) break;
					this.mergeAt(n);
				}
			};
			TimSort$2.prototype.forceMergeRuns = function forceMergeRuns() {
				while (this.stackSize > 1) {
					var n = this.stackSize - 2;
					if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) n--;
					this.mergeAt(n);
				}
			};
			TimSort$2.prototype.mergeAt = function mergeAt(i$2) {
				var compare = this.compare;
				var array$1 = this.array;
				var start1 = this.runStart[i$2];
				var length1 = this.runLength[i$2];
				var start2 = this.runStart[i$2 + 1];
				var length2 = this.runLength[i$2 + 1];
				this.runLength[i$2] = length1 + length2;
				if (i$2 === this.stackSize - 3) {
					this.runStart[i$2 + 1] = this.runStart[i$2 + 2];
					this.runLength[i$2 + 1] = this.runLength[i$2 + 2];
				}
				this.stackSize--;
				var k = gallopRight(array$1[start2], array$1, start1, length1, 0, compare);
				start1 += k;
				length1 -= k;
				if (length1 === 0) return;
				length2 = gallopLeft(array$1[start1 + length1 - 1], array$1, start2, length2, length2 - 1, compare);
				if (length2 === 0) return;
				if (length1 <= length2) this.mergeLow(start1, length1, start2, length2);
				else this.mergeHigh(start1, length1, start2, length2);
			};
			TimSort$2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
				var compare = this.compare;
				var array$1 = this.array;
				var tmp = this.tmp;
				var i$2 = 0;
				for (i$2 = 0; i$2 < length1; i$2++) tmp[i$2] = array$1[start1 + i$2];
				var cursor1 = 0;
				var cursor2 = start2;
				var dest = start1;
				array$1[dest++] = array$1[cursor2++];
				if (--length2 === 0) {
					for (i$2 = 0; i$2 < length1; i$2++) array$1[dest + i$2] = tmp[cursor1 + i$2];
					return;
				}
				if (length1 === 1) {
					for (i$2 = 0; i$2 < length2; i$2++) array$1[dest + i$2] = array$1[cursor2 + i$2];
					array$1[dest + length2] = tmp[cursor1];
					return;
				}
				var minGallop = this.minGallop;
				while (true) {
					var count1 = 0;
					var count2 = 0;
					var exit = false;
					do
						if (compare(array$1[cursor2], tmp[cursor1]) < 0) {
							array$1[dest++] = array$1[cursor2++];
							count2++;
							count1 = 0;
							if (--length2 === 0) {
								exit = true;
								break;
							}
						} else {
							array$1[dest++] = tmp[cursor1++];
							count1++;
							count2 = 0;
							if (--length1 === 1) {
								exit = true;
								break;
							}
						}
					while ((count1 | count2) < minGallop);
					if (exit) break;
					do {
						count1 = gallopRight(array$1[cursor2], tmp, cursor1, length1, 0, compare);
						if (count1 !== 0) {
							for (i$2 = 0; i$2 < count1; i$2++) array$1[dest + i$2] = tmp[cursor1 + i$2];
							dest += count1;
							cursor1 += count1;
							length1 -= count1;
							if (length1 <= 1) {
								exit = true;
								break;
							}
						}
						array$1[dest++] = array$1[cursor2++];
						if (--length2 === 0) {
							exit = true;
							break;
						}
						count2 = gallopLeft(tmp[cursor1], array$1, cursor2, length2, 0, compare);
						if (count2 !== 0) {
							for (i$2 = 0; i$2 < count2; i$2++) array$1[dest + i$2] = array$1[cursor2 + i$2];
							dest += count2;
							cursor2 += count2;
							length2 -= count2;
							if (length2 === 0) {
								exit = true;
								break;
							}
						}
						array$1[dest++] = tmp[cursor1++];
						if (--length1 === 1) {
							exit = true;
							break;
						}
						minGallop--;
					} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
					if (exit) break;
					if (minGallop < 0) minGallop = 0;
					minGallop += 2;
				}
				this.minGallop = minGallop;
				if (minGallop < 1) this.minGallop = 1;
				if (length1 === 1) {
					for (i$2 = 0; i$2 < length2; i$2++) array$1[dest + i$2] = array$1[cursor2 + i$2];
					array$1[dest + length2] = tmp[cursor1];
				} else if (length1 === 0) throw new Error("mergeLow preconditions were not respected");
				else for (i$2 = 0; i$2 < length1; i$2++) array$1[dest + i$2] = tmp[cursor1 + i$2];
			};
			TimSort$2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
				var compare = this.compare;
				var array$1 = this.array;
				var tmp = this.tmp;
				var i$2 = 0;
				for (i$2 = 0; i$2 < length2; i$2++) tmp[i$2] = array$1[start2 + i$2];
				var cursor1 = start1 + length1 - 1;
				var cursor2 = length2 - 1;
				var dest = start2 + length2 - 1;
				var customCursor = 0;
				var customDest = 0;
				array$1[dest--] = array$1[cursor1--];
				if (--length1 === 0) {
					customCursor = dest - (length2 - 1);
					for (i$2 = 0; i$2 < length2; i$2++) array$1[customCursor + i$2] = tmp[i$2];
					return;
				}
				if (length2 === 1) {
					dest -= length1;
					cursor1 -= length1;
					customDest = dest + 1;
					customCursor = cursor1 + 1;
					for (i$2 = length1 - 1; i$2 >= 0; i$2--) array$1[customDest + i$2] = array$1[customCursor + i$2];
					array$1[dest] = tmp[cursor2];
					return;
				}
				var minGallop = this.minGallop;
				while (true) {
					var count1 = 0;
					var count2 = 0;
					var exit = false;
					do
						if (compare(tmp[cursor2], array$1[cursor1]) < 0) {
							array$1[dest--] = array$1[cursor1--];
							count1++;
							count2 = 0;
							if (--length1 === 0) {
								exit = true;
								break;
							}
						} else {
							array$1[dest--] = tmp[cursor2--];
							count2++;
							count1 = 0;
							if (--length2 === 1) {
								exit = true;
								break;
							}
						}
					while ((count1 | count2) < minGallop);
					if (exit) break;
					do {
						count1 = length1 - gallopRight(tmp[cursor2], array$1, start1, length1, length1 - 1, compare);
						if (count1 !== 0) {
							dest -= count1;
							cursor1 -= count1;
							length1 -= count1;
							customDest = dest + 1;
							customCursor = cursor1 + 1;
							for (i$2 = count1 - 1; i$2 >= 0; i$2--) array$1[customDest + i$2] = array$1[customCursor + i$2];
							if (length1 === 0) {
								exit = true;
								break;
							}
						}
						array$1[dest--] = tmp[cursor2--];
						if (--length2 === 1) {
							exit = true;
							break;
						}
						count2 = length2 - gallopLeft(array$1[cursor1], tmp, 0, length2, length2 - 1, compare);
						if (count2 !== 0) {
							dest -= count2;
							cursor2 -= count2;
							length2 -= count2;
							customDest = dest + 1;
							customCursor = cursor2 + 1;
							for (i$2 = 0; i$2 < count2; i$2++) array$1[customDest + i$2] = tmp[customCursor + i$2];
							if (length2 <= 1) {
								exit = true;
								break;
							}
						}
						array$1[dest--] = array$1[cursor1--];
						if (--length1 === 0) {
							exit = true;
							break;
						}
						minGallop--;
					} while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
					if (exit) break;
					if (minGallop < 0) minGallop = 0;
					minGallop += 2;
				}
				this.minGallop = minGallop;
				if (minGallop < 1) this.minGallop = 1;
				if (length2 === 1) {
					dest -= length1;
					cursor1 -= length1;
					customDest = dest + 1;
					customCursor = cursor1 + 1;
					for (i$2 = length1 - 1; i$2 >= 0; i$2--) array$1[customDest + i$2] = array$1[customCursor + i$2];
					array$1[dest] = tmp[cursor2];
				} else if (length2 === 0) throw new Error("mergeHigh preconditions were not respected");
				else {
					customCursor = dest - (length2 - 1);
					for (i$2 = 0; i$2 < length2; i$2++) array$1[customCursor + i$2] = tmp[i$2];
				}
			};
			return TimSort$2;
		}();
		function sort$5(array$1, compare, lo, hi$2) {
			if (!Array.isArray(array$1)) throw new TypeError("Can only sort arrays");
			if (!compare) compare = alphabeticalCompare;
			else if (typeof compare !== "function") {
				hi$2 = lo;
				lo = compare;
				compare = alphabeticalCompare;
			}
			if (!lo) lo = 0;
			if (!hi$2) hi$2 = array$1.length;
			var remaining = hi$2 - lo;
			if (remaining < 2) return;
			var runLength = 0;
			if (remaining < DEFAULT_MIN_MERGE) {
				runLength = makeAscendingRun(array$1, lo, hi$2, compare);
				binaryInsertionSort(array$1, lo, hi$2, lo + runLength, compare);
				return;
			}
			var ts = new TimSort$1(array$1, compare);
			var minRun = minRunLength(remaining);
			do {
				runLength = makeAscendingRun(array$1, lo, hi$2, compare);
				if (runLength < minRun) {
					var force = remaining;
					if (force > minRun) force = minRun;
					binaryInsertionSort(array$1, lo, lo + force, lo + runLength, compare);
					runLength = force;
				}
				ts.pushRun(lo, runLength);
				ts.mergeRuns();
				remaining -= runLength;
				lo += runLength;
			} while (remaining !== 0);
			ts.forceMergeRuns();
		}
	});
})(timsort);
(function(module) {
	module.exports = timsort;
})(timsort$1);
var TimSort = /* @__PURE__ */ getDefaultExportFromCjs(timsortExports);
function _createSuper(Derived) {
	var hasNativeReflectConstruct = _isNativeReflectConstruct();
	return function _createSuperInternal() {
		var Super = _getPrototypeOf(Derived), result;
		if (hasNativeReflectConstruct) {
			var NewTarget = _getPrototypeOf(this).constructor;
			result = _Reflect$construct(Super, arguments, NewTarget);
		} else result = Super.apply(this, arguments);
		return _possibleConstructorReturn(this, result);
	};
}
function _isNativeReflectConstruct() {
	if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
	if (_Reflect$construct.sham) return false;
	if (typeof Proxy === "function") return true;
	try {
		Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function() {}));
		return true;
	} catch (e) {
		return false;
	}
}
/**
* Interface definition for direction strategy classes.
*
* This class describes the interface for the Strategy
* pattern classes used to differentiate horizontal and vertical
* direction of hierarchical results.
*
* For a given direction, one coordinate will be 'fixed', meaning that it is
* determined by level.
* The other coordinate is 'unfixed', meaning that the nodes on a given level
* can still move along that coordinate. So:
*
* - `vertical` layout: `x` unfixed, `y` fixed per level
* - `horizontal` layout: `x` fixed per level, `y` unfixed
*
* The local methods are stubs and should be regarded as abstract.
* Derived classes **must** implement all the methods themselves.
*
* @private
*/
var DirectionInterface = /* @__PURE__ */ function() {
	function DirectionInterface$1() {
		_classCallCheck(this, DirectionInterface$1);
	}
	_createClass(DirectionInterface$1, [
		{
			key: "abstract",
			value: function abstract() {
				throw new Error("Can't instantiate abstract class!");
			}
		},
		{
			key: "fake_use",
			value: function fake_use() {}
		},
		{
			key: "curveType",
			value: function curveType() {
				return this.abstract();
			}
		},
		{
			key: "getPosition",
			value: function getPosition(node$1) {
				this.fake_use(node$1);
				return this.abstract();
			}
		},
		{
			key: "setPosition",
			value: function setPosition(node$1, position) {
				var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
				this.fake_use(node$1, position, level);
				this.abstract();
			}
		},
		{
			key: "getTreeSize",
			value: function getTreeSize(index$1) {
				this.fake_use(index$1);
				return this.abstract();
			}
		},
		{
			key: "sort",
			value: function sort$5(nodeArray) {
				this.fake_use(nodeArray);
				this.abstract();
			}
		},
		{
			key: "fix",
			value: function fix(node$1, level) {
				this.fake_use(node$1, level);
				this.abstract();
			}
		},
		{
			key: "shift",
			value: function shift(nodeId, diff) {
				this.fake_use(nodeId, diff);
				this.abstract();
			}
		}
	]);
	return DirectionInterface$1;
}();
/**
* Vertical Strategy
*
* Coordinate `y` is fixed on levels, coordinate `x` is unfixed.
*
* @augments DirectionInterface
* @private
*/
var VerticalStrategy = /* @__PURE__ */ function(_DirectionInterface) {
	_inherits(VerticalStrategy$1, _DirectionInterface);
	var _super = _createSuper(VerticalStrategy$1);
	/**
	* Constructor
	*
	* @param {object} layout reference to the parent LayoutEngine instance.
	*/
	function VerticalStrategy$1(layout) {
		var _this;
		_classCallCheck(this, VerticalStrategy$1);
		_this = _super.call(this);
		_this.layout = layout;
		return _this;
	}
	/** @inheritDoc */
	_createClass(VerticalStrategy$1, [
		{
			key: "curveType",
			value: function curveType() {
				return "horizontal";
			}
		},
		{
			key: "getPosition",
			value: function getPosition(node$1) {
				return node$1.x;
			}
		},
		{
			key: "setPosition",
			value: function setPosition(node$1, position) {
				var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
				if (level !== void 0) this.layout.hierarchical.addToOrdering(node$1, level);
				node$1.x = position;
			}
		},
		{
			key: "getTreeSize",
			value: function getTreeSize(index$1) {
				var res = this.layout.hierarchical.getTreeSize(this.layout.body.nodes, index$1);
				return {
					min: res.min_x,
					max: res.max_x
				};
			}
		},
		{
			key: "sort",
			value: function sort$5(nodeArray) {
				timsortExports.sort(nodeArray, function(a, b) {
					return a.x - b.x;
				});
			}
		},
		{
			key: "fix",
			value: function fix(node$1, level) {
				node$1.y = this.layout.options.hierarchical.levelSeparation * level;
				node$1.options.fixed.y = true;
			}
		},
		{
			key: "shift",
			value: function shift(nodeId, diff) {
				this.layout.body.nodes[nodeId].x += diff;
			}
		}
	]);
	return VerticalStrategy$1;
}(DirectionInterface);
/**
* Horizontal Strategy
*
* Coordinate `x` is fixed on levels, coordinate `y` is unfixed.
*
* @augments DirectionInterface
* @private
*/
var HorizontalStrategy = /* @__PURE__ */ function(_DirectionInterface2) {
	_inherits(HorizontalStrategy$1, _DirectionInterface2);
	var _super2 = _createSuper(HorizontalStrategy$1);
	/**
	* Constructor
	*
	* @param {object} layout reference to the parent LayoutEngine instance.
	*/
	function HorizontalStrategy$1(layout) {
		var _this2;
		_classCallCheck(this, HorizontalStrategy$1);
		_this2 = _super2.call(this);
		_this2.layout = layout;
		return _this2;
	}
	/** @inheritDoc */
	_createClass(HorizontalStrategy$1, [
		{
			key: "curveType",
			value: function curveType() {
				return "vertical";
			}
		},
		{
			key: "getPosition",
			value: function getPosition(node$1) {
				return node$1.y;
			}
		},
		{
			key: "setPosition",
			value: function setPosition(node$1, position) {
				var level = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
				if (level !== void 0) this.layout.hierarchical.addToOrdering(node$1, level);
				node$1.y = position;
			}
		},
		{
			key: "getTreeSize",
			value: function getTreeSize(index$1) {
				var res = this.layout.hierarchical.getTreeSize(this.layout.body.nodes, index$1);
				return {
					min: res.min_y,
					max: res.max_y
				};
			}
		},
		{
			key: "sort",
			value: function sort$5(nodeArray) {
				timsortExports.sort(nodeArray, function(a, b) {
					return a.y - b.y;
				});
			}
		},
		{
			key: "fix",
			value: function fix(node$1, level) {
				node$1.x = this.layout.options.hierarchical.levelSeparation * level;
				node$1.options.fixed.x = true;
			}
		},
		{
			key: "shift",
			value: function shift(nodeId, diff) {
				this.layout.body.nodes[nodeId].y += diff;
			}
		}
	]);
	return HorizontalStrategy$1;
}(DirectionInterface);
var everyExports = {};
var every$3 = {
	get exports() {
		return everyExports;
	},
	set exports(v) {
		everyExports = v;
	}
};
var $ = _export;
var $every = arrayIteration.every;
var arrayMethodIsStrict = arrayMethodIsStrict$6;
var STRICT_METHOD = arrayMethodIsStrict("every");
$({
	target: "Array",
	proto: true,
	forced: !STRICT_METHOD
}, { every: function every$4(callbackfn) {
	return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} });
var entryVirtual = entryVirtual$i;
var every$2 = entryVirtual("Array").every;
var isPrototypeOf = objectIsPrototypeOf;
var method = every$2;
var ArrayPrototype = Array.prototype;
var every$1 = function(it$1) {
	var own = it$1.every;
	return it$1 === ArrayPrototype || isPrototypeOf(ArrayPrototype, it$1) && own === ArrayPrototype.every ? method : own;
};
var parent = every$1;
var every = parent;
(function(module) {
	module.exports = every;
})(every$3);
var _everyInstanceProperty = /* @__PURE__ */ getDefaultExportFromCjs(everyExports);
function _createForOfIteratorHelper$1(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray$1(o, minLen) {
	var _context9;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
	var n = _sliceInstanceProperty(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
}
function _arrayLikeToArray$1(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**

* Try to assign levels to nodes according to their positions in the cyclic “hierarchy”.

*

* @param nodes - Visible nodes of the graph.

* @param levels - If present levels will be added to it, if not a new object will be created.

* @returns Populated node levels.

*/
function fillLevelsByDirectionCyclic(nodes, levels) {
	var edges = new _Set();
	_forEachInstanceProperty(nodes).call(nodes, function(node$1) {
		var _context;
		_forEachInstanceProperty(_context = node$1.edges).call(_context, function(edge) {
			if (edge.connected) edges.add(edge);
		});
	});
	_forEachInstanceProperty(edges).call(edges, function(edge) {
		var fromId = edge.from.id;
		var toId = edge.to.id;
		if (levels[fromId] == null) levels[fromId] = 0;
		if (levels[toId] == null || levels[fromId] >= levels[toId]) levels[toId] = levels[fromId] + 1;
	});
	return levels;
}
/**

* Assign levels to nodes according to their positions in the hierarchy. Leaves will be lined up at the bottom and all other nodes as close to their children as possible.

*

* @param nodes - Visible nodes of the graph.

* @returns Populated node levels.

*/
function fillLevelsByDirectionLeaves(nodes) {
	return fillLevelsByDirection(
		// Pick only leaves (nodes without children).
		function(node$1) {
			var _context2, _context3;
			return _everyInstanceProperty(
				_context2 = _filterInstanceProperty(
					_context3 = node$1.edges
					// Take only visible nodes into account.
).call(_context3, function(edge) {
					return nodes.has(edge.toId);
				})
				// Check that all edges lead to this node (leaf).
).call(_context2, function(edge) {
				return edge.to === node$1;
			});
		},
		// Use the lowest level.
		function(newLevel, oldLevel) {
			return oldLevel > newLevel;
		},
		// Go against the direction of the edges.
		"from",
		nodes
);
}
/**

* Assign levels to nodes according to their positions in the hierarchy. Roots will be lined up at the top and all nodes as close to their parents as possible.

*

* @param nodes - Visible nodes of the graph.

* @returns Populated node levels.

*/
function fillLevelsByDirectionRoots(nodes) {
	return fillLevelsByDirection(
		// Pick only roots (nodes without parents).
		function(node$1) {
			var _context4, _context5;
			return _everyInstanceProperty(
				_context4 = _filterInstanceProperty(
					_context5 = node$1.edges
					// Take only visible nodes into account.
).call(_context5, function(edge) {
					return nodes.has(edge.toId);
				})
				// Check that all edges lead from this node (root).
).call(_context4, function(edge) {
				return edge.from === node$1;
			});
		},
		// Use the highest level.
		function(newLevel, oldLevel) {
			return oldLevel < newLevel;
		},
		// Go in the direction of the edges.
		"to",
		nodes
);
}
/**

* Assign levels to nodes according to their positions in the hierarchy.

*

* @param isEntryNode - Checks and return true if the graph should be traversed from this node.

* @param shouldLevelBeReplaced - Checks and returns true if the level of given node should be updated to the new value.

* @param direction - Wheter the graph should be traversed in the direction of the edges `"to"` or in the other way `"from"`.

* @param nodes - Visible nodes of the graph.

* @returns Populated node levels.

*/
function fillLevelsByDirection(isEntryNode, shouldLevelBeReplaced, direction, nodes) {
	var _context6;
	var levels = _Object$create$1(null);
	var limit = _reduceInstanceProperty(_context6 = _toConsumableArray(_valuesInstanceProperty(nodes).call(nodes))).call(_context6, function(acc, node$1) {
		return acc + 1 + node$1.edges.length;
	}, 0);
	var edgeIdProp = direction + "Id";
	var newLevelDiff = direction === "to" ? 1 : -1;
	var _iterator = _createForOfIteratorHelper$1(nodes), _step;
	try {
		var _loop = function _loop$1() {
			var _step$value = _slicedToArray(_step.value, 2), entryNodeId = _step$value[0], entryNode = _step$value[1];
			if (!nodes.has(entryNodeId) || !isEntryNode(entryNode)) return "continue";
			levels[entryNodeId] = 0;
			var stack = [entryNode];
			var done = 0;
			var node$1;
			var _loop2 = function _loop2$1() {
				var _context7, _context8;
				if (!nodes.has(entryNodeId)) return "continue";
				var newLevel = levels[node$1.id] + newLevelDiff;
				_forEachInstanceProperty(_context7 = _filterInstanceProperty(_context8 = node$1.edges).call(_context8, function(edge) {
					return edge.connected && edge.to !== edge.from && edge[direction] !== node$1 && nodes.has(edge.toId) && nodes.has(edge.fromId);
				})).call(_context7, function(edge) {
					var targetNodeId = edge[edgeIdProp];
					var oldLevel = levels[targetNodeId];
					if (oldLevel == null || shouldLevelBeReplaced(newLevel, oldLevel)) {
						levels[targetNodeId] = newLevel;
						stack.push(edge[direction]);
					}
				});
				if (done > limit) return { v: { v: fillLevelsByDirectionCyclic(nodes, levels) } };
				else ++done;
			};
			while (node$1 = stack.pop()) {
				var _ret2 = _loop2();
				if (_ret2 === "continue") continue;
				if (_typeof(_ret2) === "object") return _ret2.v;
			}
		};
		for (_iterator.s(); !(_step = _iterator.n()).done;) {
			var _ret = _loop();
			if (_ret === "continue") continue;
			if (_typeof(_ret) === "object") return _ret.v;
		}
	} catch (err) {
		_iterator.e(err);
	} finally {
		_iterator.f();
	}
	return levels;
}
/**
* There's a mix-up with terms in the code. Following are the formal definitions:
*
*   tree   - a strict hierarchical network, i.e. every node has at most one parent
*   forest - a collection of trees. These distinct trees are thus not connected.
*
* So:
* - in a network that is not a tree, there exist nodes with multiple parents.
* - a network consisting of unconnected sub-networks, of which at least one
*   is not a tree, is not a forest.
*
* In the code, the definitions are:
*
*   tree   - any disconnected sub-network, strict hierarchical or not.
*   forest - a bunch of these sub-networks
*
* The difference between tree and not-tree is important in the code, notably within
* to the block-shifting algorithm. The algorithm assumes formal trees and fails
* for not-trees, often in a spectacular manner (search for 'exploding network' in the issues).
*
* In order to distinguish the definitions in the following code, the adjective 'formal' is
* used. If 'formal' is absent, you must assume the non-formal definition.
*
* ----------------------------------------------------------------------------------
* NOTES
* =====
*
* A hierarchical layout is a different thing from a hierarchical network.
* The layout is a way to arrange the nodes in the view; this can be done
* on non-hierarchical networks as well. The converse is also possible.
*/
/**
* Container for derived data on current network, relating to hierarchy.
*
* @private
*/
var HierarchicalStatus = /* @__PURE__ */ function() {
	/**
	* @ignore
	*/
	function HierarchicalStatus$1() {
		_classCallCheck(this, HierarchicalStatus$1);
		this.childrenReference = {};
		this.parentReference = {};
		this.trees = {};
		this.distributionOrdering = {};
		this.levels = {};
		this.distributionIndex = {};
		this.isTree = false;
		this.treeIndex = -1;
	}
	/**
	* Add the relation between given nodes to the current state.
	*
	* @param {Node.id} parentNodeId
	* @param {Node.id} childNodeId
	*/
	_createClass(HierarchicalStatus$1, [
		{
			key: "addRelation",
			value: function addRelation(parentNodeId, childNodeId) {
				if (this.childrenReference[parentNodeId] === void 0) this.childrenReference[parentNodeId] = [];
				this.childrenReference[parentNodeId].push(childNodeId);
				if (this.parentReference[childNodeId] === void 0) this.parentReference[childNodeId] = [];
				this.parentReference[childNodeId].push(parentNodeId);
			}
		},
		{
			key: "checkIfTree",
			value: function checkIfTree() {
				for (var i$2 in this.parentReference) if (this.parentReference[i$2].length > 1) {
					this.isTree = false;
					return;
				}
				this.isTree = true;
			}
		},
		{
			key: "numTrees",
			value: function numTrees() {
				return this.treeIndex + 1;
			}
		},
		{
			key: "setTreeIndex",
			value: function setTreeIndex(node$1, treeId) {
				if (treeId === void 0) return;
				if (this.trees[node$1.id] === void 0) {
					this.trees[node$1.id] = treeId;
					this.treeIndex = Math.max(treeId, this.treeIndex);
				}
			}
		},
		{
			key: "ensureLevel",
			value: function ensureLevel(nodeId) {
				if (this.levels[nodeId] === void 0) this.levels[nodeId] = 0;
			}
		},
		{
			key: "getMaxLevel",
			value: function getMaxLevel(nodeId) {
				var _this = this;
				var accumulator = {};
				var _getMaxLevel = function _getMaxLevel$1(nodeId$1) {
					if (accumulator[nodeId$1] !== void 0) return accumulator[nodeId$1];
					var level = _this.levels[nodeId$1];
					if (_this.childrenReference[nodeId$1]) {
						var children = _this.childrenReference[nodeId$1];
						if (children.length > 0) for (var i$2 = 0; i$2 < children.length; i$2++) level = Math.max(level, _getMaxLevel$1(children[i$2]));
					}
					accumulator[nodeId$1] = level;
					return level;
				};
				return _getMaxLevel(nodeId);
			}
		},
		{
			key: "levelDownstream",
			value: function levelDownstream(nodeA, nodeB) {
				if (this.levels[nodeB.id] === void 0) {
					if (this.levels[nodeA.id] === void 0) this.levels[nodeA.id] = 0;
					this.levels[nodeB.id] = this.levels[nodeA.id] + 1;
				}
			}
		},
		{
			key: "setMinLevelToZero",
			value: function setMinLevelToZero(nodes) {
				var minLevel = 1e9;
				for (var nodeId in nodes) if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {
					if (this.levels[nodeId] !== void 0) minLevel = Math.min(this.levels[nodeId], minLevel);
				}
				for (var _nodeId in nodes) if (Object.prototype.hasOwnProperty.call(nodes, _nodeId)) {
					if (this.levels[_nodeId] !== void 0) this.levels[_nodeId] -= minLevel;
				}
			}
		},
		{
			key: "getTreeSize",
			value: function getTreeSize(nodes, index$1) {
				var min_x = 1e9;
				var max_x = -1e9;
				var min_y = 1e9;
				var max_y = -1e9;
				for (var nodeId in this.trees) if (Object.prototype.hasOwnProperty.call(this.trees, nodeId)) {
					if (this.trees[nodeId] === index$1) {
						var node$1 = nodes[nodeId];
						min_x = Math.min(node$1.x, min_x);
						max_x = Math.max(node$1.x, max_x);
						min_y = Math.min(node$1.y, min_y);
						max_y = Math.max(node$1.y, max_y);
					}
				}
				return {
					min_x,
					max_x,
					min_y,
					max_y
				};
			}
		},
		{
			key: "hasSameParent",
			value: function hasSameParent(node1, node2) {
				var parents1 = this.parentReference[node1.id];
				var parents2 = this.parentReference[node2.id];
				if (parents1 === void 0 || parents2 === void 0) return false;
				for (var i$2 = 0; i$2 < parents1.length; i$2++) for (var j = 0; j < parents2.length; j++) if (parents1[i$2] == parents2[j]) return true;
				return false;
			}
		},
		{
			key: "inSameSubNetwork",
			value: function inSameSubNetwork(node1, node2) {
				return this.trees[node1.id] === this.trees[node2.id];
			}
		},
		{
			key: "getLevels",
			value: function getLevels() {
				return _Object$keys(this.distributionOrdering);
			}
		},
		{
			key: "addToOrdering",
			value: function addToOrdering(node$1, level) {
				if (this.distributionOrdering[level] === void 0) this.distributionOrdering[level] = [];
				var isPresent = false;
				var curLevel = this.distributionOrdering[level];
				for (var n in curLevel) if (curLevel[n] === node$1) {
					isPresent = true;
					break;
				}
				if (!isPresent) {
					this.distributionOrdering[level].push(node$1);
					this.distributionIndex[node$1.id] = this.distributionOrdering[level].length - 1;
				}
			}
		}
	]);
	return HierarchicalStatus$1;
}();
/**
* The Layout Engine
*/
var LayoutEngine = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	*/
	function LayoutEngine$1(body) {
		_classCallCheck(this, LayoutEngine$1);
		this.body = body;
		this._resetRNG(Math.random() + ":" + _Date$now());
		this.setPhysics = false;
		this.options = {};
		this.optionsBackup = { physics: {} };
		this.defaultOptions = {
			randomSeed: void 0,
			improvedLayout: true,
			clusterThreshold: 150,
			hierarchical: {
				enabled: false,
				levelSeparation: 150,
				nodeSpacing: 100,
				treeSpacing: 200,
				blockShifting: true,
				edgeMinimization: true,
				parentCentralization: true,
				direction: "UD",
				sortMethod: "hubsize"
			}
		};
		_Object$assign(this.options, this.defaultOptions);
		this.bindEventListeners();
	}
	/**
	* Binds event listeners
	*/
	_createClass(LayoutEngine$1, [
		{
			key: "bindEventListeners",
			value: function bindEventListeners() {
				var _this2 = this;
				this.body.emitter.on("_dataChanged", function() {
					_this2.setupHierarchicalLayout();
				});
				this.body.emitter.on("_dataLoaded", function() {
					_this2.layoutNetwork();
				});
				this.body.emitter.on("_resetHierarchicalLayout", function() {
					_this2.setupHierarchicalLayout();
				});
				this.body.emitter.on("_adjustEdgesForHierarchicalLayout", function() {
					if (_this2.options.hierarchical.enabled !== true) return;
					var type = _this2.direction.curveType();
					_this2.body.emitter.emit("_forceDisableDynamicCurves", type, false);
				});
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options, allOptions$2) {
				if (options !== void 0) {
					var hierarchical = this.options.hierarchical;
					var prevHierarchicalState = hierarchical.enabled;
					selectiveDeepExtend([
						"randomSeed",
						"improvedLayout",
						"clusterThreshold"
					], this.options, options);
					mergeOptions(this.options, options, "hierarchical");
					if (options.randomSeed !== void 0) this._resetRNG(options.randomSeed);
					if (hierarchical.enabled === true) {
						if (prevHierarchicalState === true) this.body.emitter.emit("refresh", true);
						if (hierarchical.direction === "RL" || hierarchical.direction === "DU") {
							if (hierarchical.levelSeparation > 0) hierarchical.levelSeparation *= -1;
						} else if (hierarchical.levelSeparation < 0) hierarchical.levelSeparation *= -1;
						this.setDirectionStrategy();
						this.body.emitter.emit("_resetHierarchicalLayout");
						return this.adaptAllOptionsForHierarchicalLayout(allOptions$2);
					} else if (prevHierarchicalState === true) {
						this.body.emitter.emit("refresh");
						return deepExtend(allOptions$2, this.optionsBackup);
					}
				}
				return allOptions$2;
			}
		},
		{
			key: "_resetRNG",
			value: function _resetRNG(seed) {
				this.initialRandomSeed = seed;
				this._rng = Alea(this.initialRandomSeed);
			}
		},
		{
			key: "adaptAllOptionsForHierarchicalLayout",
			value: function adaptAllOptionsForHierarchicalLayout(allOptions$2) {
				if (this.options.hierarchical.enabled === true) {
					var backupPhysics = this.optionsBackup.physics;
					if (allOptions$2.physics === void 0 || allOptions$2.physics === true) {
						allOptions$2.physics = {
							enabled: backupPhysics.enabled === void 0 ? true : backupPhysics.enabled,
							solver: "hierarchicalRepulsion"
						};
						backupPhysics.enabled = backupPhysics.enabled === void 0 ? true : backupPhysics.enabled;
						backupPhysics.solver = backupPhysics.solver || "barnesHut";
					} else if (_typeof(allOptions$2.physics) === "object") {
						backupPhysics.enabled = allOptions$2.physics.enabled === void 0 ? true : allOptions$2.physics.enabled;
						backupPhysics.solver = allOptions$2.physics.solver || "barnesHut";
						allOptions$2.physics.solver = "hierarchicalRepulsion";
					} else if (allOptions$2.physics !== false) {
						backupPhysics.solver = "barnesHut";
						allOptions$2.physics = { solver: "hierarchicalRepulsion" };
					}
					var type = this.direction.curveType();
					if (allOptions$2.edges === void 0) {
						this.optionsBackup.edges = { smooth: {
							enabled: true,
							type: "dynamic"
						} };
						allOptions$2.edges = { smooth: false };
					} else if (allOptions$2.edges.smooth === void 0) {
						this.optionsBackup.edges = { smooth: {
							enabled: true,
							type: "dynamic"
						} };
						allOptions$2.edges.smooth = false;
					} else if (typeof allOptions$2.edges.smooth === "boolean") {
						this.optionsBackup.edges = { smooth: allOptions$2.edges.smooth };
						allOptions$2.edges.smooth = {
							enabled: allOptions$2.edges.smooth,
							type
						};
					} else {
						var smooth = allOptions$2.edges.smooth;
						if (smooth.type !== void 0 && smooth.type !== "dynamic") type = smooth.type;
						this.optionsBackup.edges = { smooth: {
							enabled: smooth.enabled === void 0 ? true : smooth.enabled,
							type: smooth.type === void 0 ? "dynamic" : smooth.type,
							roundness: smooth.roundness === void 0 ? .5 : smooth.roundness,
							forceDirection: smooth.forceDirection === void 0 ? false : smooth.forceDirection
						} };
						allOptions$2.edges.smooth = {
							enabled: smooth.enabled === void 0 ? true : smooth.enabled,
							type,
							roundness: smooth.roundness === void 0 ? .5 : smooth.roundness,
							forceDirection: smooth.forceDirection === void 0 ? false : smooth.forceDirection
						};
					}
					this.body.emitter.emit("_forceDisableDynamicCurves", type);
				}
				return allOptions$2;
			}
		},
		{
			key: "positionInitially",
			value: function positionInitially(nodesArray) {
				if (this.options.hierarchical.enabled !== true) {
					this._resetRNG(this.initialRandomSeed);
					var radius = nodesArray.length + 50;
					for (var i$2 = 0; i$2 < nodesArray.length; i$2++) {
						var node$1 = nodesArray[i$2];
						var angle = 2 * Math.PI * this._rng();
						if (node$1.x === void 0) node$1.x = radius * Math.cos(angle);
						if (node$1.y === void 0) node$1.y = radius * Math.sin(angle);
					}
				}
			}
		},
		{
			key: "layoutNetwork",
			value: function layoutNetwork() {
				if (this.options.hierarchical.enabled !== true && this.options.improvedLayout === true) {
					var indices = this.body.nodeIndices;
					var positionDefined = 0;
					for (var i$2 = 0; i$2 < indices.length; i$2++) {
						var node$1 = this.body.nodes[indices[i$2]];
						if (node$1.predefinedPosition === true) positionDefined += 1;
					}
					if (positionDefined < .5 * indices.length) {
						var MAX_LEVELS = 10;
						var level = 0;
						var clusterThreshold = this.options.clusterThreshold;
						var clusterOptions = {
							clusterNodeProperties: {
								shape: "ellipse",
								label: "",
								group: "",
								font: { multi: false }
							},
							clusterEdgeProperties: {
								label: "",
								font: { multi: false },
								smooth: { enabled: false }
							}
						};
						if (indices.length > clusterThreshold) {
							var startLength = indices.length;
							while (indices.length > clusterThreshold && level <= MAX_LEVELS) {
								level += 1;
								var before = indices.length;
								if (level % 3 === 0) this.body.modules.clustering.clusterBridges(clusterOptions);
								else this.body.modules.clustering.clusterOutliers(clusterOptions);
								var after = indices.length;
								if (before == after && level % 3 !== 0) {
									this._declusterAll();
									this.body.emitter.emit("_layoutFailed");
									console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.");
									return;
								}
							}
							this.body.modules.kamadaKawai.setOptions({ springLength: Math.max(150, 2 * startLength) });
						}
						if (level > MAX_LEVELS) console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result.");
						this.body.modules.kamadaKawai.solve(indices, this.body.edgeIndices, true);
						this._shiftToCenter();
						var offset = 70;
						for (var _i = 0; _i < indices.length; _i++) {
							var _node = this.body.nodes[indices[_i]];
							if (_node.predefinedPosition === false) {
								_node.x += (.5 - this._rng()) * offset;
								_node.y += (.5 - this._rng()) * offset;
							}
						}
						this._declusterAll();
						this.body.emitter.emit("_repositionBezierNodes");
					}
				}
			}
		},
		{
			key: "_shiftToCenter",
			value: function _shiftToCenter() {
				var range = NetworkUtil.getRangeCore(this.body.nodes, this.body.nodeIndices);
				var center = NetworkUtil.findCenter(range);
				for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) {
					var node$1 = this.body.nodes[this.body.nodeIndices[i$2]];
					node$1.x -= center.x;
					node$1.y -= center.y;
				}
			}
		},
		{
			key: "_declusterAll",
			value: function _declusterAll() {
				var clustersPresent = true;
				while (clustersPresent === true) {
					clustersPresent = false;
					for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) if (this.body.nodes[this.body.nodeIndices[i$2]].isCluster === true) {
						clustersPresent = true;
						this.body.modules.clustering.openCluster(this.body.nodeIndices[i$2], {}, false);
					}
					if (clustersPresent === true) this.body.emitter.emit("_dataChanged");
				}
			}
		},
		{
			key: "getSeed",
			value: function getSeed() {
				return this.initialRandomSeed;
			}
		},
		{
			key: "setupHierarchicalLayout",
			value: function setupHierarchicalLayout() {
				if (this.options.hierarchical.enabled === true && this.body.nodeIndices.length > 0) {
					var node$1, nodeId;
					var definedLevel = false;
					var undefinedLevel = false;
					this.lastNodeOnLevel = {};
					this.hierarchical = new HierarchicalStatus();
					for (nodeId in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {
						node$1 = this.body.nodes[nodeId];
						if (node$1.options.level !== void 0) {
							definedLevel = true;
							this.hierarchical.levels[nodeId] = node$1.options.level;
						} else undefinedLevel = true;
					}
					if (undefinedLevel === true && definedLevel === true) throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes.");
					else {
						if (undefinedLevel === true) {
							var sortMethod = this.options.hierarchical.sortMethod;
							if (sortMethod === "hubsize") this._determineLevelsByHubsize();
							else if (sortMethod === "directed") this._determineLevelsDirected();
							else if (sortMethod === "custom") this._determineLevelsCustomCallback();
						}
						for (var _nodeId2 in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, _nodeId2)) this.hierarchical.ensureLevel(_nodeId2);
						var distribution = this._getDistribution();
						this._generateMap();
						this._placeNodesByHierarchy(distribution);
						this._condenseHierarchy();
						this._shiftToCenter();
					}
				}
			}
		},
		{
			key: "_condenseHierarchy",
			value: function _condenseHierarchy() {
				var _this3 = this;
				var stillShifting = false;
				var branches = {};
				var shiftTrees = function shiftTrees$1() {
					var treeSizes = getTreeSizes();
					var shiftBy = 0;
					for (var i$2 = 0; i$2 < treeSizes.length - 1; i$2++) {
						var diff = treeSizes[i$2].max - treeSizes[i$2 + 1].min;
						shiftBy += diff + _this3.options.hierarchical.treeSpacing;
						shiftTree(i$2 + 1, shiftBy);
					}
				};
				var shiftTree = function shiftTree$1(index$1, offset) {
					var trees = _this3.hierarchical.trees;
					for (var nodeId in trees) if (Object.prototype.hasOwnProperty.call(trees, nodeId)) {
						if (trees[nodeId] === index$1) _this3.direction.shift(nodeId, offset);
					}
				};
				var getTreeSizes = function getTreeSizes$1() {
					var treeWidths = [];
					for (var i$2 = 0; i$2 < _this3.hierarchical.numTrees(); i$2++) treeWidths.push(_this3.direction.getTreeSize(i$2));
					return treeWidths;
				};
				var getBranchNodes = function getBranchNodes$1(source, map$8) {
					if (map$8[source.id]) return;
					map$8[source.id] = true;
					if (_this3.hierarchical.childrenReference[source.id]) {
						var children = _this3.hierarchical.childrenReference[source.id];
						if (children.length > 0) for (var i$2 = 0; i$2 < children.length; i$2++) getBranchNodes$1(_this3.body.nodes[children[i$2]], map$8);
					}
				};
				var getBranchBoundary = function getBranchBoundary$1(branchMap) {
					var maxLevel = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e9;
					var minSpace = 1e9;
					var maxSpace = 1e9;
					var min$4 = 1e9;
					var max$5 = -1e9;
					for (var branchNode in branchMap) if (Object.prototype.hasOwnProperty.call(branchMap, branchNode)) {
						var node$1 = _this3.body.nodes[branchNode];
						var level = _this3.hierarchical.levels[node$1.id];
						var position = _this3.direction.getPosition(node$1);
						var _this3$_getSpaceAroun = _this3._getSpaceAroundNode(node$1, branchMap), _this3$_getSpaceAroun2 = _slicedToArray(_this3$_getSpaceAroun, 2), minSpaceNode = _this3$_getSpaceAroun2[0], maxSpaceNode = _this3$_getSpaceAroun2[1];
						minSpace = Math.min(minSpaceNode, minSpace);
						maxSpace = Math.min(maxSpaceNode, maxSpace);
						if (level <= maxLevel) {
							min$4 = Math.min(position, min$4);
							max$5 = Math.max(position, max$5);
						}
					}
					return [
						min$4,
						max$5,
						minSpace,
						maxSpace
					];
				};
				var getCollisionLevel = function getCollisionLevel$1(node1, node2) {
					var maxLevel1 = _this3.hierarchical.getMaxLevel(node1.id);
					var maxLevel2 = _this3.hierarchical.getMaxLevel(node2.id);
					return Math.min(maxLevel1, maxLevel2);
				};
				/**
				* Condense elements. These can be nodes or branches depending on the callback.
				*
				* @param {Function} callback
				* @param {Array.<number>} levels
				* @param {*} centerParents
				*/
				var shiftElementsCloser = function shiftElementsCloser$1(callback, levels, centerParents) {
					var hier = _this3.hierarchical;
					for (var i$2 = 0; i$2 < levels.length; i$2++) {
						var level = levels[i$2];
						var levelNodes = hier.distributionOrdering[level];
						if (levelNodes.length > 1) for (var j = 0; j < levelNodes.length - 1; j++) {
							var node1 = levelNodes[j];
							var node2 = levelNodes[j + 1];
							if (hier.hasSameParent(node1, node2) && hier.inSameSubNetwork(node1, node2)) callback(node1, node2, centerParents);
						}
					}
				};
				var branchShiftCallback = function branchShiftCallback$1(node1, node2) {
					var centerParent = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
					var pos1 = _this3.direction.getPosition(node1);
					var pos2 = _this3.direction.getPosition(node2);
					var diffAbs = Math.abs(pos2 - pos1);
					var nodeSpacing = _this3.options.hierarchical.nodeSpacing;
					if (diffAbs > nodeSpacing) {
						var branchNodes1 = {};
						var branchNodes2 = {};
						getBranchNodes(node1, branchNodes1);
						getBranchNodes(node2, branchNodes2);
						var maxLevel = getCollisionLevel(node1, node2);
						var branchNodeBoundary1 = getBranchBoundary(branchNodes1, maxLevel);
						var branchNodeBoundary2 = getBranchBoundary(branchNodes2, maxLevel);
						var max1 = branchNodeBoundary1[1];
						var min2 = branchNodeBoundary2[0];
						var minSpace2 = branchNodeBoundary2[2];
						var diffBranch = Math.abs(max1 - min2);
						if (diffBranch > nodeSpacing) {
							var offset = max1 - min2 + nodeSpacing;
							if (offset < -minSpace2 + nodeSpacing) offset = -minSpace2 + nodeSpacing;
							if (offset < 0) {
								_this3._shiftBlock(node2.id, offset);
								stillShifting = true;
								if (centerParent === true) _this3._centerParent(node2);
							}
						}
					}
				};
				var minimizeEdgeLength = function minimizeEdgeLength$1(iterations, node$1) {
					var nodeId = node$1.id;
					var allEdges = node$1.edges;
					var nodeLevel = _this3.hierarchical.levels[node$1.id];
					var C2 = _this3.options.hierarchical.levelSeparation * _this3.options.hierarchical.levelSeparation;
					var referenceNodes = {};
					var aboveEdges = [];
					for (var i$2 = 0; i$2 < allEdges.length; i$2++) {
						var edge = allEdges[i$2];
						if (edge.toId != edge.fromId) {
							var otherNode = edge.toId == nodeId ? edge.from : edge.to;
							referenceNodes[allEdges[i$2].id] = otherNode;
							if (_this3.hierarchical.levels[otherNode.id] < nodeLevel) aboveEdges.push(edge);
						}
					}
					var getFx = function getFx$1(point, edges) {
						var sum = 0;
						for (var _i2 = 0; _i2 < edges.length; _i2++) if (referenceNodes[edges[_i2].id] !== void 0) {
							var a = _this3.direction.getPosition(referenceNodes[edges[_i2].id]) - point;
							sum += a / Math.sqrt(a * a + C2);
						}
						return sum;
					};
					var getDFx = function getDFx$1(point, edges) {
						var sum = 0;
						for (var _i3 = 0; _i3 < edges.length; _i3++) if (referenceNodes[edges[_i3].id] !== void 0) {
							var a = _this3.direction.getPosition(referenceNodes[edges[_i3].id]) - point;
							sum -= C2 * Math.pow(a * a + C2, -1.5);
						}
						return sum;
					};
					var getGuess = function getGuess$1(iterations$1, edges) {
						var guess$1 = _this3.direction.getPosition(node$1);
						var guessMap = {};
						for (var _i4 = 0; _i4 < iterations$1; _i4++) {
							var fx = getFx(guess$1, edges);
							var dfx = getDFx(guess$1, edges);
							var limit = 40;
							var ratio = Math.max(-limit, Math.min(limit, Math.round(fx / dfx)));
							guess$1 = guess$1 - ratio;
							if (guessMap[guess$1] !== void 0) break;
							guessMap[guess$1] = _i4;
						}
						return guess$1;
					};
					var moveBranch = function moveBranch$1(guess$1) {
						var nodePosition = _this3.direction.getPosition(node$1);
						if (branches[node$1.id] === void 0) {
							var branchNodes = {};
							getBranchNodes(node$1, branchNodes);
							branches[node$1.id] = branchNodes;
						}
						var branchBoundary = getBranchBoundary(branches[node$1.id]);
						var minSpaceBranch = branchBoundary[2];
						var maxSpaceBranch = branchBoundary[3];
						var diff = guess$1 - nodePosition;
						var branchOffset = 0;
						if (diff > 0) branchOffset = Math.min(diff, maxSpaceBranch - _this3.options.hierarchical.nodeSpacing);
						else if (diff < 0) branchOffset = -Math.min(-diff, minSpaceBranch - _this3.options.hierarchical.nodeSpacing);
						if (branchOffset != 0) {
							_this3._shiftBlock(node$1.id, branchOffset);
							stillShifting = true;
						}
					};
					var moveNode = function moveNode$1(guess$1) {
						var nodePosition = _this3.direction.getPosition(node$1);
						var _this3$_getSpaceAroun3 = _this3._getSpaceAroundNode(node$1), _this3$_getSpaceAroun4 = _slicedToArray(_this3$_getSpaceAroun3, 2), minSpace = _this3$_getSpaceAroun4[0], maxSpace = _this3$_getSpaceAroun4[1];
						var diff = guess$1 - nodePosition;
						var newPosition = nodePosition;
						if (diff > 0) newPosition = Math.min(nodePosition + (maxSpace - _this3.options.hierarchical.nodeSpacing), guess$1);
						else if (diff < 0) newPosition = Math.max(nodePosition - (minSpace - _this3.options.hierarchical.nodeSpacing), guess$1);
						if (newPosition !== nodePosition) {
							_this3.direction.setPosition(node$1, newPosition);
							stillShifting = true;
						}
					};
					var guess = getGuess(iterations, aboveEdges);
					moveBranch(guess);
					guess = getGuess(iterations, allEdges);
					moveNode(guess);
				};
				var minimizeEdgeLengthBottomUp = function minimizeEdgeLengthBottomUp$1(iterations) {
					var levels = _this3.hierarchical.getLevels();
					levels = _reverseInstanceProperty(levels).call(levels);
					for (var i$2 = 0; i$2 < iterations; i$2++) {
						stillShifting = false;
						for (var j = 0; j < levels.length; j++) {
							var level = levels[j];
							var levelNodes = _this3.hierarchical.distributionOrdering[level];
							for (var k = 0; k < levelNodes.length; k++) minimizeEdgeLength(1e3, levelNodes[k]);
						}
						if (stillShifting !== true) break;
					}
				};
				var shiftBranchesCloserBottomUp = function shiftBranchesCloserBottomUp$1(iterations) {
					var levels = _this3.hierarchical.getLevels();
					levels = _reverseInstanceProperty(levels).call(levels);
					for (var i$2 = 0; i$2 < iterations; i$2++) {
						stillShifting = false;
						shiftElementsCloser(branchShiftCallback, levels, true);
						if (stillShifting !== true) break;
					}
				};
				var centerAllParents = function centerAllParents$1() {
					for (var nodeId in _this3.body.nodes) if (Object.prototype.hasOwnProperty.call(_this3.body.nodes, nodeId)) _this3._centerParent(_this3.body.nodes[nodeId]);
				};
				var centerAllParentsBottomUp = function centerAllParentsBottomUp$1() {
					var levels = _this3.hierarchical.getLevels();
					levels = _reverseInstanceProperty(levels).call(levels);
					for (var i$2 = 0; i$2 < levels.length; i$2++) {
						var level = levels[i$2];
						var levelNodes = _this3.hierarchical.distributionOrdering[level];
						for (var j = 0; j < levelNodes.length; j++) _this3._centerParent(levelNodes[j]);
					}
				};
				if (this.options.hierarchical.blockShifting === true) {
					shiftBranchesCloserBottomUp(5);
					centerAllParents();
				}
				if (this.options.hierarchical.edgeMinimization === true) minimizeEdgeLengthBottomUp(20);
				if (this.options.hierarchical.parentCentralization === true) centerAllParentsBottomUp();
				shiftTrees();
			}
		},
		{
			key: "_getSpaceAroundNode",
			value: function _getSpaceAroundNode(node$1, map$8) {
				var useMap = true;
				if (map$8 === void 0) useMap = false;
				var level = this.hierarchical.levels[node$1.id];
				if (level !== void 0) {
					var index$1 = this.hierarchical.distributionIndex[node$1.id];
					var position = this.direction.getPosition(node$1);
					var ordering = this.hierarchical.distributionOrdering[level];
					var minSpace = 1e9;
					var maxSpace = 1e9;
					if (index$1 !== 0) {
						var prevNode = ordering[index$1 - 1];
						if (useMap === true && map$8[prevNode.id] === void 0 || useMap === false) {
							var prevPos = this.direction.getPosition(prevNode);
							minSpace = position - prevPos;
						}
					}
					if (index$1 != ordering.length - 1) {
						var nextNode = ordering[index$1 + 1];
						if (useMap === true && map$8[nextNode.id] === void 0 || useMap === false) {
							var nextPos = this.direction.getPosition(nextNode);
							maxSpace = Math.min(maxSpace, nextPos - position);
						}
					}
					return [minSpace, maxSpace];
				} else return [0, 0];
			}
		},
		{
			key: "_centerParent",
			value: function _centerParent(node$1) {
				if (this.hierarchical.parentReference[node$1.id]) {
					var parents = this.hierarchical.parentReference[node$1.id];
					for (var i$2 = 0; i$2 < parents.length; i$2++) {
						var parentId = parents[i$2];
						var parentNode = this.body.nodes[parentId];
						var children = this.hierarchical.childrenReference[parentId];
						if (children !== void 0) {
							var newPosition = this._getCenterPosition(children);
							var position = this.direction.getPosition(parentNode);
							var _this$_getSpaceAround = this._getSpaceAroundNode(parentNode), _this$_getSpaceAround2 = _slicedToArray(_this$_getSpaceAround, 2), minSpace = _this$_getSpaceAround2[0], maxSpace = _this$_getSpaceAround2[1];
							var diff = position - newPosition;
							if (diff < 0 && Math.abs(diff) < maxSpace - this.options.hierarchical.nodeSpacing || diff > 0 && Math.abs(diff) < minSpace - this.options.hierarchical.nodeSpacing) this.direction.setPosition(parentNode, newPosition);
						}
					}
				}
			}
		},
		{
			key: "_placeNodesByHierarchy",
			value: function _placeNodesByHierarchy(distribution) {
				this.positionedNodes = {};
				for (var level in distribution) if (Object.prototype.hasOwnProperty.call(distribution, level)) {
					var _context;
					var nodeArray = _Object$keys(distribution[level]);
					nodeArray = this._indexArrayToNodes(nodeArray);
					_sortInstanceProperty(_context = this.direction).call(_context, nodeArray);
					var handledNodeCount = 0;
					for (var i$2 = 0; i$2 < nodeArray.length; i$2++) {
						var node$1 = nodeArray[i$2];
						if (this.positionedNodes[node$1.id] === void 0) {
							var spacing = this.options.hierarchical.nodeSpacing;
							var pos = spacing * handledNodeCount;
							if (handledNodeCount > 0) pos = this.direction.getPosition(nodeArray[i$2 - 1]) + spacing;
							this.direction.setPosition(node$1, pos, level);
							this._validatePositionAndContinue(node$1, level, pos);
							handledNodeCount++;
						}
					}
				}
			}
		},
		{
			key: "_placeBranchNodes",
			value: function _placeBranchNodes(parentId, parentLevel) {
				var _context2;
				var childRef = this.hierarchical.childrenReference[parentId];
				if (childRef === void 0) return;
				var childNodes = [];
				for (var i$2 = 0; i$2 < childRef.length; i$2++) childNodes.push(this.body.nodes[childRef[i$2]]);
				_sortInstanceProperty(_context2 = this.direction).call(_context2, childNodes);
				for (var _i5 = 0; _i5 < childNodes.length; _i5++) {
					var childNode = childNodes[_i5];
					var childNodeLevel = this.hierarchical.levels[childNode.id];
					if (childNodeLevel > parentLevel && this.positionedNodes[childNode.id] === void 0) {
						var spacing = this.options.hierarchical.nodeSpacing;
						var pos = void 0;
						if (_i5 === 0) pos = this.direction.getPosition(this.body.nodes[parentId]);
						else pos = this.direction.getPosition(childNodes[_i5 - 1]) + spacing;
						this.direction.setPosition(childNode, pos, childNodeLevel);
						this._validatePositionAndContinue(childNode, childNodeLevel, pos);
					} else return;
				}
				var center = this._getCenterPosition(childNodes);
				this.direction.setPosition(this.body.nodes[parentId], center, parentLevel);
			}
		},
		{
			key: "_validatePositionAndContinue",
			value: function _validatePositionAndContinue(node$1, level, pos) {
				if (!this.hierarchical.isTree) return;
				if (this.lastNodeOnLevel[level] !== void 0) {
					var previousPos = this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[level]]);
					if (pos - previousPos < this.options.hierarchical.nodeSpacing) {
						var diff = previousPos + this.options.hierarchical.nodeSpacing - pos;
						var sharedParent = this._findCommonParent(this.lastNodeOnLevel[level], node$1.id);
						this._shiftBlock(sharedParent.withChild, diff);
					}
				}
				this.lastNodeOnLevel[level] = node$1.id;
				this.positionedNodes[node$1.id] = true;
				this._placeBranchNodes(node$1.id, level);
			}
		},
		{
			key: "_indexArrayToNodes",
			value: function _indexArrayToNodes(idArray) {
				var array$1 = [];
				for (var i$2 = 0; i$2 < idArray.length; i$2++) array$1.push(this.body.nodes[idArray[i$2]]);
				return array$1;
			}
		},
		{
			key: "_getDistribution",
			value: function _getDistribution() {
				var distribution = {};
				var nodeId, node$1;
				for (nodeId in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) {
					node$1 = this.body.nodes[nodeId];
					var level = this.hierarchical.levels[nodeId] === void 0 ? 0 : this.hierarchical.levels[nodeId];
					this.direction.fix(node$1, level);
					if (distribution[level] === void 0) distribution[level] = {};
					distribution[level][nodeId] = node$1;
				}
				return distribution;
			}
		},
		{
			key: "_getActiveEdges",
			value: function _getActiveEdges(node$1) {
				var _this4 = this;
				var result = [];
				forEach$1(node$1.edges, function(edge) {
					var _context3;
					if (_indexOfInstanceProperty(_context3 = _this4.body.edgeIndices).call(_context3, edge.id) !== -1) result.push(edge);
				});
				return result;
			}
		},
		{
			key: "_getHubSizes",
			value: function _getHubSizes() {
				var _this5 = this;
				var hubSizes = {};
				var nodeIds = this.body.nodeIndices;
				forEach$1(nodeIds, function(nodeId) {
					var node$1 = _this5.body.nodes[nodeId];
					var hubSize = _this5._getActiveEdges(node$1).length;
					hubSizes[hubSize] = true;
				});
				var result = [];
				forEach$1(hubSizes, function(size) {
					result.push(Number(size));
				});
				_sortInstanceProperty(TimSort).call(TimSort, result, function(a, b) {
					return b - a;
				});
				return result;
			}
		},
		{
			key: "_determineLevelsByHubsize",
			value: function _determineLevelsByHubsize() {
				var _this6 = this;
				var levelDownstream = function levelDownstream$1(nodeA, nodeB) {
					_this6.hierarchical.levelDownstream(nodeA, nodeB);
				};
				var hubSizes = this._getHubSizes();
				var _loop = function _loop$1() {
					var hubSize = hubSizes[i$2];
					if (hubSize === 0) return "break";
					forEach$1(_this6.body.nodeIndices, function(nodeId) {
						var node$1 = _this6.body.nodes[nodeId];
						if (hubSize === _this6._getActiveEdges(node$1).length) _this6._crawlNetwork(levelDownstream, nodeId);
					});
				};
				for (var i$2 = 0; i$2 < hubSizes.length; ++i$2) {
					var _ret = _loop();
					if (_ret === "break") break;
				}
			}
		},
		{
			key: "_determineLevelsCustomCallback",
			value: function _determineLevelsCustomCallback() {
				var _this7 = this;
				var minLevel = 1e5;
				var customCallback = function customCallback$1(nodeA, nodeB, edge) {};
				var levelByDirection = function levelByDirection$1(nodeA, nodeB, edge) {
					var levelA = _this7.hierarchical.levels[nodeA.id];
					if (levelA === void 0) levelA = _this7.hierarchical.levels[nodeA.id] = minLevel;
					var diff = customCallback(NetworkUtil.cloneOptions(nodeA, "node"), NetworkUtil.cloneOptions(nodeB, "node"), NetworkUtil.cloneOptions(edge, "edge"));
					_this7.hierarchical.levels[nodeB.id] = levelA + diff;
				};
				this._crawlNetwork(levelByDirection);
				this.hierarchical.setMinLevelToZero(this.body.nodes);
			}
		},
		{
			key: "_determineLevelsDirected",
			value: function _determineLevelsDirected() {
				var _context4, _this8 = this;
				var nodes = _reduceInstanceProperty(_context4 = this.body.nodeIndices).call(_context4, function(acc, id$4) {
					acc.set(id$4, _this8.body.nodes[id$4]);
					return acc;
				}, new _Map());
				if (this.options.hierarchical.shakeTowards === "roots") this.hierarchical.levels = fillLevelsByDirectionRoots(nodes);
				else this.hierarchical.levels = fillLevelsByDirectionLeaves(nodes);
				this.hierarchical.setMinLevelToZero(this.body.nodes);
			}
		},
		{
			key: "_generateMap",
			value: function _generateMap() {
				var _this9 = this;
				var fillInRelations = function fillInRelations$1(parentNode, childNode) {
					if (_this9.hierarchical.levels[childNode.id] > _this9.hierarchical.levels[parentNode.id]) _this9.hierarchical.addRelation(parentNode.id, childNode.id);
				};
				this._crawlNetwork(fillInRelations);
				this.hierarchical.checkIfTree();
			}
		},
		{
			key: "_crawlNetwork",
			value: function _crawlNetwork() {
				var _this10 = this;
				var callback = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function() {};
				var startingNodeId = arguments.length > 1 ? arguments[1] : void 0;
				var progress = {};
				var crawler = function crawler$1(node$2, tree) {
					if (progress[node$2.id] === void 0) {
						_this10.hierarchical.setTreeIndex(node$2, tree);
						progress[node$2.id] = true;
						var childNode;
						var edges = _this10._getActiveEdges(node$2);
						for (var i$3 = 0; i$3 < edges.length; i$3++) {
							var edge = edges[i$3];
							if (edge.connected === true) {
								if (edge.toId == node$2.id) childNode = edge.from;
								else childNode = edge.to;
								if (node$2.id != childNode.id) {
									callback(node$2, childNode, edge);
									crawler$1(childNode, tree);
								}
							}
						}
					}
				};
				if (startingNodeId === void 0) {
					var treeIndex = 0;
					for (var i$2 = 0; i$2 < this.body.nodeIndices.length; i$2++) {
						var nodeId = this.body.nodeIndices[i$2];
						if (progress[nodeId] === void 0) {
							var node$1 = this.body.nodes[nodeId];
							crawler(node$1, treeIndex);
							treeIndex += 1;
						}
					}
				} else {
					var _node2 = this.body.nodes[startingNodeId];
					if (_node2 === void 0) {
						console.error("Node not found:", startingNodeId);
						return;
					}
					crawler(_node2);
				}
			}
		},
		{
			key: "_shiftBlock",
			value: function _shiftBlock(parentId, diff) {
				var _this11 = this;
				var progress = {};
				var shifter = function shifter$1(parentId$1) {
					if (progress[parentId$1]) return;
					progress[parentId$1] = true;
					_this11.direction.shift(parentId$1, diff);
					var childRef = _this11.hierarchical.childrenReference[parentId$1];
					if (childRef !== void 0) for (var i$2 = 0; i$2 < childRef.length; i$2++) shifter$1(childRef[i$2]);
				};
				shifter(parentId);
			}
		},
		{
			key: "_findCommonParent",
			value: function _findCommonParent(childA, childB) {
				var _this12 = this;
				var parents = {};
				var iterateParents = function iterateParents$1(parents$1, child) {
					var parentRef = _this12.hierarchical.parentReference[child];
					if (parentRef !== void 0) for (var i$2 = 0; i$2 < parentRef.length; i$2++) {
						var parent$21 = parentRef[i$2];
						parents$1[parent$21] = true;
						iterateParents$1(parents$1, parent$21);
					}
				};
				var findParent = function findParent$1(parents$1, child) {
					var parentRef = _this12.hierarchical.parentReference[child];
					if (parentRef !== void 0) for (var i$2 = 0; i$2 < parentRef.length; i$2++) {
						var parent$21 = parentRef[i$2];
						if (parents$1[parent$21] !== void 0) return {
							foundParent: parent$21,
							withChild: child
						};
						var branch = findParent$1(parents$1, parent$21);
						if (branch.foundParent !== null) return branch;
					}
					return {
						foundParent: null,
						withChild: child
					};
				};
				iterateParents(parents, childA);
				return findParent(parents, childB);
			}
		},
		{
			key: "setDirectionStrategy",
			value: function setDirectionStrategy() {
				var isVertical = this.options.hierarchical.direction === "UD" || this.options.hierarchical.direction === "DU";
				if (isVertical) this.direction = new VerticalStrategy(this);
				else this.direction = new HorizontalStrategy(this);
			}
		},
		{
			key: "_getCenterPosition",
			value: function _getCenterPosition(childNodes) {
				var minPos = 1e9;
				var maxPos = -1e9;
				for (var i$2 = 0; i$2 < childNodes.length; i$2++) {
					var childNode = void 0;
					if (childNodes[i$2].id !== void 0) childNode = childNodes[i$2];
					else {
						var childNodeId = childNodes[i$2];
						childNode = this.body.nodes[childNodeId];
					}
					var position = this.direction.getPosition(childNode);
					minPos = Math.min(minPos, position);
					maxPos = Math.max(maxPos, position);
				}
				return .5 * (minPos + maxPos);
			}
		}
	]);
	return LayoutEngine$1;
}();
function _createForOfIteratorHelper(o, allowArrayLike) {
	var it$1 = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
	if (!it$1) {
		if (_Array$isArray(o) || (it$1 = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
			if (it$1) o = it$1;
			var i$2 = 0;
			var F = function F$1() {};
			return {
				s: F,
				n: function n() {
					if (i$2 >= o.length) return { done: true };
					return {
						done: false,
						value: o[i$2++]
					};
				},
				e: function e(_e) {
					throw _e;
				},
				f: F
			};
		}
		throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
	}
	var normalCompletion = true, didErr = false, err;
	return {
		s: function s() {
			it$1 = it$1.call(o);
		},
		n: function n() {
			var step = it$1.next();
			normalCompletion = step.done;
			return step;
		},
		e: function e(_e2) {
			didErr = true;
			err = _e2;
		},
		f: function f() {
			try {
				if (!normalCompletion && it$1.return != null) it$1.return();
			} finally {
				if (didErr) throw err;
			}
		}
	};
}
function _unsupportedIterableToArray(o, minLen) {
	var _context32;
	if (!o) return;
	if (typeof o === "string") return _arrayLikeToArray(o, minLen);
	var n = _sliceInstanceProperty(_context32 = Object.prototype.toString.call(o)).call(_context32, 8, -1);
	if (n === "Object" && o.constructor) n = o.constructor.name;
	if (n === "Map" || n === "Set") return _Array$from$1(o);
	if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
	if (len == null || len > arr.length) len = arr.length;
	for (var i$2 = 0, arr2 = new Array(len); i$2 < len; i$2++) arr2[i$2] = arr[i$2];
	return arr2;
}
/**
* Clears the toolbar div element of children
*
* @private
*/
var ManipulationSystem = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {Canvas} canvas
	* @param {SelectionHandler} selectionHandler
	* @param {InteractionHandler} interactionHandler
	*/
	function ManipulationSystem$1(body, canvas, selectionHandler, interactionHandler) {
		var _this = this, _context, _context2;
		_classCallCheck(this, ManipulationSystem$1);
		this.body = body;
		this.canvas = canvas;
		this.selectionHandler = selectionHandler;
		this.interactionHandler = interactionHandler;
		this.editMode = false;
		this.manipulationDiv = void 0;
		this.editModeDiv = void 0;
		this.closeDiv = void 0;
		this._domEventListenerCleanupQueue = [];
		this.temporaryUIFunctions = {};
		this.temporaryEventFunctions = [];
		this.touchTime = 0;
		this.temporaryIds = {
			nodes: [],
			edges: []
		};
		this.guiEnabled = false;
		this.inMode = false;
		this.selectedControlNode = void 0;
		this.options = {};
		this.defaultOptions = {
			enabled: false,
			initiallyActive: false,
			addNode: true,
			addEdge: true,
			editNode: void 0,
			editEdge: true,
			deleteNode: true,
			deleteEdge: true,
			controlNodeStyle: {
				shape: "dot",
				size: 6,
				color: {
					background: "#ff0000",
					border: "#3c3c3c",
					highlight: {
						background: "#07f968",
						border: "#3c3c3c"
					}
				},
				borderWidth: 2,
				borderWidthSelected: 2
			}
		};
		_Object$assign(this.options, this.defaultOptions);
		this.body.emitter.on("destroy", function() {
			_this._clean();
		});
		this.body.emitter.on("_dataChanged", _bindInstanceProperty$1(_context = this._restore).call(_context, this));
		this.body.emitter.on("_resetData", _bindInstanceProperty$1(_context2 = this._restore).call(_context2, this));
	}
	/**
	* If something changes in the data during editing, switch back to the initial datamanipulation state and close all edit modes.
	*
	* @private
	*/
	_createClass(ManipulationSystem$1, [
		{
			key: "_restore",
			value: function _restore() {
				if (this.inMode !== false) if (this.options.initiallyActive === true) this.enableEditMode();
				else this.disableEditMode();
			}
		},
		{
			key: "setOptions",
			value: function setOptions(options, allOptions$2, globalOptions) {
				if (allOptions$2 !== void 0) {
					if (allOptions$2.locale !== void 0) this.options.locale = allOptions$2.locale;
					else this.options.locale = globalOptions.locale;
					if (allOptions$2.locales !== void 0) this.options.locales = allOptions$2.locales;
					else this.options.locales = globalOptions.locales;
				}
				if (options !== void 0) {
					if (typeof options === "boolean") this.options.enabled = options;
					else {
						this.options.enabled = true;
						deepExtend(this.options, options);
					}
					if (this.options.initiallyActive === true) this.editMode = true;
					this._setup();
				}
			}
		},
		{
			key: "toggleEditMode",
			value: function toggleEditMode() {
				if (this.editMode === true) this.disableEditMode();
				else this.enableEditMode();
			}
		},
		{
			key: "enableEditMode",
			value: function enableEditMode() {
				this.editMode = true;
				this._clean();
				if (this.guiEnabled === true) {
					this.manipulationDiv.style.display = "block";
					this.closeDiv.style.display = "block";
					this.editModeDiv.style.display = "none";
					this.showManipulatorToolbar();
				}
			}
		},
		{
			key: "disableEditMode",
			value: function disableEditMode() {
				this.editMode = false;
				this._clean();
				if (this.guiEnabled === true) {
					this.manipulationDiv.style.display = "none";
					this.closeDiv.style.display = "none";
					this.editModeDiv.style.display = "block";
					this._createEditButton();
				}
			}
		},
		{
			key: "showManipulatorToolbar",
			value: function showManipulatorToolbar() {
				this._clean();
				this.manipulationDOM = {};
				if (this.guiEnabled === true) {
					var _context3, _context4;
					this.editMode = true;
					this.manipulationDiv.style.display = "block";
					this.closeDiv.style.display = "block";
					var selectedNodeCount = this.selectionHandler.getSelectedNodeCount();
					var selectedEdgeCount = this.selectionHandler.getSelectedEdgeCount();
					var selectedTotalCount = selectedNodeCount + selectedEdgeCount;
					var locale = this.options.locales[this.options.locale];
					var needSeperator = false;
					if (this.options.addNode !== false) {
						this._createAddNodeButton(locale);
						needSeperator = true;
					}
					if (this.options.addEdge !== false) {
						if (needSeperator === true) this._createSeperator(1);
						else needSeperator = true;
						this._createAddEdgeButton(locale);
					}
					if (selectedNodeCount === 1 && typeof this.options.editNode === "function") {
						if (needSeperator === true) this._createSeperator(2);
						else needSeperator = true;
						this._createEditNodeButton(locale);
					} else if (selectedEdgeCount === 1 && selectedNodeCount === 0 && this.options.editEdge !== false) {
						if (needSeperator === true) this._createSeperator(3);
						else needSeperator = true;
						this._createEditEdgeButton(locale);
					}
					if (selectedTotalCount !== 0) {
						if (selectedNodeCount > 0 && this.options.deleteNode !== false) {
							if (needSeperator === true) this._createSeperator(4);
							this._createDeleteButton(locale);
						} else if (selectedNodeCount === 0 && this.options.deleteEdge !== false) {
							if (needSeperator === true) this._createSeperator(4);
							this._createDeleteButton(locale);
						}
					}
					this._bindElementEvents(this.closeDiv, _bindInstanceProperty$1(_context3 = this.toggleEditMode).call(_context3, this));
					this._temporaryBindEvent("select", _bindInstanceProperty$1(_context4 = this.showManipulatorToolbar).call(_context4, this));
				}
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "addNodeMode",
			value: function addNodeMode() {
				var _context6;
				if (this.editMode !== true) this.enableEditMode();
				this._clean();
				this.inMode = "addNode";
				if (this.guiEnabled === true) {
					var _context5;
					var locale = this.options.locales[this.options.locale];
					this.manipulationDOM = {};
					this._createBackButton(locale);
					this._createSeperator();
					this._createDescription(locale["addDescription"] || this.options.locales["en"]["addDescription"]);
					this._bindElementEvents(this.closeDiv, _bindInstanceProperty$1(_context5 = this.toggleEditMode).call(_context5, this));
				}
				this._temporaryBindEvent("click", _bindInstanceProperty$1(_context6 = this._performAddNode).call(_context6, this));
			}
		},
		{
			key: "editNode",
			value: function editNode() {
				var _this2 = this;
				if (this.editMode !== true) this.enableEditMode();
				this._clean();
				var node$1 = this.selectionHandler.getSelectedNodes()[0];
				if (node$1 !== void 0) {
					this.inMode = "editNode";
					if (typeof this.options.editNode === "function") if (node$1.isCluster !== true) {
						var data$2 = deepExtend({}, node$1.options, false);
						data$2.x = node$1.x;
						data$2.y = node$1.y;
						if (this.options.editNode.length === 2) this.options.editNode(data$2, function(finalizedData) {
							if (finalizedData !== null && finalizedData !== void 0 && _this2.inMode === "editNode") _this2.body.data.nodes.getDataSet().update(finalizedData);
							_this2.showManipulatorToolbar();
						});
						else throw new Error("The function for edit does not support two arguments (data, callback)");
					} else alert(this.options.locales[this.options.locale]["editClusterError"] || this.options.locales["en"]["editClusterError"]);
					else throw new Error("No function has been configured to handle the editing of nodes.");
				} else this.showManipulatorToolbar();
			}
		},
		{
			key: "addEdgeMode",
			value: function addEdgeMode() {
				var _context8, _context9, _context10, _context11, _context12;
				if (this.editMode !== true) this.enableEditMode();
				this._clean();
				this.inMode = "addEdge";
				if (this.guiEnabled === true) {
					var _context7;
					var locale = this.options.locales[this.options.locale];
					this.manipulationDOM = {};
					this._createBackButton(locale);
					this._createSeperator();
					this._createDescription(locale["edgeDescription"] || this.options.locales["en"]["edgeDescription"]);
					this._bindElementEvents(this.closeDiv, _bindInstanceProperty$1(_context7 = this.toggleEditMode).call(_context7, this));
				}
				this._temporaryBindUI("onTouch", _bindInstanceProperty$1(_context8 = this._handleConnect).call(_context8, this));
				this._temporaryBindUI("onDragEnd", _bindInstanceProperty$1(_context9 = this._finishConnect).call(_context9, this));
				this._temporaryBindUI("onDrag", _bindInstanceProperty$1(_context10 = this._dragControlNode).call(_context10, this));
				this._temporaryBindUI("onRelease", _bindInstanceProperty$1(_context11 = this._finishConnect).call(_context11, this));
				this._temporaryBindUI("onDragStart", _bindInstanceProperty$1(_context12 = this._dragStartEdge).call(_context12, this));
				this._temporaryBindUI("onHold", function() {});
			}
		},
		{
			key: "editEdgeMode",
			value: function editEdgeMode() {
				if (this.editMode !== true) this.enableEditMode();
				this._clean();
				this.inMode = "editEdge";
				if (_typeof(this.options.editEdge) === "object" && typeof this.options.editEdge.editWithoutDrag === "function") {
					this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0];
					if (this.edgeBeingEditedId !== void 0) {
						var edge = this.body.edges[this.edgeBeingEditedId];
						this._performEditEdge(edge.from.id, edge.to.id);
						return;
					}
				}
				if (this.guiEnabled === true) {
					var _context13;
					var locale = this.options.locales[this.options.locale];
					this.manipulationDOM = {};
					this._createBackButton(locale);
					this._createSeperator();
					this._createDescription(locale["editEdgeDescription"] || this.options.locales["en"]["editEdgeDescription"]);
					this._bindElementEvents(this.closeDiv, _bindInstanceProperty$1(_context13 = this.toggleEditMode).call(_context13, this));
				}
				this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0];
				if (this.edgeBeingEditedId !== void 0) {
					var _context14, _context15, _context16, _context17;
					var _edge = this.body.edges[this.edgeBeingEditedId];
					var controlNodeFrom = this._getNewTargetNode(_edge.from.x, _edge.from.y);
					var controlNodeTo = this._getNewTargetNode(_edge.to.x, _edge.to.y);
					this.temporaryIds.nodes.push(controlNodeFrom.id);
					this.temporaryIds.nodes.push(controlNodeTo.id);
					this.body.nodes[controlNodeFrom.id] = controlNodeFrom;
					this.body.nodeIndices.push(controlNodeFrom.id);
					this.body.nodes[controlNodeTo.id] = controlNodeTo;
					this.body.nodeIndices.push(controlNodeTo.id);
					this._temporaryBindUI("onTouch", _bindInstanceProperty$1(_context14 = this._controlNodeTouch).call(_context14, this));
					this._temporaryBindUI("onTap", function() {});
					this._temporaryBindUI("onHold", function() {});
					this._temporaryBindUI("onDragStart", _bindInstanceProperty$1(_context15 = this._controlNodeDragStart).call(_context15, this));
					this._temporaryBindUI("onDrag", _bindInstanceProperty$1(_context16 = this._controlNodeDrag).call(_context16, this));
					this._temporaryBindUI("onDragEnd", _bindInstanceProperty$1(_context17 = this._controlNodeDragEnd).call(_context17, this));
					this._temporaryBindUI("onMouseMove", function() {});
					this._temporaryBindEvent("beforeDrawing", function(ctx) {
						var positions = _edge.edgeType.findBorderPositions(ctx);
						if (controlNodeFrom.selected === false) {
							controlNodeFrom.x = positions.from.x;
							controlNodeFrom.y = positions.from.y;
						}
						if (controlNodeTo.selected === false) {
							controlNodeTo.x = positions.to.x;
							controlNodeTo.y = positions.to.y;
						}
					});
					this.body.emitter.emit("_redraw");
				} else this.showManipulatorToolbar();
			}
		},
		{
			key: "deleteSelected",
			value: function deleteSelected() {
				var _this3 = this;
				if (this.editMode !== true) this.enableEditMode();
				this._clean();
				this.inMode = "delete";
				var selectedNodes = this.selectionHandler.getSelectedNodeIds();
				var selectedEdges = this.selectionHandler.getSelectedEdgeIds();
				var deleteFunction = void 0;
				if (selectedNodes.length > 0) {
					for (var i$2 = 0; i$2 < selectedNodes.length; i$2++) if (this.body.nodes[selectedNodes[i$2]].isCluster === true) {
						alert(this.options.locales[this.options.locale]["deleteClusterError"] || this.options.locales["en"]["deleteClusterError"]);
						return;
					}
					if (typeof this.options.deleteNode === "function") deleteFunction = this.options.deleteNode;
				} else if (selectedEdges.length > 0) {
					if (typeof this.options.deleteEdge === "function") deleteFunction = this.options.deleteEdge;
				}
				if (typeof deleteFunction === "function") {
					var data$2 = {
						nodes: selectedNodes,
						edges: selectedEdges
					};
					if (deleteFunction.length === 2) deleteFunction(data$2, function(finalizedData) {
						if (finalizedData !== null && finalizedData !== void 0 && _this3.inMode === "delete") {
							_this3.body.data.edges.getDataSet().remove(finalizedData.edges);
							_this3.body.data.nodes.getDataSet().remove(finalizedData.nodes);
							_this3.body.emitter.emit("startSimulation");
							_this3.showManipulatorToolbar();
						} else {
							_this3.body.emitter.emit("startSimulation");
							_this3.showManipulatorToolbar();
						}
					});
					else throw new Error("The function for delete does not support two arguments (data, callback)");
				} else {
					this.body.data.edges.getDataSet().remove(selectedEdges);
					this.body.data.nodes.getDataSet().remove(selectedNodes);
					this.body.emitter.emit("startSimulation");
					this.showManipulatorToolbar();
				}
			}
		},
		{
			key: "_setup",
			value: function _setup() {
				if (this.options.enabled === true) {
					this.guiEnabled = true;
					this._createWrappers();
					if (this.editMode === false) this._createEditButton();
					else this.showManipulatorToolbar();
				} else {
					this._removeManipulationDOM();
					this.guiEnabled = false;
				}
			}
		},
		{
			key: "_createWrappers",
			value: function _createWrappers() {
				if (this.manipulationDiv === void 0) {
					this.manipulationDiv = document.createElement("div");
					this.manipulationDiv.className = "vis-manipulation";
					if (this.editMode === true) this.manipulationDiv.style.display = "block";
					else this.manipulationDiv.style.display = "none";
					this.canvas.frame.appendChild(this.manipulationDiv);
				}
				if (this.editModeDiv === void 0) {
					this.editModeDiv = document.createElement("div");
					this.editModeDiv.className = "vis-edit-mode";
					if (this.editMode === true) this.editModeDiv.style.display = "none";
					else this.editModeDiv.style.display = "block";
					this.canvas.frame.appendChild(this.editModeDiv);
				}
				if (this.closeDiv === void 0) {
					var _this$options$locales, _this$options$locales2;
					this.closeDiv = document.createElement("button");
					this.closeDiv.className = "vis-close";
					this.closeDiv.setAttribute("aria-label", (_this$options$locales = (_this$options$locales2 = this.options.locales[this.options.locale]) === null || _this$options$locales2 === void 0 ? void 0 : _this$options$locales2["close"]) !== null && _this$options$locales !== void 0 ? _this$options$locales : this.options.locales["en"]["close"]);
					this.closeDiv.style.display = this.manipulationDiv.style.display;
					this.canvas.frame.appendChild(this.closeDiv);
				}
			}
		},
		{
			key: "_getNewTargetNode",
			value: function _getNewTargetNode(x, y) {
				var controlNodeStyle = deepExtend({}, this.options.controlNodeStyle);
				controlNodeStyle.id = "targetNode" + v4();
				controlNodeStyle.hidden = false;
				controlNodeStyle.physics = false;
				controlNodeStyle.x = x;
				controlNodeStyle.y = y;
				var node$1 = this.body.functions.createNode(controlNodeStyle);
				node$1.shape.boundingBox = {
					left: x,
					right: x,
					top: y,
					bottom: y
				};
				return node$1;
			}
		},
		{
			key: "_createEditButton",
			value: function _createEditButton() {
				var _context18;
				this._clean();
				this.manipulationDOM = {};
				recursiveDOMDelete(this.editModeDiv);
				var locale = this.options.locales[this.options.locale];
				var button = this._createButton("editMode", "vis-edit vis-edit-mode", locale["edit"] || this.options.locales["en"]["edit"]);
				this.editModeDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context18 = this.toggleEditMode).call(_context18, this));
			}
		},
		{
			key: "_clean",
			value: function _clean() {
				this.inMode = false;
				if (this.guiEnabled === true) {
					recursiveDOMDelete(this.editModeDiv);
					recursiveDOMDelete(this.manipulationDiv);
					this._cleanupDOMEventListeners();
				}
				this._cleanupTemporaryNodesAndEdges();
				this._unbindTemporaryUIs();
				this._unbindTemporaryEvents();
				this.body.emitter.emit("restorePhysics");
			}
		},
		{
			key: "_cleanupDOMEventListeners",
			value: function _cleanupDOMEventListeners() {
				var _context19;
				var _iterator = _createForOfIteratorHelper(_spliceInstanceProperty(_context19 = this._domEventListenerCleanupQueue).call(_context19, 0)), _step;
				try {
					for (_iterator.s(); !(_step = _iterator.n()).done;) {
						var callback = _step.value;
						callback();
					}
				} catch (err) {
					_iterator.e(err);
				} finally {
					_iterator.f();
				}
			}
		},
		{
			key: "_removeManipulationDOM",
			value: function _removeManipulationDOM() {
				this._clean();
				recursiveDOMDelete(this.manipulationDiv);
				recursiveDOMDelete(this.editModeDiv);
				recursiveDOMDelete(this.closeDiv);
				if (this.manipulationDiv) this.canvas.frame.removeChild(this.manipulationDiv);
				if (this.editModeDiv) this.canvas.frame.removeChild(this.editModeDiv);
				if (this.closeDiv) this.canvas.frame.removeChild(this.closeDiv);
				this.manipulationDiv = void 0;
				this.editModeDiv = void 0;
				this.closeDiv = void 0;
			}
		},
		{
			key: "_createSeperator",
			value: function _createSeperator() {
				var index$1 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 1;
				this.manipulationDOM["seperatorLineDiv" + index$1] = document.createElement("div");
				this.manipulationDOM["seperatorLineDiv" + index$1].className = "vis-separator-line";
				this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv" + index$1]);
			}
		},
		{
			key: "_createAddNodeButton",
			value: function _createAddNodeButton(locale) {
				var _context20;
				var button = this._createButton("addNode", "vis-add", locale["addNode"] || this.options.locales["en"]["addNode"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context20 = this.addNodeMode).call(_context20, this));
			}
		},
		{
			key: "_createAddEdgeButton",
			value: function _createAddEdgeButton(locale) {
				var _context21;
				var button = this._createButton("addEdge", "vis-connect", locale["addEdge"] || this.options.locales["en"]["addEdge"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context21 = this.addEdgeMode).call(_context21, this));
			}
		},
		{
			key: "_createEditNodeButton",
			value: function _createEditNodeButton(locale) {
				var _context22;
				var button = this._createButton("editNode", "vis-edit", locale["editNode"] || this.options.locales["en"]["editNode"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context22 = this.editNode).call(_context22, this));
			}
		},
		{
			key: "_createEditEdgeButton",
			value: function _createEditEdgeButton(locale) {
				var _context23;
				var button = this._createButton("editEdge", "vis-edit", locale["editEdge"] || this.options.locales["en"]["editEdge"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context23 = this.editEdgeMode).call(_context23, this));
			}
		},
		{
			key: "_createDeleteButton",
			value: function _createDeleteButton(locale) {
				var _context24;
				var deleteBtnClass;
				if (this.options.rtl) deleteBtnClass = "vis-delete-rtl";
				else deleteBtnClass = "vis-delete";
				var button = this._createButton("delete", deleteBtnClass, locale["del"] || this.options.locales["en"]["del"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context24 = this.deleteSelected).call(_context24, this));
			}
		},
		{
			key: "_createBackButton",
			value: function _createBackButton(locale) {
				var _context25;
				var button = this._createButton("back", "vis-back", locale["back"] || this.options.locales["en"]["back"]);
				this.manipulationDiv.appendChild(button);
				this._bindElementEvents(button, _bindInstanceProperty$1(_context25 = this.showManipulatorToolbar).call(_context25, this));
			}
		},
		{
			key: "_createButton",
			value: function _createButton(id$4, className, label) {
				var labelClassName = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "vis-label";
				this.manipulationDOM[id$4 + "Div"] = document.createElement("button");
				this.manipulationDOM[id$4 + "Div"].className = "vis-button " + className;
				this.manipulationDOM[id$4 + "Label"] = document.createElement("div");
				this.manipulationDOM[id$4 + "Label"].className = labelClassName;
				this.manipulationDOM[id$4 + "Label"].innerText = label;
				this.manipulationDOM[id$4 + "Div"].appendChild(this.manipulationDOM[id$4 + "Label"]);
				return this.manipulationDOM[id$4 + "Div"];
			}
		},
		{
			key: "_createDescription",
			value: function _createDescription(label) {
				this.manipulationDOM["descriptionLabel"] = document.createElement("div");
				this.manipulationDOM["descriptionLabel"].className = "vis-none";
				this.manipulationDOM["descriptionLabel"].innerText = label;
				this.manipulationDiv.appendChild(this.manipulationDOM["descriptionLabel"]);
			}
		},
		{
			key: "_temporaryBindEvent",
			value: function _temporaryBindEvent(event, newFunction) {
				this.temporaryEventFunctions.push({
					event,
					boundFunction: newFunction
				});
				this.body.emitter.on(event, newFunction);
			}
		},
		{
			key: "_temporaryBindUI",
			value: function _temporaryBindUI(UIfunctionName, newFunction) {
				if (this.body.eventListeners[UIfunctionName] !== void 0) {
					this.temporaryUIFunctions[UIfunctionName] = this.body.eventListeners[UIfunctionName];
					this.body.eventListeners[UIfunctionName] = newFunction;
				} else throw new Error("This UI function does not exist. Typo? You tried: " + UIfunctionName + " possible are: " + _JSON$stringify(_Object$keys(this.body.eventListeners)));
			}
		},
		{
			key: "_unbindTemporaryUIs",
			value: function _unbindTemporaryUIs() {
				for (var functionName$2 in this.temporaryUIFunctions) if (Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions, functionName$2)) {
					this.body.eventListeners[functionName$2] = this.temporaryUIFunctions[functionName$2];
					delete this.temporaryUIFunctions[functionName$2];
				}
				this.temporaryUIFunctions = {};
			}
		},
		{
			key: "_unbindTemporaryEvents",
			value: function _unbindTemporaryEvents() {
				for (var i$2 = 0; i$2 < this.temporaryEventFunctions.length; i$2++) {
					var eventName = this.temporaryEventFunctions[i$2].event;
					var boundFunction = this.temporaryEventFunctions[i$2].boundFunction;
					this.body.emitter.off(eventName, boundFunction);
				}
				this.temporaryEventFunctions = [];
			}
		},
		{
			key: "_bindElementEvents",
			value: function _bindElementEvents(domElement, boundFunction) {
				var hammer = new Hammer(domElement, {});
				onTouch(hammer, boundFunction);
				this._domEventListenerCleanupQueue.push(function() {
					hammer.destroy();
				});
				var keyupListener = function keyupListener$1(_ref) {
					var keyCode = _ref.keyCode, key = _ref.key;
					if (key === "Enter" || key === " " || keyCode === 13 || keyCode === 32) boundFunction();
				};
				domElement.addEventListener("keyup", keyupListener, false);
				this._domEventListenerCleanupQueue.push(function() {
					domElement.removeEventListener("keyup", keyupListener, false);
				});
			}
		},
		{
			key: "_cleanupTemporaryNodesAndEdges",
			value: function _cleanupTemporaryNodesAndEdges() {
				for (var i$2 = 0; i$2 < this.temporaryIds.edges.length; i$2++) {
					var _context26;
					this.body.edges[this.temporaryIds.edges[i$2]].disconnect();
					delete this.body.edges[this.temporaryIds.edges[i$2]];
					var indexTempEdge = _indexOfInstanceProperty(_context26 = this.body.edgeIndices).call(_context26, this.temporaryIds.edges[i$2]);
					if (indexTempEdge !== -1) {
						var _context27;
						_spliceInstanceProperty(_context27 = this.body.edgeIndices).call(_context27, indexTempEdge, 1);
					}
				}
				for (var _i = 0; _i < this.temporaryIds.nodes.length; _i++) {
					var _context28;
					delete this.body.nodes[this.temporaryIds.nodes[_i]];
					var indexTempNode = _indexOfInstanceProperty(_context28 = this.body.nodeIndices).call(_context28, this.temporaryIds.nodes[_i]);
					if (indexTempNode !== -1) {
						var _context29;
						_spliceInstanceProperty(_context29 = this.body.nodeIndices).call(_context29, indexTempNode, 1);
					}
				}
				this.temporaryIds = {
					nodes: [],
					edges: []
				};
			}
		},
		{
			key: "_controlNodeTouch",
			value: function _controlNodeTouch(event) {
				this.selectionHandler.unselectAll();
				this.lastTouch = this.body.functions.getPointer(event.center);
				this.lastTouch.translation = _Object$assign({}, this.body.view.translation);
			}
		},
		{
			key: "_controlNodeDragStart",
			value: function _controlNodeDragStart() {
				var pointer = this.lastTouch;
				var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
				var from$9 = this.body.nodes[this.temporaryIds.nodes[0]];
				var to = this.body.nodes[this.temporaryIds.nodes[1]];
				var edge = this.body.edges[this.edgeBeingEditedId];
				this.selectedControlNode = void 0;
				var fromSelect = from$9.isOverlappingWith(pointerObj);
				var toSelect = to.isOverlappingWith(pointerObj);
				if (fromSelect === true) {
					this.selectedControlNode = from$9;
					edge.edgeType.from = from$9;
				} else if (toSelect === true) {
					this.selectedControlNode = to;
					edge.edgeType.to = to;
				}
				if (this.selectedControlNode !== void 0) this.selectionHandler.selectObject(this.selectedControlNode);
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "_controlNodeDrag",
			value: function _controlNodeDrag(event) {
				this.body.emitter.emit("disablePhysics");
				var pointer = this.body.functions.getPointer(event.center);
				var pos = this.canvas.DOMtoCanvas(pointer);
				if (this.selectedControlNode !== void 0) {
					this.selectedControlNode.x = pos.x;
					this.selectedControlNode.y = pos.y;
				} else this.interactionHandler.onDrag(event);
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "_controlNodeDragEnd",
			value: function _controlNodeDragEnd(event) {
				var pointer = this.body.functions.getPointer(event.center);
				var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
				var edge = this.body.edges[this.edgeBeingEditedId];
				if (this.selectedControlNode === void 0) return;
				this.selectionHandler.unselectAll();
				var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
				var node$1 = void 0;
				for (var i$2 = overlappingNodeIds.length - 1; i$2 >= 0; i$2--) if (overlappingNodeIds[i$2] !== this.selectedControlNode.id) {
					node$1 = this.body.nodes[overlappingNodeIds[i$2]];
					break;
				}
				if (node$1 !== void 0 && this.selectedControlNode !== void 0) if (node$1.isCluster === true) alert(this.options.locales[this.options.locale]["createEdgeError"] || this.options.locales["en"]["createEdgeError"]);
				else {
					var from$9 = this.body.nodes[this.temporaryIds.nodes[0]];
					if (this.selectedControlNode.id === from$9.id) this._performEditEdge(node$1.id, edge.to.id);
					else this._performEditEdge(edge.from.id, node$1.id);
				}
				else {
					edge.updateEdgeType();
					this.body.emitter.emit("restorePhysics");
				}
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "_handleConnect",
			value: function _handleConnect(event) {
				if (new Date().valueOf() - this.touchTime > 100) {
					this.lastTouch = this.body.functions.getPointer(event.center);
					this.lastTouch.translation = _Object$assign({}, this.body.view.translation);
					this.interactionHandler.drag.pointer = this.lastTouch;
					this.interactionHandler.drag.translation = this.lastTouch.translation;
					var pointer = this.lastTouch;
					var node$1 = this.selectionHandler.getNodeAt(pointer);
					if (node$1 !== void 0) if (node$1.isCluster === true) alert(this.options.locales[this.options.locale]["createEdgeError"] || this.options.locales["en"]["createEdgeError"]);
					else {
						var targetNode = this._getNewTargetNode(node$1.x, node$1.y);
						this.body.nodes[targetNode.id] = targetNode;
						this.body.nodeIndices.push(targetNode.id);
						var connectionEdge = this.body.functions.createEdge({
							id: "connectionEdge" + v4(),
							from: node$1.id,
							to: targetNode.id,
							physics: false,
							smooth: {
								enabled: true,
								type: "continuous",
								roundness: .5
							}
						});
						this.body.edges[connectionEdge.id] = connectionEdge;
						this.body.edgeIndices.push(connectionEdge.id);
						this.temporaryIds.nodes.push(targetNode.id);
						this.temporaryIds.edges.push(connectionEdge.id);
					}
					this.touchTime = new Date().valueOf();
				}
			}
		},
		{
			key: "_dragControlNode",
			value: function _dragControlNode(event) {
				var pointer = this.body.functions.getPointer(event.center);
				var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
				var connectFromId = void 0;
				if (this.temporaryIds.edges[0] !== void 0) connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;
				var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
				var node$1 = void 0;
				for (var i$2 = overlappingNodeIds.length - 1; i$2 >= 0; i$2--) {
					var _context30;
					if (_indexOfInstanceProperty(_context30 = this.temporaryIds.nodes).call(_context30, overlappingNodeIds[i$2]) === -1) {
						node$1 = this.body.nodes[overlappingNodeIds[i$2]];
						break;
					}
				}
				event.controlEdge = {
					from: connectFromId,
					to: node$1 ? node$1.id : void 0
				};
				this.selectionHandler.generateClickEvent("controlNodeDragging", event, pointer);
				if (this.temporaryIds.nodes[0] !== void 0) {
					var targetNode = this.body.nodes[this.temporaryIds.nodes[0]];
					targetNode.x = this.canvas._XconvertDOMtoCanvas(pointer.x);
					targetNode.y = this.canvas._YconvertDOMtoCanvas(pointer.y);
					this.body.emitter.emit("_redraw");
				} else this.interactionHandler.onDrag(event);
			}
		},
		{
			key: "_finishConnect",
			value: function _finishConnect(event) {
				var pointer = this.body.functions.getPointer(event.center);
				var pointerObj = this.selectionHandler._pointerToPositionObject(pointer);
				var connectFromId = void 0;
				if (this.temporaryIds.edges[0] !== void 0) connectFromId = this.body.edges[this.temporaryIds.edges[0]].fromId;
				var overlappingNodeIds = this.selectionHandler._getAllNodesOverlappingWith(pointerObj);
				var node$1 = void 0;
				for (var i$2 = overlappingNodeIds.length - 1; i$2 >= 0; i$2--) {
					var _context31;
					if (_indexOfInstanceProperty(_context31 = this.temporaryIds.nodes).call(_context31, overlappingNodeIds[i$2]) === -1) {
						node$1 = this.body.nodes[overlappingNodeIds[i$2]];
						break;
					}
				}
				this._cleanupTemporaryNodesAndEdges();
				if (node$1 !== void 0) {
					if (node$1.isCluster === true) alert(this.options.locales[this.options.locale]["createEdgeError"] || this.options.locales["en"]["createEdgeError"]);
					else if (this.body.nodes[connectFromId] !== void 0 && this.body.nodes[node$1.id] !== void 0) this._performAddEdge(connectFromId, node$1.id);
				}
				event.controlEdge = {
					from: connectFromId,
					to: node$1 ? node$1.id : void 0
				};
				this.selectionHandler.generateClickEvent("controlNodeDragEnd", event, pointer);
				this.body.emitter.emit("_redraw");
			}
		},
		{
			key: "_dragStartEdge",
			value: function _dragStartEdge(event) {
				var pointer = this.lastTouch;
				this.selectionHandler.generateClickEvent("dragStart", event, pointer, void 0, true);
			}
		},
		{
			key: "_performAddNode",
			value: function _performAddNode(clickData) {
				var _this4 = this;
				var defaultData = {
					id: v4(),
					x: clickData.pointer.canvas.x,
					y: clickData.pointer.canvas.y,
					label: "new"
				};
				if (typeof this.options.addNode === "function") if (this.options.addNode.length === 2) this.options.addNode(defaultData, function(finalizedData) {
					if (finalizedData !== null && finalizedData !== void 0 && _this4.inMode === "addNode") _this4.body.data.nodes.getDataSet().add(finalizedData);
					_this4.showManipulatorToolbar();
				});
				else {
					this.showManipulatorToolbar();
					throw new Error("The function for add does not support two arguments (data,callback)");
				}
				else {
					this.body.data.nodes.getDataSet().add(defaultData);
					this.showManipulatorToolbar();
				}
			}
		},
		{
			key: "_performAddEdge",
			value: function _performAddEdge(sourceNodeId, targetNodeId) {
				var _this5 = this;
				var defaultData = {
					from: sourceNodeId,
					to: targetNodeId
				};
				if (typeof this.options.addEdge === "function") if (this.options.addEdge.length === 2) this.options.addEdge(defaultData, function(finalizedData) {
					if (finalizedData !== null && finalizedData !== void 0 && _this5.inMode === "addEdge") {
						_this5.body.data.edges.getDataSet().add(finalizedData);
						_this5.selectionHandler.unselectAll();
						_this5.showManipulatorToolbar();
					}
				});
				else throw new Error("The function for connect does not support two arguments (data,callback)");
				else {
					this.body.data.edges.getDataSet().add(defaultData);
					this.selectionHandler.unselectAll();
					this.showManipulatorToolbar();
				}
			}
		},
		{
			key: "_performEditEdge",
			value: function _performEditEdge(sourceNodeId, targetNodeId) {
				var _this6 = this;
				var defaultData = {
					id: this.edgeBeingEditedId,
					from: sourceNodeId,
					to: targetNodeId,
					label: this.body.data.edges.get(this.edgeBeingEditedId).label
				};
				var eeFunct = this.options.editEdge;
				if (_typeof(eeFunct) === "object") eeFunct = eeFunct.editWithoutDrag;
				if (typeof eeFunct === "function") if (eeFunct.length === 2) eeFunct(defaultData, function(finalizedData) {
					if (finalizedData === null || finalizedData === void 0 || _this6.inMode !== "editEdge") {
						_this6.body.edges[defaultData.id].updateEdgeType();
						_this6.body.emitter.emit("_redraw");
						_this6.showManipulatorToolbar();
					} else {
						_this6.body.data.edges.getDataSet().update(finalizedData);
						_this6.selectionHandler.unselectAll();
						_this6.showManipulatorToolbar();
					}
				});
				else throw new Error("The function for edit does not support two arguments (data, callback)");
				else {
					this.body.data.edges.getDataSet().update(defaultData);
					this.selectionHandler.unselectAll();
					this.showManipulatorToolbar();
				}
			}
		}
	]);
	return ManipulationSystem$1;
}();
/**

* This object contains all possible options. It will check if the types are correct, if required if the option is one

* of the allowed values.

*

* __any__ means that the name of the property does not matter.

* __type__ is a required field for all objects and contains the allowed types of all objects

*/
var string = "string";
var bool = "boolean";
var number = "number";
var array = "array";
var object = "object";
var dom = "dom";
var any = "any";
var endPoints = [
	"arrow",
	"bar",
	"box",
	"circle",
	"crow",
	"curve",
	"diamond",
	"image",
	"inv_curve",
	"inv_triangle",
	"triangle",
	"vee"
];
var nodeOptions = {
	borderWidth: { number },
	borderWidthSelected: {
		number,
		undefined: "undefined"
	},
	brokenImage: {
		string,
		undefined: "undefined"
	},
	chosen: {
		label: {
			boolean: bool,
			function: "function"
		},
		node: {
			boolean: bool,
			function: "function"
		},
		__type__: {
			object,
			boolean: bool
		}
	},
	color: {
		border: { string },
		background: { string },
		highlight: {
			border: { string },
			background: { string },
			__type__: {
				object,
				string
			}
		},
		hover: {
			border: { string },
			background: { string },
			__type__: {
				object,
				string
			}
		},
		__type__: {
			object,
			string
		}
	},
	opacity: {
		number,
		undefined: "undefined"
	},
	fixed: {
		x: { boolean: bool },
		y: { boolean: bool },
		__type__: {
			object,
			boolean: bool
		}
	},
	font: {
		align: { string },
		color: { string },
		size: { number },
		face: { string },
		background: { string },
		strokeWidth: { number },
		strokeColor: { string },
		vadjust: { number },
		multi: {
			boolean: bool,
			string
		},
		bold: {
			color: { string },
			size: { number },
			face: { string },
			mod: { string },
			vadjust: { number },
			__type__: {
				object,
				string
			}
		},
		boldital: {
			color: { string },
			size: { number },
			face: { string },
			mod: { string },
			vadjust: { number },
			__type__: {
				object,
				string
			}
		},
		ital: {
			color: { string },
			size: { number },
			face: { string },
			mod: { string },
			vadjust: { number },
			__type__: {
				object,
				string
			}
		},
		mono: {
			color: { string },
			size: { number },
			face: { string },
			mod: { string },
			vadjust: { number },
			__type__: {
				object,
				string
			}
		},
		__type__: {
			object,
			string
		}
	},
	group: {
		string,
		number,
		undefined: "undefined"
	},
	heightConstraint: {
		minimum: { number },
		valign: { string },
		__type__: {
			object,
			boolean: bool,
			number
		}
	},
	hidden: { boolean: bool },
	icon: {
		face: { string },
		code: { string },
		size: { number },
		color: { string },
		weight: {
			string,
			number
		},
		__type__: { object }
	},
	id: {
		string,
		number
	},
	image: {
		selected: {
			string,
			undefined: "undefined"
		},
		unselected: {
			string,
			undefined: "undefined"
		},
		__type__: {
			object,
			string
		}
	},
	imagePadding: {
		top: { number },
		right: { number },
		bottom: { number },
		left: { number },
		__type__: {
			object,
			number
		}
	},
	label: {
		string,
		undefined: "undefined"
	},
	labelHighlightBold: { boolean: bool },
	level: {
		number,
		undefined: "undefined"
	},
	margin: {
		top: { number },
		right: { number },
		bottom: { number },
		left: { number },
		__type__: {
			object,
			number
		}
	},
	mass: { number },
	physics: { boolean: bool },
	scaling: {
		min: { number },
		max: { number },
		label: {
			enabled: { boolean: bool },
			min: { number },
			max: { number },
			maxVisible: { number },
			drawThreshold: { number },
			__type__: {
				object,
				boolean: bool
			}
		},
		customScalingFunction: { function: "function" },
		__type__: { object }
	},
	shadow: {
		enabled: { boolean: bool },
		color: { string },
		size: { number },
		x: { number },
		y: { number },
		__type__: {
			object,
			boolean: bool
		}
	},
	shape: { string: [
		"custom",
		"ellipse",
		"circle",
		"database",
		"box",
		"text",
		"image",
		"circularImage",
		"diamond",
		"dot",
		"star",
		"triangle",
		"triangleDown",
		"square",
		"icon",
		"hexagon"
	] },
	ctxRenderer: { function: "function" },
	shapeProperties: {
		borderDashes: {
			boolean: bool,
			array
		},
		borderRadius: { number },
		interpolation: { boolean: bool },
		useImageSize: { boolean: bool },
		useBorderWithImage: { boolean: bool },
		coordinateOrigin: { string: ["center", "top-left"] },
		__type__: { object }
	},
	size: { number },
	title: {
		string,
		dom,
		undefined: "undefined"
	},
	value: {
		number,
		undefined: "undefined"
	},
	widthConstraint: {
		minimum: { number },
		maximum: { number },
		__type__: {
			object,
			boolean: bool,
			number
		}
	},
	x: { number },
	y: { number },
	__type__: { object }
};
var allOptions = {
	configure: {
		enabled: { boolean: bool },
		filter: {
			boolean: bool,
			string,
			array,
			function: "function"
		},
		container: { dom },
		showButton: { boolean: bool },
		__type__: {
			object,
			boolean: bool,
			string,
			array,
			function: "function"
		}
	},
	edges: {
		arrows: {
			to: {
				enabled: { boolean: bool },
				scaleFactor: { number },
				type: { string: endPoints },
				imageHeight: { number },
				imageWidth: { number },
				src: { string },
				__type__: {
					object,
					boolean: bool
				}
			},
			middle: {
				enabled: { boolean: bool },
				scaleFactor: { number },
				type: { string: endPoints },
				imageWidth: { number },
				imageHeight: { number },
				src: { string },
				__type__: {
					object,
					boolean: bool
				}
			},
			from: {
				enabled: { boolean: bool },
				scaleFactor: { number },
				type: { string: endPoints },
				imageWidth: { number },
				imageHeight: { number },
				src: { string },
				__type__: {
					object,
					boolean: bool
				}
			},
			__type__: {
				string: [
					"from",
					"to",
					"middle"
				],
				object
			}
		},
		endPointOffset: {
			from: { number },
			to: { number },
			__type__: {
				object,
				number
			}
		},
		arrowStrikethrough: { boolean: bool },
		background: {
			enabled: { boolean: bool },
			color: { string },
			size: { number },
			dashes: {
				boolean: bool,
				array
			},
			__type__: {
				object,
				boolean: bool
			}
		},
		chosen: {
			label: {
				boolean: bool,
				function: "function"
			},
			edge: {
				boolean: bool,
				function: "function"
			},
			__type__: {
				object,
				boolean: bool
			}
		},
		color: {
			color: { string },
			highlight: { string },
			hover: { string },
			inherit: {
				string: [
					"from",
					"to",
					"both"
				],
				boolean: bool
			},
			opacity: { number },
			__type__: {
				object,
				string
			}
		},
		dashes: {
			boolean: bool,
			array
		},
		font: {
			color: { string },
			size: { number },
			face: { string },
			background: { string },
			strokeWidth: { number },
			strokeColor: { string },
			align: { string: [
				"horizontal",
				"top",
				"middle",
				"bottom"
			] },
			vadjust: { number },
			multi: {
				boolean: bool,
				string
			},
			bold: {
				color: { string },
				size: { number },
				face: { string },
				mod: { string },
				vadjust: { number },
				__type__: {
					object,
					string
				}
			},
			boldital: {
				color: { string },
				size: { number },
				face: { string },
				mod: { string },
				vadjust: { number },
				__type__: {
					object,
					string
				}
			},
			ital: {
				color: { string },
				size: { number },
				face: { string },
				mod: { string },
				vadjust: { number },
				__type__: {
					object,
					string
				}
			},
			mono: {
				color: { string },
				size: { number },
				face: { string },
				mod: { string },
				vadjust: { number },
				__type__: {
					object,
					string
				}
			},
			__type__: {
				object,
				string
			}
		},
		hidden: { boolean: bool },
		hoverWidth: {
			function: "function",
			number
		},
		label: {
			string,
			undefined: "undefined"
		},
		labelHighlightBold: { boolean: bool },
		length: {
			number,
			undefined: "undefined"
		},
		physics: { boolean: bool },
		scaling: {
			min: { number },
			max: { number },
			label: {
				enabled: { boolean: bool },
				min: { number },
				max: { number },
				maxVisible: { number },
				drawThreshold: { number },
				__type__: {
					object,
					boolean: bool
				}
			},
			customScalingFunction: { function: "function" },
			__type__: { object }
		},
		selectionWidth: {
			function: "function",
			number
		},
		selfReferenceSize: { number },
		selfReference: {
			size: { number },
			angle: { number },
			renderBehindTheNode: { boolean: bool },
			__type__: { object }
		},
		shadow: {
			enabled: { boolean: bool },
			color: { string },
			size: { number },
			x: { number },
			y: { number },
			__type__: {
				object,
				boolean: bool
			}
		},
		smooth: {
			enabled: { boolean: bool },
			type: { string: [
				"dynamic",
				"continuous",
				"discrete",
				"diagonalCross",
				"straightCross",
				"horizontal",
				"vertical",
				"curvedCW",
				"curvedCCW",
				"cubicBezier"
			] },
			roundness: { number },
			forceDirection: {
				string: [
					"horizontal",
					"vertical",
					"none"
				],
				boolean: bool
			},
			__type__: {
				object,
				boolean: bool
			}
		},
		title: {
			string,
			undefined: "undefined"
		},
		width: { number },
		widthConstraint: {
			maximum: { number },
			__type__: {
				object,
				boolean: bool,
				number
			}
		},
		value: {
			number,
			undefined: "undefined"
		},
		__type__: { object }
	},
	groups: {
		useDefaultGroups: { boolean: bool },
		__any__: nodeOptions,
		__type__: { object }
	},
	interaction: {
		dragNodes: { boolean: bool },
		dragView: { boolean: bool },
		hideEdgesOnDrag: { boolean: bool },
		hideEdgesOnZoom: { boolean: bool },
		hideNodesOnDrag: { boolean: bool },
		hover: { boolean: bool },
		keyboard: {
			enabled: { boolean: bool },
			speed: {
				x: { number },
				y: { number },
				zoom: { number },
				__type__: { object }
			},
			bindToWindow: { boolean: bool },
			autoFocus: { boolean: bool },
			__type__: {
				object,
				boolean: bool
			}
		},
		multiselect: { boolean: bool },
		navigationButtons: { boolean: bool },
		selectable: { boolean: bool },
		selectConnectedEdges: { boolean: bool },
		hoverConnectedEdges: { boolean: bool },
		tooltipDelay: { number },
		zoomView: { boolean: bool },
		zoomSpeed: { number },
		__type__: { object }
	},
	layout: {
		randomSeed: {
			undefined: "undefined",
			number,
			string
		},
		improvedLayout: { boolean: bool },
		clusterThreshold: { number },
		hierarchical: {
			enabled: { boolean: bool },
			levelSeparation: { number },
			nodeSpacing: { number },
			treeSpacing: { number },
			blockShifting: { boolean: bool },
			edgeMinimization: { boolean: bool },
			parentCentralization: { boolean: bool },
			direction: { string: [
				"UD",
				"DU",
				"LR",
				"RL"
			] },
			sortMethod: { string: ["hubsize", "directed"] },
			shakeTowards: { string: ["leaves", "roots"] },
			__type__: {
				object,
				boolean: bool
			}
		},
		__type__: { object }
	},
	manipulation: {
		enabled: { boolean: bool },
		initiallyActive: { boolean: bool },
		addNode: {
			boolean: bool,
			function: "function"
		},
		addEdge: {
			boolean: bool,
			function: "function"
		},
		editNode: { function: "function" },
		editEdge: {
			editWithoutDrag: { function: "function" },
			__type__: {
				object,
				boolean: bool,
				function: "function"
			}
		},
		deleteNode: {
			boolean: bool,
			function: "function"
		},
		deleteEdge: {
			boolean: bool,
			function: "function"
		},
		controlNodeStyle: nodeOptions,
		__type__: {
			object,
			boolean: bool
		}
	},
	nodes: nodeOptions,
	physics: {
		enabled: { boolean: bool },
		barnesHut: {
			theta: { number },
			gravitationalConstant: { number },
			centralGravity: { number },
			springLength: { number },
			springConstant: { number },
			damping: { number },
			avoidOverlap: { number },
			__type__: { object }
		},
		forceAtlas2Based: {
			theta: { number },
			gravitationalConstant: { number },
			centralGravity: { number },
			springLength: { number },
			springConstant: { number },
			damping: { number },
			avoidOverlap: { number },
			__type__: { object }
		},
		repulsion: {
			centralGravity: { number },
			springLength: { number },
			springConstant: { number },
			nodeDistance: { number },
			damping: { number },
			__type__: { object }
		},
		hierarchicalRepulsion: {
			centralGravity: { number },
			springLength: { number },
			springConstant: { number },
			nodeDistance: { number },
			damping: { number },
			avoidOverlap: { number },
			__type__: { object }
		},
		maxVelocity: { number },
		minVelocity: { number },
		solver: { string: [
			"barnesHut",
			"repulsion",
			"hierarchicalRepulsion",
			"forceAtlas2Based"
		] },
		stabilization: {
			enabled: { boolean: bool },
			iterations: { number },
			updateInterval: { number },
			onlyDynamicEdges: { boolean: bool },
			fit: { boolean: bool },
			__type__: {
				object,
				boolean: bool
			}
		},
		timestep: { number },
		adaptiveTimestep: { boolean: bool },
		wind: {
			x: { number },
			y: { number },
			__type__: { object }
		},
		__type__: {
			object,
			boolean: bool
		}
	},
	autoResize: { boolean: bool },
	clickToUse: { boolean: bool },
	locale: { string },
	locales: {
		__any__: { any },
		__type__: { object }
	},
	height: { string },
	width: { string },
	__type__: { object }
};
/**

* This provides ranges, initial values, steps and dropdown menu choices for the

* configuration.

*

* @remarks

* Checkbox: `boolean`

*   The value supllied will be used as the initial value.

*

* Text field: `string`

*   The passed text will be used as the initial value. Any text will be

*   accepted afterwards.

*

* Number range: `[number, number, number, number]`

*   The meanings are `[initial value, min, max, step]`.

*

* Dropdown: `[Exclude<string, "color">, ...(string | number | boolean)[]]`

*   Translations for people with poor understanding of TypeScript: the first

*   value always has to be a string but never `"color"`, the rest can be any

*   combination of strings, numbers and booleans.

*

* Color picker: `["color", string]`

*   The first value says this will be a color picker not a dropdown menu. The

*   next value is the initial color.

*/
var configureOptions = {
	nodes: {
		borderWidth: [
			1,
			0,
			10,
			1
		],
		borderWidthSelected: [
			2,
			0,
			10,
			1
		],
		color: {
			border: ["color", "#2B7CE9"],
			background: ["color", "#97C2FC"],
			highlight: {
				border: ["color", "#2B7CE9"],
				background: ["color", "#D2E5FF"]
			},
			hover: {
				border: ["color", "#2B7CE9"],
				background: ["color", "#D2E5FF"]
			}
		},
		opacity: [
			0,
			0,
			1,
			.1
		],
		fixed: {
			x: false,
			y: false
		},
		font: {
			color: ["color", "#343434"],
			size: [
				14,
				0,
				100,
				1
			],
			face: [
				"arial",
				"verdana",
				"tahoma"
			],
			background: ["color", "none"],
			strokeWidth: [
				0,
				0,
				50,
				1
			],
			strokeColor: ["color", "#ffffff"]
		},
		hidden: false,
		labelHighlightBold: true,
		physics: true,
		scaling: {
			min: [
				10,
				0,
				200,
				1
			],
			max: [
				30,
				0,
				200,
				1
			],
			label: {
				enabled: false,
				min: [
					14,
					0,
					200,
					1
				],
				max: [
					30,
					0,
					200,
					1
				],
				maxVisible: [
					30,
					0,
					200,
					1
				],
				drawThreshold: [
					5,
					0,
					20,
					1
				]
			}
		},
		shadow: {
			enabled: false,
			color: "rgba(0,0,0,0.5)",
			size: [
				10,
				0,
				20,
				1
			],
			x: [
				5,
				-30,
				30,
				1
			],
			y: [
				5,
				-30,
				30,
				1
			]
		},
		shape: [
			"ellipse",
			"box",
			"circle",
			"database",
			"diamond",
			"dot",
			"square",
			"star",
			"text",
			"triangle",
			"triangleDown",
			"hexagon"
		],
		shapeProperties: {
			borderDashes: false,
			borderRadius: [
				6,
				0,
				20,
				1
			],
			interpolation: true,
			useImageSize: false
		},
		size: [
			25,
			0,
			200,
			1
		]
	},
	edges: {
		arrows: {
			to: {
				enabled: false,
				scaleFactor: [
					1,
					0,
					3,
					.05
				],
				type: "arrow"
			},
			middle: {
				enabled: false,
				scaleFactor: [
					1,
					0,
					3,
					.05
				],
				type: "arrow"
			},
			from: {
				enabled: false,
				scaleFactor: [
					1,
					0,
					3,
					.05
				],
				type: "arrow"
			}
		},
		endPointOffset: {
			from: [
				0,
				-10,
				10,
				1
			],
			to: [
				0,
				-10,
				10,
				1
			]
		},
		arrowStrikethrough: true,
		color: {
			color: ["color", "#848484"],
			highlight: ["color", "#848484"],
			hover: ["color", "#848484"],
			inherit: [
				"from",
				"to",
				"both",
				true,
				false
			],
			opacity: [
				1,
				0,
				1,
				.05
			]
		},
		dashes: false,
		font: {
			color: ["color", "#343434"],
			size: [
				14,
				0,
				100,
				1
			],
			face: [
				"arial",
				"verdana",
				"tahoma"
			],
			background: ["color", "none"],
			strokeWidth: [
				2,
				0,
				50,
				1
			],
			strokeColor: ["color", "#ffffff"],
			align: [
				"horizontal",
				"top",
				"middle",
				"bottom"
			]
		},
		hidden: false,
		hoverWidth: [
			1.5,
			0,
			5,
			.1
		],
		labelHighlightBold: true,
		physics: true,
		scaling: {
			min: [
				1,
				0,
				100,
				1
			],
			max: [
				15,
				0,
				100,
				1
			],
			label: {
				enabled: true,
				min: [
					14,
					0,
					200,
					1
				],
				max: [
					30,
					0,
					200,
					1
				],
				maxVisible: [
					30,
					0,
					200,
					1
				],
				drawThreshold: [
					5,
					0,
					20,
					1
				]
			}
		},
		selectionWidth: [
			1.5,
			0,
			5,
			.1
		],
		selfReferenceSize: [
			20,
			0,
			200,
			1
		],
		selfReference: {
			size: [
				20,
				0,
				200,
				1
			],
			angle: [
				Math.PI / 2,
				-6 * Math.PI,
				6 * Math.PI,
				Math.PI / 8
			],
			renderBehindTheNode: true
		},
		shadow: {
			enabled: false,
			color: "rgba(0,0,0,0.5)",
			size: [
				10,
				0,
				20,
				1
			],
			x: [
				5,
				-30,
				30,
				1
			],
			y: [
				5,
				-30,
				30,
				1
			]
		},
		smooth: {
			enabled: true,
			type: [
				"dynamic",
				"continuous",
				"discrete",
				"diagonalCross",
				"straightCross",
				"horizontal",
				"vertical",
				"curvedCW",
				"curvedCCW",
				"cubicBezier"
			],
			forceDirection: [
				"horizontal",
				"vertical",
				"none"
			],
			roundness: [
				.5,
				0,
				1,
				.05
			]
		},
		width: [
			1,
			0,
			30,
			1
		]
	},
	layout: { hierarchical: {
		enabled: false,
		levelSeparation: [
			150,
			20,
			500,
			5
		],
		nodeSpacing: [
			100,
			20,
			500,
			5
		],
		treeSpacing: [
			200,
			20,
			500,
			5
		],
		blockShifting: true,
		edgeMinimization: true,
		parentCentralization: true,
		direction: [
			"UD",
			"DU",
			"LR",
			"RL"
		],
		sortMethod: ["hubsize", "directed"],
		shakeTowards: ["leaves", "roots"]
	} },
	interaction: {
		dragNodes: true,
		dragView: true,
		hideEdgesOnDrag: false,
		hideEdgesOnZoom: false,
		hideNodesOnDrag: false,
		hover: false,
		keyboard: {
			enabled: false,
			speed: {
				x: [
					10,
					0,
					40,
					1
				],
				y: [
					10,
					0,
					40,
					1
				],
				zoom: [
					.02,
					0,
					.1,
					.005
				]
			},
			bindToWindow: true,
			autoFocus: true
		},
		multiselect: false,
		navigationButtons: false,
		selectable: true,
		selectConnectedEdges: true,
		hoverConnectedEdges: true,
		tooltipDelay: [
			300,
			0,
			1e3,
			25
		],
		zoomView: true,
		zoomSpeed: [
			1,
			.1,
			2,
			.1
		]
	},
	manipulation: {
		enabled: false,
		initiallyActive: false
	},
	physics: {
		enabled: true,
		barnesHut: {
			theta: [
				.5,
				.1,
				1,
				.05
			],
			gravitationalConstant: [
				-2e3,
				-3e4,
				0,
				50
			],
			centralGravity: [
				.3,
				0,
				10,
				.05
			],
			springLength: [
				95,
				0,
				500,
				5
			],
			springConstant: [
				.04,
				0,
				1.2,
				.005
			],
			damping: [
				.09,
				0,
				1,
				.01
			],
			avoidOverlap: [
				0,
				0,
				1,
				.01
			]
		},
		forceAtlas2Based: {
			theta: [
				.5,
				.1,
				1,
				.05
			],
			gravitationalConstant: [
				-50,
				-500,
				0,
				1
			],
			centralGravity: [
				.01,
				0,
				1,
				.005
			],
			springLength: [
				95,
				0,
				500,
				5
			],
			springConstant: [
				.08,
				0,
				1.2,
				.005
			],
			damping: [
				.4,
				0,
				1,
				.01
			],
			avoidOverlap: [
				0,
				0,
				1,
				.01
			]
		},
		repulsion: {
			centralGravity: [
				.2,
				0,
				10,
				.05
			],
			springLength: [
				200,
				0,
				500,
				5
			],
			springConstant: [
				.05,
				0,
				1.2,
				.005
			],
			nodeDistance: [
				100,
				0,
				500,
				5
			],
			damping: [
				.09,
				0,
				1,
				.01
			]
		},
		hierarchicalRepulsion: {
			centralGravity: [
				.2,
				0,
				10,
				.05
			],
			springLength: [
				100,
				0,
				500,
				5
			],
			springConstant: [
				.01,
				0,
				1.2,
				.005
			],
			nodeDistance: [
				120,
				0,
				500,
				5
			],
			damping: [
				.09,
				0,
				1,
				.01
			],
			avoidOverlap: [
				0,
				0,
				1,
				.01
			]
		},
		maxVelocity: [
			50,
			0,
			150,
			1
		],
		minVelocity: [
			.1,
			.01,
			.5,
			.01
		],
		solver: [
			"barnesHut",
			"forceAtlas2Based",
			"repulsion",
			"hierarchicalRepulsion"
		],
		timestep: [
			.5,
			.01,
			1,
			.01
		],
		wind: {
			x: [
				0,
				-10,
				10,
				.1
			],
			y: [
				0,
				-10,
				10,
				.1
			]
		}
	}
};
var configuratorHideOption = function configuratorHideOption$1(parentPath, optionName, options) {
	var _context;
	if (_includesInstanceProperty(parentPath).call(parentPath, "physics") && _includesInstanceProperty(_context = configureOptions.physics.solver).call(_context, optionName) && options.physics.solver !== optionName && optionName !== "wind") return true;
	return false;
};
/**
*  The Floyd–Warshall algorithm is an algorithm for finding shortest paths in
*  a weighted graph with positive or negative edge weights (but with no negative
*  cycles). - https://en.wikipedia.org/wiki/Floyd–Warshall_algorithm
*/
var FloydWarshall = /* @__PURE__ */ function() {
	/**
	* @ignore
	*/
	function FloydWarshall$1() {
		_classCallCheck(this, FloydWarshall$1);
	}
	/**
	*
	* @param {object} body
	* @param {Array.<Node>} nodesArray
	* @param {Array.<Edge>} edgesArray
	* @returns {{}}
	*/
	_createClass(FloydWarshall$1, [{
		key: "getDistances",
		value: function getDistances(body, nodesArray, edgesArray) {
			var D_matrix = {};
			var edges = body.edges;
			for (var i$2 = 0; i$2 < nodesArray.length; i$2++) {
				var node$1 = nodesArray[i$2];
				var cell = {};
				D_matrix[node$1] = cell;
				for (var j = 0; j < nodesArray.length; j++) cell[nodesArray[j]] = i$2 == j ? 0 : 1e9;
			}
			for (var _i = 0; _i < edgesArray.length; _i++) {
				var edge = edges[edgesArray[_i]];
				if (edge.connected === true && D_matrix[edge.fromId] !== void 0 && D_matrix[edge.toId] !== void 0) {
					D_matrix[edge.fromId][edge.toId] = 1;
					D_matrix[edge.toId][edge.fromId] = 1;
				}
			}
			var nodeCount = nodesArray.length;
			for (var k = 0; k < nodeCount; k++) {
				var knode = nodesArray[k];
				var kcolm = D_matrix[knode];
				for (var _i2 = 0; _i2 < nodeCount - 1; _i2++) {
					var inode = nodesArray[_i2];
					var icolm = D_matrix[inode];
					for (var _j = _i2 + 1; _j < nodeCount; _j++) {
						var jnode = nodesArray[_j];
						var jcolm = D_matrix[jnode];
						var val = Math.min(icolm[jnode], icolm[knode] + kcolm[jnode]);
						icolm[jnode] = val;
						jcolm[inode] = val;
					}
				}
			}
			return D_matrix;
		}
	}]);
	return FloydWarshall$1;
}();
/**
* KamadaKawai positions the nodes initially based on
*
* "AN ALGORITHM FOR DRAWING GENERAL UNDIRECTED GRAPHS"
* -- Tomihisa KAMADA and Satoru KAWAI in 1989
*
* Possible optimizations in the distance calculation can be implemented.
*/
var KamadaKawai = /* @__PURE__ */ function() {
	/**
	* @param {object} body
	* @param {number} edgeLength
	* @param {number} edgeStrength
	*/
	function KamadaKawai$1(body, edgeLength, edgeStrength) {
		_classCallCheck(this, KamadaKawai$1);
		this.body = body;
		this.springLength = edgeLength;
		this.springConstant = edgeStrength;
		this.distanceSolver = new FloydWarshall();
	}
	/**
	* Not sure if needed but can be used to update the spring length and spring constant
	*
	* @param {object} options
	*/
	_createClass(KamadaKawai$1, [
		{
			key: "setOptions",
			value: function setOptions(options) {
				if (options) {
					if (options.springLength) this.springLength = options.springLength;
					if (options.springConstant) this.springConstant = options.springConstant;
				}
			}
		},
		{
			key: "solve",
			value: function solve(nodesArray, edgesArray) {
				var ignoreClusters = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
				var D_matrix = this.distanceSolver.getDistances(this.body, nodesArray, edgesArray);
				this._createL_matrix(D_matrix);
				this._createK_matrix(D_matrix);
				this._createE_matrix();
				var threshold = .01;
				var innerThreshold = 1;
				var iterations = 0;
				var maxIterations = Math.max(1e3, Math.min(10 * this.body.nodeIndices.length, 6e3));
				var maxInnerIterations = 5;
				var maxEnergy = 1e9;
				var highE_nodeId = 0, dE_dx = 0, dE_dy = 0, delta_m = 0, subIterations = 0;
				while (maxEnergy > threshold && iterations < maxIterations) {
					iterations += 1;
					var _this$_getHighestEner = this._getHighestEnergyNode(ignoreClusters);
					var _this$_getHighestEner2 = _slicedToArray(_this$_getHighestEner, 4);
					highE_nodeId = _this$_getHighestEner2[0];
					maxEnergy = _this$_getHighestEner2[1];
					dE_dx = _this$_getHighestEner2[2];
					dE_dy = _this$_getHighestEner2[3];
					delta_m = maxEnergy;
					subIterations = 0;
					while (delta_m > innerThreshold && subIterations < maxInnerIterations) {
						subIterations += 1;
						this._moveNode(highE_nodeId, dE_dx, dE_dy);
						var _this$_getEnergy = this._getEnergy(highE_nodeId);
						var _this$_getEnergy2 = _slicedToArray(_this$_getEnergy, 3);
						delta_m = _this$_getEnergy2[0];
						dE_dx = _this$_getEnergy2[1];
						dE_dy = _this$_getEnergy2[2];
					}
				}
			}
		},
		{
			key: "_getHighestEnergyNode",
			value: function _getHighestEnergyNode(ignoreClusters) {
				var nodesArray = this.body.nodeIndices;
				var nodes = this.body.nodes;
				var maxEnergy = 0;
				var maxEnergyNodeId = nodesArray[0];
				var dE_dx_max = 0, dE_dy_max = 0;
				for (var nodeIdx = 0; nodeIdx < nodesArray.length; nodeIdx++) {
					var m = nodesArray[nodeIdx];
					if (nodes[m].predefinedPosition !== true || nodes[m].isCluster === true && ignoreClusters === true || nodes[m].options.fixed.x !== true || nodes[m].options.fixed.y !== true) {
						var _this$_getEnergy3 = this._getEnergy(m), _this$_getEnergy4 = _slicedToArray(_this$_getEnergy3, 3), delta_m = _this$_getEnergy4[0], dE_dx = _this$_getEnergy4[1], dE_dy = _this$_getEnergy4[2];
						if (maxEnergy < delta_m) {
							maxEnergy = delta_m;
							maxEnergyNodeId = m;
							dE_dx_max = dE_dx;
							dE_dy_max = dE_dy;
						}
					}
				}
				return [
					maxEnergyNodeId,
					maxEnergy,
					dE_dx_max,
					dE_dy_max
				];
			}
		},
		{
			key: "_getEnergy",
			value: function _getEnergy(m) {
				var _this$E_sums$m = _slicedToArray(this.E_sums[m], 2), dE_dx = _this$E_sums$m[0], dE_dy = _this$E_sums$m[1];
				var delta_m = Math.sqrt(Math.pow(dE_dx, 2) + Math.pow(dE_dy, 2));
				return [
					delta_m,
					dE_dx,
					dE_dy
				];
			}
		},
		{
			key: "_moveNode",
			value: function _moveNode(m, dE_dx, dE_dy) {
				var nodesArray = this.body.nodeIndices;
				var nodes = this.body.nodes;
				var d2E_dx2 = 0;
				var d2E_dxdy = 0;
				var d2E_dy2 = 0;
				var x_m = nodes[m].x;
				var y_m = nodes[m].y;
				var km = this.K_matrix[m];
				var lm = this.L_matrix[m];
				for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
					var i$2 = nodesArray[iIdx];
					if (i$2 !== m) {
						var x_i = nodes[i$2].x;
						var y_i = nodes[i$2].y;
						var kmat = km[i$2];
						var lmat = lm[i$2];
						var denominator = 1 / Math.pow(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2), 1.5);
						d2E_dx2 += kmat * (1 - lmat * Math.pow(y_m - y_i, 2) * denominator);
						d2E_dxdy += kmat * (lmat * (x_m - x_i) * (y_m - y_i) * denominator);
						d2E_dy2 += kmat * (1 - lmat * Math.pow(x_m - x_i, 2) * denominator);
					}
				}
				var A = d2E_dx2, B = d2E_dxdy, C = dE_dx, D = d2E_dy2, E = dE_dy;
				var dy = (C / A + E / B) / (B / A - D / B);
				var dx = -(B * dy + C) / A;
				nodes[m].x += dx;
				nodes[m].y += dy;
				this._updateE_matrix(m);
			}
		},
		{
			key: "_createL_matrix",
			value: function _createL_matrix(D_matrix) {
				var nodesArray = this.body.nodeIndices;
				var edgeLength = this.springLength;
				this.L_matrix = [];
				for (var i$2 = 0; i$2 < nodesArray.length; i$2++) {
					this.L_matrix[nodesArray[i$2]] = {};
					for (var j = 0; j < nodesArray.length; j++) this.L_matrix[nodesArray[i$2]][nodesArray[j]] = edgeLength * D_matrix[nodesArray[i$2]][nodesArray[j]];
				}
			}
		},
		{
			key: "_createK_matrix",
			value: function _createK_matrix(D_matrix) {
				var nodesArray = this.body.nodeIndices;
				var edgeStrength = this.springConstant;
				this.K_matrix = [];
				for (var i$2 = 0; i$2 < nodesArray.length; i$2++) {
					this.K_matrix[nodesArray[i$2]] = {};
					for (var j = 0; j < nodesArray.length; j++) this.K_matrix[nodesArray[i$2]][nodesArray[j]] = edgeStrength * Math.pow(D_matrix[nodesArray[i$2]][nodesArray[j]], -2);
				}
			}
		},
		{
			key: "_createE_matrix",
			value: function _createE_matrix() {
				var nodesArray = this.body.nodeIndices;
				var nodes = this.body.nodes;
				this.E_matrix = {};
				this.E_sums = {};
				for (var mIdx = 0; mIdx < nodesArray.length; mIdx++) this.E_matrix[nodesArray[mIdx]] = [];
				for (var _mIdx = 0; _mIdx < nodesArray.length; _mIdx++) {
					var m = nodesArray[_mIdx];
					var x_m = nodes[m].x;
					var y_m = nodes[m].y;
					var dE_dx = 0;
					var dE_dy = 0;
					for (var iIdx = _mIdx; iIdx < nodesArray.length; iIdx++) {
						var i$2 = nodesArray[iIdx];
						if (i$2 !== m) {
							var x_i = nodes[i$2].x;
							var y_i = nodes[i$2].y;
							var denominator = 1 / Math.sqrt(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2));
							this.E_matrix[m][iIdx] = [this.K_matrix[m][i$2] * (x_m - x_i - this.L_matrix[m][i$2] * (x_m - x_i) * denominator), this.K_matrix[m][i$2] * (y_m - y_i - this.L_matrix[m][i$2] * (y_m - y_i) * denominator)];
							this.E_matrix[i$2][_mIdx] = this.E_matrix[m][iIdx];
							dE_dx += this.E_matrix[m][iIdx][0];
							dE_dy += this.E_matrix[m][iIdx][1];
						}
					}
					this.E_sums[m] = [dE_dx, dE_dy];
				}
			}
		},
		{
			key: "_updateE_matrix",
			value: function _updateE_matrix(m) {
				var nodesArray = this.body.nodeIndices;
				var nodes = this.body.nodes;
				var colm = this.E_matrix[m];
				var kcolm = this.K_matrix[m];
				var lcolm = this.L_matrix[m];
				var x_m = nodes[m].x;
				var y_m = nodes[m].y;
				var dE_dx = 0;
				var dE_dy = 0;
				for (var iIdx = 0; iIdx < nodesArray.length; iIdx++) {
					var i$2 = nodesArray[iIdx];
					if (i$2 !== m) {
						var cell = colm[iIdx];
						var oldDx = cell[0];
						var oldDy = cell[1];
						var x_i = nodes[i$2].x;
						var y_i = nodes[i$2].y;
						var denominator = 1 / Math.sqrt(Math.pow(x_m - x_i, 2) + Math.pow(y_m - y_i, 2));
						var dx = kcolm[i$2] * (x_m - x_i - lcolm[i$2] * (x_m - x_i) * denominator);
						var dy = kcolm[i$2] * (y_m - y_i - lcolm[i$2] * (y_m - y_i) * denominator);
						colm[iIdx] = [dx, dy];
						dE_dx += dx;
						dE_dy += dy;
						var sum = this.E_sums[i$2];
						sum[0] += dx - oldDx;
						sum[1] += dy - oldDy;
					}
				}
				this.E_sums[m] = [dE_dx, dE_dy];
			}
		}
	]);
	return KamadaKawai$1;
}();
/**
* Create a network visualization, displaying nodes and edges.
*
* @param {Element} container   The DOM element in which the Network will
*                                  be created. Normally a div element.
* @param {object} data         An object containing parameters
*                              {Array} nodes
*                              {Array} edges
* @param {object} options      Options
* @class Network
*/
function Network(container, data$2, options) {
	var _context, _context2, _context3, _context4, _this = this;
	if (!(this instanceof Network)) throw new SyntaxError("Constructor must be called with the new operator");
	this.options = {};
	this.defaultOptions = {
		locale: "en",
		locales,
		clickToUse: false
	};
	_Object$assign(this.options, this.defaultOptions);
	/**
	* Containers for nodes and edges.
	*
	* 'edges' and 'nodes' contain the full definitions of all the network elements.
	* 'nodeIndices' and 'edgeIndices' contain the id's of the active elements.
	*
	* The distinction is important, because a defined node need not be active, i.e.
	* visible on the canvas. This happens in particular when clusters are defined, in
	* that case there will be nodes and edges not displayed.
	* The bottom line is that all code with actions related to visibility, *must* use
	* 'nodeIndices' and 'edgeIndices', not 'nodes' and 'edges' directly.
	*/
	this.body = {
		container,
		nodes: {},
		nodeIndices: [],
		edges: {},
		edgeIndices: [],
		emitter: {
			on: _bindInstanceProperty$1(_context = this.on).call(_context, this),
			off: _bindInstanceProperty$1(_context2 = this.off).call(_context2, this),
			emit: _bindInstanceProperty$1(_context3 = this.emit).call(_context3, this),
			once: _bindInstanceProperty$1(_context4 = this.once).call(_context4, this)
		},
		eventListeners: {
			onTap: function onTap() {},
			onTouch: function onTouch$1() {},
			onDoubleTap: function onDoubleTap() {},
			onHold: function onHold() {},
			onDragStart: function onDragStart() {},
			onDrag: function onDrag() {},
			onDragEnd: function onDragEnd() {},
			onMouseWheel: function onMouseWheel() {},
			onPinch: function onPinch() {},
			onMouseMove: function onMouseMove() {},
			onRelease: function onRelease$1() {},
			onContext: function onContext() {}
		},
		data: {
			nodes: null,
			edges: null
		},
		functions: {
			createNode: function createNode() {},
			createEdge: function createEdge$1() {},
			getPointer: function getPointer() {}
		},
		modules: {},
		view: {
			scale: 1,
			translation: {
				x: 0,
				y: 0
			}
		},
		selectionBox: {
			show: false,
			position: {
				start: {
					x: 0,
					y: 0
				},
				end: {
					x: 0,
					y: 0
				}
			}
		}
	};
	this.bindEventListeners();
	this.images = new Images(function() {
		return _this.body.emitter.emit("_requestRedraw");
	});
	this.groups = new Groups();
	this.canvas = new Canvas(this.body);
	this.selectionHandler = new SelectionHandler(this.body, this.canvas);
	this.interactionHandler = new InteractionHandler(this.body, this.canvas, this.selectionHandler);
	this.view = new View(this.body, this.canvas);
	this.renderer = new CanvasRenderer(this.body, this.canvas);
	this.physics = new PhysicsEngine(this.body);
	this.layoutEngine = new LayoutEngine(this.body);
	this.clustering = new ClusterEngine(this.body);
	this.manipulation = new ManipulationSystem(this.body, this.canvas, this.selectionHandler, this.interactionHandler);
	this.nodesHandler = new NodesHandler(this.body, this.images, this.groups, this.layoutEngine);
	this.edgesHandler = new EdgesHandler(this.body, this.images, this.groups);
	this.body.modules["kamadaKawai"] = new KamadaKawai(this.body, 150, .05);
	this.body.modules["clustering"] = this.clustering;
	this.canvas._create();
	this.setOptions(options);
	this.setData(data$2);
}
Emitter(Network.prototype);
/**
* Set options
*
* @param {object} options
*/
Network.prototype.setOptions = function(options) {
	var _this2 = this;
	if (options === null) options = void 0;
	if (options !== void 0) {
		var errorFound$1 = Validator.validate(options, allOptions);
		if (errorFound$1 === true) console.error("%cErrors have been found in the supplied options object.", VALIDATOR_PRINT_STYLE);
		var fields = [
			"locale",
			"locales",
			"clickToUse"
		];
		selectiveDeepExtend(fields, this.options, options);
		if (options.locale !== void 0) options.locale = normalizeLanguageCode(options.locales || this.options.locales, options.locale);
		options = this.layoutEngine.setOptions(options.layout, options);
		this.canvas.setOptions(options);
		this.groups.setOptions(options.groups);
		this.nodesHandler.setOptions(options.nodes);
		this.edgesHandler.setOptions(options.edges);
		this.physics.setOptions(options.physics);
		this.manipulation.setOptions(options.manipulation, options, this.options);
		this.interactionHandler.setOptions(options.interaction);
		this.renderer.setOptions(options.interaction);
		this.selectionHandler.setOptions(options.interaction);
		if (options.groups !== void 0) this.body.emitter.emit("refreshNodes");
		if ("configure" in options) {
			if (!this.configurator) this.configurator = new Configurator(this, this.body.container, configureOptions, this.canvas.pixelRatio, configuratorHideOption);
			this.configurator.setOptions(options.configure);
		}
		if (this.configurator && this.configurator.options.enabled === true) {
			var networkOptions = {
				nodes: {},
				edges: {},
				layout: {},
				interaction: {},
				manipulation: {},
				physics: {},
				global: {}
			};
			deepExtend(networkOptions.nodes, this.nodesHandler.options);
			deepExtend(networkOptions.edges, this.edgesHandler.options);
			deepExtend(networkOptions.layout, this.layoutEngine.options);
			deepExtend(networkOptions.interaction, this.selectionHandler.options);
			deepExtend(networkOptions.interaction, this.renderer.options);
			deepExtend(networkOptions.interaction, this.interactionHandler.options);
			deepExtend(networkOptions.manipulation, this.manipulation.options);
			deepExtend(networkOptions.physics, this.physics.options);
			deepExtend(networkOptions.global, this.canvas.options);
			deepExtend(networkOptions.global, this.options);
			this.configurator.setModuleOptions(networkOptions);
		}
		if (options.clickToUse !== void 0) if (options.clickToUse === true) {
			if (this.activator === void 0) {
				this.activator = new Activator(this.canvas.frame);
				this.activator.on("change", function() {
					_this2.body.emitter.emit("activate");
				});
			}
		} else {
			if (this.activator !== void 0) {
				this.activator.destroy();
				delete this.activator;
			}
			this.body.emitter.emit("activate");
		}
		else this.body.emitter.emit("activate");
		this.canvas.setSize();
		this.body.emitter.emit("startSimulation");
	}
};
/**
* Update the visible nodes and edges list with the most recent node state.
*
* Visible nodes are stored in this.body.nodeIndices.
* Visible edges are stored in this.body.edgeIndices.
* A node or edges is visible if it is not hidden or clustered.
*
* @private
*/
Network.prototype._updateVisibleIndices = function() {
	var nodes = this.body.nodes;
	var edges = this.body.edges;
	this.body.nodeIndices = [];
	this.body.edgeIndices = [];
	for (var nodeId in nodes) if (Object.prototype.hasOwnProperty.call(nodes, nodeId)) {
		if (!this.clustering._isClusteredNode(nodeId) && nodes[nodeId].options.hidden === false) this.body.nodeIndices.push(nodes[nodeId].id);
	}
	for (var edgeId in edges) if (Object.prototype.hasOwnProperty.call(edges, edgeId)) {
		var edge = edges[edgeId];
		var fromNode = nodes[edge.fromId];
		var toNode = nodes[edge.toId];
		var edgeNodesPresent = fromNode !== void 0 && toNode !== void 0;
		var isVisible = !this.clustering._isClusteredEdge(edgeId) && edge.options.hidden === false && edgeNodesPresent && fromNode.options.hidden === false && toNode.options.hidden === false;
		if (isVisible) this.body.edgeIndices.push(edge.id);
	}
};
/**
* Bind all events
*/
Network.prototype.bindEventListeners = function() {
	var _this3 = this;
	this.body.emitter.on("_dataChanged", function() {
		_this3.edgesHandler._updateState();
		_this3.body.emitter.emit("_dataUpdated");
	});
	this.body.emitter.on("_dataUpdated", function() {
		_this3.clustering._updateState();
		_this3._updateVisibleIndices();
		_this3._updateValueRange(_this3.body.nodes);
		_this3._updateValueRange(_this3.body.edges);
		_this3.body.emitter.emit("startSimulation");
		_this3.body.emitter.emit("_requestRedraw");
	});
};
/**
* Set nodes and edges, and optionally options as well.
*
* @param {object} data              Object containing parameters:
*                                   {Array | DataSet | DataView} [nodes] Array with nodes
*                                   {Array | DataSet | DataView} [edges] Array with edges
*                                   {String} [dot] String containing data in DOT format
*                                   {String} [gephi] String containing data in gephi JSON format
*                                   {Options} [options] Object with options
*/
Network.prototype.setData = function(data$2) {
	this.body.emitter.emit("resetPhysics");
	this.body.emitter.emit("_resetData");
	this.selectionHandler.unselectAll();
	if (data$2 && data$2.dot && (data$2.nodes || data$2.edges)) throw new SyntaxError("Data must contain either parameter \"dot\" or  parameter pair \"nodes\" and \"edges\", but not both.");
	this.setOptions(data$2 && data$2.options);
	if (data$2 && data$2.dot) {
		console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);");
		var dotData = DOTToGraph(data$2.dot);
		this.setData(dotData);
		return;
	} else if (data$2 && data$2.gephi) {
		console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);");
		var gephiData = parseGephi(data$2.gephi);
		this.setData(gephiData);
		return;
	} else {
		this.nodesHandler.setData(data$2 && data$2.nodes, true);
		this.edgesHandler.setData(data$2 && data$2.edges, true);
	}
	this.body.emitter.emit("_dataChanged");
	this.body.emitter.emit("_dataLoaded");
	this.body.emitter.emit("initPhysics");
};
/**
* Cleans up all bindings of the network, removing it fully from the memory IF the variable is set to null after calling this function.
* var network = new vis.Network(..);
* network.destroy();
* network = null;
*/
Network.prototype.destroy = function() {
	this.body.emitter.emit("destroy");
	this.body.emitter.off();
	this.off();
	delete this.groups;
	delete this.canvas;
	delete this.selectionHandler;
	delete this.interactionHandler;
	delete this.view;
	delete this.renderer;
	delete this.physics;
	delete this.layoutEngine;
	delete this.clustering;
	delete this.manipulation;
	delete this.nodesHandler;
	delete this.edgesHandler;
	delete this.configurator;
	delete this.images;
	for (var nodeId in this.body.nodes) {
		if (!Object.prototype.hasOwnProperty.call(this.body.nodes, nodeId)) continue;
		delete this.body.nodes[nodeId];
	}
	for (var edgeId in this.body.edges) {
		if (!Object.prototype.hasOwnProperty.call(this.body.edges, edgeId)) continue;
		delete this.body.edges[edgeId];
	}
	recursiveDOMDelete(this.body.container);
};
/**
* Update the values of all object in the given array according to the current
* value range of the objects in the array.
*
* @param {object} obj    An object containing a set of Edges or Nodes
*                        The objects must have a method getValue() and
*                        setValueRange(min, max).
* @private
*/
Network.prototype._updateValueRange = function(obj) {
	var id$4;
	var valueMin = void 0;
	var valueMax = void 0;
	var valueTotal = 0;
	for (id$4 in obj) if (Object.prototype.hasOwnProperty.call(obj, id$4)) {
		var value = obj[id$4].getValue();
		if (value !== void 0) {
			valueMin = valueMin === void 0 ? value : Math.min(value, valueMin);
			valueMax = valueMax === void 0 ? value : Math.max(value, valueMax);
			valueTotal += value;
		}
	}
	if (valueMin !== void 0 && valueMax !== void 0) {
		for (id$4 in obj) if (Object.prototype.hasOwnProperty.call(obj, id$4)) obj[id$4].setValueRange(valueMin, valueMax, valueTotal);
	}
};
/**
* Returns true when the Network is active.
*
* @returns {boolean}
*/
Network.prototype.isActive = function() {
	return !this.activator || this.activator.active;
};
Network.prototype.setSize = function() {
	return this.canvas.setSize.apply(this.canvas, arguments);
};
Network.prototype.canvasToDOM = function() {
	return this.canvas.canvasToDOM.apply(this.canvas, arguments);
};
Network.prototype.DOMtoCanvas = function() {
	return this.canvas.DOMtoCanvas.apply(this.canvas, arguments);
};
/**
* Nodes can be in clusters. Clusters can also be in clusters. This function returns and array of
* nodeIds showing where the node is.
*
* If any nodeId in the chain, especially the first passed in as a parameter, is not present in
* the current nodes list, an empty array is returned.
*
* Example:
* cluster 'A' contains cluster 'B',
* cluster 'B' contains cluster 'C',
* cluster 'C' contains node 'fred'.
* `jsnetwork.clustering.findNode('fred')` will return `['A','B','C','fred']`.
*
* @param {string|number} nodeId
* @returns {Array}
*/
Network.prototype.findNode = function() {
	return this.clustering.findNode.apply(this.clustering, arguments);
};
Network.prototype.isCluster = function() {
	return this.clustering.isCluster.apply(this.clustering, arguments);
};
Network.prototype.openCluster = function() {
	return this.clustering.openCluster.apply(this.clustering, arguments);
};
Network.prototype.cluster = function() {
	return this.clustering.cluster.apply(this.clustering, arguments);
};
Network.prototype.getNodesInCluster = function() {
	return this.clustering.getNodesInCluster.apply(this.clustering, arguments);
};
Network.prototype.clusterByConnection = function() {
	return this.clustering.clusterByConnection.apply(this.clustering, arguments);
};
Network.prototype.clusterByHubsize = function() {
	return this.clustering.clusterByHubsize.apply(this.clustering, arguments);
};
Network.prototype.updateClusteredNode = function() {
	return this.clustering.updateClusteredNode.apply(this.clustering, arguments);
};
Network.prototype.getClusteredEdges = function() {
	return this.clustering.getClusteredEdges.apply(this.clustering, arguments);
};
Network.prototype.getBaseEdge = function() {
	return this.clustering.getBaseEdge.apply(this.clustering, arguments);
};
Network.prototype.getBaseEdges = function() {
	return this.clustering.getBaseEdges.apply(this.clustering, arguments);
};
Network.prototype.updateEdge = function() {
	return this.clustering.updateEdge.apply(this.clustering, arguments);
};
/**
* This method will cluster all nodes with 1 edge with their respective connected node.
* The options object is explained in full <a data-scroll="" data-options="{ &quot;easing&quot;: &quot;easeInCubic&quot; }" href="#optionsObject">below</a>.
*
* @param {object} [options]
* @returns {undefined}
*/
Network.prototype.clusterOutliers = function() {
	return this.clustering.clusterOutliers.apply(this.clustering, arguments);
};
Network.prototype.getSeed = function() {
	return this.layoutEngine.getSeed.apply(this.layoutEngine, arguments);
};
Network.prototype.enableEditMode = function() {
	return this.manipulation.enableEditMode.apply(this.manipulation, arguments);
};
Network.prototype.disableEditMode = function() {
	return this.manipulation.disableEditMode.apply(this.manipulation, arguments);
};
Network.prototype.addNodeMode = function() {
	return this.manipulation.addNodeMode.apply(this.manipulation, arguments);
};
Network.prototype.editNode = function() {
	return this.manipulation.editNode.apply(this.manipulation, arguments);
};
Network.prototype.editNodeMode = function() {
	console.warn("Deprecated: Please use editNode instead of editNodeMode.");
	return this.manipulation.editNode.apply(this.manipulation, arguments);
};
Network.prototype.addEdgeMode = function() {
	return this.manipulation.addEdgeMode.apply(this.manipulation, arguments);
};
Network.prototype.editEdgeMode = function() {
	return this.manipulation.editEdgeMode.apply(this.manipulation, arguments);
};
Network.prototype.deleteSelected = function() {
	return this.manipulation.deleteSelected.apply(this.manipulation, arguments);
};
Network.prototype.getPositions = function() {
	return this.nodesHandler.getPositions.apply(this.nodesHandler, arguments);
};
Network.prototype.getPosition = function() {
	return this.nodesHandler.getPosition.apply(this.nodesHandler, arguments);
};
Network.prototype.storePositions = function() {
	return this.nodesHandler.storePositions.apply(this.nodesHandler, arguments);
};
Network.prototype.moveNode = function() {
	return this.nodesHandler.moveNode.apply(this.nodesHandler, arguments);
};
Network.prototype.getBoundingBox = function() {
	return this.nodesHandler.getBoundingBox.apply(this.nodesHandler, arguments);
};
Network.prototype.getConnectedNodes = function(objectId) {
	if (this.body.nodes[objectId] !== void 0) return this.nodesHandler.getConnectedNodes.apply(this.nodesHandler, arguments);
	else return this.edgesHandler.getConnectedNodes.apply(this.edgesHandler, arguments);
};
Network.prototype.getConnectedEdges = function() {
	return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler, arguments);
};
Network.prototype.startSimulation = function() {
	return this.physics.startSimulation.apply(this.physics, arguments);
};
Network.prototype.stopSimulation = function() {
	return this.physics.stopSimulation.apply(this.physics, arguments);
};
Network.prototype.stabilize = function() {
	return this.physics.stabilize.apply(this.physics, arguments);
};
Network.prototype.getSelection = function() {
	return this.selectionHandler.getSelection.apply(this.selectionHandler, arguments);
};
Network.prototype.setSelection = function() {
	return this.selectionHandler.setSelection.apply(this.selectionHandler, arguments);
};
Network.prototype.getSelectedNodes = function() {
	return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler, arguments);
};
Network.prototype.getSelectedEdges = function() {
	return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler, arguments);
};
Network.prototype.getNodeAt = function() {
	var node$1 = this.selectionHandler.getNodeAt.apply(this.selectionHandler, arguments);
	if (node$1 !== void 0 && node$1.id !== void 0) return node$1.id;
	return node$1;
};
Network.prototype.getEdgeAt = function() {
	var edge = this.selectionHandler.getEdgeAt.apply(this.selectionHandler, arguments);
	if (edge !== void 0 && edge.id !== void 0) return edge.id;
	return edge;
};
Network.prototype.selectNodes = function() {
	return this.selectionHandler.selectNodes.apply(this.selectionHandler, arguments);
};
Network.prototype.selectEdges = function() {
	return this.selectionHandler.selectEdges.apply(this.selectionHandler, arguments);
};
Network.prototype.unselectAll = function() {
	this.selectionHandler.unselectAll.apply(this.selectionHandler, arguments);
	this.selectionHandler.commitWithoutEmitting.apply(this.selectionHandler);
	this.redraw();
};
Network.prototype.redraw = function() {
	return this.renderer.redraw.apply(this.renderer, arguments);
};
Network.prototype.getScale = function() {
	return this.view.getScale.apply(this.view, arguments);
};
Network.prototype.getViewPosition = function() {
	return this.view.getViewPosition.apply(this.view, arguments);
};
Network.prototype.fit = function() {
	return this.view.fit.apply(this.view, arguments);
};
Network.prototype.moveTo = function() {
	return this.view.moveTo.apply(this.view, arguments);
};
Network.prototype.focus = function() {
	return this.view.focus.apply(this.view, arguments);
};
Network.prototype.releaseNode = function() {
	return this.view.releaseNode.apply(this.view, arguments);
};
Network.prototype.getOptionsFromConfigurator = function() {
	var options = {};
	if (this.configurator) options = this.configurator.getOptions.apply(this.configurator);
	return options;
};
const _hoisted_1$2 = { key: 0 };
const _hoisted_2$2 = {
	border: "~ main",
	flex: "~ col",
	absolute: "",
	"bottom-3": "",
	"right-3": "",
	"w-38": "",
	"select-none": "",
	rounded: "",
	"bg-opacity-75": "",
	p3: "",
	"text-sm": "",
	shadow: "",
	"backdrop-blur-8": "",
	"bg-main": ""
};
const _hoisted_3$2 = {
	border: "~ main",
	absolute: "",
	"bottom-3": "",
	"left-3": "",
	rounded: "",
	"bg-opacity-75": "",
	p3: "",
	"text-sm": "",
	shadow: "",
	"backdrop-blur-8": "",
	"bg-main": "",
	flex: "~ col gap-1"
};
var Graph_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "Graph",
	setup(__props) {
		const search = useSearchResults();
		const options = useOptionsStore();
		function colorPair(color) {
			return {
				color,
				font: { color }
			};
		}
		const colors = {
			vue: colorPair("#42b883"),
			ts: colorPair("#41b1e0"),
			js: colorPair("#d6cb2d"),
			json: colorPair("#cf8f30"),
			css: colorPair("#e6659a"),
			html: colorPair("#e34c26"),
			svelte: colorPair("#ff3e00"),
			jsx: colorPair("#7d6fe8"),
			tsx: colorPair("#6f99e8"),
			faded: colorPair("#888")
		};
		function getModuleWeight(mod, mode) {
			const value = 10 + (mode === "deps" ? Math.min(mod.deps.length, 30) : Math.min(mod.plugins.reduce((total, plg) => total + (plg[mode] || 0), 0) / 20, 30));
			return value;
		}
		const container = ref();
		const weightItems = [
			{
				value: "deps",
				label: "dependency count"
			},
			{
				value: "transform",
				label: "transform time"
			},
			{
				value: "resolveId",
				label: "resolveId time"
			}
		];
		const shapes = [
			{
				type: "source",
				icon: "i-ic-outline-circle"
			},
			{
				type: "virtual",
				icon: "i-ic-outline-square rotate-45 scale-85"
			},
			{
				type: "node_modules",
				icon: "i-ic-outline-hexagon"
			}
		];
		const router = useRouter();
		const data$2 = computed(() => {
			const modules = search.filtered;
			const nodes = new DataSet(modules.map((mod) => {
				const path$11 = mod.id.replace(/\?.*$/, "").replace(/#.*$/, "");
				const group = path$11.match(/\.(\w+)$/)?.[1] || "unknown";
				return {
					id: mod.id,
					label: path$11.split("/").splice(-1)[0],
					group,
					defaultGroup: group,
					size: getModuleWeight(mod, options.view.graphWeightMode),
					shape: mod.id.includes("/node_modules/") ? "hexagon" : mod.virtual ? "diamond" : "dot"
				};
			}));
			const edges = modules.flatMap((mod) => mod.deps.map((dep) => ({
				from: mod.id,
				to: dep,
				arrows: { to: {
					enabled: true,
					scaleFactor: .8
				} },
				color: { opacity: .8 }
			})));
			return {
				nodes,
				edges
			};
		});
		onMounted(() => {
			const options$1 = {
				nodes: {
					shape: "dot",
					size: 16
				},
				physics: {
					maxVelocity: 146,
					solver: "forceAtlas2Based",
					timestep: .35,
					stabilization: {
						enabled: true,
						iterations: 200
					}
				},
				groups: colors
			};
			const network = new Network(container.value, data$2.value, options$1);
			const clicking = ref(false);
			network.on("click", () => {
				clicking.value = true;
			});
			network.on("hold", () => {
				clicking.value = false;
			});
			network.on("dragStart", () => {
				clicking.value = false;
			});
			network.on("release", (data$3) => {
				const node$1 = data$3.nodes?.[0];
				if (clicking.value && node$1) {
					router.push(`/module?id=${encodeURIComponent(node$1)}`);
					clicking.value = false;
				}
			});
			watch(data$2, () => {
				network.setData(data$2.value);
			});
			watch(() => search.results, () => {
				const nodes = data$2.value.nodes;
				nodes.forEach((node$1) => {
					const mod = search.results.find((mod$1) => mod$1.id === node$1.id);
					nodes.update({
						id: node$1.id,
						group: mod ? node$1.defaultGroup : "faded"
					});
				});
			});
		});
		return (_ctx, _cache) => {
			const _component_RadioGroup = RadioGroup_default;
			return unref(search).filtered ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
				createBaseVNode("div", {
					ref_key: "container",
					ref: container,
					"h-100vh": "",
					"w-full": ""
				}, null, 512),
				createBaseVNode("div", _hoisted_2$2, [
					(openBlock(), createElementBlock(Fragment, null, renderList(colors, (value, key) => {
						return createBaseVNode("div", {
							key,
							flex: "~ gap-2 items-center"
						}, [createBaseVNode("div", {
							"h-3": "",
							"w-3": "",
							"rounded-full": "",
							style: normalizeStyle({ backgroundColor: value.color })
						}, null, 4), createBaseVNode("div", null, toDisplayString(key), 1)]);
					}), 64)),
					_cache[1] || (_cache[1] = createBaseVNode("div", {
						border: "t base",
						my3: "",
						"h-1px": ""
					}, null, -1)),
					(openBlock(), createElementBlock(Fragment, null, renderList(shapes, (shape) => {
						return createBaseVNode("div", {
							key: shape.type,
							flex: "~ gap-2 items-center"
						}, [createBaseVNode("div", {
							class: normalizeClass(shape.icon),
							"flex-none": ""
						}, null, 2), createBaseVNode("div", null, toDisplayString(shape.type), 1)]);
					}), 64))
				]),
				createBaseVNode("div", _hoisted_3$2, [_cache[2] || (_cache[2] = createBaseVNode("span", {
					"text-sm": "",
					op50: ""
				}, "weight by", -1)), createVNode(_component_RadioGroup, {
					modelValue: unref(options).view.graphWeightMode,
					"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(options).view.graphWeightMode = $event),
					"flex-col": "",
					"text-sm": "",
					name: "weight",
					options: weightItems
				}, null, 8, ["modelValue"])])
			])) : createCommentVNode("", true);
		};
	}
});
var Graph_default = Graph_vue_vue_type_script_setup_true_lang_default;
const _hoisted_1$1 = { class: "h-min flex flex-col select-none gap-1 whitespace-nowrap text-xs" };
const _hoisted_2$1 = { class: "flex gap-2" };
const _hoisted_3$1 = { class: "flex" };
const _hoisted_4$1 = { class: "flex gap-2" };
const _hoisted_5 = { class: "flex" };
const _hoisted_6 = { class: "flex" };
const _hoisted_7 = { class: "flex" };
var SearchBox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "SearchBox",
	setup(__props) {
		const options = useOptionsStore();
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock(Fragment, null, [withDirectives(createBaseVNode("input", {
				"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(options).search.text = $event),
				type: "text",
				class: "border border-main rounded bg-transparent px-3 py-1 !outline-none",
				placeholder: "Search..."
			}, null, 512), [[vModelText, unref(options).search.text]]), createBaseVNode("div", _hoisted_1$1, [createBaseVNode("div", _hoisted_2$1, [createBaseVNode("label", _hoisted_3$1, [withDirectives(createBaseVNode("input", {
				"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(options).search.exactSearch = $event),
				type: "checkbox",
				class: "my-auto"
			}, null, 512), [[vModelCheckbox, unref(options).search.exactSearch]]), _cache[5] || (_cache[5] = createBaseVNode("div", { class: "ml-1" }, "exact search", -1))])]), createBaseVNode("div", _hoisted_4$1, [
				createBaseVNode("label", _hoisted_5, [withDirectives(createBaseVNode("input", {
					"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => unref(options).search.includeNodeModules = $event),
					type: "checkbox",
					class: "my-auto"
				}, null, 512), [[vModelCheckbox, unref(options).search.includeNodeModules]]), _cache[6] || (_cache[6] = createBaseVNode("div", { class: "ml-1" }, "node_modules", -1))]),
				createBaseVNode("label", _hoisted_6, [withDirectives(createBaseVNode("input", {
					"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(options).search.includeVirtual = $event),
					type: "checkbox",
					class: "my-auto"
				}, null, 512), [[vModelCheckbox, unref(options).search.includeVirtual]]), _cache[7] || (_cache[7] = createBaseVNode("div", { class: "ml-1" }, "virtual", -1))]),
				createBaseVNode("label", _hoisted_7, [withDirectives(createBaseVNode("input", {
					"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(options).search.includeUnreached = $event),
					type: "checkbox",
					class: "my-auto"
				}, null, 512), [[vModelCheckbox, unref(options).search.includeUnreached]]), _cache[8] || (_cache[8] = createBaseVNode("div", { class: "ml-1" }, "unreached", -1))])
			])])], 64);
		};
	}
});
var SearchBox_default = SearchBox_vue_vue_type_script_setup_true_lang_default;
const _hoisted_1 = ["disabled"];
const _hoisted_2 = {
	key: 0,
	"i-carbon-list-boxes": ""
};
const _hoisted_3 = {
	key: 1,
	"i-carbon-list": ""
};
const _hoisted_4 = {
	key: 2,
	"i-carbon-network-4": ""
};
var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "index",
	setup(__props) {
		const options = useOptionsStore();
		const payload = usePayloadStore();
		const search = useSearchResults();
		const route = useRoute();
		const isRoot = computed(() => route.path === "/");
		return (_ctx, _cache) => {
			const _component_SearchBox = SearchBox_default;
			const _component_QuerySelector = QuerySelector_default;
			const _component_RouterLink = resolveComponent("RouterLink");
			const _component_NavBar = NavBar_default;
			const _component_Graph = Graph_default;
			const _component_ModuleList = ModuleList_default;
			const _component_Container = Container_default;
			const _component_RouterView = resolveComponent("RouterView");
			return openBlock(), createElementBlock(Fragment, null, [
				createVNode(_component_NavBar, null, {
					default: withCtx(() => [
						_cache[14] || (_cache[14] = createBaseVNode("div", {
							"i-carbon-ibm-watson-discovery": "",
							title: "Vite Inspect",
							"text-xl": ""
						}, null, -1)),
						createVNode(_component_SearchBox),
						_cache[15] || (_cache[15] = createBaseVNode("div", { "flex-auto": "" }, null, -1)),
						createVNode(_component_QuerySelector),
						_cache[16] || (_cache[16] = createBaseVNode("div", {
							mx1: "",
							"h-full": "",
							"w-0": "",
							border: "r main"
						}, null, -1)),
						unref(options).view.listMode === "detailed" ? (openBlock(), createElementBlock("button", {
							key: 0,
							"text-lg": "",
							"icon-btn": "",
							title: "Sort",
							flex: "~ items-center",
							disabled: !!unref(options).search.text,
							class: normalizeClass(unref(options).search.text ? "op50 pointer-events-none" : ""),
							onClick: _cache[0] || (_cache[0] = ($event) => unref(options).toggleSort())
						}, [unref(options).search.text ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[3] || (_cache[3] = createBaseVNode("span", { "i-carbon-search": "" }, null, -1)), _cache[4] || (_cache[4] = createBaseVNode("span", {
							"i-carbon-arrow-down": "",
							"text-sm": "",
							op70: ""
						}, null, -1))], 64)) : unref(options).view.sort === "time-asc" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[5] || (_cache[5] = createBaseVNode("span", { "i-carbon-time": "" }, null, -1)), _cache[6] || (_cache[6] = createBaseVNode("span", {
							"i-carbon-arrow-down": "",
							"text-sm": "",
							op70: ""
						}, null, -1))], 64)) : unref(options).view.sort === "time-desc" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[7] || (_cache[7] = createBaseVNode("span", { "i-carbon-time": "" }, null, -1)), _cache[8] || (_cache[8] = createBaseVNode("span", {
							"i-carbon-arrow-up": "",
							"text-sm": "",
							op70: ""
						}, null, -1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [_cache[9] || (_cache[9] = createBaseVNode("span", { "i-carbon-menu": "" }, null, -1)), _cache[10] || (_cache[10] = createBaseVNode("span", {
							"i-carbon-chevron-sort": "",
							"text-sm": "",
							op70: ""
						}, null, -1))], 64))], 10, _hoisted_1)) : createCommentVNode("", true),
						createBaseVNode("button", {
							"text-lg": "",
							"icon-btn": "",
							title: "View Mode",
							onClick: _cache[1] || (_cache[1] = ($event) => unref(options).toggleListMode())
						}, [unref(options).view.listMode === "detailed" ? (openBlock(), createElementBlock("span", _hoisted_2)) : unref(options).view.listMode === "list" ? (openBlock(), createElementBlock("span", _hoisted_3)) : (openBlock(), createElementBlock("span", _hoisted_4))]),
						_cache[17] || (_cache[17] = createBaseVNode("div", {
							mx2: "",
							"h-full": "",
							"w-1": "",
							border: "r main"
						}, null, -1)),
						createVNode(_component_RouterLink, {
							"text-lg": "",
							"icon-btn": "",
							to: {
								path: "/metric",
								query: unref(route).query
							},
							title: "Metrics"
						}, {
							default: withCtx(() => _cache[11] || (_cache[11] = [createBaseVNode("span", { "i-carbon-meter": "" }, null, -1)])),
							_: 1
						}, 8, ["to"]),
						createVNode(_component_RouterLink, {
							"text-lg": "",
							"icon-btn": "",
							to: {
								path: "/plugins",
								query: unref(route).query
							},
							title: "Plugins"
						}, {
							default: withCtx(() => _cache[12] || (_cache[12] = [createBaseVNode("span", { "i-carbon-microservices-1": "" }, null, -1)])),
							_: 1
						}, 8, ["to"]),
						!unref(payload).isStatic ? (openBlock(), createElementBlock("button", {
							key: 1,
							class: "text-lg icon-btn",
							title: "Refetch",
							onClick: _cache[2] || (_cache[2] = ($event) => unref(payload).refetch())
						}, _cache[13] || (_cache[13] = [createBaseVNode("span", { "i-carbon-renew": "" }, null, -1)]))) : createCommentVNode("", true)
					]),
					_: 1
				}),
				createVNode(_component_Container, { "of-auto": "" }, {
					default: withCtx(() => [(openBlock(), createBlock(KeepAlive, null, [unref(options).view.listMode === "graph" ? (openBlock(), createBlock(_component_Graph, { key: 0 })) : (openBlock(), createBlock(_component_ModuleList, {
						key: 1,
						modules: unref(search).resultsSorted
					}, null, 8, ["modules"]))], 1024))]),
					_: 1
				}),
				createBaseVNode("div", {
					pos: "fixed bottom-0 left-0 right-0 top-0",
					flex: "",
					"overflow-hidden": "",
					"bg-black:50": "",
					"transition-all": "",
					class: normalizeClass(unref(isRoot) ? "pointer-events-none opacity-0" : "opacity-100")
				}, [createVNode(_component_RouterLink, {
					"h-full": "",
					"min-w-70px": "",
					"flex-auto": "",
					to: "/"
				}), createBaseVNode("div", {
					class: normalizeClass(["h-full w-[calc(100vw-100px)] transform overflow-hidden shadow-lg transition-transform duration-300 bg-main", unref(isRoot) ? "translate-x-1/2" : "translate-x-0"]),
					border: "l main"
				}, [(openBlock(), createBlock(Suspense, null, {
					fallback: withCtx(() => _cache[18] || (_cache[18] = [createTextVNode(" Loading... ")])),
					default: withCtx(() => [createVNode(_component_RouterView, null, {
						default: withCtx(({ Component }) => [(openBlock(), createBlock(KeepAlive, null, [(openBlock(), createBlock(resolveDynamicComponent(Component)))], 1024))]),
						_: 1
					})]),
					_: 1
				}))], 2)], 2)
			], 64);
		};
	}
});
var pages_default = index_vue_vue_type_script_setup_true_lang_default;
export { pages_default as default };