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