@linkurious/ogma-annotations-react 1.1.16 → 1.1.18

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 Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
1
+ import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as rr } from "react";
2
2
  import { useOgma as Gr } from "@linkurious/ogma-react";
3
- var or = { exports: {} }, he = {};
3
+ var sr = { exports: {} }, ue = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -13,22 +13,22 @@ var or = { exports: {} }, he = {};
13
13
  var dr;
14
14
  function Xr() {
15
15
  if (dr)
16
- return he;
16
+ return ue;
17
17
  dr = 1;
18
- var u = Cr, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function f(g, 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 (g && g.defaultProps)
25
- for (y in d = g.defaultProps, d)
26
- _[y] === void 0 && (_[y] = d[y]);
27
- return { $$typeof: e, type: g, key: C, ref: E, props: _, _owner: l.current };
28
- }
29
- return he.Fragment = o, he.jsx = f, he.jsxs = f, he;
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 g(y, f, m) {
20
+ var v, k = {}, C = null, _ = null;
21
+ m !== void 0 && (C = "" + m), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (_ = f.ref);
22
+ for (v in f)
23
+ i.call(f, v) && !c.hasOwnProperty(v) && (k[v] = f[v]);
24
+ if (y && y.defaultProps)
25
+ for (v in f = y.defaultProps, f)
26
+ k[v] === void 0 && (k[v] = f[v]);
27
+ return { $$typeof: e, type: y, key: C, ref: _, props: k, _owner: l.current };
28
+ }
29
+ return ue.Fragment = s, ue.jsx = g, ue.jsxs = g, ue;
30
30
  }
31
- var ce = {};
31
+ var he = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -41,48 +41,48 @@ var ce = {};
41
41
  var fr;
