diff --git a/dist/engrid.css b/dist/engrid.css index 117ddc6..e54c3eb 100644 --- a/dist/engrid.css +++ b/dist/engrid.css @@ -19,10 +19,10 @@ * * ENGRID PAGE TEMPLATE ASSETS * - * Date: Monday, November 6, 2023 @ 11:19:11 ET - * By: michael - * ENGrid styles: v0.15.3 - * ENGrid scripts: v0.15.8 + * Date: Saturday, November 11, 2023 @ 22:38:15 ET + * By: fernando + * ENGrid styles: v0.15.12 + * ENGrid scripts: v0.15.15 * * Created by 4Site Studios * Come work with us or join our team, we would love to hear from you diff --git a/dist/engrid.js b/dist/engrid.js index bffc79b..a90c7da 100644 --- a/dist/engrid.js +++ b/dist/engrid.js @@ -1,39 +1,39 @@ -/*! - * - * (((( - * (((((((( - * ((((((( - * ((((((( **** - * ((((((( ******* - * (((((((( ********** ********* **** *** - * (((((((( ************ ************** *** **** - * (((((( ******* ***** ***** * ** ****** ***** - * ((( ******* ****** ****** **** ******** ************ - * ******* ***** ********** **** **** **** **** - * ********************* ******* ***** **** *************** - * ******************** **** **** **** **** - * ***** ***** ******* ***** ***** ***** ** - * ***** ************* **** ******* ********** - * - * ENGRID PAGE TEMPLATE ASSETS - * - * Date: Monday, November 6, 2023 @ 11:19:11 ET - * By: michael - * ENGrid styles: v0.15.3 - * ENGrid scripts: v0.15.8 - * - * Created by 4Site Studios - * Come work with us or join our team, we would love to hear from you - * https://www.4sitestudios.com/en - * - */ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ 2705: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +/*! + * + * (((( + * (((((((( + * ((((((( + * ((((((( **** + * ((((((( ******* + * (((((((( ********** ********* **** *** + * (((((((( ************ ************** *** **** + * (((((( ******* ***** ***** * ** ****** ***** + * ((( ******* ****** ****** **** ******** ************ + * ******* ***** ********** **** **** **** **** + * ********************* ******* ***** **** *************** + * ******************** **** **** **** **** + * ***** ***** ******* ***** ***** ***** ** + * ***** ************* **** ******* ********** + * + * ENGRID PAGE TEMPLATE ASSETS + * + * Date: Saturday, November 11, 2023 @ 22:38:15 ET + * By: fernando + * ENGrid styles: v0.15.12 + * ENGrid scripts: v0.15.15 + * + * Created by 4Site Studios + * Come work with us or join our team, we would love to hear from you + * https://www.4sitestudios.com/en + * + */ +/******/ (() => { // webpackBootstrap +/******/ var __webpack_modules__ = ({ + +/***/ 2705: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DispatchError = void 0; @@ -56,14 +56,14 @@ class DispatchError extends Error { } } exports.DispatchError = DispatchError; - - -/***/ }), - -/***/ 9885: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 9885: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DispatcherBase = void 0; @@ -306,14 +306,14 @@ class DispatcherBase { } } exports.DispatcherBase = DispatcherBase; - - -/***/ }), - -/***/ 1637: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 1637: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DispatcherWrapper = void 0; @@ -434,14 +434,14 @@ class DispatcherWrapper { } } exports.DispatcherWrapper = DispatcherWrapper; - - -/***/ }), - -/***/ 4155: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 4155: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventListBase = void 0; @@ -486,14 +486,14 @@ class EventListBase { } } exports.EventListBase = EventListBase; - - -/***/ }), - -/***/ 2849: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 2849: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PromiseDispatcherBase = void 0; @@ -569,14 +569,14 @@ class PromiseDispatcherBase extends __1.DispatcherBase { } } exports.PromiseDispatcherBase = PromiseDispatcherBase; - - -/***/ }), - -/***/ 4220: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4220: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SubscriptionChangeEventDispatcher = void 0; @@ -601,14 +601,14 @@ class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { } } exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; - - -/***/ }), - -/***/ 7278: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 7278: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PromiseSubscription = void 0; @@ -664,14 +664,14 @@ class PromiseSubscription { } } exports.PromiseSubscription = PromiseSubscription; - - -/***/ }), - -/***/ 8326: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 8326: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Subscription = void 0; @@ -718,14 +718,14 @@ class Subscription { } } exports.Subscription = Subscription; - - -/***/ }), - -/***/ 516: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 516: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HandlingBase = void 0; @@ -813,14 +813,14 @@ class HandlingBase { } } exports.HandlingBase = HandlingBase; - - -/***/ }), - -/***/ 4844: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4844: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; /*! * Strongly Typed Events for TypeScript - Core @@ -852,14 +852,14 @@ const Subscription_1 = __webpack_require__(8326); Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); const SubscriptionChangeEventHandler_1 = __webpack_require__(4220); Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); - - -/***/ }), - -/***/ 5638: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + + +/***/ }), + +/***/ 5638: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventManagement = void 0; @@ -892,14 +892,14 @@ class EventManagement { } } exports.EventManagement = EventManagement; - - -/***/ }), - -/***/ 4402: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4402: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventDispatcher = void 0; @@ -964,14 +964,14 @@ class EventDispatcher extends ste_core_1.DispatcherBase { } } exports.EventDispatcher = EventDispatcher; - - -/***/ }), - -/***/ 9411: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 9411: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventHandlingBase = void 0; @@ -986,14 +986,14 @@ class EventHandlingBase extends ste_core_1.HandlingBase { } } exports.EventHandlingBase = EventHandlingBase; - - -/***/ }), - -/***/ 2453: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 2453: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.EventList = void 0; @@ -1018,14 +1018,14 @@ class EventList extends ste_core_1.EventListBase { } } exports.EventList = EventList; - - -/***/ }), - -/***/ 7891: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 7891: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NonUniformEventList = void 0; @@ -1065,14 +1065,14 @@ class NonUniformEventList { } } exports.NonUniformEventList = NonUniformEventList; - - -/***/ }), - -/***/ 3111: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 3111: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; /*! * Strongly Typed Events for TypeScript - Core @@ -1092,14 +1092,14 @@ const EventList_1 = __webpack_require__(2453); Object.defineProperty(exports, "EventList", ({ enumerable: true, get: function () { return EventList_1.EventList; } })); const NonUniformEventList_1 = __webpack_require__(7891); Object.defineProperty(exports, "NonUniformEventList", ({ enumerable: true, get: function () { return NonUniformEventList_1.NonUniformEventList; } })); - - -/***/ }), - -/***/ 4729: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4729: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SignalDispatcher = void 0; @@ -1149,14 +1149,14 @@ class SignalDispatcher extends ste_core_1.DispatcherBase { } } exports.SignalDispatcher = SignalDispatcher; - - -/***/ }), - -/***/ 4243: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4243: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SignalHandlingBase = void 0; @@ -1182,14 +1182,14 @@ class SignalHandlingBase extends ste_core_1.HandlingBase { } } exports.SignalHandlingBase = SignalHandlingBase; - - -/***/ }), - -/***/ 7991: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 7991: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SignalList = void 0; @@ -1225,14 +1225,14 @@ class SignalList extends ste_core_1.EventListBase { } } exports.SignalList = SignalList; - - -/***/ }), - -/***/ 1254: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 1254: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; /*! * Strongly Typed Events for TypeScript - Promise Signals @@ -1250,14 +1250,14 @@ const SignalHandlingBase_1 = __webpack_require__(4243); Object.defineProperty(exports, "SignalHandlingBase", ({ enumerable: true, get: function () { return SignalHandlingBase_1.SignalHandlingBase; } })); const SignalList_1 = __webpack_require__(7991); Object.defineProperty(exports, "SignalList", ({ enumerable: true, get: function () { return SignalList_1.SignalList; } })); - - -/***/ }), - -/***/ 9360: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 9360: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NonUniformSimpleEventList = void 0; @@ -1297,14 +1297,14 @@ class NonUniformSimpleEventList { } } exports.NonUniformSimpleEventList = NonUniformSimpleEventList; - - -/***/ }), - -/***/ 4624: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 4624: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SimpleEventDispatcher = void 0; @@ -1366,14 +1366,14 @@ class SimpleEventDispatcher extends ste_core_1.DispatcherBase { } } exports.SimpleEventDispatcher = SimpleEventDispatcher; - - -/***/ }), - -/***/ 1269: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 1269: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SimpleEventHandlingBase = void 0; @@ -1388,14 +1388,14 @@ class SimpleEventHandlingBase extends ste_core_1.HandlingBase { } } exports.SimpleEventHandlingBase = SimpleEventHandlingBase; - - -/***/ }), - -/***/ 5570: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 5570: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SimpleEventList = void 0; @@ -1420,14 +1420,14 @@ class SimpleEventList extends ste_core_1.EventListBase { } } exports.SimpleEventList = SimpleEventList; - - -/***/ }), - -/***/ 5931: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + + +/***/ }), + +/***/ 5931: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.NonUniformSimpleEventList = exports.SimpleEventList = exports.SimpleEventHandlingBase = exports.SimpleEventDispatcher = void 0; @@ -1439,15 +1439,15 @@ const NonUniformSimpleEventList_1 = __webpack_require__(9360); Object.defineProperty(exports, "NonUniformSimpleEventList", ({ enumerable: true, get: function () { return NonUniformSimpleEventList_1.NonUniformSimpleEventList; } })); const SimpleEventList_1 = __webpack_require__(5570); Object.defineProperty(exports, "SimpleEventList", ({ enumerable: true, get: function () { return SimpleEventList_1.SimpleEventList; } })); - - -/***/ }), - -/***/ 5363: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; -var __webpack_unused_export__; + + +/***/ }), + +/***/ 5363: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +var __webpack_unused_export__; /*! * Strongly Typed Events for TypeScript @@ -1497,1910 +1497,2244 @@ __webpack_unused_export__ = ({ enumerable: true, get: function () { return ste_p __webpack_unused_export__ = ({ enumerable: true, get: function () { return ste_promise_simple_events_1.PromiseSimpleEventHandlingBase; } }); __webpack_unused_export__ = ({ enumerable: true, get: function () { return ste_promise_simple_events_1.PromiseSimpleEventList; } }); __webpack_unused_export__ = ({ enumerable: true, get: function () { return ste_promise_simple_events_1.NonUniformPromiseSimpleEventList; } }); + + +/***/ }), + +/***/ 6377: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +// A library of seedable RNGs implemented in Javascript. +// +// Usage: +// +// var seedrandom = require('seedrandom'); +// var random = seedrandom(1); // or any seed. +// var x = random(); // 0 <= x < 1. Every bit is random. +// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + +// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. +// Period: ~2^116 +// Reported to pass all BigCrush tests. +var alea = __webpack_require__(4832); + +// xor128, a pure xor-shift generator by George Marsaglia. +// Period: 2^128-1. +// Reported to fail: MatrixRank and LinearComp. +var xor128 = __webpack_require__(8652); + +// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. +// Period: 2^192-2^32 +// Reported to fail: CollisionOver, SimpPoker, and LinearComp. +var xorwow = __webpack_require__(801); + +// xorshift7, by François Panneton and Pierre L'ecuyer, takes +// a different approach: it adds robustness by allowing more shifts +// than Marsaglia's original three. It is a 7-shift generator +// with 256 bits, that passes BigCrush with no systmatic failures. +// Period 2^256-1. +// No systematic BigCrush failures reported. +var xorshift7 = __webpack_require__(2030); + +// xor4096, by Richard Brent, is a 4096-bit xor-shift with a +// very long period that also adds a Weyl generator. It also passes +// BigCrush with no systematic failures. Its long period may +// be useful if you have many generators and need to avoid +// collisions. +// Period: 2^4128-2^32. +// No systematic BigCrush failures reported. +var xor4096 = __webpack_require__(3618); + +// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random +// number generator derived from ChaCha, a modern stream cipher. +// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf +// Period: ~2^127 +// No systematic BigCrush failures reported. +var tychei = __webpack_require__(9049); + +// The original ARC4-based prng included in this library. +// Period: ~2^1600 +var sr = __webpack_require__(1971); + +sr.alea = alea; +sr.xor128 = xor128; +sr.xorwow = xorwow; +sr.xorshift7 = xorshift7; +sr.xor4096 = xor4096; +sr.tychei = tychei; + +module.exports = sr; + + +/***/ }), + +/***/ 4832: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A port of an algorithm by Johannes Baagøe , 2010 +// http://baagoe.com/en/RandomMusings/javascript/ +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror +// Original work is under MIT license - + +// Copyright (C) 2010 by Johannes Baagøe +// +// 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(global, module, define) { + +function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; +} + +function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; +} + +function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; +} + + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.alea = impl; +} + +})( + this, + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + + + +/***/ }), + +/***/ 9049: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "Tyche-i" prng algorithm by +// Samuel Neves and Filipe Araujo. +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; +}; + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.tychei = impl; +} + +})( + this, + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + + + +/***/ }), + +/***/ 8652: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xor128" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.xor128 = impl; +} + +})( + this, + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + + + +/***/ }), + +/***/ 3618: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. +// +// This fast non-cryptographic random number generator is designed for +// use in Monte-Carlo algorithms. It combines a long-period xorshift +// generator with a Weyl generator, and it passes all common batteries +// of stasticial tests for randomness while consuming only a few nanoseconds +// for each prng generated. For background on the generator, see Brent's +// paper: "Some long-period random number generators using shifts and xors." +// http://arxiv.org/pdf/1004.3115v1.pdf +// +// Usage: +// +// var xor4096 = require('xor4096'); +// random = xor4096(1); // Seed with int32 or string. +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. +// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. +// +// For nonzero numeric keys, this impelementation provides a sequence +// identical to that by Brent's xorgens 3 implementaion in C. This +// implementation also provides for initalizing the generator with +// string seeds, or for saving and restoring the state of the generator. +// +// On Chrome, this prng benchmarks about 2.1 times slower than +// Javascript's built-in Math.random(). + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); +} + +function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; +}; + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.xor4096 = impl; +} + +})( + this, // window object or global + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + +/***/ }), + +/***/ 2030: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorshift7" algorithm by +// François Panneton and Pierre L'ecuyer: +// "On the Xorgshift Random Number Generators" +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v, w; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); +} + +function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; +} + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.xorshift7 = impl; +} + +})( + this, + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + + +/***/ }), + +/***/ 801: +/***/ (function(module, exports, __webpack_require__) { + +/* module decorator */ module = __webpack_require__.nmd(module); +var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorwow" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (__webpack_require__.amdD && __webpack_require__.amdO) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} else { + this.xorwow = impl; +} + +})( + this, + true && module, // present in node.js + __webpack_require__.amdD // present with an AMD loader +); + + + + +/***/ }), + +/***/ 1971: +/***/ ((module, exports, __webpack_require__) => { + +var __WEBPACK_AMD_DEFINE_RESULT__;/* +Copyright 2014 David Bau. + +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 (pool, math) { +// +// The following constants are related to IEEE 754 limits. +// + +// Detect the global object, even if operating in strict mode. +// http://stackoverflow.com/a/14387057/265298 +var global = (0, eval)('this'), + width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + +// +// seedrandom() +// This is the seedrandom function described above. +// +function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} +math['seed' + rngname] = seedrandom; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ( true && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = __webpack_require__(5042); + } catch (ex) {} +} else if (true) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return seedrandom; }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); +} + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); + + +/***/ }), + +/***/ 7650: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var seedrandom = __webpack_require__(6377); +var self = __webpack_require__(1987); + +module.exports = self; + + + +/***/ }), + +/***/ 1987: +/***/ (function(module) { + +;(function() { + var self = {}; + + if(Math.seedrandom) seedrandom = Math.seedrandom; + + var isArray = function($){ + return Object.prototype.toString.call( $ ) === '[object Array]' + } + + var extend = function(obj) { + for (var i = 1; i < arguments.length; i++) for (var key in arguments[i]) obj[key] = arguments[i][key]; + return obj; + } + + var seedify = function(seed){ + if (/(number|string)/i.test(Object.prototype.toString.call(seed).match(/^\[object (.*)\]$/)[1])) return seed; + if (isNaN(seed)) return Number(String((this.strSeed = seed)).split('').map(function(x){return x.charCodeAt(0)}).join('')); + return seed; + } + + var seedRand = function(func,min,max){ + return Math.floor(func() * (max - min + 1)) + min; + } + + self.shuffle = function(arr,seed){ + if (!isArray(arr)) return null; + seed = seedify(seed) || 'none'; + + var size = arr.length; + var rng = seedrandom(seed); + var resp = []; + var keys = []; + + for(var i=0;i { + +/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */ +(function () { + 'use strict'; + + // polyfill + function polyfill() { + // aliases + var w = window; + var d = document; + + // return if scroll behavior is supported and polyfill is not forced + if ( + 'scrollBehavior' in d.documentElement.style && + w.__forceSmoothScrollPolyfill__ !== true + ) { + return; + } + + // globals + var Element = w.HTMLElement || w.Element; + var SCROLL_TIME = 468; + + // object gathering original scroll methods + var original = { + scroll: w.scroll || w.scrollTo, + scrollBy: w.scrollBy, + elementScroll: Element.prototype.scroll || scrollElement, + scrollIntoView: Element.prototype.scrollIntoView + }; + + // define timing method + var now = + w.performance && w.performance.now + ? w.performance.now.bind(w.performance) + : Date.now; + + /** + * indicates if a the current browser is made by Microsoft + * @method isMicrosoftBrowser + * @param {String} userAgent + * @returns {Boolean} + */ + function isMicrosoftBrowser(userAgent) { + var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/']; + + return new RegExp(userAgentPatterns.join('|')).test(userAgent); + } + + /* + * IE has rounding bug rounding down clientHeight and clientWidth and + * rounding up scrollHeight and scrollWidth causing false positives + * on hasScrollableSpace + */ + var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0; + + /** + * changes scroll position inside an element + * @method scrollElement + * @param {Number} x + * @param {Number} y + * @returns {undefined} + */ + function scrollElement(x, y) { + this.scrollLeft = x; + this.scrollTop = y; + } + + /** + * returns result of applying ease math function to a number + * @method ease + * @param {Number} k + * @returns {Number} + */ + function ease(k) { + return 0.5 * (1 - Math.cos(Math.PI * k)); + } + + /** + * indicates if a smooth behavior should be applied + * @method shouldBailOut + * @param {Number|Object} firstArg + * @returns {Boolean} + */ + function shouldBailOut(firstArg) { + if ( + firstArg === null || + typeof firstArg !== 'object' || + firstArg.behavior === undefined || + firstArg.behavior === 'auto' || + firstArg.behavior === 'instant' + ) { + // first argument is not an object/null + // or behavior is auto, instant or undefined + return true; + } + + if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') { + // first argument is an object and behavior is smooth + return false; + } + + // throw error when behavior is not supported + throw new TypeError( + 'behavior member of ScrollOptions ' + + firstArg.behavior + + ' is not a valid value for enumeration ScrollBehavior.' + ); + } + + /** + * indicates if an element has scrollable space in the provided axis + * @method hasScrollableSpace + * @param {Node} el + * @param {String} axis + * @returns {Boolean} + */ + function hasScrollableSpace(el, axis) { + if (axis === 'Y') { + return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight; + } + + if (axis === 'X') { + return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth; + } + } + + /** + * indicates if an element has a scrollable overflow property in the axis + * @method canOverflow + * @param {Node} el + * @param {String} axis + * @returns {Boolean} + */ + function canOverflow(el, axis) { + var overflowValue = w.getComputedStyle(el, null)['overflow' + axis]; + + return overflowValue === 'auto' || overflowValue === 'scroll'; + } + + /** + * indicates if an element can be scrolled in either axis + * @method isScrollable + * @param {Node} el + * @param {String} axis + * @returns {Boolean} + */ + function isScrollable(el) { + var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y'); + var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X'); + + return isScrollableY || isScrollableX; + } + + /** + * finds scrollable parent of an element + * @method findScrollableParent + * @param {Node} el + * @returns {Node} el + */ + function findScrollableParent(el) { + while (el !== d.body && isScrollable(el) === false) { + el = el.parentNode || el.host; + } + + return el; + } + + /** + * self invoked function that, given a context, steps through scrolling + * @method step + * @param {Object} context + * @returns {undefined} + */ + function step(context) { + var time = now(); + var value; + var currentX; + var currentY; + var elapsed = (time - context.startTime) / SCROLL_TIME; + + // avoid elapsed times higher than one + elapsed = elapsed > 1 ? 1 : elapsed; + + // apply easing to elapsed time + value = ease(elapsed); + + currentX = context.startX + (context.x - context.startX) * value; + currentY = context.startY + (context.y - context.startY) * value; + + context.method.call(context.scrollable, currentX, currentY); + + // scroll more if we have not reached our destination + if (currentX !== context.x || currentY !== context.y) { + w.requestAnimationFrame(step.bind(w, context)); + } + } + + /** + * scrolls window or element with a smooth behavior + * @method smoothScroll + * @param {Object|Node} el + * @param {Number} x + * @param {Number} y + * @returns {undefined} + */ + function smoothScroll(el, x, y) { + var scrollable; + var startX; + var startY; + var method; + var startTime = now(); + + // define scroll context + if (el === d.body) { + scrollable = w; + startX = w.scrollX || w.pageXOffset; + startY = w.scrollY || w.pageYOffset; + method = original.scroll; + } else { + scrollable = el; + startX = el.scrollLeft; + startY = el.scrollTop; + method = scrollElement; + } + + // scroll looping over a frame + step({ + scrollable: scrollable, + method: method, + startTime: startTime, + startX: startX, + startY: startY, + x: x, + y: y + }); + } + + // ORIGINAL METHODS OVERRIDES + // w.scroll and w.scrollTo + w.scroll = w.scrollTo = function() { + // avoid action when no arguments are passed + if (arguments[0] === undefined) { + return; + } + + // avoid smooth behavior if not required + if (shouldBailOut(arguments[0]) === true) { + original.scroll.call( + w, + arguments[0].left !== undefined + ? arguments[0].left + : typeof arguments[0] !== 'object' + ? arguments[0] + : w.scrollX || w.pageXOffset, + // use top prop, second argument if present or fallback to scrollY + arguments[0].top !== undefined + ? arguments[0].top + : arguments[1] !== undefined + ? arguments[1] + : w.scrollY || w.pageYOffset + ); + + return; + } + + // LET THE SMOOTHNESS BEGIN! + smoothScroll.call( + w, + d.body, + arguments[0].left !== undefined + ? ~~arguments[0].left + : w.scrollX || w.pageXOffset, + arguments[0].top !== undefined + ? ~~arguments[0].top + : w.scrollY || w.pageYOffset + ); + }; + + // w.scrollBy + w.scrollBy = function() { + // avoid action when no arguments are passed + if (arguments[0] === undefined) { + return; + } + + // avoid smooth behavior if not required + if (shouldBailOut(arguments[0])) { + original.scrollBy.call( + w, + arguments[0].left !== undefined + ? arguments[0].left + : typeof arguments[0] !== 'object' ? arguments[0] : 0, + arguments[0].top !== undefined + ? arguments[0].top + : arguments[1] !== undefined ? arguments[1] : 0 + ); + + return; + } + + // LET THE SMOOTHNESS BEGIN! + smoothScroll.call( + w, + d.body, + ~~arguments[0].left + (w.scrollX || w.pageXOffset), + ~~arguments[0].top + (w.scrollY || w.pageYOffset) + ); + }; + + // Element.prototype.scroll and Element.prototype.scrollTo + Element.prototype.scroll = Element.prototype.scrollTo = function() { + // avoid action when no arguments are passed + if (arguments[0] === undefined) { + return; + } + + // avoid smooth behavior if not required + if (shouldBailOut(arguments[0]) === true) { + // if one number is passed, throw error to match Firefox implementation + if (typeof arguments[0] === 'number' && arguments[1] === undefined) { + throw new SyntaxError('Value could not be converted'); + } + + original.elementScroll.call( + this, + // use left prop, first number argument or fallback to scrollLeft + arguments[0].left !== undefined + ? ~~arguments[0].left + : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft, + // use top prop, second argument or fallback to scrollTop + arguments[0].top !== undefined + ? ~~arguments[0].top + : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop + ); + + return; + } + + var left = arguments[0].left; + var top = arguments[0].top; + + // LET THE SMOOTHNESS BEGIN! + smoothScroll.call( + this, + this, + typeof left === 'undefined' ? this.scrollLeft : ~~left, + typeof top === 'undefined' ? this.scrollTop : ~~top + ); + }; + + // Element.prototype.scrollBy + Element.prototype.scrollBy = function() { + // avoid action when no arguments are passed + if (arguments[0] === undefined) { + return; + } + + // avoid smooth behavior if not required + if (shouldBailOut(arguments[0]) === true) { + original.elementScroll.call( + this, + arguments[0].left !== undefined + ? ~~arguments[0].left + this.scrollLeft + : ~~arguments[0] + this.scrollLeft, + arguments[0].top !== undefined + ? ~~arguments[0].top + this.scrollTop + : ~~arguments[1] + this.scrollTop + ); + + return; + } + + this.scroll({ + left: ~~arguments[0].left + this.scrollLeft, + top: ~~arguments[0].top + this.scrollTop, + behavior: arguments[0].behavior + }); + }; + + // Element.prototype.scrollIntoView + Element.prototype.scrollIntoView = function() { + // avoid smooth behavior if not required + if (shouldBailOut(arguments[0]) === true) { + original.scrollIntoView.call( + this, + arguments[0] === undefined ? true : arguments[0] + ); + + return; + } + + // LET THE SMOOTHNESS BEGIN! + var scrollableParent = findScrollableParent(this); + var parentRects = scrollableParent.getBoundingClientRect(); + var clientRects = this.getBoundingClientRect(); + + if (scrollableParent !== d.body) { + // reveal element inside parent + smoothScroll.call( + this, + scrollableParent, + scrollableParent.scrollLeft + clientRects.left - parentRects.left, + scrollableParent.scrollTop + clientRects.top - parentRects.top + ); + + // reveal parent in viewport unless is fixed + if (w.getComputedStyle(scrollableParent).position !== 'fixed') { + w.scrollBy({ + left: parentRects.left, + top: parentRects.top, + behavior: 'smooth' + }); + } + } else { + // reveal element in viewport + w.scrollBy({ + left: clientRects.left, + top: clientRects.top, + behavior: 'smooth' + }); + } + }; + } + + if (true) { + // commonjs + module.exports = { polyfill: polyfill }; + } else {} + +}()); + + +/***/ }), + +/***/ 6357: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; - -/***/ }), - -/***/ 6377: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -// A library of seedable RNGs implemented in Javascript. -// -// Usage: -// -// var seedrandom = require('seedrandom'); -// var random = seedrandom(1); // or any seed. -// var x = random(); // 0 <= x < 1. Every bit is random. -// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. - -// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. -// Period: ~2^116 -// Reported to pass all BigCrush tests. -var alea = __webpack_require__(4832); - -// xor128, a pure xor-shift generator by George Marsaglia. -// Period: 2^128-1. -// Reported to fail: MatrixRank and LinearComp. -var xor128 = __webpack_require__(8652); - -// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. -// Period: 2^192-2^32 -// Reported to fail: CollisionOver, SimpPoker, and LinearComp. -var xorwow = __webpack_require__(801); - -// xorshift7, by François Panneton and Pierre L'ecuyer, takes -// a different approach: it adds robustness by allowing more shifts -// than Marsaglia's original three. It is a 7-shift generator -// with 256 bits, that passes BigCrush with no systmatic failures. -// Period 2^256-1. -// No systematic BigCrush failures reported. -var xorshift7 = __webpack_require__(2030); - -// xor4096, by Richard Brent, is a 4096-bit xor-shift with a -// very long period that also adds a Weyl generator. It also passes -// BigCrush with no systematic failures. Its long period may -// be useful if you have many generators and need to avoid -// collisions. -// Period: 2^4128-2^32. -// No systematic BigCrush failures reported. -var xor4096 = __webpack_require__(3618); - -// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random -// number generator derived from ChaCha, a modern stream cipher. -// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf -// Period: ~2^127 -// No systematic BigCrush failures reported. -var tychei = __webpack_require__(9049); - -// The original ARC4-based prng included in this library. -// Period: ~2^1600 -var sr = __webpack_require__(1971); - -sr.alea = alea; -sr.xor128 = xor128; -sr.xorwow = xorwow; -sr.xorshift7 = xorshift7; -sr.xor4096 = xor4096; -sr.tychei = tychei; - -module.exports = sr; - - -/***/ }), - -/***/ 4832: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A port of an algorithm by Johannes Baagøe , 2010 -// http://baagoe.com/en/RandomMusings/javascript/ -// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror -// Original work is under MIT license - - -// Copyright (C) 2010 by Johannes Baagøe -// -// 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(global, module, define) { - -function Alea(seed) { - var me = this, mash = Mash(); - - me.next = function() { - var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 - me.s0 = me.s1; - me.s1 = me.s2; - return me.s2 = t - (me.c = t | 0); - }; - - // Apply the seeding algorithm from Baagoe. - me.c = 1; - me.s0 = mash(' '); - me.s1 = mash(' '); - me.s2 = mash(' '); - me.s0 -= mash(seed); - if (me.s0 < 0) { me.s0 += 1; } - me.s1 -= mash(seed); - if (me.s1 < 0) { me.s1 += 1; } - me.s2 -= mash(seed); - if (me.s2 < 0) { me.s2 += 1; } - mash = null; -} - -function copy(f, t) { - t.c = f.c; - t.s0 = f.s0; - t.s1 = f.s1; - t.s2 = f.s2; - return t; -} - -function impl(seed, opts) { - var xg = new Alea(seed), - state = opts && opts.state, - prng = xg.next; - prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } - prng.double = function() { - return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 - }; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NonUniformPromiseEventList = void 0; +const PromiseEventDispatcher_1 = __webpack_require__(5072); +/** + * Similar to EventList, but instead of TArgs, a map of event names ang argument types is provided with TArgsMap. + */ +class NonUniformPromiseEventList { + constructor() { + this._events = {}; + } + /** + * Gets the dispatcher associated with the name. + * @param name The name of the event. + */ + get(name) { + if (this._events[name]) { + // @TODO avoid typecasting. Not sure why TS thinks this._events[name] could still be undefined. + return this._events[name]; + } + const event = this.createDispatcher(); + this._events[name] = event; + return event; + } + /** + * Removes the dispatcher associated with the name. + * @param name The name of the event. + */ + remove(name) { + delete this._events[name]; + } + /** + * Creates a new dispatcher instance. + */ + createDispatcher() { + return new PromiseEventDispatcher_1.PromiseEventDispatcher(); + } } +exports.NonUniformPromiseEventList = NonUniformPromiseEventList; + + +/***/ }), + +/***/ 5072: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -function Mash() { - var n = 0xefc8249d; - - var mash = function(data) { - data = data.toString(); - for (var i = 0; i < data.length; i++) { - n += data.charCodeAt(i); - var h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000; // 2^32 +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseEventDispatcher = void 0; +const ste_core_1 = __webpack_require__(2874); +/** + * Dispatcher implementation for events. Can be used to subscribe, unsubscribe + * or dispatch events. Use the ToEvent() method to expose the event. + * + * @export + * @class PromiseEventDispatcher + * @extends {PromiseDispatcherBase>} + * @implements {IPromiseEvent} + * @template TSender + * @template TArgs + */ +class PromiseEventDispatcher extends ste_core_1.PromiseDispatcherBase { + /** + * Creates a new EventDispatcher instance. + */ + constructor() { + super(); + } + /** + * Dispatches the event. + * + * @param {TSender} sender The sender object. + * @param {TArgs} args The argument object. + * @returns {Promise} The status. + * + * @memberOf PromiseEventDispatcher + */ + async dispatch(sender, args) { + const result = await this._dispatchAsPromise(false, this, arguments); + if (result == null) { + throw new ste_core_1.DispatchError("Got `null` back from dispatch."); + } + return result; + } + /** + * Dispatches the event without waiting for the result. + * + * @param {TSender} sender The sender object. + * @param {TArgs} args The argument object. + * + * @memberOf PromiseEventDispatcher + */ + dispatchAsync(sender, args) { + this._dispatchAsPromise(true, this, arguments); + } + /** + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. + */ + asEvent() { + return super.asEvent(); } - return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 - }; - - return mash; } +exports.PromiseEventDispatcher = PromiseEventDispatcher; + + +/***/ }), + +/***/ 7873: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; - -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.alea = impl; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseEventHandlingBase = void 0; +const ste_core_1 = __webpack_require__(2874); +const PromiseEventList_1 = __webpack_require__(4414); +/** + * Extends objects with signal event handling capabilities. + */ +class PromiseEventHandlingBase extends ste_core_1.HandlingBase { + constructor() { + super(new PromiseEventList_1.PromiseEventList()); + } } +exports.PromiseEventHandlingBase = PromiseEventHandlingBase; + + +/***/ }), + +/***/ 4414: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -})( - this, - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - - - -/***/ }), - -/***/ 9049: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "Tyche-i" prng algorithm by -// Samuel Neves and Filipe Araujo. -// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var b = me.b, c = me.c, d = me.d, a = me.a; - b = (b << 25) ^ (b >>> 7) ^ c; - c = (c - d) | 0; - d = (d << 24) ^ (d >>> 8) ^ a; - a = (a - b) | 0; - me.b = b = (b << 20) ^ (b >>> 12) ^ c; - me.c = c = (c - d) | 0; - me.d = (d << 16) ^ (c >>> 16) ^ a; - return me.a = (a - b) | 0; - }; - - /* The following is non-inverted tyche, which has better internal - * bit diffusion, but which is about 25% slower than tyche-i in JS. - me.next = function() { - var a = me.a, b = me.b, c = me.c, d = me.d; - a = (me.a + me.b | 0) >>> 0; - d = me.d ^ a; d = d << 16 ^ d >>> 16; - c = me.c + d | 0; - b = me.b ^ c; b = b << 12 ^ d >>> 20; - me.a = a = a + b | 0; - d = d ^ a; me.d = d = d << 8 ^ d >>> 24; - me.c = c = c + d | 0; - b = b ^ c; - return me.b = (b << 7 ^ b >>> 25); - } - */ - - me.a = 0; - me.b = 0; - me.c = 2654435769 | 0; - me.d = 1367130551; - - if (seed === Math.floor(seed)) { - // Integer seed. - me.a = (seed / 0x100000000) | 0; - me.b = seed | 0; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 20; k++) { - me.b ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.a = f.a; - t.b = f.b; - t.c = f.c; - t.d = f.d; - return t; -}; - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.tychei = impl; -} - -})( - this, - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - - - -/***/ }), - -/***/ 8652: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xor128" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - - // Set up generator function. - me.next = function() { - var t = me.x ^ (me.x << 11); - me.x = me.y; - me.y = me.z; - me.z = me.w; - return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); - }; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.xor128 = impl; -} - -})( - this, - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - - - -/***/ }), - -/***/ 3618: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. -// -// This fast non-cryptographic random number generator is designed for -// use in Monte-Carlo algorithms. It combines a long-period xorshift -// generator with a Weyl generator, and it passes all common batteries -// of stasticial tests for randomness while consuming only a few nanoseconds -// for each prng generated. For background on the generator, see Brent's -// paper: "Some long-period random number generators using shifts and xors." -// http://arxiv.org/pdf/1004.3115v1.pdf -// -// Usage: -// -// var xor4096 = require('xor4096'); -// random = xor4096(1); // Seed with int32 or string. -// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. -// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. -// -// For nonzero numeric keys, this impelementation provides a sequence -// identical to that by Brent's xorgens 3 implementaion in C. This -// implementation also provides for initalizing the generator with -// string seeds, or for saving and restoring the state of the generator. -// -// On Chrome, this prng benchmarks about 2.1 times slower than -// Javascript's built-in Math.random(). - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - var w = me.w, - X = me.X, i = me.i, t, v; - // Update Weyl generator. - me.w = w = (w + 0x61c88647) | 0; - // Update xor generator. - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - // Update Xor generator array state. - v = X[i] = v ^ t; - me.i = i; - // Result is the combination. - return (v + (w ^ (w >>> 16))) | 0; - }; - - function init(me, seed) { - var t, v, i, j, w, X = [], limit = 128; - if (seed === (seed | 0)) { - // Numeric seeds initialize v, which is used to generates X. - v = seed; - seed = null; - } else { - // String seeds are mixed into v and X one character at a time. - seed = seed + '\0'; - v = 0; - limit = Math.max(limit, seed.length); - } - // Initialize circular array and weyl value. - for (i = 0, j = -32; j < limit; ++j) { - // Put the unicode characters into the array, and shuffle them. - if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); - // After 32 shuffles, take v as the starting w value. - if (j === 0) w = v; - v ^= v << 10; - v ^= v >>> 15; - v ^= v << 4; - v ^= v >>> 13; - if (j >= 0) { - w = (w + 0x61c88647) | 0; // Weyl. - t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. - i = (0 == t) ? i + 1 : 0; // Count zeroes. - } - } - // We have detected all zeroes; make the key nonzero. - if (i >= 128) { - X[(seed && seed.length || 0) & 127] = -1; - } - // Run the generator 512 times to further mix the state before using it. - // Factoring this as a function slows the main generator, so it is just - // unrolled here. The weyl generator is not advanced while warming up. - i = 127; - for (j = 4 * 128; j > 0; --j) { - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - X[i] = v ^ t; - } - // Storing state as object members is faster than using closure variables. - me.w = w; - me.X = X; - me.i = i; - } - - init(me, seed); -} - -function copy(f, t) { - t.i = f.i; - t.w = f.w; - t.X = f.X.slice(); - return t; -}; - -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.X) copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.xor4096 = impl; -} - -})( - this, // window object or global - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - -/***/ }), - -/***/ 2030: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorshift7" algorithm by -// François Panneton and Pierre L'ecuyer: -// "On the Xorgshift Random Number Generators" -// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - // Update xor generator. - var X = me.x, i = me.i, t, v, w; - t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); - t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); - t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); - t = X[(i + 4) & 7]; v ^= t ^ (t << 7); - t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); - X[i] = v; - me.i = (i + 1) & 7; - return v; - }; - - function init(me, seed) { - var j, w, X = []; - - if (seed === (seed | 0)) { - // Seed state array using a 32-bit integer. - w = X[0] = seed; - } else { - // Seed state using a string. - seed = '' + seed; - for (j = 0; j < seed.length; ++j) { - X[j & 7] = (X[j & 7] << 15) ^ - (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); - } +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseEventList = void 0; +const ste_core_1 = __webpack_require__(2874); +const PromiseEventDispatcher_1 = __webpack_require__(5072); +/** + * Storage class for multiple events that are accessible by name. + * Events dispatchers are automatically created. + */ +class PromiseEventList extends ste_core_1.EventListBase { + /** + * Creates a new EventList instance. + */ + constructor() { + super(); } - // Enforce an array length of 8, not all zeroes. - while (X.length < 8) X.push(0); - for (j = 0; j < 8 && X[j] === 0; ++j); - if (j == 8) w = X[7] = -1; else w = X[j]; - - me.x = X; - me.i = 0; - - // Discard an initial 256 values. - for (j = 256; j > 0; --j) { - me.next(); + /** + * Creates a new dispatcher instance. + */ + createDispatcher() { + return new PromiseEventDispatcher_1.PromiseEventDispatcher(); } - } - - init(me, seed); -} - -function copy(f, t) { - t.x = f.x.slice(); - t.i = f.i; - return t; -} - -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.x) copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.xorshift7 = impl; } +exports.PromiseEventList = PromiseEventList; + + +/***/ }), + +/***/ 6586: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -})( - this, - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - - -/***/ }), - -/***/ 801: -/***/ (function(module, exports, __webpack_require__) { - -/* module decorator */ module = __webpack_require__.nmd(module); -var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorwow" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var t = (me.x ^ (me.x >>> 2)); - me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; - return (me.d = (me.d + 362437 | 0)) + - (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; - }; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - me.v = 0; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } +/*! + * Strongly Typed Events for TypeScript - Core + * https://github.com/KeesCBakker/StronlyTypedEvents/ + * http://keestalkstech.com + * + * Copyright Kees C. Bakker / KeesTalksTech + * Released under the MIT license + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NonUniformPromiseEventList = exports.PromiseEventList = exports.PromiseEventHandlingBase = exports.PromiseEventDispatcher = void 0; +const PromiseEventDispatcher_1 = __webpack_require__(5072); +Object.defineProperty(exports, "PromiseEventDispatcher", ({ enumerable: true, get: function () { return PromiseEventDispatcher_1.PromiseEventDispatcher; } })); +const PromiseEventHandlingBase_1 = __webpack_require__(7873); +Object.defineProperty(exports, "PromiseEventHandlingBase", ({ enumerable: true, get: function () { return PromiseEventHandlingBase_1.PromiseEventHandlingBase; } })); +const PromiseEventList_1 = __webpack_require__(4414); +Object.defineProperty(exports, "PromiseEventList", ({ enumerable: true, get: function () { return PromiseEventList_1.PromiseEventList; } })); +const NonUniformPromiseEventList_1 = __webpack_require__(6357); +Object.defineProperty(exports, "NonUniformPromiseEventList", ({ enumerable: true, get: function () { return NonUniformPromiseEventList_1.NonUniformPromiseEventList; } })); + + +/***/ }), + +/***/ 4383: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - if (k == strseed.length) { - me.d = me.x << 10 ^ me.x >>> 4; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DispatchError = void 0; +/** + * Indicates an error with dispatching. + * + * @export + * @class DispatchError + * @extends {Error} + */ +class DispatchError extends Error { + /** + * Creates an instance of DispatchError. + * @param {string} message The message. + * + * @memberOf DispatchError + */ + constructor(message) { + super(message); } - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - t.v = f.v; - t.d = f.d; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); } - } - return prng; } +exports.DispatchError = DispatchError; + + +/***/ }), + +/***/ 894: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -if (module && module.exports) { - module.exports = impl; -} else if (__webpack_require__.amdD && __webpack_require__.amdO) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return impl; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} else { - this.xorwow = impl; -} - -})( - this, - true && module, // present in node.js - __webpack_require__.amdD // present with an AMD loader -); - - - - -/***/ }), - -/***/ 1971: -/***/ ((module, exports, __webpack_require__) => { - -var __WEBPACK_AMD_DEFINE_RESULT__;/* -Copyright 2014 David Bau. - -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 (pool, math) { -// -// The following constants are related to IEEE 754 limits. -// - -// Detect the global object, even if operating in strict mode. -// http://stackoverflow.com/a/14387057/265298 -var global = (0, eval)('this'), - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - -// -// seedrandom() -// This is the seedrandom function described above. -// -function seedrandom(seed, options, callback) { - var key = []; - options = (options == true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed == null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DispatcherBase = void 0; +const __1 = __webpack_require__(2874); +/** + * Base class for implementation of the dispatcher. It facilitates the subscribe + * and unsubscribe methods based on generic handlers. The TEventType specifies + * the type of event that should be exposed. Use the asEvent to expose the + * dispatcher as event. + * + * @export + * @abstract + * @class DispatcherBase + * @implements {ISubscribable} + * @template TEventHandler The type of event handler. + */ +class DispatcherBase { + constructor() { + /** + * The subscriptions. + * + * @protected + * + * @memberOf DispatcherBase + */ + this._subscriptions = new Array(); } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. + /** + * Returns the number of subscriptions. + * + * @readonly + * @type {number} + * @memberOf DispatcherBase + */ + get count() { + return this._subscriptions.length; } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; } - prng.quick = function() { return arc4.g(4) / 0x100000000; } - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); } + /** + * Triggered when subscriptions are changed (added or removed). + * + * @readonly + * @type {ISubscribable} + * @memberOf DispatcherBase + */ + get onSubscriptionChange() { + if (this._onSubscriptionChange == null) { + this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); -} -math['seed' + rngname] = seedrandom; - -// -// ARC4 -// -// An ARC4 implementation. The constructor takes a key in the form of -// an array of at most (width) integers that should be 0 <= x < (width). -// -// The g(count) method returns a pseudorandom integer that concatenates -// the next (count) outputs from ARC4. Its return value is a number x -// that is in the range 0 <= x < (width ^ count). -// -function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - (me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + return this._onSubscriptionChange.asEvent(); } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - // See http://google.com/search?q=rsa+fluhrer+response&btnI - })(width); -} - -// -// copy() -// Copies internal state of ARC4 to or from a plain object. -// -function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; -}; - -// -// flatten() -// Converts an object tree to nested arrays of strings. -// -function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + /** + * Subscribe to the event dispatcher. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherBase + */ + subscribe(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, false)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); -} - -// -// mixkey() -// Mixes a string seed into a key that is an array of integers, and -// returns a shortened string seed that is equivalent to the result key. -// -function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); -} - -// -// autoseed() -// Returns an object for autoseeding, using window.crypto and Node crypto -// module if available. -// -function autoseed() { - try { - var out; - if (nodecrypto && (out = nodecrypto.randomBytes)) { - // The use of 'out' to remember randomBytes makes tight minified code. - out = out(width); - } else { - out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); + /** + * Subscribe to the event dispatcher. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherBase + */ + sub(fn) { + return this.subscribe(fn); } - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date, global, plugins, global.screen, tostring(pool)]; - } -} - -// -// tostring() -// Converts an array of charcodes to a string -// -function tostring(a) { - return String.fromCharCode.apply(0, a); -} - -// -// When seedrandom.js is loaded, we immediately mix a few bits -// from the built-in RNG into the entropy pool. Because we do -// not want to interfere with deterministic PRNG state later, -// seedrandom will not call math.random on its own again after -// initialization. -// -mixkey(math.random(), pool); - -// -// Nodejs and AMD support: export the implementation as a module using -// either convention. -// -if ( true && module.exports) { - module.exports = seedrandom; - // When in node.js, try using crypto package for autoseeding. - try { - nodecrypto = __webpack_require__(5042); - } catch (ex) {} -} else if (true) { - !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return seedrandom; }).call(exports, __webpack_require__, exports, module), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); -} - -// End anonymous scope, and pass initial values. -})( - [], // pool: entropy pool starts empty - Math // math: package containing random, pow, and seedrandom -); - - -/***/ }), - -/***/ 7650: -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -var seedrandom = __webpack_require__(6377); -var self = __webpack_require__(1987); - -module.exports = self; - - - -/***/ }), - -/***/ 1987: -/***/ (function(module) { - -;(function() { - var self = {}; - - if(Math.seedrandom) seedrandom = Math.seedrandom; - - var isArray = function($){ - return Object.prototype.toString.call( $ ) === '[object Array]' - } - - var extend = function(obj) { - for (var i = 1; i < arguments.length; i++) for (var key in arguments[i]) obj[key] = arguments[i][key]; - return obj; - } - - var seedify = function(seed){ - if (/(number|string)/i.test(Object.prototype.toString.call(seed).match(/^\[object (.*)\]$/)[1])) return seed; - if (isNaN(seed)) return Number(String((this.strSeed = seed)).split('').map(function(x){return x.charCodeAt(0)}).join('')); - return seed; - } - - var seedRand = function(func,min,max){ - return Math.floor(func() * (max - min + 1)) + min; - } - - self.shuffle = function(arr,seed){ - if (!isArray(arr)) return null; - seed = seedify(seed) || 'none'; - - var size = arr.length; - var rng = seedrandom(seed); - var resp = []; - var keys = []; - - for(var i=0;i { - -/* smoothscroll v0.4.4 - 2019 - Dustan Kasten, Jeremias Menichelli - MIT License */ -(function () { - 'use strict'; - - // polyfill - function polyfill() { - // aliases - var w = window; - var d = document; - - // return if scroll behavior is supported and polyfill is not forced - if ( - 'scrollBehavior' in d.documentElement.style && - w.__forceSmoothScrollPolyfill__ !== true - ) { - return; - } - - // globals - var Element = w.HTMLElement || w.Element; - var SCROLL_TIME = 468; - - // object gathering original scroll methods - var original = { - scroll: w.scroll || w.scrollTo, - scrollBy: w.scrollBy, - elementScroll: Element.prototype.scroll || scrollElement, - scrollIntoView: Element.prototype.scrollIntoView - }; - - // define timing method - var now = - w.performance && w.performance.now - ? w.performance.now.bind(w.performance) - : Date.now; - /** - * indicates if a the current browser is made by Microsoft - * @method isMicrosoftBrowser - * @param {String} userAgent - * @returns {Boolean} + * Subscribe once to the event with the specified name. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherBase */ - function isMicrosoftBrowser(userAgent) { - var userAgentPatterns = ['MSIE ', 'Trident/', 'Edge/']; - - return new RegExp(userAgentPatterns.join('|')).test(userAgent); + one(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, true)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; } - - /* - * IE has rounding bug rounding down clientHeight and clientWidth and - * rounding up scrollHeight and scrollWidth causing false positives - * on hasScrollableSpace - */ - var ROUNDING_TOLERANCE = isMicrosoftBrowser(w.navigator.userAgent) ? 1 : 0; - /** - * changes scroll position inside an element - * @method scrollElement - * @param {Number} x - * @param {Number} y - * @returns {undefined} + * Checks it the event has a subscription for the specified handler. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase */ - function scrollElement(x, y) { - this.scrollLeft = x; - this.scrollTop = y; + has(fn) { + if (!fn) + return false; + return this._subscriptions.some((sub) => sub.handler == fn); } - /** - * returns result of applying ease math function to a number - * @method ease - * @param {Number} k - * @returns {Number} + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase */ - function ease(k) { - return 0.5 * (1 - Math.cos(Math.PI * k)); + unsubscribe(fn) { + if (!fn) + return; + let changes = false; + for (let i = 0; i < this._subscriptions.length; i++) { + if (this._subscriptions[i].handler == fn) { + this._subscriptions.splice(i, 1); + changes = true; + break; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } } - /** - * indicates if a smooth behavior should be applied - * @method shouldBailOut - * @param {Number|Object} firstArg - * @returns {Boolean} + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase */ - function shouldBailOut(firstArg) { - if ( - firstArg === null || - typeof firstArg !== 'object' || - firstArg.behavior === undefined || - firstArg.behavior === 'auto' || - firstArg.behavior === 'instant' - ) { - // first argument is not an object/null - // or behavior is auto, instant or undefined - return true; - } - - if (typeof firstArg === 'object' && firstArg.behavior === 'smooth') { - // first argument is an object and behavior is smooth - return false; - } - - // throw error when behavior is not supported - throw new TypeError( - 'behavior member of ScrollOptions ' + - firstArg.behavior + - ' is not a valid value for enumeration ScrollBehavior.' - ); + unsub(fn) { + this.unsubscribe(fn); } - /** - * indicates if an element has scrollable space in the provided axis - * @method hasScrollableSpace - * @param {Node} el - * @param {String} axis - * @returns {Boolean} + * Generic dispatch will dispatch the handlers with the given arguments. + * + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * + * @memberOf DispatcherBase */ - function hasScrollableSpace(el, axis) { - if (axis === 'Y') { - return el.clientHeight + ROUNDING_TOLERANCE < el.scrollHeight; - } - - if (axis === 'X') { - return el.clientWidth + ROUNDING_TOLERANCE < el.scrollWidth; - } + _dispatch(executeAsync, scope, args) { + //execute on a copy because of bug #9 + for (let sub of [...this._subscriptions]) { + let ev = new __1.EventManagement(() => this.unsub(sub.handler)); + let nargs = Array.prototype.slice.call(args); + nargs.push(ev); + let s = sub; + s.execute(executeAsync, scope, nargs); + //cleanup subs that are no longer needed + this.cleanup(sub); + if (!executeAsync && ev.propagationStopped) { + return { propagationStopped: true }; + } + } + if (executeAsync) { + return null; + } + return { propagationStopped: false }; } - /** - * indicates if an element has a scrollable overflow property in the axis - * @method canOverflow - * @param {Node} el - * @param {String} axis - * @returns {Boolean} + * Creates a subscription. + * + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce True if the handler should run only one. + * @returns {ISubscription} The subscription. + * + * @memberOf DispatcherBase */ - function canOverflow(el, axis) { - var overflowValue = w.getComputedStyle(el, null)['overflow' + axis]; - - return overflowValue === 'auto' || overflowValue === 'scroll'; + createSubscription(handler, isOnce) { + return new __1.Subscription(handler, isOnce); } - /** - * indicates if an element can be scrolled in either axis - * @method isScrollable - * @param {Node} el - * @param {String} axis - * @returns {Boolean} + * Cleans up subs that ran and should run only once. + * + * @protected + * @param {ISubscription} sub The subscription. + * + * @memberOf DispatcherBase */ - function isScrollable(el) { - var isScrollableY = hasScrollableSpace(el, 'Y') && canOverflow(el, 'Y'); - var isScrollableX = hasScrollableSpace(el, 'X') && canOverflow(el, 'X'); - - return isScrollableY || isScrollableX; + cleanup(sub) { + let changes = false; + if (sub.isOnce && sub.isExecuted) { + let i = this._subscriptions.indexOf(sub); + if (i > -1) { + this._subscriptions.splice(i, 1); + changes = true; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } } - /** - * finds scrollable parent of an element - * @method findScrollableParent - * @param {Node} el - * @returns {Node} el + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. + * + * @returns {ISubscribable} + * + * @memberOf DispatcherBase */ - function findScrollableParent(el) { - while (el !== d.body && isScrollable(el) === false) { - el = el.parentNode || el.host; - } - - return el; + asEvent() { + if (this._wrap == null) { + this._wrap = new __1.DispatcherWrapper(this); + } + return this._wrap; } - /** - * self invoked function that, given a context, steps through scrolling - * @method step - * @param {Object} context - * @returns {undefined} + * Clears the subscriptions. + * + * @memberOf DispatcherBase */ - function step(context) { - var time = now(); - var value; - var currentX; - var currentY; - var elapsed = (time - context.startTime) / SCROLL_TIME; - - // avoid elapsed times higher than one - elapsed = elapsed > 1 ? 1 : elapsed; - - // apply easing to elapsed time - value = ease(elapsed); - - currentX = context.startX + (context.x - context.startX) * value; - currentY = context.startY + (context.y - context.startY) * value; - - context.method.call(context.scrollable, currentX, currentY); - - // scroll more if we have not reached our destination - if (currentX !== context.x || currentY !== context.y) { - w.requestAnimationFrame(step.bind(w, context)); - } + clear() { + if (this._subscriptions.length != 0) { + this._subscriptions.splice(0, this._subscriptions.length); + this.triggerSubscriptionChange(); + } } - /** - * scrolls window or element with a smooth behavior - * @method smoothScroll - * @param {Object|Node} el - * @param {Number} x - * @param {Number} y - * @returns {undefined} + * Triggers the subscription change event. + * + * @private + * + * @memberOf DispatcherBase */ - function smoothScroll(el, x, y) { - var scrollable; - var startX; - var startY; - var method; - var startTime = now(); - - // define scroll context - if (el === d.body) { - scrollable = w; - startX = w.scrollX || w.pageXOffset; - startY = w.scrollY || w.pageYOffset; - method = original.scroll; - } else { - scrollable = el; - startX = el.scrollLeft; - startY = el.scrollTop; - method = scrollElement; - } - - // scroll looping over a frame - step({ - scrollable: scrollable, - method: method, - startTime: startTime, - startX: startX, - startY: startY, - x: x, - y: y - }); - } - - // ORIGINAL METHODS OVERRIDES - // w.scroll and w.scrollTo - w.scroll = w.scrollTo = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.scroll.call( - w, - arguments[0].left !== undefined - ? arguments[0].left - : typeof arguments[0] !== 'object' - ? arguments[0] - : w.scrollX || w.pageXOffset, - // use top prop, second argument if present or fallback to scrollY - arguments[0].top !== undefined - ? arguments[0].top - : arguments[1] !== undefined - ? arguments[1] - : w.scrollY || w.pageYOffset - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - w, - d.body, - arguments[0].left !== undefined - ? ~~arguments[0].left - : w.scrollX || w.pageXOffset, - arguments[0].top !== undefined - ? ~~arguments[0].top - : w.scrollY || w.pageYOffset - ); - }; - - // w.scrollBy - w.scrollBy = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0])) { - original.scrollBy.call( - w, - arguments[0].left !== undefined - ? arguments[0].left - : typeof arguments[0] !== 'object' ? arguments[0] : 0, - arguments[0].top !== undefined - ? arguments[0].top - : arguments[1] !== undefined ? arguments[1] : 0 - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - w, - d.body, - ~~arguments[0].left + (w.scrollX || w.pageXOffset), - ~~arguments[0].top + (w.scrollY || w.pageYOffset) - ); - }; - - // Element.prototype.scroll and Element.prototype.scrollTo - Element.prototype.scroll = Element.prototype.scrollTo = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - // if one number is passed, throw error to match Firefox implementation - if (typeof arguments[0] === 'number' && arguments[1] === undefined) { - throw new SyntaxError('Value could not be converted'); - } - - original.elementScroll.call( - this, - // use left prop, first number argument or fallback to scrollLeft - arguments[0].left !== undefined - ? ~~arguments[0].left - : typeof arguments[0] !== 'object' ? ~~arguments[0] : this.scrollLeft, - // use top prop, second argument or fallback to scrollTop - arguments[0].top !== undefined - ? ~~arguments[0].top - : arguments[1] !== undefined ? ~~arguments[1] : this.scrollTop - ); - - return; - } - - var left = arguments[0].left; - var top = arguments[0].top; - - // LET THE SMOOTHNESS BEGIN! - smoothScroll.call( - this, - this, - typeof left === 'undefined' ? this.scrollLeft : ~~left, - typeof top === 'undefined' ? this.scrollTop : ~~top - ); - }; - - // Element.prototype.scrollBy - Element.prototype.scrollBy = function() { - // avoid action when no arguments are passed - if (arguments[0] === undefined) { - return; - } - - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.elementScroll.call( - this, - arguments[0].left !== undefined - ? ~~arguments[0].left + this.scrollLeft - : ~~arguments[0] + this.scrollLeft, - arguments[0].top !== undefined - ? ~~arguments[0].top + this.scrollTop - : ~~arguments[1] + this.scrollTop - ); - - return; - } - - this.scroll({ - left: ~~arguments[0].left + this.scrollLeft, - top: ~~arguments[0].top + this.scrollTop, - behavior: arguments[0].behavior - }); - }; - - // Element.prototype.scrollIntoView - Element.prototype.scrollIntoView = function() { - // avoid smooth behavior if not required - if (shouldBailOut(arguments[0]) === true) { - original.scrollIntoView.call( - this, - arguments[0] === undefined ? true : arguments[0] - ); - - return; - } - - // LET THE SMOOTHNESS BEGIN! - var scrollableParent = findScrollableParent(this); - var parentRects = scrollableParent.getBoundingClientRect(); - var clientRects = this.getBoundingClientRect(); - - if (scrollableParent !== d.body) { - // reveal element inside parent - smoothScroll.call( - this, - scrollableParent, - scrollableParent.scrollLeft + clientRects.left - parentRects.left, - scrollableParent.scrollTop + clientRects.top - parentRects.top - ); - - // reveal parent in viewport unless is fixed - if (w.getComputedStyle(scrollableParent).position !== 'fixed') { - w.scrollBy({ - left: parentRects.left, - top: parentRects.top, - behavior: 'smooth' - }); + triggerSubscriptionChange() { + if (this._onSubscriptionChange != null) { + this._onSubscriptionChange.dispatch(this.count); } - } else { - // reveal element in viewport - w.scrollBy({ - left: clientRects.left, - top: clientRects.top, - behavior: 'smooth' - }); - } - }; - } - - if (true) { - // commonjs - module.exports = { polyfill: polyfill }; - } else {} - -}()); - - -/***/ }), - -/***/ 6357: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; + } +} +exports.DispatcherBase = DispatcherBase; + + +/***/ }), + +/***/ 9757: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NonUniformPromiseEventList = void 0; -const PromiseEventDispatcher_1 = __webpack_require__(5072); +exports.DispatcherWrapper = void 0; /** - * Similar to EventList, but instead of TArgs, a map of event names ang argument types is provided with TArgsMap. + * Hides the implementation of the event dispatcher. Will expose methods that + * are relevent to the event. + * + * @export + * @class DispatcherWrapper + * @implements {ISubscribable} + * @template TEventHandler The type of event handler. */ -class NonUniformPromiseEventList { - constructor() { - this._events = {}; +class DispatcherWrapper { + /** + * Creates an instance of DispatcherWrapper. + * @param {ISubscribable} dispatcher + * + * @memberOf DispatcherWrapper + */ + constructor(dispatcher) { + this._subscribe = (fn) => dispatcher.subscribe(fn); + this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); + this._one = (fn) => dispatcher.one(fn); + this._has = (fn) => dispatcher.has(fn); + this._clear = () => dispatcher.clear(); + this._count = () => dispatcher.count; + this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; } /** - * Gets the dispatcher associated with the name. - * @param name The name of the event. + * Triggered when subscriptions are changed (added or removed). + * + * @readonly + * @type {ISubscribable} + * @memberOf DispatcherWrapper */ - get(name) { - if (this._events[name]) { - // @TODO avoid typecasting. Not sure why TS thinks this._events[name] could still be undefined. - return this._events[name]; - } - const event = this.createDispatcher(); - this._events[name] = event; - return event; + get onSubscriptionChange() { + return this._onSubscriptionChange(); } /** - * Removes the dispatcher associated with the name. - * @param name The name of the event. + * Returns the number of subscriptions. + * + * @readonly + * @type {number} + * @memberOf DispatcherWrapper */ - remove(name) { - delete this._events[name]; + get count() { + return this._count(); } /** - * Creates a new dispatcher instance. + * Subscribe to the event dispatcher. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - createDispatcher() { - return new PromiseEventDispatcher_1.PromiseEventDispatcher(); + subscribe(fn) { + return this._subscribe(fn); } -} -exports.NonUniformPromiseEventList = NonUniformPromiseEventList; - - -/***/ }), - -/***/ 5072: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseEventDispatcher = void 0; -const ste_core_1 = __webpack_require__(2874); -/** - * Dispatcher implementation for events. Can be used to subscribe, unsubscribe - * or dispatch events. Use the ToEvent() method to expose the event. - * - * @export - * @class PromiseEventDispatcher - * @extends {PromiseDispatcherBase>} - * @implements {IPromiseEvent} - * @template TSender - * @template TArgs - */ -class PromiseEventDispatcher extends ste_core_1.PromiseDispatcherBase { /** - * Creates a new EventDispatcher instance. + * Subscribe to the event dispatcher. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - constructor() { - super(); + sub(fn) { + return this.subscribe(fn); } /** - * Dispatches the event. + * Unsubscribe from the event dispatcher. * - * @param {TSender} sender The sender object. - * @param {TArgs} args The argument object. - * @returns {Promise} The status. + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. * - * @memberOf PromiseEventDispatcher + * @memberOf DispatcherWrapper */ - async dispatch(sender, args) { - const result = await this._dispatchAsPromise(false, this, arguments); - if (result == null) { - throw new ste_core_1.DispatchError("Got `null` back from dispatch."); - } - return result; + unsubscribe(fn) { + this._unsubscribe(fn); } /** - * Dispatches the event without waiting for the result. + * Unsubscribe from the event dispatcher. * - * @param {TSender} sender The sender object. - * @param {TArgs} args The argument object. + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. * - * @memberOf PromiseEventDispatcher + * @memberOf DispatcherWrapper */ - dispatchAsync(sender, args) { - this._dispatchAsPromise(true, this, arguments); + unsub(fn) { + this.unsubscribe(fn); } /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. + * Subscribe once to the event with the specified name. + * + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - asEvent() { - return super.asEvent(); - } -} -exports.PromiseEventDispatcher = PromiseEventDispatcher; - - -/***/ }), - -/***/ 7873: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseEventHandlingBase = void 0; -const ste_core_1 = __webpack_require__(2874); -const PromiseEventList_1 = __webpack_require__(4414); -/** - * Extends objects with signal event handling capabilities. - */ -class PromiseEventHandlingBase extends ste_core_1.HandlingBase { - constructor() { - super(new PromiseEventList_1.PromiseEventList()); + one(fn) { + return this._one(fn); } -} -exports.PromiseEventHandlingBase = PromiseEventHandlingBase; - - -/***/ }), - -/***/ 4414: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseEventList = void 0; -const ste_core_1 = __webpack_require__(2874); -const PromiseEventDispatcher_1 = __webpack_require__(5072); -/** - * Storage class for multiple events that are accessible by name. - * Events dispatchers are automatically created. - */ -class PromiseEventList extends ste_core_1.EventListBase { /** - * Creates a new EventList instance. + * Checks it the event has a subscription for the specified handler. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - constructor() { - super(); + has(fn) { + return this._has(fn); } /** - * Creates a new dispatcher instance. + * Clears all the subscriptions. + * + * @memberOf DispatcherWrapper */ - createDispatcher() { - return new PromiseEventDispatcher_1.PromiseEventDispatcher(); + clear() { + this._clear(); } } -exports.PromiseEventList = PromiseEventList; - - -/***/ }), - -/***/ 6586: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Core - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NonUniformPromiseEventList = exports.PromiseEventList = exports.PromiseEventHandlingBase = exports.PromiseEventDispatcher = void 0; -const PromiseEventDispatcher_1 = __webpack_require__(5072); -Object.defineProperty(exports, "PromiseEventDispatcher", ({ enumerable: true, get: function () { return PromiseEventDispatcher_1.PromiseEventDispatcher; } })); -const PromiseEventHandlingBase_1 = __webpack_require__(7873); -Object.defineProperty(exports, "PromiseEventHandlingBase", ({ enumerable: true, get: function () { return PromiseEventHandlingBase_1.PromiseEventHandlingBase; } })); -const PromiseEventList_1 = __webpack_require__(4414); -Object.defineProperty(exports, "PromiseEventList", ({ enumerable: true, get: function () { return PromiseEventList_1.PromiseEventList; } })); -const NonUniformPromiseEventList_1 = __webpack_require__(6357); -Object.defineProperty(exports, "NonUniformPromiseEventList", ({ enumerable: true, get: function () { return NonUniformPromiseEventList_1.NonUniformPromiseEventList; } })); - - -/***/ }), - -/***/ 4383: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.DispatcherWrapper = DispatcherWrapper; + + +/***/ }), + +/***/ 5930: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatchError = void 0; +exports.EventListBase = void 0; /** - * Indicates an error with dispatching. + * Base class for event lists classes. Implements the get and remove. * * @export - * @class DispatchError - * @extends {Error} + * @abstract + * @class EventListBaset + * @template TEventDispatcher The type of event dispatcher. */ -class DispatchError extends Error { +class EventListBase { + constructor() { + this._events = {}; + } /** - * Creates an instance of DispatchError. - * @param {string} message The message. + * Gets the dispatcher associated with the name. * - * @memberOf DispatchError + * @param {string} name The name of the event. + * @returns {TEventDispatcher} The disptacher. + * + * @memberOf EventListBase */ - constructor(message) { - super(message); + get(name) { + let event = this._events[name]; + if (event) { + return event; + } + event = this.createDispatcher(); + this._events[name] = event; + return event; + } + /** + * Removes the dispatcher associated with the name. + * + * @param {string} name + * + * @memberOf EventListBase + */ + remove(name) { + delete this._events[name]; } } -exports.DispatchError = DispatchError; - - -/***/ }), - -/***/ 894: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.EventListBase = EventListBase; + + +/***/ }), + +/***/ 7541: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherBase = void 0; +exports.PromiseDispatcherBase = void 0; const __1 = __webpack_require__(2874); /** - * Base class for implementation of the dispatcher. It facilitates the subscribe - * and unsubscribe methods based on generic handlers. The TEventType specifies - * the type of event that should be exposed. Use the asEvent to expose the - * dispatcher as event. + * Dispatcher base for dispatchers that use promises. Each promise + * is awaited before the next is dispatched, unless the event is + * dispatched with the executeAsync flag. * * @export * @abstract - * @class DispatcherBase - * @implements {ISubscribable} + * @class PromiseDispatcherBase + * @extends {DispatcherBase} * @template TEventHandler The type of event handler. */ -class DispatcherBase { - constructor() { - /** - * The subscriptions. - * - * @protected - * - * @memberOf DispatcherBase - */ - this._subscriptions = new Array(); - } +class PromiseDispatcherBase extends __1.DispatcherBase { /** - * Returns the number of subscriptions. - * - * @readonly - * @type {number} - * @memberOf DispatcherBase - */ - get count() { - return this._subscriptions.length; - } - /** - * Triggered when subscriptions are changed (added or removed). - * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherBase - */ - get onSubscriptionChange() { - if (this._onSubscriptionChange == null) { - this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); - } - return this._onSubscriptionChange.asEvent(); - } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherBase - */ - subscribe(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, false)); - this.triggerSubscriptionChange(); - } - return () => { - this.unsubscribe(fn); - }; - } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherBase - */ - sub(fn) { - return this.subscribe(fn); - } - /** - * Subscribe once to the event with the specified name. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherBase - */ - one(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, true)); - this.triggerSubscriptionChange(); - } - return () => { - this.unsubscribe(fn); - }; - } - /** - * Checks it the event has a subscription for the specified handler. - * - * @param {TEventHandler} fn The event handler. - * - * @memberOf DispatcherBase - */ - has(fn) { - if (!fn) - return false; - return this._subscriptions.some((sub) => sub.handler == fn); - } - /** - * Unsubscribes the handler from the dispatcher. + * The normal dispatch cannot be used in this class. * - * @param {TEventHandler} fn The event handler. + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. * * @memberOf DispatcherBase */ - unsubscribe(fn) { - if (!fn) - return; - let changes = false; - for (let i = 0; i < this._subscriptions.length; i++) { - if (this._subscriptions[i].handler == fn) { - this._subscriptions.splice(i, 1); - changes = true; - break; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } + _dispatch(executeAsync, scope, args) { + throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); } /** - * Unsubscribes the handler from the dispatcher. + * Crates a new subscription. * - * @param {TEventHandler} fn The event handler. + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce Indicates if the handler should only run once. + * @returns {ISubscription} The subscription. * - * @memberOf DispatcherBase + * @memberOf PromiseDispatcherBase */ - unsub(fn) { - this.unsubscribe(fn); + createSubscription(handler, isOnce) { + return new __1.PromiseSubscription(handler, isOnce); } /** * Generic dispatch will dispatch the handlers with the given arguments. @@ -3413,14 +3747,14 @@ class DispatcherBase { * * @memberOf DispatcherBase */ - _dispatch(executeAsync, scope, args) { + async _dispatchAsPromise(executeAsync, scope, args) { //execute on a copy because of bug #9 for (let sub of [...this._subscriptions]) { let ev = new __1.EventManagement(() => this.unsub(sub.handler)); let nargs = Array.prototype.slice.call(args); nargs.push(ev); - let s = sub; - s.execute(executeAsync, scope, nargs); + let ps = sub; + await ps.execute(executeAsync, scope, nargs); //cleanup subs that are no longer needed this.cleanup(sub); if (!executeAsync && ev.propagationStopped) { @@ -3432,309 +3766,638 @@ class DispatcherBase { } return { propagationStopped: false }; } +} +exports.PromiseDispatcherBase = PromiseDispatcherBase; + + +/***/ }), + +/***/ 2545: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SubscriptionChangeEventDispatcher = void 0; +const __1 = __webpack_require__(2874); +/** + * Dispatcher for subscription changes. + * + * @export + * @class SubscriptionChangeEventDispatcher + * @extends {DispatcherBase} + */ +class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { /** - * Creates a subscription. + * Dispatches the event. * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce True if the handler should run only one. - * @returns {ISubscription} The subscription. + * @param {number} count The currrent number of subscriptions. * - * @memberOf DispatcherBase + * @memberOf SubscriptionChangeEventDispatcher */ - createSubscription(handler, isOnce) { - return new __1.Subscription(handler, isOnce); + dispatch(count) { + this._dispatch(false, this, arguments); } +} +exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; + + +/***/ }), + +/***/ 8452: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSubscription = void 0; +/** + * Subscription implementation for events with promises. + * + * @export + * @class PromiseSubscription + * @implements {ISubscription} + * @template TEventHandler The type of event handler. + */ +class PromiseSubscription { /** - * Cleans up subs that ran and should run only once. - * - * @protected - * @param {ISubscription} sub The subscription. + * Creates an instance of PromiseSubscription. + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. * - * @memberOf DispatcherBase + * @memberOf PromiseSubscription */ - cleanup(sub) { - let changes = false; - if (sub.isOnce && sub.isExecuted) { - let i = this._subscriptions.indexOf(sub); - if (i > -1) { - this._subscriptions.splice(i, 1); - changes = true; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } + constructor(handler, isOnce) { + this.handler = handler; + this.isOnce = isOnce; + /** + * Indicates if the subscription has been executed before. + * + * @memberOf PromiseSubscription + */ + this.isExecuted = false; } /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. + * Executes the handler. * - * @returns {ISubscribable} + * @param {boolean} executeAsync True if the even should be executed async. + * @param {*} scope The scope the scope of the event. + * @param {IArguments} args The arguments for the event. * - * @memberOf DispatcherBase + * @memberOf PromiseSubscription */ - asEvent() { - if (this._wrap == null) { - this._wrap = new __1.DispatcherWrapper(this); + async execute(executeAsync, scope, args) { + if (!this.isOnce || !this.isExecuted) { + this.isExecuted = true; + //TODO: do we need to cast to any -- seems yuck + var fn = this.handler; + if (executeAsync) { + setTimeout(() => { + fn.apply(scope, args); + }, 1); + return; + } + let result = fn.apply(scope, args); + await result; } - return this._wrap; } +} +exports.PromiseSubscription = PromiseSubscription; + + +/***/ }), + +/***/ 365: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Subscription = void 0; +/** + * Stores a handler. Manages execution meta data. + * @class Subscription + * @template TEventHandler + */ +class Subscription { /** - * Clears the subscriptions. + * Creates an instance of Subscription. * - * @memberOf DispatcherBase + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. */ - clear() { - if (this._subscriptions.length != 0) { - this._subscriptions.splice(0, this._subscriptions.length); - this.triggerSubscriptionChange(); - } + constructor(handler, isOnce) { + this.handler = handler; + this.isOnce = isOnce; + /** + * Indicates if the subscription has been executed before. + */ + this.isExecuted = false; } /** - * Triggers the subscription change event. - * - * @private + * Executes the handler. * - * @memberOf DispatcherBase + * @param {boolean} executeAsync True if the even should be executed async. + * @param {*} scope The scope the scope of the event. + * @param {IArguments} args The arguments for the event. */ - triggerSubscriptionChange() { - if (this._onSubscriptionChange != null) { - this._onSubscriptionChange.dispatch(this.count); + execute(executeAsync, scope, args) { + if (!this.isOnce || !this.isExecuted) { + this.isExecuted = true; + var fn = this.handler; + if (executeAsync) { + setTimeout(() => { + fn.apply(scope, args); + }, 1); + } + else { + fn.apply(scope, args); + } } } } -exports.DispatcherBase = DispatcherBase; - - -/***/ }), - -/***/ 9757: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.Subscription = Subscription; + + +/***/ }), + +/***/ 954: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherWrapper = void 0; +exports.HandlingBase = void 0; /** - * Hides the implementation of the event dispatcher. Will expose methods that - * are relevent to the event. + * Base class that implements event handling. With a an + * event list this base class will expose events that can be + * subscribed to. This will give your class generic events. * * @export - * @class DispatcherWrapper - * @implements {ISubscribable} + * @abstract + * @class HandlingBase * @template TEventHandler The type of event handler. + * @template TDispatcher The type of dispatcher. + * @template TList The type of event list. */ -class DispatcherWrapper { - /** - * Creates an instance of DispatcherWrapper. - * @param {ISubscribable} dispatcher - * - * @memberOf DispatcherWrapper - */ - constructor(dispatcher) { - this._subscribe = (fn) => dispatcher.subscribe(fn); - this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); - this._one = (fn) => dispatcher.one(fn); - this._has = (fn) => dispatcher.has(fn); - this._clear = () => dispatcher.clear(); - this._count = () => dispatcher.count; - this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; - } +class HandlingBase { /** - * Triggered when subscriptions are changed (added or removed). + * Creates an instance of HandlingBase. + * @param {TList} events The event list. Used for event management. * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - get onSubscriptionChange() { - return this._onSubscriptionChange(); + constructor(events) { + this.events = events; } /** - * Returns the number of subscriptions. + * Subscribes once to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @readonly - * @type {number} - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - get count() { - return this._count(); + one(name, fn) { + this.events.get(name).one(fn); } /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. + * Checks it the event has a subscription for the specified handler. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - subscribe(fn) { - return this._subscribe(fn); + has(name, fn) { + return this.events.get(name).has(fn); } /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. + * Subscribes to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - sub(fn) { - return this.subscribe(fn); + subscribe(name, fn) { + this.events.get(name).subscribe(fn); } /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * Subscribes to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - unsubscribe(fn) { - this._unsubscribe(fn); + sub(name, fn) { + this.subscribe(name, fn); } /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * Unsubscribes from the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - unsub(fn) { - this.unsubscribe(fn); + unsubscribe(name, fn) { + this.events.get(name).unsubscribe(fn); } /** - * Subscribe once to the event with the specified name. - * - * @returns {() => void} A function that unsubscribes the event handler from the event. + * Unsubscribes from the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherWrapper + * @memberOf HandlingBase */ - one(fn) { - return this._one(fn); + unsub(name, fn) { + this.unsubscribe(name, fn); } +} +exports.HandlingBase = HandlingBase; + + +/***/ }), + +/***/ 2874: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*! + * Strongly Typed Events for TypeScript - Core + * https://github.com/KeesCBakker/StronlyTypedEvents/ + * http://keestalkstech.com + * + * Copyright Kees C. Bakker / KeesTalksTech + * Released under the MIT license + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SubscriptionChangeEventDispatcher = exports.HandlingBase = exports.PromiseDispatcherBase = exports.PromiseSubscription = exports.DispatchError = exports.EventManagement = exports.EventListBase = exports.DispatcherWrapper = exports.DispatcherBase = exports.Subscription = void 0; +const DispatcherBase_1 = __webpack_require__(894); +Object.defineProperty(exports, "DispatcherBase", ({ enumerable: true, get: function () { return DispatcherBase_1.DispatcherBase; } })); +const DispatchError_1 = __webpack_require__(4383); +Object.defineProperty(exports, "DispatchError", ({ enumerable: true, get: function () { return DispatchError_1.DispatchError; } })); +const DispatcherWrapper_1 = __webpack_require__(9757); +Object.defineProperty(exports, "DispatcherWrapper", ({ enumerable: true, get: function () { return DispatcherWrapper_1.DispatcherWrapper; } })); +const EventListBase_1 = __webpack_require__(5930); +Object.defineProperty(exports, "EventListBase", ({ enumerable: true, get: function () { return EventListBase_1.EventListBase; } })); +const EventManagement_1 = __webpack_require__(4796); +Object.defineProperty(exports, "EventManagement", ({ enumerable: true, get: function () { return EventManagement_1.EventManagement; } })); +const HandlingBase_1 = __webpack_require__(954); +Object.defineProperty(exports, "HandlingBase", ({ enumerable: true, get: function () { return HandlingBase_1.HandlingBase; } })); +const PromiseDispatcherBase_1 = __webpack_require__(7541); +Object.defineProperty(exports, "PromiseDispatcherBase", ({ enumerable: true, get: function () { return PromiseDispatcherBase_1.PromiseDispatcherBase; } })); +const PromiseSubscription_1 = __webpack_require__(8452); +Object.defineProperty(exports, "PromiseSubscription", ({ enumerable: true, get: function () { return PromiseSubscription_1.PromiseSubscription; } })); +const Subscription_1 = __webpack_require__(365); +Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); +const SubscriptionChangeEventHandler_1 = __webpack_require__(2545); +Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); + + +/***/ }), + +/***/ 4796: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EventManagement = void 0; +/** + * Allows the user to interact with the event. + * + * @export + * @class EventManagement + * @implements {IEventManagement} + */ +class EventManagement { /** - * Checks it the event has a subscription for the specified handler. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * Creates an instance of EventManagement. + * @param {() => void} unsub An unsubscribe handler. * - * @memberOf DispatcherWrapper + * @memberOf EventManagement */ - has(fn) { - return this._has(fn); + constructor(unsub) { + this.unsub = unsub; + this.propagationStopped = false; } /** - * Clears all the subscriptions. + * Stops the propagation of the event. + * Cannot be used when async dispatch is done. * - * @memberOf DispatcherWrapper + * @memberOf EventManagement */ - clear() { - this._clear(); + stopPropagation() { + this.propagationStopped = true; } } -exports.DispatcherWrapper = DispatcherWrapper; - - -/***/ }), - -/***/ 5930: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.EventManagement = EventManagement; + + +/***/ }), + +/***/ 5890: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventListBase = void 0; +exports.PromiseSignalDispatcher = void 0; +const ste_core_1 = __webpack_require__(8486); /** - * Base class for event lists classes. Implements the get and remove. - * - * @export - * @abstract - * @class EventListBaset - * @template TEventDispatcher The type of event dispatcher. + * The dispatcher handles the storage of subsciptions and facilitates + * subscription, unsubscription and dispatching of a signal event. */ -class EventListBase { +class PromiseSignalDispatcher extends ste_core_1.PromiseDispatcherBase { + /** + * Creates a new SignalDispatcher instance. + */ constructor() { - this._events = {}; + super(); } /** - * Gets the dispatcher associated with the name. + * Dispatches the signal. * - * @param {string} name The name of the event. - * @returns {TEventDispatcher} The disptacher. + * @returns {IPropagationStatus} The status of the dispatch. * - * @memberOf EventListBase + * @memberOf SignalDispatcher */ - get(name) { - let event = this._events[name]; - if (event) { - return event; + async dispatch() { + const result = await this._dispatchAsPromise(false, this, arguments); + if (result == null) { + throw new ste_core_1.DispatchError("Got `null` back from dispatch."); } - event = this.createDispatcher(); - this._events[name] = event; - return event; + return result; } /** - * Removes the dispatcher associated with the name. - * - * @param {string} name - * - * @memberOf EventListBase + * Dispatches the signal threaded. */ - remove(name) { - delete this._events[name]; + dispatchAsync() { + this._dispatchAsPromise(true, this, arguments); } -} -exports.EventListBase = EventListBase; + /** + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. + */ + asEvent() { + return super.asEvent(); + } +} +exports.PromiseSignalDispatcher = PromiseSignalDispatcher; + + +/***/ }), + +/***/ 205: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSignalHandlingBase = void 0; +const ste_core_1 = __webpack_require__(8486); +const PromiseSignalList_1 = __webpack_require__(3146); +/** + * Extends objects with signal event handling capabilities. + */ +class PromiseSignalHandlingBase extends ste_core_1.HandlingBase { + constructor() { + super(new PromiseSignalList_1.PromiseSignalList()); + } +} +exports.PromiseSignalHandlingBase = PromiseSignalHandlingBase; + + +/***/ }), + +/***/ 3146: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -/***/ }), +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSignalList = void 0; +const ste_core_1 = __webpack_require__(8486); +const _1 = __webpack_require__(6838); +/** + * Storage class for multiple signal events that are accessible by name. + * Events dispatchers are automatically created. + */ +class PromiseSignalList extends ste_core_1.EventListBase { + /** + * Creates a new SignalList instance. + */ + constructor() { + super(); + } + /** + * Creates a new dispatcher instance. + */ + createDispatcher() { + return new _1.PromiseSignalDispatcher(); + } +} +exports.PromiseSignalList = PromiseSignalList; + + +/***/ }), + +/***/ 6838: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; -/***/ 7541: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { +/*! + * Strongly Typed Events for TypeScript - Promise Signals + * https://github.com/KeesCBakker/StronlyTypedEvents/ + * http://keestalkstech.com + * + * Copyright Kees C. Bakker / KeesTalksTech + * Released under the MIT license + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSignalList = exports.PromiseSignalHandlingBase = exports.PromiseSignalDispatcher = void 0; +const PromiseSignalDispatcher_1 = __webpack_require__(5890); +Object.defineProperty(exports, "PromiseSignalDispatcher", ({ enumerable: true, get: function () { return PromiseSignalDispatcher_1.PromiseSignalDispatcher; } })); +const PromiseSignalHandlingBase_1 = __webpack_require__(205); +Object.defineProperty(exports, "PromiseSignalHandlingBase", ({ enumerable: true, get: function () { return PromiseSignalHandlingBase_1.PromiseSignalHandlingBase; } })); +const PromiseSignalList_1 = __webpack_require__(3146); +Object.defineProperty(exports, "PromiseSignalList", ({ enumerable: true, get: function () { return PromiseSignalList_1.PromiseSignalList; } })); + + +/***/ }), + +/***/ 6463: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; -"use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DispatchError = void 0; +/** + * Indicates an error with dispatching. + * + * @export + * @class DispatchError + * @extends {Error} + */ +class DispatchError extends Error { + /** + * Creates an instance of DispatchError. + * @param {string} message The message. + * + * @memberOf DispatchError + */ + constructor(message) { + super(message); + } +} +exports.DispatchError = DispatchError; + + +/***/ }), + +/***/ 1368: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseDispatcherBase = void 0; -const __1 = __webpack_require__(2874); +exports.DispatcherBase = void 0; +const __1 = __webpack_require__(8486); /** - * Dispatcher base for dispatchers that use promises. Each promise - * is awaited before the next is dispatched, unless the event is - * dispatched with the executeAsync flag. + * Base class for implementation of the dispatcher. It facilitates the subscribe + * and unsubscribe methods based on generic handlers. The TEventType specifies + * the type of event that should be exposed. Use the asEvent to expose the + * dispatcher as event. * * @export * @abstract - * @class PromiseDispatcherBase - * @extends {DispatcherBase} + * @class DispatcherBase + * @implements {ISubscribable} * @template TEventHandler The type of event handler. */ -class PromiseDispatcherBase extends __1.DispatcherBase { +class DispatcherBase { + constructor() { + /** + * The subscriptions. + * + * @protected + * + * @memberOf DispatcherBase + */ + this._subscriptions = new Array(); + } /** - * The normal dispatch cannot be used in this class. + * Returns the number of subscriptions. * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * @readonly + * @type {number} + * @memberOf DispatcherBase + */ + get count() { + return this._subscriptions.length; + } + /** + * Triggered when subscriptions are changed (added or removed). * + * @readonly + * @type {ISubscribable} * @memberOf DispatcherBase */ - _dispatch(executeAsync, scope, args) { - throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); + get onSubscriptionChange() { + if (this._onSubscriptionChange == null) { + this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); + } + return this._onSubscriptionChange.asEvent(); } /** - * Crates a new subscription. + * Subscribe to the event dispatcher. * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce Indicates if the handler should only run once. - * @returns {ISubscription} The subscription. + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. * - * @memberOf PromiseDispatcherBase + * @memberOf DispatcherBase */ - createSubscription(handler, isOnce) { - return new __1.PromiseSubscription(handler, isOnce); + subscribe(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, false)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; + } + /** + * Subscribe to the event dispatcher. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherBase + */ + sub(fn) { + return this.subscribe(fn); + } + /** + * Subscribe once to the event with the specified name. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherBase + */ + one(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, true)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; + } + /** + * Checks it the event has a subscription for the specified handler. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase + */ + has(fn) { + if (!fn) + return false; + return this._subscriptions.some((sub) => sub.handler == fn); + } + /** + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase + */ + unsubscribe(fn) { + if (!fn) + return; + let changes = false; + for (let i = 0; i < this._subscriptions.length; i++) { + if (this._subscriptions[i].handler == fn) { + this._subscriptions.splice(i, 1); + changes = true; + break; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } + } + /** + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase + */ + unsub(fn) { + this.unsubscribe(fn); } /** * Generic dispatch will dispatch the handlers with the given arguments. @@ -3747,14 +4410,14 @@ class PromiseDispatcherBase extends __1.DispatcherBase { * * @memberOf DispatcherBase */ - async _dispatchAsPromise(executeAsync, scope, args) { + _dispatch(executeAsync, scope, args) { //execute on a copy because of bug #9 for (let sub of [...this._subscriptions]) { let ev = new __1.EventManagement(() => this.unsub(sub.handler)); let nargs = Array.prototype.slice.call(args); nargs.push(ev); - let ps = sub; - await ps.execute(executeAsync, scope, nargs); + let s = sub; + s.execute(executeAsync, scope, nargs); //cleanup subs that are no longer needed this.cleanup(sub); if (!executeAsync && ev.propagationStopped) { @@ -3766,992 +4429,1048 @@ class PromiseDispatcherBase extends __1.DispatcherBase { } return { propagationStopped: false }; } -} -exports.PromiseDispatcherBase = PromiseDispatcherBase; - - -/***/ }), - -/***/ 2545: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = void 0; -const __1 = __webpack_require__(2874); -/** - * Dispatcher for subscription changes. - * - * @export - * @class SubscriptionChangeEventDispatcher - * @extends {DispatcherBase} - */ -class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { /** - * Dispatches the event. - * - * @param {number} count The currrent number of subscriptions. + * Creates a subscription. * - * @memberOf SubscriptionChangeEventDispatcher - */ - dispatch(count) { - this._dispatch(false, this, arguments); + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce True if the handler should run only one. + * @returns {ISubscription} The subscription. + * + * @memberOf DispatcherBase + */ + createSubscription(handler, isOnce) { + return new __1.Subscription(handler, isOnce); } -} -exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; - - -/***/ }), - -/***/ 8452: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSubscription = void 0; -/** - * Subscription implementation for events with promises. - * - * @export - * @class PromiseSubscription - * @implements {ISubscription} - * @template TEventHandler The type of event handler. - */ -class PromiseSubscription { /** - * Creates an instance of PromiseSubscription. - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. + * Cleans up subs that ran and should run only once. * - * @memberOf PromiseSubscription + * @protected + * @param {ISubscription} sub The subscription. + * + * @memberOf DispatcherBase */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - * - * @memberOf PromiseSubscription - */ - this.isExecuted = false; + cleanup(sub) { + let changes = false; + if (sub.isOnce && sub.isExecuted) { + let i = this._subscriptions.indexOf(sub); + if (i > -1) { + this._subscriptions.splice(i, 1); + changes = true; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } } /** - * Executes the handler. + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. + * @returns {ISubscribable} * - * @memberOf PromiseSubscription + * @memberOf DispatcherBase */ - async execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - //TODO: do we need to cast to any -- seems yuck - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - return; - } - let result = fn.apply(scope, args); - await result; + asEvent() { + if (this._wrap == null) { + this._wrap = new __1.DispatcherWrapper(this); } + return this._wrap; } -} -exports.PromiseSubscription = PromiseSubscription; - - -/***/ }), - -/***/ 365: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Subscription = void 0; -/** - * Stores a handler. Manages execution meta data. - * @class Subscription - * @template TEventHandler - */ -class Subscription { /** - * Creates an instance of Subscription. + * Clears the subscriptions. * - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. + * @memberOf DispatcherBase */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - */ - this.isExecuted = false; + clear() { + if (this._subscriptions.length != 0) { + this._subscriptions.splice(0, this._subscriptions.length); + this.triggerSubscriptionChange(); + } } /** - * Executes the handler. + * Triggers the subscription change event. * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. + * @private + * + * @memberOf DispatcherBase */ - execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - } - else { - fn.apply(scope, args); - } + triggerSubscriptionChange() { + if (this._onSubscriptionChange != null) { + this._onSubscriptionChange.dispatch(this.count); } } } -exports.Subscription = Subscription; - - -/***/ }), - -/***/ 954: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.DispatcherBase = DispatcherBase; + + +/***/ }), + +/***/ 6982: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HandlingBase = void 0; +exports.DispatcherWrapper = void 0; /** - * Base class that implements event handling. With a an - * event list this base class will expose events that can be - * subscribed to. This will give your class generic events. + * Hides the implementation of the event dispatcher. Will expose methods that + * are relevent to the event. * * @export - * @abstract - * @class HandlingBase + * @class DispatcherWrapper + * @implements {ISubscribable} * @template TEventHandler The type of event handler. - * @template TDispatcher The type of dispatcher. - * @template TList The type of event list. */ -class HandlingBase { +class DispatcherWrapper { /** - * Creates an instance of HandlingBase. - * @param {TList} events The event list. Used for event management. + * Creates an instance of DispatcherWrapper. + * @param {ISubscribable} dispatcher * - * @memberOf HandlingBase + * @memberOf DispatcherWrapper */ - constructor(events) { - this.events = events; + constructor(dispatcher) { + this._subscribe = (fn) => dispatcher.subscribe(fn); + this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); + this._one = (fn) => dispatcher.one(fn); + this._has = (fn) => dispatcher.has(fn); + this._clear = () => dispatcher.clear(); + this._count = () => dispatcher.count; + this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; } /** - * Subscribes once to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Triggered when subscriptions are changed (added or removed). * - * @memberOf HandlingBase + * @readonly + * @type {ISubscribable} + * @memberOf DispatcherWrapper */ - one(name, fn) { - this.events.get(name).one(fn); + get onSubscriptionChange() { + return this._onSubscriptionChange(); } /** - * Checks it the event has a subscription for the specified handler. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Returns the number of subscriptions. * - * @memberOf HandlingBase + * @readonly + * @type {number} + * @memberOf DispatcherWrapper */ - has(name, fn) { - return this.events.get(name).has(fn); + get count() { + return this._count(); } /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Subscribe to the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - subscribe(name, fn) { - this.events.get(name).subscribe(fn); + subscribe(fn) { + return this._subscribe(fn); } /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Subscribe to the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - sub(name, fn) { - this.subscribe(name, fn); + sub(fn) { + return this.subscribe(fn); } /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Unsubscribe from the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - unsubscribe(name, fn) { - this.events.get(name).unsubscribe(fn); + unsubscribe(fn) { + this._unsubscribe(fn); } /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Unsubscribe from the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - unsub(name, fn) { - this.unsubscribe(name, fn); + unsub(fn) { + this.unsubscribe(fn); } -} -exports.HandlingBase = HandlingBase; - - -/***/ }), - -/***/ 2874: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Core - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = exports.HandlingBase = exports.PromiseDispatcherBase = exports.PromiseSubscription = exports.DispatchError = exports.EventManagement = exports.EventListBase = exports.DispatcherWrapper = exports.DispatcherBase = exports.Subscription = void 0; -const DispatcherBase_1 = __webpack_require__(894); -Object.defineProperty(exports, "DispatcherBase", ({ enumerable: true, get: function () { return DispatcherBase_1.DispatcherBase; } })); -const DispatchError_1 = __webpack_require__(4383); -Object.defineProperty(exports, "DispatchError", ({ enumerable: true, get: function () { return DispatchError_1.DispatchError; } })); -const DispatcherWrapper_1 = __webpack_require__(9757); -Object.defineProperty(exports, "DispatcherWrapper", ({ enumerable: true, get: function () { return DispatcherWrapper_1.DispatcherWrapper; } })); -const EventListBase_1 = __webpack_require__(5930); -Object.defineProperty(exports, "EventListBase", ({ enumerable: true, get: function () { return EventListBase_1.EventListBase; } })); -const EventManagement_1 = __webpack_require__(4796); -Object.defineProperty(exports, "EventManagement", ({ enumerable: true, get: function () { return EventManagement_1.EventManagement; } })); -const HandlingBase_1 = __webpack_require__(954); -Object.defineProperty(exports, "HandlingBase", ({ enumerable: true, get: function () { return HandlingBase_1.HandlingBase; } })); -const PromiseDispatcherBase_1 = __webpack_require__(7541); -Object.defineProperty(exports, "PromiseDispatcherBase", ({ enumerable: true, get: function () { return PromiseDispatcherBase_1.PromiseDispatcherBase; } })); -const PromiseSubscription_1 = __webpack_require__(8452); -Object.defineProperty(exports, "PromiseSubscription", ({ enumerable: true, get: function () { return PromiseSubscription_1.PromiseSubscription; } })); -const Subscription_1 = __webpack_require__(365); -Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); -const SubscriptionChangeEventHandler_1 = __webpack_require__(2545); -Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); - - -/***/ }), - -/***/ 4796: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; + /** + * Subscribe once to the event with the specified name. + * + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper + */ + one(fn) { + return this._one(fn); + } + /** + * Checks it the event has a subscription for the specified handler. + * + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper + */ + has(fn) { + return this._has(fn); + } + /** + * Clears all the subscriptions. + * + * @memberOf DispatcherWrapper + */ + clear() { + this._clear(); + } +} +exports.DispatcherWrapper = DispatcherWrapper; + + +/***/ }), + +/***/ 2177: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventManagement = void 0; +exports.EventListBase = void 0; /** - * Allows the user to interact with the event. + * Base class for event lists classes. Implements the get and remove. * * @export - * @class EventManagement - * @implements {IEventManagement} + * @abstract + * @class EventListBaset + * @template TEventDispatcher The type of event dispatcher. */ -class EventManagement { +class EventListBase { + constructor() { + this._events = {}; + } /** - * Creates an instance of EventManagement. - * @param {() => void} unsub An unsubscribe handler. + * Gets the dispatcher associated with the name. * - * @memberOf EventManagement + * @param {string} name The name of the event. + * @returns {TEventDispatcher} The disptacher. + * + * @memberOf EventListBase */ - constructor(unsub) { - this.unsub = unsub; - this.propagationStopped = false; + get(name) { + let event = this._events[name]; + if (event) { + return event; + } + event = this.createDispatcher(); + this._events[name] = event; + return event; } /** - * Stops the propagation of the event. - * Cannot be used when async dispatch is done. + * Removes the dispatcher associated with the name. * - * @memberOf EventManagement + * @param {string} name + * + * @memberOf EventListBase */ - stopPropagation() { - this.propagationStopped = true; + remove(name) { + delete this._events[name]; } } -exports.EventManagement = EventManagement; - - -/***/ }), - -/***/ 5890: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.EventListBase = EventListBase; + + +/***/ }), + +/***/ 2300: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSignalDispatcher = void 0; -const ste_core_1 = __webpack_require__(8486); +exports.PromiseDispatcherBase = void 0; +const __1 = __webpack_require__(8486); /** - * The dispatcher handles the storage of subsciptions and facilitates - * subscription, unsubscription and dispatching of a signal event. + * Dispatcher base for dispatchers that use promises. Each promise + * is awaited before the next is dispatched, unless the event is + * dispatched with the executeAsync flag. + * + * @export + * @abstract + * @class PromiseDispatcherBase + * @extends {DispatcherBase} + * @template TEventHandler The type of event handler. */ -class PromiseSignalDispatcher extends ste_core_1.PromiseDispatcherBase { - /** - * Creates a new SignalDispatcher instance. - */ - constructor() { - super(); - } +class PromiseDispatcherBase extends __1.DispatcherBase { /** - * Dispatches the signal. + * The normal dispatch cannot be used in this class. * - * @returns {IPropagationStatus} The status of the dispatch. + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. * - * @memberOf SignalDispatcher + * @memberOf DispatcherBase */ - async dispatch() { - const result = await this._dispatchAsPromise(false, this, arguments); - if (result == null) { - throw new ste_core_1.DispatchError("Got `null` back from dispatch."); - } - return result; + _dispatch(executeAsync, scope, args) { + throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); } /** - * Dispatches the signal threaded. + * Crates a new subscription. + * + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce Indicates if the handler should only run once. + * @returns {ISubscription} The subscription. + * + * @memberOf PromiseDispatcherBase */ - dispatchAsync() { - this._dispatchAsPromise(true, this, arguments); + createSubscription(handler, isOnce) { + return new __1.PromiseSubscription(handler, isOnce); } /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. + * Generic dispatch will dispatch the handlers with the given arguments. + * + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * + * @memberOf DispatcherBase */ - asEvent() { - return super.asEvent(); + async _dispatchAsPromise(executeAsync, scope, args) { + //execute on a copy because of bug #9 + for (let sub of [...this._subscriptions]) { + let ev = new __1.EventManagement(() => this.unsub(sub.handler)); + let nargs = Array.prototype.slice.call(args); + nargs.push(ev); + let ps = sub; + await ps.execute(executeAsync, scope, nargs); + //cleanup subs that are no longer needed + this.cleanup(sub); + if (!executeAsync && ev.propagationStopped) { + return { propagationStopped: true }; + } + } + if (executeAsync) { + return null; + } + return { propagationStopped: false }; } } -exports.PromiseSignalDispatcher = PromiseSignalDispatcher; - - -/***/ }), - -/***/ 205: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.PromiseDispatcherBase = PromiseDispatcherBase; + + +/***/ }), + +/***/ 4303: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSignalHandlingBase = void 0; -const ste_core_1 = __webpack_require__(8486); -const PromiseSignalList_1 = __webpack_require__(3146); +exports.SubscriptionChangeEventDispatcher = void 0; +const __1 = __webpack_require__(8486); /** - * Extends objects with signal event handling capabilities. + * Dispatcher for subscription changes. + * + * @export + * @class SubscriptionChangeEventDispatcher + * @extends {DispatcherBase} */ -class PromiseSignalHandlingBase extends ste_core_1.HandlingBase { - constructor() { - super(new PromiseSignalList_1.PromiseSignalList()); +class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { + /** + * Dispatches the event. + * + * @param {number} count The currrent number of subscriptions. + * + * @memberOf SubscriptionChangeEventDispatcher + */ + dispatch(count) { + this._dispatch(false, this, arguments); } } -exports.PromiseSignalHandlingBase = PromiseSignalHandlingBase; - - -/***/ }), - -/***/ 3146: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; + + +/***/ }), + +/***/ 9703: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSignalList = void 0; -const ste_core_1 = __webpack_require__(8486); -const _1 = __webpack_require__(6838); +exports.PromiseSubscription = void 0; /** - * Storage class for multiple signal events that are accessible by name. - * Events dispatchers are automatically created. + * Subscription implementation for events with promises. + * + * @export + * @class PromiseSubscription + * @implements {ISubscription} + * @template TEventHandler The type of event handler. */ -class PromiseSignalList extends ste_core_1.EventListBase { +class PromiseSubscription { /** - * Creates a new SignalList instance. - */ - constructor() { - super(); - } + * Creates an instance of PromiseSubscription. + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. + * + * @memberOf PromiseSubscription + */ + constructor(handler, isOnce) { + this.handler = handler; + this.isOnce = isOnce; + /** + * Indicates if the subscription has been executed before. + * + * @memberOf PromiseSubscription + */ + this.isExecuted = false; + } /** - * Creates a new dispatcher instance. + * Executes the handler. + * + * @param {boolean} executeAsync True if the even should be executed async. + * @param {*} scope The scope the scope of the event. + * @param {IArguments} args The arguments for the event. + * + * @memberOf PromiseSubscription */ - createDispatcher() { - return new _1.PromiseSignalDispatcher(); + async execute(executeAsync, scope, args) { + if (!this.isOnce || !this.isExecuted) { + this.isExecuted = true; + //TODO: do we need to cast to any -- seems yuck + var fn = this.handler; + if (executeAsync) { + setTimeout(() => { + fn.apply(scope, args); + }, 1); + return; + } + let result = fn.apply(scope, args); + await result; + } } } -exports.PromiseSignalList = PromiseSignalList; - - -/***/ }), - -/***/ 6838: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Promise Signals - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSignalList = exports.PromiseSignalHandlingBase = exports.PromiseSignalDispatcher = void 0; -const PromiseSignalDispatcher_1 = __webpack_require__(5890); -Object.defineProperty(exports, "PromiseSignalDispatcher", ({ enumerable: true, get: function () { return PromiseSignalDispatcher_1.PromiseSignalDispatcher; } })); -const PromiseSignalHandlingBase_1 = __webpack_require__(205); -Object.defineProperty(exports, "PromiseSignalHandlingBase", ({ enumerable: true, get: function () { return PromiseSignalHandlingBase_1.PromiseSignalHandlingBase; } })); -const PromiseSignalList_1 = __webpack_require__(3146); -Object.defineProperty(exports, "PromiseSignalList", ({ enumerable: true, get: function () { return PromiseSignalList_1.PromiseSignalList; } })); - - -/***/ }), - -/***/ 6463: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.PromiseSubscription = PromiseSubscription; + + +/***/ }), + +/***/ 4683: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatchError = void 0; +exports.Subscription = void 0; /** - * Indicates an error with dispatching. - * - * @export - * @class DispatchError - * @extends {Error} + * Stores a handler. Manages execution meta data. + * @class Subscription + * @template TEventHandler */ -class DispatchError extends Error { +class Subscription { /** - * Creates an instance of DispatchError. - * @param {string} message The message. + * Creates an instance of Subscription. * - * @memberOf DispatchError + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. */ - constructor(message) { - super(message); + constructor(handler, isOnce) { + this.handler = handler; + this.isOnce = isOnce; + /** + * Indicates if the subscription has been executed before. + */ + this.isExecuted = false; + } + /** + * Executes the handler. + * + * @param {boolean} executeAsync True if the even should be executed async. + * @param {*} scope The scope the scope of the event. + * @param {IArguments} args The arguments for the event. + */ + execute(executeAsync, scope, args) { + if (!this.isOnce || !this.isExecuted) { + this.isExecuted = true; + var fn = this.handler; + if (executeAsync) { + setTimeout(() => { + fn.apply(scope, args); + }, 1); + } + else { + fn.apply(scope, args); + } + } } } -exports.DispatchError = DispatchError; - - -/***/ }), - -/***/ 1368: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.Subscription = Subscription; + + +/***/ }), + +/***/ 5673: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherBase = void 0; -const __1 = __webpack_require__(8486); +exports.HandlingBase = void 0; /** - * Base class for implementation of the dispatcher. It facilitates the subscribe - * and unsubscribe methods based on generic handlers. The TEventType specifies - * the type of event that should be exposed. Use the asEvent to expose the - * dispatcher as event. + * Base class that implements event handling. With a an + * event list this base class will expose events that can be + * subscribed to. This will give your class generic events. * * @export * @abstract - * @class DispatcherBase - * @implements {ISubscribable} + * @class HandlingBase * @template TEventHandler The type of event handler. + * @template TDispatcher The type of dispatcher. + * @template TList The type of event list. */ -class DispatcherBase { - constructor() { - /** - * The subscriptions. - * - * @protected - * - * @memberOf DispatcherBase - */ - this._subscriptions = new Array(); - } +class HandlingBase { /** - * Returns the number of subscriptions. + * Creates an instance of HandlingBase. + * @param {TList} events The event list. Used for event management. * - * @readonly - * @type {number} - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - get count() { - return this._subscriptions.length; + constructor(events) { + this.events = events; } /** - * Triggered when subscriptions are changed (added or removed). + * Subscribes once to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - get onSubscriptionChange() { - if (this._onSubscriptionChange == null) { - this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); - } - return this._onSubscriptionChange.asEvent(); + one(name, fn) { + this.events.get(name).one(fn); } /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. + * Checks it the event has a subscription for the specified handler. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - subscribe(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, false)); - this.triggerSubscriptionChange(); - } - return () => { - this.unsubscribe(fn); - }; + has(name, fn) { + return this.events.get(name).has(fn); } /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. + * Subscribes to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - sub(fn) { - return this.subscribe(fn); + subscribe(name, fn) { + this.events.get(name).subscribe(fn); } /** - * Subscribe once to the event with the specified name. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. + * Subscribes to the event with the specified name. + * @param {string} name The name of the event. + * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - one(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, true)); - this.triggerSubscriptionChange(); - } - return () => { - this.unsubscribe(fn); - }; + sub(name, fn) { + this.subscribe(name, fn); } /** - * Checks it the event has a subscription for the specified handler. - * + * Unsubscribes from the event with the specified name. + * @param {string} name The name of the event. * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - has(fn) { - if (!fn) - return false; - return this._subscriptions.some((sub) => sub.handler == fn); + unsubscribe(name, fn) { + this.events.get(name).unsubscribe(fn); } /** - * Unsubscribes the handler from the dispatcher. - * + * Unsubscribes from the event with the specified name. + * @param {string} name The name of the event. * @param {TEventHandler} fn The event handler. * - * @memberOf DispatcherBase + * @memberOf HandlingBase */ - unsubscribe(fn) { - if (!fn) - return; - let changes = false; - for (let i = 0; i < this._subscriptions.length; i++) { - if (this._subscriptions[i].handler == fn) { - this._subscriptions.splice(i, 1); - changes = true; - break; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } - } - /** - * Unsubscribes the handler from the dispatcher. - * - * @param {TEventHandler} fn The event handler. - * - * @memberOf DispatcherBase - */ - unsub(fn) { - this.unsubscribe(fn); + unsub(name, fn) { + this.unsubscribe(name, fn); } +} +exports.HandlingBase = HandlingBase; + + +/***/ }), + +/***/ 8486: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*! + * Strongly Typed Events for TypeScript - Core + * https://github.com/KeesCBakker/StronlyTypedEvents/ + * http://keestalkstech.com + * + * Copyright Kees C. Bakker / KeesTalksTech + * Released under the MIT license + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SubscriptionChangeEventDispatcher = exports.HandlingBase = exports.PromiseDispatcherBase = exports.PromiseSubscription = exports.DispatchError = exports.EventManagement = exports.EventListBase = exports.DispatcherWrapper = exports.DispatcherBase = exports.Subscription = void 0; +const DispatcherBase_1 = __webpack_require__(1368); +Object.defineProperty(exports, "DispatcherBase", ({ enumerable: true, get: function () { return DispatcherBase_1.DispatcherBase; } })); +const DispatchError_1 = __webpack_require__(6463); +Object.defineProperty(exports, "DispatchError", ({ enumerable: true, get: function () { return DispatchError_1.DispatchError; } })); +const DispatcherWrapper_1 = __webpack_require__(6982); +Object.defineProperty(exports, "DispatcherWrapper", ({ enumerable: true, get: function () { return DispatcherWrapper_1.DispatcherWrapper; } })); +const EventListBase_1 = __webpack_require__(2177); +Object.defineProperty(exports, "EventListBase", ({ enumerable: true, get: function () { return EventListBase_1.EventListBase; } })); +const EventManagement_1 = __webpack_require__(8209); +Object.defineProperty(exports, "EventManagement", ({ enumerable: true, get: function () { return EventManagement_1.EventManagement; } })); +const HandlingBase_1 = __webpack_require__(5673); +Object.defineProperty(exports, "HandlingBase", ({ enumerable: true, get: function () { return HandlingBase_1.HandlingBase; } })); +const PromiseDispatcherBase_1 = __webpack_require__(2300); +Object.defineProperty(exports, "PromiseDispatcherBase", ({ enumerable: true, get: function () { return PromiseDispatcherBase_1.PromiseDispatcherBase; } })); +const PromiseSubscription_1 = __webpack_require__(9703); +Object.defineProperty(exports, "PromiseSubscription", ({ enumerable: true, get: function () { return PromiseSubscription_1.PromiseSubscription; } })); +const Subscription_1 = __webpack_require__(4683); +Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); +const SubscriptionChangeEventHandler_1 = __webpack_require__(4303); +Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); + + +/***/ }), + +/***/ 8209: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.EventManagement = void 0; +/** + * Allows the user to interact with the event. + * + * @export + * @class EventManagement + * @implements {IEventManagement} + */ +class EventManagement { /** - * Generic dispatch will dispatch the handlers with the given arguments. - * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * Creates an instance of EventManagement. + * @param {() => void} unsub An unsubscribe handler. * - * @memberOf DispatcherBase + * @memberOf EventManagement */ - _dispatch(executeAsync, scope, args) { - //execute on a copy because of bug #9 - for (let sub of [...this._subscriptions]) { - let ev = new __1.EventManagement(() => this.unsub(sub.handler)); - let nargs = Array.prototype.slice.call(args); - nargs.push(ev); - let s = sub; - s.execute(executeAsync, scope, nargs); - //cleanup subs that are no longer needed - this.cleanup(sub); - if (!executeAsync && ev.propagationStopped) { - return { propagationStopped: true }; - } - } - if (executeAsync) { - return null; - } - return { propagationStopped: false }; + constructor(unsub) { + this.unsub = unsub; + this.propagationStopped = false; } /** - * Creates a subscription. - * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce True if the handler should run only one. - * @returns {ISubscription} The subscription. + * Stops the propagation of the event. + * Cannot be used when async dispatch is done. * - * @memberOf DispatcherBase + * @memberOf EventManagement */ - createSubscription(handler, isOnce) { - return new __1.Subscription(handler, isOnce); + stopPropagation() { + this.propagationStopped = true; } - /** - * Cleans up subs that ran and should run only once. - * - * @protected - * @param {ISubscription} sub The subscription. - * - * @memberOf DispatcherBase - */ - cleanup(sub) { - let changes = false; - if (sub.isOnce && sub.isExecuted) { - let i = this._subscriptions.indexOf(sub); - if (i > -1) { - this._subscriptions.splice(i, 1); - changes = true; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } +} +exports.EventManagement = EventManagement; + + +/***/ }), + +/***/ 4537: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NonUniformPromiseSimpleEventList = void 0; +const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); +/** + * Similar to EventList, but instead of TArgs, a map of event names ang argument types is provided with TArgsMap. + */ +class NonUniformPromiseSimpleEventList { + constructor() { + this._events = {}; } /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. - * - * @returns {ISubscribable} - * - * @memberOf DispatcherBase + * Gets the dispatcher associated with the name. + * @param name The name of the event. */ - asEvent() { - if (this._wrap == null) { - this._wrap = new __1.DispatcherWrapper(this); + get(name) { + if (this._events[name]) { + // @TODO avoid typecasting. Not sure why TS thinks this._events[name] could still be undefined. + return this._events[name]; } - return this._wrap; + const event = this.createDispatcher(); + this._events[name] = event; + return event; } /** - * Clears the subscriptions. - * - * @memberOf DispatcherBase + * Removes the dispatcher associated with the name. + * @param name The name of the event. */ - clear() { - if (this._subscriptions.length != 0) { - this._subscriptions.splice(0, this._subscriptions.length); - this.triggerSubscriptionChange(); - } + remove(name) { + delete this._events[name]; } /** - * Triggers the subscription change event. - * - * @private - * - * @memberOf DispatcherBase + * Creates a new dispatcher instance. */ - triggerSubscriptionChange() { - if (this._onSubscriptionChange != null) { - this._onSubscriptionChange.dispatch(this.count); - } + createDispatcher() { + return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher(); } } -exports.DispatcherBase = DispatcherBase; - - -/***/ }), - -/***/ 6982: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.NonUniformPromiseSimpleEventList = NonUniformPromiseSimpleEventList; + + +/***/ }), + +/***/ 8921: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherWrapper = void 0; +exports.PromiseSimpleEventDispatcher = void 0; +const ste_core_1 = __webpack_require__(3310); /** - * Hides the implementation of the event dispatcher. Will expose methods that - * are relevent to the event. + * The dispatcher handles the storage of subsciptions and facilitates + * subscription, unsubscription and dispatching of a simple event * * @export - * @class DispatcherWrapper - * @implements {ISubscribable} - * @template TEventHandler The type of event handler. + * @class PromiseSimpleEventDispatcher + * @extends {PromiseDispatcherBase>} + * @implements {IPromiseSimpleEvent} + * @template TArgs */ -class DispatcherWrapper { +class PromiseSimpleEventDispatcher extends ste_core_1.PromiseDispatcherBase { /** - * Creates an instance of DispatcherWrapper. - * @param {ISubscribable} dispatcher - * - * @memberOf DispatcherWrapper + * Creates a new SimpleEventDispatcher instance. */ - constructor(dispatcher) { - this._subscribe = (fn) => dispatcher.subscribe(fn); - this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); - this._one = (fn) => dispatcher.one(fn); - this._has = (fn) => dispatcher.has(fn); - this._clear = () => dispatcher.clear(); - this._count = () => dispatcher.count; - this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; + constructor() { + super(); } /** - * Triggered when subscriptions are changed (added or removed). - * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherWrapper + * Dispatches the event. + * @param args The arguments object. + * @returns {IPropagationStatus} The status of the dispatch. + * @memberOf PromiseSimpleEventDispatcher */ - get onSubscriptionChange() { - return this._onSubscriptionChange(); + async dispatch(args) { + const result = await this._dispatchAsPromise(false, this, arguments); + if (result == null) { + throw new ste_core_1.DispatchError("Got `null` back from dispatch."); + } + return result; } /** - * Returns the number of subscriptions. - * - * @readonly - * @type {number} - * @memberOf DispatcherWrapper + * Dispatches the event without waiting for it to complete. + * @param args The argument object. + * @memberOf PromiseSimpleEventDispatcher */ - get count() { - return this._count(); + dispatchAsync(args) { + this._dispatchAsPromise(true, this, arguments); } /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. */ - subscribe(fn) { - return this._subscribe(fn); + asEvent() { + return super.asEvent(); } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper - */ - sub(fn) { - return this.subscribe(fn); - } - /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper - */ - unsubscribe(fn) { - this._unsubscribe(fn); - } - /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper - */ - unsub(fn) { - this.unsubscribe(fn); +} +exports.PromiseSimpleEventDispatcher = PromiseSimpleEventDispatcher; + + +/***/ }), + +/***/ 532: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSimpleEventHandlingBase = void 0; +const ste_core_1 = __webpack_require__(3310); +const PromiseSimpleEventList_1 = __webpack_require__(7929); +/** + * Extends objects with signal event handling capabilities. + */ +class PromiseSimpleEventHandlingBase extends ste_core_1.HandlingBase { + constructor() { + super(new PromiseSimpleEventList_1.PromiseSimpleEventList()); } +} +exports.PromiseSimpleEventHandlingBase = PromiseSimpleEventHandlingBase; + + +/***/ }), + +/***/ 7929: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PromiseSimpleEventList = void 0; +const ste_core_1 = __webpack_require__(3310); +const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); +/** + * Storage class for multiple simple events that are accessible by name. + * Events dispatchers are automatically created. + */ +class PromiseSimpleEventList extends ste_core_1.EventListBase { /** - * Subscribe once to the event with the specified name. - * - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper + * Creates a new SimpleEventList instance. */ - one(fn) { - return this._one(fn); + constructor() { + super(); } /** - * Checks it the event has a subscription for the specified handler. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper + * Creates a new dispatcher instance. */ - has(fn) { - return this._has(fn); + createDispatcher() { + return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher(); } +} +exports.PromiseSimpleEventList = PromiseSimpleEventList; + + +/***/ }), + +/***/ 9176: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; + +/*! + * Strongly Typed Events for TypeScript - Core + * https://github.com/KeesCBakker/StronlyTypedEvents/ + * http://keestalkstech.com + * + * Copyright Kees C. Bakker / KeesTalksTech + * Released under the MIT license + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NonUniformPromiseSimpleEventList = exports.PromiseSimpleEventList = exports.PromiseSimpleEventHandlingBase = exports.PromiseSimpleEventDispatcher = void 0; +const NonUniformPromiseSimpleEventList_1 = __webpack_require__(4537); +Object.defineProperty(exports, "NonUniformPromiseSimpleEventList", ({ enumerable: true, get: function () { return NonUniformPromiseSimpleEventList_1.NonUniformPromiseSimpleEventList; } })); +const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); +Object.defineProperty(exports, "PromiseSimpleEventDispatcher", ({ enumerable: true, get: function () { return PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher; } })); +const PromiseSimpleEventHandlingBase_1 = __webpack_require__(532); +Object.defineProperty(exports, "PromiseSimpleEventHandlingBase", ({ enumerable: true, get: function () { return PromiseSimpleEventHandlingBase_1.PromiseSimpleEventHandlingBase; } })); +const PromiseSimpleEventList_1 = __webpack_require__(7929); +Object.defineProperty(exports, "PromiseSimpleEventList", ({ enumerable: true, get: function () { return PromiseSimpleEventList_1.PromiseSimpleEventList; } })); + + +/***/ }), + +/***/ 8181: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.DispatchError = void 0; +/** + * Indicates an error with dispatching. + * + * @export + * @class DispatchError + * @extends {Error} + */ +class DispatchError extends Error { /** - * Clears all the subscriptions. + * Creates an instance of DispatchError. + * @param {string} message The message. * - * @memberOf DispatcherWrapper + * @memberOf DispatchError */ - clear() { - this._clear(); + constructor(message) { + super(message); } } -exports.DispatcherWrapper = DispatcherWrapper; - - -/***/ }), - -/***/ 2177: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.DispatchError = DispatchError; + + +/***/ }), + +/***/ 3040: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventListBase = void 0; +exports.DispatcherBase = void 0; +const __1 = __webpack_require__(3310); /** - * Base class for event lists classes. Implements the get and remove. + * Base class for implementation of the dispatcher. It facilitates the subscribe + * and unsubscribe methods based on generic handlers. The TEventType specifies + * the type of event that should be exposed. Use the asEvent to expose the + * dispatcher as event. * * @export * @abstract - * @class EventListBaset - * @template TEventDispatcher The type of event dispatcher. + * @class DispatcherBase + * @implements {ISubscribable} + * @template TEventHandler The type of event handler. */ -class EventListBase { +class DispatcherBase { constructor() { - this._events = {}; + /** + * The subscriptions. + * + * @protected + * + * @memberOf DispatcherBase + */ + this._subscriptions = new Array(); } /** - * Gets the dispatcher associated with the name. + * Returns the number of subscriptions. * - * @param {string} name The name of the event. - * @returns {TEventDispatcher} The disptacher. + * @readonly + * @type {number} + * @memberOf DispatcherBase + */ + get count() { + return this._subscriptions.length; + } + /** + * Triggered when subscriptions are changed (added or removed). * - * @memberOf EventListBase + * @readonly + * @type {ISubscribable} + * @memberOf DispatcherBase */ - get(name) { - let event = this._events[name]; - if (event) { - return event; + get onSubscriptionChange() { + if (this._onSubscriptionChange == null) { + this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); } - event = this.createDispatcher(); - this._events[name] = event; - return event; + return this._onSubscriptionChange.asEvent(); } /** - * Removes the dispatcher associated with the name. + * Subscribe to the event dispatcher. * - * @param {string} name + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. * - * @memberOf EventListBase + * @memberOf DispatcherBase */ - remove(name) { - delete this._events[name]; + subscribe(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, false)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; } -} -exports.EventListBase = EventListBase; - - -/***/ }), - -/***/ 2300: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseDispatcherBase = void 0; -const __1 = __webpack_require__(8486); -/** - * Dispatcher base for dispatchers that use promises. Each promise - * is awaited before the next is dispatched, unless the event is - * dispatched with the executeAsync flag. - * - * @export - * @abstract - * @class PromiseDispatcherBase - * @extends {DispatcherBase} - * @template TEventHandler The type of event handler. - */ -class PromiseDispatcherBase extends __1.DispatcherBase { /** - * The normal dispatch cannot be used in this class. + * Subscribe to the event dispatcher. * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. * * @memberOf DispatcherBase */ - _dispatch(executeAsync, scope, args) { - throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); + sub(fn) { + return this.subscribe(fn); } /** - * Crates a new subscription. + * Subscribe once to the event with the specified name. * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce Indicates if the handler should only run once. - * @returns {ISubscription} The subscription. + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns A function that unsubscribes the event handler from the event. * - * @memberOf PromiseDispatcherBase + * @memberOf DispatcherBase */ - createSubscription(handler, isOnce) { - return new __1.PromiseSubscription(handler, isOnce); + one(fn) { + if (fn) { + this._subscriptions.push(this.createSubscription(fn, true)); + this.triggerSubscriptionChange(); + } + return () => { + this.unsubscribe(fn); + }; } /** - * Generic dispatch will dispatch the handlers with the given arguments. + * Checks it the event has a subscription for the specified handler. * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * @param {TEventHandler} fn The event handler. * * @memberOf DispatcherBase */ - async _dispatchAsPromise(executeAsync, scope, args) { - //execute on a copy because of bug #9 + has(fn) { + if (!fn) + return false; + return this._subscriptions.some((sub) => sub.handler == fn); + } + /** + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase + */ + unsubscribe(fn) { + if (!fn) + return; + let changes = false; + for (let i = 0; i < this._subscriptions.length; i++) { + if (this._subscriptions[i].handler == fn) { + this._subscriptions.splice(i, 1); + changes = true; + break; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } + } + /** + * Unsubscribes the handler from the dispatcher. + * + * @param {TEventHandler} fn The event handler. + * + * @memberOf DispatcherBase + */ + unsub(fn) { + this.unsubscribe(fn); + } + /** + * Generic dispatch will dispatch the handlers with the given arguments. + * + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * + * @memberOf DispatcherBase + */ + _dispatch(executeAsync, scope, args) { + //execute on a copy because of bug #9 for (let sub of [...this._subscriptions]) { let ev = new __1.EventManagement(() => this.unsub(sub.handler)); let nargs = Array.prototype.slice.call(args); nargs.push(ev); - let ps = sub; - await ps.execute(executeAsync, scope, nargs); + let s = sub; + s.execute(executeAsync, scope, nargs); //cleanup subs that are no longer needed this.cleanup(sub); if (!executeAsync && ev.propagationStopped) { @@ -4763,16406 +5482,15687 @@ class PromiseDispatcherBase extends __1.DispatcherBase { } return { propagationStopped: false }; } -} -exports.PromiseDispatcherBase = PromiseDispatcherBase; - - -/***/ }), - -/***/ 4303: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = void 0; -const __1 = __webpack_require__(8486); -/** - * Dispatcher for subscription changes. - * - * @export - * @class SubscriptionChangeEventDispatcher - * @extends {DispatcherBase} - */ -class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { /** - * Dispatches the event. + * Creates a subscription. * - * @param {number} count The currrent number of subscriptions. + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce True if the handler should run only one. + * @returns {ISubscription} The subscription. * - * @memberOf SubscriptionChangeEventDispatcher + * @memberOf DispatcherBase */ - dispatch(count) { - this._dispatch(false, this, arguments); + createSubscription(handler, isOnce) { + return new __1.Subscription(handler, isOnce); } -} -exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; - - -/***/ }), - -/***/ 9703: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSubscription = void 0; -/** - * Subscription implementation for events with promises. - * - * @export - * @class PromiseSubscription - * @implements {ISubscription} - * @template TEventHandler The type of event handler. - */ -class PromiseSubscription { /** - * Creates an instance of PromiseSubscription. - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. + * Cleans up subs that ran and should run only once. * - * @memberOf PromiseSubscription + * @protected + * @param {ISubscription} sub The subscription. + * + * @memberOf DispatcherBase */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - * - * @memberOf PromiseSubscription - */ - this.isExecuted = false; + cleanup(sub) { + let changes = false; + if (sub.isOnce && sub.isExecuted) { + let i = this._subscriptions.indexOf(sub); + if (i > -1) { + this._subscriptions.splice(i, 1); + changes = true; + } + } + if (changes) { + this.triggerSubscriptionChange(); + } } /** - * Executes the handler. + * Creates an event from the dispatcher. Will return the dispatcher + * in a wrapper. This will prevent exposure of any dispatcher methods. * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. + * @returns {ISubscribable} * - * @memberOf PromiseSubscription + * @memberOf DispatcherBase */ - async execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - //TODO: do we need to cast to any -- seems yuck - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - return; - } - let result = fn.apply(scope, args); - await result; + asEvent() { + if (this._wrap == null) { + this._wrap = new __1.DispatcherWrapper(this); } + return this._wrap; } -} -exports.PromiseSubscription = PromiseSubscription; - - -/***/ }), - -/***/ 4683: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Subscription = void 0; -/** - * Stores a handler. Manages execution meta data. - * @class Subscription - * @template TEventHandler - */ -class Subscription { /** - * Creates an instance of Subscription. + * Clears the subscriptions. * - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. + * @memberOf DispatcherBase */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - */ - this.isExecuted = false; + clear() { + if (this._subscriptions.length != 0) { + this._subscriptions.splice(0, this._subscriptions.length); + this.triggerSubscriptionChange(); + } } /** - * Executes the handler. + * Triggers the subscription change event. * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. + * @private + * + * @memberOf DispatcherBase */ - execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - } - else { - fn.apply(scope, args); - } + triggerSubscriptionChange() { + if (this._onSubscriptionChange != null) { + this._onSubscriptionChange.dispatch(this.count); } } } -exports.Subscription = Subscription; - - -/***/ }), - -/***/ 5673: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.DispatcherBase = DispatcherBase; + + +/***/ }), + +/***/ 3122: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HandlingBase = void 0; +exports.DispatcherWrapper = void 0; /** - * Base class that implements event handling. With a an - * event list this base class will expose events that can be - * subscribed to. This will give your class generic events. + * Hides the implementation of the event dispatcher. Will expose methods that + * are relevent to the event. * * @export - * @abstract - * @class HandlingBase + * @class DispatcherWrapper + * @implements {ISubscribable} * @template TEventHandler The type of event handler. - * @template TDispatcher The type of dispatcher. - * @template TList The type of event list. */ -class HandlingBase { +class DispatcherWrapper { /** - * Creates an instance of HandlingBase. - * @param {TList} events The event list. Used for event management. + * Creates an instance of DispatcherWrapper. + * @param {ISubscribable} dispatcher * - * @memberOf HandlingBase + * @memberOf DispatcherWrapper */ - constructor(events) { - this.events = events; + constructor(dispatcher) { + this._subscribe = (fn) => dispatcher.subscribe(fn); + this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); + this._one = (fn) => dispatcher.one(fn); + this._has = (fn) => dispatcher.has(fn); + this._clear = () => dispatcher.clear(); + this._count = () => dispatcher.count; + this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; } /** - * Subscribes once to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Triggered when subscriptions are changed (added or removed). * - * @memberOf HandlingBase + * @readonly + * @type {ISubscribable} + * @memberOf DispatcherWrapper */ - one(name, fn) { - this.events.get(name).one(fn); + get onSubscriptionChange() { + return this._onSubscriptionChange(); } /** - * Checks it the event has a subscription for the specified handler. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Returns the number of subscriptions. * - * @memberOf HandlingBase + * @readonly + * @type {number} + * @memberOf DispatcherWrapper */ - has(name, fn) { - return this.events.get(name).has(fn); + get count() { + return this._count(); } /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Subscribe to the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - subscribe(name, fn) { - this.events.get(name).subscribe(fn); + subscribe(fn) { + return this._subscribe(fn); } /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Subscribe to the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - sub(name, fn) { - this.subscribe(name, fn); + sub(fn) { + return this.subscribe(fn); } /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Unsubscribe from the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - unsubscribe(name, fn) { - this.events.get(name).unsubscribe(fn); + unsubscribe(fn) { + this._unsubscribe(fn); } /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. + * Unsubscribe from the event dispatcher. * - * @memberOf HandlingBase + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - unsub(name, fn) { - this.unsubscribe(name, fn); + unsub(fn) { + this.unsubscribe(fn); } -} -exports.HandlingBase = HandlingBase; - - -/***/ }), - -/***/ 8486: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Core - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = exports.HandlingBase = exports.PromiseDispatcherBase = exports.PromiseSubscription = exports.DispatchError = exports.EventManagement = exports.EventListBase = exports.DispatcherWrapper = exports.DispatcherBase = exports.Subscription = void 0; -const DispatcherBase_1 = __webpack_require__(1368); -Object.defineProperty(exports, "DispatcherBase", ({ enumerable: true, get: function () { return DispatcherBase_1.DispatcherBase; } })); -const DispatchError_1 = __webpack_require__(6463); -Object.defineProperty(exports, "DispatchError", ({ enumerable: true, get: function () { return DispatchError_1.DispatchError; } })); -const DispatcherWrapper_1 = __webpack_require__(6982); -Object.defineProperty(exports, "DispatcherWrapper", ({ enumerable: true, get: function () { return DispatcherWrapper_1.DispatcherWrapper; } })); -const EventListBase_1 = __webpack_require__(2177); -Object.defineProperty(exports, "EventListBase", ({ enumerable: true, get: function () { return EventListBase_1.EventListBase; } })); -const EventManagement_1 = __webpack_require__(8209); -Object.defineProperty(exports, "EventManagement", ({ enumerable: true, get: function () { return EventManagement_1.EventManagement; } })); -const HandlingBase_1 = __webpack_require__(5673); -Object.defineProperty(exports, "HandlingBase", ({ enumerable: true, get: function () { return HandlingBase_1.HandlingBase; } })); -const PromiseDispatcherBase_1 = __webpack_require__(2300); -Object.defineProperty(exports, "PromiseDispatcherBase", ({ enumerable: true, get: function () { return PromiseDispatcherBase_1.PromiseDispatcherBase; } })); -const PromiseSubscription_1 = __webpack_require__(9703); -Object.defineProperty(exports, "PromiseSubscription", ({ enumerable: true, get: function () { return PromiseSubscription_1.PromiseSubscription; } })); -const Subscription_1 = __webpack_require__(4683); -Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); -const SubscriptionChangeEventHandler_1 = __webpack_require__(4303); -Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); - - -/***/ }), - -/***/ 8209: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventManagement = void 0; -/** - * Allows the user to interact with the event. - * - * @export - * @class EventManagement - * @implements {IEventManagement} - */ -class EventManagement { /** - * Creates an instance of EventManagement. - * @param {() => void} unsub An unsubscribe handler. + * Subscribe once to the event with the specified name. * - * @memberOf EventManagement + * @returns {() => void} A function that unsubscribes the event handler from the event. + * + * @memberOf DispatcherWrapper */ - constructor(unsub) { - this.unsub = unsub; - this.propagationStopped = false; + one(fn) { + return this._one(fn); } /** - * Stops the propagation of the event. - * Cannot be used when async dispatch is done. + * Checks it the event has a subscription for the specified handler. * - * @memberOf EventManagement + * @param {TEventHandler} fn The event handler that is called when the event is dispatched. + * + * @memberOf DispatcherWrapper */ - stopPropagation() { - this.propagationStopped = true; + has(fn) { + return this._has(fn); + } + /** + * Clears all the subscriptions. + * + * @memberOf DispatcherWrapper + */ + clear() { + this._clear(); } } -exports.EventManagement = EventManagement; - - -/***/ }), - -/***/ 4537: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.DispatcherWrapper = DispatcherWrapper; + + +/***/ }), + +/***/ 7955: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NonUniformPromiseSimpleEventList = void 0; -const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); +exports.EventListBase = void 0; /** - * Similar to EventList, but instead of TArgs, a map of event names ang argument types is provided with TArgsMap. + * Base class for event lists classes. Implements the get and remove. + * + * @export + * @abstract + * @class EventListBaset + * @template TEventDispatcher The type of event dispatcher. */ -class NonUniformPromiseSimpleEventList { +class EventListBase { constructor() { this._events = {}; } /** * Gets the dispatcher associated with the name. - * @param name The name of the event. + * + * @param {string} name The name of the event. + * @returns {TEventDispatcher} The disptacher. + * + * @memberOf EventListBase */ get(name) { - if (this._events[name]) { - // @TODO avoid typecasting. Not sure why TS thinks this._events[name] could still be undefined. - return this._events[name]; + let event = this._events[name]; + if (event) { + return event; } - const event = this.createDispatcher(); + event = this.createDispatcher(); this._events[name] = event; return event; } /** * Removes the dispatcher associated with the name. - * @param name The name of the event. + * + * @param {string} name + * + * @memberOf EventListBase */ remove(name) { delete this._events[name]; } - /** - * Creates a new dispatcher instance. - */ - createDispatcher() { - return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher(); - } } -exports.NonUniformPromiseSimpleEventList = NonUniformPromiseSimpleEventList; - - -/***/ }), - -/***/ 8921: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.EventListBase = EventListBase; + + +/***/ }), + +/***/ 2490: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSimpleEventDispatcher = void 0; -const ste_core_1 = __webpack_require__(3310); +exports.PromiseDispatcherBase = void 0; +const __1 = __webpack_require__(3310); /** - * The dispatcher handles the storage of subsciptions and facilitates - * subscription, unsubscription and dispatching of a simple event + * Dispatcher base for dispatchers that use promises. Each promise + * is awaited before the next is dispatched, unless the event is + * dispatched with the executeAsync flag. * * @export - * @class PromiseSimpleEventDispatcher - * @extends {PromiseDispatcherBase>} - * @implements {IPromiseSimpleEvent} - * @template TArgs + * @abstract + * @class PromiseDispatcherBase + * @extends {DispatcherBase} + * @template TEventHandler The type of event handler. */ -class PromiseSimpleEventDispatcher extends ste_core_1.PromiseDispatcherBase { +class PromiseDispatcherBase extends __1.DispatcherBase { /** - * Creates a new SimpleEventDispatcher instance. + * The normal dispatch cannot be used in this class. + * + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * + * @memberOf DispatcherBase */ - constructor() { - super(); + _dispatch(executeAsync, scope, args) { + throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); } /** - * Dispatches the event. - * @param args The arguments object. - * @returns {IPropagationStatus} The status of the dispatch. - * @memberOf PromiseSimpleEventDispatcher + * Crates a new subscription. + * + * @protected + * @param {TEventHandler} handler The handler. + * @param {boolean} isOnce Indicates if the handler should only run once. + * @returns {ISubscription} The subscription. + * + * @memberOf PromiseDispatcherBase */ - async dispatch(args) { - const result = await this._dispatchAsPromise(false, this, arguments); - if (result == null) { - throw new ste_core_1.DispatchError("Got `null` back from dispatch."); - } - return result; + createSubscription(handler, isOnce) { + return new __1.PromiseSubscription(handler, isOnce); } /** - * Dispatches the event without waiting for it to complete. - * @param args The argument object. - * @memberOf PromiseSimpleEventDispatcher - */ - dispatchAsync(args) { - this._dispatchAsPromise(true, this, arguments); - } - /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. - */ - asEvent() { - return super.asEvent(); - } -} -exports.PromiseSimpleEventDispatcher = PromiseSimpleEventDispatcher; - - -/***/ }), - -/***/ 532: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSimpleEventHandlingBase = void 0; -const ste_core_1 = __webpack_require__(3310); -const PromiseSimpleEventList_1 = __webpack_require__(7929); -/** - * Extends objects with signal event handling capabilities. - */ -class PromiseSimpleEventHandlingBase extends ste_core_1.HandlingBase { - constructor() { - super(new PromiseSimpleEventList_1.PromiseSimpleEventList()); - } -} -exports.PromiseSimpleEventHandlingBase = PromiseSimpleEventHandlingBase; - - -/***/ }), - -/***/ 7929: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSimpleEventList = void 0; -const ste_core_1 = __webpack_require__(3310); -const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); -/** - * Storage class for multiple simple events that are accessible by name. - * Events dispatchers are automatically created. - */ -class PromiseSimpleEventList extends ste_core_1.EventListBase { - /** - * Creates a new SimpleEventList instance. - */ - constructor() { - super(); - } - /** - * Creates a new dispatcher instance. + * Generic dispatch will dispatch the handlers with the given arguments. + * + * @protected + * @param {boolean} executeAsync `True` if the even should be executed async. + * @param {*} scope The scope of the event. The scope becomes the `this` for handler. + * @param {IArguments} args The arguments for the event. + * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. + * + * @memberOf DispatcherBase */ - createDispatcher() { - return new PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher(); + async _dispatchAsPromise(executeAsync, scope, args) { + //execute on a copy because of bug #9 + for (let sub of [...this._subscriptions]) { + let ev = new __1.EventManagement(() => this.unsub(sub.handler)); + let nargs = Array.prototype.slice.call(args); + nargs.push(ev); + let ps = sub; + await ps.execute(executeAsync, scope, nargs); + //cleanup subs that are no longer needed + this.cleanup(sub); + if (!executeAsync && ev.propagationStopped) { + return { propagationStopped: true }; + } + } + if (executeAsync) { + return null; + } + return { propagationStopped: false }; } } -exports.PromiseSimpleEventList = PromiseSimpleEventList; - - -/***/ }), - -/***/ 9176: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Core - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NonUniformPromiseSimpleEventList = exports.PromiseSimpleEventList = exports.PromiseSimpleEventHandlingBase = exports.PromiseSimpleEventDispatcher = void 0; -const NonUniformPromiseSimpleEventList_1 = __webpack_require__(4537); -Object.defineProperty(exports, "NonUniformPromiseSimpleEventList", ({ enumerable: true, get: function () { return NonUniformPromiseSimpleEventList_1.NonUniformPromiseSimpleEventList; } })); -const PromiseSimpleEventDispatcher_1 = __webpack_require__(8921); -Object.defineProperty(exports, "PromiseSimpleEventDispatcher", ({ enumerable: true, get: function () { return PromiseSimpleEventDispatcher_1.PromiseSimpleEventDispatcher; } })); -const PromiseSimpleEventHandlingBase_1 = __webpack_require__(532); -Object.defineProperty(exports, "PromiseSimpleEventHandlingBase", ({ enumerable: true, get: function () { return PromiseSimpleEventHandlingBase_1.PromiseSimpleEventHandlingBase; } })); -const PromiseSimpleEventList_1 = __webpack_require__(7929); -Object.defineProperty(exports, "PromiseSimpleEventList", ({ enumerable: true, get: function () { return PromiseSimpleEventList_1.PromiseSimpleEventList; } })); - - -/***/ }), - -/***/ 8181: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; +exports.PromiseDispatcherBase = PromiseDispatcherBase; + + +/***/ }), + +/***/ 1002: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatchError = void 0; +exports.SubscriptionChangeEventDispatcher = void 0; +const __1 = __webpack_require__(3310); /** - * Indicates an error with dispatching. + * Dispatcher for subscription changes. * * @export - * @class DispatchError - * @extends {Error} + * @class SubscriptionChangeEventDispatcher + * @extends {DispatcherBase} */ -class DispatchError extends Error { +class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { /** - * Creates an instance of DispatchError. - * @param {string} message The message. + * Dispatches the event. * - * @memberOf DispatchError + * @param {number} count The currrent number of subscriptions. + * + * @memberOf SubscriptionChangeEventDispatcher */ - constructor(message) { - super(message); + dispatch(count) { + this._dispatch(false, this, arguments); } } -exports.DispatchError = DispatchError; - - -/***/ }), - -/***/ 3040: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; +exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; + + +/***/ }), + +/***/ 9347: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherBase = void 0; -const __1 = __webpack_require__(3310); +exports.PromiseSubscription = void 0; /** - * Base class for implementation of the dispatcher. It facilitates the subscribe - * and unsubscribe methods based on generic handlers. The TEventType specifies - * the type of event that should be exposed. Use the asEvent to expose the - * dispatcher as event. + * Subscription implementation for events with promises. * * @export - * @abstract - * @class DispatcherBase - * @implements {ISubscribable} + * @class PromiseSubscription + * @implements {ISubscription} * @template TEventHandler The type of event handler. */ -class DispatcherBase { - constructor() { - /** - * The subscriptions. - * - * @protected - * - * @memberOf DispatcherBase - */ - this._subscriptions = new Array(); - } - /** - * Returns the number of subscriptions. - * - * @readonly - * @type {number} - * @memberOf DispatcherBase - */ - get count() { - return this._subscriptions.length; - } +class PromiseSubscription { /** - * Triggered when subscriptions are changed (added or removed). + * Creates an instance of PromiseSubscription. + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherBase + * @memberOf PromiseSubscription */ - get onSubscriptionChange() { - if (this._onSubscriptionChange == null) { - this._onSubscriptionChange = new __1.SubscriptionChangeEventDispatcher(); - } - return this._onSubscriptionChange.asEvent(); + constructor(handler, isOnce) { + this.handler = handler; + this.isOnce = isOnce; + /** + * Indicates if the subscription has been executed before. + * + * @memberOf PromiseSubscription + */ + this.isExecuted = false; } /** - * Subscribe to the event dispatcher. + * Executes the handler. * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. + * @param {boolean} executeAsync True if the even should be executed async. + * @param {*} scope The scope the scope of the event. + * @param {IArguments} args The arguments for the event. * - * @memberOf DispatcherBase + * @memberOf PromiseSubscription */ - subscribe(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, false)); - this.triggerSubscriptionChange(); + async execute(executeAsync, scope, args) { + if (!this.isOnce || !this.isExecuted) { + this.isExecuted = true; + //TODO: do we need to cast to any -- seems yuck + var fn = this.handler; + if (executeAsync) { + setTimeout(() => { + fn.apply(scope, args); + }, 1); + return; + } + let result = fn.apply(scope, args); + await result; } - return () => { - this.unsubscribe(fn); - }; - } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherBase - */ - sub(fn) { - return this.subscribe(fn); } +} +exports.PromiseSubscription = PromiseSubscription; + + +/***/ }), + +/***/ 2229: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Subscription = void 0; +/** + * Stores a handler. Manages execution meta data. + * @class Subscription + * @template TEventHandler + */ +class Subscription { /** - * Subscribe once to the event with the specified name. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns A function that unsubscribes the event handler from the event. + * Creates an instance of Subscription. * - * @memberOf DispatcherBase + * @param {TEventHandler} handler The handler for the subscription. + * @param {boolean} isOnce Indicates if the handler should only be executed once. */ - one(fn) { - if (fn) { - this._subscriptions.push(this.createSubscription(fn, true)); - this.triggerSubscriptionChange(); - } - return () => { - this.unsubscribe(fn); - }; - } - /** - * Checks it the event has a subscription for the specified handler. - * - * @param {TEventHandler} fn The event handler. - * - * @memberOf DispatcherBase - */ - has(fn) { - if (!fn) - return false; - return this._subscriptions.some((sub) => sub.handler == fn); - } - /** - * Unsubscribes the handler from the dispatcher. - * - * @param {TEventHandler} fn The event handler. - * - * @memberOf DispatcherBase - */ - unsubscribe(fn) { - if (!fn) - return; - let changes = false; - for (let i = 0; i < this._subscriptions.length; i++) { - if (this._subscriptions[i].handler == fn) { - this._subscriptions.splice(i, 1); - changes = true; - break; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } - } - /** - * Unsubscribes the handler from the dispatcher. - * - * @param {TEventHandler} fn The event handler. - * - * @memberOf DispatcherBase - */ - unsub(fn) { - this.unsubscribe(fn); - } - /** - * Generic dispatch will dispatch the handlers with the given arguments. - * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. - * - * @memberOf DispatcherBase - */ - _dispatch(executeAsync, scope, args) { - //execute on a copy because of bug #9 - for (let sub of [...this._subscriptions]) { - let ev = new __1.EventManagement(() => this.unsub(sub.handler)); - let nargs = Array.prototype.slice.call(args); - nargs.push(ev); - let s = sub; - s.execute(executeAsync, scope, nargs); - //cleanup subs that are no longer needed - this.cleanup(sub); - if (!executeAsync && ev.propagationStopped) { - return { propagationStopped: true }; - } - } - if (executeAsync) { - return null; - } - return { propagationStopped: false }; - } - /** - * Creates a subscription. - * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce True if the handler should run only one. - * @returns {ISubscription} The subscription. - * - * @memberOf DispatcherBase - */ - createSubscription(handler, isOnce) { - return new __1.Subscription(handler, isOnce); - } - /** - * Cleans up subs that ran and should run only once. - * - * @protected - * @param {ISubscription} sub The subscription. - * - * @memberOf DispatcherBase - */ - cleanup(sub) { - let changes = false; - if (sub.isOnce && sub.isExecuted) { - let i = this._subscriptions.indexOf(sub); - if (i > -1) { - this._subscriptions.splice(i, 1); - changes = true; - } - } - if (changes) { - this.triggerSubscriptionChange(); - } - } - /** - * Creates an event from the dispatcher. Will return the dispatcher - * in a wrapper. This will prevent exposure of any dispatcher methods. - * - * @returns {ISubscribable} - * - * @memberOf DispatcherBase - */ - asEvent() { - if (this._wrap == null) { - this._wrap = new __1.DispatcherWrapper(this); - } - return this._wrap; - } - /** - * Clears the subscriptions. - * - * @memberOf DispatcherBase - */ - clear() { - if (this._subscriptions.length != 0) { - this._subscriptions.splice(0, this._subscriptions.length); - this.triggerSubscriptionChange(); - } - } - /** - * Triggers the subscription change event. - * - * @private - * - * @memberOf DispatcherBase - */ - triggerSubscriptionChange() { - if (this._onSubscriptionChange != null) { - this._onSubscriptionChange.dispatch(this.count); - } - } -} -exports.DispatcherBase = DispatcherBase; - - -/***/ }), - -/***/ 3122: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DispatcherWrapper = void 0; -/** - * Hides the implementation of the event dispatcher. Will expose methods that - * are relevent to the event. - * - * @export - * @class DispatcherWrapper - * @implements {ISubscribable} - * @template TEventHandler The type of event handler. - */ -class DispatcherWrapper { - /** - * Creates an instance of DispatcherWrapper. - * @param {ISubscribable} dispatcher - * - * @memberOf DispatcherWrapper - */ - constructor(dispatcher) { - this._subscribe = (fn) => dispatcher.subscribe(fn); - this._unsubscribe = (fn) => dispatcher.unsubscribe(fn); - this._one = (fn) => dispatcher.one(fn); - this._has = (fn) => dispatcher.has(fn); - this._clear = () => dispatcher.clear(); - this._count = () => dispatcher.count; - this._onSubscriptionChange = () => dispatcher.onSubscriptionChange; - } - /** - * Triggered when subscriptions are changed (added or removed). - * - * @readonly - * @type {ISubscribable} - * @memberOf DispatcherWrapper - */ - get onSubscriptionChange() { - return this._onSubscriptionChange(); - } - /** - * Returns the number of subscriptions. - * - * @readonly - * @type {number} - * @memberOf DispatcherWrapper - */ - get count() { - return this._count(); - } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper - */ - subscribe(fn) { - return this._subscribe(fn); - } - /** - * Subscribe to the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper - */ - sub(fn) { - return this.subscribe(fn); - } - /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper - */ - unsubscribe(fn) { - this._unsubscribe(fn); - } - /** - * Unsubscribe from the event dispatcher. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper - */ - unsub(fn) { - this.unsubscribe(fn); - } - /** - * Subscribe once to the event with the specified name. - * - * @returns {() => void} A function that unsubscribes the event handler from the event. - * - * @memberOf DispatcherWrapper - */ - one(fn) { - return this._one(fn); - } - /** - * Checks it the event has a subscription for the specified handler. - * - * @param {TEventHandler} fn The event handler that is called when the event is dispatched. - * - * @memberOf DispatcherWrapper - */ - has(fn) { - return this._has(fn); - } - /** - * Clears all the subscriptions. - * - * @memberOf DispatcherWrapper - */ - clear() { - this._clear(); - } -} -exports.DispatcherWrapper = DispatcherWrapper; - - -/***/ }), - -/***/ 7955: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventListBase = void 0; -/** - * Base class for event lists classes. Implements the get and remove. - * - * @export - * @abstract - * @class EventListBaset - * @template TEventDispatcher The type of event dispatcher. - */ -class EventListBase { - constructor() { - this._events = {}; - } - /** - * Gets the dispatcher associated with the name. - * - * @param {string} name The name of the event. - * @returns {TEventDispatcher} The disptacher. - * - * @memberOf EventListBase - */ - get(name) { - let event = this._events[name]; - if (event) { - return event; - } - event = this.createDispatcher(); - this._events[name] = event; - return event; - } - /** - * Removes the dispatcher associated with the name. - * - * @param {string} name - * - * @memberOf EventListBase - */ - remove(name) { - delete this._events[name]; - } -} -exports.EventListBase = EventListBase; - - -/***/ }), - -/***/ 2490: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseDispatcherBase = void 0; -const __1 = __webpack_require__(3310); -/** - * Dispatcher base for dispatchers that use promises. Each promise - * is awaited before the next is dispatched, unless the event is - * dispatched with the executeAsync flag. - * - * @export - * @abstract - * @class PromiseDispatcherBase - * @extends {DispatcherBase} - * @template TEventHandler The type of event handler. - */ -class PromiseDispatcherBase extends __1.DispatcherBase { - /** - * The normal dispatch cannot be used in this class. - * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. - * - * @memberOf DispatcherBase - */ - _dispatch(executeAsync, scope, args) { - throw new __1.DispatchError("_dispatch not supported. Use _dispatchAsPromise."); - } - /** - * Crates a new subscription. - * - * @protected - * @param {TEventHandler} handler The handler. - * @param {boolean} isOnce Indicates if the handler should only run once. - * @returns {ISubscription} The subscription. - * - * @memberOf PromiseDispatcherBase - */ - createSubscription(handler, isOnce) { - return new __1.PromiseSubscription(handler, isOnce); - } - /** - * Generic dispatch will dispatch the handlers with the given arguments. - * - * @protected - * @param {boolean} executeAsync `True` if the even should be executed async. - * @param {*} scope The scope of the event. The scope becomes the `this` for handler. - * @param {IArguments} args The arguments for the event. - * @returns {(IPropagationStatus | null)} The propagation status, or if an `executeAsync` is used `null`. - * - * @memberOf DispatcherBase - */ - async _dispatchAsPromise(executeAsync, scope, args) { - //execute on a copy because of bug #9 - for (let sub of [...this._subscriptions]) { - let ev = new __1.EventManagement(() => this.unsub(sub.handler)); - let nargs = Array.prototype.slice.call(args); - nargs.push(ev); - let ps = sub; - await ps.execute(executeAsync, scope, nargs); - //cleanup subs that are no longer needed - this.cleanup(sub); - if (!executeAsync && ev.propagationStopped) { - return { propagationStopped: true }; - } - } - if (executeAsync) { - return null; - } - return { propagationStopped: false }; - } -} -exports.PromiseDispatcherBase = PromiseDispatcherBase; - - -/***/ }), - -/***/ 1002: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = void 0; -const __1 = __webpack_require__(3310); -/** - * Dispatcher for subscription changes. - * - * @export - * @class SubscriptionChangeEventDispatcher - * @extends {DispatcherBase} - */ -class SubscriptionChangeEventDispatcher extends __1.DispatcherBase { - /** - * Dispatches the event. - * - * @param {number} count The currrent number of subscriptions. - * - * @memberOf SubscriptionChangeEventDispatcher - */ - dispatch(count) { - this._dispatch(false, this, arguments); - } -} -exports.SubscriptionChangeEventDispatcher = SubscriptionChangeEventDispatcher; - - -/***/ }), - -/***/ 9347: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.PromiseSubscription = void 0; -/** - * Subscription implementation for events with promises. - * - * @export - * @class PromiseSubscription - * @implements {ISubscription} - * @template TEventHandler The type of event handler. - */ -class PromiseSubscription { - /** - * Creates an instance of PromiseSubscription. - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. - * - * @memberOf PromiseSubscription - */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - * - * @memberOf PromiseSubscription - */ - this.isExecuted = false; - } - /** - * Executes the handler. - * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. - * - * @memberOf PromiseSubscription - */ - async execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - //TODO: do we need to cast to any -- seems yuck - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - return; - } - let result = fn.apply(scope, args); - await result; - } - } -} -exports.PromiseSubscription = PromiseSubscription; - - -/***/ }), - -/***/ 2229: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Subscription = void 0; -/** - * Stores a handler. Manages execution meta data. - * @class Subscription - * @template TEventHandler - */ -class Subscription { - /** - * Creates an instance of Subscription. - * - * @param {TEventHandler} handler The handler for the subscription. - * @param {boolean} isOnce Indicates if the handler should only be executed once. - */ - constructor(handler, isOnce) { - this.handler = handler; - this.isOnce = isOnce; - /** - * Indicates if the subscription has been executed before. - */ - this.isExecuted = false; - } - /** - * Executes the handler. - * - * @param {boolean} executeAsync True if the even should be executed async. - * @param {*} scope The scope the scope of the event. - * @param {IArguments} args The arguments for the event. - */ - execute(executeAsync, scope, args) { - if (!this.isOnce || !this.isExecuted) { - this.isExecuted = true; - var fn = this.handler; - if (executeAsync) { - setTimeout(() => { - fn.apply(scope, args); - }, 1); - } - else { - fn.apply(scope, args); - } - } - } -} -exports.Subscription = Subscription; - - -/***/ }), - -/***/ 1605: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.HandlingBase = void 0; -/** - * Base class that implements event handling. With a an - * event list this base class will expose events that can be - * subscribed to. This will give your class generic events. - * - * @export - * @abstract - * @class HandlingBase - * @template TEventHandler The type of event handler. - * @template TDispatcher The type of dispatcher. - * @template TList The type of event list. - */ -class HandlingBase { - /** - * Creates an instance of HandlingBase. - * @param {TList} events The event list. Used for event management. - * - * @memberOf HandlingBase - */ - constructor(events) { - this.events = events; - } - /** - * Subscribes once to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - one(name, fn) { - this.events.get(name).one(fn); - } - /** - * Checks it the event has a subscription for the specified handler. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - has(name, fn) { - return this.events.get(name).has(fn); - } - /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - subscribe(name, fn) { - this.events.get(name).subscribe(fn); - } - /** - * Subscribes to the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - sub(name, fn) { - this.subscribe(name, fn); - } - /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - unsubscribe(name, fn) { - this.events.get(name).unsubscribe(fn); - } - /** - * Unsubscribes from the event with the specified name. - * @param {string} name The name of the event. - * @param {TEventHandler} fn The event handler. - * - * @memberOf HandlingBase - */ - unsub(name, fn) { - this.unsubscribe(name, fn); - } -} -exports.HandlingBase = HandlingBase; - - -/***/ }), - -/***/ 3310: -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { - -"use strict"; - -/*! - * Strongly Typed Events for TypeScript - Core - * https://github.com/KeesCBakker/StronlyTypedEvents/ - * http://keestalkstech.com - * - * Copyright Kees C. Bakker / KeesTalksTech - * Released under the MIT license - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SubscriptionChangeEventDispatcher = exports.HandlingBase = exports.PromiseDispatcherBase = exports.PromiseSubscription = exports.DispatchError = exports.EventManagement = exports.EventListBase = exports.DispatcherWrapper = exports.DispatcherBase = exports.Subscription = void 0; -const DispatcherBase_1 = __webpack_require__(3040); -Object.defineProperty(exports, "DispatcherBase", ({ enumerable: true, get: function () { return DispatcherBase_1.DispatcherBase; } })); -const DispatchError_1 = __webpack_require__(8181); -Object.defineProperty(exports, "DispatchError", ({ enumerable: true, get: function () { return DispatchError_1.DispatchError; } })); -const DispatcherWrapper_1 = __webpack_require__(3122); -Object.defineProperty(exports, "DispatcherWrapper", ({ enumerable: true, get: function () { return DispatcherWrapper_1.DispatcherWrapper; } })); -const EventListBase_1 = __webpack_require__(7955); -Object.defineProperty(exports, "EventListBase", ({ enumerable: true, get: function () { return EventListBase_1.EventListBase; } })); -const EventManagement_1 = __webpack_require__(2234); -Object.defineProperty(exports, "EventManagement", ({ enumerable: true, get: function () { return EventManagement_1.EventManagement; } })); -const HandlingBase_1 = __webpack_require__(1605); -Object.defineProperty(exports, "HandlingBase", ({ enumerable: true, get: function () { return HandlingBase_1.HandlingBase; } })); -const PromiseDispatcherBase_1 = __webpack_require__(2490); -Object.defineProperty(exports, "PromiseDispatcherBase", ({ enumerable: true, get: function () { return PromiseDispatcherBase_1.PromiseDispatcherBase; } })); -const PromiseSubscription_1 = __webpack_require__(9347); -Object.defineProperty(exports, "PromiseSubscription", ({ enumerable: true, get: function () { return PromiseSubscription_1.PromiseSubscription; } })); -const Subscription_1 = __webpack_require__(2229); -Object.defineProperty(exports, "Subscription", ({ enumerable: true, get: function () { return Subscription_1.Subscription; } })); -const SubscriptionChangeEventHandler_1 = __webpack_require__(1002); -Object.defineProperty(exports, "SubscriptionChangeEventDispatcher", ({ enumerable: true, get: function () { return SubscriptionChangeEventHandler_1.SubscriptionChangeEventDispatcher; } })); - - -/***/ }), - -/***/ 2234: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.EventManagement = void 0; -/** - * Allows the user to interact with the event. - * - * @export - * @class EventManagement - * @implements {IEventManagement} - */ -class EventManagement { - /** - * Creates an instance of EventManagement. - * @param {() => void} unsub An unsubscribe handler. - * - * @memberOf EventManagement - */ - constructor(unsub) { - this.unsub = unsub; - this.propagationStopped = false; - } - /** - * Stops the propagation of the event. - * Cannot be used when async dispatch is done. - * - * @memberOf EventManagement - */ - stopPropagation() { - this.propagationStopped = true; - } -} -exports.EventManagement = EventManagement; - - -/***/ }), - -/***/ 3861: -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; - -// EXPORTS -__webpack_require__.d(__webpack_exports__, { - "ZP": () => (/* binding */ tippy_esm) -}); - -// UNUSED EXPORTS: animateFill, createSingleton, delegate, followCursor, hideAll, inlinePositioning, roundArrow, sticky - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindow.js -function getWindow(node) { - if (node == null) { - return window; - } - - if (node.toString() !== '[object Window]') { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - - return node; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/instanceOf.js - - -function isElement(node) { - var OwnElement = getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; -} - -function isHTMLElement(node) { - var OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; -} - -function isShadowRoot(node) { - // IE 11 has no ShadowRoot - if (typeof ShadowRoot === 'undefined') { - return false; - } - - var OwnElement = getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; -} - - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/math.js -var math_max = Math.max; -var math_min = Math.min; -var round = Math.round; -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js - - -function getBoundingClientRect(element, includeScale) { - if (includeScale === void 0) { - includeScale = false; - } - - var rect = element.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - - if (isHTMLElement(element) && includeScale) { - var offsetHeight = element.offsetHeight; - var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale - // Fallback to 1 in case both values are `0` - - if (offsetWidth > 0) { - scaleX = round(rect.width) / offsetWidth || 1; - } - - if (offsetHeight > 0) { - scaleY = round(rect.height) / offsetHeight || 1; - } - } - - return { - width: rect.width / scaleX, - height: rect.height / scaleY, - top: rect.top / scaleY, - right: rect.right / scaleX, - bottom: rect.bottom / scaleY, - left: rect.left / scaleX, - x: rect.left / scaleX, - y: rect.top / scaleY - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js - -function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft: scrollLeft, - scrollTop: scrollTop - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js -function getHTMLElementScroll(element) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js - - - - -function getNodeScroll(node) { - if (node === getWindow(node) || !isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); - } -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getNodeName.js -function getNodeName(element) { - return element ? (element.nodeName || '').toLowerCase() : null; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js - -function getDocumentElement(element) { - // $FlowFixMe[incompatible-return]: assume body is always available - return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] - element.document) || window.document).documentElement; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js - - - -function getWindowScrollBarX(element) { - // If has a CSS width greater than the viewport, then this will be - // incorrect for RTL. - // Popper 1 is broken in this case and never had a bug report so let's assume - // it's not an issue. I don't think anyone ever specifies width on - // anyway. - // Browsers where the left scrollbar doesn't cause an issue report `0` for - // this (e.g. Edge 2019, IE11, Safari) - return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js - -function getComputedStyle(element) { - return getWindow(element).getComputedStyle(element); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js - -function isScrollParent(element) { - // Firefox wants us to check `-x` and `-y` variations as well - var _getComputedStyle = getComputedStyle(element), - overflow = _getComputedStyle.overflow, - overflowX = _getComputedStyle.overflowX, - overflowY = _getComputedStyle.overflowY; - - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js - - - - - - - - - -function isElementScaled(element) { - var rect = element.getBoundingClientRect(); - var scaleX = round(rect.width) / element.offsetWidth || 1; - var scaleY = round(rect.height) / element.offsetHeight || 1; - return scaleX !== 1 || scaleY !== 1; -} // Returns the composite rect of an element relative to its offsetParent. -// Composite means it takes into account transforms as well as layout. - - -function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; - } - - var isOffsetParentAnElement = isHTMLElement(offsetParent); - var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); - var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 - isScrollParent(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - - if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent, true); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX(documentElement); - } - } - - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js - // Returns the layout rect of an element relative to its offsetParent. Layout -// means it doesn't take into account transforms. - -function getLayoutRect(element) { - var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. - // Fixes https://github.com/popperjs/popper-core/issues/1223 - - var width = element.offsetWidth; - var height = element.offsetHeight; - - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - - return { - x: element.offsetLeft, - y: element.offsetTop, - width: width, - height: height - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getParentNode.js - - - -function getParentNode(element) { - if (getNodeName(element) === 'html') { - return element; - } - - return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle - // $FlowFixMe[incompatible-return] - // $FlowFixMe[prop-missing] - element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - isShadowRoot(element) ? element.host : null) || // ShadowRoot detected - // $FlowFixMe[incompatible-call]: HTMLElement is a Node - getDocumentElement(element) // fallback - - ); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js - - - - -function getScrollParent(node) { - if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { - // $FlowFixMe[incompatible-return]: assume body is always available - return node.ownerDocument.body; - } - - if (isHTMLElement(node) && isScrollParent(node)) { - return node; - } - - return getScrollParent(getParentNode(node)); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js - - - - -/* -given a DOM element, return the list of all scroll parents, up the list of ancesors -until we get to the top window object. This list is what we attach scroll listeners -to, because if any of these parent elements scroll, we'll need to re-calculate the -reference element's position. -*/ - -function listScrollParents(element, list) { - var _element$ownerDocumen; - - if (list === void 0) { - list = []; - } - - var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here - updatedList.concat(listScrollParents(getParentNode(target))); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/isTableElement.js - -function isTableElement(element) { - return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js - - - - - - - -function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 - getComputedStyle(element).position === 'fixed') { - return null; - } - - return element.offsetParent; -} // `.offsetParent` reports `null` for fixed elements, while absolute elements -// return the containing block - - -function getContainingBlock(element) { - var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; - var isIE = navigator.userAgent.indexOf('Trident') !== -1; - - if (isIE && isHTMLElement(element)) { - // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport - var elementCss = getComputedStyle(element); - - if (elementCss.position === 'fixed') { - return null; - } - } - - var currentNode = getParentNode(element); - - while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { - var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that - // create a containing block. - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - - if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - - return null; -} // Gets the closest ancestor positioned element. Handles some edge cases, -// such as table ancestors and cross browser bugs. - - -function getOffsetParent(element) { - var window = getWindow(element); - var offsetParent = getTrueOffsetParent(element); - - while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { - offsetParent = getTrueOffsetParent(offsetParent); - } - - if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { - return window; - } - - return offsetParent || getContainingBlock(element) || window; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/enums.js -var enums_top = 'top'; -var bottom = 'bottom'; -var right = 'right'; -var left = 'left'; -var auto = 'auto'; -var basePlacements = [enums_top, bottom, right, left]; -var start = 'start'; -var end = 'end'; -var clippingParents = 'clippingParents'; -var viewport = 'viewport'; -var popper = 'popper'; -var reference = 'reference'; -var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { - return acc.concat([placement + "-" + start, placement + "-" + end]); -}, []); -var enums_placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { - return acc.concat([placement, placement + "-" + start, placement + "-" + end]); -}, []); // modifiers that need to read the DOM - -var beforeRead = 'beforeRead'; -var read = 'read'; -var afterRead = 'afterRead'; // pure-logic modifiers - -var beforeMain = 'beforeMain'; -var main = 'main'; -var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) - -var beforeWrite = 'beforeWrite'; -var write = 'write'; -var afterWrite = 'afterWrite'; -var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/orderModifiers.js - // source: https://stackoverflow.com/questions/49875255 - -function order(modifiers) { - var map = new Map(); - var visited = new Set(); - var result = []; - modifiers.forEach(function (modifier) { - map.set(modifier.name, modifier); - }); // On visiting object, check for its dependencies and visit them recursively - - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function (dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - - if (depModifier) { - sort(depModifier); - } - } - }); - result.push(modifier); - } - - modifiers.forEach(function (modifier) { - if (!visited.has(modifier.name)) { - // check for visited object - sort(modifier); - } - }); - return result; -} - -function orderModifiers(modifiers) { - // order based on dependencies - var orderedModifiers = order(modifiers); // order based on phase - - return modifierPhases.reduce(function (acc, phase) { - return acc.concat(orderedModifiers.filter(function (modifier) { - return modifier.phase === phase; - })); - }, []); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/debounce.js -function debounce(fn) { - var pending; - return function () { - if (!pending) { - pending = new Promise(function (resolve) { - Promise.resolve().then(function () { - pending = undefined; - resolve(fn()); - }); - }); - } - - return pending; - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergeByName.js -function mergeByName(modifiers) { - var merged = modifiers.reduce(function (merged, current) { - var existing = merged[current.name]; - merged[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged; - }, {}); // IE11 does not support Object.values - - return Object.keys(merged).map(function (key) { - return merged[key]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/createPopper.js - - - - - - - - - - - - - - -var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; -var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; -var DEFAULT_OPTIONS = { - placement: 'bottom', - modifiers: [], - strategy: 'absolute' -}; - -function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return !args.some(function (element) { - return !(element && typeof element.getBoundingClientRect === 'function'); - }); -} - -function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; - } - - var _generatorOptions = generatorOptions, - _generatorOptions$def = _generatorOptions.defaultModifiers, - defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, - _generatorOptions$def2 = _generatorOptions.defaultOptions, - defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper(reference, popper, options) { - if (options === void 0) { - options = defaultOptions; - } - - var state = { - placement: 'bottom', - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference, - popper: popper - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance = { - state: state, - setOptions: function setOptions(setOptionsAction) { - var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options); - state.scrollParents = { - reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], - popper: listScrollParents(popper) - }; // Orders the modifiers based on their dependencies and `phase` - // properties - - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers - - state.orderedModifiers = orderedModifiers.filter(function (m) { - return m.enabled; - }); // Validate the provided modifiers so that the consumer will get warned - // if one of the modifiers is invalid for any reason - - if (false) { var _getComputedStyle, marginTop, marginRight, marginBottom, marginLeft, flipModifier, modifiers; } - - runModifierEffects(); - return instance.update(); - }, - // Sync update – it will always be executed, even if not necessary. This - // is useful for low frequency updates where sync behavior simplifies the - // logic. - // For high frequency updates (e.g. `resize` and `scroll` events), always - // prefer the async Popper#update method - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - - var _state$elements = state.elements, - reference = _state$elements.reference, - popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements - // anymore - - if (!areValidElements(reference, popper)) { - if (false) {} - - return; - } // Store the reference and popper rects to be read by modifiers - - - state.rects = { - reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), - popper: getLayoutRect(popper) - }; // Modifiers have the ability to reset the current update cycle. The - // most common use case for this is the `flip` modifier changing the - // placement, which then needs to re-run all the modifiers, because the - // logic was previously ran for the previous placement and is therefore - // stale/incorrect - - state.reset = false; - state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier - // is filled with the initial data specified by the modifier. This means - // it doesn't persist and is fresh on each update. - // To ensure persistent data, use `${name}#persistent` - - state.orderedModifiers.forEach(function (modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - var __debug_loops__ = 0; - - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (false) {} - - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - - var _state$orderedModifie = state.orderedModifiers[index], - fn = _state$orderedModifie.fn, - _state$orderedModifie2 = _state$orderedModifie.options, - _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, - name = _state$orderedModifie.name; - - if (typeof fn === 'function') { - state = fn({ - state: state, - options: _options, - name: name, - instance: instance - }) || state; - } - } - }, - // Async and optimistically optimized update – it will not be executed if - // not necessary (debounced to run at most once-per-tick) - update: debounce(function () { - return new Promise(function (resolve) { - instance.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; - } - }; - - if (!areValidElements(reference, popper)) { - if (false) {} - - return instance; - } - - instance.setOptions(options).then(function (state) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state); - } - }); // Modifiers have the ability to execute arbitrary code before the first - // update cycle runs. They will be executed in the same order as the update - // cycle. This is useful when a modifier adds some persistent data that - // other modifiers need to use, but the modifier is run after the dependent - // one. - - function runModifierEffects() { - state.orderedModifiers.forEach(function (_ref3) { - var name = _ref3.name, - _ref3$options = _ref3.options, - options = _ref3$options === void 0 ? {} : _ref3$options, - effect = _ref3.effect; - - if (typeof effect === 'function') { - var cleanupFn = effect({ - state: state, - name: name, - instance: instance, - options: options - }); - - var noopFn = function noopFn() {}; - - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - - function cleanupModifierEffects() { - effectCleanupFns.forEach(function (fn) { - return fn(); - }); - effectCleanupFns = []; - } - - return instance; - }; -} -var createPopper = /*#__PURE__*/(/* unused pure expression or super */ null && (popperGenerator())); // eslint-disable-next-line import/no-unused-modules - - -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/eventListeners.js - // eslint-disable-next-line import/no-unused-modules - -var passive = { - passive: true -}; - -function effect(_ref) { - var state = _ref.state, - instance = _ref.instance, - options = _ref.options; - var _options$scroll = options.scroll, - scroll = _options$scroll === void 0 ? true : _options$scroll, - _options$resize = options.resize, - resize = _options$resize === void 0 ? true : _options$resize; - var window = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.addEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.addEventListener('resize', instance.update, passive); - } - - return function () { - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.removeEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.removeEventListener('resize', instance.update, passive); - } - }; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const eventListeners = ({ - name: 'eventListeners', - enabled: true, - phase: 'write', - fn: function fn() {}, - effect: effect, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getBasePlacement.js - -function getBasePlacement(placement) { - return placement.split('-')[0]; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getVariation.js -function getVariation(placement) { - return placement.split('-')[1]; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js -function getMainAxisFromPlacement(placement) { - return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeOffsets.js - - - - -function computeOffsets(_ref) { - var reference = _ref.reference, - element = _ref.element, - placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference.x + reference.width / 2 - element.width / 2; - var commonY = reference.y + reference.height / 2 - element.height / 2; - var offsets; - - switch (basePlacement) { - case enums_top: - offsets = { - x: commonX, - y: reference.y - element.height - }; - break; - - case bottom: - offsets = { - x: commonX, - y: reference.y + reference.height - }; - break; - - case right: - offsets = { - x: reference.x + reference.width, - y: commonY - }; - break; - - case left: - offsets = { - x: reference.x - element.width, - y: commonY - }; - break; - - default: - offsets = { - x: reference.x, - y: reference.y - }; - } - - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - - if (mainAxis != null) { - var len = mainAxis === 'y' ? 'height' : 'width'; - - switch (variation) { - case start: - offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); - break; - - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); - break; - - default: - } - } - - return offsets; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/popperOffsets.js - - -function popperOffsets(_ref) { - var state = _ref.state, - name = _ref.name; - // Offsets are the actual position the popper needs to have to be - // properly positioned near its reference element - // This is the most basic placement, and will be adjusted by - // the modifiers in the next step - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: 'absolute', - placement: state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_popperOffsets = ({ - name: 'popperOffsets', - enabled: true, - phase: 'read', - fn: popperOffsets, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/computeStyles.js - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -var unsetSides = { - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto' -}; // Round the offsets to the nearest suitable subpixel based on the DPR. -// Zooming can change the DPR, but it seems to report a value that will -// cleanly divide the values into the appropriate subpixels. - -function roundOffsetsByDPR(_ref) { - var x = _ref.x, - y = _ref.y; - var win = window; - var dpr = win.devicePixelRatio || 1; - return { - x: round(x * dpr) / dpr || 0, - y: round(y * dpr) / dpr || 0 - }; -} - -function mapToStyles(_ref2) { - var _Object$assign2; - - var popper = _ref2.popper, - popperRect = _ref2.popperRect, - placement = _ref2.placement, - variation = _ref2.variation, - offsets = _ref2.offsets, - position = _ref2.position, - gpuAcceleration = _ref2.gpuAcceleration, - adaptive = _ref2.adaptive, - roundOffsets = _ref2.roundOffsets, - isFixed = _ref2.isFixed; - var _offsets$x = offsets.x, - x = _offsets$x === void 0 ? 0 : _offsets$x, - _offsets$y = offsets.y, - y = _offsets$y === void 0 ? 0 : _offsets$y; - - var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ - x: x, - y: y - }) : { - x: x, - y: y - }; - - x = _ref3.x; - y = _ref3.y; - var hasX = offsets.hasOwnProperty('x'); - var hasY = offsets.hasOwnProperty('y'); - var sideX = left; - var sideY = enums_top; - var win = window; - - if (adaptive) { - var offsetParent = getOffsetParent(popper); - var heightProp = 'clientHeight'; - var widthProp = 'clientWidth'; - - if (offsetParent === getWindow(popper)) { - offsetParent = getDocumentElement(popper); - - if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { - heightProp = 'scrollHeight'; - widthProp = 'scrollWidth'; - } - } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it - - - offsetParent = offsetParent; - - if (placement === enums_top || (placement === left || placement === right) && variation === end) { - sideY = bottom; - var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] - offsetParent[heightProp]; - y -= offsetY - popperRect.height; - y *= gpuAcceleration ? 1 : -1; - } - - if (placement === left || (placement === enums_top || placement === bottom) && variation === end) { - sideX = right; - var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] - offsetParent[widthProp]; - x -= offsetX - popperRect.width; - x *= gpuAcceleration ? 1 : -1; - } - } - - var commonStyles = Object.assign({ - position: position - }, adaptive && unsetSides); - - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x: x, - y: y - }) : { - x: x, - y: y - }; - - x = _ref4.x; - y = _ref4.y; - - if (gpuAcceleration) { - var _Object$assign; - - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); -} - -function computeStyles(_ref5) { - var state = _ref5.state, - options = _ref5.options; - var _options$gpuAccelerat = options.gpuAcceleration, - gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, - _options$adaptive = options.adaptive, - adaptive = _options$adaptive === void 0 ? true : _options$adaptive, - _options$roundOffsets = options.roundOffsets, - roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - - if (false) { var transitionProperty; } - - var commonStyles = { - placement: getBasePlacement(state.placement), - variation: getVariation(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration: gpuAcceleration, - isFixed: state.options.strategy === 'fixed' - }; - - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive: adaptive, - roundOffsets: roundOffsets - }))); - } - - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: 'absolute', - adaptive: false, - roundOffsets: roundOffsets - }))); - } - - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-placement': state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_computeStyles = ({ - name: 'computeStyles', - enabled: true, - phase: 'beforeWrite', - fn: computeStyles, - data: {} -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/applyStyles.js - - // This modifier takes the styles prepared by the `computeStyles` modifier -// and applies them to the HTMLElements such as popper and arrow - -function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function (name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element = state.elements[name]; // arrow is optional + virtual elements - - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } // Flow doesn't support to extend this property, but it's the most - // effective way to apply styles to an HTMLElement - // $FlowFixMe[cannot-write] - - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (name) { - var value = attributes[name]; - - if (value === false) { - element.removeAttribute(name); - } else { - element.setAttribute(name, value === true ? '' : value); - } - }); - }); -} - -function applyStyles_effect(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: '0', - top: '0', - margin: '0' - }, - arrow: { - position: 'absolute' - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); - } - - return function () { - Object.keys(state.elements).forEach(function (name) { - var element = state.elements[name]; - var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them - - var style = styleProperties.reduce(function (style, property) { - style[property] = ''; - return style; - }, {}); // arrow is optional + virtual elements - - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (attribute) { - element.removeAttribute(attribute); - }); - }); - }; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_applyStyles = ({ - name: 'applyStyles', - enabled: true, - phase: 'write', - fn: applyStyles, - effect: applyStyles_effect, - requires: ['computeStyles'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/offset.js - - // eslint-disable-next-line import/no-unused-modules - -function distanceAndSkiddingToXY(placement, rects, offset) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, enums_top].indexOf(basePlacement) >= 0 ? -1 : 1; - - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { - placement: placement - })) : offset, - skidding = _ref[0], - distance = _ref[1]; - - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; -} - -function offset(_ref2) { - var state = _ref2.state, - options = _ref2.options, - name = _ref2.name; - var _options$offset = options.offset, - offset = _options$offset === void 0 ? [0, 0] : _options$offset; - var data = enums_placements.reduce(function (acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); - return acc; - }, {}); - var _data$state$placement = data[state.placement], - x = _data$state$placement.x, - y = _data$state$placement.y; - - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x; - state.modifiersData.popperOffsets.y += y; - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_offset = ({ - name: 'offset', - enabled: true, - phase: 'main', - requires: ['popperOffsets'], - fn: offset -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositePlacement.js -var hash = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' -}; -function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function (matched) { - return hash[matched]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js -var getOppositeVariationPlacement_hash = { - start: 'end', - end: 'start' -}; -function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function (matched) { - return getOppositeVariationPlacement_hash[matched]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js - - - -function getViewportRect(element) { - var win = getWindow(element); - var html = getDocumentElement(element); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x = 0; - var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper - // can be obscured underneath it. - // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even - // if it isn't open, so if this isn't available, the popper will be detected - // to overflow the bottom of the screen too early. - - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) - // In Chrome, it returns a value very close to 0 (+/-) but contains rounding - // errors due to floating point numbers, so we need to check precision. - // Safari returns a number <= 0, usually < -1 when pinch-zoomed - // Feature detection fails in mobile emulation mode in Chrome. - // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < - // 0.001 - // Fallback here: "Not Safari" userAgent - - if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - - return { - width: width, - height: height, - x: x + getWindowScrollBarX(element), - y: y - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js - - - - - // Gets the entire size of the scrollable document area, even extending outside -// of the `` and `` rect bounds if horizontally scrollable - -function getDocumentRect(element) { - var _element$ownerDocumen; - - var html = getDocumentElement(element); - var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = math_max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = math_max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x = -winScroll.scrollLeft + getWindowScrollBarX(element); - var y = -winScroll.scrollTop; - - if (getComputedStyle(body || html).direction === 'rtl') { - x += math_max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - - return { - width: width, - height: height, - x: x, - y: y - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/contains.js - -function contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method - - if (parent.contains(child)) { - return true; - } // then fallback to custom implementation with Shadow DOM support - else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - - do { - if (next && parent.isSameNode(next)) { - return true; - } // $FlowFixMe[prop-missing]: need a better way to handle this... - - - next = next.parentNode || next.host; - } while (next); - } // Give up, the result is false - - - return false; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/rectToClientRect.js -function rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js - - - - - - - - - - - - - - - -function getInnerBoundingClientRect(element) { - var rect = getBoundingClientRect(element); - rect.top = rect.top + element.clientTop; - rect.left = rect.left + element.clientLeft; - rect.bottom = rect.top + element.clientHeight; - rect.right = rect.left + element.clientWidth; - rect.width = element.clientWidth; - rect.height = element.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; -} - -function getClientRectFromMixedType(element, clippingParent) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); -} // A "clipping parent" is an overflowable container with the characteristic of -// clipping (or hiding) overflowing elements with a position different from -// `initial` - - -function getClippingParents(element) { - var clippingParents = listScrollParents(getParentNode(element)); - var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; - - if (!isElement(clipperElement)) { - return []; - } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 - - - return clippingParents.filter(function (clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; - }); -} // Gets the maximum area that the element is visible in due to any number of -// clipping parents - - -function getClippingRect(element, boundary, rootBoundary) { - var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); - var clippingParents = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents[0]; - var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { - var rect = getClientRectFromMixedType(element, clippingParent); - accRect.top = math_max(rect.top, accRect.top); - accRect.right = math_min(rect.right, accRect.right); - accRect.bottom = math_min(rect.bottom, accRect.bottom); - accRect.left = math_max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element, firstClippingParent)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getFreshSideObject.js -function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/mergePaddingObject.js - -function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/expandToHashMap.js -function expandToHashMap(value, keys) { - return keys.reduce(function (hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/detectOverflow.js - - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -function detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - _options$placement = _options.placement, - placement = _options$placement === void 0 ? state.placement : _options$placement, - _options$boundary = _options.boundary, - boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, - _options$rootBoundary = _options.rootBoundary, - rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, - _options$elementConte = _options.elementContext, - elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, - _options$altBoundary = _options.altBoundary, - altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, - _options$padding = _options.padding, - padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var popperRect = state.rects.popper; - var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); - var referenceClientRect = getBoundingClientRect(state.elements.reference); - var popperOffsets = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: 'absolute', - placement: placement - }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect - // 0 or negative = within the clipping rect - - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right - }; - var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element - - if (elementContext === popper && offsetData) { - var offset = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function (key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [enums_top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; - overflowOffsets[key] += offset[axis] * multiply; - }); - } - - return overflowOffsets; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js - - - - -function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - placement = _options.placement, - boundary = _options.boundary, - rootBoundary = _options.rootBoundary, - padding = _options.padding, - flipVariations = _options.flipVariations, - _options$allowedAutoP = _options.allowedAutoPlacements, - allowedAutoPlacements = _options$allowedAutoP === void 0 ? enums_placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { - return getVariation(placement) === variation; - }) : basePlacements; - var allowedPlacements = placements.filter(function (placement) { - return allowedAutoPlacements.indexOf(placement) >= 0; - }); - - if (allowedPlacements.length === 0) { - allowedPlacements = placements; - - if (false) {} - } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... - - - var overflows = allowedPlacements.reduce(function (acc, placement) { - acc[placement] = detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding - })[getBasePlacement(placement)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function (a, b) { - return overflows[a] - overflows[b]; - }); -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/flip.js - - - - - - - // eslint-disable-next-line import/no-unused-modules - -function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === auto) { - return []; - } - - var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; -} - -function flip(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - - if (state.modifiersData[name]._skip) { - return; - } - - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, - specifiedFallbackPlacements = options.fallbackPlacements, - padding = options.padding, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - _options$flipVariatio = options.flipVariations, - flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, - allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { - return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - flipVariations: flipVariations, - allowedAutoPlacements: allowedAutoPlacements - }) : placement); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements[0]; - - for (var i = 0; i < placements.length; i++) { - var placement = placements[i]; - - var _basePlacement = getBasePlacement(placement); - - var isStartVariation = getVariation(placement) === start; - var isVertical = [enums_top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? 'width' : 'height'; - var overflow = detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - altBoundary: altBoundary, - padding: padding - }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : enums_top; - - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement(mainVariationSide); - } - - var altVariationSide = getOppositePlacement(mainVariationSide); - var checks = []; - - if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); - } - - if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); - } - - if (checks.every(function (check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; - } - - checksMap.set(placement, checks); - } - - if (makeFallbackChecks) { - // `2` may be desired in some cases – research later - var numberOfChecks = flipVariations ? 3 : 1; - - var _loop = function _loop(_i) { - var fittingPlacement = placements.find(function (placement) { - var checks = checksMap.get(placement); - - if (checks) { - return checks.slice(0, _i).every(function (check) { - return check; - }); - } - }); - - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; - } - }; - - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - - if (_ret === "break") break; - } - } - - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; - } -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_flip = ({ - name: 'flip', - enabled: true, - phase: 'main', - fn: flip, - requiresIfExists: ['offset'], - data: { - _skip: false - } -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/getAltAxis.js -function getAltAxis(axis) { - return axis === 'x' ? 'y' : 'x'; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/utils/within.js - -function within(min, value, max) { - return math_max(min, math_min(value, max)); -} -function withinMaxClamp(min, value, max) { - var v = within(min, value, max); - return v > max ? max : v; -} -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/preventOverflow.js - - - - - - - - - - - - -function preventOverflow(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - padding = options.padding, - _options$tether = options.tether, - tether = _options$tether === void 0 ? true : _options$tether, - _options$tetherOffset = options.tetherOffset, - tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow(state, { - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - altBoundary: altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? { - mainAxis: tetherOffsetValue, - altAxis: tetherOffsetValue - } : Object.assign({ - mainAxis: 0, - altAxis: 0 - }, tetherOffsetValue); - var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; - var data = { - x: 0, - y: 0 - }; - - if (!popperOffsets) { - return; - } - - if (checkMainAxis) { - var _offsetModifierState$; - - var mainSide = mainAxis === 'y' ? enums_top : left; - var altSide = mainAxis === 'y' ? bottom : right; - var len = mainAxis === 'y' ? 'height' : 'width'; - var offset = popperOffsets[mainAxis]; - var min = offset + overflow[mainSide]; - var max = offset - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go - // outside the reference bounds - - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want - // to include its full size in the calculation. If the reference is small - // and near the edge of a boundary, the popper can overflow even if the - // reference is not overflowing as well (e.g. virtual elements with no - // width or height) - - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; - var tetherMin = offset + minOffset - offsetModifierValue - clientOffset; - var tetherMax = offset + maxOffset - offsetModifierValue; - var preventedOffset = within(tether ? math_min(min, tetherMin) : min, offset, tether ? math_max(max, tetherMax) : max); - popperOffsets[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset; - } - - if (checkAltAxis) { - var _offsetModifierState$2; - - var _mainSide = mainAxis === 'x' ? enums_top : left; - - var _altSide = mainAxis === 'x' ? bottom : right; - - var _offset = popperOffsets[altAxis]; - - var _len = altAxis === 'y' ? 'height' : 'width'; - - var _min = _offset + overflow[_mainSide]; - - var _max = _offset - overflow[_altSide]; - - var isOriginSide = [enums_top, left].indexOf(basePlacement) !== -1; - - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - - popperOffsets[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_preventOverflow = ({ - name: 'preventOverflow', - enabled: true, - phase: 'main', - fn: preventOverflow, - requiresIfExists: ['offset'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/arrow.js - - - - - - - - - - // eslint-disable-next-line import/no-unused-modules - -var toPaddingObject = function toPaddingObject(padding, state) { - padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); -}; - -function arrow(_ref) { - var _state$modifiersData$; - - var state = _ref.state, - name = _ref.name, - options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? 'height' : 'width'; - - if (!arrowElement || !popperOffsets) { - return; - } - - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === 'y' ? enums_top : left; - var maxProp = axis === 'y' ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; - var startDiff = popperOffsets[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is - // outside of the popper bounds - - var min = paddingObject[minProp]; - var max = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset = within(min, center, max); // Prevents breaking syntax highlighting... - - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); -} - -function arrow_effect(_ref2) { - var state = _ref2.state, - options = _ref2.options; - var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; - - if (arrowElement == null) { - return; - } // CSS selector - - - if (typeof arrowElement === 'string') { - arrowElement = state.elements.popper.querySelector(arrowElement); - - if (!arrowElement) { - return; - } - } - - if (false) {} - - if (!contains(state.elements.popper, arrowElement)) { - if (false) {} - - return; - } - - state.elements.arrow = arrowElement; -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_arrow = ({ - name: 'arrow', - enabled: true, - phase: 'main', - fn: arrow, - effect: arrow_effect, - requires: ['popperOffsets'], - requiresIfExists: ['preventOverflow'] -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/modifiers/hide.js - - - -function getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 - }; - } - - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x - }; -} - -function isAnySideFullyClipped(overflow) { - return [enums_top, right, bottom, left].some(function (side) { - return overflow[side] >= 0; - }); -} - -function hide(_ref) { - var state = _ref.state, - name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow(state, { - elementContext: 'reference' - }); - var popperAltOverflow = detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets: referenceClippingOffsets, - popperEscapeOffsets: popperEscapeOffsets, - isReferenceHidden: isReferenceHidden, - hasPopperEscaped: hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-reference-hidden': isReferenceHidden, - 'data-popper-escaped': hasPopperEscaped - }); -} // eslint-disable-next-line import/no-unused-modules - - -/* harmony default export */ const modifiers_hide = ({ - name: 'hide', - enabled: true, - phase: 'main', - requiresIfExists: ['preventOverflow'], - fn: hide -}); -;// CONCATENATED MODULE: ./node_modules/@popperjs/core/lib/popper.js - - - - - - - - - - -var defaultModifiers = [eventListeners, modifiers_popperOffsets, modifiers_computeStyles, modifiers_applyStyles, modifiers_offset, modifiers_flip, modifiers_preventOverflow, modifiers_arrow, modifiers_hide]; -var popper_createPopper = /*#__PURE__*/popperGenerator({ - defaultModifiers: defaultModifiers -}); // eslint-disable-next-line import/no-unused-modules - - // eslint-disable-next-line import/no-unused-modules - - // eslint-disable-next-line import/no-unused-modules - - -;// CONCATENATED MODULE: ./node_modules/tippy.js/dist/tippy.esm.js -/**! -* tippy.js v6.3.7 -* (c) 2017-2021 atomiks -* MIT License -*/ - - -var ROUND_ARROW = ''; -var BOX_CLASS = "tippy-box"; -var CONTENT_CLASS = "tippy-content"; -var BACKDROP_CLASS = "tippy-backdrop"; -var ARROW_CLASS = "tippy-arrow"; -var SVG_ARROW_CLASS = "tippy-svg-arrow"; -var TOUCH_OPTIONS = { - passive: true, - capture: true -}; -var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() { - return document.body; -}; - -function tippy_esm_hasOwnProperty(obj, key) { - return {}.hasOwnProperty.call(obj, key); -} -function getValueAtIndexOrReturn(value, index, defaultValue) { - if (Array.isArray(value)) { - var v = value[index]; - return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v; - } - - return value; -} -function isType(value, type) { - var str = {}.toString.call(value); - return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1; -} -function invokeWithArgsOrReturn(value, args) { - return typeof value === 'function' ? value.apply(void 0, args) : value; -} -function tippy_esm_debounce(fn, ms) { - // Avoid wrapping in `setTimeout` if ms is 0 anyway - if (ms === 0) { - return fn; - } - - var timeout; - return function (arg) { - clearTimeout(timeout); - timeout = setTimeout(function () { - fn(arg); - }, ms); - }; -} -function removeProperties(obj, keys) { - var clone = Object.assign({}, obj); - keys.forEach(function (key) { - delete clone[key]; - }); - return clone; -} -function splitBySpaces(value) { - return value.split(/\s+/).filter(Boolean); -} -function normalizeToArray(value) { - return [].concat(value); -} -function pushIfUnique(arr, value) { - if (arr.indexOf(value) === -1) { - arr.push(value); - } -} -function unique(arr) { - return arr.filter(function (item, index) { - return arr.indexOf(item) === index; - }); -} -function tippy_esm_getBasePlacement(placement) { - return placement.split('-')[0]; -} -function arrayFrom(value) { - return [].slice.call(value); -} -function removeUndefinedProps(obj) { - return Object.keys(obj).reduce(function (acc, key) { - if (obj[key] !== undefined) { - acc[key] = obj[key]; - } - - return acc; - }, {}); -} - -function div() { - return document.createElement('div'); -} -function tippy_esm_isElement(value) { - return ['Element', 'Fragment'].some(function (type) { - return isType(value, type); - }); -} -function isNodeList(value) { - return isType(value, 'NodeList'); -} -function isMouseEvent(value) { - return isType(value, 'MouseEvent'); -} -function isReferenceElement(value) { - return !!(value && value._tippy && value._tippy.reference === value); -} -function getArrayOfElements(value) { - if (tippy_esm_isElement(value)) { - return [value]; - } - - if (isNodeList(value)) { - return arrayFrom(value); - } - - if (Array.isArray(value)) { - return value; - } - - return arrayFrom(document.querySelectorAll(value)); -} -function setTransitionDuration(els, value) { - els.forEach(function (el) { - if (el) { - el.style.transitionDuration = value + "ms"; - } - }); -} -function setVisibilityState(els, state) { - els.forEach(function (el) { - if (el) { - el.setAttribute('data-state', state); - } - }); -} -function getOwnerDocument(elementOrElements) { - var _element$ownerDocumen; - - var _normalizeToArray = normalizeToArray(elementOrElements), - element = _normalizeToArray[0]; // Elements created via a