presenter 0.8.3 → 0.8.4
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/navigator/openNavigator.d.ts +12 -2
- package/dist/presenter.js +2 -2
- package/dist/presenter.js.map +1 -1
- package/dist/presenter.mjs +965 -900
- package/dist/presenter.mjs.map +1 -1
- package/dist/utils/dom/hasModifierKey.d.ts +1 -0
- package/dist/utils/dom/isInteractiveElement.d.ts +1 -0
- package/dist/utils/presentation/setupKeyEventListeners.d.ts +5 -1
- package/package.json +1 -1
package/dist/presenter.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var k = (n, e, t) =>
|
|
1
|
+
var Q0 = Object.defineProperty;
|
|
2
|
+
var J0 = (n, e, t) => e in n ? Q0(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var k = (n, e, t) => J0(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
const ft = {
|
|
5
5
|
/** Represents an animated change in an object's properties. */
|
|
6
6
|
ANIMATE: "Animate",
|
|
@@ -9,52 +9,52 @@ const ft = {
|
|
|
9
9
|
/** Represents an immediate update to an object's properties without animation. */
|
|
10
10
|
UPDATE: "Update"
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function te(n) {
|
|
13
13
|
return n * n * n;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function ee(n) {
|
|
16
16
|
return --n * n * n + 1;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function ne(n) {
|
|
19
19
|
return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
|
|
20
20
|
}
|
|
21
|
-
var
|
|
21
|
+
var r0 = 1.70158;
|
|
22
22
|
(function n(e) {
|
|
23
23
|
e = +e;
|
|
24
24
|
function t(o) {
|
|
25
25
|
return (o = +o) * o * (e * (o - 1) + o);
|
|
26
26
|
}
|
|
27
27
|
return t.overshoot = n, t;
|
|
28
|
-
})(
|
|
28
|
+
})(r0);
|
|
29
29
|
(function n(e) {
|
|
30
30
|
e = +e;
|
|
31
31
|
function t(o) {
|
|
32
32
|
return --o * o * ((o + 1) * e + o) + 1;
|
|
33
33
|
}
|
|
34
34
|
return t.overshoot = n, t;
|
|
35
|
-
})(
|
|
36
|
-
var
|
|
35
|
+
})(r0);
|
|
36
|
+
var re = (function n(e) {
|
|
37
37
|
e = +e;
|
|
38
38
|
function t(o) {
|
|
39
39
|
return ((o *= 2) < 1 ? o * o * ((e + 1) * o - e) : (o -= 2) * o * ((e + 1) * o + e) + 2) / 2;
|
|
40
40
|
}
|
|
41
41
|
return t.overshoot = n, t;
|
|
42
|
-
})(
|
|
43
|
-
const
|
|
42
|
+
})(r0);
|
|
43
|
+
const i0 = {
|
|
44
44
|
LINEAR: (n) => n,
|
|
45
|
-
CUBIC:
|
|
46
|
-
CUBIC_IN:
|
|
47
|
-
CUBIC_OUT:
|
|
48
|
-
BACK_IN_OUT:
|
|
49
|
-
},
|
|
50
|
-
function
|
|
45
|
+
CUBIC: ne,
|
|
46
|
+
CUBIC_IN: te,
|
|
47
|
+
CUBIC_OUT: ee,
|
|
48
|
+
BACK_IN_OUT: re.overshoot(0.8)
|
|
49
|
+
}, ie = i0.LINEAR;
|
|
50
|
+
function o0(n, e, t = {}) {
|
|
51
51
|
return {
|
|
52
52
|
type: ft.ANIMATE,
|
|
53
53
|
object: n,
|
|
54
54
|
props: e,
|
|
55
55
|
delay: 0,
|
|
56
56
|
duration: 1e3,
|
|
57
|
-
easing:
|
|
57
|
+
easing: ie,
|
|
58
58
|
block: !1,
|
|
59
59
|
interpolators: null,
|
|
60
60
|
isKey: !1,
|
|
@@ -62,21 +62,21 @@ function r0(n, e, t = {}) {
|
|
|
62
62
|
...typeof t == "number" ? { duration: t } : t
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function Tn(n, e = {}) {
|
|
66
|
+
return o0(n, { opacity: 1 }, {
|
|
67
67
|
duration: 500,
|
|
68
|
-
easing:
|
|
68
|
+
easing: i0.CUBIC,
|
|
69
69
|
...typeof e == "number" ? { duration: e } : e
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
72
|
+
function Cn(n, e = {}) {
|
|
73
|
+
return o0(n, { opacity: 0 }, {
|
|
74
74
|
duration: 500,
|
|
75
|
-
easing:
|
|
75
|
+
easing: i0.CUBIC,
|
|
76
76
|
...typeof e == "number" ? { duration: e } : e
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function F0(n, e, t = {}) {
|
|
80
80
|
return {
|
|
81
81
|
type: ft.UPDATE,
|
|
82
82
|
isKey: !1,
|
|
@@ -86,11 +86,11 @@ function I0(n, e, t = {}) {
|
|
|
86
86
|
...t
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
89
|
+
function Pn(n) {
|
|
90
|
+
return F0(n, { opacity: 0 });
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
return
|
|
92
|
+
function En(n) {
|
|
93
|
+
return F0(n, { opacity: 1 });
|
|
94
94
|
}
|
|
95
95
|
const ot = {
|
|
96
96
|
TOP_LEFT: "TopLeft",
|
|
@@ -103,7 +103,7 @@ const ot = {
|
|
|
103
103
|
BOTTOM: "Bottom",
|
|
104
104
|
BOTTOM_RIGHT: "BottomRight"
|
|
105
105
|
}, ht = ot.TOP_LEFT;
|
|
106
|
-
function
|
|
106
|
+
function G(n, e = 0, t = 0, o = 1) {
|
|
107
107
|
if (typeof n == "string") {
|
|
108
108
|
const i = n.replace("#", ""), a = parseInt(i, 16);
|
|
109
109
|
return isNaN(a) ? (console.warn("Invalid hex color format:", n), Q) : i.length === 6 ? {
|
|
@@ -132,14 +132,14 @@ function W(n, e = 0, t = 0, o = 1) {
|
|
|
132
132
|
...n
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
135
|
+
G.BLACK = G(0, 0, 0);
|
|
136
|
+
G.BLUE = G(0, 0, 255);
|
|
137
|
+
G.GREEN = G(0, 255, 0);
|
|
138
|
+
G.RED = G(255, 0, 0);
|
|
139
|
+
G.TRANSPARENT = G(0, 0, 0, 0);
|
|
140
|
+
G.WHITE = G(255, 255, 255);
|
|
141
141
|
const Q = { red: 0, green: 0, blue: 0, alpha: 1 };
|
|
142
|
-
function
|
|
142
|
+
function N0(n = null) {
|
|
143
143
|
return {
|
|
144
144
|
content: null,
|
|
145
145
|
setup: null,
|
|
@@ -151,35 +151,35 @@ function _0(n = null) {
|
|
|
151
151
|
...n
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function R0(n, e = null) {
|
|
155
155
|
return n.alpha * (e ?? 1);
|
|
156
156
|
}
|
|
157
157
|
function Et(n, e = null) {
|
|
158
|
-
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(
|
|
158
|
+
const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(R0(n, e) * 255);
|
|
159
159
|
return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Sn(n = null) {
|
|
162
162
|
const {
|
|
163
163
|
url: e = "https://wikipedia.org/",
|
|
164
|
-
backgroundColor: t =
|
|
164
|
+
backgroundColor: t = G.TRANSPARENT,
|
|
165
165
|
strokeColor: o = Q,
|
|
166
166
|
strokeWidth: i = 0,
|
|
167
167
|
pointerEvents: a = "auto",
|
|
168
168
|
scale: s = 1,
|
|
169
169
|
anchor: r = ht,
|
|
170
170
|
height: h = 1e3,
|
|
171
|
-
width:
|
|
172
|
-
x:
|
|
171
|
+
width: u = 1e3,
|
|
172
|
+
x: c = 0,
|
|
173
173
|
y: d = 0
|
|
174
174
|
} = n || {}, l = document.createElement("iframe");
|
|
175
175
|
l.src = e, l.style.backgroundColor = Et(t), l.style.border = i > 0 ? `${i}px solid ${Et(o)}` : "none", l.style.pointerEvents = a;
|
|
176
|
-
const
|
|
177
|
-
return l.style.height = i === 0 ?
|
|
176
|
+
const f = (100 / s).toFixed(3) + "%";
|
|
177
|
+
return l.style.height = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.width = i === 0 ? f : `calc(${f} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left", N0({
|
|
178
178
|
content: l,
|
|
179
179
|
anchor: r,
|
|
180
180
|
height: h,
|
|
181
|
-
width:
|
|
182
|
-
x:
|
|
181
|
+
width: u,
|
|
182
|
+
x: c,
|
|
183
183
|
y: d
|
|
184
184
|
});
|
|
185
185
|
}
|
|
@@ -187,11 +187,11 @@ const xt = {
|
|
|
187
187
|
LEFT: "left",
|
|
188
188
|
CENTER: "center",
|
|
189
189
|
RIGHT: "right"
|
|
190
|
-
},
|
|
190
|
+
}, oe = xt.LEFT;
|
|
191
191
|
function st(n, e) {
|
|
192
192
|
throw new Error("Unexpected value: " + n);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function kn(n = null) {
|
|
195
195
|
const {
|
|
196
196
|
alignment: e = xt.LEFT,
|
|
197
197
|
scale: t = 1,
|
|
@@ -201,22 +201,22 @@ function Ln(n = null) {
|
|
|
201
201
|
x: s = 0,
|
|
202
202
|
y: r = 0
|
|
203
203
|
} = n || {};
|
|
204
|
-
function h(
|
|
205
|
-
const
|
|
206
|
-
switch (
|
|
204
|
+
function h(u) {
|
|
205
|
+
const c = document.createElement("video");
|
|
206
|
+
switch (c.autoplay = !0, c.style.transform = `scale(${t})`, e) {
|
|
207
207
|
case xt.LEFT:
|
|
208
|
-
|
|
208
|
+
c.style.transformOrigin = "top left";
|
|
209
209
|
break;
|
|
210
210
|
case xt.CENTER:
|
|
211
|
-
|
|
211
|
+
c.style.transformOrigin = "top center";
|
|
212
212
|
break;
|
|
213
213
|
case xt.RIGHT:
|
|
214
|
-
|
|
214
|
+
c.style.transformOrigin = "top right";
|
|
215
215
|
break;
|
|
216
216
|
default:
|
|
217
217
|
st(e);
|
|
218
218
|
}
|
|
219
|
-
|
|
219
|
+
u.appendChild(c);
|
|
220
220
|
const d = {
|
|
221
221
|
video: {
|
|
222
222
|
displaySurface: "window"
|
|
@@ -224,17 +224,17 @@ function Ln(n = null) {
|
|
|
224
224
|
audio: !1
|
|
225
225
|
};
|
|
226
226
|
return navigator.mediaDevices.getDisplayMedia(d).then((l) => {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}),
|
|
227
|
+
const f = l.getVideoTracks()[0];
|
|
228
|
+
f !== void 0 && (f.onended = function() {
|
|
229
|
+
c.style.display = "none";
|
|
230
|
+
}), c.srcObject = l, c.play();
|
|
231
231
|
}).catch((l) => {
|
|
232
232
|
console.error("Could not start screen capture -", l);
|
|
233
233
|
}), () => {
|
|
234
|
-
|
|
234
|
+
c.srcObject.getTracks().forEach((f) => f.stop()), c.style.display = "none", c.srcObject = null;
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
|
-
return
|
|
237
|
+
return N0({
|
|
238
238
|
content: null,
|
|
239
239
|
setup: h,
|
|
240
240
|
anchor: o,
|
|
@@ -265,7 +265,7 @@ function lt(n) {
|
|
|
265
265
|
...n
|
|
266
266
|
};
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function In(n = null) {
|
|
269
269
|
const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
|
|
270
270
|
return lt({
|
|
271
271
|
objectType: U.ARROW,
|
|
@@ -283,8 +283,8 @@ function Tn(n = null) {
|
|
|
283
283
|
...o
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
286
|
+
const se = 50;
|
|
287
|
+
function _n(n = null) {
|
|
288
288
|
return lt({
|
|
289
289
|
objectType: U.CIRCLE,
|
|
290
290
|
anchor: ht,
|
|
@@ -292,13 +292,13 @@ function Cn(n = null) {
|
|
|
292
292
|
strokeWidth: 0,
|
|
293
293
|
drawn: 1,
|
|
294
294
|
fillColor: Q,
|
|
295
|
-
radius:
|
|
295
|
+
radius: se,
|
|
296
296
|
x: 0,
|
|
297
297
|
y: 0,
|
|
298
298
|
...n
|
|
299
299
|
});
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function c0(n, e = null) {
|
|
302
302
|
return lt({
|
|
303
303
|
objectType: U.GROUP,
|
|
304
304
|
anchor: ht,
|
|
@@ -323,7 +323,7 @@ function h0(n, e = null) {
|
|
|
323
323
|
...e
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function On(n) {
|
|
327
327
|
const {
|
|
328
328
|
anchor: e = ht,
|
|
329
329
|
cols: t = 1,
|
|
@@ -333,30 +333,30 @@ function Pn(n) {
|
|
|
333
333
|
groupProps: s = {},
|
|
334
334
|
width: r = 0,
|
|
335
335
|
height: h = 0,
|
|
336
|
-
x:
|
|
337
|
-
y:
|
|
336
|
+
x: u = 0,
|
|
337
|
+
y: c = 0,
|
|
338
338
|
objects: d = () => null
|
|
339
|
-
} = n, l = [],
|
|
339
|
+
} = n, l = [], f = [];
|
|
340
340
|
let m = 0, y = 0;
|
|
341
341
|
for (let E = 0; E < o; E++) {
|
|
342
342
|
const L = [];
|
|
343
343
|
m = 0;
|
|
344
344
|
let C = 0;
|
|
345
345
|
for (let S = 0; S < t; S++) {
|
|
346
|
-
const T = d(E, S), I = typeof r == "function" ? r(E, S) : r,
|
|
347
|
-
L.push(T), T != null &&
|
|
348
|
-
|
|
346
|
+
const T = d(E, S), I = typeof r == "function" ? r(E, S) : r, R = typeof h == "function" ? h(E, S) : h;
|
|
347
|
+
L.push(T), T != null && f.push(
|
|
348
|
+
c0([T], {
|
|
349
349
|
x: m,
|
|
350
350
|
y
|
|
351
351
|
})
|
|
352
|
-
), m += I + i, C = Math.max(C,
|
|
352
|
+
), m += I + i, C = Math.max(C, R);
|
|
353
353
|
}
|
|
354
354
|
l.push(L), y += C + a;
|
|
355
355
|
}
|
|
356
356
|
return {
|
|
357
|
-
grid:
|
|
358
|
-
x:
|
|
359
|
-
y:
|
|
357
|
+
grid: c0(f, {
|
|
358
|
+
x: u,
|
|
359
|
+
y: c,
|
|
360
360
|
height: y - a,
|
|
361
361
|
width: m - i,
|
|
362
362
|
anchor: e,
|
|
@@ -365,7 +365,7 @@ function Pn(n) {
|
|
|
365
365
|
objects: l
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Fn(n = null) {
|
|
369
369
|
return lt({
|
|
370
370
|
objectType: U.IMAGE,
|
|
371
371
|
anchor: ht,
|
|
@@ -379,7 +379,7 @@ function En(n = null) {
|
|
|
379
379
|
...n
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Nn(n = null) {
|
|
383
383
|
return lt({
|
|
384
384
|
objectType: U.LINE,
|
|
385
385
|
color: Q,
|
|
@@ -394,7 +394,7 @@ function Sn(n = null) {
|
|
|
394
394
|
...n
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function Rn(n, e = null) {
|
|
398
398
|
return lt({
|
|
399
399
|
objectType: U.MASK,
|
|
400
400
|
anchor: ht,
|
|
@@ -407,11 +407,11 @@ function kn(n, e = null) {
|
|
|
407
407
|
...e
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
|
-
var
|
|
411
|
-
const e = (n && n.length > 0 ? n : "M0,0").match(
|
|
410
|
+
var ae = Object.defineProperty, O = (n, e) => ae(n, "name", { value: e, configurable: !0 }), Ct = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, he = /([astvzqmhlc])([^astvzqmhlc]*)/gi, le = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, ce = O((n) => {
|
|
411
|
+
const e = (n && n.length > 0 ? n : "M0,0").match(he);
|
|
412
412
|
if (!e) throw new Error(`No path elements found in string ${n}`);
|
|
413
413
|
return e.reduce((t, o) => {
|
|
414
|
-
let i = o.charAt(0), a = i.toLowerCase(), s =
|
|
414
|
+
let i = o.charAt(0), a = i.toLowerCase(), s = ue(o.substring(1));
|
|
415
415
|
if (a === "m" && s.length > 2 && (t.push([i, ...s.splice(0, 2)]), a = "l", i = i === "m" ? "l" : "L"), a.toLowerCase() === "a" && (s.length === 5 || s.length === 6)) {
|
|
416
416
|
const r = o.substring(1).trim().split(" ");
|
|
417
417
|
s = [Number(r[0]), Number(r[1]), Number(r[2]), Number(r[3].charAt(0)), Number(r[3].charAt(1)), Number(r[3].substring(2)), Number(r[4])];
|
|
@@ -426,8 +426,8 @@ var te = Object.defineProperty, O = (n, e) => te(n, "name", { value: e, configur
|
|
|
426
426
|
}
|
|
427
427
|
return t;
|
|
428
428
|
}, []);
|
|
429
|
-
}, "default"),
|
|
430
|
-
const e = n.match(
|
|
429
|
+
}, "default"), ue = O((n) => {
|
|
430
|
+
const e = n.match(le);
|
|
431
431
|
return e ? e.map(Number) : [];
|
|
432
432
|
}, "parseValues"), wt, J = (wt = class {
|
|
433
433
|
constructor(e, t, o, i) {
|
|
@@ -452,8 +452,8 @@ var te = Object.defineProperty, O = (n, e) => te(n, "name", { value: e, configur
|
|
|
452
452
|
}, "getPropertiesAtLength"));
|
|
453
453
|
this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
|
|
454
454
|
}
|
|
455
|
-
}, O(wt, "LinearPosition"), wt), mt,
|
|
456
|
-
constructor(e, t, o, i, a, s, r, h,
|
|
455
|
+
}, O(wt, "LinearPosition"), wt), mt, u0 = (mt = class {
|
|
456
|
+
constructor(e, t, o, i, a, s, r, h, u) {
|
|
457
457
|
k(this, "x0");
|
|
458
458
|
k(this, "y0");
|
|
459
459
|
k(this, "rx");
|
|
@@ -467,7 +467,7 @@ var te = Object.defineProperty, O = (n, e) => te(n, "name", { value: e, configur
|
|
|
467
467
|
k(this, "getTotalLength", O(() => this.length, "getTotalLength"));
|
|
468
468
|
k(this, "getPointAtLength", O((e) => {
|
|
469
469
|
e < 0 ? e = 0 : e > this.length && (e = this.length);
|
|
470
|
-
const t =
|
|
470
|
+
const t = f0({ x: this.x0, y: this.y0 }, this.rx, this.ry, this.xAxisRotate, this.LargeArcFlag, this.SweepFlag, { x: this.x1, y: this.y1 }, e / this.length);
|
|
471
471
|
return { x: t.x, y: t.y };
|
|
472
472
|
}, "getPointAtLength"));
|
|
473
473
|
k(this, "getTangentAtLength", O((e) => {
|
|
@@ -482,77 +482,77 @@ var te = Object.defineProperty, O = (n, e) => te(n, "name", { value: e, configur
|
|
|
482
482
|
const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
|
|
483
483
|
return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
|
|
484
484
|
}, "getPropertiesAtLength"));
|
|
485
|
-
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = h, this.y1 =
|
|
486
|
-
const
|
|
487
|
-
return
|
|
485
|
+
this.x0 = e, this.y0 = t, this.rx = o, this.ry = i, this.xAxisRotate = a, this.LargeArcFlag = s, this.SweepFlag = r, this.x1 = h, this.y1 = u;
|
|
486
|
+
const c = fe(300, function(d) {
|
|
487
|
+
return f0({ x: e, y: t }, o, i, a, s, r, { x: h, y: u }, d);
|
|
488
488
|
});
|
|
489
|
-
this.length =
|
|
489
|
+
this.length = c.arcLength;
|
|
490
490
|
}
|
|
491
|
-
}, O(mt, "Arc"), mt),
|
|
492
|
-
e = Math.abs(e), t = Math.abs(t), o =
|
|
493
|
-
const h =
|
|
491
|
+
}, O(mt, "Arc"), mt), f0 = O((n, e, t, o, i, a, s, r) => {
|
|
492
|
+
e = Math.abs(e), t = Math.abs(t), o = ge(o, 360);
|
|
493
|
+
const h = pe(o);
|
|
494
494
|
if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
|
|
495
495
|
if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
|
|
496
|
-
const
|
|
496
|
+
const u = (n.x - s.x) / 2, c = (n.y - s.y) / 2, d = { x: Math.cos(h) * u + Math.sin(h) * c, y: -Math.sin(h) * u + Math.cos(h) * c }, l = Math.pow(d.x, 2) / Math.pow(e, 2) + Math.pow(d.y, 2) / Math.pow(t, 2);
|
|
497
497
|
l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
|
|
498
|
-
let
|
|
499
|
-
|
|
500
|
-
const m = (i !== a ? 1 : -1) * Math.sqrt(
|
|
501
|
-
let S =
|
|
498
|
+
let f = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(d.y, 2) - Math.pow(t, 2) * Math.pow(d.x, 2)) / (Math.pow(e, 2) * Math.pow(d.y, 2) + Math.pow(t, 2) * Math.pow(d.x, 2));
|
|
499
|
+
f = f < 0 ? 0 : f;
|
|
500
|
+
const m = (i !== a ? 1 : -1) * Math.sqrt(f), y = m * (e * d.y / t), M = m * (-t * d.x / e), E = { x: Math.cos(h) * y - Math.sin(h) * M + (n.x + s.x) / 2, y: Math.sin(h) * y + Math.cos(h) * M + (n.y + s.y) / 2 }, L = { x: (d.x - y) / e, y: (d.y - M) / t }, C = p0({ x: 1, y: 0 }, L);
|
|
501
|
+
let S = p0(L, { x: (-d.x - y) / e, y: (-d.y - M) / t });
|
|
502
502
|
!a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
|
|
503
|
-
const T = C + S * r, I = e * Math.cos(T),
|
|
504
|
-
return { x: Math.cos(h) * I - Math.sin(h) *
|
|
505
|
-
}, "pointOnEllipticalArc"),
|
|
503
|
+
const T = C + S * r, I = e * Math.cos(T), R = t * Math.sin(T);
|
|
504
|
+
return { x: Math.cos(h) * I - Math.sin(h) * R + E.x, y: Math.sin(h) * I + Math.cos(h) * R + E.y, ellipticalArcStartAngle: C, ellipticalArcEndAngle: C + S, ellipticalArcAngle: T, ellipticalArcCenter: E, resultantRx: e, resultantRy: t };
|
|
505
|
+
}, "pointOnEllipticalArc"), fe = O((n, e) => {
|
|
506
506
|
n = n ?? 500;
|
|
507
507
|
let t = 0;
|
|
508
508
|
const o = [], i = [];
|
|
509
509
|
let a, s = e(0);
|
|
510
510
|
for (let r = 0; r < n; r++) {
|
|
511
|
-
const h =
|
|
512
|
-
a = e(h), t +=
|
|
511
|
+
const h = de(r * (1 / n), 0, 1);
|
|
512
|
+
a = e(h), t += g0(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
|
|
513
513
|
}
|
|
514
|
-
return a = e(1), i.push([s, a]), t +=
|
|
515
|
-
}, "approximateArcLengthOfCurve"),
|
|
514
|
+
return a = e(1), i.push([s, a]), t += g0(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
|
|
515
|
+
}, "approximateArcLengthOfCurve"), ge = O((n, e) => (n % e + e) % e, "mod"), pe = O((n) => n * (Math.PI / 180), "toRadians"), g0 = O((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), de = O((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), p0 = O((n, e) => {
|
|
516
516
|
const t = n.x * e.x + n.y * e.y, o = Math.sqrt((Math.pow(n.x, 2) + Math.pow(n.y, 2)) * (Math.pow(e.x, 2) + Math.pow(e.y, 2)));
|
|
517
517
|
return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
|
|
518
|
-
}, "angleBetween"), le = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], ce = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], ue = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], fe = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), ge = O((n, e, t) => F0([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), pe = O((n, e, t) => {
|
|
518
|
+
}, "angleBetween"), xe = [[], [], [-0.5773502691896257, 0.5773502691896258], [0, -0.7745966692414833, 0.7745966692414833], [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526], [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664], [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152], [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585], [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363], [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904], [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717], [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057], [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192], [0, -0.2304583159551348, 0.2304583159551348, -0.44849275103644687, 0.44849275103644687, -0.6423493394403402, 0.6423493394403402, -0.8015780907333099, 0.8015780907333099, -0.9175983992229779, 0.9175983992229779, -0.9841830547185881, 0.9841830547185881], [-0.10805494870734367, 0.10805494870734367, -0.31911236892788974, 0.31911236892788974, -0.5152486363581541, 0.5152486363581541, -0.6872929048116855, 0.6872929048116855, -0.827201315069765, 0.827201315069765, -0.9284348836635735, 0.9284348836635735, -0.9862838086968123, 0.9862838086968123], [0, -0.20119409399743451, 0.20119409399743451, -0.3941513470775634, 0.3941513470775634, -0.5709721726085388, 0.5709721726085388, -0.7244177313601701, 0.7244177313601701, -0.8482065834104272, 0.8482065834104272, -0.937273392400706, 0.937273392400706, -0.9879925180204854, 0.9879925180204854], [-0.09501250983763744, 0.09501250983763744, -0.2816035507792589, 0.2816035507792589, -0.45801677765722737, 0.45801677765722737, -0.6178762444026438, 0.6178762444026438, -0.755404408355003, 0.755404408355003, -0.8656312023878318, 0.8656312023878318, -0.9445750230732326, 0.9445750230732326, -0.9894009349916499, 0.9894009349916499], [0, -0.17848418149584785, 0.17848418149584785, -0.3512317634538763, 0.3512317634538763, -0.5126905370864769, 0.5126905370864769, -0.6576711592166907, 0.6576711592166907, -0.7815140038968014, 0.7815140038968014, -0.8802391537269859, 0.8802391537269859, -0.9506755217687678, 0.9506755217687678, -0.9905754753144174, 0.9905754753144174], [-0.0847750130417353, 0.0847750130417353, -0.2518862256915055, 0.2518862256915055, -0.41175116146284263, 0.41175116146284263, -0.5597708310739475, 0.5597708310739475, -0.6916870430603532, 0.6916870430603532, -0.8037049589725231, 0.8037049589725231, -0.8926024664975557, 0.8926024664975557, -0.9558239495713977, 0.9558239495713977, -0.9915651684209309, 0.9915651684209309], [0, -0.16035864564022537, 0.16035864564022537, -0.31656409996362983, 0.31656409996362983, -0.46457074137596094, 0.46457074137596094, -0.600545304661681, 0.600545304661681, -0.7209661773352294, 0.7209661773352294, -0.8227146565371428, 0.8227146565371428, -0.9031559036148179, 0.9031559036148179, -0.96020815213483, 0.96020815213483, -0.9924068438435844, 0.9924068438435844], [-0.07652652113349734, 0.07652652113349734, -0.22778585114164507, 0.22778585114164507, -0.37370608871541955, 0.37370608871541955, -0.5108670019508271, 0.5108670019508271, -0.636053680726515, 0.636053680726515, -0.7463319064601508, 0.7463319064601508, -0.8391169718222188, 0.8391169718222188, -0.912234428251326, 0.912234428251326, -0.9639719272779138, 0.9639719272779138, -0.9931285991850949, 0.9931285991850949], [0, -0.1455618541608951, 0.1455618541608951, -0.2880213168024011, 0.2880213168024011, -0.4243421202074388, 0.4243421202074388, -0.5516188358872198, 0.5516188358872198, -0.6671388041974123, 0.6671388041974123, -0.7684399634756779, 0.7684399634756779, -0.8533633645833173, 0.8533633645833173, -0.9200993341504008, 0.9200993341504008, -0.9672268385663063, 0.9672268385663063, -0.9937521706203895, 0.9937521706203895], [-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992], [0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522], [-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]], ye = [[], [], [1, 1], [0.8888888888888888, 0.5555555555555556, 0.5555555555555556], [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385], [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908], [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036], [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697], [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626], [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544], [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814], [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366], [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183], [0.2325515532308739, 0.22628318026289723, 0.22628318026289723, 0.2078160475368885, 0.2078160475368885, 0.17814598076194574, 0.17814598076194574, 0.13887351021978725, 0.13887351021978725, 0.09212149983772845, 0.09212149983772845, 0.04048400476531588, 0.04048400476531588], [0.2152638534631578, 0.2152638534631578, 0.2051984637212956, 0.2051984637212956, 0.18553839747793782, 0.18553839747793782, 0.15720316715819355, 0.15720316715819355, 0.12151857068790319, 0.12151857068790319, 0.08015808715976021, 0.08015808715976021, 0.03511946033175186, 0.03511946033175186], [0.2025782419255613, 0.19843148532711158, 0.19843148532711158, 0.1861610000155622, 0.1861610000155622, 0.16626920581699392, 0.16626920581699392, 0.13957067792615432, 0.13957067792615432, 0.10715922046717194, 0.10715922046717194, 0.07036604748810812, 0.07036604748810812, 0.03075324199611727, 0.03075324199611727], [0.1894506104550685, 0.1894506104550685, 0.18260341504492358, 0.18260341504492358, 0.16915651939500254, 0.16915651939500254, 0.14959598881657674, 0.14959598881657674, 0.12462897125553388, 0.12462897125553388, 0.09515851168249279, 0.09515851168249279, 0.062253523938647894, 0.062253523938647894, 0.027152459411754096, 0.027152459411754096], [0.17944647035620653, 0.17656270536699264, 0.17656270536699264, 0.16800410215645004, 0.16800410215645004, 0.15404576107681028, 0.15404576107681028, 0.13513636846852548, 0.13513636846852548, 0.11188384719340397, 0.11188384719340397, 0.08503614831717918, 0.08503614831717918, 0.0554595293739872, 0.0554595293739872, 0.02414830286854793, 0.02414830286854793], [0.1691423829631436, 0.1691423829631436, 0.16427648374583273, 0.16427648374583273, 0.15468467512626524, 0.15468467512626524, 0.14064291467065065, 0.14064291467065065, 0.12255520671147846, 0.12255520671147846, 0.10094204410628717, 0.10094204410628717, 0.07642573025488905, 0.07642573025488905, 0.0497145488949698, 0.0497145488949698, 0.02161601352648331, 0.02161601352648331], [0.1610544498487837, 0.15896884339395434, 0.15896884339395434, 0.15276604206585967, 0.15276604206585967, 0.1426067021736066, 0.1426067021736066, 0.12875396253933621, 0.12875396253933621, 0.11156664554733399, 0.11156664554733399, 0.09149002162245, 0.09149002162245, 0.06904454273764123, 0.06904454273764123, 0.0448142267656996, 0.0448142267656996, 0.019461788229726478, 0.019461788229726478], [0.15275338713072584, 0.15275338713072584, 0.14917298647260374, 0.14917298647260374, 0.14209610931838204, 0.14209610931838204, 0.13168863844917664, 0.13168863844917664, 0.11819453196151841, 0.11819453196151841, 0.10193011981724044, 0.10193011981724044, 0.08327674157670475, 0.08327674157670475, 0.06267204833410907, 0.06267204833410907, 0.04060142980038694, 0.04060142980038694, 0.017614007139152118, 0.017614007139152118], [0.14608113364969041, 0.14452440398997005, 0.14452440398997005, 0.13988739479107315, 0.13988739479107315, 0.13226893863333747, 0.13226893863333747, 0.12183141605372853, 0.12183141605372853, 0.10879729916714838, 0.10879729916714838, 0.09344442345603386, 0.09344442345603386, 0.0761001136283793, 0.0761001136283793, 0.057134425426857205, 0.057134425426857205, 0.036953789770852494, 0.036953789770852494, 0.016017228257774335, 0.016017228257774335], [0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722], [0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771], [0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]], ve = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], we = O((n, e, t) => ({ x: (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], y: (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3] }), "cubicPoint"), me = O((n, e, t) => B0([3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])], [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])], t), "cubicDerivative"), be = O((n, e, t) => {
|
|
519
519
|
let o, i;
|
|
520
520
|
const a = t / 2;
|
|
521
521
|
o = 0;
|
|
522
|
-
for (let s = 0; s < 20; s++) i = a *
|
|
522
|
+
for (let s = 0; s < 20; s++) i = a * xe[20][s] + a, o += ye[20][s] * D0(n, e, i);
|
|
523
523
|
return a * o;
|
|
524
|
-
}, "getCubicArcLength"),
|
|
524
|
+
}, "getCubicArcLength"), B0 = O((n, e, t) => ({ x: (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], y: (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2] }), "quadraticPoint"), Ae = O((n, e, t) => {
|
|
525
525
|
t === void 0 && (t = 1);
|
|
526
|
-
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s),
|
|
526
|
+
const o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), u = a * a + s * s;
|
|
527
527
|
if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
528
|
-
const
|
|
529
|
-
return Math.sqrt(r) / 2 * (d *
|
|
530
|
-
}, "getQuadraticArcLength"),
|
|
531
|
-
function
|
|
532
|
-
const o =
|
|
528
|
+
const c = h / (2 * r), d = t + c, l = u / r - c * c, f = d * d + l > 0 ? Math.sqrt(d * d + l) : 0, m = c * c + l > 0 ? Math.sqrt(c * c + l) : 0, y = c + Math.sqrt(c * c + l) !== 0 && (d + f) / (c + m) !== 0 ? l * Math.log(Math.abs((d + f) / (c + m))) : 0;
|
|
529
|
+
return Math.sqrt(r) / 2 * (d * f - c * m + y);
|
|
530
|
+
}, "getQuadraticArcLength"), Me = O((n, e, t) => ({ x: 2 * (1 - t) * (n[1] - n[0]) + 2 * t * (n[2] - n[1]), y: 2 * (1 - t) * (e[1] - e[0]) + 2 * t * (e[2] - e[1]) }), "quadraticDerivative");
|
|
531
|
+
function D0(n, e, t) {
|
|
532
|
+
const o = Vt(1, t, n), i = Vt(1, t, e), a = o * o + i * i;
|
|
533
533
|
return Math.sqrt(a);
|
|
534
534
|
}
|
|
535
|
-
O(
|
|
536
|
-
var
|
|
535
|
+
O(D0, "BFunc");
|
|
536
|
+
var Vt = O((n, e, t) => {
|
|
537
537
|
const o = t.length - 1;
|
|
538
538
|
let i, a;
|
|
539
539
|
if (o === 0) return 0;
|
|
540
540
|
if (n === 0) {
|
|
541
541
|
a = 0;
|
|
542
|
-
for (let s = 0; s <= o; s++) a +=
|
|
542
|
+
for (let s = 0; s <= o; s++) a += ve[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
543
543
|
return a;
|
|
544
544
|
}
|
|
545
545
|
i = new Array(o);
|
|
546
546
|
for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
|
|
547
|
-
return
|
|
548
|
-
}, "getDerivative"),
|
|
547
|
+
return Vt(n - 1, e, i);
|
|
548
|
+
}, "getDerivative"), Bt = O((n, e, t) => {
|
|
549
549
|
let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
|
|
550
550
|
for (; o > 1e-3; ) {
|
|
551
551
|
const r = t(i + a), h = Math.abs(n - r) / e;
|
|
552
552
|
if (h < o) o = h, i += a;
|
|
553
553
|
else {
|
|
554
|
-
const
|
|
555
|
-
|
|
554
|
+
const u = t(i - a), c = Math.abs(n - u) / e;
|
|
555
|
+
c < o ? (o = c, i -= a) : a /= 2;
|
|
556
556
|
}
|
|
557
557
|
if (s++, s > 500) break;
|
|
558
558
|
}
|
|
@@ -569,16 +569,16 @@ var Zt = O((n, e, t) => {
|
|
|
569
569
|
k(this, "getDerivative");
|
|
570
570
|
k(this, "getTotalLength", O(() => this.length, "getTotalLength"));
|
|
571
571
|
k(this, "getPointAtLength", O((e) => {
|
|
572
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
572
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Bt(e, this.length, (a) => this.getArcLength(t, o, a));
|
|
573
573
|
return this.getPoint(t, o, i);
|
|
574
574
|
}, "getPointAtLength"));
|
|
575
575
|
k(this, "getTangentAtLength", O((e) => {
|
|
576
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
576
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Bt(e, this.length, (h) => this.getArcLength(t, o, h)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
577
577
|
let r;
|
|
578
578
|
return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
|
|
579
579
|
}, "getTangentAtLength"));
|
|
580
580
|
k(this, "getPropertiesAtLength", O((e) => {
|
|
581
|
-
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i =
|
|
581
|
+
const t = [this.a.x, this.b.x, this.c.x, this.d.x], o = [this.a.y, this.b.y, this.c.y, this.d.y], i = Bt(e, this.length, (u) => this.getArcLength(t, o, u)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
|
|
582
582
|
let r;
|
|
583
583
|
r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
|
|
584
584
|
const h = this.getPoint(t, o, i);
|
|
@@ -586,9 +586,9 @@ var Zt = O((n, e, t) => {
|
|
|
586
586
|
}, "getPropertiesAtLength"));
|
|
587
587
|
k(this, "getC", O(() => this.c, "getC"));
|
|
588
588
|
k(this, "getD", O(() => this.d, "getD"));
|
|
589
|
-
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength =
|
|
589
|
+
this.a = { x: e, y: t }, this.b = { x: o, y: i }, this.c = { x: a, y: s }, r !== void 0 && h !== void 0 ? (this.getArcLength = be, this.getPoint = we, this.getDerivative = me, this.d = { x: r, y: h }) : (this.getArcLength = Ae, this.getPoint = B0, this.getDerivative = Me, this.d = { x: 0, y: 0 }), this.length = this.getArcLength([this.a.x, this.b.x, this.c.x, this.d.x], [this.a.y, this.b.y, this.c.y, this.d.y], 1);
|
|
590
590
|
}
|
|
591
|
-
}, O(bt, "Bezier"), bt), At,
|
|
591
|
+
}, O(bt, "Bezier"), bt), At, Le = (At = class {
|
|
592
592
|
constructor(e) {
|
|
593
593
|
k(this, "length", 0);
|
|
594
594
|
k(this, "partial_lengths", []);
|
|
@@ -628,7 +628,7 @@ var Zt = O((n, e, t) => {
|
|
|
628
628
|
}
|
|
629
629
|
return e;
|
|
630
630
|
}, "getParts"));
|
|
631
|
-
const t = Array.isArray(e) ? e :
|
|
631
|
+
const t = Array.isArray(e) ? e : ce(e);
|
|
632
632
|
let o, i = [0, 0], a = [0, 0], s = [0, 0];
|
|
633
633
|
for (let r = 0; r < t.length; r++) {
|
|
634
634
|
if (t[r][0] === "M") i = [t[r][1], t[r][2]], s = [i[0], i[1]], this.functions.push(null), r === 0 && (this.initial_point = { x: t[r][1], y: t[r][2] });
|
|
@@ -653,8 +653,8 @@ var Zt = O((n, e, t) => {
|
|
|
653
653
|
} else if (t[r][0] === "s") {
|
|
654
654
|
if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
|
|
655
655
|
if (o) {
|
|
656
|
-
const h = o.getC(),
|
|
657
|
-
o = new ct(i[0], i[1], i[0] +
|
|
656
|
+
const h = o.getC(), u = o.getD();
|
|
657
|
+
o = new ct(i[0], i[1], i[0] + u.x - h.x, i[1] + u.y - h.y, i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
658
658
|
}
|
|
659
659
|
} else o = new ct(i[0], i[1], i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
|
|
660
660
|
o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
|
|
@@ -686,16 +686,16 @@ var Zt = O((n, e, t) => {
|
|
|
686
686
|
}
|
|
687
687
|
a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
|
|
688
688
|
} else if (t[r][0] === "A") {
|
|
689
|
-
const h = new
|
|
689
|
+
const h = new u0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, t[r][6], t[r][7]);
|
|
690
690
|
this.length += h.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(h);
|
|
691
691
|
} else if (t[r][0] === "a") {
|
|
692
|
-
const h = new
|
|
692
|
+
const h = new u0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4] === 1, t[r][5] === 1, i[0] + t[r][6], i[1] + t[r][7]);
|
|
693
693
|
this.length += h.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(h);
|
|
694
694
|
}
|
|
695
695
|
this.partial_lengths.push(this.length);
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
}, O(At, "SVGPathProperties"), At), Mt,
|
|
698
|
+
}, O(At, "SVGPathProperties"), At), Mt, Kt = (Mt = class {
|
|
699
699
|
constructor(e) {
|
|
700
700
|
k(this, "inst");
|
|
701
701
|
k(this, "getTotalLength", O(() => this.inst.getTotalLength(), "getTotalLength"));
|
|
@@ -703,24 +703,24 @@ var Zt = O((n, e, t) => {
|
|
|
703
703
|
k(this, "getTangentAtLength", O((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
|
|
704
704
|
k(this, "getPropertiesAtLength", O((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
|
|
705
705
|
k(this, "getParts", O(() => this.inst.getParts(), "getParts"));
|
|
706
|
-
if (this.inst = new
|
|
706
|
+
if (this.inst = new Le(e), !(this instanceof Kt)) return new Kt(e);
|
|
707
707
|
}
|
|
708
708
|
}, O(Mt, "_svgPathProperties"), Mt);
|
|
709
|
-
function
|
|
709
|
+
function Te(n = G.BLACK) {
|
|
710
710
|
return { ...n, alpha: 0 };
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100",
|
|
712
|
+
function Bn(n = null) {
|
|
713
|
+
const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", u = new Kt(r).getTotalLength();
|
|
714
714
|
return lt({
|
|
715
715
|
objectType: U.PATH,
|
|
716
716
|
anchor: ht,
|
|
717
717
|
strokeColor: Q,
|
|
718
718
|
drawn: 1,
|
|
719
|
-
fillColor:
|
|
719
|
+
fillColor: Te(),
|
|
720
720
|
isRounded: !1,
|
|
721
721
|
height: t,
|
|
722
722
|
path: r,
|
|
723
|
-
pathLength:
|
|
723
|
+
pathLength: u,
|
|
724
724
|
strokeWidth: 4,
|
|
725
725
|
viewboxHeight: i ?? t,
|
|
726
726
|
viewboxWidth: a ?? o,
|
|
@@ -730,7 +730,7 @@ function In(n = null) {
|
|
|
730
730
|
...s
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function Dn(n = null) {
|
|
734
734
|
return lt({
|
|
735
735
|
objectType: U.POLYGON,
|
|
736
736
|
strokeColor: Q,
|
|
@@ -745,7 +745,7 @@ function _n(n = null) {
|
|
|
745
745
|
...n
|
|
746
746
|
});
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function qn(n = null) {
|
|
749
749
|
return lt({
|
|
750
750
|
objectType: U.RECTANGLE,
|
|
751
751
|
anchor: ht,
|
|
@@ -761,7 +761,7 @@ function On(n = null) {
|
|
|
761
761
|
...n
|
|
762
762
|
});
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function zn(n = null) {
|
|
765
765
|
return lt({
|
|
766
766
|
objectType: U.SVG,
|
|
767
767
|
anchor: ht,
|
|
@@ -773,11 +773,11 @@ function Fn(n = null) {
|
|
|
773
773
|
...n
|
|
774
774
|
});
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const Ce = {
|
|
777
777
|
NORMAL: "normal",
|
|
778
778
|
ITALIC: "italic",
|
|
779
779
|
OBLIQUE: "oblique"
|
|
780
|
-
},
|
|
780
|
+
}, Pe = Ce.NORMAL, Ee = {
|
|
781
781
|
THIN: 100,
|
|
782
782
|
EXTRA_LIGHT: 200,
|
|
783
783
|
LIGHT: 300,
|
|
@@ -787,63 +787,176 @@ const we = {
|
|
|
787
787
|
BOLD: 700,
|
|
788
788
|
EXTRA_BOLD: 800,
|
|
789
789
|
BLACK: 900
|
|
790
|
-
},
|
|
790
|
+
}, Se = Ee.NORMAL, ke = {
|
|
791
791
|
color: Q,
|
|
792
792
|
fontFamily: "sans-serif",
|
|
793
793
|
fontSize: 100,
|
|
794
|
-
fontStyle:
|
|
795
|
-
fontWeight:
|
|
794
|
+
fontStyle: Pe,
|
|
795
|
+
fontWeight: Se,
|
|
796
796
|
ligatures: !1,
|
|
797
797
|
subscript: !1,
|
|
798
798
|
superscript: !1
|
|
799
799
|
};
|
|
800
|
-
function
|
|
800
|
+
function q0(n) {
|
|
801
801
|
return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
|
|
802
802
|
}
|
|
803
|
-
function
|
|
804
|
-
return
|
|
803
|
+
function Ie(n) {
|
|
804
|
+
return q0(n).reduce(
|
|
805
805
|
(t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
|
|
806
806
|
0
|
|
807
807
|
);
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function _e(n = "", e = null) {
|
|
810
810
|
return lt({
|
|
811
811
|
objectType: U.TEXT,
|
|
812
|
-
alignment:
|
|
812
|
+
alignment: oe,
|
|
813
813
|
anchor: ht,
|
|
814
814
|
length: null,
|
|
815
815
|
lineSpacing: 1,
|
|
816
816
|
text: n,
|
|
817
817
|
x: 0,
|
|
818
818
|
y: 0,
|
|
819
|
-
...
|
|
819
|
+
...ke,
|
|
820
820
|
...e
|
|
821
821
|
});
|
|
822
822
|
}
|
|
823
|
-
|
|
823
|
+
_e.writeOn = (n, e = {}) => o0(
|
|
824
824
|
n,
|
|
825
825
|
{
|
|
826
|
-
length:
|
|
826
|
+
length: Ie(n.text)
|
|
827
827
|
},
|
|
828
828
|
e
|
|
829
829
|
);
|
|
830
|
-
|
|
831
|
-
|
|
830
|
+
function z0(n) {
|
|
831
|
+
return n.altKey || n.ctrlKey || n.metaKey || n.shiftKey;
|
|
832
|
+
}
|
|
833
|
+
function d0(n) {
|
|
834
|
+
var o, i;
|
|
835
|
+
if (n === null)
|
|
836
|
+
return !1;
|
|
837
|
+
const e = n, t = (o = e.tagName) == null ? void 0 : o.toLowerCase();
|
|
838
|
+
return t === "input" || t === "textarea" || t === "select" || t === "button" || e.isContentEditable ? !0 : (((i = e.closest) == null ? void 0 : i.call(e, "[contenteditable=''], [contenteditable='true']")) ?? null) !== null;
|
|
839
|
+
}
|
|
840
|
+
function Oe(n) {
|
|
841
|
+
var o;
|
|
842
|
+
const { slides: e } = n, t = {
|
|
843
|
+
// First build of first slide
|
|
844
|
+
s: { slideIndex: 0, buildIndex: 0 },
|
|
845
|
+
// First build of current slide
|
|
846
|
+
c: { slideIndex: null, buildIndex: 0 },
|
|
847
|
+
// Last build of last slide
|
|
848
|
+
e: {
|
|
849
|
+
slideIndex: e.length - 1,
|
|
850
|
+
buildIndex: ((o = e[e.length - 1]) == null ? void 0 : o.animations.length) ?? 0
|
|
851
|
+
}
|
|
852
|
+
};
|
|
853
|
+
for (let i = 0; i < e.length; i++) {
|
|
854
|
+
const a = e[i];
|
|
855
|
+
if (a === void 0)
|
|
856
|
+
continue;
|
|
857
|
+
const s = a.shortcut;
|
|
858
|
+
Dt(t, s, i, 0);
|
|
859
|
+
for (let r = 0; r < a.animations.length; r++) {
|
|
860
|
+
const h = a.animations[r];
|
|
861
|
+
if (h !== void 0)
|
|
862
|
+
if (Array.isArray(h))
|
|
863
|
+
for (const u of h)
|
|
864
|
+
Dt(t, u.shortcut, i, r + 1);
|
|
865
|
+
else
|
|
866
|
+
Dt(t, h.shortcut, i, r + 1);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
return t;
|
|
870
|
+
}
|
|
871
|
+
function Dt(n, e, t, o) {
|
|
872
|
+
if (e !== null)
|
|
873
|
+
if (Array.isArray(e))
|
|
874
|
+
for (const i of e)
|
|
875
|
+
n[i] = { slideIndex: t, buildIndex: o };
|
|
876
|
+
else
|
|
877
|
+
n[e] = { slideIndex: t, buildIndex: o };
|
|
878
|
+
}
|
|
879
|
+
function j0(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }, { focusOnPointerDown: r = !1, keyEventTarget: h = e } = {}) {
|
|
880
|
+
t.shortcuts = Oe(n), r && (e.hasAttribute("tabindex") || (e.tabIndex = -1), e.addEventListener("pointerdown", (u) => {
|
|
881
|
+
d0(u.target) || e.focus({ preventScroll: !0 });
|
|
882
|
+
})), e.addEventListener("mousemove", () => {
|
|
883
|
+
e.style.cursor = "auto";
|
|
884
|
+
}), h.addEventListener("keyup", (u) => {
|
|
885
|
+
const c = u;
|
|
886
|
+
if (!d0(c.target)) {
|
|
887
|
+
if (c.code === "Escape") {
|
|
888
|
+
t.textCommand = null;
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
if (c.code === "ArrowRight" || c.code === "Space") {
|
|
892
|
+
o(c.shiftKey);
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
if (c.code === "ArrowLeft") {
|
|
896
|
+
i(c.shiftKey);
|
|
897
|
+
return;
|
|
898
|
+
}
|
|
899
|
+
if (t.textCommand !== null) {
|
|
900
|
+
if (c.code === "Enter") {
|
|
901
|
+
const d = t.textCommand;
|
|
902
|
+
t.textCommand = null;
|
|
903
|
+
const l = t.shortcuts[d];
|
|
904
|
+
l !== void 0 ? a(l.slideIndex, l.buildIndex) : isNaN(Number(d)) || a(Number(d) - 1, 0);
|
|
905
|
+
return;
|
|
906
|
+
} else c.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += c.key;
|
|
907
|
+
return;
|
|
908
|
+
}
|
|
909
|
+
if (c.key === "g") {
|
|
910
|
+
t.textCommand = "";
|
|
911
|
+
return;
|
|
912
|
+
}
|
|
913
|
+
if (c.key === "`" && !z0(c)) {
|
|
914
|
+
s();
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
let N = null, _t = null, H0 = {
|
|
921
|
+
width: 700,
|
|
922
|
+
height: 680,
|
|
923
|
+
left: 20,
|
|
924
|
+
top: 50
|
|
925
|
+
};
|
|
926
|
+
function Fe({
|
|
832
927
|
presentation: n,
|
|
833
|
-
|
|
834
|
-
|
|
928
|
+
shortcutState: e,
|
|
929
|
+
onNavigateToSlide: t,
|
|
930
|
+
onRenderSlide: o,
|
|
931
|
+
onNext: i,
|
|
932
|
+
onPrevious: a
|
|
835
933
|
}) {
|
|
836
|
-
if (
|
|
837
|
-
return
|
|
838
|
-
if (
|
|
934
|
+
if (N !== null && !N.closed)
|
|
935
|
+
return Ot(N), N.focus(), _t;
|
|
936
|
+
if (N = window.open("", "Navigator", De()), N === null)
|
|
839
937
|
return console.error("Failed to open navigator window."), null;
|
|
840
|
-
const
|
|
841
|
-
return
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
938
|
+
const s = Ne(n, t, i);
|
|
939
|
+
return _t = s, N.document.title = n.title, N.document.body.replaceChildren(s.element), j0(
|
|
940
|
+
n,
|
|
941
|
+
s.element,
|
|
942
|
+
e,
|
|
943
|
+
{
|
|
944
|
+
onNext: (r) => i(r),
|
|
945
|
+
onPrevious: a,
|
|
946
|
+
onRenderSlide: o,
|
|
947
|
+
onShowNavigator: () => Qt()
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
keyEventTarget: N
|
|
951
|
+
}
|
|
952
|
+
), N.addEventListener("resize", () => Ot(N)), N.addEventListener("beforeunload", () => {
|
|
953
|
+
Ot(N);
|
|
954
|
+
}), N.addEventListener("keyup", (r) => {
|
|
955
|
+
(r.key === "Escape" || r.key === "`" && !z0(r)) && Qt();
|
|
956
|
+
}), _t;
|
|
957
|
+
}
|
|
958
|
+
function Ne(n, e, t) {
|
|
959
|
+
const o = (N == null ? void 0 : N.document) ?? document, i = o.createElement("div");
|
|
847
960
|
i.style.boxSizing = "border-box", i.style.display = "grid", i.style.gridTemplateColumns = "260px 1fr", i.style.gap = "18px", i.style.height = "100vh", i.style.overflow = "hidden", i.style.padding = "18px", i.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', i.style.backgroundColor = "#f5f6f8", i.style.color = "#1f2937", o.body.style.margin = "0", o.body.style.overflow = "hidden";
|
|
848
961
|
const a = o.createElement("div");
|
|
849
962
|
a.style.display = "flex", a.style.flexDirection = "column", a.style.gap = "8px", a.style.minHeight = "0", a.style.overflowY = "auto", a.style.paddingRight = "4px";
|
|
@@ -853,28 +966,28 @@ function Pe(n, e, t) {
|
|
|
853
966
|
r.style.display = "flex", r.style.gap = "14px", r.style.alignItems = "center", r.style.flexWrap = "wrap", r.style.fontSize = "13px", r.style.color = "#4b5563";
|
|
854
967
|
const h = o.createElement("div");
|
|
855
968
|
h.style.display = "flex", h.style.gap = "14px", h.style.flex = "1 1 auto", h.style.minHeight = "0", h.style.minWidth = "0", h.style.overflow = "hidden";
|
|
856
|
-
const
|
|
857
|
-
|
|
969
|
+
const u = x0("Current", n), c = x0("Next", n);
|
|
970
|
+
c.container.style.cursor = "pointer", c.container.addEventListener("click", t);
|
|
858
971
|
const d = n.slides.map((L, C) => {
|
|
859
|
-
const S =
|
|
972
|
+
const S = Re(L, C);
|
|
860
973
|
return S.style.cursor = "pointer", S.addEventListener("click", (T) => {
|
|
861
|
-
T.shiftKey && (
|
|
974
|
+
T.shiftKey && Qt(), e(C);
|
|
862
975
|
}), a.appendChild(S), S;
|
|
863
|
-
}), l =
|
|
864
|
-
const L =
|
|
865
|
-
i.style.gridTemplateColumns = l.input.checked ? "260px 1fr" : "1fr", h.style.flexDirection = L ? "column" : "row",
|
|
866
|
-
|
|
976
|
+
}), l = qt("Slides", a, !0), f = qt("Current", u.container, !0), m = qt("Next", c.container, !0), y = () => {
|
|
977
|
+
const L = f.input.checked && m.input.checked && E();
|
|
978
|
+
i.style.gridTemplateColumns = l.input.checked ? "260px 1fr" : "1fr", h.style.flexDirection = L ? "column" : "row", u.container.style.flex = "1 1 0", c.container.style.flex = "1 1 0", requestAnimationFrame(() => {
|
|
979
|
+
u.resize(), c.resize();
|
|
867
980
|
});
|
|
868
981
|
};
|
|
869
|
-
l.input.addEventListener("change", y),
|
|
982
|
+
l.input.addEventListener("change", y), f.input.addEventListener("change", y), m.input.addEventListener("change", y), N == null || N.addEventListener("resize", y), r.appendChild(l.element), r.appendChild(f.element), r.appendChild(m.element), h.appendChild(u.container), h.appendChild(c.container), s.appendChild(r), s.appendChild(h), i.appendChild(a), i.appendChild(s);
|
|
870
983
|
function M(L, C, S, T) {
|
|
871
|
-
d.forEach((I,
|
|
872
|
-
const
|
|
873
|
-
I.style.backgroundColor =
|
|
874
|
-
}),
|
|
984
|
+
d.forEach((I, R) => {
|
|
985
|
+
const X = R === L;
|
|
986
|
+
I.style.backgroundColor = X ? "#dbeafe" : "#ffffff", I.style.borderColor = X ? "#60a5fa" : "#e5e7eb", I.style.color = X ? "#1e3a8a" : "#1f2937";
|
|
987
|
+
}), u.label.textContent = y0(n, L, C), c.label.textContent = y0(n, S, T), Be(d[L], a), y();
|
|
875
988
|
}
|
|
876
989
|
function E() {
|
|
877
|
-
const L =
|
|
990
|
+
const L = N;
|
|
878
991
|
if (L === null)
|
|
879
992
|
return !1;
|
|
880
993
|
const C = l.input.checked ? 278 : 0, S = L.innerWidth - 36 - C, T = L.innerHeight - 36 - r.offsetHeight - 14;
|
|
@@ -882,25 +995,25 @@ function Pe(n, e, t) {
|
|
|
882
995
|
}
|
|
883
996
|
return {
|
|
884
997
|
element: i,
|
|
885
|
-
currentCanvas:
|
|
886
|
-
nextCanvas:
|
|
887
|
-
currentLabel:
|
|
888
|
-
nextLabel:
|
|
889
|
-
isOpen: () =>
|
|
998
|
+
currentCanvas: u.canvas,
|
|
999
|
+
nextCanvas: c.canvas,
|
|
1000
|
+
currentLabel: u.label,
|
|
1001
|
+
nextLabel: c.label,
|
|
1002
|
+
isOpen: () => N !== null && !N.closed,
|
|
890
1003
|
update: M
|
|
891
1004
|
};
|
|
892
1005
|
}
|
|
893
|
-
function
|
|
894
|
-
const t = (
|
|
1006
|
+
function Re(n, e) {
|
|
1007
|
+
const t = (N == null ? void 0 : N.document) ?? document, o = t.createElement("div");
|
|
895
1008
|
o.style.display = "flex", o.style.alignItems = "center", o.style.gap = "10px", o.style.padding = "8px 10px", o.style.backgroundColor = "#ffffff", o.style.border = "1px solid #e5e7eb", o.style.borderRadius = "6px", o.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.06)", o.style.fontSize = "14px", o.style.lineHeight = "1", o.style.userSelect = "none";
|
|
896
1009
|
const i = t.createElement("div");
|
|
897
1010
|
i.textContent = `${e + 1}`, i.style.minWidth = "24px", i.style.fontWeight = "700", i.style.color = "#6b7280";
|
|
898
1011
|
const a = t.createElement("div");
|
|
899
1012
|
return a.textContent = n.title.length > 0 ? n.title : `Slide ${e + 1}`, a.style.overflow = "hidden", a.style.textOverflow = "ellipsis", a.style.whiteSpace = "nowrap", o.appendChild(i), o.appendChild(a), o;
|
|
900
1013
|
}
|
|
901
|
-
function
|
|
902
|
-
var
|
|
903
|
-
const t = (
|
|
1014
|
+
function x0(n, e) {
|
|
1015
|
+
var c;
|
|
1016
|
+
const t = (N == null ? void 0 : N.document) ?? document, o = t.createElement("div");
|
|
904
1017
|
o.style.display = "flex", o.style.alignItems = "center", o.style.flexDirection = "column", o.style.minHeight = "0", o.style.minWidth = "0";
|
|
905
1018
|
const i = t.createElement("div");
|
|
906
1019
|
i.textContent = n, i.style.marginBottom = "4px", i.style.fontSize = "12px", i.style.fontWeight = "700", i.style.textAlign = "center", i.style.textTransform = "uppercase", i.style.color = "#6b7280";
|
|
@@ -914,32 +1027,47 @@ function g0(n, e) {
|
|
|
914
1027
|
const d = s.clientWidth, l = s.clientHeight;
|
|
915
1028
|
if (d <= 0 || l <= 0)
|
|
916
1029
|
return;
|
|
917
|
-
const
|
|
1030
|
+
const f = e.size.width / e.size.height, m = Math.min(d, l * f), y = m / f;
|
|
918
1031
|
r.style.width = `${m}px`, r.style.height = `${y}px`;
|
|
919
1032
|
}
|
|
920
|
-
const
|
|
921
|
-
return
|
|
1033
|
+
const u = (c = t.defaultView) == null ? void 0 : c.ResizeObserver;
|
|
1034
|
+
return u !== void 0 && new u(h).observe(s), N == null || N.addEventListener("resize", h), s.appendChild(r), o.appendChild(i), o.appendChild(a), o.appendChild(s), { container: o, label: a, canvas: r, resize: h };
|
|
922
1035
|
}
|
|
923
|
-
function
|
|
924
|
-
const o = (
|
|
1036
|
+
function qt(n, e, t) {
|
|
1037
|
+
const o = (N == null ? void 0 : N.document) ?? document, i = e.style.display || "block", a = o.createElement("label");
|
|
925
1038
|
a.style.display = "inline-flex", a.style.alignItems = "center", a.style.gap = "6px", a.style.userSelect = "none";
|
|
926
1039
|
const s = o.createElement("input");
|
|
927
1040
|
return s.type = "checkbox", s.checked = t, s.addEventListener("change", () => {
|
|
928
1041
|
e.style.display = s.checked ? i : "none";
|
|
929
1042
|
}), a.appendChild(s), a.appendChild(o.createTextNode(n)), { element: a, input: s };
|
|
930
1043
|
}
|
|
931
|
-
function
|
|
1044
|
+
function y0(n, e, t) {
|
|
932
1045
|
if (e === null)
|
|
933
1046
|
return "End of presentation";
|
|
934
1047
|
const o = n.slides[e];
|
|
935
1048
|
return o === void 0 ? "No slide" : `Slide ${e + 1} of ${n.slides.length}, Build ${t + 1} of ${o.animations.length + 1}`;
|
|
936
1049
|
}
|
|
937
|
-
function
|
|
1050
|
+
function Be(n, e) {
|
|
938
1051
|
if (n === void 0)
|
|
939
1052
|
return;
|
|
940
1053
|
const t = n.offsetTop, o = t + n.offsetHeight, i = e.scrollTop, a = i + e.clientHeight;
|
|
941
1054
|
(t < i || o > a) && n.scrollIntoView({ block: "nearest" });
|
|
942
1055
|
}
|
|
1056
|
+
function Qt() {
|
|
1057
|
+
Ot(N), N == null || N.close(), N = null, _t = null;
|
|
1058
|
+
}
|
|
1059
|
+
function De() {
|
|
1060
|
+
const { width: n, height: e, left: t, top: o } = H0;
|
|
1061
|
+
return `width=${n},height=${e},left=${t},top=${o}`;
|
|
1062
|
+
}
|
|
1063
|
+
function Ot(n) {
|
|
1064
|
+
n === null || n.closed || (H0 = {
|
|
1065
|
+
width: n.outerWidth,
|
|
1066
|
+
height: n.outerHeight,
|
|
1067
|
+
left: n.screenX,
|
|
1068
|
+
top: n.screenY
|
|
1069
|
+
});
|
|
1070
|
+
}
|
|
943
1071
|
function at(n = null) {
|
|
944
1072
|
return {
|
|
945
1073
|
height: 0,
|
|
@@ -947,10 +1075,10 @@ function at(n = null) {
|
|
|
947
1075
|
...n
|
|
948
1076
|
};
|
|
949
1077
|
}
|
|
950
|
-
const
|
|
951
|
-
function
|
|
1078
|
+
const qe = at({ width: 0, height: 0 });
|
|
1079
|
+
function ze(n = null) {
|
|
952
1080
|
return {
|
|
953
|
-
backgroundColor:
|
|
1081
|
+
backgroundColor: G.WHITE,
|
|
954
1082
|
slides: [],
|
|
955
1083
|
title: "Presentation",
|
|
956
1084
|
size: at({ width: 3840, height: 2160 }),
|
|
@@ -960,7 +1088,7 @@ function Ie(n = null) {
|
|
|
960
1088
|
...n
|
|
961
1089
|
};
|
|
962
1090
|
}
|
|
963
|
-
function
|
|
1091
|
+
function je(n) {
|
|
964
1092
|
const e = Array.isArray(n) ? n : [n];
|
|
965
1093
|
let t = 0, o = 0;
|
|
966
1094
|
for (const i of e)
|
|
@@ -978,26 +1106,26 @@ function _e(n) {
|
|
|
978
1106
|
}
|
|
979
1107
|
return o;
|
|
980
1108
|
}
|
|
981
|
-
function
|
|
982
|
-
const { red: t, green: o, blue: i } = n, a =
|
|
1109
|
+
function s0(n, e = null) {
|
|
1110
|
+
const { red: t, green: o, blue: i } = n, a = R0(n, e);
|
|
983
1111
|
return `rgba(${t}, ${o}, ${i}, ${a})`;
|
|
984
1112
|
}
|
|
985
|
-
function
|
|
1113
|
+
function U0(n) {
|
|
986
1114
|
return n === document.body;
|
|
987
1115
|
}
|
|
988
|
-
function
|
|
1116
|
+
function He(n, e) {
|
|
989
1117
|
const t = document.createElement("div");
|
|
990
|
-
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative",
|
|
1118
|
+
if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", U0(e)) {
|
|
991
1119
|
t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", t.style.overflowY = "clip", document.title = n.title, document.documentElement.style.height = "100%", document.body.style.margin = "0", document.body.style.height = "100%", document.body.style.width = "100%", document.body.style.backgroundColor = "#000000";
|
|
992
1120
|
const o = n.size.height / n.size.width;
|
|
993
|
-
|
|
1121
|
+
v0(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => v0(t, o));
|
|
994
1122
|
}
|
|
995
1123
|
return t;
|
|
996
1124
|
}
|
|
997
|
-
function
|
|
1125
|
+
function v0(n, e) {
|
|
998
1126
|
window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
|
|
999
1127
|
}
|
|
1000
|
-
const
|
|
1128
|
+
const Ue = {
|
|
1001
1129
|
check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
|
|
1002
1130
|
interpolate: (n, e, t) => ({
|
|
1003
1131
|
red: Math.round(n.red + (e.red - n.red) * t),
|
|
@@ -1005,28 +1133,28 @@ const Re = {
|
|
|
1005
1133
|
blue: Math.round(n.blue + (e.blue - n.blue) * t),
|
|
1006
1134
|
alpha: n.alpha + (e.alpha - n.alpha) * t
|
|
1007
1135
|
})
|
|
1008
|
-
},
|
|
1136
|
+
}, $e = {
|
|
1009
1137
|
check: (n) => !0,
|
|
1010
1138
|
interpolate: (n, e) => e
|
|
1011
|
-
},
|
|
1139
|
+
}, Ye = {
|
|
1012
1140
|
check: (n) => typeof n == "number",
|
|
1013
1141
|
interpolate: (n, e, t) => n + (e - n) * t
|
|
1014
|
-
},
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1142
|
+
}, w0 = [
|
|
1143
|
+
Ye,
|
|
1144
|
+
Ue,
|
|
1145
|
+
$e
|
|
1018
1146
|
];
|
|
1019
|
-
function
|
|
1147
|
+
function We(n, e, t, o = null) {
|
|
1020
1148
|
if (t === 0)
|
|
1021
1149
|
return n;
|
|
1022
1150
|
if (t === 1)
|
|
1023
1151
|
return { ...n, ...e };
|
|
1024
|
-
const i = o != null ? [...o, ...
|
|
1152
|
+
const i = o != null ? [...o, ...w0] : w0, a = {};
|
|
1025
1153
|
for (const s in e) {
|
|
1026
1154
|
const r = n[s], h = e[s];
|
|
1027
|
-
for (const
|
|
1028
|
-
if (
|
|
1029
|
-
a[s] =
|
|
1155
|
+
for (const u of i)
|
|
1156
|
+
if (u.check(r, s) && u.check(h, s)) {
|
|
1157
|
+
a[s] = u.interpolate(
|
|
1030
1158
|
r,
|
|
1031
1159
|
h,
|
|
1032
1160
|
t
|
|
@@ -1036,7 +1164,7 @@ function qe(n, e, t, o = null) {
|
|
|
1036
1164
|
}
|
|
1037
1165
|
return { ...n, ...a };
|
|
1038
1166
|
}
|
|
1039
|
-
function
|
|
1167
|
+
function m0(n, e, t = null) {
|
|
1040
1168
|
if (e === null)
|
|
1041
1169
|
return;
|
|
1042
1170
|
const o = Array.isArray(e) ? e : [e];
|
|
@@ -1058,7 +1186,7 @@ function y0(n, e, t = null) {
|
|
|
1058
1186
|
);
|
|
1059
1187
|
n.set(a.object, {
|
|
1060
1188
|
...s,
|
|
1061
|
-
...
|
|
1189
|
+
...We(
|
|
1062
1190
|
s,
|
|
1063
1191
|
a.props,
|
|
1064
1192
|
a.easing(h),
|
|
@@ -1085,10 +1213,10 @@ function y0(n, e, t = null) {
|
|
|
1085
1213
|
}
|
|
1086
1214
|
}
|
|
1087
1215
|
}
|
|
1088
|
-
function
|
|
1216
|
+
function $0(n) {
|
|
1089
1217
|
return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
|
|
1090
1218
|
}
|
|
1091
|
-
function
|
|
1219
|
+
function Xe({
|
|
1092
1220
|
slide: n,
|
|
1093
1221
|
buildIndex: e,
|
|
1094
1222
|
buildTime: t
|
|
@@ -1096,7 +1224,7 @@ function De({
|
|
|
1096
1224
|
const o = /* @__PURE__ */ new Map();
|
|
1097
1225
|
function i(s) {
|
|
1098
1226
|
o.set(s, s);
|
|
1099
|
-
for (const r of
|
|
1227
|
+
for (const r of $0(s))
|
|
1100
1228
|
i(r);
|
|
1101
1229
|
}
|
|
1102
1230
|
for (const s of n.objects)
|
|
@@ -1104,22 +1232,22 @@ function De({
|
|
|
1104
1232
|
const a = t === null ? e : e - 1;
|
|
1105
1233
|
for (let s = 0; s < a; s++) {
|
|
1106
1234
|
const r = n.animations[s] ?? null;
|
|
1107
|
-
|
|
1235
|
+
m0(o, r);
|
|
1108
1236
|
}
|
|
1109
1237
|
if (t !== null && e > 0) {
|
|
1110
1238
|
const s = n.animations[e - 1] ?? null;
|
|
1111
|
-
|
|
1239
|
+
m0(o, s, t);
|
|
1112
1240
|
}
|
|
1113
1241
|
return o;
|
|
1114
1242
|
}
|
|
1115
|
-
function
|
|
1243
|
+
function Ge(n) {
|
|
1116
1244
|
const e = {};
|
|
1117
1245
|
function t(o) {
|
|
1118
1246
|
if (o.objectType === U.SVG) {
|
|
1119
1247
|
const a = o.svg;
|
|
1120
1248
|
a !== void 0 && a.length > 0 && (e[a] = a);
|
|
1121
1249
|
}
|
|
1122
|
-
const i =
|
|
1250
|
+
const i = $0(o);
|
|
1123
1251
|
for (const a of i)
|
|
1124
1252
|
t(a);
|
|
1125
1253
|
}
|
|
@@ -1128,83 +1256,8 @@ function ze(n) {
|
|
|
1128
1256
|
t(i);
|
|
1129
1257
|
return e;
|
|
1130
1258
|
}
|
|
1131
|
-
function je(n) {
|
|
1132
|
-
var o;
|
|
1133
|
-
const { slides: e } = n, t = {
|
|
1134
|
-
// First build of first slide
|
|
1135
|
-
s: { slideIndex: 0, buildIndex: 0 },
|
|
1136
|
-
// First build of current slide
|
|
1137
|
-
c: { slideIndex: null, buildIndex: 0 },
|
|
1138
|
-
// Last build of last slide
|
|
1139
|
-
e: {
|
|
1140
|
-
slideIndex: e.length - 1,
|
|
1141
|
-
buildIndex: ((o = e[e.length - 1]) == null ? void 0 : o.animations.length) ?? 0
|
|
1142
|
-
}
|
|
1143
|
-
};
|
|
1144
|
-
for (let i = 0; i < e.length; i++) {
|
|
1145
|
-
const a = e[i];
|
|
1146
|
-
if (a === void 0)
|
|
1147
|
-
continue;
|
|
1148
|
-
const s = a.shortcut;
|
|
1149
|
-
qt(t, s, i, 0);
|
|
1150
|
-
for (let r = 0; r < a.animations.length; r++) {
|
|
1151
|
-
const h = a.animations[r];
|
|
1152
|
-
if (h !== void 0)
|
|
1153
|
-
if (Array.isArray(h))
|
|
1154
|
-
for (const c of h)
|
|
1155
|
-
qt(t, c.shortcut, i, r + 1);
|
|
1156
|
-
else
|
|
1157
|
-
qt(t, h.shortcut, i, r + 1);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
return t;
|
|
1161
|
-
}
|
|
1162
|
-
function qt(n, e, t, o) {
|
|
1163
|
-
if (e !== null)
|
|
1164
|
-
if (Array.isArray(e))
|
|
1165
|
-
for (const i of e)
|
|
1166
|
-
n[i] = { slideIndex: t, buildIndex: o };
|
|
1167
|
-
else
|
|
1168
|
-
n[e] = { slideIndex: t, buildIndex: o };
|
|
1169
|
-
}
|
|
1170
|
-
function He(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
|
|
1171
|
-
t.shortcuts = je(n), e.addEventListener("mousemove", () => {
|
|
1172
|
-
e.style.cursor = "auto";
|
|
1173
|
-
}), e.addEventListener("keyup", (r) => {
|
|
1174
|
-
if (r.code === "Escape") {
|
|
1175
|
-
t.textCommand = null;
|
|
1176
|
-
return;
|
|
1177
|
-
}
|
|
1178
|
-
if (r.code === "ArrowRight" || r.code === "Space") {
|
|
1179
|
-
o(r.shiftKey);
|
|
1180
|
-
return;
|
|
1181
|
-
}
|
|
1182
|
-
if (r.code === "ArrowLeft") {
|
|
1183
|
-
i(r.shiftKey);
|
|
1184
|
-
return;
|
|
1185
|
-
}
|
|
1186
|
-
if (t.textCommand !== null) {
|
|
1187
|
-
if (r.code === "Enter") {
|
|
1188
|
-
const h = t.textCommand;
|
|
1189
|
-
t.textCommand = null;
|
|
1190
|
-
const c = t.shortcuts[h];
|
|
1191
|
-
c !== void 0 ? a(c.slideIndex, c.buildIndex) : isNaN(Number(h)) || a(Number(h) - 1, 0);
|
|
1192
|
-
return;
|
|
1193
|
-
} else r.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += r.key;
|
|
1194
|
-
return;
|
|
1195
|
-
}
|
|
1196
|
-
if (r.key === "g") {
|
|
1197
|
-
t.textCommand = "";
|
|
1198
|
-
return;
|
|
1199
|
-
}
|
|
1200
|
-
if (r.key === "`") {
|
|
1201
|
-
s();
|
|
1202
|
-
return;
|
|
1203
|
-
}
|
|
1204
|
-
});
|
|
1205
|
-
}
|
|
1206
1259
|
const dt = "presenterState";
|
|
1207
|
-
function
|
|
1260
|
+
function Ze(n, e) {
|
|
1208
1261
|
const t = localStorage.getItem(dt);
|
|
1209
1262
|
if (t === null)
|
|
1210
1263
|
return null;
|
|
@@ -1213,8 +1266,8 @@ function Ue(n, e) {
|
|
|
1213
1266
|
let o;
|
|
1214
1267
|
try {
|
|
1215
1268
|
o = JSON.parse(t);
|
|
1216
|
-
} catch (
|
|
1217
|
-
return console.error("Failed to parse presentation state from localStorage:",
|
|
1269
|
+
} catch (u) {
|
|
1270
|
+
return console.error("Failed to parse presentation state from localStorage:", u), localStorage.removeItem(dt), null;
|
|
1218
1271
|
}
|
|
1219
1272
|
const { title: i, timestamp: a } = o;
|
|
1220
1273
|
let { slideIndex: s, buildIndex: r } = o;
|
|
@@ -1228,13 +1281,13 @@ function Ue(n, e) {
|
|
|
1228
1281
|
buildIndex: r
|
|
1229
1282
|
});
|
|
1230
1283
|
}
|
|
1231
|
-
function
|
|
1284
|
+
function Ve({ title: n, slideIndex: e, buildIndex: t }) {
|
|
1232
1285
|
localStorage.setItem(
|
|
1233
1286
|
dt,
|
|
1234
1287
|
JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
|
|
1235
1288
|
);
|
|
1236
1289
|
}
|
|
1237
|
-
const
|
|
1290
|
+
const b0 = Object.freeze({
|
|
1238
1291
|
canvas: null,
|
|
1239
1292
|
extrasContainer: null,
|
|
1240
1293
|
mountedExtrasCleanups: [],
|
|
@@ -1251,10 +1304,10 @@ const v0 = Object.freeze({
|
|
|
1251
1304
|
Browser: "browser",
|
|
1252
1305
|
Node: "node"
|
|
1253
1306
|
};
|
|
1254
|
-
function
|
|
1307
|
+
function Ke(n, e) {
|
|
1255
1308
|
e.context.clearRect(0, 0, n.width, n.height);
|
|
1256
1309
|
}
|
|
1257
|
-
function
|
|
1310
|
+
function Qe(n) {
|
|
1258
1311
|
const e = document.createElement("canvas");
|
|
1259
1312
|
return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
|
|
1260
1313
|
}
|
|
@@ -1262,31 +1315,31 @@ const gt = {
|
|
|
1262
1315
|
Browser: "browser",
|
|
1263
1316
|
Node: "node"
|
|
1264
1317
|
};
|
|
1265
|
-
function
|
|
1318
|
+
function Je(n) {
|
|
1266
1319
|
const e = new Path2D(n);
|
|
1267
1320
|
return {
|
|
1268
1321
|
type: gt.Browser,
|
|
1269
1322
|
path: e
|
|
1270
1323
|
};
|
|
1271
1324
|
}
|
|
1272
|
-
function
|
|
1273
|
-
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n,
|
|
1325
|
+
function t1(n) {
|
|
1326
|
+
const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, u = { x: t, y: o }, c = { x: i, y: a }, d = Math.atan2(c.y - u.y, c.x - u.x), l = { x: u.x + (c.x - u.x) / 2, y: u.y + (c.y - u.y) / 2 }, f = c.x - u.x, m = c.y - u.y, M = Math.hypot(f, m) * e, E = Math.cos(d), L = Math.sin(d), C = h ? { x: l.x - E * M / 2, y: l.y - L * M / 2 } : u, S = h ? { x: l.x + E * M / 2, y: l.y + L * M / 2 } : { x: u.x + E * M, y: u.y + L * M }, T = r ? Math.PI / 6 : Math.PI / 4.5, I = M < s * 2 ? M / 2 : s, R = {
|
|
1274
1327
|
x: S.x - I * Math.cos(d - T),
|
|
1275
1328
|
y: S.y - I * Math.sin(d - T)
|
|
1276
|
-
},
|
|
1329
|
+
}, X = {
|
|
1277
1330
|
x: S.x - I * Math.cos(d + T),
|
|
1278
1331
|
y: S.y - I * Math.sin(d + T)
|
|
1279
1332
|
}, H = {
|
|
1280
1333
|
x: C.x + I * Math.cos(d - T),
|
|
1281
1334
|
y: C.y + I * Math.sin(d - T)
|
|
1282
|
-
},
|
|
1335
|
+
}, Y = {
|
|
1283
1336
|
x: C.x + I * Math.cos(d + T),
|
|
1284
1337
|
y: C.y + I * Math.sin(d + T)
|
|
1285
1338
|
};
|
|
1286
1339
|
return {
|
|
1287
1340
|
arrowPoints: [C, S],
|
|
1288
|
-
arrowheadPoints: [
|
|
1289
|
-
doubledArrowheadPoints: [H, C,
|
|
1341
|
+
arrowheadPoints: [R, S, X],
|
|
1342
|
+
doubledArrowheadPoints: [H, C, Y]
|
|
1290
1343
|
};
|
|
1291
1344
|
}
|
|
1292
1345
|
function yt({
|
|
@@ -1302,13 +1355,13 @@ function yt({
|
|
|
1302
1355
|
}) {
|
|
1303
1356
|
if (!(h === 0 || t === 0)) {
|
|
1304
1357
|
if (t !== null && r !== null && t !== 1) {
|
|
1305
|
-
const
|
|
1358
|
+
const u = r + (i ? h : 0), c = r * t;
|
|
1306
1359
|
o ? n.context.setLineDash([
|
|
1307
1360
|
0,
|
|
1308
|
-
(
|
|
1309
|
-
|
|
1310
|
-
(
|
|
1311
|
-
]) : n.context.setLineDash([
|
|
1361
|
+
(u - c) / 2,
|
|
1362
|
+
c,
|
|
1363
|
+
(u - c) / 2
|
|
1364
|
+
]) : n.context.setLineDash([c, u - c]);
|
|
1312
1365
|
} else
|
|
1313
1366
|
n.context.setLineDash([]);
|
|
1314
1367
|
if (n.context.lineWidth = h, n.context.strokeStyle = Et(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
|
|
@@ -1328,7 +1381,7 @@ function yt({
|
|
|
1328
1381
|
}
|
|
1329
1382
|
}
|
|
1330
1383
|
function vt({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
1331
|
-
if (n.context.fillStyle =
|
|
1384
|
+
if (n.context.fillStyle = s0(t, o), e === void 0) {
|
|
1332
1385
|
n.context.fill();
|
|
1333
1386
|
return;
|
|
1334
1387
|
}
|
|
@@ -1343,7 +1396,7 @@ function vt({ ctx: n, path: e, color: t, opacity: o = null }) {
|
|
|
1343
1396
|
st(n);
|
|
1344
1397
|
}
|
|
1345
1398
|
}
|
|
1346
|
-
function
|
|
1399
|
+
function zt(n, e) {
|
|
1347
1400
|
const t = e(), o = n[0];
|
|
1348
1401
|
if (o === void 0)
|
|
1349
1402
|
return { path: t, length: 0 };
|
|
@@ -1353,12 +1406,12 @@ function Dt(n, e) {
|
|
|
1353
1406
|
const s = n[a], r = n[a - 1];
|
|
1354
1407
|
if (s === void 0 || r === void 0)
|
|
1355
1408
|
continue;
|
|
1356
|
-
const h = s.x - r.x,
|
|
1357
|
-
i += Math.hypot(h,
|
|
1409
|
+
const h = s.x - r.x, u = s.y - r.y;
|
|
1410
|
+
i += Math.hypot(h, u), t.path.lineTo(s.x, s.y);
|
|
1358
1411
|
}
|
|
1359
1412
|
return { path: t, length: i };
|
|
1360
1413
|
}
|
|
1361
|
-
const
|
|
1414
|
+
const e1 = ({
|
|
1362
1415
|
ctx: n,
|
|
1363
1416
|
object: e,
|
|
1364
1417
|
opacity: t,
|
|
@@ -1367,57 +1420,57 @@ const Ze = ({
|
|
|
1367
1420
|
const i = e.opacity * t;
|
|
1368
1421
|
if (i === 0 || e.drawn === 0)
|
|
1369
1422
|
return;
|
|
1370
|
-
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } =
|
|
1423
|
+
const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = t1(e), { path: h } = zt(a, o), { path: u } = zt(s, o);
|
|
1371
1424
|
if (yt({
|
|
1372
1425
|
color: e.color,
|
|
1373
1426
|
ctx: n,
|
|
1374
1427
|
path: h,
|
|
1375
1428
|
opacity: i,
|
|
1376
1429
|
width: e.width
|
|
1377
|
-
}), e.isArrowheadFilled && (
|
|
1430
|
+
}), e.isArrowheadFilled && (u.path.closePath(), vt({
|
|
1378
1431
|
ctx: n,
|
|
1379
|
-
path:
|
|
1432
|
+
path: u,
|
|
1380
1433
|
color: e.color,
|
|
1381
1434
|
opacity: i
|
|
1382
1435
|
})), yt({
|
|
1383
1436
|
color: e.color,
|
|
1384
1437
|
ctx: n,
|
|
1385
|
-
path:
|
|
1438
|
+
path: u,
|
|
1386
1439
|
opacity: i,
|
|
1387
1440
|
width: e.width
|
|
1388
1441
|
}), e.isArrowheadDoubled) {
|
|
1389
|
-
const { path:
|
|
1442
|
+
const { path: c } = zt(
|
|
1390
1443
|
r,
|
|
1391
1444
|
o
|
|
1392
1445
|
);
|
|
1393
|
-
e.isArrowheadFilled && (
|
|
1446
|
+
e.isArrowheadFilled && (c.path.closePath(), vt({
|
|
1394
1447
|
ctx: n,
|
|
1395
|
-
path:
|
|
1448
|
+
path: c,
|
|
1396
1449
|
color: e.color,
|
|
1397
1450
|
opacity: i
|
|
1398
1451
|
})), yt({
|
|
1399
1452
|
color: e.color,
|
|
1400
1453
|
ctx: n,
|
|
1401
|
-
path:
|
|
1454
|
+
path: c,
|
|
1402
1455
|
opacity: i,
|
|
1403
1456
|
width: e.width
|
|
1404
1457
|
});
|
|
1405
1458
|
}
|
|
1406
1459
|
};
|
|
1407
|
-
function
|
|
1460
|
+
function n1(n, e) {
|
|
1408
1461
|
const t = n.radius - n.strokeWidth / 2;
|
|
1409
1462
|
if (t <= 0)
|
|
1410
1463
|
return;
|
|
1411
1464
|
const o = e(), i = -Math.PI / 2;
|
|
1412
1465
|
return o.path.arc(n.x, n.y, t, i, i + 2 * Math.PI), o;
|
|
1413
1466
|
}
|
|
1414
|
-
function
|
|
1467
|
+
function r1(n, e) {
|
|
1415
1468
|
const t = e(), o = -Math.PI / 2;
|
|
1416
1469
|
t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
|
|
1417
1470
|
const i = 2 * Math.PI * n.radius;
|
|
1418
1471
|
return { path: t, length: i };
|
|
1419
1472
|
}
|
|
1420
|
-
function
|
|
1473
|
+
function Y0(n, e) {
|
|
1421
1474
|
switch (n.type) {
|
|
1422
1475
|
case V.Browser:
|
|
1423
1476
|
e.type === gt.Browser ? n.context.clip(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
|
|
@@ -1429,7 +1482,7 @@ function q0(n, e) {
|
|
|
1429
1482
|
st(n);
|
|
1430
1483
|
}
|
|
1431
1484
|
}
|
|
1432
|
-
const
|
|
1485
|
+
const i1 = ({
|
|
1433
1486
|
ctx: n,
|
|
1434
1487
|
object: e,
|
|
1435
1488
|
opacity: t,
|
|
@@ -1438,10 +1491,10 @@ const Qe = ({
|
|
|
1438
1491
|
const i = e.opacity * t;
|
|
1439
1492
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1440
1493
|
return;
|
|
1441
|
-
const { path: a, length: s } =
|
|
1494
|
+
const { path: a, length: s } = r1(e, o);
|
|
1442
1495
|
if (i < 1 && e.strokeWidth > 0) {
|
|
1443
|
-
const r =
|
|
1444
|
-
r !== void 0 && (n.context.save(),
|
|
1496
|
+
const r = n1(e, o);
|
|
1497
|
+
r !== void 0 && (n.context.save(), Y0(n, r), vt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1445
1498
|
} else
|
|
1446
1499
|
vt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1447
1500
|
yt({
|
|
@@ -1454,18 +1507,18 @@ const Qe = ({
|
|
|
1454
1507
|
width: e.strokeWidth
|
|
1455
1508
|
});
|
|
1456
1509
|
};
|
|
1457
|
-
function
|
|
1510
|
+
function W(n = null) {
|
|
1458
1511
|
return {
|
|
1459
1512
|
x: 0,
|
|
1460
1513
|
y: 0,
|
|
1461
1514
|
...n
|
|
1462
1515
|
};
|
|
1463
1516
|
}
|
|
1464
|
-
const
|
|
1517
|
+
const o1 = W();
|
|
1465
1518
|
function ut(n = null) {
|
|
1466
1519
|
return {
|
|
1467
|
-
origin:
|
|
1468
|
-
size:
|
|
1520
|
+
origin: o1,
|
|
1521
|
+
size: qe,
|
|
1469
1522
|
...n
|
|
1470
1523
|
};
|
|
1471
1524
|
}
|
|
@@ -1475,82 +1528,82 @@ function pt(n, e, t) {
|
|
|
1475
1528
|
switch (e) {
|
|
1476
1529
|
case ot.TOP_LEFT:
|
|
1477
1530
|
return ut({
|
|
1478
|
-
origin:
|
|
1531
|
+
origin: W({ x: o, y: i }),
|
|
1479
1532
|
size: t
|
|
1480
1533
|
});
|
|
1481
1534
|
case ot.TOP:
|
|
1482
1535
|
return ut({
|
|
1483
|
-
origin:
|
|
1536
|
+
origin: W({ x: o - a / 2, y: i }),
|
|
1484
1537
|
size: t
|
|
1485
1538
|
});
|
|
1486
1539
|
case ot.TOP_RIGHT:
|
|
1487
1540
|
return ut({
|
|
1488
|
-
origin:
|
|
1541
|
+
origin: W({ x: o - a, y: i }),
|
|
1489
1542
|
size: t
|
|
1490
1543
|
});
|
|
1491
1544
|
case ot.LEFT:
|
|
1492
1545
|
return ut({
|
|
1493
|
-
origin:
|
|
1546
|
+
origin: W({ x: o, y: i - s / 2 }),
|
|
1494
1547
|
size: t
|
|
1495
1548
|
});
|
|
1496
1549
|
case ot.CENTER:
|
|
1497
1550
|
return ut({
|
|
1498
|
-
origin:
|
|
1551
|
+
origin: W({ x: o - a / 2, y: i - s / 2 }),
|
|
1499
1552
|
size: t
|
|
1500
1553
|
});
|
|
1501
1554
|
case ot.RIGHT:
|
|
1502
1555
|
return ut({
|
|
1503
|
-
origin:
|
|
1556
|
+
origin: W({ x: o - a, y: i - s / 2 }),
|
|
1504
1557
|
size: t
|
|
1505
1558
|
});
|
|
1506
1559
|
case ot.BOTTOM_LEFT:
|
|
1507
1560
|
return ut({
|
|
1508
|
-
origin:
|
|
1561
|
+
origin: W({ x: o, y: i - s }),
|
|
1509
1562
|
size: t
|
|
1510
1563
|
});
|
|
1511
1564
|
case ot.BOTTOM:
|
|
1512
1565
|
return ut({
|
|
1513
|
-
origin:
|
|
1566
|
+
origin: W({ x: o - a / 2, y: i - s }),
|
|
1514
1567
|
size: t
|
|
1515
1568
|
});
|
|
1516
1569
|
case ot.BOTTOM_RIGHT:
|
|
1517
1570
|
return ut({
|
|
1518
|
-
origin:
|
|
1571
|
+
origin: W({ x: o - a, y: i - s }),
|
|
1519
1572
|
size: t
|
|
1520
1573
|
});
|
|
1521
1574
|
default:
|
|
1522
1575
|
st(e);
|
|
1523
1576
|
}
|
|
1524
1577
|
}
|
|
1525
|
-
const
|
|
1578
|
+
const s1 = ({
|
|
1526
1579
|
ctx: n,
|
|
1527
1580
|
object: e,
|
|
1528
1581
|
renderObject: t,
|
|
1529
1582
|
opacity: o
|
|
1530
1583
|
}) => {
|
|
1531
1584
|
const i = e.scale * e.scaleX, a = e.scale * e.scaleY, s = pt(
|
|
1532
|
-
|
|
1585
|
+
W({ x: e.x, y: e.y }),
|
|
1533
1586
|
e.anchor,
|
|
1534
1587
|
at({
|
|
1535
1588
|
width: e.width * Math.abs(i),
|
|
1536
1589
|
height: e.height * Math.abs(a)
|
|
1537
1590
|
})
|
|
1538
|
-
), { rotation: r, rotateOriginX: h, rotateOriginY:
|
|
1591
|
+
), { rotation: r, rotateOriginX: h, rotateOriginY: u, skewOriginX: c, skewOriginY: d, skewX: l, skewY: f } = e;
|
|
1539
1592
|
if (!(i === 0 || a === 0)) {
|
|
1540
|
-
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h,
|
|
1593
|
+
n.context.save(), n.context.translate(s.origin.x, s.origin.y), n.context.scale(i, a), n.context.translate(h, u), n.context.rotate(r * Math.PI / 180), n.context.translate(-h, -u), n.context.translate(c, d), n.context.transform(
|
|
1541
1594
|
1,
|
|
1542
|
-
Math.tan(
|
|
1595
|
+
Math.tan(f * Math.PI / 180),
|
|
1543
1596
|
Math.tan(l * Math.PI / 180),
|
|
1544
1597
|
1,
|
|
1545
1598
|
0,
|
|
1546
1599
|
0
|
|
1547
|
-
), n.context.translate(-
|
|
1600
|
+
), n.context.translate(-c, -d);
|
|
1548
1601
|
for (const m of e.objects)
|
|
1549
1602
|
t(m, o * e.opacity);
|
|
1550
|
-
e.previewColor !== null && (n.context.fillStyle = Et(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(h,
|
|
1603
|
+
e.previewColor !== null && (n.context.fillStyle = Et(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(h, u, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), e.skewOriginPreviewSize > 0 && (n.context.fillStyle = "blue", n.context.beginPath(), n.context.arc(c, d, e.skewOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.restore();
|
|
1551
1604
|
}
|
|
1552
1605
|
};
|
|
1553
|
-
function
|
|
1606
|
+
function a0(n, e, t, o, i = 0) {
|
|
1554
1607
|
const a = o();
|
|
1555
1608
|
a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
|
|
1556
1609
|
n.x + e.width,
|
|
@@ -1577,7 +1630,7 @@ function o0(n, e, t, o, i = 0) {
|
|
|
1577
1630
|
const St = {
|
|
1578
1631
|
Browser: "browser",
|
|
1579
1632
|
Node: "node"
|
|
1580
|
-
},
|
|
1633
|
+
}, a1 = ({
|
|
1581
1634
|
ctx: n,
|
|
1582
1635
|
imageById: e,
|
|
1583
1636
|
object: t,
|
|
@@ -1585,13 +1638,13 @@ const St = {
|
|
|
1585
1638
|
createPath2D: i
|
|
1586
1639
|
}) => {
|
|
1587
1640
|
const a = pt(
|
|
1588
|
-
|
|
1641
|
+
W({ x: t.x, y: t.y }),
|
|
1589
1642
|
t.anchor,
|
|
1590
1643
|
at({ width: t.width, height: t.height })
|
|
1591
1644
|
), s = e[t.imageId];
|
|
1592
1645
|
if (s !== void 0) {
|
|
1593
1646
|
if (n.context.save(), t.cornerRadius > 0) {
|
|
1594
|
-
const r =
|
|
1647
|
+
const r = a0(
|
|
1595
1648
|
a.origin,
|
|
1596
1649
|
a.size,
|
|
1597
1650
|
t.cornerRadius,
|
|
@@ -1633,13 +1686,13 @@ const St = {
|
|
|
1633
1686
|
n.context.restore();
|
|
1634
1687
|
}
|
|
1635
1688
|
};
|
|
1636
|
-
function
|
|
1689
|
+
function h1(n, e) {
|
|
1637
1690
|
const t = e();
|
|
1638
1691
|
t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
|
|
1639
1692
|
const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
|
|
1640
1693
|
return { path: t, length: o };
|
|
1641
1694
|
}
|
|
1642
|
-
const
|
|
1695
|
+
const l1 = ({
|
|
1643
1696
|
ctx: n,
|
|
1644
1697
|
object: e,
|
|
1645
1698
|
opacity: t,
|
|
@@ -1648,7 +1701,7 @@ const r1 = ({
|
|
|
1648
1701
|
const i = e.opacity * t;
|
|
1649
1702
|
if (i === 0 || e.drawn === 0)
|
|
1650
1703
|
return;
|
|
1651
|
-
const { path: a, length: s } =
|
|
1704
|
+
const { path: a, length: s } = h1(e, o);
|
|
1652
1705
|
yt({
|
|
1653
1706
|
color: e.color,
|
|
1654
1707
|
ctx: n,
|
|
@@ -1660,7 +1713,7 @@ const r1 = ({
|
|
|
1660
1713
|
opacity: i,
|
|
1661
1714
|
width: e.width
|
|
1662
1715
|
});
|
|
1663
|
-
},
|
|
1716
|
+
}, c1 = ({
|
|
1664
1717
|
ctx: n,
|
|
1665
1718
|
object: e,
|
|
1666
1719
|
opacity: t,
|
|
@@ -1668,15 +1721,15 @@ const r1 = ({
|
|
|
1668
1721
|
}) => {
|
|
1669
1722
|
n.context.save();
|
|
1670
1723
|
const i = pt(
|
|
1671
|
-
|
|
1724
|
+
W({ x: e.x, y: e.y }),
|
|
1672
1725
|
e.anchor,
|
|
1673
1726
|
at({ width: e.width, height: e.height })
|
|
1674
1727
|
);
|
|
1675
|
-
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = Et(
|
|
1728
|
+
e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = Et(G.RED), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.stroke()), n.context.beginPath(), n.context.rect(i.origin.x, i.origin.y, i.size.width, i.size.height), n.context.closePath(), n.context.clip();
|
|
1676
1729
|
for (const a of e.objects)
|
|
1677
1730
|
o(a, t * e.opacity);
|
|
1678
1731
|
n.context.restore();
|
|
1679
|
-
},
|
|
1732
|
+
}, u1 = ({
|
|
1680
1733
|
ctx: n,
|
|
1681
1734
|
object: e,
|
|
1682
1735
|
opacity: t,
|
|
@@ -1686,7 +1739,7 @@ const r1 = ({
|
|
|
1686
1739
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1687
1740
|
return;
|
|
1688
1741
|
const { origin: a } = pt(
|
|
1689
|
-
|
|
1742
|
+
W({ x: e.x, y: e.y }),
|
|
1690
1743
|
e.anchor,
|
|
1691
1744
|
at({ width: e.width, height: e.height })
|
|
1692
1745
|
), s = o(e.path);
|
|
@@ -1706,19 +1759,19 @@ const r1 = ({
|
|
|
1706
1759
|
width: e.strokeWidth
|
|
1707
1760
|
}), n.context.restore();
|
|
1708
1761
|
};
|
|
1709
|
-
function
|
|
1762
|
+
function f1(n, e) {
|
|
1710
1763
|
const t = e(), o = n.points, i = o[0];
|
|
1711
1764
|
if (i === void 0)
|
|
1712
1765
|
return { path: t, length: 0 };
|
|
1713
1766
|
t.path.moveTo(i.x, i.y);
|
|
1714
1767
|
let a = 0, s = i;
|
|
1715
1768
|
for (let h = 1; h < o.length; h++) {
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1769
|
+
const u = o[h];
|
|
1770
|
+
if (u === void 0)
|
|
1718
1771
|
continue;
|
|
1719
|
-
t.path.lineTo(
|
|
1720
|
-
const
|
|
1721
|
-
a +=
|
|
1772
|
+
t.path.lineTo(u.x, u.y);
|
|
1773
|
+
const c = Math.hypot(u.x - s.x, u.y - s.y);
|
|
1774
|
+
a += c, s = u;
|
|
1722
1775
|
}
|
|
1723
1776
|
t.path.closePath();
|
|
1724
1777
|
const r = Math.hypot(
|
|
@@ -1727,7 +1780,7 @@ function s1(n, e) {
|
|
|
1727
1780
|
);
|
|
1728
1781
|
return a += r, { path: t, length: a };
|
|
1729
1782
|
}
|
|
1730
|
-
const
|
|
1783
|
+
const g1 = ({
|
|
1731
1784
|
ctx: n,
|
|
1732
1785
|
object: e,
|
|
1733
1786
|
opacity: t,
|
|
@@ -1736,7 +1789,7 @@ const a1 = ({
|
|
|
1736
1789
|
const i = e.opacity * t;
|
|
1737
1790
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1738
1791
|
return;
|
|
1739
|
-
const { path: a, length: s } =
|
|
1792
|
+
const { path: a, length: s } = f1(e, o);
|
|
1740
1793
|
vt({
|
|
1741
1794
|
ctx: n,
|
|
1742
1795
|
path: a,
|
|
@@ -1752,26 +1805,26 @@ const a1 = ({
|
|
|
1752
1805
|
width: e.strokeWidth
|
|
1753
1806
|
});
|
|
1754
1807
|
};
|
|
1755
|
-
function
|
|
1808
|
+
function p1(n, e) {
|
|
1756
1809
|
const t = n.strokeWidth / 2, { origin: o, size: i } = pt(
|
|
1757
|
-
|
|
1810
|
+
W({ x: n.x, y: n.y }),
|
|
1758
1811
|
n.anchor,
|
|
1759
1812
|
at({ width: n.width, height: n.height })
|
|
1760
1813
|
), a = i.width - n.strokeWidth, s = i.height - n.strokeWidth;
|
|
1761
1814
|
if (a <= 0 || s <= 0)
|
|
1762
1815
|
return;
|
|
1763
|
-
const r =
|
|
1816
|
+
const r = W({ x: o.x + t, y: o.y + t }), h = at({ width: a, height: s }), u = Math.max(
|
|
1764
1817
|
0,
|
|
1765
1818
|
Math.min(n.cornerRadius - t, Math.min(a, s) / 2)
|
|
1766
1819
|
);
|
|
1767
|
-
if (
|
|
1768
|
-
return
|
|
1769
|
-
const
|
|
1770
|
-
return
|
|
1820
|
+
if (u > 0)
|
|
1821
|
+
return a0(r, h, u, e).path;
|
|
1822
|
+
const c = e();
|
|
1823
|
+
return c.path.moveTo(r.x, r.y), c.path.lineTo(r.x + a, r.y), c.path.lineTo(r.x + a, r.y + s), c.path.lineTo(r.x, r.y + s), c.path.closePath(), c;
|
|
1771
1824
|
}
|
|
1772
|
-
function
|
|
1825
|
+
function d1(n, e) {
|
|
1773
1826
|
const { origin: t, size: o } = pt(
|
|
1774
|
-
|
|
1827
|
+
W({ x: n.x, y: n.y }),
|
|
1775
1828
|
n.anchor,
|
|
1776
1829
|
at({ width: n.width, height: n.height })
|
|
1777
1830
|
), i = Math.max(
|
|
@@ -1779,7 +1832,7 @@ function l1(n, e) {
|
|
|
1779
1832
|
Math.min(n.cornerRadius, Math.min(o.width, o.height) / 2)
|
|
1780
1833
|
), a = Math.min(n.strokeWidth * 2, o.width - i);
|
|
1781
1834
|
if (i > 0)
|
|
1782
|
-
return
|
|
1835
|
+
return a0(t, o, i, e, a);
|
|
1783
1836
|
{
|
|
1784
1837
|
const s = e();
|
|
1785
1838
|
s.path.moveTo(t.x, t.y), s.path.lineTo(t.x + o.width, t.y), s.path.lineTo(t.x + o.width, t.y + o.height), s.path.lineTo(t.x, t.y + o.height), s.path.lineTo(t.x, t.y), s.path.lineTo(t.x + a, t.y);
|
|
@@ -1787,7 +1840,7 @@ function l1(n, e) {
|
|
|
1787
1840
|
return { path: s, length: r };
|
|
1788
1841
|
}
|
|
1789
1842
|
}
|
|
1790
|
-
const
|
|
1843
|
+
const x1 = ({
|
|
1791
1844
|
ctx: n,
|
|
1792
1845
|
object: e,
|
|
1793
1846
|
opacity: t,
|
|
@@ -1796,10 +1849,10 @@ const c1 = ({
|
|
|
1796
1849
|
const i = e.opacity * t;
|
|
1797
1850
|
if (i === 0 || e.drawn === 0 && e.fillColor.alpha === 0)
|
|
1798
1851
|
return;
|
|
1799
|
-
const { path: a, length: s } =
|
|
1852
|
+
const { path: a, length: s } = d1(e, o);
|
|
1800
1853
|
if (i < 1 && e.strokeWidth > 0) {
|
|
1801
|
-
const r =
|
|
1802
|
-
r !== void 0 && (n.context.save(),
|
|
1854
|
+
const r = p1(e, o);
|
|
1855
|
+
r !== void 0 && (n.context.save(), Y0(n, r), vt({ ctx: n, path: a, color: e.fillColor, opacity: i }), n.context.restore());
|
|
1803
1856
|
} else
|
|
1804
1857
|
vt({ ctx: n, path: a, color: e.fillColor, opacity: i });
|
|
1805
1858
|
yt({
|
|
@@ -1811,7 +1864,7 @@ const c1 = ({
|
|
|
1811
1864
|
opacity: i,
|
|
1812
1865
|
width: e.strokeWidth
|
|
1813
1866
|
});
|
|
1814
|
-
},
|
|
1867
|
+
}, y1 = ({
|
|
1815
1868
|
ctx: n,
|
|
1816
1869
|
imageById: e,
|
|
1817
1870
|
object: t,
|
|
@@ -1824,7 +1877,7 @@ const c1 = ({
|
|
|
1824
1877
|
if (a === void 0)
|
|
1825
1878
|
return;
|
|
1826
1879
|
const s = pt(
|
|
1827
|
-
|
|
1880
|
+
W({ x: t.x, y: t.y }),
|
|
1828
1881
|
t.anchor,
|
|
1829
1882
|
at({ width: t.width, height: t.height })
|
|
1830
1883
|
);
|
|
@@ -1852,7 +1905,7 @@ const c1 = ({
|
|
|
1852
1905
|
}
|
|
1853
1906
|
n.context.restore();
|
|
1854
1907
|
};
|
|
1855
|
-
function
|
|
1908
|
+
function v1(n) {
|
|
1856
1909
|
return {
|
|
1857
1910
|
color: n.color,
|
|
1858
1911
|
fontFamily: n.fontFamily,
|
|
@@ -1864,7 +1917,7 @@ function f1(n) {
|
|
|
1864
1917
|
superscript: n.superscript
|
|
1865
1918
|
};
|
|
1866
1919
|
}
|
|
1867
|
-
function
|
|
1920
|
+
function w1(n, e = 1) {
|
|
1868
1921
|
const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
|
|
1869
1922
|
let o = 0, i = 0;
|
|
1870
1923
|
for (let a = 0; a < n.length; a++) {
|
|
@@ -1879,8 +1932,8 @@ function g1(n, e = 1) {
|
|
|
1879
1932
|
width: t
|
|
1880
1933
|
};
|
|
1881
1934
|
}
|
|
1882
|
-
const
|
|
1883
|
-
function
|
|
1935
|
+
const m1 = 0.7, b1 = 0.3;
|
|
1936
|
+
function W0(n) {
|
|
1884
1937
|
const e = n.superscript, t = n.subscript && !e;
|
|
1885
1938
|
return !e && !t ? {
|
|
1886
1939
|
baselineShift: 0,
|
|
@@ -1888,79 +1941,79 @@ function D0(n) {
|
|
|
1888
1941
|
isSubscript: !1,
|
|
1889
1942
|
isSuperscript: !1
|
|
1890
1943
|
} : {
|
|
1891
|
-
baselineShift: n.fontSize *
|
|
1892
|
-
fontSize: n.fontSize *
|
|
1944
|
+
baselineShift: n.fontSize * b1 * (e ? -1 : 1),
|
|
1945
|
+
fontSize: n.fontSize * m1,
|
|
1893
1946
|
isSubscript: t,
|
|
1894
1947
|
isSuperscript: e
|
|
1895
1948
|
};
|
|
1896
1949
|
}
|
|
1897
|
-
function
|
|
1950
|
+
function A1(n) {
|
|
1898
1951
|
return {
|
|
1899
1952
|
width: n.width,
|
|
1900
1953
|
height: n.fontBoundingBoxAscent
|
|
1901
1954
|
};
|
|
1902
1955
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const o =
|
|
1905
|
-
n.context.fillStyle =
|
|
1956
|
+
function X0(n, e, t = 1) {
|
|
1957
|
+
const o = W0(e);
|
|
1958
|
+
n.context.fillStyle = s0(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${o.fontSize}px ${e.fontFamily}`, n.type === V.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
|
|
1906
1959
|
}
|
|
1907
|
-
function
|
|
1960
|
+
function M1(n, e, t) {
|
|
1908
1961
|
const o = [];
|
|
1909
1962
|
for (const i of n) {
|
|
1910
1963
|
const a = [];
|
|
1911
1964
|
for (const s of i) {
|
|
1912
|
-
const { text: r, ...h } = s,
|
|
1913
|
-
|
|
1914
|
-
const
|
|
1965
|
+
const { text: r, ...h } = s, u = { ...e, ...h };
|
|
1966
|
+
X0(t, u);
|
|
1967
|
+
const c = t.context.measureText(r), d = A1(c), { baselineShift: l } = W0(u), f = d.height + Math.max(0, -l), m = Math.max(0, l);
|
|
1915
1968
|
a.push({
|
|
1916
1969
|
...d,
|
|
1917
1970
|
baselineShift: l,
|
|
1918
1971
|
bottom: m,
|
|
1919
|
-
height:
|
|
1920
|
-
top:
|
|
1972
|
+
height: f + m,
|
|
1973
|
+
top: f
|
|
1921
1974
|
});
|
|
1922
1975
|
}
|
|
1923
1976
|
o.push(a);
|
|
1924
1977
|
}
|
|
1925
1978
|
return o;
|
|
1926
1979
|
}
|
|
1927
|
-
const
|
|
1980
|
+
const L1 = ({ ctx: n, object: e, opacity: t }) => {
|
|
1928
1981
|
const o = e.opacity * t;
|
|
1929
1982
|
if (o === 0)
|
|
1930
1983
|
return;
|
|
1931
|
-
const { length: i } = e, a =
|
|
1932
|
-
let
|
|
1984
|
+
const { length: i } = e, a = q0(e.text), s = v1(e), r = M1(a, s, n), h = w1(r, e.lineSpacing), u = pt(W({ x: e.x, y: e.y }), e.anchor, h);
|
|
1985
|
+
let c = u.origin.x, d = u.origin.y, l = 0, f = 0;
|
|
1933
1986
|
for (let m = 0; m < a.length; m++) {
|
|
1934
1987
|
const y = a[m], M = r[m];
|
|
1935
1988
|
if (y == null || M == null) {
|
|
1936
1989
|
console.error("Could not determine text units or sizes for line");
|
|
1937
1990
|
continue;
|
|
1938
1991
|
}
|
|
1939
|
-
const E = M.reduce((I,
|
|
1992
|
+
const E = M.reduce((I, R) => I + R.width, 0), L = M.length === 0 ? f : M.reduce((I, R) => Math.max(I, R.top), 0), C = M.length === 0 ? 0 : M.reduce((I, R) => Math.max(I, R.bottom), 0), S = L + C;
|
|
1940
1993
|
switch (e.alignment) {
|
|
1941
1994
|
case xt.LEFT:
|
|
1942
|
-
|
|
1995
|
+
c = u.origin.x;
|
|
1943
1996
|
break;
|
|
1944
1997
|
case xt.CENTER:
|
|
1945
|
-
|
|
1998
|
+
c = u.origin.x + (u.size.width - E) / 2;
|
|
1946
1999
|
break;
|
|
1947
2000
|
case xt.RIGHT:
|
|
1948
|
-
|
|
2001
|
+
c = u.origin.x + (u.size.width - E);
|
|
1949
2002
|
break;
|
|
1950
2003
|
default:
|
|
1951
2004
|
st(e.alignment);
|
|
1952
2005
|
break;
|
|
1953
2006
|
}
|
|
1954
|
-
d +=
|
|
2007
|
+
d += f * (e.lineSpacing - 1);
|
|
1955
2008
|
const T = d + L;
|
|
1956
|
-
|
|
2009
|
+
f = S;
|
|
1957
2010
|
for (let I = 0; I < y.length && !(i !== null && l >= i); I++) {
|
|
1958
|
-
const
|
|
1959
|
-
if (
|
|
2011
|
+
const R = y[I], X = M[I];
|
|
2012
|
+
if (R == null || X == null) {
|
|
1960
2013
|
console.error("Could not determine text unit or size for unit");
|
|
1961
2014
|
continue;
|
|
1962
2015
|
}
|
|
1963
|
-
const { text: H,
|
|
2016
|
+
const { text: H, ...Y } = R;
|
|
1964
2017
|
let tt;
|
|
1965
2018
|
if (i !== null && l + H.length > i) {
|
|
1966
2019
|
const K = i - l;
|
|
@@ -1968,35 +2021,35 @@ const v1 = ({ ctx: n, object: e, opacity: t }) => {
|
|
|
1968
2021
|
}
|
|
1969
2022
|
const et = tt ?? H;
|
|
1970
2023
|
l += et.length;
|
|
1971
|
-
const nt = { ...s,
|
|
1972
|
-
|
|
2024
|
+
const nt = { ...s, ...Y };
|
|
2025
|
+
X0(n, nt, o), n.context.fillText(et, c, T + X.baselineShift), c += X.width;
|
|
1973
2026
|
}
|
|
1974
2027
|
d += S;
|
|
1975
2028
|
}
|
|
1976
|
-
},
|
|
1977
|
-
[U.ARROW]:
|
|
1978
|
-
[U.CIRCLE]:
|
|
1979
|
-
[U.GROUP]:
|
|
1980
|
-
[U.IMAGE]:
|
|
1981
|
-
[U.LINE]:
|
|
1982
|
-
[U.MASK]:
|
|
1983
|
-
[U.PATH]:
|
|
1984
|
-
[U.POLYGON]:
|
|
1985
|
-
[U.RECTANGLE]:
|
|
2029
|
+
}, T1 = {
|
|
2030
|
+
[U.ARROW]: e1,
|
|
2031
|
+
[U.CIRCLE]: i1,
|
|
2032
|
+
[U.GROUP]: s1,
|
|
2033
|
+
[U.IMAGE]: a1,
|
|
2034
|
+
[U.LINE]: l1,
|
|
2035
|
+
[U.MASK]: c1,
|
|
2036
|
+
[U.PATH]: u1,
|
|
2037
|
+
[U.POLYGON]: g1,
|
|
2038
|
+
[U.RECTANGLE]: x1,
|
|
1986
2039
|
[U.SLIDE_OBJECT]: () => {
|
|
1987
2040
|
},
|
|
1988
|
-
[U.SVG]:
|
|
1989
|
-
[U.TEXT]:
|
|
2041
|
+
[U.SVG]: y1,
|
|
2042
|
+
[U.TEXT]: L1
|
|
1990
2043
|
};
|
|
1991
|
-
function
|
|
2044
|
+
function C1(n) {
|
|
1992
2045
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1993
2046
|
return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
|
|
1994
2047
|
}
|
|
1995
|
-
function
|
|
2048
|
+
function P1(n, e) {
|
|
1996
2049
|
if (n === null)
|
|
1997
2050
|
return null;
|
|
1998
2051
|
const t = pt(
|
|
1999
|
-
|
|
2052
|
+
W({ x: e.x, y: e.y }),
|
|
2000
2053
|
e.anchor,
|
|
2001
2054
|
at({ width: e.width, height: e.height })
|
|
2002
2055
|
), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
@@ -2012,13 +2065,13 @@ function b1(n, e) {
|
|
|
2012
2065
|
a !== null && a(), n.removeChild(o);
|
|
2013
2066
|
};
|
|
2014
2067
|
}
|
|
2015
|
-
async function
|
|
2068
|
+
async function E1(n) {
|
|
2016
2069
|
if (Object.keys(n).length === 0)
|
|
2017
2070
|
return {};
|
|
2018
2071
|
const e = {}, t = (i) => new Promise((a, s) => {
|
|
2019
2072
|
const r = new Image();
|
|
2020
|
-
if (r.onload = () => a(r), r.onerror = (
|
|
2021
|
-
const
|
|
2073
|
+
if (r.onload = () => a(r), r.onerror = (u) => s(u), i.includes("</svg>")) {
|
|
2074
|
+
const u = i.replace(/<\?xml[^?]*\?>\s*/g, ""), c = new Blob([u], { type: "image/svg+xml;charset=utf-8" }), d = URL.createObjectURL(c);
|
|
2022
2075
|
r.src = d;
|
|
2023
2076
|
} else
|
|
2024
2077
|
r.src = i;
|
|
@@ -2036,58 +2089,70 @@ async function A1(n) {
|
|
|
2036
2089
|
}
|
|
2037
2090
|
return e;
|
|
2038
2091
|
}
|
|
2039
|
-
class
|
|
2092
|
+
class jn {
|
|
2040
2093
|
constructor(e) {
|
|
2041
2094
|
this.navigator = null;
|
|
2042
2095
|
const { objectRenderers: t, scale: o = 1, ...i } = e;
|
|
2043
2096
|
this.props = {
|
|
2044
|
-
presentation:
|
|
2097
|
+
presentation: ze(),
|
|
2045
2098
|
element: document.body,
|
|
2046
2099
|
objectRenderers: {
|
|
2047
|
-
...
|
|
2100
|
+
...T1,
|
|
2048
2101
|
...t
|
|
2049
2102
|
},
|
|
2050
2103
|
cacheDurationMinutes: 15,
|
|
2051
|
-
scale:
|
|
2104
|
+
scale: S1(o),
|
|
2052
2105
|
...i
|
|
2053
|
-
}, this.state = { ...
|
|
2106
|
+
}, this.state = { ...b0 };
|
|
2054
2107
|
}
|
|
2055
2108
|
/** Starts the presentation. */
|
|
2056
2109
|
async present() {
|
|
2057
|
-
const { presentation: e, element: t, scale: o } = this.props, i =
|
|
2110
|
+
const { presentation: e, element: t, scale: o } = this.props, i = Qe(e.size), a = C1(e.size);
|
|
2058
2111
|
a.style.transformOrigin = "center center", a.style.transform = `scale(${o})`, this.state = {
|
|
2059
|
-
...
|
|
2060
|
-
imageById: await
|
|
2112
|
+
...b0,
|
|
2113
|
+
imageById: await E1({
|
|
2061
2114
|
...e.resources.images,
|
|
2062
|
-
...
|
|
2115
|
+
...Ge(e)
|
|
2063
2116
|
}),
|
|
2064
2117
|
canvas: i,
|
|
2065
2118
|
extrasContainer: a
|
|
2066
2119
|
};
|
|
2067
|
-
const s =
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2120
|
+
const s = He(e, t), r = U0(t), h = (c, d) => {
|
|
2121
|
+
this.state.shortcutState.shortcuts.b = {
|
|
2122
|
+
slideIndex: this.state.slideIndex,
|
|
2123
|
+
buildIndex: this.state.buildIndex
|
|
2124
|
+
}, this.renderSlide(c ?? this.state.slideIndex, d);
|
|
2125
|
+
};
|
|
2126
|
+
j0(
|
|
2127
|
+
e,
|
|
2128
|
+
s,
|
|
2129
|
+
this.state.shortcutState,
|
|
2130
|
+
{
|
|
2131
|
+
onNext: (c) => this.next(c),
|
|
2132
|
+
onPrevious: (c) => this.previous(c),
|
|
2133
|
+
onRenderSlide: h,
|
|
2134
|
+
onShowNavigator: () => {
|
|
2135
|
+
r && (this.navigator = Fe({
|
|
2136
|
+
presentation: e,
|
|
2137
|
+
shortcutState: this.state.shortcutState,
|
|
2138
|
+
onNavigateToSlide: (c) => this.renderSlide(c),
|
|
2139
|
+
onRenderSlide: h,
|
|
2140
|
+
onNext: (c) => this.next(c),
|
|
2141
|
+
onPrevious: (c) => this.previous(c)
|
|
2142
|
+
}), this.updateNavigator());
|
|
2143
|
+
}
|
|
2076
2144
|
},
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
onNavigateToSlide: (h) => this.renderSlide(h),
|
|
2081
|
-
onNext: () => this.next()
|
|
2082
|
-
}), this.updateNavigator();
|
|
2145
|
+
{
|
|
2146
|
+
focusOnPointerDown: !r,
|
|
2147
|
+
keyEventTarget: r ? window : s
|
|
2083
2148
|
}
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2086
|
-
|
|
2149
|
+
), t.replaceChildren(), s.appendChild(i), s.appendChild(a), t.appendChild(s);
|
|
2150
|
+
const u = Ze(e, this.props.cacheDurationMinutes);
|
|
2151
|
+
u !== null ? this.renderSlide(u.slideIndex, u.buildIndex) : this.renderSlide(0);
|
|
2087
2152
|
}
|
|
2088
2153
|
renderSlide(e, t = 0, o = null) {
|
|
2089
2154
|
const { presentation: i } = this.props, { canvas: a } = this.state, s = this.state.slideIndex !== e;
|
|
2090
|
-
this.state.slideIndex = e, this.state.buildIndex = t, o === null &&
|
|
2155
|
+
this.state.slideIndex = e, this.state.buildIndex = t, o === null && Ve({ title: i.title, slideIndex: e, buildIndex: t });
|
|
2091
2156
|
const r = i.slides[e];
|
|
2092
2157
|
if (!(r === void 0 || a === null)) {
|
|
2093
2158
|
if (s || this.state.mountedExtrasCleanups.length === 0 && r.extras.length > 0) {
|
|
@@ -2095,8 +2160,8 @@ class Rn {
|
|
|
2095
2160
|
h();
|
|
2096
2161
|
this.state.mountedExtrasCleanups = [];
|
|
2097
2162
|
for (const h of r.extras) {
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2163
|
+
const u = P1(this.state.extrasContainer, h);
|
|
2164
|
+
u !== null && this.state.mountedExtrasCleanups.push(u);
|
|
2100
2165
|
}
|
|
2101
2166
|
}
|
|
2102
2167
|
this.renderCanvas(a, e, t, o, this.props.scale), o === null && this.updateNavigator();
|
|
@@ -2105,42 +2170,42 @@ class Rn {
|
|
|
2105
2170
|
renderCanvas(e, t, o = 0, i = null, a = 1) {
|
|
2106
2171
|
const { objectRenderers: s, presentation: r } = this.props, { imageById: h } = this.state;
|
|
2107
2172
|
e.width = r.size.width, e.height = r.size.height;
|
|
2108
|
-
const
|
|
2109
|
-
if (
|
|
2173
|
+
const u = e.getContext("2d");
|
|
2174
|
+
if (u === null)
|
|
2110
2175
|
return;
|
|
2111
|
-
const
|
|
2176
|
+
const c = {
|
|
2112
2177
|
type: V.Browser,
|
|
2113
|
-
context:
|
|
2178
|
+
context: u
|
|
2114
2179
|
};
|
|
2115
|
-
|
|
2180
|
+
Ke(e, c);
|
|
2116
2181
|
const d = r.slides[t];
|
|
2117
2182
|
if (d === void 0)
|
|
2118
2183
|
return;
|
|
2119
|
-
const l =
|
|
2184
|
+
const l = Xe({
|
|
2120
2185
|
slide: d,
|
|
2121
2186
|
buildIndex: o,
|
|
2122
2187
|
buildTime: i
|
|
2123
2188
|
});
|
|
2124
|
-
|
|
2125
|
-
function
|
|
2189
|
+
c.context.fillStyle = s0(r.backgroundColor), c.context.fillRect(0, 0, e.width, e.height);
|
|
2190
|
+
function f(y, M) {
|
|
2126
2191
|
const E = s[y.objectType], L = l.get(y);
|
|
2127
2192
|
E === void 0 || L === void 0 || E({
|
|
2128
|
-
ctx:
|
|
2193
|
+
ctx: c,
|
|
2129
2194
|
imageById: h,
|
|
2130
2195
|
object: L,
|
|
2131
2196
|
opacity: M,
|
|
2132
|
-
renderObject:
|
|
2133
|
-
createPath2D:
|
|
2197
|
+
renderObject: f,
|
|
2198
|
+
createPath2D: Je
|
|
2134
2199
|
});
|
|
2135
2200
|
}
|
|
2136
2201
|
const m = a !== 1;
|
|
2137
|
-
m && (
|
|
2202
|
+
m && (c.context.save(), c.context.translate(
|
|
2138
2203
|
e.width * (1 - a) / 2,
|
|
2139
2204
|
e.height * (1 - a) / 2
|
|
2140
|
-
),
|
|
2205
|
+
), c.context.scale(a, a));
|
|
2141
2206
|
for (const y of d.objects)
|
|
2142
|
-
|
|
2143
|
-
m &&
|
|
2207
|
+
f(y, 1);
|
|
2208
|
+
m && c.context.restore();
|
|
2144
2209
|
}
|
|
2145
2210
|
updateNavigator() {
|
|
2146
2211
|
const { navigator: e } = this;
|
|
@@ -2171,11 +2236,11 @@ class Rn {
|
|
|
2171
2236
|
return;
|
|
2172
2237
|
const r = s.animations[a];
|
|
2173
2238
|
if (r !== void 0 && !e) {
|
|
2174
|
-
const h = performance.now(),
|
|
2239
|
+
const h = performance.now(), u = je(r), c = (d) => {
|
|
2175
2240
|
const l = d - h;
|
|
2176
|
-
l <
|
|
2241
|
+
l < u ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(c)) : this.renderSlide(i, a + 1, null);
|
|
2177
2242
|
};
|
|
2178
|
-
this.state.currentAnimationId = requestAnimationFrame(
|
|
2243
|
+
this.state.currentAnimationId = requestAnimationFrame(c);
|
|
2179
2244
|
} else i + 1 < t.slides.length && this.renderSlide(i + 1);
|
|
2180
2245
|
}
|
|
2181
2246
|
previous(e = !1) {
|
|
@@ -2197,12 +2262,12 @@ class Rn {
|
|
|
2197
2262
|
return t > 0 || e > 0;
|
|
2198
2263
|
}
|
|
2199
2264
|
}
|
|
2200
|
-
function
|
|
2265
|
+
function S1(n) {
|
|
2201
2266
|
return n <= 0 || n > 1 ? (console.warn(
|
|
2202
2267
|
`BrowserCanvasRenderer scale must be positive and no greater than 1. Received ${n}; using 1 instead.`
|
|
2203
2268
|
), 1) : n;
|
|
2204
2269
|
}
|
|
2205
|
-
function
|
|
2270
|
+
function Hn(n = 1e3) {
|
|
2206
2271
|
return {
|
|
2207
2272
|
type: ft.PAUSE,
|
|
2208
2273
|
isKey: !1,
|
|
@@ -2210,7 +2275,7 @@ function Nn(n = 1e3) {
|
|
|
2210
2275
|
shortcut: null
|
|
2211
2276
|
};
|
|
2212
2277
|
}
|
|
2213
|
-
function
|
|
2278
|
+
function Un(n = null) {
|
|
2214
2279
|
return {
|
|
2215
2280
|
objects: [],
|
|
2216
2281
|
animations: [],
|
|
@@ -2223,32 +2288,32 @@ function Bn(n = null) {
|
|
|
2223
2288
|
...n
|
|
2224
2289
|
};
|
|
2225
2290
|
}
|
|
2226
|
-
function
|
|
2291
|
+
function $n(n, e = {}) {
|
|
2227
2292
|
return {
|
|
2228
2293
|
...e,
|
|
2229
2294
|
text: n
|
|
2230
2295
|
};
|
|
2231
2296
|
}
|
|
2232
|
-
function
|
|
2297
|
+
function Yn(n = G.BLACK) {
|
|
2233
2298
|
return { ...n, alpha: 1 };
|
|
2234
2299
|
}
|
|
2235
|
-
function
|
|
2300
|
+
function k1(n) {
|
|
2236
2301
|
for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
|
|
2237
2302
|
o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
|
|
2238
2303
|
return a / 2;
|
|
2239
2304
|
}
|
|
2240
|
-
function
|
|
2305
|
+
function I1(n) {
|
|
2241
2306
|
for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
|
|
2242
2307
|
i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
|
|
2243
2308
|
return h;
|
|
2244
2309
|
}
|
|
2245
|
-
function
|
|
2310
|
+
function _1(n) {
|
|
2246
2311
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
2247
2312
|
}
|
|
2248
|
-
var
|
|
2249
|
-
function
|
|
2250
|
-
if (
|
|
2251
|
-
|
|
2313
|
+
var jt, A0;
|
|
2314
|
+
function O1() {
|
|
2315
|
+
if (A0) return jt;
|
|
2316
|
+
A0 = 1;
|
|
2252
2317
|
var n = { a: 7, c: 6, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, z: 0 }, e = [
|
|
2253
2318
|
5760,
|
|
2254
2319
|
6158,
|
|
@@ -2268,13 +2333,13 @@ function P1() {
|
|
|
2268
2333
|
12288,
|
|
2269
2334
|
65279
|
|
2270
2335
|
];
|
|
2271
|
-
function t(
|
|
2272
|
-
return
|
|
2336
|
+
function t(f) {
|
|
2337
|
+
return f === 10 || f === 13 || f === 8232 || f === 8233 || // Line terminators
|
|
2273
2338
|
// White spaces
|
|
2274
|
-
|
|
2339
|
+
f === 32 || f === 9 || f === 11 || f === 12 || f === 160 || f >= 5760 && e.indexOf(f) >= 0;
|
|
2275
2340
|
}
|
|
2276
|
-
function o(
|
|
2277
|
-
switch (
|
|
2341
|
+
function o(f) {
|
|
2342
|
+
switch (f | 32) {
|
|
2278
2343
|
case 109:
|
|
2279
2344
|
case 122:
|
|
2280
2345
|
case 108:
|
|
@@ -2290,110 +2355,110 @@ function P1() {
|
|
|
2290
2355
|
}
|
|
2291
2356
|
return !1;
|
|
2292
2357
|
}
|
|
2293
|
-
function i(
|
|
2294
|
-
return (
|
|
2358
|
+
function i(f) {
|
|
2359
|
+
return (f | 32) === 97;
|
|
2295
2360
|
}
|
|
2296
|
-
function a(
|
|
2297
|
-
return
|
|
2361
|
+
function a(f) {
|
|
2362
|
+
return f >= 48 && f <= 57;
|
|
2298
2363
|
}
|
|
2299
|
-
function s(
|
|
2300
|
-
return
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2364
|
+
function s(f) {
|
|
2365
|
+
return f >= 48 && f <= 57 || /* 0..9 */
|
|
2366
|
+
f === 43 || /* + */
|
|
2367
|
+
f === 45 || /* - */
|
|
2368
|
+
f === 46;
|
|
2304
2369
|
}
|
|
2305
|
-
function r(
|
|
2306
|
-
this.index = 0, this.path =
|
|
2370
|
+
function r(f) {
|
|
2371
|
+
this.index = 0, this.path = f, this.max = f.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
|
|
2307
2372
|
}
|
|
2308
|
-
function h(
|
|
2309
|
-
for (;
|
|
2310
|
-
|
|
2373
|
+
function h(f) {
|
|
2374
|
+
for (; f.index < f.max && t(f.path.charCodeAt(f.index)); )
|
|
2375
|
+
f.index++;
|
|
2311
2376
|
}
|
|
2312
|
-
function
|
|
2313
|
-
var m =
|
|
2377
|
+
function u(f) {
|
|
2378
|
+
var m = f.path.charCodeAt(f.index);
|
|
2314
2379
|
if (m === 48) {
|
|
2315
|
-
|
|
2380
|
+
f.param = 0, f.index++;
|
|
2316
2381
|
return;
|
|
2317
2382
|
}
|
|
2318
2383
|
if (m === 49) {
|
|
2319
|
-
|
|
2384
|
+
f.param = 1, f.index++;
|
|
2320
2385
|
return;
|
|
2321
2386
|
}
|
|
2322
|
-
|
|
2387
|
+
f.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + f.index + ")";
|
|
2323
2388
|
}
|
|
2324
|
-
function f
|
|
2325
|
-
var m =
|
|
2389
|
+
function c(f) {
|
|
2390
|
+
var m = f.index, y = m, M = f.max, E = !1, L = !1, C = !1, S = !1, T;
|
|
2326
2391
|
if (y >= M) {
|
|
2327
|
-
|
|
2392
|
+
f.err = "SvgPath: missed param (at pos " + y + ")";
|
|
2328
2393
|
return;
|
|
2329
2394
|
}
|
|
2330
|
-
if (T =
|
|
2331
|
-
|
|
2395
|
+
if (T = f.path.charCodeAt(y), (T === 43 || T === 45) && (y++, T = y < M ? f.path.charCodeAt(y) : 0), !a(T) && T !== 46) {
|
|
2396
|
+
f.err = "SvgPath: param should start with 0..9 or `.` (at pos " + y + ")";
|
|
2332
2397
|
return;
|
|
2333
2398
|
}
|
|
2334
2399
|
if (T !== 46) {
|
|
2335
|
-
if (E = T === 48, y++, T = y < M ?
|
|
2336
|
-
|
|
2400
|
+
if (E = T === 48, y++, T = y < M ? f.path.charCodeAt(y) : 0, E && y < M && T && a(T)) {
|
|
2401
|
+
f.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + m + ")";
|
|
2337
2402
|
return;
|
|
2338
2403
|
}
|
|
2339
|
-
for (; y < M && a(
|
|
2404
|
+
for (; y < M && a(f.path.charCodeAt(y)); )
|
|
2340
2405
|
y++, L = !0;
|
|
2341
|
-
T = y < M ?
|
|
2406
|
+
T = y < M ? f.path.charCodeAt(y) : 0;
|
|
2342
2407
|
}
|
|
2343
2408
|
if (T === 46) {
|
|
2344
|
-
for (S = !0, y++; a(
|
|
2409
|
+
for (S = !0, y++; a(f.path.charCodeAt(y)); )
|
|
2345
2410
|
y++, C = !0;
|
|
2346
|
-
T = y < M ?
|
|
2411
|
+
T = y < M ? f.path.charCodeAt(y) : 0;
|
|
2347
2412
|
}
|
|
2348
2413
|
if (T === 101 || T === 69) {
|
|
2349
2414
|
if (S && !L && !C) {
|
|
2350
|
-
|
|
2415
|
+
f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
2351
2416
|
return;
|
|
2352
2417
|
}
|
|
2353
|
-
if (y++, T = y < M ?
|
|
2354
|
-
for (; y < M && a(
|
|
2418
|
+
if (y++, T = y < M ? f.path.charCodeAt(y) : 0, (T === 43 || T === 45) && y++, y < M && a(f.path.charCodeAt(y)))
|
|
2419
|
+
for (; y < M && a(f.path.charCodeAt(y)); )
|
|
2355
2420
|
y++;
|
|
2356
2421
|
else {
|
|
2357
|
-
|
|
2422
|
+
f.err = "SvgPath: invalid float exponent (at pos " + y + ")";
|
|
2358
2423
|
return;
|
|
2359
2424
|
}
|
|
2360
2425
|
}
|
|
2361
|
-
|
|
2426
|
+
f.index = y, f.param = parseFloat(f.path.slice(m, y)) + 0;
|
|
2362
2427
|
}
|
|
2363
|
-
function d(
|
|
2428
|
+
function d(f) {
|
|
2364
2429
|
var m, y;
|
|
2365
|
-
m =
|
|
2366
|
-
var M =
|
|
2367
|
-
if (y === "m" && M.length > 2 && (
|
|
2368
|
-
|
|
2430
|
+
m = f.path[f.segmentStart], y = m.toLowerCase();
|
|
2431
|
+
var M = f.data;
|
|
2432
|
+
if (y === "m" && M.length > 2 && (f.result.push([m, M[0], M[1]]), M = M.slice(2), y = "l", m = m === "m" ? "l" : "L"), y === "r")
|
|
2433
|
+
f.result.push([m].concat(M));
|
|
2369
2434
|
else
|
|
2370
|
-
for (; M.length >= n[y] && (
|
|
2435
|
+
for (; M.length >= n[y] && (f.result.push([m].concat(M.splice(0, n[y]))), !!n[y]); )
|
|
2371
2436
|
;
|
|
2372
2437
|
}
|
|
2373
|
-
function l(
|
|
2374
|
-
var m =
|
|
2375
|
-
if (
|
|
2376
|
-
|
|
2438
|
+
function l(f) {
|
|
2439
|
+
var m = f.max, y, M, E, L, C;
|
|
2440
|
+
if (f.segmentStart = f.index, y = f.path.charCodeAt(f.index), M = i(y), !o(y)) {
|
|
2441
|
+
f.err = "SvgPath: bad command " + f.path[f.index] + " (at pos " + f.index + ")";
|
|
2377
2442
|
return;
|
|
2378
2443
|
}
|
|
2379
|
-
if (L = n[
|
|
2380
|
-
d(
|
|
2444
|
+
if (L = n[f.path[f.index].toLowerCase()], f.index++, h(f), f.data = [], !L) {
|
|
2445
|
+
d(f);
|
|
2381
2446
|
return;
|
|
2382
2447
|
}
|
|
2383
2448
|
for (E = !1; ; ) {
|
|
2384
2449
|
for (C = L; C > 0; C--) {
|
|
2385
|
-
if (M && (C === 3 || C === 4) ?
|
|
2386
|
-
d(
|
|
2450
|
+
if (M && (C === 3 || C === 4) ? u(f) : c(f), f.err.length) {
|
|
2451
|
+
d(f);
|
|
2387
2452
|
return;
|
|
2388
2453
|
}
|
|
2389
|
-
|
|
2454
|
+
f.data.push(f.param), h(f), E = !1, f.index < m && f.path.charCodeAt(f.index) === 44 && (f.index++, h(f), E = !0);
|
|
2390
2455
|
}
|
|
2391
|
-
if (!E && (
|
|
2456
|
+
if (!E && (f.index >= f.max || !s(f.path.charCodeAt(f.index))))
|
|
2392
2457
|
break;
|
|
2393
2458
|
}
|
|
2394
|
-
d(
|
|
2459
|
+
d(f);
|
|
2395
2460
|
}
|
|
2396
|
-
return
|
|
2461
|
+
return jt = function(m) {
|
|
2397
2462
|
var y = new r(m), M = y.max;
|
|
2398
2463
|
for (h(y); y.index < M && !y.err.length; )
|
|
2399
2464
|
l(y);
|
|
@@ -2401,12 +2466,12 @@ function P1() {
|
|
|
2401
2466
|
err: y.err,
|
|
2402
2467
|
segments: y.result
|
|
2403
2468
|
};
|
|
2404
|
-
},
|
|
2469
|
+
}, jt;
|
|
2405
2470
|
}
|
|
2406
|
-
var
|
|
2407
|
-
function
|
|
2408
|
-
if (
|
|
2409
|
-
|
|
2471
|
+
var Ht, M0;
|
|
2472
|
+
function G0() {
|
|
2473
|
+
if (M0) return Ht;
|
|
2474
|
+
M0 = 1;
|
|
2410
2475
|
function n(t, o) {
|
|
2411
2476
|
return [
|
|
2412
2477
|
t[0] * o[0] + t[2] * o[1],
|
|
@@ -2451,13 +2516,13 @@ function j0() {
|
|
|
2451
2516
|
t * a[0] + o * a[2] + (i ? 0 : a[4]),
|
|
2452
2517
|
t * a[1] + o * a[3] + (i ? 0 : a[5])
|
|
2453
2518
|
]) : [t, o];
|
|
2454
|
-
},
|
|
2519
|
+
}, Ht = e, Ht;
|
|
2455
2520
|
}
|
|
2456
|
-
var
|
|
2457
|
-
function
|
|
2458
|
-
if (
|
|
2459
|
-
|
|
2460
|
-
var n =
|
|
2521
|
+
var Ut, L0;
|
|
2522
|
+
function F1() {
|
|
2523
|
+
if (L0) return Ut;
|
|
2524
|
+
L0 = 1;
|
|
2525
|
+
var n = G0(), e = {
|
|
2461
2526
|
matrix: !0,
|
|
2462
2527
|
scale: !0,
|
|
2463
2528
|
rotate: !0,
|
|
@@ -2465,16 +2530,16 @@ function E1() {
|
|
|
2465
2530
|
skewX: !0,
|
|
2466
2531
|
skewY: !0
|
|
2467
2532
|
}, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
|
|
2468
|
-
return
|
|
2533
|
+
return Ut = function(a) {
|
|
2469
2534
|
var s = new n(), r, h;
|
|
2470
|
-
return a.split(t).forEach(function(
|
|
2471
|
-
if (
|
|
2472
|
-
if (typeof e[
|
|
2473
|
-
r =
|
|
2535
|
+
return a.split(t).forEach(function(u) {
|
|
2536
|
+
if (u.length) {
|
|
2537
|
+
if (typeof e[u] < "u") {
|
|
2538
|
+
r = u;
|
|
2474
2539
|
return;
|
|
2475
2540
|
}
|
|
2476
|
-
switch (h =
|
|
2477
|
-
return +
|
|
2541
|
+
switch (h = u.split(o).map(function(c) {
|
|
2542
|
+
return +c || 0;
|
|
2478
2543
|
}), r) {
|
|
2479
2544
|
case "matrix":
|
|
2480
2545
|
h.length === 6 && s.matrix(h);
|
|
@@ -2497,29 +2562,29 @@ function E1() {
|
|
|
2497
2562
|
}
|
|
2498
2563
|
}
|
|
2499
2564
|
}), s;
|
|
2500
|
-
},
|
|
2565
|
+
}, Ut;
|
|
2501
2566
|
}
|
|
2502
|
-
var
|
|
2503
|
-
function
|
|
2504
|
-
if (
|
|
2505
|
-
|
|
2567
|
+
var $t, T0;
|
|
2568
|
+
function N1() {
|
|
2569
|
+
if (T0) return $t;
|
|
2570
|
+
T0 = 1;
|
|
2506
2571
|
var n = Math.PI * 2;
|
|
2507
2572
|
function e(i, a, s, r) {
|
|
2508
|
-
var h = i * r - a * s < 0 ? -1 : 1,
|
|
2509
|
-
return
|
|
2573
|
+
var h = i * r - a * s < 0 ? -1 : 1, u = i * s + a * r;
|
|
2574
|
+
return u > 1 && (u = 1), u < -1 && (u = -1), h * Math.acos(u);
|
|
2510
2575
|
}
|
|
2511
|
-
function t(i, a, s, r, h,
|
|
2512
|
-
var m =
|
|
2513
|
-
S < 0 && (S = 0), S /= M * C + E * L, S = Math.sqrt(S) * (h ===
|
|
2514
|
-
var T = S *
|
|
2515
|
-
return
|
|
2576
|
+
function t(i, a, s, r, h, u, c, d, l, f) {
|
|
2577
|
+
var m = f * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + f * (a - r) / 2, M = c * c, E = d * d, L = m * m, C = y * y, S = M * E - M * C - E * L;
|
|
2578
|
+
S < 0 && (S = 0), S /= M * C + E * L, S = Math.sqrt(S) * (h === u ? -1 : 1);
|
|
2579
|
+
var T = S * c / d * y, I = S * -d / c * m, R = f * T - l * I + (i + s) / 2, X = l * T + f * I + (a + r) / 2, H = (m - T) / c, Y = (y - I) / d, tt = (-m - T) / c, et = (-y - I) / d, nt = e(1, 0, H, Y), K = e(H, Y, tt, et);
|
|
2580
|
+
return u === 0 && K > 0 && (K -= n), u === 1 && K < 0 && (K += n), [R, X, nt, K];
|
|
2516
2581
|
}
|
|
2517
2582
|
function o(i, a) {
|
|
2518
|
-
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i),
|
|
2519
|
-
return [r, h, r - h * s, h + r * s,
|
|
2583
|
+
var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), u = Math.cos(i + a), c = Math.sin(i + a);
|
|
2584
|
+
return [r, h, r - h * s, h + r * s, u + c * s, c - u * s, u, c];
|
|
2520
2585
|
}
|
|
2521
|
-
return
|
|
2522
|
-
var m = Math.sin(
|
|
2586
|
+
return $t = function(a, s, r, h, u, c, d, l, f) {
|
|
2587
|
+
var m = Math.sin(f * n / 360), y = Math.cos(f * n / 360), M = y * (a - r) / 2 + m * (s - h) / 2, E = -m * (a - r) / 2 + y * (s - h) / 2;
|
|
2523
2588
|
if (M === 0 && E === 0)
|
|
2524
2589
|
return [];
|
|
2525
2590
|
if (d === 0 || l === 0)
|
|
@@ -2527,25 +2592,25 @@ function S1() {
|
|
|
2527
2592
|
d = Math.abs(d), l = Math.abs(l);
|
|
2528
2593
|
var L = M * M / (d * d) + E * E / (l * l);
|
|
2529
2594
|
L > 1 && (d *= Math.sqrt(L), l *= Math.sqrt(L));
|
|
2530
|
-
var C = t(a, s, r, h,
|
|
2531
|
-
I /=
|
|
2532
|
-
for (var
|
|
2595
|
+
var C = t(a, s, r, h, u, c, d, l, m, y), S = [], T = C[2], I = C[3], R = Math.max(Math.ceil(Math.abs(I) / (n / 4)), 1);
|
|
2596
|
+
I /= R;
|
|
2597
|
+
for (var X = 0; X < R; X++)
|
|
2533
2598
|
S.push(o(T, I)), T += I;
|
|
2534
2599
|
return S.map(function(H) {
|
|
2535
|
-
for (var
|
|
2536
|
-
var tt = H[
|
|
2600
|
+
for (var Y = 0; Y < H.length; Y += 2) {
|
|
2601
|
+
var tt = H[Y + 0], et = H[Y + 1];
|
|
2537
2602
|
tt *= d, et *= l;
|
|
2538
2603
|
var nt = y * tt - m * et, K = m * tt + y * et;
|
|
2539
|
-
H[
|
|
2604
|
+
H[Y + 0] = nt + C[0], H[Y + 1] = K + C[1];
|
|
2540
2605
|
}
|
|
2541
2606
|
return H;
|
|
2542
2607
|
});
|
|
2543
|
-
},
|
|
2608
|
+
}, $t;
|
|
2544
2609
|
}
|
|
2545
|
-
var Yt,
|
|
2546
|
-
function
|
|
2547
|
-
if (
|
|
2548
|
-
|
|
2610
|
+
var Yt, C0;
|
|
2611
|
+
function R1() {
|
|
2612
|
+
if (C0) return Yt;
|
|
2613
|
+
C0 = 1;
|
|
2549
2614
|
var n = 1e-10, e = Math.PI / 180;
|
|
2550
2615
|
function t(o, i, a) {
|
|
2551
2616
|
if (!(this instanceof t))
|
|
@@ -2558,24 +2623,24 @@ function k1() {
|
|
|
2558
2623
|
this.rx * (o[1] * i + o[3] * a),
|
|
2559
2624
|
this.ry * (-o[0] * a + o[2] * i),
|
|
2560
2625
|
this.ry * (-o[1] * a + o[3] * i)
|
|
2561
|
-
], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3],
|
|
2562
|
-
if (
|
|
2563
|
-
return this.rx = this.ry = Math.sqrt(
|
|
2626
|
+
], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3], u = ((s[0] - s[3]) * (s[0] - s[3]) + (s[2] + s[1]) * (s[2] + s[1])) * ((s[0] + s[3]) * (s[0] + s[3]) + (s[2] - s[1]) * (s[2] - s[1])), c = (r + h) / 2;
|
|
2627
|
+
if (u < n * c)
|
|
2628
|
+
return this.rx = this.ry = Math.sqrt(c), this.ax = 0, this;
|
|
2564
2629
|
var d = s[0] * s[1] + s[2] * s[3];
|
|
2565
|
-
|
|
2566
|
-
var l =
|
|
2630
|
+
u = Math.sqrt(u);
|
|
2631
|
+
var l = c + u / 2, f = c - u / 2;
|
|
2567
2632
|
return this.ax = Math.abs(d) < n && Math.abs(l - h) < n ? 90 : Math.atan(
|
|
2568
2633
|
Math.abs(d) > Math.abs(l - h) ? (l - r) / d : d / (l - h)
|
|
2569
|
-
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(
|
|
2634
|
+
) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(f)) : (this.ax += 90, this.rx = Math.sqrt(f), this.ry = Math.sqrt(l)), this;
|
|
2570
2635
|
}, t.prototype.isDegenerate = function() {
|
|
2571
2636
|
return this.rx < n * this.ry || this.ry < n * this.rx;
|
|
2572
2637
|
}, Yt = t, Yt;
|
|
2573
2638
|
}
|
|
2574
|
-
var
|
|
2575
|
-
function
|
|
2576
|
-
if (
|
|
2577
|
-
|
|
2578
|
-
var n =
|
|
2639
|
+
var Wt, P0;
|
|
2640
|
+
function B1() {
|
|
2641
|
+
if (P0) return Wt;
|
|
2642
|
+
P0 = 1;
|
|
2643
|
+
var n = O1(), e = F1(), t = G0(), o = N1(), i = R1();
|
|
2579
2644
|
function a(s) {
|
|
2580
2645
|
if (!(this instanceof a))
|
|
2581
2646
|
return new a(s);
|
|
@@ -2595,39 +2660,39 @@ function I1() {
|
|
|
2595
2660
|
throw new Error("SvgPath.from: invalid param type " + s);
|
|
2596
2661
|
}, a.prototype.__matrix = function(s) {
|
|
2597
2662
|
var r = this, h;
|
|
2598
|
-
s.queue.length && this.iterate(function(
|
|
2599
|
-
var
|
|
2600
|
-
switch (
|
|
2663
|
+
s.queue.length && this.iterate(function(u, c, d, l) {
|
|
2664
|
+
var f, m, y, M;
|
|
2665
|
+
switch (u[0]) {
|
|
2601
2666
|
// Process 'assymetric' commands separately
|
|
2602
2667
|
case "v":
|
|
2603
|
-
|
|
2668
|
+
f = s.calc(0, u[1], !0), m = f[0] === 0 ? ["v", f[1]] : ["l", f[0], f[1]];
|
|
2604
2669
|
break;
|
|
2605
2670
|
case "V":
|
|
2606
|
-
|
|
2671
|
+
f = s.calc(d, u[1], !1), m = f[0] === s.calc(d, l, !1)[0] ? ["V", f[1]] : ["L", f[0], f[1]];
|
|
2607
2672
|
break;
|
|
2608
2673
|
case "h":
|
|
2609
|
-
|
|
2674
|
+
f = s.calc(u[1], 0, !0), m = f[1] === 0 ? ["h", f[0]] : ["l", f[0], f[1]];
|
|
2610
2675
|
break;
|
|
2611
2676
|
case "H":
|
|
2612
|
-
|
|
2677
|
+
f = s.calc(u[1], l, !1), m = f[1] === s.calc(d, l, !1)[1] ? ["H", f[0]] : ["L", f[0], f[1]];
|
|
2613
2678
|
break;
|
|
2614
2679
|
case "a":
|
|
2615
2680
|
case "A":
|
|
2616
|
-
var E = s.toArray(), L = i(
|
|
2617
|
-
if (E[0] * E[3] - E[1] * E[2] < 0 && (
|
|
2618
|
-
m = [
|
|
2681
|
+
var E = s.toArray(), L = i(u[1], u[2], u[3]).transform(E);
|
|
2682
|
+
if (E[0] * E[3] - E[1] * E[2] < 0 && (u[5] = u[5] ? "0" : "1"), f = s.calc(u[6], u[7], u[0] === "a"), u[0] === "A" && u[6] === d && u[7] === l || u[0] === "a" && u[6] === 0 && u[7] === 0) {
|
|
2683
|
+
m = [u[0] === "a" ? "l" : "L", f[0], f[1]];
|
|
2619
2684
|
break;
|
|
2620
2685
|
}
|
|
2621
|
-
L.isDegenerate() ? m = [
|
|
2686
|
+
L.isDegenerate() ? m = [u[0] === "a" ? "l" : "L", f[0], f[1]] : m = [u[0], L.rx, L.ry, L.ax, u[4], u[5], f[0], f[1]];
|
|
2622
2687
|
break;
|
|
2623
2688
|
case "m":
|
|
2624
|
-
M =
|
|
2689
|
+
M = c > 0, f = s.calc(u[1], u[2], M), m = ["m", f[0], f[1]];
|
|
2625
2690
|
break;
|
|
2626
2691
|
default:
|
|
2627
|
-
for (y =
|
|
2628
|
-
|
|
2692
|
+
for (y = u[0], m = [y], M = y.toLowerCase() === y, h = 1; h < u.length; h += 2)
|
|
2693
|
+
f = s.calc(u[h], u[h + 1], M), m.push(f[0], f[1]);
|
|
2629
2694
|
}
|
|
2630
|
-
r.segments[
|
|
2695
|
+
r.segments[c] = m;
|
|
2631
2696
|
}, !0);
|
|
2632
2697
|
}, a.prototype.__evaluateStack = function() {
|
|
2633
2698
|
var s, r;
|
|
@@ -2643,12 +2708,12 @@ function I1() {
|
|
|
2643
2708
|
}, a.prototype.toString = function() {
|
|
2644
2709
|
var s = "", r = "", h = !1;
|
|
2645
2710
|
this.__evaluateStack();
|
|
2646
|
-
for (var
|
|
2647
|
-
var d = this.segments[
|
|
2711
|
+
for (var u = 0, c = this.segments.length; u < c; u++) {
|
|
2712
|
+
var d = this.segments[u], l = d[0];
|
|
2648
2713
|
l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
|
|
2649
|
-
for (var
|
|
2650
|
-
var m = d[
|
|
2651
|
-
|
|
2714
|
+
for (var f = 1; f < d.length; f++) {
|
|
2715
|
+
var m = d[f];
|
|
2716
|
+
f === 1 ? h && m >= 0 && (s += " ") : m >= 0 && (s += " "), s += m;
|
|
2652
2717
|
}
|
|
2653
2718
|
r = l;
|
|
2654
2719
|
}
|
|
@@ -2668,47 +2733,47 @@ function I1() {
|
|
|
2668
2733
|
}, a.prototype.transform = function(s) {
|
|
2669
2734
|
return s.trim() ? (this.__stack.push(e(s)), this) : this;
|
|
2670
2735
|
}, a.prototype.round = function(s) {
|
|
2671
|
-
var r = 0, h = 0,
|
|
2736
|
+
var r = 0, h = 0, u = 0, c = 0, d;
|
|
2672
2737
|
return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(l) {
|
|
2673
|
-
var
|
|
2738
|
+
var f = l[0].toLowerCase() === l[0];
|
|
2674
2739
|
switch (l[0]) {
|
|
2675
2740
|
case "H":
|
|
2676
2741
|
case "h":
|
|
2677
|
-
|
|
2742
|
+
f && (l[1] += u), u = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
|
|
2678
2743
|
return;
|
|
2679
2744
|
case "V":
|
|
2680
2745
|
case "v":
|
|
2681
|
-
|
|
2746
|
+
f && (l[1] += c), c = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
|
|
2682
2747
|
return;
|
|
2683
2748
|
case "Z":
|
|
2684
2749
|
case "z":
|
|
2685
|
-
|
|
2750
|
+
u = r, c = h;
|
|
2686
2751
|
return;
|
|
2687
2752
|
case "M":
|
|
2688
2753
|
case "m":
|
|
2689
|
-
|
|
2754
|
+
f && (l[1] += u, l[2] += c), u = l[1] - l[1].toFixed(s), c = l[2] - l[2].toFixed(s), r = u, h = c, l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s);
|
|
2690
2755
|
return;
|
|
2691
2756
|
case "A":
|
|
2692
2757
|
case "a":
|
|
2693
|
-
|
|
2758
|
+
f && (l[6] += u, l[7] += c), u = l[6] - l[6].toFixed(s), c = l[7] - l[7].toFixed(s), l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s), l[3] = +l[3].toFixed(s + 2), l[6] = +l[6].toFixed(s), l[7] = +l[7].toFixed(s);
|
|
2694
2759
|
return;
|
|
2695
2760
|
default:
|
|
2696
|
-
d = l.length,
|
|
2761
|
+
d = l.length, f && (l[d - 2] += u, l[d - 1] += c), u = l[d - 2] - l[d - 2].toFixed(s), c = l[d - 1] - l[d - 1].toFixed(s), l.forEach(function(m, y) {
|
|
2697
2762
|
y && (l[y] = +l[y].toFixed(s));
|
|
2698
2763
|
});
|
|
2699
2764
|
return;
|
|
2700
2765
|
}
|
|
2701
2766
|
}), this;
|
|
2702
2767
|
}, a.prototype.iterate = function(s, r) {
|
|
2703
|
-
var h = this.segments,
|
|
2768
|
+
var h = this.segments, u = {}, c = !1, d = 0, l = 0, f = 0, m = 0, y, M, E;
|
|
2704
2769
|
if (r || this.__evaluateStack(), h.forEach(function(L, C) {
|
|
2705
2770
|
var S = s(L, C, d, l);
|
|
2706
|
-
Array.isArray(S) && (
|
|
2771
|
+
Array.isArray(S) && (u[C] = S, c = !0);
|
|
2707
2772
|
var T = L[0] === L[0].toLowerCase();
|
|
2708
2773
|
switch (L[0]) {
|
|
2709
2774
|
case "m":
|
|
2710
2775
|
case "M":
|
|
2711
|
-
d = L[1] + (T ? d : 0), l = L[2] + (T ? l : 0),
|
|
2776
|
+
d = L[1] + (T ? d : 0), l = L[2] + (T ? l : 0), f = d, m = l;
|
|
2712
2777
|
return;
|
|
2713
2778
|
case "h":
|
|
2714
2779
|
case "H":
|
|
@@ -2720,72 +2785,72 @@ function I1() {
|
|
|
2720
2785
|
return;
|
|
2721
2786
|
case "z":
|
|
2722
2787
|
case "Z":
|
|
2723
|
-
d =
|
|
2788
|
+
d = f, l = m;
|
|
2724
2789
|
return;
|
|
2725
2790
|
default:
|
|
2726
2791
|
d = L[L.length - 2] + (T ? d : 0), l = L[L.length - 1] + (T ? l : 0);
|
|
2727
2792
|
}
|
|
2728
|
-
}), !
|
|
2793
|
+
}), !c)
|
|
2729
2794
|
return this;
|
|
2730
2795
|
for (E = [], y = 0; y < h.length; y++)
|
|
2731
|
-
if (typeof
|
|
2732
|
-
for (M = 0; M <
|
|
2733
|
-
E.push(
|
|
2796
|
+
if (typeof u[y] < "u")
|
|
2797
|
+
for (M = 0; M < u[y].length; M++)
|
|
2798
|
+
E.push(u[y][M]);
|
|
2734
2799
|
else
|
|
2735
2800
|
E.push(h[y]);
|
|
2736
2801
|
return this.segments = E, this;
|
|
2737
2802
|
}, a.prototype.abs = function() {
|
|
2738
|
-
return this.iterate(function(s, r, h,
|
|
2739
|
-
var
|
|
2740
|
-
if (
|
|
2741
|
-
switch (s[0] = d,
|
|
2803
|
+
return this.iterate(function(s, r, h, u) {
|
|
2804
|
+
var c = s[0], d = c.toUpperCase(), l;
|
|
2805
|
+
if (c !== d)
|
|
2806
|
+
switch (s[0] = d, c) {
|
|
2742
2807
|
case "v":
|
|
2743
|
-
s[1] +=
|
|
2808
|
+
s[1] += u;
|
|
2744
2809
|
return;
|
|
2745
2810
|
case "a":
|
|
2746
|
-
s[6] += h, s[7] +=
|
|
2811
|
+
s[6] += h, s[7] += u;
|
|
2747
2812
|
return;
|
|
2748
2813
|
default:
|
|
2749
2814
|
for (l = 1; l < s.length; l++)
|
|
2750
|
-
s[l] += l % 2 ? h :
|
|
2815
|
+
s[l] += l % 2 ? h : u;
|
|
2751
2816
|
}
|
|
2752
2817
|
}, !0), this;
|
|
2753
2818
|
}, a.prototype.rel = function() {
|
|
2754
|
-
return this.iterate(function(s, r, h,
|
|
2755
|
-
var
|
|
2756
|
-
if (
|
|
2757
|
-
switch (s[0] = d,
|
|
2819
|
+
return this.iterate(function(s, r, h, u) {
|
|
2820
|
+
var c = s[0], d = c.toLowerCase(), l;
|
|
2821
|
+
if (c !== d && !(r === 0 && c === "M"))
|
|
2822
|
+
switch (s[0] = d, c) {
|
|
2758
2823
|
case "V":
|
|
2759
|
-
s[1] -=
|
|
2824
|
+
s[1] -= u;
|
|
2760
2825
|
return;
|
|
2761
2826
|
case "A":
|
|
2762
|
-
s[6] -= h, s[7] -=
|
|
2827
|
+
s[6] -= h, s[7] -= u;
|
|
2763
2828
|
return;
|
|
2764
2829
|
default:
|
|
2765
2830
|
for (l = 1; l < s.length; l++)
|
|
2766
|
-
s[l] -= l % 2 ? h :
|
|
2831
|
+
s[l] -= l % 2 ? h : u;
|
|
2767
2832
|
}
|
|
2768
2833
|
}, !0), this;
|
|
2769
2834
|
}, a.prototype.unarc = function() {
|
|
2770
|
-
return this.iterate(function(s, r, h,
|
|
2771
|
-
var
|
|
2772
|
-
return m !== "A" && m !== "a" ? null : (m === "a" ? (d = h + s[6], l =
|
|
2773
|
-
|
|
2774
|
-
}),
|
|
2835
|
+
return this.iterate(function(s, r, h, u) {
|
|
2836
|
+
var c, d, l, f = [], m = s[0];
|
|
2837
|
+
return m !== "A" && m !== "a" ? null : (m === "a" ? (d = h + s[6], l = u + s[7]) : (d = s[6], l = s[7]), c = o(h, u, d, l, s[4], s[5], s[1], s[2], s[3]), c.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (c.forEach(function(y) {
|
|
2838
|
+
f.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
|
|
2839
|
+
}), f));
|
|
2775
2840
|
}), this;
|
|
2776
2841
|
}, a.prototype.unshort = function() {
|
|
2777
|
-
var s = this.segments, r, h,
|
|
2778
|
-
return this.iterate(function(l,
|
|
2842
|
+
var s = this.segments, r, h, u, c, d;
|
|
2843
|
+
return this.iterate(function(l, f, m, y) {
|
|
2779
2844
|
var M = l[0], E = M.toUpperCase(), L;
|
|
2780
|
-
|
|
2845
|
+
f && (E === "T" ? (L = M === "t", u = s[f - 1], u[0] === "Q" ? (r = u[1] - m, h = u[2] - y) : u[0] === "q" ? (r = u[1] - u[3], h = u[2] - u[4]) : (r = 0, h = 0), c = -r, d = -h, L || (c += m, d += y), s[f] = [
|
|
2781
2846
|
L ? "q" : "Q",
|
|
2782
|
-
|
|
2847
|
+
c,
|
|
2783
2848
|
d,
|
|
2784
2849
|
l[1],
|
|
2785
2850
|
l[2]
|
|
2786
|
-
]) : E === "S" && (L = M === "s",
|
|
2851
|
+
]) : E === "S" && (L = M === "s", u = s[f - 1], u[0] === "C" ? (r = u[3] - m, h = u[4] - y) : u[0] === "c" ? (r = u[3] - u[5], h = u[4] - u[6]) : (r = 0, h = 0), c = -r, d = -h, L || (c += m, d += y), s[f] = [
|
|
2787
2852
|
L ? "c" : "C",
|
|
2788
|
-
|
|
2853
|
+
c,
|
|
2789
2854
|
d,
|
|
2790
2855
|
l[1],
|
|
2791
2856
|
l[2],
|
|
@@ -2793,20 +2858,20 @@ function I1() {
|
|
|
2793
2858
|
l[4]
|
|
2794
2859
|
]));
|
|
2795
2860
|
}), this;
|
|
2796
|
-
},
|
|
2861
|
+
}, Wt = a, Wt;
|
|
2797
2862
|
}
|
|
2798
|
-
var Xt,
|
|
2799
|
-
function
|
|
2800
|
-
return
|
|
2863
|
+
var Xt, E0;
|
|
2864
|
+
function D1() {
|
|
2865
|
+
return E0 || (E0 = 1, Xt = B1()), Xt;
|
|
2801
2866
|
}
|
|
2802
|
-
var
|
|
2803
|
-
const
|
|
2804
|
-
var Gt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 },
|
|
2805
|
-
function
|
|
2867
|
+
var q1 = D1();
|
|
2868
|
+
const z1 = /* @__PURE__ */ _1(q1);
|
|
2869
|
+
var Gt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, j1 = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2870
|
+
function H1(n) {
|
|
2806
2871
|
var e = [];
|
|
2807
|
-
return n.replace(
|
|
2872
|
+
return n.replace(j1, function(t, o, i) {
|
|
2808
2873
|
var a = o.toLowerCase();
|
|
2809
|
-
for (i =
|
|
2874
|
+
for (i = $1(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
|
|
2810
2875
|
if (i.length === Gt[a])
|
|
2811
2876
|
return i.unshift(o), e.push(i);
|
|
2812
2877
|
if (i.length < Gt[a])
|
|
@@ -2815,19 +2880,19 @@ function N1(n) {
|
|
|
2815
2880
|
}
|
|
2816
2881
|
}), e;
|
|
2817
2882
|
}
|
|
2818
|
-
var
|
|
2819
|
-
function
|
|
2820
|
-
var e = n.match(
|
|
2883
|
+
var U1 = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2884
|
+
function $1(n) {
|
|
2885
|
+
var e = n.match(U1);
|
|
2821
2886
|
return e ? e.map(Number) : [];
|
|
2822
2887
|
}
|
|
2823
2888
|
function it(n, e, t, o, i, a, s, r) {
|
|
2824
|
-
return new
|
|
2889
|
+
return new Jt(n, e, t, o, i, a, s, r);
|
|
2825
2890
|
}
|
|
2826
|
-
function
|
|
2827
|
-
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength =
|
|
2891
|
+
function Jt(n, e, t, o, i, a, s, r) {
|
|
2892
|
+
this.a = { x: n, y: e }, this.b = { x: t, y: o }, this.c = { x: i, y: a }, this.d = { x: s, y: r }, s != null && r !== null && r !== void 0 ? (this.getArcLength = tn, this.getPoint = X1, this.getDerivative = W1) : (this.getArcLength = G1, this.getPoint = Z0, this.getDerivative = Y1), this.init();
|
|
2828
2893
|
}
|
|
2829
|
-
|
|
2830
|
-
constructor:
|
|
2894
|
+
Jt.prototype = {
|
|
2895
|
+
constructor: Jt,
|
|
2831
2896
|
init: function() {
|
|
2832
2897
|
this.length = this.getArcLength(
|
|
2833
2898
|
[this.a.x, this.b.x, this.c.x, this.d.x],
|
|
@@ -2838,7 +2903,7 @@ Kt.prototype = {
|
|
|
2838
2903
|
return this.length;
|
|
2839
2904
|
},
|
|
2840
2905
|
getPointAtLength: function(n) {
|
|
2841
|
-
var e =
|
|
2906
|
+
var e = Zt(
|
|
2842
2907
|
n,
|
|
2843
2908
|
this.length,
|
|
2844
2909
|
this.getArcLength,
|
|
@@ -2852,7 +2917,7 @@ Kt.prototype = {
|
|
|
2852
2917
|
);
|
|
2853
2918
|
},
|
|
2854
2919
|
getTangentAtLength: function(n) {
|
|
2855
|
-
var e =
|
|
2920
|
+
var e = Zt(
|
|
2856
2921
|
n,
|
|
2857
2922
|
this.length,
|
|
2858
2923
|
this.getArcLength,
|
|
@@ -2866,7 +2931,7 @@ Kt.prototype = {
|
|
|
2866
2931
|
return o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 }, i;
|
|
2867
2932
|
},
|
|
2868
2933
|
getPropertiesAtLength: function(n) {
|
|
2869
|
-
var e =
|
|
2934
|
+
var e = Zt(
|
|
2870
2935
|
n,
|
|
2871
2936
|
this.length,
|
|
2872
2937
|
this.getArcLength,
|
|
@@ -2886,46 +2951,46 @@ Kt.prototype = {
|
|
|
2886
2951
|
return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
|
|
2887
2952
|
}
|
|
2888
2953
|
};
|
|
2889
|
-
function
|
|
2954
|
+
function Y1(n, e, t) {
|
|
2890
2955
|
return {
|
|
2891
2956
|
x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
|
|
2892
2957
|
y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
|
|
2893
2958
|
};
|
|
2894
2959
|
}
|
|
2895
|
-
function
|
|
2896
|
-
var o =
|
|
2960
|
+
function W1(n, e, t) {
|
|
2961
|
+
var o = Z0(
|
|
2897
2962
|
[3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
|
|
2898
2963
|
[3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
|
|
2899
2964
|
t
|
|
2900
2965
|
);
|
|
2901
2966
|
return o;
|
|
2902
2967
|
}
|
|
2903
|
-
function
|
|
2968
|
+
function Zt(n, e, t, o, i) {
|
|
2904
2969
|
for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
|
|
2905
|
-
var h = t(o, i, s + r),
|
|
2906
|
-
|
|
2970
|
+
var h = t(o, i, s + r), u = t(o, i, s - r), c = Math.abs(n - h) / e, d = Math.abs(n - u) / e;
|
|
2971
|
+
c < a ? (a = c, s += r) : d < a ? (a = d, s -= r) : r /= 2;
|
|
2907
2972
|
}
|
|
2908
2973
|
return s;
|
|
2909
2974
|
}
|
|
2910
|
-
function
|
|
2975
|
+
function Z0(n, e, t) {
|
|
2911
2976
|
var o = (1 - t) * (1 - t) * n[0] + 2 * (1 - t) * t * n[1] + t * t * n[2], i = (1 - t) * (1 - t) * e[0] + 2 * (1 - t) * t * e[1] + t * t * e[2];
|
|
2912
2977
|
return { x: o, y: i };
|
|
2913
2978
|
}
|
|
2914
|
-
function
|
|
2979
|
+
function X1(n, e, t) {
|
|
2915
2980
|
var o = (1 - t) * (1 - t) * (1 - t) * n[0] + 3 * (1 - t) * (1 - t) * t * n[1] + 3 * (1 - t) * t * t * n[2] + t * t * t * n[3], i = (1 - t) * (1 - t) * (1 - t) * e[0] + 3 * (1 - t) * (1 - t) * t * e[1] + 3 * (1 - t) * t * t * e[2] + t * t * t * e[3];
|
|
2916
2981
|
return { x: o, y: i };
|
|
2917
2982
|
}
|
|
2918
|
-
function
|
|
2983
|
+
function G1(n, e, t) {
|
|
2919
2984
|
t === void 0 && (t = 1);
|
|
2920
|
-
var o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s),
|
|
2985
|
+
var o = n[0] - 2 * n[1] + n[2], i = e[0] - 2 * e[1] + e[2], a = 2 * n[1] - 2 * n[0], s = 2 * e[1] - 2 * e[0], r = 4 * (o * o + i * i), h = 4 * (o * a + i * s), u = a * a + s * s;
|
|
2921
2986
|
if (r === 0)
|
|
2922
2987
|
return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
|
|
2923
|
-
var
|
|
2924
|
-
return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l +
|
|
2925
|
-
(l + Math.sqrt(l * l +
|
|
2988
|
+
var c = h / (2 * r), d = u / r, l = t + c, f = d - c * c;
|
|
2989
|
+
return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + f) - c * Math.sqrt(c * c + f) + f * Math.log(Math.abs(
|
|
2990
|
+
(l + Math.sqrt(l * l + f)) / (c + Math.sqrt(c * c + f))
|
|
2926
2991
|
)));
|
|
2927
2992
|
}
|
|
2928
|
-
var
|
|
2993
|
+
var Z1 = [
|
|
2929
2994
|
[],
|
|
2930
2995
|
[],
|
|
2931
2996
|
[-0.5773502691896257, 0.5773502691896257],
|
|
@@ -2951,7 +3016,7 @@ var U1 = [
|
|
|
2951
3016
|
[-0.06973927331972223, 0.06973927331972223, -0.20786042668822127, 0.20786042668822127, -0.34193582089208424, 0.34193582089208424, -0.469355837986757, 0.469355837986757, -0.5876404035069116, 0.5876404035069116, -0.6944872631866827, 0.6944872631866827, -0.7878168059792081, 0.7878168059792081, -0.8658125777203002, 0.8658125777203002, -0.926956772187174, 0.926956772187174, -0.9700604978354287, 0.9700604978354287, -0.9942945854823992, 0.9942945854823992],
|
|
2952
3017
|
[0, -0.1332568242984661, 0.1332568242984661, -0.26413568097034495, 0.26413568097034495, -0.3903010380302908, 0.3903010380302908, -0.5095014778460075, 0.5095014778460075, -0.6196098757636461, 0.6196098757636461, -0.7186613631319502, 0.7186613631319502, -0.8048884016188399, 0.8048884016188399, -0.8767523582704416, 0.8767523582704416, -0.9329710868260161, 0.9329710868260161, -0.9725424712181152, 0.9725424712181152, -0.9947693349975522, 0.9947693349975522],
|
|
2953
3018
|
[-0.06405689286260563, 0.06405689286260563, -0.1911188674736163, 0.1911188674736163, -0.3150426796961634, 0.3150426796961634, -0.4337935076260451, 0.4337935076260451, -0.5454214713888396, 0.5454214713888396, -0.6480936519369755, 0.6480936519369755, -0.7401241915785544, 0.7401241915785544, -0.820001985973903, 0.820001985973903, -0.8864155270044011, 0.8864155270044011, -0.9382745520027328, 0.9382745520027328, -0.9747285559713095, 0.9747285559713095, -0.9951872199970213, 0.9951872199970213]
|
|
2954
|
-
],
|
|
3019
|
+
], V1 = [
|
|
2955
3020
|
[],
|
|
2956
3021
|
[],
|
|
2957
3022
|
[1, 1],
|
|
@@ -2977,86 +3042,86 @@ var U1 = [
|
|
|
2977
3042
|
[0.13925187285563198, 0.13925187285563198, 0.13654149834601517, 0.13654149834601517, 0.13117350478706238, 0.13117350478706238, 0.12325237681051242, 0.12325237681051242, 0.11293229608053922, 0.11293229608053922, 0.10041414444288096, 0.10041414444288096, 0.08594160621706773, 0.08594160621706773, 0.06979646842452049, 0.06979646842452049, 0.052293335152683286, 0.052293335152683286, 0.03377490158481415, 0.03377490158481415, 0.0146279952982722, 0.0146279952982722],
|
|
2978
3043
|
[0.13365457218610619, 0.1324620394046966, 0.1324620394046966, 0.12890572218808216, 0.12890572218808216, 0.12304908430672953, 0.12304908430672953, 0.11499664022241136, 0.11499664022241136, 0.10489209146454141, 0.10489209146454141, 0.09291576606003515, 0.09291576606003515, 0.07928141177671895, 0.07928141177671895, 0.06423242140852585, 0.06423242140852585, 0.04803767173108467, 0.04803767173108467, 0.030988005856979445, 0.030988005856979445, 0.013411859487141771, 0.013411859487141771],
|
|
2979
3044
|
[0.12793819534675216, 0.12793819534675216, 0.1258374563468283, 0.1258374563468283, 0.12167047292780339, 0.12167047292780339, 0.1155056680537256, 0.1155056680537256, 0.10744427011596563, 0.10744427011596563, 0.09761865210411388, 0.09761865210411388, 0.08619016153195327, 0.08619016153195327, 0.0733464814110803, 0.0733464814110803, 0.05929858491543678, 0.05929858491543678, 0.04427743881741981, 0.04427743881741981, 0.028531388628933663, 0.028531388628933663, 0.0123412297999872, 0.0123412297999872]
|
|
2980
|
-
],
|
|
2981
|
-
function
|
|
2982
|
-
return
|
|
3045
|
+
], K1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
|
|
3046
|
+
function Q1(n, e) {
|
|
3047
|
+
return K1[n][e];
|
|
2983
3048
|
}
|
|
2984
|
-
function
|
|
3049
|
+
function t0(n, e, t) {
|
|
2985
3050
|
var o = t.length - 1, i, a, s;
|
|
2986
3051
|
if (o === 0)
|
|
2987
3052
|
return 0;
|
|
2988
3053
|
if (n === 0) {
|
|
2989
3054
|
for (a = 0, s = 0; s <= o; s++)
|
|
2990
|
-
a +=
|
|
3055
|
+
a += Q1(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
|
|
2991
3056
|
return a;
|
|
2992
3057
|
} else {
|
|
2993
3058
|
for (i = new Array(o), s = 0; s < o; s++)
|
|
2994
3059
|
i[s] = o * (t[s + 1] - t[s]);
|
|
2995
|
-
return
|
|
3060
|
+
return t0(n - 1, e, i);
|
|
2996
3061
|
}
|
|
2997
3062
|
}
|
|
2998
|
-
function
|
|
2999
|
-
var o =
|
|
3063
|
+
function J1(n, e, t) {
|
|
3064
|
+
var o = t0(1, t, n), i = t0(1, t, e), a = o * o + i * i;
|
|
3000
3065
|
return Math.sqrt(a);
|
|
3001
3066
|
}
|
|
3002
|
-
function
|
|
3067
|
+
function tn(n, e, t) {
|
|
3003
3068
|
var o, i, a, s;
|
|
3004
3069
|
t === void 0 && (t = 1);
|
|
3005
3070
|
var r = 20;
|
|
3006
3071
|
for (o = t / 2, i = 0, a = 0; a < r; a++)
|
|
3007
|
-
s = o *
|
|
3072
|
+
s = o * Z1[r][a] + o, i += V1[r][a] * J1(n, e, s);
|
|
3008
3073
|
return o * i;
|
|
3009
3074
|
}
|
|
3010
3075
|
var Pt = Math.PI * 2;
|
|
3011
|
-
function
|
|
3076
|
+
function S0(n, e, t, o) {
|
|
3012
3077
|
var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
|
|
3013
3078
|
return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
|
|
3014
3079
|
}
|
|
3015
|
-
function
|
|
3016
|
-
var
|
|
3017
|
-
M < 0 && (M = 0), M /= l * y +
|
|
3018
|
-
var E = M * s / r * d, L = M * -r / s *
|
|
3019
|
-
return a === 0 &&
|
|
3080
|
+
function en(n, e, t, o, i, a, s, r, h, u) {
|
|
3081
|
+
var c = u * (n - t) / 2 + h * (e - o) / 2, d = -h * (n - t) / 2 + u * (e - o) / 2, l = s * s, f = r * r, m = c * c, y = d * d, M = l * f - l * y - f * m;
|
|
3082
|
+
M < 0 && (M = 0), M /= l * y + f * m, M = Math.sqrt(M) * (i === a ? -1 : 1);
|
|
3083
|
+
var E = M * s / r * d, L = M * -r / s * c, C = u * E - h * L + (n + t) / 2, S = h * E + u * L + (e + o) / 2, T = (c - E) / s, I = (d - L) / r, R = (-c - E) / s, X = (-d - L) / r, H = S0(1, 0, T, I), Y = S0(T, I, R, X);
|
|
3084
|
+
return a === 0 && Y > 0 && (Y -= Pt), a === 1 && Y < 0 && (Y += Pt), [C, S, H, Y];
|
|
3020
3085
|
}
|
|
3021
|
-
function
|
|
3086
|
+
function nn(n, e) {
|
|
3022
3087
|
var t = 1.3333333333333333 * Math.tan(e / 4), o = Math.cos(n), i = Math.sin(n), a = Math.cos(n + e), s = Math.sin(n + e);
|
|
3023
3088
|
return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
|
|
3024
3089
|
}
|
|
3025
|
-
function
|
|
3026
|
-
var
|
|
3090
|
+
function rn(n, e, t, o, i, a, s, r, h) {
|
|
3091
|
+
var u = Math.sin(i * Pt / 360), c = Math.cos(i * Pt / 360), d = c * (n - r) / 2 + u * (e - h) / 2, l = -u * (n - r) / 2 + c * (e - h) / 2;
|
|
3027
3092
|
if (d === 0 && l === 0)
|
|
3028
3093
|
return [];
|
|
3029
3094
|
if (t === 0 || o === 0)
|
|
3030
3095
|
return [];
|
|
3031
3096
|
t = Math.abs(t), o = Math.abs(o);
|
|
3032
|
-
var
|
|
3033
|
-
|
|
3034
|
-
var m =
|
|
3097
|
+
var f = d * d / (t * t) + l * l / (o * o);
|
|
3098
|
+
f > 1 && (t *= Math.sqrt(f), o *= Math.sqrt(f));
|
|
3099
|
+
var m = en(n, e, r, h, a, s, t, o, u, c), y = [], M = m[2], E = m[3], L = Math.max(Math.ceil(Math.abs(E) / (Pt / 4)), 1);
|
|
3035
3100
|
E /= L;
|
|
3036
3101
|
for (var C = 0; C < L; C++)
|
|
3037
|
-
y.push(
|
|
3102
|
+
y.push(nn(M, E)), M += E;
|
|
3038
3103
|
return y.map(function(S) {
|
|
3039
3104
|
for (var T = 0; T < S.length; T += 2) {
|
|
3040
|
-
var I = S[T + 0],
|
|
3041
|
-
I *= t,
|
|
3042
|
-
var
|
|
3043
|
-
S[T + 0] =
|
|
3105
|
+
var I = S[T + 0], R = S[T + 1];
|
|
3106
|
+
I *= t, R *= o;
|
|
3107
|
+
var X = c * I - u * R, H = u * I + c * R;
|
|
3108
|
+
S[T + 0] = X + m[0], S[T + 1] = H + m[1];
|
|
3044
3109
|
}
|
|
3045
3110
|
return S;
|
|
3046
3111
|
});
|
|
3047
3112
|
}
|
|
3048
|
-
function
|
|
3049
|
-
return new
|
|
3113
|
+
function k0(n, e, t, o, i, a, s, r, h) {
|
|
3114
|
+
return new e0(n, e, t, o, i, a, s, r, h);
|
|
3050
3115
|
}
|
|
3051
|
-
function
|
|
3052
|
-
var
|
|
3053
|
-
l.forEach(function(
|
|
3054
|
-
var m = new it(
|
|
3055
|
-
|
|
3056
|
-
}), this.length =
|
|
3116
|
+
function e0(n, e, t, o, i, a, s, r, h) {
|
|
3117
|
+
var u = 0, c = [], d = [], l = rn(n, e, t, o, i, a, s, r, h);
|
|
3118
|
+
l.forEach(function(f) {
|
|
3119
|
+
var m = new it(f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7]), y = m.getTotalLength();
|
|
3120
|
+
u += y, c.push(y), d.push(m);
|
|
3121
|
+
}), this.length = u, this.partialLengths = c, this.curves = d;
|
|
3057
3122
|
}
|
|
3058
|
-
|
|
3059
|
-
constructor:
|
|
3123
|
+
e0.prototype = {
|
|
3124
|
+
constructor: e0,
|
|
3060
3125
|
init: function() {
|
|
3061
3126
|
},
|
|
3062
3127
|
getTotalLength: function() {
|
|
@@ -3106,13 +3171,13 @@ kt.prototype.getPropertiesAtLength = function(n) {
|
|
|
3106
3171
|
var e = this.getPointAtLength(n), t = this.getTangentAtLength();
|
|
3107
3172
|
return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
|
|
3108
3173
|
};
|
|
3109
|
-
function
|
|
3174
|
+
function on(n) {
|
|
3110
3175
|
var e = 0, t = [], o = [];
|
|
3111
3176
|
function i(s) {
|
|
3112
3177
|
if (!s)
|
|
3113
3178
|
return null;
|
|
3114
|
-
for (var r =
|
|
3115
|
-
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], d = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], d = [h[0], h[1]], o.push(null)) : r[l][0] === "L" ? (e = e + Math.sqrt(Math.pow(h[0] - r[l][1], 2) + Math.pow(h[1] - r[l][2], 2)), o.push(new rt(h[0], r[l][1], h[1], r[l][2])), h = [r[l][1], r[l][2]]) : r[l][0] === "l" ? (e = e + Math.sqrt(Math.pow(r[l][1], 2) + Math.pow(r[l][2], 2)), o.push(new rt(h[0], r[l][1] + h[0], h[1], r[l][2] + h[1])), h = [r[l][1] + h[0], r[l][2] + h[1]]) : r[l][0] === "H" ? (e = e + Math.abs(h[0] - r[l][1]), o.push(new rt(h[0], r[l][1], h[1], h[1])), h[0] = r[l][1]) : r[l][0] === "h" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0] + r[l][1], h[1], h[1])), h[0] = r[l][1] + h[0]) : r[l][0] === "V" ? (e = e + Math.abs(h[1] - r[l][1]), o.push(new rt(h[0], h[0], h[1], r[l][1])), h[1] = r[l][1]) : r[l][0] === "v" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0], h[1], h[1] + r[l][1])), h[1] = r[l][1] + h[1]) : r[l][0] === "z" || r[l][0] === "Z" ? (e = e + Math.sqrt(Math.pow(d[0] - h[0], 2) + Math.pow(d[1] - h[1], 2)), o.push(new rt(h[0], d[0], h[1], d[1])), h = [d[0], d[1]]) : r[l][0] === "C" ? (
|
|
3179
|
+
for (var r = H1(s), h = [0, 0], u = [0, 0], c, d, l = 0; l < r.length; l++)
|
|
3180
|
+
r[l][0] === "M" ? (h = [r[l][1], r[l][2]], d = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], d = [h[0], h[1]], o.push(null)) : r[l][0] === "L" ? (e = e + Math.sqrt(Math.pow(h[0] - r[l][1], 2) + Math.pow(h[1] - r[l][2], 2)), o.push(new rt(h[0], r[l][1], h[1], r[l][2])), h = [r[l][1], r[l][2]]) : r[l][0] === "l" ? (e = e + Math.sqrt(Math.pow(r[l][1], 2) + Math.pow(r[l][2], 2)), o.push(new rt(h[0], r[l][1] + h[0], h[1], r[l][2] + h[1])), h = [r[l][1] + h[0], r[l][2] + h[1]]) : r[l][0] === "H" ? (e = e + Math.abs(h[0] - r[l][1]), o.push(new rt(h[0], r[l][1], h[1], h[1])), h[0] = r[l][1]) : r[l][0] === "h" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0] + r[l][1], h[1], h[1])), h[0] = r[l][1] + h[0]) : r[l][0] === "V" ? (e = e + Math.abs(h[1] - r[l][1]), o.push(new rt(h[0], h[0], h[1], r[l][1])), h[1] = r[l][1]) : r[l][0] === "v" ? (e = e + Math.abs(r[l][1]), o.push(new rt(h[0], h[0], h[1], h[1] + r[l][1])), h[1] = r[l][1] + h[1]) : r[l][0] === "z" || r[l][0] === "Z" ? (e = e + Math.sqrt(Math.pow(d[0] - h[0], 2) + Math.pow(d[1] - h[1], 2)), o.push(new rt(h[0], d[0], h[1], d[1])), h = [d[0], d[1]]) : r[l][0] === "C" ? (c = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + c.getTotalLength(), h = [r[l][5], r[l][6]], o.push(c)) : r[l][0] === "c" ? (c = new it(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4], h[0] + r[l][5], h[1] + r[l][6]), e = e + c.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(c)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], 2 * h[0] - r[l - 1][r[l - 1].length - 4], 2 * h[1] - r[l - 1][r[l - 1].length - 3], r[l][1], r[l][2], r[l][3], r[l][4]) : c = new it(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + c.getTotalLength(), h = [r[l][3], r[l][4]], o.push(c)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], h[0] + c.d.x - c.c.x, h[1] + c.d.y - c.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : c = new it(h[0], h[1], h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + c.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(c)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? c = new it(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : c = new rt(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + c.getTotalLength(), o.push(c), h = [r[l][3], r[l][4]], u = [r[l][1], r[l][2]]) : r[l][0] === "q" ? (r[l][1] == 0 && r[l][2] == 0 ? c = new rt(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : c = new it(h[0], h[1], h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]), e = e + c.getTotalLength(), u = [h[0] + r[l][1], h[1] + r[l][2]], h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(c)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], 2 * h[0] - u[0], 2 * h[1] - u[1], r[l][1], r[l][2]) : c = new rt(h[0], r[l][1], h[1], r[l][2]), o.push(c), e = e + c.getTotalLength(), u = [2 * h[0] - u[0], 2 * h[1] - u[1]], h = [r[l][1], r[l][2]]) : r[l][0] === "t" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? c = new it(h[0], h[1], 2 * h[0] - u[0], 2 * h[1] - u[1], h[0] + r[l][1], h[1] + r[l][2]) : c = new rt(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + c.getTotalLength(), u = [2 * h[0] - u[0], 2 * h[1] - u[1]], h = [r[l][1] + h[0], r[l][2] + h[0]], o.push(c)) : r[l][0] === "A" ? (c = new k0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6], r[l][7]), e = e + c.getTotalLength(), h = [r[l][6], r[l][7]], o.push(c)) : r[l][0] === "a" && (c = new k0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], h[0] + r[l][6], h[1] + r[l][7]), e = e + c.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(c)), t.push(e);
|
|
3116
3181
|
return i;
|
|
3117
3182
|
}
|
|
3118
3183
|
i.getTotalLength = function() {
|
|
@@ -3135,49 +3200,49 @@ function Q1(n) {
|
|
|
3135
3200
|
};
|
|
3136
3201
|
return i(n);
|
|
3137
3202
|
}
|
|
3138
|
-
function
|
|
3203
|
+
function Nt(n, e) {
|
|
3139
3204
|
return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
|
|
3140
3205
|
}
|
|
3141
|
-
function
|
|
3206
|
+
function V0(n, e, t) {
|
|
3142
3207
|
return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
|
|
3143
3208
|
}
|
|
3144
|
-
function
|
|
3145
|
-
return
|
|
3209
|
+
function sn(n, e) {
|
|
3210
|
+
return Nt(n, e) < 1e-9;
|
|
3146
3211
|
}
|
|
3147
|
-
function
|
|
3148
|
-
let o = n.map((i, a) =>
|
|
3212
|
+
function an(n, e, t) {
|
|
3213
|
+
let o = n.map((i, a) => hn(i, e[a]));
|
|
3149
3214
|
return function(i) {
|
|
3150
3215
|
let a = o.map((s) => s(i));
|
|
3151
|
-
return t ?
|
|
3216
|
+
return t ? un(a) : a;
|
|
3152
3217
|
};
|
|
3153
3218
|
}
|
|
3154
|
-
function
|
|
3219
|
+
function hn(n, e) {
|
|
3155
3220
|
return function(t) {
|
|
3156
3221
|
return n.map((o, i) => o + t * (e[i] - o));
|
|
3157
3222
|
};
|
|
3158
3223
|
}
|
|
3159
|
-
function
|
|
3224
|
+
function Ft(n) {
|
|
3160
3225
|
return typeof n == "number" && isFinite(n);
|
|
3161
3226
|
}
|
|
3162
|
-
const
|
|
3227
|
+
const n0 = `All shapes must be supplied as arrays of [x, y] points or an SVG path string (https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d).
|
|
3163
3228
|
Example valid ways of supplying a shape would be:
|
|
3164
3229
|
[[0, 0], [10, 0], [10, 10]]
|
|
3165
3230
|
"M0,0 L10,0 L10,10Z"
|
|
3166
3231
|
`;
|
|
3167
|
-
function
|
|
3168
|
-
return new
|
|
3232
|
+
function ln(n) {
|
|
3233
|
+
return new z1(n).abs();
|
|
3169
3234
|
}
|
|
3170
|
-
function
|
|
3235
|
+
function cn(n) {
|
|
3171
3236
|
return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
|
|
3172
3237
|
}
|
|
3173
|
-
function
|
|
3238
|
+
function un(n) {
|
|
3174
3239
|
return "M" + n.join("L") + "Z";
|
|
3175
3240
|
}
|
|
3176
|
-
function
|
|
3177
|
-
let t =
|
|
3178
|
-
return
|
|
3241
|
+
function fn(n, e) {
|
|
3242
|
+
let t = ln(n);
|
|
3243
|
+
return gn(t) || pn(t, e);
|
|
3179
3244
|
}
|
|
3180
|
-
function
|
|
3245
|
+
function gn(n) {
|
|
3181
3246
|
let e = n.segments || [], t = [];
|
|
3182
3247
|
if (!e.length || e[0][0] !== "M")
|
|
3183
3248
|
return !1;
|
|
@@ -3196,11 +3261,11 @@ function an(n) {
|
|
|
3196
3261
|
}
|
|
3197
3262
|
return t.length ? { ring: t } : !1;
|
|
3198
3263
|
}
|
|
3199
|
-
function
|
|
3200
|
-
let t =
|
|
3264
|
+
function pn(n, e) {
|
|
3265
|
+
let t = cn(n)[0], o = [], i, a, s = 3;
|
|
3201
3266
|
if (!t)
|
|
3202
|
-
throw new TypeError(
|
|
3203
|
-
a =
|
|
3267
|
+
throw new TypeError(n0);
|
|
3268
|
+
a = dn(t), i = a.getTotalLength(), e && Ft(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
|
|
3204
3269
|
for (let r = 0; r < s; r++) {
|
|
3205
3270
|
let h = a.getPointAtLength(i * r / s);
|
|
3206
3271
|
o.push([h.x, h.y]);
|
|
@@ -3210,81 +3275,81 @@ function hn(n, e) {
|
|
|
3210
3275
|
skipBisect: !0
|
|
3211
3276
|
};
|
|
3212
3277
|
}
|
|
3213
|
-
function
|
|
3278
|
+
function dn(n) {
|
|
3214
3279
|
if (typeof window < "u" && window && window.document)
|
|
3215
3280
|
try {
|
|
3216
3281
|
let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3217
3282
|
return e.setAttributeNS(null, "d", n), e;
|
|
3218
3283
|
} catch {
|
|
3219
3284
|
}
|
|
3220
|
-
return
|
|
3285
|
+
return on(n);
|
|
3221
3286
|
}
|
|
3222
|
-
function
|
|
3223
|
-
const t = n.length + e, o =
|
|
3287
|
+
function I0(n, e) {
|
|
3288
|
+
const t = n.length + e, o = I1(n) / e;
|
|
3224
3289
|
let i = 0, a = 0, s = o / 2;
|
|
3225
3290
|
for (; n.length < t; ) {
|
|
3226
|
-
let r = n[i], h = n[(i + 1) % n.length],
|
|
3227
|
-
if (s <= a +
|
|
3228
|
-
n.splice(i + 1, 0,
|
|
3291
|
+
let r = n[i], h = n[(i + 1) % n.length], u = Nt(r, h);
|
|
3292
|
+
if (s <= a + u) {
|
|
3293
|
+
n.splice(i + 1, 0, u ? V0(r, h, (s - a) / u) : r.slice(0)), s += o;
|
|
3229
3294
|
continue;
|
|
3230
3295
|
}
|
|
3231
|
-
a +=
|
|
3296
|
+
a += u, i++;
|
|
3232
3297
|
}
|
|
3233
3298
|
}
|
|
3234
|
-
function
|
|
3299
|
+
function xn(n, e = 1 / 0) {
|
|
3235
3300
|
for (let t = 0; t < n.length; t++) {
|
|
3236
3301
|
let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
|
|
3237
|
-
for (;
|
|
3238
|
-
i =
|
|
3302
|
+
for (; Nt(o, i) > e; )
|
|
3303
|
+
i = V0(o, i, 0.5), n.splice(t + 1, 0, i);
|
|
3239
3304
|
}
|
|
3240
3305
|
}
|
|
3241
|
-
function
|
|
3306
|
+
function _0(n, e) {
|
|
3242
3307
|
let t, o, i;
|
|
3243
3308
|
if (typeof n == "string") {
|
|
3244
|
-
let a =
|
|
3309
|
+
let a = fn(n, e);
|
|
3245
3310
|
n = a.ring, i = a.skipBisect;
|
|
3246
3311
|
} else if (!Array.isArray(n))
|
|
3247
|
-
throw new TypeError(
|
|
3248
|
-
if (t = n.slice(0), !
|
|
3249
|
-
throw new TypeError(
|
|
3250
|
-
return t.length > 1 &&
|
|
3312
|
+
throw new TypeError(n0);
|
|
3313
|
+
if (t = n.slice(0), !yn(t))
|
|
3314
|
+
throw new TypeError(n0);
|
|
3315
|
+
return t.length > 1 && sn(t[0], t[t.length - 1]) && t.pop(), o = k1(t), o > 0 && t.reverse(), !i && e && Ft(e) && e > 0 && xn(t, e), t;
|
|
3251
3316
|
}
|
|
3252
|
-
function
|
|
3317
|
+
function yn(n) {
|
|
3253
3318
|
return n.every(function(e) {
|
|
3254
|
-
return Array.isArray(e) && e.length >= 2 &&
|
|
3319
|
+
return Array.isArray(e) && e.length >= 2 && Ft(e[0]) && Ft(e[1]);
|
|
3255
3320
|
});
|
|
3256
3321
|
}
|
|
3257
|
-
function
|
|
3322
|
+
function vn(n, e) {
|
|
3258
3323
|
let t = n.length, o = 1 / 0, i, a, s;
|
|
3259
3324
|
for (let r = 0; r < t; r++)
|
|
3260
|
-
a = 0, e.forEach(function(h,
|
|
3261
|
-
let
|
|
3262
|
-
a +=
|
|
3325
|
+
a = 0, e.forEach(function(h, u) {
|
|
3326
|
+
let c = Nt(n[(r + u) % t], h);
|
|
3327
|
+
a += c * c;
|
|
3263
3328
|
}), a < o && (o = a, i = r);
|
|
3264
3329
|
i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
|
|
3265
3330
|
}
|
|
3266
|
-
function
|
|
3267
|
-
let i =
|
|
3331
|
+
function wn(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
|
|
3332
|
+
let i = _0(n, t), a = _0(e, t), s = mn(i, a, o);
|
|
3268
3333
|
return !o || typeof n != "string" && typeof e != "string" ? s : (r) => r < 1e-4 && typeof n == "string" ? n : 1 - r < 1e-4 && typeof e == "string" ? e : s(r);
|
|
3269
3334
|
}
|
|
3270
|
-
function
|
|
3335
|
+
function mn(n, e, t) {
|
|
3271
3336
|
let o;
|
|
3272
|
-
return o = n.length - e.length,
|
|
3337
|
+
return o = n.length - e.length, I0(n, o < 0 ? o * -1 : 0), I0(e, o > 0 ? o : 0), vn(n, e), an(n, e, t);
|
|
3273
3338
|
}
|
|
3274
|
-
var
|
|
3275
|
-
function
|
|
3276
|
-
if (
|
|
3277
|
-
|
|
3339
|
+
var It = { exports: {} }, O0;
|
|
3340
|
+
function bn() {
|
|
3341
|
+
if (O0) return It.exports;
|
|
3342
|
+
O0 = 1, It.exports = n, It.exports.default = n;
|
|
3278
3343
|
function n(g, x, p) {
|
|
3279
3344
|
p = p || 2;
|
|
3280
3345
|
var v = x && x.length, w = v ? x[0] * p : g.length, b = e(g, 0, w, p, !0), A = [];
|
|
3281
3346
|
if (!b || b.next === b.prev) return A;
|
|
3282
|
-
var P, F, _,
|
|
3347
|
+
var P, F, _, $, z, B, Z;
|
|
3283
3348
|
if (v && (b = h(g, x, b, p)), g.length > 80 * p) {
|
|
3284
|
-
P = _ = g[0], F =
|
|
3349
|
+
P = _ = g[0], F = $ = g[1];
|
|
3285
3350
|
for (var j = p; j < w; j += p)
|
|
3286
|
-
z = g[j], B = g[j + 1], z < P && (P = z), B < F && (F = B), z > _ && (_ = z), B >
|
|
3287
|
-
Z = Math.max(_ - P,
|
|
3351
|
+
z = g[j], B = g[j + 1], z < P && (P = z), B < F && (F = B), z > _ && (_ = z), B > $ && ($ = B);
|
|
3352
|
+
Z = Math.max(_ - P, $ - F), Z = Z !== 0 ? 32767 / Z : 0;
|
|
3288
3353
|
}
|
|
3289
3354
|
return o(b, A, p, P, F, Z, 0), A;
|
|
3290
3355
|
}
|
|
@@ -3311,7 +3376,7 @@ function dn() {
|
|
|
3311
3376
|
}
|
|
3312
3377
|
function o(g, x, p, v, w, b, A) {
|
|
3313
3378
|
if (g) {
|
|
3314
|
-
!A && b &&
|
|
3379
|
+
!A && b && f(g, v, w, b);
|
|
3315
3380
|
for (var P = g, F, _; g.prev !== g.next; ) {
|
|
3316
3381
|
if (F = g.prev, _ = g.next, b ? a(g, v, w, b) : i(g)) {
|
|
3317
3382
|
x.push(F.i / p | 0), x.push(g.i / p | 0), x.push(_.i / p | 0), nt(g), g = _.next, P = _.next;
|
|
@@ -3327,8 +3392,8 @@ function dn() {
|
|
|
3327
3392
|
function i(g) {
|
|
3328
3393
|
var x = g.prev, p = g, v = g.next;
|
|
3329
3394
|
if (C(x, p, v) >= 0) return !1;
|
|
3330
|
-
for (var w = x.x, b = p.x, A = v.x, P = x.y, F = p.y, _ = v.y,
|
|
3331
|
-
if (j.x >=
|
|
3395
|
+
for (var w = x.x, b = p.x, A = v.x, P = x.y, F = p.y, _ = v.y, $ = w < b ? w < A ? w : A : b < A ? b : A, z = P < F ? P < _ ? P : _ : F < _ ? F : _, B = w > b ? w > A ? w : A : b > A ? b : A, Z = P > F ? P > _ ? P : _ : F > _ ? F : _, j = v.next; j !== x; ) {
|
|
3396
|
+
if (j.x >= $ && j.x <= B && j.y >= z && j.y <= Z && E(w, P, b, F, A, _, j.x, j.y) && C(j.prev, j, j.next) >= 0) return !1;
|
|
3332
3397
|
j = j.next;
|
|
3333
3398
|
}
|
|
3334
3399
|
return !0;
|
|
@@ -3336,17 +3401,17 @@ function dn() {
|
|
|
3336
3401
|
function a(g, x, p, v) {
|
|
3337
3402
|
var w = g.prev, b = g, A = g.next;
|
|
3338
3403
|
if (C(w, b, A) >= 0) return !1;
|
|
3339
|
-
for (var P = w.x, F = b.x, _ = A.x,
|
|
3340
|
-
if (
|
|
3341
|
-
|
|
3404
|
+
for (var P = w.x, F = b.x, _ = A.x, $ = w.y, z = b.y, B = A.y, Z = P < F ? P < _ ? P : _ : F < _ ? F : _, j = $ < z ? $ < B ? $ : B : z < B ? z : B, Lt = P > F ? P > _ ? P : _ : F > _ ? F : _, Tt = $ > z ? $ > B ? $ : B : z > B ? z : B, h0 = y(Z, j, x, p, v), l0 = y(Lt, Tt, x, p, v), D = g.prevZ, q = g.nextZ; D && D.z >= h0 && q && q.z <= l0; ) {
|
|
3405
|
+
if (D.x >= Z && D.x <= Lt && D.y >= j && D.y <= Tt && D !== w && D !== A && E(P, $, F, z, _, B, D.x, D.y) && C(D.prev, D, D.next) >= 0 || (D = D.prevZ, q.x >= Z && q.x <= Lt && q.y >= j && q.y <= Tt && q !== w && q !== A && E(P, $, F, z, _, B, q.x, q.y) && C(q.prev, q, q.next) >= 0)) return !1;
|
|
3406
|
+
q = q.nextZ;
|
|
3342
3407
|
}
|
|
3343
|
-
for (;
|
|
3344
|
-
if (
|
|
3345
|
-
|
|
3408
|
+
for (; D && D.z >= h0; ) {
|
|
3409
|
+
if (D.x >= Z && D.x <= Lt && D.y >= j && D.y <= Tt && D !== w && D !== A && E(P, $, F, z, _, B, D.x, D.y) && C(D.prev, D, D.next) >= 0) return !1;
|
|
3410
|
+
D = D.prevZ;
|
|
3346
3411
|
}
|
|
3347
|
-
for (;
|
|
3348
|
-
if (
|
|
3349
|
-
|
|
3412
|
+
for (; q && q.z <= l0; ) {
|
|
3413
|
+
if (q.x >= Z && q.x <= Lt && q.y >= j && q.y <= Tt && q !== w && q !== A && E(P, $, F, z, _, B, q.x, q.y) && C(q.prev, q, q.next) >= 0) return !1;
|
|
3414
|
+
q = q.nextZ;
|
|
3350
3415
|
}
|
|
3351
3416
|
return !0;
|
|
3352
3417
|
}
|
|
@@ -3376,14 +3441,14 @@ function dn() {
|
|
|
3376
3441
|
var w = [], b, A, P, F, _;
|
|
3377
3442
|
for (b = 0, A = x.length; b < A; b++)
|
|
3378
3443
|
P = x[b] * v, F = b < A - 1 ? x[b + 1] * v : g.length, _ = e(g, P, F, v, !1), _ === _.next && (_.steiner = !0), w.push(M(_));
|
|
3379
|
-
for (w.sort(
|
|
3380
|
-
p =
|
|
3444
|
+
for (w.sort(u), b = 0; b < w.length; b++)
|
|
3445
|
+
p = c(w[b], p);
|
|
3381
3446
|
return p;
|
|
3382
3447
|
}
|
|
3383
|
-
function
|
|
3448
|
+
function u(g, x) {
|
|
3384
3449
|
return g.x - x.x;
|
|
3385
3450
|
}
|
|
3386
|
-
function
|
|
3451
|
+
function c(g, x) {
|
|
3387
3452
|
var p = d(g, x);
|
|
3388
3453
|
if (!p)
|
|
3389
3454
|
return x;
|
|
@@ -3401,17 +3466,17 @@ function dn() {
|
|
|
3401
3466
|
p = p.next;
|
|
3402
3467
|
} while (p !== x);
|
|
3403
3468
|
if (!A) return null;
|
|
3404
|
-
var F = A, _ = A.x,
|
|
3469
|
+
var F = A, _ = A.x, $ = A.y, z = 1 / 0, B;
|
|
3405
3470
|
p = A;
|
|
3406
3471
|
do
|
|
3407
|
-
v >= p.x && p.x >= _ && v !== p.x && E(w <
|
|
3472
|
+
v >= p.x && p.x >= _ && v !== p.x && E(w < $ ? v : b, w, _, $, w < $ ? b : v, w, p.x, p.y) && (B = Math.abs(w - p.y) / (v - p.x), H(p, g) && (B < z || B === z && (p.x > A.x || p.x === A.x && l(A, p))) && (A = p, z = B)), p = p.next;
|
|
3408
3473
|
while (p !== F);
|
|
3409
3474
|
return A;
|
|
3410
3475
|
}
|
|
3411
3476
|
function l(g, x) {
|
|
3412
3477
|
return C(g.prev, g, x.prev) < 0 && C(x.next, g, g.next) < 0;
|
|
3413
3478
|
}
|
|
3414
|
-
function
|
|
3479
|
+
function f(g, x, p, v) {
|
|
3415
3480
|
var w = g;
|
|
3416
3481
|
do
|
|
3417
3482
|
w.z === 0 && (w.z = y(w.x, w.y, x, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
|
|
@@ -3446,8 +3511,8 @@ function dn() {
|
|
|
3446
3511
|
return (w - A) * (x - P) >= (g - A) * (b - P) && (g - A) * (v - P) >= (p - A) * (x - P) && (p - A) * (b - P) >= (w - A) * (v - P);
|
|
3447
3512
|
}
|
|
3448
3513
|
function L(g, x) {
|
|
3449
|
-
return g.next.i !== x.i && g.prev.i !== x.i && !
|
|
3450
|
-
(H(g, x) && H(x, g) &&
|
|
3514
|
+
return g.next.i !== x.i && g.prev.i !== x.i && !X(g, x) && // dones't intersect other edges
|
|
3515
|
+
(H(g, x) && H(x, g) && Y(g, x) && // locally visible
|
|
3451
3516
|
(C(g.prev, g, x.prev) || C(g, x.prev, x)) || // does not create opposite-facing sectors
|
|
3452
3517
|
S(g, x) && C(g.prev, g, g.next) > 0 && C(x.prev, x, x.next) > 0);
|
|
3453
3518
|
}
|
|
@@ -3458,16 +3523,16 @@ function dn() {
|
|
|
3458
3523
|
return g.x === x.x && g.y === x.y;
|
|
3459
3524
|
}
|
|
3460
3525
|
function T(g, x, p, v) {
|
|
3461
|
-
var w =
|
|
3526
|
+
var w = R(C(g, x, p)), b = R(C(g, x, v)), A = R(C(p, v, g)), P = R(C(p, v, x));
|
|
3462
3527
|
return !!(w !== b && A !== P || w === 0 && I(g, p, x) || b === 0 && I(g, v, x) || A === 0 && I(p, g, v) || P === 0 && I(p, x, v));
|
|
3463
3528
|
}
|
|
3464
3529
|
function I(g, x, p) {
|
|
3465
3530
|
return x.x <= Math.max(g.x, p.x) && x.x >= Math.min(g.x, p.x) && x.y <= Math.max(g.y, p.y) && x.y >= Math.min(g.y, p.y);
|
|
3466
3531
|
}
|
|
3467
|
-
function
|
|
3532
|
+
function R(g) {
|
|
3468
3533
|
return g > 0 ? 1 : g < 0 ? -1 : 0;
|
|
3469
3534
|
}
|
|
3470
|
-
function
|
|
3535
|
+
function X(g, x) {
|
|
3471
3536
|
var p = g;
|
|
3472
3537
|
do {
|
|
3473
3538
|
if (p.i !== g.i && p.next.i !== g.i && p.i !== x.i && p.next.i !== x.i && T(p, p.next, g, x)) return !0;
|
|
@@ -3478,7 +3543,7 @@ function dn() {
|
|
|
3478
3543
|
function H(g, x) {
|
|
3479
3544
|
return C(g.prev, g, g.next) < 0 ? C(g, x, g.next) >= 0 && C(g, g.prev, x) >= 0 : C(g, x, g.prev) < 0 || C(g, g.next, x) < 0;
|
|
3480
3545
|
}
|
|
3481
|
-
function
|
|
3546
|
+
function Y(g, x) {
|
|
3482
3547
|
var p = g, v = !1, w = (g.x + x.x) / 2, b = (g.y + x.y) / 2;
|
|
3483
3548
|
do
|
|
3484
3549
|
p.y > b != p.next.y > b && p.next.y !== p.y && w < (p.next.x - p.x) * (b - p.y) / (p.next.y - p.y) + p.x && (v = !v), p = p.next;
|
|
@@ -3503,8 +3568,8 @@ function dn() {
|
|
|
3503
3568
|
var w = x && x.length, b = w ? x[0] * p : g.length, A = Math.abs(Rt(g, 0, b, p));
|
|
3504
3569
|
if (w)
|
|
3505
3570
|
for (var P = 0, F = x.length; P < F; P++) {
|
|
3506
|
-
var _ = x[P] * p,
|
|
3507
|
-
A -= Math.abs(Rt(g, _,
|
|
3571
|
+
var _ = x[P] * p, $ = P < F - 1 ? x[P + 1] * p : g.length;
|
|
3572
|
+
A -= Math.abs(Rt(g, _, $, p));
|
|
3508
3573
|
}
|
|
3509
3574
|
var z = 0;
|
|
3510
3575
|
for (P = 0; P < v.length; P += 3) {
|
|
@@ -3527,14 +3592,14 @@ function dn() {
|
|
|
3527
3592
|
w > 0 && (v += g[w - 1].length, p.holes.push(v));
|
|
3528
3593
|
}
|
|
3529
3594
|
return p;
|
|
3530
|
-
},
|
|
3595
|
+
}, It.exports;
|
|
3531
3596
|
}
|
|
3532
|
-
|
|
3533
|
-
function
|
|
3597
|
+
bn();
|
|
3598
|
+
function K0(n, e) {
|
|
3534
3599
|
return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
|
|
3535
3600
|
}
|
|
3536
|
-
function
|
|
3537
|
-
return n.length === 1 && (n =
|
|
3601
|
+
function An(n) {
|
|
3602
|
+
return n.length === 1 && (n = Mn(n)), {
|
|
3538
3603
|
left: function(e, t, o, i) {
|
|
3539
3604
|
for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
|
|
3540
3605
|
var a = o + i >>> 1;
|
|
@@ -3551,31 +3616,31 @@ function xn(n) {
|
|
|
3551
3616
|
}
|
|
3552
3617
|
};
|
|
3553
3618
|
}
|
|
3554
|
-
function
|
|
3619
|
+
function Mn(n) {
|
|
3555
3620
|
return function(e, t) {
|
|
3556
|
-
return
|
|
3621
|
+
return K0(n(e), t);
|
|
3557
3622
|
};
|
|
3558
3623
|
}
|
|
3559
|
-
|
|
3560
|
-
function
|
|
3561
|
-
const o =
|
|
3624
|
+
An(K0);
|
|
3625
|
+
function Wn(n, e, t = 3) {
|
|
3626
|
+
const o = wn(n, e, { maxSegmentLength: t });
|
|
3562
3627
|
return {
|
|
3563
3628
|
check: (i) => typeof i == "string",
|
|
3564
3629
|
interpolate: (i, a, s) => o(s)
|
|
3565
3630
|
};
|
|
3566
3631
|
}
|
|
3567
|
-
function
|
|
3632
|
+
function Xn(n) {
|
|
3568
3633
|
const e = (o) => n.width * o, t = (o) => n.height * o;
|
|
3569
3634
|
return {
|
|
3570
3635
|
scaleX: e,
|
|
3571
3636
|
scaleY: t,
|
|
3572
|
-
position: (o, i) =>
|
|
3637
|
+
position: (o, i) => W({
|
|
3573
3638
|
x: e(o),
|
|
3574
3639
|
y: t(i)
|
|
3575
3640
|
})
|
|
3576
3641
|
};
|
|
3577
3642
|
}
|
|
3578
|
-
function
|
|
3643
|
+
function Gn(n) {
|
|
3579
3644
|
const e = [];
|
|
3580
3645
|
if (n.isAllKey) {
|
|
3581
3646
|
for (let t = 0; t <= n.animations.length; t++)
|
|
@@ -3589,47 +3654,47 @@ function Hn(n) {
|
|
|
3589
3654
|
export {
|
|
3590
3655
|
xt as Alignment,
|
|
3591
3656
|
ot as Anchor,
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3657
|
+
o0 as Animate,
|
|
3658
|
+
In as Arrow,
|
|
3659
|
+
jn as BrowserCanvasRenderer,
|
|
3660
|
+
_n as Circle,
|
|
3661
|
+
G as Color,
|
|
3662
|
+
i0 as Easing,
|
|
3663
|
+
Tn as FadeIn,
|
|
3664
|
+
Cn as FadeOut,
|
|
3665
|
+
Ce as FontStyle,
|
|
3666
|
+
Ee as FontWeight,
|
|
3667
|
+
On as Grid,
|
|
3668
|
+
c0 as Group,
|
|
3669
|
+
Pn as Hide,
|
|
3670
|
+
Sn as IFrame,
|
|
3671
|
+
Fn as Image,
|
|
3672
|
+
Nn as Line,
|
|
3673
|
+
Rn as Mask,
|
|
3609
3674
|
U as ObjectType,
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3675
|
+
Yn as Opaque,
|
|
3676
|
+
Bn as Path,
|
|
3677
|
+
Hn as Pause,
|
|
3678
|
+
Dn as Polygon,
|
|
3679
|
+
W as Position,
|
|
3680
|
+
ze as Presentation,
|
|
3681
|
+
qn as Rectangle,
|
|
3682
|
+
zn as SVG,
|
|
3683
|
+
kn as ScreenCapture,
|
|
3684
|
+
En as Show,
|
|
3620
3685
|
at as Size,
|
|
3621
|
-
|
|
3686
|
+
Un as Slide,
|
|
3622
3687
|
lt as SlideObject,
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3688
|
+
N0 as SlideWebExtra,
|
|
3689
|
+
_e as Text,
|
|
3690
|
+
$n as TextUnit,
|
|
3691
|
+
Te as Transparent,
|
|
3692
|
+
F0 as Update,
|
|
3693
|
+
Gn as getKeySlideBuildIndices,
|
|
3694
|
+
Xn as getSizingFunctions,
|
|
3695
|
+
Wn as getSmoothPathInterpolator,
|
|
3696
|
+
Ie as getTextContentLength,
|
|
3697
|
+
Ue as interpolateColor,
|
|
3698
|
+
Ye as interpolateNumber
|
|
3634
3699
|
};
|
|
3635
3700
|
//# sourceMappingURL=presenter.mjs.map
|