42
42
  function Jr() {
43
43
  return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
44
- var u = Cr, e = Symbol.for("react.element"), o = 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"), g = 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) {
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"), g = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), R = Symbol.iterator, S = "@@iterator";
45
+ function D(t) {
46
46
  if (t === null || typeof t != "object")
47
47
  return null;
48
- var s = P && t[P] || t[S];
49
- return typeof s == "function" ? s : null;
48
+ var u = R && t[R] || t[S];
49
+ return typeof u == "function" ? u : null;
50
50
  }
51
- var L = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ var L = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
52
  function T(t) {
53
53
  {
54
- for (var s = arguments.length, h = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
55
- h[p - 1] = arguments[p];
56
- B("error", t, h);
54
+ for (var u = arguments.length, d = new Array(u > 1 ? u - 1 : 0), p = 1; p < u; p++)
55
+ d[p - 1] = arguments[p];
56
+ U("error", t, d);
57
57
  }
58
58
  }
59
- function B(t, s, h) {
59
+ function U(t, u, d) {
60
60
  {
61
- var p = L.ReactDebugCurrentFrame, m = p.getStackAddendum();
62
- m !== "" && (s += "%s", h = h.concat([m]));
63
- var w = h.map(function(b) {
64
- return String(b);
61
+ var p = L.ReactDebugCurrentFrame, b = p.getStackAddendum();
62
+ b !== "" && (u += "%s", d = d.concat([b]));
63
+ var w = d.map(function(A) {
64
+ return String(A);
65
65
  });
66
- w.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, w);
66
+ w.unshift("Warning: " + u), Function.prototype.apply.call(console[t], console, w);
67
67
  }
68
68
  }
69
- var N = !1, it = !1, xt = !1, qt = !1, Yt = !1, pe;
70
- pe = Symbol.for("react.module.reference");
69
+ var H = !1, it = !1, At = !1, qt = !1, Yt = !1, ge;
70
+ ge = Symbol.for("react.module.reference");
71
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 === g || t.$$typeof === d || // This needs to include all possible module reference object
72
+ return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === m || t === v || qt || t === _ || H || it || At || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === k || t.$$typeof === g || t.$$typeof === y || t.$$typeof === f || // 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 === pe || t.getModuleId !== void 0));
76
+ t.$$typeof === ge || t.getModuleId !== void 0));
77
77
  }
78
- function Pt(t, s, h) {
78
+ function Pt(t, u, d) {
79
79
  var p = t.displayName;
80
80
  if (p)
81
81
  return p;
82
- var m = s.displayName || s.name || "";
83
- return m !== "" ? h + "(" + m + ")" : h;
82
+ var b = u.displayName || u.name || "";
83
+ return b !== "" ? d + "(" + b + ")" : d;
84
84
  }
85
- function Gt(t) {
85
+ function pe(t) {
86
86
  return t.displayName || "Context";
87
87
  }
88
88
  function tt(t) {
@@ -95,34 +95,34 @@ function Jr() {
95
95
  switch (t) {
96
96
  case i:
97
97
  return "Fragment";
98
- case o:
98
+ case s:
99
99
  return "Portal";
100
100
  case c:
101
101
  return "Profiler";
102
102
  case l:
103
103
  return "StrictMode";
104
- case v:
104
+ case m:
105
105
  return "Suspense";
106
- case y:
106
+ case v:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof t == "object")
110
110
  switch (t.$$typeof) {
111
+ case y:
112
+ var u = t;
113
+ return pe(u) + ".Consumer";
111
114
  case g:
112
- var s = t;
113
- return Gt(s) + ".Consumer";
115
+ var d = t;
116
+ return pe(d._context) + ".Provider";
114
117
  case f:
115
- var h = t;
116
- return Gt(h._context) + ".Provider";
117
- case d:
118
118
  return Pt(t, t.render, "ForwardRef");
119
- case _:
119
+ case k:
120
120
  var p = t.displayName || null;
121
121
  return p !== null ? p : tt(t.type) || "Memo";
122
122
  case C: {
123
- var m = t, w = m._payload, b = m._init;
123
+ var b = t, w = b._payload, A = b._init;
124
124
  try {
125
- return tt(b(w));
125
+ return tt(A(w));
126
126
  } catch {
127
127
  return null;
128
128
  }
@@ -130,18 +130,18 @@ function Jr() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var D = Object.assign, lt = 0, G, ut, Rt, ye, Xt, ve, me;
134
- function At() {
133
+ var z = Object.assign, lt = 0, X, ut, Rt, ye, Gt, ve, me;
134
+ function Et() {
135
135
  }
136
- At.__reactDisabledLog = !0;
136
+ Et.__reactDisabledLog = !0;
137
137
  function be() {
138
138
  {
139
139
  if (lt === 0) {
140
- G = console.log, ut = console.info, Rt = console.warn, ye = console.error, Xt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
140
+ X = console.log, ut = 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: At,
144
+ value: Et,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -157,7 +157,7 @@ function Jr() {
157
157
  lt++;
158
158
  }
159
159
  }
160
- function Ne() {
160
+ function He() {
161
161
  {
162
162
  if (lt--, lt === 0) {
163
163
  var t = {
@@ -166,25 +166,25 @@ function Jr() {
166
166
  writable: !0
167
167
  };
168
168
  Object.defineProperties(console, {
169
- log: D({}, t, {
170
- value: G
169
+ log: z({}, t, {
170
+ value: X
171
171
  }),
172
- info: D({}, t, {
172
+ info: z({}, t, {
173
173
  value: ut
174
174
  }),
175
- warn: D({}, t, {
175
+ warn: z({}, t, {
176
176
  value: Rt
177
177
  }),
178
- error: D({}, t, {
178
+ error: z({}, t, {
179
179
  value: ye
180
180
  }),
181
- group: D({}, t, {
182
- value: Xt
181
+ group: z({}, t, {
182
+ value: Gt
183
183
  }),
184
- groupCollapsed: D({}, t, {
184
+ groupCollapsed: z({}, t, {
185
185
  value: ve
186
186
  }),
187
- groupEnd: D({}, t, {
187
+ groupEnd: z({}, t, {
188
188
  value: me
189
189
  })
190
190
  });
@@ -192,170 +192,170 @@ function Jr() {
192
192
  lt < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var Jt = L.ReactCurrentDispatcher, Zt;
196
- function It(t, s, h) {
195
+ var Xt = L.ReactCurrentDispatcher, Jt;
196
+ function It(t, u, d) {
197
197
  {
198
- if (Zt === void 0)
198
+ if (Jt === void 0)
199
199
  try {
200
200
  throw Error();
201
- } catch (m) {
202
- var p = m.stack.trim().match(/\n( *(at )?)/);
203
- Zt = p && p[1] || "";
201
+ } catch (b) {
202
+ var p = b.stack.trim().match(/\n( *(at )?)/);
203
+ Jt = p && p[1] || "";
204
204
  }
205
205
  return `
206
- ` + Zt + t;
206
+ ` + Jt + t;
207
207
  }
208
208
  }
209
- var Kt = !1, Et;
209
+ var Kt = !1, _t;
210
210
  {
211
- var Be = typeof WeakMap == "function" ? WeakMap : Map;
212
- Et = new Be();
211
+ var Ue = typeof WeakMap == "function" ? WeakMap : Map;
212
+ _t = new Ue();
213
213
  }
214
- function Qt(t, s) {
214
+ function Zt(t, u) {
215
215
  if (!t || Kt)
216
216
  return "";
217
217
  {
218
- var h = Et.get(t);
219
- if (h !== void 0)
220
- return h;
218
+ var d = _t.get(t);
219
+ if (d !== void 0)
220
+ return d;
221
221
  }
222
222
  var p;
223
223
  Kt = !0;
224
- var m = Error.prepareStackTrace;
224
+ var b = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
226
  var w;
227
- w = Jt.current, Jt.current = null, be();
227
+ w = Xt.current, Xt.current = null, be();
228
228
  try {
229
- if (s) {
230
- var b = function() {
229
+ if (u) {
230
+ var A = function() {
231
231
  throw Error();
232
232
  };
233
- if (Object.defineProperty(b.prototype, "props", {
233
+ if (Object.defineProperty(A.prototype, "props", {
234
234
  set: function() {
235
235
  throw Error();
236
236
  }
237
237
  }), typeof Reflect == "object" && Reflect.construct) {
238
238
  try {
239
- Reflect.construct(b, []);
240
- } catch (I) {
241
- p = I;
239
+ Reflect.construct(A, []);
240
+ } catch ($) {
241
+ p = $;
242
242
  }
243
- Reflect.construct(t, [], b);
243
+ Reflect.construct(t, [], A);
244
244
  } else {
245
245
  try {
246
- b.call();
247
- } catch (I) {
248
- p = I;
246
+ A.call();
247
+ } catch ($) {
248
+ p = $;
249
249
  }
250
- t.call(b.prototype);
250
+ t.call(A.prototype);
251
251
  }
252
252
  } else {
253
253
  try {
254
254
  throw Error();
255
- } catch (I) {
256
- p = I;
255
+ } catch ($) {
256
+ p = $;
257
257
  }
258
258
  t();
259
259
  }
260
- } catch (I) {
261
- if (I && p && typeof I.stack == "string") {
262
- for (var A = I.stack.split(`
263
- `), R = p.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)
260
+ } catch ($) {
261
+ if ($ && p && typeof $.stack == "string") {
262
+ for (var E = $.stack.split(`
263
+ `), O = p.stack.split(`
264
+ `), P = E.length - 1, I = O.length - 1; P >= 1 && I >= 0 && E[P] !== O[I]; )
265
+ I--;
266
+ for (; P >= 1 && I >= 0; P--, I--)
267
+ if (E[P] !== O[I]) {
268
+ if (P !== 1 || I !== 1)
269
269
  do
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;
270
+ if (P--, I--, I < 0 || E[P] !== O[I]) {
271
+ var B = `
272
+ ` + E[P].replace(" at new ", " at ");
273
+ return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && _t.set(t, B), B;
274
274
  }
275
- while (k >= 1 && O >= 0);
275
+ while (P >= 1 && I >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- Kt = !1, Jt.current = w, Ne(), Error.prepareStackTrace = m;
280
+ Kt = !1, Xt.current = w, He(), Error.prepareStackTrace = b;
281
281
  }
282
- var U = t ? t.displayName || t.name : "", M = U ? It(U) : "";
283
- return typeof t == "function" && Et.set(t, M), M;
282
+ var M = t ? t.displayName || t.name : "", F = M ? It(M) : "";
283
+ return typeof t == "function" && _t.set(t, F), F;
284
284
  }
285
- function He(t, s, h) {
286
- return Qt(t, !1);
285
+ function We(t, u, d) {
286
+ return Zt(t, !1);
287
287
  }
288
- function Ue(t) {
289
- var s = t.prototype;
290
- return !!(s && s.isReactComponent);
288
+ function Ve(t) {
289
+ var u = t.prototype;
290
+ return !!(u && u.isReactComponent);
291
291
  }
292
- function Lt(t, s, h) {
292
+ function Lt(t, u, d) {
293
293
  if (t == null)
294
294
  return "";
295
295
  if (typeof t == "function")
296
- return Qt(t, Ue(t));
296
+ return Zt(t, Ve(t));
297
297
  if (typeof t == "string")
298
298
  return It(t);
299
299
  switch (t) {
300
- case v:
300
+ case m:
301
301
  return It("Suspense");
302
- case y:
302
+ case v:
303
303
  return It("SuspenseList");
304
304
  }
305
305
  if (typeof t == "object")
306
306
  switch (t.$$typeof) {
307
- case d:
308
- return He(t.render);
309
- case _:
310
- return Lt(t.type, s, h);
307
+ case f:
308
+ return We(t.render);
309
+ case k:
310
+ return Lt(t.type, u, d);
311
311
  case C: {
312
- var p = t, m = p._payload, w = p._init;
312
+ var p = t, b = p._payload, w = p._init;
313
313
  try {
314
- return Lt(w(m), s, h);
314
+ return Lt(w(b), u, d);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var _t = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
321
+ var bt = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
322
322
  function Ft(t) {
323
323
  if (t) {
324
- var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
325
- xe.setExtraStackFrame(h);
324
+ var u = t._owner, d = Lt(t.type, t._source, u ? u.type : null);
325
+ xe.setExtraStackFrame(d);
326
326
  } else
327
327
  xe.setExtraStackFrame(null);
328
328
  }
329
- function We(t, s, h, p, m) {
329
+ function qe(t, u, d, p, b) {
330
330
  {
331
- var w = Function.call.bind(_t);
332
- for (var b in t)
333
- if (w(t, b)) {
334
- var A = void 0;
331
+ var w = Function.call.bind(bt);
332
+ for (var A in t)
333
+ if (w(t, A)) {
334
+ var E = void 0;
335
335
  try {
336
- if (typeof t[b] != "function") {
337
- var R = Error((p || "React class") + ": " + h + " 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;
336
+ if (typeof t[A] != "function") {
337
+ var O = Error((p || "React class") + ": " + d + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw O.name = "Invariant Violation", O;
339
339
  }
340
- A = t[b](s, b, p, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (k) {
342
- A = k;
340
+ E = t[A](u, A, p, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (P) {
342
+ E = P;
343
343
  }
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).", p || "React class", h, b, typeof A), Ft(null)), A instanceof Error && !(A.message in we) && (we[A.message] = !0, Ft(m), T("Failed %s type: %s", h, A.message), Ft(null));
344
+ E && !(E instanceof Error) && (Ft(b), 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).", p || "React class", d, A, typeof E), Ft(null)), E instanceof Error && !(E.message in we) && (we[E.message] = !0, Ft(b), T("Failed %s type: %s", d, E.message), Ft(null));
345
345
  }
346
346
  }
347
347
  }
348
- var Ve = Array.isArray;
349
- function te(t) {
350
- return Ve(t);
348
+ var Ye = Array.isArray;
349
+ function Qt(t) {
350
+ return Ye(t);
351
351
  }
352
- function H(t) {
352
+ function W(t) {
353
353
  {
354
- var s = typeof Symbol == "function" && Symbol.toStringTag, h = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
355
- return h;
354
+ var u = typeof Symbol == "function" && Symbol.toStringTag, d = u && t[Symbol.toStringTag] || t.constructor.name || "Object";
355
+ return d;
356
356
  }
357
357
  }
358
- function qe(t) {
358
+ function Ge(t) {
359
359
  try {
360
360
  return Ae(t), !1;
361
361
  } catch {
@@ -365,125 +365,125 @@ function Jr() {
365
365
  function Ae(t) {
366
366
  return "" + t;
367
367
  }
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);
368
+ function te(t) {
369
+ if (Ge(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.", W(t)), Ae(t);
371
371
  }
372
372
  var ot = L.ReactCurrentOwner, Ee = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
376
376
  __source: !0
377
- }, $t, _e, re;
378
- re = {};
379
- function ne(t) {
380
- if (_t.call(t, "ref")) {
381
- var s = Object.getOwnPropertyDescriptor(t, "ref").get;
382
- if (s && s.isReactWarning)
377
+ }, jt, _e, ee;
378
+ ee = {};
379
+ function re(t) {
380
+ if (bt.call(t, "ref")) {
381
+ var u = Object.getOwnPropertyDescriptor(t, "ref").get;
382
+ if (u && u.isReactWarning)
383
383
  return !1;
384
384
  }
385
385
  return t.ref !== void 0;
386
386
  }
387
- function Ye(t) {
388
- if (_t.call(t, "key")) {
389
- var s = Object.getOwnPropertyDescriptor(t, "key").get;
390
- if (s && s.isReactWarning)
387
+ function Xe(t) {
388
+ if (bt.call(t, "key")) {
389
+ var u = Object.getOwnPropertyDescriptor(t, "key").get;
390
+ if (u && u.isReactWarning)
391
391
  return !1;
392
392
  }
393
393
  return t.key !== void 0;
394
394
  }
395
- function Ge(t, s) {
396
- if (typeof t.ref == "string" && ot.current && s && ot.current.stateNode !== s) {
397
- var h = tt(ot.current.type);
398
- re[h] || (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[h] = !0);
395
+ function Je(t, u) {
396
+ if (typeof t.ref == "string" && ot.current && u && ot.current.stateNode !== u) {
397
+ var d = tt(ot.current.type);
398
+ ee[d] || (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), ee[d] = !0);
399
399
  }
400
400
  }
401
- function Xe(t, s) {
401
+ function Ke(t, u) {
402
402
  {
403
- var h = function() {
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)", s));
403
+ var d = function() {
404
+ jt || (jt = !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)", u));
405
405
  };
406
- h.isReactWarning = !0, Object.defineProperty(t, "key", {
407
- get: h,
406
+ d.isReactWarning = !0, Object.defineProperty(t, "key", {
407
+ get: d,
408
408
  configurable: !0
409
409
  });
410
410
  }
411
411
  }
412
- function ie(t, s) {
412
+ function ne(t, u) {
413
413
  {
414
- var h = function() {
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)", s));
414
+ var d = function() {
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)", u));
416
416
  };
417
- h.isReactWarning = !0, Object.defineProperty(t, "ref", {
418
- get: h,
417
+ d.isReactWarning = !0, Object.defineProperty(t, "ref", {
418
+ get: d,
419
419
  configurable: !0
420
420
  });
421
421
  }
422
422
  }
423
- var ke = function(t, s, h, p, m, w, b) {
424
- var A = {
423
+ var ke = function(t, u, d, p, b, w, A) {
424
+ var E = {
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
428
428
  type: t,
429
- key: s,
430
- ref: h,
431
- props: b,
429
+ key: u,
430
+ ref: d,
431
+ props: A,
432
432
  // Record the component responsible for creating this element.
433
433
  _owner: w
434
434
  };
435
- return A._store = {}, Object.defineProperty(A._store, "validated", {
435
+ return E._store = {}, Object.defineProperty(E._store, "validated", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !0,
439
439
  value: !1
440
- }), Object.defineProperty(A, "_self", {
440
+ }), Object.defineProperty(E, "_self", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
444
  value: p
445
- }), Object.defineProperty(A, "_source", {
445
+ }), Object.defineProperty(E, "_source", {
446
446
  configurable: !1,
447
447
  enumerable: !1,
448
448
  writable: !1,
449
- value: m
450
- }), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
449
+ value: b
450
+ }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
451
451
  };
452
- function kt(t, s, h, p, m) {
452
+ function kt(t, u, d, p, b) {
453
453
  {
454
- var w, b = {}, A = null, R = null;
455
- h !== void 0 && (ee(h), A = "" + h), Ye(s) && (ee(s.key), A = "" + s.key), ne(s) && (R = s.ref, Ge(s, m));
456
- for (w in s)
457
- _t.call(s, w) && !Ee.hasOwnProperty(w) && (b[w] = s[w]);
454
+ var w, A = {}, E = null, O = null;
455
+ d !== void 0 && (te(d), E = "" + d), Xe(u) && (te(u.key), E = "" + u.key), re(u) && (O = u.ref, Je(u, b));
456
+ for (w in u)
457
+ bt.call(u, w) && !Ee.hasOwnProperty(w) && (A[w] = u[w]);
458
458
  if (t && t.defaultProps) {
459
- var k = t.defaultProps;
460
- for (w in k)
461
- b[w] === void 0 && (b[w] = k[w]);
459
+ var P = t.defaultProps;
460
+ for (w in P)
461
+ A[w] === void 0 && (A[w] = P[w]);
462
462
  }
463
- if (A || R) {
464
- var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
- A && Xe(b, O), R && ie(b, O);
463
+ if (E || O) {
464
+ var I = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
+ E && Ke(A, I), O && ne(A, I);
466
466
  }
467
- return ke(t, A, R, m, p, ot.current, b);
467
+ return ke(t, E, O, b, p, ot.current, A);
468
468
  }
469
469
  }
470
- var oe = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
470
+ var ie = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
471
471
  function ht(t) {
472
472
  if (t) {
473
- var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
474
- Te.setExtraStackFrame(h);
473
+ var u = t._owner, d = Lt(t.type, t._source, u ? u.type : null);
474
+ Te.setExtraStackFrame(d);
475
475
  } else
476
476
  Te.setExtraStackFrame(null);
477
477
  }
478
- var X;
479
- X = !1;
478
+ var J;
479
+ J = !1;
480
480
  function dt(t) {
481
481
  return typeof t == "object" && t !== null && t.$$typeof === e;
482
482
  }
483
- function jt() {
483
+ function $t() {
484
484
  {
485
- if (oe.current) {
486
- var t = tt(oe.current.type);
485
+ if (ie.current) {
486
+ var t = tt(ie.current.type);
487
487
  if (t)
488
488
  return `
489
489
 
@@ -492,91 +492,83 @@ Check the render method of \`` + t + "`.";
492
492
  return "";
493
493
  }
494
494
  }
495
- function Je(t) {
496
- {
497
- if (t !== void 0) {
498
- var s = t.fileName.replace(/^.*[\\\/]/, ""), h = t.lineNumber;
499
- return `
500
-
501
- Check your code at ` + s + ":" + h + ".";
502
- }
503
- return "";
504
- }
495
+ function Ze(t) {
496
+ return "";
505
497
  }
506
- var se = {};
498
+ var oe = {};
507
499
  function Se(t) {
508
500
  {
509
- var s = jt();
510
- if (!s) {
511
- var h = typeof t == "string" ? t : t.displayName || t.name;
512
- h && (s = `
501
+ var u = $t();
502
+ if (!u) {
503
+ var d = typeof t == "string" ? t : t.displayName || t.name;
504
+ d && (u = `
513
505
 
514
- Check the top-level render call using <` + h + ">.");
506
+ Check the top-level render call using <` + d + ">.");
515
507
  }
516
- return s;
508
+ return u;
517
509
  }
518
510
  }
519
- function Ce(t, s) {
511
+ function Ce(t, u) {
520
512
  {
521
513
  if (!t._store || t._store.validated || t.key != null)
522
514
  return;
523
515
  t._store.validated = !0;
524
- var h = Se(s);
525
- if (se[h])
516
+ var d = Se(u);
517
+ if (oe[d])
526
518
  return;
527
- se[h] = !0;
519
+ oe[d] = !0;
528
520
  var p = "";
529
- t && t._owner && t._owner !== oe.current && (p = " It was passed a child from " + tt(t._owner.type) + "."), ht(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.', h, p), ht(null);
521
+ t && t._owner && t._owner !== ie.current && (p = " It was passed a child from " + tt(t._owner.type) + "."), ht(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.', d, p), ht(null);
530
522
  }
531
523
  }
532
- function Dt(t, s) {
524
+ function Dt(t, u) {
533
525
  {
534
526
  if (typeof t != "object")
535
527
  return;
536
- if (te(t))
537
- for (var h = 0; h < t.length; h++) {
538
- var p = t[h];
539
- dt(p) && Ce(p, s);
528
+ if (Qt(t))
529
+ for (var d = 0; d < t.length; d++) {
530
+ var p = t[d];
531
+ dt(p) && Ce(p, u);
540
532
  }
541
533
  else if (dt(t))
542
534
  t._store && (t._store.validated = !0);
543
535
  else if (t) {
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, s);
536
+ var b = D(t);
537
+ if (typeof b == "function" && b !== t.entries)
538
+ for (var w = b.call(t), A; !(A = w.next()).done; )
539
+ dt(A.value) && Ce(A.value, u);
548
540
  }
549
541
  }
550
542
  }
551
- function Ze(t) {
543
+ function Qe(t) {
552
544
  {
553
- var s = t.type;
554
- if (s == null || typeof s == "string")
545
+ var u = t.type;
546
+ if (u == null || typeof u == "string")
555
547
  return;
556
- var h;
557
- if (typeof s == "function")
558
- h = s.propTypes;
559
- else if (typeof s == "object" && (s.$$typeof === d || // Note: Memo only checks outer props here.
548
+ var d;
549
+ if (typeof u == "function")
550
+ d = u.propTypes;
551
+ else if (typeof u == "object" && (u.$$typeof === f || // Note: Memo only checks outer props here.
560
552
  // Inner props are checked in the reconciler.
561
- s.$$typeof === _))
562
- h = s.propTypes;
553
+ u.$$typeof === k))
554
+ d = u.propTypes;
563
555
  else
564
556
  return;
565
- if (h) {
566
- var p = tt(s);
567
- We(h, t.props, "prop", p, t);
568
- } else if (s.PropTypes !== void 0 && !X) {
569
- X = !0;
570
- var m = tt(s);
571
- T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
557
+ if (d) {
558
+ var p = tt(u);
559
+ qe(d, t.props, "prop", p, t);
560
+ } else if (u.PropTypes !== void 0 && !J) {
561
+ J = !0;
562
+ var b = tt(u);
563
+ T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
572
564
  }
573
- typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
+ typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
566
  }
575
567
  }
576
568
  function Oe(t) {
577
569
  {
578
- for (var s = Object.keys(t.props), h = 0; h < s.length; h++) {
579
- var p = s[h];
570
+ for (var u = Object.keys(t.props), d = 0; d < u.length; d++) {
571
+ var p = u[d];
580
572
  if (p !== "children" && p !== "key") {
581
573
  ht(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ht(null);
582
574
  break;
@@ -585,50 +577,65 @@ Check the top-level render call using <` + h + ">.");
585
577
  t.ref !== null && (ht(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), ht(null));
586
578
  }
587
579
  }
588
- function ae(t, s, h, p, m, w) {
580
+ var se = {};
581
+ function Pe(t, u, d, p, b, w) {
589
582
  {
590
- var b = Ot(t);
591
- if (!b) {
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);
583
+ var A = Ot(t);
584
+ if (!A) {
585
+ var E = "";
586
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
+ var O = Ze();
588
+ O ? E += O : E += $t();
589
+ var P;
590
+ t === null ? P = "null" : Qt(t) ? P = "array" : t !== void 0 && t.$$typeof === e ? (P = "<" + (tt(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : P = 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", P, E);
598
591
  }
599
- var O = kt(t, s, h, m, w);
600
- if (O == null)
601
- return O;
602
- if (b) {
603
- var j = s.children;
604
- if (j !== void 0)
592
+ var I = kt(t, u, d, b, w);
593
+ if (I == null)
594
+ return I;
595
+ if (A) {
596
+ var B = u.children;
597
+ if (B !== void 0)
605
598
  if (p)
606
- if (te(j)) {
607
- for (var U = 0; U < j.length; U++)
608
- Dt(j[U], t);
609
- Object.freeze && Object.freeze(j);
599
+ if (Qt(B)) {
600
+ for (var M = 0; M < B.length; M++)
601
+ Dt(B[M], t);
602
+ Object.freeze && Object.freeze(B);
610
603
  } else
611
604
  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
605
  else
613
- Dt(j, t);
606
+ Dt(B, t);
607
+ }
608
+ if (bt.call(u, "key")) {
609
+ var F = tt(t), $ = Object.keys(u).filter(function(G) {
610
+ return G !== "key";
611
+ }), N = $.length > 0 ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}";
612
+ if (!se[F + N]) {
613
+ var K = $.length > 0 ? "{" + $.join(": ..., ") + ": ...}" : "{}";
614
+ T(`A props object containing a "key" prop is being spread into JSX:
615
+ let props = %s;
616
+ <%s {...props} />
617
+ React keys must be passed directly to JSX without using spread:
618
+ let props = %s;
619
+ <%s key={someKey} {...props} />`, N, F, K, F), se[F + N] = !0;
620
+ }
614
621
  }
615
- return t === i ? Oe(O) : Ze(O), O;
622
+ return t === i ? Oe(I) : Qe(I), I;
616
623
  }
617
624
  }
618
- function Ke(t, s, h) {
619
- return ae(t, s, h, !0);
625
+ function r(t, u, d) {
626
+ return Pe(t, u, d, !0);
620
627
  }
621
- function r(t, s, h) {
622
- return ae(t, s, h, !1);
628
+ function n(t, u, d) {
629
+ return Pe(t, u, d, !1);
623
630
  }
624
- var n = r, a = Ke;
625
- ce.Fragment = i, ce.jsx = n, ce.jsxs = a;
626
- }()), ce;
631
+ var a = n, o = r;
632
+ he.Fragment = i, he.jsx = a, he.jsxs = o;
633
+ }()), he;
627
634
  }
628
- process.env.NODE_ENV === "production" ? or.exports = Xr() : or.exports = Jr();
629
- var Zr = or.exports, Kr = Object.defineProperty, Qr = (u, e, o) => e in u ? Kr(u, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : u[e] = o, x = (u, e, o) => (Qr(u, typeof e != "symbol" ? e + "" : e, o), o);
630
- let ze = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((e, o) => (o &= 63, o < 36 ? e += o.toString(36) : o < 62 ? e += (o - 26).toString(36).toUpperCase() : o > 62 ? e += "-" : e += "_", e), "");
631
- const ge = {
635
+ process.env.NODE_ENV === "production" ? sr.exports = Xr() : sr.exports = Jr();
636
+ var Kr = sr.exports, Zr = Object.defineProperty, Qr = (h, e, s) => e in h ? Zr(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);
637
+ let Be = (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), "");
638
+ const fe = {
632
639
  strokeType: "plain",
633
640
  strokeColor: "black",
634
641
  strokeWidth: 1,
@@ -640,7 +647,7 @@ const ge = {
640
647
  properties: {
641
648
  type: "arrow",
642
649
  style: {
643
- ...ge
650
+ ...fe
644
651
  }
645
652
  },
646
653
  geometry: {
@@ -660,284 +667,284 @@ const ge = {
660
667
  // tail: 'arrow-plain',
661
668
  // start: { x: 0, y: 0 },
662
669
  // end: { x: 100, y: 100 }
663
- }, tn = (u = 0, e = 0, o = 0, i = 0, l = { ...ge }) => ({
664
- id: ze(),
670
+ }, tn = (h = 0, e = 0, s = 0, i = 0, l = { ...fe }) => ({
671
+ id: Be(),
665
672
  type: "Feature",
666
673
  properties: {
667
674
  type: "arrow",
668
675
  style: {
669
- ...ge,
676
+ ...fe,
670
677
  ...l
671
678
  }
672
679
  },
673
680
  geometry: {
674
681
  type: "LineString",
675
682
  coordinates: [
676
- [u, e],
677
- [o, i]
683
+ [h, e],
684
+ [s, i]
678
685
  ]
679
686
  }
680
687
  }), en = "http://www.w3.org/2000/svg";
681
- function de(u) {
682
- return document.createElementNS(en, u);
688
+ function ce(h) {
689
+ return document.createElementNS(en, h);
683
690
  }
684
- function Pr(u) {
685
- return u.geometry.bbox || rn(u), u.geometry.bbox;
691
+ function Pr(h) {
692
+ return h.geometry.bbox || rn(h), h.geometry.bbox;
686
693
  }
687
- function mt(u) {
688
- const e = Pr(u);
694
+ function mt(h) {
695
+ const e = Pr(h);
689
696
  return {
690
697
  width: e[2] - e[0],
691
698
  height: e[3] - e[1]
692
699
  };
693
700
  }
694
- function vt(u) {
695
- const e = Pr(u);
701
+ function vt(h) {
702
+ const e = Pr(h);
696
703
  return { x: e[0], y: e[1] };
697
704
  }
698
- function rn(u) {
699
- const [e, o] = u.geometry.coordinates[0][0], [i, l] = u.geometry.coordinates[0][2];
700
- u.geometry.bbox = [e, o, i, l];
705
+ function rn(h) {
706
+ const [e, s] = h.geometry.coordinates[0][0], [i, l] = h.geometry.coordinates[0][2];
707
+ h.geometry.bbox = [e, s, i, l];
701
708
  }
702
- function nn(u, e, o, i, l) {
703
- u.geometry.bbox = [e, o, e + i, o + l], u.geometry.coordinates = [
709
+ function nn(h, e, s, i, l) {
710
+ h.geometry.bbox = [e, s, e + i, s + l], h.geometry.coordinates = [
704
711
  [
705
- [e, o],
706
- [e + i, o],
707
- [e + i, o + l],
708
- [e, o + l],
709
- [e, o]
712
+ [e, s],
713
+ [e + i, s],
714
+ [e + i, s + l],
715
+ [e, s + l],
716
+ [e, s]
710
717
  ]
711
718
  ];
712
719
  }
713
- function fe(u) {
714
- const [e, o] = u.geometry.coordinates[0];
715
- return { x: e, y: o };
720
+ function de(h) {
721
+ const [e, s] = h.geometry.coordinates[0];
722
+ return { x: e, y: s };
716
723
  }
717
- function Ie(u, e) {
718
- const [o, i] = u.geometry.coordinates[e === "start" ? 0 : 1];
719
- return { x: o, y: i };
724
+ function Le(h, e) {
725
+ const [s, i] = h.geometry.coordinates[e === "start" ? 0 : 1];
726
+ return { x: s, y: i };
720
727
  }
721
- function $e(u) {
722
- const [e, o] = u.geometry.coordinates[1];
723
- return { x: e, y: o };
728
+ function $e(h) {
729
+ const [e, s] = h.geometry.coordinates[1];
730
+ return { x: e, y: s };
724
731
  }
725
- function Rr(u, e, o) {
726
- u.geometry.coordinates[0] = [e, o];
732
+ function Rr(h, e, s) {
733
+ h.geometry.coordinates[0] = [e, s];
727
734
  }
728
- function Ir(u, e, o) {
729
- u.geometry.coordinates[1] = [e, o];
735
+ function Ir(h, e, s) {
736
+ h.geometry.coordinates[1] = [e, s];
730
737
  }
731
- function je(u) {
732
- return { start: fe(u), end: $e(u) };
738
+ function De(h) {
739
+ return { start: de(h), end: $e(h) };
733
740
  }
734
- function Bt(u, e, o, i) {
735
- e === "start" ? Rr(u, o, i) : Ir(u, o, i);
741
+ function Bt(h, e, s, i) {
742
+ e === "start" ? Rr(h, s, i) : Ir(h, s, i);
736
743
  }
737
- const Lr = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
738
- function on(u) {
739
- return Array.isArray(u) && u.length === 2 && u.every(isFinite);
744
+ const Lr = (h) => parseInt(h.getAttribute("data-handle-id") || "-1");
745
+ function on(h) {
746
+ return Array.isArray(h) && h.length === 2 && h.every(isFinite);
740
747
  }
741
- function sn(u, e, o, i) {
742
- for (let l = 0; l < u.coordinates.length; l++) {
743
- const c = u.coordinates[l];
748
+ function sn(h, e, s, i) {
749
+ for (let l = 0; l < h.coordinates.length; l++) {
750
+ const c = h.coordinates[l];
744
751
  if (on(c))
745
- c[0] = o + (c[0] - o) * e, c[1] = i + (c[1] - i) * e;
752
+ c[0] = s + (c[0] - s) * e, c[1] = i + (c[1] - i) * e;
746
753
  else
747
- for (let f = 0; f < c.length; f++) {
748
- const g = c[f];
749
- g[0] = o + (g[0] - o) * e, g[1] = i + (g[1] - i) * e;
754
+ for (let g = 0; g < c.length; g++) {
755
+ const y = c[g];
756
+ y[0] = s + (y[0] - s) * e, y[1] = i + (y[1] - i) * e;
750
757
  }
751
758
  }
752
- return u;
759
+ return h;
753
760
  }
754
- function Le(u, e, o) {
755
- const i = Math.atan2(u.y - e.y, u.x - e.x);
761
+ function Fe(h, e, s) {
762
+ const i = Math.atan2(h.y - e.y, h.x - e.x);
756
763
  return {
757
- x: e.x + o * Math.cos(i),
758
- y: e.y + o * Math.sin(i)
764
+ x: e.x + s * Math.cos(i),
765
+ y: e.y + s * Math.sin(i)
759
766
  };
760
767
  }
761
- function sr(u, e) {
768
+ function Me(h, e) {
762
769
  if (!e)
763
- return { x: u.clientX, y: u.clientY };
764
- const o = e.getBoundingClientRect();
770
+ return { x: h.clientX, y: h.clientY };
771
+ const s = e.getBoundingClientRect();
765
772
  return {
766
- x: u.clientX - o.left - e.clientLeft,
767
- y: u.clientY - o.top - e.clientTop
773
+ x: h.clientX - s.left - e.clientLeft,
774
+ y: h.clientY - s.top - e.clientTop
768
775
  };
769
776
  }
770
- const Ct = (u, e) => ({
771
- x: u.x - e.x,
772
- y: u.y - e.y
773
- }), Ut = (u) => Math.sqrt(u.x * u.x + u.y * u.y), Fr = (u) => ({
774
- x: -u.x,
775
- y: -u.y
776
- }), $r = (u) => {
777
- const e = Ut(u);
777
+ const Ct = (h, e) => ({
778
+ x: h.x - e.x,
779
+ y: h.y - e.y
780
+ }), Ut = (h) => Math.sqrt(h.x * h.x + h.y * h.y), Fr = (h) => ({
781
+ x: -h.x,
782
+ y: -h.y
783
+ }), jr = (h) => {
784
+ const e = Ut(h);
778
785
  return e === 0 ? { x: 0, y: 0 } : {
779
- x: u.x / e,
780
- y: u.y / e
786
+ x: h.x / e,
787
+ y: h.y / e
781
788
  };
782
- }, Ht = (u, e) => ({
783
- x: u.x + e.x,
784
- y: u.y + e.y
785
- }), jr = (u, e) => ({
786
- x: u.x * e,
787
- y: u.y * e
788
- }), Fe = (u, e) => ({
789
- x: u.x * e.x,
790
- y: u.y * e.y
791
- }), at = (u, e) => {
792
- const o = Math.sin(e), i = Math.cos(e);
789
+ }, Ht = (h, e) => ({
790
+ x: h.x + e.x,
791
+ y: h.y + e.y
792
+ }), $r = (h, e) => ({
793
+ x: h.x * e,
794
+ y: h.y * e
795
+ }), je = (h, e) => ({
796
+ x: h.x * e.x,
797
+ y: h.y * e.y
798
+ }), at = (h, e) => {
799
+ const s = Math.sin(e), i = Math.cos(e);
793
800
  return {
794
- x: u.x * i - u.y * o,
795
- y: u.x * o + u.y * i
801
+ x: h.x * i - h.y * s,
802
+ y: h.x * s + h.y * i
796
803
  };
797
- }, an = (u, e) => ({
798
- x: u.x / e,
799
- y: u.y / e
800
- }), pr = (u, e) => u.x * e.x + u.y * e.y;
801
- function Dr(u, e = 5, o = 30) {
804
+ }, an = (h, e) => ({
805
+ x: h.x / e,
806
+ y: h.y / e
807
+ }), pr = (h, e) => h.x * e.x + h.y * e.y;
808
+ function Dr(h, e = 5, s = 30) {
802
809
  var i;
803
- const { start: l, end: c } = je(u), f = Ct(c, l), g = u.properties.style && u.properties.style.strokeWidth ? (i = u.properties.style) == null ? void 0 : i.strokeWidth : 0;
804
- return Math.min(o, Math.max(3 * g, Ut(f) * 0.1, e));
810
+ const { start: l, end: c } = De(h), g = Ct(c, l), y = h.properties.style && h.properties.style.strokeWidth ? (i = h.properties.style) == null ? void 0 : i.strokeWidth : 0;
811
+ return Math.min(s, Math.max(3 * y, Ut(g) * 0.1, e));
805
812
  }
806
- function yr(u, e, o, i) {
807
- const l = jr(Fr($r(e)), i);
808
- if (!o || o === "none")
813
+ function yr(h, e, s, i) {
814
+ const l = $r(Fr(jr(e)), i);
815
+ if (!s || s === "none")
809
816
  return "";
810
- const c = Ht(u, at(l, Math.PI / 8)), f = Ht(u, at(l, -Math.PI / 8)), g = `${u.x} ${u.y}`;
811
- return `M ${c.x} ${c.y} L ${g} ${f.x} ${f.y} ${o === "arrow" ? "" : `${c.x} ${c.y}`}`;
817
+ const c = Ht(h, at(l, Math.PI / 8)), g = Ht(h, at(l, -Math.PI / 8)), y = `${h.x} ${h.y}`;
818
+ return `M ${c.x} ${c.y} L ${y} ${g.x} ${g.y} ${s === "arrow" ? "" : `${c.x} ${c.y}`}`;
812
819
  }
813
- function ln(u, e, o, i, l) {
814
- const { start: c, end: f } = je(u), { tail: g, head: d, strokeColor: v, strokeWidth: y } = u.properties.style || o, _ = Ct(f, c), C = Dr(u, i, l), E = de("path");
815
- E.setAttribute("data-annotation", `${u.id}`), E.setAttribute("data-annotation-type", "arrow");
816
- const P = d === "arrow-plain" || g === "arrow";
817
- 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");
818
- const S = yr(c, Fr(_), g, C), $ = yr(f, _, d, C), L = S + `M ${c.x} ${c.y} ${f.x} ${f.y}` + $;
819
- E.setAttribute("d", L), e.appendChild(E);
820
+ function ln(h, e, s, i, l) {
821
+ const { start: c, end: g } = De(h), { tail: y, head: f, strokeColor: m, strokeWidth: v } = h.properties.style || s, k = Ct(g, c), C = Dr(h, i, l), _ = ce("path");
822
+ _.setAttribute("data-annotation", `${h.id}`), _.setAttribute("data-annotation-type", "arrow");
823
+ const R = f === "arrow-plain" || y === "arrow";
824
+ _.setAttribute("stroke", m || "none"), _.setAttribute("stroke-width", `${v}`), _.setAttribute("fill", R ? m || "" : "none"), _.setAttribute("stroke-linecap", "round"), _.setAttribute("stroke-linejoin", "round");
825
+ const S = yr(c, Fr(k), y, C), D = yr(g, k, f, C), L = S + `M ${c.x} ${c.y} ${g.x} ${g.y}` + D;
826
+ _.setAttribute("d", L), e.appendChild(_);
820
827
  }
821
- const Y = -1, De = "dragging", Me = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
828
+ const Y = -1, ze = "dragging", Ne = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
822
829
  var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
823
- function Mr(u) {
824
- return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
830
+ function Mr(h) {
831
+ return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
825
832
  }
826
833
  var zr = { exports: {} };
827
- (function(u) {
828
- var e = Object.prototype.hasOwnProperty, o = "~";
834
+ (function(h) {
835
+ var e = Object.prototype.hasOwnProperty, s = "~";
829
836
  function i() {
830
837
  }
831
- Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (o = !1));
832
- function l(d, v, y) {
833
- this.fn = d, this.context = v, this.once = y || !1;
838
+ Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (s = !1));
839
+ function l(f, m, v) {
840
+ this.fn = f, this.context = m, this.once = v || !1;
834
841
  }
835
- function c(d, v, y, _, C) {
836
- if (typeof y != "function")
842
+ function c(f, m, v, k, C) {
843
+ if (typeof v != "function")
837
844
  throw new TypeError("The listener must be a function");
838
- var E = new l(y, _ || d, C), P = o ? o + v : v;
839
- 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;
845
+ var _ = new l(v, k || f, C), R = s ? s + m : m;
846
+ return f._events[R] ? f._events[R].fn ? f._events[R] = [f._events[R], _] : f._events[R].push(_) : (f._events[R] = _, f._eventsCount++), f;
840
847
  }
841
- function f(d, v) {
842
- --d._eventsCount === 0 ? d._events = new i() : delete d._events[v];
848
+ function g(f, m) {
849
+ --f._eventsCount === 0 ? f._events = new i() : delete f._events[m];
843
850
  }
844
- function g() {
851
+ function y() {
845
852
  this._events = new i(), this._eventsCount = 0;
846
853
  }
847
- g.prototype.eventNames = function() {
848
- var d = [], v, y;
854
+ y.prototype.eventNames = function() {
855
+ var f = [], m, v;
849
856
  if (this._eventsCount === 0)
850
- return d;
851
- for (y in v = this._events)
852
- e.call(v, y) && d.push(o ? y.slice(1) : y);
853
- return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
854
- }, g.prototype.listeners = function(d) {
855
- var v = o ? o + d : d, y = this._events[v];
856
- if (!y)
857
+ return f;
858
+ for (v in m = this._events)
859
+ e.call(m, v) && f.push(s ? v.slice(1) : v);
860
+ return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(m)) : f;
861
+ }, y.prototype.listeners = function(f) {
862
+ var m = s ? s + f : f, v = this._events[m];
863
+ if (!v)
857
864
  return [];
858
- if (y.fn)
859
- return [y.fn];
860
- for (var _ = 0, C = y.length, E = new Array(C); _ < C; _++)
861
- E[_] = y[_].fn;
862
- return E;
863
- }, g.prototype.listenerCount = function(d) {
864
- var v = o ? o + d : d, y = this._events[v];
865
- return y ? y.fn ? 1 : y.length : 0;
866
- }, g.prototype.emit = function(d, v, y, _, C, E) {
867
- var P = o ? o + d : d;
868
- if (!this._events[P])
865
+ if (v.fn)
866
+ return [v.fn];
867
+ for (var k = 0, C = v.length, _ = new Array(C); k < C; k++)
868
+ _[k] = v[k].fn;
869
+ return _;
870
+ }, y.prototype.listenerCount = function(f) {
871
+ var m = s ? s + f : f, v = this._events[m];
872
+ return v ? v.fn ? 1 : v.length : 0;
873
+ }, y.prototype.emit = function(f, m, v, k, C, _) {
874
+ var R = s ? s + f : f;
875
+ if (!this._events[R])
869
876
  return !1;
870
- var S = this._events[P], $ = arguments.length, L, T;
877
+ var S = this._events[R], D = arguments.length, L, T;
871
878
  if (S.fn) {
872
- switch (S.once && this.removeListener(d, S.fn, void 0, !0), $) {
879
+ switch (S.once && this.removeListener(f, S.fn, void 0, !0), D) {
873
880
  case 1:
874
881
  return S.fn.call(S.context), !0;
875
882
  case 2:
876
- return S.fn.call(S.context, v), !0;
883
+ return S.fn.call(S.context, m), !0;
877
884
  case 3:
878
- return S.fn.call(S.context, v, y), !0;
885
+ return S.fn.call(S.context, m, v), !0;
879
886
  case 4:
880
- return S.fn.call(S.context, v, y, _), !0;
887
+ return S.fn.call(S.context, m, v, k), !0;
881
888
  case 5:
882
- return S.fn.call(S.context, v, y, _, C), !0;
889
+ return S.fn.call(S.context, m, v, k, C), !0;
883
890
  case 6:
884
- return S.fn.call(S.context, v, y, _, C, E), !0;
891
+ return S.fn.call(S.context, m, v, k, C, _), !0;
885
892
  }
886
- for (T = 1, L = new Array($ - 1); T < $; T++)
893
+ for (T = 1, L = new Array(D - 1); T < D; T++)
887
894
  L[T - 1] = arguments[T];
888
895
  S.fn.apply(S.context, L);
889
896
  } else {
890
- var B = S.length, N;
891
- for (T = 0; T < B; T++)
892
- switch (S[T].once && this.removeListener(d, S[T].fn, void 0, !0), $) {
897
+ var U = S.length, H;
898
+ for (T = 0; T < U; T++)
899
+ switch (S[T].once && this.removeListener(f, S[T].fn, void 0, !0), D) {
893
900
  case 1:
894
901
  S[T].fn.call(S[T].context);
895
902
  break;
896
903
  case 2:
897
- S[T].fn.call(S[T].context, v);
904
+ S[T].fn.call(S[T].context, m);
898
905
  break;
899
906
  case 3:
900
- S[T].fn.call(S[T].context, v, y);
907
+ S[T].fn.call(S[T].context, m, v);
901
908
  break;
902
909
  case 4:
903
- S[T].fn.call(S[T].context, v, y, _);
910
+ S[T].fn.call(S[T].context, m, v, k);
904
911
  break;
905
912
  default:
906
913
  if (!L)
907
- for (N = 1, L = new Array($ - 1); N < $; N++)
908
- L[N - 1] = arguments[N];
914
+ for (H = 1, L = new Array(D - 1); H < D; H++)
915
+ L[H - 1] = arguments[H];
909
916
  S[T].fn.apply(S[T].context, L);
910
917
  }
911
918
  }
912
919
  return !0;
913
- }, g.prototype.on = function(d, v, y) {
914
- return c(this, d, v, y, !1);
915
- }, g.prototype.once = function(d, v, y) {
916
- return c(this, d, v, y, !0);
917
- }, g.prototype.removeListener = function(d, v, y, _) {
918
- var C = o ? o + d : d;
920
+ }, y.prototype.on = function(f, m, v) {
921
+ return c(this, f, m, v, !1);
922
+ }, y.prototype.once = function(f, m, v) {
923
+ return c(this, f, m, v, !0);
924
+ }, y.prototype.removeListener = function(f, m, v, k) {
925
+ var C = s ? s + f : f;
919
926
  if (!this._events[C])
920
927
  return this;
921
- if (!v)
922
- return f(this, C), this;
923
- var E = this._events[C];
924
- if (E.fn)
925
- E.fn === v && (!_ || E.once) && (!y || E.context === y) && f(this, C);
928
+ if (!m)
929
+ return g(this, C), this;
930
+ var _ = this._events[C];
931
+ if (_.fn)
932
+ _.fn === m && (!k || _.once) && (!v || _.context === v) && g(this, C);
926
933
  else {
927
- for (var P = 0, S = [], $ = E.length; P < $; P++)
928
- (E[P].fn !== v || _ && !E[P].once || y && E[P].context !== y) && S.push(E[P]);
929
- S.length ? this._events[C] = S.length === 1 ? S[0] : S : f(this, C);
934
+ for (var R = 0, S = [], D = _.length; R < D; R++)
935
+ (_[R].fn !== m || k && !_[R].once || v && _[R].context !== v) && S.push(_[R]);
936
+ S.length ? this._events[C] = S.length === 1 ? S[0] : S : g(this, C);
930
937
  }
931
938
  return this;
932
- }, g.prototype.removeAllListeners = function(d) {
933
- var v;
934
- return d ? (v = o ? o + d : d, this._events[v] && f(this, v)) : (this._events = new i(), this._eventsCount = 0), this;
935
- }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = o, g.EventEmitter = g, u.exports = g;
939
+ }, y.prototype.removeAllListeners = function(f) {
940
+ var m;
941
+ return f ? (m = s ? s + f : f, this._events[m] && g(this, m)) : (this._events = new i(), this._eventsCount = 0), this;
942
+ }, y.prototype.off = y.prototype.removeListener, y.prototype.addListener = y.prototype.on, y.prefixed = s, y.EventEmitter = y, h.exports = y;
936
943
  })(zr);
937
944
  var gn = zr.exports;
938
945
  const Nr = /* @__PURE__ */ Mr(gn);
939
946
  class Br extends Nr {
940
- constructor(e, o) {
947
+ constructor(e, s) {
941
948
  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) => {
942
949
  i.code === 27 && this.selectedId !== Y ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== Y && this._canRemove() && this.remove(this.selectedId);
943
950
  }), x(this, "_onClickMouseMove", (i) => {
@@ -949,7 +956,7 @@ class Br extends Nr {
949
956
  this.refreshEditor(), this.refreshDrawing();
950
957
  }), this.layer = e.layers.addSVGLayer({
951
958
  draw: (i) => this.draw(i)
952
- }), this.layer.moveToTop(), this.editor = e.layers.addLayer(o), this.editor.hide();
959
+ }), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
953
960
  }
954
961
  _canRemove() {
955
962
  return !0;
@@ -960,38 +967,38 @@ class Br extends Nr {
960
967
  * @returns the added annotation
961
968
  */
962
969
  add(e) {
963
- const o = this.getDefaultOptions(), i = Object.assign(e, {
964
- id: e.id === void 0 ? ze() : e.id,
970
+ const s = this.getDefaultOptions(), i = Object.assign(e, {
971
+ id: e.id === void 0 ? Be() : e.id,
965
972
  type: e.type,
966
973
  properties: {
967
- ...o.properties,
974
+ ...s.properties,
968
975
  ...e.properties || {},
969
976
  // styles need to be merged
970
- style: { ...o.properties.style, ...e.properties.style || {} }
977
+ style: { ...s.properties.style, ...e.properties.style || {} }
971
978
  },
972
979
  geometry: {
973
- ...o.geometry,
980
+ ...s.geometry,
974
981
  ...e.geometry
975
982
  }
976
983
  });
977
984
  return this.elements.push(i), this.layer.refresh(), this.emit(hr, i), i;
978
985
  }
979
- updateStyle(e, o) {
986
+ updateStyle(e, s) {
980
987
  this.updateAnnotation(e, {
981
988
  properties: {
982
- style: o
989
+ style: s
983
990
  }
984
991
  });
985
992
  }
986
- updateGeometry(e, o) {
993
+ updateGeometry(e, s) {
987
994
  this.updateAnnotation(e, {
988
- geometry: o
995
+ geometry: s
989
996
  });
990
997
  }
991
- scale(e, o, i, l) {
998
+ scale(e, s, i, l) {
992
999
  this.updateGeometry(
993
1000
  e,
994
- sn(e.geometry, o, i, l)
1001
+ sn(e.geometry, s, i, l)
995
1002
  );
996
1003
  }
997
1004
  /**
@@ -1000,18 +1007,18 @@ class Br extends Nr {
1000
1007
  * @param id Id of the annotation to update
1001
1008
  * @param element params of the annotation
1002
1009
  */
1003
- update(e, o) {
1010
+ update(e, s) {
1004
1011
  const i = this.getById(e);
1005
- this.updateAnnotation(i, o);
1012
+ this.updateAnnotation(i, s);
1006
1013
  }
1007
- updateAnnotation(e, o) {
1014
+ updateAnnotation(e, s) {
1008
1015
  if (!e)
1009
1016
  return;
1010
1017
  const i = e.id;
1011
- Object.keys(o).forEach((l) => {
1018
+ Object.keys(s).forEach((l) => {
1012
1019
  if (l !== "id")
1013
1020
  if (l === "properties") {
1014
- const c = o.properties || { style: {} };
1021
+ const c = s.properties || { style: {} };
1015
1022
  e.properties = {
1016
1023
  ...e.properties || {},
1017
1024
  ...c || {},
@@ -1023,15 +1030,15 @@ class Br extends Nr {
1023
1030
  } else
1024
1031
  l === "geometry" ? e.geometry = {
1025
1032
  ...e.geometry,
1026
- ...o.geometry
1027
- } : e[l] = o[l];
1033
+ ...s.geometry
1034
+ } : e[l] = s[l];
1028
1035
  }), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
1029
1036
  }
1030
1037
  getById(e) {
1031
- const o = Number(e);
1038
+ const s = Number(e);
1032
1039
  for (let i = 0; i < this.elements.length; i++) {
1033
1040
  const l = this.elements[i];
1034
- if (!(l.id !== e && l.id !== o))
1041
+ if (!(l.id !== e && l.id !== s))
1035
1042
  return l;
1036
1043
  }
1037
1044
  }
@@ -1041,12 +1048,12 @@ class Br extends Nr {
1041
1048
  * Select element, show editor, disable Ogma dragging and fire event
1042
1049
  */
1043
1050
  select(e) {
1044
- const o = this.getById(e);
1045
- o && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, o));
1051
+ const s = this.getById(e);
1052
+ s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
1046
1053
  }
1047
1054
  hover(e) {
1048
- const o = this.getById(e);
1049
- o && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, o));
1055
+ const s = this.getById(e);
1056
+ s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, s));
1050
1057
  }
1051
1058
  getSelectedFeature() {
1052
1059
  return this.selectedId === Y ? null : this.getById(this.selectedId);
@@ -1065,8 +1072,8 @@ class Br extends Nr {
1065
1072
  * Removes annotation with the given id
1066
1073
  */
1067
1074
  remove(e) {
1068
- const o = this.getById(e);
1069
- e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), o && this.emit(ur, o), this.layer.refresh();
1075
+ const s = this.getById(e);
1076
+ e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), s && this.emit(ur, s), this.layer.refresh();
1070
1077
  }
1071
1078
  /**
1072
1079
  * @method disableDragging
@@ -1118,7 +1125,7 @@ class Br extends Nr {
1118
1125
  }
1119
1126
  const vr = "handle-line", mr = "handle-start", br = "handle-end";
1120
1127
  class pn extends Br {
1121
- constructor(e, o = {}) {
1128
+ constructor(e, s = {}) {
1122
1129
  super(
1123
1130
  e,
1124
1131
  `
@@ -1132,26 +1139,29 @@ class pn extends Br {
1132
1139
  const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
1133
1140
  if (!l)
1134
1141
  return;
1135
- const { x: c, y: f } = sr(i, this.ogma.getContainer());
1136
- this.startDragging(l, c, f), this.draggedHandle = Lr(i.target);
1142
+ const { x: c, y: g } = Me(i, this.ogma.getContainer());
1143
+ this.startDragging(l, c, g), this.draggedHandle = Lr(i.target);
1137
1144
  }), x(this, "onMouseUp", () => {
1138
1145
  this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
1139
1146
  }), x(this, "onMouseMove", (i) => {
1140
1147
  if (!this.isDragging || this.draggedHandle === Y)
1141
1148
  return;
1142
- const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: g } = at(
1149
+ const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), g = Me(
1150
+ i,
1151
+ this.ogma.getContainer()
1152
+ ), { x: y, y: f } = at(
1143
1153
  an(
1144
- { x: i.clientX - this.startX, y: i.clientY - this.startY },
1154
+ { x: g.x - this.startX, y: g.y - this.startY },
1145
1155
  this.ogma.view.getZoom()
1146
1156
  ),
1147
1157
  c
1148
- ), d = l.id === vr, v = l.id === mr, y = l.id === br;
1149
- (d || v) && Rr(this.arrow, this.start.x + f, this.start.y + g), (d || y) && Ir(this.arrow, this.end.x + f, this.end.y + g), this.emit(
1150
- De,
1158
+ ), m = l.id === vr, v = l.id === mr, k = l.id === br;
1159
+ (m || v) && Rr(this.arrow, this.start.x + y, this.start.y + f), (m || k) && Ir(this.arrow, this.end.x + y, this.end.y + f), this.emit(
1160
+ ze,
1151
1161
  this.arrow,
1152
- d ? "line" : v ? "start" : "end"
1162
+ m ? "line" : v ? "start" : "end"
1153
1163
  ), this.refreshEditor(), this.layer.refresh();
1154
- }), this.minArrowHeight = o.minArrowHeight || 0, this.maxArrowHeight = o.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1164
+ }), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1155
1165
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
1156
1166
  ), this.handles.forEach(
1157
1167
  (i) => i.addEventListener("mousedown", this.onHandleMouseDown)
@@ -1163,56 +1173,56 @@ class pn extends Br {
1163
1173
  * @param y
1164
1174
  * @param arrow
1165
1175
  */
1166
- startDrawing(e, o, i = tn(e, o, e, o, ge)) {
1176
+ startDrawing(e, s, i = tn(e, s, e, s, fe)) {
1167
1177
  var l;
1168
1178
  this.disableDragging(), this.add(i), this.hoveredId = i.id;
1169
- const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: o }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1179
+ const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), g = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1170
1180
  left: 0,
1171
1181
  top: 0
1172
1182
  };
1173
1183
  this.startDragging(
1174
1184
  this.getById(i.id),
1175
- c.x + (f == null ? void 0 : f.left),
1176
- c.y + f.top
1185
+ c.x + (g == null ? void 0 : g.left),
1186
+ c.y + g.top
1177
1187
  ), this.draggedHandle = 2;
1178
1188
  }
1179
1189
  cancelDrawing() {
1180
1190
  this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
1181
1191
  }
1182
- startDragging(e, o, i) {
1183
- this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = o, this.startY = i, this.start = fe(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Me, this.arrow), this.isDragging = !0;
1192
+ startDragging(e, s, i) {
1193
+ this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = de(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Ne, this.arrow), this.isDragging = !0;
1184
1194
  }
1185
- detect(e, o = 0) {
1195
+ detect(e, s = 0) {
1186
1196
  return this.elements.find((i) => {
1187
- const { start: l, end: c } = je(i), f = Ct(e, {
1197
+ const { start: l, end: c } = De(i), g = Ct(e, {
1188
1198
  x: (l.x + c.x) / 2,
1189
1199
  y: (l.y + c.y) / 2
1190
- }), g = Ct(c, l), d = Ut(g), v = $r(g), y = Dr(i);
1191
- return Math.abs(pr(v, f)) < d / 2 + o && Math.abs(pr(at(v, Math.PI / 2), f)) < y / 2 + o;
1200
+ }), y = Ct(c, l), f = Ut(y), m = jr(y), v = Dr(i);
1201
+ return Math.abs(pr(m, g)) < f / 2 + s && Math.abs(pr(at(m, Math.PI / 2), g)) < v / 2 + s;
1192
1202
  });
1193
1203
  }
1194
1204
  refreshEditor() {
1195
1205
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1196
1206
  return;
1197
- const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), o = je(e), i = this.ogma.view.graphToScreenCoordinates(o.start), l = this.ogma.view.graphToScreenCoordinates(o.end), [c, f, g] = Array.prototype.slice.call(
1207
+ const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = De(e), i = this.ogma.view.graphToScreenCoordinates(s.start), l = this.ogma.view.graphToScreenCoordinates(s.end), [c, g, y] = Array.prototype.slice.call(
1198
1208
  this.editor.element.querySelectorAll(".handle")
1199
1209
  );
1200
- f.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1201
- const d = {
1210
+ g.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, y.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1211
+ const f = {
1202
1212
  x: (l.x + i.x) / 2,
1203
1213
  y: (l.y + i.y) / 2
1204
- }, v = Ct(l, i), y = jr(v, 1 / Ut(v)), _ = Math.atan2(y.y, y.x);
1205
- c.style.width = `${Ut(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
1214
+ }, m = Ct(l, i), v = $r(m, 1 / Ut(m)), k = Math.atan2(v.y, v.x);
1215
+ c.style.width = `${Ut(m)}px`, c.style.left = `${f.x}px`, c.style.top = `${f.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${k}rad)`;
1206
1216
  }
1207
1217
  getDefaultOptions() {
1208
1218
  return gr;
1209
1219
  }
1210
1220
  draw(e) {
1211
1221
  e.innerHTML = "";
1212
- const o = de("g"), i = this.ogma.view.getAngle();
1213
- o.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1214
- (l) => ln(l, o, ge, this.minArrowHeight, this.maxArrowHeight)
1215
- ), e.appendChild(o);
1222
+ const s = ce("g"), i = this.ogma.view.getAngle();
1223
+ s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1224
+ (l) => ln(l, s, fe, this.minArrowHeight, this.maxArrowHeight)
1225
+ ), e.appendChild(s);
1216
1226
  }
1217
1227
  refreshDrawing() {
1218
1228
  const e = this.ogma.view.getAngle();
@@ -1233,7 +1243,7 @@ const Wt = {
1233
1243
  strokeWidth: 1,
1234
1244
  strokeColor: "#000",
1235
1245
  strokeType: "plain"
1236
- }, rr = {
1246
+ }, nr = {
1237
1247
  id: 0,
1238
1248
  type: "Feature",
1239
1249
  properties: {
@@ -1258,8 +1268,8 @@ const Wt = {
1258
1268
  }, wr = {
1259
1269
  handleSize: 3.5,
1260
1270
  placeholder: "Your text..."
1261
- }, yn = (u = 0, e = 0, o = 100, i = 50, l = "", c = { ...Wt }) => ({
1262
- id: ze(),
1271
+ }, yn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Wt }) => ({
1272
+ id: Be(),
1263
1273
  type: "Feature",
1264
1274
  properties: {
1265
1275
  type: "text",
@@ -1270,23 +1280,23 @@ const Wt = {
1270
1280
  type: "Polygon",
1271
1281
  coordinates: [
1272
1282
  [
1273
- [u, e],
1274
- [u + o, e],
1275
- [u + o, e + i],
1276
- [u, e + i],
1277
- [u, e]
1283
+ [h, e],
1284
+ [h + s, e],
1285
+ [h + s, e + i],
1286
+ [h, e + i],
1287
+ [h, e]
1278
1288
  ]
1279
1289
  ]
1280
1290
  }
1281
1291
  });
1282
1292
  var Hr = { exports: {} };
1283
- (function(u, e) {
1284
- (function(o, i) {
1285
- u.exports = i();
1293
+ (function(h, e) {
1294
+ (function(s, i) {
1295
+ h.exports = i();
1286
1296
  })(fn, () => (() => {
1287
- var o = { d: (r, n) => {
1297
+ var s = { d: (r, n) => {
1288
1298
  for (var a in n)
1289
- o.o(n, a) && !o.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1299
+ s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1290
1300
  }, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
1291
1301
  function l(r) {
1292
1302
  return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1295,67 +1305,67 @@ var Hr = { exports: {} };
1295
1305
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1296
1306
  }, l(r);
1297
1307
  }
1298
- o.d(i, { default: () => Ke });
1299
- 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/, g = /\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 };
1300
- function _(r) {
1308
+ s.d(i, { default: () => Pe });
1309
+ 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/, y = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, m = 13.3333333, v = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1310
+ function k(r) {
1301
1311
  var n = "", a = this;
1302
1312
  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;
1303
1313
  }
1304
- var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: _, valueOf: _ };
1305
- function E(r) {
1314
+ var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: k, valueOf: k };
1315
+ function _(r) {
1306
1316
  var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
1307
1317
  n.family = (a[6] || "").trim();
1308
- var t = y[a[2]] || parseFloat(a[2]);
1309
- a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), n.size = t;
1310
- var s = parseFloat(a[4]);
1311
- if (s !== "normal" && s !== "inherit" && s ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = s * v : a[5] === "%" ? n.height = 0.01 * t : n.height = s : n.height = s * t : n.height = Math.round(t * (7 / 6)), f.test(a[1]) && (n.variant = "small-caps"), g.test(a[1]) && (n.style = "italic"), d.test(a[1]))
1318
+ var o = v[a[2]] || parseFloat(a[2]);
1319
+ a[3] === "%" ? o *= 0.16 : a[3] === "em" ? o *= 16 : a[3] === "pt" && (o *= m), n.size = o;
1320
+ var t = parseFloat(a[4]);
1321
+ if (t !== "normal" && t !== "inherit" && t ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = t * m : a[5] === "%" ? n.height = 0.01 * o : n.height = t : n.height = t * o : n.height = Math.round(o * (7 / 6)), g.test(a[1]) && (n.variant = "small-caps"), y.test(a[1]) && (n.style = "italic"), f.test(a[1]))
1312
1322
  n.weight = "bold";
1313
1323
  else {
1314
- var h = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1315
- h >= 100 && h !== 400 && (n.weight = h);
1324
+ var u = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1325
+ u >= 100 && u !== 400 && (n.weight = u);
1316
1326
  }
1317
1327
  return n;
1318
1328
  }
1319
- function P() {
1320
- var r, n, a, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = 14, p = 12, m = null, w = null, b = "";
1321
- if (t && t.nodeType) {
1322
- var A = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), R = A.getComputedStyle(t, null);
1323
- r = R.getPropertyValue("font-family") || "", p = parseFloat(R.getPropertyValue("font-size")), h = R.getPropertyValue("line-height"), m = R.getPropertyValue("font-weight"), w = R.getPropertyValue("font-style"), b = R.getPropertyValue("font-variant") || "";
1324
- } else if (typeof t == "string") {
1325
- var k = E(t);
1326
- r = k.family, p = k.size, h = k.height, b = k.variant, w = k.style, m = k.weight;
1329
+ function R() {
1330
+ var r, n, a, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, d = 12, p = null, b = null, w = "";
1331
+ if (o && o.nodeType) {
1332
+ var A = o && (o.ownerDocument && o.ownerDocument.defaultView || o.document && o || o.defaultView), E = A.getComputedStyle(o, null);
1333
+ r = E.getPropertyValue("font-family") || "", d = parseFloat(E.getPropertyValue("font-size")), u = E.getPropertyValue("line-height"), p = E.getPropertyValue("font-weight"), b = E.getPropertyValue("font-style"), w = E.getPropertyValue("font-variant") || "";
1334
+ } else if (typeof o == "string") {
1335
+ var O = _(o);
1336
+ r = O.family, d = O.size, u = O.height, w = O.variant, b = O.style, p = O.weight;
1327
1337
  } else
1328
- l(t) === "object" && (r = t.family, p = t.size, h = t.height, b = t.variant, m = t.weight, w = t.style, n = t.baseline, a = t.color);
1329
- s.size && s.size < 3 && (p *= s.size), h = h !== "normal" && h ? parseFloat(h) : p * (7 / 6), s.height && s.height < 3 && (h *= s.height);
1330
- var O = Object.create(C);
1331
- return O.family = s.family || r || "sans-serif", O.height = h ?? 14, O.size = p ?? 12, O.variant = s.variant || b || "", O.style = s.style || w || "", O.weight = s.weight || m || "", O.baseline = n || 0, s.baseline != null && (O.baseline = s.baseline), O.color = s.color || a || "", O.id = _.call(O, !0), O;
1338
+ l(o) === "object" && (r = o.family, d = o.size, u = o.height, w = o.variant, p = o.weight, b = o.style, n = o.baseline, a = o.color);
1339
+ t.size && t.size < 3 && (d *= t.size), u = u !== "normal" && u ? parseFloat(u) : d * (7 / 6), t.height && t.height < 3 && (u *= t.height);
1340
+ var P = Object.create(C);
1341
+ return P.family = t.family || r || "sans-serif", P.height = u ?? 14, P.size = d ?? 12, P.variant = t.variant || w || "", P.style = t.style || b || "", P.weight = t.weight || p || "", P.baseline = n || 0, t.baseline != null && (P.baseline = t.baseline), P.color = t.color || a || "", P.id = k.call(P, !0), P;
1332
1342
  }
1333
1343
  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 };
1334
- var $, L = function(r) {
1344
+ var D, L = function(r) {
1335
1345
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
1336
1346
  if (n && n.getContext) {
1337
1347
  var a = n.getContext("2d");
1338
1348
  if (a && typeof a.measureText == "function")
1339
- return function(t, s) {
1340
- return a.font = String(s), a.measureText(t).width;
1349
+ return function(o, t) {
1350
+ return a.font = String(t), a.measureText(o).width;
1341
1351
  };
1342
1352
  }
1343
- }(typeof document < "u" ? document : null) || ($ = {}, function(r, n) {
1344
- if (!$[n]) {
1345
- var a = P(n);
1346
- $[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1353
+ }(typeof document < "u" ? document : null) || (D = {}, function(r, n) {
1354
+ if (!D[n]) {
1355
+ var a = R(n);
1356
+ D[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1347
1357
  }
1348
- return r.length * $[n].size;
1349
- }), T = {}, B = { trim: !0, collapse: !0 };
1350
- function N(r, n, a) {
1351
- var t = Object.assign({}, B, a), s = String(r);
1352
- if (!s)
1358
+ return r.length * D[n].size;
1359
+ }), T = {}, U = { trim: !0, collapse: !0 };
1360
+ function H(r, n, a) {
1361
+ var o = Object.assign({}, U, a), t = String(r);
1362
+ if (!t)
1353
1363
  return 0;
1354
- if (s in S) {
1355
- var h = n.id + "/" + s;
1356
- return h in T || (T[h] = L("_".concat(s, "_"), n) - L("__", n)), T[h];
1364
+ if (t in S) {
1365
+ var u = n.id + "/" + t;
1366
+ return u in T || (T[u] = L("_".concat(t, "_"), n) - L("__", n)), T[u];
1357
1367
  }
1358
- return t.trim && t.collapse ? t.trim ? s = s.trim() : t.collapse && (s = s.replace(/\s+/g, " ")) : s = s.replace(/\n/g, " "), L(s, n) + n.size * (r.tracking || 0);
1368
+ return o.trim && o.collapse ? o.trim ? t = t.trim() : o.collapse && (t = t.replace(/\s+/g, " ")) : t = t.replace(/\n/g, " "), L(t, n) + n.size * (r.tracking || 0);
1359
1369
  }
1360
1370
  function it(r) {
1361
1371
  return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1364,14 +1374,14 @@ var Hr = { exports: {} };
1364
1374
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1365
1375
  }, it(r);
1366
1376
  }
1367
- function xt(r, n) {
1377
+ function At(r, n) {
1368
1378
  if (typeof n != "function" && n !== null)
1369
1379
  throw new TypeError("Super expression must either be null or a function");
1370
1380
  r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
1371
1381
  }
1372
1382
  function qt(r, n) {
1373
- return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
1374
- return a.__proto__ = t, a;
1383
+ return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, o) {
1384
+ return a.__proto__ = o, a;
1375
1385
  }, qt(r, n);
1376
1386
  }
1377
1387
  function Yt(r) {
@@ -1388,16 +1398,16 @@ var Hr = { exports: {} };
1388
1398
  }
1389
1399
  }();
1390
1400
  return function() {
1391
- var a, t = Ot(r);
1401
+ var a, o = Ot(r);
1392
1402
  if (n) {
1393
- var s = Ot(this).constructor;
1394
- a = Reflect.construct(t, arguments, s);
1403
+ var t = Ot(this).constructor;
1404
+ a = Reflect.construct(o, arguments, t);
1395
1405
  } else
1396
- a = t.apply(this, arguments);
1397
- return pe(this, a);
1406
+ a = o.apply(this, arguments);
1407
+ return ge(this, a);
1398
1408
  };
1399
1409
  }
1400
- function pe(r, n) {
1410
+ function ge(r, n) {
1401
1411
  if (n && (it(n) === "object" || typeof n == "function"))
1402
1412
  return n;
1403
1413
  if (n !== void 0)
@@ -1417,28 +1427,28 @@ var Hr = { exports: {} };
1417
1427
  if (!(r instanceof n))
1418
1428
  throw new TypeError("Cannot call a class as a function");
1419
1429
  }
1420
- function Gt(r, n) {
1430
+ function pe(r, n) {
1421
1431
  for (var a = 0; a < n.length; a++) {
1422
- var t = n[a];
1423
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1424
- if (it(h) !== "object" || h === null)
1425
- return h;
1426
- var m = h[Symbol.toPrimitive];
1427
- if (m !== void 0) {
1428
- var w = m.call(h, p);
1429
- if (it(w) !== "object")
1430
- return w;
1432
+ var o = n[a];
1433
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1434
+ if (it(u) !== "object" || u === null)
1435
+ return u;
1436
+ var p = u[Symbol.toPrimitive];
1437
+ if (p !== void 0) {
1438
+ var b = p.call(u, d);
1439
+ if (it(b) !== "object")
1440
+ return b;
1431
1441
  throw new TypeError("@@toPrimitive must return a primitive value.");
1432
1442
  }
1433
- return String(h);
1434
- }(t.key, "string"), it(s) === "symbol" ? s : String(s)), t);
1443
+ return String(u);
1444
+ }(o.key, "string"), it(t) === "symbol" ? t : String(t)), o);
1435
1445
  }
1436
- var s;
1446
+ var t;
1437
1447
  }
1438
1448
  function tt(r, n, a) {
1439
- return n && Gt(r.prototype, n), a && Gt(r, a), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1449
+ return n && pe(r.prototype, n), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1440
1450
  }
1441
- var D = function() {
1451
+ var z = function() {
1442
1452
  function r() {
1443
1453
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1444
1454
  Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
@@ -1452,42 +1462,42 @@ var Hr = { exports: {} };
1452
1462
  return this.value;
1453
1463
  } }]), r;
1454
1464
  }(), lt = function(r) {
1455
- xt(a, r);
1465
+ At(a, r);
1456
1466
  var n = Yt(a);
1457
1467
  function a() {
1458
1468
  return Pt(this, a), n.apply(this, arguments);
1459
1469
  }
1460
1470
  return tt(a);
1461
- }(D), G = function(r) {
1462
- xt(a, r);
1471
+ }(z), X = function(r) {
1472
+ At(a, r);
1463
1473
  var n = Yt(a);
1464
1474
  function a() {
1465
1475
  return Pt(this, a), n.apply(this, arguments);
1466
1476
  }
1467
1477
  return tt(a);
1468
- }(D), ut = function(r) {
1469
- xt(a, r);
1478
+ }(z), ut = function(r) {
1479
+ At(a, r);
1470
1480
  var n = Yt(a);
1471
1481
  function a() {
1472
1482
  return Pt(this, a), n.apply(this, arguments);
1473
1483
  }
1474
1484
  return tt(a);
1475
- }(D), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Xt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
1476
- function At(r, n) {
1485
+ }(z), 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]/;
1486
+ function Et(r, n) {
1477
1487
  n !== !1 && (r = r.trim());
1478
- for (var a, t, s = [], h = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
1479
- a = r.charAt(m), t = r.charAt(m + 1);
1480
- var b = Rt.test(h), A = Rt.test(a), R = A || b, k = void 0;
1481
- if ((me.test(a) && !Xt.test(h) || ve.test(h + t) && !Xt.test(a)) && (R = !0), h !== "-" && h !== "‐" && h !== "–" && h !== "—" || ((k = Rt.test(r.charAt(m - 2))) && !A && (R = !1), !k && ye.test(a + t) && (R = !0)), R) {
1482
- var O = r.slice(p, m);
1483
- /\u00AD$/.test(O) ? (s.push(new D(O.slice(0, -1))), s.push(new ut())) : (s.push(new D(O)), s.push(new lt())), p = m;
1488
+ for (var a, o, t = [], u = r.charAt(0), d = 0, p = 1, b = r.length; p < b; p++) {
1489
+ a = r.charAt(p), o = r.charAt(p + 1);
1490
+ var w = Rt.test(u), A = Rt.test(a), E = A || w, O = void 0;
1491
+ if ((me.test(a) && !Gt.test(u) || ve.test(u + o) && !Gt.test(a)) && (E = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((O = Rt.test(r.charAt(p - 2))) && !A && (E = !1), !O && ye.test(a + o) && (E = !0)), E) {
1492
+ var P = r.slice(d, p);
1493
+ /\u00AD$/.test(P) ? (t.push(new z(P.slice(0, -1))), t.push(new ut())) : (t.push(new z(P)), t.push(new lt())), d = p;
1484
1494
  }
1485
- h = a;
1495
+ u = a;
1486
1496
  }
1487
- return s.push(new D(r.slice(p))), s;
1497
+ return t.push(new z(r.slice(d))), t;
1488
1498
  }
1489
1499
  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: "›" };
1490
- 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) {
1500
+ var He = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Xt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([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, _t = { b: function(r) {
1491
1501
  r.weight = "bold";
1492
1502
  }, strong: function(r) {
1493
1503
  r.weight = "bold";
@@ -1513,27 +1523,27 @@ var Hr = { exports: {} };
1513
1523
  r.sub = !0;
1514
1524
  }, sup: function(r) {
1515
1525
  r.sup = !0;
1516
- } }, 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 };
1517
- function Qt(r) {
1518
- return r.replace(Kt, function(n, a, t, s) {
1519
- if (a || t) {
1520
- var h = a ? 10 : 16;
1521
- return String.fromCharCode(parseInt(a || t, h));
1526
+ } }, Ue = { 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 };
1527
+ function Zt(r) {
1528
+ return r.replace(Kt, function(n, a, o, t) {
1529
+ if (a || o) {
1530
+ var u = a ? 10 : 16;
1531
+ return String.fromCharCode(parseInt(a || o, u));
1522
1532
  }
1523
- return s in be ? be[s] : n;
1533
+ return t in be ? be[t] : n;
1524
1534
  });
1525
1535
  }
1526
- function He(r) {
1536
+ function We(r) {
1527
1537
  return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
1528
1538
  }
1529
- var Ue = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1539
+ var Ve = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1530
1540
  function Lt(r) {
1531
1541
  var n, a = {};
1532
1542
  if (r) {
1533
1543
  do
1534
- if (n = Ue.exec(r)) {
1535
- var t = Qt(He(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1536
- if (a[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1544
+ if (n = Ve.exec(r)) {
1545
+ var o = Zt(We(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1546
+ if (a[n[1]] = o, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1537
1547
  throw new Error("Attribute error");
1538
1548
  }
1539
1549
  while (n && r.length);
@@ -1542,8 +1552,8 @@ var Hr = { exports: {} };
1542
1552
  }
1543
1553
  return a;
1544
1554
  }
1545
- 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: "Þ" };
1546
- var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, We = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, te = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, H = { bf: function(r) {
1555
+ const bt = { 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: "Þ" };
1556
+ var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, qe = /^\\([&{}$%#_])/, Ye = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, W = { bf: function(r) {
1547
1557
  r.weight = "bold";
1548
1558
  }, it: function(r) {
1549
1559
  r.style = "italic";
@@ -1558,23 +1568,23 @@ var Hr = { exports: {} };
1558
1568
  }, _: function(r) {
1559
1569
  r.sub = !0;
1560
1570
  }, par: function(r) {
1561
- this.tokens.push(new G(), new G());
1571
+ this.tokens.push(new X(), new X());
1562
1572
  }, newline: function(r) {
1563
- this.tokens.push(new G());
1573
+ this.tokens.push(new X());
1564
1574
  }, url: function(r, n) {
1565
- this.open_context().href = n, this.add_token(new D(n)), this.close_context();
1575
+ this.open_context().href = n, this.add_token(new z(n)), this.close_context();
1566
1576
  } };
1567
- 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;
1568
- var qe = /[\r\n\xA0]+/g;
1577
+ W.textsuperscript = W["^"], W.textsubscript = W._, W.textsl = W.sl, W.mathbf = W.bf, W.mathit = W.it, W.textbf = W.bf, W.textit = W.it, W.textcolor = W.color;
1578
+ var Ge = /[\r\n\xA0]+/g;
1569
1579
  function Ae(r, n) {
1570
1580
  r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
1571
1581
  var a = n;
1572
- return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = P(n, r)), a;
1582
+ return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = R(n, r)), a;
1573
1583
  }
1574
- function ee(r, n, a) {
1575
- for (var t, s, h = r.width; h + a.width > n && r.length; )
1576
- s = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = N(t, t.font), h += t.width) : r.pop(), h -= s;
1577
- r[r.length - 1] instanceof ut && 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);
1584
+ function te(r, n, a) {
1585
+ for (var o, t, u = r.width; u + a.width > n && r.length; )
1586
+ t = (o = r[r.length - 1]).width, o.width > a.width ? (o.value = o.value.slice(0, -1), o.width = H(o, o.font), u += o.width) : r.pop(), u -= t;
1587
+ r[r.length - 1] instanceof ut && r.pop(), o = r[r.length - 1] || o || {}, a.font = R(a.font, o.bold, o.italic, ""), a.href = r.length ? o.href : null, a.rel = r.length ? o.rel : null, a.target = r.length ? o.target : null, r.push(a);
1578
1588
  }
1579
1589
  function ot(r) {
1580
1590
  return Math.round(1e6 * r) / 1e6;
@@ -1582,92 +1592,92 @@ var Hr = { exports: {} };
1582
1592
  function Ee(r) {
1583
1593
  return function(n) {
1584
1594
  if (Array.isArray(n))
1585
- return $t(n);
1595
+ return jt(n);
1586
1596
  }(r) || function(n) {
1587
1597
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
1588
1598
  return Array.from(n);
1589
1599
  }(r) || function(n, a) {
1590
1600
  if (n) {
1591
1601
  if (typeof n == "string")
1592
- return $t(n, a);
1593
- var t = Object.prototype.toString.call(n).slice(8, -1);
1594
- 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;
1602
+ return jt(n, a);
1603
+ var o = Object.prototype.toString.call(n).slice(8, -1);
1604
+ return o === "Object" && n.constructor && (o = n.constructor.name), o === "Map" || o === "Set" ? Array.from(n) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? jt(n, a) : void 0;
1595
1605
  }
1596
1606
  }(r) || function() {
1597
1607
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1598
1608
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1599
1609
  }();
1600
1610
  }
1601
- function $t(r, n) {
1611
+ function jt(r, n) {
1602
1612
  (n == null || n > r.length) && (n = r.length);
1603
- for (var a = 0, t = new Array(n); a < n; a++)
1604
- t[a] = r[a];
1605
- return t;
1613
+ for (var a = 0, o = new Array(n); a < n; a++)
1614
+ o[a] = r[a];
1615
+ return o;
1606
1616
  }
1607
- var _e = { center: "middle", right: "end" }, re = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ne = function(r, n) {
1617
+ var _e = { center: "middle", right: "end" }, ee = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, re = function(r, n) {
1608
1618
  return !r && !n || r === n;
1609
1619
  };
1610
- function Ye(r, n) {
1611
- var a = [], t = n.font(), s = t.size, h = t.family, p = n.align(), m = n.createElement();
1620
+ function Xe(r, n) {
1621
+ var a = [], o = n.font(), t = o.size, u = o.family, d = n.align(), p = n.createElement();
1612
1622
  if (r.length) {
1613
- 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 / s), U = k ? null : ot(w / (1.15 * s + (w - s) / 2));
1614
- if (re[b] && isFinite(A)) {
1615
- var M = b === "bottom" ? 1 : 0.5;
1616
- U += (A * M - w * r.length * M) / s;
1623
+ var b = o.height, w = n.valign(), A = n.height()(), E = n.width()(0), O = !isFinite(E) && r.length === 1, P = O ? null : n.x(), I = ot(b / t), B = O ? null : ot(b / (1.15 * t + (b - t) / 2));
1624
+ if (ee[w] && isFinite(A)) {
1625
+ var M = w === "bottom" ? 1 : 0.5;
1626
+ B += (A * M - b * r.length * M) / t;
1617
1627
  }
1618
- var I = p === "justify", W = 0;
1619
- p === "right" ? W = R : p === "center" && (W = R / 2);
1620
- for (var z = [], et = "tspan", J = null, V = "", F = function() {
1628
+ var F = d === "justify", $ = 0;
1629
+ d === "right" ? $ = E : d === "center" && ($ = E / 2);
1630
+ for (var N = [], K = "tspan", G = null, V = "", j = function() {
1621
1631
  if (V) {
1622
- var Tt = m(et, J, V);
1623
- z.push(Tt);
1632
+ var Tt = p(K, G, V);
1633
+ N.push(Tt);
1624
1634
  }
1625
- et = "tspan", J = null, V = "";
1635
+ K = "tspan", G = null, V = "";
1626
1636
  }, nt = 0, rt = r.length; nt < rt; nt++) {
1627
- var ft = "", bt = "", ct = 0, gt = r[nt];
1637
+ var ft = "", wt = "", ct = 0, gt = r[nt];
1628
1638
  if (gt.length) {
1629
- z = [];
1630
- for (var Mt = 0, le = 0, pt = void 0, Z = 0, Pe = gt.length; Z < Pe; Z++) {
1631
- var q = gt[Z], K = q.font;
1632
- q.whitespace && Mt++, le += q.width, Z && !q.tracking && !ct && ne(K.id, ft) && ne(q.class, bt) && ne(pt, q.href) ? V += q.value : (F(), V = q.value, J = { fontFamily: K.family !== h ? K.family : null, fontSize: K.size !== s ? 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, bt = q.class);
1639
+ N = [];
1640
+ for (var Mt = 0, ae = 0, pt = void 0, Z = 0, Re = gt.length; Z < Re; Z++) {
1641
+ var q = gt[Z], Q = q.font;
1642
+ q.whitespace && Mt++, ae += q.width, Z && !q.tracking && !ct && re(Q.id, ft) && re(q.class, wt) && re(pt, q.href) ? V += q.value : (j(), V = q.value, G = { fontFamily: Q.family !== u ? Q.family : null, fontSize: Q.size !== t ? 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: q.class || null }, ct && (G.dx = ot(ct), ct = 0), q.tracking && (ct = Q.size * q.tracking), q.href && !pt ? (pt = q.href, K = "a", G.href = pt, G.rel = q.rel, G.target = q.target) : pt = null, ft = Q.id, wt = q.class);
1633
1643
  }
1634
- if (F(), k)
1635
- a.push.apply(a, Ee(z));
1644
+ if (j(), O)
1645
+ a.push.apply(a, Ee(N));
1636
1646
  else {
1637
- var Re = null, ue = nt === rt - 1 || gt[gt.length - 1] instanceof G;
1638
- I && gt.length > 1 && !ue && (Re = ot((R - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: Re, x: O(nt) + W, dy: ot(nt ? j : U) + "em" }].concat(Ee(z))));
1647
+ var Ie = null, le = nt === rt - 1 || gt[gt.length - 1] instanceof X;
1648
+ F && gt.length > 1 && !le && (Ie = ot((E - ae) / Mt)), a.push(p.apply(void 0, ["tspan", { wordSpacing: Ie, x: P(nt) + $, dy: ot(nt ? I : B) + "em" }].concat(Ee(N))));
1639
1649
  }
1640
1650
  } else
1641
- a.push(m("tspan", { x: O(nt), dy: ot(nt ? j : U) + "em" }, " "));
1651
+ a.push(p("tspan", { x: P(nt), dy: ot(nt ? I : B) + "em" }, " "));
1642
1652
  }
1643
1653
  }
1644
- return m.apply(void 0, ["text", { fontFamily: h, fontSize: s, textAnchor: _e[p] || "start" }].concat(a));
1654
+ return p.apply(void 0, ["text", { fontFamily: u, fontSize: t, textAnchor: _e[d] || "start" }].concat(a));
1645
1655
  }
1646
- var Ge = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1647
- function Xe(r, n, a) {
1656
+ var Je = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1657
+ function Ke(r, n, a) {
1648
1658
  if (r.length) {
1649
1659
  a.textBaseline = "middle";
1650
- var t = n.font(), s = t.height, h = t.size, p = n.valign(), m = n.height()(), w = n.width()(0), b = n.align(), A = b === "justify", R = 0.5 * s, k = Ge[p];
1651
- if (k && isFinite(m)) {
1652
- var O = r.length * s;
1653
- R += m * k - O * k;
1660
+ var o = n.font(), t = o.height, u = o.size, d = n.valign(), p = n.height()(), b = n.width()(0), w = n.align(), A = w === "justify", E = 0.5 * t, O = Je[d];
1661
+ if (O && isFinite(p)) {
1662
+ var P = r.length * t;
1663
+ E += p * O - P * O;
1654
1664
  }
1655
- r.forEach(function(j, U) {
1656
- var M = n.x()(U), I = U * s + R, W = 0, z = 0;
1657
- j.forEach(function(V) {
1658
- V.whitespace && W++, z += V.width;
1665
+ r.forEach(function(I, B) {
1666
+ var M = n.x()(B), F = B * t + E, $ = 0, N = 0;
1667
+ I.forEach(function(V) {
1668
+ V.whitespace && $++, N += V.width;
1659
1669
  });
1660
- var et = 0, J = U === r.length - 1 || j[j.length - 1] instanceof G;
1661
- A && j.length > 1 && !J && (et = (w - z) / W), j.forEach(function(V) {
1670
+ var K = 0, G = B === r.length - 1 || I[I.length - 1] instanceof X;
1671
+ A && I.length > 1 && !G && (K = (b - N) / $), I.forEach(function(V) {
1662
1672
  a.font = V.font;
1663
- var F = V.font, nt = F.baseline ? h * -F.baseline + 0.15 * h : 0;
1664
- a.fillStyle = function(bt, ct) {
1665
- return bt.color ? bt.color : ct.href ? "#00C" : "#000";
1666
- }(F, V);
1673
+ var j = V.font, nt = j.baseline ? u * -j.baseline + 0.15 * u : 0;
1674
+ a.fillStyle = function(wt, ct) {
1675
+ return wt.color ? wt.color : ct.href ? "#00C" : "#000";
1676
+ }(j, V);
1667
1677
  var rt = 0;
1668
- if (b === "right" ? rt += w - z : b === "center" ? rt += w / 2 - z / 2 : b === "justify" && (V.whitespace || V instanceof G) && (M += et), a.fillText(V.value, M + rt, I + nt), V.href) {
1678
+ if (w === "right" ? rt += b - N : w === "center" ? rt += b / 2 - N / 2 : w === "justify" && (V.whitespace || V instanceof X) && (M += K), a.fillText(V.value, M + rt, F + nt), V.href) {
1669
1679
  a.beginPath(), a.strokeStyle = a.fillStyle;
1670
- var ft = Math.floor(I + 0.45 * h) + 0.5;
1680
+ var ft = Math.floor(F + 0.45 * u) + 0.5;
1671
1681
  a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
1672
1682
  }
1673
1683
  M += V.width;
@@ -1675,17 +1685,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1675
1685
  });
1676
1686
  }
1677
1687
  }
1678
- function ie(r) {
1679
- return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1688
+ function ne(r) {
1689
+ return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1680
1690
  return typeof n;
1681
1691
  } : function(n) {
1682
1692
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1683
- }, ie(r);
1693
+ }, ne(r);
1684
1694
  }
1685
1695
  function ke(r) {
1686
1696
  for (var n = {}, a = 0; a < r.length; a++) {
1687
- var t = r[a];
1688
- 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));
1697
+ var o = r[a];
1698
+ typeof o != "number" && o != null && (typeof o == "string" ? n.text = o : typeof o == "function" ? n.fn = o : ne(o) === "object" && o._groups ? n.d3 = o : o && o.nodeType && o.getContext ? n.ctx = o.getContext("2d") : o && o.fillText && o.beginPath ? n.ctx = o : o && (n.text = o));
1689
1699
  }
1690
1700
  return n;
1691
1701
  }
@@ -1696,32 +1706,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1696
1706
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1697
1707
  }, kt(r);
1698
1708
  }
1699
- function oe(r, n) {
1709
+ function ie(r, n) {
1700
1710
  for (var a = 0; a < n.length; a++) {
1701
- var t = n[a];
1702
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1703
- if (kt(h) !== "object" || h === null)
1704
- return h;
1705
- var m = h[Symbol.toPrimitive];
1706
- if (m !== void 0) {
1707
- var w = m.call(h, p);
1708
- if (kt(w) !== "object")
1709
- return w;
1711
+ var o = n[a];
1712
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1713
+ if (kt(u) !== "object" || u === null)
1714
+ return u;
1715
+ var p = u[Symbol.toPrimitive];
1716
+ if (p !== void 0) {
1717
+ var b = p.call(u, d);
1718
+ if (kt(b) !== "object")
1719
+ return b;
1710
1720
  throw new TypeError("@@toPrimitive must return a primitive value.");
1711
1721
  }
1712
- return String(h);
1713
- }(t.key, "string"), kt(s) === "symbol" ? s : String(s)), t);
1722
+ return String(u);
1723
+ }(o.key, "string"), kt(t) === "symbol" ? t : String(t)), o);
1714
1724
  }
1715
- var s;
1725
+ var t;
1716
1726
  }
1717
- var Te = P(), ht = function(r) {
1727
+ var Te = R(), ht = function(r) {
1718
1728
  return typeof r == "function" ? r : function() {
1719
1729
  return r;
1720
1730
  };
1721
- }, X = function() {
1722
- function r(t) {
1723
- if (function(h, p) {
1724
- if (!(h instanceof p))
1731
+ }, J = function() {
1732
+ function r(o) {
1733
+ if (function(u, d) {
1734
+ if (!(u instanceof d))
1725
1735
  throw new TypeError("Cannot call a class as a function");
1726
1736
  }(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1727
1737
  return 1 / 0;
@@ -1729,124 +1739,124 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1729
1739
  return 1 / 0;
1730
1740
  }, x: function() {
1731
1741
  return 0;
1732
- }, font: null, tAnchor: 0, parser: r.defaultparser }, t)
1733
- for (var s in t)
1734
- typeof this[s] == "function" && this[s](t[s]);
1742
+ }, font: null, tAnchor: 0, parser: r.defaultparser }, o)
1743
+ for (var t in o)
1744
+ typeof this[t] == "function" && this[t](o[t]);
1735
1745
  }
1736
1746
  var n, a;
1737
- return n = r, a = [{ key: "linebreak", value: function(t) {
1738
- var s = this, h = this.props.parser(String(t)), p = this.font(), m = function(w, b, A) {
1739
- if (!w.length)
1747
+ return n = r, a = [{ key: "linebreak", value: function(o) {
1748
+ var t = this, u = this.props.parser(String(o)), d = this.font(), p = function(b, w, A) {
1749
+ if (!b.length)
1740
1750
  return [];
1741
- var R = b.height(), k = b.width(), O = b.overflowLine(), j = b.overflowWrap(), U = P(A, !0, !1), M = isFinite(R()) ? Math.floor(R() / A.height) : 1 / 0;
1742
- if (!R() && !k(0) || !M)
1751
+ var E = w.height(), O = w.width(), P = w.overflowLine(), I = w.overflowWrap(), B = R(A, !0, !1), M = isFinite(E()) ? Math.floor(E() / A.height) : 1 / 0;
1752
+ if (!E() && !O(0) || !M)
1743
1753
  return [];
1744
- for (var I = 0, W = 0, z = 0, et = [], J = [], V = !1; I < w.length && W < M; ) {
1745
- var F = w[I], nt = Ae(F, A);
1746
- if (F.width = N(F, nt), F.font = nt, F.line = W, F.whitespace = F.value in S, F.value && (F.value = F.value.replace(qe, " ")), !(!z && F.whitespace || V && F.whitespace))
1747
- if (F instanceof G)
1748
- z = 0, J = [], et.push(I + 1), W++;
1749
- else if (F instanceof lt || F instanceof ut)
1750
- J.push({ index: I, width: z });
1751
- else if (F.whitespace || z + F.width < k(W))
1752
- z += F.width;
1753
- else if (J.length) {
1754
+ for (var F = 0, $ = 0, N = 0, K = [], G = [], V = !1; F < b.length && $ < M; ) {
1755
+ var j = b[F], nt = Ae(j, A);
1756
+ if (j.width = H(j, nt), j.font = nt, j.line = $, j.whitespace = j.value in S, j.value && (j.value = j.value.replace(Ge, " ")), !(!N && j.whitespace || V && j.whitespace))
1757
+ if (j instanceof X)
1758
+ N = 0, G = [], K.push(F + 1), $++;
1759
+ else if (j instanceof lt || j instanceof ut)
1760
+ G.push({ index: F, width: N });
1761
+ else if (j.whitespace || N + j.width < O($))
1762
+ N += j.width;
1763
+ else if (G.length) {
1754
1764
  var rt = void 0, ft = void 0;
1755
1765
  do {
1756
- ft = !0, rt = J.pop();
1757
- var bt = w[rt.index], ct = void 0;
1758
- bt instanceof ut && (ct = N("-", bt.font), rt.width + ct > k(W) && (ft = !J.length));
1766
+ ft = !0, rt = G.pop();
1767
+ var wt = b[rt.index], ct = void 0;
1768
+ wt instanceof ut && (ct = H("-", wt.font), rt.width + ct > O($) && (ft = !G.length));
1759
1769
  } while (!ft);
1760
- et.push(rt.index + 1), z = 0, W++, I = rt.index, J = [];
1761
- } else if (j === "break-word") {
1762
- var gt = k(W);
1763
- if (z + F.width > gt) {
1764
- var Mt = F.clone();
1770
+ K.push(rt.index + 1), N = 0, $++, F = rt.index, G = [];
1771
+ } else if (I === "break-word") {
1772
+ var gt = O($);
1773
+ if (N + j.width > gt) {
1774
+ var Mt = j.clone();
1765
1775
  do
1766
- F.value = F.value.slice(0, -1), F.width = N(F, F.font), z += F.width;
1767
- while (F.value && F.width > gt);
1768
- Mt.value = Mt.value.slice(F.value.length), w.splice(I + 1, 0, new lt(), Mt);
1776
+ j.value = j.value.slice(0, -1), j.width = H(j, j.font), N += j.width;
1777
+ while (j.value && j.width > gt);
1778
+ Mt.value = Mt.value.slice(j.value.length), b.splice(F + 1, 0, new lt(), Mt);
1769
1779
  }
1770
- et.push(I + 1), z = 0, W++;
1780
+ K.push(F + 1), N = 0, $++;
1771
1781
  } else
1772
- z += F.width;
1773
- I++, V = F.whitespace;
1782
+ N += j.width;
1783
+ F++, V = j.whitespace;
1774
1784
  }
1775
- I !== et[et.length - 1] && et.push(I);
1776
- var le = 0, pt = 0, Z = et.map(function(Tt) {
1777
- for (var Q, St = le; (Q = w[St]) && (Q.whitespace || !Q.value); )
1785
+ F !== K[K.length - 1] && K.push(F);
1786
+ var ae = 0, pt = 0, Z = K.map(function(Tt) {
1787
+ for (var et, St = ae; (et = b[St]) && (et.whitespace || !et.value); )
1778
1788
  St++;
1779
- for (var wt = Tt, Qe = null; wt > St && (Q = w[wt - 1]) && (Q.whitespace || !(Q.value || Q instanceof ut)); )
1780
- Q instanceof G && (Qe = Q), wt--;
1781
- Q instanceof ut && (Q.value = "-", Q.width = N("-", Q.font)), le = Tt;
1782
- var zt = w.slice(St, wt).filter(function(tr) {
1783
- return tr.value;
1789
+ for (var xt = Tt, tr = null; xt > St && (et = b[xt - 1]) && (et.whitespace || !(et.value || et instanceof ut)); )
1790
+ et instanceof X && (tr = et), xt--;
1791
+ et instanceof ut && (et.value = "-", et.width = H("-", et.font)), ae = Tt;
1792
+ var zt = b.slice(St, xt).filter(function(er) {
1793
+ return er.value;
1784
1794
  });
1785
- return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
1786
- return tr + Vr.width;
1795
+ return tr && zt.push(tr), zt.width = zt.reduce(function(er, Vr) {
1796
+ return er + Vr.width;
1787
1797
  }, 0), zt.width > pt && (pt = zt.width), zt;
1788
1798
  });
1789
- if (Z.hasLineOverflow = !1, O) {
1790
- var Pe = O === "ellipsis" ? "…" : O;
1791
- Z.forEach(function(Tt, Q) {
1792
- var St = k(Q);
1799
+ if (Z.hasLineOverflow = !1, P) {
1800
+ var Re = P === "ellipsis" ? "…" : P;
1801
+ Z.forEach(function(Tt, et) {
1802
+ var St = O(et);
1793
1803
  if (Tt.width > St) {
1794
- var wt = new D(Pe);
1795
- wt.font = A, wt.width = N(Pe, U), ee(Tt, St, wt), Z.hasLineOverflow = !0;
1804
+ var xt = new z(Re);
1805
+ xt.font = A, xt.width = H(Re, B), te(Tt, St, xt), Z.hasLineOverflow = !0;
1796
1806
  }
1797
1807
  });
1798
1808
  }
1799
- var q = b.overflow() === "ellipsis" ? "…" : b.overflow();
1800
- if (q && I !== w.length) {
1801
- var K = k(Z.length - 1), Re = Z[Z.length - 1], ue = new D(q);
1802
- ue.font = A, ue.width = N(q, U), ee(Re, K, ue), Z.hasOverflow = !0;
1809
+ var q = w.overflow() === "ellipsis" ? "…" : w.overflow();
1810
+ if (q && F !== b.length) {
1811
+ var Q = O(Z.length - 1), Ie = Z[Z.length - 1], le = new z(q);
1812
+ le.font = A, le.width = H(q, B), te(Ie, Q, le), Z.hasOverflow = !0;
1803
1813
  } else
1804
1814
  Z.hasOverflow = !1;
1805
1815
  return Z.font = A, Z.width = pt, Z;
1806
- }(h, this, p);
1807
- return m.height = m.length * p.height, m.render = function(w) {
1808
- return s.render(m, w);
1809
- }, m.svg = m.render, m.draw = m.render, m;
1810
- } }, { key: "font", value: function(t) {
1811
- return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Te);
1812
- } }, { key: "overflow", value: function(t) {
1813
- return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
1814
- } }, { key: "overflowLine", value: function(t) {
1815
- return arguments.length ? (this.props.lineclamp = String(t), this) : this.props.lineclamp;
1816
- } }, { key: "valign", value: function(t) {
1817
- return arguments.length ? (this.props.valign = t, this) : this.props.valign;
1818
- } }, { key: "align", value: function(t) {
1816
+ }(u, this, d);
1817
+ return p.height = p.length * d.height, p.render = function(b) {
1818
+ return t.render(p, b);
1819
+ }, p.svg = p.render, p.draw = p.render, p;
1820
+ } }, { key: "font", value: function(o) {
1821
+ return arguments.length ? (this.props.font = R(o), this) : this.props.font || R(Te);
1822
+ } }, { key: "overflow", value: function(o) {
1823
+ return arguments.length ? (this.props.overflow = String(o), this) : this.props.overflow;
1824
+ } }, { key: "overflowLine", value: function(o) {
1825
+ return arguments.length ? (this.props.lineclamp = String(o), this) : this.props.lineclamp;
1826
+ } }, { key: "valign", value: function(o) {
1827
+ return arguments.length ? (this.props.valign = o, this) : this.props.valign;
1828
+ } }, { key: "align", value: function(o) {
1819
1829
  if (!arguments.length)
1820
1830
  return this.props.align;
1821
- var s = String(t).toLowerCase();
1822
- return s === "left" || s === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : s === "center" || s === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : s === "end" || s === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : s === "justify" && (this.props.align = t, this.props.tAnchor = 0), this;
1823
- } }, { key: "overflowWrap", value: function(t) {
1831
+ var t = String(o).toLowerCase();
1832
+ return t === "left" || t === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : t === "center" || t === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : t === "end" || t === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : t === "justify" && (this.props.align = o, this.props.tAnchor = 0), this;
1833
+ } }, { key: "overflowWrap", value: function(o) {
1824
1834
  if (!arguments.length)
1825
1835
  return this.props.overflowWrap || "normal";
1826
- var s = String(t).toLowerCase();
1827
- return s === "break-word" ? this.props.overflowWrap = "break-word" : s !== "normal" && t != null || (this.props.overflowWrap = null), this;
1828
- } }, { key: "width", value: function(t) {
1829
- return arguments.length ? (this.props.width = ht(t), this) : this.props.width;
1830
- } }, { key: "height", value: function(t) {
1831
- return arguments.length ? (this.props.height = ht(t), this) : this.props.height;
1832
- } }, { key: "x", value: function(t) {
1833
- return arguments.length ? (this.props.x = ht(t), this) : this.props.x;
1834
- } }, { key: "parser", value: function(t) {
1836
+ var t = String(o).toLowerCase();
1837
+ return t === "break-word" ? this.props.overflowWrap = "break-word" : t !== "normal" && o != null || (this.props.overflowWrap = null), this;
1838
+ } }, { key: "width", value: function(o) {
1839
+ return arguments.length ? (this.props.width = ht(o), this) : this.props.width;
1840
+ } }, { key: "height", value: function(o) {
1841
+ return arguments.length ? (this.props.height = ht(o), this) : this.props.height;
1842
+ } }, { key: "x", value: function(o) {
1843
+ return arguments.length ? (this.props.x = ht(o), this) : this.props.x;
1844
+ } }, { key: "parser", value: function(o) {
1835
1845
  if (!arguments.length)
1836
1846
  return this.props.parser;
1837
- if (typeof t == "string") {
1838
- var s = r[t] || r[t + "parser"];
1839
- typeof s == "function" && (t = s);
1847
+ if (typeof o == "string") {
1848
+ var t = r[o] || r[o + "parser"];
1849
+ typeof t == "function" && (o = t);
1840
1850
  }
1841
- if (typeof t != "function")
1842
- throw new Error("Unknown parser: " + t);
1843
- return this.props.parser = t, this;
1844
- } }, { key: "createElement", value: function(t) {
1845
- return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1851
+ if (typeof o != "function")
1852
+ throw new Error("Unknown parser: " + o);
1853
+ return this.props.parser = o, this;
1854
+ } }, { key: "createElement", value: function(o) {
1855
+ return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1846
1856
  } }, { key: "render", value: function() {
1847
- var t = ke(arguments);
1848
- return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Xe(t.text, this, t.ctx) : Ye(t.text, this);
1849
- } }], a && oe(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1857
+ var o = ke(arguments);
1858
+ return typeof o.text == "string" && (o.text = this.linebreak(o.text)), o.ctx ? Ke(o.text, this, o.ctx) : Xe(o.text, this);
1859
+ } }], a && ie(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1850
1860
  }();
1851
1861
  function dt(r) {
1852
1862
  return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1855,102 +1865,102 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1855
1865
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1856
1866
  }, dt(r);
1857
1867
  }
1858
- function jt(r, n) {
1868
+ function $t(r, n) {
1859
1869
  (n == null || n > r.length) && (n = r.length);
1860
- for (var a = 0, t = new Array(n); a < n; a++)
1861
- t[a] = r[a];
1862
- return t;
1870
+ for (var a = 0, o = new Array(n); a < n; a++)
1871
+ o[a] = r[a];
1872
+ return o;
1863
1873
  }
1864
- function Je(r, n) {
1874
+ function Ze(r, n) {
1865
1875
  for (var a = 0; a < n.length; a++) {
1866
- var t = n[a];
1867
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1868
- if (dt(h) !== "object" || h === null)
1869
- return h;
1870
- var m = h[Symbol.toPrimitive];
1871
- if (m !== void 0) {
1872
- var w = m.call(h, p);
1873
- if (dt(w) !== "object")
1874
- return w;
1876
+ var o = n[a];
1877
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1878
+ if (dt(u) !== "object" || u === null)
1879
+ return u;
1880
+ var p = u[Symbol.toPrimitive];
1881
+ if (p !== void 0) {
1882
+ var b = p.call(u, d);
1883
+ if (dt(b) !== "object")
1884
+ return b;
1875
1885
  throw new TypeError("@@toPrimitive must return a primitive value.");
1876
1886
  }
1877
- return String(h);
1878
- }(t.key, "string"), dt(s) === "symbol" ? s : String(s)), t);
1887
+ return String(u);
1888
+ }(o.key, "string"), dt(t) === "symbol" ? t : String(t)), o);
1879
1889
  }
1880
- var s;
1890
+ var t;
1881
1891
  }
1882
- var se = function(r) {
1892
+ var oe = function(r) {
1883
1893
  return typeof r == "function" ? r : function() {
1884
1894
  return r;
1885
1895
  };
1886
1896
  }, Se = function() {
1887
- function r(t) {
1888
- if (function(h, p) {
1889
- if (!(h instanceof p))
1897
+ function r(o) {
1898
+ if (function(u, d) {
1899
+ if (!(u instanceof d))
1890
1900
  throw new TypeError("Cannot call a class as a function");
1891
1901
  }(this, r), this.props = { width: function() {
1892
1902
  return 1 / 0;
1893
1903
  }, height: function() {
1894
1904
  return 1 / 0;
1895
- }, rotation: 0, vAnchor: 0, hAnchor: 0 }, t)
1896
- for (var s in t)
1897
- typeof this[s] == "function" && this[s](t[s]);
1905
+ }, rotation: 0, vAnchor: 0, hAnchor: 0 }, o)
1906
+ for (var t in o)
1907
+ typeof this[t] == "function" && this[t](o[t]);
1898
1908
  this.render = this.render.bind(this);
1899
1909
  }
1900
1910
  var n, a;
1901
- return n = r, a = [{ key: "anchor", value: function(t) {
1902
- var s = this.props, h = s.hAnchor, p = s.vAnchor, m = s.width, w = s.height;
1911
+ return n = r, a = [{ key: "anchor", value: function(o) {
1912
+ var t = this.props, u = t.hAnchor, d = t.vAnchor, p = t.width, b = t.height;
1903
1913
  if (!arguments.length)
1904
- return [h * m(0), p * w(0)];
1905
- if (typeof t == "string") {
1906
- var b = this.props;
1907
- t.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1908
- 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);
1914
+ return [u * p(0), d * b(0)];
1915
+ if (typeof o == "string") {
1916
+ var w = this.props;
1917
+ o.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1918
+ A === "top" && (w.vAnchor = -0), A === "middle" && (w.vAnchor = -0.5), A === "bottom" && (w.vAnchor = -1), A === "left" && (w.hAnchor = -0), A === "center" && (w.hAnchor = -0.5), A === "right" && (w.hAnchor = -1);
1909
1919
  });
1910
1920
  }
1911
1921
  return this;
1912
- } }, { key: "width", value: function(t) {
1913
- return arguments.length ? (this.props.width = se(t), this) : this.props.width;
1914
- } }, { key: "height", value: function(t) {
1915
- return arguments.length ? (this.props.height = se(t), this) : this.props.height;
1916
- } }, { key: "rotate", value: function(t) {
1917
- return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
1918
- } }, { key: "createElement", value: function(t) {
1919
- return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1920
- } }, { key: "canvas", value: function(t, s) {
1921
- var h, p = t.getContext ? t.getContext("2d") : t;
1922
- return p.save(), p.rotate(this.rotate() * Math.PI / 180), p.translate.apply(p, function(m) {
1923
- if (Array.isArray(m))
1924
- return jt(m);
1925
- }(h = this.anchor()) || function(m) {
1926
- if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null)
1927
- return Array.from(m);
1928
- }(h) || function(m, w) {
1929
- if (m) {
1930
- if (typeof m == "string")
1931
- return jt(m, w);
1932
- var b = Object.prototype.toString.call(m).slice(8, -1);
1933
- 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;
1922
+ } }, { key: "width", value: function(o) {
1923
+ return arguments.length ? (this.props.width = oe(o), this) : this.props.width;
1924
+ } }, { key: "height", value: function(o) {
1925
+ return arguments.length ? (this.props.height = oe(o), this) : this.props.height;
1926
+ } }, { key: "rotate", value: function(o) {
1927
+ return arguments.length ? (this.props.rotation = o, this) : this.props.rotation;
1928
+ } }, { key: "createElement", value: function(o) {
1929
+ return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1930
+ } }, { key: "canvas", value: function(o, t) {
1931
+ var u, d = o.getContext ? o.getContext("2d") : o;
1932
+ return d.save(), d.rotate(this.rotate() * Math.PI / 180), d.translate.apply(d, function(p) {
1933
+ if (Array.isArray(p))
1934
+ return $t(p);
1935
+ }(u = this.anchor()) || function(p) {
1936
+ if (typeof Symbol < "u" && p[Symbol.iterator] != null || p["@@iterator"] != null)
1937
+ return Array.from(p);
1938
+ }(u) || function(p, b) {
1939
+ if (p) {
1940
+ if (typeof p == "string")
1941
+ return $t(p, b);
1942
+ var w = Object.prototype.toString.call(p).slice(8, -1);
1943
+ return w === "Object" && p.constructor && (w = p.constructor.name), w === "Map" || w === "Set" ? Array.from(p) : w === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w) ? $t(p, b) : void 0;
1934
1944
  }
1935
- }(h) || function() {
1945
+ }(u) || function() {
1936
1946
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1937
1947
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1938
- }()), s(p), p.restore(), p;
1948
+ }()), t(d), d.restore(), d;
1939
1949
  } }, { key: "render", value: function() {
1940
- var t = ke(arguments);
1941
- if (t.d3)
1942
- return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1943
- if (t.ctx)
1944
- return this.canvas(t.ctx, t.fn);
1945
- if (t.text) {
1946
- var s = typeof t.text.render == "function" ? t.text.render() : t.text;
1947
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, s);
1950
+ var o = ke(arguments);
1951
+ if (o.d3)
1952
+ return o.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1953
+ if (o.ctx)
1954
+ return this.canvas(o.ctx, o.fn);
1955
+ if (o.text) {
1956
+ var t = typeof o.text.render == "function" ? o.text.render() : o.text;
1957
+ return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, t);
1948
1958
  }
1949
- } }], a && Je(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1959
+ } }], a && Ze(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1950
1960
  }(), Ce = Object.prototype.hasOwnProperty, Dt = {};
1951
- function Ze(r) {
1952
- return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, t) {
1953
- return a + "-" + t.toLowerCase();
1961
+ function Qe(r) {
1962
+ return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, o) {
1963
+ return a + "-" + o.toLowerCase();
1954
1964
  })), Dt[r];
1955
1965
  }
1956
1966
  function Oe(r, n) {
@@ -1960,144 +1970,144 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1960
1970
  });
1961
1971
  typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
1962
1972
  }
1963
- function ae(r, n) {
1973
+ function se(r, n) {
1964
1974
  if (typeof document < "u") {
1965
1975
  var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
1966
1976
  if (n && a.setAttribute)
1967
- for (var t in n)
1968
- Ce.call(n, t) && n[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), n[t]);
1969
- for (var s = arguments.length, h = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
1970
- h[p - 2] = arguments[p];
1971
- return h != null && h.length && h.forEach(function(m) {
1972
- Oe(a, m);
1977
+ for (var o in n)
1978
+ Ce.call(n, o) && n[o] != null && a.setAttribute(o === "className" ? "class" : Qe(o), n[o]);
1979
+ for (var t = arguments.length, u = new Array(t > 2 ? t - 2 : 0), d = 2; d < t; d++)
1980
+ u[d - 2] = arguments[d];
1981
+ return u != null && u.length && u.forEach(function(p) {
1982
+ Oe(a, p);
1973
1983
  }), a;
1974
1984
  }
1975
1985
  }
1976
- X.createElement = ae, X.textparser = At, X.defaultparser = At, X.htmlparser = function(r) {
1986
+ J.createElement = se, J.textparser = Et, J.defaultparser = Et, J.htmlparser = function(r) {
1977
1987
  r = String(r || "").trim();
1978
- for (var n, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, s = [], h = [], p = function(R) {
1979
- for (var k in t)
1980
- t[k] && (R[k] = t[k]);
1981
- s.push(R);
1982
- }, m = function(R) {
1983
- var k = s.length, O = Be[R];
1984
- if (k && O) {
1985
- for (var j = k - 1; s[j] && (s[j] instanceof lt || Ne.test(s[j].value)); )
1986
- j--;
1987
- for (; O && s[j] && s[j] instanceof G; )
1988
- j--, O--;
1989
- for (; O-- > 0; )
1990
- s.push(new G());
1988
+ for (var n, a, o = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, t = [], u = [], d = function(E) {
1989
+ for (var O in o)
1990
+ o[O] && (E[O] = o[O]);
1991
+ t.push(E);
1992
+ }, p = function(E) {
1993
+ var O = t.length, P = Ue[E];
1994
+ if (O && P) {
1995
+ for (var I = O - 1; t[I] && (t[I] instanceof lt || He.test(t[I].value)); )
1996
+ I--;
1997
+ for (; P && t[I] && t[I] instanceof X; )
1998
+ I--, P--;
1999
+ for (; P-- > 0; )
2000
+ t.push(new X());
1991
2001
  }
1992
2002
  }; r.length; ) {
1993
2003
  if (n = /^[^<]+/.exec(r))
1994
- At(Qt(n[0]), !1).forEach(p);
2004
+ Et(Zt(n[0]), !1).forEach(d);
1995
2005
  else if (!(n = It.exec(r)))
1996
- if (n = Jt.exec(r))
1997
- h.length && (t = h.pop()), m(n[1]);
1998
- else if (n = Zt.exec(r)) {
1999
- var w = n[1];
2000
- m(w), h.push(t), t = Object.create(t), Et[w] && Et[w](t, "");
2001
- var b = Lt(n[2]);
2002
- 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" && s.push(new G());
2006
+ if (n = Xt.exec(r))
2007
+ u.length && (o = u.pop()), p(n[1]);
2008
+ else if (n = Jt.exec(r)) {
2009
+ var b = n[1];
2010
+ p(b), u.push(o), o = Object.create(o), _t[b] && _t[b](o, "");
2011
+ var w = Lt(n[2]);
2012
+ b === "a" && (w.href && (o.href = w.href), w.rel && (o.rel = w.rel), w.target && (o.target = w.target)), w.class && (o.class = o.class ? o.class + " " + w.class : w.class), w.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(w.style)) && a[1] && (o.color = a[1]), b === "br" && t.push(new X());
2003
2013
  } else
2004
- n = [r.slice(0, 1)], p(new D(n[0]));
2014
+ n = [r.slice(0, 1)], d(new z(n[0]));
2005
2015
  r = r.slice(n[0].length);
2006
2016
  }
2007
- for (var A = s[s.length - 1]; A instanceof G; )
2008
- s.pop(), A = s[s.length - 1];
2009
- return s;
2010
- }, X.latexparser = function(r) {
2017
+ for (var A = t[t.length - 1]; A instanceof X; )
2018
+ t.pop(), A = t[t.length - 1];
2019
+ return t;
2020
+ }, J.latexparser = function(r) {
2011
2021
  r = String(r || "").trim();
2012
2022
  var n = [0];
2013
- r = r.replace(/\\verb,(.*?),/, function(M, I) {
2014
- return n.push(I), "\\verb," + (n.length - 1) + ",";
2023
+ r = r.replace(/\\verb,(.*?),/, function(M, F) {
2024
+ return n.push(F), "\\verb," + (n.length - 1) + ",";
2015
2025
  }).replace(/\\\\\n/g, function() {
2016
2026
  return "\\\\";
2017
- }).replace(Ve, function(M, I, W) {
2018
- return W.charAt(I - 1) === "\\" ? M : te[M];
2027
+ }).replace(Ye, function(M, F, $) {
2028
+ return $.charAt(F - 1) === "\\" ? M : Qt[M];
2019
2029
  }).replace(/\n\s+/g, function(M) {
2020
2030
  return /\n/.test(M.slice(1)) ? "\\par " : M;
2021
- }).replace(/\\symbol\{(\d+)\}/, function(M, I, W, z) {
2022
- return z.charAt(W - 1) === "\\" ? M : String.fromCharCode(1 * I);
2023
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, I, W, z) {
2024
- return I + W + "{" + z + "}";
2025
- }).replace(/\\verb,(.*?),/, function(M, I) {
2026
- return "\\verb,".concat(n[+I], ",");
2031
+ }).replace(/\\symbol\{(\d+)\}/, function(M, F, $, N) {
2032
+ return N.charAt($ - 1) === "\\" ? M : String.fromCharCode(1 * F);
2033
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, F, $, N) {
2034
+ return F + $ + "{" + N + "}";
2035
+ }).replace(/\\verb,(.*?),/, function(M, F) {
2036
+ return "\\verb,".concat(n[+F], ",");
2027
2037
  });
2028
- for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, s = [], h = [], p = function(M) {
2029
- for (var I in t)
2030
- t[I] && (M[I] = t[I]);
2031
- return s.push(M), M;
2032
- }, m = function() {
2033
- h.push(t), t = Object.create(t);
2034
- }, w = function() {
2035
- if (!h.length)
2038
+ for (var a, o = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, t = [], u = [], d = function(M) {
2039
+ for (var F in o)
2040
+ o[F] && (M[F] = o[F]);
2041
+ return t.push(M), M;
2042
+ }, p = function() {
2043
+ u.push(o), o = Object.create(o);
2044
+ }, b = function() {
2045
+ if (!u.length)
2036
2046
  throw new Error("Unexpected }");
2037
- t = h.pop();
2038
- }, b = { tokens: s, open_context: m, close_context: w, add_token: p }; r.length; ) {
2047
+ o = u.pop();
2048
+ }, w = { tokens: t, open_context: p, close_context: b, add_token: d }; r.length; ) {
2039
2049
  if (a = Ft.exec(r))
2040
- At(a[0], !1).forEach(p);
2041
- else if (a = We.exec(r))
2042
- p(new D(a[1]));
2050
+ Et(a[0], !1).forEach(d);
2051
+ else if (a = qe.exec(r))
2052
+ d(new z(a[1]));
2043
2053
  else if (!(a = xe.exec(r))) {
2044
2054
  if (a = /^\{/.exec(r))
2045
- m();
2055
+ p();
2046
2056
  else if (a = /^\}/.exec(r))
2047
- w();
2057
+ b();
2048
2058
  else if (!(a = /^\$/.exec(r)))
2049
2059
  if (a = /^\\verb,([^,]+),/.exec(r))
2050
- p(new D(a[1]));
2060
+ d(new z(a[1]));
2051
2061
  else if (a = we.exec(r)) {
2052
- var A = a[1].slice(1) || a[1], R = !!a[2];
2062
+ var A = a[1].slice(1) || a[1], E = !!a[2];
2053
2063
  if (/^(La)?TeX$/i.test(A)) {
2054
- m(), t.family = "serif";
2055
- var k = void 0;
2056
- A === "LaTeX" && ((k = p(new D("L"))).tracking = -0.25, (k = p(new D("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = p(new D("T"))).tracking = -0.17, (k = p(new D("E"))).baseline = -0.22, k.tracking = -0.13, k = p(new D("X")), w();
2057
- } else if (A in _t)
2058
- p(new D(_t[A])), R && m();
2059
- else if (A in H) {
2060
- var O = [], j = H[A].length - 1, U = void 0;
2061
- if (j) {
2062
- for (R = !1, r = r.slice(a[0].length - 1); j--; ) {
2063
- if (!(U = /^\{([^}]+)\}/.exec(r)))
2064
+ p(), o.family = "serif";
2065
+ var O = void 0;
2066
+ A === "LaTeX" && ((O = d(new z("L"))).tracking = -0.25, (O = d(new z("A"))).size = 0.7, O.baseline = 0.3, O.tracking = -0.1), (O = d(new z("T"))).tracking = -0.17, (O = d(new z("E"))).baseline = -0.22, O.tracking = -0.13, O = d(new z("X")), b();
2067
+ } else if (A in bt)
2068
+ d(new z(bt[A])), E && p();
2069
+ else if (A in W) {
2070
+ var P = [], I = W[A].length - 1, B = void 0;
2071
+ if (I) {
2072
+ for (E = !1, r = r.slice(a[0].length - 1); I--; ) {
2073
+ if (!(B = /^\{([^}]+)\}/.exec(r)))
2064
2074
  throw new Error(A + " is missing an argument");
2065
- O.push(U[1]), r = r.slice(U[0].length);
2075
+ P.push(B[1]), r = r.slice(B[0].length);
2066
2076
  }
2067
- a[0] = /^\{/.exec(r) ? "{" : "", R = !!a[0];
2077
+ a[0] = /^\{/.exec(r) ? "{" : "", E = !!a[0];
2068
2078
  }
2069
- R && m(), H[A].apply(b, [t].concat(O));
2079
+ E && p(), W[A].apply(w, [o].concat(P));
2070
2080
  } else
2071
- console.warn("unknown latex command", A), p(new D(a[1])), R && m();
2081
+ console.warn("unknown latex command", A), d(new z(a[1])), E && p();
2072
2082
  } else
2073
- a = [r.slice(0, 1)], p(new D(a[0]));
2083
+ a = [r.slice(0, 1)], d(new z(a[0]));
2074
2084
  }
2075
2085
  r = r.slice(a[0].length);
2076
2086
  }
2077
- return s;
2078
- }, X.measureText = function(r, n, a) {
2079
- return N(r, P(n), a);
2080
- }, X.Token = D, X.Break = lt, X.LineBreak = G, X.SoftHyphen = ut, X.Rotator = Se, Se.createElement = ae;
2081
- const Ke = X;
2087
+ return t;
2088
+ }, J.measureText = function(r, n, a) {
2089
+ return H(r, R(n), a);
2090
+ }, J.Token = z, J.Break = lt, J.LineBreak = X, J.SoftHyphen = ut, J.Rotator = Se, Se.createElement = se;
2091
+ const Pe = J;
2082
2092
  return i.default;
2083
2093
  })());
2084
2094
  })(Hr);
2085
2095
  var vn = Hr.exports;
2086
2096
  const xr = /* @__PURE__ */ Mr(vn);
2087
- function nr(u) {
2088
- return u.replace(/…$/, "");
2097
+ function ir(h) {
2098
+ return h.replace(/…$/, "");
2089
2099
  }
2090
- function ir(u) {
2091
- return u.children[0].innerHTML;
2100
+ function or(h) {
2101
+ return h.children[0].innerHTML;
2092
2102
  }
2093
- function mn(u, e) {
2094
- const o = mt(u), { fontSize: i, font: l, padding: c = 0 } = u.properties.style || {};
2095
- if (o.width === o.height && o.width === 0)
2103
+ function mn(h, e) {
2104
+ const s = mt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
2105
+ if (s.width === s.height && s.width === 0)
2096
2106
  return;
2097
- const f = new xr({
2107
+ const g = new xr({
2098
2108
  font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
2099
- width: o.width - c * 2,
2100
- height: o.height - c * 2,
2109
+ width: s.width - c * 2,
2110
+ height: s.height - c * 2,
2101
2111
  align: "left",
2102
2112
  valign: "top",
2103
2113
  x: 0,
@@ -2105,49 +2115,49 @@ function mn(u, e) {
2105
2115
  parser: "html",
2106
2116
  createElement: xr.createElement
2107
2117
  });
2108
- f.overflowWrap("break-word");
2109
- const g = f.linebreak(
2110
- u.properties.content.replaceAll(`
2118
+ g.overflowWrap("break-word");
2119
+ const y = g.linebreak(
2120
+ h.properties.content.replaceAll(`
2111
2121
  `, "<br>")
2112
- ).render(), d = [...g.children];
2113
- let v = 0;
2114
- const y = [];
2115
- u.properties.content.split(`
2116
- `).forEach((E) => {
2117
- let P = E;
2118
- for (; P.length && v < d.length; ) {
2119
- if (d[v].innerHTML === "&nbsp;") {
2120
- P.startsWith(`
2121
- `) || y.push(v), v++;
2122
+ ).render(), f = [...y.children];
2123
+ let m = 0;
2124
+ const v = [];
2125
+ h.properties.content.split(`
2126
+ `).forEach((_) => {
2127
+ let R = _;
2128
+ for (; R.length && m < f.length; ) {
2129
+ if (f[m].innerHTML === "&nbsp;") {
2130
+ R.startsWith(`
2131
+ `) || v.push(m), m++;
2122
2132
  break;
2123
2133
  }
2124
- const S = nr(ir(d[v]));
2125
- P.startsWith(S) && (P = P.slice(S.length).trim()), v++;
2134
+ const S = ir(or(f[m]));
2135
+ R.startsWith(S) && (R = R.slice(S.length).trim()), m++;
2126
2136
  }
2127
- }), y.forEach((E) => g.removeChild(d[E]));
2128
- const _ = u.properties.content.match(/(https?:\/\/.*)/gm), C = _ ? _.map((E) => E.split(" ")[0]) : [];
2129
- g.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((E) => {
2130
- let P = E;
2137
+ }), v.forEach((_) => y.removeChild(f[_]));
2138
+ const k = h.properties.content.match(/(https?:\/\/.*)/gm), C = k ? k.map((_) => _.split(" ")[0]) : [];
2139
+ y.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((_) => {
2140
+ let R = _;
2131
2141
  const S = [];
2132
- for (; P.length > 0; ) {
2133
- const $ = d.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && P.startsWith(nr(ir(T))));
2134
- if (!$)
2142
+ for (; R.length > 0; ) {
2143
+ const D = f.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && R.startsWith(ir(or(T))));
2144
+ if (!D)
2135
2145
  break;
2136
- S.push($);
2137
- const L = nr($.children[0].innerHTML).length;
2146
+ S.push(D);
2147
+ const L = ir(D.children[0].innerHTML).length;
2138
2148
  if (!L)
2139
2149
  break;
2140
- P = P.slice(L);
2150
+ R = R.slice(L);
2141
2151
  }
2142
- S.forEach(($) => {
2152
+ S.forEach((D) => {
2143
2153
  const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
2144
- L.setAttribute("href", E), L.setAttribute("target", "_blank"), L.innerHTML = ir($), $.children[0].innerHTML = "", $.children[0].appendChild(L);
2154
+ L.setAttribute("href", _), L.setAttribute("target", "_blank"), L.innerHTML = or(D), D.children[0].innerHTML = "", D.children[0].appendChild(L);
2145
2155
  });
2146
- }), e.appendChild(g);
2156
+ }), e.appendChild(y);
2147
2157
  }
2148
2158
  const Ar = 20;
2149
2159
  class bn extends Br {
2150
- constructor(e, o = {}) {
2160
+ constructor(e, s = {}) {
2151
2161
  super(
2152
2162
  e,
2153
2163
  `
@@ -2163,46 +2173,46 @@ class bn extends Br {
2163
2173
  <textarea wrap="on"></textarea>
2164
2174
  </div>
2165
2175
  `
2166
- ), 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", () => {
2176
+ ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...nr }), 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", () => {
2167
2177
  this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
2168
2178
  }), x(this, "_onBlur", () => {
2169
2179
  this.isFocused = !1;
2170
- }), x(this, "startDrawing", (l, c, f = yn(l, c, 0, 0, "", Wt)) => {
2171
- this.add(f);
2172
- const g = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2173
- this.select(f.id), this.startDragging(this.getById(f.id), g.x, g.y), this.draggedHandle = 6;
2180
+ }), x(this, "startDrawing", (l, c, g = yn(l, c, 0, 0, "", Wt)) => {
2181
+ this.add(g);
2182
+ const y = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2183
+ this.select(g.id), this.startDragging(this.getById(g.id), y.x, y.y), this.draggedHandle = 6;
2174
2184
  }), x(this, "cancelDrawing", () => {
2175
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
2176
- }), x(this, "startDragging", (l, c, f) => {
2185
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...nr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
2186
+ }), x(this, "startDragging", (l, c, g) => {
2177
2187
  this.annotation = l;
2178
- const g = vt(this.annotation), d = mt(this.annotation);
2179
- this.rect.x = g.x, this.rect.y = g.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;
2188
+ const y = vt(this.annotation), f = mt(this.annotation);
2189
+ this.rect.x = y.x, this.rect.y = y.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(Ne, this.annotation), this.isDragging = !0;
2180
2190
  }), x(this, "onHandleMouseDown", (l) => {
2181
2191
  const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
2182
2192
  if (!c)
2183
2193
  return;
2184
2194
  this.selectedId !== c.id && this.select(this.hoveredId);
2185
- const { x: f, y: g } = sr(l, this.ogma.getContainer());
2186
- this.startDragging(c, f, g), this.draggedHandle = Lr(l.target);
2195
+ const { x: g, y } = Me(l, this.ogma.getContainer());
2196
+ this.startDragging(c, g, y), this.draggedHandle = Lr(l.target);
2187
2197
  }), x(this, "onMouseMove", (l) => {
2188
2198
  requestAnimationFrame(() => this._onMouseMove(l));
2189
2199
  }), x(this, "_onMouseMove", (l) => {
2190
2200
  if (!this.isDragging)
2191
2201
  return;
2192
2202
  l.stopPropagation(), l.preventDefault();
2193
- const c = this.handles[this.draggedHandle], f = c.classList.contains("top"), g = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom"), y = c.classList.contains("line-handle"), { x: _, y: C } = sr(
2203
+ const c = this.handles[this.draggedHandle], g = c.classList.contains("top"), y = c.classList.contains("left"), f = c.classList.contains("right"), m = c.classList.contains("bottom"), v = c.classList.contains("line-handle"), { x: k, y: C } = Me(
2194
2204
  l,
2195
2205
  this.ogma.getContainer()
2196
- ), E = this.ogma.view.getZoom(), P = (_ - this.startX) / E, S = (C - this.startY) / E, $ = this.ogma.view.getAngle(), L = at({ x: P, y: S }, $);
2197
- (v && g || f && d) && (L.y = 0, L.x = 0);
2198
- const T = g || y ? this.rect.x + L.x : this.rect.x, B = f || y ? this.rect.y + L.y : this.rect.y, N = Math.max(
2199
- this.rect.width + P * (y || g ? 0 : 1),
2206
+ ), _ = this.ogma.view.getZoom(), R = (k - this.startX) / _, S = (C - this.startY) / _, D = this.ogma.view.getAngle(), L = at({ x: R, y: S }, D);
2207
+ (m && y || g && f) && (L.y = 0, L.x = 0);
2208
+ const T = y || v ? this.rect.x + L.x : this.rect.x, U = g || v ? this.rect.y + L.y : this.rect.y, H = Math.max(
2209
+ this.rect.width + R * (v || y ? 0 : 1),
2200
2210
  Ar
2201
2211
  ), it = Math.max(
2202
- this.rect.height + S * (y || f ? 0 : 1),
2212
+ this.rect.height + S * (v || g ? 0 : 1),
2203
2213
  Ar
2204
2214
  );
2205
- nn(this.annotation, T, B, N, it), this.emit(De, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2215
+ nn(this.annotation, T, U, H, it), this.emit(ze, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2206
2216
  }), x(this, "onMouseUp", () => {
2207
2217
  !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);
2208
2218
  }), x(this, "_onMousedown", (l) => {
@@ -2224,65 +2234,65 @@ class bn extends Br {
2224
2234
  _canRemove() {
2225
2235
  return !this.isFocused;
2226
2236
  }
2227
- detect({ x: e, y: o }, i = 0) {
2228
- const l = { x: e, y: o }, c = this.ogma.view.getAngle();
2229
- return this.elements.find((f) => {
2230
- const { x: g, y: d } = vt(f), { width: v, height: y } = mt(f), _ = { x: g, y: d }, { x: C, y: E } = at(Ct(l, _), -c);
2231
- return C > -i && C < v + i && E > -i && E < y + i;
2237
+ detect({ x: e, y: s }, i = 0) {
2238
+ const l = { x: e, y: s }, c = this.ogma.view.getAngle();
2239
+ return this.elements.find((g) => {
2240
+ const { x: y, y: f } = vt(g), { width: m, height: v } = mt(g), k = { x: y, y: f }, { x: C, y: _ } = at(Ct(l, k), -c);
2241
+ return C > -i && C < m + i && _ > -i && _ < v + i;
2232
2242
  });
2233
2243
  }
2234
2244
  draw(e) {
2235
2245
  e.innerHTML = "";
2236
- const o = "", i = this.ogma.view.getAngle();
2237
- this.elements.forEach((c, f) => {
2238
- const g = `class${f}`, d = mt(c), v = vt(c), y = c.id, {
2239
- color: _,
2246
+ const s = "", i = this.ogma.view.getAngle();
2247
+ this.elements.forEach((c, g) => {
2248
+ const y = `class${g}`, f = mt(c), m = vt(c), v = c.id, {
2249
+ color: k,
2240
2250
  fontSize: C,
2241
- font: E,
2242
- strokeColor: P,
2251
+ font: _,
2252
+ strokeColor: R,
2243
2253
  strokeWidth: S,
2244
- strokeType: $,
2254
+ strokeType: D,
2245
2255
  background: L
2246
2256
  } = c.properties.style || Wt;
2247
- if (y === this.selectedId)
2257
+ if (v === this.selectedId)
2248
2258
  return;
2249
- const T = de("g");
2250
- T.classList.add("annotation-text"), T.setAttribute("fill", `${_}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${E}`);
2251
- const B = de("rect");
2252
- let N = !1;
2253
- $ && $ !== "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), mn(c, T);
2254
- const { x: it, y: xt } = at(v, -i);
2255
- T.setAttribute("transform", `translate(${it},${xt})`), T.classList.add(g), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2259
+ const T = ce("g");
2260
+ T.classList.add("annotation-text"), T.setAttribute("fill", `${k}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${_}`);
2261
+ const U = ce("rect");
2262
+ let H = !1;
2263
+ D && D !== "none" && (H = !0, U.setAttribute("stroke", R || "black"), U.setAttribute("stroke-width", `${S}`), D === "dashed" && U.setAttribute("stroke-dasharray", "5,5")), (L && L.length || H) && (H = !0, U.setAttribute("fill", L || "transparent")), H && (U.setAttribute("width", `${f.width}`), U.setAttribute("height", `${f.height}`)), T.appendChild(U), mn(c, T);
2264
+ const { x: it, y: At } = at(m, -i);
2265
+ T.setAttribute("transform", `translate(${it},${At})`), T.classList.add(y), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2256
2266
  });
2257
- const l = de("style");
2258
- l.innerHTML = o, e.firstChild && e.insertBefore(l, e.firstChild);
2267
+ const l = ce("style");
2268
+ l.innerHTML = s, e.firstChild && e.insertBefore(l, e.firstChild);
2259
2269
  }
2260
2270
  refreshDrawing() {
2261
2271
  const e = this.ogma.view.getAngle();
2262
- [...this.layer.element.children].forEach((o) => {
2263
- const i = o.getAttribute("data-annotation");
2272
+ [...this.layer.element.children].forEach((s) => {
2273
+ const i = s.getAttribute("data-annotation");
2264
2274
  if (!i)
2265
2275
  return;
2266
- const l = vt(this.getById(i)), { x: c, y: f } = at(l, -e);
2267
- o.setAttribute("transform", `translate(${c},${f})`);
2276
+ const l = vt(this.getById(i)), { x: c, y: g } = at(l, -e);
2277
+ s.setAttribute("transform", `translate(${c},${g})`);
2268
2278
  });
2269
2279
  }
2270
2280
  getDefaultOptions() {
2271
- return rr;
2281
+ return nr;
2272
2282
  }
2273
2283
  refreshEditor() {
2274
2284
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2275
2285
  return;
2276
- const e = this.getById(this.selectedId) || this.getById(this.hoveredId), o = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2286
+ const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2277
2287
  vt(e)
2278
2288
  ), l = this.ogma.view.getZoom(), {
2279
2289
  font: c,
2280
- fontSize: f,
2281
- color: g,
2282
- background: d,
2283
- padding: v = 0
2284
- } = e.properties.style || Wt, y = (f || 1) * l;
2285
- this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${o.width / 2 * l}px, ${o.height / 2 * l}px)`, this.editor.element.style.width = `${o.width * l}px`, this.editor.element.style.height = `${o.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 = g || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2290
+ fontSize: g,
2291
+ color: y,
2292
+ background: f,
2293
+ padding: m = 0
2294
+ } = e.properties.style || Wt, v = (g || 1) * l;
2295
+ 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 = `${v} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${v}px`, this.textArea.style.padding = `${l * m}px`, this.textArea.style.lineHeight = `${v}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = y || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2286
2296
  }
2287
2297
  select(e) {
2288
2298
  super.select(e), this.textArea.focus();
@@ -2295,56 +2305,56 @@ class wn {
2295
2305
  constructor() {
2296
2306
  x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
2297
2307
  }
2298
- add(e, o, i, l, c) {
2299
- const f = ze(), g = e.id, d = {
2300
- id: f,
2301
- arrow: g,
2308
+ add(e, s, i, l, c) {
2309
+ const g = Be(), y = e.id, f = {
2310
+ id: g,
2311
+ arrow: y,
2302
2312
  target: i,
2303
2313
  targetType: l,
2304
2314
  connectionPoint: c,
2305
- side: o
2315
+ side: s
2306
2316
  };
2307
- return this.links[f] = d, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][o] = f, e.properties.link = e.properties.link || {}, e.properties.link[o] = {
2317
+ return this.links[g] = f, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(g), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][s] = g, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
2308
2318
  id: i,
2309
- side: o,
2319
+ side: s,
2310
2320
  type: l,
2311
2321
  magnet: c
2312
2322
  }, this;
2313
2323
  }
2314
- arrowIsLinked(e, o) {
2324
+ arrowIsLinked(e, s) {
2315
2325
  var i;
2316
- return !!((i = this.linksByArrowId[e]) != null && i[o]);
2326
+ return !!((i = this.linksByArrowId[e]) != null && i[s]);
2317
2327
  }
2318
2328
  // remove the link between the arrow and the target by arrow id and side
2319
- remove(e, o) {
2329
+ remove(e, s) {
2320
2330
  var i, l;
2321
- const c = e.id, f = (i = this.linksByArrowId[c]) == null ? void 0 : i[o];
2322
- if ((l = e.properties.link) == null || delete l[o], !f)
2331
+ const c = e.id, g = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
2332
+ if ((l = e.properties.link) == null || delete l[s], !g)
2323
2333
  return this;
2324
- const g = this.links[f];
2325
- delete this.links[f];
2326
- const d = this.linksByTargetId[g.target];
2327
- for (let v = 0; v < d.length; v++)
2328
- if (d[v] === f) {
2329
- d.splice(v, 1);
2334
+ const y = this.links[g];
2335
+ delete this.links[g];
2336
+ const f = this.linksByTargetId[y.target];
2337
+ for (let m = 0; m < f.length; m++)
2338
+ if (f[m] === g) {
2339
+ f.splice(m, 1);
2330
2340
  break;
2331
2341
  }
2332
- return delete this.linksByArrowId[c][o], this;
2342
+ return delete this.linksByArrowId[c][s], this;
2333
2343
  }
2334
- getArrowLink(e, o) {
2344
+ getArrowLink(e, s) {
2335
2345
  var i;
2336
- const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[o];
2346
+ const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
2337
2347
  return l ? this.links[l] : null;
2338
2348
  }
2339
- getTargetLinks(e, o) {
2349
+ getTargetLinks(e, s) {
2340
2350
  var i;
2341
- return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === o)) ?? [];
2351
+ return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
2342
2352
  }
2343
2353
  forEach(e) {
2344
2354
  Object.values(this.links).forEach(e);
2345
2355
  }
2346
2356
  }
2347
- const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Er = (u) => u.type === "FeatureCollection", xn = {
2357
+ const st = (h) => h.properties.type === "arrow", yt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", xn = {
2348
2358
  magnetColor: "#3e8",
2349
2359
  detectMargin: 20,
2350
2360
  magnetHandleRadius: 5,
@@ -2365,7 +2375,7 @@ const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type =
2365
2375
  { x: 1, y: 1 }
2366
2376
  ];
2367
2377
  class An extends Nr {
2368
- constructor(e, o = {}) {
2378
+ constructor(e, s = {}) {
2369
2379
  super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new wn()), 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) => {
2370
2380
  if (!this.dragged || this.textToMagnet === void 0)
2371
2381
  return;
@@ -2374,27 +2384,27 @@ class An extends Nr {
2374
2384
  kr.forEach((c) => {
2375
2385
  if (!this.textToMagnet)
2376
2386
  return;
2377
- const f = mt(this.textToMagnet), g = vt(this.textToMagnet), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), { x: y, y: _ } = Ht(v, g);
2378
- i.moveTo(y, _), i.arc(y, _, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2387
+ const g = mt(this.textToMagnet), y = vt(this.textToMagnet), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), { x: v, y: k } = Ht(m, y);
2388
+ i.moveTo(v, k), i.arc(v, k, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2379
2389
  }), i.fill(), i.closePath();
2380
2390
  }), x(this, "_onFeatureDrag", (i, l) => {
2381
2391
  const c = l;
2382
2392
  if (st(i) && c === "line")
2383
- ["start", "end"].find((f) => {
2384
- const g = f === "start" ? fe(i) : $e(i);
2385
- return this._snapToText(i, c, g) || this._findAndSnapToNode(i, f, g);
2393
+ ["start", "end"].find((g) => {
2394
+ const y = g === "start" ? de(i) : $e(i);
2395
+ return this._snapToText(i, c, y) || this._findAndSnapToNode(i, g, y);
2386
2396
  });
2387
2397
  else if (st(i) && c !== "line") {
2388
- const f = c === "start" ? fe(i) : $e(i);
2389
- this._snapToText(i, c, f) || this._findAndSnapToNode(i, c, f);
2398
+ const g = c === "start" ? de(i) : $e(i);
2399
+ this._snapToText(i, c, g) || this._findAndSnapToNode(i, c, g);
2390
2400
  } else
2391
- yt(i) && (this.activeLinks.forEach(({ arrow: f, side: g, connectionPoint: d }) => {
2392
- const v = this.getAnnotation(f), y = mt(i), _ = vt(i), C = Fe(d, { x: y.width, y: y.height }), E = at(C, this.ogma.view.getAngle()), P = Ht(E, _);
2393
- v.geometry.coordinates[g === "start" ? 0 : 1] = [P.x, P.y];
2401
+ yt(i) && (this.activeLinks.forEach(({ arrow: g, side: y, connectionPoint: f }) => {
2402
+ const m = this.getAnnotation(g), v = mt(i), k = vt(i), C = je(f, { x: v.width, y: v.height }), _ = at(C, this.ogma.view.getAngle()), R = Ht(_, k);
2403
+ m.geometry.coordinates[y === "start" ? 0 : 1] = [R.x, R.y];
2394
2404
  }), this.activeLinks.length && this.arrows.refreshLayer());
2395
- this.layer.refresh(), this.emit(De, i, l);
2405
+ this.layer.refresh(), this.emit(ze, i, l);
2396
2406
  }), x(this, "_onFeatureDragEnd", (i) => {
2397
- this.dragged !== null && st(i) && fe(this.dragged) && _r.forEach((l) => {
2407
+ this.dragged !== null && st(i) && de(this.dragged) && _r.forEach((l) => {
2398
2408
  this.links.getArrowLink(i.id, l) && this.emit(dn, {
2399
2409
  arrow: i,
2400
2410
  link: this.links.getArrowLink(i.id, l)
@@ -2404,7 +2414,7 @@ class An extends Nr {
2404
2414
  this.textToMagnet = void 0, st(i) ? this.dragged = i : yt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
2405
2415
  const c = l.getSelectedFeature();
2406
2416
  c && c !== i && l.unhover().unselect(), l.disableDetection();
2407
- }), this.emit(Me, i);
2417
+ }), this.emit(Ne, i);
2408
2418
  }), x(this, "_onNodesDragStart", () => {
2409
2419
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2410
2420
  }), x(this, "_onNodesDrag", (i) => {
@@ -2412,12 +2422,12 @@ class An extends Nr {
2412
2422
  this._moveNodes(i.nodes, l, c);
2413
2423
  }), x(this, "_onLayoutEnd", (i) => {
2414
2424
  i.ids.forEach((l, c) => {
2415
- this.links.getTargetLinks(l, "node").forEach((f) => {
2416
- const g = this.getAnnotation(f.arrow), d = f.side, v = Ie(
2417
- g,
2418
- d === "start" ? "end" : "start"
2419
- ), y = i.positions.current[c], _ = this.ogma.getNode(l).getAttribute("radius"), C = Le(v, y, +_);
2420
- Bt(g, d, C.x, C.y);
2425
+ this.links.getTargetLinks(l, "node").forEach((g) => {
2426
+ const y = this.getAnnotation(g.arrow), f = g.side, m = Le(
2427
+ y,
2428
+ f === "start" ? "end" : "start"
2429
+ ), v = i.positions.current[c], k = this.ogma.getNode(l).getAttribute("radius"), C = Fe(m, v, +k);
2430
+ Bt(y, f, C.x, C.y);
2421
2431
  });
2422
2432
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2423
2433
  }), x(this, "_onAdded", (i) => {
@@ -2434,59 +2444,59 @@ class An extends Nr {
2434
2444
  );
2435
2445
  }), x(this, "_onUpdate", (i) => {
2436
2446
  this.emit(cr, i);
2437
- }), this.options = this.setOptions({ ...xn, ...o }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2438
- 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(hr, this._onAdded).on(ur, this._onRemoved);
2447
+ }), this.options = this.setOptions({ ...xn, ...s }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2448
+ i.on(Ne, this._onFeatureDragStart).on(ze, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
2439
2449
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2440
2450
  this.refreshTextLinks();
2441
2451
  }), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2442
2452
  }
2443
- _moveNodes(e, o, i) {
2453
+ _moveNodes(e, s, i) {
2444
2454
  e.forEach((l) => {
2445
- const c = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
2446
- c.forEach((g) => {
2447
- const d = this.getAnnotation(g.arrow), v = g.side, y = Ie(
2448
- d,
2449
- v === "start" ? "end" : "start"
2455
+ const c = this.links.getTargetLinks(l.getId(), "node"), g = l.getPosition();
2456
+ c.forEach((y) => {
2457
+ const f = this.getAnnotation(y.arrow), m = y.side, v = Le(
2458
+ f,
2459
+ m === "start" ? "end" : "start"
2450
2460
  );
2451
- let _ = f;
2452
- const C = +l.getAttribute("radius"), E = 1e-6;
2453
- (g.connectionPoint.x - (f.x - o) > E || g.connectionPoint.y - (f.y - i) > E) && (_ = Le(y, f, C)), Bt(d, v, _.x, _.y);
2461
+ let k = g;
2462
+ const C = +l.getAttribute("radius"), _ = 1e-6;
2463
+ (y.connectionPoint.x - (g.x - s) > _ || y.connectionPoint.y - (g.y - i) > _) && (k = Fe(v, g, C)), Bt(f, m, k.x, k.y);
2454
2464
  });
2455
2465
  }), this.arrows.refreshLayer();
2456
2466
  }
2457
- _snapToText(e, o, i) {
2467
+ _snapToText(e, s, i) {
2458
2468
  const l = this.texts.detect(i, this.options.detectMargin);
2459
- if (this.links.remove(e, o), !l)
2469
+ if (this.links.remove(e, s), !l)
2460
2470
  return !1;
2461
2471
  this.textToMagnet = l;
2462
2472
  const c = this.findMagnetPoint(kr, l, i);
2463
- return c ? (Bt(e, o, c.point.x, c.point.y), this.links.add(e, o, l.id, "text", c.magnet), !0) : !1;
2473
+ return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
2464
2474
  }
2465
- _findAndSnapToNode(e, o, i) {
2475
+ _findAndSnapToNode(e, s, i) {
2466
2476
  var l, c;
2467
- const f = this.ogma.view.graphToScreenCoordinates(i), g = this.ogma.view.getElementAt(f);
2468
- this.links.remove(e, o), g && g.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = g, g.setSelected(!0), this._snapToNode(e, o, g, f)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2469
- }
2470
- _snapToNode(e, o, i, l) {
2471
- const c = i.getPositionOnScreen(), f = +i.getAttribute("radius"), g = f * this.ogma.view.getZoom(), d = l.x - c.x, v = l.y - c.y, y = Math.sqrt(d * d + v * v), _ = i.getPosition();
2472
- if (y < g + this.options.detectMargin) {
2473
- let C = _;
2474
- if (y > g / 2) {
2475
- const E = Ie(e, o === "end" ? "start" : "end");
2476
- C = Le(E, C, f);
2477
+ const g = this.ogma.view.graphToScreenCoordinates(i), y = this.ogma.view.getElementAt(g);
2478
+ this.links.remove(e, s), y && y.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = y, y.setSelected(!0), this._snapToNode(e, s, y, g)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2479
+ }
2480
+ _snapToNode(e, s, i, l) {
2481
+ const c = i.getPositionOnScreen(), g = +i.getAttribute("radius"), y = g * this.ogma.view.getZoom(), f = l.x - c.x, m = l.y - c.y, v = Math.sqrt(f * f + m * m), k = i.getPosition();
2482
+ if (v < y + this.options.detectMargin) {
2483
+ let C = k;
2484
+ if (v > y / 2) {
2485
+ const _ = Le(e, s === "end" ? "start" : "end");
2486
+ C = Fe(_, C, g);
2477
2487
  }
2478
- Bt(e, o, C.x, C.y), this.links.add(e, o, i.getId(), "node", C);
2488
+ Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
2479
2489
  }
2480
2490
  }
2481
2491
  refreshTextLinks() {
2482
2492
  let e = !1;
2483
2493
  this.links.forEach(
2484
- ({ connectionPoint: o, targetType: i, target: l, arrow: c, side: f }) => {
2494
+ ({ connectionPoint: s, targetType: i, target: l, arrow: c, side: g }) => {
2485
2495
  if (i !== "text")
2486
2496
  return;
2487
2497
  e = !0;
2488
- const g = this.getAnnotation(l), d = this.getAnnotation(c), v = mt(g), y = vt(g), _ = Fe(o, { x: v.width, y: v.height }), C = at(_, this.ogma.view.getAngle()), E = Ht(C, y);
2489
- Bt(d, f, E.x, E.y);
2498
+ const y = this.getAnnotation(l), f = this.getAnnotation(c), m = mt(y), v = vt(y), k = je(s, { x: m.width, y: m.height }), C = at(k, this.ogma.view.getAngle()), _ = Ht(C, v);
2499
+ Bt(f, g, _.x, _.y);
2490
2500
  }
2491
2501
  ), e && this.arrows.refreshLayer();
2492
2502
  }
@@ -2496,18 +2506,18 @@ class An extends Nr {
2496
2506
  getSelected() {
2497
2507
  return this.selected;
2498
2508
  }
2499
- findMagnetPoint(e, o, i) {
2509
+ findMagnetPoint(e, s, i) {
2500
2510
  let l;
2501
2511
  for (const c of e) {
2502
- const f = mt(o), g = vt(o), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), y = Ht(v, g), _ = Ut(Ct(y, i)), C = Math.min(
2512
+ const g = mt(s), y = vt(s), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), v = Ht(m, y), k = Ut(Ct(v, i)), C = Math.min(
2503
2513
  this.options.magnetRadius * this.ogma.view.getZoom(),
2504
2514
  // when really zoomed in: avoid to snap on too far away magnets
2505
- f.width / 2,
2506
- f.height / 2
2515
+ g.width / 2,
2516
+ g.height / 2
2507
2517
  );
2508
- if (_ < Math.max(C, this.options.magnetHandleRadius)) {
2518
+ if (k < Math.max(C, this.options.magnetHandleRadius)) {
2509
2519
  l = {
2510
- point: y,
2520
+ point: v,
2511
2521
  magnet: c
2512
2522
  };
2513
2523
  break;
@@ -2531,8 +2541,8 @@ class An extends Nr {
2531
2541
  * @param id the id of the annotation to select
2532
2542
  */
2533
2543
  select(e) {
2534
- const o = this.getAnnotations().features.find((i) => i.id === e);
2535
- return o ? (st(o) ? this.arrows.select(o.id) : yt(o) && this.texts.select(o.id), this) : this;
2544
+ const s = this.getAnnotations().features.find((i) => i.id === e);
2545
+ return s ? (st(s) ? this.arrows.select(s.id) : yt(s) && this.texts.select(s.id), this) : this;
2536
2546
  }
2537
2547
  /**
2538
2548
  * Unselects the currently selected annotation
@@ -2546,11 +2556,11 @@ class An extends Nr {
2546
2556
  */
2547
2557
  add(e) {
2548
2558
  if (Er(e)) {
2549
- const [o, i] = e.features.reduce(
2559
+ const [s, i] = e.features.reduce(
2550
2560
  (l, c) => (st(c) ? l[1].push(c) : yt(c) && l[0].push(c), l),
2551
2561
  [[], []]
2552
2562
  );
2553
- return o.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2563
+ return s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2554
2564
  }
2555
2565
  switch (e.properties.type) {
2556
2566
  case "text":
@@ -2568,28 +2578,28 @@ class An extends Nr {
2568
2578
  */
2569
2579
  remove(e) {
2570
2580
  return Er(e) ? (e.features.forEach(
2571
- (o) => this.remove(o)
2581
+ (s) => this.remove(s)
2572
2582
  ), this) : (st(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
2573
2583
  }
2574
2584
  loadLink(e) {
2575
2585
  if (e.properties.link)
2576
- for (const o of _r) {
2577
- const i = e.properties.link[o];
2586
+ for (const s of _r) {
2587
+ const i = e.properties.link[s];
2578
2588
  if (!i)
2579
2589
  continue;
2580
2590
  const l = this.getAnnotation(i.id);
2581
2591
  if (i.type === "text" && l)
2582
- this.links.add(e, o, i.id, i.type, i.magnet);
2592
+ this.links.add(e, s, i.id, i.type, i.magnet);
2583
2593
  else if (i.type === "node") {
2584
2594
  const c = this.ogma.getNode(i.id);
2585
2595
  if (!c)
2586
2596
  continue;
2587
- this.links.add(e, o, i.id, i.type, i.magnet);
2588
- const f = c.getPosition(), g = c.getAttribute("radius") || 0, d = Ie(
2597
+ this.links.add(e, s, i.id, i.type, i.magnet);
2598
+ const g = c.getPosition(), y = c.getAttribute("radius") || 0, f = Le(
2589
2599
  e,
2590
- o === "start" ? "end" : "start"
2591
- ), v = Le(d, f, +g);
2592
- Bt(e, o, v.x, v.y);
2600
+ s === "start" ? "end" : "start"
2601
+ ), m = Fe(f, g, +y);
2602
+ Bt(e, s, m.x, m.y);
2593
2603
  }
2594
2604
  }
2595
2605
  }
@@ -2599,8 +2609,8 @@ class An extends Nr {
2599
2609
  * @param y coord of the first point
2600
2610
  * @param arrow The arrow to add
2601
2611
  */
2602
- startArrow(e, o, i) {
2603
- this.cancelDrawing(), this.arrows.startDrawing(e, o, i);
2612
+ startArrow(e, s, i) {
2613
+ this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
2604
2614
  }
2605
2615
  /**
2606
2616
  * Start adding a text (add it, and give control to the user)
@@ -2608,8 +2618,8 @@ class An extends Nr {
2608
2618
  * @param y coord of the top left point
2609
2619
  * @param text The text to add
2610
2620
  */
2611
- startText(e, o, i) {
2612
- this.cancelDrawing(), this.texts.startDrawing(e, o, i);
2621
+ startText(e, s, i) {
2622
+ this.cancelDrawing(), this.texts.startDrawing(e, s, i);
2613
2623
  }
2614
2624
  /**
2615
2625
  * Cancel drawing on the current frame
@@ -2622,13 +2632,13 @@ class An extends Nr {
2622
2632
  * @param id The id of the annotation to update
2623
2633
  * @param style The new style
2624
2634
  */
2625
- updateStyle(e, o) {
2635
+ updateStyle(e, s) {
2626
2636
  const i = this.getAnnotations().features.find((l) => l.id === e);
2627
- return i ? (st(i) ? this.arrows.updateStyle(i, o) : yt(i) && this.texts.updateStyle(i, o), this.onUpdate(i), this) : this;
2637
+ return i ? (st(i) ? this.arrows.updateStyle(i, s) : yt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
2628
2638
  }
2629
- setScale(e, o, i, l) {
2630
- const c = this.getAnnotations().features.find((f) => f.id === e);
2631
- return c ? (st(c) ? this.arrows.scale(c, o, i, l) : yt(c) && this.texts.scale(c, o, i, l), this.onUpdate(c), this) : this;
2639
+ setScale(e, s, i, l) {
2640
+ const c = this.getAnnotations().features.find((g) => g.id === e);
2641
+ return c ? (st(c) ? this.arrows.scale(c, s, i, l) : yt(c) && this.texts.scale(c, s, i, l), this.onUpdate(c), this) : this;
2632
2642
  }
2633
2643
  /**
2634
2644
  *
@@ -2639,8 +2649,8 @@ class An extends Nr {
2639
2649
  type: "FeatureCollection",
2640
2650
  features: []
2641
2651
  };
2642
- return this.annotations.forEach((o) => {
2643
- e.features = [...e.features, ...o.getElements()];
2652
+ return this.annotations.forEach((s) => {
2653
+ e.features = [...e.features, ...s.getElements()];
2644
2654
  }), e;
2645
2655
  }
2646
2656
  /**
@@ -2649,7 +2659,7 @@ class An extends Nr {
2649
2659
  * @returns The annotation with the given id
2650
2660
  */
2651
2661
  getAnnotation(e) {
2652
- return this.getAnnotations().features.find((o) => o.id === e);
2662
+ return this.getAnnotations().features.find((s) => s.id === e);
2653
2663
  }
2654
2664
  /**
2655
2665
  * Destroy the controller and its elements
@@ -2683,7 +2693,7 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
2683
2693
  "Consolas",
2684
2694
  "Courier New",
2685
2695
  "monospace"
2686
- ].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
2696
+ ].sort((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
2687
2697
  head: "arrow",
2688
2698
  strokeColor: Ur,
2689
2699
  strokeWidth: 5
@@ -2695,97 +2705,97 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
2695
2705
  strokeType: Sr,
2696
2706
  background: Sr
2697
2707
  };
2698
- function Tn(u) {
2699
- return u.reduce((e, o) => e + o, 0) / u.length;
2708
+ function Tn(h) {
2709
+ return h.reduce((e, s) => e + s, 0) / h.length;
2700
2710
  }
2701
- function In(u, e = 0, o = 1) {
2702
- return e + (o - e) * u;
2711
+ function In(h, e = 0, s = 1) {
2712
+ return e + (s - e) * h;
2703
2713
  }
2704
- function Ln(u, e = 0, o = 1) {
2705
- return (u - e) / (o - e);
2714
+ function Ln(h, e = 0, s = 1) {
2715
+ return (h - e) / (s - e);
2706
2716
  }
2707
2717
  function Fn() {
2708
2718
  return Or(null);
2709
2719
  }
2710
2720
  const Wr = Or(
2711
2721
  void 0
2712
- ), $n = () => qr(Wr), Sn = (u, e) => {
2722
+ ), jn = () => qr(Wr), Sn = (h, e) => {
2713
2723
  switch (e.type) {
2714
2724
  case "add":
2715
2725
  return {
2716
- ...u,
2717
- features: [...u.features, e.payload]
2726
+ ...h,
2727
+ features: [...h.features, e.payload]
2718
2728
  };
2719
2729
  case "remove":
2720
2730
  return {
2721
- ...u,
2722
- features: u.features.filter((o) => o.id !== e.payload.id)
2731
+ ...h,
2732
+ features: h.features.filter((s) => s.id !== e.payload.id)
2723
2733
  };
2724
2734
  case "update":
2725
2735
  return {
2726
- ...u,
2727
- features: u.features.map(
2728
- (o) => o.id === e.payload.id ? e.payload : o
2736
+ ...h,
2737
+ features: h.features.map(
2738
+ (s) => s.id === e.payload.id ? e.payload : s
2729
2739
  )
2730
2740
  };
2731
2741
  default:
2732
- return u;
2742
+ return h;
2733
2743
  }
2734
- }, jn = ({ children: u }) => {
2735
- const e = Gr(), [o, i] = Yr(Sn, {
2744
+ }, $n = ({ children: h }) => {
2745
+ const e = Gr(), [s, i] = Yr(Sn, {
2736
2746
  type: "FeatureCollection",
2737
2747
  features: []
2738
- }), [l, c] = Nt(null), [f, g] = Nt(En), [d, v] = Nt(kn), [y, _] = Nt(), [C, E] = Nt(1), [P, S] = Nt(1);
2739
- return er(() => {
2748
+ }), [l, c] = Nt(null), [g, y] = Nt(En), [f, m] = Nt(kn), [v, k] = Nt(), [C, _] = Nt(1), [R, S] = Nt(1);
2749
+ return rr(() => {
2740
2750
  if (!e)
2741
2751
  return;
2742
- const $ = new An(e, {
2752
+ const D = new An(e, {
2743
2753
  minArrowHeight: 1
2744
2754
  }), L = Tn(e.getNodes().getAttribute("radius")) / 5, T = C;
2745
- return g({
2746
- ...f,
2747
- strokeWidth: (f.strokeWidth || 1) * T
2748
- }), E(T), S(L), $.on("select", (B) => {
2749
- st(B) ? g({
2750
- ...B.properties.style || {}
2751
- }) : yt(B) && v({
2752
- ...B.properties.style || {}
2753
- }), c(B);
2755
+ return y({
2756
+ ...g,
2757
+ strokeWidth: (g.strokeWidth || 1) * T
2758
+ }), _(T), S(L), D.on("select", (U) => {
2759
+ st(U) ? y({
2760
+ ...U.properties.style || {}
2761
+ }) : yt(U) && m({
2762
+ ...U.properties.style || {}
2763
+ }), c(U);
2754
2764
  }).on("unselect", () => {
2755
2765
  c(null);
2756
- }), _($), () => {
2757
- y == null || y.destroy();
2766
+ }), k(D), () => {
2767
+ v == null || v.destroy();
2758
2768
  };
2759
- }, [e]), er(() => {
2760
- y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
2761
- }, [y, f, l]), er(() => {
2762
- y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
2763
- }, [y, d, l]), /* @__PURE__ */ Zr.jsx(
2769
+ }, [e]), rr(() => {
2770
+ v && l && (l == null ? void 0 : l.properties.type) === "arrow" && v.updateStyle(l.id, g);
2771
+ }, [v, g, l]), rr(() => {
2772
+ v && l && (l == null ? void 0 : l.properties.type) === "text" && v.updateStyle(l.id, f);
2773
+ }, [v, f, l]), /* @__PURE__ */ Kr.jsx(
2764
2774
  Wr.Provider,
2765
2775
  {
2766
2776
  value: {
2767
- annotations: o,
2777
+ annotations: s,
2768
2778
  updateAnnotations: i,
2769
2779
  currentAnnotation: l,
2770
2780
  setCurrentAnnotation: c,
2771
- textStyle: d,
2772
- setTextStyle: v,
2773
- arrowStyle: f,
2774
- setArrowStyle: g,
2781
+ textStyle: f,
2782
+ setTextStyle: m,
2783
+ arrowStyle: g,
2784
+ setArrowStyle: y,
2775
2785
  arrowWidthFactor: C,
2776
- setArrowWidthFactor: E,
2777
- textSizeFactor: P,
2786
+ setArrowWidthFactor: _,
2787
+ textSizeFactor: R,
2778
2788
  setTextSizeFactor: S,
2779
- editor: y,
2780
- setEditor: _
2789
+ editor: v,
2790
+ setEditor: k
2781
2791
  },
2782
- children: u
2792
+ children: h
2783
2793
  }
2784
2794
  );
2785
2795
  };
2786
2796
  export {
2787
2797
  Wr as AnnotationsContext,
2788
- jn as AnnotationsContextProvider,
2798
+ $n as AnnotationsContextProvider,
2789
2799
  Ur as BLACK,
2790
2800
  _n as RELATIVE_PADDING,
2791
2801
  Sr as TRANSPARENT,
@@ -2798,5 +2808,5 @@ export {
2798
2808
  In as interpolate,
2799
2809
  Tn as mean,
2800
2810
  Ln as normalize,
2801
- $n as useAnnotationsContext
2811
+ jn as useAnnotationsContext
2802
2812
  };