-
Notifications
You must be signed in to change notification settings - Fork 30
/
sample-html-output.html
565 lines (537 loc) · 544 KB
/
sample-html-output.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<!DOCTYPE html>
<html>
<head>
<title>DependenSee</title>
<meta name="color-scheme" content="dark light">
<style type="text/css">
#mynetwork {
width: 100%;
height: 100vh;
border: 1px solid lightgray;
}
body {
font-family: sans-serif;
}
</style>
</head>
<body>
<div id="mynetwork"></div>
<!-- #region vis.js -->
<script>
/**
* vis-network
* https://visjs.github.io/vis-network/
*
* A dynamic, browser-based visualization library.
*
* @version 8.5.4
* @date 2020-11-23T19:52:22.114Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? e(exports) : "function" == typeof define && define.amd ? define(["exports"], e) : e((t = "undefined" != typeof globalThis ? globalThis : t || self).vis = t.vis || {}) }(this, (function (t) {
"use strict"; var e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}; function i(t, e) { return t(e = { exports: {} }, e.exports), e.exports } var n = function (t) { return t && t.Math == Math && t }, o = n("object" == typeof globalThis && globalThis) || n("object" == typeof window && window) || n("object" == typeof self && self) || n("object" == typeof e && e) || function () { return this }() || Function("return this")(), r = function (t) { try { return !!t() } catch (t) { return !0 } }, s = !r((function () { return 7 != Object.defineProperty({}, 1, { get: function () { return 7 } })[1] })), a = {}.propertyIsEnumerable, h = Object.getOwnPropertyDescriptor, l = { f: h && !a.call({ 1: 2 }, 1) ? function (t) { var e = h(this, t); return !!e && e.enumerable } : a }, d = function (t, e) { return { enumerable: !(1 & t), configurable: !(2 & t), writable: !(4 & t), value: e } }, c = {}.toString, u = function (t) { return c.call(t).slice(8, -1) }, f = "".split, p = r((function () { return !Object("z").propertyIsEnumerable(0) })) ? function (t) { return "String" == u(t) ? f.call(t, "") : Object(t) } : Object, v = function (t) { if (null == t) throw TypeError("Can't call method on " + t); return t }, g = function (t) { return p(v(t)) }, y = function (t) { return "object" == typeof t ? null !== t : "function" == typeof t }, m = function (t, e) { if (!y(t)) return t; var i, n; if (e && "function" == typeof (i = t.toString) && !y(n = i.call(t))) return n; if ("function" == typeof (i = t.valueOf) && !y(n = i.call(t))) return n; if (!e && "function" == typeof (i = t.toString) && !y(n = i.call(t))) return n; throw TypeError("Can't convert object to primitive value") }, b = {}.hasOwnProperty, w = function (t, e) { return b.call(t, e) }, k = o.document, _ = y(k) && y(k.createElement), x = function (t) { return _ ? k.createElement(t) : {} }, E = !s && !r((function () { return 7 != Object.defineProperty(x("div"), "a", { get: function () { return 7 } }).a })), O = Object.getOwnPropertyDescriptor, S = { f: s ? O : function (t, e) { if (t = g(t), e = m(e, !0), E) try { return O(t, e) } catch (t) { } if (w(t, e)) return d(!l.f.call(t, e), t[e]) } }, C = /#|\.prototype\./, T = function (t, e) { var i = M[D(t)]; return i == I || i != P && ("function" == typeof e ? r(e) : !!e) }, D = T.normalize = function (t) { return String(t).replace(C, ".").toLowerCase() }, M = T.data = {}, P = T.NATIVE = "N", I = T.POLYFILL = "P", B = T, z = {}, N = function (t) { if ("function" != typeof t) throw TypeError(String(t) + " is not a function"); return t }, A = function (t, e, i) { if (N(t), void 0 === e) return t; switch (i) { case 0: return function () { return t.call(e) }; case 1: return function (i) { return t.call(e, i) }; case 2: return function (i, n) { return t.call(e, i, n) }; case 3: return function (i, n, o) { return t.call(e, i, n, o) } }return function () { return t.apply(e, arguments) } }, F = function (t) { if (!y(t)) throw TypeError(String(t) + " is not an object"); return t }, j = Object.defineProperty, R = { f: s ? j : function (t, e, i) { if (F(t), e = m(e, !0), F(i), E) try { return j(t, e, i) } catch (t) { } if ("get" in i || "set" in i) throw TypeError("Accessors not supported"); return "value" in i && (t[e] = i.value), t } }, L = s ? function (t, e, i) { return R.f(t, e, d(1, i)) } : function (t, e, i) { return t[e] = i, t }, H = S.f, W = function (t) { var e = function (e, i, n) { if (this instanceof t) { switch (arguments.length) { case 0: return new t; case 1: return new t(e); case 2: return new t(e, i) }return new t(e, i, n) } return t.apply(this, arguments) }; return e.prototype = t.prototype, e }, q = function (t, e) { var i, n, r, s, a, h, l, d, c = t.target, u = t.global, f = t.stat, p = t.proto, v = u ? o : f ? o[c] : (o[c] || {}).prototype, g = u ? z : z[c] || (z[c] = {}), y = g.prototype; for (r in e) i = !B(u ? r : c + (f ? "." : "#") + r, t.forced) && v && w(v, r), a = g[r], i && (h = t.noTargetGet ? (d = H(v, r)) && d.value : v[r]), s = i && h ? h : e[r], i && typeof a == typeof s || (l = t.bind && i ? A(s, o) : t.wrap && i ? W(s) : p && "function" == typeof s ? A(Function.call, s) : s, (t.sham || s && s.sham || a && a.sham) && L(l, "sham", !0), g[r] = l, p && (w(z, n = c + "Prototype") || L(z, n, {}), z[n][r] = s, t.real && y && !y[r] && L(y, r, s))) }, V = [].slice, U = {}, Y = function (t, e, i) { if (!(e in U)) { for (var n = [], o = 0; o < e; o++)n[o] = "a[" + o + "]"; U[e] = Function("C,a", "return new C(" + n.join(",") + ")") } return U[e](t, i) }, X = Function.bind || function (t) { var e = N(this), i = V.call(arguments, 1), n = function () { var o = i.concat(V.call(arguments)); return this instanceof n ? Y(e, o.length, o) : e.apply(t, o) }; return y(e.prototype) && (n.prototype = e.prototype), n }; q({ target: "Function", proto: !0 }, { bind: X }); var G = function (t) { return z[t + "Prototype"] }, K = G("Function").bind, $ = Function.prototype, Z = function (t) { var e = t.bind; return t === $ || t instanceof Function && e === $.bind ? K : e }, Q = Math.ceil, J = Math.floor, tt = function (t) { return isNaN(t = +t) ? 0 : (t > 0 ? J : Q)(t) }, et = Math.min, it = function (t) { return t > 0 ? et(tt(t), 9007199254740991) : 0 }, nt = Math.max, ot = Math.min, rt = function (t, e) { var i = tt(t); return i < 0 ? nt(i + e, 0) : ot(i, e) }, st = function (t) { return function (e, i, n) { var o, r = g(e), s = it(r.length), a = rt(n, s); if (t && i != i) { for (; s > a;)if ((o = r[a++]) != o) return !0 } else for (; s > a; a++)if ((t || a in r) && r[a] === i) return t || a || 0; return !t && -1 } }, at = { includes: st(!0), indexOf: st(!1) }, ht = {}, lt = at.indexOf, dt = function (t, e) { var i, n = g(t), o = 0, r = []; for (i in n) !w(ht, i) && w(n, i) && r.push(i); for (; e.length > o;)w(n, i = e[o++]) && (~lt(r, i) || r.push(i)); return r }, ct = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"], ut = Object.keys || function (t) { return dt(t, ct) }, ft = { f: Object.getOwnPropertySymbols }, pt = function (t) { return Object(v(t)) }, vt = Object.assign, gt = Object.defineProperty, yt = !vt || r((function () { if (s && 1 !== vt({ b: 1 }, vt(gt({}, "a", { enumerable: !0, get: function () { gt(this, "b", { value: 3, enumerable: !1 }) } }), { b: 2 })).b) return !0; var t = {}, e = {}, i = Symbol(), n = "abcdefghijklmnopqrst"; return t[i] = 7, n.split("").forEach((function (t) { e[t] = t })), 7 != vt({}, t)[i] || ut(vt({}, e)).join("") != n })) ? function (t, e) { for (var i = pt(t), n = arguments.length, o = 1, r = ft.f, a = l.f; n > o;)for (var h, d = p(arguments[o++]), c = r ? ut(d).concat(r(d)) : ut(d), u = c.length, f = 0; u > f;)h = c[f++], s && !a.call(d, h) || (i[h] = d[h]); return i } : vt; q({ target: "Object", stat: !0, forced: Object.assign !== yt }, { assign: yt }); var mt = z.Object.assign; function bt(t, e, i, n) { t.beginPath(), t.arc(e, i, n, 0, 2 * Math.PI, !1), t.closePath() } function wt(t, e, i, n, o, r) { var s = Math.PI / 180; n - 2 * r < 0 && (r = n / 2), o - 2 * r < 0 && (r = o / 2), t.beginPath(), t.moveTo(e + r, i), t.lineTo(e + n - r, i), t.arc(e + n - r, i + r, r, 270 * s, 360 * s, !1), t.lineTo(e + n, i + o - r), t.arc(e + n - r, i + o - r, r, 0, 90 * s, !1), t.lineTo(e + r, i + o), t.arc(e + r, i + o - r, r, 90 * s, 180 * s, !1), t.lineTo(e, i + r), t.arc(e + r, i + r, r, 180 * s, 270 * s, !1), t.closePath() } function kt(t, e, i, n, o) { var r = .5522848, s = n / 2 * r, a = o / 2 * r, h = e + n, l = i + o, d = e + n / 2, c = i + o / 2; t.beginPath(), t.moveTo(e, c), t.bezierCurveTo(e, c - a, d - s, i, d, i), t.bezierCurveTo(d + s, i, h, c - a, h, c), t.bezierCurveTo(h, c + a, d + s, l, d, l), t.bezierCurveTo(d - s, l, e, c + a, e, c), t.closePath() } function _t(t, e, i, n, o) { var r = o * (1 / 3), s = .5522848, a = n / 2 * s, h = r / 2 * s, l = e + n, d = i + r, c = e + n / 2, u = i + r / 2, f = i + (o - r / 2), p = i + o; t.beginPath(), t.moveTo(l, u), t.bezierCurveTo(l, u + h, c + a, d, c, d), t.bezierCurveTo(c - a, d, e, u + h, e, u), t.bezierCurveTo(e, u - h, c - a, i, c, i), t.bezierCurveTo(c + a, i, l, u - h, l, u), t.lineTo(l, f), t.bezierCurveTo(l, f + h, c + a, p, c, p), t.bezierCurveTo(c - a, p, e, f + h, e, f), t.lineTo(e, u) } function xt(t, e, i, n, o, r) { t.beginPath(), t.moveTo(e, i); for (var s = r.length, a = n - e, h = o - i, l = h / a, d = Math.sqrt(a * a + h * h), c = 0, u = !0, f = 0, p = +r[0]; d >= .1;)(p = +r[c++ % s]) > d && (p = d), f = Math.sqrt(p * p / (1 + l * l)), e += f = a < 0 ? -f : f, i += l * f, !0 === u ? t.lineTo(e, i) : t.moveTo(e, i), d -= p, u = !u } var Et = { circle: bt, dashedLine: xt, database: _t, diamond: function (t, e, i, n) { t.beginPath(), t.lineTo(e, i + n), t.lineTo(e + n, i), t.lineTo(e, i - n), t.lineTo(e - n, i), t.closePath() }, ellipse: kt, ellipse_vis: kt, hexagon: function (t, e, i, n) { t.beginPath(); var o = 2 * Math.PI / 6; t.moveTo(e + n, i); for (var r = 1; r < 6; r++)t.lineTo(e + n * Math.cos(o * r), i + n * Math.sin(o * r)); t.closePath() }, roundRect: wt, square: function (t, e, i, n) { t.beginPath(), t.rect(e - n, i - n, 2 * n, 2 * n), t.closePath() }, star: function (t, e, i, n) { t.beginPath(), i += .1 * (n *= .82); for (var o = 0; o < 10; o++) { var r = o % 2 == 0 ? 1.3 * n : .5 * n; t.lineTo(e + r * Math.sin(2 * o * Math.PI / 10), i - r * Math.cos(2 * o * Math.PI / 10)) } t.closePath() }, triangle: function (t, e, i, n) { t.beginPath(), i += .275 * (n *= 1.15); var o = 2 * n, r = o / 2, s = Math.sqrt(3) / 6 * o, a = Math.sqrt(o * o - r * r); t.moveTo(e, i - (a - s)), t.lineTo(e + r, i + s), t.lineTo(e - r, i + s), t.lineTo(e, i - (a - s)), t.closePath() }, triangleDown: function (t, e, i, n) { t.beginPath(), i -= .275 * (n *= 1.15); var o = 2 * n, r = o / 2, s = Math.sqrt(3) / 6 * o, a = Math.sqrt(o * o - r * r); t.moveTo(e, i + (a - s)), t.lineTo(e + r, i - s), t.lineTo(e - r, i - s), t.lineTo(e, i + (a - s)), t.closePath() } }; var Ot = i((function (t) { function e(t) { if (t) return function (t) { for (var i in e.prototype) t[i] = e.prototype[i]; return t }(t) } t.exports = e, e.prototype.on = e.prototype.addEventListener = function (t, e) { return this._callbacks = this._callbacks || {}, (this._callbacks["$" + t] = this._callbacks["$" + t] || []).push(e), this }, e.prototype.once = function (t, e) { function i() { this.off(t, i), e.apply(this, arguments) } return i.fn = e, this.on(t, i), this }, e.prototype.off = e.prototype.removeListener = e.prototype.removeAllListeners = e.prototype.removeEventListener = function (t, e) { if (this._callbacks = this._callbacks || {}, 0 == arguments.length) return this._callbacks = {}, this; var i, n = this._callbacks["$" + t]; if (!n) return this; if (1 == arguments.length) return delete this._callbacks["$" + t], this; for (var o = 0; o < n.length; o++)if ((i = n[o]) === e || i.fn === e) { n.splice(o, 1); break } return 0 === n.length && delete this._callbacks["$" + t], this }, e.prototype.emit = function (t) { this._callbacks = this._callbacks || {}; for (var e = new Array(arguments.length - 1), i = this._callbacks["$" + t], n = 1; n < arguments.length; n++)e[n - 1] = arguments[n]; if (i) { n = 0; for (var o = (i = i.slice(0)).length; n < o; ++n)i[n].apply(this, e) } return this }, e.prototype.listeners = function (t) { return this._callbacks = this._callbacks || {}, this._callbacks["$" + t] || [] }, e.prototype.hasListeners = function (t) { return !!this.listeners(t).length } })); q({ target: "Object", stat: !0, forced: !s, sham: !s }, { defineProperty: R.f }); var St = i((function (t) { var e = z.Object, i = t.exports = function (t, i, n) { return e.defineProperty(t, i, n) }; e.defineProperty.sham && (i.sham = !0) })), Ct = St, Tt = s ? Object.defineProperties : function (t, e) { F(t); for (var i, n = ut(e), o = n.length, r = 0; o > r;)R.f(t, i = n[r++], e[i]); return t }; q({ target: "Object", stat: !0, forced: !s, sham: !s }, { defineProperties: Tt }); var Dt = i((function (t) { var e = z.Object, i = t.exports = function (t, i) { return e.defineProperties(t, i) }; e.defineProperties.sham && (i.sham = !0) })), Mt = function (t) { return "function" == typeof t ? t : void 0 }, Pt = function (t, e) { return arguments.length < 2 ? Mt(z[t]) || Mt(o[t]) : z[t] && z[t][e] || o[t] && o[t][e] }, It = ct.concat("length", "prototype"), Bt = { f: Object.getOwnPropertyNames || function (t) { return dt(t, It) } }, zt = Pt("Reflect", "ownKeys") || function (t) { var e = Bt.f(F(t)), i = ft.f; return i ? e.concat(i(t)) : e }, Nt = function (t, e, i) { var n = m(e); n in t ? R.f(t, n, d(0, i)) : t[n] = i }; q({ target: "Object", stat: !0, sham: !s }, { getOwnPropertyDescriptors: function (t) { for (var e, i, n = g(t), o = S.f, r = zt(n), s = {}, a = 0; r.length > a;)void 0 !== (i = o(n, e = r[a++])) && Nt(s, e, i); return s } }); var At = z.Object.getOwnPropertyDescriptors, Ft = S.f, jt = r((function () { Ft(1) })); q({ target: "Object", stat: !0, forced: !s || jt, sham: !s }, { getOwnPropertyDescriptor: function (t, e) { return Ft(g(t), e) } }); var Rt, Lt = i((function (t) { var e = z.Object, i = t.exports = function (t, i) { return e.getOwnPropertyDescriptor(t, i) }; e.getOwnPropertyDescriptor.sham && (i.sham = !0) })), Ht = Lt, Wt = !!Object.getOwnPropertySymbols && !r((function () { return !String(Symbol()) })), qt = Wt && !Symbol.sham && "symbol" == typeof Symbol.iterator, Vt = Array.isArray || function (t) { return "Array" == u(t) }, Ut = Pt("document", "documentElement"), Yt = "__core-js_shared__", Xt = o[Yt] || function (t, e) { try { L(o, t, e) } catch (i) { o[t] = e } return e }(Yt, {}), Gt = i((function (t) { (t.exports = function (t, e) { return Xt[t] || (Xt[t] = void 0 !== e ? e : {}) })("versions", []).push({ version: "3.7.0", mode: "pure", copyright: "© 2020 Denis Pushkarev (zloirock.ru)" }) })), Kt = 0, $t = Math.random(), Zt = function (t) { return "Symbol(" + String(void 0 === t ? "" : t) + ")_" + (++Kt + $t).toString(36) }, Qt = Gt("keys"), Jt = function (t) { return Qt[t] || (Qt[t] = Zt(t)) }, te = Jt("IE_PROTO"), ee = function () { }, ie = function (t) { return "<script>" + t + "</" + "script>" }, ne = function () { try { Rt = document.domain && new ActiveXObject("htmlfile") } catch (t) { } var t, e; ne = Rt ? function (t) { t.write(ie("")), t.close(); var e = t.parentWindow.Object; return t = null, e }(Rt) : ((e = x("iframe")).style.display = "none", Ut.appendChild(e), e.src = String("javascript:"), (t = e.contentWindow.document).open(), t.write(ie("document.F=Object")), t.close(), t.F); for (var i = ct.length; i--;)delete ne.prototype[ct[i]]; return ne() }; ht[te] = !0; var oe = Object.create || function (t, e) { var i; return null !== t ? (ee.prototype = F(t), i = new ee, ee.prototype = null, i[te] = t) : i = ne(), void 0 === e ? i : Tt(i, e) }, re = Bt.f, se = {}.toString, ae = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], he = { f: function (t) { return ae && "[object Window]" == se.call(t) ? function (t) { try { return re(t) } catch (t) { return ae.slice() } }(t) : re(g(t)) } }, le = function (t, e, i, n) { n && n.enumerable ? t[e] = i : L(t, e, i) }, de = Gt("wks"), ce = o.Symbol, ue = qt ? ce : ce && ce.withoutSetter || Zt, fe = function (t) { return w(de, t) || (Wt && w(ce, t) ? de[t] = ce[t] : de[t] = ue("Symbol." + t)), de[t] }, pe = { f: fe }, ve = R.f, ge = function (t) { var e = z.Symbol || (z.Symbol = {}); w(e, t) || ve(e, t, { value: pe.f(t) }) }, ye = {}; ye[fe("toStringTag")] = "z"; var me = "[object z]" === String(ye), be = fe("toStringTag"), we = "Arguments" == u(function () { return arguments }()), ke = me ? u : function (t) { var e, i, n; return void 0 === t ? "Undefined" : null === t ? "Null" : "string" == typeof (i = function (t, e) { try { return t[e] } catch (t) { } }(e = Object(t), be)) ? i : we ? u(e) : "Object" == (n = u(e)) && "function" == typeof e.callee ? "Arguments" : n }, _e = me ? {}.toString : function () { return "[object " + ke(this) + "]" }, xe = R.f, Ee = fe("toStringTag"), Oe = function (t, e, i, n) { if (t) { var o = i ? t : t.prototype; w(o, Ee) || xe(o, Ee, { configurable: !0, value: e }), n && !me && L(o, "toString", _e) } }, Se = Function.toString; "function" != typeof Xt.inspectSource && (Xt.inspectSource = function (t) { return Se.call(t) }); var Ce, Te, De, Me = Xt.inspectSource, Pe = o.WeakMap, Ie = "function" == typeof Pe && /native code/.test(Me(Pe)), Be = o.WeakMap; if (Ie) { var ze = Xt.state || (Xt.state = new Be), Ne = ze.get, Ae = ze.has, Fe = ze.set; Ce = function (t, e) { return e.facade = t, Fe.call(ze, t, e), e }, Te = function (t) { return Ne.call(ze, t) || {} }, De = function (t) { return Ae.call(ze, t) } } else { var je = Jt("state"); ht[je] = !0, Ce = function (t, e) { return e.facade = t, L(t, je, e), e }, Te = function (t) { return w(t, je) ? t[je] : {} }, De = function (t) { return w(t, je) } } var Re = { set: Ce, get: Te, has: De, enforce: function (t) { return De(t) ? Te(t) : Ce(t, {}) }, getterFor: function (t) { return function (e) { var i; if (!y(e) || (i = Te(e)).type !== t) throw TypeError("Incompatible receiver, " + t + " required"); return i } } }, Le = fe("species"), He = function (t, e) { var i; return Vt(t) && ("function" != typeof (i = t.constructor) || i !== Array && !Vt(i.prototype) ? y(i) && null === (i = i[Le]) && (i = void 0) : i = void 0), new (void 0 === i ? Array : i)(0 === e ? 0 : e) }, We = [].push, qe = function (t) { var e = 1 == t, i = 2 == t, n = 3 == t, o = 4 == t, r = 6 == t, s = 5 == t || r; return function (a, h, l, d) { for (var c, u, f = pt(a), v = p(f), g = A(h, l, 3), y = it(v.length), m = 0, b = d || He, w = e ? b(a, y) : i ? b(a, 0) : void 0; y > m; m++)if ((s || m in v) && (u = g(c = v[m], m, f), t)) if (e) w[m] = u; else if (u) switch (t) { case 3: return !0; case 5: return c; case 6: return m; case 2: We.call(w, c) } else if (o) return !1; return r ? -1 : n || o ? o : w } }, Ve = { forEach: qe(0), map: qe(1), filter: qe(2), some: qe(3), every: qe(4), find: qe(5), findIndex: qe(6) }, Ue = Ve.forEach, Ye = Jt("hidden"), Xe = "Symbol", Ge = fe("toPrimitive"), Ke = Re.set, $e = Re.getterFor(Xe), Ze = Object.prototype, Qe = o.Symbol, Je = Pt("JSON", "stringify"), ti = S.f, ei = R.f, ii = he.f, ni = l.f, oi = Gt("symbols"), ri = Gt("op-symbols"), si = Gt("string-to-symbol-registry"), ai = Gt("symbol-to-string-registry"), hi = Gt("wks"), li = o.QObject, di = !li || !li.prototype || !li.prototype.findChild, ci = s && r((function () { return 7 != oe(ei({}, "a", { get: function () { return ei(this, "a", { value: 7 }).a } })).a })) ? function (t, e, i) { var n = ti(Ze, e); n && delete Ze[e], ei(t, e, i), n && t !== Ze && ei(Ze, e, n) } : ei, ui = function (t, e) { var i = oi[t] = oe(Qe.prototype); return Ke(i, { type: Xe, tag: t, description: e }), s || (i.description = e), i }, fi = qt ? function (t) { return "symbol" == typeof t } : function (t) { return Object(t) instanceof Qe }, pi = function (t, e, i) { t === Ze && pi(ri, e, i), F(t); var n = m(e, !0); return F(i), w(oi, n) ? (i.enumerable ? (w(t, Ye) && t[Ye][n] && (t[Ye][n] = !1), i = oe(i, { enumerable: d(0, !1) })) : (w(t, Ye) || ei(t, Ye, d(1, {})), t[Ye][n] = !0), ci(t, n, i)) : ei(t, n, i) }, vi = function (t, e) { F(t); var i = g(e), n = ut(i).concat(bi(i)); return Ue(n, (function (e) { s && !gi.call(i, e) || pi(t, e, i[e]) })), t }, gi = function (t) { var e = m(t, !0), i = ni.call(this, e); return !(this === Ze && w(oi, e) && !w(ri, e)) && (!(i || !w(this, e) || !w(oi, e) || w(this, Ye) && this[Ye][e]) || i) }, yi = function (t, e) { var i = g(t), n = m(e, !0); if (i !== Ze || !w(oi, n) || w(ri, n)) { var o = ti(i, n); return !o || !w(oi, n) || w(i, Ye) && i[Ye][n] || (o.enumerable = !0), o } }, mi = function (t) { var e = ii(g(t)), i = []; return Ue(e, (function (t) { w(oi, t) || w(ht, t) || i.push(t) })), i }, bi = function (t) { var e = t === Ze, i = ii(e ? ri : g(t)), n = []; return Ue(i, (function (t) { !w(oi, t) || e && !w(Ze, t) || n.push(oi[t]) })), n }; if (Wt || (le((Qe = function () { if (this instanceof Qe) throw TypeError("Symbol is not a constructor"); var t = arguments.length && void 0 !== arguments[0] ? String(arguments[0]) : void 0, e = Zt(t), i = function (t) { this === Ze && i.call(ri, t), w(this, Ye) && w(this[Ye], e) && (this[Ye][e] = !1), ci(this, e, d(1, t)) }; return s && di && ci(Ze, e, { configurable: !0, set: i }), ui(e, t) }).prototype, "toString", (function () { return $e(this).tag })), le(Qe, "withoutSetter", (function (t) { return ui(Zt(t), t) })), l.f = gi, R.f = pi, S.f = yi, Bt.f = he.f = mi, ft.f = bi, pe.f = function (t) { return ui(fe(t), t) }, s && ei(Qe.prototype, "description", { configurable: !0, get: function () { return $e(this).description } })), q({ global: !0, wrap: !0, forced: !Wt, sham: !Wt }, { Symbol: Qe }), Ue(ut(hi), (function (t) { ge(t) })), q({ target: Xe, stat: !0, forced: !Wt }, { for: function (t) { var e = String(t); if (w(si, e)) return si[e]; var i = Qe(e); return si[e] = i, ai[i] = e, i }, keyFor: function (t) { if (!fi(t)) throw TypeError(t + " is not a symbol"); if (w(ai, t)) return ai[t] }, useSetter: function () { di = !0 }, useSimple: function () { di = !1 } }), q({ target: "Object", stat: !0, forced: !Wt, sham: !s }, { create: function (t, e) { return void 0 === e ? oe(t) : vi(oe(t), e) }, defineProperty: pi, defineProperties: vi, getOwnPropertyDescriptor: yi }), q({ target: "Object", stat: !0, forced: !Wt }, { getOwnPropertyNames: mi, getOwnPropertySymbols: bi }), q({ target: "Object", stat: !0, forced: r((function () { ft.f(1) })) }, { getOwnPropertySymbols: function (t) { return ft.f(pt(t)) } }), Je) { var wi = !Wt || r((function () { var t = Qe(); return "[null]" != Je([t]) || "{}" != Je({ a: t }) || "{}" != Je(Object(t)) })); q({ target: "JSON", stat: !0, forced: wi }, { stringify: function (t, e, i) { for (var n, o = [t], r = 1; arguments.length > r;)o.push(arguments[r++]); if (n = e, (y(e) || void 0 !== t) && !fi(t)) return Vt(e) || (e = function (t, e) { if ("function" == typeof n && (e = n.call(this, t, e)), !fi(e)) return e }), o[1] = e, Je.apply(null, o) } }) } Qe.prototype[Ge] || L(Qe.prototype, Ge, Qe.prototype.valueOf), Oe(Qe, Xe), ht[Ye] = !0; var ki, _i, xi, Ei = z.Object.getOwnPropertySymbols, Oi = {}, Si = !r((function () { function t() { } return t.prototype.constructor = null, Object.getPrototypeOf(new t) !== t.prototype })), Ci = Jt("IE_PROTO"), Ti = Object.prototype, Di = Si ? Object.getPrototypeOf : function (t) { return t = pt(t), w(t, Ci) ? t[Ci] : "function" == typeof t.constructor && t instanceof t.constructor ? t.constructor.prototype : t instanceof Object ? Ti : null }, Mi = (fe("iterator"), !1);[].keys && ("next" in (xi = [].keys()) ? (_i = Di(Di(xi))) !== Object.prototype && (ki = _i) : Mi = !0), null == ki && (ki = {}); var Pi = { IteratorPrototype: ki, BUGGY_SAFARI_ITERATORS: Mi }, Ii = Pi.IteratorPrototype, Bi = function () { return this }, zi = Object.setPrototypeOf || ("__proto__" in {} ? function () { var t, e = !1, i = {}; try { (t = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set).call(i, []), e = i instanceof Array } catch (t) { } return function (i, n) { return F(i), function (t) { if (!y(t) && null !== t) throw TypeError("Can't set " + String(t) + " as a prototype") }(n), e ? t.call(i, n) : i.__proto__ = n, i } }() : void 0), Ni = Pi.IteratorPrototype, Ai = Pi.BUGGY_SAFARI_ITERATORS, Fi = fe("iterator"), ji = "keys", Ri = "values", Li = "entries", Hi = function () { return this }, Wi = function (t, e, i, n, o, r, s) { !function (t, e, i) { var n = e + " Iterator"; t.prototype = oe(Ii, { next: d(1, i) }), Oe(t, n, !1, !0), Oi[n] = Bi }(i, e, n); var a, h, l, c = function (t) { if (t === o && g) return g; if (!Ai && t in p) return p[t]; switch (t) { case ji: case Ri: case Li: return function () { return new i(this, t) } }return function () { return new i(this) } }, u = e + " Iterator", f = !1, p = t.prototype, v = p[Fi] || p["@@iterator"] || o && p[o], g = !Ai && v || c(o), y = "Array" == e && p.entries || v; if (y && (a = Di(y.call(new t)), Ni !== Object.prototype && a.next && (Oe(a, u, !0, !0), Oi[u] = Hi)), o == Ri && v && v.name !== Ri && (f = !0, g = function () { return v.call(this) }), s && p[Fi] !== g && L(p, Fi, g), Oi[e] = g, o) if (h = { values: c(Ri), keys: r ? g : c(ji), entries: c(Li) }, s) for (l in h) (Ai || f || !(l in p)) && le(p, l, h[l]); else q({ target: e, proto: !0, forced: Ai || f }, h); return h }, qi = "Array Iterator", Vi = Re.set, Ui = Re.getterFor(qi); Wi(Array, "Array", (function (t, e) { Vi(this, { type: qi, target: g(t), index: 0, kind: e }) }), (function () { var t = Ui(this), e = t.target, i = t.kind, n = t.index++; return !e || n >= e.length ? (t.target = void 0, { value: void 0, done: !0 }) : "keys" == i ? { value: n, done: !1 } : "values" == i ? { value: e[n], done: !1 } : { value: [n, e[n]], done: !1 } }), "values"); Oi.Arguments = Oi.Array; var Yi = fe("toStringTag"); for (var Xi in { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }) { var Gi = o[Xi], Ki = Gi && Gi.prototype; Ki && ke(Ki) !== Yi && L(Ki, Yi, Xi), Oi[Xi] = Oi.Array } var $i = function (t) { return function (e, i) { var n, o, r = String(v(e)), s = tt(i), a = r.length; return s < 0 || s >= a ? t ? "" : void 0 : (n = r.charCodeAt(s)) < 55296 || n > 56319 || s + 1 === a || (o = r.charCodeAt(s + 1)) < 56320 || o > 57343 ? t ? r.charAt(s) : n : t ? r.slice(s, s + 2) : o - 56320 + (n - 55296 << 10) + 65536 } }, Zi = { codeAt: $i(!1), charAt: $i(!0) }.charAt, Qi = "String Iterator", Ji = Re.set, tn = Re.getterFor(Qi); Wi(String, "String", (function (t) { Ji(this, { type: Qi, string: String(t), index: 0 }) }), (function () { var t, e = tn(this), i = e.string, n = e.index; return n >= i.length ? { value: void 0, done: !0 } : (t = Zi(i, n), e.index += t.length, { value: t, done: !1 }) })); var en = fe("iterator"), nn = function (t) { if (null != t) return t[en] || t["@@iterator"] || Oi[ke(t)] }, on = function (t) { var e = nn(t); if ("function" != typeof e) throw TypeError(String(t) + " is not iterable"); return F(e.call(t)) }, rn = nn, sn = function (t) { var e = t.return; if (void 0 !== e) return F(e.call(t)).value }, an = function (t, e, i, n) { try { return n ? e(F(i)[0], i[1]) : e(i) } catch (e) { throw sn(t), e } }, hn = fe("iterator"), ln = Array.prototype, dn = function (t) { return void 0 !== t && (Oi.Array === t || ln[hn] === t) }, cn = fe("iterator"), un = !1; try { var fn = 0, pn = { next: function () { return { done: !!fn++ } }, return: function () { un = !0 } }; pn[cn] = function () { return this }, Array.from(pn, (function () { throw 2 })) } catch (t) { } var vn = !function (t, e) { if (!e && !un) return !1; var i = !1; try { var n = {}; n[cn] = function () { return { next: function () { return { done: i = !0 } } } }, t(n) } catch (t) { } return i }((function (t) { Array.from(t) })); q({ target: "Array", stat: !0, forced: vn }, { from: function (t) { var e, i, n, o, r, s, a = pt(t), h = "function" == typeof this ? this : Array, l = arguments.length, d = l > 1 ? arguments[1] : void 0, c = void 0 !== d, u = nn(a), f = 0; if (c && (d = A(d, l > 2 ? arguments[2] : void 0, 2)), null == u || h == Array && dn(u)) for (i = new h(e = it(a.length)); e > f; f++)s = c ? d(a[f], f) : a[f], Nt(i, f, s); else for (r = (o = u.call(a)).next, i = new h; !(n = r.call(o)).done; f++)s = c ? an(o, d, [n.value, f], !0) : n.value, Nt(i, f, s); return i.length = f, i } }); var gn = z.Array.from, yn = gn; q({ target: "Object", stat: !0, sham: !s }, { create: oe }); var mn = z.Object, bn = function (t, e) { return mn.create(t, e) }, wn = bn, kn = St; var _n, xn = function (t, e, i) { return e in t ? kn(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t }, En = "\t\n\v\f\r \u2028\u2029\ufeff", On = "[" + En + "]", Sn = RegExp("^" + On + On + "*"), Cn = RegExp(On + On + "*$"), Tn = function (t) { return function (e) { var i = String(v(e)); return 1 & t && (i = i.replace(Sn, "")), 2 & t && (i = i.replace(Cn, "")), i } }, Dn = { start: Tn(1), end: Tn(2), trim: Tn(3) }, Mn = Dn.trim; q({ target: "String", proto: !0, forced: (_n = "trim", r((function () { return !!En[_n]() || "
" != "
"[_n]() || En[_n].name !== _n }))) }, { trim: function () { return Mn(this) } }); var Pn = G("String").trim, In = String.prototype, Bn = function (t) { var e = t.trim; return "string" == typeof t || t === In || t instanceof String && e === In.trim ? Pn : e }, zn = function (t, e) { var i = [][t]; return !!i && r((function () { i.call(null, e || function () { throw 1 }, 1) })) }, Nn = Object.defineProperty, An = {}, Fn = function (t) { throw t }, jn = function (t, e) { if (w(An, t)) return An[t]; e || (e = {}); var i = [][t], n = !!w(e, "ACCESSORS") && e.ACCESSORS, o = w(e, 0) ? e[0] : Fn, a = w(e, 1) ? e[1] : void 0; return An[t] = !!i && !r((function () { if (n && !s) return !0; var t = { length: -1 }; n ? Nn(t, 1, { enumerable: !0, get: Fn }) : t[1] = 1, i.call(t, o, a) })) }, Rn = Ve.forEach, Ln = zn("forEach"), Hn = jn("forEach"), Wn = Ln && Hn ? [].forEach : function (t) { return Rn(this, t, arguments.length > 1 ? arguments[1] : void 0) }; q({ target: "Array", proto: !0, forced: [].forEach != Wn }, { forEach: Wn }); var qn = G("Array").forEach, Vn = Array.prototype, Un = { DOMTokenList: !0, NodeList: !0 }, Yn = function (t) { var e = t.forEach; return t === Vn || t instanceof Array && e === Vn.forEach || Un.hasOwnProperty(ke(t)) ? qn : e }, Xn = Dn.trim, Gn = o.parseInt, Kn = /^[+-]?0[Xx]/, $n = 8 !== Gn(En + "08") || 22 !== Gn(En + "0x16") ? function (t, e) { var i = Xn(String(t)); return Gn(i, e >>> 0 || (Kn.test(i) ? 16 : 10)) } : Gn; q({ global: !0, forced: parseInt != $n }, { parseInt: $n }); var Zn = z.parseInt, Qn = l.f, Jn = function (t) { return function (e) { for (var i, n = g(e), o = ut(n), r = o.length, a = 0, h = []; r > a;)i = o[a++], s && !Qn.call(n, i) || h.push(t ? [i, n[i]] : n[i]); return h } }, to = { entries: Jn(!0), values: Jn(!1) }.values; q({ target: "Object", stat: !0 }, { values: function (t) { return to(t) } }); var eo, io, no = z.Object.values, oo = Pt("navigator", "userAgent") || "", ro = o.process, so = ro && ro.versions, ao = so && so.v8; ao ? io = (eo = ao.split("."))[0] + eo[1] : oo && (!(eo = oo.match(/Edge\/(\d+)/)) || eo[1] >= 74) && (eo = oo.match(/Chrome\/(\d+)/)) && (io = eo[1]); var ho = io && +io, lo = fe("species"), co = function (t) { return ho >= 51 || !r((function () { var e = []; return (e.constructor = {})[lo] = function () { return { foo: 1 } }, 1 !== e[t](Boolean).foo })) }, uo = Ve.filter, fo = co("filter"), po = jn("filter"); q({ target: "Array", proto: !0, forced: !fo || !po }, { filter: function (t) { return uo(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var vo = G("Array").filter, go = Array.prototype, yo = function (t) { var e = t.filter; return t === go || t instanceof Array && e === go.filter ? vo : e }, mo = r((function () { Di(1) })); q({ target: "Object", stat: !0, forced: mo, sham: !Si }, { getPrototypeOf: function (t) { return Di(pt(t)) } }); var bo = z.Object.getPrototypeOf, wo = bo, ko = at.indexOf, _o = [].indexOf, xo = !!_o && 1 / [1].indexOf(1, -0) < 0, Eo = zn("indexOf"), Oo = jn("indexOf", { ACCESSORS: !0, 1: 0 }); q({ target: "Array", proto: !0, forced: xo || !Eo || !Oo }, { indexOf: function (t) { return xo ? _o.apply(this, arguments) || 0 : ko(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var So = G("Array").indexOf, Co = Array.prototype, To = function (t) { var e = t.indexOf; return t === Co || t instanceof Array && e === Co.indexOf ? So : e }; q({ target: "Array", stat: !0 }, { isArray: Vt }); var Do = z.Array.isArray, Mo = Do; var Po = function (t) { if (Mo(t)) return t }, Io = fe("iterator"), Bo = function (t) { var e = Object(t); return void 0 !== e[Io] || "@@iterator" in e || Oi.hasOwnProperty(ke(e)) }, zo = fe("isConcatSpreadable"), No = 9007199254740991, Ao = "Maximum allowed index exceeded", Fo = ho >= 51 || !r((function () { var t = []; return t[zo] = !1, t.concat()[0] !== t })), jo = co("concat"), Ro = function (t) { if (!y(t)) return !1; var e = t[zo]; return void 0 !== e ? !!e : Vt(t) }; q({ target: "Array", proto: !0, forced: !Fo || !jo }, { concat: function (t) { var e, i, n, o, r, s = pt(this), a = He(s, 0), h = 0; for (e = -1, n = arguments.length; e < n; e++)if (Ro(r = -1 === e ? s : arguments[e])) { if (h + (o = it(r.length)) > No) throw TypeError(Ao); for (i = 0; i < o; i++, h++)i in r && Nt(a, h, r[i]) } else { if (h >= No) throw TypeError(Ao); Nt(a, h++, r) } return a.length = h, a } }), ge("asyncIterator"), ge("hasInstance"), ge("isConcatSpreadable"), ge("iterator"), ge("match"), ge("matchAll"), ge("replace"), ge("search"), ge("species"), ge("split"), ge("toPrimitive"), ge("toStringTag"), ge("unscopables"), Oe(o.JSON, "JSON", !0); var Lo = z.Symbol; ge("asyncDispose"), ge("dispose"), ge("observable"), ge("patternMatch"), ge("replaceAll"); var Ho = Lo; var Wo = function (t, e) { if (void 0 !== Ho && Bo(Object(t))) { var i = [], n = !0, o = !1, r = void 0; try { for (var s, a = on(t); !(n = (s = a.next()).done) && (i.push(s.value), !e || i.length !== e); n = !0); } catch (t) { o = !0, r = t } finally { try { n || null == a.return || a.return() } finally { if (o) throw r } } return i } }, qo = gn, Vo = co("slice"), Uo = jn("slice", { ACCESSORS: !0, 0: 0, 1: 2 }), Yo = fe("species"), Xo = [].slice, Go = Math.max; q({ target: "Array", proto: !0, forced: !Vo || !Uo }, { slice: function (t, e) { var i, n, o, r = g(this), s = it(r.length), a = rt(t, s), h = rt(void 0 === e ? s : e, s); if (Vt(r) && ("function" != typeof (i = r.constructor) || i !== Array && !Vt(i.prototype) ? y(i) && null === (i = i[Yo]) && (i = void 0) : i = void 0, i === Array || void 0 === i)) return Xo.call(r, a, h); for (n = new (void 0 === i ? Array : i)(Go(h - a, 0)), o = 0; a < h; a++, o++)a in r && Nt(n, o, r[a]); return n.length = o, n } }); var Ko = G("Array").slice, $o = Array.prototype, Zo = function (t) { var e = t.slice; return t === $o || t instanceof Array && e === $o.slice ? Ko : e }, Qo = Zo; var Jo = function (t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n }; var tr = function (t, e) { var i; if (t) { if ("string" == typeof t) return Jo(t, e); var n = Qo(i = Object.prototype.toString.call(t)).call(i, 8, -1); return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? qo(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Jo(t, e) : void 0 } }; var er = function () { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }; var ir = function (t, e) { return Po(t) || Wo(t, e) || tr(t, e) || er() }; q({ target: "Date", stat: !0 }, { now: function () { return (new Date).getTime() } }); var nr = z.Date.now, or = r((function () { ut(1) })); q({ target: "Object", stat: !0, forced: or }, { keys: function (t) { return ut(pt(t)) } }); var rr = z.Object.keys, sr = Ve.map, ar = co("map"), hr = jn("map"); q({ target: "Array", proto: !0, forced: !ar || !hr }, { map: function (t) { return sr(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var lr = G("Array").map, dr = Array.prototype, cr = function (t) { var e = t.map; return t === dr || t instanceof Array && e === dr.map ? lr : e }, ur = Do, fr = pe.f("iterator"), pr = fr, vr = i((function (t) { function e(i) { return t.exports = e = "function" == typeof Ho && "symbol" == typeof pr ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Ho && t.constructor === Ho && t !== Ho.prototype ? "symbol" : typeof t }, e(i) } t.exports = e })); q({ target: "Reflect", stat: !0 }, { ownKeys: zt }); var gr = z.Reflect.ownKeys, yr = Zo; var mr = function (t) { if (Mo(t)) return Jo(t) }; var br = function (t) { if (void 0 !== Ho && Bo(Object(t))) return qo(t) }; var wr = function () { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") }; var kr = function (t) { return mr(t) || br(t) || tr(t) || wr() }, _r = G("Array").concat, xr = Array.prototype, Er = function (t) { var e = t.concat; return t === xr || t instanceof Array && e === xr.concat ? _r : e }, Or = Lo; function Sr(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function Cr(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = Sr(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = Sr(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } function Tr(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return Dr(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Dr(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function Dr(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n }
/**
* vis-util
* https://github.com/visjs/vis-util
*
* utilitie collection for visjs
*
* @version 4.3.4
* @date 2020-08-01T15:11:53.524Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/var Mr = Or("DELETE"); function Pr(t) { for (var e, i = arguments.length, n = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++)n[o - 1] = arguments[o]; return Ir.apply(void 0, Er(e = [{}, t]).call(e, n)) } function Ir() { var t = Br.apply(void 0, arguments); return Nr(t), t } function Br() { for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)e[i] = arguments[i]; if (e.length < 2) return e[0]; var n; if (e.length > 2) return Br.apply(void 0, Er(n = [Ir(e[0], e[1])]).call(n, kr(yr(e).call(e, 2)))); var o, r = e[0], s = e[1], a = Tr(gr(s)); try { for (a.s(); !(o = a.n()).done;) { var h = o.value; Object.prototype.propertyIsEnumerable.call(s, h) && (s[h] === Mr ? delete r[h] : null === r[h] || null === s[h] || "object" !== vr(r[h]) || "object" !== vr(s[h]) || ur(r[h]) || ur(s[h]) ? r[h] = zr(s[h]) : r[h] = Br(r[h], s[h])) } } catch (t) { a.e(t) } finally { a.f() } return r } function zr(t) { return ur(t) ? cr(t).call(t, (function (t) { return zr(t) })) : "object" === vr(t) && null !== t ? Br({}, t) : t } function Nr(t) { for (var e = 0, i = rr(t); e < i.length; e++) { var n = i[e]; t[n] === Mr ? delete t[n] : "object" === vr(t[n]) && null !== t[n] && Nr(t[n]) } } function Ar() { for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)e[i] = arguments[i]; return Fr(e.length ? e : [nr()]) } function Fr(t) { var e = function () { for (var t = jr(), e = t(" "), i = t(" "), n = t(" "), o = 0; o < arguments.length; o++)(e -= t(o < 0 || arguments.length <= o ? void 0 : arguments[o])) < 0 && (e += 1), (i -= t(o < 0 || arguments.length <= o ? void 0 : arguments[o])) < 0 && (i += 1), (n -= t(o < 0 || arguments.length <= o ? void 0 : arguments[o])) < 0 && (n += 1); return [e, i, n] }(t), i = ir(e, 3), n = i[0], o = i[1], r = i[2], s = 1, a = function () { var t = 2091639 * n + 2.3283064365386963e-10 * s; return n = o, o = r, r = t - (s = 0 | t) }; return a.uint32 = function () { return 4294967296 * a() }, a.fract53 = function () { return a() + 11102230246251565e-32 * (2097152 * a() | 0) }, a.algorithm = "Alea", a.seed = t, a.version = "0.9", a } function jr() { var t = 4022871197; return function (e) { for (var i = e.toString(), n = 0; n < i.length; n++) { var o = .02519603282416938 * (t += i.charCodeAt(n)); o -= t = o >>> 0, t = (o *= t) >>> 0, t += 4294967296 * (o -= t) } return 2.3283064365386963e-10 * (t >>> 0) } } var Rr = /^\/?Date\((-?\d+)/i, Lr = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i, Hr = /^#?([a-f\d])([a-f\d])([a-f\d])$/i, Wr = /^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i, qr = /^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i; function Vr(t) { return t instanceof Number || "number" == typeof t } function Ur(t) { if (t) for (; !0 === t.hasChildNodes();) { var e = t.firstChild; e && (Ur(e), t.removeChild(e)) } } function Yr(t) { return t instanceof String || "string" == typeof t } function Xr(t) { return "object" === vr(t) && null !== t } function Gr(t, e, i, n) { var o = !1; !0 === n && (o = null === e[i] && void 0 !== t[i]), o ? delete t[i] : t[i] = e[i] } function Kr(t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; for (var n in t) if (void 0 !== e[n]) if (null === e[n] || "object" !== vr(e[n])) Gr(t, e, n, i); else { var o = t[n], r = e[n]; Xr(o) && Xr(r) && Kr(o, r, i) } } var $r = mt; function Zr(t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; if (ur(i)) throw new TypeError("Arrays are not supported by deepExtend"); for (var o = 0; o < t.length; o++) { var r = t[o]; if (Object.prototype.hasOwnProperty.call(i, r)) if (i[r] && i[r].constructor === Object) void 0 === e[r] && (e[r] = {}), e[r].constructor === Object ? Jr(e[r], i[r], !1, n) : Gr(e, i, r, n); else { if (ur(i[r])) throw new TypeError("Arrays are not supported by deepExtend"); Gr(e, i, r, n) } } return e } function Qr(t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; if (ur(i)) throw new TypeError("Arrays are not supported by deepExtend"); for (var o in i) if (Object.prototype.hasOwnProperty.call(i, o) && -1 === To(t).call(t, o)) if (i[o] && i[o].constructor === Object) void 0 === e[o] && (e[o] = {}), e[o].constructor === Object ? Jr(e[o], i[o]) : Gr(e, i, o, n); else if (ur(i[o])) { e[o] = []; for (var r = 0; r < i[o].length; r++)e[o].push(i[o][r]) } else Gr(e, i, o, n); return e } function Jr(t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = arguments.length > 3 && void 0 !== arguments[3] && arguments[3]; for (var o in e) if (Object.prototype.hasOwnProperty.call(e, o) || !0 === i) if ("object" === vr(e[o]) && null !== e[o] && wo(e[o]) === Object.prototype) void 0 === t[o] ? t[o] = Jr({}, e[o], i) : "object" === vr(t[o]) && null !== t[o] && wo(t[o]) === Object.prototype ? Jr(t[o], e[o], i) : Gr(t, e, o, n); else if (ur(e[o])) { var r; t[o] = yr(r = e[o]).call(r) } else Gr(t, e, o, n); return t } function ts(t, e) { var i; return Er(i = []).call(i, kr(t), [e]) } function es(t) { return yr(t).call(t) } function is(t) { return t.getBoundingClientRect().left } function ns(t) { return t.getBoundingClientRect().top } function os(t, e) { var i = t.className.split(" "), n = e.split(" "); i = Er(i).call(i, yo(n).call(n, (function (t) { return To(i).call(i, t) < 0 }))), t.className = i.join(" ") } function rs(t, e) { var i = t.className.split(" "), n = e.split(" "); i = yo(i).call(i, (function (t) { return To(n).call(n, t) < 0 })), t.className = i.join(" ") } function ss(t, e) { if (ur(t)) for (var i = t.length, n = 0; n < i; n++)e(t[n], n, t); else for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e(t[o], o, t) } var as = no; function hs(t, e, i, n) { var o; t.addEventListener ? (void 0 === n && (n = !1), "mousewheel" === e && To(o = navigator.userAgent).call(o, "Firefox") >= 0 && (e = "DOMMouseScroll"), t.addEventListener(e, i, n)) : t.attachEvent("on" + e, i) } function ls(t, e, i, n) { var o; t.removeEventListener ? (void 0 === n && (n = !1), "mousewheel" === e && To(o = navigator.userAgent).call(o, "Firefox") >= 0 && (e = "DOMMouseScroll"), t.removeEventListener(e, i, n)) : t.detachEvent("on" + e, i) } var ds = { asBoolean: function (t, e) { return "function" == typeof t && (t = t()), null != t ? 0 != t : e || null }, asNumber: function (t, e) { return "function" == typeof t && (t = t()), null != t ? Number(t) || e || null : e || null }, asString: function (t, e) { return "function" == typeof t && (t = t()), null != t ? String(t) : e || null }, asSize: function (t, e) { return "function" == typeof t && (t = t()), Yr(t) ? t : Vr(t) ? t + "px" : e || null }, asElement: function (t, e) { return "function" == typeof t && (t = t()), t || e || null } }; function cs(t) { var e; switch (t.length) { case 3: case 4: return (e = Hr.exec(t)) ? { r: Zn(e[1] + e[1], 16), g: Zn(e[2] + e[2], 16), b: Zn(e[3] + e[3], 16) } : null; case 6: case 7: return (e = Lr.exec(t)) ? { r: Zn(e[1], 16), g: Zn(e[2], 16), b: Zn(e[3], 16) } : null; default: return null } } function us(t, e) { if (-1 !== To(t).call(t, "rgba")) return t; if (-1 !== To(t).call(t, "rgb")) { var i = t.substr(To(t).call(t, "(") + 1).replace(")", "").split(","); return "rgba(" + i[0] + "," + i[1] + "," + i[2] + "," + e + ")" } var n = cs(t); return null == n ? t : "rgba(" + n.r + "," + n.g + "," + n.b + "," + e + ")" } function fs(t, e, i) { var n; return "#" + yr(n = ((1 << 24) + (t << 16) + (e << 8) + i).toString(16)).call(n, 1) } function ps(t, e) { if (Yr(t)) { var i = t; if (_s(i)) { var n, o = cr(n = i.substr(4).substr(0, i.length - 5).split(",")).call(n, (function (t) { return Zn(t) })); i = fs(o[0], o[1], o[2]) } if (!0 === ks(i)) { var r = ws(i), s = { h: r.h, s: .8 * r.s, v: Math.min(1, 1.02 * r.v) }, a = { h: r.h, s: Math.min(1, 1.25 * r.s), v: .8 * r.v }, h = bs(a.h, a.s, a.v), l = bs(s.h, s.s, s.v); return { background: i, border: h, highlight: { background: l, border: h }, hover: { background: l, border: h } } } return { background: i, border: i, highlight: { background: i, border: i }, hover: { background: i, border: i } } } return e ? { background: t.background || e.background, border: t.border || e.border, highlight: Yr(t.highlight) ? { border: t.highlight, background: t.highlight } : { background: t.highlight && t.highlight.background || e.highlight.background, border: t.highlight && t.highlight.border || e.highlight.border }, hover: Yr(t.hover) ? { border: t.hover, background: t.hover } : { border: t.hover && t.hover.border || e.hover.border, background: t.hover && t.hover.background || e.hover.background } } : { background: t.background || void 0, border: t.border || void 0, highlight: Yr(t.highlight) ? { border: t.highlight, background: t.highlight } : { background: t.highlight && t.highlight.background || void 0, border: t.highlight && t.highlight.border || void 0 }, hover: Yr(t.hover) ? { border: t.hover, background: t.hover } : { border: t.hover && t.hover.border || void 0, background: t.hover && t.hover.background || void 0 } } } function vs(t, e, i) { t /= 255, e /= 255, i /= 255; var n = Math.min(t, Math.min(e, i)), o = Math.max(t, Math.max(e, i)); return n === o ? { h: 0, s: 0, v: n } : { h: 60 * ((t === n ? 3 : i === n ? 1 : 5) - (t === n ? e - i : i === n ? t - e : i - t) / (o - n)) / 360, s: (o - n) / o, v: o } } var gs = function (t) { var e, i = {}; return Yn(e = t.split(";")).call(e, (function (t) { if ("" != Bn(t).call(t)) { var e, n, o = t.split(":"), r = Bn(e = o[0]).call(e), s = Bn(n = o[1]).call(n); i[r] = s } })), i }, ys = function (t) { var e; return cr(e = rr(t)).call(e, (function (e) { return e + ": " + t[e] })).join("; ") }; function ms(t, e, i) { var n, o, r, s = Math.floor(6 * t), a = 6 * t - s, h = i * (1 - e), l = i * (1 - a * e), d = i * (1 - (1 - a) * e); switch (s % 6) { case 0: n = i, o = d, r = h; break; case 1: n = l, o = i, r = h; break; case 2: n = h, o = i, r = d; break; case 3: n = h, o = l, r = i; break; case 4: n = d, o = h, r = i; break; case 5: n = i, o = h, r = l }return { r: Math.floor(255 * n), g: Math.floor(255 * o), b: Math.floor(255 * r) } } function bs(t, e, i) { var n = ms(t, e, i); return fs(n.r, n.g, n.b) } function ws(t) { var e = cs(t); if (!e) throw new TypeError("'".concat(t, "' is not a valid color.")); return vs(e.r, e.g, e.b) } function ks(t) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t) } function _s(t) { return Wr.test(t) } function xs(t) { return qr.test(t) } function Es(t) { if (null === t || "object" !== vr(t)) return null; if (t instanceof Element) return t; var e = wn(t); for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && "object" == vr(t[i]) && (e[i] = Es(t[i])); return e } function Os(t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o = function (t) { return null != t }, r = function (t) { return null !== t && "object" === vr(t) }, s = function (t) { for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e)) return !1; return !0 }; if (!r(t)) throw new Error("Parameter mergeTarget must be an object"); if (!r(e)) throw new Error("Parameter options must be an object"); if (!o(i)) throw new Error("Parameter option must have a value"); if (!r(n)) throw new Error("Parameter globalOptions must be an object"); var a = function (t, e, i) { r(t[i]) || (t[i] = {}); var n = e[i], o = t[i]; for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (o[s] = n[s]) }, h = e[i], l = r(n) && !s(n), d = l ? n[i] : void 0, c = d ? d.enabled : void 0; if (void 0 !== h) { if ("boolean" == typeof h) return r(t[i]) || (t[i] = {}), void (t[i].enabled = h); if (null === h && !r(t[i])) { if (!o(d)) return; t[i] = wn(d) } if (r(h)) { var u = !0; void 0 !== h.enabled ? u = h.enabled : void 0 !== c && (u = d.enabled), a(t, e, i), t[i].enabled = u } } } var Ss = { linear: function (t) { return t }, easeInQuad: function (t) { return t * t }, easeOutQuad: function (t) { return t * (2 - t) }, easeInOutQuad: function (t) { return t < .5 ? 2 * t * t : (4 - 2 * t) * t - 1 }, easeInCubic: function (t) { return t * t * t }, easeOutCubic: function (t) { return --t * t * t + 1 }, easeInOutCubic: function (t) { return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1 }, easeInQuart: function (t) { return t * t * t * t }, easeOutQuart: function (t) { return 1 - --t * t * t * t }, easeInOutQuart: function (t) { return t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t }, easeInQuint: function (t) { return t * t * t * t * t }, easeOutQuint: function (t) { return 1 + --t * t * t * t * t }, easeInOutQuint: function (t) { return t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t } }; function Cs(t, e) { var i; ur(e) || (e = [e]); var n, o = Tr(t); try { for (o.s(); !(n = o.n()).done;) { var r = n.value; if (r) { i = r[e[0]]; for (var s = 1; s < e.length; s++)i && (i = i[e[s]]); if (void 0 !== i) break } } } catch (t) { o.e(t) } finally { o.f() } return i } var Ts = Object.freeze({ __proto__: null, Alea: Ar, DELETE: Mr, HSVToHex: bs, HSVToRGB: ms, RGBToHSV: vs, RGBToHex: fs, addClassName: os, addCssText: function (t, e) { var i = gs(t.style.cssText), n = gs(e), o = Cr(Cr({}, i), n); t.style.cssText = ys(o) }, addEventListener: hs, binarySearchCustom: function (t, e, i, n) { for (var o = 0, r = 0, s = t.length - 1; r <= s && o < 1e4;) { var a = Math.floor((r + s) / 2), h = t[a], l = e(void 0 === n ? h[i] : h[i][n]); if (0 == l) return a; -1 == l ? r = a + 1 : s = a - 1, o++ } return -1 }, binarySearchValue: function (t, e, i, n, o) { var r, s, a, h, l = 0, d = 0, c = t.length - 1; for (o = null != o ? o : function (t, e) { return t == e ? 0 : t < e ? -1 : 1 }; d <= c && l < 1e4;) { if (h = Math.floor(.5 * (c + d)), r = t[Math.max(0, h - 1)][i], s = t[h][i], a = t[Math.min(t.length - 1, h + 1)][i], 0 == o(s, e)) return h; if (o(r, e) < 0 && o(s, e) > 0) return "before" == n ? Math.max(0, h - 1) : h; if (o(s, e) < 0 && o(a, e) > 0) return "before" == n ? h : Math.min(t.length - 1, h + 1); o(s, e) < 0 ? d = h + 1 : c = h - 1, l++ } return -1 }, bridgeObject: Es, copyAndExtendArray: ts, copyArray: es, deepExtend: Jr, deepObjectAssign: Ir, easingFunctions: Ss, equalArray: function (t, e) { if (t.length !== e.length) return !1; for (var i = 0, n = t.length; i < n; i++)if (t[i] != e[i]) return !1; return !0 }, extend: $r, fillIfDefined: Kr, forEach: ss, getAbsoluteLeft: is, getAbsoluteRight: function (t) { return t.getBoundingClientRect().right }, getAbsoluteTop: ns, getScrollBarWidth: function () { var t = document.createElement("p"); t.style.width = "100%", t.style.height = "200px"; var e = document.createElement("div"); e.style.position = "absolute", e.style.top = "0px", e.style.left = "0px", e.style.visibility = "hidden", e.style.width = "200px", e.style.height = "150px", e.style.overflow = "hidden", e.appendChild(t), document.body.appendChild(e); var i = t.offsetWidth; e.style.overflow = "scroll"; var n = t.offsetWidth; return i == n && (n = e.clientWidth), document.body.removeChild(e), i - n }, getTarget: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window.event, e = null; return t && (t.target ? e = t.target : t.srcElement && (e = t.srcElement)), e instanceof Element && (null == e.nodeType || 3 != e.nodeType || (e = e.parentNode) instanceof Element) ? e : null }, getType: function (t) { var e = vr(t); return "object" === e ? null === t ? "null" : t instanceof Boolean ? "Boolean" : t instanceof Number ? "Number" : t instanceof String ? "String" : ur(t) ? "Array" : t instanceof Date ? "Date" : "Object" : "number" === e ? "Number" : "boolean" === e ? "Boolean" : "string" === e ? "String" : void 0 === e ? "undefined" : e }, hasParent: function (t, e) { for (var i = t; i;) { if (i === e) return !0; if (!i.parentNode) return !1; i = i.parentNode } return !1 }, hexToHSV: ws, hexToRGB: cs, insertSort: function (t, e) { for (var i = 0; i < t.length; i++) { var n = t[i], o = void 0; for (o = i; o > 0 && e(n, t[o - 1]) < 0; o--)t[o] = t[o - 1]; t[o] = n } return t }, isDate: function (t) { if (t instanceof Date) return !0; if (Yr(t)) { if (Rr.exec(t)) return !0; if (!isNaN(Date.parse(t))) return !0 } return !1 }, isNumber: Vr, isObject: Xr, isString: Yr, isValidHex: ks, isValidRGB: _s, isValidRGBA: xs, mergeOptions: Os, option: ds, overrideOpacity: us, parseColor: ps, preventDefault: function (t) { t || (t = window.event), t && (t.preventDefault ? t.preventDefault() : t.returnValue = !1) }, pureDeepObjectAssign: Pr, recursiveDOMDelete: Ur, removeClassName: rs, removeCssText: function (t, e) { var i = gs(t.style.cssText), n = gs(e); for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && delete i[o]; t.style.cssText = ys(i) }, removeEventListener: ls, selectiveBridgeObject: function (t, e) { if (null !== e && "object" === vr(e)) { for (var i = wn(e), n = 0; n < t.length; n++)Object.prototype.hasOwnProperty.call(e, t[n]) && "object" == vr(e[t[n]]) && (i[t[n]] = Es(e[t[n]])); return i } return null }, selectiveDeepExtend: Zr, selectiveExtend: function (t, e) { if (!ur(t)) throw new Error("Array with property names expected as first argument"); for (var i = arguments.length, n = new Array(i > 2 ? i - 2 : 0), o = 2; o < i; o++)n[o - 2] = arguments[o]; for (var r = 0, s = n; r < s.length; r++)for (var a = s[r], h = 0; h < t.length; h++) { var l = t[h]; a && Object.prototype.hasOwnProperty.call(a, l) && (e[l] = a[l]) } return e }, selectiveNotDeepExtend: Qr, throttle: function (t) { var e = !1; return function () { e || (e = !0, requestAnimationFrame((function () { e = !1, t() }))) } }, toArray: as, topMost: Cs, updateProperty: function (t, e, i) { return t[e] !== i && (t[e] = i, !0) } }), Ds = co("splice"), Ms = jn("splice", { ACCESSORS: !0, 0: 0, 1: 2 }), Ps = Math.max, Is = Math.min, Bs = 9007199254740991, zs = "Maximum allowed length exceeded"; q({ target: "Array", proto: !0, forced: !Ds || !Ms }, { splice: function (t, e) { var i, n, o, r, s, a, h = pt(this), l = it(h.length), d = rt(t, l), c = arguments.length; if (0 === c ? i = n = 0 : 1 === c ? (i = 0, n = l - d) : (i = c - 2, n = Is(Ps(tt(e), 0), l - d)), l + i - n > Bs) throw TypeError(zs); for (o = He(h, n), r = 0; r < n; r++)(s = d + r) in h && Nt(o, r, h[s]); if (o.length = n, i < n) { for (r = d; r < l - n; r++)a = r + i, (s = r + n) in h ? h[a] = h[s] : delete h[a]; for (r = l; r > l - n + i; r--)delete h[r - 1] } else if (i > n) for (r = l - n; r > d; r--)a = r + i - 1, (s = r + n - 1) in h ? h[a] = h[s] : delete h[a]; for (r = 0; r < i; r++)h[r + d] = arguments[r + 2]; return h.length = l - n + i, o } }); var Ns = G("Array").splice, As = Array.prototype, Fs = function (t) { var e = t.splice; return t === As || t instanceof Array && e === As.splice ? Ns : e }, js = at.includes, Rs = jn("indexOf", { ACCESSORS: !0, 1: 0 }); q({ target: "Array", proto: !0, forced: !Rs }, { includes: function (t) { return js(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var Ls = G("Array").includes, Hs = fe("match"), Ws = function (t) { if (function (t) { var e; return y(t) && (void 0 !== (e = t[Hs]) ? !!e : "RegExp" == u(t)) }(t)) throw TypeError("The method doesn't accept regular expressions"); return t }, qs = fe("match"); q({ target: "String", proto: !0, forced: !function (t) { var e = /./; try { "/./"[t](e) } catch (i) { try { return e[qs] = !1, "/./"[t](e) } catch (t) { } } return !1 }("includes") }, { includes: function (t) { return !!~String(v(this)).indexOf(Ws(t), arguments.length > 1 ? arguments[1] : void 0) } }); var Vs = G("String").includes, Us = Array.prototype, Ys = String.prototype, Xs = function (t) { var e = t.includes; return t === Us || t instanceof Array && e === Us.includes ? Ls : "string" == typeof t || t === Ys || t instanceof String && e === Ys.includes ? Vs : e }; function Gs(t) { return ia = t, function () { var t = {}; na = 0, void (oa = ia.charAt(0)), ga(), "strict" === ra && (t.strict = !0, ga()); "graph" !== ra && "digraph" !== ra || (t.type = ra, ga()); sa === Js && (t.id = ra, ga()); if ("{" != ra) throw _a("Angle bracket { expected"); if (ga(), ya(t), "}" != ra) throw _a("Angle bracket } expected"); if (ga(), "" !== ra) throw _a("End of file expected"); return ga(), delete t.node, delete t.edge, delete t.graph, t }() } var Ks = { fontsize: "font.size", fontcolor: "font.color", labelfontcolor: "font.color", fontname: "font.face", color: ["color.border", "color.background"], fillcolor: "color.background", tooltip: "title", labeltooltip: "title" }, $s = wn(Ks); $s.color = "color.color", $s.style = "dashes"; var Zs = 0, Qs = 1, Js = 2, ta = 3, ea = { "{": !0, "}": !0, "[": !0, "]": !0, ";": !0, "=": !0, ",": !0, "->": !0, "--": !0 }, ia = "", na = 0, oa = "", ra = "", sa = Zs; function aa() { na++, oa = ia.charAt(na) } function ha() { return ia.charAt(na + 1) } var la = /[a-zA-Z_0-9.:#]/; function da(t) { return la.test(t) } function ca(t, e) { if (t || (t = {}), e) for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]); return t } function ua(t, e, i) { for (var n = e.split("."), o = t; n.length;) { var r = n.shift(); n.length ? (o[r] || (o[r] = {}), o = o[r]) : o[r] = i } } function fa(t, e) { for (var i, n, o = null, r = [t], s = t; s.parent;)r.push(s.parent), s = s.parent; if (s.nodes) for (i = 0, n = s.nodes.length; i < n; i++)if (e.id === s.nodes[i].id) { o = s.nodes[i]; break } for (o || (o = { id: e.id }, t.node && (o.attr = ca(o.attr, t.node))), i = r.length - 1; i >= 0; i--) { var a, h = r[i]; h.nodes || (h.nodes = []), -1 === To(a = h.nodes).call(a, o) && h.nodes.push(o) } e.attr && (o.attr = ca(o.attr, e.attr)) } function pa(t, e) { if (t.edges || (t.edges = []), t.edges.push(e), t.edge) { var i = ca({}, t.edge); e.attr = ca(i, e.attr) } } function va(t, e, i, n, o) { var r = { from: e, to: i, type: n }; return t.edge && (r.attr = ca({}, t.edge)), r.attr = ca(r.attr || {}, o), null != o && o.hasOwnProperty("arrows") && null != o.arrows && (r.arrows = { to: { enabled: !0, type: o.arrows.type } }, o.arrows = null), r } function ga() { for (sa = Zs, ra = ""; " " === oa || "\t" === oa || "\n" === oa || "\r" === oa;)aa(); do { var t = !1; if ("#" === oa) { for (var e = na - 1; " " === ia.charAt(e) || "\t" === ia.charAt(e);)e--; if ("\n" === ia.charAt(e) || "" === ia.charAt(e)) { for (; "" != oa && "\n" != oa;)aa(); t = !0 } } if ("/" === oa && "/" === ha()) { for (; "" != oa && "\n" != oa;)aa(); t = !0 } if ("/" === oa && "*" === ha()) { for (; "" != oa;) { if ("*" === oa && "/" === ha()) { aa(), aa(); break } aa() } t = !0 } for (; " " === oa || "\t" === oa || "\n" === oa || "\r" === oa;)aa() } while (t); if ("" !== oa) { var i = oa + ha(); if (ea[i]) return sa = Qs, ra = i, aa(), void aa(); if (ea[oa]) return sa = Qs, ra = oa, void aa(); if (da(oa) || "-" === oa) { for (ra += oa, aa(); da(oa);)ra += oa, aa(); return "false" === ra ? ra = !1 : "true" === ra ? ra = !0 : isNaN(Number(ra)) || (ra = Number(ra)), void (sa = Js) } if ('"' === oa) { for (aa(); "" != oa && ('"' != oa || '"' === oa && '"' === ha());)'"' === oa ? (ra += oa, aa()) : "\\" === oa && "n" === ha() ? (ra += "\n", aa()) : ra += oa, aa(); if ('"' != oa) throw _a('End of string " expected'); return aa(), void (sa = Js) } for (sa = ta; "" != oa;)ra += oa, aa(); throw new SyntaxError('Syntax error in part "' + xa(ra, 30) + '"') } sa = Qs } function ya(t) { for (; "" !== ra && "}" != ra;)ma(t), ";" === ra && ga() } function ma(t) { var e = ba(t); if (e) wa(t, e); else if (!function (t) { if ("node" === ra) return ga(), t.node = ka(), "node"; if ("edge" === ra) return ga(), t.edge = ka(), "edge"; if ("graph" === ra) return ga(), t.graph = ka(), "graph"; return null }(t)) { if (sa != Js) throw _a("Identifier expected"); var i = ra; if (ga(), "=" === ra) { if (ga(), sa != Js) throw _a("Identifier expected"); t[i] = ra, ga() } else !function (t, e) { var i = { id: e }, n = ka(); n && (i.attr = n); fa(t, i), wa(t, e) }(t, i) } } function ba(t) { var e = null; if ("subgraph" === ra && ((e = {}).type = "subgraph", ga(), sa === Js && (e.id = ra, ga())), "{" === ra) { if (ga(), e || (e = {}), e.parent = t, e.node = t.node, e.edge = t.edge, e.graph = t.graph, ya(e), "}" != ra) throw _a("Angle bracket } expected"); ga(), delete e.node, delete e.edge, delete e.graph, delete e.parent, t.subgraphs || (t.subgraphs = []), t.subgraphs.push(e) } return e } function wa(t, e) { for (; "->" === ra || "--" === ra;) { var i, n = ra; ga(); var o = ba(t); if (o) i = o; else { if (sa != Js) throw _a("Identifier or subgraph expected"); fa(t, { id: i = ra }), ga() } pa(t, va(t, e, i, n, ka())), e = i } } function ka() { for (var t, e, i = null, n = { dashed: !0, solid: !1, dotted: [1, 5] }, o = { dot: "circle", box: "box", crow: "crow", curve: "curve", icurve: "inv_curve", normal: "triangle", inv: "inv_triangle", diamond: "diamond", tee: "bar", vee: "vee" }, r = new Array, s = new Array; "[" === ra;) { for (ga(), i = {}; "" !== ra && "]" != ra;) { if (sa != Js) throw _a("Attribute name expected"); var a = ra; if (ga(), "=" != ra) throw _a("Equal sign = expected"); if (ga(), sa != Js) throw _a("Attribute value expected"); var h = ra; "style" === a && (h = n[h]), "arrowhead" === a && (a = "arrows", h = { to: { enabled: !0, type: o[h] } }), "arrowtail" === a && (a = "arrows", h = { from: { enabled: !0, type: o[h] } }), r.push({ attr: i, name: a, value: h }), s.push(a), ga(), "," == ra && ga() } if ("]" != ra) throw _a("Bracket ] expected"); ga() } if (Xs(s).call(s, "dir")) { var l = { arrows: {} }; for (t = 0; t < r.length; t++)if ("arrows" === r[t].name) if (null != r[t].value.to) l.arrows.to = t; else { if (null == r[t].value.from) throw _a("Invalid value of arrows"); l.arrows.from = t } else "dir" === r[t].name && (l.dir = t); var d, c, u = r[l.dir].value; if (!Xs(s).call(s, "arrows")) if ("both" === u) r.push({ attr: r[l.dir].attr, name: "arrows", value: { to: { enabled: !0 } } }), l.arrows.to = r.length - 1, r.push({ attr: r[l.dir].attr, name: "arrows", value: { from: { enabled: !0 } } }), l.arrows.from = r.length - 1; else if ("forward" === u) r.push({ attr: r[l.dir].attr, name: "arrows", value: { to: { enabled: !0 } } }), l.arrows.to = r.length - 1; else if ("back" === u) r.push({ attr: r[l.dir].attr, name: "arrows", value: { from: { enabled: !0 } } }), l.arrows.from = r.length - 1; else { if ("none" !== u) throw _a('Invalid dir type "' + u + '"'); r.push({ attr: r[l.dir].attr, name: "arrows", value: "" }), l.arrows.to = r.length - 1 } if ("both" === u) l.arrows.to && l.arrows.from ? (c = r[l.arrows.to].value.to.type, d = r[l.arrows.from].value.from.type, r[l.arrows.to] = { attr: r[l.arrows.to].attr, name: r[l.arrows.to].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }, Fs(r).call(r, l.arrows.from, 1)) : l.arrows.to ? (c = r[l.arrows.to].value.to.type, d = "arrow", r[l.arrows.to] = { attr: r[l.arrows.to].attr, name: r[l.arrows.to].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }) : l.arrows.from && (c = "arrow", d = r[l.arrows.from].value.from.type, r[l.arrows.from] = { attr: r[l.arrows.from].attr, name: r[l.arrows.from].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }); else if ("back" === u) l.arrows.to && l.arrows.from ? (c = "", d = r[l.arrows.from].value.from.type, r[l.arrows.from] = { attr: r[l.arrows.from].attr, name: r[l.arrows.from].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }) : l.arrows.to ? (c = "", d = "arrow", l.arrows.from = l.arrows.to, r[l.arrows.from] = { attr: r[l.arrows.from].attr, name: r[l.arrows.from].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }) : l.arrows.from && (c = "", d = r[l.arrows.from].value.from.type, r[l.arrows.to] = { attr: r[l.arrows.from].attr, name: r[l.arrows.from].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }), r[l.arrows.from] = { attr: r[l.arrows.from].attr, name: r[l.arrows.from].name, value: { from: { enabled: !0, type: r[l.arrows.from].value.from.type } } }; else if ("none" === u) { var f; r[f = l.arrows.to ? l.arrows.to : l.arrows.from] = { attr: r[f].attr, name: r[f].name, value: "" } } else { if ("forward" !== u) throw _a('Invalid dir type "' + u + '"'); l.arrows.to && l.arrows.from || l.arrows.to ? (c = r[l.arrows.to].value.to.type, d = "", r[l.arrows.to] = { attr: r[l.arrows.to].attr, name: r[l.arrows.to].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }) : l.arrows.from && (c = "arrow", d = "", l.arrows.to = l.arrows.from, r[l.arrows.to] = { attr: r[l.arrows.to].attr, name: r[l.arrows.to].name, value: { to: { enabled: !0, type: c }, from: { enabled: !0, type: d } } }), r[l.arrows.to] = { attr: r[l.arrows.to].attr, name: r[l.arrows.to].name, value: { to: { enabled: !0, type: r[l.arrows.to].value.to.type } } } } Fs(r).call(r, l.dir, 1) } if (Xs(s).call(s, "penwidth")) { var p = []; for (e = r.length, t = 0; t < e; t++)"width" !== r[t].name && ("penwidth" === r[t].name && (r[t].name = "width"), p.push(r[t])); r = p } for (e = r.length, t = 0; t < e; t++)ua(r[t].attr, r[t].name, r[t].value); return i } function _a(t) { return new SyntaxError(t + ', got "' + xa(ra, 30) + '" (char ' + na + ")") } function xa(t, e) { return t.length <= e ? t : t.substr(0, 27) + "..." } function Ea(t, e, i) { for (var n = e.split("."), o = n.pop(), r = t, s = 0; s < n.length; s++) { var a = n[s]; a in r || (r[a] = {}), r = r[a] } return r[o] = i, t } function Oa(t, e) { var i = {}; for (var n in t) if (t.hasOwnProperty(n)) { var o = e[n]; ur(o) ? Yn(o).call(o, (function (e) { Ea(i, e, t[n]) })) : Ea(i, "string" == typeof o ? o : n, t[n]) } return i } function Sa(t) { var e, i = Gs(t), n = { nodes: [], edges: [], options: {} }; i.nodes && Yn(e = i.nodes).call(e, (function (t) { var e = { id: t.id, label: String(t.label || t.id) }; ca(e, Oa(t.attr, Ks)), e.image && (e.shape = "image"), n.nodes.push(e) })); if (i.edges) { var o, r = function (t) { var e = { from: t.from, to: t.to }; return ca(e, Oa(t.attr, $s)), null == e.arrows && "->" === t.type && (e.arrows = "to"), e }; Yn(o = i.edges).call(o, (function (t) { var e, i, o, s, a, h, l; (e = t.from instanceof Object ? t.from.nodes : { id: t.from }, i = t.to instanceof Object ? t.to.nodes : { id: t.to }, t.from instanceof Object && t.from.edges) && Yn(o = t.from.edges).call(o, (function (t) { var e = r(t); n.edges.push(e) })); (a = i, h = function (e, i) { var o = va(n, e.id, i.id, t.type, t.attr), s = r(o); n.edges.push(s) }, ur(s = e) ? Yn(s).call(s, (function (t) { ur(a) ? Yn(a).call(a, (function (e) { h(t, e) })) : h(t, a) })) : ur(a) ? Yn(a).call(a, (function (t) { h(s, t) })) : h(s, a), t.to instanceof Object && t.to.edges) && Yn(l = t.to.edges).call(l, (function (t) { var e = r(t); n.edges.push(e) })) })) } return i.attr && (n.options = i.attr), n } var Ca = Object.freeze({ __proto__: null, parseDOT: Gs, DOTToGraph: Sa }); function Ta(t, e) { var i, n = { edges: { inheritColor: !1 }, nodes: { fixed: !1, parseColor: !1 } }; null != e && (null != e.fixed && (n.nodes.fixed = e.fixed), null != e.parseColor && (n.nodes.parseColor = e.parseColor), null != e.inheritColor && (n.edges.inheritColor = e.inheritColor)); var o = t.edges, r = cr(o).call(o, (function (t) { var e = { from: t.source, id: t.id, to: t.target }; return null != t.attributes && (e.attributes = t.attributes), null != t.label && (e.label = t.label), null != t.attributes && null != t.attributes.title && (e.title = t.attributes.title), "Directed" === t.type && (e.arrows = "to"), t.color && !1 === n.edges.inheritColor && (e.color = t.color), e })); return { nodes: cr(i = t.nodes).call(i, (function (t) { var e = { id: t.id, fixed: n.nodes.fixed && null != t.x && null != t.y }; return null != t.attributes && (e.attributes = t.attributes), null != t.label && (e.label = t.label), null != t.size && (e.size = t.size), null != t.attributes && null != t.attributes.title && (e.title = t.attributes.title), null != t.title && (e.title = t.title), null != t.x && (e.x = t.x), null != t.y && (e.y = t.y), null != t.color && (!0 === n.nodes.parseColor ? e.color = t.color : e.color = { background: t.color, border: t.color, highlight: { background: t.color, border: t.color }, hover: { background: t.color, border: t.color } }), e })), edges: r } } var Da = Object.freeze({ __proto__: null, parseGephi: Ta }); function Ma(t) { var e, i = t && t.preventDefault || !1, n = t && t.container || window, o = {}, r = { keydown: {}, keyup: {} }, s = {}; for (e = 97; e <= 122; e++)s[String.fromCharCode(e)] = { code: e - 97 + 65, shift: !1 }; for (e = 65; e <= 90; e++)s[String.fromCharCode(e)] = { code: e, shift: !0 }; for (e = 0; e <= 9; e++)s["" + e] = { code: 48 + e, shift: !1 }; for (e = 1; e <= 12; e++)s["F" + e] = { code: 111 + e, shift: !1 }; for (e = 0; e <= 9; e++)s["num" + e] = { code: 96 + e, shift: !1 }; s["num*"] = { code: 106, shift: !1 }, s["num+"] = { code: 107, shift: !1 }, s["num-"] = { code: 109, shift: !1 }, s["num/"] = { code: 111, shift: !1 }, s["num."] = { code: 110, shift: !1 }, s.left = { code: 37, shift: !1 }, s.up = { code: 38, shift: !1 }, s.right = { code: 39, shift: !1 }, s.down = { code: 40, shift: !1 }, s.space = { code: 32, shift: !1 }, s.enter = { code: 13, shift: !1 }, s.shift = { code: 16, shift: void 0 }, s.esc = { code: 27, shift: !1 }, s.backspace = { code: 8, shift: !1 }, s.tab = { code: 9, shift: !1 }, s.ctrl = { code: 17, shift: !1 }, s.alt = { code: 18, shift: !1 }, s.delete = { code: 46, shift: !1 }, s.pageup = { code: 33, shift: !1 }, s.pagedown = { code: 34, shift: !1 }, s["="] = { code: 187, shift: !1 }, s["-"] = { code: 189, shift: !1 }, s["]"] = { code: 221, shift: !1 }, s["["] = { code: 219, shift: !1 }; var a = function (t) { l(t, "keydown") }, h = function (t) { l(t, "keyup") }, l = function (t, e) { if (void 0 !== r[e][t.keyCode]) { for (var n = r[e][t.keyCode], o = 0; o < n.length; o++)(void 0 === n[o].shift || 1 == n[o].shift && 1 == t.shiftKey || 0 == n[o].shift && 0 == t.shiftKey) && n[o].fn(t); 1 == i && t.preventDefault() } }; return o.bind = function (t, e, i) { if (void 0 === i && (i = "keydown"), void 0 === s[t]) throw new Error("unsupported key: " + t); void 0 === r[i][s[t].code] && (r[i][s[t].code] = []), r[i][s[t].code].push({ fn: e, shift: s[t].shift }) }, o.bindAll = function (t, e) { for (var i in void 0 === e && (e = "keydown"), s) s.hasOwnProperty(i) && o.bind(i, t, e) }, o.getKey = function (t) { for (var e in s) if (s.hasOwnProperty(e)) { if (1 == t.shiftKey && 1 == s[e].shift && t.keyCode == s[e].code) return e; if (0 == t.shiftKey && 0 == s[e].shift && t.keyCode == s[e].code) return e; if (t.keyCode == s[e].code && "shift" == e) return e } return "unknown key, currently not supported" }, o.unbind = function (t, e, i) { if (void 0 === i && (i = "keydown"), void 0 === s[t]) throw new Error("unsupported key: " + t); if (void 0 !== e) { var n = [], o = r[i][s[t].code]; if (void 0 !== o) for (var a = 0; a < o.length; a++)o[a].fn == e && o[a].shift == s[t].shift || n.push(r[i][s[t].code][a]); r[i][s[t].code] = n } else r[i][s[t].code] = [] }, o.reset = function () { r = { keydown: {}, keyup: {} } }, o.destroy = function () { r = { keydown: {}, keyup: {} }, n.removeEventListener("keydown", a, !0), n.removeEventListener("keyup", h, !0) }, n.addEventListener("keydown", a, !0), n.addEventListener("keyup", h, !0), o } var Pa = Object.freeze({ __proto__: null, default: Ma }); function Ia() { return (Ia = Object.assign || function (t) { for (var e = 1; e < arguments.length; e++) { var i = arguments[e]; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && (t[n] = i[n]) } return t }).apply(this, arguments) } function Ba(t, e) { t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e } function za(t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t } var Na, Aa = "function" != typeof Object.assign ? function (t) { if (null == t) throw new TypeError("Cannot convert undefined or null to object"); for (var e = Object(t), i = 1; i < arguments.length; i++) { var n = arguments[i]; if (null != n) for (var o in n) n.hasOwnProperty(o) && (e[o] = n[o]) } return e } : Object.assign, Fa = ["", "webkit", "Moz", "MS", "ms", "o"], ja = "undefined" == typeof document ? { style: {} } : document.createElement("div"), Ra = Math.round, La = Math.abs, Ha = Date.now; function Wa(t, e) { for (var i, n, o = e[0].toUpperCase() + e.slice(1), r = 0; r < Fa.length;) { if ((n = (i = Fa[r]) ? i + o : e) in t) return n; r++ } } Na = "undefined" == typeof window ? {} : window; var qa = Wa(ja.style, "touchAction"), Va = void 0 !== qa; var Ua = "compute", Ya = "auto", Xa = "manipulation", Ga = "none", Ka = "pan-x", $a = "pan-y", Za = function () { if (!Va) return !1; var t = {}, e = Na.CSS && Na.CSS.supports; return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach((function (i) { return t[i] = !e || Na.CSS.supports("touch-action", i) })), t }(), Qa = "ontouchstart" in Na, Ja = void 0 !== Wa(Na, "PointerEvent"), th = Qa && /mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent), eh = "touch", ih = "mouse", nh = 16, oh = 24, rh = ["x", "y"], sh = ["clientX", "clientY"]; function ah(t, e, i) { var n; if (t) if (t.forEach) t.forEach(e, i); else if (void 0 !== t.length) for (n = 0; n < t.length;)e.call(i, t[n], n, t), n++; else for (n in t) t.hasOwnProperty(n) && e.call(i, t[n], n, t) } function hh(t, e) { return "function" == typeof t ? t.apply(e && e[0] || void 0, e) : t } function lh(t, e) { return t.indexOf(e) > -1 } var dh = function () { function t(t, e) { this.manager = t, this.set(e) } var e = t.prototype; return e.set = function (t) { t === Ua && (t = this.compute()), Va && this.manager.element.style && Za[t] && (this.manager.element.style[qa] = t), this.actions = t.toLowerCase().trim() }, e.update = function () { this.set(this.manager.options.touchAction) }, e.compute = function () { var t = []; return ah(this.manager.recognizers, (function (e) { hh(e.options.enable, [e]) && (t = t.concat(e.getTouchAction())) })), function (t) { if (lh(t, Ga)) return Ga; var e = lh(t, Ka), i = lh(t, $a); return e && i ? Ga : e || i ? e ? Ka : $a : lh(t, Xa) ? Xa : Ya }(t.join(" ")) }, e.preventDefaults = function (t) { var e = t.srcEvent, i = t.offsetDirection; if (this.manager.session.prevented) e.preventDefault(); else { var n = this.actions, o = lh(n, Ga) && !Za.none, r = lh(n, $a) && !Za["pan-y"], s = lh(n, Ka) && !Za["pan-x"]; if (o) { var a = 1 === t.pointers.length, h = t.distance < 2, l = t.deltaTime < 250; if (a && h && l) return } if (!s || !r) return o || r && 6 & i || s && i & oh ? this.preventSrc(e) : void 0 } }, e.preventSrc = function (t) { this.manager.session.prevented = !0, t.preventDefault() }, t }(); function ch(t, e) { for (; t;) { if (t === e) return !0; t = t.parentNode } return !1 } function uh(t) { var e = t.length; if (1 === e) return { x: Ra(t[0].clientX), y: Ra(t[0].clientY) }; for (var i = 0, n = 0, o = 0; o < e;)i += t[o].clientX, n += t[o].clientY, o++; return { x: Ra(i / e), y: Ra(n / e) } } function fh(t) { for (var e = [], i = 0; i < t.pointers.length;)e[i] = { clientX: Ra(t.pointers[i].clientX), clientY: Ra(t.pointers[i].clientY) }, i++; return { timeStamp: Ha(), pointers: e, center: uh(e), deltaX: t.deltaX, deltaY: t.deltaY } } function ph(t, e, i) { i || (i = rh); var n = e[i[0]] - t[i[0]], o = e[i[1]] - t[i[1]]; return Math.sqrt(n * n + o * o) } function vh(t, e, i) { i || (i = rh); var n = e[i[0]] - t[i[0]], o = e[i[1]] - t[i[1]]; return 180 * Math.atan2(o, n) / Math.PI } function gh(t, e) { return t === e ? 1 : La(t) >= La(e) ? t < 0 ? 2 : 4 : e < 0 ? 8 : nh } function yh(t, e, i) { return { x: e / t || 0, y: i / t || 0 } } function mh(t, e) { var i = t.session, n = e.pointers, o = n.length; i.firstInput || (i.firstInput = fh(e)), o > 1 && !i.firstMultiple ? i.firstMultiple = fh(e) : 1 === o && (i.firstMultiple = !1); var r = i.firstInput, s = i.firstMultiple, a = s ? s.center : r.center, h = e.center = uh(n); e.timeStamp = Ha(), e.deltaTime = e.timeStamp - r.timeStamp, e.angle = vh(a, h), e.distance = ph(a, h), function (t, e) { var i = e.center, n = t.offsetDelta || {}, o = t.prevDelta || {}, r = t.prevInput || {}; 1 !== e.eventType && 4 !== r.eventType || (o = t.prevDelta = { x: r.deltaX || 0, y: r.deltaY || 0 }, n = t.offsetDelta = { x: i.x, y: i.y }), e.deltaX = o.x + (i.x - n.x), e.deltaY = o.y + (i.y - n.y) }(i, e), e.offsetDirection = gh(e.deltaX, e.deltaY); var l, d, c = yh(e.deltaTime, e.deltaX, e.deltaY); e.overallVelocityX = c.x, e.overallVelocityY = c.y, e.overallVelocity = La(c.x) > La(c.y) ? c.x : c.y, e.scale = s ? (l = s.pointers, ph((d = n)[0], d[1], sh) / ph(l[0], l[1], sh)) : 1, e.rotation = s ? function (t, e) { return vh(e[1], e[0], sh) + vh(t[1], t[0], sh) }(s.pointers, n) : 0, e.maxPointers = i.prevInput ? e.pointers.length > i.prevInput.maxPointers ? e.pointers.length : i.prevInput.maxPointers : e.pointers.length, function (t, e) { var i, n, o, r, s = t.lastInterval || e, a = e.timeStamp - s.timeStamp; if (8 !== e.eventType && (a > 25 || void 0 === s.velocity)) { var h = e.deltaX - s.deltaX, l = e.deltaY - s.deltaY, d = yh(a, h, l); n = d.x, o = d.y, i = La(d.x) > La(d.y) ? d.x : d.y, r = gh(h, l), t.lastInterval = e } else i = s.velocity, n = s.velocityX, o = s.velocityY, r = s.direction; e.velocity = i, e.velocityX = n, e.velocityY = o, e.direction = r }(i, e); var u, f = t.element, p = e.srcEvent; ch(u = p.composedPath ? p.composedPath()[0] : p.path ? p.path[0] : p.target, f) && (f = u), e.target = f } function bh(t, e, i) { var n = i.pointers.length, o = i.changedPointers.length, r = 1 & e && n - o == 0, s = 12 & e && n - o == 0; i.isFirst = !!r, i.isFinal = !!s, r && (t.session = {}), i.eventType = e, mh(t, i), t.emit("hammer.input", i), t.recognize(i), t.session.prevInput = i } function wh(t) { return t.trim().split(/\s+/g) } function kh(t, e, i) { ah(wh(e), (function (e) { t.addEventListener(e, i, !1) })) } function _h(t, e, i) { ah(wh(e), (function (e) { t.removeEventListener(e, i, !1) })) } function xh(t) { var e = t.ownerDocument || t; return e.defaultView || e.parentWindow || window } var Eh = function () { function t(t, e) { var i = this; this.manager = t, this.callback = e, this.element = t.element, this.target = t.options.inputTarget, this.domHandler = function (e) { hh(t.options.enable, [t]) && i.handler(e) }, this.init() } var e = t.prototype; return e.handler = function () { }, e.init = function () { this.evEl && kh(this.element, this.evEl, this.domHandler), this.evTarget && kh(this.target, this.evTarget, this.domHandler), this.evWin && kh(xh(this.element), this.evWin, this.domHandler) }, e.destroy = function () { this.evEl && _h(this.element, this.evEl, this.domHandler), this.evTarget && _h(this.target, this.evTarget, this.domHandler), this.evWin && _h(xh(this.element), this.evWin, this.domHandler) }, t }(); function Oh(t, e, i) { if (t.indexOf && !i) return t.indexOf(e); for (var n = 0; n < t.length;) { if (i && t[n][i] == e || !i && t[n] === e) return n; n++ } return -1 } var Sh = { pointerdown: 1, pointermove: 2, pointerup: 4, pointercancel: 8, pointerout: 8 }, Ch = { 2: eh, 3: "pen", 4: ih, 5: "kinect" }, Th = "pointerdown", Dh = "pointermove pointerup pointercancel"; Na.MSPointerEvent && !Na.PointerEvent && (Th = "MSPointerDown", Dh = "MSPointerMove MSPointerUp MSPointerCancel"); var Mh = function (t) { function e() { var i, n = e.prototype; return n.evEl = Th, n.evWin = Dh, (i = t.apply(this, arguments) || this).store = i.manager.session.pointerEvents = [], i } return Ba(e, t), e.prototype.handler = function (t) { var e = this.store, i = !1, n = t.type.toLowerCase().replace("ms", ""), o = Sh[n], r = Ch[t.pointerType] || t.pointerType, s = r === eh, a = Oh(e, t.pointerId, "pointerId"); 1 & o && (0 === t.button || s) ? a < 0 && (e.push(t), a = e.length - 1) : 12 & o && (i = !0), a < 0 || (e[a] = t, this.callback(this.manager, o, { pointers: e, changedPointers: [t], pointerType: r, srcEvent: t }), i && e.splice(a, 1)) }, e }(Eh); function Ph(t) { return Array.prototype.slice.call(t, 0) } function Ih(t, e, i) { for (var n = [], o = [], r = 0; r < t.length;) { var s = e ? t[r][e] : t[r]; Oh(o, s) < 0 && n.push(t[r]), o[r] = s, r++ } return i && (n = e ? n.sort((function (t, i) { return t[e] > i[e] })) : n.sort()), n } var Bh = { touchstart: 1, touchmove: 2, touchend: 4, touchcancel: 8 }, zh = "touchstart touchmove touchend touchcancel", Nh = function (t) { function e() { var i; return e.prototype.evTarget = zh, (i = t.apply(this, arguments) || this).targetIds = {}, i } return Ba(e, t), e.prototype.handler = function (t) { var e = Bh[t.type], i = Ah.call(this, t, e); i && this.callback(this.manager, e, { pointers: i[0], changedPointers: i[1], pointerType: eh, srcEvent: t }) }, e }(Eh); function Ah(t, e) { var i, n, o = Ph(t.touches), r = this.targetIds; if (3 & e && 1 === o.length) return r[o[0].identifier] = !0, [o, o]; var s = Ph(t.changedTouches), a = [], h = this.target; if (n = o.filter((function (t) { return ch(t.target, h) })), 1 === e) for (i = 0; i < n.length;)r[n[i].identifier] = !0, i++; for (i = 0; i < s.length;)r[s[i].identifier] && a.push(s[i]), 12 & e && delete r[s[i].identifier], i++; return a.length ? [Ih(n.concat(a), "identifier", !0), a] : void 0 } var Fh = { mousedown: 1, mousemove: 2, mouseup: 4 }, jh = "mousedown", Rh = "mousemove mouseup", Lh = function (t) { function e() { var i, n = e.prototype; return n.evEl = jh, n.evWin = Rh, (i = t.apply(this, arguments) || this).pressed = !1, i } return Ba(e, t), e.prototype.handler = function (t) { var e = Fh[t.type]; 1 & e && 0 === t.button && (this.pressed = !0), 2 & e && 1 !== t.which && (e = 4), this.pressed && (4 & e && (this.pressed = !1), this.callback(this.manager, e, { pointers: [t], changedPointers: [t], pointerType: ih, srcEvent: t })) }, e }(Eh); function Hh(t) { var e = t.changedPointers[0]; if (e.identifier === this.primaryTouch) { var i = { x: e.clientX, y: e.clientY }, n = this.lastTouches; this.lastTouches.push(i); setTimeout((function () { var t = n.indexOf(i); t > -1 && n.splice(t, 1) }), 2500) } } function Wh(t, e) { 1 & t ? (this.primaryTouch = e.changedPointers[0].identifier, Hh.call(this, e)) : 12 & t && Hh.call(this, e) } function qh(t) { for (var e = t.srcEvent.clientX, i = t.srcEvent.clientY, n = 0; n < this.lastTouches.length; n++) { var o = this.lastTouches[n], r = Math.abs(e - o.x), s = Math.abs(i - o.y); if (r <= 25 && s <= 25) return !0 } return !1 } var Vh = function () { return function (t) { function e(e, i) { var n; return (n = t.call(this, e, i) || this).handler = function (t, e, i) { var o = i.pointerType === eh, r = i.pointerType === ih; if (!(r && i.sourceCapabilities && i.sourceCapabilities.firesTouchEvents)) { if (o) Wh.call(za(za(n)), e, i); else if (r && qh.call(za(za(n)), i)) return; n.callback(t, e, i) } }, n.touch = new Nh(n.manager, n.handler), n.mouse = new Lh(n.manager, n.handler), n.primaryTouch = null, n.lastTouches = [], n } return Ba(e, t), e.prototype.destroy = function () { this.touch.destroy(), this.mouse.destroy() }, e }(Eh) }(); function Uh(t, e, i) { return !!Array.isArray(t) && (ah(t, i[e], i), !0) } var Yh = 32, Xh = 1; function Gh(t, e) { var i = e.manager; return i ? i.get(t) : t } function Kh(t) { return 16 & t ? "cancel" : 8 & t ? "end" : 4 & t ? "move" : 2 & t ? "start" : "" } var $h = function () { function t(t) { void 0 === t && (t = {}), this.options = Ia({ enable: !0 }, t), this.id = Xh++, this.manager = null, this.state = 1, this.simultaneous = {}, this.requireFail = [] } var e = t.prototype; return e.set = function (t) { return Aa(this.options, t), this.manager && this.manager.touchAction.update(), this }, e.recognizeWith = function (t) { if (Uh(t, "recognizeWith", this)) return this; var e = this.simultaneous; return e[(t = Gh(t, this)).id] || (e[t.id] = t, t.recognizeWith(this)), this }, e.dropRecognizeWith = function (t) { return Uh(t, "dropRecognizeWith", this) || (t = Gh(t, this), delete this.simultaneous[t.id]), this }, e.requireFailure = function (t) { if (Uh(t, "requireFailure", this)) return this; var e = this.requireFail; return -1 === Oh(e, t = Gh(t, this)) && (e.push(t), t.requireFailure(this)), this }, e.dropRequireFailure = function (t) { if (Uh(t, "dropRequireFailure", this)) return this; t = Gh(t, this); var e = Oh(this.requireFail, t); return e > -1 && this.requireFail.splice(e, 1), this }, e.hasRequireFailures = function () { return this.requireFail.length > 0 }, e.canRecognizeWith = function (t) { return !!this.simultaneous[t.id] }, e.emit = function (t) { var e = this, i = this.state; function n(i) { e.manager.emit(i, t) } i < 8 && n(e.options.event + Kh(i)), n(e.options.event), t.additionalEvent && n(t.additionalEvent), i >= 8 && n(e.options.event + Kh(i)) }, e.tryEmit = function (t) { if (this.canEmit()) return this.emit(t); this.state = Yh }, e.canEmit = function () { for (var t = 0; t < this.requireFail.length;) { if (!(33 & this.requireFail[t].state)) return !1; t++ } return !0 }, e.recognize = function (t) { var e = Aa({}, t); if (!hh(this.options.enable, [this, e])) return this.reset(), void (this.state = Yh); 56 & this.state && (this.state = 1), this.state = this.process(e), 30 & this.state && this.tryEmit(e) }, e.process = function (t) { }, e.getTouchAction = function () { }, e.reset = function () { }, t }(), Zh = function (t) { function e(e) { var i; return void 0 === e && (e = {}), (i = t.call(this, Ia({ event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10 }, e)) || this).pTime = !1, i.pCenter = !1, i._timer = null, i._input = null, i.count = 0, i } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { return [Xa] }, i.process = function (t) { var e = this, i = this.options, n = t.pointers.length === i.pointers, o = t.distance < i.threshold, r = t.deltaTime < i.time; if (this.reset(), 1 & t.eventType && 0 === this.count) return this.failTimeout(); if (o && r && n) { if (4 !== t.eventType) return this.failTimeout(); var s = !this.pTime || t.timeStamp - this.pTime < i.interval, a = !this.pCenter || ph(this.pCenter, t.center) < i.posThreshold; if (this.pTime = t.timeStamp, this.pCenter = t.center, a && s ? this.count += 1 : this.count = 1, this._input = t, 0 === this.count % i.taps) return this.hasRequireFailures() ? (this._timer = setTimeout((function () { e.state = 8, e.tryEmit() }), i.interval), 2) : 8 } return Yh }, i.failTimeout = function () { var t = this; return this._timer = setTimeout((function () { t.state = Yh }), this.options.interval), Yh }, i.reset = function () { clearTimeout(this._timer) }, i.emit = function () { 8 === this.state && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input)) }, e }($h), Qh = function (t) { function e(e) { return void 0 === e && (e = {}), t.call(this, Ia({ pointers: 1 }, e)) || this } Ba(e, t); var i = e.prototype; return i.attrTest = function (t) { var e = this.options.pointers; return 0 === e || t.pointers.length === e }, i.process = function (t) { var e = this.state, i = t.eventType, n = 6 & e, o = this.attrTest(t); return n && (8 & i || !o) ? 16 | e : n || o ? 4 & i ? 8 | e : 2 & e ? 4 | e : 2 : Yh }, e }($h); function Jh(t) { return t === nh ? "down" : 8 === t ? "up" : 2 === t ? "left" : 4 === t ? "right" : "" } var tl = function (t) { function e(e) { var i; return void 0 === e && (e = {}), (i = t.call(this, Ia({ event: "pan", threshold: 10, pointers: 1, direction: 30 }, e)) || this).pX = null, i.pY = null, i } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { var t = this.options.direction, e = []; return 6 & t && e.push($a), t & oh && e.push(Ka), e }, i.directionTest = function (t) { var e = this.options, i = !0, n = t.distance, o = t.direction, r = t.deltaX, s = t.deltaY; return o & e.direction || (6 & e.direction ? (o = 0 === r ? 1 : r < 0 ? 2 : 4, i = r !== this.pX, n = Math.abs(t.deltaX)) : (o = 0 === s ? 1 : s < 0 ? 8 : nh, i = s !== this.pY, n = Math.abs(t.deltaY))), t.direction = o, i && n > e.threshold && o & e.direction }, i.attrTest = function (t) { return Qh.prototype.attrTest.call(this, t) && (2 & this.state || !(2 & this.state) && this.directionTest(t)) }, i.emit = function (e) { this.pX = e.deltaX, this.pY = e.deltaY; var i = Jh(e.direction); i && (e.additionalEvent = this.options.event + i), t.prototype.emit.call(this, e) }, e }(Qh), el = function (t) { function e(e) { return void 0 === e && (e = {}), t.call(this, Ia({ event: "swipe", threshold: 10, velocity: .3, direction: 30, pointers: 1 }, e)) || this } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { return tl.prototype.getTouchAction.call(this) }, i.attrTest = function (e) { var i, n = this.options.direction; return 30 & n ? i = e.overallVelocity : 6 & n ? i = e.overallVelocityX : n & oh && (i = e.overallVelocityY), t.prototype.attrTest.call(this, e) && n & e.offsetDirection && e.distance > this.options.threshold && e.maxPointers === this.options.pointers && La(i) > this.options.velocity && 4 & e.eventType }, i.emit = function (t) { var e = Jh(t.offsetDirection); e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t) }, e }(Qh), il = function (t) { function e(e) { return void 0 === e && (e = {}), t.call(this, Ia({ event: "pinch", threshold: 0, pointers: 2 }, e)) || this } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { return [Ga] }, i.attrTest = function (e) { return t.prototype.attrTest.call(this, e) && (Math.abs(e.scale - 1) > this.options.threshold || 2 & this.state) }, i.emit = function (e) { if (1 !== e.scale) { var i = e.scale < 1 ? "in" : "out"; e.additionalEvent = this.options.event + i } t.prototype.emit.call(this, e) }, e }(Qh), nl = function (t) { function e(e) { return void 0 === e && (e = {}), t.call(this, Ia({ event: "rotate", threshold: 0, pointers: 2 }, e)) || this } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { return [Ga] }, i.attrTest = function (e) { return t.prototype.attrTest.call(this, e) && (Math.abs(e.rotation) > this.options.threshold || 2 & this.state) }, e }(Qh), ol = function (t) { function e(e) { var i; return void 0 === e && (e = {}), (i = t.call(this, Ia({ event: "press", pointers: 1, time: 251, threshold: 9 }, e)) || this)._timer = null, i._input = null, i } Ba(e, t); var i = e.prototype; return i.getTouchAction = function () { return [Ya] }, i.process = function (t) { var e = this, i = this.options, n = t.pointers.length === i.pointers, o = t.distance < i.threshold, r = t.deltaTime > i.time; if (this._input = t, !o || !n || 12 & t.eventType && !r) this.reset(); else if (1 & t.eventType) this.reset(), this._timer = setTimeout((function () { e.state = 8, e.tryEmit() }), i.time); else if (4 & t.eventType) return 8; return Yh }, i.reset = function () { clearTimeout(this._timer) }, i.emit = function (t) { 8 === this.state && (t && 4 & t.eventType ? this.manager.emit(this.options.event + "up", t) : (this._input.timeStamp = Ha(), this.manager.emit(this.options.event, this._input))) }, e }($h), rl = { domEvents: !1, touchAction: Ua, enable: !0, inputTarget: null, inputClass: null, cssProps: { userSelect: "none", touchSelect: "none", touchCallout: "none", contentZooming: "none", userDrag: "none", tapHighlightColor: "rgba(0,0,0,0)" } }, sl = [[nl, { enable: !1 }], [il, { enable: !1 }, ["rotate"]], [el, { direction: 6 }], [tl, { direction: 6 }, ["swipe"]], [Zh], [Zh, { event: "doubletap", taps: 2 }, ["tap"]], [ol]]; function al(t, e) { var i, n = t.element; n.style && (ah(t.options.cssProps, (function (o, r) { i = Wa(n.style, r), e ? (t.oldCssProps[i] = n.style[i], n.style[i] = o) : n.style[i] = t.oldCssProps[i] || "" })), e || (t.oldCssProps = {})) } var hl = function () { function t(t, e) { var i, n = this; this.options = Aa({}, rl, e || {}), this.options.inputTarget = this.options.inputTarget || t, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = t, this.input = new ((i = this).options.inputClass || (Ja ? Mh : th ? Nh : Qa ? Vh : Lh))(i, bh), this.touchAction = new dh(this, this.options.touchAction), al(this, !0), ah(this.options.recognizers, (function (t) { var e = n.add(new t[0](t[1])); t[2] && e.recognizeWith(t[2]), t[3] && e.requireFailure(t[3]) }), this) } var e = t.prototype; return e.set = function (t) { return Aa(this.options, t), t.touchAction && this.touchAction.update(), t.inputTarget && (this.input.destroy(), this.input.target = t.inputTarget, this.input.init()), this }, e.stop = function (t) { this.session.stopped = t ? 2 : 1 }, e.recognize = function (t) { var e = this.session; if (!e.stopped) { var i; this.touchAction.preventDefaults(t); var n = this.recognizers, o = e.curRecognizer; (!o || o && 8 & o.state) && (e.curRecognizer = null, o = null); for (var r = 0; r < n.length;)i = n[r], 2 === e.stopped || o && i !== o && !i.canRecognizeWith(o) ? i.reset() : i.recognize(t), !o && 14 & i.state && (e.curRecognizer = i, o = i), r++ } }, e.get = function (t) { if (t instanceof $h) return t; for (var e = this.recognizers, i = 0; i < e.length; i++)if (e[i].options.event === t) return e[i]; return null }, e.add = function (t) { if (Uh(t, "add", this)) return this; var e = this.get(t.options.event); return e && this.remove(e), this.recognizers.push(t), t.manager = this, this.touchAction.update(), t }, e.remove = function (t) { if (Uh(t, "remove", this)) return this; var e = this.get(t); if (t) { var i = this.recognizers, n = Oh(i, e); -1 !== n && (i.splice(n, 1), this.touchAction.update()) } return this }, e.on = function (t, e) { if (void 0 === t || void 0 === e) return this; var i = this.handlers; return ah(wh(t), (function (t) { i[t] = i[t] || [], i[t].push(e) })), this }, e.off = function (t, e) { if (void 0 === t) return this; var i = this.handlers; return ah(wh(t), (function (t) { e ? i[t] && i[t].splice(Oh(i[t], e), 1) : delete i[t] })), this }, e.emit = function (t, e) { this.options.domEvents && function (t, e) { var i = document.createEvent("Event"); i.initEvent(t, !0, !0), i.gesture = e, e.target.dispatchEvent(i) }(t, e); var i = this.handlers[t] && this.handlers[t].slice(); if (i && i.length) { e.type = t, e.preventDefault = function () { e.srcEvent.preventDefault() }; for (var n = 0; n < i.length;)i[n](e), n++ } }, e.destroy = function () { this.element && al(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null }, t }(), ll = { touchstart: 1, touchmove: 2, touchend: 4, touchcancel: 8 }, dl = "touchstart", cl = "touchstart touchmove touchend touchcancel", ul = function (t) { function e() { var i, n = e.prototype; return n.evTarget = dl, n.evWin = cl, (i = t.apply(this, arguments) || this).started = !1, i } return Ba(e, t), e.prototype.handler = function (t) { var e = ll[t.type]; if (1 === e && (this.started = !0), this.started) { var i = fl.call(this, t, e); 12 & e && i[0].length - i[1].length == 0 && (this.started = !1), this.callback(this.manager, e, { pointers: i[0], changedPointers: i[1], pointerType: eh, srcEvent: t }) } }, e }(Eh); function fl(t, e) { var i = Ph(t.touches), n = Ph(t.changedTouches); return 12 & e && (i = Ih(i.concat(n), "identifier", !0)), [i, n] } function pl(t, e, i) { var n = "DEPRECATED METHOD: " + e + "\n" + i + " AT \n"; return function () { var e = new Error("get-stack-trace"), i = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", o = window.console && (window.console.warn || window.console.log); return o && o.call(window.console, n, i), t.apply(this, arguments) } } var vl = pl((function (t, e, i) { for (var n = Object.keys(e), o = 0; o < n.length;)(!i || i && void 0 === t[n[o]]) && (t[n[o]] = e[n[o]]), o++; return t }), "extend", "Use `assign`."), gl = pl((function (t, e) { return vl(t, e, !0) }), "merge", "Use `assign`."); function yl(t, e, i) { var n, o = e.prototype; (n = t.prototype = Object.create(o)).constructor = t, n._super = o, i && Aa(n, i) } function ml(t, e) { return function () { return t.apply(e, arguments) } } var bl = function () { var t = function (t, e) { return void 0 === e && (e = {}), new hl(t, Ia({ recognizers: sl.concat() }, e)) }; return t.VERSION = "2.0.17-rc", t.DIRECTION_ALL = 30, t.DIRECTION_DOWN = nh, t.DIRECTION_LEFT = 2, t.DIRECTION_RIGHT = 4, t.DIRECTION_UP = 8, t.DIRECTION_HORIZONTAL = 6, t.DIRECTION_VERTICAL = oh, t.DIRECTION_NONE = 1, t.DIRECTION_DOWN = nh, t.INPUT_START = 1, t.INPUT_MOVE = 2, t.INPUT_END = 4, t.INPUT_CANCEL = 8, t.STATE_POSSIBLE = 1, t.STATE_BEGAN = 2, t.STATE_CHANGED = 4, t.STATE_ENDED = 8, t.STATE_RECOGNIZED = 8, t.STATE_CANCELLED = 16, t.STATE_FAILED = Yh, t.Manager = hl, t.Input = Eh, t.TouchAction = dh, t.TouchInput = Nh, t.MouseInput = Lh, t.PointerEventInput = Mh, t.TouchMouseInput = Vh, t.SingleTouchInput = ul, t.Recognizer = $h, t.AttrRecognizer = Qh, t.Tap = Zh, t.Pan = tl, t.Swipe = el, t.Pinch = il, t.Rotate = nl, t.Press = ol, t.on = kh, t.off = _h, t.each = ah, t.merge = gl, t.extend = vl, t.bindFn = ml, t.assign = Aa, t.inherit = yl, t.bindFn = ml, t.prefixed = Wa, t.toArray = Ph, t.inArray = Oh, t.uniqueArray = Ih, t.splitStr = wh, t.boolOrFn = hh, t.hasParent = ch, t.addEventListeners = kh, t.removeEventListeners = _h, t.defaults = Aa({}, rl, { preset: sl }), t }(); var wl = "undefined" != typeof window ? window.Hammer || bl : function () { return { on: t = function () { }, off: t, destroy: t, emit: t, get: function () { return { set: t } } }; var t }, kl = Object.freeze({ __proto__: null, default: wl }); function _l(t) { var e, i, n = this; this.active = !1, this.dom = { container: t }, this.dom.overlay = document.createElement("div"), this.dom.overlay.className = "vis-overlay", this.dom.container.appendChild(this.dom.overlay), this.hammer = wl(this.dom.overlay), this.hammer.on("tap", Z(e = this._onTapOverlay).call(e, this)); var o = ["tap", "doubletap", "press", "pinch", "pan", "panstart", "panmove", "panend"]; Yn(o).call(o, (function (t) { n.hammer.on(t, (function (t) { t.srcEvent.stopPropagation() })) })), document && document.body && (this.onClick = function (e) { (function (t, e) { for (; t;) { if (t === e) return !0; t = t.parentNode } return !1 })(e.target, t) || n.deactivate() }, document.body.addEventListener("click", this.onClick)), void 0 !== this.keycharm && this.keycharm.destroy(), this.keycharm = Ma(), this.escListener = Z(i = this.deactivate).call(i, this) } Ot(_l.prototype), _l.current = null, _l.prototype.destroy = function () { this.deactivate(), this.dom.overlay.parentNode.removeChild(this.dom.overlay), this.onClick && document.body.removeEventListener("click", this.onClick), void 0 !== this.keycharm && this.keycharm.destroy(), this.keycharm = null, this.hammer.destroy(), this.hammer = null }, _l.prototype.activate = function () { var t; _l.current && _l.current.deactivate(), _l.current = this, this.active = !0, this.dom.overlay.style.display = "none", os(this.dom.container, "vis-active"), this.emit("change"), this.emit("activate"), Z(t = this.keycharm).call(t, "esc", this.escListener) }, _l.prototype.deactivate = function () { this.active = !1, this.dom.overlay.style.display = "block", rs(this.dom.container, "vis-active"), this.keycharm.unbind("esc", this.escListener), this.emit("change"), this.emit("deactivate") }, _l.prototype._onTapOverlay = function (t) { this.activate(), t.srcEvent.stopPropagation() }; var xl = Object.freeze({ __proto__: null, en: { addDescription: "Click in an empty space to place a new node.", addEdge: "Add Edge", addNode: "Add Node", back: "Back", createEdgeError: "Cannot link edges to a cluster.", del: "Delete selected", deleteClusterError: "Clusters cannot be deleted.", edgeDescription: "Click on a node and drag the edge to another node to connect them.", edit: "Edit", editClusterError: "Clusters cannot be edited.", editEdge: "Edit Edge", editEdgeDescription: "Click on the control points and drag them to a node to connect to it.", editNode: "Edit Node" }, de: { addDescription: "Klicke auf eine freie Stelle, um einen neuen Knoten zu plazieren.", addEdge: "Kante hinzufügen", addNode: "Knoten hinzufügen", back: "Zurück", createEdgeError: "Es ist nicht möglich, Kanten mit Clustern zu verbinden.", del: "Lösche Auswahl", deleteClusterError: "Cluster können nicht gelöscht werden.", edgeDescription: "Klicke auf einen Knoten und ziehe die Kante zu einem anderen Knoten, um diese zu verbinden.", edit: "Editieren", editClusterError: "Cluster können nicht editiert werden.", editEdge: "Kante editieren", editEdgeDescription: "Klicke auf die Verbindungspunkte und ziehe diese auf einen Knoten, um sie zu verbinden.", editNode: "Knoten editieren" }, es: { addDescription: "Haga clic en un lugar vacío para colocar un nuevo nodo.", addEdge: "Añadir arista", addNode: "Añadir nodo", back: "Atrás", createEdgeError: "No se puede conectar una arista a un grupo.", del: "Eliminar selección", deleteClusterError: "No es posible eliminar grupos.", edgeDescription: "Haga clic en un nodo y arrastre la arista hacia otro nodo para conectarlos.", edit: "Editar", editClusterError: "No es posible editar grupos.", editEdge: "Editar arista", editEdgeDescription: "Haga clic en un punto de control y arrastrelo a un nodo para conectarlo.", editNode: "Editar nodo" }, it: { addDescription: "Clicca per aggiungere un nuovo nodo", addEdge: "Aggiungi un vertice", addNode: "Aggiungi un nodo", back: "Indietro", createEdgeError: "Non si possono collegare vertici ad un cluster", del: "Cancella la selezione", deleteClusterError: "I cluster non possono essere cancellati", edgeDescription: "Clicca su un nodo e trascinalo ad un altro nodo per connetterli.", edit: "Modifica", editClusterError: "I clusters non possono essere modificati.", editEdge: "Modifica il vertice", editEdgeDescription: "Clicca sui Punti di controllo e trascinali ad un nodo per connetterli.", editNode: "Modifica il nodo" }, nl: { addDescription: "Klik op een leeg gebied om een nieuwe node te maken.", addEdge: "Link toevoegen", addNode: "Node toevoegen", back: "Terug", createEdgeError: "Kan geen link maken naar een cluster.", del: "Selectie verwijderen", deleteClusterError: "Clusters kunnen niet worden verwijderd.", edgeDescription: "Klik op een node en sleep de link naar een andere node om ze te verbinden.", edit: "Wijzigen", editClusterError: "Clusters kunnen niet worden aangepast.", editEdge: "Link wijzigen", editEdgeDescription: "Klik op de verbindingspunten en sleep ze naar een node om daarmee te verbinden.", editNode: "Node wijzigen" }, pt: { addDescription: "Clique em um espaço em branco para adicionar um novo nó", addEdge: "Adicionar aresta", addNode: "Adicionar nó", back: "Voltar", createEdgeError: "Não foi possível linkar arestas a um cluster.", del: "Remover selecionado", deleteClusterError: "Clusters não puderam ser removidos.", edgeDescription: "Clique em um nó e arraste a aresta até outro nó para conectá-los", edit: "Editar", editClusterError: "Clusters não puderam ser editados.", editEdge: "Editar aresta", editEdgeDescription: "Clique nos pontos de controle e os arraste para um nó para conectá-los", editNode: "Editar nó" }, ru: { addDescription: "Кликните в свободное место, чтобы добавить новый узел.", addEdge: "Добавить ребро", addNode: "Добавить узел", back: "Назад", createEdgeError: "Невозможно соединить ребра в кластер.", del: "Удалить выбранное", deleteClusterError: "Кластеры не могут быть удалены", edgeDescription: "Кликните на узел и протяните ребро к другому узлу, чтобы соединить их.", edit: "Редактировать", editClusterError: "Кластеры недоступны для редактирования.", editEdge: "Редактировать ребро", editEdgeDescription: "Кликните на контрольные точки и перетащите их в узел, чтобы подключиться к нему.", editNode: "Редактировать узел" }, cn: { addDescription: "单击空白处放置新节点。", addEdge: "添加连接线", addNode: "添加节点", back: "返回", createEdgeError: "无法将连接线连接到群集。", del: "删除选定", deleteClusterError: "无法删除群集。", edgeDescription: "单击某个节点并将该连接线拖动到另一个节点以连接它们。", edit: "编辑", editClusterError: "无法编辑群集。", editEdge: "编辑连接线", editEdgeDescription: "单击控制节点并将它们拖到节点上连接。", editNode: "编辑节点" }, uk: { addDescription: "Kлікніть на вільне місце, щоб додати новий вузол.", addEdge: "Додати край", addNode: "Додати вузол", back: "Назад", createEdgeError: "Не можливо об'єднати краї в групу.", del: "Видалити обране", deleteClusterError: "Групи не можуть бути видалені.", edgeDescription: "Клікніть на вузол і перетягніть край до іншого вузла, щоб їх з'єднати.", edit: "Редагувати", editClusterError: "Групи недоступні для редагування.", editEdge: "Редагувати край", editEdgeDescription: "Клікніть на контрольні точки і перетягніть їх у вузол, щоб підключитися до нього.", editNode: "Редагувати вузол" }, fr: { addDescription: "Cliquez dans un endroit vide pour placer un nœud.", addEdge: "Ajouter un lien", addNode: "Ajouter un nœud", back: "Retour", createEdgeError: "Impossible de créer un lien vers un cluster.", del: "Effacer la sélection", deleteClusterError: "Les clusters ne peuvent pas être effacés.", edgeDescription: "Cliquez sur un nœud et glissez le lien vers un autre nœud pour les connecter.", edit: "Éditer", editClusterError: "Les clusters ne peuvent pas être édités.", editEdge: "Éditer le lien", editEdgeDescription: "Cliquez sur les points de contrôle et glissez-les pour connecter un nœud.", editNode: "Éditer le nœud" }, cs: { addDescription: "Kluknutím do prázdného prostoru můžete přidat nový vrchol.", addEdge: "Přidat hranu", addNode: "Přidat vrchol", back: "Zpět", createEdgeError: "Nelze připojit hranu ke shluku.", del: "Smazat výběr", deleteClusterError: "Nelze mazat shluky.", edgeDescription: "Přetažením z jednoho vrcholu do druhého můžete spojit tyto vrcholy novou hranou.", edit: "Upravit", editClusterError: "Nelze upravovat shluky.", editEdge: "Upravit hranu", editEdgeDescription: "Přetažením kontrolního vrcholu hrany ji můžete připojit k jinému vrcholu.", editNode: "Upravit vrchol" } }); var El = function (t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }; function Ol(t, e) { for (var i = 0; i < e.length; i++) { var n = e[i]; n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), kn(t, n.key, n) } } var Sl = function (t, e, i) { return e && Ol(t.prototype, e), i && Ol(t, i), t }, Cl = function () { function t() { El(this, t), this.NUM_ITERATIONS = 4, this.image = new Image, this.canvas = document.createElement("canvas") } return Sl(t, [{ key: "init", value: function () { if (!this.initialized()) { this.src = this.image.src; var t = this.image.width, e = this.image.height; this.width = t, this.height = e; var i = Math.floor(e / 2), n = Math.floor(e / 4), o = Math.floor(e / 8), r = Math.floor(e / 16), s = Math.floor(t / 2), a = Math.floor(t / 4), h = Math.floor(t / 8), l = Math.floor(t / 16); this.canvas.width = 3 * a, this.canvas.height = i, this.coordinates = [[0, 0, s, i], [s, 0, a, n], [s, n, h, o], [5 * h, n, l, r]], this._fillMipMap() } } }, { key: "initialized", value: function () { return void 0 !== this.coordinates } }, { key: "_fillMipMap", value: function () { var t = this.canvas.getContext("2d"), e = this.coordinates[0]; t.drawImage(this.image, e[0], e[1], e[2], e[3]); for (var i = 1; i < this.NUM_ITERATIONS; i++) { var n = this.coordinates[i - 1], o = this.coordinates[i]; t.drawImage(this.canvas, n[0], n[1], n[2], n[3], o[0], o[1], o[2], o[3]) } } }, { key: "drawImageAtPosition", value: function (t, e, i, n, o, r) { if (this.initialized()) if (e > 2) { e *= .5; for (var s = 0; e > 2 && s < this.NUM_ITERATIONS;)e *= .5, s += 1; s >= this.NUM_ITERATIONS && (s = this.NUM_ITERATIONS - 1); var a = this.coordinates[s]; t.drawImage(this.canvas, a[0], a[1], a[2], a[3], i, n, o, r) } else t.drawImage(this.image, i, n, o, r) } }]), t }(), Tl = function () { function t(e) { El(this, t), this.images = {}, this.imageBroken = {}, this.callback = e } return Sl(t, [{ key: "_tryloadBrokenUrl", value: function (t, e, i) { void 0 !== t && void 0 !== i && (void 0 !== e ? (i.image.onerror = function () { console.error("Could not load brokenImage:", e) }, i.image.src = e) : console.warn("No broken url image defined")) } }, { key: "_redrawWithImage", value: function (t) { this.callback && this.callback(t) } }, { key: "load", value: function (t, e) { var i = this, n = this.images[t]; if (n) return n; var o = new Cl; return this.images[t] = o, o.image.onload = function () { i._fixImageCoordinates(o.image), o.init(), i._redrawWithImage(o) }, o.image.onerror = function () { console.error("Could not load image:", t), i._tryloadBrokenUrl(t, e, o) }, o.image.src = t, o } }, { key: "_fixImageCoordinates", value: function (t) { 0 === t.width && (document.body.appendChild(t), t.width = t.offsetWidth, t.height = t.offsetHeight, document.body.removeChild(t)) } }]), t }(), Dl = !r((function () { return Object.isExtensible(Object.preventExtensions({})) })), Ml = i((function (t) { var e = R.f, i = Zt("meta"), n = 0, o = Object.isExtensible || function () { return !0 }, r = function (t) { e(t, i, { value: { objectID: "O" + ++n, weakData: {} } }) }, s = t.exports = { REQUIRED: !1, fastKey: function (t, e) { if (!y(t)) return "symbol" == typeof t ? t : ("string" == typeof t ? "S" : "P") + t; if (!w(t, i)) { if (!o(t)) return "F"; if (!e) return "E"; r(t) } return t[i].objectID }, getWeakData: function (t, e) { if (!w(t, i)) { if (!o(t)) return !0; if (!e) return !1; r(t) } return t[i].weakData }, onFreeze: function (t) { return Dl && s.REQUIRED && o(t) && !w(t, i) && r(t), t } }; ht[i] = !0 })), Pl = (Ml.REQUIRED, Ml.fastKey, Ml.getWeakData, Ml.onFreeze, function (t, e) { this.stopped = t, this.result = e }), Il = function (t, e, i) { var n, o, r, s, a, h, l, d = i && i.that, c = !(!i || !i.AS_ENTRIES), u = !(!i || !i.IS_ITERATOR), f = !(!i || !i.INTERRUPTED), p = A(e, d, 1 + c + f), v = function (t) { return n && sn(n), new Pl(!0, t) }, g = function (t) { return c ? (F(t), f ? p(t[0], t[1], v) : p(t[0], t[1])) : f ? p(t, v) : p(t) }; if (u) n = t; else { if ("function" != typeof (o = nn(t))) throw TypeError("Target is not iterable"); if (dn(o)) { for (r = 0, s = it(t.length); s > r; r++)if ((a = g(t[r])) && a instanceof Pl) return a; return new Pl(!1) } n = o.call(t) } for (h = n.next; !(l = h.call(n)).done;) { try { a = g(l.value) } catch (t) { throw sn(n), t } if ("object" == typeof a && a && a instanceof Pl) return a } return new Pl(!1) }, Bl = function (t, e, i) { if (!(t instanceof e)) throw TypeError("Incorrect " + (i ? i + " " : "") + "invocation"); return t }, zl = R.f, Nl = Ve.forEach, Al = Re.set, Fl = Re.getterFor, jl = function (t, e, i) { var n, a = -1 !== t.indexOf("Map"), h = -1 !== t.indexOf("Weak"), l = a ? "set" : "add", d = o[t], c = d && d.prototype, u = {}; if (s && "function" == typeof d && (h || c.forEach && !r((function () { (new d).entries().next() })))) { n = e((function (e, i) { Al(Bl(e, n, t), { type: t, collection: new d }), null != i && Il(i, e[l], { that: e, AS_ENTRIES: a }) })); var f = Fl(t); Nl(["add", "clear", "delete", "forEach", "get", "has", "set", "keys", "values", "entries"], (function (t) { var e = "add" == t || "set" == t; !(t in c) || h && "clear" == t || L(n.prototype, t, (function (i, n) { var o = f(this).collection; if (!e && h && !y(i)) return "get" == t && void 0; var r = o[t](0 === i ? 0 : i, n); return e ? this : r })) })), h || zl(n.prototype, "size", { configurable: !0, get: function () { return f(this).collection.size } }) } else n = i.getConstructor(e, t, a, l), Ml.REQUIRED = !0; return Oe(n, t, !1, !0), u[t] = n, q({ global: !0, forced: !0 }, u), h || i.setStrong(n, t, a), n }, Rl = function (t, e, i) { for (var n in e) i && i.unsafe && t[n] ? t[n] = e[n] : le(t, n, e[n], i); return t }, Ll = fe("species"), Hl = R.f, Wl = Ml.fastKey, ql = Re.set, Vl = Re.getterFor, Ul = { getConstructor: function (t, e, i, n) { var o = t((function (t, r) { Bl(t, o, e), ql(t, { type: e, index: oe(null), first: void 0, last: void 0, size: 0 }), s || (t.size = 0), null != r && Il(r, t[n], { that: t, AS_ENTRIES: i }) })), r = Vl(e), a = function (t, e, i) { var n, o, a = r(t), l = h(t, e); return l ? l.value = i : (a.last = l = { index: o = Wl(e, !0), key: e, value: i, previous: n = a.last, next: void 0, removed: !1 }, a.first || (a.first = l), n && (n.next = l), s ? a.size++ : t.size++, "F" !== o && (a.index[o] = l)), t }, h = function (t, e) { var i, n = r(t), o = Wl(e); if ("F" !== o) return n.index[o]; for (i = n.first; i; i = i.next)if (i.key == e) return i }; return Rl(o.prototype, { clear: function () { for (var t = r(this), e = t.index, i = t.first; i;)i.removed = !0, i.previous && (i.previous = i.previous.next = void 0), delete e[i.index], i = i.next; t.first = t.last = void 0, s ? t.size = 0 : this.size = 0 }, delete: function (t) { var e = this, i = r(e), n = h(e, t); if (n) { var o = n.next, a = n.previous; delete i.index[n.index], n.removed = !0, a && (a.next = o), o && (o.previous = a), i.first == n && (i.first = o), i.last == n && (i.last = a), s ? i.size-- : e.size-- } return !!n }, forEach: function (t) { for (var e, i = r(this), n = A(t, arguments.length > 1 ? arguments[1] : void 0, 3); e = e ? e.next : i.first;)for (n(e.value, e.key, this); e && e.removed;)e = e.previous }, has: function (t) { return !!h(this, t) } }), Rl(o.prototype, i ? { get: function (t) { var e = h(this, t); return e && e.value }, set: function (t, e) { return a(this, 0 === t ? 0 : t, e) } } : { add: function (t) { return a(this, t = 0 === t ? 0 : t, t) } }), s && Hl(o.prototype, "size", { get: function () { return r(this).size } }), o }, setStrong: function (t, e, i) { var n = e + " Iterator", o = Vl(e), r = Vl(n); Wi(t, e, (function (t, e) { ql(this, { type: n, target: t, state: o(t), kind: e, last: void 0 }) }), (function () { for (var t = r(this), e = t.kind, i = t.last; i && i.removed;)i = i.previous; return t.target && (t.last = i = i ? i.next : t.state.first) ? "keys" == e ? { value: i.key, done: !1 } : "values" == e ? { value: i.value, done: !1 } : { value: [i.key, i.value], done: !1 } : (t.target = void 0, { value: void 0, done: !0 }) }), i ? "entries" : "values", !i, !0), function (t) { var e = Pt(t), i = R.f; s && e && !e[Ll] && i(e, Ll, { configurable: !0, get: function () { return this } }) }(e) } }, Yl = (jl("Map", (function (t) { return function () { return t(this, arguments.length ? arguments[0] : void 0) } }), Ul), z.Map), Xl = function () { function t() { El(this, t), this.clear(), this._defaultIndex = 0, this._groupIndex = 0, this._defaultGroups = [{ border: "#2B7CE9", background: "#97C2FC", highlight: { border: "#2B7CE9", background: "#D2E5FF" }, hover: { border: "#2B7CE9", background: "#D2E5FF" } }, { border: "#FFA500", background: "#FFFF00", highlight: { border: "#FFA500", background: "#FFFFA3" }, hover: { border: "#FFA500", background: "#FFFFA3" } }, { border: "#FA0A10", background: "#FB7E81", highlight: { border: "#FA0A10", background: "#FFAFB1" }, hover: { border: "#FA0A10", background: "#FFAFB1" } }, { border: "#41A906", background: "#7BE141", highlight: { border: "#41A906", background: "#A1EC76" }, hover: { border: "#41A906", background: "#A1EC76" } }, { border: "#E129F0", background: "#EB7DF4", highlight: { border: "#E129F0", background: "#F0B3F5" }, hover: { border: "#E129F0", background: "#F0B3F5" } }, { border: "#7C29F0", background: "#AD85E4", highlight: { border: "#7C29F0", background: "#D3BDF0" }, hover: { border: "#7C29F0", background: "#D3BDF0" } }, { border: "#C37F00", background: "#FFA807", highlight: { border: "#C37F00", background: "#FFCA66" }, hover: { border: "#C37F00", background: "#FFCA66" } }, { border: "#4220FB", background: "#6E6EFD", highlight: { border: "#4220FB", background: "#9B9BFD" }, hover: { border: "#4220FB", background: "#9B9BFD" } }, { border: "#FD5A77", background: "#FFC0CB", highlight: { border: "#FD5A77", background: "#FFD1D9" }, hover: { border: "#FD5A77", background: "#FFD1D9" } }, { border: "#4AD63A", background: "#C2FABC", highlight: { border: "#4AD63A", background: "#E6FFE3" }, hover: { border: "#4AD63A", background: "#E6FFE3" } }, { border: "#990000", background: "#EE0000", highlight: { border: "#BB0000", background: "#FF3333" }, hover: { border: "#BB0000", background: "#FF3333" } }, { border: "#FF6000", background: "#FF6000", highlight: { border: "#FF6000", background: "#FF6000" }, hover: { border: "#FF6000", background: "#FF6000" } }, { border: "#97C2FC", background: "#2B7CE9", highlight: { border: "#D2E5FF", background: "#2B7CE9" }, hover: { border: "#D2E5FF", background: "#2B7CE9" } }, { border: "#399605", background: "#255C03", highlight: { border: "#399605", background: "#255C03" }, hover: { border: "#399605", background: "#255C03" } }, { border: "#B70054", background: "#FF007E", highlight: { border: "#B70054", background: "#FF007E" }, hover: { border: "#B70054", background: "#FF007E" } }, { border: "#AD85E4", background: "#7C29F0", highlight: { border: "#D3BDF0", background: "#7C29F0" }, hover: { border: "#D3BDF0", background: "#7C29F0" } }, { border: "#4557FA", background: "#000EA1", highlight: { border: "#6E6EFD", background: "#000EA1" }, hover: { border: "#6E6EFD", background: "#000EA1" } }, { border: "#FFC0CB", background: "#FD5A77", highlight: { border: "#FFD1D9", background: "#FD5A77" }, hover: { border: "#FFD1D9", background: "#FD5A77" } }, { border: "#C2FABC", background: "#74D66A", highlight: { border: "#E6FFE3", background: "#74D66A" }, hover: { border: "#E6FFE3", background: "#74D66A" } }, { border: "#EE0000", background: "#990000", highlight: { border: "#FF3333", background: "#BB0000" }, hover: { border: "#FF3333", background: "#BB0000" } }], this.options = {}, this.defaultOptions = { useDefaultGroups: !0 }, mt(this.options, this.defaultOptions) } return Sl(t, [{ key: "setOptions", value: function (t) { var e = ["useDefaultGroups"]; if (void 0 !== t) for (var i in t) if (Object.prototype.hasOwnProperty.call(t, i) && -1 === To(e).call(e, i)) { var n = t[i]; this.add(i, n) } } }, { key: "clear", value: function () { this._groups = new Yl, this._groupNames = [] } }, { key: "get", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this._groups.get(t); if (void 0 === i && e) if (!1 === this.options.useDefaultGroups && this._groupNames.length > 0) { var n = this._groupIndex % this._groupNames.length; ++this._groupIndex, (i = {}).color = this._groups.get(this._groupNames[n]), this._groups.set(t, i) } else { var o = this._defaultIndex % this._defaultGroups.length; this._defaultIndex++, (i = {}).color = this._defaultGroups[o], this._groups.set(t, i) } return i } }, { key: "add", value: function (t, e) { return this._groups.has(t) || this._groupNames.push(t), this._groups.set(t, e), e } }]), t }(), Gl = [].slice, Kl = /MSIE .\./.test(oo), $l = function (t) { return function (e, i) { var n = arguments.length > 2, o = n ? Gl.call(arguments, 2) : void 0; return t(n ? function () { ("function" == typeof e ? e : Function(e)).apply(this, o) } : e, i) } }; q({ global: !0, bind: !0, forced: Kl }, { setTimeout: $l(o.setTimeout), setInterval: $l(o.setInterval) }); var Zl = z.setTimeout, Ql = Ve.some, Jl = zn("some"), td = jn("some"); q({ target: "Array", proto: !0, forced: !Jl || !td }, { some: function (t) { return Ql(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var ed = G("Array").some, id = Array.prototype, nd = function (t) { var e = t.some; return t === id || t instanceof Array && e === id.some ? ed : e }, od = o.isFinite, rd = Number.isFinite || function (t) { return "number" == typeof t && od(t) }; q({ target: "Number", stat: !0 }, { isFinite: rd }); var sd = z.Number.isFinite; q({ target: "Number", stat: !0 }, { isNaN: function (t) { return t != t } }); var ad = z.Number.isNaN; var hd = function (t) { if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return t }, ld = Pt("Reflect", "construct"), dd = r((function () { function t() { } return !(ld((function () { }), [], t) instanceof t) })), cd = !r((function () { ld((function () { })) })), ud = dd || cd; q({ target: "Reflect", stat: !0, forced: ud, sham: ud }, { construct: function (t, e) { N(t), F(e); var i = arguments.length < 3 ? t : N(arguments[2]); if (cd && !dd) return ld(t, e, i); if (t == i) { switch (e.length) { case 0: return new t; case 1: return new t(e[0]); case 2: return new t(e[0], e[1]); case 3: return new t(e[0], e[1], e[2]); case 4: return new t(e[0], e[1], e[2], e[3]) }var n = [null]; return n.push.apply(n, e), new (X.apply(t, n)) } var o = i.prototype, r = oe(y(o) ? o : Object.prototype), s = Function.apply.call(t, r, e); return y(s) ? s : r } }); var fd = z.Reflect.construct, pd = G("Array").entries, vd = Array.prototype, gd = { DOMTokenList: !0, NodeList: !0 }, yd = function (t) { var e = t.entries; return t === vd || t instanceof Array && e === vd.entries || gd.hasOwnProperty(ke(t)) ? pd : e }, md = Pt("JSON", "stringify"), bd = /[\uD800-\uDFFF]/g, wd = /^[\uD800-\uDBFF]$/, kd = /^[\uDC00-\uDFFF]$/, _d = function (t, e, i) { var n = i.charAt(e - 1), o = i.charAt(e + 1); return wd.test(t) && !kd.test(o) || kd.test(t) && !wd.test(n) ? "\\u" + t.charCodeAt(0).toString(16) : t }, xd = r((function () { return '"\\udf06\\ud834"' !== md("\udf06\ud834") || '"\\udead"' !== md("\udead") })); md && q({ target: "JSON", stat: !0, forced: xd }, { stringify: function (t, e, i) { var n = md.apply(null, arguments); return "string" == typeof n ? n.replace(bd, _d) : n } }), z.JSON || (z.JSON = { stringify: JSON.stringify }); var Ed = function (t, e, i) { return z.JSON.stringify.apply(null, arguments) }, Od = G("Array").values, Sd = Array.prototype, Cd = { DOMTokenList: !0, NodeList: !0 }, Td = function (t) { var e = t.values; return t === Sd || t instanceof Array && e === Sd.values || Cd.hasOwnProperty(ke(t)) ? Od : e }, Dd = G("Array").keys, Md = Array.prototype, Pd = { DOMTokenList: !0, NodeList: !0 }, Id = function (t) { var e = t.keys; return t === Md || t instanceof Array && e === Md.keys || Pd.hasOwnProperty(ke(t)) ? Dd : e }, Bd = bn; q({ target: "Object", stat: !0 }, { setPrototypeOf: zi }); var zd = z.Object.setPrototypeOf, Nd = i((function (t) { function e(i, n) { return t.exports = e = zd || function (t, e) { return t.__proto__ = e, t }, e(i, n) } t.exports = e })); var Ad = function (t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Bd(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), e && Nd(t, e) }; var Fd = function (t, e) { return !e || "object" !== vr(e) && "function" != typeof e ? hd(t) : e }, jd = bo, Rd = i((function (t) { function e(i) { return t.exports = e = zd ? jd : function (t) { return t.__proto__ || jd(t) }, e(i) } t.exports = e })), Ld = [], Hd = Ld.sort, Wd = r((function () { Ld.sort(void 0) })), qd = r((function () { Ld.sort(null) })), Vd = zn("sort"); q({ target: "Array", proto: !0, forced: Wd || !qd || !Vd }, { sort: function (t) { return void 0 === t ? Hd.call(pt(this)) : Hd.call(pt(this), N(t)) } }); var Ud = G("Array").sort, Yd = Array.prototype, Xd = function (t) { var e = t.sort; return t === Yd || t instanceof Array && e === Yd.sort ? Ud : e }, Gd = (jl("Set", (function (t) { return function () { return t(this, arguments.length ? arguments[0] : void 0) } }), Ul), z.Set), Kd = i((function (t) { var e = function (t) { var e, i = Object.prototype, n = i.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, r = o.iterator || "@@iterator", s = o.asyncIterator || "@@asyncIterator", a = o.toStringTag || "@@toStringTag"; function h(t, e, i) { return Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }), t[e] } try { h({}, "") } catch (t) { h = function (t, e, i) { return t[e] = i } } function l(t, e, i, n) { var o = e && e.prototype instanceof g ? e : g, r = Object.create(o.prototype), s = new T(n || []); return r._invoke = function (t, e, i) { var n = c; return function (o, r) { if (n === f) throw new Error("Generator is already running"); if (n === p) { if ("throw" === o) throw r; return M() } for (i.method = o, i.arg = r; ;) { var s = i.delegate; if (s) { var a = O(s, i); if (a) { if (a === v) continue; return a } } if ("next" === i.method) i.sent = i._sent = i.arg; else if ("throw" === i.method) { if (n === c) throw n = p, i.arg; i.dispatchException(i.arg) } else "return" === i.method && i.abrupt("return", i.arg); n = f; var h = d(t, e, i); if ("normal" === h.type) { if (n = i.done ? p : u, h.arg === v) continue; return { value: h.arg, done: i.done } } "throw" === h.type && (n = p, i.method = "throw", i.arg = h.arg) } } }(t, i, s), r } function d(t, e, i) { try { return { type: "normal", arg: t.call(e, i) } } catch (t) { return { type: "throw", arg: t } } } t.wrap = l; var c = "suspendedStart", u = "suspendedYield", f = "executing", p = "completed", v = {}; function g() { } function y() { } function m() { } var b = {}; b[r] = function () { return this }; var w = Object.getPrototypeOf, k = w && w(w(D([]))); k && k !== i && n.call(k, r) && (b = k); var _ = m.prototype = g.prototype = Object.create(b); function x(t) { ["next", "throw", "return"].forEach((function (e) { h(t, e, (function (t) { return this._invoke(e, t) })) })) } function E(t, e) { function i(o, r, s, a) { var h = d(t[o], t, r); if ("throw" !== h.type) { var l = h.arg, c = l.value; return c && "object" == typeof c && n.call(c, "__await") ? e.resolve(c.__await).then((function (t) { i("next", t, s, a) }), (function (t) { i("throw", t, s, a) })) : e.resolve(c).then((function (t) { l.value = t, s(l) }), (function (t) { return i("throw", t, s, a) })) } a(h.arg) } var o; this._invoke = function (t, n) { function r() { return new e((function (e, o) { i(t, n, e, o) })) } return o = o ? o.then(r, r) : r() } } function O(t, i) { var n = t.iterator[i.method]; if (n === e) { if (i.delegate = null, "throw" === i.method) { if (t.iterator.return && (i.method = "return", i.arg = e, O(t, i), "throw" === i.method)) return v; i.method = "throw", i.arg = new TypeError("The iterator does not provide a 'throw' method") } return v } var o = d(n, t.iterator, i.arg); if ("throw" === o.type) return i.method = "throw", i.arg = o.arg, i.delegate = null, v; var r = o.arg; return r ? r.done ? (i[t.resultName] = r.value, i.next = t.nextLoc, "return" !== i.method && (i.method = "next", i.arg = e), i.delegate = null, v) : r : (i.method = "throw", i.arg = new TypeError("iterator result is not an object"), i.delegate = null, v) } function S(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e) } function C(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e } function T(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(S, this), this.reset(!0) } function D(t) { if (t) { var i = t[r]; if (i) return i.call(t); if ("function" == typeof t.next) return t; if (!isNaN(t.length)) { var o = -1, s = function i() { for (; ++o < t.length;)if (n.call(t, o)) return i.value = t[o], i.done = !1, i; return i.value = e, i.done = !0, i }; return s.next = s } } return { next: M } } function M() { return { value: e, done: !0 } } return y.prototype = _.constructor = m, m.constructor = y, y.displayName = h(m, a, "GeneratorFunction"), t.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === y || "GeneratorFunction" === (e.displayName || e.name)) }, t.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, m) : (t.__proto__ = m, h(t, a, "GeneratorFunction")), t.prototype = Object.create(_), t }, t.awrap = function (t) { return { __await: t } }, x(E.prototype), E.prototype[s] = function () { return this }, t.AsyncIterator = E, t.async = function (e, i, n, o, r) { void 0 === r && (r = Promise); var s = new E(l(e, i, n, o), r); return t.isGeneratorFunction(i) ? s : s.next().then((function (t) { return t.done ? t.value : s.next() })) }, x(_), h(_, a, "Generator"), _[r] = function () { return this }, _.toString = function () { return "[object Generator]" }, t.keys = function (t) { var e = []; for (var i in t) e.push(i); return e.reverse(), function i() { for (; e.length;) { var n = e.pop(); if (n in t) return i.value = n, i.done = !1, i } return i.done = !0, i } }, t.values = D, T.prototype = { constructor: T, reset: function (t) { if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(C), !t) for (var i in this) "t" === i.charAt(0) && n.call(this, i) && !isNaN(+i.slice(1)) && (this[i] = e) }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval }, dispatchException: function (t) { if (this.done) throw t; var i = this; function o(n, o) { return a.type = "throw", a.arg = t, i.next = n, o && (i.method = "next", i.arg = e), !!o } for (var r = this.tryEntries.length - 1; r >= 0; --r) { var s = this.tryEntries[r], a = s.completion; if ("root" === s.tryLoc) return o("end"); if (s.tryLoc <= this.prev) { var h = n.call(s, "catchLoc"), l = n.call(s, "finallyLoc"); if (h && l) { if (this.prev < s.catchLoc) return o(s.catchLoc, !0); if (this.prev < s.finallyLoc) return o(s.finallyLoc) } else if (h) { if (this.prev < s.catchLoc) return o(s.catchLoc, !0) } else { if (!l) throw new Error("try statement without catch or finally"); if (this.prev < s.finallyLoc) return o(s.finallyLoc) } } } }, abrupt: function (t, e) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var o = this.tryEntries[i]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var r = o; break } } r && ("break" === t || "continue" === t) && r.tryLoc <= e && e <= r.finallyLoc && (r = null); var s = r ? r.completion : {}; return s.type = t, s.arg = e, r ? (this.method = "next", this.next = r.finallyLoc, v) : this.complete(s) }, complete: function (t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), v }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var i = this.tryEntries[e]; if (i.finallyLoc === t) return this.complete(i.completion, i.afterLoc), C(i), v } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var i = this.tryEntries[e]; if (i.tryLoc === t) { var n = i.completion; if ("throw" === n.type) { var o = n.arg; C(i) } return o } } throw new Error("illegal catch attempt") }, delegateYield: function (t, i, n) { return this.delegate = { iterator: D(t), resultName: i, nextLoc: n }, "next" === this.method && (this.arg = e), v } }, t }(t.exports); try { regeneratorRuntime = e } catch (t) { Function("r", "regeneratorRuntime = r")(e) } })), $d = fr, Zd = function (t, e, i, n, o, r, s, a) { for (var h, l = o, d = 0, c = !!s && A(s, a, 3); d < n;) { if (d in i) { if (h = c ? c(i[d], d, e) : i[d], r > 0 && Vt(h)) l = Zd(t, e, h, it(h.length), l, r - 1) - 1; else { if (l >= 9007199254740991) throw TypeError("Exceed the acceptable array length"); t[l] = h } l++ } d++ } return l }, Qd = Zd; q({ target: "Array", proto: !0 }, { flatMap: function (t) { var e, i = pt(this), n = it(i.length); return N(t), (e = He(i, 0)).length = Qd(e, i, i, n, 0, 1, t, arguments.length > 1 ? arguments[1] : void 0), e } }); var Jd = G("Array").flatMap, tc = Array.prototype, ec = function (t) { var e = t.flatMap; return t === tc || t instanceof Array && e === tc.flatMap ? Jd : e }, ic = function (t) { return function (e, i, n, o) { N(i); var r = pt(e), s = p(r), a = it(r.length), h = t ? a - 1 : 0, l = t ? -1 : 1; if (n < 2) for (; ;) { if (h in s) { o = s[h], h += l; break } if (h += l, t ? h < 0 : a <= h) throw TypeError("Reduce of empty array with no initial value") } for (; t ? h >= 0 : a > h; h += l)h in s && (o = i(o, s[h], h, r)); return o } }, nc = { left: ic(!1), right: ic(!0) }, oc = "process" == u(o.process), rc = nc.left, sc = zn("reduce"), ac = jn("reduce", { 1: 0 }); q({ target: "Array", proto: !0, forced: !sc || !ac || !oc && ho > 79 && ho < 83 }, { reduce: function (t) { return rc(this, t, arguments.length, arguments.length > 1 ? arguments[1] : void 0) } }); var hc = G("Array").reduce, lc = Array.prototype, dc = function (t) { var e = t.reduce; return t === lc || t instanceof Array && e === lc.reduce ? hc : e }, cc = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto), uc = new Uint8Array(16); function fc() { if (!cc) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); return cc(uc) } var pc = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i; function vc(t) { return "string" == typeof t && pc.test(t) } for (var gc = [], yc = 0; yc < 256; ++yc)gc.push((yc + 256).toString(16).substr(1)); function mc(t, e, i) { var n = (t = t || {}).random || (t.rng || fc)(); if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, e) { i = i || 0; for (var o = 0; o < 16; ++o)e[i + o] = n[o]; return e } return function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0, i = (gc[t[e + 0]] + gc[t[e + 1]] + gc[t[e + 2]] + gc[t[e + 3]] + "-" + gc[t[e + 4]] + gc[t[e + 5]] + "-" + gc[t[e + 6]] + gc[t[e + 7]] + "-" + gc[t[e + 8]] + gc[t[e + 9]] + "-" + gc[t[e + 10]] + gc[t[e + 11]] + gc[t[e + 12]] + gc[t[e + 13]] + gc[t[e + 14]] + gc[t[e + 15]]).toLowerCase(); if (!vc(i)) throw TypeError("Stringified UUID is invalid"); return i }(n) } function bc(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function wc(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = bc(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = bc(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } function kc(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } function _c(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return xc(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return xc(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function xc(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } var Ec = function () { function t(e, i, n) { var o, r, s; El(this, t), this._source = e, this._transformers = i, this._target = n, this._listeners = { add: Z(o = this._add).call(o, this), remove: Z(r = this._remove).call(r, this), update: Z(s = this._update).call(s, this) } } return Sl(t, [{ key: "all", value: function () { return this._target.update(this._transformItems(this._source.get())), this } }, { key: "start", value: function () { return this._source.on("add", this._listeners.add), this._source.on("remove", this._listeners.remove), this._source.on("update", this._listeners.update), this } }, { key: "stop", value: function () { return this._source.off("add", this._listeners.add), this._source.off("remove", this._listeners.remove), this._source.off("update", this._listeners.update), this } }, { key: "_transformItems", value: function (t) { var e; return dc(e = this._transformers).call(e, (function (t, e) { return e(t) }), t) } }, { key: "_add", value: function (t, e) { null != e && this._target.add(this._transformItems(this._source.get(e.items))) } }, { key: "_update", value: function (t, e) { null != e && this._target.update(this._transformItems(this._source.get(e.items))) } }, { key: "_remove", value: function (t, e) { null != e && this._target.remove(this._transformItems(e.oldData)) } }]), t }(), Oc = function () { function t(e) { El(this, t), this._source = e, this._transformers = [] } return Sl(t, [{ key: "filter", value: function (t) { return this._transformers.push((function (e) { return yo(e).call(e, t) })), this } }, { key: "map", value: function (t) { return this._transformers.push((function (e) { return cr(e).call(e, t) })), this } }, { key: "flatMap", value: function (t) { return this._transformers.push((function (e) { return ec(e).call(e, t) })), this } }, { key: "to", value: function (t) { return new Ec(this._source, this._transformers, t) } }]), t }(); function Sc(t) { return "string" == typeof t || "number" == typeof t } var Cc = function () { function t(e) { El(this, t), this._queue = [], this._timeout = null, this._extended = null, this.delay = null, this.max = 1 / 0, this.setOptions(e) } return Sl(t, [{ key: "setOptions", value: function (t) { t && void 0 !== t.delay && (this.delay = t.delay), t && void 0 !== t.max && (this.max = t.max), this._flushIfNeeded() } }, { key: "destroy", value: function () { if (this.flush(), this._extended) { for (var t = this._extended.object, e = this._extended.methods, i = 0; i < e.length; i++) { var n = e[i]; n.original ? t[n.name] = n.original : delete t[n.name] } this._extended = null } } }, { key: "replace", value: function (t, e) { var i = this, n = t[e]; if (!n) throw new Error("Method " + e + " undefined"); t[e] = function () { for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++)e[o] = arguments[o]; i.queue({ args: e, fn: n, context: this }) } } }, { key: "queue", value: function (t) { "function" == typeof t ? this._queue.push({ fn: t }) : this._queue.push(t), this._flushIfNeeded() } }, { key: "_flushIfNeeded", value: function () { var t = this; this._queue.length > this.max && this.flush(), null != this._timeout && (clearTimeout(this._timeout), this._timeout = null), this.queue.length > 0 && "number" == typeof this.delay && (this._timeout = Zl((function () { t.flush() }), this.delay)) } }, { key: "flush", value: function () { var t, e; Yn(t = Fs(e = this._queue).call(e, 0)).call(t, (function (t) { t.fn.apply(t.context || t.fn, t.args || []) })) } }], [{ key: "extend", value: function (e, i) { var n = new t(i); if (void 0 !== e.flush) throw new Error("Target object already has a property flush"); e.flush = function () { n.flush() }; var o = [{ name: "flush", original: void 0 }]; if (i && i.replace) for (var r = 0; r < i.replace.length; r++) { var s = i.replace[r]; o.push({ name: s, original: e[s] }), n.replace(e, s) } return n._extended = { object: e, methods: o }, n } }]), t }(), Tc = function () { function t() { El(this, t), this._subscribers = { "*": [], add: [], remove: [], update: [] }, this.subscribe = t.prototype.on, this.unsubscribe = t.prototype.off } return Sl(t, [{ key: "_trigger", value: function (t, e, i) { var n, o; if ("*" === t) throw new Error("Cannot trigger event *"); Yn(n = Er(o = []).call(o, kr(this._subscribers[t]), kr(this._subscribers["*"]))).call(n, (function (n) { n(t, e, null != i ? i : null) })) } }, { key: "on", value: function (t, e) { "function" == typeof e && this._subscribers[t].push(e) } }, { key: "off", value: function (t, e) { var i; this._subscribers[t] = yo(i = this._subscribers[t]).call(i, (function (t) { return t !== e })) } }]), t }(), Dc = function () { function t(e) { El(this, t), this._pairs = e } return Sl(t, [{ key: $d, value: Kd.mark((function t() { var e, i, n, o, r; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: e = _c(this._pairs), t.prev = 1, e.s(); case 3: if ((i = e.n()).done) { t.next = 9; break } return n = ir(i.value, 2), o = n[0], r = n[1], t.next = 7, [o, r]; case 7: t.next = 3; break; case 9: t.next = 14; break; case 11: t.prev = 11, t.t0 = t.catch(1), e.e(t.t0); case 14: return t.prev = 14, e.f(), t.finish(14); case 17: case "end": return t.stop() } }), t, this, [[1, 11, 14, 17]]) })) }, { key: "entries", value: Kd.mark((function t() { var e, i, n, o, r; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: e = _c(this._pairs), t.prev = 1, e.s(); case 3: if ((i = e.n()).done) { t.next = 9; break } return n = ir(i.value, 2), o = n[0], r = n[1], t.next = 7, [o, r]; case 7: t.next = 3; break; case 9: t.next = 14; break; case 11: t.prev = 11, t.t0 = t.catch(1), e.e(t.t0); case 14: return t.prev = 14, e.f(), t.finish(14); case 17: case "end": return t.stop() } }), t, this, [[1, 11, 14, 17]]) })) }, { key: "keys", value: Kd.mark((function t() { var e, i, n, o; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: e = _c(this._pairs), t.prev = 1, e.s(); case 3: if ((i = e.n()).done) { t.next = 9; break } return n = ir(i.value, 1), o = n[0], t.next = 7, o; case 7: t.next = 3; break; case 9: t.next = 14; break; case 11: t.prev = 11, t.t0 = t.catch(1), e.e(t.t0); case 14: return t.prev = 14, e.f(), t.finish(14); case 17: case "end": return t.stop() } }), t, this, [[1, 11, 14, 17]]) })) }, { key: "values", value: Kd.mark((function t() { var e, i, n, o; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: e = _c(this._pairs), t.prev = 1, e.s(); case 3: if ((i = e.n()).done) { t.next = 9; break } return n = ir(i.value, 2), o = n[1], t.next = 7, o; case 7: t.next = 3; break; case 9: t.next = 14; break; case 11: t.prev = 11, t.t0 = t.catch(1), e.e(t.t0); case 14: return t.prev = 14, e.f(), t.finish(14); case 17: case "end": return t.stop() } }), t, this, [[1, 11, 14, 17]]) })) }, { key: "toIdArray", value: function () { var t; return cr(t = kr(this._pairs)).call(t, (function (t) { return t[0] })) } }, { key: "toItemArray", value: function () { var t; return cr(t = kr(this._pairs)).call(t, (function (t) { return t[1] })) } }, { key: "toEntryArray", value: function () { return kr(this._pairs) } }, { key: "toObjectMap", value: function () { var t, e = wn(null), i = _c(this._pairs); try { for (i.s(); !(t = i.n()).done;) { var n = ir(t.value, 2), o = n[0], r = n[1]; e[o] = r } } catch (t) { i.e(t) } finally { i.f() } return e } }, { key: "toMap", value: function () { return new Yl(this._pairs) } }, { key: "toIdSet", value: function () { return new Gd(this.toIdArray()) } }, { key: "toItemSet", value: function () { return new Gd(this.toItemArray()) } }, { key: "cache", value: function () { return new t(kr(this._pairs)) } }, { key: "distinct", value: function (t) { var e, i = new Gd, n = _c(this._pairs); try { for (n.s(); !(e = n.n()).done;) { var o = ir(e.value, 2), r = o[0], s = o[1]; i.add(t(s, r)) } } catch (t) { n.e(t) } finally { n.f() } return i } }, { key: "filter", value: function (e) { var i = this._pairs; return new t(xn({}, $d, Kd.mark((function t() { var n, o, r, s, a; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: n = _c(i), t.prev = 1, n.s(); case 3: if ((o = n.n()).done) { t.next = 10; break } if (r = ir(o.value, 2), s = r[0], a = r[1], !e(a, s)) { t.next = 8; break } return t.next = 8, [s, a]; case 8: t.next = 3; break; case 10: t.next = 15; break; case 12: t.prev = 12, t.t0 = t.catch(1), n.e(t.t0); case 15: return t.prev = 15, n.f(), t.finish(15); case 18: case "end": return t.stop() } }), t, null, [[1, 12, 15, 18]]) })))) } }, { key: "forEach", value: function (t) { var e, i = _c(this._pairs); try { for (i.s(); !(e = i.n()).done;) { var n = ir(e.value, 2), o = n[0]; t(n[1], o) } } catch (t) { i.e(t) } finally { i.f() } } }, { key: "map", value: function (e) { var i = this._pairs; return new t(xn({}, $d, Kd.mark((function t() { var n, o, r, s, a; return Kd.wrap((function (t) { for (; ;)switch (t.prev = t.next) { case 0: n = _c(i), t.prev = 1, n.s(); case 3: if ((o = n.n()).done) { t.next = 9; break } return r = ir(o.value, 2), s = r[0], a = r[1], t.next = 7, [s, e(a, s)]; case 7: t.next = 3; break; case 9: t.next = 14; break; case 11: t.prev = 11, t.t0 = t.catch(1), n.e(t.t0); case 14: return t.prev = 14, n.f(), t.finish(14); case 17: case "end": return t.stop() } }), t, null, [[1, 11, 14, 17]]) })))) } }, { key: "max", value: function (t) { var e = on(this._pairs), i = e.next(); if (i.done) return null; for (var n = i.value[1], o = t(i.value[1], i.value[0]); !(i = e.next()).done;) { var r = ir(i.value, 2), s = r[0], a = r[1], h = t(a, s); h > o && (o = h, n = a) } return n } }, { key: "min", value: function (t) { var e = on(this._pairs), i = e.next(); if (i.done) return null; for (var n = i.value[1], o = t(i.value[1], i.value[0]); !(i = e.next()).done;) { var r = ir(i.value, 2), s = r[0], a = r[1], h = t(a, s); h < o && (o = h, n = a) } return n } }, { key: "reduce", value: function (t, e) { var i, n = _c(this._pairs); try { for (n.s(); !(i = n.n()).done;) { var o = ir(i.value, 2), r = o[0]; e = t(e, o[1], r) } } catch (t) { n.e(t) } finally { n.f() } return e } }, { key: "sort", value: function (e) { var i = this; return new t(xn({}, $d, (function () { var t; return on(Xd(t = kr(i._pairs)).call(t, (function (t, i) { var n = ir(t, 2), o = n[0], r = n[1], s = ir(i, 2), a = s[0], h = s[1]; return e(r, h, o, a) }))) }))) } }]), t }(); var Mc = function (t) { Ad(i, t); var e = kc(i); function i(t, n) { var o; return El(this, i), (o = e.call(this))._queue = null, t && !ur(t) && (n = t, t = []), o._options = n || {}, o._data = new Yl, o.length = 0, o._idProp = o._options.fieldId || "id", t && t.length && o.add(t), o.setOptions(n), o } return Sl(i, [{ key: "setOptions", value: function (t) { t && void 0 !== t.queue && (!1 === t.queue ? this._queue && (this._queue.destroy(), this._queue = null) : (this._queue || (this._queue = Cc.extend(this, { replace: ["add", "update", "remove"] })), t.queue && "object" === vr(t.queue) && this._queue.setOptions(t.queue))) } }, { key: "add", value: function (t, e) { var i, n = this, o = []; if (ur(t)) { var r = cr(t).call(t, (function (t) { return t[n._idProp] })); if (nd(r).call(r, (function (t) { return n._data.has(t) }))) throw new Error("A duplicate id was found in the parameter array."); for (var s = 0, a = t.length; s < a; s++)i = this._addItem(t[s]), o.push(i) } else { if (!t || "object" !== vr(t)) throw new Error("Unknown dataType"); i = this._addItem(t), o.push(i) } return o.length && this._trigger("add", { items: o }, e), o } }, { key: "update", value: function (t, e) { var i = this, n = [], o = [], r = [], s = [], a = this._idProp, h = function (t) { var e = t[a]; if (null != e && i._data.has(e)) { var h = t, l = mt({}, i._data.get(e)), d = i._updateItem(h); o.push(d), s.push(h), r.push(l) } else { var c = i._addItem(t); n.push(c) } }; if (ur(t)) for (var l = 0, d = t.length; l < d; l++)t[l] && "object" === vr(t[l]) ? h(t[l]) : console.warn("Ignoring input item, which is not an object at index " + l); else { if (!t || "object" !== vr(t)) throw new Error("Unknown dataType"); h(t) } if (n.length && this._trigger("add", { items: n }, e), o.length) { var c = { items: o, oldData: r, data: s }; this._trigger("update", c, e) } return Er(n).call(n, o) } }, { key: "updateOnly", value: function (t, e) { var i, n = this; ur(t) || (t = [t]); var o = cr(i = cr(t).call(t, (function (t) { var e = n._data.get(t[n._idProp]); if (null == e) throw new Error("Updating non-existent items is not allowed."); return { oldData: e, update: t } }))).call(i, (function (t) { var e = t.oldData, i = t.update, o = e[n._idProp], r = Pr(e, i); return n._data.set(o, r), { id: o, oldData: e, updatedData: r } })); if (o.length) { var r = { items: cr(o).call(o, (function (t) { return t.id })), oldData: cr(o).call(o, (function (t) { return t.oldData })), data: cr(o).call(o, (function (t) { return t.updatedData })) }; return this._trigger("update", r, e), r.items } return [] } }, { key: "get", value: function (t, e) { var i = void 0, n = void 0, o = void 0; Sc(t) ? (i = t, o = e) : ur(t) ? (n = t, o = e) : o = t; var r, s = o && "Object" === o.returnType ? "Object" : "Array", a = o && yo(o), h = [], l = void 0, d = void 0, c = void 0; if (null != i) (l = this._data.get(i)) && a && !a(l) && (l = void 0); else if (null != n) for (var u = 0, f = n.length; u < f; u++)null == (l = this._data.get(n[u])) || a && !a(l) || h.push(l); else for (var p, v = 0, g = (d = kr(Id(p = this._data).call(p))).length; v < g; v++)c = d[v], null == (l = this._data.get(c)) || a && !a(l) || h.push(l); if (o && o.order && null == i && this._sort(h, o.order), o && o.fields) { var y = o.fields; if (null != i && null != l) l = this._filterFields(l, y); else for (var m = 0, b = h.length; m < b; m++)h[m] = this._filterFields(h[m], y) } if ("Object" == s) { for (var w = {}, k = 0, _ = h.length; k < _; k++) { var x = h[k]; w[x[this._idProp]] = x } return w } return null != i ? null !== (r = l) && void 0 !== r ? r : null : h } }, { key: "getIds", value: function (t) { var e = this._data, i = t && yo(t), n = t && t.order, o = kr(Id(e).call(e)), r = []; if (i) if (n) { for (var s = [], a = 0, h = o.length; a < h; a++) { var l = o[a], d = this._data.get(l); null != d && i(d) && s.push(d) } this._sort(s, n); for (var c = 0, u = s.length; c < u; c++)r.push(s[c][this._idProp]) } else for (var f = 0, p = o.length; f < p; f++) { var v = o[f], g = this._data.get(v); null != g && i(g) && r.push(g[this._idProp]) } else if (n) { for (var y = [], m = 0, b = o.length; m < b; m++) { var w = o[m]; y.push(e.get(w)) } this._sort(y, n); for (var k = 0, _ = y.length; k < _; k++)r.push(y[k][this._idProp]) } else for (var x = 0, E = o.length; x < E; x++) { var O = o[x], S = e.get(O); null != S && r.push(S[this._idProp]) } return r } }, { key: "getDataSet", value: function () { return this } }, { key: "forEach", value: function (t, e) { var i = e && yo(e), n = this._data, o = kr(Id(n).call(n)); if (e && e.order) for (var r = this.get(e), s = 0, a = r.length; s < a; s++) { var h = r[s]; t(h, h[this._idProp]) } else for (var l = 0, d = o.length; l < d; l++) { var c = o[l], u = this._data.get(c); null == u || i && !i(u) || t(u, c) } } }, { key: "map", value: function (t, e) { for (var i = e && yo(e), n = [], o = this._data, r = kr(Id(o).call(o)), s = 0, a = r.length; s < a; s++) { var h = r[s], l = this._data.get(h); null == l || i && !i(l) || n.push(t(l, h)) } return e && e.order && this._sort(n, e.order), n } }, { key: "_filterFields", value: function (t, e) { var i; return t ? dc(i = ur(e) ? e : rr(e)).call(i, (function (e, i) { return e[i] = t[i], e }), {}) : t } }, { key: "_sort", value: function (t, e) { if ("string" == typeof e) { var i = e; Xd(t).call(t, (function (t, e) { var n = t[i], o = e[i]; return n > o ? 1 : n < o ? -1 : 0 })) } else { if ("function" != typeof e) throw new TypeError("Order must be a function or a string"); Xd(t).call(t, e) } } }, { key: "remove", value: function (t, e) { for (var i = [], n = [], o = ur(t) ? t : [t], r = 0, s = o.length; r < s; r++) { var a = this._remove(o[r]); if (a) { var h = a[this._idProp]; null != h && (i.push(h), n.push(a)) } } return i.length && this._trigger("remove", { items: i, oldData: n }, e), i } }, { key: "_remove", value: function (t) { var e; if (Sc(t) ? e = t : t && "object" === vr(t) && (e = t[this._idProp]), null != e && this._data.has(e)) { var i = this._data.get(e) || null; return this._data.delete(e), --this.length, i } return null } }, { key: "clear", value: function (t) { for (var e, i = kr(Id(e = this._data).call(e)), n = [], o = 0, r = i.length; o < r; o++)n.push(this._data.get(i[o])); return this._data.clear(), this.length = 0, this._trigger("remove", { items: i, oldData: n }, t), i } }, { key: "max", value: function (t) { var e, i, n = null, o = null, r = _c(Td(e = this._data).call(e)); try { for (r.s(); !(i = r.n()).done;) { var s = i.value, a = s[t]; "number" == typeof a && (null == o || a > o) && (n = s, o = a) } } catch (t) { r.e(t) } finally { r.f() } return n || null } }, { key: "min", value: function (t) { var e, i, n = null, o = null, r = _c(Td(e = this._data).call(e)); try { for (r.s(); !(i = r.n()).done;) { var s = i.value, a = s[t]; "number" == typeof a && (null == o || a < o) && (n = s, o = a) } } catch (t) { r.e(t) } finally { r.f() } return n || null } }, { key: "distinct", value: function (t) { for (var e = this._data, i = kr(Id(e).call(e)), n = [], o = 0, r = 0, s = i.length; r < s; r++) { for (var a = i[r], h = e.get(a)[t], l = !1, d = 0; d < o; d++)if (n[d] == h) { l = !0; break } l || void 0 === h || (n[o] = h, o++) } return n } }, { key: "_addItem", value: function (t) { var e = function (t, e) { return null == t[e] && (t[e] = mc()), t }(t, this._idProp), i = e[this._idProp]; if (this._data.has(i)) throw new Error("Cannot add item: item with id " + i + " already exists"); return this._data.set(i, e), ++this.length, i } }, { key: "_updateItem", value: function (t) { var e = t[this._idProp]; if (null == e) throw new Error("Cannot update item: item has no id (item: " + Ed(t) + ")"); var i = this._data.get(e); if (!i) throw new Error("Cannot update item: no item with id " + e + " found"); return this._data.set(e, wc(wc({}, i), t)), e } }, { key: "stream", value: function (t) { if (t) { var e = this._data; return new Dc(xn({}, $d, Kd.mark((function i() { var n, o, r, s; return Kd.wrap((function (i) { for (; ;)switch (i.prev = i.next) { case 0: n = _c(t), i.prev = 1, n.s(); case 3: if ((o = n.n()).done) { i.next = 11; break } if (r = o.value, null == (s = e.get(r))) { i.next = 9; break } return i.next = 9, [r, s]; case 9: i.next = 3; break; case 11: i.next = 16; break; case 13: i.prev = 13, i.t0 = i.catch(1), n.e(i.t0); case 16: return i.prev = 16, n.f(), i.finish(16); case 19: case "end": return i.stop() } }), i, null, [[1, 13, 16, 19]]) })))) } var i; return new Dc(xn({}, $d, Z(i = yd(this._data)).call(i, this._data))) } }, { key: "idProp", get: function () { return this._idProp } }]), i }(Tc), Pc = function (t) { Ad(i, t); var e = kc(i); function i(t, n) { var o, r; return El(this, i), (r = e.call(this)).length = 0, r._ids = new Gd, r._options = n || {}, r._listener = Z(o = r._onEvent).call(o, hd(r)), r.setData(t), r } return Sl(i, [{ key: "setData", value: function (t) { if (this._data) { this._data.off && this._data.off("*", this._listener); var e = this._data.getIds({ filter: yo(this._options) }), i = this._data.get(e); this._ids.clear(), this.length = 0, this._trigger("remove", { items: e, oldData: i }) } if (null != t) { this._data = t; for (var n = this._data.getIds({ filter: yo(this._options) }), o = 0, r = n.length; o < r; o++) { var s = n[o]; this._ids.add(s) } this.length = n.length, this._trigger("add", { items: n }) } else this._data = new Mc; this._data.on && this._data.on("*", this._listener) } }, { key: "refresh", value: function () { for (var t = this._data.getIds({ filter: yo(this._options) }), e = kr(this._ids), i = {}, n = [], o = [], r = [], s = 0, a = t.length; s < a; s++) { var h = t[s]; i[h] = !0, this._ids.has(h) || (n.push(h), this._ids.add(h)) } for (var l = 0, d = e.length; l < d; l++) { var c = e[l], u = this._data.get(c); null == u ? console.error("If you see this, report it please.") : i[c] || (o.push(c), r.push(u), this._ids.delete(c)) } this.length += n.length - o.length, n.length && this._trigger("add", { items: n }), o.length && this._trigger("remove", { items: o, oldData: r }) } }, { key: "get", value: function (t, e) { if (null == this._data) return null; var i, n = null; Sc(t) || ur(t) ? (n = t, i = e) : i = t; var o = mt({}, this._options, i), r = yo(this._options), s = i && yo(i); return r && s && (o.filter = function (t) { return r(t) && s(t) }), null == n ? this._data.get(o) : this._data.get(n, o) } }, { key: "getIds", value: function (t) { if (this._data.length) { var e, i = yo(this._options), n = null != t ? yo(t) : null; return e = n ? i ? function (t) { return i(t) && n(t) } : n : i, this._data.getIds({ filter: e, order: t && t.order }) } return [] } }, { key: "forEach", value: function (t, e) { if (this._data) { var i, n, o = yo(this._options), r = e && yo(e); n = r ? o ? function (t) { return o(t) && r(t) } : r : o, Yn(i = this._data).call(i, t, { filter: n, order: e && e.order }) } } }, { key: "map", value: function (t, e) { if (this._data) { var i, n, o = yo(this._options), r = e && yo(e); return n = r ? o ? function (t) { return o(t) && r(t) } : r : o, cr(i = this._data).call(i, t, { filter: n, order: e && e.order }) } return [] } }, { key: "getDataSet", value: function () { return this._data.getDataSet() } }, { key: "stream", value: function (t) { var e; return this._data.stream(t || xn({}, $d, Z(e = Id(this._ids)).call(e, this._ids))) } }, { key: "dispose", value: function () { var t; null !== (t = this._data) && void 0 !== t && t.off && this._data.off("*", this._listener); var e, n = "This data view has already been disposed of.", o = { get: function () { throw new Error(n) }, set: function () { throw new Error(n) }, configurable: !1 }, r = _c(gr(i.prototype)); try { for (r.s(); !(e = r.n()).done;) { var s = e.value; Ct(this, s, o) } } catch (t) { r.e(t) } finally { r.f() } } }, { key: "_onEvent", value: function (t, e, i) { if (e && e.items && this._data) { var n = e.items, o = [], r = [], s = [], a = [], h = [], l = []; switch (t) { case "add": for (var d = 0, c = n.length; d < c; d++) { var u = n[d]; this.get(u) && (this._ids.add(u), o.push(u)) } break; case "update": for (var f = 0, p = n.length; f < p; f++) { var v = n[f]; this.get(v) ? this._ids.has(v) ? (r.push(v), h.push(e.data[f]), a.push(e.oldData[f])) : (this._ids.add(v), o.push(v)) : this._ids.has(v) && (this._ids.delete(v), s.push(v), l.push(e.oldData[f])) } break; case "remove": for (var g = 0, y = n.length; g < y; g++) { var m = n[g]; this._ids.has(m) && (this._ids.delete(m), s.push(m), l.push(e.oldData[g])) } }this.length += o.length - s.length, o.length && this._trigger("add", { items: o }, i), r.length && this._trigger("update", { items: r, oldData: a, data: h }, i), s.length && this._trigger("remove", { items: s, oldData: l }, i) } } }, { key: "idProp", get: function () { return this.getDataSet().idProp } }]), i }(Tc); function Ic(t, e) { return "object" === vr(e) && null !== e && t === e.idProp && "function" == typeof e.add && "function" == typeof e.clear && "function" == typeof e.distinct && "function" == typeof Yn(e) && "function" == typeof e.get && "function" == typeof e.getDataSet && "function" == typeof e.getIds && "number" == typeof e.length && "function" == typeof cr(e) && "function" == typeof e.max && "function" == typeof e.min && "function" == typeof e.off && "function" == typeof e.on && "function" == typeof e.remove && "function" == typeof e.setOptions && "function" == typeof e.stream && "function" == typeof e.update && "function" == typeof e.updateOnly } function Bc(t, e) { return "object" === vr(e) && null !== e && t === e.idProp && "function" == typeof Yn(e) && "function" == typeof e.get && "function" == typeof e.getDataSet && "function" == typeof e.getIds && "number" == typeof e.length && "function" == typeof cr(e) && "function" == typeof e.off && "function" == typeof e.on && "function" == typeof e.stream && Ic(t, e.getDataSet()) } var zc = Object.freeze({ __proto__: null, DELETE: Mr, DataSet: Mc, DataStream: Dc, DataView: Pc, Queue: Cc, createNewDataPipeFrom: function (t) { return new Oc(t) }, isDataSetLike: Ic, isDataViewLike: Bc }), Nc = he.f, Ac = r((function () { return !Object.getOwnPropertyNames(1) })); q({ target: "Object", stat: !0, forced: Ac }, { getOwnPropertyNames: Nc }); var Fc = z.Object, jc = function (t) { return Fc.getOwnPropertyNames(t) }, Rc = Dn.trim, Lc = o.parseFloat, Hc = 1 / Lc(En + "-0") != -1 / 0 ? function (t) { var e = Rc(String(t)), i = Lc(e); return 0 === i && "-" == e.charAt(0) ? -0 : i } : Lc; q({ global: !0, forced: parseFloat != Hc }, { parseFloat: Hc }); var Wc = z.parseFloat; function qc(t, e) { var i = ["node", "edge", "label"], n = !0, o = Cs(e, "chosen"); if ("boolean" == typeof o) n = o; else if ("object" === vr(o)) { if (-1 === To(i).call(i, t)) throw new Error("choosify: subOption '" + t + "' should be one of '" + i.join("', '") + "'"); var r = Cs(e, ["chosen", t]); "boolean" != typeof r && "function" != typeof r || (n = r) } return n } function Vc(t, e, i) { if (t.width <= 0 || t.height <= 0) return !1; if (void 0 !== i) { var n = { x: e.x - i.x, y: e.y - i.y }; if (0 !== i.angle) { var o = -i.angle; e = { x: Math.cos(o) * n.x - Math.sin(o) * n.y, y: Math.sin(o) * n.x + Math.cos(o) * n.y } } else e = n } var r = t.x + t.width, s = t.y + t.width; return t.left < e.x && r > e.x && t.top < e.y && s > e.y } function Uc(t) { return "string" == typeof t && "" !== t } function Yc(t, e, i, n) { var o = n.x, r = n.y; if ("function" == typeof n.distanceToBorder) { var s = n.distanceToBorder(t, e), a = Math.sin(e) * s, h = Math.cos(e) * s; h === s ? (o += s, r = n.y) : a === s ? (o = n.x, r -= s) : (o += h, r -= a) } else n.shape.width > n.shape.height ? (o = n.x + .5 * n.shape.width, r = n.y - i) : (o = n.x + i, r = n.y - .5 * n.shape.height); return { x: o, y: r } } var Xc = function () { function t(e) { El(this, t), this.measureText = e, this.current = 0, this.width = 0, this.height = 0, this.lines = [] } return Sl(t, [{ key: "_add", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "normal"; void 0 === this.lines[t] && (this.lines[t] = { width: 0, height: 0, blocks: [] }); var n = e; void 0 !== e && "" !== e || (n = " "); var o = this.measureText(n, i), r = mt({}, Td(o)); r.text = e, r.width = o.width, r.mod = i, void 0 !== e && "" !== e || (r.width = 0), this.lines[t].blocks.push(r), this.lines[t].width += r.width } }, { key: "curWidth", value: function () { var t = this.lines[this.current]; return void 0 === t ? 0 : t.width } }, { key: "append", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "normal"; this._add(this.current, t, e) } }, { key: "newLine", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "normal"; this._add(this.current, t, e), this.current++ } }, { key: "determineLineHeights", value: function () { for (var t = 0; t < this.lines.length; t++) { var e = this.lines[t], i = 0; if (void 0 !== e.blocks) for (var n = 0; n < e.blocks.length; n++) { var o = e.blocks[n]; i < o.height && (i = o.height) } e.height = i } } }, { key: "determineLabelSize", value: function () { for (var t = 0, e = 0, i = 0; i < this.lines.length; i++) { var n = this.lines[i]; n.width > t && (t = n.width), e += n.height } this.width = t, this.height = e } }, { key: "removeEmptyBlocks", value: function () { for (var t = [], e = 0; e < this.lines.length; e++) { var i = this.lines[e]; if (0 !== i.blocks.length && (e !== this.lines.length - 1 || 0 !== i.width)) { var n = {}; mt(n, i), n.blocks = []; for (var o = void 0, r = [], s = 0; s < i.blocks.length; s++) { var a = i.blocks[s]; 0 !== a.width ? r.push(a) : void 0 === o && (o = a) } 0 === r.length && void 0 !== o && r.push(o), n.blocks = r, t.push(n) } } return t } }, { key: "finalize", value: function () { this.determineLineHeights(), this.determineLabelSize(); var t = this.removeEmptyBlocks(); return { width: this.width, height: this.height, lines: t } } }]), t }(), Gc = { "<b>": /<b>/, "<i>": /<i>/, "<code>": /<code>/, "</b>": /<\/b>/, "</i>": /<\/i>/, "</code>": /<\/code>/, "*": /\*/, _: /_/, "`": /`/, afterBold: /[^*]/, afterItal: /[^_]/, afterMono: /[^`]/ }, Kc = function () { function t(e) { El(this, t), this.text = e, this.bold = !1, this.ital = !1, this.mono = !1, this.spacing = !1, this.position = 0, this.buffer = "", this.modStack = [], this.blocks = [] } return Sl(t, [{ key: "mod", value: function () { return 0 === this.modStack.length ? "normal" : this.modStack[0] } }, { key: "modName", value: function () { return 0 === this.modStack.length ? "normal" : "mono" === this.modStack[0] ? "mono" : this.bold && this.ital ? "boldital" : this.bold ? "bold" : this.ital ? "ital" : void 0 } }, { key: "emitBlock", value: function () { this.spacing && (this.add(" "), this.spacing = !1), this.buffer.length > 0 && (this.blocks.push({ text: this.buffer, mod: this.modName() }), this.buffer = "") } }, { key: "add", value: function (t) { " " === t && (this.spacing = !0), this.spacing && (this.buffer += " ", this.spacing = !1), " " != t && (this.buffer += t) } }, { key: "parseWS", value: function (t) { return !!/[ \t]/.test(t) && (this.mono ? this.add(t) : this.spacing = !0, !0) } }, { key: "setTag", value: function (t) { this.emitBlock(), this[t] = !0, this.modStack.unshift(t) } }, { key: "unsetTag", value: function (t) { this.emitBlock(), this[t] = !1, this.modStack.shift() } }, { key: "parseStartTag", value: function (t, e) { return !(this.mono || this[t] || !this.match(e)) && (this.setTag(t), !0) } }, { key: "match", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.prepareRegExp(t), n = ir(i, 2), o = n[0], r = n[1], s = o.test(this.text.substr(this.position, r)); return s && e && (this.position += r - 1), s } }, { key: "parseEndTag", value: function (t, e, i) { var n = this.mod() === t; return !(!(n = "mono" === t ? n && this.mono : n && !this.mono) || !this.match(e)) && (void 0 !== i ? (this.position === this.text.length - 1 || this.match(i, !1)) && this.unsetTag(t) : this.unsetTag(t), !0) } }, { key: "replace", value: function (t, e) { return !!this.match(t) && (this.add(e), this.position += length - 1, !0) } }, { key: "prepareRegExp", value: function (t) { var e, i; if (t instanceof RegExp) i = t, e = 1; else { var n = Gc[t]; i = void 0 !== n ? n : new RegExp(t), e = t.length } return [i, e] } }]), t }(), $c = function () { function t(e, i, n, o) { var r = this; El(this, t), this.ctx = e, this.parent = i, this.selected = n, this.hover = o; this.lines = new Xc((function (t, i) { if (void 0 === t) return 0; var s = r.parent.getFormattingValues(e, n, o, i), a = 0; "" !== t && (a = r.ctx.measureText(t).width); return { width: a, values: s } })) } return Sl(t, [{ key: "process", value: function (t) { if (!Uc(t)) return this.lines.finalize(); var e = this.parent.fontOptions; t = (t = t.replace(/\r\n/g, "\n")).replace(/\r/g, "\n"); var i = String(t).split("\n"), n = i.length; if (e.multi) for (var o = 0; o < n; o++) { var r = this.splitBlocks(i[o], e.multi); if (void 0 !== r) if (0 !== r.length) { if (e.maxWdt > 0) for (var s = 0; s < r.length; s++) { var a = r[s].mod, h = r[s].text; this.splitStringIntoLines(h, a, !0) } else for (var l = 0; l < r.length; l++) { var d = r[l].mod, c = r[l].text; this.lines.append(c, d) } this.lines.newLine() } else this.lines.newLine("") } else if (e.maxWdt > 0) for (var u = 0; u < n; u++)this.splitStringIntoLines(i[u]); else for (var f = 0; f < n; f++)this.lines.newLine(i[f]); return this.lines.finalize() } }, { key: "decodeMarkupSystem", value: function (t) { var e = "none"; return "markdown" === t || "md" === t ? e = "markdown" : !0 !== t && "html" !== t || (e = "html"), e } }, { key: "splitHtmlBlocks", value: function (t) { for (var e = new Kc(t), i = function (t) { return !!/&/.test(t) && (e.replace(e.text, "<", "<") || e.replace(e.text, "&", "&") || e.add("&"), !0) }; e.position < e.text.length;) { var n = e.text.charAt(e.position); e.parseWS(n) || /</.test(n) && (e.parseStartTag("bold", "<b>") || e.parseStartTag("ital", "<i>") || e.parseStartTag("mono", "<code>") || e.parseEndTag("bold", "</b>") || e.parseEndTag("ital", "</i>") || e.parseEndTag("mono", "</code>")) || i(n) || e.add(n), e.position++ } return e.emitBlock(), e.blocks } }, { key: "splitMarkdownBlocks", value: function (t) { for (var e = this, i = new Kc(t), n = !0, o = function (t) { return !!/\\/.test(t) && (i.position < e.text.length + 1 && (i.position++, t = e.text.charAt(i.position), / \t/.test(t) ? i.spacing = !0 : (i.add(t), n = !1)), !0) }; i.position < i.text.length;) { var r = i.text.charAt(i.position); i.parseWS(r) || o(r) || (n || i.spacing) && (i.parseStartTag("bold", "*") || i.parseStartTag("ital", "_") || i.parseStartTag("mono", "`")) || i.parseEndTag("bold", "*", "afterBold") || i.parseEndTag("ital", "_", "afterItal") || i.parseEndTag("mono", "`", "afterMono") || (i.add(r), n = !1), i.position++ } return i.emitBlock(), i.blocks } }, { key: "splitBlocks", value: function (t, e) { var i = this.decodeMarkupSystem(e); return "none" === i ? [{ text: t, mod: "normal" }] : "markdown" === i ? this.splitMarkdownBlocks(t) : "html" === i ? this.splitHtmlBlocks(t) : void 0 } }, { key: "overMaxWidth", value: function (t) { var e = this.ctx.measureText(t).width; return this.lines.curWidth() + e > this.parent.fontOptions.maxWdt } }, { key: "getLongestFit", value: function (t) { for (var e = "", i = 0; i < t.length;) { var n = e + ("" === e ? "" : " ") + t[i]; if (this.overMaxWidth(n)) break; e = n, i++ } return i } }, { key: "getLongestFitWord", value: function (t) { for (var e = 0; e < t.length && !this.overMaxWidth(yr(t).call(t, 0, e));)e++; return e } }, { key: "splitStringIntoLines", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "normal", i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; this.parent.getFormattingValues(this.ctx, this.selected, this.hover, e); for (var n = (t = (t = t.replace(/^( +)/g, "$1\r")).replace(/([^\r][^ ]*)( +)/g, "$1\r$2\r")).split("\r"); n.length > 0;) { var o = this.getLongestFit(n); if (0 === o) { var r = n[0], s = this.getLongestFitWord(r); this.lines.newLine(yr(r).call(r, 0, s), e), n[0] = yr(r).call(r, s) } else { var a = o; " " === n[o - 1] ? o-- : " " === n[a] && a++; var h = yr(n).call(n, 0, o).join(""); o == n.length && i ? this.lines.append(h, e) : this.lines.newLine(h, e), n = yr(n).call(n, a) } } } }]), t }(), Zc = ["bold", "ital", "boldital", "mono"], Qc = function () { function t(e, i) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; El(this, t), this.body = e, this.pointToSelf = !1, this.baseSize = void 0, this.fontOptions = {}, this.setOptions(i), this.size = { top: 0, left: 0, width: 0, height: 0, yLine: 0 }, this.isEdgeLabel = n } return Sl(t, [{ key: "setOptions", value: function (t) { if (this.elementOptions = t, this.initFontOptions(t.font), Uc(t.label) ? this.labelDirty = !0 : t.label = void 0, void 0 !== t.font && null !== t.font) if ("string" == typeof t.font) this.baseSize = this.fontOptions.size; else if ("object" === vr(t.font)) { var e = t.font.size; void 0 !== e && (this.baseSize = e) } } }, { key: "initFontOptions", value: function (e) { var i = this; ss(Zc, (function (t) { i.fontOptions[t] = {} })), t.parseFontString(this.fontOptions, e) ? this.fontOptions.vadjust = 0 : ss(e, (function (t, e) { null != t && "object" !== vr(t) && (i.fontOptions[e] = t) })) } }, { key: "constrain", value: function (t) { var e = { constrainWidth: !1, maxWdt: -1, minWdt: -1, constrainHeight: !1, minHgt: -1, valign: "middle" }, i = Cs(t, "widthConstraint"); if ("number" == typeof i) e.maxWdt = Number(i), e.minWdt = Number(i); else if ("object" === vr(i)) { var n = Cs(t, ["widthConstraint", "maximum"]); "number" == typeof n && (e.maxWdt = Number(n)); var o = Cs(t, ["widthConstraint", "minimum"]); "number" == typeof o && (e.minWdt = Number(o)) } var r = Cs(t, "heightConstraint"); if ("number" == typeof r) e.minHgt = Number(r); else if ("object" === vr(r)) { var s = Cs(t, ["heightConstraint", "minimum"]); "number" == typeof s && (e.minHgt = Number(s)); var a = Cs(t, ["heightConstraint", "valign"]); "string" == typeof a && ("top" !== a && "bottom" !== a || (e.valign = a)) } return e } }, { key: "update", value: function (t, e) { this.setOptions(t, !0), this.propagateFonts(e), Jr(this.fontOptions, this.constrain(e)), this.fontOptions.chooser = qc("label", e) } }, { key: "adjustSizes", value: function (t) { var e = t ? t.right + t.left : 0; this.fontOptions.constrainWidth && (this.fontOptions.maxWdt -= e, this.fontOptions.minWdt -= e); var i = t ? t.top + t.bottom : 0; this.fontOptions.constrainHeight && (this.fontOptions.minHgt -= i) } }, { key: "addFontOptionsToPile", value: function (t, e) { for (var i = 0; i < e.length; ++i)this.addFontToPile(t, e[i]) } }, { key: "addFontToPile", value: function (t, e) { if (void 0 !== e && void 0 !== e.font && null !== e.font) { var i = e.font; t.push(i) } } }, { key: "getBasicOptions", value: function (e) { for (var i = {}, n = 0; n < e.length; ++n) { var o = e[n], r = {}; t.parseFontString(r, o) && (o = r), ss(o, (function (t, e) { void 0 !== t && (Object.prototype.hasOwnProperty.call(i, e) || (-1 !== To(Zc).call(Zc, e) ? i[e] = {} : i[e] = t)) })) } return i } }, { key: "getFontOption", value: function (e, i, n) { for (var o, r = 0; r < e.length; ++r) { var s = e[r]; if (Object.prototype.hasOwnProperty.call(s, i)) { if (null == (o = s[i])) continue; var a = {}; if (t.parseFontString(a, o) && (o = a), Object.prototype.hasOwnProperty.call(o, n)) return o[n] } } if (Object.prototype.hasOwnProperty.call(this.fontOptions, n)) return this.fontOptions[n]; throw new Error("Did not find value for multi-font for property: '" + n + "'") } }, { key: "getFontOptions", value: function (t, e) { for (var i = {}, n = ["color", "size", "face", "mod", "vadjust"], o = 0; o < n.length; ++o) { var r = n[o]; i[r] = this.getFontOption(t, e, r) } return i } }, { key: "propagateFonts", value: function (t) { var e = this, i = []; this.addFontOptionsToPile(i, t), this.fontOptions = this.getBasicOptions(i); for (var n = function (t) { var n = Zc[t], o = e.fontOptions[n]; ss(e.getFontOptions(i, n), (function (t, e) { o[e] = t })), o.size = Number(o.size), o.vadjust = Number(o.vadjust) }, o = 0; o < Zc.length; ++o)n(o) } }, { key: "draw", value: function (t, e, i, n, o) { var r = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "middle"; if (void 0 !== this.elementOptions.label) { var s = this.fontOptions.size * this.body.view.scale; this.elementOptions.label && s < this.elementOptions.scaling.label.drawThreshold - 1 || (s >= this.elementOptions.scaling.label.maxVisible && (s = Number(this.elementOptions.scaling.label.maxVisible) / this.body.view.scale), this.calculateLabelSize(t, n, o, e, i, r), this._drawBackground(t), this._drawText(t, e, this.size.yLine, r, s)) } } }, { key: "_drawBackground", value: function (t) { if (void 0 !== this.fontOptions.background && "none" !== this.fontOptions.background) { t.fillStyle = this.fontOptions.background; var e = this.getSize(); t.fillRect(e.left, e.top, e.width, e.height) } } }, { key: "_drawText", value: function (t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "middle", o = arguments.length > 4 ? arguments[4] : void 0, r = this._setAlignment(t, e, i, n), s = ir(r, 2); e = s[0], i = s[1], t.textAlign = "left", e -= this.size.width / 2, this.fontOptions.valign && this.size.height > this.size.labelHeight && ("top" === this.fontOptions.valign && (i -= (this.size.height - this.size.labelHeight) / 2), "bottom" === this.fontOptions.valign && (i += (this.size.height - this.size.labelHeight) / 2)); for (var a = 0; a < this.lineCount; a++) { var h = this.lines[a]; if (h && h.blocks) { var l = 0; this.isEdgeLabel || "center" === this.fontOptions.align ? l += (this.size.width - h.width) / 2 : "right" === this.fontOptions.align && (l += this.size.width - h.width); for (var d = 0; d < h.blocks.length; d++) { var c = h.blocks[d]; t.font = c.font; var u = this._getColor(c.color, o, c.strokeColor), f = ir(u, 2), p = f[0], v = f[1]; c.strokeWidth > 0 && (t.lineWidth = c.strokeWidth, t.strokeStyle = v, t.lineJoin = "round"), t.fillStyle = p, c.strokeWidth > 0 && t.strokeText(c.text, e + l, i + c.vadjust), t.fillText(c.text, e + l, i + c.vadjust), l += c.width } i += h.height } } } }, { key: "_setAlignment", value: function (t, e, i, n) { if (this.isEdgeLabel && "horizontal" !== this.fontOptions.align && !1 === this.pointToSelf) { e = 0, i = 0; "top" === this.fontOptions.align ? (t.textBaseline = "alphabetic", i -= 4) : "bottom" === this.fontOptions.align ? (t.textBaseline = "hanging", i += 4) : t.textBaseline = "middle" } else t.textBaseline = n; return [e, i] } }, { key: "_getColor", value: function (t, e, i) { var n = t || "#000000", o = i || "#ffffff"; if (e <= this.elementOptions.scaling.label.drawThreshold) { var r = Math.max(0, Math.min(1, 1 - (this.elementOptions.scaling.label.drawThreshold - e))); n = us(n, r), o = us(o, r) } return [n, o] } }, { key: "getTextSize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2]; return this._processLabel(t, e, i), { width: this.size.width, height: this.size.height, lineCount: this.lineCount } } }, { key: "getSize", value: function () { var t = this.size.left, e = this.size.top - 1; if (this.isEdgeLabel) { var i = .5 * -this.size.width; switch (this.fontOptions.align) { case "middle": t = i, e = .5 * -this.size.height; break; case "top": t = i, e = -(this.size.height + 2); break; case "bottom": t = i, e = 2 } } return { left: t, top: e, width: this.size.width, height: this.size.height } } }, { key: "calculateLabelSize", value: function (t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 0, o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 0, r = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : "middle"; this._processLabel(t, e, i), this.size.left = n - .5 * this.size.width, this.size.top = o - .5 * this.size.height, this.size.yLine = o + .5 * (1 - this.lineCount) * this.fontOptions.size, "hanging" === r && (this.size.top += .5 * this.fontOptions.size, this.size.top += 4, this.size.yLine += 4) } }, { key: "getFormattingValues", value: function (t, e, i, n) { var o = function (t, e, i) { return "normal" === e ? "mod" === i ? "" : t[i] : void 0 !== t[e][i] ? t[e][i] : t[i] }, r = { color: o(this.fontOptions, n, "color"), size: o(this.fontOptions, n, "size"), face: o(this.fontOptions, n, "face"), mod: o(this.fontOptions, n, "mod"), vadjust: o(this.fontOptions, n, "vadjust"), strokeWidth: this.fontOptions.strokeWidth, strokeColor: this.fontOptions.strokeColor }; (e || i) && ("normal" === n && !0 === this.fontOptions.chooser && this.elementOptions.labelHighlightBold ? r.mod = "bold" : "function" == typeof this.fontOptions.chooser && this.fontOptions.chooser(r, this.elementOptions.id, e, i)); var s = ""; return void 0 !== r.mod && "" !== r.mod && (s += r.mod + " "), s += r.size + "px " + r.face, t.font = s.replace(/"/g, ""), r.font = t.font, r.height = r.size, r } }, { key: "differentState", value: function (t, e) { return t !== this.selectedState || e !== this.hoverState } }, { key: "_processLabelText", value: function (t, e, i, n) { return new $c(t, this, e, i).process(n) } }, { key: "_processLabel", value: function (t, e, i) { if (!1 !== this.labelDirty || this.differentState(e, i)) { var n = this._processLabelText(t, e, i, this.elementOptions.label); this.fontOptions.minWdt > 0 && n.width < this.fontOptions.minWdt && (n.width = this.fontOptions.minWdt), this.size.labelHeight = n.height, this.fontOptions.minHgt > 0 && n.height < this.fontOptions.minHgt && (n.height = this.fontOptions.minHgt), this.lines = n.lines, this.lineCount = n.lines.length, this.size.width = n.width, this.size.height = n.height, this.selectedState = e, this.hoverState = i, this.labelDirty = !1 } } }, { key: "visible", value: function () { return 0 !== this.size.width && 0 !== this.size.height && void 0 !== this.elementOptions.label && !(this.fontOptions.size * this.body.view.scale < this.elementOptions.scaling.label.drawThreshold - 1) } }], [{ key: "parseFontString", value: function (t, e) { if (!e || "string" != typeof e) return !1; var i = e.split(" "); return t.size = +i[0].replace("px", ""), t.face = i[1], t.color = i[2], !0 } }]), t }(); q({ target: "Array", proto: !0 }, { fill: function (t) { for (var e = pt(this), i = it(e.length), n = arguments.length, o = rt(n > 1 ? arguments[1] : void 0, i), r = n > 2 ? arguments[2] : void 0, s = void 0 === r ? i : rt(r, i); s > o;)e[o++] = t; return e } }); var Jc = G("Array").fill, tu = Array.prototype, eu = function (t) { var e = t.fill; return t === tu || t instanceof Array && e === tu.fill ? Jc : e }, iu = function () { function t(e, i, n) { El(this, t), this.body = i, this.labelModule = n, this.setOptions(e), this.top = void 0, this.left = void 0, this.height = void 0, this.width = void 0, this.radius = void 0, this.margin = void 0, this.refreshNeeded = !0, this.boundingBox = { top: 0, left: 0, right: 0, bottom: 0 } } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t } }, { key: "_setMargins", value: function (t) { this.margin = {}, this.options.margin && ("object" == vr(this.options.margin) ? (this.margin.top = this.options.margin.top, this.margin.right = this.options.margin.right, this.margin.bottom = this.options.margin.bottom, this.margin.left = this.options.margin.left) : (this.margin.top = this.options.margin, this.margin.right = this.options.margin, this.margin.bottom = this.options.margin, this.margin.left = this.options.margin)), t.adjustSizes(this.margin) } }, { key: "_distanceToBorder", value: function (t, e) { var i = this.options.borderWidth; return t && this.resize(t), Math.min(Math.abs(this.width / 2 / Math.cos(e)), Math.abs(this.height / 2 / Math.sin(e))) + i } }, { key: "enableShadow", value: function (t, e) { e.shadow && (t.shadowColor = e.shadowColor, t.shadowBlur = e.shadowSize, t.shadowOffsetX = e.shadowX, t.shadowOffsetY = e.shadowY) } }, { key: "disableShadow", value: function (t, e) { e.shadow && (t.shadowColor = "rgba(0,0,0,0)", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0) } }, { key: "enableBorderDashes", value: function (t, e) { if (!1 !== e.borderDashes) if (void 0 !== t.setLineDash) { var i = e.borderDashes; !0 === i && (i = [5, 15]), t.setLineDash(i) } else console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."), this.options.shapeProperties.borderDashes = !1, e.borderDashes = !1 } }, { key: "disableBorderDashes", value: function (t, e) { !1 !== e.borderDashes && (void 0 !== t.setLineDash ? t.setLineDash([0]) : (console.warn("setLineDash is not supported in this browser. The dashed borders cannot be used."), this.options.shapeProperties.borderDashes = !1, e.borderDashes = !1)) } }, { key: "needsRefresh", value: function (t, e) { return !0 === this.refreshNeeded ? (this.refreshNeeded = !1, !0) : void 0 === this.width || this.labelModule.differentState(t, e) } }, { key: "initContextForDraw", value: function (t, e) { var i = e.borderWidth / this.body.view.scale; t.lineWidth = Math.min(this.width, i), t.strokeStyle = e.borderColor, t.fillStyle = e.color } }, { key: "performStroke", value: function (t, e) { var i = e.borderWidth / this.body.view.scale; t.save(), i > 0 && (this.enableBorderDashes(t, e), t.stroke(), this.disableBorderDashes(t, e)), t.restore() } }, { key: "performFill", value: function (t, e) { t.save(), t.fillStyle = e.color, this.enableShadow(t, e), eu(t).call(t), this.disableShadow(t, e), t.restore(), this.performStroke(t, e) } }, { key: "_addBoundingBoxMargin", value: function (t) { this.boundingBox.left -= t, this.boundingBox.top -= t, this.boundingBox.bottom += t, this.boundingBox.right += t } }, { key: "_updateBoundingBox", value: function (t, e, i, n, o) { void 0 !== i && this.resize(i, n, o), this.left = t - this.width / 2, this.top = e - this.height / 2, this.boundingBox.left = this.left, this.boundingBox.top = this.top, this.boundingBox.bottom = this.top + this.height, this.boundingBox.right = this.left + this.width } }, { key: "updateBoundingBox", value: function (t, e, i, n, o) { this._updateBoundingBox(t, e, i, n, o) } }, { key: "getDimensionsFromLabel", value: function (t, e, i) { this.textSize = this.labelModule.getTextSize(t, e, i); var n = this.textSize.width, o = this.textSize.height; return 0 === n && (n = 14, o = 14), { width: n, height: o } } }]), t }(); function nu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var ou = function (t) { Ad(i, t); var e = nu(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover; if (this.needsRefresh(e, i)) { var n = this.getDimensionsFromLabel(t, e, i); this.width = n.width + this.margin.right + this.margin.left, this.height = n.height + this.margin.top + this.margin.bottom, this.radius = this.width / 2 } } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - this.width / 2, this.top = i - this.height / 2, this.initContextForDraw(t, r), wt(t, this.left, this.top, this.width, this.height, r.borderRadius), this.performFill(t, r), this.updateBoundingBox(e, i, t, n, o), this.labelModule.draw(t, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, n, o) } }, { key: "updateBoundingBox", value: function (t, e, i, n, o) { this._updateBoundingBox(t, e, i, n, o); var r = this.options.shapeProperties.borderRadius; this._addBoundingBoxMargin(r) } }, { key: "distanceToBorder", value: function (t, e) { t && this.resize(t); var i = this.options.borderWidth; return Math.min(Math.abs(this.width / 2 / Math.cos(e)), Math.abs(this.height / 2 / Math.sin(e))) + i } }]), i }(iu); function ru(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var su = function (t) { Ad(i, t); var e = ru(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o)).labelOffset = 0, r.selected = !1, r } return Sl(i, [{ key: "setOptions", value: function (t, e, i) { this.options = t, void 0 === e && void 0 === i || this.setImages(e, i) } }, { key: "setImages", value: function (t, e) { e && this.selected ? (this.imageObj = e, this.imageObjAlt = t) : (this.imageObj = t, this.imageObjAlt = e) } }, { key: "switchImages", value: function (t) { var e = t && !this.selected || !t && this.selected; if (this.selected = t, void 0 !== this.imageObjAlt && e) { var i = this.imageObj; this.imageObj = this.imageObjAlt, this.imageObjAlt = i } } }, { key: "_getImagePadding", value: function () { var t = { top: 0, right: 0, bottom: 0, left: 0 }; if (this.options.imagePadding) { var e = this.options.imagePadding; "object" == vr(e) ? (t.top = e.top, t.right = e.right, t.bottom = e.bottom, t.left = e.left) : (t.top = e, t.right = e, t.bottom = e, t.left = e) } return t } }, { key: "_resizeImage", value: function () { var t, e; if (!1 === this.options.shapeProperties.useImageSize) { var i = 1, n = 1; this.imageObj.width && this.imageObj.height && (this.imageObj.width > this.imageObj.height ? i = this.imageObj.width / this.imageObj.height : n = this.imageObj.height / this.imageObj.width), t = 2 * this.options.size * i, e = 2 * this.options.size * n } else { var o = this._getImagePadding(); t = this.imageObj.width + o.left + o.right, e = this.imageObj.height + o.top + o.bottom } this.width = t, this.height = e, this.radius = .5 * this.width } }, { key: "_drawRawCircle", value: function (t, e, i, n) { this.initContextForDraw(t, n), bt(t, e, i, n.size), this.performFill(t, n) } }, { key: "_drawImageAtPosition", value: function (t, e) { if (0 != this.imageObj.width) { t.globalAlpha = void 0 !== e.opacity ? e.opacity : 1, this.enableShadow(t, e); var i = 1; !0 === this.options.shapeProperties.interpolation && (i = this.imageObj.width / this.width / this.body.view.scale); var n = this._getImagePadding(), o = this.left + n.left, r = this.top + n.top, s = this.width - n.left - n.right, a = this.height - n.top - n.bottom; this.imageObj.drawImageAtPosition(t, i, o, r, s, a), this.disableShadow(t, e) } } }, { key: "_drawImageLabel", value: function (t, e, i, n, o) { var r = 0; if (void 0 !== this.height) { r = .5 * this.height; var s = this.labelModule.getTextSize(t, n, o); s.lineCount >= 1 && (r += s.height / 2) } var a = i + r; this.options.label && (this.labelOffset = r), this.labelModule.draw(t, e, a, n, o, "hanging") } }]), i }(iu); function au(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var hu = function (t) { Ad(i, t); var e = au(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover; if (this.needsRefresh(e, i)) { var n = this.getDimensionsFromLabel(t, e, i), o = Math.max(n.width + this.margin.right + this.margin.left, n.height + this.margin.top + this.margin.bottom); this.options.size = o / 2, this.width = o, this.height = o, this.radius = this.width / 2 } } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - this.width / 2, this.top = i - this.height / 2, this._drawRawCircle(t, e, i, r), this.updateBoundingBox(e, i), this.labelModule.draw(t, this.left + this.textSize.width / 2 + this.margin.left, i, n, o) } }, { key: "updateBoundingBox", value: function (t, e) { this.boundingBox.top = e - this.options.size, this.boundingBox.left = t - this.options.size, this.boundingBox.right = t + this.options.size, this.boundingBox.bottom = e + this.options.size } }, { key: "distanceToBorder", value: function (t) { return t && this.resize(t), .5 * this.width } }]), i }(su); function lu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var du = function (t) { Ad(i, t); var e = lu(i); function i(t, n, o, r, s) { var a; return El(this, i), (a = e.call(this, t, n, o)).setImages(r, s), a } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover, n = void 0 === this.imageObj.src || void 0 === this.imageObj.width || void 0 === this.imageObj.height; if (n) { var o = 2 * this.options.size; return this.width = o, this.height = o, void (this.radius = .5 * this.width) } this.needsRefresh(e, i) && this._resizeImage() } }, { key: "draw", value: function (t, e, i, n, o, r) { this.switchImages(n), this.resize(); var s = e, a = i; "top-left" === this.options.shapeProperties.coordinateOrigin ? (this.left = e, this.top = i, s += this.width / 2, a += this.height / 2) : (this.left = e - this.width / 2, this.top = i - this.height / 2), this._drawRawCircle(t, s, a, r), t.save(), t.clip(), this._drawImageAtPosition(t, r), t.restore(), this._drawImageLabel(t, s, a, n, o), this.updateBoundingBox(e, i) } }, { key: "updateBoundingBox", value: function (t, e) { "top-left" === this.options.shapeProperties.coordinateOrigin ? (this.boundingBox.top = e, this.boundingBox.left = t, this.boundingBox.right = t + 2 * this.options.size, this.boundingBox.bottom = e + 2 * this.options.size) : (this.boundingBox.top = e - this.options.size, this.boundingBox.left = t - this.options.size, this.boundingBox.right = t + this.options.size, this.boundingBox.bottom = e + this.options.size), this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left), this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width), this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset) } }, { key: "distanceToBorder", value: function (t) { return t && this.resize(t), .5 * this.width } }]), i }(su); function cu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var uu = function (t) { Ad(i, t); var e = cu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover, n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : { size: this.options.size }; if (this.needsRefresh(e, i)) { var o, r; this.labelModule.getTextSize(t, e, i); var s = 2 * n.size; this.width = null !== (o = this.customSizeWidth) && void 0 !== o ? o : s, this.height = null !== (r = this.customSizeHeight) && void 0 !== r ? r : s, this.radius = .5 * this.width } } }, { key: "_drawShape", value: function (t, e, i, n, o, r, s, a) { var h, l = this; return this.resize(t, r, s, a), this.left = n - this.width / 2, this.top = o - this.height / 2, this.initContextForDraw(t, a), (h = e, Object.prototype.hasOwnProperty.call(Et, h) ? Et[h] : function (t) { for (var e = arguments.length, i = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)i[n - 1] = arguments[n]; CanvasRenderingContext2D.prototype[h].call(t, i) })(t, n, o, a.size), this.performFill(t, a), void 0 !== this.options.icon && void 0 !== this.options.icon.code && (t.font = (r ? "bold " : "") + this.height / 2 + "px " + (this.options.icon.face || "FontAwesome"), t.fillStyle = this.options.icon.color || "black", t.textAlign = "center", t.textBaseline = "middle", t.fillText(this.options.icon.code, n, o)), { drawExternalLabel: function () { if (void 0 !== l.options.label) { l.labelModule.calculateLabelSize(t, r, s, n, o, "hanging"); var e = o + .5 * l.height + .5 * l.labelModule.size.height; l.labelModule.draw(t, n, e, r, s, "hanging") } l.updateBoundingBox(n, o) } } } }, { key: "updateBoundingBox", value: function (t, e) { this.boundingBox.top = e - this.options.size, this.boundingBox.left = t - this.options.size, this.boundingBox.right = t + this.options.size, this.boundingBox.bottom = e + this.options.size, void 0 !== this.options.label && this.labelModule.size.width > 0 && (this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left), this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width), this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height)) } }]), i }(iu); function fu(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function pu(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = fu(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = fu(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } function vu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var gu = function (t) { Ad(i, t); var e = vu(i); function i(t, n, o, r) { var s; return El(this, i), (s = e.call(this, t, n, o, r)).ctxRenderer = r, s } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o, r), this.left = e - this.width / 2, this.top = i - this.height / 2, t.save(); var s = this.ctxRenderer({ ctx: t, id: this.options.id, x: e, y: i, state: { selected: n, hover: o }, style: pu({}, r), label: this.options.label }); if (null != s.drawNode && s.drawNode(), t.restore(), s.drawExternalLabel) { var a = s.drawExternalLabel; s.drawExternalLabel = function () { t.save(), a(), t.restore() } } return s.nodeDimensions && (this.customSizeWidth = s.nodeDimensions.width, this.customSizeHeight = s.nodeDimensions.height), s } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function yu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var mu = function (t) { Ad(i, t); var e = yu(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t, e, i) { if (this.needsRefresh(e, i)) { var n = this.getDimensionsFromLabel(t, e, i).width + this.margin.right + this.margin.left; this.width = n, this.height = n, this.radius = this.width / 2 } } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - this.width / 2, this.top = i - this.height / 2, this.initContextForDraw(t, r), _t(t, e - this.width / 2, i - this.height / 2, this.width, this.height), this.performFill(t, r), this.updateBoundingBox(e, i, t, n, o), this.labelModule.draw(t, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, n, o) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(iu); function bu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var wu = function (t) { Ad(i, t); var e = bu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "diamond", 4, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function ku(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var _u = function (t) { Ad(i, t); var e = ku(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "circle", 2, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t) { return t && this.resize(t), this.options.size } }]), i }(uu); function xu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Eu = function (t) { Ad(i, t); var e = xu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover; if (this.needsRefresh(e, i)) { var n = this.getDimensionsFromLabel(t, e, i); this.height = 2 * n.height, this.width = n.width + n.height, this.radius = .5 * this.width } } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - .5 * this.width, this.top = i - .5 * this.height, this.initContextForDraw(t, r), kt(t, this.left, this.top, this.width, this.height), this.performFill(t, r), this.updateBoundingBox(e, i, t, n, o), this.labelModule.draw(t, e, i, n, o) } }, { key: "distanceToBorder", value: function (t, e) { t && this.resize(t); var i = .5 * this.width, n = .5 * this.height, o = Math.sin(e) * i, r = Math.cos(e) * n; return i * n / Math.sqrt(o * o + r * r) } }]), i }(iu); function Ou(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Su = function (t) { Ad(i, t); var e = Ou(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t, e, i) { this.needsRefresh(e, i) && (this.iconSize = { width: Number(this.options.icon.size), height: Number(this.options.icon.size) }, this.width = this.iconSize.width + this.margin.right + this.margin.left, this.height = this.iconSize.height + this.margin.top + this.margin.bottom, this.radius = .5 * this.width) } }, { key: "draw", value: function (t, e, i, n, o, r) { var s = this; return this.resize(t, n, o), this.options.icon.size = this.options.icon.size || 50, this.left = e - this.width / 2, this.top = i - this.height / 2, this._icon(t, e, i, n, o, r), { drawExternalLabel: function () { if (void 0 !== s.options.label) { s.labelModule.draw(t, s.left + s.iconSize.width / 2 + s.margin.left, i + s.height / 2 + 5, n) } s.updateBoundingBox(e, i) } } } }, { key: "updateBoundingBox", value: function (t, e) { if (this.boundingBox.top = e - .5 * this.options.icon.size, this.boundingBox.left = t - .5 * this.options.icon.size, this.boundingBox.right = t + .5 * this.options.icon.size, this.boundingBox.bottom = e + .5 * this.options.icon.size, void 0 !== this.options.label && this.labelModule.size.width > 0) { this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left), this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width), this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelModule.size.height + 5) } } }, { key: "_icon", value: function (t, e, i, n, o, r) { var s = Number(this.options.icon.size); void 0 !== this.options.icon.code ? (t.font = [null != this.options.icon.weight ? this.options.icon.weight : n ? "bold" : "", (null != this.options.icon.weight && n ? 5 : 0) + s + "px", this.options.icon.face].join(" "), t.fillStyle = this.options.icon.color || "black", t.textAlign = "center", t.textBaseline = "middle", this.enableShadow(t, r), t.fillText(this.options.icon.code, e, i), this.disableShadow(t, r)) : console.error("When using the icon shape, you need to define the code in the icon options object. This can be done per node or globally.") } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(iu); function Cu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Tu = function (t) { Ad(i, t); var e = Cu(i); function i(t, n, o, r, s) { var a; return El(this, i), (a = e.call(this, t, n, o)).setImages(r, s), a } return Sl(i, [{ key: "resize", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.selected, i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this.hover, n = void 0 === this.imageObj.src || void 0 === this.imageObj.width || void 0 === this.imageObj.height; if (n) { var o = 2 * this.options.size; return this.width = o, void (this.height = o) } this.needsRefresh(e, i) && this._resizeImage() } }, { key: "draw", value: function (t, e, i, n, o, r) { t.save(), this.switchImages(n), this.resize(); var s = e, a = i; if ("top-left" === this.options.shapeProperties.coordinateOrigin ? (this.left = e, this.top = i, s += this.width / 2, a += this.height / 2) : (this.left = e - this.width / 2, this.top = i - this.height / 2), !0 === this.options.shapeProperties.useBorderWithImage) { var h = this.options.borderWidth, l = this.options.borderWidthSelected || 2 * this.options.borderWidth, d = (n ? l : h) / this.body.view.scale; t.lineWidth = Math.min(this.width, d), t.beginPath(); var c = n ? this.options.color.highlight.border : o ? this.options.color.hover.border : this.options.color.border, u = n ? this.options.color.highlight.background : o ? this.options.color.hover.background : this.options.color.background; void 0 !== r.opacity && (c = us(c, r.opacity), u = us(u, r.opacity)), t.strokeStyle = c, t.fillStyle = u, t.rect(this.left - .5 * t.lineWidth, this.top - .5 * t.lineWidth, this.width + t.lineWidth, this.height + t.lineWidth), eu(t).call(t), this.performStroke(t, r), t.closePath() } this._drawImageAtPosition(t, r), this._drawImageLabel(t, s, a, n, o), this.updateBoundingBox(e, i), t.restore() } }, { key: "updateBoundingBox", value: function (t, e) { this.resize(), "top-left" === this.options.shapeProperties.coordinateOrigin ? (this.left = t, this.top = e) : (this.left = t - this.width / 2, this.top = e - this.height / 2), this.boundingBox.left = this.left, this.boundingBox.top = this.top, this.boundingBox.bottom = this.top + this.height, this.boundingBox.right = this.left + this.width, void 0 !== this.options.label && this.labelModule.size.width > 0 && (this.boundingBox.left = Math.min(this.boundingBox.left, this.labelModule.size.left), this.boundingBox.right = Math.max(this.boundingBox.right, this.labelModule.size.left + this.labelModule.size.width), this.boundingBox.bottom = Math.max(this.boundingBox.bottom, this.boundingBox.bottom + this.labelOffset)) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(su); function Du(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Mu = function (t) { Ad(i, t); var e = Du(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "square", 2, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function Pu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Iu = function (t) { Ad(i, t); var e = Pu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "hexagon", 4, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function Bu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var zu = function (t) { Ad(i, t); var e = Bu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "star", 4, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function Nu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Au = function (t) { Ad(i, t); var e = Nu(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._setMargins(o), r } return Sl(i, [{ key: "resize", value: function (t, e, i) { this.needsRefresh(e, i) && (this.textSize = this.labelModule.getTextSize(t, e, i), this.width = this.textSize.width + this.margin.right + this.margin.left, this.height = this.textSize.height + this.margin.top + this.margin.bottom, this.radius = .5 * this.width) } }, { key: "draw", value: function (t, e, i, n, o, r) { this.resize(t, n, o), this.left = e - this.width / 2, this.top = i - this.height / 2, this.enableShadow(t, r), this.labelModule.draw(t, this.left + this.textSize.width / 2 + this.margin.left, this.top + this.textSize.height / 2 + this.margin.top, n, o), this.disableShadow(t, r), this.updateBoundingBox(e, i, t, n, o) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(iu); function Fu(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var ju = function (t) { Ad(i, t); var e = Fu(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "triangle", 3, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu); function Ru(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Lu, Hu = function (t) { Ad(i, t); var e = Ru(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "draw", value: function (t, e, i, n, o, r) { return this._drawShape(t, "triangleDown", 3, e, i, n, o, r) } }, { key: "distanceToBorder", value: function (t, e) { return this._distanceToBorder(t, e) } }]), i }(uu), Wu = !1, qu = "background: #FFeeee; color: #dd0000", Vu = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "validate", value: function (e, i, n) { Wu = !1, Lu = i; var o = i; return void 0 !== n && (o = i[n]), t.parse(e, o, []), Wu } }, { key: "parse", value: function (e, i, n) { for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.check(o, e, i, n) } }, { key: "check", value: function (e, i, n, o) { if (void 0 !== n[e] || void 0 !== n.__any__) { var r = e, s = !0; void 0 === n[e] && void 0 !== n.__any__ && (r = "__any__", s = "object" === t.getType(i[e])); var a = n[r]; s && void 0 !== a.__type__ && (a = a.__type__), t.checkFields(e, i, n, r, a, o) } else t.getSuggestion(e, n, o) } }, { key: "checkFields", value: function (e, i, n, o, r, s) { var a = function (i) { console.error("%c" + i + t.printLocation(s, e), qu) }, h = t.getType(i[e]), l = r[h]; void 0 !== l ? "array" === t.getType(l) && -1 === To(l).call(l, i[e]) ? (a('Invalid option detected in "' + e + '". Allowed values are:' + t.print(l) + ' not "' + i[e] + '". '), Wu = !0) : "object" === h && "__any__" !== o && (s = ts(s, e), t.parse(i[e], n[o], s)) : void 0 === r.any && (a('Invalid type received for "' + e + '". Expected: ' + t.print(rr(r)) + ". Received [" + h + '] "' + i[e] + '"'), Wu = !0) } }, { key: "getType", value: function (t) { var e = vr(t); return "object" === e ? null === t ? "null" : t instanceof Boolean ? "boolean" : t instanceof Number ? "number" : t instanceof String ? "string" : ur(t) ? "array" : t instanceof Date ? "date" : void 0 !== t.nodeType ? "dom" : !0 === t._isAMomentObject ? "moment" : "object" : "number" === e ? "number" : "boolean" === e ? "boolean" : "string" === e ? "string" : void 0 === e ? "undefined" : e } }, { key: "getSuggestion", value: function (e, i, n) { var o, r = t.findInOptions(e, i, n, !1), s = t.findInOptions(e, Lu, [], !0); o = void 0 !== r.indexMatch ? " in " + t.printLocation(r.path, e, "") + 'Perhaps it was incomplete? Did you mean: "' + r.indexMatch + '"?\n\n' : s.distance <= 4 && r.distance > s.distance ? " in " + t.printLocation(r.path, e, "") + "Perhaps it was misplaced? Matching option found at: " + t.printLocation(s.path, s.closestMatch, "") : r.distance <= 8 ? '. Did you mean "' + r.closestMatch + '"?' + t.printLocation(r.path, e) : ". Did you mean one of these: " + t.print(rr(i)) + t.printLocation(n, e), console.error('%cUnknown option detected: "' + e + '"' + o, qu), Wu = !0 } }, { key: "findInOptions", value: function (e, i, n) { var o = arguments.length > 3 && void 0 !== arguments[3] && arguments[3], r = 1e9, s = "", a = [], h = e.toLowerCase(), l = void 0; for (var d in i) { var c = void 0; if (void 0 !== i[d].__type__ && !0 === o) { var u = t.findInOptions(e, i[d], ts(n, d)); r > u.distance && (s = u.closestMatch, a = u.path, r = u.distance, l = u.indexMatch) } else { var f; -1 !== To(f = d.toLowerCase()).call(f, h) && (l = d), r > (c = t.levenshteinDistance(e, d)) && (s = d, a = es(n), r = c) } } return { closestMatch: s, path: a, distance: r, indexMatch: l } } }, { key: "printLocation", value: function (t, e) { for (var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "Problem value found at: \n", n = "\n\n" + i + "options = {\n", o = 0; o < t.length; o++) { for (var r = 0; r < o + 1; r++)n += " "; n += t[o] + ": {\n" } for (var s = 0; s < t.length + 1; s++)n += " "; n += e + "\n"; for (var a = 0; a < t.length + 1; a++) { for (var h = 0; h < t.length - a; h++)n += " "; n += "}\n" } return n + "\n\n" } }, { key: "print", value: function (t) { return Ed(t).replace(/(")|(\[)|(\])|(,"__type__")/g, "").replace(/(,)/g, ", ") } }, { key: "levenshteinDistance", value: function (t, e) { if (0 === t.length) return e.length; if (0 === e.length) return t.length; var i, n, o = []; for (i = 0; i <= e.length; i++)o[i] = [i]; for (n = 0; n <= t.length; n++)o[0][n] = n; for (i = 1; i <= e.length; i++)for (n = 1; n <= t.length; n++)e.charAt(i - 1) == t.charAt(n - 1) ? o[i][n] = o[i - 1][n - 1] : o[i][n] = Math.min(o[i - 1][n - 1] + 1, Math.min(o[i][n - 1] + 1, o[i - 1][n] + 1)); return o[e.length][t.length] } }]), t }(); function Uu(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function Yu(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = Uu(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = Uu(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } var Xu = function () { function t(e, i, n, o, r, s) { El(this, t), this.options = Es(r), this.globalOptions = r, this.defaultOptions = s, this.body = i, this.edges = [], this.id = void 0, this.imagelist = n, this.grouplist = o, this.x = void 0, this.y = void 0, this.baseSize = this.options.size, this.baseFontSize = this.options.font.size, this.predefinedPosition = !1, this.selected = !1, this.hover = !1, this.labelModule = new Qc(this.body, this.options, !1), this.setOptions(e) } return Sl(t, [{ key: "attachEdge", value: function (t) { var e; -1 === To(e = this.edges).call(e, t) && this.edges.push(t) } }, { key: "detachEdge", value: function (t) { var e, i, n = To(e = this.edges).call(e, t); -1 != n && Fs(i = this.edges).call(i, n, 1) } }, { key: "setOptions", value: function (e) { var i = this.options.shape; if (e) { if (void 0 !== e.color && (this._localColor = e.color), void 0 !== e.id && (this.id = e.id), void 0 === this.id) throw new Error("Node must have an id"); t.checkMass(e, this.id), void 0 !== e.x && (null === e.x ? (this.x = void 0, this.predefinedPosition = !1) : (this.x = Zn(e.x), this.predefinedPosition = !0)), void 0 !== e.y && (null === e.y ? (this.y = void 0, this.predefinedPosition = !1) : (this.y = Zn(e.y), this.predefinedPosition = !0)), void 0 !== e.size && (this.baseSize = e.size), void 0 !== e.value && (e.value = Wc(e.value)), t.parseOptions(this.options, e, !0, this.globalOptions, this.grouplist); var n = [e, this.options, this.defaultOptions]; return this.chooser = qc("node", n), this._load_images(), this.updateLabelModule(e), void 0 !== e.opacity && t.checkOpacity(e.opacity) && (this.options.opacity = e.opacity), this.updateShape(i), void 0 !== e.hidden || void 0 !== e.physics } } }, { key: "_load_images", value: function () { if (("circularImage" === this.options.shape || "image" === this.options.shape) && void 0 === this.options.image) throw new Error("Option image must be defined for node type '" + this.options.shape + "'"); if (void 0 !== this.options.image) { if (void 0 === this.imagelist) throw new Error("Internal Error: No images provided"); if ("string" == typeof this.options.image) this.imageObj = this.imagelist.load(this.options.image, this.options.brokenImage, this.id); else { if (void 0 === this.options.image.unselected) throw new Error("No unselected image provided"); this.imageObj = this.imagelist.load(this.options.image.unselected, this.options.brokenImage, this.id), void 0 !== this.options.image.selected ? this.imageObjAlt = this.imagelist.load(this.options.image.selected, this.options.brokenImage, this.id) : this.imageObjAlt = void 0 } } } }, { key: "getFormattingValues", value: function () { var t = { color: this.options.color.background, opacity: this.options.opacity, borderWidth: this.options.borderWidth, borderColor: this.options.color.border, size: this.options.size, borderDashes: this.options.shapeProperties.borderDashes, borderRadius: this.options.shapeProperties.borderRadius, shadow: this.options.shadow.enabled, shadowColor: this.options.shadow.color, shadowSize: this.options.shadow.size, shadowX: this.options.shadow.x, shadowY: this.options.shadow.y }; if (this.selected || this.hover ? !0 === this.chooser ? this.selected ? (null != this.options.borderWidthSelected ? t.borderWidth = this.options.borderWidthSelected : t.borderWidth *= 2, t.color = this.options.color.highlight.background, t.borderColor = this.options.color.highlight.border, t.shadow = this.options.shadow.enabled) : this.hover && (t.color = this.options.color.hover.background, t.borderColor = this.options.color.hover.border, t.shadow = this.options.shadow.enabled) : "function" == typeof this.chooser && (this.chooser(t, this.options.id, this.selected, this.hover), !1 === t.shadow && (t.shadowColor === this.options.shadow.color && t.shadowSize === this.options.shadow.size && t.shadowX === this.options.shadow.x && t.shadowY === this.options.shadow.y || (t.shadow = !0))) : t.shadow = this.options.shadow.enabled, void 0 !== this.options.opacity) { var e = this.options.opacity; t.borderColor = us(t.borderColor, e), t.color = us(t.color, e), t.shadowColor = us(t.shadowColor, e) } return t } }, { key: "updateLabelModule", value: function (e) { void 0 !== this.options.label && null !== this.options.label || (this.options.label = ""), t.updateGroupOptions(this.options, Yu(Yu({}, e), {}, { color: e && e.color || this._localColor || void 0 }), this.grouplist); var i = this.grouplist.get(this.options.group, !1), n = [e, this.options, i, this.globalOptions, this.defaultOptions]; this.labelModule.update(this.options, n), void 0 !== this.labelModule.baseSize && (this.baseFontSize = this.labelModule.baseSize) } }, { key: "updateShape", value: function (t) { if (t === this.options.shape && this.shape) this.shape.setOptions(this.options, this.imageObj, this.imageObjAlt); else switch (this.options.shape) { case "box": this.shape = new ou(this.options, this.body, this.labelModule); break; case "circle": this.shape = new hu(this.options, this.body, this.labelModule); break; case "circularImage": this.shape = new du(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt); break; case "custom": this.shape = new gu(this.options, this.body, this.labelModule, this.options.ctxRenderer); break; case "database": this.shape = new mu(this.options, this.body, this.labelModule); break; case "diamond": this.shape = new wu(this.options, this.body, this.labelModule); break; case "dot": this.shape = new _u(this.options, this.body, this.labelModule); break; case "ellipse": this.shape = new Eu(this.options, this.body, this.labelModule); break; case "icon": this.shape = new Su(this.options, this.body, this.labelModule); break; case "image": this.shape = new Tu(this.options, this.body, this.labelModule, this.imageObj, this.imageObjAlt); break; case "square": this.shape = new Mu(this.options, this.body, this.labelModule); break; case "hexagon": this.shape = new Iu(this.options, this.body, this.labelModule); break; case "star": this.shape = new zu(this.options, this.body, this.labelModule); break; case "text": this.shape = new Au(this.options, this.body, this.labelModule); break; case "triangle": this.shape = new ju(this.options, this.body, this.labelModule); break; case "triangleDown": this.shape = new Hu(this.options, this.body, this.labelModule); break; default: this.shape = new Eu(this.options, this.body, this.labelModule) }this.needsRefresh() } }, { key: "select", value: function () { this.selected = !0, this.needsRefresh() } }, { key: "unselect", value: function () { this.selected = !1, this.needsRefresh() } }, { key: "needsRefresh", value: function () { this.shape.refreshNeeded = !0 } }, { key: "getTitle", value: function () { return this.options.title } }, { key: "distanceToBorder", value: function (t, e) { return this.shape.distanceToBorder(t, e) } }, { key: "isFixed", value: function () { return this.options.fixed.x && this.options.fixed.y } }, { key: "isSelected", value: function () { return this.selected } }, { key: "getValue", value: function () { return this.options.value } }, { key: "getLabelSize", value: function () { return this.labelModule.size() } }, { key: "setValueRange", value: function (t, e, i) { if (void 0 !== this.options.value) { var n = this.options.scaling.customScalingFunction(t, e, i, this.options.value), o = this.options.scaling.max - this.options.scaling.min; if (!0 === this.options.scaling.label.enabled) { var r = this.options.scaling.label.max - this.options.scaling.label.min; this.options.font.size = this.options.scaling.label.min + n * r } this.options.size = this.options.scaling.min + n * o } else this.options.size = this.baseSize, this.options.font.size = this.baseFontSize; this.updateLabelModule() } }, { key: "draw", value: function (t) { var e = this.getFormattingValues(); return this.shape.draw(t, this.x, this.y, this.selected, this.hover, e) || {} } }, { key: "updateBoundingBox", value: function (t) { this.shape.updateBoundingBox(this.x, this.y, t) } }, { key: "resize", value: function (t) { var e = this.getFormattingValues(); this.shape.resize(t, this.selected, this.hover, e) } }, { key: "getItemsOnPoint", value: function (t) { var e = []; return this.labelModule.visible() && Vc(this.labelModule.getSize(), t) && e.push({ nodeId: this.id, labelId: 0 }), Vc(this.shape.boundingBox, t) && e.push({ nodeId: this.id }), e } }, { key: "isOverlappingWith", value: function (t) { return this.shape.left < t.right && this.shape.left + this.shape.width > t.left && this.shape.top < t.bottom && this.shape.top + this.shape.height > t.top } }, { key: "isBoundingBoxOverlappingWith", value: function (t) { return this.shape.boundingBox.left < t.right && this.shape.boundingBox.right > t.left && this.shape.boundingBox.top < t.bottom && this.shape.boundingBox.bottom > t.top } }], [{ key: "checkOpacity", value: function (t) { return 0 <= t && t <= 1 } }, { key: "checkCoordinateOrigin", value: function (t) { return void 0 === t || "center" === t || "top-left" === t } }, { key: "updateGroupOptions", value: function (e, i, n) { var o; if (void 0 !== n) { var r = e.group; if (void 0 !== i && void 0 !== i.group && r !== i.group) throw new Error("updateGroupOptions: group values in options don't match."); if ("number" == typeof r || "string" == typeof r && "" != r) { var s = n.get(r); void 0 !== s.opacity && void 0 === i.opacity && (t.checkOpacity(s.opacity) || (console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + s.opacity), s.opacity = void 0)); var a = yo(o = jc(i)).call(o, (function (t) { return null != i[t] })); a.push("font"), Qr(a, e, s), e.color = ps(e.color) } } } }, { key: "parseOptions", value: function (e, i) { var n = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, r = arguments.length > 4 ? arguments[4] : void 0, s = ["color", "fixed", "shadow"]; if (Qr(s, e, i, n), t.checkMass(i), void 0 !== e.opacity && (t.checkOpacity(e.opacity) || (console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + e.opacity), e.opacity = void 0)), void 0 !== i.opacity && (t.checkOpacity(i.opacity) || (console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + i.opacity), i.opacity = void 0)), i.shapeProperties && !t.checkCoordinateOrigin(i.shapeProperties.coordinateOrigin) && console.error("Invalid option for node coordinateOrigin, found: " + i.shapeProperties.coordinateOrigin), Os(e, i, "shadow", o), void 0 !== i.color && null !== i.color) { var a = ps(i.color); Kr(e.color, a) } else !0 === n && null === i.color && (e.color = Es(o.color)); void 0 !== i.fixed && null !== i.fixed && ("boolean" == typeof i.fixed ? (e.fixed.x = i.fixed, e.fixed.y = i.fixed) : (void 0 !== i.fixed.x && "boolean" == typeof i.fixed.x && (e.fixed.x = i.fixed.x), void 0 !== i.fixed.y && "boolean" == typeof i.fixed.y && (e.fixed.y = i.fixed.y))), !0 === n && null === i.font && (e.font = Es(o.font)), t.updateGroupOptions(e, i, r), void 0 !== i.scaling && Os(e.scaling, i.scaling, "label", o.scaling) } }, { key: "checkMass", value: function (t, e) { if (void 0 !== t.mass && t.mass <= 0) { var i = ""; void 0 !== e && (i = " in node id: " + e), console.error("%cNegative or zero mass disallowed" + i + ", setting mass to 1.", qu), t.mass = 1 } } }]), t }(); function Gu(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return Ku(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ku(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function Ku(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } var $u = function () { function t(e, i, n, o) { var r, s = this; if (El(this, t), this.body = e, this.images = i, this.groups = n, this.layoutEngine = o, this.body.functions.createNode = Z(r = this.create).call(r, this), this.nodesListeners = { add: function (t, e) { s.add(e.items) }, update: function (t, e) { s.update(e.items, e.data, e.oldData) }, remove: function (t, e) { s.remove(e.items) } }, this.defaultOptions = { borderWidth: 1, borderWidthSelected: void 0, brokenImage: void 0, color: { border: "#2B7CE9", background: "#97C2FC", highlight: { border: "#2B7CE9", background: "#D2E5FF" }, hover: { border: "#2B7CE9", background: "#D2E5FF" } }, opacity: void 0, fixed: { x: !1, y: !1 }, font: { color: "#343434", size: 14, face: "arial", background: "none", strokeWidth: 0, strokeColor: "#ffffff", align: "center", vadjust: 0, multi: !1, bold: { mod: "bold" }, boldital: { mod: "bold italic" }, ital: { mod: "italic" }, mono: { mod: "", size: 15, face: "monospace", vadjust: 2 } }, group: void 0, hidden: !1, icon: { face: "FontAwesome", code: void 0, size: 50, color: "#2B7CE9" }, image: void 0, imagePadding: { top: 0, right: 0, bottom: 0, left: 0 }, label: void 0, labelHighlightBold: !0, level: void 0, margin: { top: 5, right: 5, bottom: 5, left: 5 }, mass: 1, physics: !0, scaling: { min: 10, max: 30, label: { enabled: !1, min: 14, max: 30, maxVisible: 30, drawThreshold: 5 }, customScalingFunction: function (t, e, i, n) { if (e === t) return .5; var o = 1 / (e - t); return Math.max(0, (n - t) * o) } }, shadow: { enabled: !1, color: "rgba(0,0,0,0.5)", size: 10, x: 5, y: 5 }, shape: "ellipse", shapeProperties: { borderDashes: !1, borderRadius: 6, interpolation: !0, useImageSize: !1, useBorderWithImage: !1, coordinateOrigin: "center" }, size: 25, title: void 0, value: void 0, x: void 0, y: void 0 }, this.defaultOptions.mass <= 0) throw "Internal error: mass in defaultOptions of NodesHandler may not be zero or negative"; this.options = Es(this.defaultOptions), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t, e, i = this; this.body.emitter.on("refreshNodes", Z(t = this.refresh).call(t, this)), this.body.emitter.on("refresh", Z(e = this.refresh).call(e, this)), this.body.emitter.on("destroy", (function () { ss(i.nodesListeners, (function (t, e) { i.body.data.nodes && i.body.data.nodes.off(e, t) })), delete i.body.functions.createNode, delete i.nodesListeners.add, delete i.nodesListeners.update, delete i.nodesListeners.remove, delete i.nodesListeners })) } }, { key: "setOptions", value: function (t) { if (void 0 !== t) { if (Xu.parseOptions(this.options, t), void 0 !== t.opacity && (ad(t.opacity) || !sd(t.opacity) || t.opacity < 0 || t.opacity > 1 ? console.error("Invalid option for node opacity. Value must be between 0 and 1, found: " + t.opacity) : this.options.opacity = t.opacity), void 0 !== t.shape) for (var e in this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, e) && this.body.nodes[e].updateShape(); if (void 0 !== t.font || void 0 !== t.widthConstraint || void 0 !== t.heightConstraint) for (var i = 0, n = rr(this.body.nodes); i < n.length; i++) { var o = n[i]; this.body.nodes[o].updateLabelModule(), this.body.nodes[o].needsRefresh() } if (void 0 !== t.size) for (var r in this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, r) && this.body.nodes[r].needsRefresh(); void 0 === t.hidden && void 0 === t.physics || this.body.emitter.emit("_dataChanged") } } }, { key: "setData", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.body.data.nodes; if (Bc("id", t)) this.body.data.nodes = t; else if (ur(t)) this.body.data.nodes = new Mc, this.body.data.nodes.add(t); else { if (t) throw new TypeError("Array or DataSet expected"); this.body.data.nodes = new Mc } if (i && ss(this.nodesListeners, (function (t, e) { i.off(e, t) })), this.body.nodes = {}, this.body.data.nodes) { var n = this; ss(this.nodesListeners, (function (t, e) { n.body.data.nodes.on(e, t) })); var o = this.body.data.nodes.getIds(); this.add(o, !0) } !1 === e && this.body.emitter.emit("_dataChanged") } }, { key: "add", value: function (t) { for (var e, i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = [], o = 0; o < t.length; o++) { e = t[o]; var r = this.body.data.nodes.get(e), s = this.create(r); n.push(s), this.body.nodes[e] = s } this.layoutEngine.positionInitially(n), !1 === i && this.body.emitter.emit("_dataChanged") } }, { key: "update", value: function (t, e, i) { for (var n = this.body.nodes, o = !1, r = 0; r < t.length; r++) { var s = t[r], a = n[s], h = e[r]; void 0 !== a ? a.setOptions(h) && (o = !0) : (o = !0, a = this.create(h), n[s] = a) } o || void 0 === i || (o = nd(e).call(e, (function (t, e) { var n = i[e]; return n && n.level !== t.level }))), !0 === o ? this.body.emitter.emit("_dataChanged") : this.body.emitter.emit("_dataUpdated") } }, { key: "remove", value: function (t) { for (var e = this.body.nodes, i = 0; i < t.length; i++) { delete e[t[i]] } this.body.emitter.emit("_dataChanged") } }, { key: "create", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Xu; return new e(t, this.body, this.images, this.groups, this.options, this.defaultOptions) } }, { key: "refresh", value: function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; ss(this.body.nodes, (function (i, n) { var o = t.body.data.nodes.get(n); void 0 !== o && (!0 === e && i.setOptions({ x: null, y: null }), i.setOptions({ fixed: !1 }), i.setOptions(o)) })) } }, { key: "getPositions", value: function (t) { var e = {}; if (void 0 !== t) { if (!0 === ur(t)) { for (var i = 0; i < t.length; i++)if (void 0 !== this.body.nodes[t[i]]) { var n = this.body.nodes[t[i]]; e[t[i]] = { x: Math.round(n.x), y: Math.round(n.y) } } } else if (void 0 !== this.body.nodes[t]) { var o = this.body.nodes[t]; e[t] = { x: Math.round(o.x), y: Math.round(o.y) } } } else for (var r = 0; r < this.body.nodeIndices.length; r++) { var s = this.body.nodes[this.body.nodeIndices[r]]; e[this.body.nodeIndices[r]] = { x: Math.round(s.x), y: Math.round(s.y) } } return e } }, { key: "getPosition", value: function (t) { if (null == t) throw new TypeError("No id was specified for getPosition method."); if (null == this.body.nodes[t]) throw new ReferenceError("NodeId provided for getPosition does not exist. Provided: ".concat(t)); return { x: Math.round(this.body.nodes[t].x), y: Math.round(this.body.nodes[t].y) } } }, { key: "storePositions", value: function () { var t, e = [], i = this.body.data.nodes.getDataSet(), n = Gu(i.get()); try { for (n.s(); !(t = n.n()).done;) { var o = t.value, r = o.id, s = this.body.nodes[r], a = Math.round(s.x), h = Math.round(s.y); o.x === a && o.y === h || e.push({ id: r, x: a, y: h }) } } catch (t) { n.e(t) } finally { n.f() } i.update(e) } }, { key: "getBoundingBox", value: function (t) { if (void 0 !== this.body.nodes[t]) return this.body.nodes[t].shape.boundingBox } }, { key: "getConnectedNodes", value: function (t, e) { var i = []; if (void 0 !== this.body.nodes[t]) for (var n = this.body.nodes[t], o = {}, r = 0; r < n.edges.length; r++) { var s = n.edges[r]; "to" !== e && s.toId == n.id ? void 0 === o[s.fromId] && (i.push(s.fromId), o[s.fromId] = !0) : "from" !== e && s.fromId == n.id && void 0 === o[s.toId] && (i.push(s.toId), o[s.toId] = !0) } return i } }, { key: "getConnectedEdges", value: function (t) { var e = []; if (void 0 !== this.body.nodes[t]) for (var i = this.body.nodes[t], n = 0; n < i.edges.length; n++)e.push(i.edges[n].id); else console.error("NodeId provided for getConnectedEdges does not exist. Provided: ", t); return e } }, { key: "moveNode", value: function (t, e, i) { var n = this; void 0 !== this.body.nodes[t] ? (this.body.nodes[t].x = Number(e), this.body.nodes[t].y = Number(i), Zl((function () { n.body.emitter.emit("startSimulation") }), 0)) : console.error("Node id supplied to moveNode does not exist. Provided: ", t) } }]), t }(), Zu = Lt; q({ target: "Reflect", stat: !0 }, { get: function t(e, i) { var n, o, r = arguments.length < 3 ? e : arguments[2]; return F(e) === r ? e[i] : (n = S.f(e, i)) ? w(n, "value") ? n.value : void 0 === n.get ? void 0 : n.get.call(r) : y(o = Di(e)) ? t(o, i, r) : void 0 } }); var Qu = z.Reflect.get; var Ju = function (t, e) { for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = Rd(t));); return t }, tf = i((function (t) { function e(i, n, o) { return "undefined" != typeof Reflect && Qu ? t.exports = e = Qu : t.exports = e = function (t, e, i) { var n = Ju(t, e); if (n) { var o = Zu(n, e); return o.get ? o.get.call(i) : o.value } }, e(i, n, o || i) } t.exports = e })), ef = Math.hypot, nf = Math.abs, of = Math.sqrt, rf = !!ef && ef(1 / 0, NaN) !== 1 / 0; q({ target: "Math", stat: !0, forced: rf }, { hypot: function (t, e) { for (var i, n, o = 0, r = 0, s = arguments.length, a = 0; r < s;)a < (i = nf(arguments[r++])) ? (o = o * (n = a / i) * n + 1, a = i) : o += i > 0 ? (n = i / a) * n : i; return a === 1 / 0 ? 1 / 0 : a * of(o) } }); var sf = z.Math.hypot; function af(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var hf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "transform", value: function (t, e) { ur(t) || (t = [t]); for (var i = e.point.x, n = e.point.y, o = e.angle, r = e.length, s = 0; s < t.length; ++s) { var a = t[s], h = a.x * Math.cos(o) - a.y * Math.sin(o), l = a.x * Math.sin(o) + a.y * Math.cos(o); a.x = i + r * h, a.y = n + r * l } } }, { key: "drawPath", value: function (t, e) { t.beginPath(), t.moveTo(e[0].x, e[0].y); for (var i = 1; i < e.length; ++i)t.lineTo(e[i].x, e[i].y); t.closePath() } }]), t }(), lf = function (t) { Ad(i, t); var e = af(i); function i() { return El(this, i), e.apply(this, arguments) } return Sl(i, null, [{ key: "draw", value: function (t, e) { if (e.image) { t.save(), t.translate(e.point.x, e.point.y), t.rotate(Math.PI / 2 + e.angle); var i = null != e.imageWidth ? e.imageWidth : e.image.width, n = null != e.imageHeight ? e.imageHeight : e.image.height; e.image.drawImageAtPosition(t, 1, -i / 2, 0, i, n), t.restore() } return !1 } }]), i }(hf), df = function (t) { Ad(i, t); var e = af(i); function i() { return El(this, i), e.apply(this, arguments) } return Sl(i, null, [{ key: "draw", value: function (t, e) { var i = [{ x: 0, y: 0 }, { x: -1, y: .3 }, { x: -.9, y: 0 }, { x: -1, y: -.3 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), i }(hf), cf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: -1, y: 0 }, { x: 0, y: .3 }, { x: -.4, y: 0 }, { x: 0, y: -.3 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), uf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = { x: -.4, y: 0 }; hf.transform(i, e), t.strokeStyle = t.fillStyle, t.fillStyle = "rgba(0, 0, 0, 0)"; var n = Math.PI, o = e.angle - n / 2, r = e.angle + n / 2; return t.beginPath(), t.arc(i.x, i.y, .4 * e.length, o, r, !1), t.stroke(), !0 } }]), t }(), ff = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = { x: -.3, y: 0 }; hf.transform(i, e), t.strokeStyle = t.fillStyle, t.fillStyle = "rgba(0, 0, 0, 0)"; var n = Math.PI, o = e.angle + n / 2, r = e.angle + 3 * n / 2; return t.beginPath(), t.arc(i.x, i.y, .4 * e.length, o, r, !1), t.stroke(), !0 } }]), t }(), pf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: .02, y: 0 }, { x: -1, y: .3 }, { x: -1, y: -.3 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), vf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: 0, y: .3 }, { x: 0, y: -.3 }, { x: -1, y: 0 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), gf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = { x: -.4, y: 0 }; return hf.transform(i, e), bt(t, i.x, i.y, .4 * e.length), !0 } }]), t }(), yf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: 0, y: .5 }, { x: 0, y: -.5 }, { x: -.15, y: -.5 }, { x: -.15, y: .5 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), mf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: 0, y: .3 }, { x: 0, y: -.3 }, { x: -.6, y: -.3 }, { x: -.6, y: .3 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), bf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: 0, y: 0 }, { x: -.5, y: -.3 }, { x: -1, y: 0 }, { x: -.5, y: .3 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), wf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i = [{ x: -1, y: .3 }, { x: -.5, y: 0 }, { x: -1, y: -.3 }, { x: 0, y: 0 }]; return hf.transform(i, e), hf.drawPath(t, i), !0 } }]), t }(), kf = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "draw", value: function (t, e) { var i; switch (e.type && (i = e.type.toLowerCase()), i) { case "image": return lf.draw(t, e); case "circle": return gf.draw(t, e); case "box": return mf.draw(t, e); case "crow": return cf.draw(t, e); case "curve": return uf.draw(t, e); case "diamond": return bf.draw(t, e); case "inv_curve": return ff.draw(t, e); case "triangle": return pf.draw(t, e); case "inv_triangle": return vf.draw(t, e); case "bar": return yf.draw(t, e); case "vee": return wf.draw(t, e); case "arrow": default: return df.draw(t, e) } } }]), t }(); function _f(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function xf(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = _f(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = _f(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } var Ef = function () { function t(e, i, n) { El(this, t), this._body = i, this._labelModule = n, this.color = {}, this.colorDirty = !0, this.hoverWidth = 1.5, this.selectionWidth = 2, this.setOptions(e), this.fromPoint = this.from, this.toPoint = this.to } return Sl(t, [{ key: "connect", value: function () { this.from = this._body.nodes[this.options.from], this.to = this._body.nodes[this.options.to] } }, { key: "cleanup", value: function () { return !1 } }, { key: "setOptions", value: function (t) { this.options = t, this.from = this._body.nodes[this.options.from], this.to = this._body.nodes[this.options.to], this.id = this.options.id } }, { key: "drawLine", value: function (t, e, i, n) { var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : this.getViaNode(); t.strokeStyle = this.getColor(t, e), t.lineWidth = e.width, !1 !== e.dashes ? this._drawDashedLine(t, e, o) : this._drawLine(t, e, o) } }, { key: "_drawLine", value: function (t, e, i, n, o) { if (this.from != this.to) this._line(t, e, i, n, o); else { var r = this._getCircleData(t), s = ir(r, 3), a = s[0], h = s[1], l = s[2]; this._circle(t, e, a, h, l) } } }, { key: "_drawDashedLine", value: function (t, e, i, n, o) { t.lineCap = "round"; var r = ur(e.dashes) ? e.dashes : [5, 5]; if (void 0 !== t.setLineDash) { if (t.save(), t.setLineDash(r), t.lineDashOffset = 0, this.from != this.to) this._line(t, e, i); else { var s = this._getCircleData(t), a = ir(s, 3), h = a[0], l = a[1], d = a[2]; this._circle(t, e, h, l, d) } t.setLineDash([0]), t.lineDashOffset = 0, t.restore() } else { if (this.from != this.to) xt(t, this.from.x, this.from.y, this.to.x, this.to.y, r); else { var c = this._getCircleData(t), u = ir(c, 3), f = u[0], p = u[1], v = u[2]; this._circle(t, e, f, p, v) } this.enableShadow(t, e), t.stroke(), this.disableShadow(t, e) } } }, { key: "findBorderPosition", value: function (t, e, i) { return this.from != this.to ? this._findBorderPosition(t, e, i) : this._findBorderPositionCircle(t, e, i) } }, { key: "findBorderPositions", value: function (t) { if (this.from != this.to) return { from: this._findBorderPosition(this.from, t), to: this._findBorderPosition(this.to, t) }; var e, i = yr(e = this._getCircleData(t)).call(e, 0, 2), n = ir(i, 2), o = n[0], r = n[1]; return { from: this._findBorderPositionCircle(this.from, t, { x: o, y: r, low: .25, high: .6, direction: -1 }), to: this._findBorderPositionCircle(this.from, t, { x: o, y: r, low: .6, high: .8, direction: 1 }) } } }, { key: "_getCircleData", value: function (t) { var e = this.options.selfReference.size; void 0 !== t && void 0 === this.from.shape.width && this.from.shape.resize(t); var i = Yc(t, this.options.selfReference.angle, e, this.from); return [i.x, i.y, e] } }, { key: "_pointOnCircle", value: function (t, e, i, n) { var o = 2 * n * Math.PI; return { x: t + i * Math.cos(o), y: e - i * Math.sin(o) } } }, { key: "_findBorderPositionCircle", value: function (t, e, i) { var n, o = i.x, r = i.y, s = i.low, a = i.high, h = i.direction, l = this.options.selfReference.size, d = .5 * (s + a), c = 0; !0 === this.options.arrowStrikethrough && (-1 === h ? c = this.options.endPointOffset.from : 1 === h && (c = this.options.endPointOffset.to)); var u = 0; do { d = .5 * (s + a), n = this._pointOnCircle(o, r, l, d); var f = Math.atan2(t.y - n.y, t.x - n.x), p = t.distanceToBorder(e, f) + c - Math.sqrt(Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2)); if (Math.abs(p) < .05) break; p > 0 ? h > 0 ? s = d : a = d : h > 0 ? a = d : s = d, ++u } while (s <= a && u < 10); return xf(xf({}, n), {}, { t: d }) } }, { key: "getLineWidth", value: function (t, e) { return !0 === t ? Math.max(this.selectionWidth, .3 / this._body.view.scale) : !0 === e ? Math.max(this.hoverWidth, .3 / this._body.view.scale) : Math.max(this.options.width, .3 / this._body.view.scale) } }, { key: "getColor", value: function (t, e) { if (!1 !== e.inheritsColor) { if ("both" === e.inheritsColor && this.from.id !== this.to.id) { var i = t.createLinearGradient(this.from.x, this.from.y, this.to.x, this.to.y), n = this.from.options.color.highlight.border, o = this.to.options.color.highlight.border; return !1 === this.from.selected && !1 === this.to.selected ? (n = us(this.from.options.color.border, e.opacity), o = us(this.to.options.color.border, e.opacity)) : !0 === this.from.selected && !1 === this.to.selected ? o = this.to.options.color.border : !1 === this.from.selected && !0 === this.to.selected && (n = this.from.options.color.border), i.addColorStop(0, n), i.addColorStop(1, o), i } return "to" === e.inheritsColor ? us(this.to.options.color.border, e.opacity) : us(this.from.options.color.border, e.opacity) } return us(e.color, e.opacity) } }, { key: "_circle", value: function (t, e, i, n, o) { this.enableShadow(t, e); var r = 0, s = 2 * Math.PI; if (!this.options.selfReference.renderBehindTheNode) { var a = this.options.selfReference.angle, h = this.options.selfReference.angle + Math.PI, l = this._findBorderPositionCircle(this.from, t, { x: i, y: n, low: a, high: h, direction: -1 }), d = this._findBorderPositionCircle(this.from, t, { x: i, y: n, low: a, high: h, direction: 1 }); r = Math.atan2(l.y - n, l.x - i), s = Math.atan2(d.y - n, d.x - i) } t.beginPath(), t.arc(i, n, o, r, s, !1), t.stroke(), this.disableShadow(t, e) } }, { key: "getDistanceToEdge", value: function (t, e, i, n, o, r) { if (this.from != this.to) return this._getDistanceToEdge(t, e, i, n, o, r); var s = this._getCircleData(void 0), a = ir(s, 3), h = a[0], l = a[1], d = a[2], c = h - o, u = l - r; return Math.abs(Math.sqrt(c * c + u * u) - d) } }, { key: "_getDistanceToLine", value: function (t, e, i, n, o, r) { var s = i - t, a = n - e, h = ((o - t) * s + (r - e) * a) / (s * s + a * a); h > 1 ? h = 1 : h < 0 && (h = 0); var l = t + h * s - o, d = e + h * a - r; return Math.sqrt(l * l + d * d) } }, { key: "getArrowData", value: function (t, e, i, n, o, r) { var s, a, h, l, d, c, u, f = r.width; "from" === e ? (h = this.from, l = this.to, d = r.fromArrowScale < 0, c = Math.abs(r.fromArrowScale), u = r.fromArrowType) : "to" === e ? (h = this.to, l = this.from, d = r.toArrowScale < 0, c = Math.abs(r.toArrowScale), u = r.toArrowType) : (h = this.to, l = this.from, d = r.middleArrowScale < 0, c = Math.abs(r.middleArrowScale), u = r.middleArrowType); var p = 15 * c + 3 * f; if (h != l) { var v = p / sf(h.x - l.x, h.y - l.y); if ("middle" !== e) if (!0 === this.options.smooth.enabled) { var g = this._findBorderPosition(h, t, { via: i }), y = this.getPoint(g.t + v * ("from" === e ? 1 : -1), i); s = Math.atan2(g.y - y.y, g.x - y.x), a = g } else s = Math.atan2(h.y - l.y, h.x - l.x), a = this._findBorderPosition(h, t); else { var m = (d ? -v : v) / 2, b = this.getPoint(.5 + m, i), w = this.getPoint(.5 - m, i); s = Math.atan2(b.y - w.y, b.x - w.x), a = this.getPoint(.5, i) } } else { var k = this._getCircleData(t), _ = ir(k, 3), x = _[0], E = _[1], O = _[2]; if ("from" === e) { var S = this.options.selfReference.angle, C = this.options.selfReference.angle + Math.PI, T = this._findBorderPositionCircle(this.from, t, { x: x, y: E, low: S, high: C, direction: -1 }); s = -2 * T.t * Math.PI + 1.5 * Math.PI + .1 * Math.PI, a = T } else if ("to" === e) { var D = this.options.selfReference.angle, M = this.options.selfReference.angle + Math.PI, P = this._findBorderPositionCircle(this.from, t, { x: x, y: E, low: D, high: M, direction: 1 }); s = -2 * P.t * Math.PI + 1.5 * Math.PI - 1.1 * Math.PI, a = P } else { var I = this.options.selfReference.angle / (2 * Math.PI); a = this._pointOnCircle(x, E, O, I), s = -2 * I * Math.PI + 1.5 * Math.PI + .1 * Math.PI } } return { point: a, core: { x: a.x - .9 * p * Math.cos(s), y: a.y - .9 * p * Math.sin(s) }, angle: s, length: p, type: u } } }, { key: "drawArrowHead", value: function (t, e, i, n, o) { t.strokeStyle = this.getColor(t, e), t.fillStyle = t.strokeStyle, t.lineWidth = e.width, kf.draw(t, o) && (this.enableShadow(t, e), eu(t).call(t), this.disableShadow(t, e)) } }, { key: "enableShadow", value: function (t, e) { !0 === e.shadow && (t.shadowColor = e.shadowColor, t.shadowBlur = e.shadowSize, t.shadowOffsetX = e.shadowX, t.shadowOffsetY = e.shadowY) } }, { key: "disableShadow", value: function (t, e) { !0 === e.shadow && (t.shadowColor = "rgba(0,0,0,0)", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0) } }, { key: "drawBackground", value: function (t, e) { if (!1 !== e.background) { var i = { strokeStyle: t.strokeStyle, lineWidth: t.lineWidth, dashes: t.dashes }; t.strokeStyle = e.backgroundColor, t.lineWidth = e.backgroundSize, this.setStrokeDashed(t, e.backgroundDashes), t.stroke(), t.strokeStyle = i.strokeStyle, t.lineWidth = i.lineWidth, t.dashes = i.dashes, this.setStrokeDashed(t, e.dashes) } } }, { key: "setStrokeDashed", value: function (t, e) { if (!1 !== e) if (void 0 !== t.setLineDash) { var i = ur(e) ? e : [5, 5]; t.setLineDash(i) } else console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used."); else void 0 !== t.setLineDash ? t.setLineDash([]) : console.warn("setLineDash is not supported in this browser. The dashed stroke cannot be used.") } }]), t }(); function Of(t, e) { var i = rr(t); if (Ei) { var n = Ei(t); e && (n = yo(n).call(n, (function (e) { return Ht(t, e).enumerable }))), i.push.apply(i, n) } return i } function Sf(t) { for (var e = 1; e < arguments.length; e++) { var i, n = null != arguments[e] ? arguments[e] : {}; if (e % 2) Yn(i = Of(Object(n), !0)).call(i, (function (e) { xn(t, e, n[e]) })); else if (At) Dt(t, At(n)); else { var o; Yn(o = Of(Object(n))).call(o, (function (e) { Ct(t, e, Ht(n, e)) })) } } return t } function Cf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Tf = function (t) { Ad(i, t); var e = Cf(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_findBorderPositionBezier", value: function (t, e) { var i, n, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : this._getViaCoordinates(), r = 10, s = .2, a = !1, h = 1, l = 0, d = this.to, c = this.options.endPointOffset ? this.options.endPointOffset.to : 0; t.id === this.from.id && (d = this.from, a = !0, c = this.options.endPointOffset ? this.options.endPointOffset.from : 0), !1 === this.options.arrowStrikethrough && (c = 0); var u = 0; do { n = .5 * (l + h), i = this.getPoint(n, o); var f = Math.atan2(d.y - i.y, d.x - i.x), p = d.distanceToBorder(e, f) + c, v = Math.sqrt(Math.pow(i.x - d.x, 2) + Math.pow(i.y - d.y, 2)), g = p - v; if (Math.abs(g) < s) break; g < 0 ? !1 === a ? l = n : h = n : !1 === a ? h = n : l = n, ++u } while (l <= h && u < r); return Sf(Sf({}, i), {}, { t: n }) } }, { key: "_getDistanceToBezierEdge", value: function (t, e, i, n, o, r, s) { var a, h, l, d, c, u = 1e9, f = t, p = e; for (h = 1; h < 10; h++)l = .1 * h, d = Math.pow(1 - l, 2) * t + 2 * l * (1 - l) * s.x + Math.pow(l, 2) * i, c = Math.pow(1 - l, 2) * e + 2 * l * (1 - l) * s.y + Math.pow(l, 2) * n, h > 0 && (u = (a = this._getDistanceToLine(f, p, d, c, o, r)) < u ? a : u), f = d, p = c; return u } }, { key: "_bezierCurve", value: function (t, e, i, n) { t.beginPath(), t.moveTo(this.fromPoint.x, this.fromPoint.y), null != i && null != i.x ? null != n && null != n.x ? t.bezierCurveTo(i.x, i.y, n.x, n.y, this.toPoint.x, this.toPoint.y) : t.quadraticCurveTo(i.x, i.y, this.toPoint.x, this.toPoint.y) : t.lineTo(this.toPoint.x, this.toPoint.y), this.drawBackground(t, e), this.enableShadow(t, e), t.stroke(), this.disableShadow(t, e) } }, { key: "getViaNode", value: function () { return this._getViaCoordinates() } }]), i }(Ef); function Df(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Mf = function (t) { Ad(i, t); var e = Df(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o)).via = r.via, r._boundFunction = function () { r.positionBezierNode() }, r._body.emitter.on("_repositionBezierNodes", r._boundFunction), r } return Sl(i, [{ key: "setOptions", value: function (t) { tf(Rd(i.prototype), "setOptions", this).call(this, t); var e = !1; this.options.physics !== t.physics && (e = !0), this.options = t, this.id = this.options.id, this.from = this._body.nodes[this.options.from], this.to = this._body.nodes[this.options.to], this.setupSupportNode(), this.connect(), !0 === e && (this.via.setOptions({ physics: this.options.physics }), this.positionBezierNode()) } }, { key: "connect", value: function () { this.from = this._body.nodes[this.options.from], this.to = this._body.nodes[this.options.to], void 0 === this.from || void 0 === this.to || !1 === this.options.physics || this.from.id === this.to.id ? this.via.setOptions({ physics: !1 }) : this.via.setOptions({ physics: !0 }) } }, { key: "cleanup", value: function () { return this._body.emitter.off("_repositionBezierNodes", this._boundFunction), void 0 !== this.via && (delete this._body.nodes[this.via.id], this.via = void 0, !0) } }, { key: "setupSupportNode", value: function () { if (void 0 === this.via) { var t = "edgeId:" + this.id, e = this._body.functions.createNode({ id: t, shape: "circle", physics: !0, hidden: !0 }); this._body.nodes[t] = e, this.via = e, this.via.parentEdgeId = this.id, this.positionBezierNode() } } }, { key: "positionBezierNode", value: function () { void 0 !== this.via && void 0 !== this.from && void 0 !== this.to ? (this.via.x = .5 * (this.from.x + this.to.x), this.via.y = .5 * (this.from.y + this.to.y)) : void 0 !== this.via && (this.via.x = 0, this.via.y = 0) } }, { key: "_line", value: function (t, e, i) { this._bezierCurve(t, e, i) } }, { key: "_getViaCoordinates", value: function () { return this.via } }, { key: "getViaNode", value: function () { return this.via } }, { key: "getPoint", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.via; if (this.from === this.to) { var i = this._getCircleData(), n = ir(i, 3), o = n[0], r = n[1], s = n[2], a = 2 * Math.PI * (1 - t); return { x: o + s * Math.sin(a), y: r + s - s * (1 - Math.cos(a)) } } return { x: Math.pow(1 - t, 2) * this.fromPoint.x + 2 * t * (1 - t) * e.x + Math.pow(t, 2) * this.toPoint.x, y: Math.pow(1 - t, 2) * this.fromPoint.y + 2 * t * (1 - t) * e.y + Math.pow(t, 2) * this.toPoint.y } } }, { key: "_findBorderPosition", value: function (t, e) { return this._findBorderPositionBezier(t, e, this.via) } }, { key: "_getDistanceToEdge", value: function (t, e, i, n, o, r) { return this._getDistanceToBezierEdge(t, e, i, n, o, r, this.via) } }]), i }(Tf); function Pf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var If = function (t) { Ad(i, t); var e = Pf(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_line", value: function (t, e, i) { this._bezierCurve(t, e, i) } }, { key: "getViaNode", value: function () { return this._getViaCoordinates() } }, { key: "_getViaCoordinates", value: function () { var t, e, i = this.options.smooth.roundness, n = this.options.smooth.type, o = Math.abs(this.from.x - this.to.x), r = Math.abs(this.from.y - this.to.y); if ("discrete" === n || "diagonalCross" === n) { var s, a; s = a = o <= r ? i * r : i * o, this.from.x > this.to.x && (s = -s), this.from.y >= this.to.y && (a = -a); var h = this.from.x + s, l = this.from.y + a; return "discrete" === n && (o <= r ? h = o < i * r ? this.from.x : h : l = r < i * o ? this.from.y : l), { x: h, y: l } } if ("straightCross" === n) { var d = (1 - i) * o, c = (1 - i) * r; return o <= r ? (d = 0, this.from.y < this.to.y && (c = -c)) : (this.from.x < this.to.x && (d = -d), c = 0), { x: this.to.x + d, y: this.to.y + c } } if ("horizontal" === n) { var u = (1 - i) * o; return this.from.x < this.to.x && (u = -u), { x: this.to.x + u, y: this.from.y } } if ("vertical" === n) { var f = (1 - i) * r; return this.from.y < this.to.y && (f = -f), { x: this.from.x, y: this.to.y + f } } if ("curvedCW" === n) { o = this.to.x - this.from.x, r = this.from.y - this.to.y; var p = Math.sqrt(o * o + r * r), v = Math.PI, g = (Math.atan2(r, o) + (.5 * i + .5) * v) % (2 * v); return { x: this.from.x + (.5 * i + .5) * p * Math.sin(g), y: this.from.y + (.5 * i + .5) * p * Math.cos(g) } } if ("curvedCCW" === n) { o = this.to.x - this.from.x, r = this.from.y - this.to.y; var y = Math.sqrt(o * o + r * r), m = Math.PI, b = (Math.atan2(r, o) + (.5 * -i + .5) * m) % (2 * m); return { x: this.from.x + (.5 * i + .5) * y * Math.sin(b), y: this.from.y + (.5 * i + .5) * y * Math.cos(b) } } t = e = o <= r ? i * r : i * o, this.from.x > this.to.x && (t = -t), this.from.y >= this.to.y && (e = -e); var w = this.from.x + t, k = this.from.y + e; return o <= r ? w = this.from.x <= this.to.x ? this.to.x < w ? this.to.x : w : this.to.x > w ? this.to.x : w : k = this.from.y >= this.to.y ? this.to.y > k ? this.to.y : k : this.to.y < k ? this.to.y : k, { x: w, y: k } } }, { key: "_findBorderPosition", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}; return this._findBorderPositionBezier(t, e, i.via) } }, { key: "_getDistanceToEdge", value: function (t, e, i, n, o, r) { var s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : this._getViaCoordinates(); return this._getDistanceToBezierEdge(t, e, i, n, o, r, s) } }, { key: "getPoint", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._getViaCoordinates(), i = t, n = Math.pow(1 - i, 2) * this.fromPoint.x + 2 * i * (1 - i) * e.x + Math.pow(i, 2) * this.toPoint.x, o = Math.pow(1 - i, 2) * this.fromPoint.y + 2 * i * (1 - i) * e.y + Math.pow(i, 2) * this.toPoint.y; return { x: n, y: o } } }]), i }(Tf); function Bf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } function zf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Nf = function (t) { Ad(i, t); var e = zf(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_line", value: function (t, e, i) { var n = i[0], o = i[1]; this._bezierCurve(t, e, n, o) } }, { key: "_getViaCoordinates", value: function () { var t, e, i, n, o = this.from.x - this.to.x, r = this.from.y - this.to.y, s = this.options.smooth.roundness; return (Math.abs(o) > Math.abs(r) || !0 === this.options.smooth.forceDirection || "horizontal" === this.options.smooth.forceDirection) && "vertical" !== this.options.smooth.forceDirection ? (e = this.from.y, n = this.to.y, t = this.from.x - s * o, i = this.to.x + s * o) : (e = this.from.y - s * r, n = this.to.y + s * r, t = this.from.x, i = this.to.x), [{ x: t, y: e }, { x: i, y: n }] } }, { key: "getViaNode", value: function () { return this._getViaCoordinates() } }, { key: "_findBorderPosition", value: function (t, e) { return this._findBorderPositionBezier(t, e) } }, { key: "_getDistanceToEdge", value: function (t, e, i, n, o, r) { var s = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : this._getViaCoordinates(), a = ir(s, 2), h = a[0], l = a[1]; return this._getDistanceToBezierEdge2(t, e, i, n, o, r, h, l) } }, { key: "getPoint", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._getViaCoordinates(), i = ir(e, 2), n = i[0], o = i[1], r = t, s = [Math.pow(1 - r, 3), 3 * r * Math.pow(1 - r, 2), 3 * Math.pow(r, 2) * (1 - r), Math.pow(r, 3)], a = s[0] * this.fromPoint.x + s[1] * n.x + s[2] * o.x + s[3] * this.toPoint.x, h = s[0] * this.fromPoint.y + s[1] * n.y + s[2] * o.y + s[3] * this.toPoint.y; return { x: a, y: h } } }]), i }(function (t) { Ad(i, t); var e = Bf(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_getDistanceToBezierEdge2", value: function (t, e, i, n, o, r, s, a) { for (var h = 1e9, l = t, d = e, c = [0, 0, 0, 0], u = 1; u < 10; u++) { var f = .1 * u; c[0] = Math.pow(1 - f, 3), c[1] = 3 * f * Math.pow(1 - f, 2), c[2] = 3 * Math.pow(f, 2) * (1 - f), c[3] = Math.pow(f, 3); var p = c[0] * t + c[1] * s.x + c[2] * a.x + c[3] * i, v = c[0] * e + c[1] * s.y + c[2] * a.y + c[3] * n; if (u > 0) { var g = this._getDistanceToLine(l, d, p, v, o, r); h = g < h ? g : h } l = p, d = v } return h } }]), i }(Tf)); function Af(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Ff = function (t) { Ad(i, t); var e = Af(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_line", value: function (t, e) { t.beginPath(), t.moveTo(this.fromPoint.x, this.fromPoint.y), t.lineTo(this.toPoint.x, this.toPoint.y), this.enableShadow(t, e), t.stroke(), this.disableShadow(t, e) } }, { key: "getViaNode", value: function () { } }, { key: "getPoint", value: function (t) { return { x: (1 - t) * this.fromPoint.x + t * this.toPoint.x, y: (1 - t) * this.fromPoint.y + t * this.toPoint.y } } }, { key: "_findBorderPosition", value: function (t, e) { var i = this.to, n = this.from; t.id === this.from.id && (i = this.from, n = this.to); var o = Math.atan2(i.y - n.y, i.x - n.x), r = i.x - n.x, s = i.y - n.y, a = Math.sqrt(r * r + s * s), h = (a - t.distanceToBorder(e, o)) / a; return { x: (1 - h) * n.x + h * i.x, y: (1 - h) * n.y + h * i.y, t: 0 } } }, { key: "_getDistanceToEdge", value: function (t, e, i, n, o, r) { return this._getDistanceToLine(t, e, i, n, o, r) } }]), i }(Ef), jf = function () { function t(e, i, n, o, r) { if (El(this, t), void 0 === i) throw new Error("No body provided"); this.options = Es(o), this.globalOptions = o, this.defaultOptions = r, this.body = i, this.imagelist = n, this.id = void 0, this.fromId = void 0, this.toId = void 0, this.selected = !1, this.hover = !1, this.labelDirty = !0, this.baseWidth = this.options.width, this.baseFontSize = this.options.font.size, this.from = void 0, this.to = void 0, this.edgeType = void 0, this.connected = !1, this.labelModule = new Qc(this.body, this.options, !0), this.setOptions(e) } return Sl(t, [{ key: "setOptions", value: function (e) { if (e) { var i = void 0 !== e.physics && this.options.physics !== e.physics || void 0 !== e.hidden && (this.options.hidden || !1) !== (e.hidden || !1) || void 0 !== e.from && this.options.from !== e.from || void 0 !== e.to && this.options.to !== e.to; t.parseOptions(this.options, e, !0, this.globalOptions), void 0 !== e.id && (this.id = e.id), void 0 !== e.from && (this.fromId = e.from), void 0 !== e.to && (this.toId = e.to), void 0 !== e.title && (this.title = e.title), void 0 !== e.value && (e.value = Wc(e.value)); var n = [e, this.options, this.defaultOptions]; return this.chooser = qc("edge", n), this.updateLabelModule(e), i = this.updateEdgeType() || i, this._setInteractionWidths(), this.connect(), i } } }, { key: "getFormattingValues", value: function () { var t = !0 === this.options.arrows.to || !0 === this.options.arrows.to.enabled, e = !0 === this.options.arrows.from || !0 === this.options.arrows.from.enabled, i = !0 === this.options.arrows.middle || !0 === this.options.arrows.middle.enabled, n = this.options.color.inherit, o = { toArrow: t, toArrowScale: this.options.arrows.to.scaleFactor, toArrowType: this.options.arrows.to.type, toArrowSrc: this.options.arrows.to.src, toArrowImageWidth: this.options.arrows.to.imageWidth, toArrowImageHeight: this.options.arrows.to.imageHeight, middleArrow: i, middleArrowScale: this.options.arrows.middle.scaleFactor, middleArrowType: this.options.arrows.middle.type, middleArrowSrc: this.options.arrows.middle.src, middleArrowImageWidth: this.options.arrows.middle.imageWidth, middleArrowImageHeight: this.options.arrows.middle.imageHeight, fromArrow: e, fromArrowScale: this.options.arrows.from.scaleFactor, fromArrowType: this.options.arrows.from.type, fromArrowSrc: this.options.arrows.from.src, fromArrowImageWidth: this.options.arrows.from.imageWidth, fromArrowImageHeight: this.options.arrows.from.imageHeight, arrowStrikethrough: this.options.arrowStrikethrough, color: n ? void 0 : this.options.color.color, inheritsColor: n, opacity: this.options.color.opacity, hidden: this.options.hidden, length: this.options.length, shadow: this.options.shadow.enabled, shadowColor: this.options.shadow.color, shadowSize: this.options.shadow.size, shadowX: this.options.shadow.x, shadowY: this.options.shadow.y, dashes: this.options.dashes, width: this.options.width, background: this.options.background.enabled, backgroundColor: this.options.background.color, backgroundSize: this.options.background.size, backgroundDashes: this.options.background.dashes }; if (this.selected || this.hover) if (!0 === this.chooser) { if (this.selected) { var r = this.options.selectionWidth; "function" == typeof r ? o.width = r(o.width) : "number" == typeof r && (o.width += r), o.width = Math.max(o.width, .3 / this.body.view.scale), o.color = this.options.color.highlight, o.shadow = this.options.shadow.enabled } else if (this.hover) { var s = this.options.hoverWidth; "function" == typeof s ? o.width = s(o.width) : "number" == typeof s && (o.width += s), o.width = Math.max(o.width, .3 / this.body.view.scale), o.color = this.options.color.hover, o.shadow = this.options.shadow.enabled } } else "function" == typeof this.chooser && (this.chooser(o, this.options.id, this.selected, this.hover), void 0 !== o.color && (o.inheritsColor = !1), !1 === o.shadow && (o.shadowColor === this.options.shadow.color && o.shadowSize === this.options.shadow.size && o.shadowX === this.options.shadow.x && o.shadowY === this.options.shadow.y || (o.shadow = !0))); else o.shadow = this.options.shadow.enabled, o.width = Math.max(o.width, .3 / this.body.view.scale); return o } }, { key: "updateLabelModule", value: function (t) { var e = [t, this.options, this.globalOptions, this.defaultOptions]; this.labelModule.update(this.options, e), void 0 !== this.labelModule.baseSize && (this.baseFontSize = this.labelModule.baseSize) } }, { key: "updateEdgeType", value: function () { var t = this.options.smooth, e = !1, i = !0; return void 0 !== this.edgeType && ((this.edgeType instanceof Mf && !0 === t.enabled && "dynamic" === t.type || this.edgeType instanceof Nf && !0 === t.enabled && "cubicBezier" === t.type || this.edgeType instanceof If && !0 === t.enabled && "dynamic" !== t.type && "cubicBezier" !== t.type || this.edgeType instanceof Ff && !1 === t.type.enabled) && (i = !1), !0 === i && (e = this.cleanup())), !0 === i ? !0 === t.enabled ? "dynamic" === t.type ? (e = !0, this.edgeType = new Mf(this.options, this.body, this.labelModule)) : "cubicBezier" === t.type ? this.edgeType = new Nf(this.options, this.body, this.labelModule) : this.edgeType = new If(this.options, this.body, this.labelModule) : this.edgeType = new Ff(this.options, this.body, this.labelModule) : this.edgeType.setOptions(this.options), e } }, { key: "connect", value: function () { this.disconnect(), this.from = this.body.nodes[this.fromId] || void 0, this.to = this.body.nodes[this.toId] || void 0, this.connected = void 0 !== this.from && void 0 !== this.to, !0 === this.connected ? (this.from.attachEdge(this), this.to.attachEdge(this)) : (this.from && this.from.detachEdge(this), this.to && this.to.detachEdge(this)), this.edgeType.connect() } }, { key: "disconnect", value: function () { this.from && (this.from.detachEdge(this), this.from = void 0), this.to && (this.to.detachEdge(this), this.to = void 0), this.connected = !1 } }, { key: "getTitle", value: function () { return this.title } }, { key: "isSelected", value: function () { return this.selected } }, { key: "getValue", value: function () { return this.options.value } }, { key: "setValueRange", value: function (t, e, i) { if (void 0 !== this.options.value) { var n = this.options.scaling.customScalingFunction(t, e, i, this.options.value), o = this.options.scaling.max - this.options.scaling.min; if (!0 === this.options.scaling.label.enabled) { var r = this.options.scaling.label.max - this.options.scaling.label.min; this.options.font.size = this.options.scaling.label.min + n * r } this.options.width = this.options.scaling.min + n * o } else this.options.width = this.baseWidth, this.options.font.size = this.baseFontSize; this._setInteractionWidths(), this.updateLabelModule() } }, { key: "_setInteractionWidths", value: function () { "function" == typeof this.options.hoverWidth ? this.edgeType.hoverWidth = this.options.hoverWidth(this.options.width) : this.edgeType.hoverWidth = this.options.hoverWidth + this.options.width, "function" == typeof this.options.selectionWidth ? this.edgeType.selectionWidth = this.options.selectionWidth(this.options.width) : this.edgeType.selectionWidth = this.options.selectionWidth + this.options.width } }, { key: "draw", value: function (t) { var e = this.getFormattingValues(); if (!e.hidden) { var i = this.edgeType.getViaNode(); this.edgeType.drawLine(t, e, this.selected, this.hover, i), this.drawLabel(t, i) } } }, { key: "drawArrows", value: function (t) { var e = this.getFormattingValues(); if (!e.hidden) { var i = this.edgeType.getViaNode(), n = {}; this.edgeType.fromPoint = this.edgeType.from, this.edgeType.toPoint = this.edgeType.to, e.fromArrow && (n.from = this.edgeType.getArrowData(t, "from", i, this.selected, this.hover, e), !1 === e.arrowStrikethrough && (this.edgeType.fromPoint = n.from.core), e.fromArrowSrc && (n.from.image = this.imagelist.load(e.fromArrowSrc)), e.fromArrowImageWidth && (n.from.imageWidth = e.fromArrowImageWidth), e.fromArrowImageHeight && (n.from.imageHeight = e.fromArrowImageHeight)), e.toArrow && (n.to = this.edgeType.getArrowData(t, "to", i, this.selected, this.hover, e), !1 === e.arrowStrikethrough && (this.edgeType.toPoint = n.to.core), e.toArrowSrc && (n.to.image = this.imagelist.load(e.toArrowSrc)), e.toArrowImageWidth && (n.to.imageWidth = e.toArrowImageWidth), e.toArrowImageHeight && (n.to.imageHeight = e.toArrowImageHeight)), e.middleArrow && (n.middle = this.edgeType.getArrowData(t, "middle", i, this.selected, this.hover, e), e.middleArrowSrc && (n.middle.image = this.imagelist.load(e.middleArrowSrc)), e.middleArrowImageWidth && (n.middle.imageWidth = e.middleArrowImageWidth), e.middleArrowImageHeight && (n.middle.imageHeight = e.middleArrowImageHeight)), e.fromArrow && this.edgeType.drawArrowHead(t, e, this.selected, this.hover, n.from), e.middleArrow && this.edgeType.drawArrowHead(t, e, this.selected, this.hover, n.middle), e.toArrow && this.edgeType.drawArrowHead(t, e, this.selected, this.hover, n.to) } } }, { key: "drawLabel", value: function (t, e) { if (void 0 !== this.options.label) { var i, n = this.from, o = this.to; if (this.labelModule.differentState(this.selected, this.hover) && this.labelModule.getTextSize(t, this.selected, this.hover), n.id != o.id) { this.labelModule.pointToSelf = !1, i = this.edgeType.getPoint(.5, e), t.save(); var r = this._getRotation(t); 0 != r.angle && (t.translate(r.x, r.y), t.rotate(r.angle)), this.labelModule.draw(t, i.x, i.y, this.selected, this.hover), t.restore() } else { this.labelModule.pointToSelf = !0; var s = Yc(t, this.options.selfReference.angle, this.options.selfReference.size, n); i = this._pointOnCircle(s.x, s.y, this.options.selfReference.size, this.options.selfReference.angle), this.labelModule.draw(t, i.x, i.y, this.selected, this.hover) } } } }, { key: "getItemsOnPoint", value: function (t) { var e = []; if (this.labelModule.visible()) { var i = this._getRotation(); Vc(this.labelModule.getSize(), t, i) && e.push({ edgeId: this.id, labelId: 0 }) } var n = { left: t.x, top: t.y }; return this.isOverlappingWith(n) && e.push({ edgeId: this.id }), e } }, { key: "isOverlappingWith", value: function (t) { if (this.connected) { var e = this.from.x, i = this.from.y, n = this.to.x, o = this.to.y, r = t.left, s = t.top; return this.edgeType.getDistanceToEdge(e, i, n, o, r, s) < 10 } return !1 } }, { key: "_getRotation", value: function (t) { var e = this.edgeType.getViaNode(), i = this.edgeType.getPoint(.5, e); void 0 !== t && this.labelModule.calculateLabelSize(t, this.selected, this.hover, i.x, i.y); var n = { x: i.x, y: this.labelModule.size.yLine, angle: 0 }; if (!this.labelModule.visible()) return n; if ("horizontal" === this.options.font.align) return n; var o = this.from.y - this.to.y, r = this.from.x - this.to.x, s = Math.atan2(o, r); return (s < -1 && r < 0 || s > 0 && r < 0) && (s += Math.PI), n.angle = s, n } }, { key: "_pointOnCircle", value: function (t, e, i, n) { return { x: t + i * Math.cos(n), y: e - i * Math.sin(n) } } }, { key: "select", value: function () { this.selected = !0 } }, { key: "unselect", value: function () { this.selected = !1 } }, { key: "cleanup", value: function () { return this.edgeType.cleanup() } }, { key: "remove", value: function () { this.cleanup(), this.disconnect(), delete this.body.edges[this.id] } }, { key: "endPointsValid", value: function () { return void 0 !== this.body.nodes[this.fromId] && void 0 !== this.body.nodes[this.toId] } }], [{ key: "parseOptions", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], r = ["endPointOffset", "arrowStrikethrough", "id", "from", "hidden", "hoverWidth", "labelHighlightBold", "length", "line", "opacity", "physics", "scaling", "selectionWidth", "selfReferenceSize", "selfReference", "to", "title", "value", "width", "font", "chosen", "widthConstraint"]; if (Zr(r, t, e, i), void 0 !== e.endPointOffset && void 0 !== e.endPointOffset.from && (sd(e.endPointOffset.from) ? t.endPointOffset.from = e.endPointOffset.from : (t.endPointOffset.from = void 0 !== n.endPointOffset.from ? n.endPointOffset.from : 0, console.error("endPointOffset.from is not a valid number"))), void 0 !== e.endPointOffset && void 0 !== e.endPointOffset.to && (sd(e.endPointOffset.to) ? t.endPointOffset.to = e.endPointOffset.to : (t.endPointOffset.to = void 0 !== n.endPointOffset.to ? n.endPointOffset.to : 0, console.error("endPointOffset.to is not a valid number"))), Uc(e.label) ? t.label = e.label : Uc(t.label) || (t.label = void 0), Os(t, e, "smooth", n), Os(t, e, "shadow", n), Os(t, e, "background", n), void 0 !== e.dashes && null !== e.dashes ? t.dashes = e.dashes : !0 === i && null === e.dashes && (t.dashes = wn(n.dashes)), void 0 !== e.scaling && null !== e.scaling ? (void 0 !== e.scaling.min && (t.scaling.min = e.scaling.min), void 0 !== e.scaling.max && (t.scaling.max = e.scaling.max), Os(t.scaling, e.scaling, "label", n.scaling)) : !0 === i && null === e.scaling && (t.scaling = wn(n.scaling)), void 0 !== e.arrows && null !== e.arrows) if ("string" == typeof e.arrows) { var s = e.arrows.toLowerCase(); t.arrows.to.enabled = -1 != To(s).call(s, "to"), t.arrows.middle.enabled = -1 != To(s).call(s, "middle"), t.arrows.from.enabled = -1 != To(s).call(s, "from") } else { if ("object" !== vr(e.arrows)) throw new Error("The arrow newOptions can only be an object or a string. Refer to the documentation. You used:" + Ed(e.arrows)); Os(t.arrows, e.arrows, "to", n.arrows), Os(t.arrows, e.arrows, "middle", n.arrows), Os(t.arrows, e.arrows, "from", n.arrows) } else !0 === i && null === e.arrows && (t.arrows = wn(n.arrows)); if (void 0 !== e.color && null !== e.color) { var a = Yr(e.color) ? { color: e.color, highlight: e.color, hover: e.color, inherit: !1, opacity: 1 } : e.color, h = t.color; if (o) Jr(h, n.color, !1, i); else for (var l in h) Object.prototype.hasOwnProperty.call(h, l) && delete h[l]; if (Yr(h)) h.color = h, h.highlight = h, h.hover = h, h.inherit = !1, void 0 === a.opacity && (h.opacity = 1); else { var d = !1; void 0 !== a.color && (h.color = a.color, d = !0), void 0 !== a.highlight && (h.highlight = a.highlight, d = !0), void 0 !== a.hover && (h.hover = a.hover, d = !0), void 0 !== a.inherit && (h.inherit = a.inherit), void 0 !== a.opacity && (h.opacity = Math.min(1, Math.max(0, a.opacity))), !0 === d ? h.inherit = !1 : void 0 === h.inherit && (h.inherit = "from") } } else !0 === i && null === e.color && (t.color = Es(n.color)); !0 === i && null === e.font && (t.font = Es(n.font)), Object.prototype.hasOwnProperty.call(e, "selfReferenceSize") && (console.warn("The selfReferenceSize property has been deprecated. Please use selfReference property instead. The selfReference can be set like thise selfReference:{size:30, angle:Math.PI / 4}"), t.selfReference.size = e.selfReferenceSize) } }]), t }(), Rf = function () { function t(e, i, n) { var o, r = this; El(this, t), this.body = e, this.images = i, this.groups = n, this.body.functions.createEdge = Z(o = this.create).call(o, this), this.edgesListeners = { add: function (t, e) { r.add(e.items) }, update: function (t, e) { r.update(e.items) }, remove: function (t, e) { r.remove(e.items) } }, this.options = {}, this.defaultOptions = { arrows: { to: { enabled: !1, scaleFactor: 1, type: "arrow" }, middle: { enabled: !1, scaleFactor: 1, type: "arrow" }, from: { enabled: !1, scaleFactor: 1, type: "arrow" } }, endPointOffset: { from: 0, to: 0 }, arrowStrikethrough: !0, color: { color: "#848484", highlight: "#848484", hover: "#848484", inherit: "from", opacity: 1 }, dashes: !1, font: { color: "#343434", size: 14, face: "arial", background: "none", strokeWidth: 2, strokeColor: "#ffffff", align: "horizontal", multi: !1, vadjust: 0, bold: { mod: "bold" }, boldital: { mod: "bold italic" }, ital: { mod: "italic" }, mono: { mod: "", size: 15, face: "courier new", vadjust: 2 } }, hidden: !1, hoverWidth: 1.5, label: void 0, labelHighlightBold: !0, length: void 0, physics: !0, scaling: { min: 1, max: 15, label: { enabled: !0, min: 14, max: 30, maxVisible: 30, drawThreshold: 5 }, customScalingFunction: function (t, e, i, n) { if (e === t) return .5; var o = 1 / (e - t); return Math.max(0, (n - t) * o) } }, selectionWidth: 1.5, selfReference: { size: 20, angle: Math.PI / 4, renderBehindTheNode: !0 }, shadow: { enabled: !1, color: "rgba(0,0,0,0.5)", size: 10, x: 5, y: 5 }, background: { enabled: !1, color: "rgba(111,111,111,1)", size: 10, dashes: !1 }, smooth: { enabled: !0, type: "dynamic", forceDirection: "none", roundness: .5 }, title: void 0, width: 1, value: void 0 }, Jr(this.options, this.defaultOptions), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t, e, i = this; this.body.emitter.on("_forceDisableDynamicCurves", (function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; "dynamic" === t && (t = "continuous"); var n = !1; for (var o in i.body.edges) if (Object.prototype.hasOwnProperty.call(i.body.edges, o)) { var r = i.body.edges[o], s = i.body.data.edges.get(o); if (null != s) { var a = s.smooth; void 0 !== a && !0 === a.enabled && "dynamic" === a.type && (void 0 === t ? r.setOptions({ smooth: !1 }) : r.setOptions({ smooth: { type: t } }), n = !0) } } !0 === e && !0 === n && i.body.emitter.emit("_dataChanged") })), this.body.emitter.on("_dataUpdated", (function () { i.reconnectEdges() })), this.body.emitter.on("refreshEdges", Z(t = this.refresh).call(t, this)), this.body.emitter.on("refresh", Z(e = this.refresh).call(e, this)), this.body.emitter.on("destroy", (function () { ss(i.edgesListeners, (function (t, e) { i.body.data.edges && i.body.data.edges.off(e, t) })), delete i.body.functions.createEdge, delete i.edgesListeners.add, delete i.edgesListeners.update, delete i.edgesListeners.remove, delete i.edgesListeners })) } }, { key: "setOptions", value: function (t) { if (void 0 !== t) { jf.parseOptions(this.options, t, !0, this.defaultOptions, !0); var e = !1; if (void 0 !== t.smooth) for (var i in this.body.edges) Object.prototype.hasOwnProperty.call(this.body.edges, i) && (e = this.body.edges[i].updateEdgeType() || e); if (void 0 !== t.font) for (var n in this.body.edges) Object.prototype.hasOwnProperty.call(this.body.edges, n) && this.body.edges[n].updateLabelModule(); void 0 === t.hidden && void 0 === t.physics && !0 !== e || this.body.emitter.emit("_dataChanged") } } }, { key: "setData", value: function (t) { var e = this, i = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], n = this.body.data.edges; if (Bc("id", t)) this.body.data.edges = t; else if (ur(t)) this.body.data.edges = new Mc, this.body.data.edges.add(t); else { if (t) throw new TypeError("Array or DataSet expected"); this.body.data.edges = new Mc } if (n && ss(this.edgesListeners, (function (t, e) { n.off(e, t) })), this.body.edges = {}, this.body.data.edges) { ss(this.edgesListeners, (function (t, i) { e.body.data.edges.on(i, t) })); var o = this.body.data.edges.getIds(); this.add(o, !0) } this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"), !1 === i && this.body.emitter.emit("_dataChanged") } }, { key: "add", value: function (t) { for (var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], i = this.body.edges, n = this.body.data.edges, o = 0; o < t.length; o++) { var r = t[o], s = i[r]; s && s.disconnect(); var a = n.get(r, { showInternalIds: !0 }); i[r] = this.create(a) } this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"), !1 === e && this.body.emitter.emit("_dataChanged") } }, { key: "update", value: function (t) { for (var e = this.body.edges, i = this.body.data.edges, n = !1, o = 0; o < t.length; o++) { var r = t[o], s = i.get(r), a = e[r]; void 0 !== a ? (a.disconnect(), n = a.setOptions(s) || n, a.connect()) : (this.body.edges[r] = this.create(s), n = !0) } !0 === n ? (this.body.emitter.emit("_adjustEdgesForHierarchicalLayout"), this.body.emitter.emit("_dataChanged")) : this.body.emitter.emit("_dataUpdated") } }, { key: "remove", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if (0 !== t.length) { var i = this.body.edges; ss(t, (function (t) { var e = i[t]; void 0 !== e && e.remove() })), e && this.body.emitter.emit("_dataChanged") } } }, { key: "refresh", value: function () { var t = this; ss(this.body.edges, (function (e, i) { var n = t.body.data.edges.get(i); void 0 !== n && e.setOptions(n) })) } }, { key: "create", value: function (t) { return new jf(t, this.body, this.images, this.options, this.defaultOptions) } }, { key: "reconnectEdges", value: function () { var t, e = this.body.nodes, i = this.body.edges; for (t in e) Object.prototype.hasOwnProperty.call(e, t) && (e[t].edges = []); for (t in i) if (Object.prototype.hasOwnProperty.call(i, t)) { var n = i[t]; n.from = null, n.to = null, n.connect() } } }, { key: "getConnectedNodes", value: function (t) { var e = []; if (void 0 !== this.body.edges[t]) { var i = this.body.edges[t]; void 0 !== i.fromId && e.push(i.fromId), void 0 !== i.toId && e.push(i.toId) } return e } }, { key: "_updateState", value: function () { this._addMissingEdges(), this._removeInvalidEdges() } }, { key: "_removeInvalidEdges", value: function () { var t = this, e = []; ss(this.body.edges, (function (i, n) { var o = t.body.nodes[i.toId], r = t.body.nodes[i.fromId]; void 0 !== o && !0 === o.isCluster || void 0 !== r && !0 === r.isCluster || void 0 !== o && void 0 !== r || e.push(n) })), this.remove(e, !1) } }, { key: "_addMissingEdges", value: function () { var t = this.body.data.edges; if (null != t) { var e = this.body.edges, i = []; Yn(t).call(t, (function (t, n) { void 0 === e[n] && i.push(n) })), this.add(i, !0) } } }]), t }(), Lf = function () { function t(e, i, n) { El(this, t), this.body = e, this.physicsBody = i, this.barnesHutTree, this.setOptions(n), this._rng = Ar("BARNES HUT SOLVER") } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t, this.thetaInversed = 1 / this.options.theta, this.overlapAvoidanceFactor = 1 - Math.max(0, Math.min(1, this.options.avoidOverlap)) } }, { key: "solve", value: function () { if (0 !== this.options.gravitationalConstant && this.physicsBody.physicsNodeIndices.length > 0) { var t, e = this.body.nodes, i = this.physicsBody.physicsNodeIndices, n = i.length, o = this._formBarnesHutTree(e, i); this.barnesHutTree = o; for (var r = 0; r < n; r++)(t = e[i[r]]).options.mass > 0 && this._getForceContributions(o.root, t) } } }, { key: "_getForceContributions", value: function (t, e) { this._getForceContribution(t.children.NW, e), this._getForceContribution(t.children.NE, e), this._getForceContribution(t.children.SW, e), this._getForceContribution(t.children.SE, e) } }, { key: "_getForceContribution", value: function (t, e) { if (t.childrenCount > 0) { var i = t.centerOfMass.x - e.x, n = t.centerOfMass.y - e.y, o = Math.sqrt(i * i + n * n); o * t.calcSize > this.thetaInversed ? this._calculateForces(o, i, n, e, t) : 4 === t.childrenCount ? this._getForceContributions(t, e) : t.children.data.id != e.id && this._calculateForces(o, i, n, e, t) } } }, { key: "_calculateForces", value: function (t, e, i, n, o) { 0 === t && (e = t = .1), this.overlapAvoidanceFactor < 1 && n.shape.radius && (t = Math.max(.1 + this.overlapAvoidanceFactor * n.shape.radius, t - n.shape.radius)); var r = this.options.gravitationalConstant * o.mass * n.options.mass / Math.pow(t, 3), s = e * r, a = i * r; this.physicsBody.forces[n.id].x += s, this.physicsBody.forces[n.id].y += a } }, { key: "_formBarnesHutTree", value: function (t, e) { for (var i, n = e.length, o = t[e[0]].x, r = t[e[0]].y, s = t[e[0]].x, a = t[e[0]].y, h = 1; h < n; h++) { var l = t[e[h]], d = l.x, c = l.y; l.options.mass > 0 && (d < o && (o = d), d > s && (s = d), c < r && (r = c), c > a && (a = c)) } var u = Math.abs(s - o) - Math.abs(a - r); u > 0 ? (r -= .5 * u, a += .5 * u) : (o += .5 * u, s -= .5 * u); var f = Math.max(1e-5, Math.abs(s - o)), p = .5 * f, v = .5 * (o + s), g = .5 * (r + a), y = { root: { centerOfMass: { x: 0, y: 0 }, mass: 0, range: { minX: v - p, maxX: v + p, minY: g - p, maxY: g + p }, size: f, calcSize: 1 / f, children: { data: null }, maxWidth: 0, level: 0, childrenCount: 4 } }; this._splitBranch(y.root); for (var m = 0; m < n; m++)(i = t[e[m]]).options.mass > 0 && this._placeInTree(y.root, i); return y } }, { key: "_updateBranchMass", value: function (t, e) { var i = t.centerOfMass, n = t.mass + e.options.mass, o = 1 / n; i.x = i.x * t.mass + e.x * e.options.mass, i.x *= o, i.y = i.y * t.mass + e.y * e.options.mass, i.y *= o, t.mass = n; var r = Math.max(Math.max(e.height, e.radius), e.width); t.maxWidth = t.maxWidth < r ? r : t.maxWidth } }, { key: "_placeInTree", value: function (t, e, i) { 1 == i && void 0 !== i || this._updateBranchMass(t, e); var n, o = t.children.NW.range; n = o.maxX > e.x ? o.maxY > e.y ? "NW" : "SW" : o.maxY > e.y ? "NE" : "SE", this._placeInRegion(t, e, n) } }, { key: "_placeInRegion", value: function (t, e, i) { var n = t.children[i]; switch (n.childrenCount) { case 0: n.children.data = e, n.childrenCount = 1, this._updateBranchMass(n, e); break; case 1: n.children.data.x === e.x && n.children.data.y === e.y ? (e.x += this._rng(), e.y += this._rng()) : (this._splitBranch(n), this._placeInTree(n, e)); break; case 4: this._placeInTree(n, e) } } }, { key: "_splitBranch", value: function (t) { var e = null; 1 === t.childrenCount && (e = t.children.data, t.mass = 0, t.centerOfMass.x = 0, t.centerOfMass.y = 0), t.childrenCount = 4, t.children.data = null, this._insertRegion(t, "NW"), this._insertRegion(t, "NE"), this._insertRegion(t, "SW"), this._insertRegion(t, "SE"), null != e && this._placeInTree(t, e) } }, { key: "_insertRegion", value: function (t, e) { var i, n, o, r, s = .5 * t.size; switch (e) { case "NW": i = t.range.minX, n = t.range.minX + s, o = t.range.minY, r = t.range.minY + s; break; case "NE": i = t.range.minX + s, n = t.range.maxX, o = t.range.minY, r = t.range.minY + s; break; case "SW": i = t.range.minX, n = t.range.minX + s, o = t.range.minY + s, r = t.range.maxY; break; case "SE": i = t.range.minX + s, n = t.range.maxX, o = t.range.minY + s, r = t.range.maxY }t.children[e] = { centerOfMass: { x: 0, y: 0 }, mass: 0, range: { minX: i, maxX: n, minY: o, maxY: r }, size: .5 * t.size, calcSize: 2 * t.calcSize, children: { data: null }, maxWidth: 0, level: t.level + 1, childrenCount: 0 } } }, { key: "_debug", value: function (t, e) { void 0 !== this.barnesHutTree && (t.lineWidth = 1, this._drawBranch(this.barnesHutTree.root, t, e)) } }, { key: "_drawBranch", value: function (t, e, i) { void 0 === i && (i = "#FF0000"), 4 === t.childrenCount && (this._drawBranch(t.children.NW, e), this._drawBranch(t.children.NE, e), this._drawBranch(t.children.SE, e), this._drawBranch(t.children.SW, e)), e.strokeStyle = i, e.beginPath(), e.moveTo(t.range.minX, t.range.minY), e.lineTo(t.range.maxX, t.range.minY), e.stroke(), e.beginPath(), e.moveTo(t.range.maxX, t.range.minY), e.lineTo(t.range.maxX, t.range.maxY), e.stroke(), e.beginPath(), e.moveTo(t.range.maxX, t.range.maxY), e.lineTo(t.range.minX, t.range.maxY), e.stroke(), e.beginPath(), e.moveTo(t.range.minX, t.range.maxY), e.lineTo(t.range.minX, t.range.minY), e.stroke() } }]), t }(), Hf = function () { function t(e, i, n) { El(this, t), this._rng = Ar("REPULSION SOLVER"), this.body = e, this.physicsBody = i, this.setOptions(n) } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t } }, { key: "solve", value: function () { for (var t, e, i, n, o, r, s, a, h = this.body.nodes, l = this.physicsBody.physicsNodeIndices, d = this.physicsBody.forces, c = this.options.nodeDistance, u = -2 / 3 / c, f = 0; f < l.length - 1; f++) { s = h[l[f]]; for (var p = f + 1; p < l.length; p++)t = (a = h[l[p]]).x - s.x, e = a.y - s.y, 0 === (i = Math.sqrt(t * t + e * e)) && (t = i = .1 * this._rng()), i < 2 * c && (r = i < .5 * c ? 1 : u * i + 1.3333333333333333, n = t * (r /= i), o = e * r, d[s.id].x -= n, d[s.id].y -= o, d[a.id].x += n, d[a.id].y += o) } } }]), t }(), Wf = function () { function t(e, i, n) { El(this, t), this.body = e, this.physicsBody = i, this.setOptions(n) } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t, this.overlapAvoidanceFactor = Math.max(0, Math.min(1, this.options.avoidOverlap || 0)) } }, { key: "solve", value: function () { for (var t = this.body.nodes, e = this.physicsBody.physicsNodeIndices, i = this.physicsBody.forces, n = this.options.nodeDistance, o = 0; o < e.length - 1; o++)for (var r = t[e[o]], s = o + 1; s < e.length; s++) { var a = t[e[s]]; if (r.level === a.level) { var h = n + this.overlapAvoidanceFactor * ((r.shape.radius || 0) / 2 + (a.shape.radius || 0) / 2), l = a.x - r.x, d = a.y - r.y, c = Math.sqrt(l * l + d * d), u = void 0; u = c < h ? -Math.pow(.05 * c, 2) + Math.pow(.05 * h, 2) : 0, 0 !== c && (u /= c); var f = l * u, p = d * u; i[r.id].x -= f, i[r.id].y -= p, i[a.id].x += f, i[a.id].y += p } } } }]), t }(), qf = function () { function t(e, i, n) { El(this, t), this.body = e, this.physicsBody = i, this.setOptions(n) } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t } }, { key: "solve", value: function () { for (var t, e, i, n, o, r = this.physicsBody.physicsEdgeIndices, s = this.body.edges, a = 0; a < r.length; a++)!0 === (e = s[r[a]]).connected && e.toId !== e.fromId && void 0 !== this.body.nodes[e.toId] && void 0 !== this.body.nodes[e.fromId] && (void 0 !== e.edgeType.via ? (t = void 0 === e.options.length ? this.options.springLength : e.options.length, i = e.to, n = e.edgeType.via, o = e.from, this._calculateSpringForce(i, n, .5 * t), this._calculateSpringForce(n, o, .5 * t)) : (t = void 0 === e.options.length ? 1.5 * this.options.springLength : e.options.length, this._calculateSpringForce(e.from, e.to, t))) } }, { key: "_calculateSpringForce", value: function (t, e, i) { var n = t.x - e.x, o = t.y - e.y, r = Math.max(Math.sqrt(n * n + o * o), .01), s = this.options.springConstant * (i - r) / r, a = n * s, h = o * s; void 0 !== this.physicsBody.forces[t.id] && (this.physicsBody.forces[t.id].x += a, this.physicsBody.forces[t.id].y += h), void 0 !== this.physicsBody.forces[e.id] && (this.physicsBody.forces[e.id].x -= a, this.physicsBody.forces[e.id].y -= h) } }]), t }(), Vf = function () { function t(e, i, n) { El(this, t), this.body = e, this.physicsBody = i, this.setOptions(n) } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t } }, { key: "solve", value: function () { for (var t, e, i, n, o, r, s, a, h, l, d = this.body.edges, c = .5, u = this.physicsBody.physicsEdgeIndices, f = this.physicsBody.physicsNodeIndices, p = this.physicsBody.forces, v = 0; v < f.length; v++) { var g = f[v]; p[g].springFx = 0, p[g].springFy = 0 } for (var y = 0; y < u.length; y++)!0 === (e = d[u[y]]).connected && (t = void 0 === e.options.length ? this.options.springLength : e.options.length, i = e.from.x - e.to.x, n = e.from.y - e.to.y, a = 0 === (a = Math.sqrt(i * i + n * n)) ? .01 : a, o = i * (s = this.options.springConstant * (t - a) / a), r = n * s, e.to.level != e.from.level ? (void 0 !== p[e.toId] && (p[e.toId].springFx -= o, p[e.toId].springFy -= r), void 0 !== p[e.fromId] && (p[e.fromId].springFx += o, p[e.fromId].springFy += r)) : (void 0 !== p[e.toId] && (p[e.toId].x -= c * o, p[e.toId].y -= c * r), void 0 !== p[e.fromId] && (p[e.fromId].x += c * o, p[e.fromId].y += c * r))); s = 1; for (var m = 0; m < f.length; m++) { var b = f[m]; h = Math.min(s, Math.max(-s, p[b].springFx)), l = Math.min(s, Math.max(-s, p[b].springFy)), p[b].x += h, p[b].y += l } for (var w = 0, k = 0, _ = 0; _ < f.length; _++) { var x = f[_]; w += p[x].x, k += p[x].y } for (var E = w / f.length, O = k / f.length, S = 0; S < f.length; S++) { var C = f[S]; p[C].x -= E, p[C].y -= O } } }]), t }(), Uf = function () { function t(e, i, n) { El(this, t), this.body = e, this.physicsBody = i, this.setOptions(n) } return Sl(t, [{ key: "setOptions", value: function (t) { this.options = t } }, { key: "solve", value: function () { for (var t, e, i, n, o = this.body.nodes, r = this.physicsBody.physicsNodeIndices, s = this.physicsBody.forces, a = 0; a < r.length; a++) { t = -(n = o[r[a]]).x, e = -n.y, i = Math.sqrt(t * t + e * e), this._calculateForces(i, t, e, s, n) } } }, { key: "_calculateForces", value: function (t, e, i, n, o) { var r = 0 === t ? 0 : this.options.centralGravity / t; n[o.id].x = e * r, n[o.id].y = i * r } }]), t }(); function Yf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Xf = function (t) { Ad(i, t); var e = Yf(i); function i(t, n, o) { var r; return El(this, i), (r = e.call(this, t, n, o))._rng = Ar("FORCE ATLAS 2 BASED REPULSION SOLVER"), r } return Sl(i, [{ key: "_calculateForces", value: function (t, e, i, n, o) { 0 === t && (e = t = .1 * this._rng()), this.overlapAvoidanceFactor < 1 && n.shape.radius && (t = Math.max(.1 + this.overlapAvoidanceFactor * n.shape.radius, t - n.shape.radius)); var r = n.edges.length + 1, s = this.options.gravitationalConstant * o.mass * n.options.mass * r / Math.pow(t, 2), a = e * s, h = i * s; this.physicsBody.forces[n.id].x += a, this.physicsBody.forces[n.id].y += h } }]), i }(Lf); function Gf(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Kf = function (t) { Ad(i, t); var e = Gf(i); function i(t, n, o) { return El(this, i), e.call(this, t, n, o) } return Sl(i, [{ key: "_calculateForces", value: function (t, e, i, n, o) { if (t > 0) { var r = o.edges.length + 1, s = this.options.centralGravity * r * o.options.mass; n[o.id].x = e * s, n[o.id].y = i * s } } }]), i }(Uf), $f = function () { function t(e) { El(this, t), this.body = e, this.physicsBody = { physicsNodeIndices: [], physicsEdgeIndices: [], forces: {}, velocities: {} }, this.physicsEnabled = !0, this.simulationInterval = 1e3 / 60, this.requiresTimeout = !0, this.previousStates = {}, this.referenceState = {}, this.freezeCache = {}, this.renderTimer = void 0, this.adaptiveTimestep = !1, this.adaptiveTimestepEnabled = !1, this.adaptiveCounter = 0, this.adaptiveInterval = 3, this.stabilized = !1, this.startedStabilization = !1, this.stabilizationIterations = 0, this.ready = !1, this.options = {}, this.defaultOptions = { enabled: !0, barnesHut: { theta: .5, gravitationalConstant: -2e3, centralGravity: .3, springLength: 95, springConstant: .04, damping: .09, avoidOverlap: 0 }, forceAtlas2Based: { theta: .5, gravitationalConstant: -50, centralGravity: .01, springConstant: .08, springLength: 100, damping: .4, avoidOverlap: 0 }, repulsion: { centralGravity: .2, springLength: 200, springConstant: .05, nodeDistance: 100, damping: .09, avoidOverlap: 0 }, hierarchicalRepulsion: { centralGravity: 0, springLength: 100, springConstant: .01, nodeDistance: 120, damping: .09 }, maxVelocity: 50, minVelocity: .75, solver: "barnesHut", stabilization: { enabled: !0, iterations: 1e3, updateInterval: 50, onlyDynamicEdges: !1, fit: !0 }, timestep: .5, adaptiveTimestep: !0, wind: { x: 0, y: 0 } }, mt(this.options, this.defaultOptions), this.timestep = .5, this.layoutFailed = !1, this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t = this; this.body.emitter.on("initPhysics", (function () { t.initPhysics() })), this.body.emitter.on("_layoutFailed", (function () { t.layoutFailed = !0 })), this.body.emitter.on("resetPhysics", (function () { t.stopSimulation(), t.ready = !1 })), this.body.emitter.on("disablePhysics", (function () { t.physicsEnabled = !1, t.stopSimulation() })), this.body.emitter.on("restorePhysics", (function () { t.setOptions(t.options), !0 === t.ready && t.startSimulation() })), this.body.emitter.on("startSimulation", (function () { !0 === t.ready && t.startSimulation() })), this.body.emitter.on("stopSimulation", (function () { t.stopSimulation() })), this.body.emitter.on("destroy", (function () { t.stopSimulation(!1), t.body.emitter.off() })), this.body.emitter.on("_dataChanged", (function () { t.updatePhysicsData() })) } }, { key: "setOptions", value: function (t) { if (void 0 !== t) if (!1 === t) this.options.enabled = !1, this.physicsEnabled = !1, this.stopSimulation(); else if (!0 === t) this.options.enabled = !0, this.physicsEnabled = !0, this.startSimulation(); else { this.physicsEnabled = !0, Qr(["stabilization"], this.options, t), Os(this.options, t, "stabilization"), void 0 === t.enabled && (this.options.enabled = !0), !1 === this.options.enabled && (this.physicsEnabled = !1, this.stopSimulation()); var e = this.options.wind; e && (("number" != typeof e.x || ad(e.x)) && (e.x = 0), ("number" != typeof e.y || ad(e.y)) && (e.y = 0)), this.timestep = this.options.timestep } this.init() } }, { key: "init", value: function () { var t; "forceAtlas2Based" === this.options.solver ? (t = this.options.forceAtlas2Based, this.nodesSolver = new Xf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Kf(this.body, this.physicsBody, t)) : "repulsion" === this.options.solver ? (t = this.options.repulsion, this.nodesSolver = new Hf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)) : "hierarchicalRepulsion" === this.options.solver ? (t = this.options.hierarchicalRepulsion, this.nodesSolver = new Wf(this.body, this.physicsBody, t), this.edgesSolver = new Vf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)) : (t = this.options.barnesHut, this.nodesSolver = new Lf(this.body, this.physicsBody, t), this.edgesSolver = new qf(this.body, this.physicsBody, t), this.gravitySolver = new Uf(this.body, this.physicsBody, t)), this.modelOptions = t } }, { key: "initPhysics", value: function () { !0 === this.physicsEnabled && !0 === this.options.enabled ? !0 === this.options.stabilization.enabled ? this.stabilize() : (this.stabilized = !1, this.ready = !0, this.body.emitter.emit("fit", {}, this.layoutFailed), this.startSimulation()) : (this.ready = !0, this.body.emitter.emit("fit")) } }, { key: "startSimulation", value: function () { var t; !0 === this.physicsEnabled && !0 === this.options.enabled ? (this.stabilized = !1, this.adaptiveTimestep = !1, this.body.emitter.emit("_resizeNodes"), void 0 === this.viewFunction && (this.viewFunction = Z(t = this.simulationStep).call(t, this), this.body.emitter.on("initRedraw", this.viewFunction), this.body.emitter.emit("_startRendering"))) : this.body.emitter.emit("_redraw") } }, { key: "stopSimulation", value: function () { var t = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; this.stabilized = !0, !0 === t && this._emitStabilized(), void 0 !== this.viewFunction && (this.body.emitter.off("initRedraw", this.viewFunction), this.viewFunction = void 0, !0 === t && this.body.emitter.emit("_stopRendering")) } }, { key: "simulationStep", value: function () { var t = nr(); this.physicsTick(), (nr() - t < .4 * this.simulationInterval || !0 === this.runDoubleSpeed) && !1 === this.stabilized && (this.physicsTick(), this.runDoubleSpeed = !0), !0 === this.stabilized && this.stopSimulation() } }, { key: "_emitStabilized", value: function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.stabilizationIterations; (this.stabilizationIterations > 1 || !0 === this.startedStabilization) && Zl((function () { t.body.emitter.emit("stabilized", { iterations: e }), t.startedStabilization = !1, t.stabilizationIterations = 0 }), 0) } }, { key: "physicsStep", value: function () { this.gravitySolver.solve(), this.nodesSolver.solve(), this.edgesSolver.solve(), this.moveNodes() } }, { key: "adjustTimeStep", value: function () { !0 === this._evaluateStepQuality() ? this.timestep = 1.2 * this.timestep : this.timestep / 1.2 < this.options.timestep ? this.timestep = this.options.timestep : (this.adaptiveCounter = -1, this.timestep = Math.max(this.options.timestep, this.timestep / 1.2)) } }, { key: "physicsTick", value: function () { if (this._startStabilizing(), !0 !== this.stabilized) { if (!0 === this.adaptiveTimestep && !0 === this.adaptiveTimestepEnabled) this.adaptiveCounter % this.adaptiveInterval == 0 ? (this.timestep = 2 * this.timestep, this.physicsStep(), this.revert(), this.timestep = .5 * this.timestep, this.physicsStep(), this.physicsStep(), this.adjustTimeStep()) : this.physicsStep(), this.adaptiveCounter += 1; else this.timestep = this.options.timestep, this.physicsStep(); !0 === this.stabilized && this.revert(), this.stabilizationIterations++ } } }, { key: "updatePhysicsData", value: function () { this.physicsBody.forces = {}, this.physicsBody.physicsNodeIndices = [], this.physicsBody.physicsEdgeIndices = []; var t = this.body.nodes, e = this.body.edges; for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && !0 === t[i].options.physics && this.physicsBody.physicsNodeIndices.push(t[i].id); for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && !0 === e[n].options.physics && this.physicsBody.physicsEdgeIndices.push(e[n].id); for (var o = 0; o < this.physicsBody.physicsNodeIndices.length; o++) { var r = this.physicsBody.physicsNodeIndices[o]; this.physicsBody.forces[r] = { x: 0, y: 0 }, void 0 === this.physicsBody.velocities[r] && (this.physicsBody.velocities[r] = { x: 0, y: 0 }) } for (var s in this.physicsBody.velocities) void 0 === t[s] && delete this.physicsBody.velocities[s] } }, { key: "revert", value: function () { var t = rr(this.previousStates), e = this.body.nodes, i = this.physicsBody.velocities; this.referenceState = {}; for (var n = 0; n < t.length; n++) { var o = t[n]; void 0 !== e[o] ? !0 === e[o].options.physics && (this.referenceState[o] = { positions: { x: e[o].x, y: e[o].y } }, i[o].x = this.previousStates[o].vx, i[o].y = this.previousStates[o].vy, e[o].x = this.previousStates[o].x, e[o].y = this.previousStates[o].y) : delete this.previousStates[o] } } }, { key: "_evaluateStepQuality", value: function () { var t, e, i = this.body.nodes, n = this.referenceState; for (var o in this.referenceState) if (Object.prototype.hasOwnProperty.call(this.referenceState, o) && void 0 !== i[o] && (t = i[o].x - n[o].positions.x, e = i[o].y - n[o].positions.y, Math.sqrt(Math.pow(t, 2) + Math.pow(e, 2)) > .3)) return !1; return !0 } }, { key: "moveNodes", value: function () { for (var t = this.physicsBody.physicsNodeIndices, e = 0, i = 0, n = 0; n < t.length; n++) { var o = t[n], r = this._performStep(o); e = Math.max(e, r), i += r } this.adaptiveTimestepEnabled = i / t.length < 5, this.stabilized = e < this.options.minVelocity } }, { key: "calculateComponentVelocity", value: function (t, e, i) { t += (e - this.modelOptions.damping * t) / i * this.timestep; var n = this.options.maxVelocity || 1e9; return Math.abs(t) > n && (t = t > 0 ? n : -n), t } }, { key: "_performStep", value: function (t) { var e = this.body.nodes[t], i = this.physicsBody.forces[t]; this.options.wind && (i.x += this.options.wind.x, i.y += this.options.wind.y); var n = this.physicsBody.velocities[t]; return this.previousStates[t] = { x: e.x, y: e.y, vx: n.x, vy: n.y }, !1 === e.options.fixed.x ? (n.x = this.calculateComponentVelocity(n.x, i.x, e.options.mass), e.x += n.x * this.timestep) : (i.x = 0, n.x = 0), !1 === e.options.fixed.y ? (n.y = this.calculateComponentVelocity(n.y, i.y, e.options.mass), e.y += n.y * this.timestep) : (i.y = 0, n.y = 0), Math.sqrt(Math.pow(n.x, 2) + Math.pow(n.y, 2)) } }, { key: "_freezeNodes", value: function () { var t = this.body.nodes; for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e) && t[e].x && t[e].y) { var i = t[e].options.fixed; this.freezeCache[e] = { x: i.x, y: i.y }, i.x = !0, i.y = !0 } } }, { key: "_restoreFrozenNodes", value: function () { var t = this.body.nodes; for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && void 0 !== this.freezeCache[e] && (t[e].options.fixed.x = this.freezeCache[e].x, t[e].options.fixed.y = this.freezeCache[e].y); this.freezeCache = {} } }, { key: "stabilize", value: function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.options.stabilization.iterations; "number" != typeof e && (e = this.options.stabilization.iterations, console.error("The stabilize method needs a numeric amount of iterations. Switching to default: ", e)), 0 !== this.physicsBody.physicsNodeIndices.length ? (this.adaptiveTimestep = this.options.adaptiveTimestep, this.body.emitter.emit("_resizeNodes"), this.stopSimulation(), this.stabilized = !1, this.body.emitter.emit("_blockRedraw"), this.targetIterations = e, !0 === this.options.stabilization.onlyDynamicEdges && this._freezeNodes(), this.stabilizationIterations = 0, Zl((function () { return t._stabilizationBatch() }), 0)) : this.ready = !0 } }, { key: "_startStabilizing", value: function () { return !0 !== this.startedStabilization && (this.body.emitter.emit("startStabilizing"), this.startedStabilization = !0, !0) } }, { key: "_stabilizationBatch", value: function () { var t = this, e = function () { return !1 === t.stabilized && t.stabilizationIterations < t.targetIterations }, i = function () { t.body.emitter.emit("stabilizationProgress", { iterations: t.stabilizationIterations, total: t.targetIterations }) }; this._startStabilizing() && i(); for (var n, o = 0; e() && o < this.options.stabilization.updateInterval;)this.physicsTick(), o++; (i(), e()) ? Zl(Z(n = this._stabilizationBatch).call(n, this), 0) : this._finalizeStabilization() } }, { key: "_finalizeStabilization", value: function () { this.body.emitter.emit("_allowRedraw"), !0 === this.options.stabilization.fit && this.body.emitter.emit("fit"), !0 === this.options.stabilization.onlyDynamicEdges && this._restoreFrozenNodes(), this.body.emitter.emit("stabilizationIterationsDone"), this.body.emitter.emit("_requestRedraw"), !0 === this.stabilized ? this._emitStabilized() : this.startSimulation(), this.ready = !0 } }, { key: "_drawForces", value: function (t) { for (var e = 0; e < this.physicsBody.physicsNodeIndices.length; e++) { var i = this.physicsBody.physicsNodeIndices[e], n = this.body.nodes[i], o = this.physicsBody.forces[i], r = Math.sqrt(Math.pow(o.x, 2) + Math.pow(o.x, 2)), s = Math.min(Math.max(5, r), 15), a = 3 * s, h = bs((180 - 180 * Math.min(1, Math.max(0, .03 * r))) / 360, 1, 1), l = { x: n.x + 20 * o.x, y: n.y + 20 * o.y }; t.lineWidth = s, t.strokeStyle = h, t.beginPath(), t.moveTo(n.x, n.y), t.lineTo(l.x, l.y), t.stroke(); var d = Math.atan2(o.y, o.x); t.fillStyle = h, kf.draw(t, { type: "arrow", point: l, angle: d, length: a }), eu(t).call(t) } } }]), t }(), Zf = [].reverse, Qf = [1, 2]; q({ target: "Array", proto: !0, forced: String(Qf) === String(Qf.reverse()) }, { reverse: function () { return Vt(this) && (this.length = this.length), Zf.call(this) } }); var Jf = G("Array").reverse, tp = Array.prototype, ep = function (t) { var e = t.reverse; return t === tp || t instanceof Array && e === tp.reverse ? Jf : e }, ip = function () { function t() { El(this, t) } return Sl(t, null, [{ key: "getRange", value: function (t) { var e, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = 1e9, o = -1e9, r = 1e9, s = -1e9; if (i.length > 0) for (var a = 0; a < i.length; a++)r > (e = t[i[a]]).shape.boundingBox.left && (r = e.shape.boundingBox.left), s < e.shape.boundingBox.right && (s = e.shape.boundingBox.right), n > e.shape.boundingBox.top && (n = e.shape.boundingBox.top), o < e.shape.boundingBox.bottom && (o = e.shape.boundingBox.bottom); return 1e9 === r && -1e9 === s && 1e9 === n && -1e9 === o && (n = 0, o = 0, r = 0, s = 0), { minX: r, maxX: s, minY: n, maxY: o } } }, { key: "getRangeCore", value: function (t) { var e, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], n = 1e9, o = -1e9, r = 1e9, s = -1e9; if (i.length > 0) for (var a = 0; a < i.length; a++)r > (e = t[i[a]]).x && (r = e.x), s < e.x && (s = e.x), n > e.y && (n = e.y), o < e.y && (o = e.y); return 1e9 === r && -1e9 === s && 1e9 === n && -1e9 === o && (n = 0, o = 0, r = 0, s = 0), { minX: r, maxX: s, minY: n, maxY: o } } }, { key: "findCenter", value: function (t) { return { x: .5 * (t.maxX + t.minX), y: .5 * (t.maxY + t.minY) } } }, { key: "cloneOptions", value: function (t, e) { var i = {}; return void 0 === e || "node" === e ? (Jr(i, t.options, !0), i.x = t.x, i.y = t.y, i.amountOfConnections = t.edges.length) : Jr(i, t.options, !0), i } }]), t }(); function np(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var op = function (t) { Ad(i, t); var e = np(i); function i(t, n, o, r, s, a) { var h; return El(this, i), (h = e.call(this, t, n, o, r, s, a)).isCluster = !0, h.containedNodes = {}, h.containedEdges = {}, h } return Sl(i, [{ key: "_openChildCluster", value: function (t) { var e = this, i = this.body.nodes[t]; if (void 0 === this.containedNodes[t]) throw new Error("node with id: " + t + " not in current cluster"); if (!i.isCluster) throw new Error("node with id: " + t + " is not a cluster"); delete this.containedNodes[t], ss(i.edges, (function (t) { delete e.containedEdges[t.id] })), ss(i.containedNodes, (function (t, i) { e.containedNodes[i] = t })), i.containedNodes = {}, ss(i.containedEdges, (function (t, i) { e.containedEdges[i] = t })), i.containedEdges = {}, ss(i.edges, (function (t) { ss(e.edges, (function (i) { var n, o, r = To(n = i.clusteringEdgeReplacingIds).call(n, t.id); -1 !== r && (ss(t.clusteringEdgeReplacingIds, (function (t) { i.clusteringEdgeReplacingIds.push(t), e.body.edges[t].edgeReplacedById = i.id })), Fs(o = i.clusteringEdgeReplacingIds).call(o, r, 1)) })) })), i.edges = [] } }]), i }(Xu), rp = function () { function t(e) { var i = this; El(this, t), this.body = e, this.clusteredNodes = {}, this.clusteredEdges = {}, this.options = {}, this.defaultOptions = {}, mt(this.options, this.defaultOptions), this.body.emitter.on("_resetData", (function () { i.clusteredNodes = {}, i.clusteredEdges = {} })) } return Sl(t, [{ key: "clusterByHubsize", value: function (t, e) { void 0 === t ? t = this._getHubSize() : "object" === vr(t) && (e = this._checkOptions(t), t = this._getHubSize()); for (var i = [], n = 0; n < this.body.nodeIndices.length; n++) { var o = this.body.nodes[this.body.nodeIndices[n]]; o.edges.length >= t && i.push(o.id) } for (var r = 0; r < i.length; r++)this.clusterByConnection(i[r], e, !0); this.body.emitter.emit("_dataChanged") } }, { key: "cluster", value: function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, i = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if (void 0 === e.joinCondition) throw new Error("Cannot call clusterByNodeData without a joinCondition function in the options."); e = this._checkOptions(e); var n = {}, o = {}; ss(this.body.nodes, (function (i, r) { i.options && !0 === e.joinCondition(i.options) && (n[r] = i, ss(i.edges, (function (e) { void 0 === t.clusteredEdges[e.id] && (o[e.id] = e) }))) })), this._cluster(n, o, e, i) } }, { key: "clusterByEdgeCount", value: function (t, e) { var i = this, n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; e = this._checkOptions(e); for (var o, r, s, a = [], h = {}, l = function (n) { var l = {}, d = {}, c = i.body.nodeIndices[n], u = i.body.nodes[c]; if (void 0 === h[c]) { s = 0, r = []; for (var f = 0; f < u.edges.length; f++)o = u.edges[f], void 0 === i.clusteredEdges[o.id] && (o.toId !== o.fromId && s++, r.push(o)); if (s === t) { for (var p = function (t) { if (void 0 === e.joinCondition || null === e.joinCondition) return !0; var i = ip.cloneOptions(t); return e.joinCondition(i) }, v = !0, g = 0; g < r.length; g++) { o = r[g]; var y = i._getConnectedId(o, c); if (!p(u)) { v = !1; break } d[o.id] = o, l[c] = u, l[y] = i.body.nodes[y], h[c] = !0 } if (rr(l).length > 0 && rr(d).length > 0 && !0 === v) { var m = function () { for (var t = 0; t < a.length; ++t)for (var e in l) if (void 0 !== a[t].nodes[e]) return a[t] }(); if (void 0 !== m) { for (var b in l) void 0 === m.nodes[b] && (m.nodes[b] = l[b]); for (var w in d) void 0 === m.edges[w] && (m.edges[w] = d[w]) } else a.push({ nodes: l, edges: d }) } } } }, d = 0; d < this.body.nodeIndices.length; d++)l(d); for (var c = 0; c < a.length; c++)this._cluster(a[c].nodes, a[c].edges, e, !1); !0 === n && this.body.emitter.emit("_dataChanged") } }, { key: "clusterOutliers", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; this.clusterByEdgeCount(1, t, e) } }, { key: "clusterBridges", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; this.clusterByEdgeCount(2, t, e) } }, { key: "clusterByConnection", value: function (t, e) { var i, n = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; if (void 0 === t) throw new Error("No nodeId supplied to clusterByConnection!"); if (void 0 === this.body.nodes[t]) throw new Error("The nodeId given to clusterByConnection does not exist!"); var o = this.body.nodes[t]; void 0 === (e = this._checkOptions(e, o)).clusterNodeProperties.x && (e.clusterNodeProperties.x = o.x), void 0 === e.clusterNodeProperties.y && (e.clusterNodeProperties.y = o.y), void 0 === e.clusterNodeProperties.fixed && (e.clusterNodeProperties.fixed = {}, e.clusterNodeProperties.fixed.x = o.options.fixed.x, e.clusterNodeProperties.fixed.y = o.options.fixed.y); var r = {}, s = {}, a = o.id, h = ip.cloneOptions(o); r[a] = o; for (var l = 0; l < o.edges.length; l++) { var d = o.edges[l]; if (void 0 === this.clusteredEdges[d.id]) { var c = this._getConnectedId(d, a); if (void 0 === this.clusteredNodes[c]) if (c !== a) if (void 0 === e.joinCondition) s[d.id] = d, r[c] = this.body.nodes[c]; else { var u = ip.cloneOptions(this.body.nodes[c]); !0 === e.joinCondition(h, u) && (s[d.id] = d, r[c] = this.body.nodes[c]) } else s[d.id] = d } } var f = cr(i = rr(r)).call(i, (function (t) { return r[t].id })); for (var p in r) if (Object.prototype.hasOwnProperty.call(r, p)) for (var v = r[p], g = 0; g < v.edges.length; g++) { var y = v.edges[g]; To(f).call(f, this._getConnectedId(y, v.id)) > -1 && (s[y.id] = y) } this._cluster(r, s, e, n) } }, { key: "_createClusterEdges", value: function (t, e, i, n) { for (var o, r, s, a, h, l, d = rr(t), c = [], u = 0; u < d.length; u++) { s = t[r = d[u]]; for (var f = 0; f < s.edges.length; f++)o = s.edges[f], void 0 === this.clusteredEdges[o.id] && (o.toId == o.fromId ? e[o.id] = o : o.toId == r ? (a = i.id, l = h = o.fromId) : (a = o.toId, h = i.id, l = a), void 0 === t[l] && c.push({ edge: o, fromId: h, toId: a })) } for (var p = [], v = function (t) { for (var e = 0; e < p.length; e++) { var i = p[e], n = t.fromId === i.fromId && t.toId === i.toId, o = t.fromId === i.toId && t.toId === i.fromId; if (n || o) return i } return null }, g = 0; g < c.length; g++) { var y = c[g], m = y.edge, b = v(y); null === b ? (b = this._createClusteredEdge(y.fromId, y.toId, m, n), p.push(b)) : b.clusteringEdgeReplacingIds.push(m.id), this.body.edges[m.id].edgeReplacedById = b.id, this._backupEdgeOptions(m), m.setOptions({ physics: !1 }) } } }, { key: "_checkOptions", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return void 0 === t.clusterEdgeProperties && (t.clusterEdgeProperties = {}), void 0 === t.clusterNodeProperties && (t.clusterNodeProperties = {}), t } }, { key: "_cluster", value: function (t, e, i) { var n = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], o = []; for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && void 0 !== this.clusteredNodes[r] && o.push(r); for (var s = 0; s < o.length; ++s)delete t[o[s]]; if (0 != rr(t).length && (1 != rr(t).length || 1 == i.clusterNodeProperties.allowSingleNodeCluster)) { var a = Jr({}, i.clusterNodeProperties); if (void 0 !== i.processProperties) { var h = []; for (var l in t) if (Object.prototype.hasOwnProperty.call(t, l)) { var d = ip.cloneOptions(t[l]); h.push(d) } var c = []; for (var u in e) if (Object.prototype.hasOwnProperty.call(e, u) && "clusterEdge:" !== u.substr(0, 12)) { var f = ip.cloneOptions(e[u], "edge"); c.push(f) } if (!(a = i.processProperties(a, h, c))) throw new Error("The processProperties function does not return properties!") } void 0 === a.id && (a.id = "cluster:" + mc()); var p = a.id; void 0 === a.label && (a.label = "cluster"); var v = void 0; void 0 === a.x && (v = this._getClusterPosition(t), a.x = v.x), void 0 === a.y && (void 0 === v && (v = this._getClusterPosition(t)), a.y = v.y), a.id = p; var g = this.body.functions.createNode(a, op); g.containedNodes = t, g.containedEdges = e, g.clusterEdgeProperties = i.clusterEdgeProperties, this.body.nodes[a.id] = g, this._clusterEdges(t, e, a, i.clusterEdgeProperties), a.id = void 0, !0 === n && this.body.emitter.emit("_dataChanged") } } }, { key: "_backupEdgeOptions", value: function (t) { void 0 === this.clusteredEdges[t.id] && (this.clusteredEdges[t.id] = { physics: t.options.physics }) } }, { key: "_restoreEdge", value: function (t) { var e = this.clusteredEdges[t.id]; void 0 !== e && (t.setOptions({ physics: e.physics }), delete this.clusteredEdges[t.id]) } }, { key: "isCluster", value: function (t) { return void 0 !== this.body.nodes[t] ? !0 === this.body.nodes[t].isCluster : (console.error("Node does not exist."), !1) } }, { key: "_getClusterPosition", value: function (t) { for (var e, i = rr(t), n = t[i[0]].x, o = t[i[0]].x, r = t[i[0]].y, s = t[i[0]].y, a = 1; a < i.length; a++)n = (e = t[i[a]]).x < n ? e.x : n, o = e.x > o ? e.x : o, r = e.y < r ? e.y : r, s = e.y > s ? e.y : s; return { x: .5 * (n + o), y: .5 * (r + s) } } }, { key: "openCluster", value: function (t, e) { var i = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; if (void 0 === t) throw new Error("No clusterNodeId supplied to openCluster."); var n = this.body.nodes[t]; if (void 0 === n) throw new Error("The clusterNodeId supplied to openCluster does not exist."); if (!0 !== n.isCluster || void 0 === n.containedNodes || void 0 === n.containedEdges) throw new Error("The node:" + t + " is not a valid cluster."); var o = this.findNode(t), r = To(o).call(o, t) - 1; if (r >= 0) { var s = o[r], a = this.body.nodes[s]; return a._openChildCluster(t), delete this.body.nodes[t], void (!0 === i && this.body.emitter.emit("_dataChanged")) } var h = n.containedNodes, l = n.containedEdges; if (void 0 !== e && void 0 !== e.releaseFunction && "function" == typeof e.releaseFunction) { var d = {}, c = { x: n.x, y: n.y }; for (var u in h) if (Object.prototype.hasOwnProperty.call(h, u)) { var f = this.body.nodes[u]; d[u] = { x: f.x, y: f.y } } var p = e.releaseFunction(c, d); for (var v in h) if (Object.prototype.hasOwnProperty.call(h, v)) { var g = this.body.nodes[v]; void 0 !== p[v] && (g.x = void 0 === p[v].x ? n.x : p[v].x, g.y = void 0 === p[v].y ? n.y : p[v].y) } } else ss(h, (function (t) { !1 === t.options.fixed.x && (t.x = n.x), !1 === t.options.fixed.y && (t.y = n.y) })); for (var y in h) if (Object.prototype.hasOwnProperty.call(h, y)) { var m = this.body.nodes[y]; m.vx = n.vx, m.vy = n.vy, m.setOptions({ physics: !0 }), delete this.clusteredNodes[y] } for (var b = [], w = 0; w < n.edges.length; w++)b.push(n.edges[w]); for (var k = 0; k < b.length; k++) { for (var _ = b[k], x = this._getConnectedId(_, t), E = this.clusteredNodes[x], O = 0; O < _.clusteringEdgeReplacingIds.length; O++) { var S = _.clusteringEdgeReplacingIds[O], C = this.body.edges[S]; if (void 0 !== C) if (void 0 !== E) { var T = this.body.nodes[E.clusterId]; T.containedEdges[C.id] = C, delete l[C.id]; var D = C.fromId, M = C.toId; C.toId == x ? M = E.clusterId : D = E.clusterId, this._createClusteredEdge(D, M, C, T.clusterEdgeProperties, { hidden: !1, physics: !0 }) } else this._restoreEdge(C) } _.remove() } for (var P in l) Object.prototype.hasOwnProperty.call(l, P) && this._restoreEdge(l[P]); delete this.body.nodes[t], !0 === i && this.body.emitter.emit("_dataChanged") } }, { key: "getNodesInCluster", value: function (t) { var e = []; if (!0 === this.isCluster(t)) { var i = this.body.nodes[t].containedNodes; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && e.push(this.body.nodes[n].id) } return e } }, { key: "findNode", value: function (t) { for (var e, i = [], n = 0; void 0 !== this.clusteredNodes[t] && n < 100;) { if (void 0 === (e = this.body.nodes[t])) return []; i.push(e.id), t = this.clusteredNodes[t].clusterId, n++ } return void 0 === (e = this.body.nodes[t]) ? [] : (i.push(e.id), ep(i).call(i), i) } }, { key: "updateClusteredNode", value: function (t, e) { if (void 0 === t) throw new Error("No clusteredNodeId supplied to updateClusteredNode."); if (void 0 === e) throw new Error("No newOptions supplied to updateClusteredNode."); if (void 0 === this.body.nodes[t]) throw new Error("The clusteredNodeId supplied to updateClusteredNode does not exist."); this.body.nodes[t].setOptions(e), this.body.emitter.emit("_dataChanged") } }, { key: "updateEdge", value: function (t, e) { if (void 0 === t) throw new Error("No startEdgeId supplied to updateEdge."); if (void 0 === e) throw new Error("No newOptions supplied to updateEdge."); if (void 0 === this.body.edges[t]) throw new Error("The startEdgeId supplied to updateEdge does not exist."); for (var i = this.getClusteredEdges(t), n = 0; n < i.length; n++) { this.body.edges[i[n]].setOptions(e) } this.body.emitter.emit("_dataChanged") } }, { key: "getClusteredEdges", value: function (t) { for (var e = [], i = 0; void 0 !== t && void 0 !== this.body.edges[t] && i < 100;)e.push(this.body.edges[t].id), t = this.body.edges[t].edgeReplacedById, i++; return ep(e).call(e), e } }, { key: "getBaseEdge", value: function (t) { return this.getBaseEdges(t)[0] } }, { key: "getBaseEdges", value: function (t) { for (var e = [t], i = [], n = [], o = 0; e.length > 0 && o < 100;) { var r = e.pop(); if (void 0 !== r) { var s = this.body.edges[r]; if (void 0 !== s) { o++; var a = s.clusteringEdgeReplacingIds; if (void 0 === a) n.push(r); else for (var h = 0; h < a.length; ++h) { var l = a[h]; -1 === To(e).call(e, a) && -1 === To(i).call(i, a) && e.push(l) } i.push(r) } } } return n } }, { key: "_getConnectedId", value: function (t, e) { return t.toId != e ? t.toId : (t.fromId, t.fromId) } }, { key: "_getHubSize", value: function () { for (var t = 0, e = 0, i = 0, n = 0, o = 0; o < this.body.nodeIndices.length; o++) { var r = this.body.nodes[this.body.nodeIndices[o]]; r.edges.length > n && (n = r.edges.length), t += r.edges.length, e += Math.pow(r.edges.length, 2), i += 1 } t /= i; var s = (e /= i) - Math.pow(t, 2), a = Math.sqrt(s), h = Math.floor(t + 2 * a); return h > n && (h = n), h } }, { key: "_createClusteredEdge", value: function (t, e, i, n, o) { var r = ip.cloneOptions(i, "edge"); Jr(r, n), r.from = t, r.to = e, r.id = "clusterEdge:" + mc(), void 0 !== o && Jr(r, o); var s = this.body.functions.createEdge(r); return s.clusteringEdgeReplacingIds = [i.id], s.connect(), this.body.edges[s.id] = s, s } }, { key: "_clusterEdges", value: function (t, e, i, n) { if (e instanceof jf) { var o = e, r = {}; r[o.id] = o, e = r } if (t instanceof Xu) { var s = t, a = {}; a[s.id] = s, t = a } if (null == i) throw new Error("_clusterEdges: parameter clusterNode required"); for (var h in void 0 === n && (n = i.clusterEdgeProperties), this._createClusterEdges(t, e, i, n), e) if (Object.prototype.hasOwnProperty.call(e, h) && void 0 !== this.body.edges[h]) { var l = this.body.edges[h]; this._backupEdgeOptions(l), l.setOptions({ physics: !1 }) } for (var d in t) Object.prototype.hasOwnProperty.call(t, d) && (this.clusteredNodes[d] = { clusterId: i.id, node: this.body.nodes[d] }, this.body.nodes[d].setOptions({ physics: !1 })) } }, { key: "_getClusterNodeForNode", value: function (t) { if (void 0 !== t) { var e = this.clusteredNodes[t]; if (void 0 !== e) { var i = e.clusterId; if (void 0 !== i) return this.body.nodes[i] } } } }, { key: "_filter", value: function (t, e) { var i = []; return ss(t, (function (t) { e(t) && i.push(t) })), i } }, { key: "_updateState", value: function () { var t, e = this, i = [], n = {}, o = function (t) { ss(e.body.nodes, (function (e) { !0 === e.isCluster && t(e) })) }; for (t in this.clusteredNodes) { if (Object.prototype.hasOwnProperty.call(this.clusteredNodes, t)) void 0 === this.body.nodes[t] && i.push(t) } o((function (t) { for (var e = 0; e < i.length; e++)delete t.containedNodes[i[e]] })); for (var r = 0; r < i.length; r++)delete this.clusteredNodes[i[r]]; ss(this.clusteredEdges, (function (t) { var i = e.body.edges[t]; void 0 !== i && i.endPointsValid() || (n[t] = t) })), o((function (t) { ss(t.containedEdges, (function (t, e) { t.endPointsValid() || n[e] || (n[e] = e) })) })), ss(this.body.edges, (function (t, i) { var o = !0, r = t.clusteringEdgeReplacingIds; if (void 0 !== r) { var s = 0; ss(r, (function (t) { var i = e.body.edges[t]; void 0 !== i && i.endPointsValid() && (s += 1) })), o = s > 0 } t.endPointsValid() && o || (n[i] = i) })), o((function (t) { ss(n, (function (i) { delete t.containedEdges[i], ss(t.edges, (function (o, r) { o.id !== i ? o.clusteringEdgeReplacingIds = e._filter(o.clusteringEdgeReplacingIds, (function (t) { return !n[t] })) : t.edges[r] = null })), t.edges = e._filter(t.edges, (function (t) { return null !== t })) })) })), ss(n, (function (t) { delete e.clusteredEdges[t] })), ss(n, (function (t) { delete e.body.edges[t] })), ss(rr(this.body.edges), (function (t) { var i = e.body.edges[t], n = e._isClusteredNode(i.fromId) || e._isClusteredNode(i.toId); if (n !== e._isClusteredEdge(i.id)) if (n) { var o = e._getClusterNodeForNode(i.fromId); void 0 !== o && e._clusterEdges(e.body.nodes[i.fromId], i, o); var r = e._getClusterNodeForNode(i.toId); void 0 !== r && e._clusterEdges(e.body.nodes[i.toId], i, r) } else delete e._clusterEdges[t], e._restoreEdge(i) })); for (var s = !1, a = !0, h = function () { var t = []; o((function (e) { var i = rr(e.containedNodes).length, n = !0 === e.options.allowSingleNodeCluster; (n && i < 1 || !n && i < 2) && t.push(e.id) })); for (var i = 0; i < t.length; ++i)e.openCluster(t[i], {}, !1); a = t.length > 0, s = s || a }; a;)h(); s && this._updateState() } }, { key: "_isClusteredNode", value: function (t) { return void 0 !== this.clusteredNodes[t] } }, { key: "_isClusteredEdge", value: function (t) { return void 0 !== this.clusteredEdges[t] } }]), t }(); function sp(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return ap(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ap(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function ap(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } var hp = function () { function t(e, i) { var n; El(this, t), void 0 !== window && (n = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame), window.requestAnimationFrame = void 0 === n ? function (t) { t() } : n, this.body = e, this.canvas = i, this.redrawRequested = !1, this.renderTimer = void 0, this.requiresTimeout = !0, this.renderingActive = !1, this.renderRequests = 0, this.allowRedraw = !0, this.dragging = !1, this.zooming = !1, this.options = {}, this.defaultOptions = { hideEdgesOnDrag: !1, hideEdgesOnZoom: !1, hideNodesOnDrag: !1 }, mt(this.options, this.defaultOptions), this._determineBrowserMethod(), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t, e = this; this.body.emitter.on("dragStart", (function () { e.dragging = !0 })), this.body.emitter.on("dragEnd", (function () { e.dragging = !1 })), this.body.emitter.on("zoom", (function () { e.zooming = !0, window.clearTimeout(e.zoomTimeoutId), e.zoomTimeoutId = window.setTimeout((function () { var t; e.zooming = !1, Z(t = e._requestRedraw).call(t, e)() }), 250) })), this.body.emitter.on("_resizeNodes", (function () { e._resizeNodes() })), this.body.emitter.on("_redraw", (function () { !1 === e.renderingActive && e._redraw() })), this.body.emitter.on("_blockRedraw", (function () { e.allowRedraw = !1 })), this.body.emitter.on("_allowRedraw", (function () { e.allowRedraw = !0, e.redrawRequested = !1 })), this.body.emitter.on("_requestRedraw", Z(t = this._requestRedraw).call(t, this)), this.body.emitter.on("_startRendering", (function () { e.renderRequests += 1, e.renderingActive = !0, e._startRendering() })), this.body.emitter.on("_stopRendering", (function () { e.renderRequests -= 1, e.renderingActive = e.renderRequests > 0, e.renderTimer = void 0 })), this.body.emitter.on("destroy", (function () { e.renderRequests = 0, e.allowRedraw = !1, e.renderingActive = !1, !0 === e.requiresTimeout ? clearTimeout(e.renderTimer) : window.cancelAnimationFrame(e.renderTimer), e.body.emitter.off() })) } }, { key: "setOptions", value: function (t) { if (void 0 !== t) { Zr(["hideEdgesOnDrag", "hideEdgesOnZoom", "hideNodesOnDrag"], this.options, t) } } }, { key: "_requestNextFrame", value: function (t, e) { if ("undefined" != typeof window) { var i, n = window; return !0 === this.requiresTimeout ? i = n.setTimeout(t, e) : n.requestAnimationFrame && (i = n.requestAnimationFrame(t)), i } } }, { key: "_startRendering", value: function () { var t; !0 === this.renderingActive && (void 0 === this.renderTimer && (this.renderTimer = this._requestNextFrame(Z(t = this._renderStep).call(t, this), this.simulationInterval))) } }, { key: "_renderStep", value: function () { !0 === this.renderingActive && (this.renderTimer = void 0, !0 === this.requiresTimeout && this._startRendering(), this._redraw(), !1 === this.requiresTimeout && this._startRendering()) } }, { key: "redraw", value: function () { this.body.emitter.emit("setSize"), this._redraw() } }, { key: "_requestRedraw", value: function () { var t = this; !0 !== this.redrawRequested && !1 === this.renderingActive && !0 === this.allowRedraw && (this.redrawRequested = !0, this._requestNextFrame((function () { t._redraw(!1) }), 0)) } }, { key: "_redraw", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; if (!0 === this.allowRedraw) { this.body.emitter.emit("initRedraw"), this.redrawRequested = !1; var e = { drawExternalLabels: null }; 0 !== this.canvas.frame.canvas.width && 0 !== this.canvas.frame.canvas.height || this.canvas.setSize(), this.canvas.setTransform(); var i = this.canvas.getContext(), n = this.canvas.frame.canvas.clientWidth, o = this.canvas.frame.canvas.clientHeight; if (i.clearRect(0, 0, n, o), 0 === this.canvas.frame.clientWidth) return; if (i.save(), i.translate(this.body.view.translation.x, this.body.view.translation.y), i.scale(this.body.view.scale, this.body.view.scale), i.beginPath(), this.body.emitter.emit("beforeDrawing", i), i.closePath(), !1 === t && (!1 === this.dragging || !0 === this.dragging && !1 === this.options.hideEdgesOnDrag) && (!1 === this.zooming || !0 === this.zooming && !1 === this.options.hideEdgesOnZoom) && this._drawEdges(i), !1 === this.dragging || !0 === this.dragging && !1 === this.options.hideNodesOnDrag) { var r = this._drawNodes(i, t), s = r.drawExternalLabels; e.drawExternalLabels = s } !1 === t && (!1 === this.dragging || !0 === this.dragging && !1 === this.options.hideEdgesOnDrag) && (!1 === this.zooming || !0 === this.zooming && !1 === this.options.hideEdgesOnZoom) && this._drawArrows(i), null != e.drawExternalLabels && e.drawExternalLabels(), !1 === t && this._drawSelectionBox(i), i.beginPath(), this.body.emitter.emit("afterDrawing", i), i.closePath(), i.restore(), !0 === t && i.clearRect(0, 0, n, o) } } }, { key: "_resizeNodes", value: function () { this.canvas.setTransform(); var t = this.canvas.getContext(); t.save(), t.translate(this.body.view.translation.x, this.body.view.translation.y), t.scale(this.body.view.scale, this.body.view.scale); var e, i = this.body.nodes; for (var n in i) Object.prototype.hasOwnProperty.call(i, n) && ((e = i[n]).resize(t), e.updateBoundingBox(t, e.selected)); t.restore() } }, { key: "_drawNodes", value: function (t) { for (var e, i, n = arguments.length > 1 && void 0 !== arguments[1] && arguments[1], o = this.body.nodes, r = this.body.nodeIndices, s = [], a = [], h = 20, l = this.canvas.DOMtoCanvas({ x: -h, y: -h }), d = this.canvas.DOMtoCanvas({ x: this.canvas.frame.canvas.clientWidth + h, y: this.canvas.frame.canvas.clientHeight + h }), c = { top: l.y, left: l.x, bottom: d.y, right: d.x }, u = [], f = 0; f < r.length; f++)if ((e = o[r[f]]).hover) a.push(r[f]); else if (e.isSelected()) s.push(r[f]); else if (!0 === n) { var p = e.draw(t); null != p.drawExternalLabel && u.push(p.drawExternalLabel) } else if (!0 === e.isBoundingBoxOverlappingWith(c)) { var v = e.draw(t); null != v.drawExternalLabel && u.push(v.drawExternalLabel) } else e.updateBoundingBox(t, e.selected); var g = s.length, y = a.length; for (i = 0; i < g; i++) { var m = (e = o[s[i]]).draw(t); null != m.drawExternalLabel && u.push(m.drawExternalLabel) } for (i = 0; i < y; i++) { var b = (e = o[a[i]]).draw(t); null != b.drawExternalLabel && u.push(b.drawExternalLabel) } return { drawExternalLabels: function () { var t, e = sp(u); try { for (e.s(); !(t = e.n()).done;) { (0, t.value)() } } catch (t) { e.e(t) } finally { e.f() } } } } }, { key: "_drawEdges", value: function (t) { for (var e = this.body.edges, i = this.body.edgeIndices, n = 0; n < i.length; n++) { var o = e[i[n]]; !0 === o.connected && o.draw(t) } } }, { key: "_drawArrows", value: function (t) { for (var e = this.body.edges, i = this.body.edgeIndices, n = 0; n < i.length; n++) { var o = e[i[n]]; !0 === o.connected && o.drawArrows(t) } } }, { key: "_determineBrowserMethod", value: function () { if ("undefined" != typeof window) { var t = navigator.userAgent.toLowerCase(); this.requiresTimeout = !1, (-1 != To(t).call(t, "msie 9.0") || -1 != To(t).call(t, "safari") && To(t).call(t, "chrome") <= -1) && (this.requiresTimeout = !0) } else this.requiresTimeout = !0 } }, { key: "_drawSelectionBox", value: function (t) { if (this.body.selectionBox.show) { t.beginPath(); var e = this.body.selectionBox.position.end.x - this.body.selectionBox.position.start.x, i = this.body.selectionBox.position.end.y - this.body.selectionBox.position.start.y; t.rect(this.body.selectionBox.position.start.x, this.body.selectionBox.position.start.y, e, i), t.fillStyle = "rgba(151, 194, 252, 0.2)", t.fillRect(this.body.selectionBox.position.start.x, this.body.selectionBox.position.start.y, e, i), t.strokeStyle = "rgba(151, 194, 252, 1)", t.stroke() } else t.closePath() } }]), t }(), lp = z.setInterval; function dp(t, e) { e.inputHandler = function (t) { t.isFirst && e(t) }, t.on("hammer.input", e.inputHandler) } function cp(t, e) { return e.inputHandler = function (t) { t.isFinal && e(t) }, t.on("hammer.input", e.inputHandler) } var up = function () { function t(e) { El(this, t), this.body = e, this.pixelRatio = 1, this.cameraState = {}, this.initialized = !1, this.canvasViewCenter = {}, this._cleanupCallbacks = [], this.options = {}, this.defaultOptions = { autoResize: !0, height: "100%", width: "100%" }, mt(this.options, this.defaultOptions), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t, e = this; this.body.emitter.once("resize", (function (t) { 0 !== t.width && (e.body.view.translation.x = .5 * t.width), 0 !== t.height && (e.body.view.translation.y = .5 * t.height) })), this.body.emitter.on("setSize", Z(t = this.setSize).call(t, this)), this.body.emitter.on("destroy", (function () { e.hammerFrame.destroy(), e.hammer.destroy(), e._cleanUp() })) } }, { key: "setOptions", value: function (t) { var e = this; if (void 0 !== t) { Zr(["width", "height", "autoResize"], this.options, t) } if (this._cleanUp(), !0 === this.options.autoResize) { var i; if (window.ResizeObserver) { var n = new ResizeObserver((function () { !0 === e.setSize() && e.body.emitter.emit("_requestRedraw") })), o = this.frame; n.observe(o), this._cleanupCallbacks.push((function () { n.unobserve(o) })) } else { var r = lp((function () { !0 === e.setSize() && e.body.emitter.emit("_requestRedraw") }), 1e3); this._cleanupCallbacks.push((function () { clearInterval(r) })) } var s = Z(i = this._onResize).call(i, this); hs(window, "resize", s), this._cleanupCallbacks.push((function () { ls(window, "resize", s) })) } } }, { key: "_cleanUp", value: function () { var t, e, i; Yn(t = ep(e = Fs(i = this._cleanupCallbacks).call(i, 0)).call(e)).call(t, (function (t) { try { t() } catch (t) { console.error(t) } })) } }, { key: "_onResize", value: function () { this.setSize(), this.body.emitter.emit("_redraw") } }, { key: "_getCameraState", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.pixelRatio; !0 === this.initialized && (this.cameraState.previousWidth = this.frame.canvas.width / t, this.cameraState.previousHeight = this.frame.canvas.height / t, this.cameraState.scale = this.body.view.scale, this.cameraState.position = this.DOMtoCanvas({ x: .5 * this.frame.canvas.width / t, y: .5 * this.frame.canvas.height / t })) } }, { key: "_setCameraState", value: function () { if (void 0 !== this.cameraState.scale && 0 !== this.frame.canvas.clientWidth && 0 !== this.frame.canvas.clientHeight && 0 !== this.pixelRatio && this.cameraState.previousWidth > 0 && this.cameraState.previousHeight > 0) { var t = this.frame.canvas.width / this.pixelRatio / this.cameraState.previousWidth, e = this.frame.canvas.height / this.pixelRatio / this.cameraState.previousHeight, i = this.cameraState.scale; 1 != t && 1 != e ? i = .5 * this.cameraState.scale * (t + e) : 1 != t ? i = this.cameraState.scale * t : 1 != e && (i = this.cameraState.scale * e), this.body.view.scale = i; var n = this.DOMtoCanvas({ x: .5 * this.frame.canvas.clientWidth, y: .5 * this.frame.canvas.clientHeight }), o = { x: n.x - this.cameraState.position.x, y: n.y - this.cameraState.position.y }; this.body.view.translation.x += o.x * this.body.view.scale, this.body.view.translation.y += o.y * this.body.view.scale } } }, { key: "_prepareValue", value: function (t) { if ("number" == typeof t) return t + "px"; if ("string" == typeof t) { if (-1 !== To(t).call(t, "%") || -1 !== To(t).call(t, "px")) return t; if (-1 === To(t).call(t, "%")) return t + "px" } throw new Error("Could not use the value supplied for width or height:" + t) } }, { key: "_create", value: function () { for (; this.body.container.hasChildNodes();)this.body.container.removeChild(this.body.container.firstChild); if (this.frame = document.createElement("div"), this.frame.className = "vis-network", this.frame.style.position = "relative", this.frame.style.overflow = "hidden", this.frame.tabIndex = 900, this.frame.canvas = document.createElement("canvas"), this.frame.canvas.style.position = "relative", this.frame.appendChild(this.frame.canvas), this.frame.canvas.getContext) this._setPixelRatio(), this.setTransform(); else { var t = document.createElement("DIV"); t.style.color = "red", t.style.fontWeight = "bold", t.style.padding = "10px", t.innerHTML = "Error: your browser does not support HTML canvas", this.frame.canvas.appendChild(t) } this.body.container.appendChild(this.frame), this.body.view.scale = 1, this.body.view.translation = { x: .5 * this.frame.canvas.clientWidth, y: .5 * this.frame.canvas.clientHeight }, this._bindHammer() } }, { key: "_bindHammer", value: function () { var t = this; void 0 !== this.hammer && this.hammer.destroy(), this.drag = {}, this.pinch = {}, this.hammer = new wl(this.frame.canvas), this.hammer.get("pinch").set({ enable: !0 }), this.hammer.get("pan").set({ threshold: 5, direction: wl.DIRECTION_ALL }), dp(this.hammer, (function (e) { t.body.eventListeners.onTouch(e) })), this.hammer.on("tap", (function (e) { t.body.eventListeners.onTap(e) })), this.hammer.on("doubletap", (function (e) { t.body.eventListeners.onDoubleTap(e) })), this.hammer.on("press", (function (e) { t.body.eventListeners.onHold(e) })), this.hammer.on("panstart", (function (e) { t.body.eventListeners.onDragStart(e) })), this.hammer.on("panmove", (function (e) { t.body.eventListeners.onDrag(e) })), this.hammer.on("panend", (function (e) { t.body.eventListeners.onDragEnd(e) })), this.hammer.on("pinch", (function (e) { t.body.eventListeners.onPinch(e) })), this.frame.canvas.addEventListener("wheel", (function (e) { t.body.eventListeners.onMouseWheel(e) })), this.frame.canvas.addEventListener("mousemove", (function (e) { t.body.eventListeners.onMouseMove(e) })), this.frame.canvas.addEventListener("contextmenu", (function (e) { t.body.eventListeners.onContext(e) })), this.hammerFrame = new wl(this.frame), cp(this.hammerFrame, (function (e) { t.body.eventListeners.onRelease(e) })) } }, { key: "setSize", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.options.width, e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.options.height; t = this._prepareValue(t), e = this._prepareValue(e); var i = !1, n = this.frame.canvas.width, o = this.frame.canvas.height, r = this.pixelRatio; if (this._setPixelRatio(), t != this.options.width || e != this.options.height || this.frame.style.width != t || this.frame.style.height != e) this._getCameraState(r), this.frame.style.width = t, this.frame.style.height = e, this.frame.canvas.style.width = "100%", this.frame.canvas.style.height = "100%", this.frame.canvas.width = Math.round(this.frame.canvas.clientWidth * this.pixelRatio), this.frame.canvas.height = Math.round(this.frame.canvas.clientHeight * this.pixelRatio), this.options.width = t, this.options.height = e, this.canvasViewCenter = { x: .5 * this.frame.clientWidth, y: .5 * this.frame.clientHeight }, i = !0; else { var s = Math.round(this.frame.canvas.clientWidth * this.pixelRatio), a = Math.round(this.frame.canvas.clientHeight * this.pixelRatio); this.frame.canvas.width === s && this.frame.canvas.height === a || this._getCameraState(r), this.frame.canvas.width !== s && (this.frame.canvas.width = s, i = !0), this.frame.canvas.height !== a && (this.frame.canvas.height = a, i = !0) } return !0 === i && (this.body.emitter.emit("resize", { width: Math.round(this.frame.canvas.width / this.pixelRatio), height: Math.round(this.frame.canvas.height / this.pixelRatio), oldWidth: Math.round(n / this.pixelRatio), oldHeight: Math.round(o / this.pixelRatio) }), this._setCameraState()), this.initialized = !0, i } }, { key: "getContext", value: function () { return this.frame.canvas.getContext("2d") } }, { key: "_determinePixelRatio", value: function () { var t = this.getContext(); if (void 0 === t) throw new Error("Could not get canvax context"); var e = 1; return "undefined" != typeof window && (e = window.devicePixelRatio || 1), e / (t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1) } }, { key: "_setPixelRatio", value: function () { this.pixelRatio = this._determinePixelRatio() } }, { key: "setTransform", value: function () { var t = this.getContext(); if (void 0 === t) throw new Error("Could not get canvax context"); t.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0) } }, { key: "_XconvertDOMtoCanvas", value: function (t) { return (t - this.body.view.translation.x) / this.body.view.scale } }, { key: "_XconvertCanvasToDOM", value: function (t) { return t * this.body.view.scale + this.body.view.translation.x } }, { key: "_YconvertDOMtoCanvas", value: function (t) { return (t - this.body.view.translation.y) / this.body.view.scale } }, { key: "_YconvertCanvasToDOM", value: function (t) { return t * this.body.view.scale + this.body.view.translation.y } }, { key: "canvasToDOM", value: function (t) { return { x: this._XconvertCanvasToDOM(t.x), y: this._YconvertCanvasToDOM(t.y) } } }, { key: "DOMtoCanvas", value: function (t) { return { x: this._XconvertDOMtoCanvas(t.x), y: this._YconvertDOMtoCanvas(t.y) } } }]), t }(); function fp(t, e) { var i = mt({ nodes: e, minZoomLevel: Number.MIN_VALUE, maxZoomLevel: 1 }, null != t ? t : {}); if (!ur(i.nodes)) throw new TypeError("Nodes has to be an array of ids."); if (0 === i.nodes.length && (i.nodes = e), !("number" == typeof i.minZoomLevel && i.minZoomLevel > 0)) throw new TypeError("Min zoom level has to be a number higher than zero."); if (!("number" == typeof i.maxZoomLevel && i.minZoomLevel <= i.maxZoomLevel)) throw new TypeError("Max zoom level has to be a number higher than min zoom level."); return i } var pp = function () { function t(e, i) { var n, o, r = this; El(this, t), this.body = e, this.canvas = i, this.animationSpeed = 1 / this.renderRefreshRate, this.animationEasingFunction = "easeInOutQuint", this.easingTime = 0, this.sourceScale = 0, this.targetScale = 0, this.sourceTranslation = 0, this.targetTranslation = 0, this.lockedOnNodeId = void 0, this.lockedOnNodeOffset = void 0, this.touchTime = 0, this.viewFunction = void 0, this.body.emitter.on("fit", Z(n = this.fit).call(n, this)), this.body.emitter.on("animationFinished", (function () { r.body.emitter.emit("_stopRendering") })), this.body.emitter.on("unlockNode", Z(o = this.releaseNode).call(o, this)) } return Sl(t, [{ key: "setOptions", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; this.options = t } }, { key: "fit", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; t = fp(t, this.body.nodeIndices); var i, n, o = this.canvas.frame.canvas.clientWidth, r = this.canvas.frame.canvas.clientHeight; if (0 === o || 0 === r) n = 1, i = ip.getRange(this.body.nodes, t.nodes); else if (!0 === e) { var s = 0; for (var a in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, a)) { var h = this.body.nodes[a]; !0 === h.predefinedPosition && (s += 1) } if (s > .5 * this.body.nodeIndices.length) return void this.fit(t, !1); i = ip.getRange(this.body.nodes, t.nodes); var l = this.body.nodeIndices.length; n = 12.662 / (l + 7.4147) + .0964822; var d = Math.min(o / 600, r / 600); n *= d } else { this.body.emitter.emit("_resizeNodes"), i = ip.getRange(this.body.nodes, t.nodes); var c = 1.1 * Math.abs(i.maxX - i.minX), u = 1.1 * Math.abs(i.maxY - i.minY), f = o / c, p = r / u; n = f <= p ? f : p } n > t.maxZoomLevel ? n = t.maxZoomLevel : n < t.minZoomLevel && (n = t.minZoomLevel); var v = ip.findCenter(i), g = { position: v, scale: n, animation: t.animation }; this.moveTo(g) } }, { key: "focus", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (void 0 !== this.body.nodes[t]) { var i = { x: this.body.nodes[t].x, y: this.body.nodes[t].y }; e.position = i, e.lockedOnNode = t, this.moveTo(e) } else console.error("Node: " + t + " cannot be found.") } }, { key: "moveTo", value: function (t) { if (void 0 !== t) { if (null != t.offset) { if (null != t.offset.x) { if (t.offset.x = +t.offset.x, !sd(t.offset.x)) throw new TypeError('The option "offset.x" has to be a finite number.') } else t.offset.x = 0; if (null != t.offset.y) { if (t.offset.y = +t.offset.y, !sd(t.offset.y)) throw new TypeError('The option "offset.y" has to be a finite number.') } else t.offset.x = 0 } else t.offset = { x: 0, y: 0 }; if (null != t.position) { if (null != t.position.x) { if (t.position.x = +t.position.x, !sd(t.position.x)) throw new TypeError('The option "position.x" has to be a finite number.') } else t.position.x = 0; if (null != t.position.y) { if (t.position.y = +t.position.y, !sd(t.position.y)) throw new TypeError('The option "position.y" has to be a finite number.') } else t.position.x = 0 } else t.position = this.getViewPosition(); if (null != t.scale) { if (t.scale = +t.scale, !(t.scale > 0)) throw new TypeError('The option "scale" has to be a number greater than zero.') } else t.scale = this.body.view.scale; void 0 === t.animation && (t.animation = { duration: 0 }), !1 === t.animation && (t.animation = { duration: 0 }), !0 === t.animation && (t.animation = {}), void 0 === t.animation.duration && (t.animation.duration = 1e3), void 0 === t.animation.easingFunction && (t.animation.easingFunction = "easeInOutQuad"), this.animateView(t) } else t = {} } }, { key: "animateView", value: function (t) { if (void 0 !== t) { this.animationEasingFunction = t.animation.easingFunction, this.releaseNode(), !0 === t.locked && (this.lockedOnNodeId = t.lockedOnNode, this.lockedOnNodeOffset = t.offset), 0 != this.easingTime && this._transitionRedraw(!0), this.sourceScale = this.body.view.scale, this.sourceTranslation = this.body.view.translation, this.targetScale = t.scale, this.body.view.scale = this.targetScale; var e, i, n = this.canvas.DOMtoCanvas({ x: .5 * this.canvas.frame.canvas.clientWidth, y: .5 * this.canvas.frame.canvas.clientHeight }), o = n.x - t.position.x, r = n.y - t.position.y; if (this.targetTranslation = { x: this.sourceTranslation.x + o * this.targetScale + t.offset.x, y: this.sourceTranslation.y + r * this.targetScale + t.offset.y }, 0 === t.animation.duration) if (null != this.lockedOnNodeId) this.viewFunction = Z(e = this._lockedRedraw).call(e, this), this.body.emitter.on("initRedraw", this.viewFunction); else this.body.view.scale = this.targetScale, this.body.view.translation = this.targetTranslation, this.body.emitter.emit("_requestRedraw"); else this.animationSpeed = 1 / (60 * t.animation.duration * .001) || 1 / 60, this.animationEasingFunction = t.animation.easingFunction, this.viewFunction = Z(i = this._transitionRedraw).call(i, this), this.body.emitter.on("initRedraw", this.viewFunction), this.body.emitter.emit("_startRendering") } } }, { key: "_lockedRedraw", value: function () { var t = this.body.nodes[this.lockedOnNodeId].x, e = this.body.nodes[this.lockedOnNodeId].y, i = this.canvas.DOMtoCanvas({ x: .5 * this.canvas.frame.canvas.clientWidth, y: .5 * this.canvas.frame.canvas.clientHeight }), n = i.x - t, o = i.y - e, r = this.body.view.translation, s = { x: r.x + n * this.body.view.scale + this.lockedOnNodeOffset.x, y: r.y + o * this.body.view.scale + this.lockedOnNodeOffset.y }; this.body.view.translation = s } }, { key: "releaseNode", value: function () { void 0 !== this.lockedOnNodeId && void 0 !== this.viewFunction && (this.body.emitter.off("initRedraw", this.viewFunction), this.lockedOnNodeId = void 0, this.lockedOnNodeOffset = void 0) } }, { key: "_transitionRedraw", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; this.easingTime += this.animationSpeed, this.easingTime = !0 === t ? 1 : this.easingTime; var e = Ss[this.animationEasingFunction](this.easingTime); if (this.body.view.scale = this.sourceScale + (this.targetScale - this.sourceScale) * e, this.body.view.translation = { x: this.sourceTranslation.x + (this.targetTranslation.x - this.sourceTranslation.x) * e, y: this.sourceTranslation.y + (this.targetTranslation.y - this.sourceTranslation.y) * e }, this.easingTime >= 1) { var i; if (this.body.emitter.off("initRedraw", this.viewFunction), this.easingTime = 0, null != this.lockedOnNodeId) this.viewFunction = Z(i = this._lockedRedraw).call(i, this), this.body.emitter.on("initRedraw", this.viewFunction); this.body.emitter.emit("animationFinished") } } }, { key: "getScale", value: function () { return this.body.view.scale } }, { key: "getViewPosition", value: function () { return this.canvas.DOMtoCanvas({ x: .5 * this.canvas.frame.canvas.clientWidth, y: .5 * this.canvas.frame.canvas.clientHeight }) } }]), t }(), vp = function () { function t(e, i) { var n = this; El(this, t), this.body = e, this.canvas = i, this.iconsCreated = !1, this.navigationHammers = [], this.boundFunctions = {}, this.touchTime = 0, this.activated = !1, this.body.emitter.on("activate", (function () { n.activated = !0, n.configureKeyboardBindings() })), this.body.emitter.on("deactivate", (function () { n.activated = !1, n.configureKeyboardBindings() })), this.body.emitter.on("destroy", (function () { void 0 !== n.keycharm && n.keycharm.destroy() })), this.options = {} } return Sl(t, [{ key: "setOptions", value: function (t) { void 0 !== t && (this.options = t, this.create()) } }, { key: "create", value: function () { !0 === this.options.navigationButtons ? !1 === this.iconsCreated && this.loadNavigationElements() : !0 === this.iconsCreated && this.cleanNavigation(), this.configureKeyboardBindings() } }, { key: "cleanNavigation", value: function () { if (0 != this.navigationHammers.length) { for (var t = 0; t < this.navigationHammers.length; t++)this.navigationHammers[t].destroy(); this.navigationHammers = [] } this.navigationDOM && this.navigationDOM.wrapper && this.navigationDOM.wrapper.parentNode && this.navigationDOM.wrapper.parentNode.removeChild(this.navigationDOM.wrapper), this.iconsCreated = !1 } }, { key: "loadNavigationElements", value: function () { var t = this; this.cleanNavigation(), this.navigationDOM = {}; var e = ["up", "down", "left", "right", "zoomIn", "zoomOut", "zoomExtends"], i = ["_moveUp", "_moveDown", "_moveLeft", "_moveRight", "_zoomIn", "_zoomOut", "_fit"]; this.navigationDOM.wrapper = document.createElement("div"), this.navigationDOM.wrapper.className = "vis-navigation", this.canvas.frame.appendChild(this.navigationDOM.wrapper); for (var n = 0; n < e.length; n++) { this.navigationDOM[e[n]] = document.createElement("div"), this.navigationDOM[e[n]].className = "vis-button vis-" + e[n], this.navigationDOM.wrapper.appendChild(this.navigationDOM[e[n]]); var o, r, s = new wl(this.navigationDOM[e[n]]); if ("_fit" === i[n]) dp(s, Z(o = this._fit).call(o, this)); else dp(s, Z(r = this.bindToRedraw).call(r, this, i[n])); this.navigationHammers.push(s) } var a = new wl(this.canvas.frame); cp(a, (function () { t._stopMovement() })), this.navigationHammers.push(a), this.iconsCreated = !0 } }, { key: "bindToRedraw", value: function (t) { var e; void 0 === this.boundFunctions[t] && (this.boundFunctions[t] = Z(e = this[t]).call(e, this), this.body.emitter.on("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_startRendering")) } }, { key: "unbindFromRedraw", value: function (t) { void 0 !== this.boundFunctions[t] && (this.body.emitter.off("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_stopRendering"), delete this.boundFunctions[t]) } }, { key: "_fit", value: function () { (new Date).valueOf() - this.touchTime > 700 && (this.body.emitter.emit("fit", { duration: 700 }), this.touchTime = (new Date).valueOf()) } }, { key: "_stopMovement", value: function () { for (var t in this.boundFunctions) Object.prototype.hasOwnProperty.call(this.boundFunctions, t) && (this.body.emitter.off("initRedraw", this.boundFunctions[t]), this.body.emitter.emit("_stopRendering")); this.boundFunctions = {} } }, { key: "_moveUp", value: function () { this.body.view.translation.y += this.options.keyboard.speed.y } }, { key: "_moveDown", value: function () { this.body.view.translation.y -= this.options.keyboard.speed.y } }, { key: "_moveLeft", value: function () { this.body.view.translation.x += this.options.keyboard.speed.x } }, { key: "_moveRight", value: function () { this.body.view.translation.x -= this.options.keyboard.speed.x } }, { key: "_zoomIn", value: function () { var t = this.body.view.scale, e = this.body.view.scale * (1 + this.options.keyboard.speed.zoom), i = this.body.view.translation, n = e / t, o = (1 - n) * this.canvas.canvasViewCenter.x + i.x * n, r = (1 - n) * this.canvas.canvasViewCenter.y + i.y * n; this.body.view.scale = e, this.body.view.translation = { x: o, y: r }, this.body.emitter.emit("zoom", { direction: "+", scale: this.body.view.scale, pointer: null }) } }, { key: "_zoomOut", value: function () { var t = this.body.view.scale, e = this.body.view.scale / (1 + this.options.keyboard.speed.zoom), i = this.body.view.translation, n = e / t, o = (1 - n) * this.canvas.canvasViewCenter.x + i.x * n, r = (1 - n) * this.canvas.canvasViewCenter.y + i.y * n; this.body.view.scale = e, this.body.view.translation = { x: o, y: r }, this.body.emitter.emit("zoom", { direction: "-", scale: this.body.view.scale, pointer: null }) } }, { key: "configureKeyboardBindings", value: function () { var t, e, i, n, o, r, s, a, h, l, d, c, u, f, p, v, g, y, m, b, w, k, _, x, E = this; (void 0 !== this.keycharm && this.keycharm.destroy(), !0 === this.options.keyboard.enabled) && (!0 === this.options.keyboard.bindToWindow ? this.keycharm = Ma({ container: window, preventDefault: !0 }) : this.keycharm = Ma({ container: this.canvas.frame, preventDefault: !0 }), this.keycharm.reset(), !0 === this.activated && (Z(t = this.keycharm).call(t, "up", (function () { E.bindToRedraw("_moveUp") }), "keydown"), Z(e = this.keycharm).call(e, "down", (function () { E.bindToRedraw("_moveDown") }), "keydown"), Z(i = this.keycharm).call(i, "left", (function () { E.bindToRedraw("_moveLeft") }), "keydown"), Z(n = this.keycharm).call(n, "right", (function () { E.bindToRedraw("_moveRight") }), "keydown"), Z(o = this.keycharm).call(o, "=", (function () { E.bindToRedraw("_zoomIn") }), "keydown"), Z(r = this.keycharm).call(r, "num+", (function () { E.bindToRedraw("_zoomIn") }), "keydown"), Z(s = this.keycharm).call(s, "num-", (function () { E.bindToRedraw("_zoomOut") }), "keydown"), Z(a = this.keycharm).call(a, "-", (function () { E.bindToRedraw("_zoomOut") }), "keydown"), Z(h = this.keycharm).call(h, "[", (function () { E.bindToRedraw("_zoomOut") }), "keydown"), Z(l = this.keycharm).call(l, "]", (function () { E.bindToRedraw("_zoomIn") }), "keydown"), Z(d = this.keycharm).call(d, "pageup", (function () { E.bindToRedraw("_zoomIn") }), "keydown"), Z(c = this.keycharm).call(c, "pagedown", (function () { E.bindToRedraw("_zoomOut") }), "keydown"), Z(u = this.keycharm).call(u, "up", (function () { E.unbindFromRedraw("_moveUp") }), "keyup"), Z(f = this.keycharm).call(f, "down", (function () { E.unbindFromRedraw("_moveDown") }), "keyup"), Z(p = this.keycharm).call(p, "left", (function () { E.unbindFromRedraw("_moveLeft") }), "keyup"), Z(v = this.keycharm).call(v, "right", (function () { E.unbindFromRedraw("_moveRight") }), "keyup"), Z(g = this.keycharm).call(g, "=", (function () { E.unbindFromRedraw("_zoomIn") }), "keyup"), Z(y = this.keycharm).call(y, "num+", (function () { E.unbindFromRedraw("_zoomIn") }), "keyup"), Z(m = this.keycharm).call(m, "num-", (function () { E.unbindFromRedraw("_zoomOut") }), "keyup"), Z(b = this.keycharm).call(b, "-", (function () { E.unbindFromRedraw("_zoomOut") }), "keyup"), Z(w = this.keycharm).call(w, "[", (function () { E.unbindFromRedraw("_zoomOut") }), "keyup"), Z(k = this.keycharm).call(k, "]", (function () { E.unbindFromRedraw("_zoomIn") }), "keyup"), Z(_ = this.keycharm).call(_, "pageup", (function () { E.unbindFromRedraw("_zoomIn") }), "keyup"), Z(x = this.keycharm).call(x, "pagedown", (function () { E.unbindFromRedraw("_zoomOut") }), "keyup"))) } }]), t }(), gp = function () { function t(e, i) { El(this, t), this.container = e, this.overflowMethod = i || "cap", this.x = 0, this.y = 0, this.padding = 5, this.hidden = !1, this.frame = document.createElement("div"), this.frame.className = "vis-tooltip", this.container.appendChild(this.frame) } return Sl(t, [{ key: "setPosition", value: function (t, e) { this.x = Zn(t), this.y = Zn(e) } }, { key: "setText", value: function (t) { t instanceof Element ? (this.frame.innerHTML = "", this.frame.appendChild(t)) : this.frame.innerHTML = t } }, { key: "show", value: function (t) { if (void 0 === t && (t = !0), !0 === t) { var e = this.frame.clientHeight, i = this.frame.clientWidth, n = this.frame.parentNode.clientHeight, o = this.frame.parentNode.clientWidth, r = 0, s = 0; if ("flip" == this.overflowMethod) { var a = !1, h = !0; this.y - e < this.padding && (h = !1), this.x + i > o - this.padding && (a = !0), r = a ? this.x - i : this.x, s = h ? this.y - e : this.y } else (s = this.y - e) + e + this.padding > n && (s = n - e - this.padding), s < this.padding && (s = this.padding), (r = this.x) + i + this.padding > o && (r = o - i - this.padding), r < this.padding && (r = this.padding); this.frame.style.left = r + "px", this.frame.style.top = s + "px", this.frame.style.visibility = "visible", this.hidden = !1 } else this.hide() } }, { key: "hide", value: function () { this.hidden = !0, this.frame.style.left = "0", this.frame.style.top = "0", this.frame.style.visibility = "hidden" } }, { key: "destroy", value: function () { this.frame.parentNode.removeChild(this.frame) } }]), t }(); function yp(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return mp(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return mp(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function mp(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } var bp = function () { function t(e, i, n) { var o, r, s, a, h, l, d, c, u, f, p, v, g; El(this, t), this.body = e, this.canvas = i, this.selectionHandler = n, this.navigationHandler = new vp(e, i), this.body.eventListeners.onTap = Z(o = this.onTap).call(o, this), this.body.eventListeners.onTouch = Z(r = this.onTouch).call(r, this), this.body.eventListeners.onDoubleTap = Z(s = this.onDoubleTap).call(s, this), this.body.eventListeners.onHold = Z(a = this.onHold).call(a, this), this.body.eventListeners.onDragStart = Z(h = this.onDragStart).call(h, this), this.body.eventListeners.onDrag = Z(l = this.onDrag).call(l, this), this.body.eventListeners.onDragEnd = Z(d = this.onDragEnd).call(d, this), this.body.eventListeners.onMouseWheel = Z(c = this.onMouseWheel).call(c, this), this.body.eventListeners.onPinch = Z(u = this.onPinch).call(u, this), this.body.eventListeners.onMouseMove = Z(f = this.onMouseMove).call(f, this), this.body.eventListeners.onRelease = Z(p = this.onRelease).call(p, this), this.body.eventListeners.onContext = Z(v = this.onContext).call(v, this), this.touchTime = 0, this.drag = {}, this.pinch = {}, this.popup = void 0, this.popupObj = void 0, this.popupTimer = void 0, this.body.functions.getPointer = Z(g = this.getPointer).call(g, this), this.options = {}, this.defaultOptions = { dragNodes: !0, dragView: !0, hover: !1, keyboard: { enabled: !1, speed: { x: 10, y: 10, zoom: .02 }, bindToWindow: !0 }, navigationButtons: !1, tooltipDelay: 300, zoomView: !0, zoomSpeed: 1 }, mt(this.options, this.defaultOptions), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t = this; this.body.emitter.on("destroy", (function () { clearTimeout(t.popupTimer), delete t.body.functions.getPointer })) } }, { key: "setOptions", value: function (t) { if (void 0 !== t) { Qr(["hideEdgesOnDrag", "hideEdgesOnZoom", "hideNodesOnDrag", "keyboard", "multiselect", "selectable", "selectConnectedEdges"], this.options, t), Os(this.options, t, "keyboard"), t.tooltip && (mt(this.options.tooltip, t.tooltip), t.tooltip.color && (this.options.tooltip.color = ps(t.tooltip.color))) } this.navigationHandler.setOptions(this.options) } }, { key: "getPointer", value: function (t) { return { x: t.x - is(this.canvas.frame.canvas), y: t.y - ns(this.canvas.frame.canvas) } } }, { key: "onTouch", value: function (t) { (new Date).valueOf() - this.touchTime > 50 && (this.drag.pointer = this.getPointer(t.center), this.drag.pinched = !1, this.pinch.scale = this.body.view.scale, this.touchTime = (new Date).valueOf()) } }, { key: "onTap", value: function (t) { var e = this.getPointer(t.center), i = this.selectionHandler.options.multiselect && (t.changedPointers[0].ctrlKey || t.changedPointers[0].metaKey); this.checkSelectionChanges(e, i), this.selectionHandler.commitAndEmit(e, t), this.selectionHandler.generateClickEvent("click", t, e) } }, { key: "onDoubleTap", value: function (t) { var e = this.getPointer(t.center); this.selectionHandler.generateClickEvent("doubleClick", t, e) } }, { key: "onHold", value: function (t) { var e = this.getPointer(t.center), i = this.selectionHandler.options.multiselect; this.checkSelectionChanges(e, i), this.selectionHandler.commitAndEmit(e, t), this.selectionHandler.generateClickEvent("click", t, e), this.selectionHandler.generateClickEvent("hold", t, e) } }, { key: "onRelease", value: function (t) { if ((new Date).valueOf() - this.touchTime > 10) { var e = this.getPointer(t.center); this.selectionHandler.generateClickEvent("release", t, e), this.touchTime = (new Date).valueOf() } } }, { key: "onContext", value: function (t) { var e = this.getPointer({ x: t.clientX, y: t.clientY }); this.selectionHandler.generateClickEvent("oncontext", t, e) } }, { key: "checkSelectionChanges", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1]; !0 === e ? this.selectionHandler.selectAdditionalOnPoint(t) : this.selectionHandler.selectOnPoint(t) } }, { key: "_determineDifference", value: function (t, e) { var i = function (t, e) { for (var i = [], n = 0; n < t.length; n++) { var o = t[n]; -1 === To(e).call(e, o) && i.push(o) } return i }; return { nodes: i(t.nodes, e.nodes), edges: i(t.edges, e.edges) } } }, { key: "onDragStart", value: function (t) { if (!this.drag.dragging) { void 0 === this.drag.pointer && this.onTouch(t); var e = this.selectionHandler.getNodeAt(this.drag.pointer); if (this.drag.dragging = !0, this.drag.selection = [], this.drag.translation = mt({}, this.body.view.translation), this.drag.nodeId = void 0, t.srcEvent.shiftKey) { this.body.selectionBox.show = !0; var i = this.getPointer(t.center); this.body.selectionBox.position.start = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) }, this.body.selectionBox.position.end = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) } } if (void 0 !== e && !0 === this.options.dragNodes) { this.drag.nodeId = e.id, !1 === e.isSelected() && (this.selectionHandler.unselectAll(), this.selectionHandler.selectObject(e)), this.selectionHandler.generateClickEvent("dragStart", t, this.drag.pointer); var n, o = yp(this.selectionHandler.getSelectedNodes()); try { for (o.s(); !(n = o.n()).done;) { var r = n.value, s = { id: r.id, node: r, x: r.x, y: r.y, xFixed: r.options.fixed.x, yFixed: r.options.fixed.y }; r.options.fixed.x = !0, r.options.fixed.y = !0, this.drag.selection.push(s) } } catch (t) { o.e(t) } finally { o.f() } } else this.selectionHandler.generateClickEvent("dragStart", t, this.drag.pointer, void 0, !0) } } }, { key: "onDrag", value: function (t) { var e = this; if (!0 !== this.drag.pinched) { this.body.emitter.emit("unlockNode"); var i = this.getPointer(t.center), n = this.drag.selection; if (n && n.length && !0 === this.options.dragNodes) { this.selectionHandler.generateClickEvent("dragging", t, i); var o = i.x - this.drag.pointer.x, r = i.y - this.drag.pointer.y; Yn(n).call(n, (function (t) { var i = t.node; !1 === t.xFixed && (i.x = e.canvas._XconvertDOMtoCanvas(e.canvas._XconvertCanvasToDOM(t.x) + o)), !1 === t.yFixed && (i.y = e.canvas._YconvertDOMtoCanvas(e.canvas._YconvertCanvasToDOM(t.y) + r)) })), this.body.emitter.emit("startSimulation") } else { if (t.srcEvent.shiftKey) { if (this.selectionHandler.generateClickEvent("dragging", t, i, void 0, !0), void 0 === this.drag.pointer) return void this.onDragStart(t); this.body.selectionBox.position.end = { x: this.canvas._XconvertDOMtoCanvas(i.x), y: this.canvas._YconvertDOMtoCanvas(i.y) }, this.body.emitter.emit("_requestRedraw") } if (!0 === this.options.dragView && !t.srcEvent.shiftKey) { if (this.selectionHandler.generateClickEvent("dragging", t, i, void 0, !0), void 0 === this.drag.pointer) return void this.onDragStart(t); var s = i.x - this.drag.pointer.x, a = i.y - this.drag.pointer.y; this.body.view.translation = { x: this.drag.translation.x + s, y: this.drag.translation.y + a }, this.body.emitter.emit("_requestRedraw") } } } } }, { key: "onDragEnd", value: function (t) { var e = this; if (this.drag.dragging = !1, this.body.selectionBox.show) { var i; this.body.selectionBox.show = !1; var n = this.body.selectionBox.position, o = { minX: Math.min(n.start.x, n.end.x), minY: Math.min(n.start.y, n.end.y), maxX: Math.max(n.start.x, n.end.x), maxY: Math.max(n.start.y, n.end.y) }, r = yo(i = this.body.nodeIndices).call(i, (function (t) { var i = e.body.nodes[t]; return i.x >= o.minX && i.x <= o.maxX && i.y >= o.minY && i.y <= o.maxY })); Yn(r).call(r, (function (t) { return e.selectionHandler.selectObject(e.body.nodes[t]) })); var s = this.getPointer(t.center); this.selectionHandler.commitAndEmit(s, t), this.selectionHandler.generateClickEvent("dragEnd", t, this.getPointer(t.center), void 0, !0), this.body.emitter.emit("_requestRedraw") } else { var a = this.drag.selection; a && a.length ? (Yn(a).call(a, (function (t) { t.node.options.fixed.x = t.xFixed, t.node.options.fixed.y = t.yFixed })), this.selectionHandler.generateClickEvent("dragEnd", t, this.getPointer(t.center)), this.body.emitter.emit("startSimulation")) : (this.selectionHandler.generateClickEvent("dragEnd", t, this.getPointer(t.center), void 0, !0), this.body.emitter.emit("_requestRedraw")) } } }, { key: "onPinch", value: function (t) { var e = this.getPointer(t.center); this.drag.pinched = !0, void 0 === this.pinch.scale && (this.pinch.scale = 1); var i = this.pinch.scale * t.scale; this.zoom(i, e) } }, { key: "zoom", value: function (t, e) { if (!0 === this.options.zoomView) { var i = this.body.view.scale; t < 1e-5 && (t = 1e-5), t > 10 && (t = 10); var n = void 0; void 0 !== this.drag && !0 === this.drag.dragging && (n = this.canvas.DOMtoCanvas(this.drag.pointer)); var o = this.body.view.translation, r = t / i, s = (1 - r) * e.x + o.x * r, a = (1 - r) * e.y + o.y * r; if (this.body.view.scale = t, this.body.view.translation = { x: s, y: a }, null != n) { var h = this.canvas.canvasToDOM(n); this.drag.pointer.x = h.x, this.drag.pointer.y = h.y } this.body.emitter.emit("_requestRedraw"), i < t ? this.body.emitter.emit("zoom", { direction: "+", scale: this.body.view.scale, pointer: e }) : this.body.emitter.emit("zoom", { direction: "-", scale: this.body.view.scale, pointer: e }) } } }, { key: "onMouseWheel", value: function (t) { if (!0 === this.options.zoomView) { if (0 !== t.deltaY) { var e = this.body.view.scale; e *= 1 + (t.deltaY < 0 ? 1 : -1) * (.1 * this.options.zoomSpeed); var i = this.getPointer({ x: t.clientX, y: t.clientY }); this.zoom(e, i) } t.preventDefault() } } }, { key: "onMouseMove", value: function (t) { var e = this, i = this.getPointer({ x: t.clientX, y: t.clientY }), n = !1; void 0 !== this.popup && (!1 === this.popup.hidden && this._checkHidePopup(i), !1 === this.popup.hidden && (n = !0, this.popup.setPosition(i.x + 3, i.y - 5), this.popup.show())), !1 === this.options.keyboard.bindToWindow && !0 === this.options.keyboard.enabled && this.canvas.frame.focus(), !1 === n && (void 0 !== this.popupTimer && (clearInterval(this.popupTimer), this.popupTimer = void 0), this.drag.dragging || (this.popupTimer = Zl((function () { return e._checkShowPopup(i) }), this.options.tooltipDelay))), !0 === this.options.hover && this.selectionHandler.hoverObject(t, i) } }, { key: "_checkShowPopup", value: function (t) { var e = this.canvas._XconvertDOMtoCanvas(t.x), i = this.canvas._YconvertDOMtoCanvas(t.y), n = { left: e, top: i, right: e, bottom: i }, o = void 0 === this.popupObj ? void 0 : this.popupObj.id, r = !1, s = "node"; if (void 0 === this.popupObj) { for (var a, h = this.body.nodeIndices, l = this.body.nodes, d = [], c = 0; c < h.length; c++)!0 === (a = l[h[c]]).isOverlappingWith(n) && (r = !0, void 0 !== a.getTitle() && d.push(h[c])); d.length > 0 && (this.popupObj = l[d[d.length - 1]], r = !0) } if (void 0 === this.popupObj && !1 === r) { for (var u, f = this.body.edgeIndices, p = this.body.edges, v = [], g = 0; g < f.length; g++)!0 === (u = p[f[g]]).isOverlappingWith(n) && !0 === u.connected && void 0 !== u.getTitle() && v.push(f[g]); v.length > 0 && (this.popupObj = p[v[v.length - 1]], s = "edge") } void 0 !== this.popupObj ? this.popupObj.id !== o && (void 0 === this.popup && (this.popup = new gp(this.canvas.frame)), this.popup.popupTargetType = s, this.popup.popupTargetId = this.popupObj.id, this.popup.setPosition(t.x + 3, t.y - 5), this.popup.setText(this.popupObj.getTitle()), this.popup.show(), this.body.emitter.emit("showPopup", this.popupObj.id)) : void 0 !== this.popup && (this.popup.hide(), this.body.emitter.emit("hidePopup")) } }, { key: "_checkHidePopup", value: function (t) { var e = this.selectionHandler._pointerToPositionObject(t), i = !1; if ("node" === this.popup.popupTargetType) { if (void 0 !== this.body.nodes[this.popup.popupTargetId] && !0 === (i = this.body.nodes[this.popup.popupTargetId].isOverlappingWith(e))) { var n = this.selectionHandler.getNodeAt(t); i = void 0 !== n && n.id === this.popup.popupTargetId } } else void 0 === this.selectionHandler.getNodeAt(t) && void 0 !== this.body.edges[this.popup.popupTargetId] && (i = this.body.edges[this.popup.popupTargetId].isOverlappingWith(e)); !1 === i && (this.popupObj = void 0, this.popup.hide(), this.body.emitter.emit("hidePopup")) } }]), t }(), wp = Ml.getWeakData, kp = Re.set, _p = Re.getterFor, xp = Ve.find, Ep = Ve.findIndex, Op = 0, Sp = function (t) { return t.frozen || (t.frozen = new Cp) }, Cp = function () { this.entries = [] }, Tp = function (t, e) { return xp(t.entries, (function (t) { return t[0] === e })) }; Cp.prototype = { get: function (t) { var e = Tp(this, t); if (e) return e[1] }, has: function (t) { return !!Tp(this, t) }, set: function (t, e) { var i = Tp(this, t); i ? i[1] = e : this.entries.push([t, e]) }, delete: function (t) { var e = Ep(this.entries, (function (e) { return e[0] === t })); return ~e && this.entries.splice(e, 1), !!~e } }; var Dp, Mp, Pp, Ip, Bp, zp = { getConstructor: function (t, e, i, n) { var o = t((function (t, r) { Bl(t, o, e), kp(t, { type: e, id: Op++, frozen: void 0 }), null != r && Il(r, t[n], { that: t, AS_ENTRIES: i }) })), r = _p(e), s = function (t, e, i) { var n = r(t), o = wp(F(e), !0); return !0 === o ? Sp(n).set(e, i) : o[n.id] = i, t }; return Rl(o.prototype, { delete: function (t) { var e = r(this); if (!y(t)) return !1; var i = wp(t); return !0 === i ? Sp(e).delete(t) : i && w(i, e.id) && delete i[e.id] }, has: function (t) { var e = r(this); if (!y(t)) return !1; var i = wp(t); return !0 === i ? Sp(e).has(t) : i && w(i, e.id) } }), Rl(o.prototype, i ? { get: function (t) { var e = r(this); if (y(t)) { var i = wp(t); return !0 === i ? Sp(e).get(t) : i ? i[e.id] : void 0 } }, set: function (t, e) { return s(this, t, e) } } : { add: function (t) { return s(this, t, !0) } }), o } }, Np = (i((function (t) { var e, i = Re.enforce, n = !o.ActiveXObject && "ActiveXObject" in o, r = Object.isExtensible, s = function (t) { return function () { return t(this, arguments.length ? arguments[0] : void 0) } }, a = t.exports = jl("WeakMap", s, zp); if (Ie && n) { e = zp.getConstructor(s, "WeakMap", !0), Ml.REQUIRED = !0; var h = a.prototype, l = h.delete, d = h.has, c = h.get, u = h.set; Rl(h, { delete: function (t) { if (y(t) && !r(t)) { var n = i(this); return n.frozen || (n.frozen = new e), l.call(this, t) || n.frozen.delete(t) } return l.call(this, t) }, has: function (t) { if (y(t) && !r(t)) { var n = i(this); return n.frozen || (n.frozen = new e), d.call(this, t) || n.frozen.has(t) } return d.call(this, t) }, get: function (t) { if (y(t) && !r(t)) { var n = i(this); return n.frozen || (n.frozen = new e), d.call(this, t) ? c.call(this, t) : n.frozen.get(t) } return c.call(this, t) }, set: function (t, n) { if (y(t) && !r(t)) { var o = i(this); o.frozen || (o.frozen = new e), d.call(this, t) ? u.call(this, t, n) : o.frozen.set(t, n) } else u.call(this, t, n); return this } }) } })), z.WeakMap); function Ap(t, e) { if (!e.has(t)) throw new TypeError("attempted to get private field on non-instance"); return e.get(t) } function Fp(t, e, i) { if (!e.has(t)) throw new TypeError("attempted to set private field on non-instance"); return e.set(t, i), i } function jp(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return Rp(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Rp(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function Rp(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } function Lp(t, e) { var i, n = new Gd, o = jp(e); try { for (o.s(); !(i = o.n()).done;) { var r = i.value; t.has(r) || n.add(r) } } catch (t) { o.e(t) } finally { o.f() } return n } var Hp = function () { function t() { El(this, t), Dp.set(this, new Gd), Mp.set(this, new Gd) } return Sl(t, [{ key: "add", value: function () { for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)e[i] = arguments[i]; for (var n = 0, o = e; n < o.length; n++) { var r = o[n]; Ap(this, Mp).add(r) } } }, { key: "delete", value: function () { for (var t = arguments.length, e = new Array(t), i = 0; i < t; i++)e[i] = arguments[i]; for (var n = 0, o = e; n < o.length; n++) { var r = o[n]; Ap(this, Mp).delete(r) } } }, { key: "clear", value: function () { Ap(this, Mp).clear() } }, { key: "getSelection", value: function () { return kr(Ap(this, Mp)) } }, { key: "getChanges", value: function () { return { added: kr(Lp(Ap(this, Dp), Ap(this, Mp))), deleted: kr(Lp(Ap(this, Mp), Ap(this, Dp))), previous: kr(new Gd(Ap(this, Dp))), current: kr(new Gd(Ap(this, Mp))) } } }, { key: "commit", value: function () { var t = this.getChanges(); Fp(this, Dp, Ap(this, Mp)), Fp(this, Mp, new Gd(Ap(this, Dp))); var e, i = jp(t.added); try { for (i.s(); !(e = i.n()).done;) { e.value.select() } } catch (t) { i.e(t) } finally { i.f() } var n, o = jp(t.deleted); try { for (o.s(); !(n = o.n()).done;) { n.value.unselect() } } catch (t) { o.e(t) } finally { o.f() } return t } }, { key: "size", get: function () { return Ap(this, Mp).size } }]), t }(); Dp = new Np, Mp = new Np; var Wp = function () { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function () { }; El(this, t), Pp.set(this, new Hp), Ip.set(this, new Hp), Bp.set(this, void 0), Fp(this, Bp, e) } return Sl(t, [{ key: "getNodes", value: function () { return Ap(this, Pp).getSelection() } }, { key: "getEdges", value: function () { return Ap(this, Ip).getSelection() } }, { key: "addNodes", value: function () { var t; (t = Ap(this, Pp)).add.apply(t, arguments) } }, { key: "addEdges", value: function () { var t; (t = Ap(this, Ip)).add.apply(t, arguments) } }, { key: "deleteNodes", value: function (t) { Ap(this, Pp).delete(t) } }, { key: "deleteEdges", value: function (t) { Ap(this, Ip).delete(t) } }, { key: "clear", value: function () { Ap(this, Pp).clear(), Ap(this, Ip).clear() } }, { key: "commit", value: function () { for (var t, e, i = { nodes: Ap(this, Pp).commit(), edges: Ap(this, Ip).commit() }, n = arguments.length, o = new Array(n), r = 0; r < n; r++)o[r] = arguments[r]; return (t = Ap(this, Bp)).call.apply(t, Er(e = [this, i]).call(e, o)), i } }, { key: "sizeNodes", get: function () { return Ap(this, Pp).size } }, { key: "sizeEdges", get: function () { return Ap(this, Ip).size } }]), t }(); function qp(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return Vp(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Vp(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function Vp(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } Pp = new Np, Ip = new Np, Bp = new Np; var Up, Yp = function () { function t(e, i) { var n = this; El(this, t), this.body = e, this.canvas = i, this._selectionAccumulator = new Wp, this.hoverObj = { nodes: {}, edges: {} }, this.options = {}, this.defaultOptions = { multiselect: !1, selectable: !0, selectConnectedEdges: !0, hoverConnectedEdges: !0 }, mt(this.options, this.defaultOptions), this.body.emitter.on("_dataChanged", (function () { n.updateSelection() })) } return Sl(t, [{ key: "setOptions", value: function (t) { if (void 0 !== t) { Zr(["multiselect", "hoverConnectedEdges", "selectable", "selectConnectedEdges"], this.options, t) } } }, { key: "selectOnPoint", value: function (t) { var e = !1; if (!0 === this.options.selectable) { var i = this.getNodeAt(t) || this.getEdgeAt(t); this.unselectAll(), void 0 !== i && (e = this.selectObject(i)), this.body.emitter.emit("_requestRedraw") } return e } }, { key: "selectAdditionalOnPoint", value: function (t) { var e = !1; if (!0 === this.options.selectable) { var i = this.getNodeAt(t) || this.getEdgeAt(t); void 0 !== i && (e = !0, !0 === i.isSelected() ? this.deselectObject(i) : this.selectObject(i), this.body.emitter.emit("_requestRedraw")) } return e } }, { key: "_initBaseEvent", value: function (t, e) { var i = {}; return i.pointer = { DOM: { x: e.x, y: e.y }, canvas: this.canvas.DOMtoCanvas(e) }, i.event = t, i } }, { key: "generateClickEvent", value: function (t, e, i, n) { var o = arguments.length > 4 && void 0 !== arguments[4] && arguments[4], r = this._initBaseEvent(e, i); if (!0 === o) r.nodes = [], r.edges = []; else { var s = this.getSelection(); r.nodes = s.nodes, r.edges = s.edges } void 0 !== n && (r.previousSelection = n), "click" == t && (r.items = this.getClickedItems(i)), void 0 !== e.controlEdge && (r.controlEdge = e.controlEdge), this.body.emitter.emit(t, r) } }, { key: "selectObject", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.options.selectConnectedEdges; if (void 0 !== t) { if (t instanceof Xu) { var i; if (!0 === e) (i = this._selectionAccumulator).addEdges.apply(i, kr(t.edges)); this._selectionAccumulator.addNodes(t) } else this._selectionAccumulator.addEdges(t); return !0 } return !1 } }, { key: "deselectObject", value: function (t) { !0 === t.isSelected() && (t.selected = !1, this._removeFromSelection(t)) } }, { key: "_getAllNodesOverlappingWith", value: function (t) { for (var e = [], i = this.body.nodes, n = 0; n < this.body.nodeIndices.length; n++) { var o = this.body.nodeIndices[n]; i[o].isOverlappingWith(t) && e.push(o) } return e } }, { key: "_pointerToPositionObject", value: function (t) { var e = this.canvas.DOMtoCanvas(t); return { left: e.x - 1, top: e.y + 1, right: e.x + 1, bottom: e.y - 1 } } }, { key: "getNodeAt", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this._pointerToPositionObject(t), n = this._getAllNodesOverlappingWith(i); return n.length > 0 ? !0 === e ? this.body.nodes[n[n.length - 1]] : n[n.length - 1] : void 0 } }, { key: "_getEdgesOverlappingWith", value: function (t, e) { for (var i = this.body.edges, n = 0; n < this.body.edgeIndices.length; n++) { var o = this.body.edgeIndices[n]; i[o].isOverlappingWith(t) && e.push(o) } } }, { key: "_getAllEdgesOverlappingWith", value: function (t) { var e = []; return this._getEdgesOverlappingWith(t, e), e } }, { key: "getEdgeAt", value: function (t) { for (var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], i = this.canvas.DOMtoCanvas(t), n = 10, o = null, r = this.body.edges, s = 0; s < this.body.edgeIndices.length; s++) { var a = this.body.edgeIndices[s], h = r[a]; if (h.connected) { var l = h.from.x, d = h.from.y, c = h.to.x, u = h.to.y, f = h.edgeType.getDistanceToEdge(l, d, c, u, i.x, i.y); f < n && (o = a, n = f) } } return null !== o ? !0 === e ? this.body.edges[o] : o : void 0 } }, { key: "_addToHover", value: function (t) { t instanceof Xu ? this.hoverObj.nodes[t.id] = t : this.hoverObj.edges[t.id] = t } }, { key: "_removeFromSelection", value: function (t) { var e; t instanceof Xu ? (this._selectionAccumulator.deleteNodes(t), (e = this._selectionAccumulator).deleteEdges.apply(e, kr(t.edges))) : this._selectionAccumulator.deleteEdges(t) } }, { key: "unselectAll", value: function () { this._selectionAccumulator.clear(), this._selectionAccumulator.commit() } }, { key: "getSelectedNodeCount", value: function () { return this._selectionAccumulator.sizeNodes } }, { key: "getSelectedEdgeCount", value: function () { return this._selectionAccumulator.sizeEdges } }, { key: "_hoverConnectedEdges", value: function (t) { for (var e = 0; e < t.edges.length; e++) { var i = t.edges[e]; i.hover = !0, this._addToHover(i) } } }, { key: "emitBlurEvent", value: function (t, e, i) { var n = this._initBaseEvent(t, e); !0 === i.hover && (i.hover = !1, i instanceof Xu ? (n.node = i.id, this.body.emitter.emit("blurNode", n)) : (n.edge = i.id, this.body.emitter.emit("blurEdge", n))) } }, { key: "emitHoverEvent", value: function (t, e, i) { var n = this._initBaseEvent(t, e), o = !1; return !1 === i.hover && (i.hover = !0, this._addToHover(i), o = !0, i instanceof Xu ? (n.node = i.id, this.body.emitter.emit("hoverNode", n)) : (n.edge = i.id, this.body.emitter.emit("hoverEdge", n))), o } }, { key: "hoverObject", value: function (t, e) { var i = this.getNodeAt(e); void 0 === i && (i = this.getEdgeAt(e)); var n = !1; for (var o in this.hoverObj.nodes) Object.prototype.hasOwnProperty.call(this.hoverObj.nodes, o) && (void 0 === i || i instanceof Xu && i.id != o || i instanceof jf) && (this.emitBlurEvent(t, e, this.hoverObj.nodes[o]), delete this.hoverObj.nodes[o], n = !0); for (var r in this.hoverObj.edges) Object.prototype.hasOwnProperty.call(this.hoverObj.edges, r) && (!0 === n ? (this.hoverObj.edges[r].hover = !1, delete this.hoverObj.edges[r]) : (void 0 === i || i instanceof jf && i.id != r || i instanceof Xu && !i.hover) && (this.emitBlurEvent(t, e, this.hoverObj.edges[r]), delete this.hoverObj.edges[r], n = !0)); if (void 0 !== i) { var s = rr(this.hoverObj.edges).length, a = rr(this.hoverObj.nodes).length; (n || i instanceof jf && 0 === s && 0 === a || i instanceof Xu && 0 === s && 0 === a) && (n = this.emitHoverEvent(t, e, i)), i instanceof Xu && !0 === this.options.hoverConnectedEdges && this._hoverConnectedEdges(i) } !0 === n && this.body.emitter.emit("_requestRedraw") } }, { key: "commitAndEmit", value: function (t, e) { var i = !1, n = this._selectionAccumulator.commit(), o = { nodes: n.nodes.previous, edges: n.edges.previous }; n.edges.deleted.length > 0 && (this.generateClickEvent("deselectEdge", e, t, o), i = !0), n.nodes.deleted.length > 0 && (this.generateClickEvent("deselectNode", e, t, o), i = !0), n.nodes.added.length > 0 && (this.generateClickEvent("selectNode", e, t), i = !0), n.edges.added.length > 0 && (this.generateClickEvent("selectEdge", e, t), i = !0), !0 === i && this.generateClickEvent("select", e, t) } }, { key: "getSelection", value: function () { return { nodes: this.getSelectedNodeIds(), edges: this.getSelectedEdgeIds() } } }, { key: "getSelectedNodes", value: function () { return this._selectionAccumulator.getNodes() } }, { key: "getSelectedEdges", value: function () { return this._selectionAccumulator.getEdges() } }, { key: "getSelectedNodeIds", value: function () { var t; return cr(t = this._selectionAccumulator.getNodes()).call(t, (function (t) { return t.id })) } }, { key: "getSelectedEdgeIds", value: function () { var t; return cr(t = this._selectionAccumulator.getEdges()).call(t, (function (t) { return t.id })) } }, { key: "setSelection", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; if (!t || !t.nodes && !t.edges) throw new TypeError("Selection must be an object with nodes and/or edges properties"); if ((e.unselectAll || void 0 === e.unselectAll) && this.unselectAll(), t.nodes) { var i, n = qp(t.nodes); try { for (n.s(); !(i = n.n()).done;) { var o = i.value, r = this.body.nodes[o]; if (!r) throw new RangeError('Node with id "' + o + '" not found'); this.selectObject(r, e.highlightEdges) } } catch (t) { n.e(t) } finally { n.f() } } if (t.edges) { var s, a = qp(t.edges); try { for (a.s(); !(s = a.n()).done;) { var h = s.value, l = this.body.edges[h]; if (!l) throw new RangeError('Edge with id "' + h + '" not found'); this.selectObject(l) } } catch (t) { a.e(t) } finally { a.f() } } this.body.emitter.emit("_requestRedraw"), this._selectionAccumulator.commit() } }, { key: "selectNodes", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if (!t || void 0 === t.length) throw "Selection must be an array with ids"; this.setSelection({ nodes: t }, { highlightEdges: e }) } }, { key: "selectEdges", value: function (t) { if (!t || void 0 === t.length) throw "Selection must be an array with ids"; this.setSelection({ edges: t }) } }, { key: "updateSelection", value: function () { for (var t in this._selectionAccumulator.getNodes()) Object.prototype.hasOwnProperty.call(this.body.nodes, t.id) || this._selectionAccumulator.deleteNodes(t); for (var e in this._selectionAccumulator.getEdges()) Object.prototype.hasOwnProperty.call(this.body.edges, e.id) || this._selectionAccumulator.deleteEdges(e) } }, { key: "getClickedItems", value: function (t) { for (var e = this.canvas.DOMtoCanvas(t), i = [], n = this.body.nodeIndices, o = this.body.nodes, r = n.length - 1; r >= 0; r--) { var s = o[n[r]].getItemsOnPoint(e); i.push.apply(i, s) } for (var a = this.body.edgeIndices, h = this.body.edges, l = a.length - 1; l >= 0; l--) { var d = h[a[l]].getItemsOnPoint(e); i.push.apply(i, d) } return i } }]), t }(), Xp = i((function (t, e) { !function (t) { function e(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } t.__esModule = !0, t.sort = v; var i = 32, n = 7, o = 256, r = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9]; function s(t) { return t < 1e5 ? t < 100 ? t < 10 ? 0 : 1 : t < 1e4 ? t < 1e3 ? 2 : 3 : 4 : t < 1e7 ? t < 1e6 ? 5 : 6 : t < 1e9 ? t < 1e8 ? 7 : 8 : 9 } function a(t, e) { if (t === e) return 0; if (~~t === t && ~~e === e) { if (0 === t || 0 === e) return t < e ? -1 : 1; if (t < 0 || e < 0) { if (e >= 0) return -1; if (t >= 0) return 1; t = -t, e = -e } var i = s(t), n = s(e), o = 0; return i < n ? (t *= r[n - i - 1], e /= 10, o = -1) : i > n && (e *= r[i - n - 1], t /= 10, o = 1), t === e ? o : t < e ? -1 : 1 } var a = String(t), h = String(e); return a === h ? 0 : a < h ? -1 : 1 } function h(t) { for (var e = 0; t >= i;)e |= 1 & t, t >>= 1; return t + e } function l(t, e, i, n) { var o = e + 1; if (o === i) return 1; if (n(t[o++], t[e]) < 0) { for (; o < i && n(t[o], t[o - 1]) < 0;)o++; d(t, e, o) } else for (; o < i && n(t[o], t[o - 1]) >= 0;)o++; return o - e } function d(t, e, i) { for (i--; e < i;) { var n = t[e]; t[e++] = t[i], t[i--] = n } } function c(t, e, i, n, o) { for (n === e && n++; n < i; n++) { for (var r = t[n], s = e, a = n; s < a;) { var h = s + a >>> 1; o(r, t[h]) < 0 ? a = h : s = h + 1 } var l = n - s; switch (l) { case 3: t[s + 3] = t[s + 2]; case 2: t[s + 2] = t[s + 1]; case 1: t[s + 1] = t[s]; break; default: for (; l > 0;)t[s + l] = t[s + l - 1], l-- }t[s] = r } } function u(t, e, i, n, o, r) { var s = 0, a = 0, h = 1; if (r(t, e[i + o]) > 0) { for (a = n - o; h < a && r(t, e[i + o + h]) > 0;)s = h, (h = 1 + (h << 1)) <= 0 && (h = a); h > a && (h = a), s += o, h += o } else { for (a = o + 1; h < a && r(t, e[i + o - h]) <= 0;)s = h, (h = 1 + (h << 1)) <= 0 && (h = a); h > a && (h = a); var l = s; s = o - h, h = o - l } for (s++; s < h;) { var d = s + (h - s >>> 1); r(t, e[i + d]) > 0 ? s = d + 1 : h = d } return h } function f(t, e, i, n, o, r) { var s = 0, a = 0, h = 1; if (r(t, e[i + o]) < 0) { for (a = o + 1; h < a && r(t, e[i + o - h]) < 0;)s = h, (h = 1 + (h << 1)) <= 0 && (h = a); h > a && (h = a); var l = s; s = o - h, h = o - l } else { for (a = n - o; h < a && r(t, e[i + o + h]) >= 0;)s = h, (h = 1 + (h << 1)) <= 0 && (h = a); h > a && (h = a), s += o, h += o } for (s++; s < h;) { var d = s + (h - s >>> 1); r(t, e[i + d]) < 0 ? h = d : s = d + 1 } return h } var p = function () { function t(i, r) { e(this, t), this.array = null, this.compare = null, this.minGallop = n, this.length = 0, this.tmpStorageLength = o, this.stackLength = 0, this.runStart = null, this.runLength = null, this.stackSize = 0, this.array = i, this.compare = r, this.length = i.length, this.length < 2 * o && (this.tmpStorageLength = this.length >>> 1), this.tmp = new Array(this.tmpStorageLength), this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40, this.runStart = new Array(this.stackLength), this.runLength = new Array(this.stackLength) } return t.prototype.pushRun = function (t, e) { this.runStart[this.stackSize] = t, this.runLength[this.stackSize] = e, this.stackSize += 1 }, t.prototype.mergeRuns = function () { for (; this.stackSize > 1;) { var t = this.stackSize - 2; if (t >= 1 && this.runLength[t - 1] <= this.runLength[t] + this.runLength[t + 1] || t >= 2 && this.runLength[t - 2] <= this.runLength[t] + this.runLength[t - 1]) this.runLength[t - 1] < this.runLength[t + 1] && t--; else if (this.runLength[t] > this.runLength[t + 1]) break; this.mergeAt(t) } }, t.prototype.forceMergeRuns = function () { for (; this.stackSize > 1;) { var t = this.stackSize - 2; t > 0 && this.runLength[t - 1] < this.runLength[t + 1] && t--, this.mergeAt(t) } }, t.prototype.mergeAt = function (t) { var e = this.compare, i = this.array, n = this.runStart[t], o = this.runLength[t], r = this.runStart[t + 1], s = this.runLength[t + 1]; this.runLength[t] = o + s, t === this.stackSize - 3 && (this.runStart[t + 1] = this.runStart[t + 2], this.runLength[t + 1] = this.runLength[t + 2]), this.stackSize--; var a = f(i[r], i, n, o, 0, e); n += a, 0 != (o -= a) && 0 !== (s = u(i[n + o - 1], i, r, s, s - 1, e)) && (o <= s ? this.mergeLow(n, o, r, s) : this.mergeHigh(n, o, r, s)) }, t.prototype.mergeLow = function (t, e, i, o) { var r = this.compare, s = this.array, a = this.tmp, h = 0; for (h = 0; h < e; h++)a[h] = s[t + h]; var l = 0, d = i, c = t; if (s[c++] = s[d++], 0 != --o) if (1 !== e) { for (var p = this.minGallop; ;) { var v = 0, g = 0, y = !1; do { if (r(s[d], a[l]) < 0) { if (s[c++] = s[d++], g++, v = 0, 0 == --o) { y = !0; break } } else if (s[c++] = a[l++], v++, g = 0, 1 == --e) { y = !0; break } } while ((v | g) < p); if (y) break; do { if (0 !== (v = f(s[d], a, l, e, 0, r))) { for (h = 0; h < v; h++)s[c + h] = a[l + h]; if (c += v, l += v, (e -= v) <= 1) { y = !0; break } } if (s[c++] = s[d++], 0 == --o) { y = !0; break } if (0 !== (g = u(a[l], s, d, o, 0, r))) { for (h = 0; h < g; h++)s[c + h] = s[d + h]; if (c += g, d += g, 0 == (o -= g)) { y = !0; break } } if (s[c++] = a[l++], 1 == --e) { y = !0; break } p-- } while (v >= n || g >= n); if (y) break; p < 0 && (p = 0), p += 2 } if (this.minGallop = p, p < 1 && (this.minGallop = 1), 1 === e) { for (h = 0; h < o; h++)s[c + h] = s[d + h]; s[c + o] = a[l] } else { if (0 === e) throw new Error("mergeLow preconditions were not respected"); for (h = 0; h < e; h++)s[c + h] = a[l + h] } } else { for (h = 0; h < o; h++)s[c + h] = s[d + h]; s[c + o] = a[l] } else for (h = 0; h < e; h++)s[c + h] = a[l + h] }, t.prototype.mergeHigh = function (t, e, i, o) { var r = this.compare, s = this.array, a = this.tmp, h = 0; for (h = 0; h < o; h++)a[h] = s[i + h]; var l = t + e - 1, d = o - 1, c = i + o - 1, p = 0, v = 0; if (s[c--] = s[l--], 0 != --e) if (1 !== o) { for (var g = this.minGallop; ;) { var y = 0, m = 0, b = !1; do { if (r(a[d], s[l]) < 0) { if (s[c--] = s[l--], y++, m = 0, 0 == --e) { b = !0; break } } else if (s[c--] = a[d--], m++, y = 0, 1 == --o) { b = !0; break } } while ((y | m) < g); if (b) break; do { if (0 != (y = e - f(a[d], s, t, e, e - 1, r))) { for (e -= y, v = 1 + (c -= y), p = 1 + (l -= y), h = y - 1; h >= 0; h--)s[v + h] = s[p + h]; if (0 === e) { b = !0; break } } if (s[c--] = a[d--], 1 == --o) { b = !0; break } if (0 != (m = o - u(s[l], a, 0, o, o - 1, r))) { for (o -= m, v = 1 + (c -= m), p = 1 + (d -= m), h = 0; h < m; h++)s[v + h] = a[p + h]; if (o <= 1) { b = !0; break } } if (s[c--] = s[l--], 0 == --e) { b = !0; break } g-- } while (y >= n || m >= n); if (b) break; g < 0 && (g = 0), g += 2 } if (this.minGallop = g, g < 1 && (this.minGallop = 1), 1 === o) { for (v = 1 + (c -= e), p = 1 + (l -= e), h = e - 1; h >= 0; h--)s[v + h] = s[p + h]; s[c] = a[d] } else { if (0 === o) throw new Error("mergeHigh preconditions were not respected"); for (p = c - (o - 1), h = 0; h < o; h++)s[p + h] = a[h] } } else { for (v = 1 + (c -= e), p = 1 + (l -= e), h = e - 1; h >= 0; h--)s[v + h] = s[p + h]; s[c] = a[d] } else for (p = c - (o - 1), h = 0; h < o; h++)s[p + h] = a[h] }, t }(); function v(t, e, n, o) { if (!Array.isArray(t)) throw new TypeError("Can only sort arrays"); e ? "function" != typeof e && (o = n, n = e, e = a) : e = a, n || (n = 0), o || (o = t.length); var r = o - n; if (!(r < 2)) { var s = 0; if (r < i) c(t, n, o, n + (s = l(t, n, o, e)), e); else { var d = new p(t, e), u = h(r); do { if ((s = l(t, n, o, e)) < u) { var f = r; f > u && (f = u), c(t, n, n + f, n + s, e), s = f } d.pushRun(n, s), d.mergeRuns(), r -= s, n += s } while (0 !== r); d.forceMergeRuns() } } } }(e) })); (Up = Xp) && Up.__esModule && Object.prototype.hasOwnProperty.call(Up, "default") && Up.default; var Gp = Xp, Kp = Gp.sort; function $p(t) { var e = function () { if ("undefined" == typeof Reflect || !fd) return !1; if (fd.sham) return !1; if ("function" == typeof Proxy) return !0; try { return Date.prototype.toString.call(fd(Date, [], (function () { }))), !0 } catch (t) { return !1 } }(); return function () { var i, n = Rd(t); if (e) { var o = Rd(this).constructor; i = fd(n, arguments, o) } else i = n.apply(this, arguments); return Fd(this, i) } } var Zp = function () { function t() { El(this, t) } return Sl(t, [{ key: "abstract", value: function () { throw new Error("Can't instantiate abstract class!") } }, { key: "fake_use", value: function () { } }, { key: "curveType", value: function () { return this.abstract() } }, { key: "getPosition", value: function (t) { return this.fake_use(t), this.abstract() } }, { key: "setPosition", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; this.fake_use(t, e, i), this.abstract() } }, { key: "getTreeSize", value: function (t) { return this.fake_use(t), this.abstract() } }, { key: "sort", value: function (t) { this.fake_use(t), this.abstract() } }, { key: "fix", value: function (t, e) { this.fake_use(t, e), this.abstract() } }, { key: "shift", value: function (t, e) { this.fake_use(t, e), this.abstract() } }]), t }(), Qp = function (t) { Ad(i, t); var e = $p(i); function i(t) { var n; return El(this, i), (n = e.call(this)).layout = t, n } return Sl(i, [{ key: "curveType", value: function () { return "horizontal" } }, { key: "getPosition", value: function (t) { return t.x } }, { key: "setPosition", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; void 0 !== i && this.layout.hierarchical.addToOrdering(t, i), t.x = e } }, { key: "getTreeSize", value: function (t) { var e = this.layout.hierarchical.getTreeSize(this.layout.body.nodes, t); return { min: e.min_x, max: e.max_x } } }, { key: "sort", value: function (t) { Kp(t, (function (t, e) { return t.x - e.x })) } }, { key: "fix", value: function (t, e) { t.y = this.layout.options.hierarchical.levelSeparation * e, t.options.fixed.y = !0 } }, { key: "shift", value: function (t, e) { this.layout.body.nodes[t].x += e } }]), i }(Zp), Jp = function (t) { Ad(i, t); var e = $p(i); function i(t) { var n; return El(this, i), (n = e.call(this)).layout = t, n } return Sl(i, [{ key: "curveType", value: function () { return "vertical" } }, { key: "getPosition", value: function (t) { return t.y } }, { key: "setPosition", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; void 0 !== i && this.layout.hierarchical.addToOrdering(t, i), t.y = e } }, { key: "getTreeSize", value: function (t) { var e = this.layout.hierarchical.getTreeSize(this.layout.body.nodes, t); return { min: e.min_y, max: e.max_y } } }, { key: "sort", value: function (t) { Kp(t, (function (t, e) { return t.y - e.y })) } }, { key: "fix", value: function (t, e) { t.x = this.layout.options.hierarchical.levelSeparation * e, t.options.fixed.x = !0 } }, { key: "shift", value: function (t, e) { this.layout.body.nodes[t].y += e } }]), i }(Zp), tv = Ve.every, ev = zn("every"), iv = jn("every"); q({ target: "Array", proto: !0, forced: !ev || !iv }, { every: function (t) { return tv(this, t, arguments.length > 1 ? arguments[1] : void 0) } }); var nv = G("Array").every, ov = Array.prototype, rv = function (t) { var e = t.every; return t === ov || t instanceof Array && e === ov.every ? nv : e }; function sv(t, e) { var i; if (void 0 === Or || null == rn(t)) { if (ur(t) || (i = function (t, e) { var i; if (!t) return; if ("string" == typeof t) return av(t, e); var n = yr(i = Object.prototype.toString.call(t)).call(i, 8, -1); "Object" === n && t.constructor && (n = t.constructor.name); if ("Map" === n || "Set" === n) return yn(t); if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return av(t, e) }(t)) || e && t && "number" == typeof t.length) { i && (t = i); var n = 0, o = function () { }; return { s: o, n: function () { return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] } }, e: function (t) { throw t }, f: o } } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.") } var r, s = !0, a = !1; return { s: function () { i = on(t) }, n: function () { var t = i.next(); return s = t.done, t }, e: function (t) { a = !0, r = t }, f: function () { try { s || null == i.return || i.return() } finally { if (a) throw r } } } } function av(t, e) { (null == e || e > t.length) && (e = t.length); for (var i = 0, n = new Array(e); i < e; i++)n[i] = t[i]; return n } function hv(t, e) { var i = new Gd; return Yn(t).call(t, (function (t) { var e; Yn(e = t.edges).call(e, (function (t) { t.connected && i.add(t) })) })), Yn(i).call(i, (function (t) { var i = t.from.id, n = t.to.id; null == e[i] && (e[i] = 0), (null == e[n] || e[i] >= e[n]) && (e[n] = e[i] + 1) })), e } function lv(t, e, i, n) { var o, r, s = wn(null), a = dc(o = kr(Td(n).call(n))).call(o, (function (t, e) { return t + 1 + e.edges.length }), 0), h = i + "Id", l = "to" === i ? 1 : -1, d = sv(n); try { var c = function () { var o = ir(r.value, 2), d = o[0], c = o[1]; if (!n.has(d) || !t(c)) return "continue"; s[d] = 0; for (var u = [c], f = 0, p = void 0, v = function () { var t, o; if (!n.has(d)) return "continue"; var r = s[p.id] + l; if (Yn(t = yo(o = p.edges).call(o, (function (t) { return t.connected && t.to !== t.from && t[i] !== p && n.has(t.toId) && n.has(t.fromId) }))).call(t, (function (t) { var n = t[h], o = s[n]; (null == o || e(r, o)) && (s[n] = r, u.push(t[i])) })), f > a) return { v: { v: hv(n, s) } }; ++f }; p = u.pop();) { var g = v(); if ("continue" !== g && "object" === vr(g)) return g.v } }; for (d.s(); !(r = d.n()).done;) { var u = c(); if ("continue" !== u && "object" === vr(u)) return u.v } } catch (t) { d.e(t) } finally { d.f() } return s } var dv = function () { function t() { El(this, t), this.childrenReference = {}, this.parentReference = {}, this.trees = {}, this.distributionOrdering = {}, this.levels = {}, this.distributionIndex = {}, this.isTree = !1, this.treeIndex = -1 } return Sl(t, [{ key: "addRelation", value: function (t, e) { void 0 === this.childrenReference[t] && (this.childrenReference[t] = []), this.childrenReference[t].push(e), void 0 === this.parentReference[e] && (this.parentReference[e] = []), this.parentReference[e].push(t) } }, { key: "checkIfTree", value: function () { for (var t in this.parentReference) if (this.parentReference[t].length > 1) return void (this.isTree = !1); this.isTree = !0 } }, { key: "numTrees", value: function () { return this.treeIndex + 1 } }, { key: "setTreeIndex", value: function (t, e) { void 0 !== e && void 0 === this.trees[t.id] && (this.trees[t.id] = e, this.treeIndex = Math.max(e, this.treeIndex)) } }, { key: "ensureLevel", value: function (t) { void 0 === this.levels[t] && (this.levels[t] = 0) } }, { key: "getMaxLevel", value: function (t) { var e = this, i = {}; return function t(n) { if (void 0 !== i[n]) return i[n]; var o = e.levels[n]; if (e.childrenReference[n]) { var r = e.childrenReference[n]; if (r.length > 0) for (var s = 0; s < r.length; s++)o = Math.max(o, t(r[s])) } return i[n] = o, o }(t) } }, { key: "levelDownstream", value: function (t, e) { void 0 === this.levels[e.id] && (void 0 === this.levels[t.id] && (this.levels[t.id] = 0), this.levels[e.id] = this.levels[t.id] + 1) } }, { key: "setMinLevelToZero", value: function (t) { var e = 1e9; for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && void 0 !== this.levels[i] && (e = Math.min(this.levels[i], e)); for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && void 0 !== this.levels[n] && (this.levels[n] -= e) } }, { key: "getTreeSize", value: function (t, e) { var i = 1e9, n = -1e9, o = 1e9, r = -1e9; for (var s in this.trees) if (Object.prototype.hasOwnProperty.call(this.trees, s) && this.trees[s] === e) { var a = t[s]; i = Math.min(a.x, i), n = Math.max(a.x, n), o = Math.min(a.y, o), r = Math.max(a.y, r) } return { min_x: i, max_x: n, min_y: o, max_y: r } } }, { key: "hasSameParent", value: function (t, e) { var i = this.parentReference[t.id], n = this.parentReference[e.id]; if (void 0 === i || void 0 === n) return !1; for (var o = 0; o < i.length; o++)for (var r = 0; r < n.length; r++)if (i[o] == n[r]) return !0; return !1 } }, { key: "inSameSubNetwork", value: function (t, e) { return this.trees[t.id] === this.trees[e.id] } }, { key: "getLevels", value: function () { return rr(this.distributionOrdering) } }, { key: "addToOrdering", value: function (t, e) { void 0 === this.distributionOrdering[e] && (this.distributionOrdering[e] = []); var i = !1, n = this.distributionOrdering[e]; for (var o in n) if (n[o] === t) { i = !0; break } i || (this.distributionOrdering[e].push(t), this.distributionIndex[t.id] = this.distributionOrdering[e].length - 1) } }]), t }(), cv = function () { function t(e) { El(this, t), this.body = e, this._resetRNG(Math.random() + ":" + nr()), this.setPhysics = !1, this.options = {}, this.optionsBackup = { physics: {} }, this.defaultOptions = { randomSeed: void 0, improvedLayout: !0, clusterThreshold: 150, hierarchical: { enabled: !1, levelSeparation: 150, nodeSpacing: 100, treeSpacing: 200, blockShifting: !0, edgeMinimization: !0, parentCentralization: !0, direction: "UD", sortMethod: "hubsize" } }, mt(this.options, this.defaultOptions), this.bindEventListeners() } return Sl(t, [{ key: "bindEventListeners", value: function () { var t = this; this.body.emitter.on("_dataChanged", (function () { t.setupHierarchicalLayout() })), this.body.emitter.on("_dataLoaded", (function () { t.layoutNetwork() })), this.body.emitter.on("_resetHierarchicalLayout", (function () { t.setupHierarchicalLayout() })), this.body.emitter.on("_adjustEdgesForHierarchicalLayout", (function () { if (!0 === t.options.hierarchical.enabled) { var e = t.direction.curveType(); t.body.emitter.emit("_forceDisableDynamicCurves", e, !1) } })) } }, { key: "setOptions", value: function (t, e) { if (void 0 !== t) { var i = this.options.hierarchical, n = i.enabled; if (Zr(["randomSeed", "improvedLayout", "clusterThreshold"], this.options, t), Os(this.options, t, "hierarchical"), void 0 !== t.randomSeed && this._resetRNG(t.randomSeed), !0 === i.enabled) return !0 === n && this.body.emitter.emit("refresh", !0), "RL" === i.direction || "DU" === i.direction ? i.levelSeparation > 0 && (i.levelSeparation *= -1) : i.levelSeparation < 0 && (i.levelSeparation *= -1), this.setDirectionStrategy(), this.body.emitter.emit("_resetHierarchicalLayout"), this.adaptAllOptionsForHierarchicalLayout(e); if (!0 === n) return this.body.emitter.emit("refresh"), Jr(e, this.optionsBackup) } return e } }, { key: "_resetRNG", value: function (t) { this.initialRandomSeed = t, this._rng = Ar(this.initialRandomSeed) } }, { key: "adaptAllOptionsForHierarchicalLayout", value: function (t) { if (!0 === this.options.hierarchical.enabled) { var e = this.optionsBackup.physics; void 0 === t.physics || !0 === t.physics ? (t.physics = { enabled: void 0 === e.enabled || e.enabled, solver: "hierarchicalRepulsion" }, e.enabled = void 0 === e.enabled || e.enabled, e.solver = e.solver || "barnesHut") : "object" === vr(t.physics) ? (e.enabled = void 0 === t.physics.enabled || t.physics.enabled, e.solver = t.physics.solver || "barnesHut", t.physics.solver = "hierarchicalRepulsion") : !1 !== t.physics && (e.solver = "barnesHut", t.physics = { solver: "hierarchicalRepulsion" }); var i = this.direction.curveType(); if (void 0 === t.edges) this.optionsBackup.edges = { smooth: { enabled: !0, type: "dynamic" } }, t.edges = { smooth: !1 }; else if (void 0 === t.edges.smooth) this.optionsBackup.edges = { smooth: { enabled: !0, type: "dynamic" } }, t.edges.smooth = !1; else if ("boolean" == typeof t.edges.smooth) this.optionsBackup.edges = { smooth: t.edges.smooth }, t.edges.smooth = { enabled: t.edges.smooth, type: i }; else { var n = t.edges.smooth; void 0 !== n.type && "dynamic" !== n.type && (i = n.type), this.optionsBackup.edges = { smooth: { enabled: void 0 === n.enabled || n.enabled, type: void 0 === n.type ? "dynamic" : n.type, roundness: void 0 === n.roundness ? .5 : n.roundness, forceDirection: void 0 !== n.forceDirection && n.forceDirection } }, t.edges.smooth = { enabled: void 0 === n.enabled || n.enabled, type: i, roundness: void 0 === n.roundness ? .5 : n.roundness, forceDirection: void 0 !== n.forceDirection && n.forceDirection } } this.body.emitter.emit("_forceDisableDynamicCurves", i) } return t } }, { key: "positionInitially", value: function (t) { if (!0 !== this.options.hierarchical.enabled) { this._resetRNG(this.initialRandomSeed); for (var e = t.length + 50, i = 0; i < t.length; i++) { var n = t[i], o = 2 * Math.PI * this._rng(); void 0 === n.x && (n.x = e * Math.cos(o)), void 0 === n.y && (n.y = e * Math.sin(o)) } } } }, { key: "layoutNetwork", value: function () { if (!0 !== this.options.hierarchical.enabled && !0 === this.options.improvedLayout) { for (var t = this.body.nodeIndices, e = 0, i = 0; i < t.length; i++) { !0 === this.body.nodes[t[i]].predefinedPosition && (e += 1) } if (e < .5 * t.length) { var n = 0, o = this.options.clusterThreshold, r = { clusterNodeProperties: { shape: "ellipse", label: "", group: "", font: { multi: !1 } }, clusterEdgeProperties: { label: "", font: { multi: !1 }, smooth: { enabled: !1 } } }; if (t.length > o) { for (var s = t.length; t.length > o && n <= 10;) { n += 1; var a = t.length; if (n % 3 == 0 ? this.body.modules.clustering.clusterBridges(r) : this.body.modules.clustering.clusterOutliers(r), a == t.length && n % 3 != 0) return this._declusterAll(), this.body.emitter.emit("_layoutFailed"), void console.info("This network could not be positioned by this version of the improved layout algorithm. Please disable improvedLayout for better performance.") } this.body.modules.kamadaKawai.setOptions({ springLength: Math.max(150, 2 * s) }) } n > 10 && console.info("The clustering didn't succeed within the amount of interations allowed, progressing with partial result."), this.body.modules.kamadaKawai.solve(t, this.body.edgeIndices, !0), this._shiftToCenter(); for (var h = 0; h < t.length; h++) { var l = this.body.nodes[t[h]]; !1 === l.predefinedPosition && (l.x += 70 * (.5 - this._rng()), l.y += 70 * (.5 - this._rng())) } this._declusterAll(), this.body.emitter.emit("_repositionBezierNodes") } } } }, { key: "_shiftToCenter", value: function () { for (var t = ip.getRangeCore(this.body.nodes, this.body.nodeIndices), e = ip.findCenter(t), i = 0; i < this.body.nodeIndices.length; i++) { var n = this.body.nodes[this.body.nodeIndices[i]]; n.x -= e.x, n.y -= e.y } } }, { key: "_declusterAll", value: function () { for (var t = !0; !0 === t;) { t = !1; for (var e = 0; e < this.body.nodeIndices.length; e++)!0 === this.body.nodes[this.body.nodeIndices[e]].isCluster && (t = !0, this.body.modules.clustering.openCluster(this.body.nodeIndices[e], {}, !1)); !0 === t && this.body.emitter.emit("_dataChanged") } } }, { key: "getSeed", value: function () { return this.initialRandomSeed } }, { key: "setupHierarchicalLayout", value: function () { if (!0 === this.options.hierarchical.enabled && this.body.nodeIndices.length > 0) { var t, e, i = !1, n = !1; for (e in this.lastNodeOnLevel = {}, this.hierarchical = new dv, this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, e) && (void 0 !== (t = this.body.nodes[e]).options.level ? (i = !0, this.hierarchical.levels[e] = t.options.level) : n = !0); if (!0 === n && !0 === i) throw new Error("To use the hierarchical layout, nodes require either no predefined levels or levels have to be defined for all nodes."); if (!0 === n) { var o = this.options.hierarchical.sortMethod; "hubsize" === o ? this._determineLevelsByHubsize() : "directed" === o ? this._determineLevelsDirected() : "custom" === o && this._determineLevelsCustomCallback() } for (var r in this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, r) && this.hierarchical.ensureLevel(r); var s = this._getDistribution(); this._generateMap(), this._placeNodesByHierarchy(s), this._condenseHierarchy(), this._shiftToCenter() } } }, { key: "_condenseHierarchy", value: function () { var t = this, e = !1, i = {}, n = function (e, i) { var n = t.hierarchical.trees; for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && n[o] === e && t.direction.shift(o, i) }, o = function () { for (var e = [], i = 0; i < t.hierarchical.numTrees(); i++)e.push(t.direction.getTreeSize(i)); return e }, r = function e(i, n) { if (!n[i.id] && (n[i.id] = !0, t.hierarchical.childrenReference[i.id])) { var o = t.hierarchical.childrenReference[i.id]; if (o.length > 0) for (var r = 0; r < o.length; r++)e(t.body.nodes[o[r]], n) } }, s = function (e) { var i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1e9, n = 1e9, o = 1e9, r = 1e9, s = -1e9; for (var a in e) if (Object.prototype.hasOwnProperty.call(e, a)) { var h = t.body.nodes[a], l = t.hierarchical.levels[h.id], d = t.direction.getPosition(h), c = t._getSpaceAroundNode(h, e), u = ir(c, 2), f = u[0], p = u[1]; n = Math.min(f, n), o = Math.min(p, o), l <= i && (r = Math.min(d, r), s = Math.max(d, s)) } return [r, s, n, o] }, a = function (e, i) { var n = t.hierarchical.getMaxLevel(e.id), o = t.hierarchical.getMaxLevel(i.id); return Math.min(n, o) }, h = function (e, i, n) { for (var o = t.hierarchical, r = 0; r < i.length; r++) { var s = i[r], a = o.distributionOrdering[s]; if (a.length > 1) for (var h = 0; h < a.length - 1; h++) { var l = a[h], d = a[h + 1]; o.hasSameParent(l, d) && o.inSameSubNetwork(l, d) && e(l, d, n) } } }, l = function (i, n) { var o = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], h = t.direction.getPosition(i), l = t.direction.getPosition(n), d = Math.abs(l - h), c = t.options.hierarchical.nodeSpacing; if (d > c) { var u = {}, f = {}; r(i, u), r(n, f); var p = a(i, n), v = s(u, p), g = s(f, p), y = v[1], m = g[0], b = g[2], w = Math.abs(y - m); if (w > c) { var k = y - m + c; k < -b + c && (k = -b + c), k < 0 && (t._shiftBlock(n.id, k), e = !0, !0 === o && t._centerParent(n)) } } }, d = function (n, o) { for (var a = o.id, h = o.edges, l = t.hierarchical.levels[o.id], d = t.options.hierarchical.levelSeparation * t.options.hierarchical.levelSeparation, c = {}, u = [], f = 0; f < h.length; f++) { var p = h[f]; if (p.toId != p.fromId) { var v = p.toId == a ? p.from : p.to; c[h[f].id] = v, t.hierarchical.levels[v.id] < l && u.push(p) } } var g = function (e, i) { for (var n = 0, o = 0; o < i.length; o++)if (void 0 !== c[i[o].id]) { var r = t.direction.getPosition(c[i[o].id]) - e; n += r / Math.sqrt(r * r + d) } return n }, y = function (e, i) { for (var n = 0, o = 0; o < i.length; o++)if (void 0 !== c[i[o].id]) { var r = t.direction.getPosition(c[i[o].id]) - e; n -= d * Math.pow(r * r + d, -1.5) } return n }, m = function (e, i) { for (var n = t.direction.getPosition(o), r = {}, s = 0; s < e; s++) { var a = g(n, i), h = y(n, i); if (void 0 !== r[n -= Math.max(-40, Math.min(40, Math.round(a / h)))]) break; r[n] = s } return n }, b = m(n, u); !function (n) { var a = t.direction.getPosition(o); if (void 0 === i[o.id]) { var h = {}; r(o, h), i[o.id] = h } var l = s(i[o.id]), d = l[2], c = l[3], u = n - a, f = 0; u > 0 ? f = Math.min(u, c - t.options.hierarchical.nodeSpacing) : u < 0 && (f = -Math.min(-u, d - t.options.hierarchical.nodeSpacing)), 0 != f && (t._shiftBlock(o.id, f), e = !0) }(b), function (i) { var n = t.direction.getPosition(o), r = t._getSpaceAroundNode(o), s = ir(r, 2), a = s[0], h = s[1], l = i - n, d = n; l > 0 ? d = Math.min(n + (h - t.options.hierarchical.nodeSpacing), i) : l < 0 && (d = Math.max(n - (a - t.options.hierarchical.nodeSpacing), i)), d !== n && (t.direction.setPosition(o, d), e = !0) }(b = m(n, h)) }; !0 === this.options.hierarchical.blockShifting && (function (i) { var n = t.hierarchical.getLevels(); n = ep(n).call(n); for (var o = 0; o < i && (e = !1, h(l, n, !0), !0 === e); o++); }(5), function () { for (var e in t.body.nodes) Object.prototype.hasOwnProperty.call(t.body.nodes, e) && t._centerParent(t.body.nodes[e]) }()), !0 === this.options.hierarchical.edgeMinimization && function (i) { var n = t.hierarchical.getLevels(); n = ep(n).call(n); for (var o = 0; o < i; o++) { e = !1; for (var r = 0; r < n.length; r++)for (var s = n[r], a = t.hierarchical.distributionOrdering[s], h = 0; h < a.length; h++)d(1e3, a[h]); if (!0 !== e) break } }(20), !0 === this.options.hierarchical.parentCentralization && function () { var e = t.hierarchical.getLevels(); e = ep(e).call(e); for (var i = 0; i < e.length; i++)for (var n = e[i], o = t.hierarchical.distributionOrdering[n], r = 0; r < o.length; r++)t._centerParent(o[r]) }(), function () { for (var e = o(), i = 0, r = 0; r < e.length - 1; r++) { i += e[r].max - e[r + 1].min + t.options.hierarchical.treeSpacing, n(r + 1, i) } }() } }, { key: "_getSpaceAroundNode", value: function (t, e) { var i = !0; void 0 === e && (i = !1); var n = this.hierarchical.levels[t.id]; if (void 0 !== n) { var o = this.hierarchical.distributionIndex[t.id], r = this.direction.getPosition(t), s = this.hierarchical.distributionOrdering[n], a = 1e9, h = 1e9; if (0 !== o) { var l = s[o - 1]; if (!0 === i && void 0 === e[l.id] || !1 === i) a = r - this.direction.getPosition(l) } if (o != s.length - 1) { var d = s[o + 1]; if (!0 === i && void 0 === e[d.id] || !1 === i) { var c = this.direction.getPosition(d); h = Math.min(h, c - r) } } return [a, h] } return [0, 0] } }, { key: "_centerParent", value: function (t) { if (this.hierarchical.parentReference[t.id]) for (var e = this.hierarchical.parentReference[t.id], i = 0; i < e.length; i++) { var n = e[i], o = this.body.nodes[n], r = this.hierarchical.childrenReference[n]; if (void 0 !== r) { var s = this._getCenterPosition(r), a = this.direction.getPosition(o), h = this._getSpaceAroundNode(o), l = ir(h, 2), d = l[0], c = l[1], u = a - s; (u < 0 && Math.abs(u) < c - this.options.hierarchical.nodeSpacing || u > 0 && Math.abs(u) < d - this.options.hierarchical.nodeSpacing) && this.direction.setPosition(o, s) } } } }, { key: "_placeNodesByHierarchy", value: function (t) { for (var e in this.positionedNodes = {}, t) if (Object.prototype.hasOwnProperty.call(t, e)) { var i, n = rr(t[e]); n = this._indexArrayToNodes(n), Xd(i = this.direction).call(i, n); for (var o = 0, r = 0; r < n.length; r++) { var s = n[r]; if (void 0 === this.positionedNodes[s.id]) { var a = this.options.hierarchical.nodeSpacing, h = a * o; o > 0 && (h = this.direction.getPosition(n[r - 1]) + a), this.direction.setPosition(s, h, e), this._validatePositionAndContinue(s, e, h), o++ } } } } }, { key: "_placeBranchNodes", value: function (t, e) { var i, n = this.hierarchical.childrenReference[t]; if (void 0 !== n) { for (var o = [], r = 0; r < n.length; r++)o.push(this.body.nodes[n[r]]); Xd(i = this.direction).call(i, o); for (var s = 0; s < o.length; s++) { var a = o[s], h = this.hierarchical.levels[a.id]; if (!(h > e && void 0 === this.positionedNodes[a.id])) return; var l = this.options.hierarchical.nodeSpacing, d = void 0; d = 0 === s ? this.direction.getPosition(this.body.nodes[t]) : this.direction.getPosition(o[s - 1]) + l, this.direction.setPosition(a, d, h), this._validatePositionAndContinue(a, h, d) } var c = this._getCenterPosition(o); this.direction.setPosition(this.body.nodes[t], c, e) } } }, { key: "_validatePositionAndContinue", value: function (t, e, i) { if (this.hierarchical.isTree) { if (void 0 !== this.lastNodeOnLevel[e]) { var n = this.direction.getPosition(this.body.nodes[this.lastNodeOnLevel[e]]); if (i - n < this.options.hierarchical.nodeSpacing) { var o = n + this.options.hierarchical.nodeSpacing - i, r = this._findCommonParent(this.lastNodeOnLevel[e], t.id); this._shiftBlock(r.withChild, o) } } this.lastNodeOnLevel[e] = t.id, this.positionedNodes[t.id] = !0, this._placeBranchNodes(t.id, e) } } }, { key: "_indexArrayToNodes", value: function (t) { for (var e = [], i = 0; i < t.length; i++)e.push(this.body.nodes[t[i]]); return e } }, { key: "_getDistribution", value: function () { var t, e, i = {}; for (t in this.body.nodes) if (Object.prototype.hasOwnProperty.call(this.body.nodes, t)) { e = this.body.nodes[t]; var n = void 0 === this.hierarchical.levels[t] ? 0 : this.hierarchical.levels[t]; this.direction.fix(e, n), void 0 === i[n] && (i[n] = {}), i[n][t] = e } return i } }, { key: "_getActiveEdges", value: function (t) { var e = this, i = []; return ss(t.edges, (function (t) { var n; -1 !== To(n = e.body.edgeIndices).call(n, t.id) && i.push(t) })), i } }, { key: "_getHubSizes", value: function () { var t = this, e = {}; ss(this.body.nodeIndices, (function (i) { var n = t.body.nodes[i], o = t._getActiveEdges(n).length; e[o] = !0 })); var i = []; return ss(e, (function (t) { i.push(Number(t)) })), Xd(Gp).call(Gp, i, (function (t, e) { return e - t })), i } }, { key: "_determineLevelsByHubsize", value: function () { for (var t = this, e = function (e, i) { t.hierarchical.levelDownstream(e, i) }, i = this._getHubSizes(), n = function (n) { var o = i[n]; if (0 === o) return "break"; ss(t.body.nodeIndices, (function (i) { var n = t.body.nodes[i]; o === t._getActiveEdges(n).length && t._crawlNetwork(e, i) })) }, o = 0; o < i.length; ++o) { if ("break" === n(o)) break } } }, { key: "_determineLevelsCustomCallback", value: function () { var t = this; this._crawlNetwork((function (e, i, n) { var o = t.hierarchical.levels[e.id]; void 0 === o && (o = t.hierarchical.levels[e.id] = 1e5); var r = (ip.cloneOptions(e, "node"), ip.cloneOptions(i, "node"), void ip.cloneOptions(n, "edge")); t.hierarchical.levels[i.id] = o + r })), this.hierarchical.setMinLevelToZero(this.body.nodes) } }, { key: "_determineLevelsDirected", value: function () { var t, e = this, i = dc(t = this.body.nodeIndices).call(t, (function (t, i) { return t.set(i, e.body.nodes[i]), t }), new Yl); "roots" === this.options.hierarchical.shakeTowards ? this.hierarchical.levels = function (t) { return lv((function (e) { var i, n; return rv(i = yo(n = e.edges).call(n, (function (e) { return t.has(e.toId) }))).call(i, (function (t) { return t.from === e })) }), (function (t, e) { return e < t }), "to", t) }(i) : this.hierarchical.levels = function (t) { return lv((function (e) { var i, n; return rv(i = yo(n = e.edges).call(n, (function (e) { return t.has(e.toId) }))).call(i, (function (t) { return t.to === e })) }), (function (t, e) { return e > t }), "from", t) }(i), this.hierarchical.setMinLevelToZero(this.body.nodes) } }, { key: "_generateMap", value: function () { var t = this; this._crawlNetwork((function (e, i) { t.hierarchical.levels[i.id] > t.hierarchical.levels[e.id] && t.hierarchical.addRelation(e.id, i.id) })), this.hierarchical.checkIfTree() } }, { key: "_crawlNetwork", value: function () { var t = this, e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function () { }, i = arguments.length > 1 ? arguments[1] : void 0, n = {}, o = function i(o, r) { if (void 0 === n[o.id]) { var s; t.hierarchical.setTreeIndex(o, r), n[o.id] = !0; for (var a = t._getActiveEdges(o), h = 0; h < a.length; h++) { var l = a[h]; !0 === l.connected && (s = l.toId == o.id ? l.from : l.to, o.id != s.id && (e(o, s, l), i(s, r))) } } }; if (void 0 === i) for (var r = 0, s = 0; s < this.body.nodeIndices.length; s++) { var a = this.body.nodeIndices[s]; if (void 0 === n[a]) { var h = this.body.nodes[a]; o(h, r), r += 1 } } else { var l = this.body.nodes[i]; if (void 0 === l) return void console.error("Node not found:", i); o(l) } } }, { key: "_shiftBlock", value: function (t, e) { var i = this, n = {}; !function t(o) { if (!n[o]) { n[o] = !0, i.direction.shift(o, e); var r = i.hierarchical.childrenReference[o]; if (void 0 !== r) for (var s = 0; s < r.length; s++)t(r[s]) } }(t) } }, { key: "_findCommonParent", value: function (t, e) { var i = this, n = {}; return function t(e, n) { var o = i.hierarchical.parentReference[n]; if (void 0 !== o) for (var r = 0; r < o.length; r++) { var s = o[r]; e[s] = !0, t(e, s) } }(n, t), function t(e, n) { var o = i.hierarchical.parentReference[n]; if (void 0 !== o) for (var r = 0; r < o.length; r++) { var s = o[r]; if (void 0 !== e[s]) return { foundParent: s, withChild: n }; var a = t(e, s); if (null !== a.foundParent) return a } return { foundParent: null, withChild: n } }(n, e) } }, { key: "setDirectionStrategy", value: function () { var t = "UD" === this.options.hierarchical.direction || "DU" === this.options.hierarchical.direction; this.direction = t ? new Qp(this) : new Jp(this) } }, { key: "_getCenterPosition", value: function (t) { for (var e = 1e9, i = -1e9, n = 0; n < t.length; n++) { var o = void 0; if (void 0 !== t[n].id) o = t[n]; else { var r = t[n]; o = this.body.nodes[r] } var s = this.direction.getPosition(o); e = Math.min(e, s), i = Math.max(i, s) } return .5 * (e + i) } }]), t }(), uv = function () { function t(e, i, n, o) { var r, s, a = this; El(this, t), this.body = e, this.canvas = i, this.selectionHandler = n, this.interactionHandler = o, this.editMode = !1, this.manipulationDiv = void 0, this.editModeDiv = void 0, this.closeDiv = void 0, this.manipulationHammers = [], this.temporaryUIFunctions = {}, this.temporaryEventFunctions = [], this.touchTime = 0, this.temporaryIds = { nodes: [], edges: [] }, this.guiEnabled = !1, this.inMode = !1, this.selectedControlNode = void 0, this.options = {}, this.defaultOptions = { enabled: !1, initiallyActive: !1, addNode: !0, addEdge: !0, editNode: void 0, editEdge: !0, deleteNode: !0, deleteEdge: !0, controlNodeStyle: { shape: "dot", size: 6, color: { background: "#ff0000", border: "#3c3c3c", highlight: { background: "#07f968", border: "#3c3c3c" } }, borderWidth: 2, borderWidthSelected: 2 } }, mt(this.options, this.defaultOptions), this.body.emitter.on("destroy", (function () { a._clean() })), this.body.emitter.on("_dataChanged", Z(r = this._restore).call(r, this)), this.body.emitter.on("_resetData", Z(s = this._restore).call(s, this)) } return Sl(t, [{ key: "_restore", value: function () { !1 !== this.inMode && (!0 === this.options.initiallyActive ? this.enableEditMode() : this.disableEditMode()) } }, { key: "setOptions", value: function (t, e, i) { void 0 !== e && (void 0 !== e.locale ? this.options.locale = e.locale : this.options.locale = i.locale, void 0 !== e.locales ? this.options.locales = e.locales : this.options.locales = i.locales), void 0 !== t && ("boolean" == typeof t ? this.options.enabled = t : (this.options.enabled = !0, Jr(this.options, t)), !0 === this.options.initiallyActive && (this.editMode = !0), this._setup()) } }, { key: "toggleEditMode", value: function () { !0 === this.editMode ? this.disableEditMode() : this.enableEditMode() } }, { key: "enableEditMode", value: function () { this.editMode = !0, this._clean(), !0 === this.guiEnabled && (this.manipulationDiv.style.display = "block", this.closeDiv.style.display = "block", this.editModeDiv.style.display = "none", this.showManipulatorToolbar()) } }, { key: "disableEditMode", value: function () { this.editMode = !1, this._clean(), !0 === this.guiEnabled && (this.manipulationDiv.style.display = "none", this.closeDiv.style.display = "none", this.editModeDiv.style.display = "block", this._createEditButton()) } }, { key: "showManipulatorToolbar", value: function () { if (this._clean(), this.manipulationDOM = {}, !0 === this.guiEnabled) { var t, e; this.editMode = !0, this.manipulationDiv.style.display = "block", this.closeDiv.style.display = "block"; var i = this.selectionHandler.getSelectedNodeCount(), n = this.selectionHandler.getSelectedEdgeCount(), o = i + n, r = this.options.locales[this.options.locale], s = !1; !1 !== this.options.addNode && (this._createAddNodeButton(r), s = !0), !1 !== this.options.addEdge && (!0 === s ? this._createSeperator(1) : s = !0, this._createAddEdgeButton(r)), 1 === i && "function" == typeof this.options.editNode ? (!0 === s ? this._createSeperator(2) : s = !0, this._createEditNodeButton(r)) : 1 === n && 0 === i && !1 !== this.options.editEdge && (!0 === s ? this._createSeperator(3) : s = !0, this._createEditEdgeButton(r)), 0 !== o && (i > 0 && !1 !== this.options.deleteNode || 0 === i && !1 !== this.options.deleteEdge) && (!0 === s && this._createSeperator(4), this._createDeleteButton(r)), this._bindHammerToDiv(this.closeDiv, Z(t = this.toggleEditMode).call(t, this)), this._temporaryBindEvent("select", Z(e = this.showManipulatorToolbar).call(e, this)) } this.body.emitter.emit("_redraw") } }, { key: "addNodeMode", value: function () { var t; if (!0 !== this.editMode && this.enableEditMode(), this._clean(), this.inMode = "addNode", !0 === this.guiEnabled) { var e, i = this.options.locales[this.options.locale]; this.manipulationDOM = {}, this._createBackButton(i), this._createSeperator(), this._createDescription(i.addDescription || this.options.locales.en.addDescription), this._bindHammerToDiv(this.closeDiv, Z(e = this.toggleEditMode).call(e, this)) } this._temporaryBindEvent("click", Z(t = this._performAddNode).call(t, this)) } }, { key: "editNode", value: function () { var t = this; !0 !== this.editMode && this.enableEditMode(), this._clean(); var e = this.selectionHandler.getSelectedNodes()[0]; if (void 0 !== e) { if (this.inMode = "editNode", "function" != typeof this.options.editNode) throw new Error("No function has been configured to handle the editing of nodes."); if (!0 !== e.isCluster) { var i = Jr({}, e.options, !1); if (i.x = e.x, i.y = e.y, 2 !== this.options.editNode.length) throw new Error("The function for edit does not support two arguments (data, callback)"); this.options.editNode(i, (function (e) { null != e && "editNode" === t.inMode && t.body.data.nodes.getDataSet().update(e), t.showManipulatorToolbar() })) } else alert(this.options.locales[this.options.locale].editClusterError || this.options.locales.en.editClusterError) } else this.showManipulatorToolbar() } }, { key: "addEdgeMode", value: function () { var t, e, i, n, o; if (!0 !== this.editMode && this.enableEditMode(), this._clean(), this.inMode = "addEdge", !0 === this.guiEnabled) { var r, s = this.options.locales[this.options.locale]; this.manipulationDOM = {}, this._createBackButton(s), this._createSeperator(), this._createDescription(s.edgeDescription || this.options.locales.en.edgeDescription), this._bindHammerToDiv(this.closeDiv, Z(r = this.toggleEditMode).call(r, this)) } this._temporaryBindUI("onTouch", Z(t = this._handleConnect).call(t, this)), this._temporaryBindUI("onDragEnd", Z(e = this._finishConnect).call(e, this)), this._temporaryBindUI("onDrag", Z(i = this._dragControlNode).call(i, this)), this._temporaryBindUI("onRelease", Z(n = this._finishConnect).call(n, this)), this._temporaryBindUI("onDragStart", Z(o = this._dragStartEdge).call(o, this)), this._temporaryBindUI("onHold", (function () { })) } }, { key: "editEdgeMode", value: function () { if (!0 !== this.editMode && this.enableEditMode(), this._clean(), this.inMode = "editEdge", "object" !== vr(this.options.editEdge) || "function" != typeof this.options.editEdge.editWithoutDrag || (this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0], void 0 === this.edgeBeingEditedId)) { if (!0 === this.guiEnabled) { var t, e = this.options.locales[this.options.locale]; this.manipulationDOM = {}, this._createBackButton(e), this._createSeperator(), this._createDescription(e.editEdgeDescription || this.options.locales.en.editEdgeDescription), this._bindHammerToDiv(this.closeDiv, Z(t = this.toggleEditMode).call(t, this)) } if (this.edgeBeingEditedId = this.selectionHandler.getSelectedEdgeIds()[0], void 0 !== this.edgeBeingEditedId) { var i, n, o, r, s = this.body.edges[this.edgeBeingEditedId], a = this._getNewTargetNode(s.from.x, s.from.y), h = this._getNewTargetNode(s.to.x, s.to.y); this.temporaryIds.nodes.push(a.id), this.temporaryIds.nodes.push(h.id), this.body.nodes[a.id] = a, this.body.nodeIndices.push(a.id), this.body.nodes[h.id] = h, this.body.nodeIndices.push(h.id), this._temporaryBindUI("onTouch", Z(i = this._controlNodeTouch).call(i, this)), this._temporaryBindUI("onTap", (function () { })), this._temporaryBindUI("onHold", (function () { })), this._temporaryBindUI("onDragStart", Z(n = this._controlNodeDragStart).call(n, this)), this._temporaryBindUI("onDrag", Z(o = this._controlNodeDrag).call(o, this)), this._temporaryBindUI("onDragEnd", Z(r = this._controlNodeDragEnd).call(r, this)), this._temporaryBindUI("onMouseMove", (function () { })), this._temporaryBindEvent("beforeDrawing", (function (t) { var e = s.edgeType.findBorderPositions(t); !1 === a.selected && (a.x = e.from.x, a.y = e.from.y), !1 === h.selected && (h.x = e.to.x, h.y = e.to.y) })), this.body.emitter.emit("_redraw") } else this.showManipulatorToolbar() } else { var l = this.body.edges[this.edgeBeingEditedId]; this._performEditEdge(l.from.id, l.to.id) } } }, { key: "deleteSelected", value: function () { var t = this; !0 !== this.editMode && this.enableEditMode(), this._clean(), this.inMode = "delete"; var e = this.selectionHandler.getSelectedNodeIds(), i = this.selectionHandler.getSelectedEdgeIds(), n = void 0; if (e.length > 0) { for (var o = 0; o < e.length; o++)if (!0 === this.body.nodes[e[o]].isCluster) return void alert(this.options.locales[this.options.locale].deleteClusterError || this.options.locales.en.deleteClusterError); "function" == typeof this.options.deleteNode && (n = this.options.deleteNode) } else i.length > 0 && "function" == typeof this.options.deleteEdge && (n = this.options.deleteEdge); if ("function" == typeof n) { var r = { nodes: e, edges: i }; if (2 !== n.length) throw new Error("The function for delete does not support two arguments (data, callback)"); n(r, (function (e) { null != e && "delete" === t.inMode ? (t.body.data.edges.getDataSet().remove(e.edges), t.body.data.nodes.getDataSet().remove(e.nodes), t.body.emitter.emit("startSimulation"), t.showManipulatorToolbar()) : (t.body.emitter.emit("startSimulation"), t.showManipulatorToolbar()) })) } else this.body.data.edges.getDataSet().remove(i), this.body.data.nodes.getDataSet().remove(e), this.body.emitter.emit("startSimulation"), this.showManipulatorToolbar() } }, { key: "_setup", value: function () { !0 === this.options.enabled ? (this.guiEnabled = !0, this._createWrappers(), !1 === this.editMode ? this._createEditButton() : this.showManipulatorToolbar()) : (this._removeManipulationDOM(), this.guiEnabled = !1) } }, { key: "_createWrappers", value: function () { void 0 === this.manipulationDiv && (this.manipulationDiv = document.createElement("div"), this.manipulationDiv.className = "vis-manipulation", !0 === this.editMode ? this.manipulationDiv.style.display = "block" : this.manipulationDiv.style.display = "none", this.canvas.frame.appendChild(this.manipulationDiv)), void 0 === this.editModeDiv && (this.editModeDiv = document.createElement("div"), this.editModeDiv.className = "vis-edit-mode", !0 === this.editMode ? this.editModeDiv.style.display = "none" : this.editModeDiv.style.display = "block", this.canvas.frame.appendChild(this.editModeDiv)), void 0 === this.closeDiv && (this.closeDiv = document.createElement("div"), this.closeDiv.className = "vis-close", this.closeDiv.style.display = this.manipulationDiv.style.display, this.canvas.frame.appendChild(this.closeDiv)) } }, { key: "_getNewTargetNode", value: function (t, e) { var i = Jr({}, this.options.controlNodeStyle); i.id = "targetNode" + mc(), i.hidden = !1, i.physics = !1, i.x = t, i.y = e; var n = this.body.functions.createNode(i); return n.shape.boundingBox = { left: t, right: t, top: e, bottom: e }, n } }, { key: "_createEditButton", value: function () { var t; this._clean(), this.manipulationDOM = {}, Ur(this.editModeDiv); var e = this.options.locales[this.options.locale], i = this._createButton("editMode", "vis-button vis-edit vis-edit-mode", e.edit || this.options.locales.en.edit); this.editModeDiv.appendChild(i), this._bindHammerToDiv(i, Z(t = this.toggleEditMode).call(t, this)) } }, { key: "_clean", value: function () { this.inMode = !1, !0 === this.guiEnabled && (Ur(this.editModeDiv), Ur(this.manipulationDiv), this._cleanManipulatorHammers()), this._cleanupTemporaryNodesAndEdges(), this._unbindTemporaryUIs(), this._unbindTemporaryEvents(), this.body.emitter.emit("restorePhysics") } }, { key: "_cleanManipulatorHammers", value: function () { if (0 != this.manipulationHammers.length) { for (var t = 0; t < this.manipulationHammers.length; t++)this.manipulationHammers[t].destroy(); this.manipulationHammers = [] } } }, { key: "_removeManipulationDOM", value: function () { this._clean(), Ur(this.manipulationDiv), Ur(this.editModeDiv), Ur(this.closeDiv), this.manipulationDiv && this.canvas.frame.removeChild(this.manipulationDiv), this.editModeDiv && this.canvas.frame.removeChild(this.editModeDiv), this.closeDiv && this.canvas.frame.removeChild(this.closeDiv), this.manipulationDiv = void 0, this.editModeDiv = void 0, this.closeDiv = void 0 } }, { key: "_createSeperator", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1; this.manipulationDOM["seperatorLineDiv" + t] = document.createElement("div"), this.manipulationDOM["seperatorLineDiv" + t].className = "vis-separator-line", this.manipulationDiv.appendChild(this.manipulationDOM["seperatorLineDiv" + t]) } }, { key: "_createAddNodeButton", value: function (t) { var e, i = this._createButton("addNode", "vis-button vis-add", t.addNode || this.options.locales.en.addNode); this.manipulationDiv.appendChild(i), this._bindHammerToDiv(i, Z(e = this.addNodeMode).call(e, this)) } }, { key: "_createAddEdgeButton", value: function (t) { var e, i = this._createButton("addEdge", "vis-button vis-connect", t.addEdge || this.options.locales.en.addEdge); this.manipulationDiv.appendChild(i), this._bindHammerToDiv(i, Z(e = this.addEdgeMode).call(e, this)) } }, { key: "_createEditNodeButton", value: function (t) { var e, i = this._createButton("editNode", "vis-button vis-edit", t.editNode || this.options.locales.en.editNode); this.manipulationDiv.appendChild(i), this._bindHammerToDiv(i, Z(e = this.editNode).call(e, this)) } }, { key: "_createEditEdgeButton", value: function (t) { var e, i = this._createButton("editEdge", "vis-button vis-edit", t.editEdge || this.options.locales.en.editEdge); this.manipulationDiv.appendChild(i), this._bindHammerToDiv(i, Z(e = this.editEdgeMode).call(e, this)) } }, { key: "_createDeleteButton", value: function (t) { var e, i; i = this.options.rtl ? "vis-button vis-delete-rtl" : "vis-button vis-delete"; var n = this._createButton("delete", i, t.del || this.options.locales.en.del); this.manipulationDiv.appendChild(n), this._bindHammerToDiv(n, Z(e = this.deleteSelected).call(e, this)) } }, { key: "_createBackButton", value: function (t) { var e, i = this._createButton("back", "vis-button vis-back", t.back || this.options.locales.en.back); this.manipulationDiv.appendChild(i), this._bindHammerToDiv(i, Z(e = this.showManipulatorToolbar).call(e, this)) } }, { key: "_createButton", value: function (t, e, i) { var n = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "vis-label"; return this.manipulationDOM[t + "Div"] = document.createElement("div"), this.manipulationDOM[t + "Div"].className = e, this.manipulationDOM[t + "Label"] = document.createElement("div"), this.manipulationDOM[t + "Label"].className = n, this.manipulationDOM[t + "Label"].innerHTML = i, this.manipulationDOM[t + "Div"].appendChild(this.manipulationDOM[t + "Label"]), this.manipulationDOM[t + "Div"] } }, { key: "_createDescription", value: function (t) { this.manipulationDiv.appendChild(this._createButton("description", "vis-button vis-none", t)) } }, { key: "_temporaryBindEvent", value: function (t, e) { this.temporaryEventFunctions.push({ event: t, boundFunction: e }), this.body.emitter.on(t, e) } }, { key: "_temporaryBindUI", value: function (t, e) { if (void 0 === this.body.eventListeners[t]) throw new Error("This UI function does not exist. Typo? You tried: " + t + " possible are: " + Ed(rr(this.body.eventListeners))); this.temporaryUIFunctions[t] = this.body.eventListeners[t], this.body.eventListeners[t] = e } }, { key: "_unbindTemporaryUIs", value: function () { for (var t in this.temporaryUIFunctions) Object.prototype.hasOwnProperty.call(this.temporaryUIFunctions, t) && (this.body.eventListeners[t] = this.temporaryUIFunctions[t], delete this.temporaryUIFunctions[t]); this.temporaryUIFunctions = {} } }, { key: "_unbindTemporaryEvents", value: function () { for (var t = 0; t < this.temporaryEventFunctions.length; t++) { var e = this.temporaryEventFunctions[t].event, i = this.temporaryEventFunctions[t].boundFunction; this.body.emitter.off(e, i) } this.temporaryEventFunctions = [] } }, { key: "_bindHammerToDiv", value: function (t, e) { var i = new wl(t, {}); dp(i, e), this.manipulationHammers.push(i) } }, { key: "_cleanupTemporaryNodesAndEdges", value: function () { for (var t = 0; t < this.temporaryIds.edges.length; t++) { var e; this.body.edges[this.temporaryIds.edges[t]].disconnect(), delete this.body.edges[this.temporaryIds.edges[t]]; var i, n = To(e = this.body.edgeIndices).call(e, this.temporaryIds.edges[t]); if (-1 !== n) Fs(i = this.body.edgeIndices).call(i, n, 1) } for (var o = 0; o < this.temporaryIds.nodes.length; o++) { var r; delete this.body.nodes[this.temporaryIds.nodes[o]]; var s, a = To(r = this.body.nodeIndices).call(r, this.temporaryIds.nodes[o]); if (-1 !== a) Fs(s = this.body.nodeIndices).call(s, a, 1) } this.temporaryIds = { nodes: [], edges: [] } } }, { key: "_controlNodeTouch", value: function (t) { this.selectionHandler.unselectAll(), this.lastTouch = this.body.functions.getPointer(t.center), this.lastTouch.translation = mt({}, this.body.view.translation) } }, { key: "_controlNodeDragStart", value: function () { var t = this.lastTouch, e = this.selectionHandler._pointerToPositionObject(t), i = this.body.nodes[this.temporaryIds.nodes[0]], n = this.body.nodes[this.temporaryIds.nodes[1]], o = this.body.edges[this.edgeBeingEditedId]; this.selectedControlNode = void 0; var r = i.isOverlappingWith(e), s = n.isOverlappingWith(e); !0 === r ? (this.selectedControlNode = i, o.edgeType.from = i) : !0 === s && (this.selectedControlNode = n, o.edgeType.to = n), void 0 !== this.selectedControlNode && this.selectionHandler.selectObject(this.selectedControlNode), this.body.emitter.emit("_redraw") } }, { key: "_controlNodeDrag", value: function (t) { this.body.emitter.emit("disablePhysics"); var e = this.body.functions.getPointer(t.center), i = this.canvas.DOMtoCanvas(e); void 0 !== this.selectedControlNode ? (this.selectedControlNode.x = i.x, this.selectedControlNode.y = i.y) : this.interactionHandler.onDrag(t), this.body.emitter.emit("_redraw") } }, { key: "_controlNodeDragEnd", value: function (t) { var e = this.body.functions.getPointer(t.center), i = this.selectionHandler._pointerToPositionObject(e), n = this.body.edges[this.edgeBeingEditedId]; if (void 0 !== this.selectedControlNode) { this.selectionHandler.unselectAll(); for (var o = this.selectionHandler._getAllNodesOverlappingWith(i), r = void 0, s = o.length - 1; s >= 0; s--)if (o[s] !== this.selectedControlNode.id) { r = this.body.nodes[o[s]]; break } if (void 0 !== r && void 0 !== this.selectedControlNode) if (!0 === r.isCluster) alert(this.options.locales[this.options.locale].createEdgeError || this.options.locales.en.createEdgeError); else { var a = this.body.nodes[this.temporaryIds.nodes[0]]; this.selectedControlNode.id === a.id ? this._performEditEdge(r.id, n.to.id) : this._performEditEdge(n.from.id, r.id) } else n.updateEdgeType(), this.body.emitter.emit("restorePhysics"); this.body.emitter.emit("_redraw") } } }, { key: "_handleConnect", value: function (t) { if ((new Date).valueOf() - this.touchTime > 100) { this.lastTouch = this.body.functions.getPointer(t.center), this.lastTouch.translation = mt({}, this.body.view.translation), this.interactionHandler.drag.pointer = this.lastTouch, this.interactionHandler.drag.translation = this.lastTouch.translation; var e = this.lastTouch, i = this.selectionHandler.getNodeAt(e); if (void 0 !== i) if (!0 === i.isCluster) alert(this.options.locales[this.options.locale].createEdgeError || this.options.locales.en.createEdgeError); else { var n = this._getNewTargetNode(i.x, i.y); this.body.nodes[n.id] = n, this.body.nodeIndices.push(n.id); var o = this.body.functions.createEdge({ id: "connectionEdge" + mc(), from: i.id, to: n.id, physics: !1, smooth: { enabled: !0, type: "continuous", roundness: .5 } }); this.body.edges[o.id] = o, this.body.edgeIndices.push(o.id), this.temporaryIds.nodes.push(n.id), this.temporaryIds.edges.push(o.id) } this.touchTime = (new Date).valueOf() } } }, { key: "_dragControlNode", value: function (t) { var e = this.body.functions.getPointer(t.center), i = this.selectionHandler._pointerToPositionObject(e), n = void 0; void 0 !== this.temporaryIds.edges[0] && (n = this.body.edges[this.temporaryIds.edges[0]].fromId); for (var o = this.selectionHandler._getAllNodesOverlappingWith(i), r = void 0, s = o.length - 1; s >= 0; s--) { var a; if (-1 === To(a = this.temporaryIds.nodes).call(a, o[s])) { r = this.body.nodes[o[s]]; break } } if (t.controlEdge = { from: n, to: r ? r.id : void 0 }, this.selectionHandler.generateClickEvent("controlNodeDragging", t, e), void 0 !== this.temporaryIds.nodes[0]) { var h = this.body.nodes[this.temporaryIds.nodes[0]]; h.x = this.canvas._XconvertDOMtoCanvas(e.x), h.y = this.canvas._YconvertDOMtoCanvas(e.y), this.body.emitter.emit("_redraw") } else this.interactionHandler.onDrag(t) } }, { key: "_finishConnect", value: function (t) { var e = this.body.functions.getPointer(t.center), i = this.selectionHandler._pointerToPositionObject(e), n = void 0; void 0 !== this.temporaryIds.edges[0] && (n = this.body.edges[this.temporaryIds.edges[0]].fromId); for (var o = this.selectionHandler._getAllNodesOverlappingWith(i), r = void 0, s = o.length - 1; s >= 0; s--) { var a; if (-1 === To(a = this.temporaryIds.nodes).call(a, o[s])) { r = this.body.nodes[o[s]]; break } } this._cleanupTemporaryNodesAndEdges(), void 0 !== r && (!0 === r.isCluster ? alert(this.options.locales[this.options.locale].createEdgeError || this.options.locales.en.createEdgeError) : void 0 !== this.body.nodes[n] && void 0 !== this.body.nodes[r.id] && this._performAddEdge(n, r.id)), t.controlEdge = { from: n, to: r ? r.id : void 0 }, this.selectionHandler.generateClickEvent("controlNodeDragEnd", t, e), this.body.emitter.emit("_redraw") } }, { key: "_dragStartEdge", value: function (t) { var e = this.lastTouch; this.selectionHandler.generateClickEvent("dragStart", t, e, void 0, !0) } }, { key: "_performAddNode", value: function (t) { var e = this, i = { id: mc(), x: t.pointer.canvas.x, y: t.pointer.canvas.y, label: "new" }; if ("function" == typeof this.options.addNode) { if (2 !== this.options.addNode.length) throw this.showManipulatorToolbar(), new Error("The function for add does not support two arguments (data,callback)"); this.options.addNode(i, (function (t) { null != t && "addNode" === e.inMode && e.body.data.nodes.getDataSet().add(t), e.showManipulatorToolbar() })) } else this.body.data.nodes.getDataSet().add(i), this.showManipulatorToolbar() } }, { key: "_performAddEdge", value: function (t, e) { var i = this, n = { from: t, to: e }; if ("function" == typeof this.options.addEdge) { if (2 !== this.options.addEdge.length) throw new Error("The function for connect does not support two arguments (data,callback)"); this.options.addEdge(n, (function (t) { null != t && "addEdge" === i.inMode && (i.body.data.edges.getDataSet().add(t), i.selectionHandler.unselectAll(), i.showManipulatorToolbar()) })) } else this.body.data.edges.getDataSet().add(n), this.selectionHandler.unselectAll(), this.showManipulatorToolbar() } }, { key: "_performEditEdge", value: function (t, e) { var i = this, n = { id: this.edgeBeingEditedId, from: t, to: e, label: this.body.data.edges.get(this.edgeBeingEditedId).label }, o = this.options.editEdge; if ("object" === vr(o) && (o = o.editWithoutDrag), "function" == typeof o) { if (2 !== o.length) throw new Error("The function for edit does not support two arguments (data, callback)"); o(n, (function (t) { null == t || "editEdge" !== i.inMode ? (i.body.edges[n.id].updateEdgeType(), i.body.emitter.emit("_redraw"), i.showManipulatorToolbar()) : (i.body.data.edges.getDataSet().update(t), i.selectionHandler.unselectAll(), i.showManipulatorToolbar()) })) } else this.body.data.edges.getDataSet().update(n), this.selectionHandler.unselectAll(), this.showManipulatorToolbar() } }]), t }(), fv = { black: "#000000", navy: "#000080", darkblue: "#00008B", mediumblue: "#0000CD", blue: "#0000FF", darkgreen: "#006400", green: "#008000", teal: "#008080", darkcyan: "#008B8B", deepskyblue: "#00BFFF", darkturquoise: "#00CED1", mediumspringgreen: "#00FA9A", lime: "#00FF00", springgreen: "#00FF7F", aqua: "#00FFFF", cyan: "#00FFFF", midnightblue: "#191970", dodgerblue: "#1E90FF", lightseagreen: "#20B2AA", forestgreen: "#228B22", seagreen: "#2E8B57", darkslategray: "#2F4F4F", limegreen: "#32CD32", mediumseagreen: "#3CB371", turquoise: "#40E0D0", royalblue: "#4169E1", steelblue: "#4682B4", darkslateblue: "#483D8B", mediumturquoise: "#48D1CC", indigo: "#4B0082", darkolivegreen: "#556B2F", cadetblue: "#5F9EA0", cornflowerblue: "#6495ED", mediumaquamarine: "#66CDAA", dimgray: "#696969", slateblue: "#6A5ACD", olivedrab: "#6B8E23", slategray: "#708090", lightslategray: "#778899", mediumslateblue: "#7B68EE", lawngreen: "#7CFC00", chartreuse: "#7FFF00", aquamarine: "#7FFFD4", maroon: "#800000", purple: "#800080", olive: "#808000", gray: "#808080", skyblue: "#87CEEB", lightskyblue: "#87CEFA", blueviolet: "#8A2BE2", darkred: "#8B0000", darkmagenta: "#8B008B", saddlebrown: "#8B4513", darkseagreen: "#8FBC8F", lightgreen: "#90EE90", mediumpurple: "#9370D8", darkviolet: "#9400D3", palegreen: "#98FB98", darkorchid: "#9932CC", yellowgreen: "#9ACD32", sienna: "#A0522D", brown: "#A52A2A", darkgray: "#A9A9A9", lightblue: "#ADD8E6", greenyellow: "#ADFF2F", paleturquoise: "#AFEEEE", lightsteelblue: "#B0C4DE", powderblue: "#B0E0E6", firebrick: "#B22222", darkgoldenrod: "#B8860B", mediumorchid: "#BA55D3", rosybrown: "#BC8F8F", darkkhaki: "#BDB76B", silver: "#C0C0C0", mediumvioletred: "#C71585", indianred: "#CD5C5C", peru: "#CD853F", chocolate: "#D2691E", tan: "#D2B48C", lightgrey: "#D3D3D3", palevioletred: "#D87093", thistle: "#D8BFD8", orchid: "#DA70D6", goldenrod: "#DAA520", crimson: "#DC143C", gainsboro: "#DCDCDC", plum: "#DDA0DD", burlywood: "#DEB887", lightcyan: "#E0FFFF", lavender: "#E6E6FA", darksalmon: "#E9967A", violet: "#EE82EE", palegoldenrod: "#EEE8AA", lightcoral: "#F08080", khaki: "#F0E68C", aliceblue: "#F0F8FF", honeydew: "#F0FFF0", azure: "#F0FFFF", sandybrown: "#F4A460", wheat: "#F5DEB3", beige: "#F5F5DC", whitesmoke: "#F5F5F5", mintcream: "#F5FFFA", ghostwhite: "#F8F8FF", salmon: "#FA8072", antiquewhite: "#FAEBD7", linen: "#FAF0E6", lightgoldenrodyellow: "#FAFAD2", oldlace: "#FDF5E6", red: "#FF0000", fuchsia: "#FF00FF", magenta: "#FF00FF", deeppink: "#FF1493", orangered: "#FF4500", tomato: "#FF6347", hotpink: "#FF69B4", coral: "#FF7F50", darkorange: "#FF8C00", lightsalmon: "#FFA07A", orange: "#FFA500", lightpink: "#FFB6C1", pink: "#FFC0CB", gold: "#FFD700", peachpuff: "#FFDAB9", navajowhite: "#FFDEAD", moccasin: "#FFE4B5", bisque: "#FFE4C4", mistyrose: "#FFE4E1", blanchedalmond: "#FFEBCD", papayawhip: "#FFEFD5", lavenderblush: "#FFF0F5", seashell: "#FFF5EE", cornsilk: "#FFF8DC", lemonchiffon: "#FFFACD", floralwhite: "#FFFAF0", snow: "#FFFAFA", yellow: "#FFFF00", lightyellow: "#FFFFE0", ivory: "#FFFFF0", white: "#FFFFFF" }, pv = function () { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1; El(this, t), this.pixelRatio = e, this.generated = !1, this.centerCoordinates = { x: 144.5, y: 144.5 }, this.r = 289 * .49, this.color = { r: 255, g: 255, b: 255, a: 1 }, this.hueCircle = void 0, this.initialColor = { r: 255, g: 255, b: 255, a: 1 }, this.previousColor = void 0, this.applied = !1, this.updateCallback = function () { }, this.closeCallback = function () { }, this._create() } return Sl(t, [{ key: "insertTo", value: function (t) { void 0 !== this.hammer && (this.hammer.destroy(), this.hammer = void 0), this.container = t, this.container.appendChild(this.frame), this._bindHammer(), this._setSize() } }, { key: "setUpdateCallback", value: function (t) { if ("function" != typeof t) throw new Error("Function attempted to set as colorPicker update callback is not a function."); this.updateCallback = t } }, { key: "setCloseCallback", value: function (t) { if ("function" != typeof t) throw new Error("Function attempted to set as colorPicker closing callback is not a function."); this.closeCallback = t } }, { key: "_isColorString", value: function (t) { if ("string" == typeof t) return fv[t] } }, { key: "setColor", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; if ("none" !== t) { var i, n = this._isColorString(t); if (void 0 !== n && (t = n), !0 === Yr(t)) { if (!0 === _s(t)) { var o = t.substr(4).substr(0, t.length - 5).split(","); i = { r: o[0], g: o[1], b: o[2], a: 1 } } else if (!0 === xs(t)) { var r = t.substr(5).substr(0, t.length - 6).split(","); i = { r: r[0], g: r[1], b: r[2], a: r[3] } } else if (!0 === ks(t)) { var s = cs(t); i = { r: s.r, g: s.g, b: s.b, a: 1 } } } else if (t instanceof Object && void 0 !== t.r && void 0 !== t.g && void 0 !== t.b) { var a = void 0 !== t.a ? t.a : "1.0"; i = { r: t.r, g: t.g, b: t.b, a: a } } if (void 0 === i) throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: " + Ed(t)); this._setColor(i, e) } } }, { key: "show", value: function () { void 0 !== this.closeCallback && (this.closeCallback(), this.closeCallback = void 0), this.applied = !1, this.frame.style.display = "block", this._generateHueCircle() } }, { key: "_hide", value: function () { var t = this, e = !(arguments.length > 0 && void 0 !== arguments[0]) || arguments[0]; !0 === e && (this.previousColor = mt({}, this.color)), !0 === this.applied && this.updateCallback(this.initialColor), this.frame.style.display = "none", Zl((function () { void 0 !== t.closeCallback && (t.closeCallback(), t.closeCallback = void 0) }), 0) } }, { key: "_save", value: function () { this.updateCallback(this.color), this.applied = !1, this._hide() } }, { key: "_apply", value: function () { this.applied = !0, this.updateCallback(this.color), this._updatePicker(this.color) } }, { key: "_loadLast", value: function () { void 0 !== this.previousColor ? this.setColor(this.previousColor, !1) : alert("There is no last color to load...") } }, { key: "_setColor", value: function (t) { var e = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; !0 === e && (this.initialColor = mt({}, t)), this.color = t; var i = vs(t.r, t.g, t.b), n = 2 * Math.PI, o = this.r * i.s, r = this.centerCoordinates.x + o * Math.sin(n * i.h), s = this.centerCoordinates.y + o * Math.cos(n * i.h); this.colorPickerSelector.style.left = r - .5 * this.colorPickerSelector.clientWidth + "px", this.colorPickerSelector.style.top = s - .5 * this.colorPickerSelector.clientHeight + "px", this._updatePicker(t) } }, { key: "_setOpacity", value: function (t) { this.color.a = t / 100, this._updatePicker(this.color) } }, { key: "_setBrightness", value: function (t) { var e = vs(this.color.r, this.color.g, this.color.b); e.v = t / 100; var i = ms(e.h, e.s, e.v); i.a = this.color.a, this.color = i, this._updatePicker() } }, { key: "_updatePicker", value: function () { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : this.color, e = vs(t.r, t.g, t.b), i = this.colorPickerCanvas.getContext("2d"); void 0 === this.pixelRation && (this.pixelRatio = (window.devicePixelRatio || 1) / (i.webkitBackingStorePixelRatio || i.mozBackingStorePixelRatio || i.msBackingStorePixelRatio || i.oBackingStorePixelRatio || i.backingStorePixelRatio || 1)), i.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0); var n = this.colorPickerCanvas.clientWidth, o = this.colorPickerCanvas.clientHeight; i.clearRect(0, 0, n, o), i.putImageData(this.hueCircle, 0, 0), i.fillStyle = "rgba(0,0,0," + (1 - e.v) + ")", i.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r), eu(i).call(i), this.brightnessRange.value = 100 * e.v, this.opacityRange.value = 100 * t.a, this.initialColorDiv.style.backgroundColor = "rgba(" + this.initialColor.r + "," + this.initialColor.g + "," + this.initialColor.b + "," + this.initialColor.a + ")", this.newColorDiv.style.backgroundColor = "rgba(" + this.color.r + "," + this.color.g + "," + this.color.b + "," + this.color.a + ")" } }, { key: "_setSize", value: function () { this.colorPickerCanvas.style.width = "100%", this.colorPickerCanvas.style.height = "100%", this.colorPickerCanvas.width = 289 * this.pixelRatio, this.colorPickerCanvas.height = 289 * this.pixelRatio } }, { key: "_create", value: function () { var t, e, i, n; if (this.frame = document.createElement("div"), this.frame.className = "vis-color-picker", this.colorPickerDiv = document.createElement("div"), this.colorPickerSelector = document.createElement("div"), this.colorPickerSelector.className = "vis-selector", this.colorPickerDiv.appendChild(this.colorPickerSelector), this.colorPickerCanvas = document.createElement("canvas"), this.colorPickerDiv.appendChild(this.colorPickerCanvas), this.colorPickerCanvas.getContext) { var o = this.colorPickerCanvas.getContext("2d"); this.pixelRatio = (window.devicePixelRatio || 1) / (o.webkitBackingStorePixelRatio || o.mozBackingStorePixelRatio || o.msBackingStorePixelRatio || o.oBackingStorePixelRatio || o.backingStorePixelRatio || 1), this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0) } else { var r = document.createElement("DIV"); r.style.color = "red", r.style.fontWeight = "bold", r.style.padding = "10px", r.innerHTML = "Error: your browser does not support HTML canvas", this.colorPickerCanvas.appendChild(r) } this.colorPickerDiv.className = "vis-color", this.opacityDiv = document.createElement("div"), this.opacityDiv.className = "vis-opacity", this.brightnessDiv = document.createElement("div"), this.brightnessDiv.className = "vis-brightness", this.arrowDiv = document.createElement("div"), this.arrowDiv.className = "vis-arrow", this.opacityRange = document.createElement("input"); try { this.opacityRange.type = "range", this.opacityRange.min = "0", this.opacityRange.max = "100" } catch (t) { } this.opacityRange.value = "100", this.opacityRange.className = "vis-range", this.brightnessRange = document.createElement("input"); try { this.brightnessRange.type = "range", this.brightnessRange.min = "0", this.brightnessRange.max = "100" } catch (t) { } this.brightnessRange.value = "100", this.brightnessRange.className = "vis-range", this.opacityDiv.appendChild(this.opacityRange), this.brightnessDiv.appendChild(this.brightnessRange); var s = this; this.opacityRange.onchange = function () { s._setOpacity(this.value) }, this.opacityRange.oninput = function () { s._setOpacity(this.value) }, this.brightnessRange.onchange = function () { s._setBrightness(this.value) }, this.brightnessRange.oninput = function () { s._setBrightness(this.value) }, this.brightnessLabel = document.createElement("div"), this.brightnessLabel.className = "vis-label vis-brightness", this.brightnessLabel.innerHTML = "brightness:", this.opacityLabel = document.createElement("div"), this.opacityLabel.className = "vis-label vis-opacity", this.opacityLabel.innerHTML = "opacity:", this.newColorDiv = document.createElement("div"), this.newColorDiv.className = "vis-new-color", this.newColorDiv.innerHTML = "new", this.initialColorDiv = document.createElement("div"), this.initialColorDiv.className = "vis-initial-color", this.initialColorDiv.innerHTML = "initial", this.cancelButton = document.createElement("div"), this.cancelButton.className = "vis-button vis-cancel", this.cancelButton.innerHTML = "cancel", this.cancelButton.onclick = Z(t = this._hide).call(t, this, !1), this.applyButton = document.createElement("div"), this.applyButton.className = "vis-button vis-apply", this.applyButton.innerHTML = "apply", this.applyButton.onclick = Z(e = this._apply).call(e, this), this.saveButton = document.createElement("div"), this.saveButton.className = "vis-button vis-save", this.saveButton.innerHTML = "save", this.saveButton.onclick = Z(i = this._save).call(i, this), this.loadButton = document.createElement("div"), this.loadButton.className = "vis-button vis-load", this.loadButton.innerHTML = "load last", this.loadButton.onclick = Z(n = this._loadLast).call(n, this), this.frame.appendChild(this.colorPickerDiv), this.frame.appendChild(this.arrowDiv), this.frame.appendChild(this.brightnessLabel), this.frame.appendChild(this.brightnessDiv), this.frame.appendChild(this.opacityLabel), this.frame.appendChild(this.opacityDiv), this.frame.appendChild(this.newColorDiv), this.frame.appendChild(this.initialColorDiv), this.frame.appendChild(this.cancelButton), this.frame.appendChild(this.applyButton), this.frame.appendChild(this.saveButton), this.frame.appendChild(this.loadButton) } }, { key: "_bindHammer", value: function () { var t = this; this.drag = {}, this.pinch = {}, this.hammer = new wl(this.colorPickerCanvas), this.hammer.get("pinch").set({ enable: !0 }), dp(this.hammer, (function (e) { t._moveSelector(e) })), this.hammer.on("tap", (function (e) { t._moveSelector(e) })), this.hammer.on("panstart", (function (e) { t._moveSelector(e) })), this.hammer.on("panmove", (function (e) { t._moveSelector(e) })), this.hammer.on("panend", (function (e) { t._moveSelector(e) })) } }, { key: "_generateHueCircle", value: function () { if (!1 === this.generated) { var t = this.colorPickerCanvas.getContext("2d"); void 0 === this.pixelRation && (this.pixelRatio = (window.devicePixelRatio || 1) / (t.webkitBackingStorePixelRatio || t.mozBackingStorePixelRatio || t.msBackingStorePixelRatio || t.oBackingStorePixelRatio || t.backingStorePixelRatio || 1)), t.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0); var e, i, n, o, r = this.colorPickerCanvas.clientWidth, s = this.colorPickerCanvas.clientHeight; t.clearRect(0, 0, r, s), this.centerCoordinates = { x: .5 * r, y: .5 * s }, this.r = .49 * r; var a, h = 2 * Math.PI / 360, l = 1 / this.r; for (n = 0; n < 360; n++)for (o = 0; o < this.r; o++)e = this.centerCoordinates.x + o * Math.sin(h * n), i = this.centerCoordinates.y + o * Math.cos(h * n), a = ms(.002777777777777778 * n, o * l, 1), t.fillStyle = "rgb(" + a.r + "," + a.g + "," + a.b + ")", t.fillRect(e - .5, i - .5, 2, 2); t.strokeStyle = "rgba(0,0,0,1)", t.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r), t.stroke(), this.hueCircle = t.getImageData(0, 0, r, s) } this.generated = !0 } }, { key: "_moveSelector", value: function (t) { var e = this.colorPickerDiv.getBoundingClientRect(), i = t.center.x - e.left, n = t.center.y - e.top, o = .5 * this.colorPickerDiv.clientHeight, r = .5 * this.colorPickerDiv.clientWidth, s = i - r, a = n - o, h = Math.atan2(s, a), l = .98 * Math.min(Math.sqrt(s * s + a * a), r), d = Math.cos(h) * l + o, c = Math.sin(h) * l + r; this.colorPickerSelector.style.top = d - .5 * this.colorPickerSelector.clientHeight + "px", this.colorPickerSelector.style.left = c - .5 * this.colorPickerSelector.clientWidth + "px"; var u = h / (2 * Math.PI); u = u < 0 ? u + 1 : u; var f = l / this.r, p = vs(this.color.r, this.color.g, this.color.b); p.h = u, p.s = f; var v = ms(p.h, p.s, p.v); v.a = this.color.a, this.color = v, this.initialColorDiv.style.backgroundColor = "rgba(" + this.initialColor.r + "," + this.initialColor.g + "," + this.initialColor.b + "," + this.initialColor.a + ")", this.newColorDiv.style.backgroundColor = "rgba(" + this.color.r + "," + this.color.g + "," + this.color.b + "," + this.color.a + ")" } }]), t }(), vv = function () { function t(e, i, n) { var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1; El(this, t), this.parent = e, this.changedOptions = [], this.container = i, this.allowCreation = !1, this.options = {}, this.initialized = !1, this.popupCounter = 0, this.defaultOptions = { enabled: !1, filter: !0, container: void 0, showButton: !0 }, mt(this.options, this.defaultOptions), this.configureOptions = n, this.moduleOptions = {}, this.domElements = [], this.popupDiv = {}, this.popupLimit = 5, this.popupHistory = {}, this.colorPicker = new pv(o), this.wrapper = void 0 } return Sl(t, [{ key: "setOptions", value: function (t) { if (void 0 !== t) { this.popupHistory = {}, this._removePopup(); var e = !0; if ("string" == typeof t) this.options.filter = t; else if (ur(t)) this.options.filter = t.join(); else if ("object" === vr(t)) { if (null == t) throw new TypeError("options cannot be null"); void 0 !== t.container && (this.options.container = t.container), void 0 !== yo(t) && (this.options.filter = yo(t)), void 0 !== t.showButton && (this.options.showButton = t.showButton), void 0 !== t.enabled && (e = t.enabled) } else "boolean" == typeof t ? (this.options.filter = !0, e = t) : "function" == typeof t && (this.options.filter = t, e = !0); !1 === yo(this.options) && (e = !1), this.options.enabled = e } this._clean() } }, { key: "setModuleOptions", value: function (t) { this.moduleOptions = t, !0 === this.options.enabled && (this._clean(), void 0 !== this.options.container && (this.container = this.options.container), this._create()) } }, { key: "_create", value: function () { this._clean(), this.changedOptions = []; var t = yo(this.options), e = 0, i = !1; for (var n in this.configureOptions) Object.prototype.hasOwnProperty.call(this.configureOptions, n) && (this.allowCreation = !1, i = !1, "function" == typeof t ? i = (i = t(n, [])) || this._handleObject(this.configureOptions[n], [n], !0) : !0 !== t && -1 === To(t).call(t, n) || (i = !0), !1 !== i && (this.allowCreation = !0, e > 0 && this._makeItem([]), this._makeHeader(n), this._handleObject(this.configureOptions[n], [n])), e++); this._makeButton(), this._push() } }, { key: "_push", value: function () { this.wrapper = document.createElement("div"), this.wrapper.className = "vis-configuration-wrapper", this.container.appendChild(this.wrapper); for (var t = 0; t < this.domElements.length; t++)this.wrapper.appendChild(this.domElements[t]); this._showPopupIfNeeded() } }, { key: "_clean", value: function () { for (var t = 0; t < this.domElements.length; t++)this.wrapper.removeChild(this.domElements[t]); void 0 !== this.wrapper && (this.container.removeChild(this.wrapper), this.wrapper = void 0), this.domElements = [], this._removePopup() } }, { key: "_getValue", value: function (t) { for (var e = this.moduleOptions, i = 0; i < t.length; i++) { if (void 0 === e[t[i]]) { e = void 0; break } e = e[t[i]] } return e } }, { key: "_makeItem", value: function (t) { if (!0 === this.allowCreation) { var e = document.createElement("div"); e.className = "vis-configuration vis-config-item vis-config-s" + t.length; for (var i = arguments.length, n = new Array(i > 1 ? i - 1 : 0), o = 1; o < i; o++)n[o - 1] = arguments[o]; return Yn(n).call(n, (function (t) { e.appendChild(t) })), this.domElements.push(e), this.domElements.length } return 0 } }, { key: "_makeHeader", value: function (t) { var e = document.createElement("div"); e.className = "vis-configuration vis-config-header", e.innerHTML = t, this._makeItem([], e) } }, { key: "_makeLabel", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = document.createElement("div"); return n.className = "vis-configuration vis-config-label vis-config-s" + e.length, n.innerHTML = !0 === i ? "<i><b>" + t + ":</b></i>" : t + ":", n } }, { key: "_makeDropdown", value: function (t, e, i) { var n = document.createElement("select"); n.className = "vis-configuration vis-config-select"; var o = 0; void 0 !== e && -1 !== To(t).call(t, e) && (o = To(t).call(t, e)); for (var r = 0; r < t.length; r++) { var s = document.createElement("option"); s.value = t[r], r === o && (s.selected = "selected"), s.innerHTML = t[r], n.appendChild(s) } var a = this; n.onchange = function () { a._update(this.value, i) }; var h = this._makeLabel(i[i.length - 1], i); this._makeItem(i, h, n) } }, { key: "_makeRange", value: function (t, e, i) { var n = t[0], o = t[1], r = t[2], s = t[3], a = document.createElement("input"); a.className = "vis-configuration vis-config-range"; try { a.type = "range", a.min = o, a.max = r } catch (t) { } a.step = s; var h = "", l = 0; if (void 0 !== e) { var d = 1.2; e < 0 && e * d < o ? (a.min = Math.ceil(e * d), l = a.min, h = "range increased") : e / d < o && (a.min = Math.ceil(e / d), l = a.min, h = "range increased"), e * d > r && 1 !== r && (a.max = Math.ceil(e * d), l = a.max, h = "range increased"), a.value = e } else a.value = n; var c = document.createElement("input"); c.className = "vis-configuration vis-config-rangeinput", c.value = a.value; var u = this; a.onchange = function () { c.value = this.value, u._update(Number(this.value), i) }, a.oninput = function () { c.value = this.value }; var f = this._makeLabel(i[i.length - 1], i), p = this._makeItem(i, f, a, c); "" !== h && this.popupHistory[p] !== l && (this.popupHistory[p] = l, this._setupPopup(h, p)) } }, { key: "_makeButton", value: function () { var t = this; if (!0 === this.options.showButton) { var e = document.createElement("div"); e.className = "vis-configuration vis-config-button", e.innerHTML = "generate options", e.onclick = function () { t._printOptions() }, e.onmouseover = function () { e.className = "vis-configuration vis-config-button hover" }, e.onmouseout = function () { e.className = "vis-configuration vis-config-button" }, this.optionsContainer = document.createElement("div"), this.optionsContainer.className = "vis-configuration vis-config-option-container", this.domElements.push(this.optionsContainer), this.domElements.push(e) } } }, { key: "_setupPopup", value: function (t, e) { var i = this; if (!0 === this.initialized && !0 === this.allowCreation && this.popupCounter < this.popupLimit) { var n = document.createElement("div"); n.id = "vis-configuration-popup", n.className = "vis-configuration-popup", n.innerHTML = t, n.onclick = function () { i._removePopup() }, this.popupCounter += 1, this.popupDiv = { html: n, index: e } } } }, { key: "_removePopup", value: function () { void 0 !== this.popupDiv.html && (this.popupDiv.html.parentNode.removeChild(this.popupDiv.html), clearTimeout(this.popupDiv.hideTimeout), clearTimeout(this.popupDiv.deleteTimeout), this.popupDiv = {}) } }, { key: "_showPopupIfNeeded", value: function () { var t = this; if (void 0 !== this.popupDiv.html) { var e = this.domElements[this.popupDiv.index].getBoundingClientRect(); this.popupDiv.html.style.left = e.left + "px", this.popupDiv.html.style.top = e.top - 30 + "px", document.body.appendChild(this.popupDiv.html), this.popupDiv.hideTimeout = Zl((function () { t.popupDiv.html.style.opacity = 0 }), 1500), this.popupDiv.deleteTimeout = Zl((function () { t._removePopup() }), 1800) } } }, { key: "_makeCheckbox", value: function (t, e, i) { var n = document.createElement("input"); n.type = "checkbox", n.className = "vis-configuration vis-config-checkbox", n.checked = t, void 0 !== e && (n.checked = e, e !== t && ("object" === vr(t) ? e !== t.enabled && this.changedOptions.push({ path: i, value: e }) : this.changedOptions.push({ path: i, value: e }))); var o = this; n.onchange = function () { o._update(this.checked, i) }; var r = this._makeLabel(i[i.length - 1], i); this._makeItem(i, r, n) } }, { key: "_makeTextInput", value: function (t, e, i) { var n = document.createElement("input"); n.type = "text", n.className = "vis-configuration vis-config-text", n.value = e, e !== t && this.changedOptions.push({ path: i, value: e }); var o = this; n.onchange = function () { o._update(this.value, i) }; var r = this._makeLabel(i[i.length - 1], i); this._makeItem(i, r, n) } }, { key: "_makeColorField", value: function (t, e, i) { var n = this, o = t[1], r = document.createElement("div"); "none" !== (e = void 0 === e ? o : e) ? (r.className = "vis-configuration vis-config-colorBlock", r.style.backgroundColor = e) : r.className = "vis-configuration vis-config-colorBlock none", e = void 0 === e ? o : e, r.onclick = function () { n._showColorPicker(e, r, i) }; var s = this._makeLabel(i[i.length - 1], i); this._makeItem(i, s, r) } }, { key: "_showColorPicker", value: function (t, e, i) { var n = this; e.onclick = function () { }, this.colorPicker.insertTo(e), this.colorPicker.show(), this.colorPicker.setColor(t), this.colorPicker.setUpdateCallback((function (t) { var o = "rgba(" + t.r + "," + t.g + "," + t.b + "," + t.a + ")"; e.style.backgroundColor = o, n._update(o, i) })), this.colorPicker.setCloseCallback((function () { e.onclick = function () { n._showColorPicker(t, e, i) } })) } }, { key: "_handleObject", value: function (t) { var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [], i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = !1, o = yo(this.options), r = !1; for (var s in t) if (Object.prototype.hasOwnProperty.call(t, s)) { n = !0; var a = t[s], h = ts(e, s); if ("function" == typeof o && !1 === (n = o(s, e)) && !ur(a) && "string" != typeof a && "boolean" != typeof a && a instanceof Object && (this.allowCreation = !1, n = this._handleObject(a, h, !0), this.allowCreation = !1 === i), !1 !== n) { r = !0; var l = this._getValue(h); if (ur(a)) this._handleArray(a, l, h); else if ("string" == typeof a) this._makeTextInput(a, l, h); else if ("boolean" == typeof a) this._makeCheckbox(a, l, h); else if (a instanceof Object) { var d = !0; if (-1 !== To(e).call(e, "physics") && this.moduleOptions.physics.solver !== s && "wind" !== s && (d = !1), !0 === d) if (void 0 !== a.enabled) { var c = ts(h, "enabled"), u = this._getValue(c); if (!0 === u) { var f = this._makeLabel(s, h, !0); this._makeItem(h, f), r = this._handleObject(a, h) || r } else this._makeCheckbox(a, u, h) } else { var p = this._makeLabel(s, h, !0); this._makeItem(h, p), r = this._handleObject(a, h) || r } } else console.error("dont know how to handle", a, s, h) } } return r } }, { key: "_handleArray", value: function (t, e, i) { "string" == typeof t[0] && "color" === t[0] ? (this._makeColorField(t, e, i), t[1] !== e && this.changedOptions.push({ path: i, value: e })) : "string" == typeof t[0] ? (this._makeDropdown(t, e, i), t[0] !== e && this.changedOptions.push({ path: i, value: e })) : "number" == typeof t[0] && (this._makeRange(t, e, i), t[0] !== e && this.changedOptions.push({ path: i, value: Number(e) })) } }, { key: "_update", value: function (t, e) { var i = this._constructOptions(t, e); this.parent.body && this.parent.body.emitter && this.parent.body.emitter.emit && this.parent.body.emitter.emit("configChange", i), this.initialized = !0, this.parent.setOptions(i) } }, { key: "_constructOptions", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, n = i; t = "false" !== (t = "true" === t || t) && t; for (var o = 0; o < e.length; o++)"global" !== e[o] && (void 0 === n[e[o]] && (n[e[o]] = {}), o !== e.length - 1 ? n = n[e[o]] : n[e[o]] = t); return i } }, { key: "_printOptions", value: function () { var t = this.getOptions(); this.optionsContainer.innerHTML = "<pre>var options = " + Ed(t, null, 2) + "</pre>" } }, { key: "getOptions", value: function () { for (var t = {}, e = 0; e < this.changedOptions.length; e++)this._constructOptions(this.changedOptions[e].value, this.changedOptions[e].path, t); return t } }]), t }(), gv = "string", yv = "boolean", mv = "number", bv = "array", wv = "object", kv = ["arrow", "bar", "box", "circle", "crow", "curve", "diamond", "image", "inv_curve", "inv_triangle", "triangle", "vee"], _v = { configure: { enabled: { boolean: yv }, filter: { boolean: yv, string: gv, array: bv, function: "function" }, container: { dom: "dom" }, showButton: { boolean: yv }, __type__: { object: wv, boolean: yv, string: gv, array: bv, function: "function" } }, edges: { arrows: { to: { enabled: { boolean: yv }, scaleFactor: { number: mv }, type: { string: kv }, imageHeight: { number: mv }, imageWidth: { number: mv }, src: { string: gv }, __type__: { object: wv, boolean: yv } }, middle: { enabled: { boolean: yv }, scaleFactor: { number: mv }, type: { string: kv }, imageWidth: { number: mv }, imageHeight: { number: mv }, src: { string: gv }, __type__: { object: wv, boolean: yv } }, from: { enabled: { boolean: yv }, scaleFactor: { number: mv }, type: { string: kv }, imageWidth: { number: mv }, imageHeight: { number: mv }, src: { string: gv }, __type__: { object: wv, boolean: yv } }, __type__: { string: ["from", "to", "middle"], object: wv } }, endPointOffset: { from: { number: mv }, to: { number: mv }, __type__: { object: wv, number: mv } }, arrowStrikethrough: { boolean: yv }, background: { enabled: { boolean: yv }, color: { string: gv }, size: { number: mv }, dashes: { boolean: yv, array: bv }, __type__: { object: wv, boolean: yv } }, chosen: { label: { boolean: yv, function: "function" }, edge: { boolean: yv, function: "function" }, __type__: { object: wv, boolean: yv } }, color: { color: { string: gv }, highlight: { string: gv }, hover: { string: gv }, inherit: { string: ["from", "to", "both"], boolean: yv }, opacity: { number: mv }, __type__: { object: wv, string: gv } }, dashes: { boolean: yv, array: bv }, font: { color: { string: gv }, size: { number: mv }, face: { string: gv }, background: { string: gv }, strokeWidth: { number: mv }, strokeColor: { string: gv }, align: { string: ["horizontal", "top", "middle", "bottom"] }, vadjust: { number: mv }, multi: { boolean: yv, string: gv }, bold: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, boldital: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, ital: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, mono: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, __type__: { object: wv, string: gv } }, hidden: { boolean: yv }, hoverWidth: { function: "function", number: mv }, label: { string: gv, undefined: "undefined" }, labelHighlightBold: { boolean: yv }, length: { number: mv, undefined: "undefined" }, physics: { boolean: yv }, scaling: { min: { number: mv }, max: { number: mv }, label: { enabled: { boolean: yv }, min: { number: mv }, max: { number: mv }, maxVisible: { number: mv }, drawThreshold: { number: mv }, __type__: { object: wv, boolean: yv } }, customScalingFunction: { function: "function" }, __type__: { object: wv } }, selectionWidth: { function: "function", number: mv }, selfReferenceSize: { number: mv }, selfReference: { size: { number: mv }, angle: { number: mv }, renderBehindTheNode: { boolean: yv }, __type__: { object: wv } }, shadow: { enabled: { boolean: yv }, color: { string: gv }, size: { number: mv }, x: { number: mv }, y: { number: mv }, __type__: { object: wv, boolean: yv } }, smooth: { enabled: { boolean: yv }, type: { string: ["dynamic", "continuous", "discrete", "diagonalCross", "straightCross", "horizontal", "vertical", "curvedCW", "curvedCCW", "cubicBezier"] }, roundness: { number: mv }, forceDirection: { string: ["horizontal", "vertical", "none"], boolean: yv }, __type__: { object: wv, boolean: yv } }, title: { string: gv, undefined: "undefined" }, width: { number: mv }, widthConstraint: { maximum: { number: mv }, __type__: { object: wv, boolean: yv, number: mv } }, value: { number: mv, undefined: "undefined" }, __type__: { object: wv } }, groups: { useDefaultGroups: { boolean: yv }, __any__: "get from nodes, will be overwritten below", __type__: { object: wv } }, interaction: { dragNodes: { boolean: yv }, dragView: { boolean: yv }, hideEdgesOnDrag: { boolean: yv }, hideEdgesOnZoom: { boolean: yv }, hideNodesOnDrag: { boolean: yv }, hover: { boolean: yv }, keyboard: { enabled: { boolean: yv }, speed: { x: { number: mv }, y: { number: mv }, zoom: { number: mv }, __type__: { object: wv } }, bindToWindow: { boolean: yv }, __type__: { object: wv, boolean: yv } }, multiselect: { boolean: yv }, navigationButtons: { boolean: yv }, selectable: { boolean: yv }, selectConnectedEdges: { boolean: yv }, hoverConnectedEdges: { boolean: yv }, tooltipDelay: { number: mv }, zoomView: { boolean: yv }, zoomSpeed: { number: mv }, __type__: { object: wv } }, layout: { randomSeed: { undefined: "undefined", number: mv, string: gv }, improvedLayout: { boolean: yv }, clusterThreshold: { number: mv }, hierarchical: { enabled: { boolean: yv }, levelSeparation: { number: mv }, nodeSpacing: { number: mv }, treeSpacing: { number: mv }, blockShifting: { boolean: yv }, edgeMinimization: { boolean: yv }, parentCentralization: { boolean: yv }, direction: { string: ["UD", "DU", "LR", "RL"] }, sortMethod: { string: ["hubsize", "directed"] }, shakeTowards: { string: ["leaves", "roots"] }, __type__: { object: wv, boolean: yv } }, __type__: { object: wv } }, manipulation: { enabled: { boolean: yv }, initiallyActive: { boolean: yv }, addNode: { boolean: yv, function: "function" }, addEdge: { boolean: yv, function: "function" }, editNode: { function: "function" }, editEdge: { editWithoutDrag: { function: "function" }, __type__: { object: wv, boolean: yv, function: "function" } }, deleteNode: { boolean: yv, function: "function" }, deleteEdge: { boolean: yv, function: "function" }, controlNodeStyle: "get from nodes, will be overwritten below", __type__: { object: wv, boolean: yv } }, nodes: { borderWidth: { number: mv }, borderWidthSelected: { number: mv, undefined: "undefined" }, brokenImage: { string: gv, undefined: "undefined" }, chosen: { label: { boolean: yv, function: "function" }, node: { boolean: yv, function: "function" }, __type__: { object: wv, boolean: yv } }, color: { border: { string: gv }, background: { string: gv }, highlight: { border: { string: gv }, background: { string: gv }, __type__: { object: wv, string: gv } }, hover: { border: { string: gv }, background: { string: gv }, __type__: { object: wv, string: gv } }, __type__: { object: wv, string: gv } }, opacity: { number: mv, undefined: "undefined" }, fixed: { x: { boolean: yv }, y: { boolean: yv }, __type__: { object: wv, boolean: yv } }, font: { align: { string: gv }, color: { string: gv }, size: { number: mv }, face: { string: gv }, background: { string: gv }, strokeWidth: { number: mv }, strokeColor: { string: gv }, vadjust: { number: mv }, multi: { boolean: yv, string: gv }, bold: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, boldital: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, ital: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, mono: { color: { string: gv }, size: { number: mv }, face: { string: gv }, mod: { string: gv }, vadjust: { number: mv }, __type__: { object: wv, string: gv } }, __type__: { object: wv, string: gv } }, group: { string: gv, number: mv, undefined: "undefined" }, heightConstraint: { minimum: { number: mv }, valign: { string: gv }, __type__: { object: wv, boolean: yv, number: mv } }, hidden: { boolean: yv }, icon: { face: { string: gv }, code: { string: gv }, size: { number: mv }, color: { string: gv }, weight: { string: gv, number: mv }, __type__: { object: wv } }, id: { string: gv, number: mv }, image: { selected: { string: gv, undefined: "undefined" }, unselected: { string: gv, undefined: "undefined" }, __type__: { object: wv, string: gv } }, imagePadding: { top: { number: mv }, right: { number: mv }, bottom: { number: mv }, left: { number: mv }, __type__: { object: wv, number: mv } }, label: { string: gv, undefined: "undefined" }, labelHighlightBold: { boolean: yv }, level: { number: mv, undefined: "undefined" }, margin: { top: { number: mv }, right: { number: mv }, bottom: { number: mv }, left: { number: mv }, __type__: { object: wv, number: mv } }, mass: { number: mv }, physics: { boolean: yv }, scaling: { min: { number: mv }, max: { number: mv }, label: { enabled: { boolean: yv }, min: { number: mv }, max: { number: mv }, maxVisible: { number: mv }, drawThreshold: { number: mv }, __type__: { object: wv, boolean: yv } }, customScalingFunction: { function: "function" }, __type__: { object: wv } }, shadow: { enabled: { boolean: yv }, color: { string: gv }, size: { number: mv }, x: { number: mv }, y: { number: mv }, __type__: { object: wv, boolean: yv } }, shape: { string: ["custom", "ellipse", "circle", "database", "box", "text", "image", "circularImage", "diamond", "dot", "star", "triangle", "triangleDown", "square", "icon", "hexagon"] }, ctxRenderer: { function: "function" }, shapeProperties: { borderDashes: { boolean: yv, array: bv }, borderRadius: { number: mv }, interpolation: { boolean: yv }, useImageSize: { boolean: yv }, useBorderWithImage: { boolean: yv }, coordinateOrigin: { string: ["center", "top-left"] }, __type__: { object: wv } }, size: { number: mv }, title: { string: gv, dom: "dom", undefined: "undefined" }, value: { number: mv, undefined: "undefined" }, widthConstraint: { minimum: { number: mv }, maximum: { number: mv }, __type__: { object: wv, boolean: yv, number: mv } }, x: { number: mv }, y: { number: mv }, __type__: { object: wv } }, physics: { enabled: { boolean: yv }, barnesHut: { theta: { number: mv }, gravitationalConstant: { number: mv }, centralGravity: { number: mv }, springLength: { number: mv }, springConstant: { number: mv }, damping: { number: mv }, avoidOverlap: { number: mv }, __type__: { object: wv } }, forceAtlas2Based: { theta: { number: mv }, gravitationalConstant: { number: mv }, centralGravity: { number: mv }, springLength: { number: mv }, springConstant: { number: mv }, damping: { number: mv }, avoidOverlap: { number: mv }, __type__: { object: wv } }, repulsion: { centralGravity: { number: mv }, springLength: { number: mv }, springConstant: { number: mv }, nodeDistance: { number: mv }, damping: { number: mv }, __type__: { object: wv } }, hierarchicalRepulsion: { centralGravity: { number: mv }, springLength: { number: mv }, springConstant: { number: mv }, nodeDistance: { number: mv }, damping: { number: mv }, avoidOverlap: { number: mv }, __type__: { object: wv } }, maxVelocity: { number: mv }, minVelocity: { number: mv }, solver: { string: ["barnesHut", "repulsion", "hierarchicalRepulsion", "forceAtlas2Based"] }, stabilization: { enabled: { boolean: yv }, iterations: { number: mv }, updateInterval: { number: mv }, onlyDynamicEdges: { boolean: yv }, fit: { boolean: yv }, __type__: { object: wv, boolean: yv } }, timestep: { number: mv }, adaptiveTimestep: { boolean: yv }, wind: { x: { number: mv }, y: { number: mv }, __type__: { object: wv } }, __type__: { object: wv, boolean: yv } }, autoResize: { boolean: yv }, clickToUse: { boolean: yv }, locale: { string: gv }, locales: { __any__: { any: "any" }, __type__: { object: wv } }, height: { string: gv }, width: { string: gv }, __type__: { object: wv } }; _v.groups.__any__ = _v.nodes, _v.manipulation.controlNodeStyle = _v.nodes; var xv = { nodes: { borderWidth: [1, 0, 10, 1], borderWidthSelected: [2, 0, 10, 1], color: { border: ["color", "#2B7CE9"], background: ["color", "#97C2FC"], highlight: { border: ["color", "#2B7CE9"], background: ["color", "#D2E5FF"] }, hover: { border: ["color", "#2B7CE9"], background: ["color", "#D2E5FF"] } }, opacity: [0, 0, 1, .1], fixed: { x: !1, y: !1 }, font: { color: ["color", "#343434"], size: [14, 0, 100, 1], face: ["arial", "verdana", "tahoma"], background: ["color", "none"], strokeWidth: [0, 0, 50, 1], strokeColor: ["color", "#ffffff"] }, hidden: !1, labelHighlightBold: !0, physics: !0, scaling: { min: [10, 0, 200, 1], max: [30, 0, 200, 1], label: { enabled: !1, min: [14, 0, 200, 1], max: [30, 0, 200, 1], maxVisible: [30, 0, 200, 1], drawThreshold: [5, 0, 20, 1] } }, shadow: { enabled: !1, color: "rgba(0,0,0,0.5)", size: [10, 0, 20, 1], x: [5, -30, 30, 1], y: [5, -30, 30, 1] }, shape: ["ellipse", "box", "circle", "database", "diamond", "dot", "square", "star", "text", "triangle", "triangleDown", "hexagon"], shapeProperties: { borderDashes: !1, borderRadius: [6, 0, 20, 1], interpolation: !0, useImageSize: !1 }, size: [25, 0, 200, 1] }, edges: { arrows: { to: { enabled: !1, scaleFactor: [1, 0, 3, .05], type: "arrow" }, middle: { enabled: !1, scaleFactor: [1, 0, 3, .05], type: "arrow" }, from: { enabled: !1, scaleFactor: [1, 0, 3, .05], type: "arrow" } }, endPointOffset: { from: [0, -10, 10, 1], to: [0, -10, 10, 1] }, arrowStrikethrough: !0, color: { color: ["color", "#848484"], highlight: ["color", "#848484"], hover: ["color", "#848484"], inherit: ["from", "to", "both", !0, !1], opacity: [1, 0, 1, .05] }, dashes: !1, font: { color: ["color", "#343434"], size: [14, 0, 100, 1], face: ["arial", "verdana", "tahoma"], background: ["color", "none"], strokeWidth: [2, 0, 50, 1], strokeColor: ["color", "#ffffff"], align: ["horizontal", "top", "middle", "bottom"] }, hidden: !1, hoverWidth: [1.5, 0, 5, .1], labelHighlightBold: !0, physics: !0, scaling: { min: [1, 0, 100, 1], max: [15, 0, 100, 1], label: { enabled: !0, min: [14, 0, 200, 1], max: [30, 0, 200, 1], maxVisible: [30, 0, 200, 1], drawThreshold: [5, 0, 20, 1] } }, selectionWidth: [1.5, 0, 5, .1], selfReferenceSize: [20, 0, 200, 1], selfReference: { size: [20, 0, 200, 1], angle: [Math.PI / 2, -6 * Math.PI, 6 * Math.PI, Math.PI / 8], renderBehindTheNode: !0 }, shadow: { enabled: !1, color: "rgba(0,0,0,0.5)", size: [10, 0, 20, 1], x: [5, -30, 30, 1], y: [5, -30, 30, 1] }, smooth: { enabled: !0, type: ["dynamic", "continuous", "discrete", "diagonalCross", "straightCross", "horizontal", "vertical", "curvedCW", "curvedCCW", "cubicBezier"], forceDirection: ["horizontal", "vertical", "none"], roundness: [.5, 0, 1, .05] }, width: [1, 0, 30, 1] }, layout: { hierarchical: { enabled: !1, levelSeparation: [150, 20, 500, 5], nodeSpacing: [100, 20, 500, 5], treeSpacing: [200, 20, 500, 5], blockShifting: !0, edgeMinimization: !0, parentCentralization: !0, direction: ["UD", "DU", "LR", "RL"], sortMethod: ["hubsize", "directed"], shakeTowards: ["leaves", "roots"] } }, interaction: { dragNodes: !0, dragView: !0, hideEdgesOnDrag: !1, hideEdgesOnZoom: !1, hideNodesOnDrag: !1, hover: !1, keyboard: { enabled: !1, speed: { x: [10, 0, 40, 1], y: [10, 0, 40, 1], zoom: [.02, 0, .1, .005] }, bindToWindow: !0 }, multiselect: !1, navigationButtons: !1, selectable: !0, selectConnectedEdges: !0, hoverConnectedEdges: !0, tooltipDelay: [300, 0, 1e3, 25], zoomView: !0, zoomSpeed: [1, .1, 2, .1] }, manipulation: { enabled: !1, initiallyActive: !1 }, physics: { enabled: !0, barnesHut: { theta: [.5, .1, 1, .05], gravitationalConstant: [-2e3, -3e4, 0, 50], centralGravity: [.3, 0, 10, .05], springLength: [95, 0, 500, 5], springConstant: [.04, 0, 1.2, .005], damping: [.09, 0, 1, .01], avoidOverlap: [0, 0, 1, .01] }, forceAtlas2Based: { theta: [.5, .1, 1, .05], gravitationalConstant: [-50, -500, 0, 1], centralGravity: [.01, 0, 1, .005], springLength: [95, 0, 500, 5], springConstant: [.08, 0, 1.2, .005], damping: [.4, 0, 1, .01], avoidOverlap: [0, 0, 1, .01] }, repulsion: { centralGravity: [.2, 0, 10, .05], springLength: [200, 0, 500, 5], springConstant: [.05, 0, 1.2, .005], nodeDistance: [100, 0, 500, 5], damping: [.09, 0, 1, .01] }, hierarchicalRepulsion: { centralGravity: [.2, 0, 10, .05], springLength: [100, 0, 500, 5], springConstant: [.01, 0, 1.2, .005], nodeDistance: [120, 0, 500, 5], damping: [.09, 0, 1, .01], avoidOverlap: [0, 0, 1, .01] }, maxVelocity: [50, 0, 150, 1], minVelocity: [.1, .01, .5, .01], solver: ["barnesHut", "forceAtlas2Based", "repulsion", "hierarchicalRepulsion"], timestep: [.5, .01, 1, .01], wind: { x: [0, -10, 10, .1], y: [0, -10, 10, .1] } } }, Ev = Object.freeze({ __proto__: null, allOptions: _v, configureOptions: xv }), Ov = function () { function t() { El(this, t) } return Sl(t, [{ key: "getDistances", value: function (t, e, i) { for (var n = {}, o = t.edges, r = 0; r < e.length; r++) { var s = {}; n[e[r]] = s; for (var a = 0; a < e.length; a++)s[e[a]] = r == a ? 0 : 1e9 } for (var h = 0; h < i.length; h++) { var l = o[i[h]]; !0 === l.connected && void 0 !== n[l.fromId] && void 0 !== n[l.toId] && (n[l.fromId][l.toId] = 1, n[l.toId][l.fromId] = 1) } for (var d = e.length, c = 0; c < d; c++)for (var u = e[c], f = n[u], p = 0; p < d - 1; p++)for (var v = e[p], g = n[v], y = p + 1; y < d; y++) { var m = e[y], b = n[m], w = Math.min(g[m], g[u] + f[m]); g[m] = w, b[v] = w } return n } }]), t }(), Sv = function () { function t(e, i, n) { El(this, t), this.body = e, this.springLength = i, this.springConstant = n, this.distanceSolver = new Ov } return Sl(t, [{ key: "setOptions", value: function (t) { t && (t.springLength && (this.springLength = t.springLength), t.springConstant && (this.springConstant = t.springConstant)) } }, { key: "solve", value: function (t, e) { var i = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], n = this.distanceSolver.getDistances(this.body, t, e); this._createL_matrix(n), this._createK_matrix(n), this._createE_matrix(); for (var o = .01, r = 1, s = 0, a = Math.max(1e3, Math.min(10 * this.body.nodeIndices.length, 6e3)), h = 5, l = 1e9, d = 0, c = 0, u = 0, f = 0, p = 0; l > o && s < a;) { s += 1; var v = this._getHighestEnergyNode(i), g = ir(v, 4); for (d = g[0], l = g[1], c = g[2], u = g[3], f = l, p = 0; f > r && p < h;) { p += 1, this._moveNode(d, c, u); var y = this._getEnergy(d), m = ir(y, 3); f = m[0], c = m[1], u = m[2] } } } }, { key: "_getHighestEnergyNode", value: function (t) { for (var e = this.body.nodeIndices, i = this.body.nodes, n = 0, o = e[0], r = 0, s = 0, a = 0; a < e.length; a++) { var h = e[a]; if (!0 !== i[h].predefinedPosition || !0 === i[h].isCluster && !0 === t || !0 !== i[h].options.fixed.x || !0 !== i[h].options.fixed.y) { var l = this._getEnergy(h), d = ir(l, 3), c = d[0], u = d[1], f = d[2]; n < c && (n = c, o = h, r = u, s = f) } } return [o, n, r, s] } }, { key: "_getEnergy", value: function (t) { var e = ir(this.E_sums[t], 2), i = e[0], n = e[1]; return [Math.sqrt(Math.pow(i, 2) + Math.pow(n, 2)), i, n] } }, { key: "_moveNode", value: function (t, e, i) { for (var n = this.body.nodeIndices, o = this.body.nodes, r = 0, s = 0, a = 0, h = o[t].x, l = o[t].y, d = this.K_matrix[t], c = this.L_matrix[t], u = 0; u < n.length; u++) { var f = n[u]; if (f !== t) { var p = o[f].x, v = o[f].y, g = d[f], y = c[f], m = 1 / Math.pow(Math.pow(h - p, 2) + Math.pow(l - v, 2), 1.5); r += g * (1 - y * Math.pow(l - v, 2) * m), s += g * (y * (h - p) * (l - v) * m), a += g * (1 - y * Math.pow(h - p, 2) * m) } } var b = (e / r + i / s) / (s / r - a / s), w = -(s * b + e) / r; o[t].x += w, o[t].y += b, this._updateE_matrix(t) } }, { key: "_createL_matrix", value: function (t) { var e = this.body.nodeIndices, i = this.springLength; this.L_matrix = []; for (var n = 0; n < e.length; n++) { this.L_matrix[e[n]] = {}; for (var o = 0; o < e.length; o++)this.L_matrix[e[n]][e[o]] = i * t[e[n]][e[o]] } } }, { key: "_createK_matrix", value: function (t) { var e = this.body.nodeIndices, i = this.springConstant; this.K_matrix = []; for (var n = 0; n < e.length; n++) { this.K_matrix[e[n]] = {}; for (var o = 0; o < e.length; o++)this.K_matrix[e[n]][e[o]] = i * Math.pow(t[e[n]][e[o]], -2) } } }, { key: "_createE_matrix", value: function () { var t = this.body.nodeIndices, e = this.body.nodes; this.E_matrix = {}, this.E_sums = {}; for (var i = 0; i < t.length; i++)this.E_matrix[t[i]] = []; for (var n = 0; n < t.length; n++) { for (var o = t[n], r = e[o].x, s = e[o].y, a = 0, h = 0, l = n; l < t.length; l++) { var d = t[l]; if (d !== o) { var c = e[d].x, u = e[d].y, f = 1 / Math.sqrt(Math.pow(r - c, 2) + Math.pow(s - u, 2)); this.E_matrix[o][l] = [this.K_matrix[o][d] * (r - c - this.L_matrix[o][d] * (r - c) * f), this.K_matrix[o][d] * (s - u - this.L_matrix[o][d] * (s - u) * f)], this.E_matrix[d][n] = this.E_matrix[o][l], a += this.E_matrix[o][l][0], h += this.E_matrix[o][l][1] } } this.E_sums[o] = [a, h] } } }, { key: "_updateE_matrix", value: function (t) { for (var e = this.body.nodeIndices, i = this.body.nodes, n = this.E_matrix[t], o = this.K_matrix[t], r = this.L_matrix[t], s = i[t].x, a = i[t].y, h = 0, l = 0, d = 0; d < e.length; d++) { var c = e[d]; if (c !== t) { var u = n[d], f = u[0], p = u[1], v = i[c].x, g = i[c].y, y = 1 / Math.sqrt(Math.pow(s - v, 2) + Math.pow(a - g, 2)), m = o[c] * (s - v - r[c] * (s - v) * y), b = o[c] * (a - g - r[c] * (a - g) * y); n[d] = [m, b], h += m, l += b; var w = this.E_sums[c]; w[0] += m - f, w[1] += b - p } } this.E_sums[t] = [h, l] } }]), t }(); function Cv(t, e, i) { var n, o, r, s, a = this; if (!(this instanceof Cv)) throw new SyntaxError("Constructor must be called with the new operator"); this.options = {}, this.defaultOptions = { locale: "en", locales: xl, clickToUse: !1 }, mt(this.options, this.defaultOptions), this.body = { container: t, nodes: {}, nodeIndices: [], edges: {}, edgeIndices: [], emitter: { on: Z(n = this.on).call(n, this), off: Z(o = this.off).call(o, this), emit: Z(r = this.emit).call(r, this), once: Z(s = this.once).call(s, this) }, eventListeners: { onTap: function () { }, onTouch: function () { }, onDoubleTap: function () { }, onHold: function () { }, onDragStart: function () { }, onDrag: function () { }, onDragEnd: function () { }, onMouseWheel: function () { }, onPinch: function () { }, onMouseMove: function () { }, onRelease: function () { }, onContext: function () { } }, data: { nodes: null, edges: null }, functions: { createNode: function () { }, createEdge: function () { }, getPointer: function () { } }, modules: {}, view: { scale: 1, translation: { x: 0, y: 0 } }, selectionBox: { show: !1, position: { start: { x: 0, y: 0 }, end: { x: 0, y: 0 } } } }, this.bindEventListeners(), this.images = new Tl((function () { return a.body.emitter.emit("_requestRedraw") })), this.groups = new Xl, this.canvas = new up(this.body), this.selectionHandler = new Yp(this.body, this.canvas), this.interactionHandler = new bp(this.body, this.canvas, this.selectionHandler), this.view = new pp(this.body, this.canvas), this.renderer = new hp(this.body, this.canvas), this.physics = new $f(this.body), this.layoutEngine = new cv(this.body), this.clustering = new rp(this.body), this.manipulation = new uv(this.body, this.canvas, this.selectionHandler, this.interactionHandler), this.nodesHandler = new $u(this.body, this.images, this.groups, this.layoutEngine), this.edgesHandler = new Rf(this.body, this.images, this.groups), this.body.modules.kamadaKawai = new Sv(this.body, 150, .05), this.body.modules.clustering = this.clustering, this.canvas._create(), this.setOptions(i), this.setData(e) } function Tv(t) { for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && (t[e].redundant = t[e].used, t[e].used = []) } function Dv(t) { for (var e in t) if (Object.prototype.hasOwnProperty.call(t, e) && t[e].redundant) { for (var i = 0; i < t[e].redundant.length; i++)t[e].redundant[i].parentNode.removeChild(t[e].redundant[i]); t[e].redundant = [] } } function Mv(t, e, i) { var n; return Object.prototype.hasOwnProperty.call(e, t) ? e[t].redundant.length > 0 ? (n = e[t].redundant[0], e[t].redundant.shift()) : (n = document.createElementNS("http://www.w3.org/2000/svg", t), i.appendChild(n)) : (n = document.createElementNS("http://www.w3.org/2000/svg", t), e[t] = { used: [], redundant: [] }, i.appendChild(n)), e[t].used.push(n), n } Ot(Cv.prototype), Cv.prototype.setOptions = function (t) { var e = this; if (null === t && (t = void 0), void 0 !== t) { !0 === Vu.validate(t, _v) && console.error("%cErrors have been found in the supplied options object.", qu); if (Zr(["locale", "locales", "clickToUse"], this.options, t), void 0 !== t.locale && (t.locale = function (t, e) { try { var i = e.split(/[-_ /]/, 2), n = ir(i, 2), o = n[0], r = n[1], s = null != o ? o.toLowerCase() : null, a = null != r ? r.toUpperCase() : null; if (s && a) { var h, l = s + "-" + a; if (Object.prototype.hasOwnProperty.call(t, l)) return l; console.warn(Er(h = "Unknown variant ".concat(a, " of language ")).call(h, s, ".")) } if (s) { var d = s; if (Object.prototype.hasOwnProperty.call(t, d)) return d; console.warn("Unknown language ".concat(s)) } return console.warn("Unknown locale ".concat(e, ", falling back to English.")), "en" } catch (t) { return console.error(t), console.warn("Unexpected error while normalizing locale ".concat(e, ", falling back to English.")), "en" } }(t.locales || this.options.locales, t.locale)), t = this.layoutEngine.setOptions(t.layout, t), this.canvas.setOptions(t), this.groups.setOptions(t.groups), this.nodesHandler.setOptions(t.nodes), this.edgesHandler.setOptions(t.edges), this.physics.setOptions(t.physics), this.manipulation.setOptions(t.manipulation, t, this.options), this.interactionHandler.setOptions(t.interaction), this.renderer.setOptions(t.interaction), this.selectionHandler.setOptions(t.interaction), void 0 !== t.groups && this.body.emitter.emit("refreshNodes"), "configure" in t && (this.configurator || (this.configurator = new vv(this, this.body.container, xv, this.canvas.pixelRatio)), this.configurator.setOptions(t.configure)), this.configurator && !0 === this.configurator.options.enabled) { var i = { nodes: {}, edges: {}, layout: {}, interaction: {}, manipulation: {}, physics: {}, global: {} }; Jr(i.nodes, this.nodesHandler.options), Jr(i.edges, this.edgesHandler.options), Jr(i.layout, this.layoutEngine.options), Jr(i.interaction, this.selectionHandler.options), Jr(i.interaction, this.renderer.options), Jr(i.interaction, this.interactionHandler.options), Jr(i.manipulation, this.manipulation.options), Jr(i.physics, this.physics.options), Jr(i.global, this.canvas.options), Jr(i.global, this.options), this.configurator.setModuleOptions(i) } void 0 !== t.clickToUse ? !0 === t.clickToUse ? void 0 === this.activator && (this.activator = new _l(this.canvas.frame), this.activator.on("change", (function () { e.body.emitter.emit("activate") }))) : (void 0 !== this.activator && (this.activator.destroy(), delete this.activator), this.body.emitter.emit("activate")) : this.body.emitter.emit("activate"), this.canvas.setSize(), this.body.emitter.emit("startSimulation") } }, Cv.prototype._updateVisibleIndices = function () { var t = this.body.nodes, e = this.body.edges; for (var i in this.body.nodeIndices = [], this.body.edgeIndices = [], t) Object.prototype.hasOwnProperty.call(t, i) && (this.clustering._isClusteredNode(i) || !1 !== t[i].options.hidden || this.body.nodeIndices.push(t[i].id)); for (var n in e) if (Object.prototype.hasOwnProperty.call(e, n)) { var o = e[n], r = t[o.fromId], s = t[o.toId], a = void 0 !== r && void 0 !== s; !this.clustering._isClusteredEdge(n) && !1 === o.options.hidden && a && !1 === r.options.hidden && !1 === s.options.hidden && this.body.edgeIndices.push(o.id) } }, Cv.prototype.bindEventListeners = function () { var t = this; this.body.emitter.on("_dataChanged", (function () { t.edgesHandler._updateState(), t.body.emitter.emit("_dataUpdated") })), this.body.emitter.on("_dataUpdated", (function () { t.clustering._updateState(), t._updateVisibleIndices(), t._updateValueRange(t.body.nodes), t._updateValueRange(t.body.edges), t.body.emitter.emit("startSimulation"), t.body.emitter.emit("_requestRedraw") })) }, Cv.prototype.setData = function (t) { if (this.body.emitter.emit("resetPhysics"), this.body.emitter.emit("_resetData"), this.selectionHandler.unselectAll(), t && t.dot && (t.nodes || t.edges)) throw new SyntaxError('Data must contain either parameter "dot" or parameter pair "nodes" and "edges", but not both.'); if (this.setOptions(t && t.options), t && t.dot) { console.warn("The dot property has been deprecated. Please use the static convertDot method to convert DOT into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertDot(dotString);"); var e = Sa(t.dot); this.setData(e) } else if (t && t.gephi) { console.warn("The gephi property has been deprecated. Please use the static convertGephi method to convert gephi into vis.network format and use the normal data format with nodes and edges. This converter is used like this: var data = vis.network.convertGephi(gephiJson);"); var i = Ta(t.gephi); this.setData(i) } else this.nodesHandler.setData(t && t.nodes, !0), this.edgesHandler.setData(t && t.edges, !0), this.body.emitter.emit("_dataChanged"), this.body.emitter.emit("_dataLoaded"), this.body.emitter.emit("initPhysics") }, Cv.prototype.destroy = function () { for (var t in this.body.emitter.emit("destroy"), this.body.emitter.off(), this.off(), delete this.groups, delete this.canvas, delete this.selectionHandler, delete this.interactionHandler, delete this.view, delete this.renderer, delete this.physics, delete this.layoutEngine, delete this.clustering, delete this.manipulation, delete this.nodesHandler, delete this.edgesHandler, delete this.configurator, delete this.images, this.body.nodes) Object.prototype.hasOwnProperty.call(this.body.nodes, t) && delete this.body.nodes[t]; for (var e in this.body.edges) Object.prototype.hasOwnProperty.call(this.body.edges, e) && delete this.body.edges[e]; Ur(this.body.container) }, Cv.prototype._updateValueRange = function (t) { var e, i = void 0, n = void 0, o = 0; for (e in t) if (Object.prototype.hasOwnProperty.call(t, e)) { var r = t[e].getValue(); void 0 !== r && (i = void 0 === i ? r : Math.min(r, i), n = void 0 === n ? r : Math.max(r, n), o += r) } if (void 0 !== i && void 0 !== n) for (e in t) Object.prototype.hasOwnProperty.call(t, e) && t[e].setValueRange(i, n, o) }, Cv.prototype.isActive = function () { return !this.activator || this.activator.active }, Cv.prototype.setSize = function () { return this.canvas.setSize.apply(this.canvas, arguments) }, Cv.prototype.canvasToDOM = function () { return this.canvas.canvasToDOM.apply(this.canvas, arguments) }, Cv.prototype.DOMtoCanvas = function () { return this.canvas.DOMtoCanvas.apply(this.canvas, arguments) }, Cv.prototype.findNode = function () { return this.clustering.findNode.apply(this.clustering, arguments) }, Cv.prototype.isCluster = function () { return this.clustering.isCluster.apply(this.clustering, arguments) }, Cv.prototype.openCluster = function () { return this.clustering.openCluster.apply(this.clustering, arguments) }, Cv.prototype.cluster = function () { return this.clustering.cluster.apply(this.clustering, arguments) }, Cv.prototype.getNodesInCluster = function () { return this.clustering.getNodesInCluster.apply(this.clustering, arguments) }, Cv.prototype.clusterByConnection = function () { return this.clustering.clusterByConnection.apply(this.clustering, arguments) }, Cv.prototype.clusterByHubsize = function () { return this.clustering.clusterByHubsize.apply(this.clustering, arguments) }, Cv.prototype.updateClusteredNode = function () { return this.clustering.updateClusteredNode.apply(this.clustering, arguments) }, Cv.prototype.getClusteredEdges = function () { return this.clustering.getClusteredEdges.apply(this.clustering, arguments) }, Cv.prototype.getBaseEdge = function () { return this.clustering.getBaseEdge.apply(this.clustering, arguments) }, Cv.prototype.getBaseEdges = function () { return this.clustering.getBaseEdges.apply(this.clustering, arguments) }, Cv.prototype.updateEdge = function () { return this.clustering.updateEdge.apply(this.clustering, arguments) }, Cv.prototype.clusterOutliers = function () { return this.clustering.clusterOutliers.apply(this.clustering, arguments) }, Cv.prototype.getSeed = function () { return this.layoutEngine.getSeed.apply(this.layoutEngine, arguments) }, Cv.prototype.enableEditMode = function () { return this.manipulation.enableEditMode.apply(this.manipulation, arguments) }, Cv.prototype.disableEditMode = function () { return this.manipulation.disableEditMode.apply(this.manipulation, arguments) }, Cv.prototype.addNodeMode = function () { return this.manipulation.addNodeMode.apply(this.manipulation, arguments) }, Cv.prototype.editNode = function () { return this.manipulation.editNode.apply(this.manipulation, arguments) }, Cv.prototype.editNodeMode = function () { return console.warn("Deprecated: Please use editNode instead of editNodeMode."), this.manipulation.editNode.apply(this.manipulation, arguments) }, Cv.prototype.addEdgeMode = function () { return this.manipulation.addEdgeMode.apply(this.manipulation, arguments) }, Cv.prototype.editEdgeMode = function () { return this.manipulation.editEdgeMode.apply(this.manipulation, arguments) }, Cv.prototype.deleteSelected = function () { return this.manipulation.deleteSelected.apply(this.manipulation, arguments) }, Cv.prototype.getPositions = function () { return this.nodesHandler.getPositions.apply(this.nodesHandler, arguments) }, Cv.prototype.getPosition = function () { return this.nodesHandler.getPosition.apply(this.nodesHandler, arguments) }, Cv.prototype.storePositions = function () { return this.nodesHandler.storePositions.apply(this.nodesHandler, arguments) }, Cv.prototype.moveNode = function () { return this.nodesHandler.moveNode.apply(this.nodesHandler, arguments) }, Cv.prototype.getBoundingBox = function () { return this.nodesHandler.getBoundingBox.apply(this.nodesHandler, arguments) }, Cv.prototype.getConnectedNodes = function (t) { return void 0 !== this.body.nodes[t] ? this.nodesHandler.getConnectedNodes.apply(this.nodesHandler, arguments) : this.edgesHandler.getConnectedNodes.apply(this.edgesHandler, arguments) }, Cv.prototype.getConnectedEdges = function () { return this.nodesHandler.getConnectedEdges.apply(this.nodesHandler, arguments) }, Cv.prototype.startSimulation = function () { return this.physics.startSimulation.apply(this.physics, arguments) }, Cv.prototype.stopSimulation = function () { return this.physics.stopSimulation.apply(this.physics, arguments) }, Cv.prototype.stabilize = function () { return this.physics.stabilize.apply(this.physics, arguments) }, Cv.prototype.getSelection = function () { return this.selectionHandler.getSelection.apply(this.selectionHandler, arguments) }, Cv.prototype.setSelection = function () { return this.selectionHandler.setSelection.apply(this.selectionHandler, arguments) }, Cv.prototype.getSelectedNodes = function () { return this.selectionHandler.getSelectedNodeIds.apply(this.selectionHandler, arguments) }, Cv.prototype.getSelectedEdges = function () { return this.selectionHandler.getSelectedEdgeIds.apply(this.selectionHandler, arguments) }, Cv.prototype.getNodeAt = function () { var t = this.selectionHandler.getNodeAt.apply(this.selectionHandler, arguments); return void 0 !== t && void 0 !== t.id ? t.id : t }, Cv.prototype.getEdgeAt = function () { var t = this.selectionHandler.getEdgeAt.apply(this.selectionHandler, arguments); return void 0 !== t && void 0 !== t.id ? t.id : t }, Cv.prototype.selectNodes = function () { return this.selectionHandler.selectNodes.apply(this.selectionHandler, arguments) }, Cv.prototype.selectEdges = function () { return this.selectionHandler.selectEdges.apply(this.selectionHandler, arguments) }, Cv.prototype.unselectAll = function () { this.selectionHandler.unselectAll.apply(this.selectionHandler, arguments), this.redraw() }, Cv.prototype.redraw = function () { return this.renderer.redraw.apply(this.renderer, arguments) }, Cv.prototype.getScale = function () { return this.view.getScale.apply(this.view, arguments) }, Cv.prototype.getViewPosition = function () { return this.view.getViewPosition.apply(this.view, arguments) }, Cv.prototype.fit = function () { return this.view.fit.apply(this.view, arguments) }, Cv.prototype.moveTo = function () { return this.view.moveTo.apply(this.view, arguments) }, Cv.prototype.focus = function () { return this.view.focus.apply(this.view, arguments) }, Cv.prototype.releaseNode = function () { return this.view.releaseNode.apply(this.view, arguments) }, Cv.prototype.getOptionsFromConfigurator = function () { var t = {}; return this.configurator && (t = this.configurator.getOptions.apply(this.configurator)), t }; var Pv = Object.freeze({ __proto__: null, prepareElements: Tv, cleanupElements: Dv, resetElements: function (t) { Tv(t), Dv(t), Tv(t) }, getSVGElement: Mv, getDOMElement: function (t, e, i, n) { var o; return Object.prototype.hasOwnProperty.call(e, t) ? e[t].redundant.length > 0 ? (o = e[t].redundant[0], e[t].redundant.shift()) : (o = document.createElement(t), void 0 !== n ? i.insertBefore(o, n) : i.appendChild(o)) : (o = document.createElement(t), e[t] = { used: [], redundant: [] }, void 0 !== n ? i.insertBefore(o, n) : i.appendChild(o)), e[t].used.push(o), o }, drawPoint: function (t, e, i, n, o, r) { var s; if ("circle" == i.style ? ((s = Mv("circle", n, o)).setAttributeNS(null, "cx", t), s.setAttributeNS(null, "cy", e), s.setAttributeNS(null, "r", .5 * i.size)) : ((s = Mv("rect", n, o)).setAttributeNS(null, "x", t - .5 * i.size), s.setAttributeNS(null, "y", e - .5 * i.size), s.setAttributeNS(null, "width", i.size), s.setAttributeNS(null, "height", i.size)), void 0 !== i.styles && s.setAttributeNS(null, "style", i.styles), s.setAttributeNS(null, "class", i.className + " vis-point"), r) { var a = Mv("text", n, o); r.xOffset && (t += r.xOffset), r.yOffset && (e += r.yOffset), r.content && (a.textContent = r.content), r.className && a.setAttributeNS(null, "class", r.className + " vis-label"), a.setAttributeNS(null, "x", t), a.setAttributeNS(null, "y", e) } return s }, drawBar: function (t, e, i, n, o, r, s, a) { if (0 != n) { n < 0 && (e -= n *= -1); var h = Mv("rect", r, s); h.setAttributeNS(null, "x", t - .5 * i), h.setAttributeNS(null, "y", e), h.setAttributeNS(null, "width", i), h.setAttributeNS(null, "height", n), h.setAttributeNS(null, "class", o), a && h.setAttributeNS(null, "style", a) } } }), Iv = { Images: Tl, dotparser: Ca, gephiParser: Da, allOptions: Ev, convertDot: Sa, convertGephi: Ta }, Bv = Object.freeze({ __proto__: null, network: Iv, DOMutil: Pv, util: Ts, data: zc, Hammer: kl, keycharm: Pa, DataSet: Mc, DataView: Pc, Queue: Cc, Network: Cv }); t.DOMutil = Pv, t.DataSet = Mc, t.DataView = Pc, t.Hammer = kl, t.Network = Cv, t.Queue = Cc, t.data = zc, t.default = Bv, t.keycharm = Pa, t.network = Iv, t.util = Ts, Object.defineProperty(t, "__esModule", { value: !0 })
}));
</script>
<!-- #endregion vis.js -->
<script type="text/javascript">
var source = {
"Projects": [
{
"Id": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"Name": "Stanwagon.ContentEngine"
},
{
"Id": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj",
"Name": "Stanwagon.ContentEngine.All"
},
{
"Id": "Stanwagon.ContentEngine.Configuration.Provider\\Stanwagon.ContentEngine.Configuration.Provider.csproj",
"Name": "Stanwagon.ContentEngine.Configuration.Provider"
},
{
"Id": "Stanwagon.ContentEngine.ArtistCatalog\\Stanwagon.ContentEngine.ArtistCatalog.csproj",
"Name": "Stanwagon.ContentEngine.ArtistCatalog"
},
{
"Id": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"Name": "Stanwagon.ContentEngine.Newsroom"
},
{
"Id": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"Name": "Stanwagon.ContentEngine.Official"
},
{
"Id": "Stanwagon.ContentEngine.Aggregation\\Stanwagon.ContentEngine.Aggregation.csproj",
"Name": "Stanwagon.ContentEngine.Aggregation"
},
{
"Id": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj",
"Name": "Stanwagon.ContentEngine.Common"
},
{
"Id": "Stanwagon.ContentEngine.Newsroom.Models\\Stanwagon.ContentEngine.Newsroom.Models.csproj",
"Name": "Stanwagon.ContentEngine.Newsroom.Models"
},
{
"Id": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj",
"Name": "Stanwagon.ContentEngine.Notices"
},
{
"Id": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj",
"Name": "Stanwagon.ContentEngine.Official.Models"
},
{
"Id": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj",
"Name": "Stanwagon.ContentEngine.PublicFeeds"
},
{
"Id": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj",
"Name": "Stanwagon.ContentEngine.Configuration.Shared"
},
{
"Id": "Stanwagon.ContentEngine.AzTableCopy\\Stanwagon.ContentEngine.AzTableCopy.csproj",
"Name": "Stanwagon.ContentEngine.AzTableCopy"
},
{
"Id": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj",
"Name": "Stanwagon.ContentEngine.TableStorage"
},
{
"Id": "Stanwagon.ContentEngine.Configuration\\Stanwagon.ContentEngine.Configuration.csproj",
"Name": "Stanwagon.ContentEngine.Configuration"
},
{
"Id": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj",
"Name": "Stanwagon.ContentEngine.YouTube"
},
{
"Id": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj",
"Name": "Stanwagon.ContentEngine.Crawling"
},
{
"Id": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj",
"Name": "Stanwagon.ContentEngine.Http"
},
{
"Id": "Stanwagon.ContentEngine.ExecutionManagement\\Stanwagon.ContentEngine.ExecutionManagement.csproj",
"Name": "Stanwagon.ContentEngine.ExecutionManagement"
},
{
"Id": "Stanwagon.ContentEngine.Metrics\\Stanwagon.ContentEngine.Metrics.csproj",
"Name": "Stanwagon.ContentEngine.Metrics"
},
{
"Id": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"Name": "Stanwagon.ContentEngine.ImageProcessing"
}
],
"Packages": [
{
"Id": "OpenGraph-Net",
"Name": "OpenGraph-Net"
},
{
"Id": "System.Configuration.ConfigurationManager",
"Name": "System.Configuration.ConfigurationManager"
},
{
"Id": "PowerArgs",
"Name": "PowerArgs"
},
{
"Id": "HtmlAgilityPack",
"Name": "HtmlAgilityPack"
},
{
"Id": "Magick.NET-Q8-AnyCPU",
"Name": "Magick.NET-Q8-AnyCPU"
},
{
"Id": "Azure.Storage.Blobs",
"Name": "Azure.Storage.Blobs"
},
{
"Id": "Newtonsoft.Json",
"Name": "Newtonsoft.Json"
}
],
"References": [
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "Stanwagon.ContentEngine.Configuration.Provider\\Stanwagon.ContentEngine.Configuration.Provider.csproj"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "Stanwagon.ContentEngine.ArtistCatalog\\Stanwagon.ContentEngine.ArtistCatalog.csproj"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "OpenGraph-Net"
},
{
"From": "Stanwagon.ContentEngine\\Stanwagon.ContentEngine.csproj",
"To": "System.Configuration.ConfigurationManager"
},
{
"From": "Stanwagon.ContentEngine.Aggregation\\Stanwagon.ContentEngine.Aggregation.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj",
"To": "Stanwagon.ContentEngine.Newsroom.Models\\Stanwagon.ContentEngine.Newsroom.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj",
"To": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj"
},
{
"From": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj",
"To": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.All\\Stanwagon.ContentEngine.All.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.ArtistCatalog\\Stanwagon.ContentEngine.ArtistCatalog.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.ArtistCatalog\\Stanwagon.ContentEngine.ArtistCatalog.csproj",
"To": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj"
},
{
"From": "Stanwagon.ContentEngine.ArtistCatalog\\Stanwagon.ContentEngine.ArtistCatalog.csproj",
"To": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj"
},
{
"From": "Stanwagon.ContentEngine.AzTableCopy\\Stanwagon.ContentEngine.AzTableCopy.csproj",
"To": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj"
},
{
"From": "Stanwagon.ContentEngine.AzTableCopy\\Stanwagon.ContentEngine.AzTableCopy.csproj",
"To": "PowerArgs"
},
{
"From": "Stanwagon.ContentEngine.Configuration\\Stanwagon.ContentEngine.Configuration.csproj",
"To": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration\\Stanwagon.ContentEngine.Configuration.csproj",
"To": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration\\Stanwagon.ContentEngine.Configuration.csproj",
"To": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration\\Stanwagon.ContentEngine.Configuration.csproj",
"To": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration.Provider\\Stanwagon.ContentEngine.Configuration.Provider.csproj",
"To": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj",
"To": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj"
},
{
"From": "Stanwagon.ContentEngine.Configuration.Shared\\Stanwagon.ContentEngine.Configuration.Shared.csproj",
"To": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj"
},
{
"From": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj",
"To": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj"
},
{
"From": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj",
"To": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj"
},
{
"From": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj",
"To": "HtmlAgilityPack"
},
{
"From": "Stanwagon.ContentEngine.ExecutionManagement\\Stanwagon.ContentEngine.ExecutionManagement.csproj",
"To": "Stanwagon.ContentEngine.Metrics\\Stanwagon.ContentEngine.Metrics.csproj"
},
{
"From": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj",
"To": "Stanwagon.ContentEngine.Metrics\\Stanwagon.ContentEngine.Metrics.csproj"
},
{
"From": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Stanwagon.ContentEngine.ExecutionManagement\\Stanwagon.ContentEngine.ExecutionManagement.csproj"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Stanwagon.ContentEngine.Metrics\\Stanwagon.ContentEngine.Metrics.csproj"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Magick.NET-Q8-AnyCPU"
},
{
"From": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj",
"To": "Azure.Storage.Blobs"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.Aggregation\\Stanwagon.ContentEngine.Aggregation.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.Newsroom.Models\\Stanwagon.ContentEngine.Newsroom.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.Newsroom\\Stanwagon.ContentEngine.Newsroom.csproj",
"To": "OpenGraph-Net"
},
{
"From": "Stanwagon.ContentEngine.Newsroom.Models\\Stanwagon.ContentEngine.Newsroom.Models.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj",
"To": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.Crawling\\Stanwagon.ContentEngine.Crawling.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.Aggregation\\Stanwagon.ContentEngine.Aggregation.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.ImageProcessing\\Stanwagon.ContentEngine.ImageProcessing.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.Notices\\Stanwagon.ContentEngine.Notices.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official\\Stanwagon.ContentEngine.Official.csproj",
"To": "Stanwagon.ContentEngine.Newsroom.Models\\Stanwagon.ContentEngine.Newsroom.Models.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj",
"To": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj"
},
{
"From": "Stanwagon.ContentEngine.Official.Models\\Stanwagon.ContentEngine.Official.Models.csproj",
"To": "Stanwagon.ContentEngine.Aggregation\\Stanwagon.ContentEngine.Aggregation.csproj"
},
{
"From": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj",
"To": "Azure.Storage.Blobs"
},
{
"From": "Stanwagon.ContentEngine.PublicFeeds\\Stanwagon.ContentEngine.PublicFeeds.csproj",
"To": "Newtonsoft.Json"
},
{
"From": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj",
"To": "Newtonsoft.Json"
},
{
"From": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj",
"To": "Stanwagon.ContentEngine.ExecutionManagement\\Stanwagon.ContentEngine.ExecutionManagement.csproj"
},
{
"From": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj",
"To": "Stanwagon.ContentEngine.TableStorage\\Stanwagon.ContentEngine.TableStorage.csproj"
},
{
"From": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj",
"To": "Stanwagon.ContentEngine.Common\\Stanwagon.ContentEngine.Common.csproj"
},
{
"From": "Stanwagon.ContentEngine.YouTube\\Stanwagon.ContentEngine.YouTube.csproj",
"To": "Stanwagon.ContentEngine.Http\\Stanwagon.ContentEngine.Http.csproj"
}
]
};
var nodes = [];
var isDark = false;
try {
isDark = window.matchMedia('(prefers-color-scheme: dark)');
} catch { }
var nodeFont = { color: isDark ? '#ddd': 'black'};
for (let index = 0; index < source.Projects.length; index++) {
const project = source.Projects[index];
var node = {
id: project.Id,
label: project.Name,
font: nodeFont,
type: 'project',
color: isDark ? '#009911' : '#00cc22',
};
nodes.push(node);
}
for (let index = 0; index < source.Packages.length; index++) {
const package = source.Packages[index];
var node = {
id: package.Id,
label: package.Name,
font: nodeFont,
type: 'package',
color: "#22aaee",
};
nodes.push(node);
}
var edges = [];
for (let index = 0; index < source.References.length; index++) {
const reference = source.References[index];
var edge = {
from: reference.From,
to: reference.To,
arrows: 'to',
smooth: { type: 'cubicBezier' },
};
edges.push(edge);
}
var container = document.getElementById("mynetwork");
var data = {
nodes: nodes,
edges: edges,
};
var options = {
edges: {
},
nodes: {
shape: "box",
font: {size:30}
},
physics: {
barnesHut: {
avoidOverlap: 0.6,
centralGravity: 0,
springConstant: 0,
gravitationalConstant: -1000
},
stabilization: {
enabled: false,
},
timestep: 1,
adaptiveTimestep:true
}
};
var network = new vis.Network(container, data, options);
setTimeout(() => {
network.setOptions({ physics: false });
console.log('physics stopped');
}, 2000)
</script>
</body>
</html>