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