@linkurious/ogma-annotations-react 1.1.16 → 1.1.19
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 +1178 -1171
- 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
1
|
import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
|
|
2
2
|
import { useOgma as Gr } from "@linkurious/ogma-react";
|
|
3
|
-
var or = { exports: {} },
|
|
3
|
+
var or = { 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 Be() {
|
|
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 He = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
|
+
_t = new He();
|
|
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, Be(), 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 Ue(t, u, d) {
|
|
286
|
+
return Zt(t, !1);
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
var
|
|
290
|
-
return !!(
|
|
288
|
+
function We(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, We(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 Ue(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 Ve(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 qe = Array.isArray;
|
|
349
|
+
function Qt(t) {
|
|
350
|
+
return qe(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 Ye(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 (Ye(t))
|
|
370
|
+
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(t)), Ae(t);
|
|
371
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 Ge(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 Xe(t, u) {
|
|
396
|
+
if (typeof t.ref == "string" && ot.current && u && ot.current.stateNode !== u) {
|
|
397
|
+
var d = tt(ot.current.type);
|
|
398
|
+
ee[d] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), ee[d] = !0);
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function Je(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), Ge(u) && (te(u.key), E = "" + u.key), re(u) && (O = u.ref, Xe(u, b));
|
|
456
|
+
for (w in u)
|
|
457
|
+
bt.call(u, w) && !Ee.hasOwnProperty(w) && (A[w] = u[w]);
|
|
458
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 && Je(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 Ke(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
543
|
function Ze(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
|
+
Ve(d, t.props, "prop", p, t);
|
|
560
|
+
} else if (u.PropTypes !== void 0 && !J) {
|
|
561
|
+
J = !0;
|
|
562
|
+
var b = tt(u);
|
|
563
|
+
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
|
|
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 = Ke();
|
|
588
|
+
O ? E += O : E += $t();
|
|
589
|
+
var P;
|
|
590
|
+
t === null ? P = "null" : Qt(t) ? P = "array" : t !== void 0 && t.$$typeof === e ? (P = "<" + (tt(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : P = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, E);
|
|
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);
|
|
614
607
|
}
|
|
615
|
-
|
|
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
|
+
}
|
|
621
|
+
}
|
|
622
|
+
return t === i ? Oe(I) : Ze(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
635
|
process.env.NODE_ENV === "production" ? or.exports = Xr() : or.exports = Jr();
|
|
629
|
-
var
|
|
630
|
-
let
|
|
631
|
-
const
|
|
636
|
+
var Kr = or.exports, Zr = Object.defineProperty, Qr = (h, e, s) => e in h ? Zr(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, x = (h, e, s) => (Qr(h, typeof e != "symbol" ? e + "" : e, s), s);
|
|
637
|
+
let Ne = (h = 21) => crypto.getRandomValues(new Uint8Array(h)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
|
|
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: Ne(),
|
|
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 sr(
|
|
768
|
+
function sr(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, Me = "dragging", ze = "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 ? Ne() : 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,26 @@ 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 } = sr(i, this.ogma.getContainer());
|
|
1143
|
+
this.startDragging(l, c, g), this.draggedHandle = Lr(i.target);
|
|
1137
1144
|
}), x(this, "onMouseUp", () => {
|
|
1138
1145
|
this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
|
|
1139
1146
|
}), x(this, "onMouseMove", (i) => {
|
|
1140
1147
|
if (!this.isDragging || this.draggedHandle === Y)
|
|
1141
1148
|
return;
|
|
1142
|
-
const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x:
|
|
1149
|
+
const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: g, y } = at(
|
|
1143
1150
|
an(
|
|
1144
|
-
{ x: i.
|
|
1151
|
+
{ x: i.x - this.startX, y: i.y - this.startY },
|
|
1145
1152
|
this.ogma.view.getZoom()
|
|
1146
1153
|
),
|
|
1147
1154
|
c
|
|
1148
|
-
),
|
|
1149
|
-
(
|
|
1150
|
-
|
|
1155
|
+
), f = l.id === vr, m = l.id === mr, v = l.id === br;
|
|
1156
|
+
(f || m) && Rr(this.arrow, this.start.x + g, this.start.y + y), (f || v) && Ir(this.arrow, this.end.x + g, this.end.y + y), this.emit(
|
|
1157
|
+
Me,
|
|
1151
1158
|
this.arrow,
|
|
1152
|
-
|
|
1159
|
+
f ? "line" : m ? "start" : "end"
|
|
1153
1160
|
), this.refreshEditor(), this.layer.refresh();
|
|
1154
|
-
}), this.minArrowHeight =
|
|
1161
|
+
}), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
|
|
1155
1162
|
this.editor.element.querySelectorAll(".arrow-handle>.handle")
|
|
1156
1163
|
), this.handles.forEach(
|
|
1157
1164
|
(i) => i.addEventListener("mousedown", this.onHandleMouseDown)
|
|
@@ -1163,56 +1170,56 @@ class pn extends Br {
|
|
|
1163
1170
|
* @param y
|
|
1164
1171
|
* @param arrow
|
|
1165
1172
|
*/
|
|
1166
|
-
startDrawing(e,
|
|
1173
|
+
startDrawing(e, s, i = tn(e, s, e, s, fe)) {
|
|
1167
1174
|
var l;
|
|
1168
1175
|
this.disableDragging(), this.add(i), this.hoveredId = i.id;
|
|
1169
|
-
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y:
|
|
1176
|
+
const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), g = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
|
|
1170
1177
|
left: 0,
|
|
1171
1178
|
top: 0
|
|
1172
1179
|
};
|
|
1173
1180
|
this.startDragging(
|
|
1174
1181
|
this.getById(i.id),
|
|
1175
|
-
c.x + (
|
|
1176
|
-
c.y +
|
|
1182
|
+
c.x + (g == null ? void 0 : g.left),
|
|
1183
|
+
c.y + g.top
|
|
1177
1184
|
), this.draggedHandle = 2;
|
|
1178
1185
|
}
|
|
1179
1186
|
cancelDrawing() {
|
|
1180
1187
|
this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
|
|
1181
1188
|
}
|
|
1182
|
-
startDragging(e,
|
|
1183
|
-
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX =
|
|
1189
|
+
startDragging(e, s, i) {
|
|
1190
|
+
this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = de(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(ze, this.arrow), this.isDragging = !0;
|
|
1184
1191
|
}
|
|
1185
|
-
detect(e,
|
|
1192
|
+
detect(e, s = 0) {
|
|
1186
1193
|
return this.elements.find((i) => {
|
|
1187
|
-
const { start: l, end: c } =
|
|
1194
|
+
const { start: l, end: c } = De(i), g = Ct(e, {
|
|
1188
1195
|
x: (l.x + c.x) / 2,
|
|
1189
1196
|
y: (l.y + c.y) / 2
|
|
1190
|
-
}),
|
|
1191
|
-
return Math.abs(pr(
|
|
1197
|
+
}), y = Ct(c, l), f = Ut(y), m = jr(y), v = Dr(i);
|
|
1198
|
+
return Math.abs(pr(m, g)) < f / 2 + s && Math.abs(pr(at(m, Math.PI / 2), g)) < v / 2 + s;
|
|
1192
1199
|
});
|
|
1193
1200
|
}
|
|
1194
1201
|
refreshEditor() {
|
|
1195
1202
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
1196
1203
|
return;
|
|
1197
|
-
const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId),
|
|
1204
|
+
const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = De(e), i = this.ogma.view.graphToScreenCoordinates(s.start), l = this.ogma.view.graphToScreenCoordinates(s.end), [c, g, y] = Array.prototype.slice.call(
|
|
1198
1205
|
this.editor.element.querySelectorAll(".handle")
|
|
1199
1206
|
);
|
|
1200
|
-
|
|
1201
|
-
const
|
|
1207
|
+
g.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, y.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
|
|
1208
|
+
const f = {
|
|
1202
1209
|
x: (l.x + i.x) / 2,
|
|
1203
1210
|
y: (l.y + i.y) / 2
|
|
1204
|
-
},
|
|
1205
|
-
c.style.width = `${Ut(
|
|
1211
|
+
}, m = Ct(l, i), v = $r(m, 1 / Ut(m)), k = Math.atan2(v.y, v.x);
|
|
1212
|
+
c.style.width = `${Ut(m)}px`, c.style.left = `${f.x}px`, c.style.top = `${f.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${k}rad)`;
|
|
1206
1213
|
}
|
|
1207
1214
|
getDefaultOptions() {
|
|
1208
1215
|
return gr;
|
|
1209
1216
|
}
|
|
1210
1217
|
draw(e) {
|
|
1211
1218
|
e.innerHTML = "";
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1214
|
-
(l) => ln(l,
|
|
1215
|
-
), e.appendChild(
|
|
1219
|
+
const s = ce("g"), i = this.ogma.view.getAngle();
|
|
1220
|
+
s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
|
|
1221
|
+
(l) => ln(l, s, fe, this.minArrowHeight, this.maxArrowHeight)
|
|
1222
|
+
), e.appendChild(s);
|
|
1216
1223
|
}
|
|
1217
1224
|
refreshDrawing() {
|
|
1218
1225
|
const e = this.ogma.view.getAngle();
|
|
@@ -1258,8 +1265,8 @@ const Wt = {
|
|
|
1258
1265
|
}, wr = {
|
|
1259
1266
|
handleSize: 3.5,
|
|
1260
1267
|
placeholder: "Your text..."
|
|
1261
|
-
}, yn = (
|
|
1262
|
-
id:
|
|
1268
|
+
}, yn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Wt }) => ({
|
|
1269
|
+
id: Ne(),
|
|
1263
1270
|
type: "Feature",
|
|
1264
1271
|
properties: {
|
|
1265
1272
|
type: "text",
|
|
@@ -1270,23 +1277,23 @@ const Wt = {
|
|
|
1270
1277
|
type: "Polygon",
|
|
1271
1278
|
coordinates: [
|
|
1272
1279
|
[
|
|
1273
|
-
[
|
|
1274
|
-
[
|
|
1275
|
-
[
|
|
1276
|
-
[
|
|
1277
|
-
[
|
|
1280
|
+
[h, e],
|
|
1281
|
+
[h + s, e],
|
|
1282
|
+
[h + s, e + i],
|
|
1283
|
+
[h, e + i],
|
|
1284
|
+
[h, e]
|
|
1278
1285
|
]
|
|
1279
1286
|
]
|
|
1280
1287
|
}
|
|
1281
1288
|
});
|
|
1282
1289
|
var Hr = { exports: {} };
|
|
1283
|
-
(function(
|
|
1284
|
-
(function(
|
|
1285
|
-
|
|
1290
|
+
(function(h, e) {
|
|
1291
|
+
(function(s, i) {
|
|
1292
|
+
h.exports = i();
|
|
1286
1293
|
})(fn, () => (() => {
|
|
1287
|
-
var
|
|
1294
|
+
var s = { d: (r, n) => {
|
|
1288
1295
|
for (var a in n)
|
|
1289
|
-
|
|
1296
|
+
s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
|
|
1290
1297
|
}, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
|
|
1291
1298
|
function l(r) {
|
|
1292
1299
|
return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
@@ -1295,67 +1302,67 @@ var Hr = { exports: {} };
|
|
|
1295
1302
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1296
1303
|
}, l(r);
|
|
1297
1304
|
}
|
|
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
|
|
1305
|
+
s.d(i, { default: () => Pe });
|
|
1306
|
+
var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, g = /\bsmall-caps\b/, y = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, m = 13.3333333, v = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
|
|
1307
|
+
function k(r) {
|
|
1301
1308
|
var n = "", a = this;
|
|
1302
1309
|
return a.style && a.style !== "normal" && (n += a.style), a.variant && a.variant !== "normal" && (n += (n ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (n += (n ? " " : "") + a.weight), a.size && (n += (n ? " " : "") + a.size + "px", a.height !== a.size && (n += "/" + a.height + "px")), a.family && (n += (n ? " " : "") + a.family), r && (n += "::" + a.baseline), r && (n += "::" + a.color), n;
|
|
1303
1310
|
}
|
|
1304
|
-
var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString:
|
|
1305
|
-
function
|
|
1311
|
+
var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: k, valueOf: k };
|
|
1312
|
+
function _(r) {
|
|
1306
1313
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
|
|
1307
1314
|
n.family = (a[6] || "").trim();
|
|
1308
|
-
var
|
|
1309
|
-
a[3] === "%" ?
|
|
1310
|
-
var
|
|
1311
|
-
if (
|
|
1315
|
+
var o = v[a[2]] || parseFloat(a[2]);
|
|
1316
|
+
a[3] === "%" ? o *= 0.16 : a[3] === "em" ? o *= 16 : a[3] === "pt" && (o *= m), n.size = o;
|
|
1317
|
+
var t = parseFloat(a[4]);
|
|
1318
|
+
if (t !== "normal" && t !== "inherit" && t ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = t * m : a[5] === "%" ? n.height = 0.01 * o : n.height = t : n.height = t * o : n.height = Math.round(o * (7 / 6)), g.test(a[1]) && (n.variant = "small-caps"), y.test(a[1]) && (n.style = "italic"), f.test(a[1]))
|
|
1312
1319
|
n.weight = "bold";
|
|
1313
1320
|
else {
|
|
1314
|
-
var
|
|
1315
|
-
|
|
1321
|
+
var u = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
|
|
1322
|
+
u >= 100 && u !== 400 && (n.weight = u);
|
|
1316
1323
|
}
|
|
1317
1324
|
return n;
|
|
1318
1325
|
}
|
|
1319
|
-
function
|
|
1320
|
-
var r, n, a,
|
|
1321
|
-
if (
|
|
1322
|
-
var A =
|
|
1323
|
-
r =
|
|
1324
|
-
} else if (typeof
|
|
1325
|
-
var
|
|
1326
|
-
r =
|
|
1326
|
+
function R() {
|
|
1327
|
+
var r, n, a, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, d = 12, p = null, b = null, w = "";
|
|
1328
|
+
if (o && o.nodeType) {
|
|
1329
|
+
var A = o && (o.ownerDocument && o.ownerDocument.defaultView || o.document && o || o.defaultView), E = A.getComputedStyle(o, null);
|
|
1330
|
+
r = E.getPropertyValue("font-family") || "", d = parseFloat(E.getPropertyValue("font-size")), u = E.getPropertyValue("line-height"), p = E.getPropertyValue("font-weight"), b = E.getPropertyValue("font-style"), w = E.getPropertyValue("font-variant") || "";
|
|
1331
|
+
} else if (typeof o == "string") {
|
|
1332
|
+
var O = _(o);
|
|
1333
|
+
r = O.family, d = O.size, u = O.height, w = O.variant, b = O.style, p = O.weight;
|
|
1327
1334
|
} else
|
|
1328
|
-
l(
|
|
1329
|
-
|
|
1330
|
-
var
|
|
1331
|
-
return
|
|
1335
|
+
l(o) === "object" && (r = o.family, d = o.size, u = o.height, w = o.variant, p = o.weight, b = o.style, n = o.baseline, a = o.color);
|
|
1336
|
+
t.size && t.size < 3 && (d *= t.size), u = u !== "normal" && u ? parseFloat(u) : d * (7 / 6), t.height && t.height < 3 && (u *= t.height);
|
|
1337
|
+
var P = Object.create(C);
|
|
1338
|
+
return P.family = t.family || r || "sans-serif", P.height = u ?? 14, P.size = d ?? 12, P.variant = t.variant || w || "", P.style = t.style || b || "", P.weight = t.weight || p || "", P.baseline = n || 0, t.baseline != null && (P.baseline = t.baseline), P.color = t.color || a || "", P.id = k.call(P, !0), P;
|
|
1332
1339
|
}
|
|
1333
1340
|
const S = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
|
|
1334
|
-
var
|
|
1341
|
+
var D, L = function(r) {
|
|
1335
1342
|
var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
|
|
1336
1343
|
if (n && n.getContext) {
|
|
1337
1344
|
var a = n.getContext("2d");
|
|
1338
1345
|
if (a && typeof a.measureText == "function")
|
|
1339
|
-
return function(
|
|
1340
|
-
return a.font = String(
|
|
1346
|
+
return function(o, t) {
|
|
1347
|
+
return a.font = String(t), a.measureText(o).width;
|
|
1341
1348
|
};
|
|
1342
1349
|
}
|
|
1343
|
-
}(typeof document < "u" ? document : null) || (
|
|
1344
|
-
if (
|
|
1345
|
-
var a =
|
|
1346
|
-
|
|
1350
|
+
}(typeof document < "u" ? document : null) || (D = {}, function(r, n) {
|
|
1351
|
+
if (!D[n]) {
|
|
1352
|
+
var a = R(n);
|
|
1353
|
+
D[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
|
|
1347
1354
|
}
|
|
1348
|
-
return r.length *
|
|
1349
|
-
}), T = {},
|
|
1350
|
-
function
|
|
1351
|
-
var
|
|
1352
|
-
if (!
|
|
1355
|
+
return r.length * D[n].size;
|
|
1356
|
+
}), T = {}, U = { trim: !0, collapse: !0 };
|
|
1357
|
+
function H(r, n, a) {
|
|
1358
|
+
var o = Object.assign({}, U, a), t = String(r);
|
|
1359
|
+
if (!t)
|
|
1353
1360
|
return 0;
|
|
1354
|
-
if (
|
|
1355
|
-
var
|
|
1356
|
-
return
|
|
1361
|
+
if (t in S) {
|
|
1362
|
+
var u = n.id + "/" + t;
|
|
1363
|
+
return u in T || (T[u] = L("_".concat(t, "_"), n) - L("__", n)), T[u];
|
|
1357
1364
|
}
|
|
1358
|
-
return
|
|
1365
|
+
return o.trim && o.collapse ? o.trim ? t = t.trim() : o.collapse && (t = t.replace(/\s+/g, " ")) : t = t.replace(/\n/g, " "), L(t, n) + n.size * (r.tracking || 0);
|
|
1359
1366
|
}
|
|
1360
1367
|
function it(r) {
|
|
1361
1368
|
return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
@@ -1364,14 +1371,14 @@ var Hr = { exports: {} };
|
|
|
1364
1371
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1365
1372
|
}, it(r);
|
|
1366
1373
|
}
|
|
1367
|
-
function
|
|
1374
|
+
function At(r, n) {
|
|
1368
1375
|
if (typeof n != "function" && n !== null)
|
|
1369
1376
|
throw new TypeError("Super expression must either be null or a function");
|
|
1370
1377
|
r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
|
|
1371
1378
|
}
|
|
1372
1379
|
function qt(r, n) {
|
|
1373
|
-
return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a,
|
|
1374
|
-
return a.__proto__ =
|
|
1380
|
+
return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, o) {
|
|
1381
|
+
return a.__proto__ = o, a;
|
|
1375
1382
|
}, qt(r, n);
|
|
1376
1383
|
}
|
|
1377
1384
|
function Yt(r) {
|
|
@@ -1388,16 +1395,16 @@ var Hr = { exports: {} };
|
|
|
1388
1395
|
}
|
|
1389
1396
|
}();
|
|
1390
1397
|
return function() {
|
|
1391
|
-
var a,
|
|
1398
|
+
var a, o = Ot(r);
|
|
1392
1399
|
if (n) {
|
|
1393
|
-
var
|
|
1394
|
-
a = Reflect.construct(
|
|
1400
|
+
var t = Ot(this).constructor;
|
|
1401
|
+
a = Reflect.construct(o, arguments, t);
|
|
1395
1402
|
} else
|
|
1396
|
-
a =
|
|
1397
|
-
return
|
|
1403
|
+
a = o.apply(this, arguments);
|
|
1404
|
+
return ge(this, a);
|
|
1398
1405
|
};
|
|
1399
1406
|
}
|
|
1400
|
-
function
|
|
1407
|
+
function ge(r, n) {
|
|
1401
1408
|
if (n && (it(n) === "object" || typeof n == "function"))
|
|
1402
1409
|
return n;
|
|
1403
1410
|
if (n !== void 0)
|
|
@@ -1417,28 +1424,28 @@ var Hr = { exports: {} };
|
|
|
1417
1424
|
if (!(r instanceof n))
|
|
1418
1425
|
throw new TypeError("Cannot call a class as a function");
|
|
1419
1426
|
}
|
|
1420
|
-
function
|
|
1427
|
+
function pe(r, n) {
|
|
1421
1428
|
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
|
|
1429
|
+
var o = n[a];
|
|
1430
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
|
|
1431
|
+
if (it(u) !== "object" || u === null)
|
|
1432
|
+
return u;
|
|
1433
|
+
var p = u[Symbol.toPrimitive];
|
|
1434
|
+
if (p !== void 0) {
|
|
1435
|
+
var b = p.call(u, d);
|
|
1436
|
+
if (it(b) !== "object")
|
|
1437
|
+
return b;
|
|
1431
1438
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1432
1439
|
}
|
|
1433
|
-
return String(
|
|
1434
|
-
}(
|
|
1440
|
+
return String(u);
|
|
1441
|
+
}(o.key, "string"), it(t) === "symbol" ? t : String(t)), o);
|
|
1435
1442
|
}
|
|
1436
|
-
var
|
|
1443
|
+
var t;
|
|
1437
1444
|
}
|
|
1438
1445
|
function tt(r, n, a) {
|
|
1439
|
-
return n &&
|
|
1446
|
+
return n && pe(r.prototype, n), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
1440
1447
|
}
|
|
1441
|
-
var
|
|
1448
|
+
var z = function() {
|
|
1442
1449
|
function r() {
|
|
1443
1450
|
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
1444
1451
|
Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
|
|
@@ -1452,42 +1459,42 @@ var Hr = { exports: {} };
|
|
|
1452
1459
|
return this.value;
|
|
1453
1460
|
} }]), r;
|
|
1454
1461
|
}(), lt = function(r) {
|
|
1455
|
-
|
|
1462
|
+
At(a, r);
|
|
1456
1463
|
var n = Yt(a);
|
|
1457
1464
|
function a() {
|
|
1458
1465
|
return Pt(this, a), n.apply(this, arguments);
|
|
1459
1466
|
}
|
|
1460
1467
|
return tt(a);
|
|
1461
|
-
}(
|
|
1462
|
-
|
|
1468
|
+
}(z), X = function(r) {
|
|
1469
|
+
At(a, r);
|
|
1463
1470
|
var n = Yt(a);
|
|
1464
1471
|
function a() {
|
|
1465
1472
|
return Pt(this, a), n.apply(this, arguments);
|
|
1466
1473
|
}
|
|
1467
1474
|
return tt(a);
|
|
1468
|
-
}(
|
|
1469
|
-
|
|
1475
|
+
}(z), ut = function(r) {
|
|
1476
|
+
At(a, r);
|
|
1470
1477
|
var n = Yt(a);
|
|
1471
1478
|
function a() {
|
|
1472
1479
|
return Pt(this, a), n.apply(this, arguments);
|
|
1473
1480
|
}
|
|
1474
1481
|
return tt(a);
|
|
1475
|
-
}(
|
|
1476
|
-
function
|
|
1482
|
+
}(z), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Gt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
|
|
1483
|
+
function Et(r, n) {
|
|
1477
1484
|
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(
|
|
1485
|
+
for (var a, o, t = [], u = r.charAt(0), d = 0, p = 1, b = r.length; p < b; p++) {
|
|
1486
|
+
a = r.charAt(p), o = r.charAt(p + 1);
|
|
1487
|
+
var w = Rt.test(u), A = Rt.test(a), E = A || w, O = void 0;
|
|
1488
|
+
if ((me.test(a) && !Gt.test(u) || ve.test(u + o) && !Gt.test(a)) && (E = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((O = Rt.test(r.charAt(p - 2))) && !A && (E = !1), !O && ye.test(a + o) && (E = !0)), E) {
|
|
1489
|
+
var P = r.slice(d, p);
|
|
1490
|
+
/\u00AD$/.test(P) ? (t.push(new z(P.slice(0, -1))), t.push(new ut())) : (t.push(new z(P)), t.push(new lt())), d = p;
|
|
1484
1491
|
}
|
|
1485
|
-
|
|
1492
|
+
u = a;
|
|
1486
1493
|
}
|
|
1487
|
-
return
|
|
1494
|
+
return t.push(new z(r.slice(d))), t;
|
|
1488
1495
|
}
|
|
1489
1496
|
const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
|
|
1490
|
-
var
|
|
1497
|
+
var Be = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Xt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, _t = { b: function(r) {
|
|
1491
1498
|
r.weight = "bold";
|
|
1492
1499
|
}, strong: function(r) {
|
|
1493
1500
|
r.weight = "bold";
|
|
@@ -1513,27 +1520,27 @@ var Hr = { exports: {} };
|
|
|
1513
1520
|
r.sub = !0;
|
|
1514
1521
|
}, sup: function(r) {
|
|
1515
1522
|
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 ||
|
|
1523
|
+
} }, He = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
|
|
1524
|
+
function Zt(r) {
|
|
1525
|
+
return r.replace(Kt, function(n, a, o, t) {
|
|
1526
|
+
if (a || o) {
|
|
1527
|
+
var u = a ? 10 : 16;
|
|
1528
|
+
return String.fromCharCode(parseInt(a || o, u));
|
|
1522
1529
|
}
|
|
1523
|
-
return
|
|
1530
|
+
return t in be ? be[t] : n;
|
|
1524
1531
|
});
|
|
1525
1532
|
}
|
|
1526
|
-
function
|
|
1533
|
+
function Ue(r) {
|
|
1527
1534
|
return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
|
|
1528
1535
|
}
|
|
1529
|
-
var
|
|
1536
|
+
var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
|
|
1530
1537
|
function Lt(r) {
|
|
1531
1538
|
var n, a = {};
|
|
1532
1539
|
if (r) {
|
|
1533
1540
|
do
|
|
1534
|
-
if (n =
|
|
1535
|
-
var
|
|
1536
|
-
if (a[n[1]] =
|
|
1541
|
+
if (n = We.exec(r)) {
|
|
1542
|
+
var o = Zt(Ue(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
|
|
1543
|
+
if (a[n[1]] = o, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
|
|
1537
1544
|
throw new Error("Attribute error");
|
|
1538
1545
|
}
|
|
1539
1546
|
while (n && r.length);
|
|
@@ -1542,8 +1549,8 @@ var Hr = { exports: {} };
|
|
|
1542
1549
|
}
|
|
1543
1550
|
return a;
|
|
1544
1551
|
}
|
|
1545
|
-
const
|
|
1546
|
-
var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/,
|
|
1552
|
+
const bt = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
|
|
1553
|
+
var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, Ve = /^\\([&{}$%#_])/, qe = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, W = { bf: function(r) {
|
|
1547
1554
|
r.weight = "bold";
|
|
1548
1555
|
}, it: function(r) {
|
|
1549
1556
|
r.style = "italic";
|
|
@@ -1558,23 +1565,23 @@ var Hr = { exports: {} };
|
|
|
1558
1565
|
}, _: function(r) {
|
|
1559
1566
|
r.sub = !0;
|
|
1560
1567
|
}, par: function(r) {
|
|
1561
|
-
this.tokens.push(new
|
|
1568
|
+
this.tokens.push(new X(), new X());
|
|
1562
1569
|
}, newline: function(r) {
|
|
1563
|
-
this.tokens.push(new
|
|
1570
|
+
this.tokens.push(new X());
|
|
1564
1571
|
}, url: function(r, n) {
|
|
1565
|
-
this.open_context().href = n, this.add_token(new
|
|
1572
|
+
this.open_context().href = n, this.add_token(new z(n)), this.close_context();
|
|
1566
1573
|
} };
|
|
1567
|
-
|
|
1568
|
-
var
|
|
1574
|
+
W.textsuperscript = W["^"], W.textsubscript = W._, W.textsl = W.sl, W.mathbf = W.bf, W.mathit = W.it, W.textbf = W.bf, W.textit = W.it, W.textcolor = W.color;
|
|
1575
|
+
var Ye = /[\r\n\xA0]+/g;
|
|
1569
1576
|
function Ae(r, n) {
|
|
1570
1577
|
r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
|
|
1571
1578
|
var a = n;
|
|
1572
|
-
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a =
|
|
1579
|
+
return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = R(n, r)), a;
|
|
1573
1580
|
}
|
|
1574
|
-
function
|
|
1575
|
-
for (var
|
|
1576
|
-
|
|
1577
|
-
r[r.length - 1] instanceof ut && r.pop(),
|
|
1581
|
+
function te(r, n, a) {
|
|
1582
|
+
for (var o, t, u = r.width; u + a.width > n && r.length; )
|
|
1583
|
+
t = (o = r[r.length - 1]).width, o.width > a.width ? (o.value = o.value.slice(0, -1), o.width = H(o, o.font), u += o.width) : r.pop(), u -= t;
|
|
1584
|
+
r[r.length - 1] instanceof ut && r.pop(), o = r[r.length - 1] || o || {}, a.font = R(a.font, o.bold, o.italic, ""), a.href = r.length ? o.href : null, a.rel = r.length ? o.rel : null, a.target = r.length ? o.target : null, r.push(a);
|
|
1578
1585
|
}
|
|
1579
1586
|
function ot(r) {
|
|
1580
1587
|
return Math.round(1e6 * r) / 1e6;
|
|
@@ -1582,92 +1589,92 @@ var Hr = { exports: {} };
|
|
|
1582
1589
|
function Ee(r) {
|
|
1583
1590
|
return function(n) {
|
|
1584
1591
|
if (Array.isArray(n))
|
|
1585
|
-
return
|
|
1592
|
+
return jt(n);
|
|
1586
1593
|
}(r) || function(n) {
|
|
1587
1594
|
if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
|
|
1588
1595
|
return Array.from(n);
|
|
1589
1596
|
}(r) || function(n, a) {
|
|
1590
1597
|
if (n) {
|
|
1591
1598
|
if (typeof n == "string")
|
|
1592
|
-
return
|
|
1593
|
-
var
|
|
1594
|
-
return
|
|
1599
|
+
return jt(n, a);
|
|
1600
|
+
var o = Object.prototype.toString.call(n).slice(8, -1);
|
|
1601
|
+
return o === "Object" && n.constructor && (o = n.constructor.name), o === "Map" || o === "Set" ? Array.from(n) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? jt(n, a) : void 0;
|
|
1595
1602
|
}
|
|
1596
1603
|
}(r) || function() {
|
|
1597
1604
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1598
1605
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1599
1606
|
}();
|
|
1600
1607
|
}
|
|
1601
|
-
function
|
|
1608
|
+
function jt(r, n) {
|
|
1602
1609
|
(n == null || n > r.length) && (n = r.length);
|
|
1603
|
-
for (var a = 0,
|
|
1604
|
-
|
|
1605
|
-
return
|
|
1610
|
+
for (var a = 0, o = new Array(n); a < n; a++)
|
|
1611
|
+
o[a] = r[a];
|
|
1612
|
+
return o;
|
|
1606
1613
|
}
|
|
1607
|
-
var _e = { center: "middle", right: "end" },
|
|
1614
|
+
var _e = { center: "middle", right: "end" }, ee = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, re = function(r, n) {
|
|
1608
1615
|
return !r && !n || r === n;
|
|
1609
1616
|
};
|
|
1610
|
-
function
|
|
1611
|
-
var a = [],
|
|
1617
|
+
function Ge(r, n) {
|
|
1618
|
+
var a = [], o = n.font(), t = o.size, u = o.family, d = n.align(), p = n.createElement();
|
|
1612
1619
|
if (r.length) {
|
|
1613
|
-
var
|
|
1614
|
-
if (
|
|
1615
|
-
var M =
|
|
1616
|
-
|
|
1620
|
+
var b = o.height, w = n.valign(), A = n.height()(), E = n.width()(0), O = !isFinite(E) && r.length === 1, P = O ? null : n.x(), I = ot(b / t), B = O ? null : ot(b / (1.15 * t + (b - t) / 2));
|
|
1621
|
+
if (ee[w] && isFinite(A)) {
|
|
1622
|
+
var M = w === "bottom" ? 1 : 0.5;
|
|
1623
|
+
B += (A * M - b * r.length * M) / t;
|
|
1617
1624
|
}
|
|
1618
|
-
var
|
|
1619
|
-
|
|
1620
|
-
for (var
|
|
1625
|
+
var F = d === "justify", $ = 0;
|
|
1626
|
+
d === "right" ? $ = E : d === "center" && ($ = E / 2);
|
|
1627
|
+
for (var N = [], K = "tspan", G = null, V = "", j = function() {
|
|
1621
1628
|
if (V) {
|
|
1622
|
-
var Tt =
|
|
1623
|
-
|
|
1629
|
+
var Tt = p(K, G, V);
|
|
1630
|
+
N.push(Tt);
|
|
1624
1631
|
}
|
|
1625
|
-
|
|
1632
|
+
K = "tspan", G = null, V = "";
|
|
1626
1633
|
}, nt = 0, rt = r.length; nt < rt; nt++) {
|
|
1627
|
-
var ft = "",
|
|
1634
|
+
var ft = "", wt = "", ct = 0, gt = r[nt];
|
|
1628
1635
|
if (gt.length) {
|
|
1629
|
-
|
|
1630
|
-
for (var Mt = 0,
|
|
1631
|
-
var q = gt[Z],
|
|
1632
|
-
q.whitespace && Mt++,
|
|
1636
|
+
N = [];
|
|
1637
|
+
for (var Mt = 0, ae = 0, pt = void 0, Z = 0, Re = gt.length; Z < Re; Z++) {
|
|
1638
|
+
var q = gt[Z], Q = q.font;
|
|
1639
|
+
q.whitespace && Mt++, ae += q.width, Z && !q.tracking && !ct && re(Q.id, ft) && re(q.class, wt) && re(pt, q.href) ? V += q.value : (j(), V = q.value, G = { fontFamily: Q.family !== u ? Q.family : null, fontSize: Q.size !== t ? Q.size : null, fontWeight: Q.weight || null, fontStyle: Q.style || null, fontVariant: Q.variant !== "normal" && Q.variant || null, fill: Q.color || null, baselineShift: Q.baseline ? 100 * Q.baseline + "%" : null, className: q.class || null }, ct && (G.dx = ot(ct), ct = 0), q.tracking && (ct = Q.size * q.tracking), q.href && !pt ? (pt = q.href, K = "a", G.href = pt, G.rel = q.rel, G.target = q.target) : pt = null, ft = Q.id, wt = q.class);
|
|
1633
1640
|
}
|
|
1634
|
-
if (
|
|
1635
|
-
a.push.apply(a, Ee(
|
|
1641
|
+
if (j(), O)
|
|
1642
|
+
a.push.apply(a, Ee(N));
|
|
1636
1643
|
else {
|
|
1637
|
-
var
|
|
1638
|
-
|
|
1644
|
+
var Ie = null, le = nt === rt - 1 || gt[gt.length - 1] instanceof X;
|
|
1645
|
+
F && gt.length > 1 && !le && (Ie = ot((E - ae) / Mt)), a.push(p.apply(void 0, ["tspan", { wordSpacing: Ie, x: P(nt) + $, dy: ot(nt ? I : B) + "em" }].concat(Ee(N))));
|
|
1639
1646
|
}
|
|
1640
1647
|
} else
|
|
1641
|
-
a.push(
|
|
1648
|
+
a.push(p("tspan", { x: P(nt), dy: ot(nt ? I : B) + "em" }, " "));
|
|
1642
1649
|
}
|
|
1643
1650
|
}
|
|
1644
|
-
return
|
|
1651
|
+
return p.apply(void 0, ["text", { fontFamily: u, fontSize: t, textAnchor: _e[d] || "start" }].concat(a));
|
|
1645
1652
|
}
|
|
1646
|
-
var
|
|
1647
|
-
function
|
|
1653
|
+
var Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
|
|
1654
|
+
function Je(r, n, a) {
|
|
1648
1655
|
if (r.length) {
|
|
1649
1656
|
a.textBaseline = "middle";
|
|
1650
|
-
var
|
|
1651
|
-
if (
|
|
1652
|
-
var
|
|
1653
|
-
|
|
1657
|
+
var o = n.font(), t = o.height, u = o.size, d = n.valign(), p = n.height()(), b = n.width()(0), w = n.align(), A = w === "justify", E = 0.5 * t, O = Xe[d];
|
|
1658
|
+
if (O && isFinite(p)) {
|
|
1659
|
+
var P = r.length * t;
|
|
1660
|
+
E += p * O - P * O;
|
|
1654
1661
|
}
|
|
1655
|
-
r.forEach(function(
|
|
1656
|
-
var M = n.x()(
|
|
1657
|
-
|
|
1658
|
-
V.whitespace &&
|
|
1662
|
+
r.forEach(function(I, B) {
|
|
1663
|
+
var M = n.x()(B), F = B * t + E, $ = 0, N = 0;
|
|
1664
|
+
I.forEach(function(V) {
|
|
1665
|
+
V.whitespace && $++, N += V.width;
|
|
1659
1666
|
});
|
|
1660
|
-
var
|
|
1661
|
-
A &&
|
|
1667
|
+
var K = 0, G = B === r.length - 1 || I[I.length - 1] instanceof X;
|
|
1668
|
+
A && I.length > 1 && !G && (K = (b - N) / $), I.forEach(function(V) {
|
|
1662
1669
|
a.font = V.font;
|
|
1663
|
-
var
|
|
1664
|
-
a.fillStyle = function(
|
|
1665
|
-
return
|
|
1666
|
-
}(
|
|
1670
|
+
var j = V.font, nt = j.baseline ? u * -j.baseline + 0.15 * u : 0;
|
|
1671
|
+
a.fillStyle = function(wt, ct) {
|
|
1672
|
+
return wt.color ? wt.color : ct.href ? "#00C" : "#000";
|
|
1673
|
+
}(j, V);
|
|
1667
1674
|
var rt = 0;
|
|
1668
|
-
if (
|
|
1675
|
+
if (w === "right" ? rt += b - N : w === "center" ? rt += b / 2 - N / 2 : w === "justify" && (V.whitespace || V instanceof X) && (M += K), a.fillText(V.value, M + rt, F + nt), V.href) {
|
|
1669
1676
|
a.beginPath(), a.strokeStyle = a.fillStyle;
|
|
1670
|
-
var ft = Math.floor(
|
|
1677
|
+
var ft = Math.floor(F + 0.45 * u) + 0.5;
|
|
1671
1678
|
a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
|
|
1672
1679
|
}
|
|
1673
1680
|
M += V.width;
|
|
@@ -1675,17 +1682,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1675
1682
|
});
|
|
1676
1683
|
}
|
|
1677
1684
|
}
|
|
1678
|
-
function
|
|
1679
|
-
return
|
|
1685
|
+
function ne(r) {
|
|
1686
|
+
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
1680
1687
|
return typeof n;
|
|
1681
1688
|
} : function(n) {
|
|
1682
1689
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1683
|
-
},
|
|
1690
|
+
}, ne(r);
|
|
1684
1691
|
}
|
|
1685
1692
|
function ke(r) {
|
|
1686
1693
|
for (var n = {}, a = 0; a < r.length; a++) {
|
|
1687
|
-
var
|
|
1688
|
-
typeof
|
|
1694
|
+
var o = r[a];
|
|
1695
|
+
typeof o != "number" && o != null && (typeof o == "string" ? n.text = o : typeof o == "function" ? n.fn = o : ne(o) === "object" && o._groups ? n.d3 = o : o && o.nodeType && o.getContext ? n.ctx = o.getContext("2d") : o && o.fillText && o.beginPath ? n.ctx = o : o && (n.text = o));
|
|
1689
1696
|
}
|
|
1690
1697
|
return n;
|
|
1691
1698
|
}
|
|
@@ -1696,32 +1703,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1696
1703
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1697
1704
|
}, kt(r);
|
|
1698
1705
|
}
|
|
1699
|
-
function
|
|
1706
|
+
function ie(r, n) {
|
|
1700
1707
|
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
|
|
1708
|
+
var o = n[a];
|
|
1709
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
|
|
1710
|
+
if (kt(u) !== "object" || u === null)
|
|
1711
|
+
return u;
|
|
1712
|
+
var p = u[Symbol.toPrimitive];
|
|
1713
|
+
if (p !== void 0) {
|
|
1714
|
+
var b = p.call(u, d);
|
|
1715
|
+
if (kt(b) !== "object")
|
|
1716
|
+
return b;
|
|
1710
1717
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1711
1718
|
}
|
|
1712
|
-
return String(
|
|
1713
|
-
}(
|
|
1719
|
+
return String(u);
|
|
1720
|
+
}(o.key, "string"), kt(t) === "symbol" ? t : String(t)), o);
|
|
1714
1721
|
}
|
|
1715
|
-
var
|
|
1722
|
+
var t;
|
|
1716
1723
|
}
|
|
1717
|
-
var Te =
|
|
1724
|
+
var Te = R(), ht = function(r) {
|
|
1718
1725
|
return typeof r == "function" ? r : function() {
|
|
1719
1726
|
return r;
|
|
1720
1727
|
};
|
|
1721
|
-
},
|
|
1722
|
-
function r(
|
|
1723
|
-
if (function(
|
|
1724
|
-
if (!(
|
|
1728
|
+
}, J = function() {
|
|
1729
|
+
function r(o) {
|
|
1730
|
+
if (function(u, d) {
|
|
1731
|
+
if (!(u instanceof d))
|
|
1725
1732
|
throw new TypeError("Cannot call a class as a function");
|
|
1726
1733
|
}(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
|
|
1727
1734
|
return 1 / 0;
|
|
@@ -1729,124 +1736,124 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1729
1736
|
return 1 / 0;
|
|
1730
1737
|
}, x: function() {
|
|
1731
1738
|
return 0;
|
|
1732
|
-
}, font: null, tAnchor: 0, parser: r.defaultparser },
|
|
1733
|
-
for (var
|
|
1734
|
-
typeof this[
|
|
1739
|
+
}, font: null, tAnchor: 0, parser: r.defaultparser }, o)
|
|
1740
|
+
for (var t in o)
|
|
1741
|
+
typeof this[t] == "function" && this[t](o[t]);
|
|
1735
1742
|
}
|
|
1736
1743
|
var n, a;
|
|
1737
|
-
return n = r, a = [{ key: "linebreak", value: function(
|
|
1738
|
-
var
|
|
1739
|
-
if (!
|
|
1744
|
+
return n = r, a = [{ key: "linebreak", value: function(o) {
|
|
1745
|
+
var t = this, u = this.props.parser(String(o)), d = this.font(), p = function(b, w, A) {
|
|
1746
|
+
if (!b.length)
|
|
1740
1747
|
return [];
|
|
1741
|
-
var
|
|
1742
|
-
if (!
|
|
1748
|
+
var E = w.height(), O = w.width(), P = w.overflowLine(), I = w.overflowWrap(), B = R(A, !0, !1), M = isFinite(E()) ? Math.floor(E() / A.height) : 1 / 0;
|
|
1749
|
+
if (!E() && !O(0) || !M)
|
|
1743
1750
|
return [];
|
|
1744
|
-
for (var
|
|
1745
|
-
var
|
|
1746
|
-
if (
|
|
1747
|
-
if (
|
|
1748
|
-
|
|
1749
|
-
else if (
|
|
1750
|
-
|
|
1751
|
-
else if (
|
|
1752
|
-
|
|
1753
|
-
else if (
|
|
1751
|
+
for (var F = 0, $ = 0, N = 0, K = [], G = [], V = !1; F < b.length && $ < M; ) {
|
|
1752
|
+
var j = b[F], nt = Ae(j, A);
|
|
1753
|
+
if (j.width = H(j, nt), j.font = nt, j.line = $, j.whitespace = j.value in S, j.value && (j.value = j.value.replace(Ye, " ")), !(!N && j.whitespace || V && j.whitespace))
|
|
1754
|
+
if (j instanceof X)
|
|
1755
|
+
N = 0, G = [], K.push(F + 1), $++;
|
|
1756
|
+
else if (j instanceof lt || j instanceof ut)
|
|
1757
|
+
G.push({ index: F, width: N });
|
|
1758
|
+
else if (j.whitespace || N + j.width < O($))
|
|
1759
|
+
N += j.width;
|
|
1760
|
+
else if (G.length) {
|
|
1754
1761
|
var rt = void 0, ft = void 0;
|
|
1755
1762
|
do {
|
|
1756
|
-
ft = !0, rt =
|
|
1757
|
-
var
|
|
1758
|
-
|
|
1763
|
+
ft = !0, rt = G.pop();
|
|
1764
|
+
var wt = b[rt.index], ct = void 0;
|
|
1765
|
+
wt instanceof ut && (ct = H("-", wt.font), rt.width + ct > O($) && (ft = !G.length));
|
|
1759
1766
|
} while (!ft);
|
|
1760
|
-
|
|
1761
|
-
} else if (
|
|
1762
|
-
var gt =
|
|
1763
|
-
if (
|
|
1764
|
-
var Mt =
|
|
1767
|
+
K.push(rt.index + 1), N = 0, $++, F = rt.index, G = [];
|
|
1768
|
+
} else if (I === "break-word") {
|
|
1769
|
+
var gt = O($);
|
|
1770
|
+
if (N + j.width > gt) {
|
|
1771
|
+
var Mt = j.clone();
|
|
1765
1772
|
do
|
|
1766
|
-
|
|
1767
|
-
while (
|
|
1768
|
-
Mt.value = Mt.value.slice(
|
|
1773
|
+
j.value = j.value.slice(0, -1), j.width = H(j, j.font), N += j.width;
|
|
1774
|
+
while (j.value && j.width > gt);
|
|
1775
|
+
Mt.value = Mt.value.slice(j.value.length), b.splice(F + 1, 0, new lt(), Mt);
|
|
1769
1776
|
}
|
|
1770
|
-
|
|
1777
|
+
K.push(F + 1), N = 0, $++;
|
|
1771
1778
|
} else
|
|
1772
|
-
|
|
1773
|
-
|
|
1779
|
+
N += j.width;
|
|
1780
|
+
F++, V = j.whitespace;
|
|
1774
1781
|
}
|
|
1775
|
-
|
|
1776
|
-
var
|
|
1777
|
-
for (var
|
|
1782
|
+
F !== K[K.length - 1] && K.push(F);
|
|
1783
|
+
var ae = 0, pt = 0, Z = K.map(function(Tt) {
|
|
1784
|
+
for (var et, St = ae; (et = b[St]) && (et.whitespace || !et.value); )
|
|
1778
1785
|
St++;
|
|
1779
|
-
for (var
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
var zt =
|
|
1786
|
+
for (var xt = Tt, Qe = null; xt > St && (et = b[xt - 1]) && (et.whitespace || !(et.value || et instanceof ut)); )
|
|
1787
|
+
et instanceof X && (Qe = et), xt--;
|
|
1788
|
+
et instanceof ut && (et.value = "-", et.width = H("-", et.font)), ae = Tt;
|
|
1789
|
+
var zt = b.slice(St, xt).filter(function(tr) {
|
|
1783
1790
|
return tr.value;
|
|
1784
1791
|
});
|
|
1785
1792
|
return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
|
|
1786
1793
|
return tr + Vr.width;
|
|
1787
1794
|
}, 0), zt.width > pt && (pt = zt.width), zt;
|
|
1788
1795
|
});
|
|
1789
|
-
if (Z.hasLineOverflow = !1,
|
|
1790
|
-
var
|
|
1791
|
-
Z.forEach(function(Tt,
|
|
1792
|
-
var St =
|
|
1796
|
+
if (Z.hasLineOverflow = !1, P) {
|
|
1797
|
+
var Re = P === "ellipsis" ? "…" : P;
|
|
1798
|
+
Z.forEach(function(Tt, et) {
|
|
1799
|
+
var St = O(et);
|
|
1793
1800
|
if (Tt.width > St) {
|
|
1794
|
-
var
|
|
1795
|
-
|
|
1801
|
+
var xt = new z(Re);
|
|
1802
|
+
xt.font = A, xt.width = H(Re, B), te(Tt, St, xt), Z.hasLineOverflow = !0;
|
|
1796
1803
|
}
|
|
1797
1804
|
});
|
|
1798
1805
|
}
|
|
1799
|
-
var q =
|
|
1800
|
-
if (q &&
|
|
1801
|
-
var
|
|
1802
|
-
|
|
1806
|
+
var q = w.overflow() === "ellipsis" ? "…" : w.overflow();
|
|
1807
|
+
if (q && F !== b.length) {
|
|
1808
|
+
var Q = O(Z.length - 1), Ie = Z[Z.length - 1], le = new z(q);
|
|
1809
|
+
le.font = A, le.width = H(q, B), te(Ie, Q, le), Z.hasOverflow = !0;
|
|
1803
1810
|
} else
|
|
1804
1811
|
Z.hasOverflow = !1;
|
|
1805
1812
|
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(
|
|
1813
|
+
}(u, this, d);
|
|
1814
|
+
return p.height = p.length * d.height, p.render = function(b) {
|
|
1815
|
+
return t.render(p, b);
|
|
1816
|
+
}, p.svg = p.render, p.draw = p.render, p;
|
|
1817
|
+
} }, { key: "font", value: function(o) {
|
|
1818
|
+
return arguments.length ? (this.props.font = R(o), this) : this.props.font || R(Te);
|
|
1819
|
+
} }, { key: "overflow", value: function(o) {
|
|
1820
|
+
return arguments.length ? (this.props.overflow = String(o), this) : this.props.overflow;
|
|
1821
|
+
} }, { key: "overflowLine", value: function(o) {
|
|
1822
|
+
return arguments.length ? (this.props.lineclamp = String(o), this) : this.props.lineclamp;
|
|
1823
|
+
} }, { key: "valign", value: function(o) {
|
|
1824
|
+
return arguments.length ? (this.props.valign = o, this) : this.props.valign;
|
|
1825
|
+
} }, { key: "align", value: function(o) {
|
|
1819
1826
|
if (!arguments.length)
|
|
1820
1827
|
return this.props.align;
|
|
1821
|
-
var
|
|
1822
|
-
return
|
|
1823
|
-
} }, { key: "overflowWrap", value: function(
|
|
1828
|
+
var t = String(o).toLowerCase();
|
|
1829
|
+
return t === "left" || t === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : t === "center" || t === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : t === "end" || t === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : t === "justify" && (this.props.align = o, this.props.tAnchor = 0), this;
|
|
1830
|
+
} }, { key: "overflowWrap", value: function(o) {
|
|
1824
1831
|
if (!arguments.length)
|
|
1825
1832
|
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(
|
|
1833
|
+
var t = String(o).toLowerCase();
|
|
1834
|
+
return t === "break-word" ? this.props.overflowWrap = "break-word" : t !== "normal" && o != null || (this.props.overflowWrap = null), this;
|
|
1835
|
+
} }, { key: "width", value: function(o) {
|
|
1836
|
+
return arguments.length ? (this.props.width = ht(o), this) : this.props.width;
|
|
1837
|
+
} }, { key: "height", value: function(o) {
|
|
1838
|
+
return arguments.length ? (this.props.height = ht(o), this) : this.props.height;
|
|
1839
|
+
} }, { key: "x", value: function(o) {
|
|
1840
|
+
return arguments.length ? (this.props.x = ht(o), this) : this.props.x;
|
|
1841
|
+
} }, { key: "parser", value: function(o) {
|
|
1835
1842
|
if (!arguments.length)
|
|
1836
1843
|
return this.props.parser;
|
|
1837
|
-
if (typeof
|
|
1838
|
-
var
|
|
1839
|
-
typeof
|
|
1844
|
+
if (typeof o == "string") {
|
|
1845
|
+
var t = r[o] || r[o + "parser"];
|
|
1846
|
+
typeof t == "function" && (o = t);
|
|
1840
1847
|
}
|
|
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 =
|
|
1848
|
+
if (typeof o != "function")
|
|
1849
|
+
throw new Error("Unknown parser: " + o);
|
|
1850
|
+
return this.props.parser = o, this;
|
|
1851
|
+
} }, { key: "createElement", value: function(o) {
|
|
1852
|
+
return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
|
|
1846
1853
|
} }, { key: "render", value: function() {
|
|
1847
|
-
var
|
|
1848
|
-
return typeof
|
|
1849
|
-
} }], a &&
|
|
1854
|
+
var o = ke(arguments);
|
|
1855
|
+
return typeof o.text == "string" && (o.text = this.linebreak(o.text)), o.ctx ? Je(o.text, this, o.ctx) : Ge(o.text, this);
|
|
1856
|
+
} }], a && ie(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
1850
1857
|
}();
|
|
1851
1858
|
function dt(r) {
|
|
1852
1859
|
return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
@@ -1855,102 +1862,102 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1855
1862
|
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
1856
1863
|
}, dt(r);
|
|
1857
1864
|
}
|
|
1858
|
-
function
|
|
1865
|
+
function $t(r, n) {
|
|
1859
1866
|
(n == null || n > r.length) && (n = r.length);
|
|
1860
|
-
for (var a = 0,
|
|
1861
|
-
|
|
1862
|
-
return
|
|
1867
|
+
for (var a = 0, o = new Array(n); a < n; a++)
|
|
1868
|
+
o[a] = r[a];
|
|
1869
|
+
return o;
|
|
1863
1870
|
}
|
|
1864
|
-
function
|
|
1871
|
+
function Ke(r, n) {
|
|
1865
1872
|
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
|
|
1873
|
+
var o = n[a];
|
|
1874
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
|
|
1875
|
+
if (dt(u) !== "object" || u === null)
|
|
1876
|
+
return u;
|
|
1877
|
+
var p = u[Symbol.toPrimitive];
|
|
1878
|
+
if (p !== void 0) {
|
|
1879
|
+
var b = p.call(u, d);
|
|
1880
|
+
if (dt(b) !== "object")
|
|
1881
|
+
return b;
|
|
1875
1882
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1876
1883
|
}
|
|
1877
|
-
return String(
|
|
1878
|
-
}(
|
|
1884
|
+
return String(u);
|
|
1885
|
+
}(o.key, "string"), dt(t) === "symbol" ? t : String(t)), o);
|
|
1879
1886
|
}
|
|
1880
|
-
var
|
|
1887
|
+
var t;
|
|
1881
1888
|
}
|
|
1882
|
-
var
|
|
1889
|
+
var oe = function(r) {
|
|
1883
1890
|
return typeof r == "function" ? r : function() {
|
|
1884
1891
|
return r;
|
|
1885
1892
|
};
|
|
1886
1893
|
}, Se = function() {
|
|
1887
|
-
function r(
|
|
1888
|
-
if (function(
|
|
1889
|
-
if (!(
|
|
1894
|
+
function r(o) {
|
|
1895
|
+
if (function(u, d) {
|
|
1896
|
+
if (!(u instanceof d))
|
|
1890
1897
|
throw new TypeError("Cannot call a class as a function");
|
|
1891
1898
|
}(this, r), this.props = { width: function() {
|
|
1892
1899
|
return 1 / 0;
|
|
1893
1900
|
}, height: function() {
|
|
1894
1901
|
return 1 / 0;
|
|
1895
|
-
}, rotation: 0, vAnchor: 0, hAnchor: 0 },
|
|
1896
|
-
for (var
|
|
1897
|
-
typeof this[
|
|
1902
|
+
}, rotation: 0, vAnchor: 0, hAnchor: 0 }, o)
|
|
1903
|
+
for (var t in o)
|
|
1904
|
+
typeof this[t] == "function" && this[t](o[t]);
|
|
1898
1905
|
this.render = this.render.bind(this);
|
|
1899
1906
|
}
|
|
1900
1907
|
var n, a;
|
|
1901
|
-
return n = r, a = [{ key: "anchor", value: function(
|
|
1902
|
-
var
|
|
1908
|
+
return n = r, a = [{ key: "anchor", value: function(o) {
|
|
1909
|
+
var t = this.props, u = t.hAnchor, d = t.vAnchor, p = t.width, b = t.height;
|
|
1903
1910
|
if (!arguments.length)
|
|
1904
|
-
return [
|
|
1905
|
-
if (typeof
|
|
1906
|
-
var
|
|
1907
|
-
|
|
1908
|
-
A === "top" && (
|
|
1911
|
+
return [u * p(0), d * b(0)];
|
|
1912
|
+
if (typeof o == "string") {
|
|
1913
|
+
var w = this.props;
|
|
1914
|
+
o.toLowerCase().trim().split(/\s+/).forEach(function(A) {
|
|
1915
|
+
A === "top" && (w.vAnchor = -0), A === "middle" && (w.vAnchor = -0.5), A === "bottom" && (w.vAnchor = -1), A === "left" && (w.hAnchor = -0), A === "center" && (w.hAnchor = -0.5), A === "right" && (w.hAnchor = -1);
|
|
1909
1916
|
});
|
|
1910
1917
|
}
|
|
1911
1918
|
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
|
|
1919
|
+
} }, { key: "width", value: function(o) {
|
|
1920
|
+
return arguments.length ? (this.props.width = oe(o), this) : this.props.width;
|
|
1921
|
+
} }, { key: "height", value: function(o) {
|
|
1922
|
+
return arguments.length ? (this.props.height = oe(o), this) : this.props.height;
|
|
1923
|
+
} }, { key: "rotate", value: function(o) {
|
|
1924
|
+
return arguments.length ? (this.props.rotation = o, this) : this.props.rotation;
|
|
1925
|
+
} }, { key: "createElement", value: function(o) {
|
|
1926
|
+
return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
|
|
1927
|
+
} }, { key: "canvas", value: function(o, t) {
|
|
1928
|
+
var u, d = o.getContext ? o.getContext("2d") : o;
|
|
1929
|
+
return d.save(), d.rotate(this.rotate() * Math.PI / 180), d.translate.apply(d, function(p) {
|
|
1930
|
+
if (Array.isArray(p))
|
|
1931
|
+
return $t(p);
|
|
1932
|
+
}(u = this.anchor()) || function(p) {
|
|
1933
|
+
if (typeof Symbol < "u" && p[Symbol.iterator] != null || p["@@iterator"] != null)
|
|
1934
|
+
return Array.from(p);
|
|
1935
|
+
}(u) || function(p, b) {
|
|
1936
|
+
if (p) {
|
|
1937
|
+
if (typeof p == "string")
|
|
1938
|
+
return $t(p, b);
|
|
1939
|
+
var w = Object.prototype.toString.call(p).slice(8, -1);
|
|
1940
|
+
return w === "Object" && p.constructor && (w = p.constructor.name), w === "Map" || w === "Set" ? Array.from(p) : w === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w) ? $t(p, b) : void 0;
|
|
1934
1941
|
}
|
|
1935
|
-
}(
|
|
1942
|
+
}(u) || function() {
|
|
1936
1943
|
throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1937
1944
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1938
|
-
}()),
|
|
1945
|
+
}()), t(d), d.restore(), d;
|
|
1939
1946
|
} }, { 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(), ")") },
|
|
1947
|
+
var o = ke(arguments);
|
|
1948
|
+
if (o.d3)
|
|
1949
|
+
return o.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
|
|
1950
|
+
if (o.ctx)
|
|
1951
|
+
return this.canvas(o.ctx, o.fn);
|
|
1952
|
+
if (o.text) {
|
|
1953
|
+
var t = typeof o.text.render == "function" ? o.text.render() : o.text;
|
|
1954
|
+
return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, t);
|
|
1948
1955
|
}
|
|
1949
|
-
} }], a &&
|
|
1956
|
+
} }], a && Ke(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
|
|
1950
1957
|
}(), Ce = Object.prototype.hasOwnProperty, Dt = {};
|
|
1951
1958
|
function Ze(r) {
|
|
1952
|
-
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a,
|
|
1953
|
-
return a + "-" +
|
|
1959
|
+
return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, o) {
|
|
1960
|
+
return a + "-" + o.toLowerCase();
|
|
1954
1961
|
})), Dt[r];
|
|
1955
1962
|
}
|
|
1956
1963
|
function Oe(r, n) {
|
|
@@ -1960,144 +1967,144 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1960
1967
|
});
|
|
1961
1968
|
typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
|
|
1962
1969
|
}
|
|
1963
|
-
function
|
|
1970
|
+
function se(r, n) {
|
|
1964
1971
|
if (typeof document < "u") {
|
|
1965
1972
|
var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
|
|
1966
1973
|
if (n && a.setAttribute)
|
|
1967
|
-
for (var
|
|
1968
|
-
Ce.call(n,
|
|
1969
|
-
for (var
|
|
1970
|
-
|
|
1971
|
-
return
|
|
1972
|
-
Oe(a,
|
|
1974
|
+
for (var o in n)
|
|
1975
|
+
Ce.call(n, o) && n[o] != null && a.setAttribute(o === "className" ? "class" : Ze(o), n[o]);
|
|
1976
|
+
for (var t = arguments.length, u = new Array(t > 2 ? t - 2 : 0), d = 2; d < t; d++)
|
|
1977
|
+
u[d - 2] = arguments[d];
|
|
1978
|
+
return u != null && u.length && u.forEach(function(p) {
|
|
1979
|
+
Oe(a, p);
|
|
1973
1980
|
}), a;
|
|
1974
1981
|
}
|
|
1975
1982
|
}
|
|
1976
|
-
|
|
1983
|
+
J.createElement = se, J.textparser = Et, J.defaultparser = Et, J.htmlparser = function(r) {
|
|
1977
1984
|
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
|
-
|
|
1985
|
+
for (var n, a, o = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, t = [], u = [], d = function(E) {
|
|
1986
|
+
for (var O in o)
|
|
1987
|
+
o[O] && (E[O] = o[O]);
|
|
1988
|
+
t.push(E);
|
|
1989
|
+
}, p = function(E) {
|
|
1990
|
+
var O = t.length, P = He[E];
|
|
1991
|
+
if (O && P) {
|
|
1992
|
+
for (var I = O - 1; t[I] && (t[I] instanceof lt || Be.test(t[I].value)); )
|
|
1993
|
+
I--;
|
|
1994
|
+
for (; P && t[I] && t[I] instanceof X; )
|
|
1995
|
+
I--, P--;
|
|
1996
|
+
for (; P-- > 0; )
|
|
1997
|
+
t.push(new X());
|
|
1991
1998
|
}
|
|
1992
1999
|
}; r.length; ) {
|
|
1993
2000
|
if (n = /^[^<]+/.exec(r))
|
|
1994
|
-
|
|
2001
|
+
Et(Zt(n[0]), !1).forEach(d);
|
|
1995
2002
|
else if (!(n = It.exec(r)))
|
|
1996
|
-
if (n =
|
|
1997
|
-
|
|
1998
|
-
else if (n =
|
|
1999
|
-
var
|
|
2000
|
-
|
|
2001
|
-
var
|
|
2002
|
-
|
|
2003
|
+
if (n = Xt.exec(r))
|
|
2004
|
+
u.length && (o = u.pop()), p(n[1]);
|
|
2005
|
+
else if (n = Jt.exec(r)) {
|
|
2006
|
+
var b = n[1];
|
|
2007
|
+
p(b), u.push(o), o = Object.create(o), _t[b] && _t[b](o, "");
|
|
2008
|
+
var w = Lt(n[2]);
|
|
2009
|
+
b === "a" && (w.href && (o.href = w.href), w.rel && (o.rel = w.rel), w.target && (o.target = w.target)), w.class && (o.class = o.class ? o.class + " " + w.class : w.class), w.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(w.style)) && a[1] && (o.color = a[1]), b === "br" && t.push(new X());
|
|
2003
2010
|
} else
|
|
2004
|
-
n = [r.slice(0, 1)],
|
|
2011
|
+
n = [r.slice(0, 1)], d(new z(n[0]));
|
|
2005
2012
|
r = r.slice(n[0].length);
|
|
2006
2013
|
}
|
|
2007
|
-
for (var A =
|
|
2008
|
-
|
|
2009
|
-
return
|
|
2010
|
-
},
|
|
2014
|
+
for (var A = t[t.length - 1]; A instanceof X; )
|
|
2015
|
+
t.pop(), A = t[t.length - 1];
|
|
2016
|
+
return t;
|
|
2017
|
+
}, J.latexparser = function(r) {
|
|
2011
2018
|
r = String(r || "").trim();
|
|
2012
2019
|
var n = [0];
|
|
2013
|
-
r = r.replace(/\\verb,(.*?),/, function(M,
|
|
2014
|
-
return n.push(
|
|
2020
|
+
r = r.replace(/\\verb,(.*?),/, function(M, F) {
|
|
2021
|
+
return n.push(F), "\\verb," + (n.length - 1) + ",";
|
|
2015
2022
|
}).replace(/\\\\\n/g, function() {
|
|
2016
2023
|
return "\\\\";
|
|
2017
|
-
}).replace(
|
|
2018
|
-
return
|
|
2024
|
+
}).replace(qe, function(M, F, $) {
|
|
2025
|
+
return $.charAt(F - 1) === "\\" ? M : Qt[M];
|
|
2019
2026
|
}).replace(/\n\s+/g, function(M) {
|
|
2020
2027
|
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[+
|
|
2028
|
+
}).replace(/\\symbol\{(\d+)\}/, function(M, F, $, N) {
|
|
2029
|
+
return N.charAt($ - 1) === "\\" ? M : String.fromCharCode(1 * F);
|
|
2030
|
+
}).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, F, $, N) {
|
|
2031
|
+
return F + $ + "{" + N + "}";
|
|
2032
|
+
}).replace(/\\verb,(.*?),/, function(M, F) {
|
|
2033
|
+
return "\\verb,".concat(n[+F], ",");
|
|
2027
2034
|
});
|
|
2028
|
-
for (var a,
|
|
2029
|
-
for (var
|
|
2030
|
-
|
|
2031
|
-
return
|
|
2032
|
-
},
|
|
2033
|
-
|
|
2034
|
-
},
|
|
2035
|
-
if (!
|
|
2035
|
+
for (var a, o = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, t = [], u = [], d = function(M) {
|
|
2036
|
+
for (var F in o)
|
|
2037
|
+
o[F] && (M[F] = o[F]);
|
|
2038
|
+
return t.push(M), M;
|
|
2039
|
+
}, p = function() {
|
|
2040
|
+
u.push(o), o = Object.create(o);
|
|
2041
|
+
}, b = function() {
|
|
2042
|
+
if (!u.length)
|
|
2036
2043
|
throw new Error("Unexpected }");
|
|
2037
|
-
|
|
2038
|
-
},
|
|
2044
|
+
o = u.pop();
|
|
2045
|
+
}, w = { tokens: t, open_context: p, close_context: b, add_token: d }; r.length; ) {
|
|
2039
2046
|
if (a = Ft.exec(r))
|
|
2040
|
-
|
|
2041
|
-
else if (a =
|
|
2042
|
-
|
|
2047
|
+
Et(a[0], !1).forEach(d);
|
|
2048
|
+
else if (a = Ve.exec(r))
|
|
2049
|
+
d(new z(a[1]));
|
|
2043
2050
|
else if (!(a = xe.exec(r))) {
|
|
2044
2051
|
if (a = /^\{/.exec(r))
|
|
2045
|
-
|
|
2052
|
+
p();
|
|
2046
2053
|
else if (a = /^\}/.exec(r))
|
|
2047
|
-
|
|
2054
|
+
b();
|
|
2048
2055
|
else if (!(a = /^\$/.exec(r)))
|
|
2049
2056
|
if (a = /^\\verb,([^,]+),/.exec(r))
|
|
2050
|
-
|
|
2057
|
+
d(new z(a[1]));
|
|
2051
2058
|
else if (a = we.exec(r)) {
|
|
2052
|
-
var A = a[1].slice(1) || a[1],
|
|
2059
|
+
var A = a[1].slice(1) || a[1], E = !!a[2];
|
|
2053
2060
|
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 (!(
|
|
2061
|
+
p(), o.family = "serif";
|
|
2062
|
+
var O = void 0;
|
|
2063
|
+
A === "LaTeX" && ((O = d(new z("L"))).tracking = -0.25, (O = d(new z("A"))).size = 0.7, O.baseline = 0.3, O.tracking = -0.1), (O = d(new z("T"))).tracking = -0.17, (O = d(new z("E"))).baseline = -0.22, O.tracking = -0.13, O = d(new z("X")), b();
|
|
2064
|
+
} else if (A in bt)
|
|
2065
|
+
d(new z(bt[A])), E && p();
|
|
2066
|
+
else if (A in W) {
|
|
2067
|
+
var P = [], I = W[A].length - 1, B = void 0;
|
|
2068
|
+
if (I) {
|
|
2069
|
+
for (E = !1, r = r.slice(a[0].length - 1); I--; ) {
|
|
2070
|
+
if (!(B = /^\{([^}]+)\}/.exec(r)))
|
|
2064
2071
|
throw new Error(A + " is missing an argument");
|
|
2065
|
-
|
|
2072
|
+
P.push(B[1]), r = r.slice(B[0].length);
|
|
2066
2073
|
}
|
|
2067
|
-
a[0] = /^\{/.exec(r) ? "{" : "",
|
|
2074
|
+
a[0] = /^\{/.exec(r) ? "{" : "", E = !!a[0];
|
|
2068
2075
|
}
|
|
2069
|
-
|
|
2076
|
+
E && p(), W[A].apply(w, [o].concat(P));
|
|
2070
2077
|
} else
|
|
2071
|
-
console.warn("unknown latex command", A),
|
|
2078
|
+
console.warn("unknown latex command", A), d(new z(a[1])), E && p();
|
|
2072
2079
|
} else
|
|
2073
|
-
a = [r.slice(0, 1)],
|
|
2080
|
+
a = [r.slice(0, 1)], d(new z(a[0]));
|
|
2074
2081
|
}
|
|
2075
2082
|
r = r.slice(a[0].length);
|
|
2076
2083
|
}
|
|
2077
|
-
return
|
|
2078
|
-
},
|
|
2079
|
-
return
|
|
2080
|
-
},
|
|
2081
|
-
const
|
|
2084
|
+
return t;
|
|
2085
|
+
}, J.measureText = function(r, n, a) {
|
|
2086
|
+
return H(r, R(n), a);
|
|
2087
|
+
}, J.Token = z, J.Break = lt, J.LineBreak = X, J.SoftHyphen = ut, J.Rotator = Se, Se.createElement = se;
|
|
2088
|
+
const Pe = J;
|
|
2082
2089
|
return i.default;
|
|
2083
2090
|
})());
|
|
2084
2091
|
})(Hr);
|
|
2085
2092
|
var vn = Hr.exports;
|
|
2086
2093
|
const xr = /* @__PURE__ */ Mr(vn);
|
|
2087
|
-
function nr(
|
|
2088
|
-
return
|
|
2094
|
+
function nr(h) {
|
|
2095
|
+
return h.replace(/…$/, "");
|
|
2089
2096
|
}
|
|
2090
|
-
function ir(
|
|
2091
|
-
return
|
|
2097
|
+
function ir(h) {
|
|
2098
|
+
return h.children[0].innerHTML;
|
|
2092
2099
|
}
|
|
2093
|
-
function mn(
|
|
2094
|
-
const
|
|
2095
|
-
if (
|
|
2100
|
+
function mn(h, e) {
|
|
2101
|
+
const s = mt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
|
|
2102
|
+
if (s.width === s.height && s.width === 0)
|
|
2096
2103
|
return;
|
|
2097
|
-
const
|
|
2104
|
+
const g = new xr({
|
|
2098
2105
|
font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
|
|
2099
|
-
width:
|
|
2100
|
-
height:
|
|
2106
|
+
width: s.width - c * 2,
|
|
2107
|
+
height: s.height - c * 2,
|
|
2101
2108
|
align: "left",
|
|
2102
2109
|
valign: "top",
|
|
2103
2110
|
x: 0,
|
|
@@ -2105,49 +2112,49 @@ function mn(u, e) {
|
|
|
2105
2112
|
parser: "html",
|
|
2106
2113
|
createElement: xr.createElement
|
|
2107
2114
|
});
|
|
2108
|
-
|
|
2109
|
-
const
|
|
2110
|
-
|
|
2115
|
+
g.overflowWrap("break-word");
|
|
2116
|
+
const y = g.linebreak(
|
|
2117
|
+
h.properties.content.replaceAll(`
|
|
2111
2118
|
`, "<br>")
|
|
2112
|
-
).render(),
|
|
2113
|
-
let
|
|
2114
|
-
const
|
|
2115
|
-
|
|
2116
|
-
`).forEach((
|
|
2117
|
-
let
|
|
2118
|
-
for (;
|
|
2119
|
-
if (
|
|
2120
|
-
|
|
2121
|
-
`) ||
|
|
2119
|
+
).render(), f = [...y.children];
|
|
2120
|
+
let m = 0;
|
|
2121
|
+
const v = [];
|
|
2122
|
+
h.properties.content.split(`
|
|
2123
|
+
`).forEach((_) => {
|
|
2124
|
+
let R = _;
|
|
2125
|
+
for (; R.length && m < f.length; ) {
|
|
2126
|
+
if (f[m].innerHTML === " ") {
|
|
2127
|
+
R.startsWith(`
|
|
2128
|
+
`) || v.push(m), m++;
|
|
2122
2129
|
break;
|
|
2123
2130
|
}
|
|
2124
|
-
const S = nr(ir(
|
|
2125
|
-
|
|
2131
|
+
const S = nr(ir(f[m]));
|
|
2132
|
+
R.startsWith(S) && (R = R.slice(S.length).trim()), m++;
|
|
2126
2133
|
}
|
|
2127
|
-
}),
|
|
2128
|
-
const
|
|
2129
|
-
|
|
2130
|
-
let
|
|
2134
|
+
}), v.forEach((_) => y.removeChild(f[_]));
|
|
2135
|
+
const k = h.properties.content.match(/(https?:\/\/.*)/gm), C = k ? k.map((_) => _.split(" ")[0]) : [];
|
|
2136
|
+
y.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((_) => {
|
|
2137
|
+
let R = _;
|
|
2131
2138
|
const S = [];
|
|
2132
|
-
for (;
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2139
|
+
for (; R.length > 0; ) {
|
|
2140
|
+
const D = f.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && R.startsWith(nr(ir(T))));
|
|
2141
|
+
if (!D)
|
|
2135
2142
|
break;
|
|
2136
|
-
S.push(
|
|
2137
|
-
const L = nr(
|
|
2143
|
+
S.push(D);
|
|
2144
|
+
const L = nr(D.children[0].innerHTML).length;
|
|
2138
2145
|
if (!L)
|
|
2139
2146
|
break;
|
|
2140
|
-
|
|
2147
|
+
R = R.slice(L);
|
|
2141
2148
|
}
|
|
2142
|
-
S.forEach((
|
|
2149
|
+
S.forEach((D) => {
|
|
2143
2150
|
const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
|
|
2144
|
-
L.setAttribute("href",
|
|
2151
|
+
L.setAttribute("href", _), L.setAttribute("target", "_blank"), L.innerHTML = ir(D), D.children[0].innerHTML = "", D.children[0].appendChild(L);
|
|
2145
2152
|
});
|
|
2146
|
-
}), e.appendChild(
|
|
2153
|
+
}), e.appendChild(y);
|
|
2147
2154
|
}
|
|
2148
2155
|
const Ar = 20;
|
|
2149
2156
|
class bn extends Br {
|
|
2150
|
-
constructor(e,
|
|
2157
|
+
constructor(e, s = {}) {
|
|
2151
2158
|
super(
|
|
2152
2159
|
e,
|
|
2153
2160
|
`
|
|
@@ -2167,42 +2174,42 @@ class bn extends Br {
|
|
|
2167
2174
|
this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
|
|
2168
2175
|
}), x(this, "_onBlur", () => {
|
|
2169
2176
|
this.isFocused = !1;
|
|
2170
|
-
}), x(this, "startDrawing", (l, c,
|
|
2171
|
-
this.add(
|
|
2172
|
-
const
|
|
2173
|
-
this.select(
|
|
2177
|
+
}), x(this, "startDrawing", (l, c, g = yn(l, c, 0, 0, "", Wt)) => {
|
|
2178
|
+
this.add(g);
|
|
2179
|
+
const y = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
|
|
2180
|
+
this.select(g.id), this.startDragging(this.getById(g.id), y.x, y.y), this.draggedHandle = 6;
|
|
2174
2181
|
}), x(this, "cancelDrawing", () => {
|
|
2175
2182
|
this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
|
|
2176
|
-
}), x(this, "startDragging", (l, c,
|
|
2183
|
+
}), x(this, "startDragging", (l, c, g) => {
|
|
2177
2184
|
this.annotation = l;
|
|
2178
|
-
const
|
|
2179
|
-
this.rect.x =
|
|
2185
|
+
const y = vt(this.annotation), f = mt(this.annotation);
|
|
2186
|
+
this.rect.x = y.x, this.rect.y = y.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = c, this.startY = g, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(ze, this.annotation), this.isDragging = !0;
|
|
2180
2187
|
}), x(this, "onHandleMouseDown", (l) => {
|
|
2181
2188
|
const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
|
|
2182
2189
|
if (!c)
|
|
2183
2190
|
return;
|
|
2184
2191
|
this.selectedId !== c.id && this.select(this.hoveredId);
|
|
2185
|
-
const { x:
|
|
2186
|
-
this.startDragging(c,
|
|
2192
|
+
const { x: g, y } = sr(l, this.ogma.getContainer());
|
|
2193
|
+
this.startDragging(c, g, y), this.draggedHandle = Lr(l.target);
|
|
2187
2194
|
}), x(this, "onMouseMove", (l) => {
|
|
2188
2195
|
requestAnimationFrame(() => this._onMouseMove(l));
|
|
2189
2196
|
}), x(this, "_onMouseMove", (l) => {
|
|
2190
2197
|
if (!this.isDragging)
|
|
2191
2198
|
return;
|
|
2192
2199
|
l.stopPropagation(), l.preventDefault();
|
|
2193
|
-
const c = this.handles[this.draggedHandle],
|
|
2200
|
+
const c = this.handles[this.draggedHandle], g = c.classList.contains("top"), y = c.classList.contains("left"), f = c.classList.contains("right"), m = c.classList.contains("bottom"), v = c.classList.contains("line-handle"), { x: k, y: C } = sr(
|
|
2194
2201
|
l,
|
|
2195
2202
|
this.ogma.getContainer()
|
|
2196
|
-
),
|
|
2197
|
-
(
|
|
2198
|
-
const T =
|
|
2199
|
-
this.rect.width +
|
|
2203
|
+
), _ = this.ogma.view.getZoom(), R = (k - this.startX) / _, S = (C - this.startY) / _, D = this.ogma.view.getAngle(), L = at({ x: R, y: S }, D);
|
|
2204
|
+
(m && y || g && f) && (L.y = 0, L.x = 0);
|
|
2205
|
+
const T = y || v ? this.rect.x + L.x : this.rect.x, U = g || v ? this.rect.y + L.y : this.rect.y, H = Math.max(
|
|
2206
|
+
this.rect.width + R * (v || y ? 0 : 1),
|
|
2200
2207
|
Ar
|
|
2201
2208
|
), it = Math.max(
|
|
2202
|
-
this.rect.height + S * (
|
|
2209
|
+
this.rect.height + S * (v || g ? 0 : 1),
|
|
2203
2210
|
Ar
|
|
2204
2211
|
);
|
|
2205
|
-
nn(this.annotation, T,
|
|
2212
|
+
nn(this.annotation, T, U, H, it), this.emit(Me, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
|
|
2206
2213
|
}), x(this, "onMouseUp", () => {
|
|
2207
2214
|
!this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
|
|
2208
2215
|
}), x(this, "_onMousedown", (l) => {
|
|
@@ -2224,47 +2231,47 @@ class bn extends Br {
|
|
|
2224
2231
|
_canRemove() {
|
|
2225
2232
|
return !this.isFocused;
|
|
2226
2233
|
}
|
|
2227
|
-
detect({ x: e, y:
|
|
2228
|
-
const l = { x: e, y:
|
|
2229
|
-
return this.elements.find((
|
|
2230
|
-
const { x:
|
|
2231
|
-
return C > -i && C <
|
|
2234
|
+
detect({ x: e, y: s }, i = 0) {
|
|
2235
|
+
const l = { x: e, y: s }, c = this.ogma.view.getAngle();
|
|
2236
|
+
return this.elements.find((g) => {
|
|
2237
|
+
const { x: y, y: f } = vt(g), { width: m, height: v } = mt(g), k = { x: y, y: f }, { x: C, y: _ } = at(Ct(l, k), -c);
|
|
2238
|
+
return C > -i && C < m + i && _ > -i && _ < v + i;
|
|
2232
2239
|
});
|
|
2233
2240
|
}
|
|
2234
2241
|
draw(e) {
|
|
2235
2242
|
e.innerHTML = "";
|
|
2236
|
-
const
|
|
2237
|
-
this.elements.forEach((c,
|
|
2238
|
-
const
|
|
2239
|
-
color:
|
|
2243
|
+
const s = "", i = this.ogma.view.getAngle();
|
|
2244
|
+
this.elements.forEach((c, g) => {
|
|
2245
|
+
const y = `class${g}`, f = mt(c), m = vt(c), v = c.id, {
|
|
2246
|
+
color: k,
|
|
2240
2247
|
fontSize: C,
|
|
2241
|
-
font:
|
|
2242
|
-
strokeColor:
|
|
2248
|
+
font: _,
|
|
2249
|
+
strokeColor: R,
|
|
2243
2250
|
strokeWidth: S,
|
|
2244
|
-
strokeType:
|
|
2251
|
+
strokeType: D,
|
|
2245
2252
|
background: L
|
|
2246
2253
|
} = c.properties.style || Wt;
|
|
2247
|
-
if (
|
|
2254
|
+
if (v === this.selectedId)
|
|
2248
2255
|
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},${
|
|
2256
|
+
const T = ce("g");
|
|
2257
|
+
T.classList.add("annotation-text"), T.setAttribute("fill", `${k}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${_}`);
|
|
2258
|
+
const U = ce("rect");
|
|
2259
|
+
let H = !1;
|
|
2260
|
+
D && D !== "none" && (H = !0, U.setAttribute("stroke", R || "black"), U.setAttribute("stroke-width", `${S}`), D === "dashed" && U.setAttribute("stroke-dasharray", "5,5")), (L && L.length || H) && (H = !0, U.setAttribute("fill", L || "transparent")), H && (U.setAttribute("width", `${f.width}`), U.setAttribute("height", `${f.height}`)), T.appendChild(U), mn(c, T);
|
|
2261
|
+
const { x: it, y: At } = at(m, -i);
|
|
2262
|
+
T.setAttribute("transform", `translate(${it},${At})`), T.classList.add(y), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
|
|
2256
2263
|
});
|
|
2257
|
-
const l =
|
|
2258
|
-
l.innerHTML =
|
|
2264
|
+
const l = ce("style");
|
|
2265
|
+
l.innerHTML = s, e.firstChild && e.insertBefore(l, e.firstChild);
|
|
2259
2266
|
}
|
|
2260
2267
|
refreshDrawing() {
|
|
2261
2268
|
const e = this.ogma.view.getAngle();
|
|
2262
|
-
[...this.layer.element.children].forEach((
|
|
2263
|
-
const i =
|
|
2269
|
+
[...this.layer.element.children].forEach((s) => {
|
|
2270
|
+
const i = s.getAttribute("data-annotation");
|
|
2264
2271
|
if (!i)
|
|
2265
2272
|
return;
|
|
2266
|
-
const l = vt(this.getById(i)), { x: c, y:
|
|
2267
|
-
|
|
2273
|
+
const l = vt(this.getById(i)), { x: c, y: g } = at(l, -e);
|
|
2274
|
+
s.setAttribute("transform", `translate(${c},${g})`);
|
|
2268
2275
|
});
|
|
2269
2276
|
}
|
|
2270
2277
|
getDefaultOptions() {
|
|
@@ -2273,16 +2280,16 @@ class bn extends Br {
|
|
|
2273
2280
|
refreshEditor() {
|
|
2274
2281
|
if (+this.selectedId < 0 && +this.hoveredId < 0)
|
|
2275
2282
|
return;
|
|
2276
|
-
const e = this.getById(this.selectedId) || this.getById(this.hoveredId),
|
|
2283
|
+
const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = mt(e), i = this.ogma.view.graphToScreenCoordinates(
|
|
2277
2284
|
vt(e)
|
|
2278
2285
|
), l = this.ogma.view.getZoom(), {
|
|
2279
2286
|
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(${
|
|
2287
|
+
fontSize: g,
|
|
2288
|
+
color: y,
|
|
2289
|
+
background: f,
|
|
2290
|
+
padding: m = 0
|
|
2291
|
+
} = e.properties.style || Wt, v = (g || 1) * l;
|
|
2292
|
+
this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${s.width / 2 * l}px, ${s.height / 2 * l}px)`, this.editor.element.style.width = `${s.width * l}px`, this.editor.element.style.height = `${s.height * l}px`, this.textArea.style.font = `${v} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${v}px`, this.textArea.style.padding = `${l * m}px`, this.textArea.style.lineHeight = `${v}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = y || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
|
|
2286
2293
|
}
|
|
2287
2294
|
select(e) {
|
|
2288
2295
|
super.select(e), this.textArea.focus();
|
|
@@ -2295,56 +2302,56 @@ class wn {
|
|
|
2295
2302
|
constructor() {
|
|
2296
2303
|
x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
|
|
2297
2304
|
}
|
|
2298
|
-
add(e,
|
|
2299
|
-
const
|
|
2300
|
-
id:
|
|
2301
|
-
arrow:
|
|
2305
|
+
add(e, s, i, l, c) {
|
|
2306
|
+
const g = Ne(), y = e.id, f = {
|
|
2307
|
+
id: g,
|
|
2308
|
+
arrow: y,
|
|
2302
2309
|
target: i,
|
|
2303
2310
|
targetType: l,
|
|
2304
2311
|
connectionPoint: c,
|
|
2305
|
-
side:
|
|
2312
|
+
side: s
|
|
2306
2313
|
};
|
|
2307
|
-
return this.links[
|
|
2314
|
+
return this.links[g] = f, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(g), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][s] = g, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
|
|
2308
2315
|
id: i,
|
|
2309
|
-
side:
|
|
2316
|
+
side: s,
|
|
2310
2317
|
type: l,
|
|
2311
2318
|
magnet: c
|
|
2312
2319
|
}, this;
|
|
2313
2320
|
}
|
|
2314
|
-
arrowIsLinked(e,
|
|
2321
|
+
arrowIsLinked(e, s) {
|
|
2315
2322
|
var i;
|
|
2316
|
-
return !!((i = this.linksByArrowId[e]) != null && i[
|
|
2323
|
+
return !!((i = this.linksByArrowId[e]) != null && i[s]);
|
|
2317
2324
|
}
|
|
2318
2325
|
// remove the link between the arrow and the target by arrow id and side
|
|
2319
|
-
remove(e,
|
|
2326
|
+
remove(e, s) {
|
|
2320
2327
|
var i, l;
|
|
2321
|
-
const c = e.id,
|
|
2322
|
-
if ((l = e.properties.link) == null || delete l[
|
|
2328
|
+
const c = e.id, g = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
|
|
2329
|
+
if ((l = e.properties.link) == null || delete l[s], !g)
|
|
2323
2330
|
return this;
|
|
2324
|
-
const
|
|
2325
|
-
delete this.links[
|
|
2326
|
-
const
|
|
2327
|
-
for (let
|
|
2328
|
-
if (
|
|
2329
|
-
|
|
2331
|
+
const y = this.links[g];
|
|
2332
|
+
delete this.links[g];
|
|
2333
|
+
const f = this.linksByTargetId[y.target];
|
|
2334
|
+
for (let m = 0; m < f.length; m++)
|
|
2335
|
+
if (f[m] === g) {
|
|
2336
|
+
f.splice(m, 1);
|
|
2330
2337
|
break;
|
|
2331
2338
|
}
|
|
2332
|
-
return delete this.linksByArrowId[c][
|
|
2339
|
+
return delete this.linksByArrowId[c][s], this;
|
|
2333
2340
|
}
|
|
2334
|
-
getArrowLink(e,
|
|
2341
|
+
getArrowLink(e, s) {
|
|
2335
2342
|
var i;
|
|
2336
|
-
const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[
|
|
2343
|
+
const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
|
|
2337
2344
|
return l ? this.links[l] : null;
|
|
2338
2345
|
}
|
|
2339
|
-
getTargetLinks(e,
|
|
2346
|
+
getTargetLinks(e, s) {
|
|
2340
2347
|
var i;
|
|
2341
|
-
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType ===
|
|
2348
|
+
return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
|
|
2342
2349
|
}
|
|
2343
2350
|
forEach(e) {
|
|
2344
2351
|
Object.values(this.links).forEach(e);
|
|
2345
2352
|
}
|
|
2346
2353
|
}
|
|
2347
|
-
const st = (
|
|
2354
|
+
const st = (h) => h.properties.type === "arrow", yt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", xn = {
|
|
2348
2355
|
magnetColor: "#3e8",
|
|
2349
2356
|
detectMargin: 20,
|
|
2350
2357
|
magnetHandleRadius: 5,
|
|
@@ -2365,7 +2372,7 @@ const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type =
|
|
|
2365
2372
|
{ x: 1, y: 1 }
|
|
2366
2373
|
];
|
|
2367
2374
|
class An extends Nr {
|
|
2368
|
-
constructor(e,
|
|
2375
|
+
constructor(e, s = {}) {
|
|
2369
2376
|
super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new wn()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (i) => {
|
|
2370
2377
|
if (!this.dragged || this.textToMagnet === void 0)
|
|
2371
2378
|
return;
|
|
@@ -2374,27 +2381,27 @@ class An extends Nr {
|
|
|
2374
2381
|
kr.forEach((c) => {
|
|
2375
2382
|
if (!this.textToMagnet)
|
|
2376
2383
|
return;
|
|
2377
|
-
const
|
|
2378
|
-
i.moveTo(
|
|
2384
|
+
const g = mt(this.textToMagnet), y = vt(this.textToMagnet), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), { x: v, y: k } = Ht(m, y);
|
|
2385
|
+
i.moveTo(v, k), i.arc(v, k, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
|
|
2379
2386
|
}), i.fill(), i.closePath();
|
|
2380
2387
|
}), x(this, "_onFeatureDrag", (i, l) => {
|
|
2381
2388
|
const c = l;
|
|
2382
2389
|
if (st(i) && c === "line")
|
|
2383
|
-
["start", "end"].find((
|
|
2384
|
-
const
|
|
2385
|
-
return this._snapToText(i, c,
|
|
2390
|
+
["start", "end"].find((g) => {
|
|
2391
|
+
const y = g === "start" ? de(i) : $e(i);
|
|
2392
|
+
return this._snapToText(i, c, y) || this._findAndSnapToNode(i, g, y);
|
|
2386
2393
|
});
|
|
2387
2394
|
else if (st(i) && c !== "line") {
|
|
2388
|
-
const
|
|
2389
|
-
this._snapToText(i, c,
|
|
2395
|
+
const g = c === "start" ? de(i) : $e(i);
|
|
2396
|
+
this._snapToText(i, c, g) || this._findAndSnapToNode(i, c, g);
|
|
2390
2397
|
} else
|
|
2391
|
-
yt(i) && (this.activeLinks.forEach(({ arrow:
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2398
|
+
yt(i) && (this.activeLinks.forEach(({ arrow: g, side: y, connectionPoint: f }) => {
|
|
2399
|
+
const m = this.getAnnotation(g), v = mt(i), k = vt(i), C = je(f, { x: v.width, y: v.height }), _ = at(C, this.ogma.view.getAngle()), R = Ht(_, k);
|
|
2400
|
+
m.geometry.coordinates[y === "start" ? 0 : 1] = [R.x, R.y];
|
|
2394
2401
|
}), this.activeLinks.length && this.arrows.refreshLayer());
|
|
2395
|
-
this.layer.refresh(), this.emit(
|
|
2402
|
+
this.layer.refresh(), this.emit(Me, i, l);
|
|
2396
2403
|
}), x(this, "_onFeatureDragEnd", (i) => {
|
|
2397
|
-
this.dragged !== null && st(i) &&
|
|
2404
|
+
this.dragged !== null && st(i) && de(this.dragged) && _r.forEach((l) => {
|
|
2398
2405
|
this.links.getArrowLink(i.id, l) && this.emit(dn, {
|
|
2399
2406
|
arrow: i,
|
|
2400
2407
|
link: this.links.getArrowLink(i.id, l)
|
|
@@ -2404,7 +2411,7 @@ class An extends Nr {
|
|
|
2404
2411
|
this.textToMagnet = void 0, st(i) ? this.dragged = i : yt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
|
|
2405
2412
|
const c = l.getSelectedFeature();
|
|
2406
2413
|
c && c !== i && l.unhover().unselect(), l.disableDetection();
|
|
2407
|
-
}), this.emit(
|
|
2414
|
+
}), this.emit(ze, i);
|
|
2408
2415
|
}), x(this, "_onNodesDragStart", () => {
|
|
2409
2416
|
this.arrows.unhover().unselect(), this.texts.unhover().unselect();
|
|
2410
2417
|
}), x(this, "_onNodesDrag", (i) => {
|
|
@@ -2412,12 +2419,12 @@ class An extends Nr {
|
|
|
2412
2419
|
this._moveNodes(i.nodes, l, c);
|
|
2413
2420
|
}), x(this, "_onLayoutEnd", (i) => {
|
|
2414
2421
|
i.ids.forEach((l, c) => {
|
|
2415
|
-
this.links.getTargetLinks(l, "node").forEach((
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
),
|
|
2420
|
-
Bt(
|
|
2422
|
+
this.links.getTargetLinks(l, "node").forEach((g) => {
|
|
2423
|
+
const y = this.getAnnotation(g.arrow), f = g.side, m = Le(
|
|
2424
|
+
y,
|
|
2425
|
+
f === "start" ? "end" : "start"
|
|
2426
|
+
), v = i.positions.current[c], k = this.ogma.getNode(l).getAttribute("radius"), C = Fe(m, v, +k);
|
|
2427
|
+
Bt(y, f, C.x, C.y);
|
|
2421
2428
|
});
|
|
2422
2429
|
}), this.arrows.refreshLayer(), this.texts.refreshLayer();
|
|
2423
2430
|
}), x(this, "_onAdded", (i) => {
|
|
@@ -2434,59 +2441,59 @@ class An extends Nr {
|
|
|
2434
2441
|
);
|
|
2435
2442
|
}), x(this, "_onUpdate", (i) => {
|
|
2436
2443
|
this.emit(cr, i);
|
|
2437
|
-
}), this.options = this.setOptions({ ...xn, ...
|
|
2438
|
-
i.on(
|
|
2444
|
+
}), this.options = this.setOptions({ ...xn, ...s }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
|
|
2445
|
+
i.on(ze, this._onFeatureDragStart).on(Me, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
|
|
2439
2446
|
}), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
|
|
2440
2447
|
this.refreshTextLinks();
|
|
2441
2448
|
}), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
|
|
2442
2449
|
}
|
|
2443
|
-
_moveNodes(e,
|
|
2450
|
+
_moveNodes(e, s, i) {
|
|
2444
2451
|
e.forEach((l) => {
|
|
2445
|
-
const c = this.links.getTargetLinks(l.getId(), "node"),
|
|
2446
|
-
c.forEach((
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2449
|
-
|
|
2452
|
+
const c = this.links.getTargetLinks(l.getId(), "node"), g = l.getPosition();
|
|
2453
|
+
c.forEach((y) => {
|
|
2454
|
+
const f = this.getAnnotation(y.arrow), m = y.side, v = Le(
|
|
2455
|
+
f,
|
|
2456
|
+
m === "start" ? "end" : "start"
|
|
2450
2457
|
);
|
|
2451
|
-
let
|
|
2452
|
-
const C = +l.getAttribute("radius"),
|
|
2453
|
-
(
|
|
2458
|
+
let k = g;
|
|
2459
|
+
const C = +l.getAttribute("radius"), _ = 1e-6;
|
|
2460
|
+
(y.connectionPoint.x - (g.x - s) > _ || y.connectionPoint.y - (g.y - i) > _) && (k = Fe(v, g, C)), Bt(f, m, k.x, k.y);
|
|
2454
2461
|
});
|
|
2455
2462
|
}), this.arrows.refreshLayer();
|
|
2456
2463
|
}
|
|
2457
|
-
_snapToText(e,
|
|
2464
|
+
_snapToText(e, s, i) {
|
|
2458
2465
|
const l = this.texts.detect(i, this.options.detectMargin);
|
|
2459
|
-
if (this.links.remove(e,
|
|
2466
|
+
if (this.links.remove(e, s), !l)
|
|
2460
2467
|
return !1;
|
|
2461
2468
|
this.textToMagnet = l;
|
|
2462
2469
|
const c = this.findMagnetPoint(kr, l, i);
|
|
2463
|
-
return c ? (Bt(e,
|
|
2470
|
+
return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
|
|
2464
2471
|
}
|
|
2465
|
-
_findAndSnapToNode(e,
|
|
2472
|
+
_findAndSnapToNode(e, s, i) {
|
|
2466
2473
|
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 =
|
|
2474
|
+
const g = this.ogma.view.graphToScreenCoordinates(i), y = this.ogma.view.getElementAt(g);
|
|
2475
|
+
this.links.remove(e, s), y && y.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = y, y.setSelected(!0), this._snapToNode(e, s, y, g)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
|
|
2476
|
+
}
|
|
2477
|
+
_snapToNode(e, s, i, l) {
|
|
2478
|
+
const c = i.getPositionOnScreen(), g = +i.getAttribute("radius"), y = g * this.ogma.view.getZoom(), f = l.x - c.x, m = l.y - c.y, v = Math.sqrt(f * f + m * m), k = i.getPosition();
|
|
2479
|
+
if (v < y + this.options.detectMargin) {
|
|
2480
|
+
let C = k;
|
|
2481
|
+
if (v > y / 2) {
|
|
2482
|
+
const _ = Le(e, s === "end" ? "start" : "end");
|
|
2483
|
+
C = Fe(_, C, g);
|
|
2477
2484
|
}
|
|
2478
|
-
Bt(e,
|
|
2485
|
+
Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
|
|
2479
2486
|
}
|
|
2480
2487
|
}
|
|
2481
2488
|
refreshTextLinks() {
|
|
2482
2489
|
let e = !1;
|
|
2483
2490
|
this.links.forEach(
|
|
2484
|
-
({ connectionPoint:
|
|
2491
|
+
({ connectionPoint: s, targetType: i, target: l, arrow: c, side: g }) => {
|
|
2485
2492
|
if (i !== "text")
|
|
2486
2493
|
return;
|
|
2487
2494
|
e = !0;
|
|
2488
|
-
const
|
|
2489
|
-
Bt(
|
|
2495
|
+
const y = this.getAnnotation(l), f = this.getAnnotation(c), m = mt(y), v = vt(y), k = je(s, { x: m.width, y: m.height }), C = at(k, this.ogma.view.getAngle()), _ = Ht(C, v);
|
|
2496
|
+
Bt(f, g, _.x, _.y);
|
|
2490
2497
|
}
|
|
2491
2498
|
), e && this.arrows.refreshLayer();
|
|
2492
2499
|
}
|
|
@@ -2496,18 +2503,18 @@ class An extends Nr {
|
|
|
2496
2503
|
getSelected() {
|
|
2497
2504
|
return this.selected;
|
|
2498
2505
|
}
|
|
2499
|
-
findMagnetPoint(e,
|
|
2506
|
+
findMagnetPoint(e, s, i) {
|
|
2500
2507
|
let l;
|
|
2501
2508
|
for (const c of e) {
|
|
2502
|
-
const
|
|
2509
|
+
const g = mt(s), y = vt(s), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), v = Ht(m, y), k = Ut(Ct(v, i)), C = Math.min(
|
|
2503
2510
|
this.options.magnetRadius * this.ogma.view.getZoom(),
|
|
2504
2511
|
// when really zoomed in: avoid to snap on too far away magnets
|
|
2505
|
-
|
|
2506
|
-
|
|
2512
|
+
g.width / 2,
|
|
2513
|
+
g.height / 2
|
|
2507
2514
|
);
|
|
2508
|
-
if (
|
|
2515
|
+
if (k < Math.max(C, this.options.magnetHandleRadius)) {
|
|
2509
2516
|
l = {
|
|
2510
|
-
point:
|
|
2517
|
+
point: v,
|
|
2511
2518
|
magnet: c
|
|
2512
2519
|
};
|
|
2513
2520
|
break;
|
|
@@ -2531,8 +2538,8 @@ class An extends Nr {
|
|
|
2531
2538
|
* @param id the id of the annotation to select
|
|
2532
2539
|
*/
|
|
2533
2540
|
select(e) {
|
|
2534
|
-
const
|
|
2535
|
-
return
|
|
2541
|
+
const s = this.getAnnotations().features.find((i) => i.id === e);
|
|
2542
|
+
return s ? (st(s) ? this.arrows.select(s.id) : yt(s) && this.texts.select(s.id), this) : this;
|
|
2536
2543
|
}
|
|
2537
2544
|
/**
|
|
2538
2545
|
* Unselects the currently selected annotation
|
|
@@ -2546,11 +2553,11 @@ class An extends Nr {
|
|
|
2546
2553
|
*/
|
|
2547
2554
|
add(e) {
|
|
2548
2555
|
if (Er(e)) {
|
|
2549
|
-
const [
|
|
2556
|
+
const [s, i] = e.features.reduce(
|
|
2550
2557
|
(l, c) => (st(c) ? l[1].push(c) : yt(c) && l[0].push(c), l),
|
|
2551
2558
|
[[], []]
|
|
2552
2559
|
);
|
|
2553
|
-
return
|
|
2560
|
+
return s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
|
|
2554
2561
|
}
|
|
2555
2562
|
switch (e.properties.type) {
|
|
2556
2563
|
case "text":
|
|
@@ -2568,28 +2575,28 @@ class An extends Nr {
|
|
|
2568
2575
|
*/
|
|
2569
2576
|
remove(e) {
|
|
2570
2577
|
return Er(e) ? (e.features.forEach(
|
|
2571
|
-
(
|
|
2578
|
+
(s) => this.remove(s)
|
|
2572
2579
|
), this) : (st(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
|
|
2573
2580
|
}
|
|
2574
2581
|
loadLink(e) {
|
|
2575
2582
|
if (e.properties.link)
|
|
2576
|
-
for (const
|
|
2577
|
-
const i = e.properties.link[
|
|
2583
|
+
for (const s of _r) {
|
|
2584
|
+
const i = e.properties.link[s];
|
|
2578
2585
|
if (!i)
|
|
2579
2586
|
continue;
|
|
2580
2587
|
const l = this.getAnnotation(i.id);
|
|
2581
2588
|
if (i.type === "text" && l)
|
|
2582
|
-
this.links.add(e,
|
|
2589
|
+
this.links.add(e, s, i.id, i.type, i.magnet);
|
|
2583
2590
|
else if (i.type === "node") {
|
|
2584
2591
|
const c = this.ogma.getNode(i.id);
|
|
2585
2592
|
if (!c)
|
|
2586
2593
|
continue;
|
|
2587
|
-
this.links.add(e,
|
|
2588
|
-
const
|
|
2594
|
+
this.links.add(e, s, i.id, i.type, i.magnet);
|
|
2595
|
+
const g = c.getPosition(), y = c.getAttribute("radius") || 0, f = Le(
|
|
2589
2596
|
e,
|
|
2590
|
-
|
|
2591
|
-
),
|
|
2592
|
-
Bt(e,
|
|
2597
|
+
s === "start" ? "end" : "start"
|
|
2598
|
+
), m = Fe(f, g, +y);
|
|
2599
|
+
Bt(e, s, m.x, m.y);
|
|
2593
2600
|
}
|
|
2594
2601
|
}
|
|
2595
2602
|
}
|
|
@@ -2599,8 +2606,8 @@ class An extends Nr {
|
|
|
2599
2606
|
* @param y coord of the first point
|
|
2600
2607
|
* @param arrow The arrow to add
|
|
2601
2608
|
*/
|
|
2602
|
-
startArrow(e,
|
|
2603
|
-
this.cancelDrawing(), this.arrows.startDrawing(e,
|
|
2609
|
+
startArrow(e, s, i) {
|
|
2610
|
+
this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
|
|
2604
2611
|
}
|
|
2605
2612
|
/**
|
|
2606
2613
|
* Start adding a text (add it, and give control to the user)
|
|
@@ -2608,8 +2615,8 @@ class An extends Nr {
|
|
|
2608
2615
|
* @param y coord of the top left point
|
|
2609
2616
|
* @param text The text to add
|
|
2610
2617
|
*/
|
|
2611
|
-
startText(e,
|
|
2612
|
-
this.cancelDrawing(), this.texts.startDrawing(e,
|
|
2618
|
+
startText(e, s, i) {
|
|
2619
|
+
this.cancelDrawing(), this.texts.startDrawing(e, s, i);
|
|
2613
2620
|
}
|
|
2614
2621
|
/**
|
|
2615
2622
|
* Cancel drawing on the current frame
|
|
@@ -2622,13 +2629,13 @@ class An extends Nr {
|
|
|
2622
2629
|
* @param id The id of the annotation to update
|
|
2623
2630
|
* @param style The new style
|
|
2624
2631
|
*/
|
|
2625
|
-
updateStyle(e,
|
|
2632
|
+
updateStyle(e, s) {
|
|
2626
2633
|
const i = this.getAnnotations().features.find((l) => l.id === e);
|
|
2627
|
-
return i ? (st(i) ? this.arrows.updateStyle(i,
|
|
2634
|
+
return i ? (st(i) ? this.arrows.updateStyle(i, s) : yt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
|
|
2628
2635
|
}
|
|
2629
|
-
setScale(e,
|
|
2630
|
-
const c = this.getAnnotations().features.find((
|
|
2631
|
-
return c ? (st(c) ? this.arrows.scale(c,
|
|
2636
|
+
setScale(e, s, i, l) {
|
|
2637
|
+
const c = this.getAnnotations().features.find((g) => g.id === e);
|
|
2638
|
+
return c ? (st(c) ? this.arrows.scale(c, s, i, l) : yt(c) && this.texts.scale(c, s, i, l), this.onUpdate(c), this) : this;
|
|
2632
2639
|
}
|
|
2633
2640
|
/**
|
|
2634
2641
|
*
|
|
@@ -2639,8 +2646,8 @@ class An extends Nr {
|
|
|
2639
2646
|
type: "FeatureCollection",
|
|
2640
2647
|
features: []
|
|
2641
2648
|
};
|
|
2642
|
-
return this.annotations.forEach((
|
|
2643
|
-
e.features = [...e.features, ...
|
|
2649
|
+
return this.annotations.forEach((s) => {
|
|
2650
|
+
e.features = [...e.features, ...s.getElements()];
|
|
2644
2651
|
}), e;
|
|
2645
2652
|
}
|
|
2646
2653
|
/**
|
|
@@ -2649,7 +2656,7 @@ class An extends Nr {
|
|
|
2649
2656
|
* @returns The annotation with the given id
|
|
2650
2657
|
*/
|
|
2651
2658
|
getAnnotation(e) {
|
|
2652
|
-
return this.getAnnotations().features.find((
|
|
2659
|
+
return this.getAnnotations().features.find((s) => s.id === e);
|
|
2653
2660
|
}
|
|
2654
2661
|
/**
|
|
2655
2662
|
* Destroy the controller and its elements
|
|
@@ -2683,7 +2690,7 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
|
|
|
2683
2690
|
"Consolas",
|
|
2684
2691
|
"Courier New",
|
|
2685
2692
|
"monospace"
|
|
2686
|
-
].sort((
|
|
2693
|
+
].sort((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
|
|
2687
2694
|
head: "arrow",
|
|
2688
2695
|
strokeColor: Ur,
|
|
2689
2696
|
strokeWidth: 5
|
|
@@ -2695,97 +2702,97 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
|
|
|
2695
2702
|
strokeType: Sr,
|
|
2696
2703
|
background: Sr
|
|
2697
2704
|
};
|
|
2698
|
-
function Tn(
|
|
2699
|
-
return
|
|
2705
|
+
function Tn(h) {
|
|
2706
|
+
return h.reduce((e, s) => e + s, 0) / h.length;
|
|
2700
2707
|
}
|
|
2701
|
-
function In(
|
|
2702
|
-
return e + (
|
|
2708
|
+
function In(h, e = 0, s = 1) {
|
|
2709
|
+
return e + (s - e) * h;
|
|
2703
2710
|
}
|
|
2704
|
-
function Ln(
|
|
2705
|
-
return (
|
|
2711
|
+
function Ln(h, e = 0, s = 1) {
|
|
2712
|
+
return (h - e) / (s - e);
|
|
2706
2713
|
}
|
|
2707
2714
|
function Fn() {
|
|
2708
2715
|
return Or(null);
|
|
2709
2716
|
}
|
|
2710
2717
|
const Wr = Or(
|
|
2711
2718
|
void 0
|
|
2712
|
-
),
|
|
2719
|
+
), jn = () => qr(Wr), Sn = (h, e) => {
|
|
2713
2720
|
switch (e.type) {
|
|
2714
2721
|
case "add":
|
|
2715
2722
|
return {
|
|
2716
|
-
...
|
|
2717
|
-
features: [...
|
|
2723
|
+
...h,
|
|
2724
|
+
features: [...h.features, e.payload]
|
|
2718
2725
|
};
|
|
2719
2726
|
case "remove":
|
|
2720
2727
|
return {
|
|
2721
|
-
...
|
|
2722
|
-
features:
|
|
2728
|
+
...h,
|
|
2729
|
+
features: h.features.filter((s) => s.id !== e.payload.id)
|
|
2723
2730
|
};
|
|
2724
2731
|
case "update":
|
|
2725
2732
|
return {
|
|
2726
|
-
...
|
|
2727
|
-
features:
|
|
2728
|
-
(
|
|
2733
|
+
...h,
|
|
2734
|
+
features: h.features.map(
|
|
2735
|
+
(s) => s.id === e.payload.id ? e.payload : s
|
|
2729
2736
|
)
|
|
2730
2737
|
};
|
|
2731
2738
|
default:
|
|
2732
|
-
return
|
|
2739
|
+
return h;
|
|
2733
2740
|
}
|
|
2734
|
-
},
|
|
2735
|
-
const e = Gr(), [
|
|
2741
|
+
}, $n = ({ children: h }) => {
|
|
2742
|
+
const e = Gr(), [s, i] = Yr(Sn, {
|
|
2736
2743
|
type: "FeatureCollection",
|
|
2737
2744
|
features: []
|
|
2738
|
-
}), [l, c] = Nt(null), [
|
|
2745
|
+
}), [l, c] = Nt(null), [g, y] = Nt(En), [f, m] = Nt(kn), [v, k] = Nt(), [C, _] = Nt(1), [R, S] = Nt(1);
|
|
2739
2746
|
return er(() => {
|
|
2740
2747
|
if (!e)
|
|
2741
2748
|
return;
|
|
2742
|
-
const
|
|
2749
|
+
const D = new An(e, {
|
|
2743
2750
|
minArrowHeight: 1
|
|
2744
2751
|
}), L = Tn(e.getNodes().getAttribute("radius")) / 5, T = C;
|
|
2745
|
-
return
|
|
2746
|
-
...
|
|
2747
|
-
strokeWidth: (
|
|
2748
|
-
}),
|
|
2749
|
-
st(
|
|
2750
|
-
...
|
|
2751
|
-
}) : yt(
|
|
2752
|
-
...
|
|
2753
|
-
}), c(
|
|
2752
|
+
return y({
|
|
2753
|
+
...g,
|
|
2754
|
+
strokeWidth: (g.strokeWidth || 1) * T
|
|
2755
|
+
}), _(T), S(L), D.on("select", (U) => {
|
|
2756
|
+
st(U) ? y({
|
|
2757
|
+
...U.properties.style || {}
|
|
2758
|
+
}) : yt(U) && m({
|
|
2759
|
+
...U.properties.style || {}
|
|
2760
|
+
}), c(U);
|
|
2754
2761
|
}).on("unselect", () => {
|
|
2755
2762
|
c(null);
|
|
2756
|
-
}),
|
|
2757
|
-
|
|
2763
|
+
}), k(D), () => {
|
|
2764
|
+
v == null || v.destroy();
|
|
2758
2765
|
};
|
|
2759
2766
|
}, [e]), er(() => {
|
|
2760
|
-
|
|
2761
|
-
}, [
|
|
2762
|
-
|
|
2763
|
-
}, [
|
|
2767
|
+
v && l && (l == null ? void 0 : l.properties.type) === "arrow" && v.updateStyle(l.id, g);
|
|
2768
|
+
}, [v, g, l]), er(() => {
|
|
2769
|
+
v && l && (l == null ? void 0 : l.properties.type) === "text" && v.updateStyle(l.id, f);
|
|
2770
|
+
}, [v, f, l]), /* @__PURE__ */ Kr.jsx(
|
|
2764
2771
|
Wr.Provider,
|
|
2765
2772
|
{
|
|
2766
2773
|
value: {
|
|
2767
|
-
annotations:
|
|
2774
|
+
annotations: s,
|
|
2768
2775
|
updateAnnotations: i,
|
|
2769
2776
|
currentAnnotation: l,
|
|
2770
2777
|
setCurrentAnnotation: c,
|
|
2771
|
-
textStyle:
|
|
2772
|
-
setTextStyle:
|
|
2773
|
-
arrowStyle:
|
|
2774
|
-
setArrowStyle:
|
|
2778
|
+
textStyle: f,
|
|
2779
|
+
setTextStyle: m,
|
|
2780
|
+
arrowStyle: g,
|
|
2781
|
+
setArrowStyle: y,
|
|
2775
2782
|
arrowWidthFactor: C,
|
|
2776
|
-
setArrowWidthFactor:
|
|
2777
|
-
textSizeFactor:
|
|
2783
|
+
setArrowWidthFactor: _,
|
|
2784
|
+
textSizeFactor: R,
|
|
2778
2785
|
setTextSizeFactor: S,
|
|
2779
|
-
editor:
|
|
2780
|
-
setEditor:
|
|
2786
|
+
editor: v,
|
|
2787
|
+
setEditor: k
|
|
2781
2788
|
},
|
|
2782
|
-
children:
|
|
2789
|
+
children: h
|
|
2783
2790
|
}
|
|
2784
2791
|
);
|
|
2785
2792
|
};
|
|
2786
2793
|
export {
|
|
2787
2794
|
Wr as AnnotationsContext,
|
|
2788
|
-
|
|
2795
|
+
$n as AnnotationsContextProvider,
|
|
2789
2796
|
Ur as BLACK,
|
|
2790
2797
|
_n as RELATIVE_PADDING,
|
|
2791
2798
|
Sr as TRANSPARENT,
|
|
@@ -2798,5 +2805,5 @@ export {
|
|
|
2798
2805
|
In as interpolate,
|
|
2799
2806
|
Tn as mean,
|
|
2800
2807
|
Ln as normalize,
|
|
2801
|
-
|
|
2808
|
+
jn as useAnnotationsContext
|
|
2802
2809
|
};
|