@linkurious/ogma-annotations-react 1.1.20 → 1.1.23

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