@linkurious/ogma-annotations-react 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import Er, { createContext as _r, useContext as zr, useReducer as Nr, useState as zt, useEffect as Je } from "react";
2
- import { useOgma as Hr } from "@linkurious/ogma-react";
3
- var er = { exports: {} }, ae = {};
1
+ import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
2
+ import { useOgma as Xr } from "@linkurious/ogma-react";
3
+ var or = { exports: {} }, ue = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -10,25 +10,25 @@ var er = { exports: {} }, ae = {};
10
10
  * This source code is licensed under the MIT license found in the
11
11
  * LICENSE file in the root directory of this source tree.
12
12
  */
13
- var hr;
14
- function Br() {
15
- if (hr)
16
- return ae;
17
- hr = 1;
18
- var p = Er, e = Symbol.for("react.element"), a = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, h = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function g(m, f, s) {
20
- var d, A = {}, _ = null, R = null;
21
- s !== void 0 && (_ = "" + s), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (R = f.ref);
22
- for (d in f)
23
- i.call(f, d) && !c.hasOwnProperty(d) && (A[d] = f[d]);
24
- if (m && m.defaultProps)
25
- for (d in f = m.defaultProps, f)
26
- A[d] === void 0 && (A[d] = f[d]);
27
- return { $$typeof: e, type: m, key: _, ref: R, props: A, _owner: h.current };
28
- }
29
- return ae.Fragment = a, ae.jsx = g, ae.jsxs = g, ae;
13
+ var dr;
14
+ function Gr() {
15
+ if (dr)
16
+ return ue;
17
+ dr = 1;
18
+ var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function f(p, d, v) {
20
+ var y, _ = {}, C = null, E = null;
21
+ v !== void 0 && (C = "" + v), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (E = d.ref);
22
+ for (y in d)
23
+ i.call(d, y) && !c.hasOwnProperty(y) && (_[y] = d[y]);
24
+ if (p && p.defaultProps)
25
+ for (y in d = p.defaultProps, d)
26
+ _[y] === void 0 && (_[y] = d[y]);
27
+ return { $$typeof: e, type: p, key: C, ref: E, props: _, _owner: l.current };
28
+ }
29
+ return ue.Fragment = s, ue.jsx = f, ue.jsxs = f, ue;
30
30
  }
31
- var le = {};
31
+ var ce = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -38,91 +38,91 @@ var le = {};
38
38
  * This source code is licensed under the MIT license found in the
39
39
  * LICENSE file in the root directory of this source tree.
40
40
  */
41
- var ur;
42
- function Ur() {
43
- return ur || (ur = 1, process.env.NODE_ENV !== "production" && function() {
44
- var p = Er, e = Symbol.for("react.element"), a = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), h = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), m = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), s = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), P = Symbol.iterator, E = "@@iterator";
45
- function M(t) {
41
+ var fr;
42
+ function Jr() {
43
+ return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), p = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), P = Symbol.iterator, S = "@@iterator";
45
+ function $(t) {
46
46
  if (t === null || typeof t != "object")
47
47
  return null;
48
- var o = P && t[P] || t[E];
48
+ var o = P && t[P] || t[S];
49
49
  return typeof o == "function" ? o : null;
50
50
  }
51
- var j = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function k(t) {
51
+ var L = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function T(t) {
53
53
  {
54
- for (var o = arguments.length, u = new Array(o > 1 ? o - 1 : 0), y = 1; y < o; y++)
55
- u[y - 1] = arguments[y];
56
- N("error", t, u);
54
+ for (var o = arguments.length, u = new Array(o > 1 ? o - 1 : 0), g = 1; g < o; g++)
55
+ u[g - 1] = arguments[g];
56
+ B("error", t, u);
57
57
  }
58
58
  }
59
- function N(t, o, u) {
59
+ function B(t, o, u) {
60
60
  {
61
- var y = j.ReactDebugCurrentFrame, v = y.getStackAddendum();
62
- v !== "" && (o += "%s", u = u.concat([v]));
61
+ var g = L.ReactDebugCurrentFrame, m = g.getStackAddendum();
62
+ m !== "" && (o += "%s", u = u.concat([m]));
63
63
  var w = u.map(function(b) {
64
64
  return String(b);
65
65
  });
66
66
  w.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, w);
67
67
  }
68
68
  }
69
- var H = !1, st = !1, xt = !1, Ut = !1, Wt = !1, fe;
70
- fe = Symbol.for("react.module.reference");
71
- function Rt(t) {
72
- return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Wt || t === h || t === s || t === d || Ut || t === R || H || st || xt || typeof t == "object" && t !== null && (t.$$typeof === _ || t.$$typeof === A || t.$$typeof === g || t.$$typeof === m || t.$$typeof === f || // This needs to include all possible module reference object
69
+ var N = !1, it = !1, xt = !1, qt = !1, Yt = !1, pe;
70
+ pe = Symbol.for("react.module.reference");
71
+ function Ot(t) {
72
+ return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === v || t === y || qt || t === E || N || it || xt || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === _ || t.$$typeof === f || t.$$typeof === p || t.$$typeof === d || // This needs to include all possible module reference object
73
73
  // types supported by any Flight configuration anywhere since
74
74
  // we don't know which Flight build this will end up being used
75
75
  // with.
76
- t.$$typeof === fe || t.getModuleId !== void 0));
76
+ t.$$typeof === pe || t.getModuleId !== void 0));
77
77
  }
