@bug-on/m3-expressive 1.0.0

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 (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +110 -0
  3. package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
  4. package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  5. package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  6. package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  7. package/dist/assets/loading-indicator.svg +19 -0
  8. package/dist/assets/material-symbols-cdn.css +65 -0
  9. package/dist/assets/material-symbols-self-hosted.css +94 -0
  10. package/dist/buttons.d.mts +180 -0
  11. package/dist/buttons.d.ts +180 -0
  12. package/dist/buttons.js +4282 -0
  13. package/dist/buttons.js.map +1 -0
  14. package/dist/buttons.mjs +4227 -0
  15. package/dist/buttons.mjs.map +1 -0
  16. package/dist/core.d.mts +422 -0
  17. package/dist/core.d.ts +422 -0
  18. package/dist/core.js +2581 -0
  19. package/dist/core.js.map +1 -0
  20. package/dist/core.mjs +2547 -0
  21. package/dist/core.mjs.map +1 -0
  22. package/dist/feedback.d.mts +600 -0
  23. package/dist/feedback.d.ts +600 -0
  24. package/dist/feedback.js +2357 -0
  25. package/dist/feedback.js.map +1 -0
  26. package/dist/feedback.mjs +2321 -0
  27. package/dist/feedback.mjs.map +1 -0
  28. package/dist/forms.d.mts +40 -0
  29. package/dist/forms.d.ts +40 -0
  30. package/dist/forms.js +4263 -0
  31. package/dist/forms.js.map +1 -0
  32. package/dist/forms.mjs +4228 -0
  33. package/dist/forms.mjs.map +1 -0
  34. package/dist/icon-button-D-gs0gfj.d.mts +136 -0
  35. package/dist/icon-button-D-gs0gfj.d.ts +136 -0
  36. package/dist/index.css +309 -0
  37. package/dist/index.css.d.ts +2 -0
  38. package/dist/index.d.mts +24 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.js +23972 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +23668 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/layout.d.mts +610 -0
  45. package/dist/layout.d.ts +610 -0
  46. package/dist/layout.js +5091 -0
  47. package/dist/layout.js.map +1 -0
  48. package/dist/layout.mjs +5042 -0
  49. package/dist/layout.mjs.map +1 -0
  50. package/dist/material-symbols-cdn.css +65 -0
  51. package/dist/material-symbols-cdn.css.d.ts +2 -0
  52. package/dist/material-symbols-self-hosted.css +94 -0
  53. package/dist/material-symbols-self-hosted.css.d.ts +2 -0
  54. package/dist/md3-DFhj-NZj.d.mts +17 -0
  55. package/dist/md3-DFhj-NZj.d.ts +17 -0
  56. package/dist/navigation.d.mts +2766 -0
  57. package/dist/navigation.d.ts +2766 -0
  58. package/dist/navigation.js +6684 -0
  59. package/dist/navigation.js.map +1 -0
  60. package/dist/navigation.mjs +6573 -0
  61. package/dist/navigation.mjs.map +1 -0
  62. package/dist/overlays.d.mts +161 -0
  63. package/dist/overlays.d.ts +161 -0
  64. package/dist/overlays.js +3298 -0
  65. package/dist/overlays.js.map +1 -0
  66. package/dist/overlays.mjs +3244 -0
  67. package/dist/overlays.mjs.map +1 -0
  68. package/dist/pickers.d.mts +1074 -0
  69. package/dist/pickers.d.ts +1074 -0
  70. package/dist/pickers.js +4240 -0
  71. package/dist/pickers.js.map +1 -0
  72. package/dist/pickers.mjs +4200 -0
  73. package/dist/pickers.mjs.map +1 -0
  74. package/dist/plugin.d.mts +1 -0
  75. package/dist/plugin.d.ts +1 -0
  76. package/dist/plugin.js +13 -0
  77. package/dist/plugin.js.map +1 -0
  78. package/dist/plugin.mjs +3 -0
  79. package/dist/plugin.mjs.map +1 -0
  80. package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
  81. package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
  82. package/dist/shapes.d.mts +1119 -0
  83. package/dist/shapes.d.ts +1119 -0
  84. package/dist/shapes.js +2941 -0
  85. package/dist/shapes.js.map +1 -0
  86. package/dist/shapes.mjs +2889 -0
  87. package/dist/shapes.mjs.map +1 -0
  88. package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
  89. package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
  90. package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
  91. package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
  92. package/dist/text-field-eAIpz9z1.d.mts +1038 -0
  93. package/dist/text-field-eAIpz9z1.d.ts +1038 -0
  94. package/dist/typography-339RV6v7.d.mts +486 -0
  95. package/dist/typography-339RV6v7.d.ts +486 -0
  96. package/dist/typography.css +22 -0
  97. package/dist/typography.css.d.ts +2 -0
  98. package/package.json +207 -0
@@ -0,0 +1,2889 @@
1
+ "use client";
2
+ import { useMemo, useState, useRef, useEffect, useCallback } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var __defProp = Object.defineProperty;
6
+ var __defProps = Object.defineProperties;
7
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+
25
+ // src/shapes/core/features.ts
26
+ function cornerFeature(cubics, convex2) {
27
+ return { type: "corner", cubics, convex: convex2 };
28
+ }
29
+ function edgeFeature(cubics) {
30
+ return { type: "edge", cubics };
31
+ }
32
+ function transformFeature(feature, fn) {
33
+ const cubics = feature.cubics.map((c) => c.transformed(fn));
34
+ if (feature.type === "corner") {
35
+ return cornerFeature(cubics, feature.convex);
36
+ }
37
+ return edgeFeature(cubics);
38
+ }
39
+
40
+ // src/shapes/math/corner-rounding.ts
41
+ function cornerRounding(radius = 0, smoothing = 0) {
42
+ return { radius, smoothing };
43
+ }
44
+ var UNROUNDED = Object.freeze({
45
+ radius: 0,
46
+ smoothing: 0
47
+ });
48
+
49
+ // src/shapes/utils/utils.ts
50
+ var DISTANCE_EPSILON = 1e-4;
51
+ var ANGLE_EPSILON = 1e-4;
52
+ var FLOAT_PI = Math.PI;
53
+ function distance(dx, dy) {
54
+ return Math.sqrt(dx * dx + dy * dy);
55
+ }
56
+ function distanceSquared(dx, dy) {
57
+ return dx * dx + dy * dy;
58
+ }
59
+ function radialToCartesian(radius, angle) {
60
+ return [radius * Math.cos(angle), radius * Math.sin(angle)];
61
+ }
62
+ function positiveModulo(value, divisor) {
63
+ return (value % divisor + divisor) % divisor;
64
+ }
65
+ function interpolate(start, stop, fraction) {
66
+ return start + (stop - start) * fraction;
67
+ }
68
+ function square(value) {
69
+ return value * value;
70
+ }
71
+ function directionVector(dx, dy) {
72
+ const d = distance(dx, dy);
73
+ if (d < DISTANCE_EPSILON) return [0, 0];
74
+ return [dx / d, dy / d];
75
+ }
76
+ function convex(prevX, prevY, currX, currY, nextX, nextY) {
77
+ const v1x = currX - prevX;
78
+ const v1y = currY - prevY;
79
+ const v2x = nextX - currX;
80
+ const v2y = nextY - currY;
81
+ return v1x * v2y - v1y * v2x > 0;
82
+ }
83
+
84
+ // src/shapes/math/point.ts
85
+ function point(x, y) {
86
+ return { x, y };
87
+ }
88
+ function getDistance(p) {
89
+ return distance(p.x, p.y);
90
+ }
91
+ function getDistanceSquared(p) {
92
+ return p.x * p.x + p.y * p.y;
93
+ }
94
+ function dotProduct(a, b) {
95
+ return a.x * b.x + a.y * b.y;
96
+ }
97
+ function rotate90(p) {
98
+ return { x: -p.y, y: p.x };
99
+ }
100
+ function getDirection(p) {
101
+ const d = getDistance(p);
102
+ if (d < DISTANCE_EPSILON)
103
+ throw new Error("Can't get direction of zero-length vector");
104
+ return { x: p.x / d, y: p.y / d };
105
+ }
106
+ function clockwise(p0, p1, p2) {
107
+ const v1x = p1.x - p0.x;
108
+ const v1y = p1.y - p0.y;
109
+ const v2x = p2.x - p1.x;
110
+ const v2y = p2.y - p1.y;
111
+ return v1x * v2y - v1y * v2x > 0;
112
+ }
113
+ function addPoints(a, b) {
114
+ return { x: a.x + b.x, y: a.y + b.y };
115
+ }
116
+ function subtractPoints(a, b) {
117
+ return { x: a.x - b.x, y: a.y - b.y };
118
+ }
119
+ function scalePoint(p, scalar) {
120
+ return { x: p.x * scalar, y: p.y * scalar };
121
+ }
122
+ function dividePoint(p, scalar) {
123
+ return { x: p.x / scalar, y: p.y / scalar };
124
+ }
125
+ function lerpPoint(start, stop, fraction) {
126
+ return {
127
+ x: interpolate(start.x, stop.x, fraction),
128
+ y: interpolate(start.y, stop.y, fraction)
129
+ };
130
+ }
131
+ function transformPoint(p, fn) {
132
+ const [tx, ty] = fn(p.x, p.y);
133
+ return { x: tx, y: ty };
134
+ }
135
+
136
+ // src/shapes/math/cubic.ts
137
+ var Cubic = class _Cubic {
138
+ constructor(points) {
139
+ if (points.length !== 8)
140
+ throw new Error("Cubic points array must have exactly 8 elements");
141
+ this.points = points;
142
+ }
143
+ /** First anchor point X */
144
+ get anchor0X() {
145
+ return this.points[0];
146
+ }
147
+ /** First anchor point Y */
148
+ get anchor0Y() {
149
+ return this.points[1];
150
+ }
151
+ /** First control point X */
152
+ get control0X() {
153
+ return this.points[2];
154
+ }
155
+ /** First control point Y */
156
+ get control0Y() {
157
+ return this.points[3];
158
+ }
159
+ /** Second control point X */
160
+ get control1X() {
161
+ return this.points[4];
162
+ }
163
+ /** Second control point Y */
164
+ get control1Y() {
165
+ return this.points[5];
166
+ }
167
+ /** Second anchor point X */
168
+ get anchor1X() {
169
+ return this.points[6];
170
+ }
171
+ /** Second anchor point Y */
172
+ get anchor1Y() {
173
+ return this.points[7];
174
+ }
175
+ /**
176
+ * Returns a point on the curve at parameter t (0=start, 1=end).
177
+ * Uses the standard cubic Bézier formula.
178
+ * @param t - Parameter in [0, 1]
179
+ */
180
+ pointOnCurve(t) {
181
+ const u = 1 - t;
182
+ return point(
183
+ this.anchor0X * (u * u * u) + this.control0X * (3 * t * u * u) + this.control1X * (3 * t * t * u) + this.anchor1X * (t * t * t),
184
+ this.anchor0Y * (u * u * u) + this.control0Y * (3 * t * u * u) + this.control1Y * (3 * t * t * u) + this.anchor1Y * (t * t * t)
185
+ );
186
+ }
187
+ /**
188
+ * Returns true if this curve has (near) zero length.
189
+ */
190
+ zeroLength() {
191
+ return Math.abs(this.anchor0X - this.anchor1X) < DISTANCE_EPSILON && Math.abs(this.anchor0Y - this.anchor1Y) < DISTANCE_EPSILON;
192
+ }
193
+ /**
194
+ * Splits this cubic at parameter t, returning two cubics.
195
+ * Uses De Casteljau's algorithm.
196
+ * @param t - Split parameter in [0, 1]
197
+ * @returns [left, right] pair
198
+ */
199
+ split(t) {
200
+ const u = 1 - t;
201
+ const mid = this.pointOnCurve(t);
202
+ const left = new _Cubic([
203
+ this.anchor0X,
204
+ this.anchor0Y,
205
+ this.anchor0X * u + this.control0X * t,
206
+ this.anchor0Y * u + this.control0Y * t,
207
+ this.anchor0X * (u * u) + this.control0X * (2 * u * t) + this.control1X * (t * t),
208
+ this.anchor0Y * (u * u) + this.control0Y * (2 * u * t) + this.control1Y * (t * t),
209
+ mid.x,
210
+ mid.y
211
+ ]);
212
+ const right = new _Cubic([
213
+ mid.x,
214
+ mid.y,
215
+ this.control0X * (u * u) + this.control1X * (2 * u * t) + this.anchor1X * (t * t),
216
+ this.control0Y * (u * u) + this.control1Y * (2 * u * t) + this.anchor1Y * (t * t),
217
+ this.control1X * u + this.anchor1X * t,
218
+ this.control1Y * u + this.anchor1Y * t,
219
+ this.anchor1X,
220
+ this.anchor1Y
221
+ ]);
222
+ return [left, right];
223
+ }
224
+ /**
225
+ * Returns a reversed copy of this cubic (anchor0 ↔ anchor1, controls swapped).
226
+ */
227
+ reverse() {
228
+ return new _Cubic([
229
+ this.anchor1X,
230
+ this.anchor1Y,
231
+ this.control1X,
232
+ this.control1Y,
233
+ this.control0X,
234
+ this.control0Y,
235
+ this.anchor0X,
236
+ this.anchor0Y
237
+ ]);
238
+ }
239
+ /**
240
+ * Calculates the axis-aligned bounding box.
241
+ * @param approximate - If true, uses control point hull (faster). Default: false.
242
+ * @returns [minX, minY, maxX, maxY]
243
+ */
244
+ calculateBounds(approximate = false) {
245
+ if (this.zeroLength()) {
246
+ return [this.anchor0X, this.anchor0Y, this.anchor0X, this.anchor0Y];
247
+ }
248
+ let minX = Math.min(this.anchor0X, this.anchor1X);
249
+ let minY = Math.min(this.anchor0Y, this.anchor1Y);
250
+ let maxX = Math.max(this.anchor0X, this.anchor1X);
251
+ let maxY = Math.max(this.anchor0Y, this.anchor1Y);
252
+ if (approximate) {
253
+ minX = Math.min(minX, this.control0X, this.control1X);
254
+ minY = Math.min(minY, this.control0Y, this.control1Y);
255
+ maxX = Math.max(maxX, this.control0X, this.control1X);
256
+ maxY = Math.max(maxY, this.control0Y, this.control1Y);
257
+ return [minX, minY, maxX, maxY];
258
+ }
259
+ const xa = -this.anchor0X + 3 * this.control0X - 3 * this.control1X + this.anchor1X;
260
+ const xb = 2 * this.anchor0X - 4 * this.control0X + 2 * this.control1X;
261
+ const xc = -this.anchor0X + this.control0X;
262
+ const expandX = (t) => {
263
+ if (t >= 0 && t <= 1) {
264
+ const v = this.pointOnCurve(t).x;
265
+ if (v < minX) minX = v;
266
+ if (v > maxX) maxX = v;
267
+ }
268
+ };
269
+ if (Math.abs(xa) < DISTANCE_EPSILON) {
270
+ if (xb !== 0) expandX(2 * xc / (-2 * xb));
271
+ } else {
272
+ const xs = xb * xb - 4 * xa * xc;
273
+ if (xs >= 0) {
274
+ expandX((-xb + Math.sqrt(xs)) / (2 * xa));
275
+ expandX((-xb - Math.sqrt(xs)) / (2 * xa));
276
+ }
277
+ }
278
+ const ya = -this.anchor0Y + 3 * this.control0Y - 3 * this.control1Y + this.anchor1Y;
279
+ const yb = 2 * this.anchor0Y - 4 * this.control0Y + 2 * this.control1Y;
280
+ const yc = -this.anchor0Y + this.control0Y;
281
+ const expandY = (t) => {
282
+ if (t >= 0 && t <= 1) {
283
+ const v = this.pointOnCurve(t).y;
284
+ if (v < minY) minY = v;
285
+ if (v > maxY) maxY = v;
286
+ }
287
+ };
288
+ if (Math.abs(ya) < DISTANCE_EPSILON) {
289
+ if (yb !== 0) expandY(2 * yc / (-2 * yb));
290
+ } else {
291
+ const ys = yb * yb - 4 * ya * yc;
292
+ if (ys >= 0) {
293
+ expandY((-yb + Math.sqrt(ys)) / (2 * ya));
294
+ expandY((-yb - Math.sqrt(ys)) / (2 * ya));
295
+ }
296
+ }
297
+ return [minX, minY, maxX, maxY];
298
+ }
299
+ /**
300
+ * Interpolates between this cubic and another at fraction t.
301
+ * @param other - Target cubic
302
+ * @param t - Fraction [0, 1]
303
+ */
304
+ interpolateTo(other, t) {
305
+ return new _Cubic(
306
+ this.points.map((v, i) => interpolate(v, other.points[i], t))
307
+ );
308
+ }
309
+ /**
310
+ * Applies a PointTransformer to all anchor and control points.
311
+ * @param fn - The transform function
312
+ */
313
+ transformed(fn) {
314
+ const p = this.points.slice();
315
+ for (let i = 0; i < 8; i += 2) {
316
+ const [tx, ty] = fn(p[i], p[i + 1]);
317
+ p[i] = tx;
318
+ p[i + 1] = ty;
319
+ }
320
+ return new _Cubic(p);
321
+ }
322
+ toString() {
323
+ return `Cubic(a0=(${this.anchor0X},${this.anchor0Y}) c0=(${this.control0X},${this.control0Y}) c1=(${this.control1X},${this.control1Y}) a1=(${this.anchor1X},${this.anchor1Y}))`;
324
+ }
325
+ // ─── Static factories ─────────────────────────────────────────────────────
326
+ /**
327
+ * Creates a cubic representing a straight line.
328
+ * Control points lie at 1/3 and 2/3 of the line.
329
+ * @param x0 - Start anchor X
330
+ * @param y0 - Start anchor Y
331
+ * @param x1 - End anchor X
332
+ * @param y1 - End anchor Y
333
+ */
334
+ static straightLine(x0, y0, x1, y1) {
335
+ return new _Cubic([
336
+ x0,
337
+ y0,
338
+ interpolate(x0, x1, 1 / 3),
339
+ interpolate(y0, y1, 1 / 3),
340
+ interpolate(x0, x1, 2 / 3),
341
+ interpolate(y0, y1, 2 / 3),
342
+ x1,
343
+ y1
344
+ ]);
345
+ }
346
+ /**
347
+ * Creates a cubic approximating a circular arc.
348
+ * p0 and p1 must be equidistant from the center.
349
+ * For arcs > 180°, use multiple cubics.
350
+ *
351
+ * @param centerX - Arc center X
352
+ * @param centerY - Arc center Y
353
+ * @param x0 - Start point X (on circle)
354
+ * @param y0 - Start point Y (on circle)
355
+ * @param x1 - End point X (on circle)
356
+ * @param y1 - End point Y (on circle)
357
+ */
358
+ static circularArc(centerX, centerY, x0, y0, x1, y1) {
359
+ const p0dx = x0 - centerX;
360
+ const p0dy = y0 - centerY;
361
+ const p1dx = x1 - centerX;
362
+ const p1dy = y1 - centerY;
363
+ const d0 = Math.sqrt(p0dx * p0dx + p0dy * p0dy);
364
+ const d1 = Math.sqrt(p1dx * p1dx + p1dy * p1dy);
365
+ if (d0 < DISTANCE_EPSILON || d1 < DISTANCE_EPSILON) {
366
+ return _Cubic.straightLine(x0, y0, x1, y1);
367
+ }
368
+ const nx0 = p0dx / d0, ny0 = p0dy / d0;
369
+ const nx1 = p1dx / d1, ny1 = p1dy / d1;
370
+ const rx0 = -ny0, ry0 = nx0;
371
+ const rx1 = -ny1, ry1 = nx1;
372
+ const cosa = nx0 * nx1 + ny0 * ny1;
373
+ if (cosa > 0.999) return _Cubic.straightLine(x0, y0, x1, y1);
374
+ const clockwise2 = rx0 * p1dx + ry0 * p1dy >= 0;
375
+ const k = d0 * (4 / 3) * (Math.sqrt(2 * (1 - cosa)) - Math.sqrt(1 - square(cosa))) / (1 - cosa) * (clockwise2 ? 1 : -1);
376
+ return new _Cubic([
377
+ x0,
378
+ y0,
379
+ x0 + rx0 * k,
380
+ y0 + ry0 * k,
381
+ x1 - rx1 * k,
382
+ y1 - ry1 * k,
383
+ x1,
384
+ y1
385
+ ]);
386
+ }
387
+ /**
388
+ * Creates a zero-length cubic at the given point.
389
+ * @param x - X coordinate
390
+ * @param y - Y coordinate
391
+ */
392
+ static empty(x, y) {
393
+ return new _Cubic([x, y, x, y, x, y, x, y]);
394
+ }
395
+ };
396
+ var MutableCubic = class extends Cubic {
397
+ constructor() {
398
+ super([0, 0, 0, 0, 0, 0, 0, 0]);
399
+ }
400
+ /**
401
+ * Mutably interpolates between c1 and c2 at the given progress.
402
+ * @param c1 - Start cubic
403
+ * @param c2 - End cubic
404
+ * @param progress - Interpolation factor [0, 1]
405
+ */
406
+ interpolate(c1, c2, progress) {
407
+ for (let i = 0; i < 8; i++) {
408
+ this.points[i] = interpolate(
409
+ c1.points[i],
410
+ c2.points[i],
411
+ progress
412
+ );
413
+ }
414
+ }
415
+ /**
416
+ * Mutably applies a PointTransformer to all points.
417
+ * @param fn - The transform function
418
+ */
419
+ transform(fn) {
420
+ const p = this.points;
421
+ for (let i = 0; i < 8; i += 2) {
422
+ const [tx, ty] = fn(p[i], p[i + 1]);
423
+ p[i] = tx;
424
+ p[i + 1] = ty;
425
+ }
426
+ }
427
+ };
428
+
429
+ // src/shapes/core/rounded-polygon.ts
430
+ var RoundedCorner = class {
431
+ constructor(p0, p1, p2, rounding = UNROUNDED) {
432
+ this.p0 = p0;
433
+ this.p1 = p1;
434
+ this.p2 = p2;
435
+ this.rounding = rounding;
436
+ this.center = point(0, 0);
437
+ const v01x = p0.x - p1.x, v01y = p0.y - p1.y;
438
+ const v21x = p2.x - p1.x, v21y = p2.y - p1.y;
439
+ const d01 = distance(v01x, v01y);
440
+ const d21 = distance(v21x, v21y);
441
+ if (d01 > 0 && d21 > 0) {
442
+ this.d1 = point(v01x / d01, v01y / d01);
443
+ this.d2 = point(v21x / d21, v21y / d21);
444
+ this.cornerRadius = rounding.radius;
445
+ this.smoothing = rounding.smoothing;
446
+ const cosA = this.d1.x * this.d2.x + this.d1.y * this.d2.y;
447
+ this.sinAngle = Math.sqrt(Math.max(0, 1 - square(cosA)));
448
+ this.expectedRoundCut = this.sinAngle > 1e-3 ? this.cornerRadius * (cosA + 1) / this.sinAngle : 0;
449
+ } else {
450
+ this.d1 = point(0, 0);
451
+ this.d2 = point(0, 0);
452
+ this.cornerRadius = 0;
453
+ this.smoothing = 0;
454
+ this.sinAngle = 0;
455
+ this.expectedRoundCut = 0;
456
+ }
457
+ }
458
+ get expectedCut() {
459
+ return (1 + this.smoothing) * this.expectedRoundCut;
460
+ }
461
+ getCubics(allowedCut0, allowedCut1 = allowedCut0) {
462
+ const allowedCut = Math.min(allowedCut0, allowedCut1);
463
+ if (this.expectedRoundCut < DISTANCE_EPSILON || allowedCut < DISTANCE_EPSILON || this.cornerRadius < DISTANCE_EPSILON) {
464
+ this.center = this.p1;
465
+ return [Cubic.straightLine(this.p1.x, this.p1.y, this.p1.x, this.p1.y)];
466
+ }
467
+ const actualRoundCut = Math.min(allowedCut, this.expectedRoundCut);
468
+ const actualSmoothing0 = this.calcSmoothingValue(allowedCut0);
469
+ const actualSmoothing1 = this.calcSmoothingValue(allowedCut1);
470
+ const actualR = this.cornerRadius * actualRoundCut / this.expectedRoundCut;
471
+ const centerDist = Math.sqrt(square(actualR) + square(actualRoundCut));
472
+ const midDirX = (this.d1.x + this.d2.x) / 2;
473
+ const midDirY = (this.d1.y + this.d2.y) / 2;
474
+ const midDist = distance(midDirX, midDirY);
475
+ this.center = point(
476
+ this.p1.x + midDirX / midDist * centerDist,
477
+ this.p1.y + midDirY / midDist * centerDist
478
+ );
479
+ const ci0 = point(
480
+ this.p1.x + this.d1.x * actualRoundCut,
481
+ this.p1.y + this.d1.y * actualRoundCut
482
+ );
483
+ const ci2 = point(
484
+ this.p1.x + this.d2.x * actualRoundCut,
485
+ this.p1.y + this.d2.y * actualRoundCut
486
+ );
487
+ const flanking0 = this.computeFlankingCurve(
488
+ actualRoundCut,
489
+ actualSmoothing0,
490
+ this.p1,
491
+ this.p0,
492
+ ci0,
493
+ ci2,
494
+ this.center,
495
+ actualR
496
+ );
497
+ const flanking2 = this.computeFlankingCurve(
498
+ actualRoundCut,
499
+ actualSmoothing1,
500
+ this.p1,
501
+ this.p2,
502
+ ci2,
503
+ ci0,
504
+ this.center,
505
+ actualR
506
+ ).reverse();
507
+ return [
508
+ flanking0,
509
+ Cubic.circularArc(
510
+ this.center.x,
511
+ this.center.y,
512
+ flanking0.anchor1X,
513
+ flanking0.anchor1Y,
514
+ flanking2.anchor0X,
515
+ flanking2.anchor0Y
516
+ ),
517
+ flanking2
518
+ ];
519
+ }
520
+ calcSmoothingValue(allowedCut) {
521
+ if (allowedCut > this.expectedCut) return this.smoothing;
522
+ if (allowedCut > this.expectedRoundCut) {
523
+ return this.smoothing * (allowedCut - this.expectedRoundCut) / (this.expectedCut - this.expectedRoundCut);
524
+ }
525
+ return 0;
526
+ }
527
+ computeFlankingCurve(actualRoundCut, actualSmoothing, corner, sideStart, circleIntersect, otherIntersect, circleCenter, actualR) {
528
+ var _a;
529
+ const sdx = sideStart.x - corner.x, sdy = sideStart.y - corner.y;
530
+ const sd = distance(sdx, sdy);
531
+ const sideDir = point(sdx / sd, sdy / sd);
532
+ const curveStart = point(
533
+ corner.x + sideDir.x * actualRoundCut * (1 + actualSmoothing),
534
+ corner.y + sideDir.y * actualRoundCut * (1 + actualSmoothing)
535
+ );
536
+ const px = interpolate(
537
+ circleIntersect.x,
538
+ (circleIntersect.x + otherIntersect.x) / 2,
539
+ actualSmoothing
540
+ );
541
+ const py = interpolate(
542
+ circleIntersect.y,
543
+ (circleIntersect.y + otherIntersect.y) / 2,
544
+ actualSmoothing
545
+ );
546
+ const ptoCx = px - circleCenter.x, ptoCy = py - circleCenter.y;
547
+ const ptoCd = distance(ptoCx, ptoCy);
548
+ const curveEnd = point(
549
+ circleCenter.x + ptoCx / ptoCd * actualR,
550
+ circleCenter.y + ptoCy / ptoCd * actualR
551
+ );
552
+ const tangentX = -(curveEnd.y - circleCenter.y);
553
+ const tangentY = curveEnd.x - circleCenter.x;
554
+ const anchorEnd = (_a = lineIntersection(
555
+ sideStart,
556
+ sideDir,
557
+ curveEnd,
558
+ point(tangentX, tangentY)
559
+ )) != null ? _a : circleIntersect;
560
+ const anchorStart = point(
561
+ (curveStart.x + anchorEnd.x * 2) / 3,
562
+ (curveStart.y + anchorEnd.y * 2) / 3
563
+ );
564
+ return new Cubic([
565
+ curveStart.x,
566
+ curveStart.y,
567
+ anchorStart.x,
568
+ anchorStart.y,
569
+ anchorEnd.x,
570
+ anchorEnd.y,
571
+ curveEnd.x,
572
+ curveEnd.y
573
+ ]);
574
+ }
575
+ };
576
+ function lineIntersection(p0, d0, p1, d1) {
577
+ const rd1x = -d1.y, rd1y = d1.x;
578
+ const den = d0.x * rd1x + d0.y * rd1y;
579
+ if (Math.abs(den) < DISTANCE_EPSILON) return null;
580
+ const num = (p1.x - p0.x) * rd1x + (p1.y - p0.y) * rd1y;
581
+ if (Math.abs(den) < DISTANCE_EPSILON * Math.abs(num)) return null;
582
+ const k = num / den;
583
+ return point(p0.x + d0.x * k, p0.y + d0.y * k);
584
+ }
585
+ function calculateCenter(vertices) {
586
+ let cx = 0, cy = 0;
587
+ for (let i = 0; i < vertices.length; i += 2) {
588
+ cx += vertices[i];
589
+ cy += vertices[i + 1];
590
+ }
591
+ const n = vertices.length / 2;
592
+ return point(cx / n, cy / n);
593
+ }
594
+ function verticesFromNumVerts(numVertices, radius, cx, cy) {
595
+ const result = [];
596
+ for (let i = 0; i < numVertices; i++) {
597
+ const angle = FLOAT_PI / numVertices * 2 * i;
598
+ const [rx, ry] = radialToCartesian(radius, angle);
599
+ result.push(cx + rx, cy + ry);
600
+ }
601
+ return result;
602
+ }
603
+ var RoundedPolygon = class _RoundedPolygon {
604
+ /** @internal Use static factory methods instead */
605
+ constructor(features, center) {
606
+ this.features = features;
607
+ this.center = center;
608
+ this.cubics = buildCubicsList(features);
609
+ validateContiguity(this.cubics);
610
+ }
611
+ get centerX() {
612
+ return this.center.x;
613
+ }
614
+ get centerY() {
615
+ return this.center.y;
616
+ }
617
+ // ─── Static factories ────────────────────────────────────────────────
618
+ /**
619
+ * Creates a polygon from a vertex count (regular polygon).
620
+ * @param numVertices - Number of vertices (≥ 3)
621
+ * @param radius - Circumradius (default: 1)
622
+ * @param centerX - Center X (default: 0)
623
+ * @param centerY - Center Y (default: 0)
624
+ * @param rounding - Corner rounding for all vertices
625
+ * @param perVertexRounding - Per-vertex rounding overrides
626
+ */
627
+ static fromNumVertices(numVertices, radius = 1, centerX = 0, centerY = 0, rounding = UNROUNDED, perVertexRounding) {
628
+ if (numVertices < 3)
629
+ throw new Error("Polygon must have at least 3 vertices");
630
+ const vertices = verticesFromNumVerts(
631
+ numVertices,
632
+ radius,
633
+ centerX,
634
+ centerY
635
+ );
636
+ return _RoundedPolygon.fromVertices(
637
+ vertices,
638
+ rounding,
639
+ perVertexRounding,
640
+ centerX,
641
+ centerY
642
+ );
643
+ }
644
+ /**
645
+ * Creates a polygon from a flat vertex array [x0, y0, x1, y1, ...].
646
+ * @param vertices - Flat array of x,y pairs (length must be even and ≥ 6)
647
+ * @param rounding - Corner rounding for all vertices
648
+ * @param perVertexRounding - Per-vertex rounding overrides
649
+ * @param centerX - Center X (auto-calculated if not provided)
650
+ * @param centerY - Center Y (auto-calculated if not provided)
651
+ */
652
+ static fromVertices(vertices, rounding = UNROUNDED, perVertexRounding, centerX, centerY) {
653
+ if (vertices.length < 6)
654
+ throw new Error("Polygon must have at least 3 vertices");
655
+ if (vertices.length % 2 !== 0)
656
+ throw new Error("Vertices array must have even length");
657
+ if (perVertexRounding && perVertexRounding.length * 2 !== vertices.length) {
658
+ throw new Error("perVertexRounding must match vertex count");
659
+ }
660
+ const n = vertices.length / 2;
661
+ const roundedCorners = [];
662
+ for (let i = 0; i < n; i++) {
663
+ const vtxRounding = perVertexRounding ? perVertexRounding[i] : rounding;
664
+ const prevIdx = (i + n - 1) % n * 2;
665
+ const nextIdx = (i + 1) % n * 2;
666
+ roundedCorners.push(
667
+ new RoundedCorner(
668
+ point(vertices[prevIdx], vertices[prevIdx + 1]),
669
+ point(vertices[i * 2], vertices[i * 2 + 1]),
670
+ point(vertices[nextIdx], vertices[nextIdx + 1]),
671
+ vtxRounding
672
+ )
673
+ );
674
+ }
675
+ const cutAdjusts = [];
676
+ for (let ix = 0; ix < n; ix++) {
677
+ const expectedRoundCut = roundedCorners[ix].expectedRoundCut + roundedCorners[(ix + 1) % n].expectedRoundCut;
678
+ const expectedCut = roundedCorners[ix].expectedCut + roundedCorners[(ix + 1) % n].expectedCut;
679
+ const vx = vertices[ix * 2], vy = vertices[ix * 2 + 1];
680
+ const nx = vertices[(ix + 1) % n * 2], ny = vertices[(ix + 1) % n * 2 + 1];
681
+ const sideSize = distance(vx - nx, vy - ny);
682
+ if (expectedRoundCut > sideSize) {
683
+ cutAdjusts.push([sideSize / expectedRoundCut, 0]);
684
+ } else if (expectedCut > sideSize) {
685
+ cutAdjusts.push([
686
+ 1,
687
+ (sideSize - expectedRoundCut) / (expectedCut - expectedRoundCut)
688
+ ]);
689
+ } else {
690
+ cutAdjusts.push([1, 1]);
691
+ }
692
+ }
693
+ const corners = [];
694
+ for (let i = 0; i < n; i++) {
695
+ const allowedCuts = [];
696
+ for (const delta of [0, 1]) {
697
+ const [roundCutRatio, cutRatio] = cutAdjusts[(i + n - 1 + delta) % n];
698
+ allowedCuts.push(
699
+ roundedCorners[i].expectedRoundCut * roundCutRatio + (roundedCorners[i].expectedCut - roundedCorners[i].expectedRoundCut) * cutRatio
700
+ );
701
+ }
702
+ corners.push(roundedCorners[i].getCubics(allowedCuts[0], allowedCuts[1]));
703
+ }
704
+ const tempFeatures = [];
705
+ for (let i = 0; i < n; i++) {
706
+ const prevIdx = (i + n - 1) % n;
707
+ const nextIdx = (i + 1) % n;
708
+ const currV = point(vertices[i * 2], vertices[i * 2 + 1]);
709
+ const prevV = point(vertices[prevIdx * 2], vertices[prevIdx * 2 + 1]);
710
+ const nextV = point(vertices[nextIdx * 2], vertices[nextIdx * 2 + 1]);
711
+ const isConvex = convex(
712
+ prevV.x,
713
+ prevV.y,
714
+ currV.x,
715
+ currV.y,
716
+ nextV.x,
717
+ nextV.y
718
+ );
719
+ tempFeatures.push(cornerFeature(corners[i], isConvex));
720
+ const lastCornerA1 = corners[i][corners[i].length - 1];
721
+ const nextCornerA0 = corners[(i + 1) % n][0];
722
+ tempFeatures.push(
723
+ edgeFeature([
724
+ Cubic.straightLine(
725
+ lastCornerA1.anchor1X,
726
+ lastCornerA1.anchor1Y,
727
+ nextCornerA0.anchor0X,
728
+ nextCornerA0.anchor0Y
729
+ )
730
+ ])
731
+ );
732
+ }
733
+ const cx = centerX != null ? centerX : calculateCenter(vertices).x;
734
+ const cy = centerY != null ? centerY : calculateCenter(vertices).y;
735
+ return new _RoundedPolygon(tempFeatures, point(cx, cy));
736
+ }
737
+ /**
738
+ * Creates a polygon from a pre-built Feature list.
739
+ * @param features - Feature list (≥ 2 features)
740
+ * @param centerX - Center X (auto-calculated if NaN)
741
+ * @param centerY - Center Y (auto-calculated if NaN)
742
+ */
743
+ static fromFeatures(features, centerX = Number.NaN, centerY = Number.NaN) {
744
+ if (features.length < 2)
745
+ throw new Error("Polygon must have at least 2 features");
746
+ const allVertices = [];
747
+ for (const f of features) {
748
+ for (const c of f.cubics) {
749
+ allVertices.push(c.anchor0X, c.anchor0Y);
750
+ }
751
+ }
752
+ const cx = Number.isNaN(centerX) ? calculateCenter(allVertices).x : centerX;
753
+ const cy = Number.isNaN(centerY) ? calculateCenter(allVertices).y : centerY;
754
+ return new _RoundedPolygon(features, point(cx, cy));
755
+ }
756
+ // ─── Instance methods ────────────────────────────────────────────────
757
+ /**
758
+ * Returns a new RoundedPolygon with all points transformed.
759
+ * @param fn - Transform function: (x, y) => [x', y']
760
+ */
761
+ transformed(fn) {
762
+ const [cx, cy] = fn(this.center.x, this.center.y);
763
+ return new _RoundedPolygon(
764
+ this.features.map((f) => transformFeature(f, fn)),
765
+ point(cx, cy)
766
+ );
767
+ }
768
+ /**
769
+ * Returns a normalized copy: scaled and centered to fit in [0,1] × [0,1].
770
+ * Maintains aspect ratio by using the larger dimension.
771
+ */
772
+ normalized() {
773
+ const [minX, minY, maxX, maxY] = this.calculateBounds(false);
774
+ const width = maxX - minX;
775
+ const height = maxY - minY;
776
+ const side = Math.max(width, height);
777
+ const offsetX = (side - width) / 2 - minX;
778
+ const offsetY = (side - height) / 2 - minY;
779
+ return this.transformed((x, y) => [
780
+ (x + offsetX) / side,
781
+ (y + offsetY) / side
782
+ ]);
783
+ }
784
+ /**
785
+ * Calculates the axis-aligned bounding box.
786
+ * @param approximate - If true, uses control point hull (faster). Default: true.
787
+ * @returns [minX, minY, maxX, maxY]
788
+ */
789
+ calculateBounds(approximate = true) {
790
+ let minX = Number.MAX_VALUE, minY = Number.MAX_VALUE;
791
+ let maxX = -Number.MAX_VALUE, maxY = -Number.MAX_VALUE;
792
+ for (const c of this.cubics) {
793
+ const [cx0, cy0, cx1, cy1] = c.calculateBounds(approximate);
794
+ if (cx0 < minX) minX = cx0;
795
+ if (cy0 < minY) minY = cy0;
796
+ if (cx1 > maxX) maxX = cx1;
797
+ if (cy1 > maxY) maxY = cy1;
798
+ }
799
+ return [minX, minY, maxX, maxY];
800
+ }
801
+ /**
802
+ * Calculates the maximum bounding square (useful for shapes that rotate).
803
+ * @returns [minX, minY, maxX, maxY] of the max-bounds square
804
+ */
805
+ calculateMaxBounds() {
806
+ let maxDistSq = 0;
807
+ for (const c of this.cubics) {
808
+ const ad = distanceSquared(
809
+ c.anchor0X - this.centerX,
810
+ c.anchor0Y - this.centerY
811
+ );
812
+ const mid = c.pointOnCurve(0.5);
813
+ const md = distanceSquared(mid.x - this.centerX, mid.y - this.centerY);
814
+ const m = Math.max(ad, md);
815
+ if (m > maxDistSq) maxDistSq = m;
816
+ }
817
+ const d = Math.sqrt(maxDistSq);
818
+ return [
819
+ this.centerX - d,
820
+ this.centerY - d,
821
+ this.centerX + d,
822
+ this.centerY + d
823
+ ];
824
+ }
825
+ };
826
+ function buildCubicsList(features) {
827
+ const result = [];
828
+ let firstCubic = null;
829
+ let lastCubic = null;
830
+ let firstFeatureSplitStart = null;
831
+ let firstFeatureSplitEnd = null;
832
+ if (features.length > 0 && features[0].cubics.length === 3) {
833
+ const center = features[0].cubics[1];
834
+ const [start, end] = center.split(0.5);
835
+ firstFeatureSplitStart = [features[0].cubics[0], start];
836
+ firstFeatureSplitEnd = [end, features[0].cubics[2]];
837
+ }
838
+ for (let i = 0; i <= features.length; i++) {
839
+ let featureCubics;
840
+ if (i === 0 && firstFeatureSplitEnd) {
841
+ featureCubics = firstFeatureSplitEnd;
842
+ } else if (i === features.length) {
843
+ if (firstFeatureSplitStart) featureCubics = firstFeatureSplitStart;
844
+ else break;
845
+ } else {
846
+ featureCubics = features[i].cubics;
847
+ }
848
+ for (const cubic of featureCubics) {
849
+ if (!cubic.zeroLength()) {
850
+ if (lastCubic) result.push(lastCubic);
851
+ lastCubic = cubic;
852
+ if (!firstCubic) firstCubic = cubic;
853
+ } else if (lastCubic) {
854
+ const p = lastCubic.points.slice();
855
+ p[6] = cubic.anchor1X;
856
+ p[7] = cubic.anchor1Y;
857
+ lastCubic = new Cubic(p);
858
+ }
859
+ }
860
+ }
861
+ if (lastCubic && firstCubic) {
862
+ result.push(
863
+ new Cubic([
864
+ lastCubic.anchor0X,
865
+ lastCubic.anchor0Y,
866
+ lastCubic.control0X,
867
+ lastCubic.control0Y,
868
+ lastCubic.control1X,
869
+ lastCubic.control1Y,
870
+ firstCubic.anchor0X,
871
+ firstCubic.anchor0Y
872
+ ])
873
+ );
874
+ } else {
875
+ result.push(Cubic.empty(0, 0));
876
+ }
877
+ return result;
878
+ }
879
+ function validateContiguity(cubics) {
880
+ let prev = cubics[cubics.length - 1];
881
+ for (const cubic of cubics) {
882
+ if (Math.abs(cubic.anchor0X - prev.anchor1X) > DISTANCE_EPSILON || Math.abs(cubic.anchor0Y - prev.anchor1Y) > DISTANCE_EPSILON) {
883
+ throw new Error(
884
+ `RoundedPolygon must be contiguous: gap between (${cubic.anchor0X},${cubic.anchor0Y}) and (${prev.anchor1X},${prev.anchor1Y})`
885
+ );
886
+ }
887
+ prev = cubic;
888
+ }
889
+ }
890
+
891
+ // src/shapes/catalog/md3-expressive-shapes.ts
892
+ function createShape(pts) {
893
+ const cubics = pts.map((p) => new Cubic(p));
894
+ return RoundedPolygon.fromFeatures(
895
+ cubics.map((c) => cornerFeature([c], false))
896
+ );
897
+ }
898
+ var archShape = createShape([
899
+ [1, 0.83461, 1, 0.8547, 1, 0.86477, 0.99898, 0.87322],
900
+ [0.99898, 0.87322, 0.99115, 0.93918, 0.93918, 0.99115, 0.87322, 0.99898],
901
+ [0.87322, 0.99898, 0.86477, 1, 0.8547, 1, 0.83461, 1],
902
+ [0.83461, 1, 0.61154, 1, 0.38847, 1, 0.1654, 1],
903
+ [0.1654, 1, 0.14529, 1, 0.13524, 1, 0.12679, 0.99898],
904
+ [0.12679, 0.99898, 0.06084, 0.99115, 884e-5, 0.93918, 1e-3, 0.87322],
905
+ [1e-3, 0.87322, 0, 0.86477, 0, 0.8547, 0, 0.83461],
906
+ [0, 0.83461, 0, 0.72307, 0, 0.61154, 0, 0.5],
907
+ [0, 0.5, 0, 0.22385, 0.22386, 0, 0.5, 0],
908
+ [0.5, 0, 0.77615, 0, 1, 0.22385, 1, 0.5],
909
+ [1, 0.5, 1, 0.61154, 1, 0.72307, 1, 0.83461]
910
+ ]);
911
+ var arrowShape = createShape([
912
+ [0.8594, 0.44684, 0.81504, 0.37855, 0.77068, 0.31016, 0.72632, 0.24187],
913
+ [0.72632, 0.24187, 0.69754, 0.19753, 0.66825, 0.1526, 0.62934, 0.11738],
914
+ [0.62934, 0.11738, 0.59043, 0.08209, 0.54003, 0.05716, 0.48834, 0.06041],
915
+ [0.48834, 0.06041, 0.44296, 0.06333, 0.4009, 0.08773, 0.36769, 0.11959],
916
+ [0.36769, 0.11959, 0.33449, 0.15146, 0.30869, 0.1907, 0.28332, 0.22956],
917
+ [0.28332, 0.22956, 0.21469, 0.33456, 0.14598, 0.43956, 0.07736, 0.54462],
918
+ [0.07736, 0.54462, 0.04474, 0.5945, 0.01128, 0.64655, 226e-5, 0.70598],
919
+ [226e-5, 0.70598, -864e-5, 0.77779, 0.02074, 0.85092, 0.07284, 0.89867],
920
+ [0.07284, 0.89867, 0.12733, 0.94861, 0.21563, 0.94456, 0.28196, 0.93089],
921
+ [0.28196, 0.93089, 0.35467, 0.91586, 0.42576, 0.8876, 0.49992, 0.88769],
922
+ [0.49992, 0.88769, 0.56344, 0.88769, 0.62483, 0.90858, 0.68664, 0.92377],
923
+ [0.68664, 0.92377, 0.74837, 0.93886, 0.8147, 0.94817, 0.8743, 0.9257],
924
+ [0.8743, 0.9257, 0.94829, 0.89788, 1.00142, 0.81877, 0.99997, 0.73757],
925
+ [0.99997, 0.73757, 0.99861, 0.66348, 0.95714, 0.59731, 0.91721, 0.53567],
926
+ [0.91721, 0.53567, 0.89797, 0.50608, 0.87873, 0.47643, 0.85948, 0.44684],
927
+ [0.85948, 0.44684, 0.85946, 0.44684, 0.85943, 0.44684, 0.8594, 0.44684]
928
+ ]);
929
+ var boomShape = createShape([
930
+ [0.49006, 0.03176, 0.49241, 0.01294, 0.49359, 354e-5, 0.49537, 185e-5],
931
+ [0.49537, 185e-5, 0.49796, -62e-5, 0.50203, -62e-5, 0.50462, 185e-5],
932
+ [0.50462, 185e-5, 0.50641, 354e-5, 0.50759, 0.01294, 0.50994, 0.03176],
933
+ [0.50994, 0.03176, 0.51992, 0.11153, 0.5299, 0.1913, 0.53987, 0.27107],
934
+ [0.53987, 0.27107, 0.54082, 0.27866, 0.5413, 0.28244, 0.54266, 0.28403],
935
+ [0.54266, 0.28403, 0.54464, 0.28628, 0.54787, 0.287, 0.5506, 0.28572],
936
+ [0.5506, 0.28572, 0.55248, 0.28485, 0.55445, 0.28157, 0.55839, 0.275],
937
+ [0.55839, 0.275, 0.59978, 0.20621, 0.64116, 0.13742, 0.68254, 0.06863],
938
+ [0.68254, 0.06863, 0.69231, 0.05241, 0.69719, 0.04429, 0.6995, 0.04348],
939
+ [0.6995, 0.04348, 0.70287, 0.04232, 0.70657, 0.04398, 0.70795, 0.04729],
940
+ [0.70795, 0.04729, 0.70891, 0.04954, 0.70617, 0.05863, 0.70071, 0.07679],
941
+ [0.70071, 0.07679, 0.67756, 0.15373, 0.6544, 0.23068, 0.63124, 0.30763],
942
+ [0.63124, 0.30763, 0.62904, 0.31497, 0.62794, 0.31863, 0.62855, 0.3206],
943
+ [0.62855, 0.3206, 0.62942, 0.32348, 0.6321, 0.32544, 0.63512, 0.32541],
944
+ [0.63512, 0.32541, 0.63719, 0.32538, 0.64031, 0.32319, 0.64656, 0.31882],
945
+ [0.64656, 0.31882, 0.7122, 0.2729, 0.77783, 0.22698, 0.84347, 0.18107],
946
+ [0.84347, 0.18107, 0.85895, 0.17022, 0.86669, 0.16482, 0.86913, 0.16501],
947
+ [0.86913, 0.16501, 0.87269, 0.16533, 0.87539, 0.16834, 0.87532, 0.17191],
948
+ [0.87532, 0.17191, 0.87528, 0.17438, 0.86911, 0.18157, 0.85678, 0.19591],
949
+ [0.85678, 0.19591, 0.80449, 0.25674, 0.75221, 0.31758, 0.69992, 0.37841],
950
+ [0.69992, 0.37841, 0.69494, 0.38419, 0.69246, 0.3871, 0.69221, 0.38916],
951
+ [0.69221, 0.38916, 0.69185, 0.39216, 0.6935, 0.39503, 0.69627, 0.39622],
952
+ [0.69627, 0.39622, 0.69817, 0.39706, 0.70191, 0.39631, 0.70939, 0.39488],
953
+ [0.70939, 0.39488, 0.78793, 0.37977, 0.86646, 0.36467, 0.945, 0.34957],
954
+ [0.945, 0.34957, 0.96353, 0.346, 0.9728, 0.34422, 0.97494, 0.34541],
955
+ [0.97494, 0.34541, 0.97806, 0.34713, 0.97931, 0.351, 0.9778, 0.35425],
956
+ [0.9778, 0.35425, 0.97676, 0.35647, 0.96822, 0.3605, 0.95115, 0.36856],
957
+ [0.95115, 0.36856, 0.87878, 0.40276, 0.80641, 0.43696, 0.73403, 0.47116],
958
+ [0.73403, 0.47116, 0.72714, 0.47441, 0.7237, 0.47603, 0.72263, 0.47781],
959
+ [0.72263, 0.47781, 0.72109, 0.48041, 0.72144, 0.48372, 0.72348, 0.48594],
960
+ [0.72348, 0.48594, 0.72489, 0.48747, 0.7286, 0.48834, 0.73601, 0.49006],
961
+ [0.73601, 0.49006, 0.81387, 0.50839, 0.89173, 0.52671, 0.96959, 0.54503],
962
+ [0.96959, 0.54503, 0.98796, 0.54934, 0.99715, 0.5515, 0.99862, 0.55347],
963
+ [0.99862, 0.55347, 1.00077, 0.55631, 1.00035, 0.56037, 0.99766, 0.56272],
964
+ [0.99766, 0.56272, 0.9958, 0.56431, 0.98638, 0.56453, 0.96751, 0.56491],
965
+ [0.96751, 0.56491, 0.88757, 0.56654, 0.80762, 0.56818, 0.72767, 0.56981],
966
+ [0.72767, 0.56981, 0.72006, 0.56997, 0.71626, 0.57006, 0.71456, 0.57125],
967
+ [0.71456, 0.57125, 0.7121, 0.573, 0.71108, 0.57617, 0.71206, 0.57903],
968
+ [0.71206, 0.57903, 0.71272, 0.581, 0.71576, 0.58331, 0.72182, 0.58794],
969
+ [0.72182, 0.58794, 0.78555, 0.6365, 0.84927, 0.68506, 0.91299, 0.73362],
970
+ [0.91299, 0.73362, 0.92802, 0.74509, 0.93554, 0.75084, 0.93609, 0.75322],
971
+ [0.93609, 0.75322, 0.93691, 0.7567, 0.93489, 0.76022, 0.93147, 0.76128],
972
+ [0.93147, 0.76128, 0.92912, 0.762, 0.92043, 0.75831, 0.90304, 0.75097],
973
+ [0.90304, 0.75097, 0.82934, 0.71977, 0.75565, 0.68857, 0.68195, 0.65737],
974
+ [0.68195, 0.65737, 0.67493, 0.6544, 0.67142, 0.6529, 0.66939, 0.65331],
975
+ [0.66939, 0.65331, 0.66644, 0.65391, 0.66423, 0.65637, 0.66396, 0.65937],
976
+ [0.66396, 0.65937, 0.66378, 0.66144, 0.66561, 0.66481, 0.66928, 0.6715],
977
+ [0.66928, 0.6715, 0.70784, 0.74193, 0.74641, 0.81237, 0.78497, 0.88281],
978
+ [0.78497, 0.88281, 0.79407, 0.8994, 0.79862, 0.90771, 0.79815, 0.91015],
979
+ [0.79815, 0.91015, 0.79748, 0.91366, 0.79421, 0.91604, 0.79067, 0.91562],
980
+ [0.79067, 0.91562, 0.78824, 0.91531, 0.78179, 0.9084, 0.76888, 0.89456],
981
+ [0.76888, 0.89456, 0.71418, 0.83591, 0.65947, 0.77727, 0.60477, 0.71862],
982
+ [0.60477, 0.71862, 0.59956, 0.71306, 0.59695, 0.71025, 0.59494, 0.70981],
983
+ [0.59494, 0.70981, 0.592, 0.70912, 0.58897, 0.71048, 0.58752, 0.71312],
984
+ [0.58752, 0.71312, 0.58651, 0.71493, 0.58683, 0.71875, 0.58747, 0.72637],
985
+ [0.58747, 0.72637, 0.59421, 0.80649, 0.60094, 0.8866, 0.60768, 0.96671],
986
+ [0.60768, 0.96671, 0.60927, 0.98562, 0.61006, 0.99506, 0.60866, 0.99709],
987
+ [0.60866, 0.99709, 0.60663, 1.00002, 0.60267, 1.00087, 0.59962, 0.99902],
988
+ [0.59962, 0.99902, 0.59752, 0.99774, 0.59442, 0.98877, 0.58823, 0.97087],
989
+ [0.58823, 0.97087, 0.56197, 0.89493, 0.53572, 0.819, 0.50946, 0.74306],
990
+ [0.50946, 0.74306, 0.50696, 0.73581, 0.50571, 0.73222, 0.50406, 0.73097],
991
+ [0.50406, 0.73097, 0.50165, 0.72916, 0.49834, 0.72916, 0.49594, 0.73097],
992
+ [0.49594, 0.73097, 0.49428, 0.73222, 0.49303, 0.73581, 0.49053, 0.74306],
993
+ [0.49053, 0.74306, 0.46428, 0.819, 0.43803, 0.89493, 0.41177, 0.97087],
994
+ [0.41177, 0.97087, 0.40558, 0.98877, 0.40248, 0.99774, 0.40038, 0.99902],
995
+ [0.40038, 0.99902, 0.39733, 1.00087, 0.39338, 1.00002, 0.39134, 0.99709],
996
+ [0.39134, 0.99709, 0.38994, 0.99506, 0.39073, 0.98562, 0.39232, 0.96671],
997
+ [0.39232, 0.96671, 0.39906, 0.8866, 0.40579, 0.80649, 0.41253, 0.72637],
998
+ [0.41253, 0.72637, 0.41317, 0.71875, 0.41349, 0.71493, 0.41248, 0.71312],
999
+ [0.41248, 0.71312, 0.41104, 0.71048, 0.408, 0.70912, 0.40507, 0.70981],
1000
+ [0.40507, 0.70981, 0.40305, 0.71025, 0.40044, 0.71306, 0.39523, 0.71862],
1001
+ [0.39523, 0.71862, 0.34053, 0.77727, 0.28582, 0.83591, 0.23112, 0.89456],
1002
+ [0.23112, 0.89456, 0.21821, 0.9084, 0.21176, 0.91531, 0.20933, 0.91562],
1003
+ [0.20933, 0.91562, 0.20578, 0.91604, 0.20252, 0.91366, 0.20184, 0.91015],
1004
+ [0.20184, 0.91015, 0.20138, 0.90771, 0.20593, 0.8994, 0.21503, 0.88281],
1005
+ [0.21503, 0.88281, 0.25359, 0.81237, 0.29215, 0.74193, 0.33072, 0.6715],
1006
+ [0.33072, 0.6715, 0.33439, 0.66481, 0.33622, 0.66144, 0.33604, 0.65937],
1007
+ [0.33604, 0.65937, 0.33577, 0.65637, 0.33356, 0.65391, 0.3306, 0.65331],
1008
+ [0.3306, 0.65331, 0.32857, 0.6529, 0.32506, 0.6544, 0.31805, 0.65737],
1009
+ [0.31805, 0.65737, 0.24435, 0.68857, 0.17065, 0.71977, 0.09695, 0.75097],
1010
+ [0.09695, 0.75097, 0.07957, 0.75831, 0.07087, 0.762, 0.06853, 0.76128],
1011
+ [0.06853, 0.76128, 0.06511, 0.76022, 0.06309, 0.7567, 0.06391, 0.75322],
1012
+ [0.06391, 0.75322, 0.06446, 0.75084, 0.07198, 0.74509, 0.08701, 0.73362],
1013
+ [0.08701, 0.73362, 0.15073, 0.68506, 0.21445, 0.6365, 0.27817, 0.58794],
1014
+ [0.27817, 0.58794, 0.28424, 0.58331, 0.28727, 0.581, 0.28794, 0.57903],
1015
+ [0.28794, 0.57903, 0.28892, 0.57617, 0.2879, 0.573, 0.28543, 0.57125],
1016
+ [0.28543, 0.57125, 0.28374, 0.57006, 0.27993, 0.56997, 0.27232, 0.56981],
1017
+ [0.27232, 0.56981, 0.19238, 0.56818, 0.11243, 0.56654, 0.03248, 0.56491],
1018
+ [0.03248, 0.56491, 0.01362, 0.56453, 419e-5, 0.56431, 234e-5, 0.56272],
1019
+ [234e-5, 0.56272, -35e-5, 0.56036, -77e-5, 0.55633, 138e-5, 0.55347],
1020
+ [138e-5, 0.55347, 285e-5, 0.5515, 0.01204, 0.54934, 0.03041, 0.54503],
1021
+ [0.03041, 0.54503, 0.10827, 0.52671, 0.18613, 0.50839, 0.26399, 0.49006],
1022
+ [0.26399, 0.49006, 0.2714, 0.48834, 0.27511, 0.48747, 0.27652, 0.48594],
1023
+ [0.27652, 0.48594, 0.27856, 0.48372, 0.27891, 0.48041, 0.27736, 0.47781],
1024
+ [0.27736, 0.47781, 0.2763, 0.47603, 0.27286, 0.47441, 0.26597, 0.47116],
1025
+ [0.26597, 0.47116, 0.19359, 0.43696, 0.12122, 0.40276, 0.04885, 0.36856],
1026
+ [0.04885, 0.36856, 0.03177, 0.3605, 0.02324, 0.35647, 0.0222, 0.35425],
1027
+ [0.0222, 0.35425, 0.02068, 0.35101, 0.02193, 0.34715, 0.02506, 0.34541],
1028
+ [0.02506, 0.34541, 0.0272, 0.34422, 0.03647, 0.346, 0.055, 0.34957],
1029
+ [0.055, 0.34957, 0.13353, 0.36467, 0.21207, 0.37977, 0.29061, 0.39488],
1030
+ [0.29061, 0.39488, 0.29809, 0.39631, 0.30183, 0.39706, 0.30373, 0.39622],
1031
+ [0.30373, 0.39622, 0.3065, 0.39502, 0.30815, 0.39215, 0.30779, 0.38916],
1032
+ [0.30779, 0.38916, 0.30755, 0.3871, 0.30506, 0.38419, 0.30008, 0.37841],
1033
+ [0.30008, 0.37841, 0.24779, 0.31758, 0.19551, 0.25674, 0.14322, 0.19591],
1034
+ [0.14322, 0.19591, 0.13089, 0.18157, 0.12472, 0.17438, 0.12468, 0.17191],
1035
+ [0.12468, 0.17191, 0.12461, 0.16834, 0.12731, 0.16533, 0.13086, 0.16501],
1036
+ [0.13086, 0.16501, 0.1333, 0.16482, 0.14104, 0.17022, 0.15653, 0.18107],
1037
+ [0.15653, 0.18107, 0.22217, 0.22698, 0.2878, 0.2729, 0.35344, 0.31882],
1038
+ [0.35344, 0.31882, 0.35969, 0.32319, 0.36281, 0.32538, 0.36488, 0.32541],
1039
+ [0.36488, 0.32541, 0.3679, 0.32544, 0.37058, 0.32348, 0.37145, 0.3206],
1040
+ [0.37145, 0.3206, 0.37206, 0.31863, 0.37096, 0.31497, 0.36875, 0.30763],
1041
+ [0.36875, 0.30763, 0.3456, 0.23068, 0.32244, 0.15373, 0.29929, 0.07679],
1042
+ [0.29929, 0.07679, 0.29382, 0.05863, 0.29109, 0.04954, 0.29205, 0.04729],
1043
+ [0.29205, 0.04729, 0.29342, 0.04399, 0.29711, 0.04232, 0.3005, 0.04348],
1044
+ [0.3005, 0.04348, 0.30281, 0.04429, 0.30769, 0.05241, 0.31745, 0.06863],
1045
+ [0.31745, 0.06863, 0.35884, 0.13742, 0.40022, 0.20621, 0.44161, 0.275],
1046
+ [0.44161, 0.275, 0.44555, 0.28157, 0.44752, 0.28485, 0.4494, 0.28572],
1047
+ [0.4494, 0.28572, 0.45212, 0.287, 0.45536, 0.28628, 0.45734, 0.28403],
1048
+ [0.45734, 0.28403, 0.4587, 0.28244, 0.45917, 0.27866, 0.46012, 0.27107],
1049
+ [0.46012, 0.27107, 0.4701, 0.1913, 0.48008, 0.11153, 0.49006, 0.03176]
1050
+ ]);
1051
+ var bunShape = createShape([
1052
+ [0.01546, 0.25425, 0.01545, 0.18682, 0.04224, 0.12214, 0.08992, 0.07446],
1053
+ [0.08992, 0.07446, 0.1376, 0.02678, 0.20228, -1e-5, 0.26971, 0],
1054
+ [0.26971, 0, 0.42313, 0, 0.57654, 0, 0.72996, 0],
1055
+ [0.72996, 0, 0.85665, -17e-5, 0.96413, 0.09297, 0.98198, 0.2184],
1056
+ [0.98198, 0.2184, 0.99983, 0.34383, 0.92261, 0.46325, 0.8009, 0.49844],
1057
+ [0.8009, 0.49844, 0.8002, 0.49863, 0.79972, 0.49927, 0.79974, 0.5],
1058
+ [0.79974, 0.5, 0.79974, 0.50072, 0.80021, 0.50134, 0.8009, 0.50156],
1059
+ [0.8009, 0.50156, 0.92232, 0.537, 0.99924, 0.65629, 0.98142, 0.78152],
1060
+ [0.98142, 0.78152, 0.96359, 0.90675, 0.85645, 0.99984, 0.72996, 1],
1061
+ [0.72996, 1, 0.57654, 1, 0.42313, 1, 0.26971, 1],
1062
+ [0.26971, 1, 0.20228, 1.00001, 0.1376, 0.97322, 0.08992, 0.92554],
1063
+ [0.08992, 0.92554, 0.04224, 0.87786, 0.01545, 0.81318, 0.01546, 0.74575],
1064
+ [0.01546, 0.74575, 0.01548, 0.63344, 0.08915, 0.53444, 0.19671, 0.50216],
1065
+ [0.19671, 0.50216, 0.19766, 0.50187, 0.19832, 0.501, 0.19832, 0.5],
1066
+ [0.19832, 0.5, 0.19832, 0.49901, 0.19766, 0.49813, 0.19671, 0.49784],
1067
+ [0.19671, 0.49784, 0.08915, 0.46556, 0.01548, 0.36656, 0.01546, 0.25425]
1068
+ ]);
1069
+ var burstShape = createShape([
1070
+ [0.49184, 797e-5, 0.49416, 384e-5, 0.49528, 181e-5, 0.49669, 94e-5],
1071
+ [0.49669, 94e-5, 0.49872, -31e-5, 0.50128, -31e-5, 0.50331, 94e-5],
1072
+ [0.50331, 94e-5, 0.50472, 181e-5, 0.50584, 384e-5, 0.50816, 797e-5],
1073
+ [0.50816, 797e-5, 0.53447, 0.055, 0.56078, 0.10203, 0.58709, 0.14906],
1074
+ [0.58709, 0.14906, 0.5885, 0.15159, 0.58922, 0.15287, 0.59019, 0.15362],
1075
+ [0.59019, 0.15362, 0.59156, 0.15475, 0.59334, 0.15522, 0.59509, 0.15494],
1076
+ [0.59509, 0.15494, 0.59631, 0.15475, 0.59756, 0.15403, 0.60003, 0.15253],
1077
+ [0.60003, 0.15253, 0.64634, 0.12496, 0.69266, 0.09739, 0.73897, 0.06981],
1078
+ [0.73897, 0.06981, 0.743, 0.06741, 0.74503, 0.06619, 0.74666, 0.06616],
1079
+ [0.74666, 0.06616, 0.74906, 0.06606, 0.75125, 0.06734, 0.75241, 0.06944],
1080
+ [0.75241, 0.06944, 0.75319, 0.07091, 0.75316, 0.07325, 0.75309, 0.07797],
1081
+ [0.75309, 0.07797, 0.75236, 0.13185, 0.75164, 0.18574, 0.75091, 0.23962],
1082
+ [0.75091, 0.23962, 0.75084, 0.24253, 0.75084, 0.24397, 0.75128, 0.24512],
1083
+ [0.75128, 0.24512, 0.75191, 0.24678, 0.75322, 0.24809, 0.75488, 0.24872],
1084
+ [0.75488, 0.24872, 0.75603, 0.24916, 0.75747, 0.24916, 0.76038, 0.24909],
1085
+ [0.76038, 0.24909, 0.81426, 0.24836, 0.86815, 0.24764, 0.92203, 0.24691],
1086
+ [0.92203, 0.24691, 0.92675, 0.24684, 0.92909, 0.24681, 0.93056, 0.24759],
1087
+ [0.93056, 0.24759, 0.93266, 0.24875, 0.93394, 0.25094, 0.93384, 0.25334],
1088
+ [0.93384, 0.25334, 0.93381, 0.25497, 0.93259, 0.257, 0.93019, 0.26103],
1089
+ [0.93019, 0.26103, 0.90261, 0.30734, 0.87504, 0.35366, 0.84747, 0.39997],
1090
+ [0.84747, 0.39997, 0.84597, 0.40244, 0.84525, 0.40369, 0.84506, 0.40491],
1091
+ [0.84506, 0.40491, 0.84478, 0.40666, 0.84525, 0.40844, 0.84638, 0.40981],
1092
+ [0.84638, 0.40981, 0.84713, 0.41078, 0.84841, 0.4115, 0.85094, 0.41291],
1093
+ [0.85094, 0.41291, 0.89797, 0.43922, 0.945, 0.46553, 0.99203, 0.49184],
1094
+ [0.99203, 0.49184, 0.99616, 0.49416, 0.99819, 0.49528, 0.99906, 0.49669],
1095
+ [0.99906, 0.49669, 1.00031, 0.49872, 1.00031, 0.50128, 0.99906, 0.50331],
1096
+ [0.99906, 0.50331, 0.99819, 0.50472, 0.99616, 0.50584, 0.99203, 0.50816],
1097
+ [0.99203, 0.50816, 0.945, 0.53447, 0.89797, 0.56078, 0.85094, 0.58709],
1098
+ [0.85094, 0.58709, 0.84841, 0.5885, 0.84713, 0.58922, 0.84638, 0.59019],
1099
+ [0.84638, 0.59019, 0.84525, 0.59156, 0.84478, 0.59334, 0.84506, 0.59509],
1100
+ [0.84506, 0.59509, 0.84525, 0.59631, 0.84597, 0.59756, 0.84747, 0.60003],
1101
+ [0.84747, 0.60003, 0.87504, 0.64634, 0.90261, 0.69266, 0.93019, 0.73897],
1102
+ [0.93019, 0.73897, 0.93259, 0.743, 0.93381, 0.74503, 0.93384, 0.74666],
1103
+ [0.93384, 0.74666, 0.93394, 0.74906, 0.93266, 0.75125, 0.93056, 0.75241],
1104
+ [0.93056, 0.75241, 0.92909, 0.75319, 0.92675, 0.75316, 0.92203, 0.75309],
1105
+ [0.92203, 0.75309, 0.86815, 0.75236, 0.81426, 0.75164, 0.76038, 0.75091],
1106
+ [0.76038, 0.75091, 0.75747, 0.75084, 0.75603, 0.75084, 0.75488, 0.75128],
1107
+ [0.75488, 0.75128, 0.75322, 0.75191, 0.75191, 0.75322, 0.75128, 0.75488],
1108
+ [0.75128, 0.75488, 0.75084, 0.75603, 0.75084, 0.75747, 0.75091, 0.76038],
1109
+ [0.75091, 0.76038, 0.75164, 0.81426, 0.75236, 0.86815, 0.75309, 0.92203],
1110
+ [0.75309, 0.92203, 0.75316, 0.92675, 0.75319, 0.92909, 0.75241, 0.93056],
1111
+ [0.75241, 0.93056, 0.75125, 0.93266, 0.74906, 0.93394, 0.74666, 0.93384],
1112
+ [0.74666, 0.93384, 0.74503, 0.93381, 0.743, 0.93259, 0.73897, 0.93019],
1113
+ [0.73897, 0.93019, 0.69266, 0.90261, 0.64634, 0.87504, 0.60003, 0.84747],
1114
+ [0.60003, 0.84747, 0.59756, 0.84597, 0.59631, 0.84525, 0.59509, 0.84506],
1115
+ [0.59509, 0.84506, 0.59334, 0.84478, 0.59156, 0.84525, 0.59019, 0.84638],
1116
+ [0.59019, 0.84638, 0.58922, 0.84713, 0.5885, 0.84841, 0.58709, 0.85094],
1117
+ [0.58709, 0.85094, 0.56078, 0.89797, 0.53447, 0.945, 0.50816, 0.99203],
1118
+ [0.50816, 0.99203, 0.50584, 0.99616, 0.50472, 0.99819, 0.50331, 0.99906],
1119
+ [0.50331, 0.99906, 0.50128, 1.00031, 0.49872, 1.00031, 0.49669, 0.99906],
1120
+ [0.49669, 0.99906, 0.49528, 0.99819, 0.49416, 0.99616, 0.49184, 0.99203],
1121
+ [0.49184, 0.99203, 0.46553, 0.945, 0.43922, 0.89797, 0.41291, 0.85094],
1122
+ [0.41291, 0.85094, 0.4115, 0.84841, 0.41078, 0.84713, 0.40981, 0.84638],
1123
+ [0.40981, 0.84638, 0.40844, 0.84525, 0.40666, 0.84478, 0.40491, 0.84506],
1124
+ [0.40491, 0.84506, 0.40369, 0.84525, 0.40244, 0.84597, 0.39997, 0.84747],
1125
+ [0.39997, 0.84747, 0.35366, 0.87504, 0.30734, 0.90261, 0.26103, 0.93019],
1126
+ [0.26103, 0.93019, 0.257, 0.93259, 0.25497, 0.93381, 0.25334, 0.93384],
1127
+ [0.25334, 0.93384, 0.25094, 0.93394, 0.24875, 0.93266, 0.24759, 0.93056],
1128
+ [0.24759, 0.93056, 0.24681, 0.92909, 0.24684, 0.92675, 0.24691, 0.92203],
1129
+ [0.24691, 0.92203, 0.24764, 0.86815, 0.24836, 0.81426, 0.24909, 0.76038],
1130
+ [0.24909, 0.76038, 0.24916, 0.75747, 0.24916, 0.75603, 0.24872, 0.75488],
1131
+ [0.24872, 0.75488, 0.24809, 0.75322, 0.24678, 0.75191, 0.24513, 0.75128],
1132
+ [0.24513, 0.75128, 0.24397, 0.75084, 0.24253, 0.75084, 0.23963, 0.75091],
1133
+ [0.23963, 0.75091, 0.18574, 0.75164, 0.13185, 0.75236, 0.07797, 0.75309],
1134
+ [0.07797, 0.75309, 0.07325, 0.75316, 0.07091, 0.75319, 0.06944, 0.75241],
1135
+ [0.06944, 0.75241, 0.06734, 0.75127, 0.06607, 0.74904, 0.06616, 0.74666],
1136
+ [0.06616, 0.74666, 0.06619, 0.74503, 0.06741, 0.743, 0.06981, 0.73897],
1137
+ [0.06981, 0.73897, 0.09739, 0.69266, 0.12496, 0.64634, 0.15253, 0.60003],
1138
+ [0.15253, 0.60003, 0.15403, 0.59756, 0.15475, 0.59631, 0.15494, 0.59509],
1139
+ [0.15494, 0.59509, 0.15522, 0.59334, 0.15475, 0.59156, 0.15363, 0.59019],
1140
+ [0.15363, 0.59019, 0.15288, 0.58922, 0.15159, 0.5885, 0.14906, 0.58709],
1141
+ [0.14906, 0.58709, 0.10203, 0.56078, 0.055, 0.53447, 797e-5, 0.50816],
1142
+ [797e-5, 0.50816, 384e-5, 0.50584, 181e-5, 0.50472, 94e-5, 0.50331],
1143
+ [94e-5, 0.50331, -31e-5, 0.50128, -31e-5, 0.49872, 94e-5, 0.49669],
1144
+ [94e-5, 0.49669, 181e-5, 0.49528, 384e-5, 0.49416, 797e-5, 0.49184],
1145
+ [797e-5, 0.49184, 0.055, 0.46553, 0.10203, 0.43922, 0.14906, 0.41291],
1146
+ [0.14906, 0.41291, 0.15159, 0.4115, 0.15287, 0.41078, 0.15362, 0.40981],
1147
+ [0.15362, 0.40981, 0.15475, 0.40844, 0.15522, 0.40666, 0.15494, 0.40491],
1148
+ [0.15494, 0.40491, 0.15475, 0.40369, 0.15403, 0.40244, 0.15253, 0.39997],
1149
+ [0.15253, 0.39997, 0.12496, 0.35366, 0.09739, 0.30734, 0.06981, 0.26103],
1150
+ [0.06981, 0.26103, 0.06741, 0.257, 0.06619, 0.25497, 0.06616, 0.25334],
1151
+ [0.06616, 0.25334, 0.06606, 0.25094, 0.06734, 0.24875, 0.06944, 0.24759],
1152
+ [0.06944, 0.24759, 0.07091, 0.24681, 0.07325, 0.24684, 0.07797, 0.24691],
1153
+ [0.07797, 0.24691, 0.13185, 0.24764, 0.18574, 0.24836, 0.23963, 0.24909],
1154
+ [0.23963, 0.24909, 0.24253, 0.24916, 0.24397, 0.24916, 0.24513, 0.24872],
1155
+ [0.24513, 0.24872, 0.24678, 0.24809, 0.24809, 0.24678, 0.24872, 0.24512],
1156
+ [0.24872, 0.24512, 0.24916, 0.24397, 0.24916, 0.24253, 0.24909, 0.23962],
1157
+ [0.24909, 0.23962, 0.24836, 0.18574, 0.24764, 0.13185, 0.24691, 0.07797],
1158
+ [0.24691, 0.07797, 0.24684, 0.07325, 0.24681, 0.07091, 0.24759, 0.06944],
1159
+ [0.24759, 0.06944, 0.24875, 0.06734, 0.25094, 0.06606, 0.25334, 0.06616],
1160
+ [0.25334, 0.06616, 0.25497, 0.06619, 0.257, 0.06741, 0.26103, 0.06981],
1161
+ [0.26103, 0.06981, 0.30734, 0.09739, 0.35366, 0.12496, 0.39997, 0.15253],
1162
+ [0.39997, 0.15253, 0.40244, 0.15403, 0.40369, 0.15475, 0.40491, 0.15494],
1163
+ [0.40491, 0.15494, 0.40666, 0.15522, 0.40844, 0.15475, 0.40981, 0.15362],
1164
+ [0.40981, 0.15362, 0.41078, 0.15287, 0.4115, 0.15159, 0.41291, 0.14906],
1165
+ [0.41291, 0.14906, 0.43922, 0.10203, 0.46553, 0.055, 0.49184, 797e-5]
1166
+ ]);
1167
+ var circleShape = createShape([
1168
+ [1, 0.5, 1, 0.77614, 0.77614, 1, 0.5, 1],
1169
+ [0.5, 1, 0.22386, 1, 0, 0.77614, 0, 0.5],
1170
+ [0, 0.5, 0, 0.22386, 0.22386, 0, 0.5, 0],
1171
+ [0.5, 0, 0.77614, 0, 1, 0.22386, 1, 0.5]
1172
+ ]);
1173
+ var clamshellShape = createShape([
1174
+ [0.95752, 0.36588, 0.97848, 0.4081, 0.98896, 0.42921, 0.99426, 0.45126],
1175
+ [0.99426, 0.45126, 1.00191, 0.4833, 1.00191, 0.5167, 0.99426, 0.54874],
1176
+ [0.99426, 0.54874, 0.98896, 0.57079, 0.97848, 0.5919, 0.95752, 0.63412],
1177
+ [0.95752, 0.63412, 0.93623, 0.677, 0.91494, 0.71987, 0.89365, 0.76275],
1178
+ [0.89365, 0.76275, 0.87268, 0.80497, 0.8622, 0.82608, 0.84842, 0.84244],
1179
+ [0.84842, 0.84244, 0.8285, 0.86609, 0.80339, 0.88295, 0.77581, 0.89118],
1180
+ [0.77581, 0.89118, 0.75673, 0.89688, 0.73577, 0.89688, 0.69384, 0.89688],
1181
+ [0.69384, 0.89688, 0.56461, 0.89688, 0.43539, 0.89688, 0.30616, 0.89688],
1182
+ [0.30616, 0.89688, 0.26423, 0.89688, 0.24327, 0.89688, 0.22419, 0.89118],
1183
+ [0.22419, 0.89118, 0.19661, 0.88295, 0.1715, 0.86609, 0.15158, 0.84244],
1184
+ [0.15158, 0.84244, 0.1378, 0.82608, 0.12732, 0.80497, 0.10635, 0.76275],
1185
+ [0.10635, 0.76275, 0.08506, 0.71987, 0.06377, 0.677, 0.04248, 0.63412],
1186
+ [0.04248, 0.63412, 0.02152, 0.5919, 0.01104, 0.57079, 574e-5, 0.54874],
1187
+ [574e-5, 0.54874, -191e-5, 0.5167, -191e-5, 0.4833, 574e-5, 0.45126],
1188
+ [574e-5, 0.45126, 0.01104, 0.42921, 0.02152, 0.4081, 0.04248, 0.36588],
1189
+ [0.04248, 0.36588, 0.06377, 0.323, 0.08506, 0.28013, 0.10635, 0.23725],
1190
+ [0.10635, 0.23725, 0.12732, 0.19503, 0.1378, 0.17392, 0.15158, 0.15756],
1191
+ [0.15158, 0.15756, 0.1715, 0.13391, 0.19661, 0.11705, 0.22419, 0.10882],
1192
+ [0.22419, 0.10882, 0.24327, 0.10312, 0.26423, 0.10312, 0.30616, 0.10312],
1193
+ [0.30616, 0.10312, 0.43539, 0.10312, 0.56461, 0.10312, 0.69384, 0.10312],
1194
+ [0.69384, 0.10312, 0.73577, 0.10312, 0.75673, 0.10312, 0.77581, 0.10882],
1195
+ [0.77581, 0.10882, 0.80339, 0.11705, 0.8285, 0.13391, 0.84842, 0.15756],
1196
+ [0.84842, 0.15756, 0.8622, 0.17392, 0.87268, 0.19503, 0.89365, 0.23725],
1197
+ [0.89365, 0.23725, 0.91494, 0.28013, 0.93623, 0.323, 0.95752, 0.36588]
1198
+ ]);
1199
+ var diamondShape = createShape([
1200
+ [0.67951, 0.864, 0.62689, 0.93286, 0.60059, 0.96728, 0.57021, 0.98296],
1201
+ [0.57021, 0.98296, 0.52616, 1.00568, 0.47384, 1.00568, 0.42979, 0.98296],
1202
+ [0.42979, 0.98296, 0.39941, 0.96728, 0.37311, 0.93286, 0.32049, 0.864],
1203
+ [0.32049, 0.864, 0.26225, 0.78778, 0.20401, 0.71156, 0.14577, 0.63534],
1204
+ [0.14577, 0.63534, 0.11377, 0.59346, 0.09777, 0.57252, 0.08984, 0.5501],
1205
+ [0.08984, 0.5501, 0.07838, 0.51768, 0.07838, 0.48232, 0.08984, 0.4499],
1206
+ [0.08984, 0.4499, 0.09777, 0.42748, 0.11377, 0.40654, 0.14577, 0.36466],
1207
+ [0.14577, 0.36466, 0.20401, 0.28844, 0.26225, 0.21222, 0.32049, 0.136],
1208
+ [0.32049, 0.136, 0.37311, 0.06714, 0.39941, 0.03271, 0.42979, 0.01704],
1209
+ [0.42979, 0.01704, 0.47384, -568e-5, 0.52616, -568e-5, 0.57021, 0.01704],
1210
+ [0.57021, 0.01704, 0.60059, 0.03272, 0.62689, 0.06714, 0.67951, 0.136],
1211
+ [0.67951, 0.136, 0.73775, 0.21222, 0.79599, 0.28844, 0.85423, 0.36466],
1212
+ [0.85423, 0.36466, 0.88623, 0.40654, 0.90223, 0.42748, 0.91016, 0.4499],
1213
+ [0.91016, 0.4499, 0.92162, 0.48232, 0.92162, 0.51768, 0.91016, 0.5501],
1214
+ [0.91016, 0.5501, 0.90223, 0.57252, 0.88623, 0.59346, 0.85423, 0.63534],
1215
+ [0.85423, 0.63534, 0.79599, 0.71156, 0.73775, 0.78778, 0.67951, 0.864]
1216
+ ]);
1217
+ var fanShape = createShape([
1218
+ [0, 0.15789, 0, 0.15232, 0, 0.14954, 7e-5, 0.14718],
1219
+ [7e-5, 0.14718, 256e-5, 0.06699, 0.06699, 256e-5, 0.14718, 8e-5],
1220
+ [0.14718, 8e-5, 0.14954, 0, 0.15232, 0, 0.1579, 0],
1221
+ [0.1579, 0, 0.18761, 0, 0.20246, 0, 0.21503, 39e-5],
1222
+ [0.21503, 39e-5, 0.64271, 0.01366, 0.98632, 0.35728, 0.99961, 0.78497],
1223
+ [0.99961, 0.78497, 1, 0.79753, 1, 0.81239, 1, 0.8421],
1224
+ [1, 0.8421, 1, 0.84767, 1, 0.85046, 0.99993, 0.85282],
1225
+ [0.99993, 0.85282, 0.99743, 0.93301, 0.933, 0.99744, 0.85282, 0.99993],
1226
+ [0.85282, 0.99993, 0.85046, 1, 0.84768, 1, 0.84211, 1],
1227
+ [0.84211, 1, 0.63634, 1, 0.43057, 1, 0.2248, 1],
1228
+ [0.2248, 1, 0.15688, 1, 0.12292, 1, 0.09598, 0.98933],
1229
+ [0.09598, 0.98933, 0.05698, 0.97389, 0.02611, 0.94301, 0.01067, 0.90402],
1230
+ [0.01067, 0.90402, 0, 0.87708, 0, 0.84312, 0, 0.7752],
1231
+ [0, 0.7752, 0, 0.56943, 0, 0.36366, 0, 0.15789]
1232
+ ]);
1233
+ var flowerShape = createShape([
1234
+ [0.85353, 0.14645, 0.81641, 0.10934, 0.73184, 0.12769, 0.62984, 0.1865],
1235
+ [0.62984, 0.1865, 0.59928, 0.07277, 0.55247, 0, 0.5, 0],
1236
+ [0.5, 0, 0.4475, 0, 0.40069, 0.07276, 0.37016, 0.18649],
1237
+ [0.37016, 0.18649, 0.26813, 0.12768, 0.18359, 0.10934, 0.14647, 0.14644],
1238
+ [0.14647, 0.14644, 0.10938, 0.18355, 0.12772, 0.26811, 0.18653, 0.37014],
1239
+ [0.18653, 0.37014, 0.07278, 0.40069, 0, 0.44751, 0, 0.5],
1240
+ [0, 0.5, 0, 0.55248, 0.07275, 0.59929, 0.1865, 0.62984],
1241
+ [0.1865, 0.62984, 0.12766, 0.73188, 0.10931, 0.81644, 0.14641, 0.85355],
1242
+ [0.14641, 0.85355, 0.18353, 0.89067, 0.26809, 0.87231, 0.37012, 0.81347],
1243
+ [0.37012, 0.81347, 0.40069, 0.92722, 0.4475, 1, 0.5, 1],
1244
+ [0.5, 1, 0.55247, 1, 0.59928, 0.92722, 0.62984, 0.81346],
1245
+ [0.62984, 0.81346, 0.73191, 0.8723, 0.81647, 0.89066, 0.85359, 0.85355],
1246
+ [0.85359, 0.85355, 0.89069, 0.81644, 0.87234, 0.73188, 0.8135, 0.62984],
1247
+ [0.8135, 0.62984, 0.92725, 0.59929, 1, 0.55248, 1, 0.5],
1248
+ [1, 0.5, 1, 0.44751, 0.92722, 0.40069, 0.81344, 0.37014],
1249
+ [0.81344, 0.37014, 0.87228, 0.26811, 0.89063, 0.18356, 0.85353, 0.14645]
1250
+ ]);
1251
+ var gemShape = createShape([
1252
+ [0.31244, 0.08536, 0.37064, 0.04306, 0.39978, 0.02191, 0.4308, 0.0114],
1253
+ [0.4308, 0.0114, 0.47568, -38e-4, 0.52432, -38e-4, 0.5692, 0.0114],
1254
+ [0.5692, 0.0114, 0.60022, 0.02191, 0.62936, 0.04306, 0.68756, 0.08536],
1255
+ [0.68756, 0.08536, 0.73121, 0.11706, 0.77485, 0.14876, 0.81849, 0.18046],
1256
+ [0.81849, 0.18046, 0.85308, 0.20558, 0.87038, 0.21814, 0.88446, 0.23321],
1257
+ [0.88446, 0.23321, 0.90483, 0.25499, 0.92046, 0.28077, 0.93035, 0.30891],
1258
+ [0.93035, 0.30891, 0.93721, 0.32838, 0.94032, 0.34951, 0.9466, 0.39178],
1259
+ [0.9466, 0.39178, 0.95468, 0.44627, 0.96276, 0.50076, 0.97083, 0.55524],
1260
+ [0.97083, 0.55524, 0.98183, 0.6294, 0.98734, 0.66648, 0.9818, 0.69989],
1261
+ [0.9818, 0.69989, 0.97375, 0.74823, 0.9495, 0.79239, 0.91301, 0.8251],
1262
+ [0.91301, 0.8251, 0.88779, 0.84771, 0.85353, 0.86296, 0.78503, 0.89347],
1263
+ [0.78503, 0.89347, 0.73331, 0.91651, 0.68159, 0.93954, 0.62987, 0.96258],
1264
+ [0.62987, 0.96258, 0.58853, 0.98099, 0.56785, 0.99019, 0.54663, 0.9949],
1265
+ [0.54663, 0.9949, 0.51592, 1.0017, 0.48408, 1.0017, 0.45337, 0.9949],
1266
+ [0.45337, 0.9949, 0.43215, 0.99019, 0.41147, 0.98099, 0.37013, 0.96258],
1267
+ [0.37013, 0.96258, 0.31841, 0.93954, 0.26669, 0.91651, 0.21497, 0.89347],
1268
+ [0.21497, 0.89347, 0.14647, 0.86296, 0.11221, 0.84771, 0.08699, 0.8251],
1269
+ [0.08699, 0.8251, 0.0505, 0.79239, 0.02625, 0.74823, 0.0182, 0.69989],
1270
+ [0.0182, 0.69989, 0.01266, 0.66648, 0.01817, 0.6294, 0.02917, 0.55524],
1271
+ [0.02917, 0.55524, 0.03724, 0.50076, 0.04532, 0.44627, 0.0534, 0.39178],
1272
+ [0.0534, 0.39178, 0.05968, 0.34951, 0.06279, 0.32838, 0.06965, 0.30891],
1273
+ [0.06965, 0.30891, 0.07954, 0.28077, 0.09517, 0.25499, 0.11554, 0.23321],
1274
+ [0.11554, 0.23321, 0.12962, 0.21814, 0.14692, 0.20558, 0.18151, 0.18046],
1275
+ [0.18151, 0.18046, 0.22515, 0.14876, 0.26879, 0.11706, 0.31244, 0.08536]
1276
+ ]);
1277
+ var ghostishShape = createShape([
1278
+ [0, 0.47619, 0, 0.2132, 0.22386, 0, 0.5, 0],
1279
+ [0.5, 0, 0.77614, 0, 1, 0.2132, 1, 0.47619],
1280
+ [1, 0.47619, 1, 0.5873, 1, 0.69841, 1, 0.80952],
1281
+ [1, 0.80952, 1, 0.91472, 0.91046, 1, 0.8, 1],
1282
+ [0.8, 1, 0.76726, 1, 0.73636, 0.99251, 0.70908, 0.97923],
1283
+ [0.70908, 0.97923, 0.69518, 0.97246, 0.68131, 0.96504, 0.66738, 0.95759],
1284
+ [0.66738, 0.95759, 0.61838, 0.93137, 0.56864, 0.90476, 0.51423, 0.90476],
1285
+ [0.51423, 0.90476, 0.50474, 0.90476, 0.49526, 0.90476, 0.48577, 0.90476],
1286
+ [0.48577, 0.90476, 0.43136, 0.90476, 0.38163, 0.93137, 0.33262, 0.95759],
1287
+ [0.33262, 0.95759, 0.31869, 0.96504, 0.30482, 0.97246, 0.29092, 0.97923],
1288
+ [0.29092, 0.97923, 0.26364, 0.99251, 0.23274, 1, 0.2, 1],
1289
+ [0.2, 1, 0.08954, 1, 0, 0.91472, 0, 0.80952],
1290
+ [0, 0.80952, 0, 0.69841, 0, 0.5873, 0, 0.47619]
1291
+ ]);
1292
+ var heartShape = createShape([
1293
+ [0.78469, 0.05353, 0.717, 0.05353, 0.6566, 0.08531, 0.61713, 0.135],
1294
+ [0.61713, 0.135, 0.57809, 0.17803, 0.53904, 0.22106, 0.5, 0.26409],
1295
+ [0.5, 0.26409, 0.5, 0.26396, 0.5, 0.26382, 0.5, 0.26369],
1296
+ [0.5, 0.26369, 0.46096, 0.22065, 0.42191, 0.1776, 0.38287, 0.13456],
1297
+ [0.38287, 0.13456, 0.3434, 0.08491, 0.283, 0.05312, 0.21531, 0.05312],
1298
+ [0.21531, 0.05312, 0.0964, 0.05312, 0, 0.15116, 0, 0.27206],
1299
+ [0, 0.27206, 0, 0.37831, 0.08867, 0.45772, 0.15287, 0.534],
1300
+ [0.15287, 0.534, 0.21684, 0.61003, 0.2808, 0.686, 0.34476, 0.762],
1301
+ [0.34476, 0.762, 0.39262, 0.81887, 0.44049, 0.87575, 0.48835, 0.93263],
1302
+ [0.48835, 0.93263, 0.49224, 0.93722, 0.49611, 0.94184, 0.5, 0.94647],
1303
+ [0.5, 0.94647, 0.5, 0.9466, 0.5, 0.94674, 0.5, 0.94688],
1304
+ [0.5, 0.94688, 0.50389, 0.94225, 0.50776, 0.93766, 0.51165, 0.93303],
1305
+ [0.51165, 0.93303, 0.55951, 0.87616, 0.60737, 0.81931, 0.65524, 0.76244],
1306
+ [0.65524, 0.76244, 0.7192, 0.68644, 0.78317, 0.61044, 0.84713, 0.53444],
1307
+ [0.84713, 0.53444, 0.91133, 0.45816, 1, 0.37875, 1, 0.27247],
1308
+ [1, 0.27247, 1, 0.15156, 0.9036, 0.05353, 0.78469, 0.05353]
1309
+ ]);
1310
+ var clover4LeafShape = createShape([
1311
+ [0.07095, 0.5, 0.02669, 0.44709, 0, 0.37882, 0, 0.30426],
1312
+ [0, 0.30426, 0, 0.13622, 0.13551, 0, 0.3027, 0],
1313
+ [0.3027, 0, 0.37834, 0, 0.44753, 0.02791, 0.50057, 0.07402],
1314
+ [0.50057, 0.07402, 0.55351, 0.02791, 0.62253, 0, 0.69801, 0],
1315
+ [0.69801, 0, 0.8648, 0, 1, 0.13622, 1, 0.30426],
1316
+ [1, 0.30426, 1, 0.37882, 0.97338, 0.44709, 0.92922, 0.5],
1317
+ [0.92922, 0.5, 0.97338, 0.55291, 1, 0.62118, 1, 0.69574],
1318
+ [1, 0.69574, 1, 0.86378, 0.8648, 1, 0.69801, 1],
1319
+ [0.69801, 1, 0.62253, 1, 0.55351, 0.97209, 0.50057, 0.92598],
1320
+ [0.50057, 0.92598, 0.44753, 0.97209, 0.37834, 1, 0.3027, 1],
1321
+ [0.3027, 1, 0.13551, 1, 0, 0.86378, 0, 0.69574],
1322
+ [0, 0.69574, 0, 0.62118, 0.02669, 0.55291, 0.07095, 0.5]
1323
+ ]);
1324
+ var clover8LeafShape = createShape([
1325
+ [0.96431, 0.5, 1.0451, 0.6505, 0.98406, 0.78678, 0.82834, 0.82831],
1326
+ [0.82834, 0.82831, 0.78678, 0.98406, 0.6505, 1.04506, 0.5, 0.96431],
1327
+ [0.5, 0.96431, 0.34947, 1.0451, 0.21319, 0.98406, 0.17166, 0.82834],
1328
+ [0.17166, 0.82834, 0.01594, 0.78678, -0.0451, 0.6505, 0.03569, 0.5],
1329
+ [0.03569, 0.5, -0.0451, 0.34947, 0.01594, 0.21319, 0.17166, 0.17166],
1330
+ [0.17166, 0.17166, 0.21319, 0.01594, 0.34947, -0.0451, 0.5, 0.03569],
1331
+ [0.5, 0.03569, 0.6505, -0.0451, 0.78678, 0.01594, 0.82831, 0.17166],
1332
+ [0.82831, 0.17166, 0.98406, 0.21319, 1.04506, 0.34947, 0.96431, 0.5]
1333
+ ]);
1334
+ var ovalShape = createShape([
1335
+ [0.77103, 0.77103, 0.53902, 1.00303, 0.22959, 1.06979, 0.07991, 0.9201],
1336
+ [0.07991, 0.9201, -0.06978, 0.7704, -304e-5, 0.46097, 0.22897, 0.22897],
1337
+ [0.22897, 0.22897, 0.46098, -303e-5, 0.77041, -0.06979, 0.92009, 0.0799],
1338
+ [0.92009, 0.0799, 1.06978, 0.2296, 1.00304, 0.53903, 0.77103, 0.77103]
1339
+ ]);
1340
+ var pentagonShape = createShape([
1341
+ [0.3426, 0.07617, 0.39138, 0.03842, 0.41575, 0.01954, 0.44181, 0.01017],
1342
+ [0.44181, 0.01017, 0.47942, -336e-5, 0.52058, -336e-5, 0.55819, 0.01017],
1343
+ [0.55819, 0.01017, 0.58425, 0.01954, 0.60862, 0.03842, 0.6574, 0.07617],
1344
+ [0.6574, 0.07617, 0.69296, 0.1037, 0.72853, 0.13123, 0.76409, 0.15876],
1345
+ [0.76409, 0.15876, 0.79963, 0.18455, 0.83517, 0.21034, 0.87071, 0.23613],
1346
+ [0.87071, 0.23613, 0.9213, 0.27285, 0.94662, 0.29123, 0.96352, 0.31429],
1347
+ [0.96352, 0.31429, 0.98796, 0.34769, 1.00083, 0.38872, 0.99996, 0.43069],
1348
+ [0.99996, 0.43069, 0.99933, 0.45972, 0.9893, 0.49006, 0.96918, 0.55072],
1349
+ [0.96918, 0.55072, 0.95522, 0.59283, 0.94126, 0.63495, 0.9273, 0.67706],
1350
+ [0.9273, 0.67706, 0.91443, 0.72021, 0.90155, 0.76335, 0.88868, 0.8065],
1351
+ [0.88868, 0.8065, 0.87052, 0.86724, 0.86146, 0.89762, 0.84562, 0.92124],
1352
+ [0.84562, 0.92124, 0.82268, 0.95543, 0.78934, 0.98055, 0.75099, 0.99259],
1353
+ [0.75099, 0.99259, 0.7245, 1.00093, 0.69393, 1.00043, 0.63281, 0.99946],
1354
+ [0.63281, 0.99946, 0.58854, 0.99876, 0.54427, 0.99806, 0.5, 0.99737],
1355
+ [0.5, 0.99737, 0.45573, 0.99806, 0.41146, 0.99876, 0.36719, 0.99946],
1356
+ [0.36719, 0.99946, 0.30607, 1.00043, 0.2755, 1.00093, 0.24901, 0.99259],
1357
+ [0.24901, 0.99259, 0.21066, 0.98055, 0.17732, 0.95543, 0.15438, 0.92124],
1358
+ [0.15438, 0.92124, 0.13854, 0.89762, 0.12948, 0.86724, 0.11132, 0.8065],
1359
+ [0.11132, 0.8065, 0.09845, 0.76335, 0.08557, 0.72021, 0.0727, 0.67706],
1360
+ [0.0727, 0.67706, 0.05874, 0.63495, 0.04478, 0.59283, 0.03082, 0.55072],
1361
+ [0.03082, 0.55072, 0.0107, 0.49006, 67e-5, 0.45972, 4e-5, 0.43069],
1362
+ [4e-5, 0.43069, -83e-5, 0.38872, 0.01204, 0.34769, 0.03648, 0.31429],
1363
+ [0.03648, 0.31429, 0.05338, 0.29123, 0.0787, 0.27285, 0.12929, 0.23613],
1364
+ [0.12929, 0.23613, 0.16483, 0.21034, 0.20037, 0.18455, 0.23591, 0.15876],
1365
+ [0.23591, 0.15876, 0.27147, 0.13123, 0.30704, 0.1037, 0.3426, 0.07617]
1366
+ ]);
1367
+ var pillShape = createShape([
1368
+ [0.2662, 0.1259, 0.43407, -0.04197, 0.70623, -0.04197, 0.8741, 0.1259],
1369
+ [0.8741, 0.1259, 1.04197, 0.29377, 1.04197, 0.56593, 0.8741, 0.7338],
1370
+ [0.8741, 0.7338, 0.82733, 0.78057, 0.78057, 0.82733, 0.7338, 0.8741],
1371
+ [0.7338, 0.8741, 0.56593, 1.04197, 0.29377, 1.04197, 0.1259, 0.8741],
1372
+ [0.1259, 0.8741, -0.04197, 0.70623, -0.04197, 0.43407, 0.1259, 0.2662],
1373
+ [0.1259, 0.2662, 0.17267, 0.21943, 0.21943, 0.17267, 0.2662, 0.1259]
1374
+ ]);
1375
+ var pixelCircleShape = createShape([
1376
+ [0.70372, 0, 0.56791, 0, 0.43209, 0, 0.29628, 0],
1377
+ [0.29628, 0, 0.29628, 0.0216, 0.29628, 0.04321, 0.29628, 0.06481],
1378
+ [0.29628, 0.06481, 0.24999, 0.06481, 0.2037, 0.06481, 0.15741, 0.06481],
1379
+ [0.15741, 0.06481, 0.15741, 0.09259, 0.15741, 0.12037, 0.15741, 0.14816],
1380
+ [0.15741, 0.14816, 0.12963, 0.14816, 0.10185, 0.14816, 0.07408, 0.14816],
1381
+ [0.07408, 0.14816, 0.07408, 0.19753, 0.07408, 0.24691, 0.07408, 0.29628],
1382
+ [0.07408, 0.29628, 0.04938, 0.29628, 0.02469, 0.29628, 0, 0.29628],
1383
+ [0, 0.29628, 0, 0.43209, 0, 0.56791, 0, 0.70372],
1384
+ [0, 0.70372, 0.02469, 0.70372, 0.04938, 0.70372, 0.07408, 0.70372],
1385
+ [0.07408, 0.70372, 0.07408, 0.75309, 0.07408, 0.80247, 0.07408, 0.85184],
1386
+ [0.07408, 0.85184, 0.10185, 0.85184, 0.12963, 0.85184, 0.15741, 0.85184],
1387
+ [0.15741, 0.85184, 0.15741, 0.87962, 0.15741, 0.90741, 0.15741, 0.93519],
1388
+ [0.15741, 0.93519, 0.2037, 0.93519, 0.24999, 0.93519, 0.29628, 0.93519],
1389
+ [0.29628, 0.93519, 0.29628, 0.95679, 0.29628, 0.9784, 0.29628, 1],
1390
+ [0.29628, 1, 0.43209, 1, 0.56791, 1, 0.70372, 1],
1391
+ [0.70372, 1, 0.70372, 0.9784, 0.70372, 0.95679, 0.70372, 0.93519],
1392
+ [0.70372, 0.93519, 0.75001, 0.93519, 0.7963, 0.93519, 0.84259, 0.93519],
1393
+ [0.84259, 0.93519, 0.84259, 0.90741, 0.84259, 0.87962, 0.84259, 0.85184],
1394
+ [0.84259, 0.85184, 0.87037, 0.85184, 0.89816, 0.85184, 0.92594, 0.85184],
1395
+ [0.92594, 0.85184, 0.92594, 0.80247, 0.92594, 0.75309, 0.92594, 0.70372],
1396
+ [0.92594, 0.70372, 0.95062, 0.70372, 0.97531, 0.70372, 1, 0.70372],
1397
+ [1, 0.70372, 1, 0.56791, 1, 0.43209, 1, 0.29628],
1398
+ [1, 0.29628, 0.97531, 0.29628, 0.95062, 0.29628, 0.92594, 0.29628],
1399
+ [0.92594, 0.29628, 0.92594, 0.24691, 0.92594, 0.19753, 0.92594, 0.14816],
1400
+ [0.92594, 0.14816, 0.89816, 0.14816, 0.87037, 0.14816, 0.84259, 0.14816],
1401
+ [0.84259, 0.14816, 0.84259, 0.12038, 0.84259, 0.09259, 0.84259, 0.06481],
1402
+ [0.84259, 0.06481, 0.7963, 0.06481, 0.75001, 0.06481, 0.70372, 0.06481],
1403
+ [0.70372, 0.06481, 0.70372, 0.04321, 0.70372, 0.0216, 0.70372, 0]
1404
+ ]);
1405
+ var pixelTriangleShape = createShape([
1406
+ [0.28637, 0, 0.22842, 0, 0.17046, 0, 0.1125, 0],
1407
+ [0.1125, 0, 0.1125, 0.33333, 0.1125, 0.66667, 0.1125, 1],
1408
+ [0.1125, 1, 0.17046, 1, 0.22842, 1, 0.28637, 1],
1409
+ [0.28637, 1, 0.28637, 0.97101, 0.28637, 0.94203, 0.28637, 0.91304],
1410
+ [0.28637, 0.91304, 0.33108, 0.91304, 0.37579, 0.91304, 0.4205, 0.91304],
1411
+ [0.4205, 0.91304, 0.4205, 0.88551, 0.4205, 0.85797, 0.4205, 0.83043],
1412
+ [0.4205, 0.83043, 0.46688, 0.83043, 0.51325, 0.83043, 0.55963, 0.83043],
1413
+ [0.55963, 0.83043, 0.55963, 0.79855, 0.55963, 0.76667, 0.55963, 0.73478],
1414
+ [0.55963, 0.73478, 0.59771, 0.73478, 0.63579, 0.73478, 0.67388, 0.73478],
1415
+ [0.67388, 0.73478, 0.67388, 0.70869, 0.67388, 0.68261, 0.67388, 0.65652],
1416
+ [0.67388, 0.65652, 0.71197, 0.65652, 0.75006, 0.65652, 0.78816, 0.65652],
1417
+ [0.78816, 0.65652, 0.78816, 0.62464, 0.78816, 0.59275, 0.78816, 0.56087],
1418
+ [0.78816, 0.56087, 0.82127, 0.56087, 0.85439, 0.56087, 0.8875, 0.56087],
1419
+ [0.8875, 0.56087, 0.8875, 0.52029, 0.8875, 0.47971, 0.8875, 0.43913],
1420
+ [0.8875, 0.43913, 0.85439, 0.43913, 0.82127, 0.43913, 0.78816, 0.43913],
1421
+ [0.78816, 0.43913, 0.78816, 0.40725, 0.78816, 0.37536, 0.78816, 0.34347],
1422
+ [0.78816, 0.34347, 0.75006, 0.34347, 0.71197, 0.34347, 0.67388, 0.34347],
1423
+ [0.67388, 0.34347, 0.67388, 0.31739, 0.67388, 0.2913, 0.67388, 0.26522],
1424
+ [0.67388, 0.26522, 0.63579, 0.26522, 0.59771, 0.26522, 0.55963, 0.26522],
1425
+ [0.55963, 0.26522, 0.55963, 0.23333, 0.55963, 0.20145, 0.55963, 0.16957],
1426
+ [0.55963, 0.16957, 0.51325, 0.16957, 0.46688, 0.16957, 0.4205, 0.16957],
1427
+ [0.4205, 0.16957, 0.4205, 0.14203, 0.4205, 0.11449, 0.4205, 0.08696],
1428
+ [0.4205, 0.08696, 0.37579, 0.08696, 0.33108, 0.08696, 0.28637, 0.08696],
1429
+ [0.28637, 0.08696, 0.28637, 0.05797, 0.28637, 0.02899, 0.28637, 0]
1430
+ ]);
1431
+ var puffyDiamondShape = createShape([
1432
+ [0.77937, 0.78048, 0.81712, 0.7427, 0.8299, 0.6894, 0.81768, 0.64111],
1433
+ [0.81768, 0.64111, 0.86599, 0.65339, 0.91937, 0.64063, 0.95718, 0.60282],
1434
+ [0.95718, 0.60282, 1.01427, 0.54574, 1.01427, 0.45319, 0.95718, 0.39611],
1435
+ [0.95718, 0.39611, 0.91959, 0.35852, 0.86662, 0.34569, 0.81856, 0.3576],
1436
+ [0.81856, 0.3576, 0.82928, 0.31027, 0.81621, 0.25865, 0.77937, 0.2218],
1437
+ [0.77937, 0.2218, 0.7415, 0.18394, 0.68803, 0.17119, 0.63969, 0.18355],
1438
+ [0.63969, 0.18355, 0.6525, 0.13492, 0.63984, 0.08095, 0.60169, 0.04282],
1439
+ [0.60169, 0.04282, 0.54462, -0.01426, 0.45206, -0.01426, 0.395, 0.04282],
1440
+ [0.395, 0.04282, 0.3571, 0.08073, 0.34435, 0.13427, 0.35678, 0.18269],
1441
+ [0.35678, 0.18269, 0.30938, 0.17184, 0.2576, 0.18487, 0.22069, 0.2218],
1442
+ [0.22069, 0.2218, 0.18385, 0.25865, 0.17079, 0.31028, 0.1815, 0.35761],
1443
+ [0.1815, 0.35761, 0.13341, 0.34568, 0.08041, 0.35851, 0.04282, 0.39611],
1444
+ [0.04282, 0.39611, -0.01427, 0.45319, -0.01427, 0.54574, 0.04282, 0.60282],
1445
+ [0.04282, 0.60282, 0.08063, 0.64064, 0.13404, 0.6534, 0.18235, 0.6411],
1446
+ [0.18235, 0.6411, 0.17013, 0.68939, 0.18291, 0.7427, 0.22069, 0.78048],
1447
+ [0.22069, 0.78048, 0.25744, 0.81725, 0.30894, 0.83033, 0.35619, 0.81973],
1448
+ [0.35619, 0.81973, 0.34478, 0.8675, 0.35772, 0.9199, 0.395, 0.95718],
1449
+ [0.395, 0.95718, 0.45206, 1.01426, 0.54462, 1.01426, 0.60169, 0.95718],
1450
+ [0.60169, 0.95718, 0.63919, 0.91968, 0.65206, 0.86688, 0.64028, 0.81888],
1451
+ [0.64028, 0.81888, 0.6885, 0.83098, 0.74165, 0.81817, 0.77937, 0.78048]
1452
+ ]);
1453
+ var puffyShape = createShape([
1454
+ [0.99994, 0.49408, 0.99912, 0.42679, 0.94916, 0.37292, 0.88825, 0.37382],
1455
+ [0.88825, 0.37382, 0.88491, 0.37382, 0.88159, 0.3741, 0.87831, 0.37449],
1456
+ [0.87831, 0.37449, 0.88087, 0.37218, 0.88337, 0.36982, 0.88575, 0.36722],
1457
+ [0.88575, 0.36722, 0.92937, 0.32028, 0.93028, 0.24307, 0.88784, 0.19483],
1458
+ [0.88784, 0.19483, 0.88534, 0.19201, 0.88287, 0.18919, 0.88031, 0.18648],
1459
+ [0.88031, 0.18648, 0.83669, 0.13954, 0.76694, 0.14055, 0.72444, 0.1888],
1460
+ [0.72444, 0.1888, 0.72209, 0.19144, 0.71997, 0.19421, 0.71787, 0.19703],
1461
+ [0.71787, 0.19703, 0.71822, 0.19342, 0.71844, 0.18975, 0.7185, 0.18603],
1462
+ [0.7185, 0.18603, 0.71934, 0.11874, 0.67066, 0.06346, 0.60981, 0.0625],
1463
+ [0.60981, 0.0625, 0.60682, 0.0625, 0.60383, 0.0625, 0.60084, 0.0625],
1464
+ [0.60084, 0.0625, 0.55575, 0.0625, 0.51706, 0.09248, 0.5, 0.13537],
1465
+ [0.5, 0.13537, 0.48294, 0.09248, 0.44422, 0.0625, 0.39916, 0.0625],
1466
+ [0.39916, 0.0625, 0.39617, 0.0625, 0.39318, 0.0625, 0.39019, 0.0625],
1467
+ [0.39019, 0.0625, 0.32934, 0.0634, 0.28066, 0.11869, 0.28147, 0.18603],
1468
+ [0.28147, 0.18603, 0.28147, 0.18975, 0.28172, 0.19342, 0.28206, 0.19703],
1469
+ [0.28206, 0.19703, 0.28, 0.19418, 0.27781, 0.19144, 0.2755, 0.1888],
1470
+ [0.2755, 0.1888, 0.23306, 0.14055, 0.16325, 0.13954, 0.11962, 0.18648],
1471
+ [0.11962, 0.18648, 0.11709, 0.18925, 0.11453, 0.19201, 0.11209, 0.19483],
1472
+ [0.11209, 0.19483, 0.06966, 0.24307, 0.07056, 0.32022, 0.11419, 0.36722],
1473
+ [0.11419, 0.36722, 0.11659, 0.36982, 0.11906, 0.37218, 0.12162, 0.37449],
1474
+ [0.12162, 0.37449, 0.11833, 0.37409, 0.11501, 0.37387, 0.11169, 0.37382],
1475
+ [0.11169, 0.37382, 0.05084, 0.37292, 87e-5, 0.42679, 0, 0.49408],
1476
+ [0, 0.49408, 0, 0.49803, 0, 0.50197, 0, 0.50592],
1477
+ [0, 0.50592, 81e-5, 0.57321, 0.05081, 0.62708, 0.11169, 0.62618],
1478
+ [0.11169, 0.62618, 0.11506, 0.62618, 0.11837, 0.6259, 0.12162, 0.62551],
1479
+ [0.12162, 0.62551, 0.11906, 0.62782, 0.11659, 0.63018, 0.11419, 0.63278],
1480
+ [0.11419, 0.63278, 0.07056, 0.67972, 0.06966, 0.75693, 0.11209, 0.80518],
1481
+ [0.11209, 0.80518, 0.11459, 0.80799, 0.11709, 0.81081, 0.11962, 0.81352],
1482
+ [0.11962, 0.81352, 0.16325, 0.86046, 0.233, 0.85945, 0.2755, 0.8112],
1483
+ [0.2755, 0.8112, 0.27784, 0.80856, 0.28, 0.80579, 0.28206, 0.80297],
1484
+ [0.28206, 0.80298, 0.28171, 0.80663, 0.28151, 0.8103, 0.28147, 0.81397],
1485
+ [0.28147, 0.81397, 0.28066, 0.88126, 0.32931, 0.9366, 0.39019, 0.9375],
1486
+ [0.39019, 0.9375, 0.39318, 0.9375, 0.39617, 0.9375, 0.39916, 0.9375],
1487
+ [0.39916, 0.9375, 0.44425, 0.9375, 0.48294, 0.90752, 0.5, 0.86463],
1488
+ [0.5, 0.86463, 0.51706, 0.90752, 0.55578, 0.9375, 0.60084, 0.9375],
1489
+ [0.60084, 0.9375, 0.60383, 0.9375, 0.60682, 0.9375, 0.60981, 0.9375],
1490
+ [0.60981, 0.9375, 0.67066, 0.9366, 0.71934, 0.88131, 0.71853, 0.81397],
1491
+ [0.71853, 0.81397, 0.71853, 0.81025, 0.71828, 0.80658, 0.71794, 0.80297],
1492
+ [0.71794, 0.80297, 0.72, 0.80579, 0.72216, 0.80856, 0.7245, 0.8112],
1493
+ [0.7245, 0.8112, 0.76694, 0.85945, 0.83675, 0.86046, 0.88037, 0.81352],
1494
+ [0.88037, 0.81352, 0.88291, 0.81075, 0.88547, 0.80799, 0.88791, 0.80518],
1495
+ [0.88791, 0.80518, 0.93034, 0.75693, 0.92944, 0.67978, 0.88581, 0.63278],
1496
+ [0.88581, 0.63278, 0.88341, 0.63018, 0.88094, 0.62782, 0.87838, 0.62551],
1497
+ [0.87838, 0.62551, 0.88167, 0.62591, 0.88499, 0.62613, 0.88831, 0.62618],
1498
+ [0.88831, 0.62618, 0.94916, 0.62708, 0.99919, 0.57327, 1, 0.50592],
1499
+ [1, 0.50592, 1, 0.50197, 1, 0.49803, 1, 0.49408],
1500
+ [1, 0.49408, 0.99998, 0.49408, 0.99996, 0.49408, 0.99994, 0.49408]
1501
+ ]);
1502
+ var semiCircleShape = createShape([
1503
+ [1, 0.70913, 1, 0.76622, 0.95372, 0.8125, 0.89663, 0.8125],
1504
+ [0.89663, 0.8125, 0.63221, 0.8125, 0.36779, 0.8125, 0.10337, 0.8125],
1505
+ [0.10337, 0.8125, 0.04628, 0.8125, 0, 0.76622, 0, 0.70913],
1506
+ [0, 0.70913, 0, 0.70192, 0, 0.69471, 0, 0.6875],
1507
+ [0, 0.6875, 0, 0.41134, 0.22386, 0.1875, 0.5, 0.1875],
1508
+ [0.5, 0.1875, 0.77614, 0.1875, 1, 0.41134, 1, 0.6875],
1509
+ [1, 0.6875, 1, 0.69471, 1, 0.70192, 1, 0.70913]
1510
+ ]);
1511
+ var cookie12SidedShape = createShape([
1512
+ [0.42719, 0.03077, 0.42887, 0.02912, 0.42972, 0.02827, 0.43044, 0.02759],
1513
+ [0.43044, 0.02759, 0.46953, -92e-4, 0.53047, -92e-4, 0.56956, 0.02759],
1514
+ [0.56956, 0.02759, 0.57028, 0.02827, 0.57113, 0.02912, 0.57281, 0.03077],
1515
+ [0.57281, 0.03077, 0.57384, 0.03174, 0.57434, 0.03224, 0.57481, 0.03271],
1516
+ [0.57481, 0.03271, 0.59982, 0.05657, 0.63526, 0.06606, 0.66885, 0.0579],
1517
+ [0.66885, 0.0579, 0.6695, 0.05774, 0.67019, 0.05756, 0.67157, 0.05721],
1518
+ [0.67157, 0.05721, 0.67385, 0.05662, 0.675, 0.05634, 0.67597, 0.05609],
1519
+ [0.67597, 0.05609, 0.72819, 0.04377, 0.781, 0.07424, 0.79644, 0.12565],
1520
+ [0.79644, 0.12565, 0.79672, 0.12662, 0.79704, 0.12774, 0.79769, 0.13003],
1521
+ [0.79769, 0.13003, 0.79807, 0.1314, 0.79825, 0.13209, 0.79844, 0.13274],
1522
+ [0.79844, 0.13274, 0.80817, 0.1659, 0.8341, 0.19183, 0.86726, 0.20156],
1523
+ [0.86726, 0.20156, 0.86791, 0.20175, 0.8686, 0.20193, 0.86997, 0.20231],
1524
+ [0.86997, 0.20231, 0.87226, 0.20296, 0.87338, 0.20328, 0.87435, 0.20356],
1525
+ [0.87435, 0.20356, 0.92576, 0.219, 0.95623, 0.27181, 0.94391, 0.32403],
1526
+ [0.94391, 0.32403, 0.94366, 0.325, 0.94338, 0.32615, 0.94279, 0.32843],
1527
+ [0.94279, 0.32843, 0.94244, 0.32981, 0.94226, 0.3305, 0.9421, 0.33115],
1528
+ [0.9421, 0.33115, 0.93394, 0.36474, 0.94343, 0.40018, 0.96729, 0.42519],
1529
+ [0.96729, 0.42519, 0.96776, 0.42566, 0.96826, 0.42616, 0.96923, 0.42719],
1530
+ [0.96923, 0.42719, 0.97088, 0.42887, 0.97173, 0.42972, 0.97241, 0.43044],
1531
+ [0.97241, 0.43044, 1.0092, 0.46953, 1.0092, 0.53047, 0.97241, 0.56956],
1532
+ [0.97241, 0.56956, 0.97173, 0.57028, 0.97088, 0.57113, 0.96923, 0.57281],
1533
+ [0.96923, 0.57281, 0.96826, 0.57384, 0.96776, 0.57434, 0.96729, 0.57481],
1534
+ [0.96729, 0.57481, 0.94343, 0.59982, 0.93394, 0.63526, 0.9421, 0.66885],
1535
+ [0.9421, 0.66885, 0.94226, 0.6695, 0.94244, 0.67019, 0.94279, 0.67157],
1536
+ [0.94279, 0.67157, 0.94338, 0.67385, 0.94366, 0.675, 0.94391, 0.67597],
1537
+ [0.94391, 0.67597, 0.95623, 0.72819, 0.92576, 0.781, 0.87435, 0.79644],
1538
+ [0.87435, 0.79644, 0.87338, 0.79672, 0.87226, 0.79704, 0.86997, 0.79769],
1539
+ [0.86997, 0.79769, 0.8686, 0.79807, 0.86791, 0.79825, 0.86726, 0.79844],
1540
+ [0.86726, 0.79844, 0.8341, 0.80817, 0.80817, 0.8341, 0.79844, 0.86726],
1541
+ [0.79844, 0.86726, 0.79825, 0.86791, 0.79807, 0.8686, 0.79769, 0.86997],
1542
+ [0.79769, 0.86997, 0.79704, 0.87226, 0.79672, 0.87338, 0.79644, 0.87435],
1543
+ [0.79644, 0.87435, 0.781, 0.92576, 0.72819, 0.95623, 0.67597, 0.94391],
1544
+ [0.67597, 0.94391, 0.675, 0.94366, 0.67385, 0.94338, 0.67157, 0.94279],
1545
+ [0.67157, 0.94279, 0.67019, 0.94244, 0.6695, 0.94226, 0.66885, 0.9421],
1546
+ [0.66885, 0.9421, 0.63526, 0.93394, 0.59982, 0.94343, 0.57481, 0.96729],
1547
+ [0.57481, 0.96729, 0.57434, 0.96776, 0.57384, 0.96826, 0.57281, 0.96923],
1548
+ [0.57281, 0.96923, 0.57113, 0.97088, 0.57028, 0.97173, 0.56956, 0.97241],
1549
+ [0.56956, 0.97241, 0.53047, 1.0092, 0.46953, 1.0092, 0.43044, 0.97241],
1550
+ [0.43044, 0.97241, 0.42972, 0.97173, 0.42887, 0.97088, 0.42719, 0.96923],
1551
+ [0.42719, 0.96923, 0.42616, 0.96826, 0.42566, 0.96776, 0.42519, 0.96729],
1552
+ [0.42519, 0.96729, 0.40018, 0.94343, 0.36474, 0.93394, 0.33115, 0.9421],
1553
+ [0.33115, 0.9421, 0.3305, 0.94226, 0.32981, 0.94244, 0.32843, 0.94279],
1554
+ [0.32843, 0.94279, 0.32615, 0.94338, 0.325, 0.94366, 0.32403, 0.94391],
1555
+ [0.32403, 0.94391, 0.27181, 0.95623, 0.219, 0.92576, 0.20356, 0.87435],
1556
+ [0.20356, 0.87435, 0.20328, 0.87338, 0.20296, 0.87226, 0.20231, 0.86997],
1557
+ [0.20231, 0.86997, 0.20193, 0.8686, 0.20175, 0.86791, 0.20156, 0.86726],
1558
+ [0.20156, 0.86726, 0.19183, 0.8341, 0.1659, 0.80817, 0.13274, 0.79844],
1559
+ [0.13274, 0.79844, 0.13209, 0.79825, 0.1314, 0.79807, 0.13003, 0.79769],
1560
+ [0.13003, 0.79769, 0.12774, 0.79704, 0.12662, 0.79672, 0.12565, 0.79644],
1561
+ [0.12565, 0.79644, 0.07424, 0.781, 0.04377, 0.72819, 0.05609, 0.67597],
1562
+ [0.05609, 0.67597, 0.05634, 0.675, 0.05662, 0.67385, 0.05721, 0.67157],
1563
+ [0.05721, 0.67157, 0.05756, 0.67019, 0.05774, 0.6695, 0.0579, 0.66885],
1564
+ [0.0579, 0.66885, 0.06606, 0.63526, 0.05657, 0.59982, 0.03271, 0.57481],
1565
+ [0.03271, 0.57481, 0.03224, 0.57434, 0.03174, 0.57384, 0.03077, 0.57281],
1566
+ [0.03077, 0.57281, 0.02912, 0.57113, 0.02827, 0.57028, 0.02759, 0.56956],
1567
+ [0.02759, 0.56956, -92e-4, 0.53047, -92e-4, 0.46953, 0.02759, 0.43044],
1568
+ [0.02759, 0.43044, 0.02827, 0.42972, 0.02912, 0.42887, 0.03077, 0.42719],
1569
+ [0.03077, 0.42719, 0.03174, 0.42616, 0.03224, 0.42566, 0.03271, 0.42519],
1570
+ [0.03271, 0.42519, 0.05657, 0.40018, 0.06606, 0.36474, 0.0579, 0.33115],
1571
+ [0.0579, 0.33115, 0.05774, 0.3305, 0.05756, 0.32981, 0.05721, 0.32843],
1572
+ [0.05721, 0.32843, 0.05662, 0.32615, 0.05634, 0.325, 0.05609, 0.32403],
1573
+ [0.05609, 0.32403, 0.04377, 0.27181, 0.07424, 0.219, 0.12565, 0.20356],
1574
+ [0.12565, 0.20356, 0.12662, 0.20328, 0.12774, 0.20296, 0.13003, 0.20231],
1575
+ [0.13003, 0.20231, 0.1314, 0.20193, 0.13209, 0.20175, 0.13274, 0.20156],
1576
+ [0.13274, 0.20156, 0.1659, 0.19183, 0.19183, 0.1659, 0.20156, 0.13274],
1577
+ [0.20156, 0.13274, 0.20175, 0.13209, 0.20193, 0.1314, 0.20231, 0.13003],
1578
+ [0.20231, 0.13003, 0.20296, 0.12774, 0.20328, 0.12662, 0.20356, 0.12565],
1579
+ [0.20356, 0.12565, 0.219, 0.07424, 0.27181, 0.04377, 0.32403, 0.05609],
1580
+ [0.32403, 0.05609, 0.325, 0.05634, 0.32615, 0.05662, 0.32843, 0.05721],
1581
+ [0.32843, 0.05721, 0.32981, 0.05756, 0.3305, 0.05774, 0.33115, 0.0579],
1582
+ [0.33115, 0.0579, 0.36474, 0.06606, 0.40018, 0.05657, 0.42519, 0.03271],
1583
+ [0.42519, 0.03271, 0.42566, 0.03224, 0.42616, 0.03174, 0.42719, 0.03077]
1584
+ ]);
1585
+ var cookie4SidedShape = createShape([
1586
+ [0.63833, 0.02217, 0.85312, -0.07111, 1.07112, 0.14689, 0.97783, 0.36168],
1587
+ [0.97783, 0.36168, 0.97269, 0.37351, 0.96755, 0.38534, 0.9624, 0.39718],
1588
+ [0.9624, 0.39718, 0.93394, 0.46277, 0.93394, 0.53723, 0.9624, 0.60282],
1589
+ [0.9624, 0.60282, 0.96755, 0.61466, 0.97269, 0.62649, 0.97783, 0.63832],
1590
+ [0.97783, 0.63832, 1.07112, 0.85311, 0.85312, 1.07111, 0.63833, 0.97783],
1591
+ [0.63833, 0.97783, 0.6265, 0.97268, 0.61466, 0.96754, 0.60283, 0.9624],
1592
+ [0.60283, 0.9624, 0.53724, 0.93393, 0.46278, 0.93393, 0.39718, 0.9624],
1593
+ [0.39718, 0.9624, 0.38535, 0.96754, 0.37352, 0.97268, 0.36168, 0.97783],
1594
+ [0.36168, 0.97783, 0.14689, 1.07111, -0.07112, 0.85311, 0.02217, 0.63832],
1595
+ [0.02217, 0.63832, 0.02731, 0.62649, 0.03245, 0.61466, 0.03759, 0.60282],
1596
+ [0.03759, 0.60282, 0.06608, 0.53723, 0.06608, 0.46277, 0.03759, 0.39718],
1597
+ [0.03759, 0.39718, 0.03245, 0.38534, 0.02731, 0.37351, 0.02217, 0.36168],
1598
+ [0.02217, 0.36168, -0.07112, 0.14689, 0.14689, -0.07111, 0.36168, 0.02217],
1599
+ [0.36168, 0.02217, 0.37352, 0.02732, 0.38535, 0.03246, 0.39718, 0.0376],
1600
+ [0.39718, 0.0376, 0.46278, 0.06607, 0.53724, 0.06607, 0.60283, 0.0376],
1601
+ [0.60283, 0.0376, 0.61466, 0.03246, 0.6265, 0.02732, 0.63833, 0.02217]
1602
+ ]);
1603
+ var cookie6SidedShape = createShape([
1604
+ [0.32337, 0.07142, 0.42176, -0.02381, 0.57824, -0.02381, 0.67663, 0.07142],
1605
+ [0.67663, 0.07142, 0.70677, 0.10055, 0.74365, 0.12178, 0.78399, 0.13319],
1606
+ [0.78399, 0.13319, 0.91589, 0.17053, 0.99413, 0.30566, 0.96061, 0.4382],
1607
+ [0.96061, 0.4382, 0.95036, 0.47876, 0.95036, 0.52124, 0.96061, 0.5618],
1608
+ [0.96061, 0.5618, 0.99413, 0.69434, 0.91589, 0.82947, 0.78399, 0.86681],
1609
+ [0.78399, 0.86681, 0.74365, 0.87822, 0.70677, 0.89945, 0.67663, 0.92858],
1610
+ [0.67663, 0.92858, 0.57824, 1.02381, 0.42176, 1.02381, 0.32337, 0.92858],
1611
+ [0.32337, 0.92858, 0.29323, 0.89945, 0.25635, 0.87822, 0.21601, 0.86681],
1612
+ [0.21601, 0.86681, 0.08411, 0.82947, 587e-5, 0.69434, 0.03939, 0.5618],
1613
+ [0.03939, 0.5618, 0.04964, 0.52124, 0.04964, 0.47876, 0.03939, 0.4382],
1614
+ [0.03939, 0.4382, 587e-5, 0.30566, 0.08411, 0.17053, 0.21601, 0.13319],
1615
+ [0.21601, 0.13319, 0.25635, 0.12178, 0.29323, 0.10055, 0.32337, 0.07142]
1616
+ ]);
1617
+ var cookie7SidedShape = createShape([
1618
+ [0.35209, 0.06806, 0.36326, 0.05824, 0.36884, 0.05334, 0.37397, 0.04937],
1619
+ [0.37397, 0.04937, 0.4482, -813e-5, 0.5518, -813e-5, 0.62603, 0.04937],
1620
+ [0.62603, 0.04937, 0.63116, 0.05334, 0.63674, 0.05824, 0.64791, 0.06806],
1621
+ [0.64791, 0.06806, 0.65164, 0.07137, 0.65351, 0.07299, 0.65539, 0.07459],
1622
+ [0.65539, 0.07459, 0.68167, 0.09662, 0.71303, 0.11176, 0.74663, 0.11862],
1623
+ [0.74663, 0.11862, 0.74903, 0.11912, 0.75147, 0.11956, 0.75637, 0.12043],
1624
+ [0.75637, 0.12043, 0.771, 0.12306, 0.77831, 0.12434, 0.78461, 0.1259],
1625
+ [0.78461, 0.1259, 0.87573, 0.14821, 0.94032, 0.2294, 0.94176, 0.3234],
1626
+ [0.94176, 0.3234, 0.94186, 0.3299, 0.94151, 0.33734, 0.9408, 0.35221],
1627
+ [0.9408, 0.35221, 0.94057, 0.35721, 0.94045, 0.35968, 0.94039, 0.36215],
1628
+ [0.94039, 0.36215, 0.93958, 0.39649, 0.94732, 0.43049, 0.96293, 0.46109],
1629
+ [0.96293, 0.46109, 0.96404, 0.46328, 0.96523, 0.46546, 0.96759, 0.46987],
1630
+ [0.96759, 0.46987, 0.97467, 0.48296, 0.97821, 0.4895, 0.98093, 0.4954],
1631
+ [0.98093, 0.4954, 1.02032, 0.58071, 0.99727, 0.68196, 0.92484, 0.74168],
1632
+ [0.92484, 0.74168, 0.91984, 0.74584, 0.91381, 0.75018, 0.90177, 0.7589],
1633
+ [0.90177, 0.7589, 0.89774, 0.76184, 0.89572, 0.76328, 0.89377, 0.76478],
1634
+ [0.89377, 0.76478, 0.86646, 0.78557, 0.84476, 0.81284, 0.83064, 0.84412],
1635
+ [0.83064, 0.84412, 0.82963, 0.84637, 0.82865, 0.84865, 0.82671, 0.85325],
1636
+ [0.82671, 0.85325, 0.82091, 0.86696, 0.818, 0.87381, 0.8151, 0.87962],
1637
+ [0.8151, 0.87962, 0.7731, 0.96368, 0.67977, 1.00875, 0.58801, 0.98925],
1638
+ [0.58801, 0.98925, 0.58166, 0.98787, 0.57451, 0.98587, 0.56019, 0.98187],
1639
+ [0.56019, 0.98187, 0.5554, 0.98056, 0.55301, 0.97987, 0.55063, 0.97928],
1640
+ [0.55063, 0.97928, 0.51741, 0.97084, 0.48259, 0.97084, 0.44937, 0.97928],
1641
+ [0.44937, 0.97928, 0.44699, 0.97987, 0.4446, 0.98056, 0.43981, 0.98187],
1642
+ [0.43981, 0.98187, 0.42549, 0.98587, 0.41834, 0.98787, 0.41199, 0.98925],
1643
+ [0.41199, 0.98925, 0.32023, 1.00875, 0.2269, 0.96368, 0.1849, 0.87962],
1644
+ [0.1849, 0.87962, 0.18199, 0.87381, 0.17909, 0.86696, 0.17329, 0.85325],
1645
+ [0.17329, 0.85325, 0.17135, 0.84865, 0.17037, 0.84637, 0.16936, 0.84412],
1646
+ [0.16936, 0.84412, 0.15523, 0.81284, 0.13353, 0.78557, 0.10623, 0.76478],
1647
+ [0.10623, 0.76478, 0.10428, 0.76328, 0.10226, 0.76184, 0.09823, 0.7589],
1648
+ [0.09823, 0.7589, 0.08619, 0.75018, 0.08017, 0.74584, 0.07516, 0.74168],
1649
+ [0.07516, 0.74168, 273e-5, 0.68196, -0.02032, 0.58071, 0.01907, 0.4954],
1650
+ [0.01907, 0.4954, 0.02179, 0.4895, 0.02533, 0.48296, 0.03241, 0.46987],
1651
+ [0.03241, 0.46987, 0.03477, 0.46546, 0.03596, 0.46328, 0.03707, 0.46109],
1652
+ [0.03707, 0.46109, 0.05268, 0.43049, 0.06042, 0.39649, 0.05961, 0.36215],
1653
+ [0.05961, 0.36215, 0.05955, 0.35968, 0.05943, 0.35721, 0.0592, 0.35221],
1654
+ [0.0592, 0.35221, 0.05849, 0.33734, 0.05813, 0.3299, 0.05824, 0.3234],
1655
+ [0.05824, 0.3234, 0.05968, 0.2294, 0.12427, 0.14821, 0.21539, 0.1259],
1656
+ [0.21539, 0.1259, 0.22169, 0.12434, 0.229, 0.12306, 0.24363, 0.12043],
1657
+ [0.24363, 0.12043, 0.24853, 0.11956, 0.25097, 0.11912, 0.25337, 0.11862],
1658
+ [0.25337, 0.11862, 0.28697, 0.11176, 0.31833, 0.09662, 0.34461, 0.07459],
1659
+ [0.34461, 0.07459, 0.34649, 0.07299, 0.34836, 0.07137, 0.35209, 0.06806]
1660
+ ]);
1661
+ var cookie9SidedShape = createShape([
1662
+ [0.39144, 0.04182, 0.39684, 0.03735, 0.39953, 0.03513, 0.402, 0.03326],
1663
+ [0.402, 0.03326, 0.45981, -0.01109, 0.54019, -0.01109, 0.598, 0.03326],
1664
+ [0.598, 0.03326, 0.60047, 0.03513, 0.60316, 0.03735, 0.60856, 0.04182],
1665
+ [0.60856, 0.04182, 0.61097, 0.04379, 0.61216, 0.04479, 0.61334, 0.04576],
1666
+ [0.61334, 0.04576, 0.64056, 0.06743, 0.67404, 0.07974, 0.70881, 0.08085],
1667
+ [0.70881, 0.08085, 0.71031, 0.08088, 0.71187, 0.08091, 0.71497, 0.08094],
1668
+ [0.71497, 0.08094, 0.72194, 0.08104, 0.72544, 0.08107, 0.7285, 0.08123],
1669
+ [0.7285, 0.08123, 0.80112, 0.08494, 0.86243, 0.13694, 0.87865, 0.20854],
1670
+ [0.87865, 0.20854, 0.87934, 0.21157, 0.88, 0.21504, 0.88131, 0.22194],
1671
+ [0.88131, 0.22194, 0.88187, 0.22504, 0.88215, 0.22657, 0.88247, 0.22807],
1672
+ [0.88247, 0.22807, 0.88956, 0.26244, 0.90737, 0.29357, 0.93325, 0.31694],
1673
+ [0.93325, 0.31694, 0.9344, 0.31797, 0.93556, 0.319, 0.93793, 0.32104],
1674
+ [0.93793, 0.32104, 0.94321, 0.32563, 0.94584, 0.32794, 0.94809, 0.33007],
1675
+ [0.94809, 0.33007, 1.00137, 0.38004, 1.01528, 0.45972, 0.98215, 0.5251],
1676
+ [0.98215, 0.5251, 0.98075, 0.52788, 0.97903, 0.53094, 0.97562, 0.53707],
1677
+ [0.97562, 0.53707, 0.97409, 0.53982, 0.97334, 0.54119, 0.97262, 0.54253],
1678
+ [0.97262, 0.54253, 0.9562, 0.57351, 0.95003, 0.60889, 0.955, 0.6436],
1679
+ [0.955, 0.6436, 0.95521, 0.64513, 0.95546, 0.64666, 0.95596, 0.64975],
1680
+ [0.95596, 0.64975, 0.95709, 0.65672, 0.95765, 0.66019, 0.95803, 0.66328],
1681
+ [0.95803, 0.66328, 0.96703, 0.73616, 0.927, 0.80622, 0.86003, 0.83478],
1682
+ [0.86003, 0.83478, 0.85718, 0.836, 0.8539, 0.83725, 0.8474, 0.83975],
1683
+ [0.8474, 0.83975, 0.8445, 0.84084, 0.84303, 0.84141, 0.84162, 0.84197],
1684
+ [0.84162, 0.84197, 0.80937, 0.855, 0.78212, 0.87812, 0.76381, 0.90794],
1685
+ [0.76381, 0.90794, 0.76303, 0.90925, 0.76225, 0.91059, 0.76065, 0.91328],
1686
+ [0.76065, 0.91328, 0.75709, 0.91934, 0.75531, 0.92237, 0.75362, 0.925],
1687
+ [0.75362, 0.925, 0.71415, 0.98665, 0.63894, 1.01434, 0.56944, 0.99272],
1688
+ [0.56944, 0.99272, 0.5665, 0.99181, 0.56319, 0.99065, 0.55662, 0.98831],
1689
+ [0.55662, 0.98831, 0.55369, 0.98728, 0.55222, 0.98675, 0.55078, 0.98628],
1690
+ [0.55078, 0.98628, 0.51782, 0.97531, 0.48218, 0.97531, 0.44922, 0.98628],
1691
+ [0.44922, 0.98628, 0.44778, 0.98675, 0.44631, 0.98728, 0.44338, 0.98831],
1692
+ [0.44338, 0.98831, 0.43681, 0.99065, 0.4335, 0.99181, 0.43056, 0.99272],
1693
+ [0.43056, 0.99272, 0.36106, 1.01434, 0.28585, 0.98665, 0.24638, 0.925],
1694
+ [0.24638, 0.925, 0.24469, 0.92237, 0.24291, 0.91934, 0.23935, 0.91328],
1695
+ [0.23935, 0.91328, 0.23775, 0.91059, 0.23697, 0.90925, 0.23619, 0.90794],
1696
+ [0.23619, 0.90794, 0.21788, 0.87812, 0.19063, 0.855, 0.15838, 0.84197],
1697
+ [0.15838, 0.84197, 0.15697, 0.84141, 0.1555, 0.84084, 0.1526, 0.83975],
1698
+ [0.1526, 0.83975, 0.1461, 0.83725, 0.14282, 0.836, 0.13997, 0.83478],
1699
+ [0.13997, 0.83478, 0.073, 0.80622, 0.03297, 0.73616, 0.04197, 0.66328],
1700
+ [0.04197, 0.66328, 0.04235, 0.66019, 0.04291, 0.65672, 0.04404, 0.64975],
1701
+ [0.04404, 0.64975, 0.04454, 0.64666, 0.04479, 0.64513, 0.045, 0.6436],
1702
+ [0.045, 0.6436, 0.04997, 0.60889, 0.0438, 0.57351, 0.02738, 0.54253],
1703
+ [0.02738, 0.54253, 0.02666, 0.54119, 0.02591, 0.53982, 0.02438, 0.53707],
1704
+ [0.02438, 0.53707, 0.02097, 0.53094, 0.01925, 0.52788, 0.01785, 0.5251],
1705
+ [0.01785, 0.5251, -0.01528, 0.45972, -137e-5, 0.38004, 0.05191, 0.33007],
1706
+ [0.05191, 0.33007, 0.05416, 0.32794, 0.05679, 0.32563, 0.06207, 0.32104],
1707
+ [0.06207, 0.32104, 0.06444, 0.319, 0.0656, 0.31797, 0.06675, 0.31694],
1708
+ [0.06675, 0.31694, 0.0927, 0.29347, 0.11049, 0.26234, 0.11753, 0.22807],
1709
+ [0.11753, 0.22807, 0.11785, 0.22657, 0.11813, 0.22504, 0.11869, 0.22194],
1710
+ [0.11869, 0.22194, 0.12, 0.21504, 0.12066, 0.21157, 0.12135, 0.20854],
1711
+ [0.12135, 0.20854, 0.13757, 0.13694, 0.19888, 0.08494, 0.2715, 0.08123],
1712
+ [0.2715, 0.08123, 0.27456, 0.08107, 0.27806, 0.08104, 0.28503, 0.08094],
1713
+ [0.28503, 0.08094, 0.28813, 0.08091, 0.28969, 0.08088, 0.29119, 0.08085],
1714
+ [0.29119, 0.08085, 0.32596, 0.07974, 0.35944, 0.06743, 0.38666, 0.04576],
1715
+ [0.38666, 0.04576, 0.38784, 0.04479, 0.38903, 0.04379, 0.39144, 0.04182]
1716
+ ]);
1717
+ var slantedShape = createShape([
1718
+ [0.04911, 0.28294, 0.05715, 0.20613, 0.06118, 0.16772, 0.07595, 0.13743],
1719
+ [0.07595, 0.13743, 0.09732, 0.09358, 0.13462, 0.05972, 0.18009, 0.04288],
1720
+ [0.18009, 0.04288, 0.21151, 0.03125, 0.24979, 0.03125, 0.32635, 0.03125],
1721
+ [0.32635, 0.03125, 0.45521, 0.03125, 0.58407, 0.03125, 0.71293, 0.03125],
1722
+ [0.71293, 0.03125, 0.80551, 0.03125, 0.85181, 0.03125, 0.88715, 0.04642],
1723
+ [0.88715, 0.04642, 0.93832, 0.06838, 0.97725, 0.11203, 0.99352, 0.16569],
1724
+ [0.99352, 0.16569, 1.00476, 0.20272, 0.9999, 0.24916, 0.99017, 0.34206],
1725
+ [0.99017, 0.34206, 0.97708, 0.46706, 0.96398, 0.59206, 0.95089, 0.71706],
1726
+ [0.95089, 0.71706, 0.94285, 0.79387, 0.93883, 0.83228, 0.92405, 0.86256],
1727
+ [0.92405, 0.86256, 0.90268, 0.90641, 0.86538, 0.94028, 0.81991, 0.95712],
1728
+ [0.81991, 0.95712, 0.78849, 0.96875, 0.75021, 0.96875, 0.67365, 0.96875],
1729
+ [0.67365, 0.96875, 0.54479, 0.96875, 0.41593, 0.96875, 0.28707, 0.96875],
1730
+ [0.28707, 0.96875, 0.19449, 0.96875, 0.14819, 0.96875, 0.11285, 0.95359],
1731
+ [0.11285, 0.95359, 0.06169, 0.93162, 0.02275, 0.88797, 648e-5, 0.83431],
1732
+ [648e-5, 0.83431, -476e-5, 0.79728, 1e-4, 0.75084, 983e-5, 0.65794],
1733
+ [983e-5, 0.65794, 0.02292, 0.53294, 0.03602, 0.40794, 0.04911, 0.28294]
1734
+ ]);
1735
+ var softBoomShape = createShape([
1736
+ [0.54668, 0.26546, 0.61712, -0.08849, 0.38296, -0.08849, 0.45337, 0.26546],
1737
+ [0.45337, 0.26546, 0.38296, -0.08849, 0.16664, 11e-4, 0.36715, 0.30118],
1738
+ [0.36715, 0.30118, 0.16664, 11e-4, 11e-4, 0.16665, 0.30118, 0.36715],
1739
+ [0.30118, 0.36715, 11e-4, 0.16665, -0.08849, 0.38296, 0.26546, 0.45334],
1740
+ [0.26546, 0.45334, -0.08849, 0.38293, -0.08849, 0.61706, 0.26546, 0.54665],
1741
+ [0.26546, 0.54665, -0.08849, 0.61706, 114e-5, 0.83334, 0.30118, 0.63284],
1742
+ [0.30118, 0.63284, 114e-5, 0.83334, 0.16668, 0.9989, 0.36715, 0.69881],
1743
+ [0.36715, 0.69881, 0.16664, 0.99884, 0.38296, 1.08843, 0.45334, 0.73452],
1744
+ [0.45334, 0.73452, 0.38293, 1.08849, 0.61706, 1.08849, 0.54665, 0.73452],
1745
+ [0.54665, 0.73452, 0.61706, 1.08849, 0.83334, 0.99884, 0.63284, 0.69881],
1746
+ [0.63284, 0.69881, 0.83334, 0.99884, 0.9989, 0.83331, 0.69881, 0.63284],
1747
+ [0.69881, 0.63284, 0.99884, 0.83334, 1.08843, 0.61702, 0.73452, 0.54665],
1748
+ [0.73452, 0.54665, 1.08849, 0.61706, 1.08849, 0.38293, 0.73452, 0.45334],
1749
+ [0.73452, 0.45334, 1.08849, 0.38293, 0.99884, 0.16665, 0.69881, 0.36715],
1750
+ [0.69881, 0.36715, 0.99884, 0.16665, 0.83331, 11e-4, 0.63284, 0.30118],
1751
+ [0.63284, 0.30118, 0.83334, 114e-5, 0.61702, -0.08845, 0.54665, 0.26546],
1752
+ [0.54665, 0.26546, 0.54666, 0.26546, 0.54667, 0.26546, 0.54668, 0.26546]
1753
+ ]);
1754
+ var softBurstShape = createShape([
1755
+ [0.45359, 0.0247, 0.47494, -823e-5, 0.52506, -823e-5, 0.54641, 0.0247],
1756
+ [0.54641, 0.0247, 0.56348, 0.05101, 0.58055, 0.07733, 0.59763, 0.10364],
1757
+ [0.59763, 0.10364, 0.61166, 0.12529, 0.64, 0.1341, 0.66466, 0.12447],
1758
+ [0.66466, 0.12447, 0.69464, 0.11278, 0.72462, 0.10108, 0.7546, 0.08939],
1759
+ [0.7546, 0.08939, 0.79213, 0.07475, 0.83266, 0.10291, 0.82972, 0.14156],
1760
+ [0.82972, 0.14156, 0.82736, 0.17245, 0.82499, 0.20334, 0.82263, 0.23422],
1761
+ [0.82263, 0.23422, 0.82066, 0.25963, 0.83816, 0.28266, 0.86403, 0.28875],
1762
+ [0.86403, 0.28875, 0.89548, 0.29614, 0.92693, 0.30352, 0.95838, 0.31091],
1763
+ [0.95838, 0.31091, 0.99772, 0.32016, 1.01322, 0.36572, 0.98707, 0.39535],
1764
+ [0.98707, 0.39535, 0.96617, 0.41899, 0.94527, 0.44264, 0.92438, 0.46629],
1765
+ [0.92438, 0.46629, 0.90719, 0.48575, 0.90719, 0.51425, 0.92438, 0.53372],
1766
+ [0.92438, 0.53372, 0.94527, 0.55737, 0.96617, 0.58102, 0.98707, 0.60466],
1767
+ [0.98707, 0.60466, 1.01322, 0.63429, 0.99772, 0.67985, 0.95838, 0.6891],
1768
+ [0.95838, 0.6891, 0.92693, 0.69648, 0.89548, 0.70387, 0.86403, 0.71126],
1769
+ [0.86403, 0.71126, 0.83816, 0.71735, 0.82066, 0.74038, 0.82263, 0.76579],
1770
+ [0.82263, 0.76579, 0.82499, 0.79667, 0.82736, 0.82756, 0.82972, 0.85844],
1771
+ [0.82972, 0.85844, 0.83266, 0.8971, 0.79213, 0.92526, 0.7546, 0.91063],
1772
+ [0.7546, 0.91063, 0.72462, 0.89893, 0.69464, 0.88724, 0.66466, 0.87554],
1773
+ [0.66466, 0.87554, 0.64, 0.86591, 0.61166, 0.87473, 0.59763, 0.89638],
1774
+ [0.59763, 0.89638, 0.58055, 0.92269, 0.56348, 0.94901, 0.54641, 0.97532],
1775
+ [0.54641, 0.97532, 0.52506, 1.00823, 0.47494, 1.00823, 0.45359, 0.97532],
1776
+ [0.45359, 0.97532, 0.43652, 0.94901, 0.41945, 0.92269, 0.40237, 0.89638],
1777
+ [0.40237, 0.89638, 0.38834, 0.87473, 0.36, 0.86591, 0.33534, 0.87554],
1778
+ [0.33534, 0.87554, 0.30536, 0.88724, 0.27538, 0.89893, 0.2454, 0.91063],
1779
+ [0.2454, 0.91063, 0.20787, 0.92526, 0.16734, 0.8971, 0.17028, 0.85844],
1780
+ [0.17028, 0.85844, 0.17264, 0.82756, 0.17501, 0.79667, 0.17737, 0.76579],
1781
+ [0.17737, 0.76579, 0.17934, 0.74038, 0.16184, 0.71735, 0.13597, 0.71126],
1782
+ [0.13597, 0.71126, 0.10452, 0.70387, 0.07307, 0.69648, 0.04162, 0.6891],
1783
+ [0.04162, 0.6891, 228e-5, 0.67985, -0.01322, 0.63429, 0.01293, 0.60466],
1784
+ [0.01293, 0.60466, 0.03383, 0.58102, 0.05473, 0.55737, 0.07562, 0.53372],
1785
+ [0.07562, 0.53372, 0.09281, 0.51425, 0.09281, 0.48575, 0.07562, 0.46629],
1786
+ [0.07562, 0.46629, 0.05473, 0.44264, 0.03383, 0.41899, 0.01293, 0.39535],
1787
+ [0.01293, 0.39535, -0.01322, 0.36572, 228e-5, 0.32016, 0.04162, 0.31091],
1788
+ [0.04162, 0.31091, 0.07307, 0.30352, 0.10452, 0.29614, 0.13597, 0.28875],
1789
+ [0.13597, 0.28875, 0.16184, 0.28266, 0.17934, 0.25963, 0.17737, 0.23422],
1790
+ [0.17737, 0.23422, 0.17501, 0.20334, 0.17264, 0.17245, 0.17028, 0.14156],
1791
+ [0.17028, 0.14156, 0.16734, 0.10291, 0.20787, 0.07475, 0.2454, 0.08939],
1792
+ [0.2454, 0.08939, 0.27538, 0.10108, 0.30536, 0.11278, 0.33534, 0.12447],
1793
+ [0.33534, 0.12447, 0.36, 0.1341, 0.38834, 0.12529, 0.40237, 0.10364],
1794
+ [0.40237, 0.10364, 0.41945, 0.07733, 0.43652, 0.05101, 0.45359, 0.0247]
1795
+ ]);
1796
+ var squareShape = createShape([
1797
+ [1, 0.5375, 1, 0.67725, 1, 0.74712, 0.97806, 0.80253],
1798
+ [0.97806, 0.80253, 0.94628, 0.88278, 0.88278, 0.94628, 0.80253, 0.97806],
1799
+ [0.80253, 0.97806, 0.74713, 1, 0.67725, 1, 0.5375, 1],
1800
+ [0.5375, 1, 0.5125, 1, 0.4875, 1, 0.4625, 1],
1801
+ [0.4625, 1, 0.32275, 1, 0.25288, 1, 0.19747, 0.97806],
1802
+ [0.19747, 0.97806, 0.11722, 0.94628, 0.05372, 0.88278, 0.02194, 0.80253],
1803
+ [0.02194, 0.80253, 0, 0.74713, 0, 0.67725, 0, 0.5375],
1804
+ [0, 0.5375, 0, 0.5125, 0, 0.4875, 0, 0.4625],
1805
+ [0, 0.4625, 0, 0.32275, 0, 0.25288, 0.02194, 0.19747],
1806
+ [0.02194, 0.19747, 0.0537, 0.11723, 0.11723, 0.05371, 0.19747, 0.02194],
1807
+ [0.19747, 0.02194, 0.25288, 0, 0.32275, 0, 0.4625, 0],
1808
+ [0.4625, 0, 0.4875, 0, 0.5125, 0, 0.5375, 0],
1809
+ [0.5375, 0, 0.67725, 0, 0.74712, 0, 0.80253, 0.02194],
1810
+ [0.80253, 0.02194, 0.88277, 0.05371, 0.9463, 0.11723, 0.97806, 0.19747],
1811
+ [0.97806, 0.19747, 1, 0.25288, 1, 0.32275, 1, 0.4625],
1812
+ [1, 0.4625, 1, 0.4875, 1, 0.5125, 1, 0.5375]
1813
+ ]);
1814
+ var sunnyShape = createShape([
1815
+ [0.77016, 0.1213, 0.80126, 0.12342, 0.81681, 0.12448, 0.82938, 0.12995],
1816
+ [0.82938, 0.12995, 0.84756, 0.13791, 0.86208, 0.15244, 0.87004, 0.17062],
1817
+ [0.87004, 0.17062, 0.87554, 0.18318, 0.8766, 0.19874, 0.87871, 0.22983],
1818
+ [0.87871, 0.22983, 0.88031, 0.25348, 0.88192, 0.27714, 0.88353, 0.3008],
1819
+ [0.88353, 0.3008, 0.88439, 0.31338, 0.88481, 0.31968, 0.88618, 0.32568],
1820
+ [0.88618, 0.32568, 0.88816, 0.33436, 0.89159, 0.34264, 0.89633, 0.35018],
1821
+ [0.89633, 0.35018, 0.89961, 0.35541, 0.90376, 0.36015, 0.91204, 0.36965],
1822
+ [0.91204, 0.36965, 0.92764, 0.38751, 0.94323, 0.40537, 0.95882, 0.42324],
1823
+ [0.95882, 0.42324, 0.97932, 0.44674, 0.98957, 0.45847, 0.99457, 0.47124],
1824
+ [0.99457, 0.47124, 1.0018, 0.48973, 1.0018, 0.51027, 0.99457, 0.52876],
1825
+ [0.99457, 0.52876, 0.98957, 0.54153, 0.97932, 0.55326, 0.95882, 0.57676],
1826
+ [0.95882, 0.57676, 0.94323, 0.59463, 0.92764, 0.61249, 0.91204, 0.63035],
1827
+ [0.91204, 0.63035, 0.90376, 0.63985, 0.89961, 0.64459, 0.89633, 0.64982],
1828
+ [0.89633, 0.64982, 0.89159, 0.65736, 0.88816, 0.66564, 0.88618, 0.67432],
1829
+ [0.88618, 0.67432, 0.88481, 0.68032, 0.88439, 0.68662, 0.88353, 0.6992],
1830
+ [0.88353, 0.6992, 0.88192, 0.72286, 0.88031, 0.74652, 0.87871, 0.77017],
1831
+ [0.87871, 0.77017, 0.8766, 0.80126, 0.87554, 0.81682, 0.87004, 0.82938],
1832
+ [0.87004, 0.82938, 0.86208, 0.84756, 0.84756, 0.86209, 0.82938, 0.87005],
1833
+ [0.82938, 0.87005, 0.81681, 0.87552, 0.80126, 0.87658, 0.77016, 0.8787],
1834
+ [0.77016, 0.8787, 0.7465, 0.88031, 0.72285, 0.88192, 0.69919, 0.88352],
1835
+ [0.69919, 0.88352, 0.68661, 0.88438, 0.68032, 0.88482, 0.67431, 0.88617],
1836
+ [0.67431, 0.88617, 0.66563, 0.88815, 0.65735, 0.89158, 0.64981, 0.89632],
1837
+ [0.64981, 0.89632, 0.6446, 0.89961, 0.63985, 0.90376, 0.63035, 0.91205],
1838
+ [0.63035, 0.91205, 0.61248, 0.92764, 0.59462, 0.94323, 0.57675, 0.95882],
1839
+ [0.57675, 0.95882, 0.55327, 0.97932, 0.54153, 0.98955, 0.52875, 0.99455],
1840
+ [0.52875, 0.99455, 0.51027, 1.00182, 0.48973, 1.00182, 0.47125, 0.99455],
1841
+ [0.47125, 0.99455, 0.45847, 0.98955, 0.44673, 0.97932, 0.42325, 0.95882],
1842
+ [0.42325, 0.95882, 0.40538, 0.94323, 0.38752, 0.92764, 0.36965, 0.91205],
1843
+ [0.36965, 0.91205, 0.36015, 0.90376, 0.3554, 0.89961, 0.35019, 0.89632],
1844
+ [0.35019, 0.89632, 0.34265, 0.89158, 0.33437, 0.88815, 0.32569, 0.88617],
1845
+ [0.32569, 0.88617, 0.31968, 0.88482, 0.31339, 0.88438, 0.30081, 0.88352],
1846
+ [0.30081, 0.88352, 0.27715, 0.88192, 0.2535, 0.88031, 0.22984, 0.8787],
1847
+ [0.22984, 0.8787, 0.19874, 0.87658, 0.18319, 0.87552, 0.17062, 0.87005],
1848
+ [0.17062, 0.87005, 0.15244, 0.86209, 0.13792, 0.84756, 0.12996, 0.82938],
1849
+ [0.12996, 0.82938, 0.12446, 0.81682, 0.1234, 0.80126, 0.12129, 0.77017],
1850
+ [0.12129, 0.77017, 0.11968, 0.74652, 0.11807, 0.72286, 0.11647, 0.6992],
1851
+ [0.11647, 0.6992, 0.11561, 0.68662, 0.11519, 0.68032, 0.11382, 0.67432],
1852
+ [0.11382, 0.67432, 0.11185, 0.66564, 0.10841, 0.65736, 0.10367, 0.64982],
1853
+ [0.10367, 0.64982, 0.10039, 0.64459, 0.09624, 0.63985, 0.08796, 0.63035],
1854
+ [0.08796, 0.63035, 0.07236, 0.61249, 0.05677, 0.59463, 0.04118, 0.57676],
1855
+ [0.04118, 0.57676, 0.02068, 0.55326, 0.01043, 0.54153, 543e-5, 0.52876],
1856
+ [543e-5, 0.52876, -18e-4, 0.51027, -18e-4, 0.48973, 543e-5, 0.47124],
1857
+ [543e-5, 0.47124, 0.01043, 0.45847, 0.02068, 0.44674, 0.04118, 0.42324],
1858
+ [0.04118, 0.42324, 0.05677, 0.40537, 0.07236, 0.38751, 0.08796, 0.36965],
1859
+ [0.08796, 0.36965, 0.09624, 0.36015, 0.10039, 0.35541, 0.10367, 0.35018],
1860
+ [0.10367, 0.35018, 0.10841, 0.34264, 0.11184, 0.33436, 0.11382, 0.32568],
1861
+ [0.11382, 0.32568, 0.11519, 0.31968, 0.11561, 0.31338, 0.11647, 0.3008],
1862
+ [0.11647, 0.3008, 0.11808, 0.27714, 0.11969, 0.25348, 0.12129, 0.22983],
1863
+ [0.12129, 0.22983, 0.1234, 0.19874, 0.12446, 0.18318, 0.12996, 0.17062],
1864
+ [0.12996, 0.17062, 0.13792, 0.15244, 0.15244, 0.13791, 0.17062, 0.12995],
1865
+ [0.17062, 0.12995, 0.18319, 0.12448, 0.19874, 0.12342, 0.22984, 0.1213],
1866
+ [0.22984, 0.1213, 0.2535, 0.11969, 0.27716, 0.11808, 0.30081, 0.11648],
1867
+ [0.30081, 0.11648, 0.31339, 0.11562, 0.31968, 0.11518, 0.32569, 0.11383],
1868
+ [0.32569, 0.11383, 0.33437, 0.11185, 0.34266, 0.10842, 0.35019, 0.10368],
1869
+ [0.35019, 0.10368, 0.3554, 0.10039, 0.36015, 0.09624, 0.36965, 0.08795],
1870
+ [0.36965, 0.08795, 0.38752, 0.07236, 0.40538, 0.05677, 0.42325, 0.04118],
1871
+ [0.42325, 0.04118, 0.44673, 0.02068, 0.45847, 0.01045, 0.47125, 545e-5],
1872
+ [0.47125, 545e-5, 0.48973, -182e-5, 0.51027, -182e-5, 0.52875, 545e-5],
1873
+ [0.52875, 545e-5, 0.54153, 0.01045, 0.55327, 0.02068, 0.57675, 0.04118],
1874
+ [0.57675, 0.04118, 0.59462, 0.05677, 0.61248, 0.07236, 0.63035, 0.08795],
1875
+ [0.63035, 0.08795, 0.63985, 0.09624, 0.6446, 0.10039, 0.64981, 0.10368],
1876
+ [0.64981, 0.10368, 0.65735, 0.10842, 0.66563, 0.11185, 0.67431, 0.11383],
1877
+ [0.67431, 0.11383, 0.68032, 0.11518, 0.68661, 0.11562, 0.69919, 0.11648],
1878
+ [0.69919, 0.11648, 0.72285, 0.11808, 0.7465, 0.11969, 0.77016, 0.1213]
1879
+ ]);
1880
+ var triangleShape = createShape([
1881
+ [0.33058, 0.2095, 0.37847, 0.12601, 0.40242, 0.08427, 0.43146, 0.06665],
1882
+ [0.43146, 0.06665, 0.47358, 0.04108, 0.52643, 0.04108, 0.56854, 0.06665],
1883
+ [0.56854, 0.06665, 0.59758, 0.08427, 0.62153, 0.12601, 0.66943, 0.2095],
1884
+ [0.66943, 0.2095, 0.75568, 0.35983, 0.84194, 0.51017, 0.92819, 0.66051],
1885
+ [0.92819, 0.66051, 0.97563, 0.7432, 0.99935, 0.78452, 0.99998, 0.81829],
1886
+ [0.99998, 0.81829, 1.00088, 0.86728, 0.97451, 0.91273, 0.93153, 0.93626],
1887
+ [0.93153, 0.93626, 0.90188, 0.95253, 0.85417, 0.95253, 0.75877, 0.95253],
1888
+ [0.75877, 0.95253, 0.58626, 0.95253, 0.41375, 0.95253, 0.24124, 0.95253],
1889
+ [0.24124, 0.95253, 0.14583, 0.95253, 0.09812, 0.95253, 0.06847, 0.93626],
1890
+ [0.06847, 0.93626, 0.02548, 0.91274, -89e-5, 0.86729, 2e-5, 0.81829],
1891
+ [2e-5, 0.81829, 65e-5, 0.78452, 0.02437, 0.7432, 0.07181, 0.66051],
1892
+ [0.07181, 0.66051, 0.15807, 0.51017, 0.24432, 0.35983, 0.33058, 0.2095]
1893
+ ]);
1894
+ var verySunnyShape = createShape([
1895
+ [0.42725, 0.04123, 0.46018, -0.01374, 0.53981, -0.01374, 0.57275, 0.04123],
1896
+ [0.57275, 0.04123, 0.58508, 0.06182, 0.59741, 0.08241, 0.60974, 0.10301],
1897
+ [0.60974, 0.10301, 0.62896, 0.13504, 0.66687, 0.15076, 0.70309, 0.14166],
1898
+ [0.70309, 0.14166, 0.72638, 0.13583, 0.74967, 0.13, 0.77296, 0.12416],
1899
+ [0.77296, 0.12416, 0.83512, 0.1086, 0.8914, 0.16488, 0.87583, 0.22704],
1900
+ [0.87583, 0.22704, 0.87, 0.25033, 0.86417, 0.27362, 0.85833, 0.29691],
1901
+ [0.85833, 0.29691, 0.84924, 0.33313, 0.86496, 0.37103, 0.89699, 0.39025],
1902
+ [0.89699, 0.39025, 0.91758, 0.40258, 0.93818, 0.41492, 0.95877, 0.42725],
1903
+ [0.95877, 0.42725, 1.01374, 0.46019, 1.01374, 0.53981, 0.95877, 0.57275],
1904
+ [0.95877, 0.57275, 0.93818, 0.58508, 0.91758, 0.59742, 0.89699, 0.60975],
1905
+ [0.89699, 0.60975, 0.86496, 0.62897, 0.84924, 0.66687, 0.85833, 0.70309],
1906
+ [0.85833, 0.70309, 0.86417, 0.72638, 0.87, 0.74967, 0.87583, 0.77296],
1907
+ [0.87583, 0.77296, 0.8914, 0.83512, 0.83512, 0.8914, 0.77296, 0.87584],
1908
+ [0.77296, 0.87584, 0.74967, 0.87, 0.72638, 0.86417, 0.70309, 0.85834],
1909
+ [0.70309, 0.85834, 0.66687, 0.84924, 0.62896, 0.86496, 0.60974, 0.89699],
1910
+ [0.60974, 0.89699, 0.59741, 0.91759, 0.58508, 0.93818, 0.57275, 0.95877],
1911
+ [0.57275, 0.95877, 0.53981, 1.01374, 0.46018, 1.01374, 0.42725, 0.95877],
1912
+ [0.42725, 0.95877, 0.41491, 0.93818, 0.40258, 0.91759, 0.39025, 0.89699],
1913
+ [0.39025, 0.89699, 0.37103, 0.86496, 0.33312, 0.84924, 0.29691, 0.85834],
1914
+ [0.29691, 0.85834, 0.27361, 0.86417, 0.25031, 0.87, 0.22702, 0.87584],
1915
+ [0.22702, 0.87584, 0.16489, 0.8914, 0.10859, 0.83512, 0.12416, 0.77296],
1916
+ [0.12416, 0.77296, 0.12999, 0.74967, 0.13583, 0.72638, 0.14167, 0.70309],
1917
+ [0.14167, 0.70309, 0.15075, 0.66687, 0.13505, 0.62897, 0.103, 0.60975],
1918
+ [0.103, 0.60975, 0.08241, 0.59742, 0.06181, 0.58508, 0.04121, 0.57275],
1919
+ [0.04121, 0.57275, -0.01373, 0.53981, -0.01373, 0.46019, 0.04121, 0.42725],
1920
+ [0.04121, 0.42725, 0.06181, 0.41492, 0.08241, 0.40258, 0.103, 0.39025],
1921
+ [0.103, 0.39025, 0.13505, 0.37103, 0.15075, 0.33313, 0.14167, 0.29691],
1922
+ [0.14167, 0.29691, 0.13583, 0.27362, 0.12999, 0.25033, 0.12416, 0.22704],
1923
+ [0.12416, 0.22704, 0.10859, 0.16488, 0.16489, 0.1086, 0.22702, 0.12416],
1924
+ [0.22702, 0.12416, 0.25031, 0.13, 0.27361, 0.13583, 0.29691, 0.14166],
1925
+ [0.29691, 0.14166, 0.33312, 0.15076, 0.37103, 0.13504, 0.39025, 0.10301],
1926
+ [0.39025, 0.10301, 0.40258, 0.08241, 0.41491, 0.06182, 0.42725, 0.04123]
1927
+ ]);
1928
+ function reversePolygon(polygon) {
1929
+ const reversedFeatures = polygon.features.map((f) => {
1930
+ const reversedCubics = f.cubics.map((c) => c.reverse()).reverse();
1931
+ if (f.type === "corner") {
1932
+ return cornerFeature(reversedCubics, f.convex);
1933
+ } else {
1934
+ return edgeFeature(reversedCubics);
1935
+ }
1936
+ }).reverse();
1937
+ return RoundedPolygon.fromFeatures(
1938
+ reversedFeatures,
1939
+ polygon.centerX,
1940
+ polygon.centerY
1941
+ );
1942
+ }
1943
+ function rotate180(polygon) {
1944
+ return polygon.transformed((x, y) => [1 - x, 1 - y]);
1945
+ }
1946
+ function flipV(polygon) {
1947
+ const flipped = polygon.transformed((x, y) => [x, 1 - y]);
1948
+ return reversePolygon(flipped);
1949
+ }
1950
+ var MD3Shapes = {
1951
+ arch: flipV(archShape),
1952
+ arrow: flipV(arrowShape),
1953
+ boom: boomShape,
1954
+ bun: bunShape,
1955
+ burst: burstShape,
1956
+ circle: circleShape,
1957
+ clamshell: clamshellShape,
1958
+ diamond: diamondShape,
1959
+ fan: rotate180(fanShape),
1960
+ flower: flowerShape,
1961
+ gem: flipV(gemShape),
1962
+ ghostish: flipV(ghostishShape),
1963
+ heart: flipV(heartShape),
1964
+ clover4Leaf: clover4LeafShape,
1965
+ clover8Leaf: clover8LeafShape,
1966
+ oval: flipV(ovalShape),
1967
+ pentagon: flipV(pentagonShape),
1968
+ pill: flipV(pillShape),
1969
+ pixelCircle: pixelCircleShape,
1970
+ pixelTriangle: pixelTriangleShape,
1971
+ puffyDiamond: puffyDiamondShape,
1972
+ puffy: puffyShape,
1973
+ semiCircle: flipV(semiCircleShape),
1974
+ cookie12Sided: cookie12SidedShape,
1975
+ cookie4Sided: cookie4SidedShape,
1976
+ cookie6Sided: cookie6SidedShape,
1977
+ cookie7Sided: cookie7SidedShape,
1978
+ cookie9Sided: cookie9SidedShape,
1979
+ slanted: flipV(slantedShape),
1980
+ softBoom: softBoomShape,
1981
+ softBurst: softBurstShape,
1982
+ square: squareShape,
1983
+ sunny: sunnyShape,
1984
+ triangle: flipV(triangleShape),
1985
+ verySunny: verySunnyShape
1986
+ };
1987
+ function resolveShape(ref) {
1988
+ if (ref instanceof RoundedPolygon) return ref;
1989
+ const shape = MD3Shapes[ref];
1990
+ if (!shape) throw new Error(`Unknown shape: "${ref}"`);
1991
+ return shape;
1992
+ }
1993
+
1994
+ // src/shapes/catalog/shape-tokens.ts
1995
+ var MD3CornerRadius = {
1996
+ /** 0dp — Sharp corners */
1997
+ none: 0,
1998
+ /** 4dp */
1999
+ extraSmall: 4,
2000
+ /** 8dp */
2001
+ small: 8,
2002
+ /** 12dp */
2003
+ medium: 12,
2004
+ /** 16dp */
2005
+ large: 16,
2006
+ /** 20dp (new in M3 Expressive) */
2007
+ largeIncreased: 20,
2008
+ /** 28dp */
2009
+ extraLarge: 28,
2010
+ /** 32dp (new in M3 Expressive) */
2011
+ extraLargeIncreased: 32,
2012
+ /** 48dp (new in M3 Expressive) */
2013
+ extraExtraLarge: 48,
2014
+ /** 9999dp — Fully rounded (pill/circle) */
2015
+ full: 9999
2016
+ };
2017
+
2018
+ // src/shapes/catalog/shapes.ts
2019
+ function circle(numVertices = 8, radius = 1, centerX = 0, centerY = 0) {
2020
+ if (numVertices < 3) throw new Error("Circle must have at least 3 vertices");
2021
+ const theta = FLOAT_PI / numVertices;
2022
+ const polygonRadius = radius / Math.cos(theta);
2023
+ return RoundedPolygon.fromNumVertices(
2024
+ numVertices,
2025
+ polygonRadius,
2026
+ centerX,
2027
+ centerY,
2028
+ cornerRounding(radius)
2029
+ );
2030
+ }
2031
+ function rectangle(width = 2, height = 2, rounding = UNROUNDED, perVertexRounding, centerX = 0, centerY = 0) {
2032
+ const left = centerX - width / 2;
2033
+ const top = centerY - height / 2;
2034
+ const right = centerX + width / 2;
2035
+ const bottom = centerY + height / 2;
2036
+ return RoundedPolygon.fromVertices(
2037
+ [right, bottom, left, bottom, left, top, right, top],
2038
+ rounding,
2039
+ perVertexRounding,
2040
+ centerX,
2041
+ centerY
2042
+ );
2043
+ }
2044
+ function star(numVerticesPerRadius, radius = 1, innerRadius = 0.5, rounding = UNROUNDED, innerRounding, perVertexRounding, centerX = 0, centerY = 0) {
2045
+ if (radius <= 0 || innerRadius <= 0)
2046
+ throw new Error("Star radii must be greater than 0");
2047
+ if (innerRadius >= radius)
2048
+ throw new Error("innerRadius must be less than radius");
2049
+ let pvRounding = perVertexRounding;
2050
+ if (!pvRounding && innerRounding) {
2051
+ const resolvedInnerRounding = innerRounding;
2052
+ pvRounding = Array.from(
2053
+ { length: numVerticesPerRadius },
2054
+ (_, i) => i % 2 === 0 ? rounding : resolvedInnerRounding
2055
+ );
2056
+ pvRounding = [];
2057
+ for (let i = 0; i < numVerticesPerRadius; i++) {
2058
+ pvRounding.push(rounding, resolvedInnerRounding);
2059
+ }
2060
+ }
2061
+ const vertices = starVertices(
2062
+ numVerticesPerRadius,
2063
+ radius,
2064
+ innerRadius,
2065
+ centerX,
2066
+ centerY
2067
+ );
2068
+ return RoundedPolygon.fromVertices(
2069
+ vertices,
2070
+ rounding,
2071
+ pvRounding,
2072
+ centerX,
2073
+ centerY
2074
+ );
2075
+ }
2076
+ function pill(width = 2, height = 1, smoothing = 0, centerX = 0, centerY = 0) {
2077
+ if (width <= 0 || height <= 0)
2078
+ throw new Error("Pill must have positive width and height");
2079
+ const wHalf = width / 2;
2080
+ const hHalf = height / 2;
2081
+ const r = Math.min(wHalf, hHalf);
2082
+ return RoundedPolygon.fromVertices(
2083
+ [
2084
+ wHalf + centerX,
2085
+ hHalf + centerY,
2086
+ -wHalf + centerX,
2087
+ hHalf + centerY,
2088
+ -wHalf + centerX,
2089
+ -hHalf + centerY,
2090
+ wHalf + centerX,
2091
+ -hHalf + centerY
2092
+ ],
2093
+ cornerRounding(r, smoothing),
2094
+ void 0,
2095
+ centerX,
2096
+ centerY
2097
+ );
2098
+ }
2099
+ function pillStar(width = 2, height = 1, numVerticesPerRadius = 8, innerRadiusRatio = 0.5, rounding = UNROUNDED, innerRounding, perVertexRounding, vertexSpacing = 0.5, centerX = 0, centerY = 0) {
2100
+ if (innerRadiusRatio <= 0 || innerRadiusRatio >= 1) {
2101
+ throw new Error("innerRadiusRatio must be between 0 and 1 (exclusive)");
2102
+ }
2103
+ const vertices = pillStarVertices(
2104
+ width,
2105
+ height,
2106
+ numVerticesPerRadius,
2107
+ innerRadiusRatio,
2108
+ vertexSpacing,
2109
+ centerX,
2110
+ centerY
2111
+ );
2112
+ let pvRounding = perVertexRounding;
2113
+ if (!pvRounding && innerRounding) {
2114
+ const resolvedInnerRounding = innerRounding;
2115
+ pvRounding = [];
2116
+ for (let i = 0; i < numVerticesPerRadius * 2; i++) {
2117
+ pvRounding.push(i % 2 === 0 ? rounding : resolvedInnerRounding);
2118
+ }
2119
+ }
2120
+ return RoundedPolygon.fromVertices(
2121
+ vertices,
2122
+ rounding,
2123
+ pvRounding,
2124
+ centerX,
2125
+ centerY
2126
+ );
2127
+ }
2128
+ function starVertices(numVerticesPerRadius, radius, innerRadius, cx, cy) {
2129
+ const result = [];
2130
+ const total = numVerticesPerRadius * 2;
2131
+ for (let i = 0; i < total; i++) {
2132
+ const r = i % 2 === 0 ? radius : innerRadius;
2133
+ const angle = FLOAT_PI / numVerticesPerRadius * i;
2134
+ const [rx, ry] = radialToCartesian(r, angle);
2135
+ result.push(cx + rx, cy + ry);
2136
+ }
2137
+ return result;
2138
+ }
2139
+ function pillStarVertices(width, height, numVerticesPerRadius, innerRadiusRatio, vertexSpacing, cx, cy) {
2140
+ const wHalf = width / 2;
2141
+ const hHalf = height / 2;
2142
+ const r = Math.min(wHalf, hHalf);
2143
+ const result = [];
2144
+ const total = numVerticesPerRadius * 2;
2145
+ for (let i = 0; i < total; i++) {
2146
+ const angle = FLOAT_PI / numVerticesPerRadius * i;
2147
+ const isOuter = i % 2 === 0;
2148
+ const cos = Math.cos(angle), sin = Math.sin(angle);
2149
+ const baseR = isOuter ? r : r * innerRadiusRatio;
2150
+ const rx = cos * wHalf;
2151
+ const ry = sin * hHalf;
2152
+ const pillR = distance(rx, ry);
2153
+ const finalR = baseR * vertexSpacing + pillR * (1 - vertexSpacing);
2154
+ result.push(cx + cos * finalR, cy + sin * finalR);
2155
+ }
2156
+ return result;
2157
+ }
2158
+
2159
+ // src/shapes/morph/float-mapping.ts
2160
+ function mapSegments(value, segments) {
2161
+ for (const seg of segments) {
2162
+ if (value <= seg.fromEnd) {
2163
+ if (seg.fromEnd === seg.fromStart) return seg.toStart;
2164
+ const t = (value - seg.fromStart) / (seg.fromEnd - seg.fromStart);
2165
+ return interpolate(seg.toStart, seg.toEnd, t);
2166
+ }
2167
+ }
2168
+ const last = segments[segments.length - 1];
2169
+ return last.toEnd;
2170
+ }
2171
+ function createDoubleMapper(fromValues, toValues) {
2172
+ if (fromValues.length !== toValues.length || fromValues.length === 0) {
2173
+ return { map: (v) => v, mapBack: (v) => v };
2174
+ }
2175
+ const n = fromValues.length;
2176
+ const forwardSegs = [];
2177
+ for (let i = 0; i < n; i++) {
2178
+ const next = (i + 1) % n;
2179
+ const fromStart = fromValues[i];
2180
+ let fromEnd = fromValues[next];
2181
+ const toStart = toValues[i];
2182
+ let toEnd = toValues[next];
2183
+ if (fromEnd < fromStart) fromEnd += 1;
2184
+ if (toEnd < toStart) toEnd += 1;
2185
+ forwardSegs.push({ fromStart, fromEnd, toStart, toEnd });
2186
+ }
2187
+ const reverseSegs = [];
2188
+ for (const seg of forwardSegs) {
2189
+ reverseSegs.push({
2190
+ fromStart: seg.toStart,
2191
+ fromEnd: seg.toEnd,
2192
+ toStart: seg.fromStart,
2193
+ toEnd: seg.fromEnd
2194
+ });
2195
+ }
2196
+ reverseSegs.sort((a, b) => a.fromStart - b.fromStart);
2197
+ return {
2198
+ map: (v) => positiveModulo(mapSegments(positiveModulo(v, 1), forwardSegs), 1),
2199
+ mapBack: (v) => positiveModulo(mapSegments(positiveModulo(v, 1), reverseSegs), 1)
2200
+ };
2201
+ }
2202
+
2203
+ // src/shapes/morph/feature-mapping.ts
2204
+ function featureMapper(features1, features2) {
2205
+ const convex1 = features1.filter((f) => f.convex);
2206
+ const convex2 = features2.filter((f) => f.convex);
2207
+ if (convex1.length === 0 || convex2.length === 0) {
2208
+ return createDoubleMapper([], []);
2209
+ }
2210
+ const fromValues = [];
2211
+ const toValues = [];
2212
+ for (const f1 of convex1) {
2213
+ let bestDist = Number.MAX_VALUE;
2214
+ let bestProgress = 0;
2215
+ for (const f2 of convex2) {
2216
+ const diff = Math.abs(f1.progress - f2.progress);
2217
+ const dist = Math.min(diff, 1 - diff);
2218
+ if (dist < bestDist) {
2219
+ bestDist = dist;
2220
+ bestProgress = f2.progress;
2221
+ }
2222
+ }
2223
+ fromValues.push(f1.progress);
2224
+ toValues.push(bestProgress);
2225
+ }
2226
+ return createDoubleMapper(fromValues, toValues);
2227
+ }
2228
+
2229
+ // src/shapes/morph/polygon-measure.ts
2230
+ var MeasuredPolygon = class _MeasuredPolygon {
2231
+ constructor(measuredCubics, features) {
2232
+ this.measuredCubics = measuredCubics;
2233
+ this.features = features;
2234
+ }
2235
+ get size() {
2236
+ return this.measuredCubics.length;
2237
+ }
2238
+ getOrNull(index) {
2239
+ return index >= 0 && index < this.measuredCubics.length ? this.measuredCubics[index] : null;
2240
+ }
2241
+ /**
2242
+ * Cuts the polygon at cutPoint and rotates so that cutPoint becomes progress=0.
2243
+ * Returns a new MeasuredPolygon with adjusted progress values.
2244
+ * @param cutPoint - Progress value [0, 1] at which to cut
2245
+ */
2246
+ cutAndShift(cutPoint) {
2247
+ if (cutPoint <= 0 || cutPoint >= 1) return this;
2248
+ const result = [];
2249
+ let cutCubicIdx = -1;
2250
+ for (let i = 0; i < this.measuredCubics.length; i++) {
2251
+ if (this.measuredCubics[i].endOutlineProgress >= cutPoint) {
2252
+ cutCubicIdx = i;
2253
+ break;
2254
+ }
2255
+ }
2256
+ if (cutCubicIdx === -1) cutCubicIdx = this.measuredCubics.length - 1;
2257
+ const cutCubic = this.measuredCubics[cutCubicIdx];
2258
+ const segLen = cutCubic.endOutlineProgress - cutCubic.startOutlineProgress;
2259
+ const t = segLen > 0 ? (cutPoint - cutCubic.startOutlineProgress) / segLen : 0;
2260
+ const [left, right] = cutCubic.cubic.split(t);
2261
+ const shift = (p) => {
2262
+ let s = p - cutPoint;
2263
+ if (s < 0) s += 1;
2264
+ return s;
2265
+ };
2266
+ if (!right.zeroLength()) {
2267
+ result.push({
2268
+ cubic: right,
2269
+ startOutlineProgress: 0,
2270
+ endOutlineProgress: shift(cutCubic.endOutlineProgress)
2271
+ });
2272
+ }
2273
+ for (let i = 1; i < this.measuredCubics.length; i++) {
2274
+ const idx = (cutCubicIdx + i) % this.measuredCubics.length;
2275
+ const mc = this.measuredCubics[idx];
2276
+ if (!mc.cubic.zeroLength()) {
2277
+ result.push({
2278
+ cubic: mc.cubic,
2279
+ startOutlineProgress: shift(mc.startOutlineProgress),
2280
+ endOutlineProgress: shift(mc.endOutlineProgress)
2281
+ });
2282
+ }
2283
+ }
2284
+ if (!left.zeroLength()) {
2285
+ result.push({
2286
+ cubic: left,
2287
+ startOutlineProgress: shift(cutCubic.startOutlineProgress),
2288
+ endOutlineProgress: 1
2289
+ });
2290
+ }
2291
+ return new _MeasuredPolygon(result, this.features);
2292
+ }
2293
+ /**
2294
+ * Cuts a MeasuredCubic at a given outline progress, returning [segment, rest].
2295
+ */
2296
+ cutAtProgress(measuredCubic, progress) {
2297
+ const segLen = measuredCubic.endOutlineProgress - measuredCubic.startOutlineProgress;
2298
+ const t = segLen > 0 ? (progress - measuredCubic.startOutlineProgress) / segLen : 0;
2299
+ const [left, right] = measuredCubic.cubic.split(
2300
+ Math.max(0, Math.min(1, t))
2301
+ );
2302
+ return [
2303
+ {
2304
+ cubic: left,
2305
+ startOutlineProgress: measuredCubic.startOutlineProgress,
2306
+ endOutlineProgress: progress
2307
+ },
2308
+ {
2309
+ cubic: right,
2310
+ startOutlineProgress: progress,
2311
+ endOutlineProgress: measuredCubic.endOutlineProgress
2312
+ }
2313
+ ];
2314
+ }
2315
+ /**
2316
+ * Measures a RoundedPolygon's outline by arc length.
2317
+ * Returns a MeasuredPolygon with normalized progress in [0, 1].
2318
+ */
2319
+ static measurePolygon(polygon) {
2320
+ const cubics = polygon.cubics;
2321
+ let totalLength = 0;
2322
+ const lengths = cubics.map((c) => {
2323
+ const len = approximateLength(c);
2324
+ totalLength += len;
2325
+ return len;
2326
+ });
2327
+ if (totalLength === 0) {
2328
+ return new _MeasuredPolygon(
2329
+ cubics.map((c) => ({
2330
+ cubic: c,
2331
+ startOutlineProgress: 0,
2332
+ endOutlineProgress: 0
2333
+ })),
2334
+ []
2335
+ );
2336
+ }
2337
+ const measured = [];
2338
+ let accumulated = 0;
2339
+ for (let i = 0; i < cubics.length; i++) {
2340
+ const startP = accumulated / totalLength;
2341
+ accumulated += lengths[i];
2342
+ const endP = accumulated / totalLength;
2343
+ measured.push({
2344
+ cubic: cubics[i],
2345
+ startOutlineProgress: startP,
2346
+ endOutlineProgress: endP
2347
+ });
2348
+ }
2349
+ const featureList = [];
2350
+ let cubicIdx = 0;
2351
+ for (const feature of polygon.features) {
2352
+ if (feature.type === "corner" && feature.cubics.length > 0) {
2353
+ const middleCubicIdx = feature.cubics.length > 1 ? 1 : 0;
2354
+ const mc = measured[Math.min(cubicIdx + middleCubicIdx, measured.length - 1)];
2355
+ if (mc) {
2356
+ const midProgress = (mc.startOutlineProgress + mc.endOutlineProgress) / 2;
2357
+ featureList.push({ progress: midProgress, convex: feature.convex });
2358
+ }
2359
+ }
2360
+ cubicIdx += feature.cubics.length;
2361
+ }
2362
+ return new _MeasuredPolygon(measured, featureList);
2363
+ }
2364
+ };
2365
+ function approximateLength(cubic) {
2366
+ let len = 0;
2367
+ let prevX = cubic.anchor0X, prevY = cubic.anchor0Y;
2368
+ const steps = 4;
2369
+ for (let i = 1; i <= steps; i++) {
2370
+ const p = cubic.pointOnCurve(i / steps);
2371
+ len += distance(p.x - prevX, p.y - prevY);
2372
+ prevX = p.x;
2373
+ prevY = p.y;
2374
+ }
2375
+ return len;
2376
+ }
2377
+
2378
+ // src/shapes/morph/morph.ts
2379
+ var Morph = class _Morph {
2380
+ /**
2381
+ * Creates a Morph between two shapes.
2382
+ * @param start - Starting shape
2383
+ * @param end - Ending shape
2384
+ */
2385
+ constructor(start, end) {
2386
+ this.start = start;
2387
+ this.end = end;
2388
+ this.morphMatch = _Morph.match(start, end);
2389
+ }
2390
+ /**
2391
+ * Returns the interpolated shape at the given progress as a list of Cubics.
2392
+ *
2393
+ * Note: This allocates a new list. For performance-critical animation loops,
2394
+ * use {@link forEachCubic} instead.
2395
+ *
2396
+ * @param progress - Value in [0, 1]. 0 = start shape, 1 = end shape.
2397
+ * Values outside [0, 1] produce exaggerated shapes (useful for bounce/overshoot).
2398
+ * @returns List of interpolated Cubic curves forming the morphed shape
2399
+ */
2400
+ asCubics(progress) {
2401
+ const result = [];
2402
+ for (const [c1, c2] of this.morphMatch) {
2403
+ result.push(
2404
+ new Cubic(
2405
+ c1.points.map((v, i) => interpolate(v, c2.points[i], progress))
2406
+ )
2407
+ );
2408
+ }
2409
+ return result;
2410
+ }
2411
+ /**
2412
+ * Iterates over the morphed cubics without allocating new Cubic instances.
2413
+ * Reuses a single MutableCubic for each callback invocation.
2414
+ *
2415
+ * @param progress - Value in [0, 1]
2416
+ * @param callback - Called for each interpolated cubic
2417
+ *
2418
+ * @example
2419
+ * const mutable = new MutableCubic();
2420
+ * morph.forEachCubic(progress, mutable, (c) => {
2421
+ * path.bezierCurveTo(c.control0X, c.control0Y, c.control1X, c.control1Y, c.anchor1X, c.anchor1Y);
2422
+ * });
2423
+ */
2424
+ forEachCubic(progress, mutableOrCallback, callback) {
2425
+ let mutable;
2426
+ let cb;
2427
+ if (typeof mutableOrCallback === "function") {
2428
+ mutable = new MutableCubic();
2429
+ cb = mutableOrCallback;
2430
+ } else {
2431
+ mutable = mutableOrCallback;
2432
+ if (!callback) {
2433
+ throw new Error(
2434
+ "Callback must be provided when passing a mutable cubic"
2435
+ );
2436
+ }
2437
+ cb = callback;
2438
+ }
2439
+ for (const [c1, c2] of this.morphMatch) {
2440
+ mutable.interpolate(c1, c2, progress);
2441
+ cb(mutable);
2442
+ }
2443
+ }
2444
+ /**
2445
+ * Calculates the axis-aligned bounding box of the morph (union of start + end bounds).
2446
+ * @param approximate - Use faster approximate bounds (default: true)
2447
+ */
2448
+ calculateBounds(approximate = true) {
2449
+ const [s0, s1, s2, s3] = this.start.calculateBounds(approximate);
2450
+ const [e0, e1, e2, e3] = this.end.calculateBounds(approximate);
2451
+ return [
2452
+ Math.min(s0, e0),
2453
+ Math.min(s1, e1),
2454
+ Math.max(s2, e2),
2455
+ Math.max(s3, e3)
2456
+ ];
2457
+ }
2458
+ /**
2459
+ * Calculates the max bounding square (union of start + end max bounds).
2460
+ */
2461
+ calculateMaxBounds() {
2462
+ const [s0, s1, s2, s3] = this.start.calculateMaxBounds();
2463
+ const [e0, e1, e2, e3] = this.end.calculateMaxBounds();
2464
+ return [
2465
+ Math.min(s0, e0),
2466
+ Math.min(s1, e1),
2467
+ Math.max(s2, e2),
2468
+ Math.max(s3, e3)
2469
+ ];
2470
+ }
2471
+ // ─── Internal: matching algorithm ──────────────────────────────────────
2472
+ /**
2473
+ * Matches cubic curves between two polygons.
2474
+ *
2475
+ * Algorithm:
2476
+ * 1. Measure both polygons (arc-length normalized progress)
2477
+ * 2. Use featureMapper to determine correspondence between features
2478
+ * 3. Cut and shift polygon2 so both start at the same logical point
2479
+ * 4. Walk both lists together, splitting curves when one extends past the other
2480
+ *
2481
+ * @internal
2482
+ */
2483
+ static match(p1, p2) {
2484
+ const measured1 = MeasuredPolygon.measurePolygon(p1);
2485
+ const measured2 = MeasuredPolygon.measurePolygon(p2);
2486
+ const doubleMapper = featureMapper(measured1.features, measured2.features);
2487
+ const polygon2CutPoint = doubleMapper.map(0);
2488
+ const bs1 = measured1;
2489
+ const bs2 = measured2.cutAndShift(polygon2CutPoint);
2490
+ const result = [];
2491
+ let i1 = 0, i2 = 0;
2492
+ let b1 = bs1.getOrNull(i1++);
2493
+ let b2 = bs2.getOrNull(i2++);
2494
+ while (b1 !== null && b2 !== null) {
2495
+ const b1a = i1 >= bs1.size ? 1 : b1.endOutlineProgress;
2496
+ const b2aRaw = i2 >= bs2.size ? 1 : positiveModulo(b2.endOutlineProgress + polygon2CutPoint, 1);
2497
+ const b2a = doubleMapper.mapBack(b2aRaw);
2498
+ const minb = Math.min(b1a, b2a);
2499
+ let seg1 = b1, newb1 = bs1.getOrNull(i1);
2500
+ let seg2 = b2, newb2 = bs2.getOrNull(i2);
2501
+ if (b1a > minb + ANGLE_EPSILON) {
2502
+ const [cut, rest] = bs1.cutAtProgress(b1, minb);
2503
+ seg1 = cut;
2504
+ newb1 = rest;
2505
+ } else {
2506
+ i1++;
2507
+ }
2508
+ if (b2a > minb + ANGLE_EPSILON) {
2509
+ const targetProgress = positiveModulo(
2510
+ doubleMapper.map(minb) - polygon2CutPoint,
2511
+ 1
2512
+ );
2513
+ const [cut, rest] = bs2.cutAtProgress(b2, targetProgress);
2514
+ seg2 = cut;
2515
+ newb2 = rest;
2516
+ } else {
2517
+ i2++;
2518
+ }
2519
+ result.push([seg1.cubic, seg2.cubic]);
2520
+ b1 = newb1;
2521
+ b2 = newb2;
2522
+ }
2523
+ return result;
2524
+ }
2525
+ };
2526
+
2527
+ // src/shapes/render/shape-rendering.ts
2528
+ function toSvgPath(cubics, width = 1, height = 1) {
2529
+ if (cubics.length === 0) return "";
2530
+ const paddingX = width * 0.015;
2531
+ const paddingY = height * 0.015;
2532
+ const sx = width - 2 * paddingX;
2533
+ const sy = height - 2 * paddingY;
2534
+ const flipY = (y) => paddingY + sy * (1 - y);
2535
+ const parts = [
2536
+ `M ${fmt(paddingX + cubics[0].anchor0X * sx)} ${fmt(flipY(cubics[0].anchor0Y))}`
2537
+ ];
2538
+ for (const c of cubics) {
2539
+ parts.push(
2540
+ `C ${fmt(paddingX + c.control0X * sx)} ${fmt(flipY(c.control0Y))},${fmt(paddingX + c.control1X * sx)} ${fmt(flipY(c.control1Y))},${fmt(paddingX + c.anchor1X * sx)} ${fmt(flipY(c.anchor1Y))}`
2541
+ );
2542
+ }
2543
+ parts.push("Z");
2544
+ return parts.join(" ");
2545
+ }
2546
+ function toClipPath(polygon, width, height) {
2547
+ const pathData = toSvgPath(polygon.cubics, width, height);
2548
+ return `path('${pathData}')`;
2549
+ }
2550
+ function interpolatePath(morph, progress, width, height) {
2551
+ const cubics = morph.asCubics(progress);
2552
+ return toClipPath({ cubics }, width, height);
2553
+ }
2554
+ function fmt(v) {
2555
+ return Number(v.toFixed(4)).toString();
2556
+ }
2557
+ function prefersReducedMotion() {
2558
+ if (typeof window === "undefined") return false;
2559
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2560
+ }
2561
+ function useShapeMorph({
2562
+ shape,
2563
+ morphTo,
2564
+ morphOn = "hover",
2565
+ morphOptions,
2566
+ scrollProgress,
2567
+ width,
2568
+ height,
2569
+ disabled = false
2570
+ }) {
2571
+ var _a, _b;
2572
+ const duration = (_a = morphOptions == null ? void 0 : morphOptions.duration) != null ? _a : 0.3;
2573
+ const easing = (_b = morphOptions == null ? void 0 : morphOptions.easing) != null ? _b : "ease-in-out";
2574
+ const easingFunction = useMemo(() => getEasingFunction(easing), [easing]);
2575
+ const startShape = useMemo(() => resolveShape(shape), [shape]);
2576
+ const endShape = useMemo(
2577
+ () => morphTo ? resolveShape(morphTo) : null,
2578
+ [morphTo]
2579
+ );
2580
+ const morph = useMemo(
2581
+ () => endShape ? new Morph(startShape, endShape) : null,
2582
+ [startShape, endShape]
2583
+ );
2584
+ const [isActive, setIsActive] = useState(false);
2585
+ const [clipPath, setClipPath] = useState(
2586
+ () => toClipPath(startShape, width, height)
2587
+ );
2588
+ const animRef = useRef(null);
2589
+ const startTimeRef = useRef(0);
2590
+ const startProgressRef = useRef(0);
2591
+ const targetProgressRef = useRef(0);
2592
+ const currentProgressRef = useRef(0);
2593
+ useEffect(() => {
2594
+ if (morph) {
2595
+ setClipPath(
2596
+ interpolatePath(morph, currentProgressRef.current, width, height)
2597
+ );
2598
+ } else {
2599
+ setClipPath(toClipPath(startShape, width, height));
2600
+ }
2601
+ }, [width, height, startShape, morph]);
2602
+ useEffect(() => {
2603
+ if (morphOn !== "scroll" || !morph || scrollProgress === void 0) return;
2604
+ const p = Math.max(0, Math.min(1, scrollProgress));
2605
+ currentProgressRef.current = p;
2606
+ setClipPath(interpolatePath(morph, p, width, height));
2607
+ }, [scrollProgress, morphOn, morph, width, height]);
2608
+ const animate = useCallback(
2609
+ (timestamp) => {
2610
+ if (!morph) return;
2611
+ const elapsed = timestamp - startTimeRef.current;
2612
+ const durationMs = duration * 1e3;
2613
+ const rawT = Math.min(elapsed / durationMs, 1);
2614
+ const ease = easingFunction(rawT);
2615
+ const progress = startProgressRef.current + (targetProgressRef.current - startProgressRef.current) * ease;
2616
+ currentProgressRef.current = progress;
2617
+ setClipPath(interpolatePath(morph, progress, width, height));
2618
+ if (rawT < 1) {
2619
+ animRef.current = requestAnimationFrame(animate);
2620
+ } else {
2621
+ animRef.current = null;
2622
+ }
2623
+ },
2624
+ [morph, duration, easingFunction, width, height]
2625
+ );
2626
+ const startAnimation = useCallback(
2627
+ (toProgress) => {
2628
+ if (!morph) return;
2629
+ if (prefersReducedMotion()) {
2630
+ currentProgressRef.current = toProgress;
2631
+ setClipPath(interpolatePath(morph, toProgress, width, height));
2632
+ return;
2633
+ }
2634
+ if (animRef.current !== null) cancelAnimationFrame(animRef.current);
2635
+ startProgressRef.current = currentProgressRef.current;
2636
+ targetProgressRef.current = toProgress;
2637
+ startTimeRef.current = performance.now();
2638
+ animRef.current = requestAnimationFrame(animate);
2639
+ },
2640
+ [morph, animate, width, height]
2641
+ );
2642
+ useEffect(() => {
2643
+ return () => {
2644
+ if (animRef.current !== null) cancelAnimationFrame(animRef.current);
2645
+ };
2646
+ }, []);
2647
+ const activate = useCallback(() => {
2648
+ if (disabled || !morph) return;
2649
+ setIsActive(true);
2650
+ startAnimation(1);
2651
+ }, [disabled, morph, startAnimation]);
2652
+ const deactivate = useCallback(() => {
2653
+ if (disabled || !morph) return;
2654
+ setIsActive(false);
2655
+ startAnimation(0);
2656
+ }, [disabled, morph, startAnimation]);
2657
+ const setProgress = useCallback(
2658
+ (progress) => {
2659
+ if (!morph) return;
2660
+ const p = Math.max(0, Math.min(1, progress));
2661
+ currentProgressRef.current = p;
2662
+ setIsActive(p >= 0.5);
2663
+ setClipPath(interpolatePath(morph, p, width, height));
2664
+ },
2665
+ [morph, width, height]
2666
+ );
2667
+ const handlers = useMemo(() => {
2668
+ if (!morphTo || disabled) return {};
2669
+ if (morphOn === "hover") {
2670
+ return { onMouseEnter: activate, onMouseLeave: deactivate };
2671
+ }
2672
+ if (morphOn === "click") {
2673
+ return {
2674
+ onClick: () => {
2675
+ if (isActive) deactivate();
2676
+ else activate();
2677
+ }
2678
+ };
2679
+ }
2680
+ if (morphOn === "focus") {
2681
+ return { onFocus: activate, onBlur: deactivate };
2682
+ }
2683
+ return {};
2684
+ }, [morphTo, disabled, morphOn, activate, deactivate, isActive]);
2685
+ return { clipPath, isActive, activate, deactivate, setProgress, handlers };
2686
+ }
2687
+ function easeCubicInOut(t) {
2688
+ return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
2689
+ }
2690
+ function cubicBezier(x1, y1, x2, y2) {
2691
+ return (t) => {
2692
+ if (t === 0 || t === 1) return t;
2693
+ let tParam = t;
2694
+ for (let i = 0; i < 8; i++) {
2695
+ const x = 3 * (1 - tParam) ** 2 * tParam * x1 + 3 * (1 - tParam) * tParam ** 2 * x2 + tParam ** 3;
2696
+ const dx = 3 * (1 - tParam) ** 2 * x1 + 6 * (1 - tParam) * tParam * (x2 - x1) + 3 * tParam ** 2 * (1 - x2);
2697
+ if (Math.abs(dx) < 1e-6) break;
2698
+ tParam -= (x - t) / dx;
2699
+ }
2700
+ return 3 * (1 - tParam) ** 2 * tParam * y1 + 3 * (1 - tParam) * tParam ** 2 * y2 + tParam ** 3;
2701
+ };
2702
+ }
2703
+ function getEasingFunction(easing) {
2704
+ if (Array.isArray(easing)) {
2705
+ if (easing.length === 4) {
2706
+ const [x1, y1, x2, y2] = easing;
2707
+ return cubicBezier(x1, y1, x2, y2);
2708
+ }
2709
+ return easeCubicInOut;
2710
+ }
2711
+ switch (easing) {
2712
+ case "linear":
2713
+ return (t) => t;
2714
+ case "ease-in":
2715
+ return (t) => t * t * t;
2716
+ case "ease-out":
2717
+ return (t) => 1 - (1 - t) ** 3;
2718
+ default:
2719
+ return easeCubicInOut;
2720
+ }
2721
+ }
2722
+ function ShapeMedia({
2723
+ shape,
2724
+ morphTo,
2725
+ morphOn = "hover",
2726
+ morphOptions,
2727
+ scrollProgress,
2728
+ width: widthProp,
2729
+ height: heightProp,
2730
+ children,
2731
+ className,
2732
+ style,
2733
+ "aria-label": ariaLabel,
2734
+ role,
2735
+ disabled
2736
+ }) {
2737
+ const containerRef = useRef(null);
2738
+ const [measuredWidth, setMeasuredWidth] = useState(widthProp != null ? widthProp : 0);
2739
+ const [measuredHeight, setMeasuredHeight] = useState(heightProp != null ? heightProp : 0);
2740
+ const width = widthProp != null ? widthProp : measuredWidth;
2741
+ const height = heightProp != null ? heightProp : measuredHeight;
2742
+ useEffect(() => {
2743
+ if (widthProp !== void 0 && heightProp !== void 0) return;
2744
+ const el = containerRef.current;
2745
+ if (!el) return;
2746
+ const observer = new ResizeObserver(([entry]) => {
2747
+ const { width: w, height: h } = entry.contentRect;
2748
+ setMeasuredWidth(Math.round(w));
2749
+ setMeasuredHeight(Math.round(h));
2750
+ });
2751
+ observer.observe(el);
2752
+ return () => observer.disconnect();
2753
+ }, [widthProp, heightProp]);
2754
+ const { clipPath, handlers } = useShapeMorph({
2755
+ shape,
2756
+ morphTo,
2757
+ morphOn,
2758
+ morphOptions,
2759
+ scrollProgress,
2760
+ width: Math.max(width, 1),
2761
+ height: Math.max(height, 1),
2762
+ disabled
2763
+ });
2764
+ const resolvedRole = role != null ? role : ariaLabel ? "img" : "presentation";
2765
+ const accessibilityProps = ariaLabel ? { role: resolvedRole, "aria-label": ariaLabel } : { role: resolvedRole };
2766
+ const computedStyle = __spreadProps(__spreadValues({}, style), {
2767
+ clipPath,
2768
+ overflow: "hidden",
2769
+ position: "relative"
2770
+ });
2771
+ return /* @__PURE__ */ jsx(
2772
+ "div",
2773
+ __spreadProps(__spreadValues(__spreadValues({
2774
+ ref: containerRef,
2775
+ className,
2776
+ style: computedStyle
2777
+ }, accessibilityProps), handlers), {
2778
+ children
2779
+ })
2780
+ );
2781
+ }
2782
+ function ShapeIcon({
2783
+ shape,
2784
+ morphTo,
2785
+ size = 48,
2786
+ children,
2787
+ className,
2788
+ style,
2789
+ color,
2790
+ "aria-label": ariaLabel
2791
+ }) {
2792
+ const computedStyle = __spreadValues({
2793
+ width: size,
2794
+ height: size,
2795
+ display: "flex",
2796
+ alignItems: "center",
2797
+ justifyContent: "center",
2798
+ backgroundColor: color
2799
+ }, style);
2800
+ return /* @__PURE__ */ jsx(
2801
+ ShapeMedia,
2802
+ {
2803
+ shape,
2804
+ morphTo,
2805
+ morphOn: morphTo ? "hover" : "none",
2806
+ width: size,
2807
+ height: size,
2808
+ className,
2809
+ style: computedStyle,
2810
+ "aria-label": ariaLabel,
2811
+ children
2812
+ }
2813
+ );
2814
+ }
2815
+ function ShapeMediaServer({
2816
+ shape,
2817
+ width,
2818
+ height,
2819
+ children,
2820
+ className,
2821
+ style,
2822
+ "aria-label": ariaLabel,
2823
+ role
2824
+ }) {
2825
+ const polygon = resolveShape(shape);
2826
+ const clipPath = toClipPath(polygon, width, height);
2827
+ const resolvedRole = role != null ? role : ariaLabel ? "img" : "presentation";
2828
+ const accessibilityProps = ariaLabel ? { role: resolvedRole, "aria-label": ariaLabel } : { role: resolvedRole };
2829
+ const computedStyle = __spreadProps(__spreadValues({}, style), {
2830
+ clipPath,
2831
+ overflow: "hidden",
2832
+ position: "relative"
2833
+ });
2834
+ return /* @__PURE__ */ jsx("div", __spreadProps(__spreadValues({ className, style: computedStyle }, accessibilityProps), { children }));
2835
+ }
2836
+ function ShapeSvg({
2837
+ shape,
2838
+ morphTo,
2839
+ progress = 0,
2840
+ width = 100,
2841
+ height = 100,
2842
+ fill = "currentColor",
2843
+ stroke = "none",
2844
+ strokeWidth = 0,
2845
+ className,
2846
+ style,
2847
+ "aria-label": ariaLabel
2848
+ }) {
2849
+ const startPolygon = useMemo(() => resolveShape(shape), [shape]);
2850
+ const endPolygon = useMemo(
2851
+ () => morphTo ? resolveShape(morphTo) : null,
2852
+ [morphTo]
2853
+ );
2854
+ const morph = useMemo(
2855
+ () => endPolygon ? new Morph(startPolygon, endPolygon) : null,
2856
+ [startPolygon, endPolygon]
2857
+ );
2858
+ const pathData = useMemo(() => {
2859
+ const cubics = morph ? morph.asCubics(progress) : startPolygon.cubics;
2860
+ return toSvgPath(cubics, width, height);
2861
+ }, [morph, progress, startPolygon, width, height]);
2862
+ return /* @__PURE__ */ jsx(
2863
+ "svg",
2864
+ {
2865
+ xmlns: "http://www.w3.org/2000/svg",
2866
+ viewBox: `0 0 ${width} ${height}`,
2867
+ width,
2868
+ height,
2869
+ className,
2870
+ style,
2871
+ "aria-label": ariaLabel,
2872
+ role: ariaLabel ? "img" : "presentation",
2873
+ "aria-hidden": !ariaLabel,
2874
+ children: /* @__PURE__ */ jsx(
2875
+ "path",
2876
+ {
2877
+ d: pathData,
2878
+ fill,
2879
+ stroke,
2880
+ strokeWidth
2881
+ }
2882
+ )
2883
+ }
2884
+ );
2885
+ }
2886
+
2887
+ export { ANGLE_EPSILON, Cubic, DISTANCE_EPSILON, FLOAT_PI, MD3CornerRadius, MD3Shapes, MeasuredPolygon, Morph, MutableCubic, RoundedPolygon, ShapeIcon, ShapeMedia, ShapeMediaServer, ShapeSvg, UNROUNDED, addPoints, circle, clockwise, convex, cornerFeature, cornerRounding, createDoubleMapper, directionVector, distance, distanceSquared, dividePoint, dotProduct, edgeFeature, featureMapper, getDirection, getDistance, getDistanceSquared, interpolate, interpolatePath, lerpPoint, pill, pillStar, point, positiveModulo, radialToCartesian, rectangle, rotate90, scalePoint, square, star, subtractPoints, toClipPath, toSvgPath, transformFeature, transformPoint, useShapeMorph };
2888
+ //# sourceMappingURL=shapes.mjs.map
2889
+ //# sourceMappingURL=shapes.mjs.map