@linkurious/ogma-annotations-react 1.1.19 → 1.1.20

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