presenter 0.6.3 → 0.6.5

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.
Files changed (129) hide show
  1. package/dist/__vite-browser-external-DYxpcVy9.mjs +4 -0
  2. package/dist/animations/FadeIn.d.ts +2 -2
  3. package/dist/animations/FadeOut.d.ts +2 -2
  4. package/dist/animations/Hide.d.ts +2 -2
  5. package/dist/animations/Show.d.ts +2 -2
  6. package/dist/export/image-renderer/ImageRenderer.d.ts +2 -2
  7. package/dist/export/image-renderer/types/ImageRendererProps.d.ts +3 -3
  8. package/dist/export/image-renderer/types/ImageRendererState.d.ts +1 -1
  9. package/dist/export/index.d.ts +3 -3
  10. package/dist/export/pdf-renderer/PDFRenderer.d.ts +3 -3
  11. package/dist/export/pdf-renderer/types/PDFRendererProps.d.ts +3 -3
  12. package/dist/export/pdf-renderer/types/PDFRendererState.d.ts +1 -1
  13. package/dist/export/powerpoint-renderer/PowerPointRenderer.d.ts +4 -4
  14. package/dist/export/powerpoint-renderer/objects/renderArrow.d.ts +2 -2
  15. package/dist/export/powerpoint-renderer/objects/renderCircle.d.ts +2 -2
  16. package/dist/export/powerpoint-renderer/objects/renderGroup.d.ts +2 -2
  17. package/dist/export/powerpoint-renderer/objects/renderImage.d.ts +2 -2
  18. package/dist/export/powerpoint-renderer/objects/renderLine.d.ts +2 -2
  19. package/dist/export/powerpoint-renderer/objects/renderPath.d.ts +2 -2
  20. package/dist/export/powerpoint-renderer/objects/renderPolygon.d.ts +2 -2
  21. package/dist/export/powerpoint-renderer/objects/renderRectangle.d.ts +2 -2
  22. package/dist/export/powerpoint-renderer/objects/renderText.d.ts +2 -2
  23. package/dist/export/powerpoint-renderer/types/PowerPointObjectRenderer.d.ts +4 -4
  24. package/dist/export/powerpoint-renderer/types/PowerPointRendererProps.d.ts +3 -3
  25. package/dist/export/powerpoint-renderer/utils/defaultObjectRenderers.d.ts +3 -3
  26. package/dist/export/powerpoint-renderer/utils/getPptxFillColor.d.ts +1 -1
  27. package/dist/export/powerpoint-renderer/utils/getPptxText.d.ts +3 -3
  28. package/dist/export/powerpoint-renderer/utils/getTransformedBoundingBox.d.ts +5 -5
  29. package/dist/export/utils/createCanvasElement.d.ts +2 -2
  30. package/dist/export/utils/createPath2D.d.ts +1 -1
  31. package/dist/export/utils/loadPresentationImages.d.ts +1 -1
  32. package/dist/export.js +123 -1
  33. package/dist/export.mjs +5897 -0
  34. package/dist/extras/IFrame.d.ts +3 -3
  35. package/dist/extras/ScreenCapture.d.ts +3 -3
  36. package/dist/index.d.ts +51 -51
  37. package/dist/navigator/openNavigator.d.ts +1 -1
  38. package/dist/objects/Arrow.d.ts +3 -3
  39. package/dist/objects/Circle.d.ts +4 -4
  40. package/dist/objects/Grid.d.ts +3 -3
  41. package/dist/objects/Group.d.ts +5 -3
  42. package/dist/objects/Image.d.ts +3 -3
  43. package/dist/objects/Line.d.ts +3 -3
  44. package/dist/objects/Mask.d.ts +3 -3
  45. package/dist/objects/Path.d.ts +5 -4
  46. package/dist/objects/Polygon.d.ts +4 -4
  47. package/dist/objects/Rectangle.d.ts +4 -4
  48. package/dist/objects/Text.d.ts +7 -7
  49. package/dist/presenter.js +5 -1
  50. package/dist/presenter.mjs +3332 -0
  51. package/dist/renderer/browser-canvas/BrowserCanvasRenderer.d.ts +2 -2
  52. package/dist/renderer/browser-canvas/objects/renderArrow.d.ts +2 -2
  53. package/dist/renderer/browser-canvas/objects/renderCircle.d.ts +2 -2
  54. package/dist/renderer/browser-canvas/objects/renderGroup.d.ts +2 -2
  55. package/dist/renderer/browser-canvas/objects/renderImage.d.ts +2 -2
  56. package/dist/renderer/browser-canvas/objects/renderLine.d.ts +2 -2
  57. package/dist/renderer/browser-canvas/objects/renderMask.d.ts +2 -2
  58. package/dist/renderer/browser-canvas/objects/renderPath.d.ts +2 -2
  59. package/dist/renderer/browser-canvas/objects/renderPolygon.d.ts +2 -2
  60. package/dist/renderer/browser-canvas/objects/renderRectangle.d.ts +2 -2
  61. package/dist/renderer/browser-canvas/objects/renderText.d.ts +2 -2
  62. package/dist/renderer/browser-canvas/types/BrowserCanvasObjectRenderer.d.ts +4 -4
  63. package/dist/renderer/browser-canvas/types/BrowserCanvasRendererProps.d.ts +3 -3
  64. package/dist/renderer/browser-canvas/types/BrowserCanvasRendererState.d.ts +2 -2
  65. package/dist/renderer/browser-canvas/types/UnifiedCanvasContext.d.ts +1 -1
  66. package/dist/renderer/browser-canvas/types/UnifiedImage.d.ts +1 -1
  67. package/dist/renderer/browser-canvas/types/UnifiedPath2D.d.ts +1 -1
  68. package/dist/renderer/browser-canvas/utils/clearCanvas.d.ts +1 -1
  69. package/dist/renderer/browser-canvas/utils/createCanvasElement.d.ts +1 -1
  70. package/dist/renderer/browser-canvas/utils/createPath2D.d.ts +1 -1
  71. package/dist/renderer/browser-canvas/utils/defaultObjectRenderers.d.ts +3 -3
  72. package/dist/renderer/browser-canvas/utils/drawStroke.d.ts +3 -3
  73. package/dist/renderer/browser-canvas/utils/extras/createExtrasElement.d.ts +1 -1
  74. package/dist/renderer/browser-canvas/utils/extras/mountWebExtra.d.ts +1 -1
  75. package/dist/renderer/browser-canvas/utils/fillPath.d.ts +3 -3
  76. package/dist/renderer/browser-canvas/utils/getPathFromPoints.d.ts +3 -3
  77. package/dist/renderer/browser-canvas/utils/getSizeFromTextMetrics.d.ts +1 -1
  78. package/dist/renderer/browser-canvas/utils/loadPresentationImages.d.ts +1 -1
  79. package/dist/renderer/browser-canvas/utils/text/getTextUnitMeasurements.d.ts +4 -4
  80. package/dist/renderer/browser-canvas/utils/text/setContextWithTextStyle.d.ts +2 -2
  81. package/dist/types/Animate.d.ts +6 -5
  82. package/dist/types/BaseUnitSlideAnimation.d.ts +1 -1
  83. package/dist/types/BoundingBox.d.ts +2 -2
  84. package/dist/types/Easing.d.ts +3 -3
  85. package/dist/types/PathWithLength.d.ts +1 -1
  86. package/dist/types/Pause.d.ts +2 -2
  87. package/dist/types/Presentation.d.ts +4 -4
  88. package/dist/types/Slide.d.ts +3 -3
  89. package/dist/types/SlideAnimation.d.ts +4 -4
  90. package/dist/types/SlideWebExtra.d.ts +1 -1
  91. package/dist/types/TextContent.d.ts +1 -1
  92. package/dist/types/TextStyle.d.ts +3 -3
  93. package/dist/types/TextUnit.d.ts +1 -1
  94. package/dist/types/Update.d.ts +3 -3
  95. package/dist/utils/animate/getSlideAnimationDuration.d.ts +1 -1
  96. package/dist/utils/animate/updateObjectStateWithAnimation.d.ts +2 -2
  97. package/dist/utils/color/Opaque.d.ts +1 -1
  98. package/dist/utils/color/Transparent.d.ts +1 -1
  99. package/dist/utils/color/getAlphaForColor.d.ts +1 -1
  100. package/dist/utils/color/getHexStringForColor.d.ts +1 -1
  101. package/dist/utils/color/getRgbStringForColor.d.ts +1 -1
  102. package/dist/utils/interpolate/defaultInterpolators.d.ts +1 -1
  103. package/dist/utils/interpolate/getSmoothPathInterpolator.d.ts +1 -1
  104. package/dist/utils/interpolate/interpolate.d.ts +2 -2
  105. package/dist/utils/interpolate/interpolateColor.d.ts +2 -2
  106. package/dist/utils/interpolate/interpolateFallback.d.ts +1 -1
  107. package/dist/utils/interpolate/interpolateNumber.d.ts +1 -1
  108. package/dist/utils/layout/getBoundingBox.d.ts +4 -4
  109. package/dist/utils/layout/getLineBoundingBox.d.ts +1 -1
  110. package/dist/utils/layout/getSizingFunctions.d.ts +2 -2
  111. package/dist/utils/objects/arrow/getArrowPoints.d.ts +2 -2
  112. package/dist/utils/objects/circle/getCirclePath.d.ts +3 -3
  113. package/dist/utils/objects/line/getLinePath.d.ts +3 -3
  114. package/dist/utils/objects/polygon/getPolygonPath.d.ts +3 -3
  115. package/dist/utils/objects/rectangle/getRectanglePath.d.ts +3 -3
  116. package/dist/utils/objects/rectangle/getRoundedRectanglePath.d.ts +4 -4
  117. package/dist/utils/objects/text/getTextContentLength.d.ts +1 -1
  118. package/dist/utils/objects/text/getTextStyleFromText.d.ts +2 -2
  119. package/dist/utils/objects/text/getTextUnitsFromTextContent.d.ts +2 -2
  120. package/dist/utils/presentation/createPresentationContainer.d.ts +1 -1
  121. package/dist/utils/presentation/getObjectChildren.d.ts +1 -1
  122. package/dist/utils/presentation/getObjectState.d.ts +2 -2
  123. package/dist/utils/presentation/getPresentationShortcuts.d.ts +2 -2
  124. package/dist/utils/presentation/setupKeyEventListeners.d.ts +2 -2
  125. package/dist/utils/size/getCombinedSizes2D.d.ts +1 -1
  126. package/dist/utils/slide/getKeySlideBuildIndices.d.ts +1 -1
  127. package/dist/utils/storage/loadPresentationState.d.ts +2 -2
  128. package/dist/utils/storage/storePresentationState.d.ts +1 -1
  129. package/package.json +13 -10
