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