78
- function Ct(t, o, u) {
79
- var y = t.displayName;
80
- if (y)
81
- return y;
82
- var v = o.displayName || o.name || "";
83
- return v !== "" ? u + "(" + v + ")" : u;
78
+ function Pt(t, o, u) {
79
+ var g = t.displayName;
80
+ if (g)
81
+ return g;
82
+ var m = o.displayName || o.name || "";
83
+ return m !== "" ? u + "(" + m + ")" : u;
84
84
  }
85
- function Yt(t) {
85
+ function Xt(t) {
86
86
  return t.displayName || "Context";
87
87
  }
88
- function et(t) {
88
+ function tt(t) {
89
89
  if (t == null)
90
90
  return null;
91
- if (typeof t.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
91
+ if (typeof t.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
92
92
  return t.displayName || t.name || null;
93
93
  if (typeof t == "string")
94
94
  return t;
95
95
  switch (t) {
96
96
  case i:
97
97
  return "Fragment";
98
- case a:
98
+ case s:
99
99
  return "Portal";
100
100
  case c:
101
101
  return "Profiler";
102
- case h:
102
+ case l:
103
103
  return "StrictMode";
104
- case s:
104
+ case v:
105
105
  return "Suspense";
106
- case d:
106
+ case y:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof t == "object")
110
110
  switch (t.$$typeof) {
111
- case m:
111
+ case p:
112
112
  var o = t;
113
- return Yt(o) + ".Consumer";
114
- case g:
115
- var u = t;
116
- return Yt(u._context) + ".Provider";
113
+ return Xt(o) + ".Consumer";
117
114
  case f:
118
- return Ct(t, t.render, "ForwardRef");
119
- case A:
120
- var y = t.displayName || null;
121
- return y !== null ? y : et(t.type) || "Memo";
122
- case _: {
123
- var v = t, w = v._payload, b = v._init;
115
+ var u = t;
116
+ return Xt(u._context) + ".Provider";
117
+ case d:
118
+ return Pt(t, t.render, "ForwardRef");
119
+ case _:
120
+ var g = t.displayName || null;
121
+ return g !== null ? g : tt(t.type) || "Memo";
122
+ case C: {
123
+ var m = t, w = m._payload, b = m._init;
124
124
  try {
125
- return et(b(w));
125
+ return tt(b(w));
126
126
  } catch {
127
127
  return null;
128
128
  }
@@ -130,18 +130,18 @@ function Ur() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var F = Object.assign, at = 0, Z, ht, Pt, de, Vt, pe, ge;
134
- function St() {
133
+ var D = Object.assign, at = 0, X, ht, Rt, ye, Gt, ve, me;
134
+ function At() {
135
135
  }
136
- St.__reactDisabledLog = !0;
137
- function ye() {
136
+ At.__reactDisabledLog = !0;
137
+ function be() {
138
138
  {
139
139
  if (at === 0) {
140
- Z = console.log, ht = console.info, Pt = console.warn, de = console.error, Vt = console.group, pe = console.groupCollapsed, ge = console.groupEnd;
140
+ X = console.log, ht = console.info, Rt = console.warn, ye = console.error, Gt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
141
141
  var t = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
144
- value: St,
144
+ value: At,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -157,7 +157,7 @@ function Ur() {
157
157
  at++;
158
158
  }
159
159
  }
160
- function De() {
160
+ function Ne() {
161
161
  {
162
162
  if (at--, at === 0) {
163
163
  var t = {
@@ -166,65 +166,65 @@ function Ur() {
166
166
  writable: !0
167
167
  };
168
168
  Object.defineProperties(console, {
169
- log: F({}, t, {
170
- value: Z
169
+ log: D({}, t, {
170
+ value: X
171
171
  }),
172
- info: F({}, t, {
172
+ info: D({}, t, {
173
173
  value: ht
174
174
  }),
175
- warn: F({}, t, {
176
- value: Pt
175
+ warn: D({}, t, {
176
+ value: Rt
177
177
  }),
178
- error: F({}, t, {
179
- value: de
178
+ error: D({}, t, {
179
+ value: ye
180
180
  }),
181
- group: F({}, t, {
182
- value: Vt
181
+ group: D({}, t, {
182
+ value: Gt
183
183
  }),
184
- groupCollapsed: F({}, t, {
185
- value: pe
184
+ groupCollapsed: D({}, t, {
185
+ value: ve
186
186
  }),
187
- groupEnd: F({}, t, {
188
- value: ge
187
+ groupEnd: D({}, t, {
188
+ value: me
189
189
  })
190
190
  });
191
191
  }
192
- at < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
+ at < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var qt = j.ReactCurrentDispatcher, Xt;
195
+ var Jt = L.ReactCurrentDispatcher, Zt;
196
196
  function It(t, o, u) {
197
197
  {
198
- if (Xt === void 0)
198
+ if (Zt === void 0)
199
199
  try {
200
200
  throw Error();
201
- } catch (v) {
202
- var y = v.stack.trim().match(/\n( *(at )?)/);
203
- Xt = y && y[1] || "";
201
+ } catch (m) {
202
+ var g = m.stack.trim().match(/\n( *(at )?)/);
203
+ Zt = g && g[1] || "";
204
204
  }
205
205
  return `
206
- ` + Xt + t;
206
+ ` + Zt + t;
207
207
  }
208
208
  }
209
- var Zt = !1, At;
209
+ var Kt = !1, Et;
210
210
  {
211
- var Fe = typeof WeakMap == "function" ? WeakMap : Map;
212
- At = new Fe();
211
+ var Be = typeof WeakMap == "function" ? WeakMap : Map;
212
+ Et = new Be();
213
213
  }
214
- function Gt(t, o) {
215
- if (!t || Zt)
214
+ function Qt(t, o) {
215
+ if (!t || Kt)
216
216
  return "";
217
217
  {
218
- var u = At.get(t);
218
+ var u = Et.get(t);
219
219
  if (u !== void 0)
220
220
  return u;
221
221
  }
222
- var y;
223
- Zt = !0;
224
- var v = Error.prepareStackTrace;
222
+ var g;
223
+ Kt = !0;
224
+ var m = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
226
  var w;
227
- w = qt.current, qt.current = null, ye();
227
+ w = Jt.current, Jt.current = null, be();
228
228
  try {
229
229
  if (o) {
230
230
  var b = function() {
@@ -237,171 +237,171 @@ function Ur() {
237
237
  }), typeof Reflect == "object" && Reflect.construct) {
238
238
  try {
239
239
  Reflect.construct(b, []);
240
- } catch (O) {
241
- y = O;
240
+ } catch (I) {
241
+ g = I;
242
242
  }
243
243
  Reflect.construct(t, [], b);
244
244
  } else {
245
245
  try {
246
246
  b.call();
247
- } catch (O) {
248
- y = O;
247
+ } catch (I) {
248
+ g = I;
249
249
  }
250
250
  t.call(b.prototype);
251
251
  }
252
252
  } else {
253
253
  try {
254
254
  throw Error();
255
- } catch (O) {
256
- y = O;
255
+ } catch (I) {
256
+ g = I;
257
257
  }
258
258
  t();
259
259
  }
260
- } catch (O) {
261
- if (O && y && typeof O.stack == "string") {
262
- for (var S = O.stack.split(`
263
- `), I = y.stack.split(`
264
- `), T = S.length - 1, C = I.length - 1; T >= 1 && C >= 0 && S[T] !== I[C]; )
265
- C--;
266
- for (; T >= 1 && C >= 0; T--, C--)
267
- if (S[T] !== I[C]) {
268
- if (T !== 1 || C !== 1)
260
+ } catch (I) {
261
+ if (I && g && typeof I.stack == "string") {
262
+ for (var A = I.stack.split(`
263
+ `), R = g.stack.split(`
264
+ `), k = A.length - 1, O = R.length - 1; k >= 1 && O >= 0 && A[k] !== R[O]; )
265
+ O--;
266
+ for (; k >= 1 && O >= 0; k--, O--)
267
+ if (A[k] !== R[O]) {
268
+ if (k !== 1 || O !== 1)
269
269
  do
270
- if (T--, C--, C < 0 || S[T] !== I[C]) {
271
- var D = `
272
- ` + S[T].replace(" at new ", " at ");
273
- return t.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", t.displayName)), typeof t == "function" && At.set(t, D), D;
270
+ if (k--, O--, O < 0 || A[k] !== R[O]) {
271
+ var j = `
272
+ ` + A[k].replace(" at new ", " at ");
273
+ return t.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", t.displayName)), typeof t == "function" && Et.set(t, j), j;
274
274
  }
275
- while (T >= 1 && C >= 0);
275
+ while (k >= 1 && O >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- Zt = !1, qt.current = w, De(), Error.prepareStackTrace = v;
280
+ Kt = !1, Jt.current = w, Ne(), Error.prepareStackTrace = m;
281
281
  }
282
- var U = t ? t.displayName || t.name : "", L = U ? It(U) : "";
283
- return typeof t == "function" && At.set(t, L), L;
282
+ var W = t ? t.displayName || t.name : "", M = W ? It(W) : "";
283
+ return typeof t == "function" && Et.set(t, M), M;
284
284
  }
285
- function Le(t, o, u) {
286
- return Gt(t, !1);
285
+ function He(t, o, u) {
286
+ return Qt(t, !1);
287
287
  }
288
- function ze(t) {
288
+ function We(t) {
289
289
  var o = t.prototype;
290
290
  return !!(o && o.isReactComponent);
291
291
  }
292
- function Ot(t, o, u) {
292
+ function Lt(t, o, u) {
293
293
  if (t == null)
294
294
  return "";
295
295
  if (typeof t == "function")
296
- return Gt(t, ze(t));
296
+ return Qt(t, We(t));
297
297
  if (typeof t == "string")
298
298
  return It(t);
299
299
  switch (t) {
300
- case s:
300
+ case v:
301
301
  return It("Suspense");
302
- case d:
302
+ case y:
303
303
  return It("SuspenseList");
304
304
  }
305
305
  if (typeof t == "object")
306
306
  switch (t.$$typeof) {
307
- case f:
308
- return Le(t.render);
309
- case A:
310
- return Ot(t.type, o, u);
311
- case _: {
312
- var y = t, v = y._payload, w = y._init;
307
+ case d:
308
+ return He(t.render);
309
+ case _:
310
+ return Lt(t.type, o, u);
311
+ case C: {
312
+ var g = t, m = g._payload, w = g._init;
313
313
  try {
314
- return Ot(w(v), o, u);
314
+ return Lt(w(m), o, u);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var Et = Object.prototype.hasOwnProperty, me = {}, ve = j.ReactDebugCurrentFrame;
322
- function jt(t) {
321
+ var _t = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
322
+ function Ft(t) {
323
323
  if (t) {
324
- var o = t._owner, u = Ot(t.type, t._source, o ? o.type : null);
325
- ve.setExtraStackFrame(u);
324
+ var o = t._owner, u = Lt(t.type, t._source, o ? o.type : null);
325
+ xe.setExtraStackFrame(u);
326
326
  } else
327
- ve.setExtraStackFrame(null);
327
+ xe.setExtraStackFrame(null);
328
328
  }
329
- function Ne(t, o, u, y, v) {
329
+ function Ue(t, o, u, g, m) {
330
330
  {
331
- var w = Function.call.bind(Et);
331
+ var w = Function.call.bind(_t);
332
332
  for (var b in t)
333
333
  if (w(t, b)) {
334
- var S = void 0;
334
+ var A = void 0;
335
335
  try {
336
336
  if (typeof t[b] != "function") {
337
- var I = Error((y || "React class") + ": " + u + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
- throw I.name = "Invariant Violation", I;
337
+ var R = Error((g || "React class") + ": " + u + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw R.name = "Invariant Violation", R;
339
339
  }
340
- S = t[b](o, b, y, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (T) {
342
- S = T;
340
+ A = t[b](o, b, g, u, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (k) {
342
+ A = k;
343
343
  }
344
- S && !(S instanceof Error) && (jt(v), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", y || "React class", u, b, typeof S), jt(null)), S instanceof Error && !(S.message in me) && (me[S.message] = !0, jt(v), k("Failed %s type: %s", u, S.message), jt(null));
344
+ A && !(A instanceof Error) && (Ft(m), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", g || "React class", u, b, typeof A), Ft(null)), A instanceof Error && !(A.message in we) && (we[A.message] = !0, Ft(m), T("Failed %s type: %s", u, A.message), Ft(null));
345
345
  }
346
346
  }
347
347
  }
348
- var He = Array.isArray;
349
- function Jt(t) {
350
- return He(t);
348
+ var Ve = Array.isArray;
349
+ function te(t) {
350
+ return Ve(t);
351
351
  }
352
- function B(t) {
352
+ function H(t) {
353
353
  {
354
354
  var o = typeof Symbol == "function" && Symbol.toStringTag, u = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
355
355
  return u;
356
356
  }
357
357
  }
358
- function Be(t) {
358
+ function qe(t) {
359
359
  try {
360
- return be(t), !1;
360
+ return Ae(t), !1;
361
361
  } catch {
362
362
  return !0;
363
363
  }
364
364
  }
365
- function be(t) {
365
+ function Ae(t) {
366
366
  return "" + t;
367
367
  }
368
- function Kt(t) {
369
- if (Be(t))
370
- return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", B(t)), be(t);
368
+ function ee(t) {
369
+ if (qe(t))
370
+ return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", H(t)), Ae(t);
371
371
  }
372
- var ot = j.ReactCurrentOwner, we = {
372
+ var ot = L.ReactCurrentOwner, Ee = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
376
376
  __source: !0
377
- }, $t, xe, Qt;
378
- Qt = {};
379
- function te(t) {
380
- if (Et.call(t, "ref")) {
377
+ }, $t, _e, re;
378
+ re = {};
379
+ function ne(t) {
380
+ if (_t.call(t, "ref")) {
381
381
  var o = Object.getOwnPropertyDescriptor(t, "ref").get;
382
382
  if (o && o.isReactWarning)
383
383
  return !1;
384
384
  }
385
385
  return t.ref !== void 0;
386
386
  }
387
- function Ue(t) {
388
- if (Et.call(t, "key")) {
387
+ function Ye(t) {
388
+ if (_t.call(t, "key")) {
389
389
  var o = Object.getOwnPropertyDescriptor(t, "key").get;
390
390
  if (o && o.isReactWarning)
391
391
  return !1;
392
392
  }
393
393
  return t.key !== void 0;
394
394
  }
395
- function We(t, o) {
395
+ function Xe(t, o) {
396
396
  if (typeof t.ref == "string" && ot.current && o && ot.current.stateNode !== o) {
397
- var u = et(ot.current.type);
398
- Qt[u] || (k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', et(ot.current.type), t.ref), Qt[u] = !0);
397
+ var u = tt(ot.current.type);
398
+ re[u] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), re[u] = !0);
399
399
  }
400
400
  }
401
- function Ye(t, o) {
401
+ function Ge(t, o) {
402
402
  {
403
403
  var u = function() {
404
- $t || ($t = !0, k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
404
+ $t || ($t = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
405
405
  };
406
406
  u.isReactWarning = !0, Object.defineProperty(t, "key", {
407
407
  get: u,
@@ -409,10 +409,10 @@ function Ur() {
409
409
  });
410
410
  }
411
411
  }
412
- function ee(t, o) {
412
+ function ie(t, o) {
413
413
  {
414
414
  var u = function() {
415
- xe || (xe = !0, k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
415
+ _e || (_e = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
416
416
  };
417
417
  u.isReactWarning = !0, Object.defineProperty(t, "ref", {
418
418
  get: u,
@@ -420,8 +420,8 @@ function Ur() {
420
420
  });
421
421
  }
422
422
  }
423
- var Se = function(t, o, u, y, v, w, b) {
424
- var S = {
423
+ var ke = function(t, o, u, g, m, w, b) {
424
+ var A = {
425
425
  // This tag allows us to uniquely identify this as a React Element
426
426
  $$typeof: e,
427
427
  // Built-in properties that belong on the element
@@ -432,58 +432,58 @@ function Ur() {
432
432
  // Record the component responsible for creating this element.
433
433
  _owner: w
434
434
  };
435
- return S._store = {}, Object.defineProperty(S._store, "validated", {
435
+ return A._store = {}, Object.defineProperty(A._store, "validated", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !0,
439
439
  value: !1
440
- }), Object.defineProperty(S, "_self", {
440
+ }), Object.defineProperty(A, "_self", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
- value: y
445
- }), Object.defineProperty(S, "_source", {
444
+ value: g
445
+ }), Object.defineProperty(A, "_source", {
446
446
  configurable: !1,
447
447
  enumerable: !1,
448
448
  writable: !1,
449
- value: v
450
- }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
449
+ value: m
450
+ }), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
451
451
  };
452
- function _t(t, o, u, y, v) {
452
+ function kt(t, o, u, g, m) {
453
453
  {
454
- var w, b = {}, S = null, I = null;
455
- u !== void 0 && (Kt(u), S = "" + u), Ue(o) && (Kt(o.key), S = "" + o.key), te(o) && (I = o.ref, We(o, v));
454
+ var w, b = {}, A = null, R = null;
455
+ u !== void 0 && (ee(u), A = "" + u), Ye(o) && (ee(o.key), A = "" + o.key), ne(o) && (R = o.ref, Xe(o, m));
456
456
  for (w in o)
457
- Et.call(o, w) && !we.hasOwnProperty(w) && (b[w] = o[w]);
457
+ _t.call(o, w) && !Ee.hasOwnProperty(w) && (b[w] = o[w]);
458
458
  if (t && t.defaultProps) {
459
- var T = t.defaultProps;
460
- for (w in T)
461
- b[w] === void 0 && (b[w] = T[w]);
459
+ var k = t.defaultProps;
460
+ for (w in k)
461
+ b[w] === void 0 && (b[w] = k[w]);
462
462
  }
463
- if (S || I) {
464
- var C = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
- S && Ye(b, C), I && ee(b, C);
463
+ if (A || R) {
464
+ var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
+ A && Ge(b, O), R && ie(b, O);
466
466
  }
467
- return Se(t, S, I, v, y, ot.current, b);
467
+ return ke(t, A, R, m, g, ot.current, b);
468
468
  }
469
469
  }
470
- var re = j.ReactCurrentOwner, Ae = j.ReactDebugCurrentFrame;
470
+ var oe = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
471
471
  function ut(t) {
472
472
  if (t) {
473
- var o = t._owner, u = Ot(t.type, t._source, o ? o.type : null);
474
- Ae.setExtraStackFrame(u);
473
+ var o = t._owner, u = Lt(t.type, t._source, o ? o.type : null);
474
+ Te.setExtraStackFrame(u);
475
475
  } else
476
- Ae.setExtraStackFrame(null);
476
+ Te.setExtraStackFrame(null);
477
477
  }
478
478
  var G;
479
479
  G = !1;
480
- function ft(t) {
480
+ function dt(t) {
481
481
  return typeof t == "object" && t !== null && t.$$typeof === e;
482
482
  }
483
- function Mt() {
483
+ function jt() {
484
484
  {
485
- if (re.current) {
486
- var t = et(re.current.type);
485
+ if (oe.current) {
486
+ var t = tt(oe.current.type);
487
487
  if (t)
488
488
  return `
489
489
 
@@ -492,7 +492,7 @@ Check the render method of \`` + t + "`.";
492
492
  return "";
493
493
  }
494
494
  }
495
- function Ve(t) {
495
+ function Je(t) {
496
496
  {
497
497
  if (t !== void 0) {
498
498
  var o = t.fileName.replace(/^.*[\\\/]/, ""), u = t.lineNumber;
@@ -503,10 +503,10 @@ Check your code at ` + o + ":" + u + ".";
503
503
  return "";
504
504
  }
505
505
  }
506
- var ne = {};
507
- function Ee(t) {
506
+ var se = {};
507
+ function Se(t) {
508
508
  {
509
- var o = Mt();
509
+ var o = jt();
510
510
  if (!o) {
511
511
  var u = typeof t == "string" ? t : t.displayName || t.name;
512
512
  u && (o = `
@@ -516,39 +516,39 @@ Check the top-level render call using <` + u + ">.");
516
516
  return o;
517
517
  }
518
518
  }
519
- function _e(t, o) {
519
+ function Ce(t, o) {
520
520
  {
521
521
  if (!t._store || t._store.validated || t.key != null)
522
522
  return;
523
523
  t._store.validated = !0;
524
- var u = Ee(o);
525
- if (ne[u])
524
+ var u = Se(o);
525
+ if (se[u])
526
526
  return;
527
- ne[u] = !0;
528
- var y = "";
529
- t && t._owner && t._owner !== re.current && (y = " It was passed a child from " + et(t._owner.type) + "."), ut(t), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, y), ut(null);
527
+ se[u] = !0;
528
+ var g = "";
529
+ t && t._owner && t._owner !== oe.current && (g = " It was passed a child from " + tt(t._owner.type) + "."), ut(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', u, g), ut(null);
530
530
  }
531
531
  }
532
532
  function Dt(t, o) {
533
533
  {
534
534
  if (typeof t != "object")
535
535
  return;
536
- if (Jt(t))
536
+ if (te(t))
537
537
  for (var u = 0; u < t.length; u++) {
538
- var y = t[u];
539
- ft(y) && _e(y, o);
538
+ var g = t[u];
539
+ dt(g) && Ce(g, o);
540
540
  }
541
- else if (ft(t))
541
+ else if (dt(t))
542
542
  t._store && (t._store.validated = !0);
543
543
  else if (t) {
544
- var v = M(t);
545
- if (typeof v == "function" && v !== t.entries)
546
- for (var w = v.call(t), b; !(b = w.next()).done; )
547
- ft(b.value) && _e(b.value, o);
544
+ var m = $(t);
545
+ if (typeof m == "function" && m !== t.entries)
546
+ for (var w = m.call(t), b; !(b = w.next()).done; )
547
+ dt(b.value) && Ce(b.value, o);
548
548
  }
549
549
  }
550
550
  }
551
- function qe(t) {
551
+ function Ze(t) {
552
552
  {
553
553
  var o = t.type;
554
554
  if (o == null || typeof o == "string")
@@ -556,574 +556,91 @@ Check the top-level render call using <` + u + ">.");
556
556
  var u;
557
557
  if (typeof o == "function")
558
558
  u = o.propTypes;
559
- else if (typeof o == "object" && (o.$$typeof === f || // Note: Memo only checks outer props here.
559
+ else if (typeof o == "object" && (o.$$typeof === d || // Note: Memo only checks outer props here.
560
560
  // Inner props are checked in the reconciler.
561
- o.$$typeof === A))
561
+ o.$$typeof === _))
562
562
  u = o.propTypes;
563
563
  else
564
564
  return;
565
565
  if (u) {
566
- var y = et(o);
567
- Ne(u, t.props, "prop", y, t);
566
+ var g = tt(o);
567
+ Ue(u, t.props, "prop", g, t);
568
568
  } else if (o.PropTypes !== void 0 && !G) {
569
569
  G = !0;
570
- var v = et(o);
571
- k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", v || "Unknown");
570
+ var m = tt(o);
571
+ T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
572
572
  }
573
- typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
+ typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
574
  }
575
575
  }
576
- function ke(t) {
576
+ function Oe(t) {
577
577
  {
578
578
  for (var o = Object.keys(t.props), u = 0; u < o.length; u++) {
579
- var y = o[u];
580
- if (y !== "children" && y !== "key") {
581
- ut(t), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), ut(null);
579
+ var g = o[u];
580
+ if (g !== "children" && g !== "key") {
581
+ ut(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", g), ut(null);
582
582
  break;
583
583
  }
584
584
  }
585
- t.ref !== null && (ut(t), k("Invalid attribute `ref` supplied to `React.Fragment`."), ut(null));
585
+ t.ref !== null && (ut(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), ut(null));
586
586
  }
587
587
  }
588
- function ie(t, o, u, y, v, w) {
588
+ function ae(t, o, u, g, m, w) {
589
589
  {
590
- var b = Rt(t);
590
+ var b = Ot(t);
591
591
  if (!b) {
592
- var S = "";
593
- (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
- var I = Ve(v);
595
- I ? S += I : S += Mt();
596
- var T;
597
- t === null ? T = "null" : Jt(t) ? T = "array" : t !== void 0 && t.$$typeof === e ? (T = "<" + (et(t.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : T = typeof t, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, S);
592
+ var A = "";
593
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
+ var R = Je(m);
595
+ R ? A += R : A += jt();
596
+ var k;
597
+ t === null ? k = "null" : te(t) ? k = "array" : t !== void 0 && t.$$typeof === e ? (k = "<" + (tt(t.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : k = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, A);
598
598
  }
599
- var C = _t(t, o, u, v, w);
600
- if (C == null)
601
- return C;
599
+ var O = kt(t, o, u, m, w);
600
+ if (O == null)
601
+ return O;
602
602
  if (b) {
603
- var D = o.children;
604
- if (D !== void 0)
605
- if (y)
606
- if (Jt(D)) {
607
- for (var U = 0; U < D.length; U++)
608
- Dt(D[U], t);
609
- Object.freeze && Object.freeze(D);
603
+ var j = o.children;
604
+ if (j !== void 0)
605
+ if (g)
606
+ if (te(j)) {
607
+ for (var W = 0; W < j.length; W++)
608
+ Dt(j[W], t);
609
+ Object.freeze && Object.freeze(j);
610
610
  } else
611
- k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
611
+ T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
612
  else
613
- Dt(D, t);
613
+ Dt(j, t);
614
614
  }
615
- return t === i ? ke(C) : qe(C), C;
615
+ return t === i ? Oe(O) : Ze(O), O;
616
616
  }
617
617
  }
618
- function Xe(t, o, u) {
619
- return ie(t, o, u, !0);
618
+ function Ke(t, o, u) {
619
+ return ae(t, o, u, !0);
620
620
  }
621
621
  function r(t, o, u) {
622
- return ie(t, o, u, !1);
622
+ return ae(t, o, u, !1);
623
623
  }
624
- var n = r, l = Xe;
625
- le.Fragment = i, le.jsx = n, le.jsxs = l;
626
- }()), le;
627
- }
628
- process.env.NODE_ENV === "production" ? er.exports = Br() : er.exports = Ur();
629
- var Wr = er.exports, Yr = Object.defineProperty, Vr = (p, e, a) => e in p ? Yr(p, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : p[e] = a, x = (p, e, a) => (Vr(p, typeof e != "symbol" ? e + "" : e, a), a), qr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
630
- function lr(p) {
631
- return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
624
+ var n = r, a = Ke;
625
+ ce.Fragment = i, ce.jsx = n, ce.jsxs = a;
626
+ }()), ce;
632
627
  }
633
- var kr = { exports: {} };
634
- (function(p) {
635
- (function(e, a) {
636
- p.exports = a();
637
- })("Vector", function() {
638
- var e = function() {
639
- var a = Math.PI * 2, i = 180 / Math.PI, h = Math.PI / 180;
640
- function c(s) {
641
- return Math.round(s * 1e8) / 1e8;
642
- }
643
- function g(s, d) {
644
- var A = d.x - s.x, _ = d.y - s.y;
645
- return Math.sqrt(A * A + _ * _);
646
- }
647
- function m(s, d, A) {
648
- var _ = d.y - s.y, R = d.x - s.x, P = Math.atan2(_, R);
649
- if (A)
650
- for (; P < 0; )
651
- P += a;
652
- return P;
653
- }
654
- function f(s, d) {
655
- this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
656
- }
657
- return f.fromRadians = function(s) {
658
- var d = Math.cos(s), A = Math.sin(s);
659
- return new f(d, A);
660
- }, f.fromDegrees = function(s) {
661
- var d = s * (Math.PI / 180);
662
- return f.fromRadians(d);
663
- }, f.fromString = function(s) {
664
- var d = s.split(",");
665
- return new f(parseFloat(d[0]), parseFloat(d[1]));
666
- }, f.fromArray = function(s) {
667
- return new f(s[0], s[1]);
668
- }, f.prototype = {
669
- // version
670
- version: "2.0.1",
671
- // [API]
672
- // [chainable, clone]
673
- // clone the vector and return the cloned instance.
674
- // @return cloned vector.
675
- clone: function() {
676
- return new f(this.x, this.y);
677
- },
678
- // [API]
679
- // []
680
- // Get if equal to another vector
681
- // @param vector - other vector to compare with.
682
- // @return if vectors are equal.
683
- equals: function(s) {
684
- return this.prototype === s.prototype && this.x === s.x && this.y === s.y;
685
- },
686
- // [API]
687
- // [chainable, changeSelf]
688
- // set values from another vector. this changes value of self.
689
- // @param vector - other vector to get values from.
690
- // @return self.
691
- copy: function(s) {
692
- return this.x = s.x, this.y = s.y, this;
693
- },
694
- // [API]
695
- // [chainable, changeSelf]
696
- // set only the x component from another vector.
697
- // @return self.
698
- copyX: function(s) {
699
- return this.x = s.x, this;
700
- },
701
- // [API]
702
- // [chainable, changeSelf]
703
- // set only the y component from another vector.
704
- // @return self.
705
- copyY: function(s) {
706
- return this.y = s.y, this;
707
- },
708
- // [API]
709
- // []
710
- // convert to a dictionary with {x, y}.
711
- // @return a dictionary representation of the vector.
712
- toDict: function() {
713
- return { x: this.x, y: this.y };
714
- },
715
- // [API]
716
- // []
717
- // convert to array with [x, y].
718
- // @return an array representation of the vector.
719
- toArray: function() {
720
- return [this.x, this.y];
721
- },
722
- // [API]
723
- // [chainable, changeSelf]
724
- // set values from x, y.
725
- // @param x - optional x component to set.
726
- // @param y - optional y component to set.
727
- // @return self.
728
- set: function(s, d) {
729
- return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
730
- },
731
- // [API]
732
- // [chainable, clone]
733
- // clone and flip between x and y values.
734
- // @return cloned vector with flipped x and y components.
735
- flipXY: function() {
736
- return new f(this.y, this.x);
737
- },
738
- // [API]
739
- // [chainable, changeSelf]
740
- // flip between x and y values.
741
- // @return self.
742
- flipXYSelf: function() {
743
- return this.y = [this.x, this.x = this.y][0], this;
744
- },
745
- // [API]
746
- // [chainable, clone]
747
- // clone and invert x and y values (like multiply with -1, eg x, y => -x, -y)
748
- // @return cloned vector with inverted values.
749
- invert: function() {
750
- return this.mulScalar(-1);
751
- },
752
- // [API]
753
- // [chainable, changeSelf]
754
- // invert x and y values (like multiply with -1, eg x, y => -x, -y)
755
- // @return self.
756
- invertSelf: function() {
757
- return this.mulScalarSelf(-1), this;
758
- },
759
- // [API]
760
- // []
761
- // get the distance from another vector.
762
- // @param other - vector to get distance from.
763
- // @return distance between vectors.
764
- distanceFrom: function(s) {
765
- return g(this, s);
766
- },
767
- // [API]
768
- // []
769
- // get angle from another vector in radians.
770
- // @return angle in radians from this to other.
771
- radiansTo: function(s) {
772
- return m(this, s, !0);
773
- },
774
- // [API]
775
- // []
776
- // get degrees from another vector in degrees.
777
- // @return angle in degrees from this to other.
778
- degreesTo: function(s) {
779
- return m(this, s, !0) * i;
780
- },
781
- // [API]
782
- // []
783
- // convert this vector to a radian angle.
784
- // this is equivalent to doing Vector.zero.radiansTo(this).
785
- // @return angle in radians.
786
- toRadians: function(s) {
787
- return m(f.zero, this, !0);
788
- },
789
- // [API]
790
- // []
791
- // convert this vector to degree.
792
- // this is equivalent to doing Vector.zero.degreeTo(this).
793
- // @return angle in degrees (0-360).
794
- toDegrees: function(s) {
795
- return this.toRadians() * i;
796
- },
797
- // [API]
798
- // [chainable, changeSelf]
799
- // rotate this vector by a given degree.
800
- // @param degrees - degrees to rotate this vector by (can be positive or negative).
801
- // @return self.
802
- rotateDegreesSelf: function(s) {
803
- return this.rotateRadiansSelf(s * h);
804
- },
805
- // [API]
806
- // [chainable]
807
- // clone and rotate the vector by a given degree.
808
- // @param degrees - degree to rotate this vector by (can be positive or negative).
809
- // @return cloned rotated vector.
810
- rotateDegrees: function(s) {
811
- return this.clone().rotateDegreesSelf(s);
812
- },
813
- // [API]
814
- // [chainable, changeSelf]
815
- // rotate this vector by a given radian.
816
- // @param radians - radians to rotate this vector by (can be positive or negative).
817
- // @return self.
818
- rotateRadiansSelf: function(s) {
819
- var d = Math.cos(s), A = Math.sin(s), _ = this.x * d - this.y * A, R = this.x * A + this.y * d;
820
- return this.x = c(_), this.y = c(R), this;
821
- },
822
- // [API]
823
- // [chainable]
824
- // clone and rotate the vector by a given degree.
825
- // @param radians - radians to rotate this vector by (can be positive or negative).
826
- // @return cloned rotated vector.
827
- rotateRadians: function(s) {
828
- return this.clone().rotateRadiansSelf(s);
829
- },
830
- // [API]
831
- // []
832
- // calculate the length of this vector (aka magnitude).
833
- // @return vector length.
834
- length: function() {
835
- return Math.sqrt(this.x * this.x + this.y * this.y);
836
- },
837
- // [API]
838
- // [chainable, changeSelf]
839
- // normalize this vector, eg make length equal 1.
840
- // @return self.
841
- normalizeSelf: function() {
842
- var s = Math.sqrt(this.x * this.x + this.y * this.y);
843
- return s === 0 ? this : (this.x /= s, this.y /= s, this);
844
- },
845
- // [API]
846
- // [chainable, clone]
847
- // clone and normalize the vector.
848
- // @return normalized vector.
849
- normalize: function() {
850
- return this.clone().normalizeSelf();
851
- },
852
- // [API]
853
- // [chainable, changeSelf]
854
- // add other vector to self.
855
- // for example, v(10, 11) + v(5, 6) = v(15, 17).
856
- // @param other - vector to add components to self.
857
- // @return self.
858
- addSelf: function(s) {
859
- return typeof s == "number" ? this.addScalarSelf(s) : (this.x += s.x, this.y += s.y, this);
860
- },
861
- // [API]
862
- // [chainable, changeSelf]
863
- // subtract other vector from self.
864
- // for example, v(10, 10) - v(2, 3) = v(8, 7).
865
- // @param other - vector to subtract components from self.
866
- // @return self.
867
- subSelf: function(s) {
868
- return typeof s == "number" ? this.subScalarSelf(s) : (this.x -= s.x, this.y -= s.y, this);
869
- },
870
- // [API]
871
- // [chainable, changeSelf]
872
- // divide self by other vector.
873
- // for example, v(10, 20) / v(2, 5) = v(5, 4).
874
- // @param other - vector to divide components from self.
875
- // @return self.
876
- divSelf: function(s) {
877
- return typeof s == "number" ? this.divScalarSelf(s) : (this.x /= s.x, this.y /= s.y, this);
878
- },
879
- // [API]
880
- // [chainable, changeSelf]
881
- // multiply self vector by other vector.
882
- // for example, v(2, 3) * v(3, 4) = v(6, 12).
883
- // @param other - vector to multiply components with self.
884
- // @return self.
885
- mulSelf: function(s) {
886
- return typeof s == "number" ? this.mulScalarSelf(s) : (this.x *= s.x, this.y *= s.y, this);
887
- },
888
- // [API]
889
- // [chainable, changeSelf]
890
- // add scalar value to self.
891
- // for example, v(2, 3) + 5 = v(7, 8).
892
- // @param val - value to add to components.
893
- // @return self.
894
- addScalarSelf: function(s) {
895
- return this.x += s, this.y += s, this;
896
- },
897
- // [API]
898
- // [chainable, changeSelf]
899
- // subtract scalar from self.
900
- // for example, v(7, 9) - 5 = v(3, 4).
901
- // @param val - value to subtract from components.
902
- // @return self.
903
- subScalarSelf: function(s) {
904
- return this.x -= s, this.y -= s, this;
905
- },
906
- // [API]
907
- // [chainable, changeSelf]
908
- // divide self by scalar.
909
- // for example, v(6, 8) / 5 = v(3, 4).
910
- // @param val - value to divide components by.
911
- // @return self.
912
- divScalarSelf: function(s) {
913
- return this.x /= s, this.y /= s, this;
914
- },
915
- // [API]
916
- // [chainable, changeSelf]
917
- // multiply self by scalar.
918
- // for example, v(2, 3) * 2 = v(4, 6).
919
- // @param val - value to multiply components with.
920
- // @return self.
921
- mulScalarSelf: function(s) {
922
- return this.x *= s, this.y *= s, this;
923
- },
924
- // [API]
925
- // [chainable, clone]
926
- // clone self and add other vector to it.
927
- // @param other - vector to add with.
928
- // @return cloned vector.
929
- add: function(s) {
930
- return this.clone().addSelf(s);
931
- },
932
- // [API]
933
- // [chainable, clone]
934
- // clone self and subtract other vector from it.
935
- // @param other - vector to subtract with.
936
- // @return cloned vector.
937
- sub: function(s) {
938
- return this.clone().subSelf(s);
939
- },
940
- // [API]
941
- // [chainable, clone]
942
- // clone self and multiply by other vector.
943
- // @param other - vector to multiply with.
944
- // @return cloned vector.
945
- mul: function(s) {
946
- return this.clone().mulSelf(s);
947
- },
948
- // [API]
949
- // [chainable, clone]
950
- // clone self and divide by other vector.
951
- // @param other - vector to divide with.
952
- // @param scalar - value to divide by.
953
- // @return cloned vector.
954
- div: function(s) {
955
- return this.clone().divSelf(s);
956
- },
957
- // [API]
958
- // [chainable, clone]
959
- // clone self and add scalar to it.
960
- // @param scalar - value to add.
961
- // @return cloned vector.
962
- addScalar: function(s) {
963
- return this.clone().addScalarSelf(s);
964
- },
965
- // [API]
966
- // [chainable, clone]
967
- // clone self and substract scalar from it.
968
- // @param scalar - value to subtract.
969
- // @return cloned vector.
970
- subScalar: function(s) {
971
- return this.clone().subScalarSelf(s);
972
- },
973
- // [API]
974
- // [chainable, clone]
975
- // clone self and multiply by scalar.
976
- // @param scalar - value to multiply with.
977
- // @return cloned vector.
978
- mulScalar: function(s) {
979
- return this.clone().mulScalarSelf(s);
980
- },
981
- // [API]
982
- // [chainable, clone]
983
- // clone self and divide by scalar.
984
- // @param scalar - value to divide by.
985
- // @return cloned vector.
986
- divScalar: function(s) {
987
- return this.clone().divScalarSelf(s);
988
- },
989
- // [API]
990
- // [chainable, changeSelf]
991
- // clamp vector values into range.
992
- // note: this function does not validate that min < max.
993
- // @param min - min value for x, y components.
994
- // @param max - max value for x, y components.
995
- // @return self.
996
- clampSelf: function(s, d) {
997
- return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
998
- },
999
- // [API]
1000
- // [chainable, clone]
1001
- // clone vector and clamp its values.
1002
- // note: this function does not validate that min < max.
1003
- // @param min - min value for x, y components.
1004
- // @param max - max value for x, y components.
1005
- // @return cloned vector in range.
1006
- clamp: function(s, d) {
1007
- return this.clone().clampSelf(s, d);
1008
- },
1009
- // [API]
1010
- // [chainable, changeSelf]
1011
- // apply a function on x and y components of the vector.
1012
- // for example, you can use Math.round to round the vector x, y values.
1013
- // @param func - function to apply on components.
1014
- // @return self.
1015
- applySelf: function(s) {
1016
- return this.x = s(this.x), this.y = s(this.y), this;
1017
- },
1018
- // [API]
1019
- // [chainable, clone]
1020
- // clone self and apply a function on x and y components of the clone vector.
1021
- // for example, you can use Math.round to round the vector x, y values.
1022
- // @param func - function to apply on components.
1023
- // @return cloned vector.
1024
- apply: function(s) {
1025
- return this.clone().applySelf(s);
1026
- },
1027
- // [API]
1028
- // [chainable, changeSelf]
1029
- // turn self to absolute values (eg turn x, y positive).
1030
- // @return self.
1031
- absSelf: function() {
1032
- return this.applySelf(Math.abs);
1033
- },
1034
- // [API]
1035
- // [chainable, clone]
1036
- // clone and turn to absolute values (eg turn x, y positive).
1037
- // @return cloned vector.
1038
- abs: function() {
1039
- return this.clone().absSelf();
1040
- },
1041
- // [API]
1042
- // [chainable, changeSelf]
1043
- // turn self to round values (eg turn x, y positive).
1044
- // @return self.
1045
- roundSelf: function() {
1046
- return this.applySelf(Math.round);
1047
- },
1048
- // [API]
1049
- // [chainable, clone]
1050
- // clone and turn to round values (eg turn x, y positive).
1051
- // @return cloned vector.
1052
- round: function() {
1053
- return this.clone().roundSelf();
1054
- },
1055
- // [API]
1056
- // []
1057
- // calculate dot-product of this vector with another vector.
1058
- // @param other - other vector to calculate dot-product with.
1059
- // @return dot product.
1060
- dot: function(s) {
1061
- return this.x * s.x + this.y * s.y;
1062
- },
1063
- // [API]
1064
- // []
1065
- // calculate cross-product of this vector with another vector.
1066
- // @param other - other vector to calculate cross-product with.
1067
- // @return dot product.
1068
- cross: function(s) {
1069
- return this.x * s.y - this.y * s.x;
1070
- },
1071
- // [API]
1072
- // [chainable, changeSelf]
1073
- // if any of the components of this vector are NaN, null, undefined, etc. set them to defaults.
1074
- // note: 0's are considered to be a valid number and will not be replaced with a default value.
1075
- // @param x - default value for x if undefined (0 if not defined).
1076
- // @param y - default value for y if undefined (0 if not defined).
1077
- // @return self.
1078
- repairSelf: function(s, d) {
1079
- return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
1080
- },
1081
- // [API]
1082
- // [chainable, clone]
1083
- // create a clone and if any of the components of the vector are NaN, null, undefined, etc. set them to default.
1084
- // note: 0's are considered to be a valid number and will not be replaced with a default value.
1085
- // @param x - default value for x if undefined (0 if not defined).
1086
- // @param y - default value for y if undefined (0 if not defined).
1087
- // @return repaired clone.
1088
- repair: function(s, d) {
1089
- return this.clone().repairSelf(s, d);
1090
- },
1091
- // [API]
1092
- // []
1093
- // convert to string in the form of "x,y".
1094
- // @return string representation of the vector.
1095
- toString: function() {
1096
- return this.x + "," + this.y;
1097
- },
1098
- // [API]
1099
- // []
1100
- // convert to a string with a given format.
1101
- // @param format - a string in which %x and %y will be replaced with the vector values.
1102
- // @return formatted string representing the vector.
1103
- format: function(s) {
1104
- return s = s || "%x,%y", s = s.replace(new RegExp("%x", "g"), this.x), s = s.replace(new RegExp("%y", "g"), this.y), s;
1105
- }
1106
- }, f;
1107
- }();
1108
- return e.zero = new e(0, 0), e.one = new e(1, 1), e.up = new e(0, -1), e.down = new e(0, 1), e.left = new e(-1, 0), e.right = new e(1, 0), e.upLeft = new e(-1, -1), e.downLeft = new e(-1, 1), e.upRight = new e(1, -1), e.downRight = new e(1, 1), e.prototype.magnitude = e.prototype.length, Object.freeze && (Object.freeze(e.zero), Object.freeze(e.one), Object.freeze(e.up), Object.freeze(e.down), Object.freeze(e.left), Object.freeze(e.right), Object.freeze(e.upLeft), Object.freeze(e.downLeft), Object.freeze(e.upRight), Object.freeze(e.downRight)), e;
1109
- });
1110
- })(kr);
1111
- var Xr = kr.exports;
1112
- const X = /* @__PURE__ */ lr(Xr);
1113
- let Me = (p = 21) => crypto.getRandomValues(new Uint8Array(p)).reduce((e, a) => (a &= 63, a < 36 ? e += a.toString(36) : a < 62 ? e += (a - 26).toString(36).toUpperCase() : a > 62 ? e += "-" : e += "_", e), "");
1114
- const ce = {
628
+ process.env.NODE_ENV === "production" ? or.exports = Gr() : or.exports = Jr();
629
+ var Zr = or.exports, Kr = Object.defineProperty, Qr = (h, e, s) => e in h ? Kr(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, x = (h, e, s) => (Qr(h, typeof e != "symbol" ? e + "" : e, s), s);
630
+ let ze = (h = 21) => crypto.getRandomValues(new Uint8Array(h)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
631
+ const ge = {
1115
632
  strokeType: "plain",
1116
633
  strokeColor: "black",
1117
634
  strokeWidth: 1,
1118
635
  head: "none",
1119
636
  tail: "none"
1120
- }, cr = {
637
+ }, gr = {
1121
638
  id: 0,
1122
639
  type: "Feature",
1123
640
  properties: {
1124
641
  type: "arrow",
1125
642
  style: {
1126
- ...ce
643
+ ...ge
1127
644
  }
1128
645
  },
1129
646
  geometry: {
@@ -1143,245 +660,280 @@ const ce = {
1143
660
  // tail: 'arrow-plain',
1144
661
  // start: { x: 0, y: 0 },
1145
662
  // end: { x: 100, y: 100 }
1146
- }, Zr = (p = 0, e = 0, a = 0, i = 0, h = { ...ce }) => ({
1147
- id: Me(),
663
+ }, tn = (h = 0, e = 0, s = 0, i = 0, l = { ...ge }) => ({
664
+ id: ze(),
1148
665
  type: "Feature",
1149
666
  properties: {
1150
667
  type: "arrow",
1151
668
  style: {
1152
- ...ce,
1153
- ...h
669
+ ...ge,
670
+ ...l
1154
671
  }
1155
672
  },
1156
673
  geometry: {
1157
674
  type: "LineString",
1158
675
  coordinates: [
1159
- [p, e],
1160
- [a, i]
676
+ [h, e],
677
+ [s, i]
1161
678
  ]
1162
679
  }
1163
- }), Gr = "http://www.w3.org/2000/svg";
1164
- function he(p) {
1165
- return document.createElementNS(Gr, p);
680
+ }), en = "http://www.w3.org/2000/svg";
681
+ function de(h) {
682
+ return document.createElementNS(en, h);
1166
683
  }
1167
- function Tr(p) {
1168
- return p.geometry.bbox || Jr(p), p.geometry.bbox;
684
+ function Pr(h) {
685
+ return h.geometry.bbox || rn(h), h.geometry.bbox;
1169
686
  }
1170
- function mt(p) {
1171
- const e = Tr(p);
687
+ function vt(h) {
688
+ const e = Pr(h);
1172
689
  return {
1173
690
  width: e[2] - e[0],
1174
691
  height: e[3] - e[1]
1175
692
  };
1176
693
  }
1177
- function yt(p) {
1178
- const e = Tr(p);
694
+ function yt(h) {
695
+ const e = Pr(h);
1179
696
  return { x: e[0], y: e[1] };
1180
697
  }
1181
- function Jr(p) {
1182
- const [e, a] = p.geometry.coordinates[0][0], [i, h] = p.geometry.coordinates[0][2];
1183
- p.geometry.bbox = [e, a, i, h];
698
+ function rn(h) {
699
+ const [e, s] = h.geometry.coordinates[0][0], [i, l] = h.geometry.coordinates[0][2];
700
+ h.geometry.bbox = [e, s, i, l];
1184
701
  }
1185
- function Kr(p, e, a, i, h) {
1186
- p.geometry.bbox = [e, a, e + i, a + h], p.geometry.coordinates = [
702
+ function nn(h, e, s, i, l) {
703
+ h.geometry.bbox = [e, s, e + i, s + l], h.geometry.coordinates = [
1187
704
  [
1188
- [e, a],
1189
- [e + i, a],
1190
- [e + i, a + h],
1191
- [e, a + h],
1192
- [e, a]
705
+ [e, s],
706
+ [e + i, s],
707
+ [e + i, s + l],
708
+ [e, s + l],
709
+ [e, s]
1193
710
  ]
1194
711
  ];
1195
712
  }
1196
- function ue(p) {
1197
- const [e, a] = p.geometry.coordinates[0];
1198
- return { x: e, y: a };
713
+ function fe(h) {
714
+ const [e, s] = h.geometry.coordinates[0];
715
+ return { x: e, y: s };
1199
716
  }
1200
- function Ce(p, e) {
1201
- const [a, i] = p.geometry.coordinates[e === "start" ? 0 : 1];
1202
- return { x: a, y: i };
717
+ function Ie(h, e) {
718
+ const [s, i] = h.geometry.coordinates[e === "start" ? 0 : 1];
719
+ return { x: s, y: i };
1203
720
  }
1204
- function Ie(p) {
1205
- const [e, a] = p.geometry.coordinates[1];
1206
- return { x: e, y: a };
721
+ function $e(h) {
722
+ const [e, s] = h.geometry.coordinates[1];
723
+ return { x: e, y: s };
1207
724
  }
1208
- function Rr(p, e, a) {
1209
- p.geometry.coordinates[0] = [e, a];
725
+ function Rr(h, e, s) {
726
+ h.geometry.coordinates[0] = [e, s];
1210
727
  }
1211
- function Cr(p, e, a) {
1212
- p.geometry.coordinates[1] = [e, a];
728
+ function Ir(h, e, s) {
729
+ h.geometry.coordinates[1] = [e, s];
1213
730
  }
1214
- function Oe(p) {
1215
- return { start: ue(p), end: Ie(p) };
731
+ function je(h) {
732
+ return { start: fe(h), end: $e(h) };
1216
733
  }
1217
- function Nt(p, e, a, i) {
1218
- e === "start" ? Rr(p, a, i) : Cr(p, a, i);
734
+ function Bt(h, e, s, i) {
735
+ e === "start" ? Rr(h, s, i) : Ir(h, s, i);
1219
736
  }
1220
- const Pr = (p) => parseInt(p.getAttribute("data-handle-id") || "-1");
1221
- function Pe(p, e, a) {
1222
- const i = Math.atan2(p.y - e.y, p.x - e.x);
737
+ const Lr = (h) => parseInt(h.getAttribute("data-handle-id") || "-1");
738
+ function Le(h, e, s) {
739
+ const i = Math.atan2(h.y - e.y, h.x - e.x);
1223
740
  return {
1224
- x: e.x + a * Math.cos(i),
1225
- y: e.y + a * Math.sin(i)
741
+ x: e.x + s * Math.cos(i),
742
+ y: e.y + s * Math.sin(i)
1226
743
  };
1227
744
  }
1228
- function rr(p, e) {
745
+ function sr(h, e) {
1229
746
  if (!e)
1230
- return { x: p.clientX, y: p.clientY };
1231
- const a = e.getBoundingClientRect();
747
+ return { x: h.clientX, y: h.clientY };
748
+ const s = e.getBoundingClientRect();
1232
749
  return {
1233
- x: p.clientX - a.left - e.clientLeft,
1234
- y: p.clientY - a.top - e.clientTop
750
+ x: h.clientX - s.left - e.clientLeft,
751
+ y: h.clientY - s.top - e.clientTop
1235
752
  };
1236
753
  }
1237
- function Ir(p, e = 5, a = 30) {
754
+ const Ct = (h, e) => ({
755
+ x: h.x - e.x,
756
+ y: h.y - e.y
757
+ }), Wt = (h) => Math.sqrt(h.x * h.x + h.y * h.y), Fr = (h) => ({
758
+ x: -h.x,
759
+ y: -h.y
760
+ }), $r = (h) => {
761
+ const e = Wt(h);
762
+ return e === 0 ? { x: 0, y: 0 } : {
763
+ x: h.x / e,
764
+ y: h.y / e
765
+ };
766
+ }, Ht = (h, e) => ({
767
+ x: h.x + e.x,
768
+ y: h.y + e.y
769
+ }), jr = (h, e) => ({
770
+ x: h.x * e,
771
+ y: h.y * e
772
+ }), Fe = (h, e) => ({
773
+ x: h.x * e.x,
774
+ y: h.y * e.y
775
+ }), st = (h, e) => {
776
+ const s = Math.sin(e), i = Math.cos(e);
777
+ return {
778
+ x: h.x * i - h.y * s,
779
+ y: h.x * s + h.y * i
780
+ };
781
+ }, on = (h, e) => ({
782
+ x: h.x / e,
783
+ y: h.y / e
784
+ }), pr = (h, e) => h.x * e.x + h.y * e.y;
785
+ function Dr(h, e = 5, s = 30) {
1238
786
  var i;
1239
- const { start: h, end: c } = Oe(p), g = new X(h.x, h.y), m = new X(c.x, c.y).sub(g), f = p.properties.style && p.properties.style.strokeWidth ? (i = p.properties.style) == null ? void 0 : i.strokeWidth : 0;
1240
- return Math.min(a, Math.max(3 * f, m.length() * 0.1, e));
787
+ const { start: l, end: c } = je(h), f = Ct(c, l), p = h.properties.style && h.properties.style.strokeWidth ? (i = h.properties.style) == null ? void 0 : i.strokeWidth : 0;
788
+ return Math.min(s, Math.max(3 * p, Wt(f) * 0.1, e));
1241
789
  }
1242
- function fr(p, e, a, i) {
1243
- const h = e.clone().normalize().invert().mul(i);
1244
- if (!a || a === "none")
790
+ function yr(h, e, s, i) {
791
+ const l = jr(Fr($r(e)), i);
792
+ if (!s || s === "none")
1245
793
  return "";
1246
- const c = p.clone().add(h.rotateRadians(Math.PI / 8)), g = p.clone().add(h.rotateRadians(-Math.PI / 8)), m = `${p.x} ${p.y}`;
1247
- return `M ${c.x} ${c.y} L ${m} ${g.x} ${g.y} ${a === "arrow" ? "" : `${c.x} ${c.y}`}`;
794
+ const c = Ht(h, st(l, Math.PI / 8)), f = Ht(h, st(l, -Math.PI / 8)), p = `${h.x} ${h.y}`;
795
+ return `M ${c.x} ${c.y} L ${p} ${f.x} ${f.y} ${s === "arrow" ? "" : `${c.x} ${c.y}`}`;
1248
796
  }
1249
- function Qr(p, e, a, i, h) {
1250
- const { start: c, end: g } = Oe(p), { tail: m, head: f, strokeColor: s, strokeWidth: d } = p.properties.style || a, A = new X(c.x, c.y), _ = new X(g.x, g.y), R = _.clone().sub(A), P = Ir(p, i, h), E = he("path");
1251
- E.setAttribute("data-annotation", `${p.id}`), E.setAttribute("data-annotation-type", "arrow");
1252
- const M = f === "arrow-plain" || m === "arrow";
1253
- E.setAttribute("stroke", s || "none"), E.setAttribute("stroke-width", `${d}`), E.setAttribute("fill", M ? s || "" : "none"), E.setAttribute("stroke-linecap", "round"), E.setAttribute("stroke-linejoin", "round");
1254
- const j = fr(A, R.clone().invert(), m, P), k = fr(_, R, f, P), N = j + `M ${A.x} ${A.y} ${_.x} ${_.y}` + k;
1255
- E.setAttribute("d", N), e.appendChild(E);
797
+ function sn(h, e, s, i, l) {
798
+ const { start: c, end: f } = je(h), { tail: p, head: d, strokeColor: v, strokeWidth: y } = h.properties.style || s, _ = Ct(f, c), C = Dr(h, i, l), E = de("path");
799
+ E.setAttribute("data-annotation", `${h.id}`), E.setAttribute("data-annotation-type", "arrow");
800
+ const P = d === "arrow-plain" || p === "arrow";
801
+ E.setAttribute("stroke", v || "none"), E.setAttribute("stroke-width", `${y}`), E.setAttribute("fill", P ? v || "" : "none"), E.setAttribute("stroke-linecap", "round"), E.setAttribute("stroke-linejoin", "round");
802
+ const S = yr(c, Fr(_), p, C), $ = yr(f, _, d, C), L = S + `M ${c.x} ${c.y} ${f.x} ${f.y}` + $;
803
+ E.setAttribute("d", L), e.appendChild(E);
1256
804
  }
1257
- const q = -1, je = "dragging", $e = "dragstart", Bt = "dragend", nr = "select", ir = "unselect", tn = "hover", en = "unhover", sr = "remove", or = "add", rn = "cancelDrawing", ar = "update", nn = "link";
1258
- var Or = { exports: {} };
1259
- (function(p) {
1260
- var e = Object.prototype.hasOwnProperty, a = "~";
805
+ const Y = -1, De = "dragging", Me = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", an = "hover", ln = "unhover", hr = "remove", ur = "add", hn = "cancelDrawing", cr = "update", un = "link";
806
+ var cn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
807
+ function Mr(h) {
808
+ return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
809
+ }
810
+ var zr = { exports: {} };
811
+ (function(h) {
812
+ var e = Object.prototype.hasOwnProperty, s = "~";
1261
813
  function i() {
1262
814
  }
1263
- Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (a = !1));
1264
- function h(f, s, d) {
1265
- this.fn = f, this.context = s, this.once = d || !1;
815
+ Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (s = !1));
816
+ function l(d, v, y) {
817
+ this.fn = d, this.context = v, this.once = y || !1;
1266
818
  }
1267
- function c(f, s, d, A, _) {
1268
- if (typeof d != "function")
819
+ function c(d, v, y, _, C) {
820
+ if (typeof y != "function")
1269
821
  throw new TypeError("The listener must be a function");
1270
- var R = new h(d, A || f, _), P = a ? a + s : s;
1271
- return f._events[P] ? f._events[P].fn ? f._events[P] = [f._events[P], R] : f._events[P].push(R) : (f._events[P] = R, f._eventsCount++), f;
822
+ var E = new l(y, _ || d, C), P = s ? s + v : v;
823
+ return d._events[P] ? d._events[P].fn ? d._events[P] = [d._events[P], E] : d._events[P].push(E) : (d._events[P] = E, d._eventsCount++), d;
1272
824
  }
1273
- function g(f, s) {
1274
- --f._eventsCount === 0 ? f._events = new i() : delete f._events[s];
825
+ function f(d, v) {
826
+ --d._eventsCount === 0 ? d._events = new i() : delete d._events[v];
1275
827
  }
1276
- function m() {
828
+ function p() {
1277
829
  this._events = new i(), this._eventsCount = 0;
1278
830
  }
1279
- m.prototype.eventNames = function() {
1280
- var f = [], s, d;
831
+ p.prototype.eventNames = function() {
832
+ var d = [], v, y;
1281
833
  if (this._eventsCount === 0)
1282
- return f;
1283
- for (d in s = this._events)
1284
- e.call(s, d) && f.push(a ? d.slice(1) : d);
1285
- return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(s)) : f;
1286
- }, m.prototype.listeners = function(f) {
1287
- var s = a ? a + f : f, d = this._events[s];
1288
- if (!d)
834
+ return d;
835
+ for (y in v = this._events)
836
+ e.call(v, y) && d.push(s ? y.slice(1) : y);
837
+ return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
838
+ }, p.prototype.listeners = function(d) {
839
+ var v = s ? s + d : d, y = this._events[v];
840
+ if (!y)
1289
841
  return [];
1290
- if (d.fn)
1291
- return [d.fn];
1292
- for (var A = 0, _ = d.length, R = new Array(_); A < _; A++)
1293
- R[A] = d[A].fn;
1294
- return R;
1295
- }, m.prototype.listenerCount = function(f) {
1296
- var s = a ? a + f : f, d = this._events[s];
1297
- return d ? d.fn ? 1 : d.length : 0;
1298
- }, m.prototype.emit = function(f, s, d, A, _, R) {
1299
- var P = a ? a + f : f;
842
+ if (y.fn)
843
+ return [y.fn];
844
+ for (var _ = 0, C = y.length, E = new Array(C); _ < C; _++)
845
+ E[_] = y[_].fn;
846
+ return E;
847
+ }, p.prototype.listenerCount = function(d) {
848
+ var v = s ? s + d : d, y = this._events[v];
849
+ return y ? y.fn ? 1 : y.length : 0;
850
+ }, p.prototype.emit = function(d, v, y, _, C, E) {
851
+ var P = s ? s + d : d;
1300
852
  if (!this._events[P])
1301
853
  return !1;
1302
- var E = this._events[P], M = arguments.length, j, k;
1303
- if (E.fn) {
1304
- switch (E.once && this.removeListener(f, E.fn, void 0, !0), M) {
854
+ var S = this._events[P], $ = arguments.length, L, T;
855
+ if (S.fn) {
856
+ switch (S.once && this.removeListener(d, S.fn, void 0, !0), $) {
1305
857
  case 1:
1306
- return E.fn.call(E.context), !0;
858
+ return S.fn.call(S.context), !0;
1307
859
  case 2:
1308
- return E.fn.call(E.context, s), !0;
860
+ return S.fn.call(S.context, v), !0;
1309
861
  case 3:
1310
- return E.fn.call(E.context, s, d), !0;
862
+ return S.fn.call(S.context, v, y), !0;
1311
863
  case 4:
1312
- return E.fn.call(E.context, s, d, A), !0;
864
+ return S.fn.call(S.context, v, y, _), !0;
1313
865
  case 5:
1314
- return E.fn.call(E.context, s, d, A, _), !0;
866
+ return S.fn.call(S.context, v, y, _, C), !0;
1315
867
  case 6:
1316
- return E.fn.call(E.context, s, d, A, _, R), !0;
868
+ return S.fn.call(S.context, v, y, _, C, E), !0;
1317
869
  }
1318
- for (k = 1, j = new Array(M - 1); k < M; k++)
1319
- j[k - 1] = arguments[k];
1320
- E.fn.apply(E.context, j);
870
+ for (T = 1, L = new Array($ - 1); T < $; T++)
871
+ L[T - 1] = arguments[T];
872
+ S.fn.apply(S.context, L);
1321
873
  } else {
1322
- var N = E.length, H;
1323
- for (k = 0; k < N; k++)
1324
- switch (E[k].once && this.removeListener(f, E[k].fn, void 0, !0), M) {
874
+ var B = S.length, N;
875
+ for (T = 0; T < B; T++)
876
+ switch (S[T].once && this.removeListener(d, S[T].fn, void 0, !0), $) {
1325
877
  case 1:
1326
- E[k].fn.call(E[k].context);
878
+ S[T].fn.call(S[T].context);
1327
879
  break;
1328
880
  case 2:
1329
- E[k].fn.call(E[k].context, s);
881
+ S[T].fn.call(S[T].context, v);
1330
882
  break;
1331
883
  case 3:
1332
- E[k].fn.call(E[k].context, s, d);
884
+ S[T].fn.call(S[T].context, v, y);
1333
885
  break;
1334
886
  case 4:
1335
- E[k].fn.call(E[k].context, s, d, A);
887
+ S[T].fn.call(S[T].context, v, y, _);
1336
888
  break;
1337
889
  default:
1338
- if (!j)
1339
- for (H = 1, j = new Array(M - 1); H < M; H++)
1340
- j[H - 1] = arguments[H];
1341
- E[k].fn.apply(E[k].context, j);
890
+ if (!L)
891
+ for (N = 1, L = new Array($ - 1); N < $; N++)
892
+ L[N - 1] = arguments[N];
893
+ S[T].fn.apply(S[T].context, L);
1342
894
  }
1343
895
  }
1344
896
  return !0;
1345
- }, m.prototype.on = function(f, s, d) {
1346
- return c(this, f, s, d, !1);
1347
- }, m.prototype.once = function(f, s, d) {
1348
- return c(this, f, s, d, !0);
1349
- }, m.prototype.removeListener = function(f, s, d, A) {
1350
- var _ = a ? a + f : f;
1351
- if (!this._events[_])
897
+ }, p.prototype.on = function(d, v, y) {
898
+ return c(this, d, v, y, !1);
899
+ }, p.prototype.once = function(d, v, y) {
900
+ return c(this, d, v, y, !0);
901
+ }, p.prototype.removeListener = function(d, v, y, _) {
902
+ var C = s ? s + d : d;
903
+ if (!this._events[C])
1352
904
  return this;
1353
- if (!s)
1354
- return g(this, _), this;
1355
- var R = this._events[_];
1356
- if (R.fn)
1357
- R.fn === s && (!A || R.once) && (!d || R.context === d) && g(this, _);
905
+ if (!v)
906
+ return f(this, C), this;
907
+ var E = this._events[C];
908
+ if (E.fn)
909
+ E.fn === v && (!_ || E.once) && (!y || E.context === y) && f(this, C);
1358
910
  else {
1359
- for (var P = 0, E = [], M = R.length; P < M; P++)
1360
- (R[P].fn !== s || A && !R[P].once || d && R[P].context !== d) && E.push(R[P]);
1361
- E.length ? this._events[_] = E.length === 1 ? E[0] : E : g(this, _);
911
+ for (var P = 0, S = [], $ = E.length; P < $; P++)
912
+ (E[P].fn !== v || _ && !E[P].once || y && E[P].context !== y) && S.push(E[P]);
913
+ S.length ? this._events[C] = S.length === 1 ? S[0] : S : f(this, C);
1362
914
  }
1363
915
  return this;
1364
- }, m.prototype.removeAllListeners = function(f) {
1365
- var s;
1366
- return f ? (s = a ? a + f : f, this._events[s] && g(this, s)) : (this._events = new i(), this._eventsCount = 0), this;
1367
- }, m.prototype.off = m.prototype.removeListener, m.prototype.addListener = m.prototype.on, m.prefixed = a, m.EventEmitter = m, p.exports = m;
1368
- })(Or);
1369
- var sn = Or.exports;
1370
- const jr = /* @__PURE__ */ lr(sn);
1371
- class $r extends jr {
1372
- constructor(e, a) {
1373
- super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", q), x(this, "hoveredId", q), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "maxHandleScale", 1.5), x(this, "_onKeyUp", (i) => {
1374
- i.code === 27 && this.selectedId !== q ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== q && this._canRemove() && this.remove(this.selectedId);
916
+ }, p.prototype.removeAllListeners = function(d) {
917
+ var v;
918
+ return d ? (v = s ? s + d : d, this._events[v] && f(this, v)) : (this._events = new i(), this._eventsCount = 0), this;
919
+ }, p.prototype.off = p.prototype.removeListener, p.prototype.addListener = p.prototype.on, p.prefixed = s, p.EventEmitter = p, h.exports = p;
920
+ })(zr);
921
+ var dn = zr.exports;
922
+ const Nr = /* @__PURE__ */ Mr(dn);
923
+ class Br extends Nr {
924
+ constructor(e, s) {
925
+ super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", Y), x(this, "hoveredId", Y), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (i) => {
926
+ i.code === 27 && this.selectedId !== Y ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== Y && this._canRemove() && this.remove(this.selectedId);
1375
927
  }), x(this, "_onClickMouseMove", (i) => {
1376
928
  if (!i.domEvent || this.isDragging || !this.shouldDetect || i.domEvent.type !== "mousemove" && i.domEvent.target && i.domEvent.target.tagName === "a")
1377
929
  return;
1378
- const h = this.ogma.view.screenToGraphCoordinates(i), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(h, 0) : void 0;
1379
- i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== q && this.unhover() : c ? this.select(c.id) : this.selectedId !== q && this.unselect();
930
+ const l = this.ogma.view.screenToGraphCoordinates(i), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
931
+ i.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== Y && this.unhover() : c ? this.select(c.id) : this.selectedId !== Y && this.unselect();
1380
932
  }), this.ogma = e, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = e.getOptions(), e.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
1381
933
  this.refreshEditor(), this.refreshDrawing();
1382
934
  }), this.layer = e.layers.addSVGLayer({
1383
935
  draw: (i) => this.draw(i)
1384
- }), this.layer.moveToTop(), this.editor = e.layers.addLayer(a), this.editor.hide();
936
+ }), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
1385
937
  }
1386
938
  _canRemove() {
1387
939
  return !0;
@@ -1392,52 +944,52 @@ class $r extends jr {
1392
944
  * @returns the added annotation
1393
945
  */
1394
946
  add(e) {
1395
- const a = this.getDefaultOptions(), i = Object.assign(e, {
1396
- id: e.id === void 0 ? Me() : e.id,
947
+ const s = this.getDefaultOptions(), i = Object.assign(e, {
948
+ id: e.id === void 0 ? ze() : e.id,
1397
949
  type: e.type,
1398
950
  properties: {
1399
- ...a.properties,
951
+ ...s.properties,
1400
952
  ...e.properties || {},
1401
953
  // styles need to be merged
1402
- style: { ...a.properties.style, ...e.properties.style || {} }
954
+ style: { ...s.properties.style, ...e.properties.style || {} }
1403
955
  },
1404
956
  geometry: {
1405
- ...a.geometry,
957
+ ...s.geometry,
1406
958
  ...e.geometry
1407
959
  }
1408
960
  });
1409
- return this.elements.push(i), this.layer.refresh(), this.emit(or, i), i;
961
+ return this.elements.push(i), this.layer.refresh(), this.emit(ur, i), i;
1410
962
  }
1411
- updateStyle(e, a) {
963
+ updateStyle(e, s) {
1412
964
  this.updateAnnotation(e, {
1413
965
  properties: {
1414
- style: a
966
+ style: s
1415
967
  }
1416
968
  });
1417
969
  }
1418
- updateGeometry(e, a) {
970
+ updateGeometry(e, s) {
1419
971
  this.updateAnnotation(e, {
1420
- geometry: a
972
+ geometry: s
1421
973
  });
1422
974
  }
1423
975
  /**
1424
976
  * @method update
1425
977
  * Updates an annotation (position, color etc)
1426
978
  * @param id Id of the annotation to update
1427
- * @param new params of the annotation
979
+ * @param element params of the annotation
1428
980
  */
1429
- update(e, a) {
981
+ update(e, s) {
1430
982
  const i = this.getById(e);
1431
- this.updateAnnotation(i, a);
983
+ this.updateAnnotation(i, s);
1432
984
  }
1433
- updateAnnotation(e, a) {
985
+ updateAnnotation(e, s) {
1434
986
  if (!e)
1435
987
  return;
1436
988
  const i = e.id;
1437
- Object.keys(a).forEach((h) => {
1438
- if (h !== "id")
1439
- if (h === "properties") {
1440
- const c = a.properties || { style: {} };
989
+ Object.keys(s).forEach((l) => {
990
+ if (l !== "id")
991
+ if (l === "properties") {
992
+ const c = s.properties || { style: {} };
1441
993
  e.properties = {
1442
994
  ...e.properties || {},
1443
995
  ...c || {},
@@ -1447,18 +999,18 @@ class $r extends jr {
1447
999
  }
1448
1000
  };
1449
1001
  } else
1450
- h === "geometry" ? e.geometry = {
1002
+ l === "geometry" ? e.geometry = {
1451
1003
  ...e.geometry,
1452
- ...a.geometry
1453
- } : e[h] = a[h];
1004
+ ...s.geometry
1005
+ } : e[l] = s[l];
1454
1006
  }), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
1455
1007
  }
1456
1008
  getById(e) {
1457
- const a = Number(e);
1009
+ const s = Number(e);
1458
1010
  for (let i = 0; i < this.elements.length; i++) {
1459
- const h = this.elements[i];
1460
- if (!(h.id !== e && h.id !== a))
1461
- return h;
1011
+ const l = this.elements[i];
1012
+ if (!(l.id !== e && l.id !== s))
1013
+ return l;
1462
1014
  }
1463
1015
  }
1464
1016
  /**
@@ -1467,23 +1019,23 @@ class $r extends jr {
1467
1019
  * Select element, show editor, disable Ogma dragging and fire event
1468
1020
  */
1469
1021
  select(e) {
1470
- const a = this.getById(e);
1471
- a && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(nr, a));
1022
+ const s = this.getById(e);
1023
+ s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
1472
1024
  }
1473
1025
  hover(e) {
1474
- const a = this.getById(e);
1475
- a && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(tn, a));
1026
+ const s = this.getById(e);
1027
+ s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(an, s));
1476
1028
  }
1477
1029
  getSelectedFeature() {
1478
- return this.selectedId === q ? null : this.getById(this.selectedId);
1030
+ return this.selectedId === Y ? null : this.getById(this.selectedId);
1479
1031
  }
1480
1032
  unselect() {
1481
1033
  const e = this.getById(this.selectedId);
1482
- return e && this.emit(ir, e), this.selectedId = q, this.hoveredId === q && this.editor.hide(), this.layer.refresh(), this;
1034
+ return e && this.emit(lr, e), this.selectedId = Y, this.hoveredId === Y && this.editor.hide(), this.layer.refresh(), this;
1483
1035
  }
1484
1036
  unhover() {
1485
1037
  const e = this.getById(this.hoveredId);
1486
- return this.emit(en, e), this.hoveredId = q, this.selectedId === q && this.editor.hide(), this.layer.refresh(), this;
1038
+ return this.emit(ln, e), this.hoveredId = Y, this.selectedId === Y && this.editor.hide(), this.layer.refresh(), this;
1487
1039
  }
1488
1040
  /**
1489
1041
  * @method remove
@@ -1491,8 +1043,8 @@ class $r extends jr {
1491
1043
  * Removes annotation with the given id
1492
1044
  */
1493
1045
  remove(e) {
1494
- const a = this.getById(e);
1495
- e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), a && this.emit(sr, a), this.layer.refresh();
1046
+ const s = this.getById(e);
1047
+ e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), s && this.emit(hr, s), this.layer.refresh();
1496
1048
  }
1497
1049
  /**
1498
1050
  * @method disableDragging
@@ -1542,39 +1094,42 @@ class $r extends jr {
1542
1094
  this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
1543
1095
  }
1544
1096
  }
1545
- const dr = "handle-line", pr = "handle-start", gr = "handle-end";
1546
- class on extends $r {
1547
- constructor(e, a = {}) {
1097
+ const vr = "handle-line", mr = "handle-start", br = "handle-end";
1098
+ class fn extends Br {
1099
+ constructor(e, s = {}) {
1548
1100
  super(
1549
1101
  e,
1550
1102
  `
1551
1103
  <div class="arrow-handle">
1552
- <div id="${dr}" data-handle-id="0" class="handle line"></div>
1553
- <div id="${pr}" data-handle-id="1" class="handle"></div>
1554
- <div id="${gr}" data-handle-id="2" class="handle"></div>
1104
+ <div id="${vr}" data-handle-id="0" class="handle line"></div>
1105
+ <div id="${mr}" data-handle-id="1" class="handle point"></div>
1106
+ <div id="${br}" data-handle-id="2" class="handle point"></div>
1555
1107
  </div>
1556
1108
  `
1557
- ), x(this, "draggedHandle", q), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...cr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (i) => {
1558
- const h = this.getById(this.selectedId) || this.getById(this.hoveredId);
1559
- if (!h)
1109
+ ), x(this, "draggedHandle", Y), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...gr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (i) => {
1110
+ const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
1111
+ if (!l)
1560
1112
  return;
1561
- const { x: c, y: g } = rr(i, this.ogma.getContainer());
1562
- this.startDragging(h, c, g), this.draggedHandle = Pr(i.target);
1113
+ const { x: c, y: f } = sr(i, this.ogma.getContainer());
1114
+ this.startDragging(l, c, f), this.draggedHandle = Lr(i.target);
1563
1115
  }), x(this, "onMouseUp", () => {
1564
- this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = q, this.emit(Bt, this.arrow));
1116
+ this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
1565
1117
  }), x(this, "onMouseMove", (i) => {
1566
- if (!this.isDragging || this.draggedHandle === q)
1118
+ if (!this.isDragging || this.draggedHandle === Y)
1567
1119
  return;
1568
- const h = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: g, y: m } = new X(
1569
- i.clientX - this.startX,
1570
- i.clientY - this.startY
1571
- ).divScalar(this.ogma.view.getZoom()).rotateRadians(c), f = h.id === dr, s = h.id === pr, d = h.id === gr;
1572
- (f || s) && Rr(this.arrow, this.start.x + g, this.start.y + m), (f || d) && Cr(this.arrow, this.end.x + g, this.end.y + m), this.emit(
1573
- je,
1120
+ const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: p } = st(
1121
+ on(
1122
+ { x: i.clientX - this.startX, y: i.clientY - this.startY },
1123
+ this.ogma.view.getZoom()
1124
+ ),
1125
+ c
1126
+ ), d = l.id === vr, v = l.id === mr, y = l.id === br;
1127
+ (d || v) && Rr(this.arrow, this.start.x + f, this.start.y + p), (d || y) && Ir(this.arrow, this.end.x + f, this.end.y + p), this.emit(
1128
+ De,
1574
1129
  this.arrow,
1575
- f ? "line" : s ? "start" : "end"
1130
+ d ? "line" : v ? "start" : "end"
1576
1131
  ), this.refreshEditor(), this.layer.refresh();
1577
- }), this.minArrowHeight = a.minArrowHeight || 0, this.maxArrowHeight = a.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1132
+ }), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1578
1133
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
1579
1134
  ), this.handles.forEach(
1580
1135
  (i) => i.addEventListener("mousedown", this.onHandleMouseDown)
@@ -1586,55 +1141,56 @@ class on extends $r {
1586
1141
  * @param y
1587
1142
  * @param arrow
1588
1143
  */
1589
- startDrawing(e, a, i = Zr(e, a, e, a, ce)) {
1590
- var h;
1144
+ startDrawing(e, s, i = tn(e, s, e, s, ge)) {
1145
+ var l;
1591
1146
  this.disableDragging(), this.add(i), this.hoveredId = i.id;
1592
- const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: a }), g = ((h = this.ogma.getContainer()) == null ? void 0 : h.getBoundingClientRect()) || {
1147
+ const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1593
1148
  left: 0,
1594
1149
  top: 0
1595
1150
  };
1596
1151
  this.startDragging(
1597
1152
  this.getById(i.id),
1598
- c.x + (g == null ? void 0 : g.left),
1599
- c.y + g.top
1153
+ c.x + (f == null ? void 0 : f.left),
1154
+ c.y + f.top
1600
1155
  ), this.draggedHandle = 2;
1601
1156
  }
1602
1157
  cancelDrawing() {
1603
- this.isDragging && (this.remove(this.arrow.id), this.emit(Bt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = q);
1158
+ this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
1604
1159
  }
1605
- startDragging(e, a, i) {
1606
- this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = a, this.startY = i, this.start = ue(this.arrow), this.end = Ie(this.arrow), this.disableDragging(), this.emit($e, this.arrow), this.isDragging = !0;
1160
+ startDragging(e, s, i) {
1161
+ this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = fe(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Me, this.arrow), this.isDragging = !0;
1607
1162
  }
1608
- detect(e, a = 0) {
1163
+ detect(e, s = 0) {
1609
1164
  return this.elements.find((i) => {
1610
- const { start: h, end: c } = Oe(i), g = new X(e.x, e.y).sub(
1611
- new X((h.x + c.x) / 2, (h.y + c.y) / 2)
1612
- ), m = new X(c.x, c.y).sub(new X(h.x, h.y)), f = m.length(), s = m.normalize(), d = Ir(i);
1613
- return Math.abs(s.dot(g)) < f / 2 + a && Math.abs(s.rotateRadians(Math.PI / 2).dot(g)) < d / 2 + a;
1165
+ const { start: l, end: c } = je(i), f = Ct(e, {
1166
+ x: (l.x + c.x) / 2,
1167
+ y: (l.y + c.y) / 2
1168
+ }), p = Ct(c, l), d = Wt(p), v = $r(p), y = Dr(i);
1169
+ return Math.abs(pr(v, f)) < d / 2 + s && Math.abs(pr(st(v, Math.PI / 2), f)) < y / 2 + s;
1614
1170
  });
1615
1171
  }
1616
1172
  refreshEditor() {
1617
1173
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1618
1174
  return;
1619
- const e = this.selectedId !== q ? this.getById(this.selectedId) : this.getById(this.hoveredId), a = Oe(e), i = this.ogma.view.graphToScreenCoordinates(a.start), h = this.ogma.view.graphToScreenCoordinates(a.end), c = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, m, f] = Array.prototype.slice.call(
1175
+ const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = je(e), i = this.ogma.view.graphToScreenCoordinates(s.start), l = this.ogma.view.graphToScreenCoordinates(s.end), [c, f, p] = Array.prototype.slice.call(
1620
1176
  this.editor.element.querySelectorAll(".handle")
1621
1177
  );
1622
- m.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%) scale(${c})`, f.style.transform = `translate(${h.x}px, ${h.y}px) translate(-50%, -50%) scale(${c}`;
1623
- const s = {
1624
- x: (h.x + i.x) / 2,
1625
- y: (h.y + i.y) / 2
1626
- }, d = new X(h.x - i.x, h.y - i.y), A = d.mul(1 / d.length()), _ = Math.atan2(A.y, A.x);
1627
- g.style.width = `${d.length()}px`, g.style.left = `${s.x}px`, g.style.top = `${s.y}px`, g.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
1178
+ f.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, p.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1179
+ const d = {
1180
+ x: (l.x + i.x) / 2,
1181
+ y: (l.y + i.y) / 2
1182
+ }, v = Ct(l, i), y = jr(v, 1 / Wt(v)), _ = Math.atan2(y.y, y.x);
1183
+ c.style.width = `${Wt(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
1628
1184
  }
1629
1185
  getDefaultOptions() {
1630
- return cr;
1186
+ return gr;
1631
1187
  }
1632
1188
  draw(e) {
1633
1189
  e.innerHTML = "";
1634
- const a = he("g"), i = this.ogma.view.getAngle();
1635
- a.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1636
- (h) => Qr(h, a, ce, this.minArrowHeight, this.maxArrowHeight)
1637
- ), e.appendChild(a);
1190
+ const s = de("g"), i = this.ogma.view.getAngle();
1191
+ s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1192
+ (l) => sn(l, s, ge, this.minArrowHeight, this.maxArrowHeight)
1193
+ ), e.appendChild(s);
1638
1194
  }
1639
1195
  refreshDrawing() {
1640
1196
  const e = this.ogma.view.getAngle();
@@ -1647,7 +1203,7 @@ class on extends $r {
1647
1203
  super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
1648
1204
  }
1649
1205
  }
1650
- const Ht = {
1206
+ const Ut = {
1651
1207
  font: "sans-serif",
1652
1208
  fontSize: 12,
1653
1209
  color: "black",
@@ -1655,13 +1211,13 @@ const Ht = {
1655
1211
  strokeWidth: 1,
1656
1212
  strokeColor: "#000",
1657
1213
  strokeType: "plain"
1658
- }, Ke = {
1214
+ }, rr = {
1659
1215
  id: 0,
1660
1216
  type: "Feature",
1661
1217
  properties: {
1662
1218
  type: "text",
1663
1219
  content: "",
1664
- style: { ...Ht }
1220
+ style: { ...Ut }
1665
1221
  },
1666
1222
  geometry: {
1667
1223
  type: "Polygon",
@@ -1677,126 +1233,126 @@ const Ht = {
1677
1233
  }
1678
1234
  // position: { x: 0, y: 0 },
1679
1235
  // size: { width: 100, height: 50 }
1680
- }, yr = {
1236
+ }, wr = {
1681
1237
  handleSize: 3.5,
1682
1238
  placeholder: "Your text..."
1683
- }, an = (p = 0, e = 0, a = 100, i = 50, h = "", c = { ...Ht }) => ({
1684
- id: Me(),
1239
+ }, gn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Ut }) => ({
1240
+ id: ze(),
1685
1241
  type: "Feature",
1686
1242
  properties: {
1687
1243
  type: "text",
1688
- content: h,
1689
- style: { ...Ht, ...c }
1244
+ content: l,
1245
+ style: { ...Ut, ...c }
1690
1246
  },
1691
1247
  geometry: {
1692
1248
  type: "Polygon",
1693
1249
  coordinates: [
1694
1250
  [
1695
- [p, e],
1696
- [p + a, e],
1697
- [p + a, e + i],
1698
- [p, e + i],
1699
- [p, e]
1251
+ [h, e],
1252
+ [h + s, e],
1253
+ [h + s, e + i],
1254
+ [h, e + i],
1255
+ [h, e]
1700
1256
  ]
1701
1257
  ]
1702
1258
  }
1703
1259
  });
1704
- var Mr = { exports: {} };
1705
- (function(p, e) {
1706
- (function(a, i) {
1707
- p.exports = i();
1708
- })(qr, () => (() => {
1709
- var a = { d: (r, n) => {
1710
- for (var l in n)
1711
- a.o(n, l) && !a.o(r, l) && Object.defineProperty(r, l, { enumerable: !0, get: n[l] });
1260
+ var Hr = { exports: {} };
1261
+ (function(h, e) {
1262
+ (function(s, i) {
1263
+ h.exports = i();
1264
+ })(cn, () => (() => {
1265
+ var s = { d: (r, n) => {
1266
+ for (var a in n)
1267
+ s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1712
1268
  }, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
1713
- function h(r) {
1714
- return h = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1269
+ function l(r) {
1270
+ return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1715
1271
  return typeof n;
1716
1272
  } : function(n) {
1717
1273
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1718
- }, h(r);
1719
- }
1720
- a.d(i, { default: () => Xe });
1721
- var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, g = /\bsmall-caps\b/, m = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, s = 13.3333333, d = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1722
- function A(r) {
1723
- var n = "", l = this;
1724
- return l.style && l.style !== "normal" && (n += l.style), l.variant && l.variant !== "normal" && (n += (n ? " " : "") + l.variant), l.weight && l.weight !== "normal" && (n += (n ? " " : "") + l.weight), l.size && (n += (n ? " " : "") + l.size + "px", l.height !== l.size && (n += "/" + l.height + "px")), l.family && (n += (n ? " " : "") + l.family), r && (n += "::" + l.baseline), r && (n += "::" + l.color), n;
1725
- }
1726
- var _ = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: A, valueOf: A };
1727
- function R(r) {
1728
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = c.exec(r);
1729
- n.family = (l[6] || "").trim();
1730
- var t = d[l[2]] || parseFloat(l[2]);
1731
- l[3] === "%" ? t *= 0.16 : l[3] === "em" ? t *= 16 : l[3] === "pt" && (t *= s), n.size = t;
1732
- var o = parseFloat(l[4]);
1733
- if (o !== "normal" && o !== "inherit" && o ? l[5] && l[5] !== "em" ? l[5] === "pt" ? n.height = o * s : l[5] === "%" ? n.height = 0.01 * t : n.height = o : n.height = o * t : n.height = Math.round(t * (7 / 6)), g.test(l[1]) && (n.variant = "small-caps"), m.test(l[1]) && (n.style = "italic"), f.test(l[1]))
1274
+ }, l(r);
1275
+ }
1276
+ s.d(i, { default: () => Ke });
1277
+ var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, f = /\bsmall-caps\b/, p = /\b(?:italic|oblique)\b/, d = /\bbold(?:er)?\b/, v = 13.3333333, y = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1278
+ function _(r) {
1279
+ var n = "", a = this;
1280
+ return a.style && a.style !== "normal" && (n += a.style), a.variant && a.variant !== "normal" && (n += (n ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (n += (n ? " " : "") + a.weight), a.size && (n += (n ? " " : "") + a.size + "px", a.height !== a.size && (n += "/" + a.height + "px")), a.family && (n += (n ? " " : "") + a.family), r && (n += "::" + a.baseline), r && (n += "::" + a.color), n;
1281
+ }
1282
+ var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: _, valueOf: _ };
1283
+ function E(r) {
1284
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
1285
+ n.family = (a[6] || "").trim();
1286
+ var t = y[a[2]] || parseFloat(a[2]);
1287
+ a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), n.size = t;
1288
+ var o = parseFloat(a[4]);
1289
+ if (o !== "normal" && o !== "inherit" && o ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = o * v : a[5] === "%" ? n.height = 0.01 * t : n.height = o : n.height = o * t : n.height = Math.round(t * (7 / 6)), f.test(a[1]) && (n.variant = "small-caps"), p.test(a[1]) && (n.style = "italic"), d.test(a[1]))
1734
1290
  n.weight = "bold";
1735
1291
  else {
1736
- var u = parseInt(/\b(\d+)\b/.exec(l[1]), 10);
1292
+ var u = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1737
1293
  u >= 100 && u !== 400 && (n.weight = u);
1738
1294
  }
1739
1295
  return n;
1740
1296
  }
1741
1297
  function P() {
1742
- var r, n, l, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, y = 12, v = null, w = null, b = "";
1298
+ var r, n, a, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, g = 12, m = null, w = null, b = "";
1743
1299
  if (t && t.nodeType) {
1744
- var S = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), I = S.getComputedStyle(t, null);
1745
- r = I.getPropertyValue("font-family") || "", y = parseFloat(I.getPropertyValue("font-size")), u = I.getPropertyValue("line-height"), v = I.getPropertyValue("font-weight"), w = I.getPropertyValue("font-style"), b = I.getPropertyValue("font-variant") || "";
1300
+ var A = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), R = A.getComputedStyle(t, null);
1301
+ r = R.getPropertyValue("font-family") || "", g = parseFloat(R.getPropertyValue("font-size")), u = R.getPropertyValue("line-height"), m = R.getPropertyValue("font-weight"), w = R.getPropertyValue("font-style"), b = R.getPropertyValue("font-variant") || "";
1746
1302
  } else if (typeof t == "string") {
1747
- var T = R(t);
1748
- r = T.family, y = T.size, u = T.height, b = T.variant, w = T.style, v = T.weight;
1303
+ var k = E(t);
1304
+ r = k.family, g = k.size, u = k.height, b = k.variant, w = k.style, m = k.weight;
1749
1305
  } else
1750
- h(t) === "object" && (r = t.family, y = t.size, u = t.height, b = t.variant, v = t.weight, w = t.style, n = t.baseline, l = t.color);
1751
- o.size && o.size < 3 && (y *= o.size), u = u !== "normal" && u ? parseFloat(u) : y * (7 / 6), o.height && o.height < 3 && (u *= o.height);
1752
- var C = Object.create(_);
1753
- return C.family = o.family || r || "sans-serif", C.height = u ?? 14, C.size = y ?? 12, C.variant = o.variant || b || "", C.style = o.style || w || "", C.weight = o.weight || v || "", C.baseline = n || 0, o.baseline != null && (C.baseline = o.baseline), C.color = o.color || l || "", C.id = A.call(C, !0), C;
1306
+ l(t) === "object" && (r = t.family, g = t.size, u = t.height, b = t.variant, m = t.weight, w = t.style, n = t.baseline, a = t.color);
1307
+ o.size && o.size < 3 && (g *= o.size), u = u !== "normal" && u ? parseFloat(u) : g * (7 / 6), o.height && o.height < 3 && (u *= o.height);
1308
+ var O = Object.create(C);
1309
+ return O.family = o.family || r || "sans-serif", O.height = u ?? 14, O.size = g ?? 12, O.variant = o.variant || b || "", O.style = o.style || w || "", O.weight = o.weight || m || "", O.baseline = n || 0, o.baseline != null && (O.baseline = o.baseline), O.color = o.color || a || "", O.id = _.call(O, !0), O;
1754
1310
  }
1755
- const E = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1756
- var M, j = function(r) {
1311
+ const S = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1312
+ var $, L = function(r) {
1757
1313
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
1758
1314
  if (n && n.getContext) {
1759
- var l = n.getContext("2d");
1760
- if (l && typeof l.measureText == "function")
1315
+ var a = n.getContext("2d");
1316
+ if (a && typeof a.measureText == "function")
1761
1317
  return function(t, o) {
1762
- return l.font = String(o), l.measureText(t).width;
1318
+ return a.font = String(o), a.measureText(t).width;
1763
1319
  };
1764
1320
  }
1765
- }(typeof document < "u" ? document : null) || (M = {}, function(r, n) {
1766
- if (!M[n]) {
1767
- var l = P(n);
1768
- M[n] = l, /\bmonospace\b/.test(l.family) ? l.size *= 0.6 : (l.size *= 0.45, l.weight && (l.size *= 1.18));
1321
+ }(typeof document < "u" ? document : null) || ($ = {}, function(r, n) {
1322
+ if (!$[n]) {
1323
+ var a = P(n);
1324
+ $[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1769
1325
  }
1770
- return r.length * M[n].size;
1771
- }), k = {}, N = { trim: !0, collapse: !0 };
1772
- function H(r, n, l) {
1773
- var t = Object.assign({}, N, l), o = String(r);
1326
+ return r.length * $[n].size;
1327
+ }), T = {}, B = { trim: !0, collapse: !0 };
1328
+ function N(r, n, a) {
1329
+ var t = Object.assign({}, B, a), o = String(r);
1774
1330
  if (!o)
1775
1331
  return 0;
1776
- if (o in E) {
1332
+ if (o in S) {
1777
1333
  var u = n.id + "/" + o;
1778
- return u in k || (k[u] = j("_".concat(o, "_"), n) - j("__", n)), k[u];
1334
+ return u in T || (T[u] = L("_".concat(o, "_"), n) - L("__", n)), T[u];
1779
1335
  }
1780
- return t.trim && t.collapse ? t.trim ? o = o.trim() : t.collapse && (o = o.replace(/\s+/g, " ")) : o = o.replace(/\n/g, " "), j(o, n) + n.size * (r.tracking || 0);
1336
+ return t.trim && t.collapse ? t.trim ? o = o.trim() : t.collapse && (o = o.replace(/\s+/g, " ")) : o = o.replace(/\n/g, " "), L(o, n) + n.size * (r.tracking || 0);
1781
1337
  }
1782
- function st(r) {
1783
- return st = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1338
+ function it(r) {
1339
+ return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1784
1340
  return typeof n;
1785
1341
  } : function(n) {
1786
1342
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1787
- }, st(r);
1343
+ }, it(r);
1788
1344
  }
1789
1345
  function xt(r, n) {
1790
1346
  if (typeof n != "function" && n !== null)
1791
1347
  throw new TypeError("Super expression must either be null or a function");
1792
- r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && Ut(r, n);
1348
+ r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
1793
1349
  }
1794
- function Ut(r, n) {
1795
- return Ut = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(l, t) {
1796
- return l.__proto__ = t, l;
1797
- }, Ut(r, n);
1350
+ function qt(r, n) {
1351
+ return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
1352
+ return a.__proto__ = t, a;
1353
+ }, qt(r, n);
1798
1354
  }
1799
- function Wt(r) {
1355
+ function Yt(r) {
1800
1356
  var n = function() {
1801
1357
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1802
1358
  return !1;
@@ -1810,62 +1366,62 @@ var Mr = { exports: {} };
1810
1366
  }
1811
1367
  }();
1812
1368
  return function() {
1813
- var l, t = Rt(r);
1369
+ var a, t = Ot(r);
1814
1370
  if (n) {
1815
- var o = Rt(this).constructor;
1816
- l = Reflect.construct(t, arguments, o);
1371
+ var o = Ot(this).constructor;
1372
+ a = Reflect.construct(t, arguments, o);
1817
1373
  } else
1818
- l = t.apply(this, arguments);
1819
- return fe(this, l);
1374
+ a = t.apply(this, arguments);
1375
+ return pe(this, a);
1820
1376
  };
1821
1377
  }
1822
- function fe(r, n) {
1823
- if (n && (st(n) === "object" || typeof n == "function"))
1378
+ function pe(r, n) {
1379
+ if (n && (it(n) === "object" || typeof n == "function"))
1824
1380
  return n;
1825
1381
  if (n !== void 0)
1826
1382
  throw new TypeError("Derived constructors may only return object or undefined");
1827
- return function(l) {
1828
- if (l === void 0)
1383
+ return function(a) {
1384
+ if (a === void 0)
1829
1385
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1830
- return l;
1386
+ return a;
1831
1387
  }(r);
1832
1388
  }
1833
- function Rt(r) {
1834
- return Rt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
1389
+ function Ot(r) {
1390
+ return Ot = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
1835
1391
  return n.__proto__ || Object.getPrototypeOf(n);
1836
- }, Rt(r);
1392
+ }, Ot(r);
1837
1393
  }
1838
- function Ct(r, n) {
1394
+ function Pt(r, n) {
1839
1395
  if (!(r instanceof n))
1840
1396
  throw new TypeError("Cannot call a class as a function");
1841
1397
  }
1842
- function Yt(r, n) {
1843
- for (var l = 0; l < n.length; l++) {
1844
- var t = n[l];
1845
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, y) {
1846
- if (st(u) !== "object" || u === null)
1398
+ function Xt(r, n) {
1399
+ for (var a = 0; a < n.length; a++) {
1400
+ var t = n[a];
1401
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
1402
+ if (it(u) !== "object" || u === null)
1847
1403
  return u;
1848
- var v = u[Symbol.toPrimitive];
1849
- if (v !== void 0) {
1850
- var w = v.call(u, y);
1851
- if (st(w) !== "object")
1404
+ var m = u[Symbol.toPrimitive];
1405
+ if (m !== void 0) {
1406
+ var w = m.call(u, g);
1407
+ if (it(w) !== "object")
1852
1408
  return w;
1853
1409
  throw new TypeError("@@toPrimitive must return a primitive value.");
1854
1410
  }
1855
1411
  return String(u);
1856
- }(t.key, "string"), st(o) === "symbol" ? o : String(o)), t);
1412
+ }(t.key, "string"), it(o) === "symbol" ? o : String(o)), t);
1857
1413
  }
1858
1414
  var o;
1859
1415
  }
1860
- function et(r, n, l) {
1861
- return n && Yt(r.prototype, n), l && Yt(r, l), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1416
+ function tt(r, n, a) {
1417
+ return n && Xt(r.prototype, n), a && Xt(r, a), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1862
1418
  }
1863
- var F = function() {
1419
+ var D = function() {
1864
1420
  function r() {
1865
1421
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1866
- Ct(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
1422
+ Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
1867
1423
  }
1868
- return et(r, [{ key: "clone", value: function() {
1424
+ return tt(r, [{ key: "clone", value: function() {
1869
1425
  var n = new r(this.value);
1870
1426
  return n.value = this.value, n.weight = this.weight, n.style = this.style, n.font = this.font, n.href = this.href, n.sub = this.sub, n.sup = this.sup, n;
1871
1427
  } }, { key: "valueOf", value: function() {
@@ -1874,42 +1430,42 @@ var Mr = { exports: {} };
1874
1430
  return this.value;
1875
1431
  } }]), r;
1876
1432
  }(), at = function(r) {
1877
- xt(l, r);
1878
- var n = Wt(l);
1879
- function l() {
1880
- return Ct(this, l), n.apply(this, arguments);
1433
+ xt(a, r);
1434
+ var n = Yt(a);
1435
+ function a() {
1436
+ return Pt(this, a), n.apply(this, arguments);
1881
1437
  }
1882
- return et(l);
1883
- }(F), Z = function(r) {
1884
- xt(l, r);
1885
- var n = Wt(l);
1886
- function l() {
1887
- return Ct(this, l), n.apply(this, arguments);
1438
+ return tt(a);
1439
+ }(D), X = function(r) {
1440
+ xt(a, r);
1441
+ var n = Yt(a);
1442
+ function a() {
1443
+ return Pt(this, a), n.apply(this, arguments);
1888
1444
  }
1889
- return et(l);
1890
- }(F), ht = function(r) {
1891
- xt(l, r);
1892
- var n = Wt(l);
1893
- function l() {
1894
- return Ct(this, l), n.apply(this, arguments);
1445
+ return tt(a);
1446
+ }(D), ht = function(r) {
1447
+ xt(a, r);
1448
+ var n = Yt(a);
1449
+ function a() {
1450
+ return Pt(this, a), n.apply(this, arguments);
1895
1451
  }
1896
- return et(l);
1897
- }(F), Pt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, de = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Vt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, pe = /^(?:[;\xAD%?…]|,(?!\d))/, ge = /^[´±°¢£¤$¥\u2212]/;
1898
- function St(r, n) {
1452
+ return tt(a);
1453
+ }(D), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Gt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
1454
+ function At(r, n) {
1899
1455
  n !== !1 && (r = r.trim());
1900
- for (var l, t, o = [], u = r.charAt(0), y = 0, v = 1, w = r.length; v < w; v++) {
1901
- l = r.charAt(v), t = r.charAt(v + 1);
1902
- var b = Pt.test(u), S = Pt.test(l), I = S || b, T = void 0;
1903
- if ((ge.test(l) && !Vt.test(u) || pe.test(u + t) && !Vt.test(l)) && (I = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((T = Pt.test(r.charAt(v - 2))) && !S && (I = !1), !T && de.test(l + t) && (I = !0)), I) {
1904
- var C = r.slice(y, v);
1905
- /\u00AD$/.test(C) ? (o.push(new F(C.slice(0, -1))), o.push(new ht())) : (o.push(new F(C)), o.push(new at())), y = v;
1456
+ for (var a, t, o = [], u = r.charAt(0), g = 0, m = 1, w = r.length; m < w; m++) {
1457
+ a = r.charAt(m), t = r.charAt(m + 1);
1458
+ var b = Rt.test(u), A = Rt.test(a), R = A || b, k = void 0;
1459
+ if ((me.test(a) && !Gt.test(u) || ve.test(u + t) && !Gt.test(a)) && (R = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((k = Rt.test(r.charAt(m - 2))) && !A && (R = !1), !k && ye.test(a + t) && (R = !0)), R) {
1460
+ var O = r.slice(g, m);
1461
+ /\u00AD$/.test(O) ? (o.push(new D(O.slice(0, -1))), o.push(new ht())) : (o.push(new D(O)), o.push(new at())), g = m;
1906
1462
  }
1907
- u = l;
1463
+ u = a;
1908
1464
  }
1909
- return o.push(new F(r.slice(y))), o;
1465
+ return o.push(new D(r.slice(g))), o;
1910
1466
  }
1911
- const ye = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1912
- var De = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, qt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Xt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Zt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, At = { b: function(r) {
1467
+ const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1468
+ var Ne = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Jt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Zt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, Et = { b: function(r) {
1913
1469
  r.weight = "bold";
1914
1470
  }, strong: function(r) {
1915
1471
  r.weight = "bold";
@@ -1935,37 +1491,37 @@ var Mr = { exports: {} };
1935
1491
  r.sub = !0;
1936
1492
  }, sup: function(r) {
1937
1493
  r.sup = !0;
1938
- } }, Fe = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1939
- function Gt(r) {
1940
- return r.replace(Zt, function(n, l, t, o) {
1941
- if (l || t) {
1942
- var u = l ? 10 : 16;
1943
- return String.fromCharCode(parseInt(l || t, u));
1494
+ } }, Be = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1495
+ function Qt(r) {
1496
+ return r.replace(Kt, function(n, a, t, o) {
1497
+ if (a || t) {
1498
+ var u = a ? 10 : 16;
1499
+ return String.fromCharCode(parseInt(a || t, u));
1944
1500
  }
1945
- return o in ye ? ye[o] : n;
1501
+ return o in be ? be[o] : n;
1946
1502
  });
1947
1503
  }
1948
- function Le(r) {
1504
+ function He(r) {
1949
1505
  return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
1950
1506
  }
1951
- var ze = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1952
- function Ot(r) {
1953
- var n, l = {};
1507
+ var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1508
+ function Lt(r) {
1509
+ var n, a = {};
1954
1510
  if (r) {
1955
1511
  do
1956
- if (n = ze.exec(r)) {
1957
- var t = Gt(Le(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1958
- if (l[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1512
+ if (n = We.exec(r)) {
1513
+ var t = Qt(He(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1514
+ if (a[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1959
1515
  throw new Error("Attribute error");
1960
1516
  }
1961
1517
  while (n && r.length);
1962
1518
  if (/\S/.test(r))
1963
1519
  throw new Error("Attribute error");
1964
1520
  }
1965
- return l;
1521
+ return a;
1966
1522
  }
1967
- const Et = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1968
- var me = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, ve = /^%[^\n]+(?:\n|$)/, jt = /^[^#$%&~_^\\{}]+/, Ne = /^\\([&{}$%#_])/, He = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Jt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, B = { bf: function(r) {
1523
+ const _t = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1524
+ var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, Ue = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, te = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, H = { bf: function(r) {
1969
1525
  r.weight = "bold";
1970
1526
  }, it: function(r) {
1971
1527
  r.style = "italic";
@@ -1980,40 +1536,40 @@ var Mr = { exports: {} };
1980
1536
  }, _: function(r) {
1981
1537
  r.sub = !0;
1982
1538
  }, par: function(r) {
1983
- this.tokens.push(new Z(), new Z());
1539
+ this.tokens.push(new X(), new X());
1984
1540
  }, newline: function(r) {
1985
- this.tokens.push(new Z());
1541
+ this.tokens.push(new X());
1986
1542
  }, url: function(r, n) {
1987
- this.open_context().href = n, this.add_token(new F(n)), this.close_context();
1543
+ this.open_context().href = n, this.add_token(new D(n)), this.close_context();
1988
1544
  } };
1989
- B.textsuperscript = B["^"], B.textsubscript = B._, B.textsl = B.sl, B.mathbf = B.bf, B.mathit = B.it, B.textbf = B.bf, B.textit = B.it, B.textcolor = B.color;
1990
- var Be = /[\r\n\xA0]+/g;
1991
- function be(r, n) {
1545
+ H.textsuperscript = H["^"], H.textsubscript = H._, H.textsl = H.sl, H.mathbf = H.bf, H.mathit = H.it, H.textbf = H.bf, H.textit = H.it, H.textcolor = H.color;
1546
+ var qe = /[\r\n\xA0]+/g;
1547
+ function Ae(r, n) {
1992
1548
  r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
1993
- var l = n;
1994
- return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (l = P(n, r)), l;
1549
+ var a = n;
1550
+ return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = P(n, r)), a;
1995
1551
  }
1996
- function Kt(r, n, l) {
1997
- for (var t, o, u = r.width; u + l.width > n && r.length; )
1998
- o = (t = r[r.length - 1]).width, t.width > l.width ? (t.value = t.value.slice(0, -1), t.width = H(t, t.font), u += t.width) : r.pop(), u -= o;
1999
- r[r.length - 1] instanceof ht && r.pop(), t = r[r.length - 1] || t || {}, l.font = P(l.font, t.bold, t.italic, ""), l.href = r.length ? t.href : null, l.rel = r.length ? t.rel : null, l.target = r.length ? t.target : null, r.push(l);
1552
+ function ee(r, n, a) {
1553
+ for (var t, o, u = r.width; u + a.width > n && r.length; )
1554
+ o = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = N(t, t.font), u += t.width) : r.pop(), u -= o;
1555
+ r[r.length - 1] instanceof ht && r.pop(), t = r[r.length - 1] || t || {}, a.font = P(a.font, t.bold, t.italic, ""), a.href = r.length ? t.href : null, a.rel = r.length ? t.rel : null, a.target = r.length ? t.target : null, r.push(a);
2000
1556
  }
2001
1557
  function ot(r) {
2002
1558
  return Math.round(1e6 * r) / 1e6;
2003
1559
  }
2004
- function we(r) {
1560
+ function Ee(r) {
2005
1561
  return function(n) {
2006
1562
  if (Array.isArray(n))
2007
1563
  return $t(n);
2008
1564
  }(r) || function(n) {
2009
1565
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
2010
1566
  return Array.from(n);
2011
- }(r) || function(n, l) {
1567
+ }(r) || function(n, a) {
2012
1568
  if (n) {
2013
1569
  if (typeof n == "string")
2014
- return $t(n, l);
1570
+ return $t(n, a);
2015
1571
  var t = Object.prototype.toString.call(n).slice(8, -1);
2016
- return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n, l) : void 0;
1572
+ return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n, a) : void 0;
2017
1573
  }
2018
1574
  }(r) || function() {
2019
1575
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -2022,128 +1578,128 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2022
1578
  }
2023
1579
  function $t(r, n) {
2024
1580
  (n == null || n > r.length) && (n = r.length);
2025
- for (var l = 0, t = new Array(n); l < n; l++)
2026
- t[l] = r[l];
1581
+ for (var a = 0, t = new Array(n); a < n; a++)
1582
+ t[a] = r[a];
2027
1583
  return t;
2028
1584
  }
2029
- var xe = { center: "middle", right: "end" }, Qt = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, te = function(r, n) {
1585
+ var _e = { center: "middle", right: "end" }, re = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ne = function(r, n) {
2030
1586
  return !r && !n || r === n;
2031
1587
  };
2032
- function Ue(r, n) {
2033
- var l = [], t = n.font(), o = t.size, u = t.family, y = n.align(), v = n.createElement();
1588
+ function Ye(r, n) {
1589
+ var a = [], t = n.font(), o = t.size, u = t.family, g = n.align(), m = n.createElement();
2034
1590
  if (r.length) {
2035
- var w = t.height, b = n.valign(), S = n.height()(), I = n.width()(0), T = !isFinite(I) && r.length === 1, C = T ? null : n.x(), D = ot(w / o), U = T ? null : ot(w / (1.15 * o + (w - o) / 2));
2036
- if (Qt[b] && isFinite(S)) {
2037
- var L = b === "bottom" ? 1 : 0.5;
2038
- U += (S * L - w * r.length * L) / o;
1591
+ var w = t.height, b = n.valign(), A = n.height()(), R = n.width()(0), k = !isFinite(R) && r.length === 1, O = k ? null : n.x(), j = ot(w / o), W = k ? null : ot(w / (1.15 * o + (w - o) / 2));
1592
+ if (re[b] && isFinite(A)) {
1593
+ var M = b === "bottom" ? 1 : 0.5;
1594
+ W += (A * M - w * r.length * M) / o;
2039
1595
  }
2040
- var O = y === "justify", W = 0;
2041
- y === "right" ? W = I : y === "center" && (W = I / 2);
2042
- for (var z = [], rt = "tspan", J = null, Y = "", $ = function() {
2043
- if (Y) {
2044
- var kt = v(rt, J, Y);
2045
- z.push(kt);
1596
+ var I = g === "justify", U = 0;
1597
+ g === "right" ? U = R : g === "center" && (U = R / 2);
1598
+ for (var z = [], et = "tspan", J = null, V = "", F = function() {
1599
+ if (V) {
1600
+ var Tt = m(et, J, V);
1601
+ z.push(Tt);
2046
1602
  }
2047
- rt = "tspan", J = null, Y = "";
2048
- }, it = 0, nt = r.length; it < nt; it++) {
2049
- var dt = "", vt = "", ct = 0, pt = r[it];
2050
- if (pt.length) {
1603
+ et = "tspan", J = null, V = "";
1604
+ }, nt = 0, rt = r.length; nt < rt; nt++) {
1605
+ var ft = "", mt = "", ct = 0, gt = r[nt];
1606
+ if (gt.length) {
2051
1607
  z = [];
2052
- for (var Ft = 0, se = 0, gt = void 0, K = 0, Te = pt.length; K < Te; K++) {
2053
- var V = pt[K], Q = V.font;
2054
- V.whitespace && Ft++, se += V.width, K && !V.tracking && !ct && te(Q.id, dt) && te(V.class, vt) && te(gt, V.href) ? Y += V.value : ($(), Y = V.value, J = { fontFamily: Q.family !== u ? Q.family : null, fontSize: Q.size !== o ? Q.size : null, fontWeight: Q.weight || null, fontStyle: Q.style || null, fontVariant: Q.variant !== "normal" && Q.variant || null, fill: Q.color || null, baselineShift: Q.baseline ? 100 * Q.baseline + "%" : null, className: V.class || null }, ct && (J.dx = ot(ct), ct = 0), V.tracking && (ct = Q.size * V.tracking), V.href && !gt ? (gt = V.href, rt = "a", J.href = gt, J.rel = V.rel, J.target = V.target) : gt = null, dt = Q.id, vt = V.class);
1608
+ for (var Mt = 0, le = 0, pt = void 0, Z = 0, Pe = gt.length; Z < Pe; Z++) {
1609
+ var q = gt[Z], K = q.font;
1610
+ q.whitespace && Mt++, le += q.width, Z && !q.tracking && !ct && ne(K.id, ft) && ne(q.class, mt) && ne(pt, q.href) ? V += q.value : (F(), V = q.value, J = { fontFamily: K.family !== u ? K.family : null, fontSize: K.size !== o ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: q.class || null }, ct && (J.dx = ot(ct), ct = 0), q.tracking && (ct = K.size * q.tracking), q.href && !pt ? (pt = q.href, et = "a", J.href = pt, J.rel = q.rel, J.target = q.target) : pt = null, ft = K.id, mt = q.class);
2055
1611
  }
2056
- if ($(), T)
2057
- l.push.apply(l, we(z));
1612
+ if (F(), k)
1613
+ a.push.apply(a, Ee(z));
2058
1614
  else {
2059
- var Re = null, oe = it === nt - 1 || pt[pt.length - 1] instanceof Z;
2060
- O && pt.length > 1 && !oe && (Re = ot((I - se) / Ft)), l.push(v.apply(void 0, ["tspan", { wordSpacing: Re, x: C(it) + W, dy: ot(it ? D : U) + "em" }].concat(we(z))));
1615
+ var Re = null, he = nt === rt - 1 || gt[gt.length - 1] instanceof X;
1616
+ I && gt.length > 1 && !he && (Re = ot((R - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: Re, x: O(nt) + U, dy: ot(nt ? j : W) + "em" }].concat(Ee(z))));
2061
1617
  }
2062
1618
  } else
2063
- l.push(v("tspan", { x: C(it), dy: ot(it ? D : U) + "em" }, " "));
1619
+ a.push(m("tspan", { x: O(nt), dy: ot(nt ? j : W) + "em" }, " "));
2064
1620
  }
2065
1621
  }
2066
- return v.apply(void 0, ["text", { fontFamily: u, fontSize: o, textAnchor: xe[y] || "start" }].concat(l));
1622
+ return m.apply(void 0, ["text", { fontFamily: u, fontSize: o, textAnchor: _e[g] || "start" }].concat(a));
2067
1623
  }
2068
- var We = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
2069
- function Ye(r, n, l) {
1624
+ var Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1625
+ function Ge(r, n, a) {
2070
1626
  if (r.length) {
2071
- l.textBaseline = "middle";
2072
- var t = n.font(), o = t.height, u = t.size, y = n.valign(), v = n.height()(), w = n.width()(0), b = n.align(), S = b === "justify", I = 0.5 * o, T = We[y];
2073
- if (T && isFinite(v)) {
2074
- var C = r.length * o;
2075
- I += v * T - C * T;
1627
+ a.textBaseline = "middle";
1628
+ var t = n.font(), o = t.height, u = t.size, g = n.valign(), m = n.height()(), w = n.width()(0), b = n.align(), A = b === "justify", R = 0.5 * o, k = Xe[g];
1629
+ if (k && isFinite(m)) {
1630
+ var O = r.length * o;
1631
+ R += m * k - O * k;
2076
1632
  }
2077
- r.forEach(function(D, U) {
2078
- var L = n.x()(U), O = U * o + I, W = 0, z = 0;
2079
- D.forEach(function(Y) {
2080
- Y.whitespace && W++, z += Y.width;
1633
+ r.forEach(function(j, W) {
1634
+ var M = n.x()(W), I = W * o + R, U = 0, z = 0;
1635
+ j.forEach(function(V) {
1636
+ V.whitespace && U++, z += V.width;
2081
1637
  });
2082
- var rt = 0, J = U === r.length - 1 || D[D.length - 1] instanceof Z;
2083
- S && D.length > 1 && !J && (rt = (w - z) / W), D.forEach(function(Y) {
2084
- l.font = Y.font;
2085
- var $ = Y.font, it = $.baseline ? u * -$.baseline + 0.15 * u : 0;
2086
- l.fillStyle = function(vt, ct) {
2087
- return vt.color ? vt.color : ct.href ? "#00C" : "#000";
2088
- }($, Y);
2089
- var nt = 0;
2090
- if (b === "right" ? nt += w - z : b === "center" ? nt += w / 2 - z / 2 : b === "justify" && (Y.whitespace || Y instanceof Z) && (L += rt), l.fillText(Y.value, L + nt, O + it), Y.href) {
2091
- l.beginPath(), l.strokeStyle = l.fillStyle;
2092
- var dt = Math.floor(O + 0.45 * u) + 0.5;
2093
- l.moveTo(L + nt, dt), l.lineTo(L + nt + Y.width, dt), l.stroke();
1638
+ var et = 0, J = W === r.length - 1 || j[j.length - 1] instanceof X;
1639
+ A && j.length > 1 && !J && (et = (w - z) / U), j.forEach(function(V) {
1640
+ a.font = V.font;
1641
+ var F = V.font, nt = F.baseline ? u * -F.baseline + 0.15 * u : 0;
1642
+ a.fillStyle = function(mt, ct) {
1643
+ return mt.color ? mt.color : ct.href ? "#00C" : "#000";
1644
+ }(F, V);
1645
+ var rt = 0;
1646
+ if (b === "right" ? rt += w - z : b === "center" ? rt += w / 2 - z / 2 : b === "justify" && (V.whitespace || V instanceof X) && (M += et), a.fillText(V.value, M + rt, I + nt), V.href) {
1647
+ a.beginPath(), a.strokeStyle = a.fillStyle;
1648
+ var ft = Math.floor(I + 0.45 * u) + 0.5;
1649
+ a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
2094
1650
  }
2095
- L += Y.width;
1651
+ M += V.width;
2096
1652
  });
2097
1653
  });
2098
1654
  }
2099
1655
  }
2100
- function ee(r) {
2101
- return ee = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1656
+ function ie(r) {
1657
+ return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
2102
1658
  return typeof n;
2103
1659
  } : function(n) {
2104
1660
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
2105
- }, ee(r);
1661
+ }, ie(r);
2106
1662
  }
2107
- function Se(r) {
2108
- for (var n = {}, l = 0; l < r.length; l++) {
2109
- var t = r[l];
2110
- typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t : ee(t) === "object" && t._groups ? n.d3 = t : t && t.nodeType && t.getContext ? n.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? n.ctx = t : t && (n.text = t));
1663
+ function ke(r) {
1664
+ for (var n = {}, a = 0; a < r.length; a++) {
1665
+ var t = r[a];
1666
+ typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t : ie(t) === "object" && t._groups ? n.d3 = t : t && t.nodeType && t.getContext ? n.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? n.ctx = t : t && (n.text = t));
2111
1667
  }
2112
1668
  return n;
2113
1669
  }
2114
- function _t(r) {
2115
- return _t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1670
+ function kt(r) {
1671
+ return kt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
2116
1672
  return typeof n;
2117
1673
  } : function(n) {
2118
1674
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
2119
- }, _t(r);
1675
+ }, kt(r);
2120
1676
  }
2121
- function re(r, n) {
2122
- for (var l = 0; l < n.length; l++) {
2123
- var t = n[l];
2124
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, y) {
2125
- if (_t(u) !== "object" || u === null)
1677
+ function oe(r, n) {
1678
+ for (var a = 0; a < n.length; a++) {
1679
+ var t = n[a];
1680
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
1681
+ if (kt(u) !== "object" || u === null)
2126
1682
  return u;
2127
- var v = u[Symbol.toPrimitive];
2128
- if (v !== void 0) {
2129
- var w = v.call(u, y);
2130
- if (_t(w) !== "object")
1683
+ var m = u[Symbol.toPrimitive];
1684
+ if (m !== void 0) {
1685
+ var w = m.call(u, g);
1686
+ if (kt(w) !== "object")
2131
1687
  return w;
2132
1688
  throw new TypeError("@@toPrimitive must return a primitive value.");
2133
1689
  }
2134
1690
  return String(u);
2135
- }(t.key, "string"), _t(o) === "symbol" ? o : String(o)), t);
1691
+ }(t.key, "string"), kt(o) === "symbol" ? o : String(o)), t);
2136
1692
  }
2137
1693
  var o;
2138
1694
  }
2139
- var Ae = P(), ut = function(r) {
1695
+ var Te = P(), ut = function(r) {
2140
1696
  return typeof r == "function" ? r : function() {
2141
1697
  return r;
2142
1698
  };
2143
1699
  }, G = function() {
2144
1700
  function r(t) {
2145
- if (function(u, y) {
2146
- if (!(u instanceof y))
1701
+ if (function(u, g) {
1702
+ if (!(u instanceof g))
2147
1703
  throw new TypeError("Cannot call a class as a function");
2148
1704
  }(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
2149
1705
  return 1 / 0;
@@ -2155,82 +1711,82 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2155
1711
  for (var o in t)
2156
1712
  typeof this[o] == "function" && this[o](t[o]);
2157
1713
  }
2158
- var n, l;
2159
- return n = r, l = [{ key: "linebreak", value: function(t) {
2160
- var o = this, u = this.props.parser(String(t)), y = this.font(), v = function(w, b, S) {
1714
+ var n, a;
1715
+ return n = r, a = [{ key: "linebreak", value: function(t) {
1716
+ var o = this, u = this.props.parser(String(t)), g = this.font(), m = function(w, b, A) {
2161
1717
  if (!w.length)
2162
1718
  return [];
2163
- var I = b.height(), T = b.width(), C = b.overflowLine(), D = b.overflowWrap(), U = P(S, !0, !1), L = isFinite(I()) ? Math.floor(I() / S.height) : 1 / 0;
2164
- if (!I() && !T(0) || !L)
1719
+ var R = b.height(), k = b.width(), O = b.overflowLine(), j = b.overflowWrap(), W = P(A, !0, !1), M = isFinite(R()) ? Math.floor(R() / A.height) : 1 / 0;
1720
+ if (!R() && !k(0) || !M)
2165
1721
  return [];
2166
- for (var O = 0, W = 0, z = 0, rt = [], J = [], Y = !1; O < w.length && W < L; ) {
2167
- var $ = w[O], it = be($, S);
2168
- if ($.width = H($, it), $.font = it, $.line = W, $.whitespace = $.value in E, $.value && ($.value = $.value.replace(Be, " ")), !(!z && $.whitespace || Y && $.whitespace))
2169
- if ($ instanceof Z)
2170
- z = 0, J = [], rt.push(O + 1), W++;
2171
- else if ($ instanceof at || $ instanceof ht)
2172
- J.push({ index: O, width: z });
2173
- else if ($.whitespace || z + $.width < T(W))
2174
- z += $.width;
1722
+ for (var I = 0, U = 0, z = 0, et = [], J = [], V = !1; I < w.length && U < M; ) {
1723
+ var F = w[I], nt = Ae(F, A);
1724
+ if (F.width = N(F, nt), F.font = nt, F.line = U, F.whitespace = F.value in S, F.value && (F.value = F.value.replace(qe, " ")), !(!z && F.whitespace || V && F.whitespace))
1725
+ if (F instanceof X)
1726
+ z = 0, J = [], et.push(I + 1), U++;
1727
+ else if (F instanceof at || F instanceof ht)
1728
+ J.push({ index: I, width: z });
1729
+ else if (F.whitespace || z + F.width < k(U))
1730
+ z += F.width;
2175
1731
  else if (J.length) {
2176
- var nt = void 0, dt = void 0;
1732
+ var rt = void 0, ft = void 0;
2177
1733
  do {
2178
- dt = !0, nt = J.pop();
2179
- var vt = w[nt.index], ct = void 0;
2180
- vt instanceof ht && (ct = H("-", vt.font), nt.width + ct > T(W) && (dt = !J.length));
2181
- } while (!dt);
2182
- rt.push(nt.index + 1), z = 0, W++, O = nt.index, J = [];
2183
- } else if (D === "break-word") {
2184
- var pt = T(W);
2185
- if (z + $.width > pt) {
2186
- var Ft = $.clone();
1734
+ ft = !0, rt = J.pop();
1735
+ var mt = w[rt.index], ct = void 0;
1736
+ mt instanceof ht && (ct = N("-", mt.font), rt.width + ct > k(U) && (ft = !J.length));
1737
+ } while (!ft);
1738
+ et.push(rt.index + 1), z = 0, U++, I = rt.index, J = [];
1739
+ } else if (j === "break-word") {
1740
+ var gt = k(U);
1741
+ if (z + F.width > gt) {
1742
+ var Mt = F.clone();
2187
1743
  do
2188
- $.value = $.value.slice(0, -1), $.width = H($, $.font), z += $.width;
2189
- while ($.value && $.width > pt);
2190
- Ft.value = Ft.value.slice($.value.length), w.splice(O + 1, 0, new at(), Ft);
1744
+ F.value = F.value.slice(0, -1), F.width = N(F, F.font), z += F.width;
1745
+ while (F.value && F.width > gt);
1746
+ Mt.value = Mt.value.slice(F.value.length), w.splice(I + 1, 0, new at(), Mt);
2191
1747
  }
2192
- rt.push(O + 1), z = 0, W++;
1748
+ et.push(I + 1), z = 0, U++;
2193
1749
  } else
2194
- z += $.width;
2195
- O++, Y = $.whitespace;
1750
+ z += F.width;
1751
+ I++, V = F.whitespace;
2196
1752
  }
2197
- O !== rt[rt.length - 1] && rt.push(O);
2198
- var se = 0, gt = 0, K = rt.map(function(kt) {
2199
- for (var tt, Tt = se; (tt = w[Tt]) && (tt.whitespace || !tt.value); )
2200
- Tt++;
2201
- for (var bt = kt, Ze = null; bt > Tt && (tt = w[bt - 1]) && (tt.whitespace || !(tt.value || tt instanceof ht)); )
2202
- tt instanceof Z && (Ze = tt), bt--;
2203
- tt instanceof ht && (tt.value = "-", tt.width = H("-", tt.font)), se = kt;
2204
- var Lt = w.slice(Tt, bt).filter(function(Ge) {
2205
- return Ge.value;
1753
+ I !== et[et.length - 1] && et.push(I);
1754
+ var le = 0, pt = 0, Z = et.map(function(Tt) {
1755
+ for (var Q, St = le; (Q = w[St]) && (Q.whitespace || !Q.value); )
1756
+ St++;
1757
+ for (var bt = Tt, Qe = null; bt > St && (Q = w[bt - 1]) && (Q.whitespace || !(Q.value || Q instanceof ht)); )
1758
+ Q instanceof X && (Qe = Q), bt--;
1759
+ Q instanceof ht && (Q.value = "-", Q.width = N("-", Q.font)), le = Tt;
1760
+ var zt = w.slice(St, bt).filter(function(tr) {
1761
+ return tr.value;
2206
1762
  });
2207
- return Ze && Lt.push(Ze), Lt.width = Lt.reduce(function(Ge, Lr) {
2208
- return Ge + Lr.width;
2209
- }, 0), Lt.width > gt && (gt = Lt.width), Lt;
1763
+ return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
1764
+ return tr + Vr.width;
1765
+ }, 0), zt.width > pt && (pt = zt.width), zt;
2210
1766
  });
2211
- if (K.hasLineOverflow = !1, C) {
2212
- var Te = C === "ellipsis" ? "…" : C;
2213
- K.forEach(function(kt, tt) {
2214
- var Tt = T(tt);
2215
- if (kt.width > Tt) {
2216
- var bt = new F(Te);
2217
- bt.font = S, bt.width = H(Te, U), Kt(kt, Tt, bt), K.hasLineOverflow = !0;
1767
+ if (Z.hasLineOverflow = !1, O) {
1768
+ var Pe = O === "ellipsis" ? "…" : O;
1769
+ Z.forEach(function(Tt, Q) {
1770
+ var St = k(Q);
1771
+ if (Tt.width > St) {
1772
+ var bt = new D(Pe);
1773
+ bt.font = A, bt.width = N(Pe, W), ee(Tt, St, bt), Z.hasLineOverflow = !0;
2218
1774
  }
2219
1775
  });
2220
1776
  }
2221
- var V = b.overflow() === "ellipsis" ? "…" : b.overflow();
2222
- if (V && O !== w.length) {
2223
- var Q = T(K.length - 1), Re = K[K.length - 1], oe = new F(V);
2224
- oe.font = S, oe.width = H(V, U), Kt(Re, Q, oe), K.hasOverflow = !0;
1777
+ var q = b.overflow() === "ellipsis" ? "…" : b.overflow();
1778
+ if (q && I !== w.length) {
1779
+ var K = k(Z.length - 1), Re = Z[Z.length - 1], he = new D(q);
1780
+ he.font = A, he.width = N(q, W), ee(Re, K, he), Z.hasOverflow = !0;
2225
1781
  } else
2226
- K.hasOverflow = !1;
2227
- return K.font = S, K.width = gt, K;
2228
- }(u, this, y);
2229
- return v.height = v.length * y.height, v.render = function(w) {
2230
- return o.render(v, w);
2231
- }, v.svg = v.render, v.draw = v.render, v;
1782
+ Z.hasOverflow = !1;
1783
+ return Z.font = A, Z.width = pt, Z;
1784
+ }(u, this, g);
1785
+ return m.height = m.length * g.height, m.render = function(w) {
1786
+ return o.render(m, w);
1787
+ }, m.svg = m.render, m.draw = m.render, m;
2232
1788
  } }, { key: "font", value: function(t) {
2233
- return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Ae);
1789
+ return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Te);
2234
1790
  } }, { key: "overflow", value: function(t) {
2235
1791
  return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
2236
1792
  } }, { key: "overflowLine", value: function(t) {
@@ -2266,49 +1822,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2266
1822
  } }, { key: "createElement", value: function(t) {
2267
1823
  return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
2268
1824
  } }, { key: "render", value: function() {
2269
- var t = Se(arguments);
2270
- return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ye(t.text, this, t.ctx) : Ue(t.text, this);
2271
- } }], l && re(n.prototype, l), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1825
+ var t = ke(arguments);
1826
+ return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ge(t.text, this, t.ctx) : Ye(t.text, this);
1827
+ } }], a && oe(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
2272
1828
  }();
2273
- function ft(r) {
2274
- return ft = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1829
+ function dt(r) {
1830
+ return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
2275
1831
  return typeof n;
2276
1832
  } : function(n) {
2277
1833
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
2278
- }, ft(r);
1834
+ }, dt(r);
2279
1835
  }
2280
- function Mt(r, n) {
1836
+ function jt(r, n) {
2281
1837
  (n == null || n > r.length) && (n = r.length);
2282
- for (var l = 0, t = new Array(n); l < n; l++)
2283
- t[l] = r[l];
1838
+ for (var a = 0, t = new Array(n); a < n; a++)
1839
+ t[a] = r[a];
2284
1840
  return t;
2285
1841
  }
2286
- function Ve(r, n) {
2287
- for (var l = 0; l < n.length; l++) {
2288
- var t = n[l];
2289
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, y) {
2290
- if (ft(u) !== "object" || u === null)
1842
+ function Je(r, n) {
1843
+ for (var a = 0; a < n.length; a++) {
1844
+ var t = n[a];
1845
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(u, g) {
1846
+ if (dt(u) !== "object" || u === null)
2291
1847
  return u;
2292
- var v = u[Symbol.toPrimitive];
2293
- if (v !== void 0) {
2294
- var w = v.call(u, y);
2295
- if (ft(w) !== "object")
1848
+ var m = u[Symbol.toPrimitive];
1849
+ if (m !== void 0) {
1850
+ var w = m.call(u, g);
1851
+ if (dt(w) !== "object")
2296
1852
  return w;
2297
1853
  throw new TypeError("@@toPrimitive must return a primitive value.");
2298
1854
  }
2299
1855
  return String(u);
2300
- }(t.key, "string"), ft(o) === "symbol" ? o : String(o)), t);
1856
+ }(t.key, "string"), dt(o) === "symbol" ? o : String(o)), t);
2301
1857
  }
2302
1858
  var o;
2303
1859
  }
2304
- var ne = function(r) {
1860
+ var se = function(r) {
2305
1861
  return typeof r == "function" ? r : function() {
2306
1862
  return r;
2307
1863
  };
2308
- }, Ee = function() {
1864
+ }, Se = function() {
2309
1865
  function r(t) {
2310
- if (function(u, y) {
2311
- if (!(u instanceof y))
1866
+ if (function(u, g) {
1867
+ if (!(u instanceof g))
2312
1868
  throw new TypeError("Cannot call a class as a function");
2313
1869
  }(this, r), this.props = { width: function() {
2314
1870
  return 1 / 0;
@@ -2319,47 +1875,47 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2319
1875
  typeof this[o] == "function" && this[o](t[o]);
2320
1876
  this.render = this.render.bind(this);
2321
1877
  }
2322
- var n, l;
2323
- return n = r, l = [{ key: "anchor", value: function(t) {
2324
- var o = this.props, u = o.hAnchor, y = o.vAnchor, v = o.width, w = o.height;
1878
+ var n, a;
1879
+ return n = r, a = [{ key: "anchor", value: function(t) {
1880
+ var o = this.props, u = o.hAnchor, g = o.vAnchor, m = o.width, w = o.height;
2325
1881
  if (!arguments.length)
2326
- return [u * v(0), y * w(0)];
1882
+ return [u * m(0), g * w(0)];
2327
1883
  if (typeof t == "string") {
2328
1884
  var b = this.props;
2329
- t.toLowerCase().trim().split(/\s+/).forEach(function(S) {
2330
- S === "top" && (b.vAnchor = -0), S === "middle" && (b.vAnchor = -0.5), S === "bottom" && (b.vAnchor = -1), S === "left" && (b.hAnchor = -0), S === "center" && (b.hAnchor = -0.5), S === "right" && (b.hAnchor = -1);
1885
+ t.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1886
+ A === "top" && (b.vAnchor = -0), A === "middle" && (b.vAnchor = -0.5), A === "bottom" && (b.vAnchor = -1), A === "left" && (b.hAnchor = -0), A === "center" && (b.hAnchor = -0.5), A === "right" && (b.hAnchor = -1);
2331
1887
  });
2332
1888
  }
2333
1889
  return this;
2334
1890
  } }, { key: "width", value: function(t) {
2335
- return arguments.length ? (this.props.width = ne(t), this) : this.props.width;
1891
+ return arguments.length ? (this.props.width = se(t), this) : this.props.width;
2336
1892
  } }, { key: "height", value: function(t) {
2337
- return arguments.length ? (this.props.height = ne(t), this) : this.props.height;
1893
+ return arguments.length ? (this.props.height = se(t), this) : this.props.height;
2338
1894
  } }, { key: "rotate", value: function(t) {
2339
1895
  return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
2340
1896
  } }, { key: "createElement", value: function(t) {
2341
1897
  return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
2342
1898
  } }, { key: "canvas", value: function(t, o) {
2343
- var u, y = t.getContext ? t.getContext("2d") : t;
2344
- return y.save(), y.rotate(this.rotate() * Math.PI / 180), y.translate.apply(y, function(v) {
2345
- if (Array.isArray(v))
2346
- return Mt(v);
2347
- }(u = this.anchor()) || function(v) {
2348
- if (typeof Symbol < "u" && v[Symbol.iterator] != null || v["@@iterator"] != null)
2349
- return Array.from(v);
2350
- }(u) || function(v, w) {
2351
- if (v) {
2352
- if (typeof v == "string")
2353
- return Mt(v, w);
2354
- var b = Object.prototype.toString.call(v).slice(8, -1);
2355
- return b === "Object" && v.constructor && (b = v.constructor.name), b === "Map" || b === "Set" ? Array.from(v) : b === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b) ? Mt(v, w) : void 0;
1899
+ var u, g = t.getContext ? t.getContext("2d") : t;
1900
+ return g.save(), g.rotate(this.rotate() * Math.PI / 180), g.translate.apply(g, function(m) {
1901
+ if (Array.isArray(m))
1902
+ return jt(m);
1903
+ }(u = this.anchor()) || function(m) {
1904
+ if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null)
1905
+ return Array.from(m);
1906
+ }(u) || function(m, w) {
1907
+ if (m) {
1908
+ if (typeof m == "string")
1909
+ return jt(m, w);
1910
+ var b = Object.prototype.toString.call(m).slice(8, -1);
1911
+ return b === "Object" && m.constructor && (b = m.constructor.name), b === "Map" || b === "Set" ? Array.from(m) : b === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b) ? jt(m, w) : void 0;
2356
1912
  }
2357
1913
  }(u) || function() {
2358
1914
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
2359
1915
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2360
- }()), o(y), y.restore(), y;
1916
+ }()), o(g), g.restore(), g;
2361
1917
  } }, { key: "render", value: function() {
2362
- var t = Se(arguments);
1918
+ var t = ke(arguments);
2363
1919
  if (t.d3)
2364
1920
  return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
2365
1921
  if (t.ctx)
@@ -2368,208 +1924,208 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2368
1924
  var o = typeof t.text.render == "function" ? t.text.render() : t.text;
2369
1925
  return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, o);
2370
1926
  }
2371
- } }], l && Ve(n.prototype, l), Object.defineProperty(n, "prototype", { writable: !1 }), r;
2372
- }(), _e = Object.prototype.hasOwnProperty, Dt = {};
2373
- function qe(r) {
2374
- return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, l, t) {
2375
- return l + "-" + t.toLowerCase();
1927
+ } }], a && Je(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1928
+ }(), Ce = Object.prototype.hasOwnProperty, Dt = {};
1929
+ function Ze(r) {
1930
+ return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, t) {
1931
+ return a + "-" + t.toLowerCase();
2376
1932
  })), Dt[r];
2377
1933
  }
2378
- function ke(r, n) {
1934
+ function Oe(r, n) {
2379
1935
  if (Array.isArray(n))
2380
- return n.forEach(function(l) {
2381
- return ke(r, l);
1936
+ return n.forEach(function(a) {
1937
+ return Oe(r, a);
2382
1938
  });
2383
1939
  typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
2384
1940
  }
2385
- function ie(r, n) {
1941
+ function ae(r, n) {
2386
1942
  if (typeof document < "u") {
2387
- var l = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
2388
- if (n && l.setAttribute)
1943
+ var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
1944
+ if (n && a.setAttribute)
2389
1945
  for (var t in n)
2390
- _e.call(n, t) && n[t] != null && l.setAttribute(t === "className" ? "class" : qe(t), n[t]);
2391
- for (var o = arguments.length, u = new Array(o > 2 ? o - 2 : 0), y = 2; y < o; y++)
2392
- u[y - 2] = arguments[y];
2393
- return u != null && u.length && u.forEach(function(v) {
2394
- ke(l, v);
2395
- }), l;
1946
+ Ce.call(n, t) && n[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), n[t]);
1947
+ for (var o = arguments.length, u = new Array(o > 2 ? o - 2 : 0), g = 2; g < o; g++)
1948
+ u[g - 2] = arguments[g];
1949
+ return u != null && u.length && u.forEach(function(m) {
1950
+ Oe(a, m);
1951
+ }), a;
2396
1952
  }
2397
1953
  }
2398
- G.createElement = ie, G.textparser = St, G.defaultparser = St, G.htmlparser = function(r) {
1954
+ G.createElement = ae, G.textparser = At, G.defaultparser = At, G.htmlparser = function(r) {
2399
1955
  r = String(r || "").trim();
2400
- for (var n, l, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, o = [], u = [], y = function(I) {
2401
- for (var T in t)
2402
- t[T] && (I[T] = t[T]);
2403
- o.push(I);
2404
- }, v = function(I) {
2405
- var T = o.length, C = Fe[I];
2406
- if (T && C) {
2407
- for (var D = T - 1; o[D] && (o[D] instanceof at || De.test(o[D].value)); )
2408
- D--;
2409
- for (; C && o[D] && o[D] instanceof Z; )
2410
- D--, C--;
2411
- for (; C-- > 0; )
2412
- o.push(new Z());
1956
+ for (var n, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, o = [], u = [], g = function(R) {
1957
+ for (var k in t)
1958
+ t[k] && (R[k] = t[k]);
1959
+ o.push(R);
1960
+ }, m = function(R) {
1961
+ var k = o.length, O = Be[R];
1962
+ if (k && O) {
1963
+ for (var j = k - 1; o[j] && (o[j] instanceof at || Ne.test(o[j].value)); )
1964
+ j--;
1965
+ for (; O && o[j] && o[j] instanceof X; )
1966
+ j--, O--;
1967
+ for (; O-- > 0; )
1968
+ o.push(new X());
2413
1969
  }
2414
1970
  }; r.length; ) {
2415
1971
  if (n = /^[^<]+/.exec(r))
2416
- St(Gt(n[0]), !1).forEach(y);
1972
+ At(Qt(n[0]), !1).forEach(g);
2417
1973
  else if (!(n = It.exec(r)))
2418
- if (n = qt.exec(r))
2419
- u.length && (t = u.pop()), v(n[1]);
2420
- else if (n = Xt.exec(r)) {
1974
+ if (n = Jt.exec(r))
1975
+ u.length && (t = u.pop()), m(n[1]);
1976
+ else if (n = Zt.exec(r)) {
2421
1977
  var w = n[1];
2422
- v(w), u.push(t), t = Object.create(t), At[w] && At[w](t, "");
2423
- var b = Ot(n[2]);
2424
- w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (l = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && l[1] && (t.color = l[1]), w === "br" && o.push(new Z());
1978
+ m(w), u.push(t), t = Object.create(t), Et[w] && Et[w](t, "");
1979
+ var b = Lt(n[2]);
1980
+ w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && a[1] && (t.color = a[1]), w === "br" && o.push(new X());
2425
1981
  } else
2426
- n = [r.slice(0, 1)], y(new F(n[0]));
1982
+ n = [r.slice(0, 1)], g(new D(n[0]));
2427
1983
  r = r.slice(n[0].length);
2428
1984
  }
2429
- for (var S = o[o.length - 1]; S instanceof Z; )
2430
- o.pop(), S = o[o.length - 1];
1985
+ for (var A = o[o.length - 1]; A instanceof X; )
1986
+ o.pop(), A = o[o.length - 1];
2431
1987
  return o;
2432
1988
  }, G.latexparser = function(r) {
2433
1989
  r = String(r || "").trim();
2434
1990
  var n = [0];
2435
- r = r.replace(/\\verb,(.*?),/, function(L, O) {
2436
- return n.push(O), "\\verb," + (n.length - 1) + ",";
1991
+ r = r.replace(/\\verb,(.*?),/, function(M, I) {
1992
+ return n.push(I), "\\verb," + (n.length - 1) + ",";
2437
1993
  }).replace(/\\\\\n/g, function() {
2438
1994
  return "\\\\";
2439
- }).replace(He, function(L, O, W) {
2440
- return W.charAt(O - 1) === "\\" ? L : Jt[L];
2441
- }).replace(/\n\s+/g, function(L) {
2442
- return /\n/.test(L.slice(1)) ? "\\par " : L;
2443
- }).replace(/\\symbol\{(\d+)\}/, function(L, O, W, z) {
2444
- return z.charAt(W - 1) === "\\" ? L : String.fromCharCode(1 * O);
2445
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(L, O, W, z) {
2446
- return O + W + "{" + z + "}";
2447
- }).replace(/\\verb,(.*?),/, function(L, O) {
2448
- return "\\verb,".concat(n[+O], ",");
1995
+ }).replace(Ve, function(M, I, U) {
1996
+ return U.charAt(I - 1) === "\\" ? M : te[M];
1997
+ }).replace(/\n\s+/g, function(M) {
1998
+ return /\n/.test(M.slice(1)) ? "\\par " : M;
1999
+ }).replace(/\\symbol\{(\d+)\}/, function(M, I, U, z) {
2000
+ return z.charAt(U - 1) === "\\" ? M : String.fromCharCode(1 * I);
2001
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, I, U, z) {
2002
+ return I + U + "{" + z + "}";
2003
+ }).replace(/\\verb,(.*?),/, function(M, I) {
2004
+ return "\\verb,".concat(n[+I], ",");
2449
2005
  });
2450
- for (var l, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, o = [], u = [], y = function(L) {
2451
- for (var O in t)
2452
- t[O] && (L[O] = t[O]);
2453
- return o.push(L), L;
2454
- }, v = function() {
2006
+ for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, o = [], u = [], g = function(M) {
2007
+ for (var I in t)
2008
+ t[I] && (M[I] = t[I]);
2009
+ return o.push(M), M;
2010
+ }, m = function() {
2455
2011
  u.push(t), t = Object.create(t);
2456
2012
  }, w = function() {
2457
2013
  if (!u.length)
2458
2014
  throw new Error("Unexpected }");
2459
2015
  t = u.pop();
2460
- }, b = { tokens: o, open_context: v, close_context: w, add_token: y }; r.length; ) {
2461
- if (l = jt.exec(r))
2462
- St(l[0], !1).forEach(y);
2463
- else if (l = Ne.exec(r))
2464
- y(new F(l[1]));
2465
- else if (!(l = ve.exec(r))) {
2466
- if (l = /^\{/.exec(r))
2467
- v();
2468
- else if (l = /^\}/.exec(r))
2016
+ }, b = { tokens: o, open_context: m, close_context: w, add_token: g }; r.length; ) {
2017
+ if (a = Ft.exec(r))
2018
+ At(a[0], !1).forEach(g);
2019
+ else if (a = Ue.exec(r))
2020
+ g(new D(a[1]));
2021
+ else if (!(a = xe.exec(r))) {
2022
+ if (a = /^\{/.exec(r))
2023
+ m();
2024
+ else if (a = /^\}/.exec(r))
2469
2025
  w();
2470
- else if (!(l = /^\$/.exec(r)))
2471
- if (l = /^\\verb,([^,]+),/.exec(r))
2472
- y(new F(l[1]));
2473
- else if (l = me.exec(r)) {
2474
- var S = l[1].slice(1) || l[1], I = !!l[2];
2475
- if (/^(La)?TeX$/i.test(S)) {
2476
- v(), t.family = "serif";
2477
- var T = void 0;
2478
- S === "LaTeX" && ((T = y(new F("L"))).tracking = -0.25, (T = y(new F("A"))).size = 0.7, T.baseline = 0.3, T.tracking = -0.1), (T = y(new F("T"))).tracking = -0.17, (T = y(new F("E"))).baseline = -0.22, T.tracking = -0.13, T = y(new F("X")), w();
2479
- } else if (S in Et)
2480
- y(new F(Et[S])), I && v();
2481
- else if (S in B) {
2482
- var C = [], D = B[S].length - 1, U = void 0;
2483
- if (D) {
2484
- for (I = !1, r = r.slice(l[0].length - 1); D--; ) {
2485
- if (!(U = /^\{([^}]+)\}/.exec(r)))
2486
- throw new Error(S + " is missing an argument");
2487
- C.push(U[1]), r = r.slice(U[0].length);
2026
+ else if (!(a = /^\$/.exec(r)))
2027
+ if (a = /^\\verb,([^,]+),/.exec(r))
2028
+ g(new D(a[1]));
2029
+ else if (a = we.exec(r)) {
2030
+ var A = a[1].slice(1) || a[1], R = !!a[2];
2031
+ if (/^(La)?TeX$/i.test(A)) {
2032
+ m(), t.family = "serif";
2033
+ var k = void 0;
2034
+ A === "LaTeX" && ((k = g(new D("L"))).tracking = -0.25, (k = g(new D("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = g(new D("T"))).tracking = -0.17, (k = g(new D("E"))).baseline = -0.22, k.tracking = -0.13, k = g(new D("X")), w();
2035
+ } else if (A in _t)
2036
+ g(new D(_t[A])), R && m();
2037
+ else if (A in H) {
2038
+ var O = [], j = H[A].length - 1, W = void 0;
2039
+ if (j) {
2040
+ for (R = !1, r = r.slice(a[0].length - 1); j--; ) {
2041
+ if (!(W = /^\{([^}]+)\}/.exec(r)))
2042
+ throw new Error(A + " is missing an argument");
2043
+ O.push(W[1]), r = r.slice(W[0].length);
2488
2044
  }
2489
- l[0] = /^\{/.exec(r) ? "{" : "", I = !!l[0];
2045
+ a[0] = /^\{/.exec(r) ? "{" : "", R = !!a[0];
2490
2046
  }
2491
- I && v(), B[S].apply(b, [t].concat(C));
2047
+ R && m(), H[A].apply(b, [t].concat(O));
2492
2048
  } else
2493
- console.warn("unknown latex command", S), y(new F(l[1])), I && v();
2049
+ console.warn("unknown latex command", A), g(new D(a[1])), R && m();
2494
2050
  } else
2495
- l = [r.slice(0, 1)], y(new F(l[0]));
2051
+ a = [r.slice(0, 1)], g(new D(a[0]));
2496
2052
  }
2497
- r = r.slice(l[0].length);
2053
+ r = r.slice(a[0].length);
2498
2054
  }
2499
2055
  return o;
2500
- }, G.measureText = function(r, n, l) {
2501
- return H(r, P(n), l);
2502
- }, G.Token = F, G.Break = at, G.LineBreak = Z, G.SoftHyphen = ht, G.Rotator = Ee, Ee.createElement = ie;
2503
- const Xe = G;
2056
+ }, G.measureText = function(r, n, a) {
2057
+ return N(r, P(n), a);
2058
+ }, G.Token = D, G.Break = at, G.LineBreak = X, G.SoftHyphen = ht, G.Rotator = Se, Se.createElement = ae;
2059
+ const Ke = G;
2504
2060
  return i.default;
2505
2061
  })());
2506
- })(Mr);
2507
- var ln = Mr.exports;
2508
- const mr = /* @__PURE__ */ lr(ln);
2509
- function Qe(p) {
2510
- return p.replace(/…$/, "");
2062
+ })(Hr);
2063
+ var pn = Hr.exports;
2064
+ const xr = /* @__PURE__ */ Mr(pn);
2065
+ function nr(h) {
2066
+ return h.replace(/…$/, "");
2511
2067
  }
2512
- function tr(p) {
2513
- return p.children[0].innerHTML;
2068
+ function ir(h) {
2069
+ return h.children[0].innerHTML;
2514
2070
  }
2515
- function hn(p, e) {
2516
- const a = mt(p), { fontSize: i, font: h, padding: c = 0 } = p.properties.style || {};
2517
- if (a.width === a.height && a.width === 0)
2071
+ function yn(h, e) {
2072
+ const s = vt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
2073
+ if (s.width === s.height && s.width === 0)
2518
2074
  return;
2519
- const g = new mr({
2520
- font: `${i}px/${i}px ${h}`.replace(/(px)+/g, "px"),
2521
- width: a.width - c * 2,
2522
- height: a.height - c * 2,
2075
+ const f = new xr({
2076
+ font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
2077
+ width: s.width - c * 2,
2078
+ height: s.height - c * 2,
2523
2079
  align: "left",
2524
2080
  valign: "top",
2525
2081
  x: 0,
2526
2082
  overflow: "ellipsis",
2527
2083
  parser: "html",
2528
- createElement: mr.createElement
2084
+ createElement: xr.createElement
2529
2085
  });
2530
- g.overflowWrap("break-word");
2531
- const m = g.linebreak(
2532
- p.properties.content.replaceAll(`
2086
+ f.overflowWrap("break-word");
2087
+ const p = f.linebreak(
2088
+ h.properties.content.replaceAll(`
2533
2089
  `, "<br>")
2534
- ).render(), f = [...m.children];
2535
- let s = 0;
2536
- const d = [];
2537
- p.properties.content.split(`
2538
- `).forEach((R) => {
2539
- let P = R;
2540
- for (; P.length && s < f.length; ) {
2541
- if (f[s].innerHTML === "&nbsp;") {
2090
+ ).render(), d = [...p.children];
2091
+ let v = 0;
2092
+ const y = [];
2093
+ h.properties.content.split(`
2094
+ `).forEach((E) => {
2095
+ let P = E;
2096
+ for (; P.length && v < d.length; ) {
2097
+ if (d[v].innerHTML === "&nbsp;") {
2542
2098
  P.startsWith(`
2543
- `) || d.push(s), s++;
2099
+ `) || y.push(v), v++;
2544
2100
  break;
2545
2101
  }
2546
- const E = Qe(tr(f[s]));
2547
- P.startsWith(E) && (P = P.slice(E.length).trim()), s++;
2548
- }
2549
- }), d.forEach((R) => m.removeChild(f[R]));
2550
- const A = p.properties.content.match(/(https?:\/\/.*)/gm), _ = A ? A.map((R) => R.split(" ")[0]) : [];
2551
- m.setAttribute("transform", `translate(${c}, ${c})`), _.forEach((R) => {
2552
- let P = R;
2553
- const E = [];
2102
+ const S = nr(ir(d[v]));
2103
+ P.startsWith(S) && (P = P.slice(S.length).trim()), v++;
2104
+ }
2105
+ }), y.forEach((E) => p.removeChild(d[E]));
2106
+ const _ = h.properties.content.match(/(https?:\/\/.*)/gm), C = _ ? _.map((E) => E.split(" ")[0]) : [];
2107
+ p.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((E) => {
2108
+ let P = E;
2109
+ const S = [];
2554
2110
  for (; P.length > 0; ) {
2555
- const M = f.find((k) => !!k.children[0] && k.children[0].tagName === "tspan" && P.startsWith(Qe(tr(k))));
2556
- if (!M)
2111
+ const $ = d.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && P.startsWith(nr(ir(T))));
2112
+ if (!$)
2557
2113
  break;
2558
- E.push(M);
2559
- const j = Qe(M.children[0].innerHTML).length;
2560
- if (!j)
2114
+ S.push($);
2115
+ const L = nr($.children[0].innerHTML).length;
2116
+ if (!L)
2561
2117
  break;
2562
- P = P.slice(j);
2118
+ P = P.slice(L);
2563
2119
  }
2564
- E.forEach((M) => {
2565
- const j = document.createElementNS("http://www.w3.org/2000/svg", "a");
2566
- j.setAttribute("href", R), j.setAttribute("target", "_blank"), j.innerHTML = tr(M), M.children[0].innerHTML = "", M.children[0].appendChild(j);
2120
+ S.forEach(($) => {
2121
+ const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
2122
+ L.setAttribute("href", E), L.setAttribute("target", "_blank"), L.innerHTML = ir($), $.children[0].innerHTML = "", $.children[0].appendChild(L);
2567
2123
  });
2568
- }), e.appendChild(m);
2124
+ }), e.appendChild(p);
2569
2125
  }
2570
- const vr = 20;
2571
- class un extends $r {
2572
- constructor(e, a = {}) {
2126
+ const Ar = 20;
2127
+ class vn extends Br {
2128
+ constructor(e, s = {}) {
2573
2129
  super(
2574
2130
  e,
2575
2131
  `
@@ -2585,130 +2141,126 @@ class un extends $r {
2585
2141
  <textarea wrap="on"></textarea>
2586
2142
  </div>
2587
2143
  `
2588
- ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...Ke }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", q), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
2144
+ ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...rr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", Y), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
2589
2145
  this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
2590
2146
  }), x(this, "_onBlur", () => {
2591
2147
  this.isFocused = !1;
2592
- }), x(this, "startDrawing", (h, c, g = an(h, c, 0, 0, "", Ht)) => {
2593
- this.add(g);
2594
- const m = this.ogma.view.graphToScreenCoordinates({ x: h, y: c });
2595
- this.select(g.id), this.startDragging(this.getById(g.id), m.x, m.y), this.draggedHandle = 6;
2148
+ }), x(this, "startDrawing", (l, c, f = gn(l, c, 0, 0, "", Ut)) => {
2149
+ this.add(f);
2150
+ const p = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2151
+ this.select(f.id), this.startDragging(this.getById(f.id), p.x, p.y), this.draggedHandle = 6;
2596
2152
  }), x(this, "cancelDrawing", () => {
2597
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...Ke }, this.draggedHandle = q, this.isDragging = !1, this.emit(Bt, this.annotation));
2598
- }), x(this, "startDragging", (h, c, g) => {
2599
- this.annotation = h;
2600
- const m = yt(this.annotation), f = mt(this.annotation);
2601
- this.rect.x = m.x, this.rect.y = m.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = c, this.startY = g, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit($e, this.annotation), this.isDragging = !0;
2602
- }), x(this, "onHandleMouseDown", (h) => {
2153
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
2154
+ }), x(this, "startDragging", (l, c, f) => {
2155
+ this.annotation = l;
2156
+ const p = yt(this.annotation), d = vt(this.annotation);
2157
+ this.rect.x = p.x, this.rect.y = p.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = c, this.startY = f, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Me, this.annotation), this.isDragging = !0;
2158
+ }), x(this, "onHandleMouseDown", (l) => {
2603
2159
  const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
2604
2160
  if (!c)
2605
2161
  return;
2606
2162
  this.selectedId !== c.id && this.select(this.hoveredId);
2607
- const { x: g, y: m } = rr(h, this.ogma.getContainer());
2608
- this.startDragging(c, g, m), this.draggedHandle = Pr(h.target);
2609
- }), x(this, "onMouseMove", (h) => {
2610
- requestAnimationFrame(() => this._onMouseMove(h));
2611
- }), x(this, "_onMouseMove", (h) => {
2163
+ const { x: f, y: p } = sr(l, this.ogma.getContainer());
2164
+ this.startDragging(c, f, p), this.draggedHandle = Lr(l.target);
2165
+ }), x(this, "onMouseMove", (l) => {
2166
+ requestAnimationFrame(() => this._onMouseMove(l));
2167
+ }), x(this, "_onMouseMove", (l) => {
2612
2168
  if (!this.isDragging)
2613
2169
  return;
2614
- h.stopPropagation(), h.preventDefault();
2615
- const c = this.handles[this.draggedHandle], g = c.classList.contains("top"), m = c.classList.contains("left"), f = c.classList.contains("right"), s = c.classList.contains("bottom"), d = c.classList.contains("line-handle"), { x: A, y: _ } = rr(
2616
- h,
2170
+ l.stopPropagation(), l.preventDefault();
2171
+ const c = this.handles[this.draggedHandle], f = c.classList.contains("top"), p = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom"), y = c.classList.contains("line-handle"), { x: _, y: C } = sr(
2172
+ l,
2617
2173
  this.ogma.getContainer()
2618
- ), R = this.ogma.view.getZoom(), P = (A - this.startX) / R, E = (_ - this.startY) / R, M = this.ogma.view.getAngle(), j = new X(P, E).rotateRadians(M);
2619
- (s && m || g && f) && (j.y = 0, j.x = 0);
2620
- const k = m || d ? this.rect.x + j.x : this.rect.x, N = g || d ? this.rect.y + j.y : this.rect.y, H = Math.max(
2621
- this.rect.width + P * (d || m ? 0 : 1),
2622
- vr
2623
- ), st = Math.max(
2624
- this.rect.height + E * (d || g ? 0 : 1),
2625
- vr
2174
+ ), E = this.ogma.view.getZoom(), P = (_ - this.startX) / E, S = (C - this.startY) / E, $ = this.ogma.view.getAngle(), L = st({ x: P, y: S }, $);
2175
+ (v && p || f && d) && (L.y = 0, L.x = 0);
2176
+ const T = p || y ? this.rect.x + L.x : this.rect.x, B = f || y ? this.rect.y + L.y : this.rect.y, N = Math.max(
2177
+ this.rect.width + P * (y || p ? 0 : 1),
2178
+ Ar
2179
+ ), it = Math.max(
2180
+ this.rect.height + S * (y || f ? 0 : 1),
2181
+ Ar
2626
2182
  );
2627
- Kr(this.annotation, k, N, H, st), this.emit(je, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2183
+ nn(this.annotation, T, B, N, it), this.emit(De, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2628
2184
  }), x(this, "onMouseUp", () => {
2629
- !this.isDragging || this.draggedHandle === q || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Bt, this.annotation), this.isDragging = !1, this.draggedHandle = q);
2630
- }), x(this, "_onMousedown", (h) => {
2631
- h.stopPropagation();
2185
+ !this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
2186
+ }), x(this, "_onMousedown", (l) => {
2187
+ l.stopPropagation();
2632
2188
  }), x(this, "onViewChanged", () => {
2633
- const h = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2634
- document.documentElement.style.setProperty("--handle-scale", `${1 / h}`);
2189
+ const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2190
+ document.documentElement.style.setProperty("--handle-scale", `${1 / l}`);
2635
2191
  }), x(this, "_onInput", () => {
2636
- const h = this.getById(this.selectedId);
2637
- h && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), h.properties.content = this.textArea.value, this.emit(ar, h), this.layer.refresh());
2638
- }), this.showeditorOnHover = !1, this.handleSize = yr.handleSize, this.placeholder = yr.placeholder;
2192
+ const l = this.getById(this.selectedId);
2193
+ l && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), l.properties.content = this.textArea.value, this.emit(cr, l), this.layer.refresh());
2194
+ }), this.showeditorOnHover = !1, this.handleSize = wr.handleSize, this.placeholder = wr.placeholder;
2639
2195
  const i = this.textArea = this.editor.element.querySelector("textarea");
2640
2196
  i.addEventListener("input", this._onInput), i.addEventListener("focus", this._onFocus), i.addEventListener("blur", this._onBlur), i.addEventListener("mousedown", this._onMousedown), i.spellcheck = !1, this.handles = Array.prototype.slice.call(
2641
2197
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2642
2198
  ), this.handles.forEach(
2643
- (h) => h.addEventListener("mousedown", this.onHandleMouseDown)
2199
+ (l) => l.addEventListener("mousedown", this.onHandleMouseDown)
2644
2200
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
2645
2201
  }
2646
2202
  _canRemove() {
2647
2203
  return !this.isFocused;
2648
2204
  }
2649
- detect({ x: e, y: a }, i = 0) {
2650
- const h = new X(e, a), c = this.ogma.view.getAngle();
2651
- return this.elements.find((g) => {
2652
- const { x: m, y: f } = yt(g), { width: s, height: d } = mt(g), A = new X(m, f), { x: _, y: R } = h.sub(A).rotateRadians(-c);
2653
- return _ > -i && _ < s + i && R > -i && R < d + i;
2205
+ detect({ x: e, y: s }, i = 0) {
2206
+ const l = { x: e, y: s }, c = this.ogma.view.getAngle();
2207
+ return this.elements.find((f) => {
2208
+ const { x: p, y: d } = yt(f), { width: v, height: y } = vt(f), _ = { x: p, y: d }, { x: C, y: E } = st(Ct(l, _), -c);
2209
+ return C > -i && C < v + i && E > -i && E < y + i;
2654
2210
  });
2655
2211
  }
2656
2212
  draw(e) {
2657
2213
  e.innerHTML = "";
2658
- const a = "", i = this.ogma.view.getAngle();
2659
- this.elements.forEach((c, g) => {
2660
- const m = `class${g}`, f = mt(c), s = yt(c), d = c.id, {
2661
- color: A,
2662
- fontSize: _,
2663
- font: R,
2214
+ const s = "", i = this.ogma.view.getAngle();
2215
+ this.elements.forEach((c, f) => {
2216
+ const p = `class${f}`, d = vt(c), v = yt(c), y = c.id, {
2217
+ color: _,
2218
+ fontSize: C,
2219
+ font: E,
2664
2220
  strokeColor: P,
2665
- strokeWidth: E,
2666
- strokeType: M,
2667
- background: j
2668
- } = c.properties.style || Ht;
2669
- if (d === this.selectedId)
2221
+ strokeWidth: S,
2222
+ strokeType: $,
2223
+ background: L
2224
+ } = c.properties.style || Ut;
2225
+ if (y === this.selectedId)
2670
2226
  return;
2671
- const k = he("g");
2672
- k.classList.add("annotation-text"), k.setAttribute("fill", `${A}`), k.setAttribute("font-size", `${_}px`), k.setAttribute("font-family", `${R}`);
2673
- const N = he("rect");
2674
- let H = !1;
2675
- M && M !== "none" && (H = !0, N.setAttribute("stroke", P || "black"), N.setAttribute("stroke-width", `${E}`), M === "dashed" && N.setAttribute("stroke-dasharray", "5,5")), (j && j.length || H) && (H = !0, N.setAttribute("fill", j || "transparent")), H && (N.setAttribute("width", `${f.width}`), N.setAttribute("height", `${f.height}`)), k.appendChild(N), hn(c, k);
2676
- const { x: st, y: xt } = new X(s.x, s.y).rotateRadians(
2677
- -i
2678
- );
2679
- k.setAttribute("transform", `translate(${st},${xt})`), k.classList.add(m), k.setAttribute("data-annotation", `${c.id}`), k.setAttribute("data-annotation-type", "text"), e.appendChild(k);
2227
+ const T = de("g");
2228
+ T.classList.add("annotation-text"), T.setAttribute("fill", `${_}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${E}`);
2229
+ const B = de("rect");
2230
+ let N = !1;
2231
+ $ && $ !== "none" && (N = !0, B.setAttribute("stroke", P || "black"), B.setAttribute("stroke-width", `${S}`), $ === "dashed" && B.setAttribute("stroke-dasharray", "5,5")), (L && L.length || N) && (N = !0, B.setAttribute("fill", L || "transparent")), N && (B.setAttribute("width", `${d.width}`), B.setAttribute("height", `${d.height}`)), T.appendChild(B), yn(c, T);
2232
+ const { x: it, y: xt } = st(v, -i);
2233
+ T.setAttribute("transform", `translate(${it},${xt})`), T.classList.add(p), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2680
2234
  });
2681
- const h = he("style");
2682
- h.innerHTML = a, e.firstChild && e.insertBefore(h, e.firstChild);
2235
+ const l = de("style");
2236
+ l.innerHTML = s, e.firstChild && e.insertBefore(l, e.firstChild);
2683
2237
  }
2684
2238
  refreshDrawing() {
2685
2239
  const e = this.ogma.view.getAngle();
2686
- [...this.layer.element.children].forEach((a) => {
2687
- const i = a.getAttribute("data-annotation");
2240
+ [...this.layer.element.children].forEach((s) => {
2241
+ const i = s.getAttribute("data-annotation");
2688
2242
  if (!i)
2689
2243
  return;
2690
- const h = yt(this.getById(i)), { x: c, y: g } = new X(h.x, h.y).rotateRadians(
2691
- -e
2692
- );
2693
- a.setAttribute("transform", `translate(${c},${g})`);
2244
+ const l = yt(this.getById(i)), { x: c, y: f } = st(l, -e);
2245
+ s.setAttribute("transform", `translate(${c},${f})`);
2694
2246
  });
2695
2247
  }
2696
2248
  getDefaultOptions() {
2697
- return Ke;
2249
+ return rr;
2698
2250
  }
2699
2251
  refreshEditor() {
2700
2252
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2701
2253
  return;
2702
- const e = this.getById(this.selectedId) || this.getById(this.hoveredId), a = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2254
+ const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = vt(e), i = this.ogma.view.graphToScreenCoordinates(
2703
2255
  yt(e)
2704
- ), h = this.ogma.view.getZoom(), {
2256
+ ), l = this.ogma.view.getZoom(), {
2705
2257
  font: c,
2706
- fontSize: g,
2707
- color: m,
2708
- background: f,
2709
- padding: s = 0
2710
- } = e.properties.style || Ht, d = (g || 1) * h;
2711
- this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${a.width / 2 * h}px, ${a.height / 2 * h}px)`, this.editor.element.style.width = `${a.width * h}px`, this.editor.element.style.height = `${a.height * h}px`, this.textArea.style.font = `${d} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${d}px`, this.textArea.style.padding = `${h * s}px`, this.textArea.style.lineHeight = `${d}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = m || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2258
+ fontSize: f,
2259
+ color: p,
2260
+ background: d,
2261
+ padding: v = 0
2262
+ } = e.properties.style || Ut, y = (f || 1) * l;
2263
+ this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${s.width / 2 * l}px, ${s.height / 2 * l}px)`, this.editor.element.style.width = `${s.width * l}px`, this.editor.element.style.height = `${s.height * l}px`, this.textArea.style.font = `${y} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${y}px`, this.textArea.style.padding = `${l * v}px`, this.textArea.style.lineHeight = `${y}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2712
2264
  }
2713
2265
  select(e) {
2714
2266
  super.select(e), this.textArea.focus();
@@ -2717,60 +2269,60 @@ class un extends $r {
2717
2269
  super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
2718
2270
  }
2719
2271
  }
2720
- class cn {
2272
+ class mn {
2721
2273
  constructor() {
2722
2274
  x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
2723
2275
  }
2724
- add(e, a, i, h, c) {
2725
- const g = Me(), m = e.id, f = {
2726
- id: g,
2727
- arrow: m,
2276
+ add(e, s, i, l, c) {
2277
+ const f = ze(), p = e.id, d = {
2278
+ id: f,
2279
+ arrow: p,
2728
2280
  target: i,
2729
- targetType: h,
2281
+ targetType: l,
2730
2282
  connectionPoint: c,
2731
- side: a
2283
+ side: s
2732
2284
  };
2733
- return this.links[g] = f, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(g), this.linksByArrowId[m] || (this.linksByArrowId[m] = {}), this.linksByArrowId[m][a] = g, e.properties.link = e.properties.link || {}, e.properties.link[a] = {
2285
+ return this.links[f] = d, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(f), this.linksByArrowId[p] || (this.linksByArrowId[p] = {}), this.linksByArrowId[p][s] = f, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
2734
2286
  id: i,
2735
- side: a,
2736
- type: h,
2287
+ side: s,
2288
+ type: l,
2737
2289
  magnet: c
2738
2290
  }, this;
2739
2291
  }
2740
- arrowIsLinked(e, a) {
2292
+ arrowIsLinked(e, s) {
2741
2293
  var i;
2742
- return !!((i = this.linksByArrowId[e]) != null && i[a]);
2294
+ return !!((i = this.linksByArrowId[e]) != null && i[s]);
2743
2295
  }
2744
2296
  // remove the link between the arrow and the target by arrow id and side
2745
- remove(e, a) {
2746
- var i, h;
2747
- const c = e.id, g = (i = this.linksByArrowId[c]) == null ? void 0 : i[a];
2748
- if ((h = e.properties.link) == null || delete h[a], !g)
2297
+ remove(e, s) {
2298
+ var i, l;
2299
+ const c = e.id, f = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
2300
+ if ((l = e.properties.link) == null || delete l[s], !f)
2749
2301
  return this;
2750
- const m = this.links[g];
2751
- delete this.links[g];
2752
- const f = this.linksByTargetId[m.target];
2753
- for (let s = 0; s < f.length; s++)
2754
- if (f[s] === g) {
2755
- f.splice(s, 1);
2302
+ const p = this.links[f];
2303
+ delete this.links[f];
2304
+ const d = this.linksByTargetId[p.target];
2305
+ for (let v = 0; v < d.length; v++)
2306
+ if (d[v] === f) {
2307
+ d.splice(v, 1);
2756
2308
  break;
2757
2309
  }
2758
- return delete this.linksByArrowId[c][a], this;
2310
+ return delete this.linksByArrowId[c][s], this;
2759
2311
  }
2760
- getArrowLink(e, a) {
2312
+ getArrowLink(e, s) {
2761
2313
  var i;
2762
- const h = (i = this.linksByArrowId[e]) == null ? void 0 : i[a];
2763
- return h ? this.links[h] : null;
2314
+ const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
2315
+ return l ? this.links[l] : null;
2764
2316
  }
2765
- getTargetLinks(e, a) {
2317
+ getTargetLinks(e, s) {
2766
2318
  var i;
2767
- return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((h) => this.links[h]).filter((h) => h.targetType === a)) ?? [];
2319
+ return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
2768
2320
  }
2769
2321
  forEach(e) {
2770
2322
  Object.values(this.links).forEach(e);
2771
2323
  }
2772
2324
  }
2773
- const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type === "text", br = (p) => p.type === "FeatureCollection", fn = {
2325
+ const lt = (h) => h.properties.type === "arrow", wt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", bn = {
2774
2326
  magnetColor: "#3e8",
2775
2327
  detectMargin: 20,
2776
2328
  magnetHandleRadius: 5,
@@ -2780,7 +2332,7 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
2780
2332
  textHandleSize: 3.5,
2781
2333
  minArrowHeight: 20,
2782
2334
  maxArrowHeight: 30
2783
- }, wr = ["start", "end"], xr = [
2335
+ }, _r = ["start", "end"], kr = [
2784
2336
  { x: 0, y: 0 },
2785
2337
  { x: 0.5, y: 0 },
2786
2338
  { x: 1, y: 0 },
@@ -2790,128 +2342,129 @@ const lt = (p) => p.properties.type === "arrow", wt = (p) => p.properties.type =
2790
2342
  { x: 0.5, y: 1 },
2791
2343
  { x: 1, y: 1 }
2792
2344
  ];
2793
- class dn extends jr {
2794
- constructor(e, a = {}) {
2795
- super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new cn()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (i) => {
2345
+ class wn extends Nr {
2346
+ constructor(e, s = {}) {
2347
+ super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new mn()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (i) => {
2796
2348
  if (!this.dragged || this.textToMagnet === void 0)
2797
2349
  return;
2798
2350
  i.beginPath(), i.fillStyle = "green";
2799
- const h = this.ogma.view.getZoom();
2800
- xr.forEach((c) => {
2351
+ const l = this.ogma.view.getZoom();
2352
+ kr.forEach((c) => {
2801
2353
  if (!this.textToMagnet)
2802
2354
  return;
2803
- const g = mt(this.textToMagnet), m = yt(this.textToMagnet), { x: f, y: s } = new X(c.x, c.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2804
- i.moveTo(f, s), i.arc(f, s, this.options.magnetHandleRadius / h, 0, Math.PI * 2);
2355
+ const f = vt(this.textToMagnet), p = yt(this.textToMagnet), d = Fe(c, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), { x: y, y: _ } = Ht(v, p);
2356
+ i.moveTo(y, _), i.arc(y, _, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2805
2357
  }), i.fill(), i.closePath();
2806
- }), x(this, "_onFeatureDrag", (i, h) => {
2807
- const c = h;
2358
+ }), x(this, "_onFeatureDrag", (i, l) => {
2359
+ const c = l;
2808
2360
  if (lt(i) && c === "line")
2809
- ["start", "end"].find((g) => {
2810
- const m = g === "start" ? ue(i) : Ie(i);
2811
- return this._snapToText(i, c, m) || this._findAndSnapToNode(i, g, m);
2361
+ ["start", "end"].find((f) => {
2362
+ const p = f === "start" ? fe(i) : $e(i);
2363
+ return this._snapToText(i, c, p) || this._findAndSnapToNode(i, f, p);
2812
2364
  });
2813
2365
  else if (lt(i) && c !== "line") {
2814
- const g = c === "start" ? ue(i) : Ie(i);
2815
- this._snapToText(i, c, g) || this._findAndSnapToNode(i, c, g);
2366
+ const f = c === "start" ? fe(i) : $e(i);
2367
+ this._snapToText(i, c, f) || this._findAndSnapToNode(i, c, f);
2816
2368
  } else
2817
- wt(i) && (this.activeLinks.forEach(({ arrow: g, side: m, connectionPoint: f }) => {
2818
- const s = this.getAnnotation(g), d = mt(i), A = yt(i), _ = new X(f.x, f.y).mul({ x: d.width, y: d.height }).rotateRadians(this.ogma.view.getAngle()).add(A);
2819
- s.geometry.coordinates[m === "start" ? 0 : 1] = [_.x, _.y];
2369
+ wt(i) && (this.activeLinks.forEach(({ arrow: f, side: p, connectionPoint: d }) => {
2370
+ const v = this.getAnnotation(f), y = vt(i), _ = yt(i), C = Fe(d, { x: y.width, y: y.height }), E = st(C, this.ogma.view.getAngle()), P = Ht(E, _);
2371
+ v.geometry.coordinates[p === "start" ? 0 : 1] = [P.x, P.y];
2820
2372
  }), this.activeLinks.length && this.arrows.refreshLayer());
2821
- this.layer.refresh(), this.emit(je, i, h);
2373
+ this.layer.refresh(), this.emit(De, i, l);
2822
2374
  }), x(this, "_onFeatureDragEnd", (i) => {
2823
- this.dragged !== null && lt(i) && ue(this.dragged) && wr.forEach((h) => {
2824
- this.links.getArrowLink(i.id, h) && this.emit(nn, {
2375
+ this.dragged !== null && lt(i) && fe(this.dragged) && _r.forEach((l) => {
2376
+ this.links.getArrowLink(i.id, l) && this.emit(un, {
2825
2377
  arrow: i,
2826
- link: this.links.getArrowLink(i.id, h)
2378
+ link: this.links.getArrowLink(i.id, l)
2827
2379
  });
2828
- }), (wt(i) || lt(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((h) => h.enableDetection()), this.layer.refresh(), this.emit(Bt, i);
2380
+ }), (wt(i) || lt(i)) && this.onUpdate(i), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Vt, i);
2829
2381
  }), x(this, "_onFeatureDragStart", (i) => {
2830
- this.textToMagnet = void 0, lt(i) ? this.dragged = i : wt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((h) => {
2831
- const c = h.getSelectedFeature();
2832
- c && c !== i && h.unhover().unselect(), h.disableDetection();
2833
- }), this.emit($e, i);
2382
+ this.textToMagnet = void 0, lt(i) ? this.dragged = i : wt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
2383
+ const c = l.getSelectedFeature();
2384
+ c && c !== i && l.unhover().unselect(), l.disableDetection();
2385
+ }), this.emit(Me, i);
2834
2386
  }), x(this, "_onNodesDragStart", () => {
2835
2387
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2836
2388
  }), x(this, "_onNodesDrag", (i) => {
2837
- const { dx: h, dy: c } = i;
2838
- this._moveNodes(i.nodes, h, c);
2389
+ const { dx: l, dy: c } = i;
2390
+ this._moveNodes(i.nodes, l, c);
2839
2391
  }), x(this, "_onLayoutEnd", (i) => {
2840
- i.ids.forEach((h, c) => {
2841
- this.links.getTargetLinks(h, "node").forEach((g) => {
2842
- const m = this.getAnnotation(g.arrow), f = g.side, s = Ce(
2843
- m,
2844
- f === "start" ? "end" : "start"
2845
- ), d = i.positions.current[c], A = this.ogma.getNode(h).getAttribute("radius"), _ = Pe(s, d, +A);
2846
- Nt(m, f, _.x, _.y);
2392
+ i.ids.forEach((l, c) => {
2393
+ this.links.getTargetLinks(l, "node").forEach((f) => {
2394
+ const p = this.getAnnotation(f.arrow), d = f.side, v = Ie(
2395
+ p,
2396
+ d === "start" ? "end" : "start"
2397
+ ), y = i.positions.current[c], _ = this.ogma.getNode(l).getAttribute("radius"), C = Le(v, y, +_);
2398
+ Bt(p, d, C.x, C.y);
2847
2399
  });
2848
2400
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2849
2401
  }), x(this, "_onAdded", (i) => {
2850
- this.emit(or, i);
2402
+ this.emit(ur, i);
2851
2403
  }), x(this, "_onRemoved", (i) => {
2852
- this.emit(sr, i);
2404
+ this.emit(hr, i);
2853
2405
  }), x(this, "_onUnselect", (i) => {
2854
- this.selected = null, this.emit(ir, i);
2406
+ this.selected = null, this.emit(lr, i);
2855
2407
  }), x(this, "_onSelect", (i) => {
2856
- this.selected !== i && (this.selected = i, this.emit(nr, this.selected));
2408
+ this.selected !== i && (this.selected = i, this.emit(ar, this.selected));
2857
2409
  }), x(this, "onUpdate", (i) => {
2858
2410
  cancelAnimationFrame(this.updateTimeout), this.updateTimeout = requestAnimationFrame(
2859
2411
  () => this._onUpdate(i)
2860
2412
  );
2861
2413
  }), x(this, "_onUpdate", (i) => {
2862
- this.emit(ar, i);
2863
- }), this.options = this.setOptions({ ...fn, ...a }), this.ogma = e, this.arrows = new on(e, this.options), this.texts = new un(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2864
- i.on($e, this._onFeatureDragStart).on(je, this._onFeatureDrag).on(Bt, this._onFeatureDragEnd).on(ar, this.onUpdate).on(ir, this._onUnselect).on(nr, this._onSelect).on(or, this._onAdded).on(sr, this._onRemoved);
2414
+ this.emit(cr, i);
2415
+ }), this.options = this.setOptions({ ...bn, ...s }), this.ogma = e, this.arrows = new fn(e, this.options), this.texts = new vn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2416
+ i.on(Me, this._onFeatureDragStart).on(De, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(ur, this._onAdded).on(hr, this._onRemoved);
2865
2417
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2866
2418
  this.refreshTextLinks();
2867
2419
  }), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2868
2420
  }
2869
- _moveNodes(e, a, i) {
2870
- e.forEach((h) => {
2871
- const c = this.links.getTargetLinks(h.getId(), "node"), g = h.getPosition();
2872
- c.forEach((m) => {
2873
- const f = this.getAnnotation(m.arrow), s = m.side, d = Ce(
2874
- f,
2875
- s === "start" ? "end" : "start"
2421
+ _moveNodes(e, s, i) {
2422
+ e.forEach((l) => {
2423
+ const c = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
2424
+ c.forEach((p) => {
2425
+ const d = this.getAnnotation(p.arrow), v = p.side, y = Ie(
2426
+ d,
2427
+ v === "start" ? "end" : "start"
2876
2428
  );
2877
- let A = g;
2878
- const _ = +h.getAttribute("radius"), R = 1e-6;
2879
- (m.connectionPoint.x - (g.x - a) > R || m.connectionPoint.y - (g.y - i) > R) && (A = Pe(d, g, _)), Nt(f, s, A.x, A.y);
2429
+ let _ = f;
2430
+ const C = +l.getAttribute("radius"), E = 1e-6;
2431
+ (p.connectionPoint.x - (f.x - s) > E || p.connectionPoint.y - (f.y - i) > E) && (_ = Le(y, f, C)), Bt(d, v, _.x, _.y);
2880
2432
  });
2881
2433
  }), this.arrows.refreshLayer();
2882
2434
  }
2883
- _snapToText(e, a, i) {
2884
- const h = this.texts.detect(i, this.options.detectMargin);
2885
- if (this.links.remove(e, a), !h)
2435
+ _snapToText(e, s, i) {
2436
+ const l = this.texts.detect(i, this.options.detectMargin);
2437
+ if (this.links.remove(e, s), !l)
2886
2438
  return !1;
2887
- this.textToMagnet = h;
2888
- const c = this.findMagnetPoint(xr, h, i);
2889
- return c ? (Nt(e, a, c.point.x, c.point.y), this.links.add(e, a, h.id, "text", c.magnet), !0) : !1;
2890
- }
2891
- _findAndSnapToNode(e, a, i) {
2892
- const h = this.ogma.view.graphToScreenCoordinates(i), c = this.ogma.view.getElementAt(h);
2893
- this.links.remove(e, a), c && c.isNode ? (this.hoveredNode = c, this.hoveredNode.setSelected(!0), this._snapToNode(e, a, c, h)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2894
- }
2895
- _snapToNode(e, a, i, h) {
2896
- const c = i.getPositionOnScreen(), g = +i.getAttribute("radius"), m = g * this.ogma.view.getZoom(), f = h.x - c.x, s = h.y - c.y, d = Math.sqrt(f * f + s * s), A = i.getPosition();
2897
- if (d < m + this.options.detectMargin) {
2898
- let _ = A;
2899
- if (d > m / 2) {
2900
- const R = Ce(e, a === "end" ? "start" : "end");
2901
- _ = Pe(R, _, g);
2439
+ this.textToMagnet = l;
2440
+ const c = this.findMagnetPoint(kr, l, i);
2441
+ return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
2442
+ }
2443
+ _findAndSnapToNode(e, s, i) {
2444
+ var l, c;
2445
+ const f = this.ogma.view.graphToScreenCoordinates(i), p = this.ogma.view.getElementAt(f);
2446
+ this.links.remove(e, s), p && p.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = p, p.setSelected(!0), this._snapToNode(e, s, p, f)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2447
+ }
2448
+ _snapToNode(e, s, i, l) {
2449
+ const c = i.getPositionOnScreen(), f = +i.getAttribute("radius"), p = f * this.ogma.view.getZoom(), d = l.x - c.x, v = l.y - c.y, y = Math.sqrt(d * d + v * v), _ = i.getPosition();
2450
+ if (y < p + this.options.detectMargin) {
2451
+ let C = _;
2452
+ if (y > p / 2) {
2453
+ const E = Ie(e, s === "end" ? "start" : "end");
2454
+ C = Le(E, C, f);
2902
2455
  }
2903
- Nt(e, a, _.x, _.y), this.links.add(e, a, i.getId(), "node", _);
2456
+ Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
2904
2457
  }
2905
2458
  }
2906
2459
  refreshTextLinks() {
2907
2460
  let e = !1;
2908
2461
  this.links.forEach(
2909
- ({ connectionPoint: a, targetType: i, target: h, arrow: c, side: g }) => {
2462
+ ({ connectionPoint: s, targetType: i, target: l, arrow: c, side: f }) => {
2910
2463
  if (i !== "text")
2911
2464
  return;
2912
2465
  e = !0;
2913
- const m = this.getAnnotation(h), f = this.getAnnotation(c), s = mt(m), d = yt(m), A = new X(a.x, a.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2914
- Nt(f, g, A.x, A.y);
2466
+ const p = this.getAnnotation(l), d = this.getAnnotation(c), v = vt(p), y = yt(p), _ = Fe(s, { x: v.width, y: v.height }), C = st(_, this.ogma.view.getAngle()), E = Ht(C, y);
2467
+ Bt(d, f, E.x, E.y);
2915
2468
  }
2916
2469
  ), e && this.arrows.refreshLayer();
2917
2470
  }
@@ -2921,24 +2474,24 @@ class dn extends jr {
2921
2474
  getSelected() {
2922
2475
  return this.selected;
2923
2476
  }
2924
- findMagnetPoint(e, a, i) {
2925
- let h;
2477
+ findMagnetPoint(e, s, i) {
2478
+ let l;
2926
2479
  for (const c of e) {
2927
- const g = mt(a), m = yt(a), f = new X(c.x, c.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(m), s = f.sub(i).length(), d = Math.min(
2480
+ const f = vt(s), p = yt(s), d = Fe(c, { x: f.width, y: f.height }), v = st(d, this.ogma.view.getAngle()), y = Ht(v, p), _ = Wt(Ct(y, i)), C = Math.min(
2928
2481
  this.options.magnetRadius * this.ogma.view.getZoom(),
2929
2482
  // when really zoomed in: avoid to snap on too far away magnets
2930
- g.width / 2,
2931
- g.height / 2
2483
+ f.width / 2,
2484
+ f.height / 2
2932
2485
  );
2933
- if (s < Math.max(d, this.options.magnetHandleRadius)) {
2934
- h = {
2935
- point: f,
2486
+ if (_ < Math.max(C, this.options.magnetHandleRadius)) {
2487
+ l = {
2488
+ point: y,
2936
2489
  magnet: c
2937
2490
  };
2938
2491
  break;
2939
2492
  }
2940
2493
  }
2941
- return h;
2494
+ return l;
2942
2495
  }
2943
2496
  /**
2944
2497
  * Set the options for the controller
@@ -2956,8 +2509,8 @@ class dn extends jr {
2956
2509
  * @param id the id of the annotation to select
2957
2510
  */
2958
2511
  select(e) {
2959
- const a = this.getAnnotations().features.find((i) => i.id === e);
2960
- return a ? (lt(a) ? this.arrows.select(a.id) : wt(a) && this.texts.select(a.id), this) : this;
2512
+ const s = this.getAnnotations().features.find((i) => i.id === e);
2513
+ return s ? (lt(s) ? this.arrows.select(s.id) : wt(s) && this.texts.select(s.id), this) : this;
2961
2514
  }
2962
2515
  /**
2963
2516
  * Unselects the currently selected annotation
@@ -2970,12 +2523,12 @@ class dn extends jr {
2970
2523
  * @param annotation The annotation to add
2971
2524
  */
2972
2525
  add(e) {
2973
- if (br(e)) {
2974
- const [a, i] = e.features.reduce(
2975
- (h, c) => (lt(c) ? h[1].push(c) : wt(c) && h[0].push(c), h),
2526
+ if (Er(e)) {
2527
+ const [s, i] = e.features.reduce(
2528
+ (l, c) => (lt(c) ? l[1].push(c) : wt(c) && l[0].push(c), l),
2976
2529
  [[], []]
2977
2530
  );
2978
- return a.forEach((h) => this.add(h)), i.forEach((h) => this.add(h)), this.arrows.refreshLayer(), this;
2531
+ return s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2979
2532
  }
2980
2533
  switch (e.properties.type) {
2981
2534
  case "text":
@@ -2992,29 +2545,29 @@ class dn extends jr {
2992
2545
  * @param annotation The annotation(s) to remove
2993
2546
  */
2994
2547
  remove(e) {
2995
- return br(e) ? (e.features.forEach(
2996
- (a) => this.remove(a)
2548
+ return Er(e) ? (e.features.forEach(
2549
+ (s) => this.remove(s)
2997
2550
  ), this) : (lt(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
2998
2551
  }
2999
2552
  loadLink(e) {
3000
2553
  if (e.properties.link)
3001
- for (const a of wr) {
3002
- const i = e.properties.link[a];
2554
+ for (const s of _r) {
2555
+ const i = e.properties.link[s];
3003
2556
  if (!i)
3004
2557
  continue;
3005
- const h = this.getAnnotation(i.id);
3006
- if (i.type === "text" && h)
3007
- this.links.add(e, a, i.id, i.type, i.magnet);
2558
+ const l = this.getAnnotation(i.id);
2559
+ if (i.type === "text" && l)
2560
+ this.links.add(e, s, i.id, i.type, i.magnet);
3008
2561
  else if (i.type === "node") {
3009
2562
  const c = this.ogma.getNode(i.id);
3010
2563
  if (!c)
3011
2564
  continue;
3012
- this.links.add(e, a, i.id, i.type, i.magnet);
3013
- const g = c.getPosition(), m = c.getAttribute("radius") || 0, f = Ce(
2565
+ this.links.add(e, s, i.id, i.type, i.magnet);
2566
+ const f = c.getPosition(), p = c.getAttribute("radius") || 0, d = Ie(
3014
2567
  e,
3015
- a === "start" ? "end" : "start"
3016
- ), s = Pe(f, g, +m);
3017
- Nt(e, a, s.x, s.y);
2568
+ s === "start" ? "end" : "start"
2569
+ ), v = Le(d, f, +p);
2570
+ Bt(e, s, v.x, v.y);
3018
2571
  }
3019
2572
  }
3020
2573
  }
@@ -3024,8 +2577,8 @@ class dn extends jr {
3024
2577
  * @param y coord of the first point
3025
2578
  * @param arrow The arrow to add
3026
2579
  */
3027
- startArrow(e, a, i) {
3028
- this.cancelDrawing(), this.arrows.startDrawing(e, a, i);
2580
+ startArrow(e, s, i) {
2581
+ this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
3029
2582
  }
3030
2583
  /**
3031
2584
  * Start adding a text (add it, and give control to the user)
@@ -3033,23 +2586,23 @@ class dn extends jr {
3033
2586
  * @param y coord of the top left point
3034
2587
  * @param text The text to add
3035
2588
  */
3036
- startText(e, a, i) {
3037
- this.cancelDrawing(), this.texts.startDrawing(e, a, i);
2589
+ startText(e, s, i) {
2590
+ this.cancelDrawing(), this.texts.startDrawing(e, s, i);
3038
2591
  }
3039
2592
  /**
3040
2593
  * Cancel drawing on the current frame
3041
2594
  */
3042
2595
  cancelDrawing() {
3043
- this.annotations.forEach((e) => e.cancelDrawing()), this.emit(rn);
2596
+ this.annotations.forEach((e) => e.cancelDrawing()), this.emit(hn);
3044
2597
  }
3045
2598
  /**
3046
2599
  * Update the style of the annotation with the given id
3047
2600
  * @param id The id of the annotation to update
3048
2601
  * @param style The new style
3049
2602
  */
3050
- updateStyle(e, a) {
3051
- const i = this.getAnnotations().features.find((h) => h.id === e);
3052
- return i ? (lt(i) ? this.arrows.updateStyle(i, a) : wt(i) && this.texts.updateStyle(i, a), this.onUpdate(i), this) : this;
2603
+ updateStyle(e, s) {
2604
+ const i = this.getAnnotations().features.find((l) => l.id === e);
2605
+ return i ? (lt(i) ? this.arrows.updateStyle(i, s) : wt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
3053
2606
  }
3054
2607
  /**
3055
2608
  *
@@ -3060,8 +2613,8 @@ class dn extends jr {
3060
2613
  type: "FeatureCollection",
3061
2614
  features: []
3062
2615
  };
3063
- return this.annotations.forEach((a) => {
3064
- e.features = [...e.features, ...a.getElements()];
2616
+ return this.annotations.forEach((s) => {
2617
+ e.features = [...e.features, ...s.getElements()];
3065
2618
  }), e;
3066
2619
  }
3067
2620
  /**
@@ -3070,7 +2623,7 @@ class dn extends jr {
3070
2623
  * @returns The annotation with the given id
3071
2624
  */
3072
2625
  getAnnotation(e) {
3073
- return this.getAnnotations().features.find((a) => a.id === e);
2626
+ return this.getAnnotations().features.find((s) => s.id === e);
3074
2627
  }
3075
2628
  /**
3076
2629
  * Destroy the controller and its elements
@@ -3079,7 +2632,7 @@ class dn extends jr {
3079
2632
  this.annotations.forEach((e) => e.destroy()), this.layer.destroy();
3080
2633
  }
3081
2634
  }
3082
- const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333", xn = [
2635
+ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Wr = "#333333", Cn = [
3083
2636
  "#FFFFFF",
3084
2637
  "#F44E3B",
3085
2638
  "#FE9200",
@@ -3092,7 +2645,7 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
3092
2645
  "#333333",
3093
2646
  "#808080",
3094
2647
  "#cccccc"
3095
- ], Sn = [
2648
+ ], On = [
3096
2649
  "Roboto",
3097
2650
  "Helvetica Neue",
3098
2651
  "Helvetica",
@@ -3104,120 +2657,120 @@ const Sr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ar = "none", Dr = "#333333",
3104
2657
  "Consolas",
3105
2658
  "Courier New",
3106
2659
  "monospace"
3107
- ].sort((p, e) => p.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), pn = {
2660
+ ].sort((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), xn = {
3108
2661
  head: "arrow",
3109
- strokeColor: Dr,
2662
+ strokeColor: Wr,
3110
2663
  strokeWidth: 5
3111
- }, gn = 0.25, yn = {
2664
+ }, An = 0.25, En = {
3112
2665
  font: "Roboto",
3113
- fontSize: Sr[2],
3114
- padding: Sr[2] * gn,
3115
- color: Dr,
3116
- strokeType: Ar,
3117
- background: Ar
2666
+ fontSize: Tr[2],
2667
+ padding: Tr[2] * An,
2668
+ color: Wr,
2669
+ strokeType: Sr,
2670
+ background: Sr
3118
2671
  };
3119
- function mn(p) {
3120
- return p.reduce((e, a) => e + a, 0) / p.length;
2672
+ function _n(h) {
2673
+ return h.reduce((e, s) => e + s, 0) / h.length;
3121
2674
  }
3122
- function An(p, e = 0, a = 1) {
3123
- return e + (a - e) * p;
2675
+ function Pn(h, e = 0, s = 1) {
2676
+ return e + (s - e) * h;
3124
2677
  }
3125
- function En(p, e = 0, a = 1) {
3126
- return (p - e) / (a - e);
2678
+ function Rn(h, e = 0, s = 1) {
2679
+ return (h - e) / (s - e);
3127
2680
  }
3128
- function _n() {
3129
- return _r(null);
2681
+ function In() {
2682
+ return Or(null);
3130
2683
  }
3131
- const Fr = _r(
2684
+ const Ur = Or(
3132
2685
  void 0
3133
- ), kn = () => zr(Fr), vn = (p, e) => {
2686
+ ), Ln = () => qr(Ur), kn = (h, e) => {
3134
2687
  switch (e.type) {
3135
2688
  case "add":
3136
2689
  return {
3137
- ...p,
3138
- features: [...p.features, e.payload]
2690
+ ...h,
2691
+ features: [...h.features, e.payload]
3139
2692
  };
3140
2693
  case "remove":
3141
2694
  return {
3142
- ...p,
3143
- features: p.features.filter((a) => a.id !== e.payload.id)
2695
+ ...h,
2696
+ features: h.features.filter((s) => s.id !== e.payload.id)
3144
2697
  };
3145
2698
  case "update":
3146
2699
  return {
3147
- ...p,
3148
- features: p.features.map(
3149
- (a) => a.id === e.payload.id ? e.payload : a
2700
+ ...h,
2701
+ features: h.features.map(
2702
+ (s) => s.id === e.payload.id ? e.payload : s
3150
2703
  )
3151
2704
  };
3152
2705
  default:
3153
- return p;
2706
+ return h;
3154
2707
  }
3155
- }, Tn = ({ children: p }) => {
3156
- const e = Hr(), [a, i] = Nr(vn, {
2708
+ }, Fn = ({ children: h }) => {
2709
+ const e = Xr(), [s, i] = Yr(kn, {
3157
2710
  type: "FeatureCollection",
3158
2711
  features: []
3159
- }), [h, c] = zt(null), [g, m] = zt(pn), [f, s] = zt(yn), [d, A] = zt(), [_, R] = zt(1), [P, E] = zt(1);
3160
- return Je(() => {
2712
+ }), [l, c] = Nt(null), [f, p] = Nt(xn), [d, v] = Nt(En), [y, _] = Nt(), [C, E] = Nt(1), [P, S] = Nt(1);
2713
+ return er(() => {
3161
2714
  if (!e)
3162
2715
  return;
3163
- const M = new dn(e, {
2716
+ const $ = new wn(e, {
3164
2717
  minArrowHeight: 1
3165
- }), j = mn(e.getNodes().getAttribute("radius")) / 5, k = _;
3166
- return m({
3167
- ...g,
3168
- strokeWidth: (g.strokeWidth || 1) * k
3169
- }), R(k), E(j), M.on("select", (N) => {
3170
- lt(N) ? m({
3171
- ...N.properties.style || {}
3172
- }) : wt(N) && s({
3173
- ...N.properties.style || {}
3174
- }), c(N);
2718
+ }), L = _n(e.getNodes().getAttribute("radius")) / 5, T = C;
2719
+ return p({
2720
+ ...f,
2721
+ strokeWidth: (f.strokeWidth || 1) * T
2722
+ }), E(T), S(L), $.on("select", (B) => {
2723
+ lt(B) ? p({
2724
+ ...B.properties.style || {}
2725
+ }) : wt(B) && v({
2726
+ ...B.properties.style || {}
2727
+ }), c(B);
3175
2728
  }).on("unselect", () => {
3176
2729
  c(null);
3177
- }), A(M), () => {
3178
- d == null || d.destroy();
2730
+ }), _($), () => {
2731
+ y == null || y.destroy();
3179
2732
  };
3180
- }, [e]), Je(() => {
3181
- d && h && (h == null ? void 0 : h.properties.type) === "arrow" && d.updateStyle(h.id, g);
3182
- }, [d, g, h]), Je(() => {
3183
- d && h && (h == null ? void 0 : h.properties.type) === "text" && d.updateStyle(h.id, f);
3184
- }, [d, f, h]), /* @__PURE__ */ Wr.jsx(
3185
- Fr.Provider,
2733
+ }, [e]), er(() => {
2734
+ y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
2735
+ }, [y, f, l]), er(() => {
2736
+ y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
2737
+ }, [y, d, l]), /* @__PURE__ */ Zr.jsx(
2738
+ Ur.Provider,
3186
2739
  {
3187
2740
  value: {
3188
- annotations: a,
2741
+ annotations: s,
3189
2742
  updateAnnotations: i,
3190
- currentAnnotation: h,
2743
+ currentAnnotation: l,
3191
2744
  setCurrentAnnotation: c,
3192
- textStyle: f,
3193
- setTextStyle: s,
3194
- arrowStyle: g,
3195
- setArrowStyle: m,
3196
- arrowWidthFactor: _,
3197
- setArrowWidthFactor: R,
2745
+ textStyle: d,
2746
+ setTextStyle: v,
2747
+ arrowStyle: f,
2748
+ setArrowStyle: p,
2749
+ arrowWidthFactor: C,
2750
+ setArrowWidthFactor: E,
3198
2751
  textSizeFactor: P,
3199
- setTextSizeFactor: E,
3200
- editor: d,
3201
- setEditor: A
2752
+ setTextSizeFactor: S,
2753
+ editor: y,
2754
+ setEditor: _
3202
2755
  },
3203
- children: p
2756
+ children: h
3204
2757
  }
3205
2758
  );
3206
2759
  };
3207
2760
  export {
3208
- Fr as AnnotationsContext,
3209
- Tn as AnnotationsContextProvider,
3210
- Dr as BLACK,
3211
- gn as RELATIVE_PADDING,
3212
- Ar as TRANSPARENT,
3213
- _n as createAnnotationsContext,
3214
- pn as defaultArrowStyle,
3215
- xn as defaultColors,
3216
- yn as defaultTextStyle,
3217
- Sr as fontSizes,
3218
- Sn as fonts,
3219
- An as interpolate,
3220
- mn as mean,
3221
- En as normalize,
3222
- kn as useAnnotationsContext
2761
+ Ur as AnnotationsContext,
2762
+ Fn as AnnotationsContextProvider,
2763
+ Wr as BLACK,
2764
+ An as RELATIVE_PADDING,
2765
+ Sr as TRANSPARENT,
2766
+ In as createAnnotationsContext,
2767
+ xn as defaultArrowStyle,
2768
+ Cn as defaultColors,
2769
+ En as defaultTextStyle,
2770
+ Tr as fontSizes,
2771
+ On as fonts,
2772
+ Pn as interpolate,
2773
+ _n as mean,
2774
+ Rn as normalize,
2775
+ Ln as useAnnotationsContext
3223
2776
  };