@@ -0,0 +1,3332 @@
1
+ var Dt = Object.defineProperty;
2
+ var Bt = (n, e, t) => e in n ? Dt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var _ = (n, e, t) => Bt(n, typeof e != "symbol" ? e + "" : e, t);
4
+ const l0 = {
5
+ /** Represents an animated change in an object's properties. */
6
+ ANIMATE: "Animate",
7
+ /** Represents a pause in the animation timeline. */
8
+ PAUSE: "Pause",
9
+ /** Represents an immediate update to an object's properties without animation. */
10
+ UPDATE: "Update"
11
+ };
12
+ function jt(n) {
13
+ return n * n * n;
14
+ }
15
+ function Ut(n) {
16
+ return --n * n * n + 1;
17
+ }
18
+ function zt(n) {
19
+ return ((n *= 2) <= 1 ? n * n * n : (n -= 2) * n * n + 2) / 2;
20
+ }
21
+ var J0 = 1.70158;
22
+ (function n(e) {
23
+ e = +e;
24
+ function t(o) {
25
+ return (o = +o) * o * (e * (o - 1) + o);
26
+ }
27
+ return t.overshoot = n, t;
28
+ })(J0);
29
+ (function n(e) {
30
+ e = +e;
31
+ function t(o) {
32
+ return --o * o * ((o + 1) * e + o) + 1;
33
+ }
34
+ return t.overshoot = n, t;
35
+ })(J0);
36
+ var Ht = (function n(e) {
37
+ e = +e;
38
+ function t(o) {
39
+ return ((o *= 2) < 1 ? o * o * ((e + 1) * o - e) : (o -= 2) * o * ((e + 1) * o + e) + 2) / 2;
40
+ }
41
+ return t.overshoot = n, t;
42
+ })(J0);
43
+ const tt = {
44
+ LINEAR: (n) => n,
45
+ CUBIC: zt,
46
+ CUBIC_IN: jt,
47
+ CUBIC_OUT: Ut,
48
+ BACK_IN_OUT: Ht.overshoot(0.8)
49
+ }, $t = tt.LINEAR;
50
+ function et(n, e, t = {}) {
51
+ return {
52
+ type: l0.ANIMATE,
53
+ object: n,
54
+ props: e,
55
+ delay: 0,
56
+ duration: 1e3,
57
+ easing: $t,
58
+ block: !1,
59
+ interpolators: null,
60
+ isKey: !1,
61
+ shortcut: null,
62
+ ...typeof t == "number" ? { duration: t } : t
63
+ };
64
+ }
65
+ function on(n, e = {}) {
66
+ return et(n, { opacity: 1 }, {
67
+ duration: 500,
68
+ easing: tt.CUBIC,
69
+ ...typeof e == "number" ? { duration: e } : e
70
+ });
71
+ }
72
+ function sn(n, e = {}) {
73
+ return et(n, { opacity: 0 }, {
74
+ duration: 500,
75
+ easing: tt.CUBIC,
76
+ ...typeof e == "number" ? { duration: e } : e
77
+ });
78
+ }
79
+ function Pt(n, e) {
80
+ return {
81
+ type: l0.UPDATE,
82
+ isKey: !1,
83
+ object: n,
84
+ props: e,
85
+ shortcut: null
86
+ };
87
+ }
88
+ function an(n) {
89
+ return Pt(n, { opacity: 0 });
90
+ }
91
+ function hn(n) {
92
+ return Pt(n, { opacity: 1 });
93
+ }
94
+ const e0 = {
95
+ TOP_LEFT: "TopLeft",
96
+ TOP: "Top",
97
+ TOP_RIGHT: "TopRight",
98
+ LEFT: "Left",
99
+ CENTER: "Center",
100
+ RIGHT: "Right",
101
+ BOTTOM_LEFT: "BottomLeft",
102
+ BOTTOM: "Bottom",
103
+ BOTTOM_RIGHT: "BottomRight"
104
+ }, s0 = e0.TOP_LEFT;
105
+ function X(n, e = 0, t = 0, o = 1) {
106
+ if (typeof n == "string") {
107
+ const i = n.replace("#", ""), a = parseInt(i, 16);
108
+ return isNaN(a) ? (console.warn("Invalid hex color format:", n), K) : i.length === 6 ? {
109
+ red: a >> 16 & 255,
110
+ green: a >> 8 & 255,
111
+ blue: a & 255,
112
+ alpha: 1
113
+ } : i.length === 8 ? {
114
+ red: a >> 24 & 255,
115
+ green: a >> 16 & 255,
116
+ blue: a >> 8 & 255,
117
+ alpha: (a & 255) / 255
118
+ } : (console.warn("Invalid hex color format:", n), K);
119
+ } else if (typeof n == "number")
120
+ return {
121
+ red: n,
122
+ green: e ?? 0,
123
+ blue: t ?? 0,
124
+ alpha: o ?? 1
125
+ };
126
+ return {
127
+ red: 0,
128
+ green: 0,
129
+ blue: 0,
130
+ alpha: 1,
131
+ ...n
132
+ };
133
+ }
134
+ X.BLACK = X(0, 0, 0);
135
+ X.BLUE = X(0, 0, 255);
136
+ X.GREEN = X(0, 255, 0);
137
+ X.RED = X(255, 0, 0);
138
+ X.TRANSPARENT = X(0, 0, 0, 0);
139
+ X.WHITE = X(255, 255, 255);
140
+ const K = { red: 0, green: 0, blue: 0, alpha: 1 };
141
+ function Ct(n = null) {
142
+ return {
143
+ content: null,
144
+ setup: null,
145
+ anchor: e0.TOP_LEFT,
146
+ height: 0,
147
+ width: 0,
148
+ x: 0,
149
+ y: 0,
150
+ ...n
151
+ };
152
+ }
153
+ function Et(n, e = null) {
154
+ return n.alpha * (e ?? 1);
155
+ }
156
+ function E0(n, e = null) {
157
+ const { red: t, green: o, blue: i } = n, a = t << 16 | o << 8 | i, s = Math.round(Et(n, e) * 255);
158
+ return `#${a.toString(16).padStart(6, "0")}${s !== 255 ? s.toString(16).padStart(2, "0") : ""}`;
159
+ }
160
+ function ln(n = null) {
161
+ const {
162
+ url: e = "https://wikipedia.org/",
163
+ backgroundColor: t = X.TRANSPARENT,
164
+ borderColor: o = K,
165
+ borderWidth: i = 0,
166
+ pointerEvents: a = "auto",
167
+ scale: s = 1,
168
+ anchor: r = s0,
169
+ height: h = 1e3,
170
+ width: c = 1e3,
171
+ x: f = 0,
172
+ y: x = 0
173
+ } = n || {}, l = document.createElement("iframe");
174
+ l.src = e, l.style.backgroundColor = E0(t), l.style.border = i > 0 ? `${i}px solid ${E0(o)}` : "none", l.style.pointerEvents = a;
175
+ const u = (100 / s).toFixed(3) + "%";
176
+ return l.style.height = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.width = i === 0 ? u : `calc(${u} - ${i * 2}px)`, l.style.transform = `scale(${s})`, l.style.transformOrigin = "top left", Ct({
177
+ content: l,
178
+ anchor: r,
179
+ height: h,
180
+ width: c,
181
+ x: f,
182
+ y: x
183
+ });
184
+ }
185
+ const g0 = {
186
+ LEFT: "left",
187
+ CENTER: "center",
188
+ RIGHT: "right"
189
+ }, Yt = g0.LEFT;
190
+ function c0(n, e) {
191
+ throw new Error("Unexpected value: " + n);
192
+ }
193
+ function cn(n = null) {
194
+ const {
195
+ alignment: e = g0.LEFT,
196
+ scale: t = 1,
197
+ anchor: o = s0,
198
+ height: i = 1e3,
199
+ width: a = 1e3,
200
+ x: s = 0,
201
+ y: r = 0
202
+ } = n || {};
203
+ function h(c) {
204
+ const f = document.createElement("video");
205
+ switch (f.autoplay = !0, f.style.transform = `scale(${t})`, e) {
206
+ case g0.LEFT:
207
+ f.style.transformOrigin = "top left";
208
+ break;
209
+ case g0.CENTER:
210
+ f.style.transformOrigin = "top center";
211
+ break;
212
+ case g0.RIGHT:
213
+ f.style.transformOrigin = "top right";
214
+ break;
215
+ default:
216
+ c0(e);
217
+ }
218
+ c.appendChild(f);
219
+ const x = {
220
+ video: {
221
+ displaySurface: "window"
222
+ },
223
+ audio: !1
224
+ };
225
+ return navigator.mediaDevices.getDisplayMedia(x).then((l) => {
226
+ const u = l.getVideoTracks()[0];
227
+ u !== void 0 && (u.onended = function() {
228
+ f.style.display = "none";
229
+ }), f.srcObject = l, f.play();
230
+ }).catch((l) => {
231
+ console.error("Could not start screen capture -", l);
232
+ }), () => {
233
+ f.srcObject.getTracks().forEach((u) => u.stop()), f.style.display = "none", f.srcObject = null;
234
+ };
235
+ }
236
+ return Ct({
237
+ content: null,
238
+ setup: h,
239
+ anchor: o,
240
+ height: i,
241
+ width: a,
242
+ x: s,
243
+ y: r
244
+ });
245
+ }
246
+ const H = {
247
+ ARROW: "Arrow",
248
+ CIRCLE: "Circle",
249
+ GROUP: "Group",
250
+ IMAGE: "Image",
251
+ LINE: "Line",
252
+ MASK: "Mask",
253
+ PATH: "Path",
254
+ POLYGON: "Polygon",
255
+ RECTANGLE: "Rectangle",
256
+ SLIDE_OBJECT: "SlideObject",
257
+ TEXT: "Text"
258
+ };
259
+ function a0(n) {
260
+ return {
261
+ objectType: H.SLIDE_OBJECT,
262
+ opacity: 1,
263
+ ...n
264
+ };
265
+ }
266
+ function un(n = null) {
267
+ const { arrowheadSize: e, width: t = 10, ...o } = n || {}, i = e ?? t * 4;
268
+ return a0({
269
+ objectType: H.ARROW,
270
+ arrowheadSize: i,
271
+ color: K,
272
+ drawn: 1,
273
+ endX: 100,
274
+ endY: 100,
275
+ isArrowheadDoubled: !1,
276
+ isArrowheadFilled: !1,
277
+ isDrawnFromCenter: !1,
278
+ startX: 0,
279
+ startY: 0,
280
+ width: t,
281
+ ...o
282
+ });
283
+ }
284
+ const Xt = 50;
285
+ function fn(n = null) {
286
+ return a0({
287
+ objectType: H.CIRCLE,
288
+ anchor: s0,
289
+ borderColor: K,
290
+ borderWidth: 0,
291
+ drawn: 1,
292
+ fill: K,
293
+ radius: Xt,
294
+ x: 0,
295
+ y: 0,
296
+ ...n
297
+ });
298
+ }
299
+ function ot(n, e = null) {
300
+ return a0({
301
+ objectType: H.GROUP,
302
+ anchor: s0,
303
+ height: 0,
304
+ objects: n,
305
+ previewColor: null,
306
+ rotateOriginPreviewSize: 0,
307
+ rotateOriginX: 0,
308
+ rotateOriginY: 0,
309
+ rotation: 0,
310
+ scale: 1,
311
+ width: 0,
312
+ x: 0,
313
+ y: 0,
314
+ ...e
315
+ });
316
+ }
317
+ function gn(n) {
318
+ const {
319
+ anchor: e = s0,
320
+ cols: t = 1,
321
+ rows: o = 1,
322
+ gapX: i = 0,
323
+ gapY: a = 0,
324
+ width: s = 0,
325
+ height: r = 0,
326
+ x: h = 0,
327
+ y: c = 0,
328
+ objects: f = () => null
329
+ } = n, x = [], l = [];
330
+ let u = 0, A = 0;
331
+ for (let M = 0; M < o; M++) {
332
+ const C = [];
333
+ u = 0;
334
+ let E = 0;
335
+ for (let L = 0; L < t; L++) {
336
+ const S = f(M, L), P = typeof s == "function" ? s(M, L) : s, F = typeof r == "function" ? r(M, L) : r;
337
+ C.push(S), S != null && l.push(
338
+ ot([S], {
339
+ x: u,
340
+ y: A
341
+ })
342
+ ), u += P + i, E = Math.max(E, F);
343
+ }
344
+ x.push(C), A += E + a;
345
+ }
346
+ return {
347
+ grid: ot(l, {
348
+ x: h,
349
+ y: c,
350
+ height: A - a,
351
+ width: u - i,
352
+ anchor: e
353
+ }),
354
+ objects: x
355
+ };
356
+ }
357
+ function pn(n = null) {
358
+ return a0({
359
+ objectType: H.IMAGE,
360
+ anchor: s0,
361
+ height: 100,
362
+ imageId: "",
363
+ rounding: 0,
364
+ smooth: !0,
365
+ width: 100,
366
+ x: 0,
367
+ y: 0,
368
+ ...n
369
+ });
370
+ }
371
+ function dn(n = null) {
372
+ return a0({
373
+ objectType: H.LINE,
374
+ color: K,
375
+ drawn: 1,
376
+ endX: 100,
377
+ endY: 100,
378
+ isDrawnFromCenter: !1,
379
+ isRounded: !1,
380
+ startX: 0,
381
+ startY: 0,
382
+ width: 10,
383
+ ...n
384
+ });
385
+ }
386
+ function xn(n, e = null) {
387
+ return a0({
388
+ objectType: H.MASK,
389
+ anchor: s0,
390
+ height: 100,
391
+ objects: n,
392
+ preview: !1,
393
+ width: 100,
394
+ x: 0,
395
+ y: 0,
396
+ ...e
397
+ });
398
+ }
399
+ var Gt = Object.defineProperty, O = (n, e) => Gt(n, "name", { value: e, configurable: !0 }), P0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Zt = /([astvzqmhlc])([^astvzqmhlc]*)/gi, Wt = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi, Kt = O((n) => {
400
+ const e = (n && n.length > 0 ? n : "M0,0").match(Zt);
401
+ if (!e) throw new Error(`No path elements found in string ${n}`);
402
+ return e.reduce((t, o) => {
403
+ let i = o.charAt(0), a = i.toLowerCase(), s = Vt(o.substring(1));
404
+ 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)) {
405
+ const r = o.substring(1).trim().split(" ");
406
+ 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])];
407
+ }
408
+ for (; s.length >= 0; ) {
409
+ if (s.length === P0[a]) {
410
+ t.push([i, ...s.splice(0, P0[a])]);
411
+ break;
412
+ }
413
+ if (s.length < P0[a]) throw new Error(`Malformed path data: "${i}" must have ${P0[a]} elements and has ${s.length}: ${o}`);
414
+ t.push([i, ...s.splice(0, P0[a])]);
415
+ }
416
+ return t;
417
+ }, []);
418
+ }, "default"), Vt = O((n) => {
419
+ const e = n.match(Wt);
420
+ return e ? e.map(Number) : [];
421
+ }, "parseValues"), v0, V = (v0 = class {
422
+ constructor(e, t, o, i) {
423
+ _(this, "x0");
424
+ _(this, "x1");
425
+ _(this, "y0");
426
+ _(this, "y1");
427
+ _(this, "getTotalLength", O(() => Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), "getTotalLength"));
428
+ _(this, "getPointAtLength", O((e) => {
429
+ let t = e / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
430
+ t = Number.isNaN(t) ? 1 : t;
431
+ const o = (this.x1 - this.x0) * t, i = (this.y1 - this.y0) * t;
432
+ return { x: this.x0 + o, y: this.y0 + i };
433
+ }, "getPointAtLength"));
434
+ _(this, "getTangentAtLength", O((e) => {
435
+ const t = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
436
+ return { x: (this.x1 - this.x0) / t, y: (this.y1 - this.y0) / t };
437
+ }, "getTangentAtLength"));
438
+ _(this, "getPropertiesAtLength", O((e) => {
439
+ const t = this.getPointAtLength(e), o = this.getTangentAtLength(e);
440
+ return { x: t.x, y: t.y, tangentX: o.x, tangentY: o.y };
441
+ }, "getPropertiesAtLength"));
442
+ this.x0 = e, this.x1 = t, this.y0 = o, this.y1 = i;
443
+ }
444
+ }, O(v0, "LinearPosition"), v0), w0, st = (w0 = class {
445
+ constructor(e, t, o, i, a, s, r, h, c) {
446
+ _(this, "x0");
447
+ _(this, "y0");
448
+ _(this, "rx");
449
+ _(this, "ry");
450
+ _(this, "xAxisRotate");
451
+ _(this, "LargeArcFlag");
452
+ _(this, "SweepFlag");
453
+ _(this, "x1");
454
+ _(this, "y1");
455
+ _(this, "length");
456
+ _(this, "getTotalLength", O(() => this.length, "getTotalLength"));
457
+ _(this, "getPointAtLength", O((e) => {
458
+ e < 0 ? e = 0 : e > this.length && (e = this.length);
459
+ const t = at({ 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);
460
+ return { x: t.x, y: t.y };
461
+ }, "getPointAtLength"));
462
+ _(this, "getTangentAtLength", O((e) => {
463
+ e < 0 ? e = 0 : e > this.length && (e = this.length);
464
+ const t = 0.05, o = this.getPointAtLength(e);
465
+ let i;
466
+ e < 0 ? e = 0 : e > this.length && (e = this.length), i = e < this.length - t ? this.getPointAtLength(e + t) : this.getPointAtLength(e - t);
467
+ const a = i.x - o.x, s = i.y - o.y, r = Math.sqrt(a * a + s * s);
468
+ return e < this.length - t ? { x: -a / r, y: -s / r } : { x: a / r, y: s / r };
469
+ }, "getTangentAtLength"));
470
+ _(this, "getPropertiesAtLength", O((e) => {
471
+ const t = this.getTangentAtLength(e), o = this.getPointAtLength(e);
472
+ return { x: o.x, y: o.y, tangentX: t.x, tangentY: t.y };
473
+ }, "getPropertiesAtLength"));
474
+ 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 = c;
475
+ const f = Qt(300, function(x) {
476
+ return at({ x: e, y: t }, o, i, a, s, r, { x: h, y: c }, x);
477
+ });
478
+ this.length = f.arcLength;
479
+ }
480
+ }, O(w0, "Arc"), w0), at = O((n, e, t, o, i, a, s, r) => {
481
+ e = Math.abs(e), t = Math.abs(t), o = Jt(o, 360);
482
+ const h = t1(o);
483
+ if (n.x === s.x && n.y === s.y) return { x: n.x, y: n.y, ellipticalArcAngle: 0 };
484
+ if (e === 0 || t === 0) return { x: 0, y: 0, ellipticalArcAngle: 0 };
485
+ const c = (n.x - s.x) / 2, f = (n.y - s.y) / 2, x = { x: Math.cos(h) * c + Math.sin(h) * f, y: -Math.sin(h) * c + Math.cos(h) * f }, l = Math.pow(x.x, 2) / Math.pow(e, 2) + Math.pow(x.y, 2) / Math.pow(t, 2);
486
+ l > 1 && (e = Math.sqrt(l) * e, t = Math.sqrt(l) * t);
487
+ let u = (Math.pow(e, 2) * Math.pow(t, 2) - Math.pow(e, 2) * Math.pow(x.y, 2) - Math.pow(t, 2) * Math.pow(x.x, 2)) / (Math.pow(e, 2) * Math.pow(x.y, 2) + Math.pow(t, 2) * Math.pow(x.x, 2));
488
+ u = u < 0 ? 0 : u;
489
+ const A = (i !== a ? 1 : -1) * Math.sqrt(u), y = A * (e * x.y / t), M = A * (-t * x.x / e), C = { 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 }, E = { x: (x.x - y) / e, y: (x.y - M) / t }, L = lt({ x: 1, y: 0 }, E);
490
+ let S = lt(E, { x: (-x.x - y) / e, y: (-x.y - M) / t });
491
+ !a && S > 0 ? S -= 2 * Math.PI : a && S < 0 && (S += 2 * Math.PI), S %= 2 * Math.PI;
492
+ const P = L + S * r, F = e * Math.cos(P), z = t * Math.sin(P);
493
+ return { x: Math.cos(h) * F - Math.sin(h) * z + C.x, y: Math.sin(h) * F + Math.cos(h) * z + C.y, ellipticalArcStartAngle: L, ellipticalArcEndAngle: L + S, ellipticalArcAngle: P, ellipticalArcCenter: C, resultantRx: e, resultantRy: t };
494
+ }, "pointOnEllipticalArc"), Qt = O((n, e) => {
495
+ n = n ?? 500;
496
+ let t = 0;
497
+ const o = [], i = [];
498
+ let a, s = e(0);
499
+ for (let r = 0; r < n; r++) {
500
+ const h = e1(r * (1 / n), 0, 1);
501
+ a = e(h), t += ht(s, a), i.push([s, a]), o.push({ t: h, arcLength: t }), s = a;
502
+ }
503
+ return a = e(1), i.push([s, a]), t += ht(s, a), o.push({ t: 1, arcLength: t }), { arcLength: t, arcLengthMap: o, approximationLines: i };
504
+ }, "approximateArcLengthOfCurve"), Jt = O((n, e) => (n % e + e) % e, "mod"), t1 = O((n) => n * (Math.PI / 180), "toRadians"), ht = O((n, e) => Math.sqrt(Math.pow(e.x - n.x, 2) + Math.pow(e.y - n.y, 2)), "distance"), e1 = O((n, e, t) => Math.min(Math.max(n, e), t), "clamp"), lt = O((n, e) => {
505
+ 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)));
506
+ return (n.x * e.y - n.y * e.x < 0 ? -1 : 1) * Math.acos(t / o);
507
+ }, "angleBetween"), n1 = [[], [], [-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]], r1 = [[], [], [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]], i1 = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]], o1 = 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"), s1 = O((n, e, t) => St([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"), a1 = O((n, e, t) => {
508
+ let o, i;
509
+ const a = t / 2;
510
+ o = 0;
511
+ for (let s = 0; s < 20; s++) i = a * n1[20][s] + a, o += r1[20][s] * _t(n, e, i);
512
+ return a * o;
513
+ }, "getCubicArcLength"), St = 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"), h1 = O((n, e, t) => {
514
+ t === void 0 && (t = 1);
515
+ 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), c = a * a + s * s;
516
+ if (r === 0) return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
517
+ const f = h / (2 * r), x = t + f, l = c / r - f * f, u = x * x + l > 0 ? Math.sqrt(x * x + l) : 0, A = f * f + l > 0 ? Math.sqrt(f * f + l) : 0, y = f + Math.sqrt(f * f + l) !== 0 && (x + u) / (f + A) !== 0 ? l * Math.log(Math.abs((x + u) / (f + A))) : 0;
518
+ return Math.sqrt(r) / 2 * (x * u - f * A + y);
519
+ }, "getQuadraticArcLength"), l1 = 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");
520
+ function _t(n, e, t) {
521
+ const o = X0(1, t, n), i = X0(1, t, e), a = o * o + i * i;
522
+ return Math.sqrt(a);
523
+ }
524
+ O(_t, "BFunc");
525
+ var X0 = O((n, e, t) => {
526
+ const o = t.length - 1;
527
+ let i, a;
528
+ if (o === 0) return 0;
529
+ if (n === 0) {
530
+ a = 0;
531
+ for (let s = 0; s <= o; s++) a += i1[o][s] * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
532
+ return a;
533
+ }
534
+ i = new Array(o);
535
+ for (let s = 0; s < o; s++) i[s] = o * (t[s + 1] - t[s]);
536
+ return X0(n - 1, e, i);
537
+ }, "getDerivative"), F0 = O((n, e, t) => {
538
+ let o = 1, i = n / e, a = (n - t(i)) / e, s = 0;
539
+ for (; o > 1e-3; ) {
540
+ const r = t(i + a), h = Math.abs(n - r) / e;
541
+ if (h < o) o = h, i += a;
542
+ else {
543
+ const c = t(i - a), f = Math.abs(n - c) / e;
544
+ f < o ? (o = f, i -= a) : a /= 2;
545
+ }
546
+ if (s++, s > 500) break;
547
+ }
548
+ return i;
549
+ }, "t2length"), A0, r0 = (A0 = class {
550
+ constructor(e, t, o, i, a, s, r, h) {
551
+ _(this, "a");
552
+ _(this, "b");
553
+ _(this, "c");
554
+ _(this, "d");
555
+ _(this, "length");
556
+ _(this, "getArcLength");
557
+ _(this, "getPoint");
558
+ _(this, "getDerivative");
559
+ _(this, "getTotalLength", O(() => this.length, "getTotalLength"));
560
+ _(this, "getPointAtLength", O((e) => {
561
+ 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 = F0(e, this.length, (a) => this.getArcLength(t, o, a));
562
+ return this.getPoint(t, o, i);
563
+ }, "getPointAtLength"));
564
+ _(this, "getTangentAtLength", O((e) => {
565
+ 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 = F0(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);
566
+ let r;
567
+ return r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 }, r;
568
+ }, "getTangentAtLength"));
569
+ _(this, "getPropertiesAtLength", O((e) => {
570
+ 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 = F0(e, this.length, (c) => this.getArcLength(t, o, c)), a = this.getDerivative(t, o, i), s = Math.sqrt(a.x * a.x + a.y * a.y);
571
+ let r;
572
+ r = s > 0 ? { x: a.x / s, y: a.y / s } : { x: 0, y: 0 };
573
+ const h = this.getPoint(t, o, i);
574
+ return { x: h.x, y: h.y, tangentX: r.x, tangentY: r.y };
575
+ }, "getPropertiesAtLength"));
576
+ _(this, "getC", O(() => this.c, "getC"));
577
+ _(this, "getD", O(() => this.d, "getD"));
578
+ 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 = a1, this.getPoint = o1, this.getDerivative = s1, this.d = { x: r, y: h }) : (this.getArcLength = h1, this.getPoint = St, this.getDerivative = l1, 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);
579
+ }
580
+ }, O(A0, "Bezier"), A0), m0, c1 = (m0 = class {
581
+ constructor(e) {
582
+ _(this, "length", 0);
583
+ _(this, "partial_lengths", []);
584
+ _(this, "functions", []);
585
+ _(this, "initial_point", null);
586
+ _(this, "getPartAtLength", O((e) => {
587
+ e < 0 ? e = 0 : e > this.length && (e = this.length);
588
+ let t = this.partial_lengths.length - 1;
589
+ for (; this.partial_lengths[t] >= e && t > 0; ) t--;
590
+ return t++, { fraction: e - this.partial_lengths[t - 1], i: t };
591
+ }, "getPartAtLength"));
592
+ _(this, "getTotalLength", O(() => this.length, "getTotalLength"));
593
+ _(this, "getPointAtLength", O((e) => {
594
+ const t = this.getPartAtLength(e), o = this.functions[t.i];
595
+ if (o) return o.getPointAtLength(t.fraction);
596
+ if (this.initial_point) return this.initial_point;
597
+ throw new Error("Wrong function at this part.");
598
+ }, "getPointAtLength"));
599
+ _(this, "getTangentAtLength", O((e) => {
600
+ const t = this.getPartAtLength(e), o = this.functions[t.i];
601
+ if (o) return o.getTangentAtLength(t.fraction);
602
+ if (this.initial_point) return { x: 0, y: 0 };
603
+ throw new Error("Wrong function at this part.");
604
+ }, "getTangentAtLength"));
605
+ _(this, "getPropertiesAtLength", O((e) => {
606
+ const t = this.getPartAtLength(e), o = this.functions[t.i];
607
+ if (o) return o.getPropertiesAtLength(t.fraction);
608
+ if (this.initial_point) return { x: this.initial_point.x, y: this.initial_point.y, tangentX: 0, tangentY: 0 };
609
+ throw new Error("Wrong function at this part.");
610
+ }, "getPropertiesAtLength"));
611
+ _(this, "getParts", O(() => {
612
+ const e = [];
613
+ for (let t = 0; t < this.functions.length; t++) if (this.functions[t] !== null) {
614
+ this.functions[t] = this.functions[t];
615
+ const o = { start: this.functions[t].getPointAtLength(0), end: this.functions[t].getPointAtLength(this.partial_lengths[t] - this.partial_lengths[t - 1]), length: this.partial_lengths[t] - this.partial_lengths[t - 1], getPointAtLength: this.functions[t].getPointAtLength, getTangentAtLength: this.functions[t].getTangentAtLength, getPropertiesAtLength: this.functions[t].getPropertiesAtLength };
616
+ e.push(o);
617
+ }
618
+ return e;
619
+ }, "getParts"));
620
+ const t = Array.isArray(e) ? e : Kt(e);
621
+ let o, i = [0, 0], a = [0, 0], s = [0, 0];
622
+ for (let r = 0; r < t.length; r++) {
623
+ 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] });
624
+ else if (t[r][0] === "m") i = [t[r][1] + i[0], t[r][2] + i[1]], s = [i[0], i[1]], this.functions.push(null);
625
+ else if (t[r][0] === "L") this.length += Math.sqrt(Math.pow(i[0] - t[r][1], 2) + Math.pow(i[1] - t[r][2], 2)), this.functions.push(new V(i[0], t[r][1], i[1], t[r][2])), i = [t[r][1], t[r][2]];
626
+ else if (t[r][0] === "l") this.length += Math.sqrt(Math.pow(t[r][1], 2) + Math.pow(t[r][2], 2)), this.functions.push(new V(i[0], t[r][1] + i[0], i[1], t[r][2] + i[1])), i = [t[r][1] + i[0], t[r][2] + i[1]];
627
+ else if (t[r][0] === "H") this.length += Math.abs(i[0] - t[r][1]), this.functions.push(new V(i[0], t[r][1], i[1], i[1])), i[0] = t[r][1];
628
+ else if (t[r][0] === "h") this.length += Math.abs(t[r][1]), this.functions.push(new V(i[0], i[0] + t[r][1], i[1], i[1])), i[0] = t[r][1] + i[0];
629
+ else if (t[r][0] === "V") this.length += Math.abs(i[1] - t[r][1]), this.functions.push(new V(i[0], i[0], i[1], t[r][1])), i[1] = t[r][1];
630
+ else if (t[r][0] === "v") this.length += Math.abs(t[r][1]), this.functions.push(new V(i[0], i[0], i[1], i[1] + t[r][1])), i[1] = t[r][1] + i[1];
631
+ else if (t[r][0] === "z" || t[r][0] === "Z") this.length += Math.sqrt(Math.pow(s[0] - i[0], 2) + Math.pow(s[1] - i[1], 2)), this.functions.push(new V(i[0], s[0], i[1], s[1])), i = [s[0], s[1]];
632
+ else if (t[r][0] === "C") o = new r0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], t[r][5], t[r][6]), this.length += o.getTotalLength(), i = [t[r][5], t[r][6]], this.functions.push(o);
633
+ else if (t[r][0] === "c") o = new r0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], i[0] + t[r][5], i[1] + t[r][6]), o.getTotalLength() > 0 ? (this.length += o.getTotalLength(), this.functions.push(o), i = [t[r][5] + i[0], t[r][6] + i[1]]) : this.functions.push(new V(i[0], i[0], i[1], i[1]));
634
+ else if (t[r][0] === "S") {
635
+ if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
636
+ if (o) {
637
+ const h = o.getC();
638
+ o = new r0(i[0], i[1], 2 * i[0] - h.x, 2 * i[1] - h.y, t[r][1], t[r][2], t[r][3], t[r][4]);
639
+ }
640
+ } else o = new r0(i[0], i[1], i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4]);
641
+ o && (this.length += o.getTotalLength(), i = [t[r][3], t[r][4]], this.functions.push(o));
642
+ } else if (t[r][0] === "s") {
643
+ if (r > 0 && ["C", "c", "S", "s"].indexOf(t[r - 1][0]) > -1) {
644
+ if (o) {
645
+ const h = o.getC(), c = o.getD();
646
+ o = new r0(i[0], i[1], i[0] + c.x - h.x, i[1] + c.y - h.y, i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4]);
647
+ }
648
+ } else o = new r0(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]);
649
+ o && (this.length += o.getTotalLength(), i = [t[r][3] + i[0], t[r][4] + i[1]], this.functions.push(o));
650
+ } else if (t[r][0] === "Q") {
651
+ if (i[0] === t[r][1] && i[1] === t[r][2]) {
652
+ const h = new V(t[r][1], t[r][3], t[r][2], t[r][4]);
653
+ this.length += h.getTotalLength(), this.functions.push(h);
654
+ } else o = new r0(i[0], i[1], t[r][1], t[r][2], t[r][3], t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
655
+ i = [t[r][3], t[r][4]], a = [t[r][1], t[r][2]];
656
+ } else if (t[r][0] === "q") {
657
+ if (t[r][1] !== 0 || t[r][2] !== 0) o = new r0(i[0], i[1], i[0] + t[r][1], i[1] + t[r][2], i[0] + t[r][3], i[1] + t[r][4], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
658
+ else {
659
+ const h = new V(i[0] + t[r][1], i[0] + t[r][3], i[1] + t[r][2], i[1] + t[r][4]);
660
+ this.length += h.getTotalLength(), this.functions.push(h);
661
+ }
662
+ a = [i[0] + t[r][1], i[1] + t[r][2]], i = [t[r][3] + i[0], t[r][4] + i[1]];
663
+ } else if (t[r][0] === "T") {
664
+ if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new r0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], t[r][1], t[r][2], void 0, void 0), this.functions.push(o), this.length += o.getTotalLength();
665
+ else {
666
+ const h = new V(i[0], t[r][1], i[1], t[r][2]);
667
+ this.functions.push(h), this.length += h.getTotalLength();
668
+ }
669
+ a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1], t[r][2]];
670
+ } else if (t[r][0] === "t") {
671
+ if (r > 0 && ["Q", "q", "T", "t"].indexOf(t[r - 1][0]) > -1) o = new r0(i[0], i[1], 2 * i[0] - a[0], 2 * i[1] - a[1], i[0] + t[r][1], i[1] + t[r][2], void 0, void 0), this.length += o.getTotalLength(), this.functions.push(o);
672
+ else {
673
+ const h = new V(i[0], i[0] + t[r][1], i[1], i[1] + t[r][2]);
674
+ this.length += h.getTotalLength(), this.functions.push(h);
675
+ }
676
+ a = [2 * i[0] - a[0], 2 * i[1] - a[1]], i = [t[r][1] + i[0], t[r][2] + i[1]];
677
+ } else if (t[r][0] === "A") {
678
+ const h = new st(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]);
679
+ this.length += h.getTotalLength(), i = [t[r][6], t[r][7]], this.functions.push(h);
680
+ } else if (t[r][0] === "a") {
681
+ const h = new st(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]);
682
+ this.length += h.getTotalLength(), i = [i[0] + t[r][6], i[1] + t[r][7]], this.functions.push(h);
683
+ }
684
+ this.partial_lengths.push(this.length);
685
+ }
686
+ }
687
+ }, O(m0, "SVGPathProperties"), m0), b0, G0 = (b0 = class {
688
+ constructor(e) {
689
+ _(this, "inst");
690
+ _(this, "getTotalLength", O(() => this.inst.getTotalLength(), "getTotalLength"));
691
+ _(this, "getPointAtLength", O((e) => this.inst.getPointAtLength(e), "getPointAtLength"));
692
+ _(this, "getTangentAtLength", O((e) => this.inst.getTangentAtLength(e), "getTangentAtLength"));
693
+ _(this, "getPropertiesAtLength", O((e) => this.inst.getPropertiesAtLength(e), "getPropertiesAtLength"));
694
+ _(this, "getParts", O(() => this.inst.getParts(), "getParts"));
695
+ if (this.inst = new c1(e), !(this instanceof G0)) return new G0(e);
696
+ }
697
+ }, O(b0, "_svgPathProperties"), b0);
698
+ function u1(n = X.BLACK) {
699
+ return { ...n, alpha: 0 };
700
+ }
701
+ function yn(n = null) {
702
+ const { path: e, height: t = 100, width: o = 100, viewboxHeight: i, viewboxWidth: a, ...s } = n ?? {}, r = e ?? "M 0 0 L 100 100", c = new G0(r).getTotalLength();
703
+ return a0({
704
+ objectType: H.PATH,
705
+ anchor: s0,
706
+ color: K,
707
+ drawn: 1,
708
+ fill: u1(),
709
+ isRounded: !1,
710
+ height: t,
711
+ path: r,
712
+ pathLength: c,
713
+ strokeWidth: 4,
714
+ viewboxHeight: i ?? t,
715
+ viewboxWidth: a ?? o,
716
+ width: o,
717
+ x: 0,
718
+ y: 0,
719
+ ...s
720
+ });
721
+ }
722
+ function vn(n = null) {
723
+ return a0({
724
+ objectType: H.POLYGON,
725
+ borderColor: K,
726
+ borderWidth: 0,
727
+ drawn: 1,
728
+ points: [
729
+ { x: 0, y: 0 },
730
+ { x: 100, y: 0 },
731
+ { x: 100, y: 100 }
732
+ ],
733
+ fill: K,
734
+ ...n
735
+ });
736
+ }
737
+ function wn(n = null) {
738
+ return a0({
739
+ objectType: H.RECTANGLE,
740
+ anchor: s0,
741
+ borderColor: K,
742
+ borderWidth: 0,
743
+ drawn: 1,
744
+ fill: K,
745
+ height: 100,
746
+ rounding: 0,
747
+ width: 100,
748
+ x: 0,
749
+ y: 0,
750
+ ...n
751
+ });
752
+ }
753
+ const f1 = {
754
+ NORMAL: "normal",
755
+ ITALIC: "italic",
756
+ OBLIQUE: "oblique"
757
+ }, g1 = f1.NORMAL, p1 = {
758
+ THIN: 100,
759
+ EXTRA_LIGHT: 200,
760
+ LIGHT: 300,
761
+ NORMAL: 400,
762
+ MEDIUM: 500,
763
+ SEMI_BOLD: 600,
764
+ BOLD: 700,
765
+ EXTRA_BOLD: 800,
766
+ BLACK: 900
767
+ }, d1 = p1.NORMAL, x1 = {
768
+ color: K,
769
+ fontFamily: "sans-serif",
770
+ fontSize: 100,
771
+ fontStyle: g1,
772
+ fontWeight: d1,
773
+ ligatures: !1
774
+ };
775
+ function It(n) {
776
+ return typeof n == "string" ? [[{ text: n }]] : n.map((e) => e.map((t) => typeof t == "string" ? { text: t } : t));
777
+ }
778
+ function y1(n) {
779
+ return It(n).reduce(
780
+ (t, o) => t + o.reduce((i, a) => i + a.text.length, 0),
781
+ 0
782
+ );
783
+ }
784
+ function v1(n = "", e = null) {
785
+ return a0({
786
+ objectType: H.TEXT,
787
+ alignment: Yt,
788
+ anchor: s0,
789
+ length: null,
790
+ lineSpacing: 1,
791
+ text: n,
792
+ x: 0,
793
+ y: 0,
794
+ ...x1,
795
+ ...e
796
+ });
797
+ }
798
+ v1.writeOn = (n, e = {}) => et(
799
+ n,
800
+ {
801
+ length: y1(n.text)
802
+ },
803
+ e
804
+ );
805
+ let W = null;
806
+ function w1({ presentation: n, onNavigateToSlide: e }) {
807
+ if (W !== null && !W.closed) {
808
+ W.focus();
809
+ return;
810
+ }
811
+ if (W = window.open("", "Navigator", "width=300,height=500,left=20,top=50"), W === null) {
812
+ console.error("Failed to open navigator window.");
813
+ return;
814
+ }
815
+ const t = A1(n, e);
816
+ W.document.title = n.title, W.document.body.appendChild(t), W.addEventListener("keyup", (o) => {
817
+ (o.key === "Escape" || o.key === "`") && (W == null || W.close(), W = null);
818
+ });
819
+ }
820
+ function A1(n, e) {
821
+ const t = document.createElement("div");
822
+ return t.style.fontFamily = "Arial, sans-serif", n.slides.forEach((o, i) => {
823
+ const a = m1(o, i);
824
+ a.style.cursor = "pointer", a.addEventListener("click", (s) => {
825
+ s.shiftKey && (W == null || W.close()), e(i);
826
+ }), t.appendChild(a);
827
+ }), t;
828
+ }
829
+ function m1(n, e) {
830
+ const t = document.createElement("div");
831
+ return t.style.marginBottom = "8px", t.style.padding = "8px", t.style.backgroundColor = "#eceed7", t.style.borderRadius = "4px", t.style.userSelect = "none", t.innerHTML = `${e + 1}: ` + (n.title.length > 0 ? n.title : `Slide ${e + 1}`), t;
832
+ }
833
+ function d0(n = null) {
834
+ return {
835
+ height: 0,
836
+ width: 0,
837
+ ...n
838
+ };
839
+ }
840
+ const b1 = d0({ width: 0, height: 0 });
841
+ function M1(n = null) {
842
+ return {
843
+ backgroundColor: X.WHITE,
844
+ slides: [],
845
+ title: "Presentation",
846
+ size: d0({ width: 3840, height: 2160 }),
847
+ resources: {
848
+ images: {}
849
+ },
850
+ ...n
851
+ };
852
+ }
853
+ function L1(n) {
854
+ const e = Array.isArray(n) ? n : [n];
855
+ let t = 0, o = 0;
856
+ for (const i of e)
857
+ switch (i.type) {
858
+ case l0.PAUSE:
859
+ t += i.duration;
860
+ break;
861
+ case l0.ANIMATE:
862
+ o = Math.max(o, t + i.delay + i.duration), i.block && (t += i.delay + i.duration);
863
+ break;
864
+ case l0.UPDATE:
865
+ break;
866
+ default:
867
+ c0(i);
868
+ }
869
+ return o;
870
+ }
871
+ function nt(n, e = null) {
872
+ const { red: t, green: o, blue: i } = n, a = Et(n, e);
873
+ return `rgba(${t}, ${o}, ${i}, ${a})`;
874
+ }
875
+ function T1(n) {
876
+ return n === document.body;
877
+ }
878
+ function P1(n, e) {
879
+ const t = document.createElement("div");
880
+ if (t.style.width = "100%", t.style.aspectRatio = `${n.size.width} / ${n.size.height}`, t.style.position = "relative", t.style.top = "50%", t.style.transform = "translateY(-50%)", t.style.marginLeft = "auto", t.style.marginRight = "auto", T1(e)) {
881
+ 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";
882
+ const o = n.size.height / n.size.width;
883
+ ct(t, o), window.matchMedia(`(min-aspect-ratio: ${n.size.width} / ${n.size.height})`).addEventListener("change", () => ct(t, o));
884
+ }
885
+ return t;
886
+ }
887
+ function ct(n, e) {
888
+ window.innerHeight / window.innerWidth > e ? (n.style.width = "100%", n.style.height = "auto") : (n.style.width = "auto", n.style.height = "100%");
889
+ }
890
+ const C1 = {
891
+ check: (n) => typeof n == "object" && n !== null && typeof n.red == "number" && typeof n.green == "number" && typeof n.blue == "number" && typeof n.alpha == "number",
892
+ interpolate: (n, e, t) => ({
893
+ red: Math.round(n.red + (e.red - n.red) * t),
894
+ green: Math.round(n.green + (e.green - n.green) * t),
895
+ blue: Math.round(n.blue + (e.blue - n.blue) * t),
896
+ alpha: n.alpha + (e.alpha - n.alpha) * t
897
+ })
898
+ }, E1 = {
899
+ check: (n) => !0,
900
+ interpolate: (n, e) => e
901
+ }, S1 = {
902
+ check: (n) => typeof n == "number",
903
+ interpolate: (n, e, t) => n + (e - n) * t
904
+ }, ut = [
905
+ S1,
906
+ C1,
907
+ E1
908
+ ];
909
+ function _1(n, e, t, o = null) {
910
+ if (t === 0)
911
+ return n;
912
+ if (t === 1)
913
+ return { ...n, ...e };
914
+ const i = o != null ? [...o, ...ut] : ut, a = {};
915
+ for (const s in e) {
916
+ const r = n[s], h = e[s];
917
+ for (const c of i)
918
+ if (c.check(r, s) && c.check(h, s)) {
919
+ a[s] = c.interpolate(
920
+ r,
921
+ h,
922
+ t
923
+ );
924
+ break;
925
+ }
926
+ }
927
+ return { ...n, ...a };
928
+ }
929
+ function ft(n, e, t = null) {
930
+ if (e === null)
931
+ return;
932
+ const o = Array.isArray(e) ? e : [e];
933
+ let i = 0;
934
+ for (const a of o) {
935
+ if (t !== null && i > t)
936
+ break;
937
+ switch (a.type) {
938
+ case l0.ANIMATE: {
939
+ const s = n.get(a.object);
940
+ if (s === void 0)
941
+ break;
942
+ const r = t !== null ? t - i : null, h = Math.max(
943
+ Math.min(
944
+ r !== null ? (r - a.delay) / a.duration : 1,
945
+ 1
946
+ ),
947
+ 0
948
+ );
949
+ n.set(a.object, {
950
+ ...s,
951
+ ..._1(
952
+ s,
953
+ a.props,
954
+ a.easing(h),
955
+ a.interpolators
956
+ )
957
+ }), a.block && (i += a.delay + a.duration);
958
+ break;
959
+ }
960
+ case l0.UPDATE: {
961
+ const s = n.get(a.object);
962
+ if (s === void 0)
963
+ break;
964
+ n.set(a.object, {
965
+ ...s,
966
+ ...a.props
967
+ });
968
+ break;
969
+ }
970
+ case l0.PAUSE:
971
+ i += a.duration;
972
+ break;
973
+ default:
974
+ c0(a);
975
+ }
976
+ }
977
+ }
978
+ function I1(n) {
979
+ return "objects" in n ? n.objects.filter((e) => "objectType" in e) : [];
980
+ }
981
+ function O1({
982
+ slide: n,
983
+ buildIndex: e,
984
+ buildTime: t
985
+ }) {
986
+ const o = /* @__PURE__ */ new Map();
987
+ function i(s) {
988
+ o.set(s, s);
989
+ for (const r of I1(s))
990
+ i(r);
991
+ }
992
+ for (const s of n.objects)
993
+ i(s);
994
+ const a = t === null ? e : e - 1;
995
+ for (let s = 0; s < a; s++) {
996
+ const r = n.animations[s] ?? null;
997
+ ft(o, r);
998
+ }
999
+ if (t !== null && e > 0) {
1000
+ const s = n.animations[e - 1] ?? null;
1001
+ ft(o, s, t);
1002
+ }
1003
+ return o;
1004
+ }
1005
+ function k1(n) {
1006
+ var o;
1007
+ const { slides: e } = n, t = {
1008
+ // First build of first slide
1009
+ s: { slideIndex: 0, buildIndex: 0 },
1010
+ // First build of current slide
1011
+ c: { slideIndex: null, buildIndex: 0 },
1012
+ // Last build of last slide
1013
+ e: {
1014
+ slideIndex: e.length - 1,
1015
+ buildIndex: ((o = e[e.length - 1]) == null ? void 0 : o.animations.length) ?? 0
1016
+ }
1017
+ };
1018
+ for (let i = 0; i < e.length; i++) {
1019
+ const a = e[i];
1020
+ if (a === void 0)
1021
+ continue;
1022
+ const s = a.shortcut;
1023
+ R0(t, s, i, 0);
1024
+ for (let r = 0; r < a.animations.length; r++) {
1025
+ const h = a.animations[r];
1026
+ if (h !== void 0)
1027
+ if (Array.isArray(h))
1028
+ for (const c of h)
1029
+ R0(t, c.shortcut, i, r + 1);
1030
+ else
1031
+ R0(t, h.shortcut, i, r + 1);
1032
+ }
1033
+ }
1034
+ return t;
1035
+ }
1036
+ function R0(n, e, t, o) {
1037
+ if (e !== null)
1038
+ if (Array.isArray(e))
1039
+ for (const i of e)
1040
+ n[i] = { slideIndex: t, buildIndex: o };
1041
+ else
1042
+ n[e] = { slideIndex: t, buildIndex: o };
1043
+ }
1044
+ function F1(n, e, t, { onNext: o, onPrevious: i, onRenderSlide: a, onShowNavigator: s }) {
1045
+ t.shortcuts = k1(n), e.addEventListener("mousemove", () => {
1046
+ e.style.cursor = "auto";
1047
+ }), e.addEventListener("keyup", (r) => {
1048
+ if (r.code === "Escape") {
1049
+ t.textCommand = null;
1050
+ return;
1051
+ }
1052
+ if (r.code === "ArrowRight" || r.code === "Space") {
1053
+ o(r.shiftKey);
1054
+ return;
1055
+ }
1056
+ if (r.code === "ArrowLeft") {
1057
+ i(r.shiftKey);
1058
+ return;
1059
+ }
1060
+ if (t.textCommand !== null) {
1061
+ if (r.code === "Enter") {
1062
+ const h = t.textCommand;
1063
+ t.textCommand = null;
1064
+ const c = t.shortcuts[h];
1065
+ c !== void 0 ? a(c.slideIndex, c.buildIndex) : isNaN(Number(h)) || a(Number(h) - 1, 0);
1066
+ return;
1067
+ } else r.code === "Backspace" ? t.textCommand = t.textCommand.slice(0, -1) : t.textCommand += r.key;
1068
+ return;
1069
+ }
1070
+ if (r.key === "g") {
1071
+ t.textCommand = "";
1072
+ return;
1073
+ }
1074
+ if (r.key === "`") {
1075
+ s();
1076
+ return;
1077
+ }
1078
+ });
1079
+ }
1080
+ const f0 = "presenterState";
1081
+ function R1(n, e) {
1082
+ const t = localStorage.getItem(f0);
1083
+ if (t === null)
1084
+ return null;
1085
+ if (e === null)
1086
+ return localStorage.removeItem(f0), null;
1087
+ let o;
1088
+ try {
1089
+ o = JSON.parse(t);
1090
+ } catch (c) {
1091
+ return console.error("Failed to parse presentation state from localStorage:", c), localStorage.removeItem(f0), null;
1092
+ }
1093
+ const { title: i, timestamp: a } = o;
1094
+ let { slideIndex: s, buildIndex: r } = o;
1095
+ if (typeof i != "string" || typeof s != "number" || typeof r != "number" || typeof a != "number" || i !== n.title || Date.now() - a > 1e3 * 60 * e)
1096
+ return localStorage.removeItem(f0), null;
1097
+ s > n.slides.length - 1 && (s = n.slides.length - 1, r = 0);
1098
+ const h = n.slides[s];
1099
+ return h === void 0 ? (localStorage.removeItem(f0), null) : (r > h.animations.length && (r = h.animations.length), {
1100
+ title: i,
1101
+ slideIndex: s,
1102
+ buildIndex: r
1103
+ });
1104
+ }
1105
+ function q1({ title: n, slideIndex: e, buildIndex: t }) {
1106
+ localStorage.setItem(
1107
+ f0,
1108
+ JSON.stringify({ title: n, slideIndex: e, buildIndex: t, timestamp: Date.now() })
1109
+ );
1110
+ }
1111
+ const gt = Object.freeze({
1112
+ canvas: null,
1113
+ extrasContainer: null,
1114
+ mountedExtrasCleanups: [],
1115
+ mountedExtrasSlideIndex: null,
1116
+ slideIndex: 0,
1117
+ buildIndex: 0,
1118
+ currentAnimationId: null,
1119
+ imageById: {},
1120
+ shortcutState: {
1121
+ textCommand: null,
1122
+ shortcuts: {}
1123
+ }
1124
+ }), o0 = {
1125
+ Browser: "browser",
1126
+ Node: "node"
1127
+ };
1128
+ function N1(n, e) {
1129
+ e.context.clearRect(0, 0, n.width, n.height);
1130
+ }
1131
+ function D1(n) {
1132
+ const e = document.createElement("canvas");
1133
+ return e.setAttribute("width", n.width.toString()), e.setAttribute("height", n.height.toString()), e.style.position = "absolute", e.style.width = "100%", e;
1134
+ }
1135
+ const x0 = {
1136
+ Browser: "browser",
1137
+ Node: "node"
1138
+ };
1139
+ function B1(n) {
1140
+ const e = new Path2D(n);
1141
+ return {
1142
+ type: x0.Browser,
1143
+ path: e
1144
+ };
1145
+ }
1146
+ function j1(n) {
1147
+ const { drawn: e, startX: t, startY: o, endX: i, endY: a, arrowheadSize: s, isArrowheadFilled: r, isDrawnFromCenter: h } = n, c = { x: t, y: o }, f = { x: i, y: a }, x = Math.atan2(f.y - c.y, f.x - c.x), l = { x: c.x + (f.x - c.x) / 2, y: c.y + (f.y - c.y) / 2 }, u = f.x - c.x, A = f.y - c.y, M = Math.hypot(u, A) * e, C = Math.cos(x), E = Math.sin(x), L = h ? { x: l.x - C * M / 2, y: l.y - E * M / 2 } : c, S = h ? { x: l.x + C * M / 2, y: l.y + E * M / 2 } : { x: c.x + C * M, y: c.y + E * M }, P = r ? Math.PI / 6 : Math.PI / 4.5, F = M < s * 2 ? M / 2 : s, z = {
1148
+ x: S.x - F * Math.cos(x - P),
1149
+ y: S.y - F * Math.sin(x - P)
1150
+ }, Z = {
1151
+ x: S.x - F * Math.cos(x + P),
1152
+ y: S.y - F * Math.sin(x + P)
1153
+ }, j = {
1154
+ x: L.x + F * Math.cos(x - P),
1155
+ y: L.y + F * Math.sin(x - P)
1156
+ }, $ = {
1157
+ x: L.x + F * Math.cos(x + P),
1158
+ y: L.y + F * Math.sin(x + P)
1159
+ };
1160
+ return {
1161
+ arrowPoints: [L, S],
1162
+ arrowheadPoints: [z, S, Z],
1163
+ doubledArrowheadPoints: [j, L, $]
1164
+ };
1165
+ }
1166
+ function p0({
1167
+ ctx: n,
1168
+ color: e,
1169
+ drawn: t = null,
1170
+ isDrawnFromCenter: o = !1,
1171
+ isRounded: i = !1,
1172
+ opacity: a = null,
1173
+ path: s,
1174
+ pathLength: r = null,
1175
+ width: h
1176
+ }) {
1177
+ if (!(h === 0 || t === 0)) {
1178
+ if (t !== null && r !== null && t !== 1) {
1179
+ const c = r + (i ? h : 0), f = r * t;
1180
+ o ? n.context.setLineDash([
1181
+ 0,
1182
+ (c - f) / 2,
1183
+ f,
1184
+ (c - f) / 2
1185
+ ]) : n.context.setLineDash([f, c - f]);
1186
+ } else
1187
+ n.context.setLineDash([]);
1188
+ if (n.context.lineWidth = h, n.context.strokeStyle = E0(e, a), n.context.lineCap = i ? "round" : "butt", s === void 0) {
1189
+ n.context.stroke();
1190
+ return;
1191
+ }
1192
+ switch (n.type) {
1193
+ case o0.Browser:
1194
+ s.type === x0.Browser ? n.context.stroke(s.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1195
+ break;
1196
+ case o0.Node:
1197
+ s.type === x0.Node ? n.context.stroke(s.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1198
+ break;
1199
+ default:
1200
+ c0(n);
1201
+ }
1202
+ }
1203
+ }
1204
+ function M0({ ctx: n, path: e, color: t, opacity: o = null }) {
1205
+ if (n.context.fillStyle = nt(t, o), e === void 0) {
1206
+ n.context.fill();
1207
+ return;
1208
+ }
1209
+ switch (n.type) {
1210
+ case o0.Browser:
1211
+ e.type === x0.Browser ? n.context.fill(e.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1212
+ break;
1213
+ case o0.Node:
1214
+ e.type === x0.Node ? n.context.fill(e.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1215
+ break;
1216
+ default:
1217
+ c0(n);
1218
+ }
1219
+ }
1220
+ function q0(n, e) {
1221
+ const t = e(), o = n[0];
1222
+ if (o === void 0)
1223
+ return { path: t, length: 0 };
1224
+ t.path.moveTo(o.x, o.y);
1225
+ let i = 0;
1226
+ for (let a = 1; a < n.length; a++) {
1227
+ const s = n[a], r = n[a - 1];
1228
+ if (s === void 0 || r === void 0)
1229
+ continue;
1230
+ const h = s.x - r.x, c = s.y - r.y;
1231
+ i += Math.hypot(h, c), t.path.lineTo(s.x, s.y);
1232
+ }
1233
+ return { path: t, length: i };
1234
+ }
1235
+ const U1 = ({
1236
+ ctx: n,
1237
+ object: e,
1238
+ opacity: t,
1239
+ createPath2D: o
1240
+ }) => {
1241
+ const i = e.opacity * t;
1242
+ if (i === 0 || e.drawn === 0)
1243
+ return;
1244
+ const { arrowPoints: a, arrowheadPoints: s, doubledArrowheadPoints: r } = j1(e), { path: h } = q0(a, o), { path: c } = q0(s, o);
1245
+ if (p0({
1246
+ color: e.color,
1247
+ ctx: n,
1248
+ path: h,
1249
+ opacity: i,
1250
+ width: e.width
1251
+ }), e.isArrowheadFilled && (c.path.closePath(), M0({
1252
+ ctx: n,
1253
+ path: c,
1254
+ color: e.color,
1255
+ opacity: i
1256
+ })), p0({
1257
+ color: e.color,
1258
+ ctx: n,
1259
+ path: c,
1260
+ opacity: i,
1261
+ width: e.width
1262
+ }), e.isArrowheadDoubled) {
1263
+ const { path: f } = q0(
1264
+ r,
1265
+ o
1266
+ );
1267
+ e.isArrowheadFilled && (f.path.closePath(), M0({
1268
+ ctx: n,
1269
+ path: f,
1270
+ color: e.color,
1271
+ opacity: i
1272
+ })), p0({
1273
+ color: e.color,
1274
+ ctx: n,
1275
+ path: f,
1276
+ opacity: i,
1277
+ width: e.width
1278
+ });
1279
+ }
1280
+ };
1281
+ function z1(n, e) {
1282
+ const t = e(), o = -Math.PI / 2;
1283
+ t.path.arc(n.x, n.y, n.radius, o, o + 2 * Math.PI);
1284
+ const i = 2 * Math.PI * n.radius;
1285
+ return { path: t, length: i };
1286
+ }
1287
+ const H1 = ({
1288
+ ctx: n,
1289
+ object: e,
1290
+ opacity: t,
1291
+ createPath2D: o
1292
+ }) => {
1293
+ const i = e.opacity * t;
1294
+ if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
1295
+ return;
1296
+ const { path: a, length: s } = z1(e, o);
1297
+ M0({
1298
+ ctx: n,
1299
+ path: a,
1300
+ color: e.fill,
1301
+ opacity: i
1302
+ }), p0({
1303
+ color: e.borderColor,
1304
+ ctx: n,
1305
+ drawn: e.drawn,
1306
+ path: a,
1307
+ pathLength: s,
1308
+ opacity: i,
1309
+ width: e.borderWidth
1310
+ });
1311
+ };
1312
+ function Y(n = null) {
1313
+ return {
1314
+ x: 0,
1315
+ y: 0,
1316
+ ...n
1317
+ };
1318
+ }
1319
+ const $1 = Y();
1320
+ function i0(n = null) {
1321
+ return {
1322
+ origin: $1,
1323
+ size: b1,
1324
+ ...n
1325
+ };
1326
+ }
1327
+ i0();
1328
+ function y0(n, e, t) {
1329
+ const { x: o, y: i } = n, { width: a, height: s } = t;
1330
+ switch (e) {
1331
+ case e0.TOP_LEFT:
1332
+ return i0({
1333
+ origin: Y({ x: o, y: i }),
1334
+ size: t
1335
+ });
1336
+ case e0.TOP:
1337
+ return i0({
1338
+ origin: Y({ x: o - a / 2, y: i }),
1339
+ size: t
1340
+ });
1341
+ case e0.TOP_RIGHT:
1342
+ return i0({
1343
+ origin: Y({ x: o - a, y: i }),
1344
+ size: t
1345
+ });
1346
+ case e0.LEFT:
1347
+ return i0({
1348
+ origin: Y({ x: o, y: i - s / 2 }),
1349
+ size: t
1350
+ });
1351
+ case e0.CENTER:
1352
+ return i0({
1353
+ origin: Y({ x: o - a / 2, y: i - s / 2 }),
1354
+ size: t
1355
+ });
1356
+ case e0.RIGHT:
1357
+ return i0({
1358
+ origin: Y({ x: o - a, y: i - s / 2 }),
1359
+ size: t
1360
+ });
1361
+ case e0.BOTTOM_LEFT:
1362
+ return i0({
1363
+ origin: Y({ x: o, y: i - s }),
1364
+ size: t
1365
+ });
1366
+ case e0.BOTTOM:
1367
+ return i0({
1368
+ origin: Y({ x: o - a / 2, y: i - s }),
1369
+ size: t
1370
+ });
1371
+ case e0.BOTTOM_RIGHT:
1372
+ return i0({
1373
+ origin: Y({ x: o - a, y: i - s }),
1374
+ size: t
1375
+ });
1376
+ default:
1377
+ c0(e);
1378
+ }
1379
+ }
1380
+ const Y1 = ({
1381
+ ctx: n,
1382
+ object: e,
1383
+ renderObject: t,
1384
+ opacity: o
1385
+ }) => {
1386
+ const i = y0(
1387
+ Y({ x: e.x, y: e.y }),
1388
+ e.anchor,
1389
+ d0({
1390
+ width: e.width * e.scale,
1391
+ height: e.height * e.scale
1392
+ })
1393
+ ), { rotation: a, rotateOriginX: s, rotateOriginY: r } = e;
1394
+ if (e.scale !== 0) {
1395
+ n.context.translate(i.origin.x, i.origin.y), n.context.scale(e.scale, e.scale), n.context.translate(s, r), n.context.rotate(a * Math.PI / 180), n.context.translate(-s, -r);
1396
+ for (const h of e.objects)
1397
+ t(h, o * e.opacity);
1398
+ e.previewColor !== null && (n.context.fillStyle = E0(e.previewColor), n.context.fillRect(0, 0, e.width, e.height)), n.context.translate(s, r), n.context.rotate(-a * Math.PI / 180), n.context.translate(-s, -r), e.rotateOriginPreviewSize > 0 && (n.context.fillStyle = "red", n.context.beginPath(), n.context.arc(s, r, e.rotateOriginPreviewSize, 0, 2 * Math.PI), n.context.fill()), n.context.scale(1 / e.scale, 1 / e.scale), n.context.translate(-i.origin.x, -i.origin.y);
1399
+ }
1400
+ };
1401
+ function Ot(n, e, t, o, i = 0) {
1402
+ const a = o();
1403
+ a.path.moveTo(n.x + t, n.y), a.path.lineTo(n.x + e.width - t, n.y), a.path.arcTo(
1404
+ n.x + e.width,
1405
+ n.y,
1406
+ n.x + e.width,
1407
+ n.y + t,
1408
+ t
1409
+ ), a.path.lineTo(n.x + e.width, n.y + e.height - t), a.path.arcTo(
1410
+ n.x + e.width,
1411
+ n.y + e.height,
1412
+ n.x + e.width - t,
1413
+ n.y + e.height,
1414
+ t
1415
+ ), a.path.lineTo(n.x + t, n.y + e.height), a.path.arcTo(
1416
+ n.x,
1417
+ n.y + e.height,
1418
+ n.x,
1419
+ n.y + e.height - t,
1420
+ t
1421
+ ), a.path.lineTo(n.x, n.y + t), a.path.arcTo(n.x, n.y, n.x + t, n.y, t), i > 0 && a.path.lineTo(n.x + t + i, n.y);
1422
+ const s = 2 * (e.width + e.height - 4 * t) + 2 * Math.PI * t + i;
1423
+ return { path: a, length: s };
1424
+ }
1425
+ const Z0 = {
1426
+ Browser: "browser",
1427
+ Node: "node"
1428
+ }, X1 = ({
1429
+ ctx: n,
1430
+ imageById: e,
1431
+ object: t,
1432
+ opacity: o,
1433
+ createPath2D: i
1434
+ }) => {
1435
+ const a = y0(
1436
+ Y({ x: t.x, y: t.y }),
1437
+ t.anchor,
1438
+ d0({ width: t.width, height: t.height })
1439
+ ), s = e[t.imageId];
1440
+ if (s !== void 0) {
1441
+ if (n.context.save(), t.rounding > 0) {
1442
+ const r = Ot(
1443
+ a.origin,
1444
+ a.size,
1445
+ t.rounding,
1446
+ i
1447
+ );
1448
+ switch (n.type) {
1449
+ case o0.Browser:
1450
+ r.path.type === x0.Browser ? n.context.clip(r.path.path) : console.warn("Attempted to use Node Path2D in Browser Canvas context");
1451
+ break;
1452
+ case o0.Node:
1453
+ r.path.type === x0.Node ? n.context.clip(r.path.path) : console.warn("Attempted to use Browser Path2D in Node Canvas context");
1454
+ break;
1455
+ default:
1456
+ c0(n);
1457
+ }
1458
+ }
1459
+ switch (n.context.globalAlpha = o * t.opacity, n.context.imageSmoothingEnabled = t.smooth, n.type) {
1460
+ case o0.Browser:
1461
+ s.type === Z0.Browser ? n.context.drawImage(
1462
+ s.image,
1463
+ a.origin.x,
1464
+ a.origin.y,
1465
+ a.size.width,
1466
+ a.size.height
1467
+ ) : console.warn("Attempted to use Node Image in Browser Canvas context");
1468
+ break;
1469
+ case o0.Node:
1470
+ s.type === Z0.Node ? n.context.drawImage(
1471
+ s.image,
1472
+ a.origin.x,
1473
+ a.origin.y,
1474
+ a.size.width,
1475
+ a.size.height
1476
+ ) : console.warn("Attempted to use Browser Image in Node Canvas context");
1477
+ break;
1478
+ default:
1479
+ c0(n);
1480
+ }
1481
+ n.context.restore();
1482
+ }
1483
+ };
1484
+ function G1(n, e) {
1485
+ const t = e();
1486
+ t.path.moveTo(n.startX, n.startY), t.path.lineTo(n.endX, n.endY);
1487
+ const o = Math.hypot(n.endX - n.startX, n.endY - n.startY);
1488
+ return { path: t, length: o };
1489
+ }
1490
+ const Z1 = ({
1491
+ ctx: n,
1492
+ object: e,
1493
+ opacity: t,
1494
+ createPath2D: o
1495
+ }) => {
1496
+ const i = e.opacity * t;
1497
+ if (i === 0 || e.drawn === 0)
1498
+ return;
1499
+ const { path: a, length: s } = G1(e, o);
1500
+ p0({
1501
+ color: e.color,
1502
+ ctx: n,
1503
+ drawn: e.drawn,
1504
+ isDrawnFromCenter: e.isDrawnFromCenter,
1505
+ isRounded: e.isRounded,
1506
+ path: a,
1507
+ pathLength: s,
1508
+ opacity: i,
1509
+ width: e.width
1510
+ });
1511
+ }, W1 = ({
1512
+ ctx: n,
1513
+ object: e,
1514
+ opacity: t,
1515
+ renderObject: o
1516
+ }) => {
1517
+ n.context.save();
1518
+ const i = y0(
1519
+ Y({ x: e.x, y: e.y }),
1520
+ e.anchor,
1521
+ d0({ width: e.width, height: e.height })
1522
+ );
1523
+ e.preview && (n.context.lineWidth = 4, n.context.strokeStyle = E0(X.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();
1524
+ for (const a of e.objects)
1525
+ o(a, t * e.opacity);
1526
+ n.context.restore();
1527
+ }, K1 = ({
1528
+ ctx: n,
1529
+ object: e,
1530
+ opacity: t,
1531
+ createPath2D: o
1532
+ }) => {
1533
+ const i = e.opacity * t;
1534
+ if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
1535
+ return;
1536
+ const { origin: a } = y0(
1537
+ Y({ x: e.x, y: e.y }),
1538
+ e.anchor,
1539
+ d0({ width: e.width, height: e.height })
1540
+ ), s = o(e.path);
1541
+ n.context.save(), n.context.translate(a.x, a.y), n.context.scale(e.width / e.viewboxWidth, e.height / e.viewboxHeight), M0({
1542
+ ctx: n,
1543
+ path: s,
1544
+ color: e.fill,
1545
+ opacity: i
1546
+ }), p0({
1547
+ color: e.color,
1548
+ ctx: n,
1549
+ drawn: e.drawn,
1550
+ isRounded: e.isRounded,
1551
+ path: s,
1552
+ pathLength: e.pathLength,
1553
+ opacity: i,
1554
+ width: e.strokeWidth
1555
+ }), n.context.restore();
1556
+ };
1557
+ function V1(n, e) {
1558
+ const t = e(), o = n.points, i = o[0];
1559
+ if (i === void 0)
1560
+ return { path: t, length: 0 };
1561
+ t.path.moveTo(i.x, i.y);
1562
+ let a = 0, s = i;
1563
+ for (let h = 1; h < o.length; h++) {
1564
+ const c = o[h];
1565
+ if (c === void 0)
1566
+ continue;
1567
+ t.path.lineTo(c.x, c.y);
1568
+ const f = Math.hypot(c.x - s.x, c.y - s.y);
1569
+ a += f, s = c;
1570
+ }
1571
+ t.path.closePath();
1572
+ const r = Math.hypot(
1573
+ i.x - s.x,
1574
+ i.y - s.y
1575
+ );
1576
+ return a += r, { path: t, length: a };
1577
+ }
1578
+ const Q1 = ({
1579
+ ctx: n,
1580
+ object: e,
1581
+ opacity: t,
1582
+ createPath2D: o
1583
+ }) => {
1584
+ const i = e.opacity * t;
1585
+ if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
1586
+ return;
1587
+ const { path: a, length: s } = V1(e, o);
1588
+ M0({
1589
+ ctx: n,
1590
+ path: a,
1591
+ color: e.fill,
1592
+ opacity: i
1593
+ }), p0({
1594
+ color: e.borderColor,
1595
+ ctx: n,
1596
+ drawn: e.drawn,
1597
+ path: a,
1598
+ pathLength: s,
1599
+ opacity: i,
1600
+ width: e.borderWidth
1601
+ });
1602
+ };
1603
+ function J1(n, e) {
1604
+ const { origin: t, size: o } = y0(
1605
+ Y({ x: n.x, y: n.y }),
1606
+ n.anchor,
1607
+ d0({ width: n.width, height: n.height })
1608
+ ), i = Math.max(0, Math.min(n.rounding, Math.min(o.width, o.height) / 2)), a = Math.min(n.borderWidth * 2, o.width - i);
1609
+ if (i > 0)
1610
+ return Ot(t, o, i, e, a);
1611
+ {
1612
+ const s = e();
1613
+ 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);
1614
+ const r = 2 * (o.width + o.height) + a;
1615
+ return { path: s, length: r };
1616
+ }
1617
+ }
1618
+ const te = ({
1619
+ ctx: n,
1620
+ object: e,
1621
+ opacity: t,
1622
+ createPath2D: o
1623
+ }) => {
1624
+ const i = e.opacity * t;
1625
+ if (i === 0 || e.drawn === 0 && e.fill.alpha === 0)
1626
+ return;
1627
+ const { path: a, length: s } = J1(e, o);
1628
+ M0({
1629
+ ctx: n,
1630
+ path: a,
1631
+ color: e.fill,
1632
+ opacity: i
1633
+ }), p0({
1634
+ color: e.borderColor,
1635
+ ctx: n,
1636
+ drawn: e.drawn,
1637
+ path: a,
1638
+ pathLength: s,
1639
+ opacity: i,
1640
+ width: e.borderWidth
1641
+ });
1642
+ };
1643
+ function ee(n) {
1644
+ return {
1645
+ color: n.color,
1646
+ fontFamily: n.fontFamily,
1647
+ fontSize: n.fontSize,
1648
+ fontStyle: n.fontStyle,
1649
+ fontWeight: n.fontWeight,
1650
+ ligatures: n.ligatures
1651
+ };
1652
+ }
1653
+ function ne(n, e = 1) {
1654
+ const t = Math.max(...n.map((a) => a.reduce((s, r) => s + r.width, 0)));
1655
+ let o = 0, i = 0;
1656
+ for (let a = 0; a < n.length; a++) {
1657
+ const s = n[a];
1658
+ if (s === void 0)
1659
+ continue;
1660
+ const r = Math.max(...s.map((h) => h.height));
1661
+ o += r + i * (e - 1), i = r;
1662
+ }
1663
+ return {
1664
+ height: o,
1665
+ width: t
1666
+ };
1667
+ }
1668
+ function re(n) {
1669
+ return {
1670
+ width: n.width,
1671
+ height: n.fontBoundingBoxAscent
1672
+ };
1673
+ }
1674
+ function kt(n, e, t = 1) {
1675
+ n.context.fillStyle = nt(e.color, t), n.context.font = `${e.fontStyle} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.type === o0.Browser ? n.context.textRendering = e.ligatures ? "optimizeLegibility" : "optimizeSpeed" : n.context.fontVariant = e.ligatures ? "common-ligatures" : "no-common-ligatures";
1676
+ }
1677
+ function ie(n, e, t) {
1678
+ const o = [];
1679
+ for (const i of n) {
1680
+ const a = [];
1681
+ for (const s of i) {
1682
+ const { text: r, ...h } = s, c = { ...e, ...h };
1683
+ kt(t, c);
1684
+ const f = t.context.measureText(r);
1685
+ a.push(re(f));
1686
+ }
1687
+ o.push(a);
1688
+ }
1689
+ return o;
1690
+ }
1691
+ const oe = ({ ctx: n, object: e, opacity: t }) => {
1692
+ const o = e.opacity * t;
1693
+ if (o === 0)
1694
+ return;
1695
+ const { length: i } = e, a = It(e.text), s = ee(e), r = ie(a, s, n), h = ne(r, e.lineSpacing), c = y0(Y({ x: e.x, y: e.y }), e.anchor, h);
1696
+ let f = c.origin.x, x = c.origin.y, l = 0, u = 0;
1697
+ for (let A = 0; A < a.length; A++) {
1698
+ const y = a[A], M = r[A];
1699
+ if (y == null || M == null) {
1700
+ console.error("Could not determine text units or sizes for line");
1701
+ continue;
1702
+ }
1703
+ const C = M.reduce((L, S) => L + S.width, 0), E = M.length === 0 ? u : M.reduce((L, S) => Math.max(L, S.height), 0);
1704
+ switch (e.alignment) {
1705
+ case g0.LEFT:
1706
+ f = c.origin.x;
1707
+ break;
1708
+ case g0.CENTER:
1709
+ f = c.origin.x + (c.size.width - C) / 2;
1710
+ break;
1711
+ case g0.RIGHT:
1712
+ f = c.origin.x + (c.size.width - C);
1713
+ break;
1714
+ default:
1715
+ c0(e.alignment);
1716
+ break;
1717
+ }
1718
+ x += E + u * (e.lineSpacing - 1), u = E;
1719
+ for (let L = 0; L < y.length && !(i !== null && l >= i); L++) {
1720
+ const S = y[L], P = M[L];
1721
+ if (S == null || P == null) {
1722
+ console.error("Could not determine text unit or size for unit");
1723
+ continue;
1724
+ }
1725
+ const { text: F, ...z } = S;
1726
+ let Z;
1727
+ if (i !== null && l + F.length > i) {
1728
+ const n0 = i - l;
1729
+ Z = F.slice(0, n0);
1730
+ }
1731
+ const j = Z ?? F;
1732
+ l += j.length;
1733
+ const $ = { ...s, ...z };
1734
+ kt(n, $, o), n.context.fillText(j, f, x), f += P.width;
1735
+ }
1736
+ }
1737
+ }, se = {
1738
+ [H.ARROW]: U1,
1739
+ [H.CIRCLE]: H1,
1740
+ [H.GROUP]: Y1,
1741
+ [H.IMAGE]: X1,
1742
+ [H.LINE]: Z1,
1743
+ [H.MASK]: W1,
1744
+ [H.PATH]: K1,
1745
+ [H.POLYGON]: Q1,
1746
+ [H.RECTANGLE]: te,
1747
+ [H.SLIDE_OBJECT]: () => {
1748
+ },
1749
+ [H.TEXT]: oe
1750
+ };
1751
+ function ae(n) {
1752
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1753
+ return e.setAttribute("viewBox", `0 0 ${n.width} ${n.height}`), e.style.backgroundColor = "transparent", e.style.position = "absolute", e.style.width = "100%", e;
1754
+ }
1755
+ function he(n, e) {
1756
+ if (n === null)
1757
+ return null;
1758
+ const t = y0(
1759
+ Y({ x: e.x, y: e.y }),
1760
+ e.anchor,
1761
+ d0({ width: e.width, height: e.height })
1762
+ ), o = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
1763
+ o.setAttribute("x", t.origin.x.toString()), o.setAttribute("y", t.origin.y.toString()), o.setAttribute("width", e.width.toString()), o.setAttribute("height", e.height.toString());
1764
+ const i = e.content;
1765
+ i !== null && o.appendChild(i), n.appendChild(o);
1766
+ let a = null;
1767
+ if (e.setup !== null) {
1768
+ const s = e.setup(o);
1769
+ s !== void 0 && (a = s);
1770
+ }
1771
+ return () => {
1772
+ a !== null && a(), n.removeChild(o);
1773
+ };
1774
+ }
1775
+ async function le(n) {
1776
+ if (Object.keys(n).length === 0)
1777
+ return {};
1778
+ const e = {}, t = (i) => new Promise((a, s) => {
1779
+ const r = new Image();
1780
+ if (r.onload = () => a(r), r.onerror = (c) => s(c), i.includes("</svg>")) {
1781
+ const c = new Blob([i], { type: "image/svg+xml;charset=utf-8" }), f = URL.createObjectURL(c);
1782
+ r.src = f;
1783
+ } else
1784
+ r.src = i;
1785
+ }), o = Object.entries(n).map(async ([i, a]) => {
1786
+ const s = await t(a);
1787
+ e[i] = {
1788
+ type: Z0.Browser,
1789
+ image: s
1790
+ };
1791
+ });
1792
+ return await Promise.all(o), e;
1793
+ }
1794
+ class An {
1795
+ constructor(e) {
1796
+ const { objectRenderers: t, ...o } = e;
1797
+ this.props = {
1798
+ presentation: M1(),
1799
+ element: document.body,
1800
+ objectRenderers: {
1801
+ ...se,
1802
+ ...t
1803
+ },
1804
+ cacheDurationMinutes: 15,
1805
+ ...o
1806
+ }, this.state = { ...gt };
1807
+ }
1808
+ /** Starts the presentation. */
1809
+ async present() {
1810
+ const { presentation: e, element: t } = this.props, o = D1(e.size), i = ae(e.size);
1811
+ this.state = {
1812
+ ...gt,
1813
+ imageById: await le(e.resources.images),
1814
+ canvas: o,
1815
+ extrasContainer: i
1816
+ };
1817
+ const a = P1(e, t);
1818
+ F1(e, t, this.state.shortcutState, {
1819
+ onNext: (r) => this.next(r),
1820
+ onPrevious: (r) => this.previous(r),
1821
+ onRenderSlide: (r, h) => {
1822
+ this.state.shortcutState.shortcuts.b = {
1823
+ slideIndex: this.state.slideIndex,
1824
+ buildIndex: this.state.buildIndex
1825
+ }, this.renderSlide(r ?? this.state.slideIndex, h);
1826
+ },
1827
+ onShowNavigator: () => w1({
1828
+ presentation: e,
1829
+ onNavigateToSlide: (r) => this.renderSlide(r)
1830
+ })
1831
+ }), t.replaceChildren(), a.appendChild(o), a.appendChild(i), t.appendChild(a);
1832
+ const s = R1(e, this.props.cacheDurationMinutes);
1833
+ s !== null ? this.renderSlide(s.slideIndex, s.buildIndex) : this.renderSlide(0);
1834
+ }
1835
+ renderSlide(e, t = 0, o = null) {
1836
+ const { objectRenderers: i, presentation: a } = this.props, { canvas: s, imageById: r } = this.state, h = this.state.slideIndex !== e;
1837
+ this.state.slideIndex = e, this.state.buildIndex = t, o === null && q1({ title: a.title, slideIndex: e, buildIndex: t });
1838
+ const c = a.slides[e];
1839
+ if (c === void 0 || s === null)
1840
+ return;
1841
+ if (h || this.state.mountedExtrasCleanups.length === 0 && c.extras.length > 0) {
1842
+ for (const A of this.state.mountedExtrasCleanups)
1843
+ A();
1844
+ this.state.mountedExtrasCleanups = [];
1845
+ for (const A of c.extras) {
1846
+ const y = he(this.state.extrasContainer, A);
1847
+ y !== null && this.state.mountedExtrasCleanups.push(y);
1848
+ }
1849
+ }
1850
+ const f = s.getContext("2d");
1851
+ if (f === null)
1852
+ return;
1853
+ const x = {
1854
+ type: o0.Browser,
1855
+ context: f
1856
+ };
1857
+ N1(s, x);
1858
+ const l = O1({
1859
+ slide: c,
1860
+ buildIndex: t,
1861
+ buildTime: o
1862
+ });
1863
+ x.context.fillStyle = nt(a.backgroundColor), x.context.fillRect(0, 0, s.width, s.height);
1864
+ function u(A, y) {
1865
+ const M = i[A.objectType], C = l.get(A);
1866
+ M === void 0 || C === void 0 || M({
1867
+ ctx: x,
1868
+ imageById: r,
1869
+ object: C,
1870
+ opacity: y,
1871
+ renderObject: u,
1872
+ createPath2D: B1
1873
+ });
1874
+ }
1875
+ for (const A of c.objects)
1876
+ u(A, 1);
1877
+ }
1878
+ next(e = !1) {
1879
+ const { presentation: t } = this.props, { currentAnimationId: o, slideIndex: i, buildIndex: a } = this.state;
1880
+ this.props.element.style.cursor = "none", o !== null && cancelAnimationFrame(o);
1881
+ const s = t.slides[i];
1882
+ if (s === void 0)
1883
+ return;
1884
+ const r = s.animations[a];
1885
+ if (r !== void 0 && !e) {
1886
+ const h = performance.now(), c = L1(r), f = (x) => {
1887
+ const l = x - h;
1888
+ l < c ? (this.renderSlide(i, a + 1, l), this.state.currentAnimationId = requestAnimationFrame(f)) : this.renderSlide(i, a + 1, null);
1889
+ };
1890
+ this.state.currentAnimationId = requestAnimationFrame(f);
1891
+ } else i + 1 < t.slides.length && this.renderSlide(i + 1);
1892
+ }
1893
+ previous(e = !1) {
1894
+ const { currentAnimationId: t, slideIndex: o, buildIndex: i } = this.state;
1895
+ if (this.props.element.style.cursor = "none", t !== null && cancelAnimationFrame(t), i > 0)
1896
+ e ? this.renderSlide(o, 0) : this.renderSlide(o, i - 1);
1897
+ else if (o > 0) {
1898
+ const a = this.props.presentation.slides[o - 1], s = e ? 0 : (a == null ? void 0 : a.animations.length) ?? 0;
1899
+ this.renderSlide(o - 1, s);
1900
+ } else
1901
+ this.renderSlide(0, 0);
1902
+ }
1903
+ }
1904
+ function mn(n = 1e3) {
1905
+ return {
1906
+ type: l0.PAUSE,
1907
+ isKey: !1,
1908
+ duration: n,
1909
+ shortcut: null
1910
+ };
1911
+ }
1912
+ function bn(n = null) {
1913
+ return {
1914
+ objects: [],
1915
+ animations: [],
1916
+ extras: [],
1917
+ isAllKey: !1,
1918
+ isEndKey: !0,
1919
+ isStartKey: !1,
1920
+ shortcut: null,
1921
+ title: "",
1922
+ ...n
1923
+ };
1924
+ }
1925
+ function Mn(n, e = {}) {
1926
+ return {
1927
+ ...e,
1928
+ text: n
1929
+ };
1930
+ }
1931
+ function Ln(n = X.BLACK) {
1932
+ return { ...n, alpha: 1 };
1933
+ }
1934
+ function ce(n) {
1935
+ for (var e = -1, t = n.length, o, i = n[t - 1], a = 0; ++e < t; )
1936
+ o = i, i = n[e], a += o[1] * i[0] - o[0] * i[1];
1937
+ return a / 2;
1938
+ }
1939
+ function ue(n) {
1940
+ for (var e = -1, t = n.length, o = n[t - 1], i, a, s = o[0], r = o[1], h = 0; ++e < t; )
1941
+ i = s, a = r, o = n[e], s = o[0], r = o[1], i -= s, a -= r, h += Math.sqrt(i * i + a * a);
1942
+ return h;
1943
+ }
1944
+ function fe(n) {
1945
+ return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
1946
+ }
1947
+ var N0, pt;
1948
+ function ge() {
1949
+ if (pt) return N0;
1950
+ pt = 1;
1951
+ 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 = [
1952
+ 5760,
1953
+ 6158,
1954
+ 8192,
1955
+ 8193,
1956
+ 8194,
1957
+ 8195,
1958
+ 8196,
1959
+ 8197,
1960
+ 8198,
1961
+ 8199,
1962
+ 8200,
1963
+ 8201,
1964
+ 8202,
1965
+ 8239,
1966
+ 8287,
1967
+ 12288,
1968
+ 65279
1969
+ ];
1970
+ function t(u) {
1971
+ return u === 10 || u === 13 || u === 8232 || u === 8233 || // Line terminators
1972
+ // White spaces
1973
+ u === 32 || u === 9 || u === 11 || u === 12 || u === 160 || u >= 5760 && e.indexOf(u) >= 0;
1974
+ }
1975
+ function o(u) {
1976
+ switch (u | 32) {
1977
+ case 109:
1978
+ case 122:
1979
+ case 108:
1980
+ case 104:
1981
+ case 118:
1982
+ case 99:
1983
+ case 115:
1984
+ case 113:
1985
+ case 116:
1986
+ case 97:
1987
+ case 114:
1988
+ return !0;
1989
+ }
1990
+ return !1;
1991
+ }
1992
+ function i(u) {
1993
+ return (u | 32) === 97;
1994
+ }
1995
+ function a(u) {
1996
+ return u >= 48 && u <= 57;
1997
+ }
1998
+ function s(u) {
1999
+ return u >= 48 && u <= 57 || /* 0..9 */
2000
+ u === 43 || /* + */
2001
+ u === 45 || /* - */
2002
+ u === 46;
2003
+ }
2004
+ function r(u) {
2005
+ this.index = 0, this.path = u, this.max = u.length, this.result = [], this.param = 0, this.err = "", this.segmentStart = 0, this.data = [];
2006
+ }
2007
+ function h(u) {
2008
+ for (; u.index < u.max && t(u.path.charCodeAt(u.index)); )
2009
+ u.index++;
2010
+ }
2011
+ function c(u) {
2012
+ var A = u.path.charCodeAt(u.index);
2013
+ if (A === 48) {
2014
+ u.param = 0, u.index++;
2015
+ return;
2016
+ }
2017
+ if (A === 49) {
2018
+ u.param = 1, u.index++;
2019
+ return;
2020
+ }
2021
+ u.err = "SvgPath: arc flag can be 0 or 1 only (at pos " + u.index + ")";
2022
+ }
2023
+ function f(u) {
2024
+ var A = u.index, y = A, M = u.max, C = !1, E = !1, L = !1, S = !1, P;
2025
+ if (y >= M) {
2026
+ u.err = "SvgPath: missed param (at pos " + y + ")";
2027
+ return;
2028
+ }
2029
+ if (P = u.path.charCodeAt(y), (P === 43 || P === 45) && (y++, P = y < M ? u.path.charCodeAt(y) : 0), !a(P) && P !== 46) {
2030
+ u.err = "SvgPath: param should start with 0..9 or `.` (at pos " + y + ")";
2031
+ return;
2032
+ }
2033
+ if (P !== 46) {
2034
+ if (C = P === 48, y++, P = y < M ? u.path.charCodeAt(y) : 0, C && y < M && P && a(P)) {
2035
+ u.err = "SvgPath: numbers started with `0` such as `09` are illegal (at pos " + A + ")";
2036
+ return;
2037
+ }
2038
+ for (; y < M && a(u.path.charCodeAt(y)); )
2039
+ y++, E = !0;
2040
+ P = y < M ? u.path.charCodeAt(y) : 0;
2041
+ }
2042
+ if (P === 46) {
2043
+ for (S = !0, y++; a(u.path.charCodeAt(y)); )
2044
+ y++, L = !0;
2045
+ P = y < M ? u.path.charCodeAt(y) : 0;
2046
+ }
2047
+ if (P === 101 || P === 69) {
2048
+ if (S && !E && !L) {
2049
+ u.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2050
+ return;
2051
+ }
2052
+ if (y++, P = y < M ? u.path.charCodeAt(y) : 0, (P === 43 || P === 45) && y++, y < M && a(u.path.charCodeAt(y)))
2053
+ for (; y < M && a(u.path.charCodeAt(y)); )
2054
+ y++;
2055
+ else {
2056
+ u.err = "SvgPath: invalid float exponent (at pos " + y + ")";
2057
+ return;
2058
+ }
2059
+ }
2060
+ u.index = y, u.param = parseFloat(u.path.slice(A, y)) + 0;
2061
+ }
2062
+ function x(u) {
2063
+ var A, y;
2064
+ A = u.path[u.segmentStart], y = A.toLowerCase();
2065
+ var M = u.data;
2066
+ if (y === "m" && M.length > 2 && (u.result.push([A, M[0], M[1]]), M = M.slice(2), y = "l", A = A === "m" ? "l" : "L"), y === "r")
2067
+ u.result.push([A].concat(M));
2068
+ else
2069
+ for (; M.length >= n[y] && (u.result.push([A].concat(M.splice(0, n[y]))), !!n[y]); )
2070
+ ;
2071
+ }
2072
+ function l(u) {
2073
+ var A = u.max, y, M, C, E, L;
2074
+ if (u.segmentStart = u.index, y = u.path.charCodeAt(u.index), M = i(y), !o(y)) {
2075
+ u.err = "SvgPath: bad command " + u.path[u.index] + " (at pos " + u.index + ")";
2076
+ return;
2077
+ }
2078
+ if (E = n[u.path[u.index].toLowerCase()], u.index++, h(u), u.data = [], !E) {
2079
+ x(u);
2080
+ return;
2081
+ }
2082
+ for (C = !1; ; ) {
2083
+ for (L = E; L > 0; L--) {
2084
+ if (M && (L === 3 || L === 4) ? c(u) : f(u), u.err.length) {
2085
+ x(u);
2086
+ return;
2087
+ }
2088
+ u.data.push(u.param), h(u), C = !1, u.index < A && u.path.charCodeAt(u.index) === 44 && (u.index++, h(u), C = !0);
2089
+ }
2090
+ if (!C && (u.index >= u.max || !s(u.path.charCodeAt(u.index))))
2091
+ break;
2092
+ }
2093
+ x(u);
2094
+ }
2095
+ return N0 = function(A) {
2096
+ var y = new r(A), M = y.max;
2097
+ for (h(y); y.index < M && !y.err.length; )
2098
+ l(y);
2099
+ return y.result.length && ("mM".indexOf(y.result[0][0]) < 0 ? (y.err = "SvgPath: string should start with `M` or `m`", y.result = []) : y.result[0][0] = "M"), {
2100
+ err: y.err,
2101
+ segments: y.result
2102
+ };
2103
+ }, N0;
2104
+ }
2105
+ var D0, dt;
2106
+ function Ft() {
2107
+ if (dt) return D0;
2108
+ dt = 1;
2109
+ function n(t, o) {
2110
+ return [
2111
+ t[0] * o[0] + t[2] * o[1],
2112
+ t[1] * o[0] + t[3] * o[1],
2113
+ t[0] * o[2] + t[2] * o[3],
2114
+ t[1] * o[2] + t[3] * o[3],
2115
+ t[0] * o[4] + t[2] * o[5] + t[4],
2116
+ t[1] * o[4] + t[3] * o[5] + t[5]
2117
+ ];
2118
+ }
2119
+ function e() {
2120
+ if (!(this instanceof e))
2121
+ return new e();
2122
+ this.queue = [], this.cache = null;
2123
+ }
2124
+ return e.prototype.matrix = function(t) {
2125
+ return t[0] === 1 && t[1] === 0 && t[2] === 0 && t[3] === 1 && t[4] === 0 && t[5] === 0 ? this : (this.cache = null, this.queue.push(t), this);
2126
+ }, e.prototype.translate = function(t, o) {
2127
+ return (t !== 0 || o !== 0) && (this.cache = null, this.queue.push([1, 0, 0, 1, t, o])), this;
2128
+ }, e.prototype.scale = function(t, o) {
2129
+ return (t !== 1 || o !== 1) && (this.cache = null, this.queue.push([t, 0, 0, o, 0, 0])), this;
2130
+ }, e.prototype.rotate = function(t, o, i) {
2131
+ var a, s, r;
2132
+ return t !== 0 && (this.translate(o, i), a = t * Math.PI / 180, s = Math.cos(a), r = Math.sin(a), this.queue.push([s, r, -r, s, 0, 0]), this.cache = null, this.translate(-o, -i)), this;
2133
+ }, e.prototype.skewX = function(t) {
2134
+ return t !== 0 && (this.cache = null, this.queue.push([1, 0, Math.tan(t * Math.PI / 180), 1, 0, 0])), this;
2135
+ }, e.prototype.skewY = function(t) {
2136
+ return t !== 0 && (this.cache = null, this.queue.push([1, Math.tan(t * Math.PI / 180), 0, 1, 0, 0])), this;
2137
+ }, e.prototype.toArray = function() {
2138
+ if (this.cache)
2139
+ return this.cache;
2140
+ if (!this.queue.length)
2141
+ return this.cache = [1, 0, 0, 1, 0, 0], this.cache;
2142
+ if (this.cache = this.queue[0], this.queue.length === 1)
2143
+ return this.cache;
2144
+ for (var t = 1; t < this.queue.length; t++)
2145
+ this.cache = n(this.cache, this.queue[t]);
2146
+ return this.cache;
2147
+ }, e.prototype.calc = function(t, o, i) {
2148
+ var a;
2149
+ return this.queue.length ? (this.cache || (this.cache = this.toArray()), a = this.cache, [
2150
+ t * a[0] + o * a[2] + (i ? 0 : a[4]),
2151
+ t * a[1] + o * a[3] + (i ? 0 : a[5])
2152
+ ]) : [t, o];
2153
+ }, D0 = e, D0;
2154
+ }
2155
+ var B0, xt;
2156
+ function pe() {
2157
+ if (xt) return B0;
2158
+ xt = 1;
2159
+ var n = Ft(), e = {
2160
+ matrix: !0,
2161
+ scale: !0,
2162
+ rotate: !0,
2163
+ translate: !0,
2164
+ skewX: !0,
2165
+ skewY: !0
2166
+ }, t = /\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/, o = /[\s,]+/;
2167
+ return B0 = function(a) {
2168
+ var s = new n(), r, h;
2169
+ return a.split(t).forEach(function(c) {
2170
+ if (c.length) {
2171
+ if (typeof e[c] < "u") {
2172
+ r = c;
2173
+ return;
2174
+ }
2175
+ switch (h = c.split(o).map(function(f) {
2176
+ return +f || 0;
2177
+ }), r) {
2178
+ case "matrix":
2179
+ h.length === 6 && s.matrix(h);
2180
+ return;
2181
+ case "scale":
2182
+ h.length === 1 ? s.scale(h[0], h[0]) : h.length === 2 && s.scale(h[0], h[1]);
2183
+ return;
2184
+ case "rotate":
2185
+ h.length === 1 ? s.rotate(h[0], 0, 0) : h.length === 3 && s.rotate(h[0], h[1], h[2]);
2186
+ return;
2187
+ case "translate":
2188
+ h.length === 1 ? s.translate(h[0], 0) : h.length === 2 && s.translate(h[0], h[1]);
2189
+ return;
2190
+ case "skewX":
2191
+ h.length === 1 && s.skewX(h[0]);
2192
+ return;
2193
+ case "skewY":
2194
+ h.length === 1 && s.skewY(h[0]);
2195
+ return;
2196
+ }
2197
+ }
2198
+ }), s;
2199
+ }, B0;
2200
+ }
2201
+ var j0, yt;
2202
+ function de() {
2203
+ if (yt) return j0;
2204
+ yt = 1;
2205
+ var n = Math.PI * 2;
2206
+ function e(i, a, s, r) {
2207
+ var h = i * r - a * s < 0 ? -1 : 1, c = i * s + a * r;
2208
+ return c > 1 && (c = 1), c < -1 && (c = -1), h * Math.acos(c);
2209
+ }
2210
+ function t(i, a, s, r, h, c, f, x, l, u) {
2211
+ var A = u * (i - s) / 2 + l * (a - r) / 2, y = -l * (i - s) / 2 + u * (a - r) / 2, M = f * f, C = x * x, E = A * A, L = y * y, S = M * C - M * L - C * E;
2212
+ S < 0 && (S = 0), S /= M * L + C * E, S = Math.sqrt(S) * (h === c ? -1 : 1);
2213
+ var P = S * f / x * y, F = S * -x / f * A, z = u * P - l * F + (i + s) / 2, Z = l * P + u * F + (a + r) / 2, j = (A - P) / f, $ = (y - F) / x, n0 = (-A - P) / f, u0 = (-y - F) / x, h0 = e(1, 0, j, $), Q = e(j, $, n0, u0);
2214
+ return c === 0 && Q > 0 && (Q -= n), c === 1 && Q < 0 && (Q += n), [z, Z, h0, Q];
2215
+ }
2216
+ function o(i, a) {
2217
+ var s = 1.3333333333333333 * Math.tan(a / 4), r = Math.cos(i), h = Math.sin(i), c = Math.cos(i + a), f = Math.sin(i + a);
2218
+ return [r, h, r - h * s, h + r * s, c + f * s, f - c * s, c, f];
2219
+ }
2220
+ return j0 = function(a, s, r, h, c, f, x, l, u) {
2221
+ var A = Math.sin(u * n / 360), y = Math.cos(u * n / 360), M = y * (a - r) / 2 + A * (s - h) / 2, C = -A * (a - r) / 2 + y * (s - h) / 2;
2222
+ if (M === 0 && C === 0)
2223
+ return [];
2224
+ if (x === 0 || l === 0)
2225
+ return [];
2226
+ x = Math.abs(x), l = Math.abs(l);
2227
+ var E = M * M / (x * x) + C * C / (l * l);
2228
+ E > 1 && (x *= Math.sqrt(E), l *= Math.sqrt(E));
2229
+ var L = t(a, s, r, h, c, f, x, l, A, y), S = [], P = L[2], F = L[3], z = Math.max(Math.ceil(Math.abs(F) / (n / 4)), 1);
2230
+ F /= z;
2231
+ for (var Z = 0; Z < z; Z++)
2232
+ S.push(o(P, F)), P += F;
2233
+ return S.map(function(j) {
2234
+ for (var $ = 0; $ < j.length; $ += 2) {
2235
+ var n0 = j[$ + 0], u0 = j[$ + 1];
2236
+ n0 *= x, u0 *= l;
2237
+ var h0 = y * n0 - A * u0, Q = A * n0 + y * u0;
2238
+ j[$ + 0] = h0 + L[0], j[$ + 1] = Q + L[1];
2239
+ }
2240
+ return j;
2241
+ });
2242
+ }, j0;
2243
+ }
2244
+ var U0, vt;
2245
+ function xe() {
2246
+ if (vt) return U0;
2247
+ vt = 1;
2248
+ var n = 1e-10, e = Math.PI / 180;
2249
+ function t(o, i, a) {
2250
+ if (!(this instanceof t))
2251
+ return new t(o, i, a);
2252
+ this.rx = o, this.ry = i, this.ax = a;
2253
+ }
2254
+ return t.prototype.transform = function(o) {
2255
+ var i = Math.cos(this.ax * e), a = Math.sin(this.ax * e), s = [
2256
+ this.rx * (o[0] * i + o[2] * a),
2257
+ this.rx * (o[1] * i + o[3] * a),
2258
+ this.ry * (-o[0] * a + o[2] * i),
2259
+ this.ry * (-o[1] * a + o[3] * i)
2260
+ ], r = s[0] * s[0] + s[2] * s[2], h = s[1] * s[1] + s[3] * s[3], c = ((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])), f = (r + h) / 2;
2261
+ if (c < n * f)
2262
+ return this.rx = this.ry = Math.sqrt(f), this.ax = 0, this;
2263
+ var x = s[0] * s[1] + s[2] * s[3];
2264
+ c = Math.sqrt(c);
2265
+ var l = f + c / 2, u = f - c / 2;
2266
+ return this.ax = Math.abs(x) < n && Math.abs(l - h) < n ? 90 : Math.atan(
2267
+ Math.abs(x) > Math.abs(l - h) ? (l - r) / x : x / (l - h)
2268
+ ) * 180 / Math.PI, this.ax >= 0 ? (this.rx = Math.sqrt(l), this.ry = Math.sqrt(u)) : (this.ax += 90, this.rx = Math.sqrt(u), this.ry = Math.sqrt(l)), this;
2269
+ }, t.prototype.isDegenerate = function() {
2270
+ return this.rx < n * this.ry || this.ry < n * this.rx;
2271
+ }, U0 = t, U0;
2272
+ }
2273
+ var z0, wt;
2274
+ function ye() {
2275
+ if (wt) return z0;
2276
+ wt = 1;
2277
+ var n = ge(), e = pe(), t = Ft(), o = de(), i = xe();
2278
+ function a(s) {
2279
+ if (!(this instanceof a))
2280
+ return new a(s);
2281
+ var r = n(s);
2282
+ this.segments = r.segments, this.err = r.err, this.__stack = [];
2283
+ }
2284
+ return a.from = function(s) {
2285
+ if (typeof s == "string") return new a(s);
2286
+ if (s instanceof a) {
2287
+ var r = new a("");
2288
+ return r.err = s.err, r.segments = s.segments.map(function(h) {
2289
+ return h.slice();
2290
+ }), r.__stack = s.__stack.map(function(h) {
2291
+ return t().matrix(h.toArray());
2292
+ }), r;
2293
+ }
2294
+ throw new Error("SvgPath.from: invalid param type " + s);
2295
+ }, a.prototype.__matrix = function(s) {
2296
+ var r = this, h;
2297
+ s.queue.length && this.iterate(function(c, f, x, l) {
2298
+ var u, A, y, M;
2299
+ switch (c[0]) {
2300
+ // Process 'assymetric' commands separately
2301
+ case "v":
2302
+ u = s.calc(0, c[1], !0), A = u[0] === 0 ? ["v", u[1]] : ["l", u[0], u[1]];
2303
+ break;
2304
+ case "V":
2305
+ u = s.calc(x, c[1], !1), A = u[0] === s.calc(x, l, !1)[0] ? ["V", u[1]] : ["L", u[0], u[1]];
2306
+ break;
2307
+ case "h":
2308
+ u = s.calc(c[1], 0, !0), A = u[1] === 0 ? ["h", u[0]] : ["l", u[0], u[1]];
2309
+ break;
2310
+ case "H":
2311
+ u = s.calc(c[1], l, !1), A = u[1] === s.calc(x, l, !1)[1] ? ["H", u[0]] : ["L", u[0], u[1]];
2312
+ break;
2313
+ case "a":
2314
+ case "A":
2315
+ var C = s.toArray(), E = i(c[1], c[2], c[3]).transform(C);
2316
+ if (C[0] * C[3] - C[1] * C[2] < 0 && (c[5] = c[5] ? "0" : "1"), u = s.calc(c[6], c[7], c[0] === "a"), c[0] === "A" && c[6] === x && c[7] === l || c[0] === "a" && c[6] === 0 && c[7] === 0) {
2317
+ A = [c[0] === "a" ? "l" : "L", u[0], u[1]];
2318
+ break;
2319
+ }
2320
+ E.isDegenerate() ? A = [c[0] === "a" ? "l" : "L", u[0], u[1]] : A = [c[0], E.rx, E.ry, E.ax, c[4], c[5], u[0], u[1]];
2321
+ break;
2322
+ case "m":
2323
+ M = f > 0, u = s.calc(c[1], c[2], M), A = ["m", u[0], u[1]];
2324
+ break;
2325
+ default:
2326
+ for (y = c[0], A = [y], M = y.toLowerCase() === y, h = 1; h < c.length; h += 2)
2327
+ u = s.calc(c[h], c[h + 1], M), A.push(u[0], u[1]);
2328
+ }
2329
+ r.segments[f] = A;
2330
+ }, !0);
2331
+ }, a.prototype.__evaluateStack = function() {
2332
+ var s, r;
2333
+ if (this.__stack.length) {
2334
+ if (this.__stack.length === 1) {
2335
+ this.__matrix(this.__stack[0]), this.__stack = [];
2336
+ return;
2337
+ }
2338
+ for (s = t(), r = this.__stack.length; --r >= 0; )
2339
+ s.matrix(this.__stack[r].toArray());
2340
+ this.__matrix(s), this.__stack = [];
2341
+ }
2342
+ }, a.prototype.toString = function() {
2343
+ var s = "", r = "", h = !1;
2344
+ this.__evaluateStack();
2345
+ for (var c = 0, f = this.segments.length; c < f; c++) {
2346
+ var x = this.segments[c], l = x[0];
2347
+ l !== r || l === "m" || l === "M" ? (l === "m" && r === "z" && (s += " "), s += l, h = !1) : h = !0;
2348
+ for (var u = 1; u < x.length; u++) {
2349
+ var A = x[u];
2350
+ u === 1 ? h && A >= 0 && (s += " ") : A >= 0 && (s += " "), s += A;
2351
+ }
2352
+ r = l;
2353
+ }
2354
+ return s;
2355
+ }, a.prototype.translate = function(s, r) {
2356
+ return this.__stack.push(t().translate(s, r || 0)), this;
2357
+ }, a.prototype.scale = function(s, r) {
2358
+ return this.__stack.push(t().scale(s, !r && r !== 0 ? s : r)), this;
2359
+ }, a.prototype.rotate = function(s, r, h) {
2360
+ return this.__stack.push(t().rotate(s, r || 0, h || 0)), this;
2361
+ }, a.prototype.skewX = function(s) {
2362
+ return this.__stack.push(t().skewX(s)), this;
2363
+ }, a.prototype.skewY = function(s) {
2364
+ return this.__stack.push(t().skewY(s)), this;
2365
+ }, a.prototype.matrix = function(s) {
2366
+ return this.__stack.push(t().matrix(s)), this;
2367
+ }, a.prototype.transform = function(s) {
2368
+ return s.trim() ? (this.__stack.push(e(s)), this) : this;
2369
+ }, a.prototype.round = function(s) {
2370
+ var r = 0, h = 0, c = 0, f = 0, x;
2371
+ return s = s || 0, this.__evaluateStack(), this.segments.forEach(function(l) {
2372
+ var u = l[0].toLowerCase() === l[0];
2373
+ switch (l[0]) {
2374
+ case "H":
2375
+ case "h":
2376
+ u && (l[1] += c), c = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2377
+ return;
2378
+ case "V":
2379
+ case "v":
2380
+ u && (l[1] += f), f = l[1] - l[1].toFixed(s), l[1] = +l[1].toFixed(s);
2381
+ return;
2382
+ case "Z":
2383
+ case "z":
2384
+ c = r, f = h;
2385
+ return;
2386
+ case "M":
2387
+ case "m":
2388
+ u && (l[1] += c, l[2] += f), c = l[1] - l[1].toFixed(s), f = l[2] - l[2].toFixed(s), r = c, h = f, l[1] = +l[1].toFixed(s), l[2] = +l[2].toFixed(s);
2389
+ return;
2390
+ case "A":
2391
+ case "a":
2392
+ u && (l[6] += c, l[7] += f), c = l[6] - l[6].toFixed(s), f = 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);
2393
+ return;
2394
+ default:
2395
+ x = l.length, u && (l[x - 2] += c, l[x - 1] += f), c = l[x - 2] - l[x - 2].toFixed(s), f = l[x - 1] - l[x - 1].toFixed(s), l.forEach(function(A, y) {
2396
+ y && (l[y] = +l[y].toFixed(s));
2397
+ });
2398
+ return;
2399
+ }
2400
+ }), this;
2401
+ }, a.prototype.iterate = function(s, r) {
2402
+ var h = this.segments, c = {}, f = !1, x = 0, l = 0, u = 0, A = 0, y, M, C;
2403
+ if (r || this.__evaluateStack(), h.forEach(function(E, L) {
2404
+ var S = s(E, L, x, l);
2405
+ Array.isArray(S) && (c[L] = S, f = !0);
2406
+ var P = E[0] === E[0].toLowerCase();
2407
+ switch (E[0]) {
2408
+ case "m":
2409
+ case "M":
2410
+ x = E[1] + (P ? x : 0), l = E[2] + (P ? l : 0), u = x, A = l;
2411
+ return;
2412
+ case "h":
2413
+ case "H":
2414
+ x = E[1] + (P ? x : 0);
2415
+ return;
2416
+ case "v":
2417
+ case "V":
2418
+ l = E[1] + (P ? l : 0);
2419
+ return;
2420
+ case "z":
2421
+ case "Z":
2422
+ x = u, l = A;
2423
+ return;
2424
+ default:
2425
+ x = E[E.length - 2] + (P ? x : 0), l = E[E.length - 1] + (P ? l : 0);
2426
+ }
2427
+ }), !f)
2428
+ return this;
2429
+ for (C = [], y = 0; y < h.length; y++)
2430
+ if (typeof c[y] < "u")
2431
+ for (M = 0; M < c[y].length; M++)
2432
+ C.push(c[y][M]);
2433
+ else
2434
+ C.push(h[y]);
2435
+ return this.segments = C, this;
2436
+ }, a.prototype.abs = function() {
2437
+ return this.iterate(function(s, r, h, c) {
2438
+ var f = s[0], x = f.toUpperCase(), l;
2439
+ if (f !== x)
2440
+ switch (s[0] = x, f) {
2441
+ case "v":
2442
+ s[1] += c;
2443
+ return;
2444
+ case "a":
2445
+ s[6] += h, s[7] += c;
2446
+ return;
2447
+ default:
2448
+ for (l = 1; l < s.length; l++)
2449
+ s[l] += l % 2 ? h : c;
2450
+ }
2451
+ }, !0), this;
2452
+ }, a.prototype.rel = function() {
2453
+ return this.iterate(function(s, r, h, c) {
2454
+ var f = s[0], x = f.toLowerCase(), l;
2455
+ if (f !== x && !(r === 0 && f === "M"))
2456
+ switch (s[0] = x, f) {
2457
+ case "V":
2458
+ s[1] -= c;
2459
+ return;
2460
+ case "A":
2461
+ s[6] -= h, s[7] -= c;
2462
+ return;
2463
+ default:
2464
+ for (l = 1; l < s.length; l++)
2465
+ s[l] -= l % 2 ? h : c;
2466
+ }
2467
+ }, !0), this;
2468
+ }, a.prototype.unarc = function() {
2469
+ return this.iterate(function(s, r, h, c) {
2470
+ var f, x, l, u = [], A = s[0];
2471
+ return A !== "A" && A !== "a" ? null : (A === "a" ? (x = h + s[6], l = c + s[7]) : (x = s[6], l = s[7]), f = o(h, c, x, l, s[4], s[5], s[1], s[2], s[3]), f.length === 0 ? [[s[0] === "a" ? "l" : "L", s[6], s[7]]] : (f.forEach(function(y) {
2472
+ u.push(["C", y[2], y[3], y[4], y[5], y[6], y[7]]);
2473
+ }), u));
2474
+ }), this;
2475
+ }, a.prototype.unshort = function() {
2476
+ var s = this.segments, r, h, c, f, x;
2477
+ return this.iterate(function(l, u, A, y) {
2478
+ var M = l[0], C = M.toUpperCase(), E;
2479
+ u && (C === "T" ? (E = M === "t", c = s[u - 1], c[0] === "Q" ? (r = c[1] - A, h = c[2] - y) : c[0] === "q" ? (r = c[1] - c[3], h = c[2] - c[4]) : (r = 0, h = 0), f = -r, x = -h, E || (f += A, x += y), s[u] = [
2480
+ E ? "q" : "Q",
2481
+ f,
2482
+ x,
2483
+ l[1],
2484
+ l[2]
2485
+ ]) : C === "S" && (E = M === "s", c = s[u - 1], c[0] === "C" ? (r = c[3] - A, h = c[4] - y) : c[0] === "c" ? (r = c[3] - c[5], h = c[4] - c[6]) : (r = 0, h = 0), f = -r, x = -h, E || (f += A, x += y), s[u] = [
2486
+ E ? "c" : "C",
2487
+ f,
2488
+ x,
2489
+ l[1],
2490
+ l[2],
2491
+ l[3],
2492
+ l[4]
2493
+ ]));
2494
+ }), this;
2495
+ }, z0 = a, z0;
2496
+ }
2497
+ var H0, At;
2498
+ function ve() {
2499
+ return At || (At = 1, H0 = ye()), H0;
2500
+ }
2501
+ var we = ve();
2502
+ const Ae = /* @__PURE__ */ fe(we);
2503
+ var $0 = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, me = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2504
+ function be(n) {
2505
+ var e = [];
2506
+ return n.replace(me, function(t, o, i) {
2507
+ var a = o.toLowerCase();
2508
+ for (i = Le(i), a === "m" && i.length > 2 && (e.push([o].concat(i.splice(0, 2))), a = "l", o = o === "m" ? "l" : "L"); i.length >= 0; ) {
2509
+ if (i.length === $0[a])
2510
+ return i.unshift(o), e.push(i);
2511
+ if (i.length < $0[a])
2512
+ throw new Error("malformed path data");
2513
+ e.push([o].concat(i.splice(0, $0[a])));
2514
+ }
2515
+ }), e;
2516
+ }
2517
+ var Me = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2518
+ function Le(n) {
2519
+ var e = n.match(Me);
2520
+ return e ? e.map(Number) : [];
2521
+ }
2522
+ function t0(n, e, t, o, i, a, s, r) {
2523
+ return new W0(n, e, t, o, i, a, s, r);
2524
+ }
2525
+ function W0(n, e, t, o, i, a, s, r) {
2526
+ 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 = Fe, this.getPoint = Ce, this.getDerivative = Pe) : (this.getArcLength = Ee, this.getPoint = Rt, this.getDerivative = Te), this.init();
2527
+ }
2528
+ W0.prototype = {
2529
+ constructor: W0,
2530
+ init: function() {
2531
+ this.length = this.getArcLength(
2532
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2533
+ [this.a.y, this.b.y, this.c.y, this.d.y]
2534
+ );
2535
+ },
2536
+ getTotalLength: function() {
2537
+ return this.length;
2538
+ },
2539
+ getPointAtLength: function(n) {
2540
+ var e = Y0(
2541
+ n,
2542
+ this.length,
2543
+ this.getArcLength,
2544
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2545
+ [this.a.y, this.b.y, this.c.y, this.d.y]
2546
+ );
2547
+ return this.getPoint(
2548
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2549
+ [this.a.y, this.b.y, this.c.y, this.d.y],
2550
+ e
2551
+ );
2552
+ },
2553
+ getTangentAtLength: function(n) {
2554
+ var e = Y0(
2555
+ n,
2556
+ this.length,
2557
+ this.getArcLength,
2558
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2559
+ [this.a.y, this.b.y, this.c.y, this.d.y]
2560
+ ), t = this.getDerivative(
2561
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2562
+ [this.a.y, this.b.y, this.c.y, this.d.y],
2563
+ e
2564
+ ), o = Math.sqrt(t.x * t.x + t.y * t.y), i;
2565
+ return o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 }, i;
2566
+ },
2567
+ getPropertiesAtLength: function(n) {
2568
+ var e = Y0(
2569
+ n,
2570
+ this.length,
2571
+ this.getArcLength,
2572
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2573
+ [this.a.y, this.b.y, this.c.y, this.d.y]
2574
+ ), t = this.getDerivative(
2575
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2576
+ [this.a.y, this.b.y, this.c.y, this.d.y],
2577
+ e
2578
+ ), o = Math.sqrt(t.x * t.x + t.y * t.y), i;
2579
+ o > 0 ? i = { x: t.x / o, y: t.y / o } : i = { x: 0, y: 0 };
2580
+ var a = this.getPoint(
2581
+ [this.a.x, this.b.x, this.c.x, this.d.x],
2582
+ [this.a.y, this.b.y, this.c.y, this.d.y],
2583
+ e
2584
+ );
2585
+ return { x: a.x, y: a.y, tangentX: i.x, tangentY: i.y };
2586
+ }
2587
+ };
2588
+ function Te(n, e, t) {
2589
+ return {
2590
+ x: (1 - t) * 2 * (n[1] - n[0]) + t * 2 * (n[2] - n[1]),
2591
+ y: (1 - t) * 2 * (e[1] - e[0]) + t * 2 * (e[2] - e[1])
2592
+ };
2593
+ }
2594
+ function Pe(n, e, t) {
2595
+ var o = Rt(
2596
+ [3 * (n[1] - n[0]), 3 * (n[2] - n[1]), 3 * (n[3] - n[2])],
2597
+ [3 * (e[1] - e[0]), 3 * (e[2] - e[1]), 3 * (e[3] - e[2])],
2598
+ t
2599
+ );
2600
+ return o;
2601
+ }
2602
+ function Y0(n, e, t, o, i) {
2603
+ for (var a = 1, s = n / e, r = (n - t(o, i, s)) / e; a > 1e-3; ) {
2604
+ var h = t(o, i, s + r), c = t(o, i, s - r), f = Math.abs(n - h) / e, x = Math.abs(n - c) / e;
2605
+ f < a ? (a = f, s += r) : x < a ? (a = x, s -= r) : r /= 2;
2606
+ }
2607
+ return s;
2608
+ }
2609
+ function Rt(n, e, t) {
2610
+ 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];
2611
+ return { x: o, y: i };
2612
+ }
2613
+ function Ce(n, e, t) {
2614
+ 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];
2615
+ return { x: o, y: i };
2616
+ }
2617
+ function Ee(n, e, t) {
2618
+ t === void 0 && (t = 1);
2619
+ 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), c = a * a + s * s;
2620
+ if (r === 0)
2621
+ return t * Math.sqrt(Math.pow(n[2] - n[0], 2) + Math.pow(e[2] - e[0], 2));
2622
+ var f = h / (2 * r), x = c / r, l = t + f, u = x - f * f;
2623
+ return Math.sqrt(r) / 2 * (l * Math.sqrt(l * l + u) - f * Math.sqrt(f * f + u) + u * Math.log(Math.abs(
2624
+ (l + Math.sqrt(l * l + u)) / (f + Math.sqrt(f * f + u))
2625
+ )));
2626
+ }
2627
+ var Se = [
2628
+ [],
2629
+ [],
2630
+ [-0.5773502691896257, 0.5773502691896257],
2631
+ [0, -0.7745966692414834, 0.7745966692414834],
2632
+ [-0.33998104358485626, 0.33998104358485626, -0.8611363115940526, 0.8611363115940526],
2633
+ [0, -0.5384693101056831, 0.5384693101056831, -0.906179845938664, 0.906179845938664],
2634
+ [0.6612093864662645, -0.6612093864662645, -0.2386191860831969, 0.2386191860831969, -0.932469514203152, 0.932469514203152],
2635
+ [0, 0.4058451513773972, -0.4058451513773972, -0.7415311855993945, 0.7415311855993945, -0.9491079123427585, 0.9491079123427585],
2636
+ [-0.1834346424956498, 0.1834346424956498, -0.525532409916329, 0.525532409916329, -0.7966664774136267, 0.7966664774136267, -0.9602898564975363, 0.9602898564975363],
2637
+ [0, -0.8360311073266358, 0.8360311073266358, -0.9681602395076261, 0.9681602395076261, -0.3242534234038089, 0.3242534234038089, -0.6133714327005904, 0.6133714327005904],
2638
+ [-0.14887433898163122, 0.14887433898163122, -0.4333953941292472, 0.4333953941292472, -0.6794095682990244, 0.6794095682990244, -0.8650633666889845, 0.8650633666889845, -0.9739065285171717, 0.9739065285171717],
2639
+ [0, -0.26954315595234496, 0.26954315595234496, -0.5190961292068118, 0.5190961292068118, -0.7301520055740494, 0.7301520055740494, -0.8870625997680953, 0.8870625997680953, -0.978228658146057, 0.978228658146057],
2640
+ [-0.1252334085114689, 0.1252334085114689, -0.3678314989981802, 0.3678314989981802, -0.5873179542866175, 0.5873179542866175, -0.7699026741943047, 0.7699026741943047, -0.9041172563704749, 0.9041172563704749, -0.9815606342467192, 0.9815606342467192],
2641
+ [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],
2642
+ [-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],
2643
+ [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],
2644
+ [-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],
2645
+ [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],
2646
+ [-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],
2647
+ [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],
2648
+ [-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],
2649
+ [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],
2650
+ [-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],
2651
+ [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],
2652
+ [-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]
2653
+ ], _e = [
2654
+ [],
2655
+ [],
2656
+ [1, 1],
2657
+ [0.8888888888888888, 0.5555555555555556, 0.5555555555555556],
2658
+ [0.6521451548625461, 0.6521451548625461, 0.34785484513745385, 0.34785484513745385],
2659
+ [0.5688888888888889, 0.47862867049936647, 0.47862867049936647, 0.23692688505618908, 0.23692688505618908],
2660
+ [0.3607615730481386, 0.3607615730481386, 0.46791393457269104, 0.46791393457269104, 0.17132449237917036, 0.17132449237917036],
2661
+ [0.4179591836734694, 0.3818300505051189, 0.3818300505051189, 0.27970539148927664, 0.27970539148927664, 0.1294849661688697, 0.1294849661688697],
2662
+ [0.362683783378362, 0.362683783378362, 0.31370664587788727, 0.31370664587788727, 0.22238103445337448, 0.22238103445337448, 0.10122853629037626, 0.10122853629037626],
2663
+ [0.3302393550012598, 0.1806481606948574, 0.1806481606948574, 0.08127438836157441, 0.08127438836157441, 0.31234707704000286, 0.31234707704000286, 0.26061069640293544, 0.26061069640293544],
2664
+ [0.29552422471475287, 0.29552422471475287, 0.26926671930999635, 0.26926671930999635, 0.21908636251598204, 0.21908636251598204, 0.1494513491505806, 0.1494513491505806, 0.06667134430868814, 0.06667134430868814],
2665
+ [0.2729250867779006, 0.26280454451024665, 0.26280454451024665, 0.23319376459199048, 0.23319376459199048, 0.18629021092773426, 0.18629021092773426, 0.1255803694649046, 0.1255803694649046, 0.05566856711617366, 0.05566856711617366],
2666
+ [0.24914704581340277, 0.24914704581340277, 0.2334925365383548, 0.2334925365383548, 0.20316742672306592, 0.20316742672306592, 0.16007832854334622, 0.16007832854334622, 0.10693932599531843, 0.10693932599531843, 0.04717533638651183, 0.04717533638651183],
2667
+ [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],
2668
+ [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],
2669
+ [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],
2670
+ [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],
2671
+ [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],
2672
+ [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],
2673
+ [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],
2674
+ [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],
2675
+ [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],
2676
+ [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],
2677
+ [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],
2678
+ [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]
2679
+ ], Ie = [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1]];
2680
+ function Oe(n, e) {
2681
+ return Ie[n][e];
2682
+ }
2683
+ function K0(n, e, t) {
2684
+ var o = t.length - 1, i, a, s;
2685
+ if (o === 0)
2686
+ return 0;
2687
+ if (n === 0) {
2688
+ for (a = 0, s = 0; s <= o; s++)
2689
+ a += Oe(o, s) * Math.pow(1 - e, o - s) * Math.pow(e, s) * t[s];
2690
+ return a;
2691
+ } else {
2692
+ for (i = new Array(o), s = 0; s < o; s++)
2693
+ i[s] = o * (t[s + 1] - t[s]);
2694
+ return K0(n - 1, e, i);
2695
+ }
2696
+ }
2697
+ function ke(n, e, t) {
2698
+ var o = K0(1, t, n), i = K0(1, t, e), a = o * o + i * i;
2699
+ return Math.sqrt(a);
2700
+ }
2701
+ function Fe(n, e, t) {
2702
+ var o, i, a, s;
2703
+ t === void 0 && (t = 1);
2704
+ var r = 20;
2705
+ for (o = t / 2, i = 0, a = 0; a < r; a++)
2706
+ s = o * Se[r][a] + o, i += _e[r][a] * ke(n, e, s);
2707
+ return o * i;
2708
+ }
2709
+ var C0 = Math.PI * 2;
2710
+ function mt(n, e, t, o) {
2711
+ var i = n * o - e * t < 0 ? -1 : 1, a = n * t + e * o;
2712
+ return a > 1 && (a = 1), a < -1 && (a = -1), i * Math.acos(a);
2713
+ }
2714
+ function Re(n, e, t, o, i, a, s, r, h, c) {
2715
+ var f = c * (n - t) / 2 + h * (e - o) / 2, x = -h * (n - t) / 2 + c * (e - o) / 2, l = s * s, u = r * r, A = f * f, y = x * x, M = l * u - l * y - u * A;
2716
+ M < 0 && (M = 0), M /= l * y + u * A, M = Math.sqrt(M) * (i === a ? -1 : 1);
2717
+ var C = M * s / r * x, E = M * -r / s * f, L = c * C - h * E + (n + t) / 2, S = h * C + c * E + (e + o) / 2, P = (f - C) / s, F = (x - E) / r, z = (-f - C) / s, Z = (-x - E) / r, j = mt(1, 0, P, F), $ = mt(P, F, z, Z);
2718
+ return a === 0 && $ > 0 && ($ -= C0), a === 1 && $ < 0 && ($ += C0), [L, S, j, $];
2719
+ }
2720
+ function qe(n, e) {
2721
+ 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);
2722
+ return [o, i, o - i * t, i + o * t, a + s * t, s - a * t, a, s];
2723
+ }
2724
+ function Ne(n, e, t, o, i, a, s, r, h) {
2725
+ var c = Math.sin(i * C0 / 360), f = Math.cos(i * C0 / 360), x = f * (n - r) / 2 + c * (e - h) / 2, l = -c * (n - r) / 2 + f * (e - h) / 2;
2726
+ if (x === 0 && l === 0)
2727
+ return [];
2728
+ if (t === 0 || o === 0)
2729
+ return [];
2730
+ t = Math.abs(t), o = Math.abs(o);
2731
+ var u = x * x / (t * t) + l * l / (o * o);
2732
+ u > 1 && (t *= Math.sqrt(u), o *= Math.sqrt(u));
2733
+ var A = Re(n, e, r, h, a, s, t, o, c, f), y = [], M = A[2], C = A[3], E = Math.max(Math.ceil(Math.abs(C) / (C0 / 4)), 1);
2734
+ C /= E;
2735
+ for (var L = 0; L < E; L++)
2736
+ y.push(qe(M, C)), M += C;
2737
+ return y.map(function(S) {
2738
+ for (var P = 0; P < S.length; P += 2) {
2739
+ var F = S[P + 0], z = S[P + 1];
2740
+ F *= t, z *= o;
2741
+ var Z = f * F - c * z, j = c * F + f * z;
2742
+ S[P + 0] = Z + A[0], S[P + 1] = j + A[1];
2743
+ }
2744
+ return S;
2745
+ });
2746
+ }
2747
+ function bt(n, e, t, o, i, a, s, r, h) {
2748
+ return new V0(n, e, t, o, i, a, s, r, h);
2749
+ }
2750
+ function V0(n, e, t, o, i, a, s, r, h) {
2751
+ var c = 0, f = [], x = [], l = Ne(n, e, t, o, i, a, s, r, h);
2752
+ l.forEach(function(u) {
2753
+ var A = new t0(u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7]), y = A.getTotalLength();
2754
+ c += y, f.push(y), x.push(A);
2755
+ }), this.length = c, this.partialLengths = f, this.curves = x;
2756
+ }
2757
+ V0.prototype = {
2758
+ constructor: V0,
2759
+ init: function() {
2760
+ },
2761
+ getTotalLength: function() {
2762
+ return this.length;
2763
+ },
2764
+ getPointAtLength: function(n) {
2765
+ n < 0 ? n = 0 : n > this.length && (n = this.length);
2766
+ for (var e = this.partialLengths.length - 1; this.partialLengths[e] >= n && this.partialLengths[e] > 0; )
2767
+ e--;
2768
+ e < this.partialLengths.length - 1 && e++;
2769
+ for (var t = 0, o = 0; o < e; o++)
2770
+ t += this.partialLengths[o];
2771
+ return this.curves[e].getPointAtLength(n - t);
2772
+ },
2773
+ getTangentAtLength: function(n) {
2774
+ n < 0 ? n = 0 : n > this.length && (n = this.length);
2775
+ for (var e = this.partialLengths.length - 1; this.partialLengths[e] >= n && this.partialLengths[e] > 0; )
2776
+ e--;
2777
+ e < this.partialLengths.length - 1 && e++;
2778
+ for (var t = 0, o = 0; o < e; o++)
2779
+ t += this.partialLengths[o];
2780
+ return this.curves[e].getTangentAtLength(n - t);
2781
+ },
2782
+ getPropertiesAtLength: function(n) {
2783
+ var e = this.getTangentAtLength(n), t = this.getPointAtLength(n);
2784
+ return { x: t.x, y: t.y, tangentX: e.x, tangentY: e.y };
2785
+ }
2786
+ };
2787
+ function J(n, e, t, o) {
2788
+ return new S0(n, e, t, o);
2789
+ }
2790
+ function S0(n, e, t, o) {
2791
+ this.x0 = n, this.x1 = e, this.y0 = t, this.y1 = o;
2792
+ }
2793
+ S0.prototype.getTotalLength = function() {
2794
+ return Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2));
2795
+ };
2796
+ S0.prototype.getPointAtLength = function(n) {
2797
+ var e = n / Math.sqrt(Math.pow(this.x0 - this.x1, 2) + Math.pow(this.y0 - this.y1, 2)), t = (this.x1 - this.x0) * e, o = (this.y1 - this.y0) * e;
2798
+ return { x: this.x0 + t, y: this.y0 + o };
2799
+ };
2800
+ S0.prototype.getTangentAtLength = function() {
2801
+ var n = Math.sqrt((this.x1 - this.x0) * (this.x1 - this.x0) + (this.y1 - this.y0) * (this.y1 - this.y0));
2802
+ return { x: (this.x1 - this.x0) / n, y: (this.y1 - this.y0) / n };
2803
+ };
2804
+ S0.prototype.getPropertiesAtLength = function(n) {
2805
+ var e = this.getPointAtLength(n), t = this.getTangentAtLength();
2806
+ return { x: e.x, y: e.y, tangentX: t.x, tangentY: t.y };
2807
+ };
2808
+ function De(n) {
2809
+ var e = 0, t = [], o = [];
2810
+ function i(s) {
2811
+ if (!s)
2812
+ return null;
2813
+ for (var r = be(s), h = [0, 0], c = [0, 0], f, x, l = 0; l < r.length; l++)
2814
+ r[l][0] === "M" ? (h = [r[l][1], r[l][2]], x = [h[0], h[1]], o.push(null)) : r[l][0] === "m" ? (h = [r[l][1] + h[0], r[l][2] + h[1]], x = [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 J(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 J(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 J(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 J(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 J(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 J(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(x[0] - h[0], 2) + Math.pow(x[1] - h[1], 2)), o.push(new J(h[0], x[0], h[1], x[1])), h = [x[0], x[1]]) : r[l][0] === "C" ? (f = new t0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4], r[l][5], r[l][6]), e = e + f.getTotalLength(), h = [r[l][5], r[l][6]], o.push(f)) : r[l][0] === "c" ? (f = new t0(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 + f.getTotalLength(), h = [r[l][5] + h[0], r[l][6] + h[1]], o.push(f)) : r[l][0] === "S" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new t0(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]) : f = new t0(h[0], h[1], h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]), e = e + f.getTotalLength(), h = [r[l][3], r[l][4]], o.push(f)) : r[l][0] === "s" ? (l > 0 && ["C", "c", "S", "s"].indexOf(r[l - 1][0]) > -1 ? f = new t0(h[0], h[1], h[0] + f.d.x - f.c.x, h[1] + f.d.y - f.c.y, h[0] + r[l][1], h[1] + r[l][2], h[0] + r[l][3], h[1] + r[l][4]) : f = new t0(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 + f.getTotalLength(), h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(f)) : r[l][0] === "Q" ? (h[0] != r[l][1] && h[1] != r[l][2] ? f = new t0(h[0], h[1], r[l][1], r[l][2], r[l][3], r[l][4]) : f = new J(r[l][1], r[l][3], r[l][2], r[l][4]), e = e + f.getTotalLength(), o.push(f), h = [r[l][3], r[l][4]], c = [r[l][1], r[l][2]]) : r[l][0] === "q" ? (r[l][1] == 0 && r[l][2] == 0 ? f = new J(h[0] + r[l][1], h[0] + r[l][3], h[1] + r[l][2], h[1] + r[l][4]) : f = new t0(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 + f.getTotalLength(), c = [h[0] + r[l][1], h[1] + r[l][2]], h = [r[l][3] + h[0], r[l][4] + h[1]], o.push(f)) : r[l][0] === "T" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? f = new t0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], r[l][1], r[l][2]) : f = new J(h[0], r[l][1], h[1], r[l][2]), o.push(f), e = e + f.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1], r[l][2]]) : r[l][0] === "t" ? (l > 0 && ["Q", "q", "T", "t"].indexOf(r[l - 1][0]) > -1 ? f = new t0(h[0], h[1], 2 * h[0] - c[0], 2 * h[1] - c[1], h[0] + r[l][1], h[1] + r[l][2]) : f = new J(h[0], h[0] + r[l][1], h[1], h[1] + r[l][2]), e = e + f.getTotalLength(), c = [2 * h[0] - c[0], 2 * h[1] - c[1]], h = [r[l][1] + h[0], r[l][2] + h[0]], o.push(f)) : r[l][0] === "A" ? (f = new bt(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 + f.getTotalLength(), h = [r[l][6], r[l][7]], o.push(f)) : r[l][0] === "a" && (f = new bt(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 + f.getTotalLength(), h = [h[0] + r[l][6], h[1] + r[l][7]], o.push(f)), t.push(e);
2815
+ return i;
2816
+ }
2817
+ i.getTotalLength = function() {
2818
+ return e;
2819
+ }, i.getPointAtLength = function(s) {
2820
+ var r = a(s);
2821
+ return o[r.i].getPointAtLength(r.fraction);
2822
+ }, i.getTangentAtLength = function(s) {
2823
+ var r = a(s);
2824
+ return o[r.i].getTangentAtLength(r.fraction);
2825
+ }, i.getPropertiesAtLength = function(s) {
2826
+ var r = a(s);
2827
+ return o[r.i].getPropertiesAtLength(r.fraction);
2828
+ };
2829
+ var a = function(s) {
2830
+ s < 0 ? s = 0 : s > e && (s = e);
2831
+ for (var r = t.length - 1; t[r] >= s && t[r] > 0; )
2832
+ r--;
2833
+ return r++, { fraction: s - t[r - 1], i: r };
2834
+ };
2835
+ return i(n);
2836
+ }
2837
+ function O0(n, e) {
2838
+ return Math.sqrt((n[0] - e[0]) * (n[0] - e[0]) + (n[1] - e[1]) * (n[1] - e[1]));
2839
+ }
2840
+ function qt(n, e, t) {
2841
+ return [n[0] + (e[0] - n[0]) * t, n[1] + (e[1] - n[1]) * t];
2842
+ }
2843
+ function Be(n, e) {
2844
+ return O0(n, e) < 1e-9;
2845
+ }
2846
+ function je(n, e, t) {
2847
+ let o = n.map((i, a) => Ue(i, e[a]));
2848
+ return function(i) {
2849
+ let a = o.map((s) => s(i));
2850
+ return t ? $e(a) : a;
2851
+ };
2852
+ }
2853
+ function Ue(n, e) {
2854
+ return function(t) {
2855
+ return n.map((o, i) => o + t * (e[i] - o));
2856
+ };
2857
+ }
2858
+ function I0(n) {
2859
+ return typeof n == "number" && isFinite(n);
2860
+ }
2861
+ const Q0 = `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).
2862
+ Example valid ways of supplying a shape would be:
2863
+ [[0, 0], [10, 0], [10, 10]]
2864
+ "M0,0 L10,0 L10,10Z"
2865
+ `;
2866
+ function ze(n) {
2867
+ return new Ae(n).abs();
2868
+ }
2869
+ function He(n) {
2870
+ return n.toString().split("M").map((e, t) => (e = e.trim(), t && e ? "M" + e : e)).filter((e) => e);
2871
+ }
2872
+ function $e(n) {
2873
+ return "M" + n.join("L") + "Z";
2874
+ }
2875
+ function Ye(n, e) {
2876
+ let t = ze(n);
2877
+ return Xe(t) || Ge(t, e);
2878
+ }
2879
+ function Xe(n) {
2880
+ let e = n.segments || [], t = [];
2881
+ if (!e.length || e[0][0] !== "M")
2882
+ return !1;
2883
+ for (let o = 0; o < e.length; o++) {
2884
+ let [i, a, s] = e[o];
2885
+ if (i === "M" && o || i === "Z")
2886
+ break;
2887
+ if (i === "M" || i === "L")
2888
+ t.push([a, s]);
2889
+ else if (i === "H")
2890
+ t.push([a, t[t.length - 1][1]]);
2891
+ else if (i === "V")
2892
+ t.push([t[t.length - 1][0], a]);
2893
+ else
2894
+ return !1;
2895
+ }
2896
+ return t.length ? { ring: t } : !1;
2897
+ }
2898
+ function Ge(n, e) {
2899
+ let t = He(n)[0], o = [], i, a, s = 3;
2900
+ if (!t)
2901
+ throw new TypeError(Q0);
2902
+ a = Ze(t), i = a.getTotalLength(), e && I0(e) && e > 0 && (s = Math.max(s, Math.ceil(i / e)));
2903
+ for (let r = 0; r < s; r++) {
2904
+ let h = a.getPointAtLength(i * r / s);
2905
+ o.push([h.x, h.y]);
2906
+ }
2907
+ return {
2908
+ ring: o,
2909
+ skipBisect: !0
2910
+ };
2911
+ }
2912
+ function Ze(n) {
2913
+ if (typeof window < "u" && window && window.document)
2914
+ try {
2915
+ let e = window.document.createElementNS("http://www.w3.org/2000/svg", "path");
2916
+ return e.setAttributeNS(null, "d", n), e;
2917
+ } catch {
2918
+ }
2919
+ return De(n);
2920
+ }
2921
+ function Mt(n, e) {
2922
+ const t = n.length + e, o = ue(n) / e;
2923
+ let i = 0, a = 0, s = o / 2;
2924
+ for (; n.length < t; ) {
2925
+ let r = n[i], h = n[(i + 1) % n.length], c = O0(r, h);
2926
+ if (s <= a + c) {
2927
+ n.splice(i + 1, 0, c ? qt(r, h, (s - a) / c) : r.slice(0)), s += o;
2928
+ continue;
2929
+ }
2930
+ a += c, i++;
2931
+ }
2932
+ }
2933
+ function We(n, e = 1 / 0) {
2934
+ for (let t = 0; t < n.length; t++) {
2935
+ let o = n[t], i = t === n.length - 1 ? n[0] : n[t + 1];
2936
+ for (; O0(o, i) > e; )
2937
+ i = qt(o, i, 0.5), n.splice(t + 1, 0, i);
2938
+ }
2939
+ }
2940
+ function Lt(n, e) {
2941
+ let t, o, i;
2942
+ if (typeof n == "string") {
2943
+ let a = Ye(n, e);
2944
+ n = a.ring, i = a.skipBisect;
2945
+ } else if (!Array.isArray(n))
2946
+ throw new TypeError(Q0);
2947
+ if (t = n.slice(0), !Ke(t))
2948
+ throw new TypeError(Q0);
2949
+ return t.length > 1 && Be(t[0], t[t.length - 1]) && t.pop(), o = ce(t), o > 0 && t.reverse(), !i && e && I0(e) && e > 0 && We(t, e), t;
2950
+ }
2951
+ function Ke(n) {
2952
+ return n.every(function(e) {
2953
+ return Array.isArray(e) && e.length >= 2 && I0(e[0]) && I0(e[1]);
2954
+ });
2955
+ }
2956
+ function Ve(n, e) {
2957
+ let t = n.length, o = 1 / 0, i, a, s;
2958
+ for (let r = 0; r < t; r++)
2959
+ a = 0, e.forEach(function(h, c) {
2960
+ let f = O0(n[(r + c) % t], h);
2961
+ a += f * f;
2962
+ }), a < o && (o = a, i = r);
2963
+ i && (s = n.splice(0, i), n.splice(n.length, 0, ...s));
2964
+ }
2965
+ function Qe(n, e, { maxSegmentLength: t = 10, string: o = !0 } = {}) {
2966
+ let i = Lt(n, t), a = Lt(e, t), s = Je(i, a, o);
2967
+ 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);
2968
+ }
2969
+ function Je(n, e, t) {
2970
+ let o;
2971
+ return o = n.length - e.length, Mt(n, o < 0 ? o * -1 : 0), Mt(e, o > 0 ? o : 0), Ve(n, e), je(n, e, t);
2972
+ }
2973
+ var _0 = { exports: {} }, Tt;
2974
+ function tn() {
2975
+ if (Tt) return _0.exports;
2976
+ Tt = 1, _0.exports = n, _0.exports.default = n;
2977
+ function n(g, d, p) {
2978
+ p = p || 2;
2979
+ var v = d && d.length, w = v ? d[0] * p : g.length, m = e(g, 0, w, p, !0), b = [];
2980
+ if (!m || m.next === m.prev) return b;
2981
+ var T, k, I, U, D, R, G;
2982
+ if (v && (m = h(g, d, m, p)), g.length > 80 * p) {
2983
+ T = I = g[0], k = U = g[1];
2984
+ for (var B = p; B < w; B += p)
2985
+ D = g[B], R = g[B + 1], D < T && (T = D), R < k && (k = R), D > I && (I = D), R > U && (U = R);
2986
+ G = Math.max(I - T, U - k), G = G !== 0 ? 32767 / G : 0;
2987
+ }
2988
+ return o(m, b, p, T, k, G, 0), b;
2989
+ }
2990
+ function e(g, d, p, v, w) {
2991
+ var m, b;
2992
+ if (w === k0(g, d, p, v) > 0)
2993
+ for (m = d; m < p; m += v) b = u0(m, g[m], g[m + 1], b);
2994
+ else
2995
+ for (m = p - v; m >= d; m -= v) b = u0(m, g[m], g[m + 1], b);
2996
+ return b && S(b, b.next) && (h0(b), b = b.next), b;
2997
+ }
2998
+ function t(g, d) {
2999
+ if (!g) return g;
3000
+ d || (d = g);
3001
+ var p = g, v;
3002
+ do
3003
+ if (v = !1, !p.steiner && (S(p, p.next) || L(p.prev, p, p.next) === 0)) {
3004
+ if (h0(p), p = d = p.prev, p === p.next) break;
3005
+ v = !0;
3006
+ } else
3007
+ p = p.next;
3008
+ while (v || p !== d);
3009
+ return d;
3010
+ }
3011
+ function o(g, d, p, v, w, m, b) {
3012
+ if (g) {
3013
+ !b && m && u(g, v, w, m);
3014
+ for (var T = g, k, I; g.prev !== g.next; ) {
3015
+ if (k = g.prev, I = g.next, m ? a(g, v, w, m) : i(g)) {
3016
+ d.push(k.i / p | 0), d.push(g.i / p | 0), d.push(I.i / p | 0), h0(g), g = I.next, T = I.next;
3017
+ continue;
3018
+ }
3019
+ if (g = I, g === T) {
3020
+ b ? b === 1 ? (g = s(t(g), d, p), o(g, d, p, v, w, m, 2)) : b === 2 && r(g, d, p, v, w, m) : o(t(g), d, p, v, w, m, 1);
3021
+ break;
3022
+ }
3023
+ }
3024
+ }
3025
+ }
3026
+ function i(g) {
3027
+ var d = g.prev, p = g, v = g.next;
3028
+ if (L(d, p, v) >= 0) return !1;
3029
+ for (var w = d.x, m = p.x, b = v.x, T = d.y, k = p.y, I = v.y, U = w < m ? w < b ? w : b : m < b ? m : b, D = T < k ? T < I ? T : I : k < I ? k : I, R = w > m ? w > b ? w : b : m > b ? m : b, G = T > k ? T > I ? T : I : k > I ? k : I, B = v.next; B !== d; ) {
3030
+ if (B.x >= U && B.x <= R && B.y >= D && B.y <= G && C(w, T, m, k, b, I, B.x, B.y) && L(B.prev, B, B.next) >= 0) return !1;
3031
+ B = B.next;
3032
+ }
3033
+ return !0;
3034
+ }
3035
+ function a(g, d, p, v) {
3036
+ var w = g.prev, m = g, b = g.next;
3037
+ if (L(w, m, b) >= 0) return !1;
3038
+ for (var T = w.x, k = m.x, I = b.x, U = w.y, D = m.y, R = b.y, G = T < k ? T < I ? T : I : k < I ? k : I, B = U < D ? U < R ? U : R : D < R ? D : R, L0 = T > k ? T > I ? T : I : k > I ? k : I, T0 = U > D ? U > R ? U : R : D > R ? D : R, rt = y(G, B, d, p, v), it = y(L0, T0, d, p, v), q = g.prevZ, N = g.nextZ; q && q.z >= rt && N && N.z <= it; ) {
3039
+ if (q.x >= G && q.x <= L0 && q.y >= B && q.y <= T0 && q !== w && q !== b && C(T, U, k, D, I, R, q.x, q.y) && L(q.prev, q, q.next) >= 0 || (q = q.prevZ, N.x >= G && N.x <= L0 && N.y >= B && N.y <= T0 && N !== w && N !== b && C(T, U, k, D, I, R, N.x, N.y) && L(N.prev, N, N.next) >= 0)) return !1;
3040
+ N = N.nextZ;
3041
+ }
3042
+ for (; q && q.z >= rt; ) {
3043
+ if (q.x >= G && q.x <= L0 && q.y >= B && q.y <= T0 && q !== w && q !== b && C(T, U, k, D, I, R, q.x, q.y) && L(q.prev, q, q.next) >= 0) return !1;
3044
+ q = q.prevZ;
3045
+ }
3046
+ for (; N && N.z <= it; ) {
3047
+ if (N.x >= G && N.x <= L0 && N.y >= B && N.y <= T0 && N !== w && N !== b && C(T, U, k, D, I, R, N.x, N.y) && L(N.prev, N, N.next) >= 0) return !1;
3048
+ N = N.nextZ;
3049
+ }
3050
+ return !0;
3051
+ }
3052
+ function s(g, d, p) {
3053
+ var v = g;
3054
+ do {
3055
+ var w = v.prev, m = v.next.next;
3056
+ !S(w, m) && P(w, v, v.next, m) && j(w, m) && j(m, w) && (d.push(w.i / p | 0), d.push(v.i / p | 0), d.push(m.i / p | 0), h0(v), h0(v.next), v = g = m), v = v.next;
3057
+ } while (v !== g);
3058
+ return t(v);
3059
+ }
3060
+ function r(g, d, p, v, w, m) {
3061
+ var b = g;
3062
+ do {
3063
+ for (var T = b.next.next; T !== b.prev; ) {
3064
+ if (b.i !== T.i && E(b, T)) {
3065
+ var k = n0(b, T);
3066
+ b = t(b, b.next), k = t(k, k.next), o(b, d, p, v, w, m, 0), o(k, d, p, v, w, m, 0);
3067
+ return;
3068
+ }
3069
+ T = T.next;
3070
+ }
3071
+ b = b.next;
3072
+ } while (b !== g);
3073
+ }
3074
+ function h(g, d, p, v) {
3075
+ var w = [], m, b, T, k, I;
3076
+ for (m = 0, b = d.length; m < b; m++)
3077
+ T = d[m] * v, k = m < b - 1 ? d[m + 1] * v : g.length, I = e(g, T, k, v, !1), I === I.next && (I.steiner = !0), w.push(M(I));
3078
+ for (w.sort(c), m = 0; m < w.length; m++)
3079
+ p = f(w[m], p);
3080
+ return p;
3081
+ }
3082
+ function c(g, d) {
3083
+ return g.x - d.x;
3084
+ }
3085
+ function f(g, d) {
3086
+ var p = x(g, d);
3087
+ if (!p)
3088
+ return d;
3089
+ var v = n0(p, g);
3090
+ return t(v, v.next), t(p, p.next);
3091
+ }
3092
+ function x(g, d) {
3093
+ var p = d, v = g.x, w = g.y, m = -1 / 0, b;
3094
+ do {
3095
+ if (w <= p.y && w >= p.next.y && p.next.y !== p.y) {
3096
+ var T = p.x + (w - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
3097
+ if (T <= v && T > m && (m = T, b = p.x < p.next.x ? p : p.next, T === v))
3098
+ return b;
3099
+ }
3100
+ p = p.next;
3101
+ } while (p !== d);
3102
+ if (!b) return null;
3103
+ var k = b, I = b.x, U = b.y, D = 1 / 0, R;
3104
+ p = b;
3105
+ do
3106
+ v >= p.x && p.x >= I && v !== p.x && C(w < U ? v : m, w, I, U, w < U ? m : v, w, p.x, p.y) && (R = Math.abs(w - p.y) / (v - p.x), j(p, g) && (R < D || R === D && (p.x > b.x || p.x === b.x && l(b, p))) && (b = p, D = R)), p = p.next;
3107
+ while (p !== k);
3108
+ return b;
3109
+ }
3110
+ function l(g, d) {
3111
+ return L(g.prev, g, d.prev) < 0 && L(d.next, g, g.next) < 0;
3112
+ }
3113
+ function u(g, d, p, v) {
3114
+ var w = g;
3115
+ do
3116
+ w.z === 0 && (w.z = y(w.x, w.y, d, p, v)), w.prevZ = w.prev, w.nextZ = w.next, w = w.next;
3117
+ while (w !== g);
3118
+ w.prevZ.nextZ = null, w.prevZ = null, A(w);
3119
+ }
3120
+ function A(g) {
3121
+ var d, p, v, w, m, b, T, k, I = 1;
3122
+ do {
3123
+ for (p = g, g = null, m = null, b = 0; p; ) {
3124
+ for (b++, v = p, T = 0, d = 0; d < I && (T++, v = v.nextZ, !!v); d++)
3125
+ ;
3126
+ for (k = I; T > 0 || k > 0 && v; )
3127
+ T !== 0 && (k === 0 || !v || p.z <= v.z) ? (w = p, p = p.nextZ, T--) : (w = v, v = v.nextZ, k--), m ? m.nextZ = w : g = w, w.prevZ = m, m = w;
3128
+ p = v;
3129
+ }
3130
+ m.nextZ = null, I *= 2;
3131
+ } while (b > 1);
3132
+ return g;
3133
+ }
3134
+ function y(g, d, p, v, w) {
3135
+ return g = (g - p) * w | 0, d = (d - v) * w | 0, g = (g | g << 8) & 16711935, g = (g | g << 4) & 252645135, g = (g | g << 2) & 858993459, g = (g | g << 1) & 1431655765, d = (d | d << 8) & 16711935, d = (d | d << 4) & 252645135, d = (d | d << 2) & 858993459, d = (d | d << 1) & 1431655765, g | d << 1;
3136
+ }
3137
+ function M(g) {
3138
+ var d = g, p = g;
3139
+ do
3140
+ (d.x < p.x || d.x === p.x && d.y < p.y) && (p = d), d = d.next;
3141
+ while (d !== g);
3142
+ return p;
3143
+ }
3144
+ function C(g, d, p, v, w, m, b, T) {
3145
+ return (w - b) * (d - T) >= (g - b) * (m - T) && (g - b) * (v - T) >= (p - b) * (d - T) && (p - b) * (m - T) >= (w - b) * (v - T);
3146
+ }
3147
+ function E(g, d) {
3148
+ return g.next.i !== d.i && g.prev.i !== d.i && !Z(g, d) && // dones't intersect other edges
3149
+ (j(g, d) && j(d, g) && $(g, d) && // locally visible
3150
+ (L(g.prev, g, d.prev) || L(g, d.prev, d)) || // does not create opposite-facing sectors
3151
+ S(g, d) && L(g.prev, g, g.next) > 0 && L(d.prev, d, d.next) > 0);
3152
+ }
3153
+ function L(g, d, p) {
3154
+ return (d.y - g.y) * (p.x - d.x) - (d.x - g.x) * (p.y - d.y);
3155
+ }
3156
+ function S(g, d) {
3157
+ return g.x === d.x && g.y === d.y;
3158
+ }
3159
+ function P(g, d, p, v) {
3160
+ var w = z(L(g, d, p)), m = z(L(g, d, v)), b = z(L(p, v, g)), T = z(L(p, v, d));
3161
+ return !!(w !== m && b !== T || w === 0 && F(g, p, d) || m === 0 && F(g, v, d) || b === 0 && F(p, g, v) || T === 0 && F(p, d, v));
3162
+ }
3163
+ function F(g, d, p) {
3164
+ return d.x <= Math.max(g.x, p.x) && d.x >= Math.min(g.x, p.x) && d.y <= Math.max(g.y, p.y) && d.y >= Math.min(g.y, p.y);
3165
+ }
3166
+ function z(g) {
3167
+ return g > 0 ? 1 : g < 0 ? -1 : 0;
3168
+ }
3169
+ function Z(g, d) {
3170
+ var p = g;
3171
+ do {
3172
+ if (p.i !== g.i && p.next.i !== g.i && p.i !== d.i && p.next.i !== d.i && P(p, p.next, g, d)) return !0;
3173
+ p = p.next;
3174
+ } while (p !== g);
3175
+ return !1;
3176
+ }
3177
+ function j(g, d) {
3178
+ return L(g.prev, g, g.next) < 0 ? L(g, d, g.next) >= 0 && L(g, g.prev, d) >= 0 : L(g, d, g.prev) < 0 || L(g, g.next, d) < 0;
3179
+ }
3180
+ function $(g, d) {
3181
+ var p = g, v = !1, w = (g.x + d.x) / 2, m = (g.y + d.y) / 2;
3182
+ do
3183
+ p.y > m != p.next.y > m && p.next.y !== p.y && w < (p.next.x - p.x) * (m - p.y) / (p.next.y - p.y) + p.x && (v = !v), p = p.next;
3184
+ while (p !== g);
3185
+ return v;
3186
+ }
3187
+ function n0(g, d) {
3188
+ var p = new Q(g.i, g.x, g.y), v = new Q(d.i, d.x, d.y), w = g.next, m = d.prev;
3189
+ return g.next = d, d.prev = g, p.next = w, w.prev = p, v.next = p, p.prev = v, m.next = v, v.prev = m, v;
3190
+ }
3191
+ function u0(g, d, p, v) {
3192
+ var w = new Q(g, d, p);
3193
+ return v ? (w.next = v.next, w.prev = v, v.next.prev = w, v.next = w) : (w.prev = w, w.next = w), w;
3194
+ }
3195
+ function h0(g) {
3196
+ g.next.prev = g.prev, g.prev.next = g.next, g.prevZ && (g.prevZ.nextZ = g.nextZ), g.nextZ && (g.nextZ.prevZ = g.prevZ);
3197
+ }
3198
+ function Q(g, d, p) {
3199
+ this.i = g, this.x = d, this.y = p, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
3200
+ }
3201
+ n.deviation = function(g, d, p, v) {
3202
+ var w = d && d.length, m = w ? d[0] * p : g.length, b = Math.abs(k0(g, 0, m, p));
3203
+ if (w)
3204
+ for (var T = 0, k = d.length; T < k; T++) {
3205
+ var I = d[T] * p, U = T < k - 1 ? d[T + 1] * p : g.length;
3206
+ b -= Math.abs(k0(g, I, U, p));
3207
+ }
3208
+ var D = 0;
3209
+ for (T = 0; T < v.length; T += 3) {
3210
+ var R = v[T] * p, G = v[T + 1] * p, B = v[T + 2] * p;
3211
+ D += Math.abs(
3212
+ (g[R] - g[B]) * (g[G + 1] - g[R + 1]) - (g[R] - g[G]) * (g[B + 1] - g[R + 1])
3213
+ );
3214
+ }
3215
+ return b === 0 && D === 0 ? 0 : Math.abs((D - b) / b);
3216
+ };
3217
+ function k0(g, d, p, v) {
3218
+ for (var w = 0, m = d, b = p - v; m < p; m += v)
3219
+ w += (g[b] - g[m]) * (g[m + 1] + g[b + 1]), b = m;
3220
+ return w;
3221
+ }
3222
+ return n.flatten = function(g) {
3223
+ for (var d = g[0][0].length, p = { vertices: [], holes: [], dimensions: d }, v = 0, w = 0; w < g.length; w++) {
3224
+ for (var m = 0; m < g[w].length; m++)
3225
+ for (var b = 0; b < d; b++) p.vertices.push(g[w][m][b]);
3226
+ w > 0 && (v += g[w - 1].length, p.holes.push(v));
3227
+ }
3228
+ return p;
3229
+ }, _0.exports;
3230
+ }
3231
+ tn();
3232
+ function Nt(n, e) {
3233
+ return n < e ? -1 : n > e ? 1 : n >= e ? 0 : NaN;
3234
+ }
3235
+ function en(n) {
3236
+ return n.length === 1 && (n = nn(n)), {
3237
+ left: function(e, t, o, i) {
3238
+ for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
3239
+ var a = o + i >>> 1;
3240
+ n(e[a], t) < 0 ? o = a + 1 : i = a;
3241
+ }
3242
+ return o;
3243
+ },
3244
+ right: function(e, t, o, i) {
3245
+ for (o == null && (o = 0), i == null && (i = e.length); o < i; ) {
3246
+ var a = o + i >>> 1;
3247
+ n(e[a], t) > 0 ? i = a : o = a + 1;
3248
+ }
3249
+ return o;
3250
+ }
3251
+ };
3252
+ }
3253
+ function nn(n) {
3254
+ return function(e, t) {
3255
+ return Nt(n(e), t);
3256
+ };
3257
+ }
3258
+ en(Nt);
3259
+ function Tn(n, e, t = 3) {
3260
+ const o = Qe(n, e, { maxSegmentLength: t });
3261
+ return {
3262
+ check: (i) => typeof i == "string",
3263
+ interpolate: (i, a, s) => o(s)
3264
+ };
3265
+ }
3266
+ function Pn(n) {
3267
+ const e = (o) => n.width * o, t = (o) => n.height * o;
3268
+ return {
3269
+ scaleX: e,
3270
+ scaleY: t,
3271
+ position: (o, i) => Y({
3272
+ x: e(o),
3273
+ y: t(i)
3274
+ })
3275
+ };
3276
+ }
3277
+ function Cn(n) {
3278
+ const e = [];
3279
+ if (n.isAllKey) {
3280
+ for (let t = 0; t <= n.animations.length; t++)
3281
+ e.push(t);
3282
+ return e;
3283
+ }
3284
+ return n.isStartKey && e.push(0), n.animations.forEach((t, o) => {
3285
+ Array.isArray(t) ? t.some((i) => i.isKey) && e.push(o + 1) : t.isKey && e.push(o + 1);
3286
+ }), n.isEndKey && e[e.length - 1] !== n.animations.length && e.push(n.animations.length), e;
3287
+ }
3288
+ export {
3289
+ g0 as Alignment,
3290
+ e0 as Anchor,
3291
+ et as Animate,
3292
+ un as Arrow,
3293
+ An as BrowserCanvasRenderer,
3294
+ fn as Circle,
3295
+ X as Color,
3296
+ tt as Easing,
3297
+ on as FadeIn,
3298
+ sn as FadeOut,
3299
+ f1 as FontStyle,
3300
+ p1 as FontWeight,
3301
+ gn as Grid,
3302
+ ot as Group,
3303
+ an as Hide,
3304
+ ln as IFrame,
3305
+ pn as Image,
3306
+ dn as Line,
3307
+ xn as Mask,
3308
+ H as ObjectType,
3309
+ Ln as Opaque,
3310
+ yn as Path,
3311
+ mn as Pause,
3312
+ vn as Polygon,
3313
+ Y as Position,
3314
+ M1 as Presentation,
3315
+ wn as Rectangle,
3316
+ cn as ScreenCapture,
3317
+ hn as Show,
3318
+ d0 as Size,
3319
+ bn as Slide,
3320
+ a0 as SlideObject,
3321
+ Ct as SlideWebExtra,
3322
+ v1 as Text,
3323
+ Mn as TextUnit,
3324
+ u1 as Transparent,
3325
+ Pt as Update,
3326
+ Cn as getKeySlideBuildIndices,
3327
+ Pn as getSizingFunctions,
3328
+ Tn as getSmoothPathInterpolator,
3329
+ y1 as getTextContentLength,
3330
+ C1 as interpolateColor,
3331
+ S1 as interpolateNumber
3332
+ };