@pixerate/editor 0.106.0 → 0.108.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.
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/dist/animation-editor/index.cjs +39 -39
- package/dist/animation-editor/index.d.cts +1 -1
- package/dist/animation-editor/index.d.ts +1 -1
- package/dist/animation-editor/index.js +1 -1
- package/dist/{chunk-DS7KDKPX.js → chunk-3PHA3UKI.js} +2 -2
- package/dist/{chunk-ZID226ZG.cjs → chunk-FRD3FUXI.cjs} +172 -172
- package/dist/{chunk-ZID226ZG.cjs.map → chunk-FRD3FUXI.cjs.map} +1 -1
- package/dist/{chunk-67FRIOPZ.js → chunk-G4BIYE6R.js} +2 -2
- package/dist/{chunk-PV42JITT.cjs → chunk-HUFQD4CB.cjs} +44 -44
- package/dist/{chunk-PV42JITT.cjs.map → chunk-HUFQD4CB.cjs.map} +1 -1
- package/dist/{chunk-63EFQCT5.js → chunk-HUQ7EHVI.js} +1140 -371
- package/dist/chunk-HUQ7EHVI.js.map +1 -0
- package/dist/{chunk-4X5MIVCE.js → chunk-SOROZ2BF.js} +3 -3
- package/dist/{chunk-CRMAXIUV.cjs → chunk-SZ6KMZNM.cjs} +157 -8
- package/dist/chunk-SZ6KMZNM.cjs.map +1 -0
- package/dist/{chunk-WSTEXEKD.cjs → chunk-T3QZ6S47.cjs} +92 -92
- package/dist/{chunk-WSTEXEKD.cjs.map → chunk-T3QZ6S47.cjs.map} +1 -1
- package/dist/{chunk-KANRAHTL.cjs → chunk-UTEVPQTS.cjs} +1353 -584
- package/dist/chunk-UTEVPQTS.cjs.map +1 -0
- package/dist/{chunk-HEW6KDNI.js → chunk-WMBIJCHA.js} +155 -6
- package/dist/chunk-WMBIJCHA.js.map +1 -0
- package/dist/{compositor-Bc3PNP3C.d.cts → compositor-D92URMlm.d.cts} +1 -1
- package/dist/{compositor-BsYYllvR.d.ts → compositor-Kt_M4ruo.d.ts} +1 -1
- package/dist/{export-_m3Es4ru.d.cts → export-JGWQEPJn.d.cts} +3 -3
- package/dist/{export-iMrop3Jm.d.ts → export-a9bnF7Cl.d.ts} +3 -3
- package/dist/image-editor/index.cjs +627 -619
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +8 -8
- package/dist/image-editor/index.d.ts +8 -8
- package/dist/image-editor/index.js +12 -4
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{mixer-C1M1Nua_.d.cts → mixer-5ziHU8OS.d.cts} +1 -1
- package/dist/{mixer-Cu5a9Bzd.d.ts → mixer-DNqiYXYQ.d.ts} +1 -1
- package/dist/paint/index.cjs +3 -3
- package/dist/paint/index.d.cts +2 -2
- package/dist/paint/index.d.ts +2 -2
- package/dist/paint/index.js +2 -2
- package/dist/paint-editor/index.cjs +365 -132
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +113 -8
- package/dist/paint-editor/index.d.ts +113 -8
- package/dist/paint-editor/index.js +249 -16
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +11 -3
- package/dist/raster/index.cjs.map +1 -1
- package/dist/raster/index.d.cts +4 -4
- package/dist/raster/index.d.ts +4 -4
- package/dist/raster/index.js +10 -2
- package/dist/{surface-BBJN9wxg.d.ts → surface-CkKOHGPm.d.cts} +20 -2
- package/dist/{surface-BBJN9wxg.d.cts → surface-CkKOHGPm.d.ts} +20 -2
- package/dist/{svg-Bj1MQFh6.d.cts → svg-ClVIG4T7.d.cts} +26 -2
- package/dist/{svg-vme0PLNo.d.ts → svg-SseJTIrA.d.ts} +26 -2
- package/dist/vector/index.cjs +977 -948
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +266 -7
- package/dist/vector/index.d.ts +266 -7
- package/dist/vector/index.js +427 -398
- package/dist/vector/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +50 -7
- package/skills/pixerate-paint-editor/SKILL.md +21 -1
- package/skills/pixerate-vector/SKILL.md +35 -5
- package/dist/chunk-63EFQCT5.js.map +0 -1
- package/dist/chunk-CRMAXIUV.cjs.map +0 -1
- package/dist/chunk-HEW6KDNI.js.map +0 -1
- package/dist/chunk-KANRAHTL.cjs.map +0 -1
- /package/dist/{chunk-DS7KDKPX.js.map → chunk-3PHA3UKI.js.map} +0 -0
- /package/dist/{chunk-67FRIOPZ.js.map → chunk-G4BIYE6R.js.map} +0 -0
- /package/dist/{chunk-4X5MIVCE.js.map → chunk-SOROZ2BF.js.map} +0 -0
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
24
29
|
|
|
25
30
|
|
|
26
31
|
|
|
@@ -95,6 +100,7 @@ var VECTOR_BLEND_MODES = [
|
|
|
95
100
|
"luminosity"
|
|
96
101
|
];
|
|
97
102
|
var VECTOR_BLEND_SPACINGS = ["steps", "distance", "smoothColor"];
|
|
103
|
+
var VECTOR_MASK_TYPES = ["clip", "alpha", "luminance"];
|
|
98
104
|
var VECTOR_TOOLS = [
|
|
99
105
|
"select",
|
|
100
106
|
"direct",
|
|
@@ -1622,14 +1628,14 @@ function nearestStrokePosition(path, p, only) {
|
|
|
1622
1628
|
if (!(total > 0)) return;
|
|
1623
1629
|
let acc = 0;
|
|
1624
1630
|
c.segments.forEach((seg, si) => {
|
|
1625
|
-
const
|
|
1626
|
-
if (!best ||
|
|
1627
|
-
const s = acc + _chunkXGD3FSNCcjs.segmentLength.call(void 0, seg, 0,
|
|
1628
|
-
const tan = _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg,
|
|
1629
|
-
const pt2 = seg.length === 2 ? lerp(seg[0], seg[1],
|
|
1631
|
+
const near2 = _chunkXGD3FSNCcjs.segmentNearest.call(void 0, seg, p);
|
|
1632
|
+
if (!best || near2.distance < best.distance) {
|
|
1633
|
+
const s = acc + _chunkXGD3FSNCcjs.segmentLength.call(void 0, seg, 0, near2.t);
|
|
1634
|
+
const tan = _chunkXGD3FSNCcjs.segmentTangent.call(void 0, seg, near2.t);
|
|
1635
|
+
const pt2 = seg.length === 2 ? lerp(seg[0], seg[1], near2.t) : evalSeg(seg, near2.t);
|
|
1630
1636
|
const n = leftNormal([tan[0], tan[1]]);
|
|
1631
1637
|
const side = (p[0] - pt2[0]) * n[0] + (p[1] - pt2[1]) * n[1] >= 0 ? "left" : "right";
|
|
1632
|
-
best = { contour: ci, t: Math.min(Math.max(s / total, 0), 1), distance:
|
|
1638
|
+
best = { contour: ci, t: Math.min(Math.max(s / total, 0), 1), distance: near2.distance, side, point: pt2, tangent: [tan[0], tan[1]], length: total };
|
|
1633
1639
|
}
|
|
1634
1640
|
acc += lengths[si];
|
|
1635
1641
|
});
|
|
@@ -1814,7 +1820,7 @@ function vectorStrokeParts(path, style) {
|
|
|
1814
1820
|
const cap = capExtent(style, width);
|
|
1815
1821
|
const tipMode = style.arrowAlign === "tip";
|
|
1816
1822
|
const trims = contours.map(() => [0, 0]);
|
|
1817
|
-
const
|
|
1823
|
+
const place2 = (end, contour, ci) => {
|
|
1818
1824
|
const kind = end === "start" ? style.startArrow : style.endArrow;
|
|
1819
1825
|
if (!kind || contour.closed) return;
|
|
1820
1826
|
const hw = arrowheadWeight(style, end);
|
|
@@ -1835,8 +1841,8 @@ function vectorStrokeParts(path, style) {
|
|
|
1835
1841
|
}
|
|
1836
1842
|
heads.push({ end, kind, tip, dir, inset, path: arrowheadPath(kind, tip, dir, hw) });
|
|
1837
1843
|
};
|
|
1838
|
-
|
|
1839
|
-
|
|
1844
|
+
place2("start", first, 0);
|
|
1845
|
+
place2("end", last, contours.length - 1);
|
|
1840
1846
|
if (!tipMode || !heads.length) return { align, line: path, drawWidth, heads };
|
|
1841
1847
|
const trimmed = contours.map((c, i) => {
|
|
1842
1848
|
const [s0, s1] = trims[i];
|
|
@@ -1869,13 +1875,13 @@ function hitTestVectorStroke(path, p, style, tolerance = 0) {
|
|
|
1869
1875
|
let d;
|
|
1870
1876
|
let reach = width / 2;
|
|
1871
1877
|
if (profile) {
|
|
1872
|
-
const
|
|
1873
|
-
if (!
|
|
1874
|
-
d =
|
|
1875
|
-
const w = widthProfileAt(profile,
|
|
1876
|
-
reach = width / 2 * (
|
|
1878
|
+
const near2 = nearestStrokePosition(parts.line, point);
|
|
1879
|
+
if (!near2) return false;
|
|
1880
|
+
d = near2.distance;
|
|
1881
|
+
const w = widthProfileAt(profile, near2.t);
|
|
1882
|
+
reach = width / 2 * (near2.side === "left" ? w.left : w.right);
|
|
1877
1883
|
if (parts.align !== "center") reach *= 2;
|
|
1878
|
-
const atEnd =
|
|
1884
|
+
const atEnd = near2.t <= 1e-9 || near2.t >= 1 - 1e-9;
|
|
1879
1885
|
if (atEnd && (style.strokeLinecap === "round" || style.strokeLinecap === "square") && d > reach) {
|
|
1880
1886
|
reach = Math.max(reach, width / 2 * (w.left + w.right) / 2);
|
|
1881
1887
|
}
|
|
@@ -2318,206 +2324,966 @@ function mapBezierPath(path, f, tolerance = 0.1, options = {}) {
|
|
|
2318
2324
|
return subpathsToBezier(mapVectorSubpaths(bezierToSubpaths(path), f, tolerance, options), { corners: false });
|
|
2319
2325
|
}
|
|
2320
2326
|
|
|
2321
|
-
// src/vector/
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2327
|
+
// src/vector/pathCut.ts
|
|
2328
|
+
var loopArea = (l) => _chunkXGD3FSNCcjs.contourSignedArea.call(void 0, l.segs);
|
|
2329
|
+
function loopSample(l) {
|
|
2330
|
+
const k = l.chord.findIndex((c) => !c);
|
|
2331
|
+
return _chunkXGD3FSNCcjs.segmentPoint.call(void 0, l.segs[k >= 0 ? k : 0], 0.5);
|
|
2332
|
+
}
|
|
2333
|
+
var contains = (l, p) => _chunkXGD3FSNCcjs.windingNumber.call(void 0, [l.segs], p) !== 0;
|
|
2334
|
+
function groupFaces(loops) {
|
|
2335
|
+
const usable = loops.filter((l) => l.segs.length && Math.abs(loopArea(l)) > 1e-12);
|
|
2336
|
+
if (!usable.length) return [];
|
|
2337
|
+
const largest = usable.reduce((a, b) => Math.abs(loopArea(b)) > Math.abs(loopArea(a)) ? b : a);
|
|
2338
|
+
const sign = Math.sign(loopArea(largest));
|
|
2339
|
+
const outers = usable.filter((l) => Math.sign(loopArea(l)) === sign).sort((a, b) => Math.abs(loopArea(a)) - Math.abs(loopArea(b)));
|
|
2340
|
+
const faces = new Map(outers.map((o) => [o, { loops: [o] }]));
|
|
2341
|
+
for (const hole of usable.filter((l) => Math.sign(loopArea(l)) !== sign)) {
|
|
2342
|
+
const p = loopSample(hole);
|
|
2343
|
+
const parent = outers.find((o) => Math.abs(loopArea(o)) > Math.abs(loopArea(hole)) && contains(o, p));
|
|
2344
|
+
if (parent) faces.get(parent).loops.push(hole);
|
|
2345
|
+
}
|
|
2346
|
+
return outers.reverse().map((o) => faces.get(o));
|
|
2347
|
+
}
|
|
2348
|
+
function faceToPath(face) {
|
|
2349
|
+
return _chunkXGD3FSNCcjs.contoursToPath.call(void 0, face.loops.map((l) => ({ segments: l.segs, closed: true })));
|
|
2350
|
+
}
|
|
2351
|
+
function facesOf(path, fillRule) {
|
|
2352
|
+
const normalized = _chunkXGD3FSNCcjs.normalizeBezierPath.call(void 0, path, fillRule);
|
|
2353
|
+
const loops = _chunkXGD3FSNCcjs.pathToContours.call(void 0, normalized).map((c) => {
|
|
2354
|
+
const segs = _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true).map((s) => s.slice());
|
|
2355
|
+
return { segs, chord: segs.map(() => false) };
|
|
2356
|
+
});
|
|
2357
|
+
return groupFaces(loops);
|
|
2358
|
+
}
|
|
2359
|
+
function splitIntoFaces(path, fillRule = "nonzero") {
|
|
2360
|
+
return facesOf(path, fillRule).map(faceToPath);
|
|
2361
|
+
}
|
|
2362
|
+
function rootsInUnit(a, b, c, d, scale3) {
|
|
2363
|
+
const f = (t) => ((a * t + b) * t + c) * t + d;
|
|
2364
|
+
const tol = 1e-12 * Math.max(1, scale3);
|
|
2365
|
+
const cuts = [0];
|
|
2366
|
+
const qa = 3 * a;
|
|
2367
|
+
const qb = 2 * b;
|
|
2368
|
+
if (Math.abs(qa) > 1e-18) {
|
|
2369
|
+
const disc = qb * qb - 4 * qa * c;
|
|
2370
|
+
if (disc >= 0) {
|
|
2371
|
+
const r = Math.sqrt(disc);
|
|
2372
|
+
for (const t of [(-qb - r) / (2 * qa), (-qb + r) / (2 * qa)].sort((x, y) => x - y)) if (t > 0 && t < 1) cuts.push(t);
|
|
2373
|
+
}
|
|
2374
|
+
} else if (Math.abs(qb) > 1e-18) {
|
|
2375
|
+
const t = -c / qb;
|
|
2376
|
+
if (t > 0 && t < 1) cuts.push(t);
|
|
2377
|
+
}
|
|
2378
|
+
cuts.push(1);
|
|
2379
|
+
const roots = [];
|
|
2380
|
+
const push = (t) => {
|
|
2381
|
+
if (!roots.some((r) => Math.abs(r - t) < 1e-9)) roots.push(t);
|
|
2333
2382
|
};
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
for (let k = 0; k <
|
|
2343
|
-
const
|
|
2344
|
-
const
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2383
|
+
for (let i = 0; i < cuts.length - 1; i++) {
|
|
2384
|
+
let lo = cuts[i];
|
|
2385
|
+
let hi = cuts[i + 1];
|
|
2386
|
+
let flo = f(lo);
|
|
2387
|
+
const fhi = f(hi);
|
|
2388
|
+
if (Math.abs(flo) <= tol) push(lo);
|
|
2389
|
+
if (Math.abs(fhi) <= tol) push(hi);
|
|
2390
|
+
if (flo * fhi >= 0) continue;
|
|
2391
|
+
for (let k = 0; k < 80; k++) {
|
|
2392
|
+
const m = (lo + hi) / 2;
|
|
2393
|
+
const fm = f(m);
|
|
2394
|
+
if (fm === 0) {
|
|
2395
|
+
lo = hi = m;
|
|
2396
|
+
break;
|
|
2397
|
+
}
|
|
2398
|
+
if (fm * flo < 0) hi = m;
|
|
2399
|
+
else {
|
|
2400
|
+
lo = m;
|
|
2401
|
+
flo = fm;
|
|
2402
|
+
}
|
|
2348
2403
|
}
|
|
2404
|
+
push((lo + hi) / 2);
|
|
2405
|
+
}
|
|
2406
|
+
return roots.sort((x, y) => x - y);
|
|
2407
|
+
}
|
|
2408
|
+
function lineHits(p, q, seg) {
|
|
2409
|
+
const dx = q[0] - p[0];
|
|
2410
|
+
const dy = q[1] - p[1];
|
|
2411
|
+
const len2 = dx * dx + dy * dy;
|
|
2412
|
+
if (len2 < 1e-24) return [];
|
|
2413
|
+
const h = (pt2) => (pt2[0] - p[0]) * -dy + (pt2[1] - p[1]) * dx;
|
|
2414
|
+
let coeffs;
|
|
2415
|
+
if (seg.length === 2) coeffs = [0, 0, h(seg[1]) - h(seg[0]), h(seg[0])];
|
|
2416
|
+
else {
|
|
2417
|
+
const [h0, h1, h2, h3] = seg.map(h);
|
|
2418
|
+
coeffs = [-h0 + 3 * h1 - 3 * h2 + h3, 3 * h0 - 6 * h1 + 3 * h2, -3 * h0 + 3 * h1, h0];
|
|
2419
|
+
}
|
|
2420
|
+
if (coeffs.every((c) => Math.abs(c) < 1e-12 * Math.max(1, len2))) return [];
|
|
2421
|
+
const scale3 = Math.sqrt(len2) * Math.max(1, ...seg.map((pt2) => Math.abs(pt2[0]) + Math.abs(pt2[1])));
|
|
2422
|
+
const out = [];
|
|
2423
|
+
for (const t of rootsInUnit(...coeffs, scale3)) {
|
|
2424
|
+
const point = _chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, t);
|
|
2425
|
+
const s = ((point[0] - p[0]) * dx + (point[1] - p[1]) * dy) / len2;
|
|
2426
|
+
if (s >= -1e-9 && s <= 1 + 1e-9) out.push({ s: Math.min(1, Math.max(0, s)), t, point });
|
|
2349
2427
|
}
|
|
2350
2428
|
return out;
|
|
2351
2429
|
}
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
const
|
|
2356
|
-
const
|
|
2357
|
-
const
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
};
|
|
2364
|
-
const cornersOf = () => [
|
|
2365
|
-
{ x: box.x0, y: box.y0 },
|
|
2366
|
-
{ x: box.x1, y: box.y0 },
|
|
2367
|
-
{ x: box.x1, y: box.y1 },
|
|
2368
|
-
{ x: box.x0, y: box.y1 }
|
|
2369
|
-
].map(nearest);
|
|
2370
|
-
let c = cornersOf();
|
|
2371
|
-
const n = ring.length;
|
|
2372
|
-
const fwd = (from, to) => (to - from + n) % n;
|
|
2373
|
-
if (!(fwd(c[0], c[1]) < fwd(c[0], c[2]) && fwd(c[0], c[2]) < fwd(c[0], c[3]))) {
|
|
2374
|
-
ring = ring.slice().reverse();
|
|
2375
|
-
c = cornersOf();
|
|
2376
|
-
if (!(fwd(c[0], c[1]) < fwd(c[0], c[2]) && fwd(c[0], c[2]) < fwd(c[0], c[3]))) return null;
|
|
2377
|
-
}
|
|
2378
|
-
if (new Set(c).size < 4) return null;
|
|
2379
|
-
const walk = (from, to) => {
|
|
2380
|
-
const out = [];
|
|
2381
|
-
for (let i = from; ; i = (i + 1) % n) {
|
|
2382
|
-
out.push(ring[i]);
|
|
2383
|
-
if (i === to) break;
|
|
2430
|
+
var near = (a, b, eps) => Math.abs(a[0] - b[0]) <= eps && Math.abs(a[1] - b[1]) <= eps;
|
|
2431
|
+
var degenerate = (seg, eps) => seg.every((p) => near(p, seg[0], eps));
|
|
2432
|
+
function arc(l, a, b, eps) {
|
|
2433
|
+
const n = l.segs.length;
|
|
2434
|
+
const segs = [];
|
|
2435
|
+
const chord = [];
|
|
2436
|
+
const push = (k, t0, t1) => {
|
|
2437
|
+
const piece = t0 <= 0 && t1 >= 1 ? l.segs[k].slice() : _chunkXGD3FSNCcjs.subSegment.call(void 0, l.segs[k], t0, t1);
|
|
2438
|
+
if (!degenerate(piece, eps)) {
|
|
2439
|
+
segs.push(piece);
|
|
2440
|
+
chord.push(l.chord[k]);
|
|
2384
2441
|
}
|
|
2385
|
-
return out;
|
|
2386
|
-
};
|
|
2387
|
-
const top = polylineAt(walk(c[0], c[1]));
|
|
2388
|
-
const right = polylineAt(walk(c[1], c[2]));
|
|
2389
|
-
const bottomLR = polylineAt(walk(c[2], c[3]).reverse());
|
|
2390
|
-
const leftTB = polylineAt(walk(c[3], c[0]).reverse());
|
|
2391
|
-
const p00 = top(0);
|
|
2392
|
-
const p10 = top(1);
|
|
2393
|
-
const p01 = bottomLR(0);
|
|
2394
|
-
const p11 = bottomLR(1);
|
|
2395
|
-
const coons = (s, t) => {
|
|
2396
|
-
const T = top(s);
|
|
2397
|
-
const B = bottomLR(s);
|
|
2398
|
-
const L = leftTB(t);
|
|
2399
|
-
const R = right(t);
|
|
2400
|
-
return {
|
|
2401
|
-
x: (1 - t) * T.x + t * B.x + (1 - s) * L.x + s * R.x - ((1 - s) * (1 - t) * p00.x + s * (1 - t) * p10.x + (1 - s) * t * p01.x + s * t * p11.x),
|
|
2402
|
-
y: (1 - t) * T.y + t * B.y + (1 - s) * L.y + s * R.y - ((1 - s) * (1 - t) * p00.y + s * (1 - t) * p10.y + (1 - s) * t * p01.y + s * t * p11.y)
|
|
2403
|
-
};
|
|
2404
2442
|
};
|
|
2405
|
-
|
|
2443
|
+
if (a.seg === b.seg && b.t >= a.t + 1e-12) {
|
|
2444
|
+
push(a.seg, a.t, b.t);
|
|
2445
|
+
return { segs, chord };
|
|
2446
|
+
}
|
|
2447
|
+
push(a.seg, a.t, 1);
|
|
2448
|
+
for (let k = (a.seg + 1) % n; k !== b.seg; k = (k + 1) % n) push(k, 0, 1);
|
|
2449
|
+
push(b.seg, 0, b.t);
|
|
2450
|
+
return { segs, chord };
|
|
2406
2451
|
}
|
|
2407
|
-
function
|
|
2408
|
-
const
|
|
2409
|
-
|
|
2410
|
-
|
|
2452
|
+
function polySegs(points, eps) {
|
|
2453
|
+
const out = [];
|
|
2454
|
+
for (let i = 1; i < points.length; i++) if (!near(points[i - 1], points[i], eps)) out.push([points[i - 1], points[i]]);
|
|
2455
|
+
return out;
|
|
2456
|
+
}
|
|
2457
|
+
function knifePath(path, fillRule, knife) {
|
|
2458
|
+
const pts = knife.filter((p) => Number.isFinite(p[0]) && Number.isFinite(p[1]));
|
|
2459
|
+
if (pts.length < 2) return null;
|
|
2460
|
+
let faces = facesOf(path, fillRule);
|
|
2461
|
+
if (!faces.length) return null;
|
|
2462
|
+
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, path);
|
|
2463
|
+
const size = b ? Math.max(b.maxX - b.minX, b.maxY - b.minY, 1) : 1;
|
|
2464
|
+
const eps = size * 1e-9;
|
|
2465
|
+
let cursor = -Infinity;
|
|
2466
|
+
let cuts = 0;
|
|
2467
|
+
for (let guard = 0; guard < 512; guard++) {
|
|
2468
|
+
let best = null;
|
|
2469
|
+
faces.forEach((face2, fi2) => {
|
|
2470
|
+
const hits = [];
|
|
2471
|
+
for (let m = 0; m < pts.length - 1; m++) {
|
|
2472
|
+
if (m + 1 < cursor - 1e-9) continue;
|
|
2473
|
+
const kb = { minX: Math.min(pts[m][0], pts[m + 1][0]), maxX: Math.max(pts[m][0], pts[m + 1][0]), minY: Math.min(pts[m][1], pts[m + 1][1]), maxY: Math.max(pts[m][1], pts[m + 1][1]) };
|
|
2474
|
+
face2.loops.forEach(
|
|
2475
|
+
(l, li) => l.segs.forEach((seg, si) => {
|
|
2476
|
+
const sb = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, seg);
|
|
2477
|
+
if (sb.maxX < kb.minX - eps || sb.minX > kb.maxX + eps || sb.maxY < kb.minY - eps || sb.minY > kb.maxY + eps) return;
|
|
2478
|
+
for (const h of lineHits(pts[m], pts[m + 1], seg)) {
|
|
2479
|
+
const s = m + h.s;
|
|
2480
|
+
if (s >= cursor - 1e-9) hits.push({ s, loop: li, seg: si, t: h.t, point: h.point });
|
|
2481
|
+
}
|
|
2482
|
+
})
|
|
2483
|
+
);
|
|
2484
|
+
}
|
|
2485
|
+
hits.sort((x, y) => x.s - y.s);
|
|
2486
|
+
const unique = hits.filter((h, i) => i === 0 || h.s - hits[i - 1].s > 1e-9 || !near(h.point, hits[i - 1].point, eps * 10));
|
|
2487
|
+
const inside = (s) => {
|
|
2488
|
+
const m = Math.min(pts.length - 2, Math.floor(s));
|
|
2489
|
+
const u = s - m;
|
|
2490
|
+
const q = [pts[m][0] + (pts[m + 1][0] - pts[m][0]) * u, pts[m][1] + (pts[m + 1][1] - pts[m][1]) * u];
|
|
2491
|
+
return _chunkXGD3FSNCcjs.windingNumber.call(void 0, face2.loops.map((l) => l.segs), q) !== 0;
|
|
2492
|
+
};
|
|
2493
|
+
for (let i = 0; i < unique.length - 1; i++) {
|
|
2494
|
+
const from2 = unique[i];
|
|
2495
|
+
const to2 = unique[i + 1];
|
|
2496
|
+
if (near(from2.point, to2.point, eps * 10) || !inside((from2.s + to2.s) / 2)) continue;
|
|
2497
|
+
if (!best || from2.s < best.from.s) best = { face: fi2, from: from2, to: to2 };
|
|
2498
|
+
break;
|
|
2499
|
+
}
|
|
2500
|
+
});
|
|
2501
|
+
if (!best) break;
|
|
2502
|
+
const { face: fi, from, to } = best;
|
|
2503
|
+
const face = faces[fi];
|
|
2504
|
+
const corners = [from.point];
|
|
2505
|
+
for (let m = Math.floor(from.s) + 1; m <= to.s - 1e-12 && m < pts.length; m++) if (m > from.s) corners.push(pts[m]);
|
|
2506
|
+
corners.push(to.point);
|
|
2507
|
+
const forward = polySegs(corners, eps);
|
|
2508
|
+
const back = polySegs(corners.slice().reverse(), eps);
|
|
2509
|
+
const la = face.loops[from.loop];
|
|
2510
|
+
const loops = face.loops.filter((_, i) => i !== from.loop && i !== to.loop);
|
|
2511
|
+
if (from.loop === to.loop) {
|
|
2512
|
+
const ab = arc(la, from, to, eps);
|
|
2513
|
+
const ba = arc(la, to, from, eps);
|
|
2514
|
+
loops.push(
|
|
2515
|
+
{ segs: [...ab.segs, ...back], chord: [...ab.chord, ...back.map(() => true)] },
|
|
2516
|
+
{ segs: [...ba.segs, ...forward], chord: [...ba.chord, ...forward.map(() => true)] }
|
|
2517
|
+
);
|
|
2518
|
+
} else {
|
|
2519
|
+
const lb = face.loops[to.loop];
|
|
2520
|
+
const roundA = arc(la, from, from, eps);
|
|
2521
|
+
const roundB = arc(lb, to, to, eps);
|
|
2522
|
+
loops.push({
|
|
2523
|
+
segs: [...roundA.segs, ...forward, ...roundB.segs, ...back],
|
|
2524
|
+
chord: [...roundA.chord, ...forward.map(() => true), ...roundB.chord, ...back.map(() => true)]
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
faces = [...faces.slice(0, fi), ...groupFaces(loops), ...faces.slice(fi + 1)];
|
|
2528
|
+
cursor = to.s;
|
|
2529
|
+
cuts++;
|
|
2530
|
+
}
|
|
2531
|
+
return cuts ? faces.map(faceToPath) : null;
|
|
2532
|
+
}
|
|
2533
|
+
function eraserRegion(points, width) {
|
|
2534
|
+
const pts = points.filter((p) => Number.isFinite(p[0]) && Number.isFinite(p[1]));
|
|
2535
|
+
const r = width / 2;
|
|
2536
|
+
if (!pts.length || !(r > 0)) return [];
|
|
2537
|
+
const moved = pts.some((p) => !near(p, pts[0], 1e-9));
|
|
2538
|
+
if (!moved) {
|
|
2539
|
+
const [cx, cy] = pts[0];
|
|
2540
|
+
const k = r * 0.5522847498307936;
|
|
2541
|
+
return [
|
|
2542
|
+
{ type: "M", x: cx, y: cy - r },
|
|
2543
|
+
{ type: "C", x1: cx + k, y1: cy - r, x2: cx + r, y2: cy - k, x: cx + r, y: cy },
|
|
2544
|
+
{ type: "C", x1: cx + r, y1: cy + k, x2: cx + k, y2: cy + r, x: cx, y: cy + r },
|
|
2545
|
+
{ type: "C", x1: cx - k, y1: cy + r, x2: cx - r, y2: cy + k, x: cx - r, y: cy },
|
|
2546
|
+
{ type: "C", x1: cx - r, y1: cy - k, x2: cx - k, y2: cy - r, x: cx, y: cy - r },
|
|
2547
|
+
{ type: "Z" }
|
|
2548
|
+
];
|
|
2549
|
+
}
|
|
2550
|
+
const line = [{ type: "M", x: pts[0][0], y: pts[0][1] }, ...pts.slice(1).map((p) => ({ type: "L", x: p[0], y: p[1] }))];
|
|
2551
|
+
return _chunkXGD3FSNCcjs.outlineStroke.call(void 0, line, { width, cap: "round", join: "round" });
|
|
2552
|
+
}
|
|
2553
|
+
function eraseFromFill(path, fillRule, region) {
|
|
2554
|
+
const overlap = _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "intersection", [{ path, fillRule }, { path: region }]).path;
|
|
2555
|
+
if (!_chunkXGD3FSNCcjs.pathToContours.call(void 0, overlap).some((c) => Math.abs(_chunkXGD3FSNCcjs.contourSignedArea.call(void 0, _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true))) > 1e-9)) return null;
|
|
2556
|
+
const rest = _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "difference", [{ path, fillRule }, { path: region }]).path;
|
|
2557
|
+
return splitIntoFaces(rest);
|
|
2558
|
+
}
|
|
2559
|
+
function eraseFromOutline(sp, region, options = {}) {
|
|
2560
|
+
const regionSegs = _chunkXGD3FSNCcjs.pathToContours.call(void 0, region).flatMap((c) => _chunkXGD3FSNCcjs.closeContour.call(void 0, c, true));
|
|
2561
|
+
if (!regionSegs.length) return null;
|
|
2562
|
+
const rb = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, region);
|
|
2563
|
+
const count = subpathSegmentCount(sp);
|
|
2564
|
+
if (!rb || count === 0) return null;
|
|
2565
|
+
const inside = options.keep === "inside";
|
|
2566
|
+
const removed = (p) => _chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, region, p, _nullishCoalesce(options.fillRule, () => ( "nonzero"))) !== inside;
|
|
2411
2567
|
const runs = [];
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
for (let i =
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2568
|
+
let cur = [];
|
|
2569
|
+
let any = false;
|
|
2570
|
+
for (let i = 0; i < count; i++) {
|
|
2571
|
+
const seg = subpathSegment(sp, i);
|
|
2572
|
+
const sb = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, seg);
|
|
2573
|
+
const ts = [0, 1];
|
|
2574
|
+
if (!(sb.maxX < rb.minX || sb.minX > rb.maxX || sb.maxY < rb.minY || sb.minY > rb.maxY)) {
|
|
2575
|
+
for (const r of regionSegs) {
|
|
2576
|
+
const b = _chunkXGD3FSNCcjs.segmentBounds.call(void 0, r);
|
|
2577
|
+
if (b.maxX < sb.minX || b.minX > sb.maxX || b.maxY < sb.minY || b.minY > sb.maxY) continue;
|
|
2578
|
+
for (const hit of _chunkXGD3FSNCcjs.segmentIntersections.call(void 0, seg, r)) if (hit.ta > 1e-9 && hit.ta < 1 - 1e-9) ts.push(hit.ta);
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
ts.sort((a, b) => a - b);
|
|
2582
|
+
for (let k = 0; k < ts.length - 1; k++) {
|
|
2583
|
+
const t0 = ts[k];
|
|
2584
|
+
const t1 = ts[k + 1];
|
|
2585
|
+
if (t1 - t0 < 1e-9) continue;
|
|
2586
|
+
if (removed(_chunkXGD3FSNCcjs.segmentPoint.call(void 0, seg, (t0 + t1) / 2))) {
|
|
2587
|
+
any = true;
|
|
2588
|
+
if (cur.length) runs.push(cur);
|
|
2589
|
+
cur = [];
|
|
2590
|
+
} else cur.push({ seg: i, t0, t1 });
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
if (cur.length) runs.push(cur);
|
|
2594
|
+
if (!any) return null;
|
|
2595
|
+
if (sp.closed && runs.length >= 2) {
|
|
2596
|
+
const first = runs[0][0];
|
|
2597
|
+
const lastRun = runs[runs.length - 1];
|
|
2598
|
+
const last = lastRun[lastRun.length - 1];
|
|
2599
|
+
if (first.seg === 0 && first.t0 === 0 && last.seg === count - 1 && last.t1 === 1) lastRun.push(...runs.shift());
|
|
2600
|
+
}
|
|
2601
|
+
const out = [];
|
|
2602
|
+
for (const run of runs) {
|
|
2603
|
+
const anchors = [];
|
|
2604
|
+
for (const { seg, t0, t1 } of run) {
|
|
2605
|
+
const c = _chunkXGD3FSNCcjs.subSegment.call(void 0, subpathSegment(sp, seg), t0, t1);
|
|
2606
|
+
const line = c.length === 2;
|
|
2607
|
+
const start = c[0];
|
|
2608
|
+
const end = c[c.length - 1];
|
|
2609
|
+
if (!anchors.length) anchors.push({ x: start[0], y: start[1] });
|
|
2610
|
+
if (!line) anchors[anchors.length - 1].out = { x: c[1][0], y: c[1][1] };
|
|
2611
|
+
const next = { x: end[0], y: end[1] };
|
|
2612
|
+
if (!line) next.in = { x: c[2][0], y: c[2][1] };
|
|
2613
|
+
anchors.push(next);
|
|
2614
|
+
}
|
|
2615
|
+
if (anchors.length < 2) continue;
|
|
2616
|
+
for (const a of anchors) {
|
|
2617
|
+
const type = inferAnchorType(a);
|
|
2618
|
+
if (type !== "corner") a.type = type;
|
|
2619
|
+
}
|
|
2620
|
+
out.push({ anchors, closed: false });
|
|
2621
|
+
}
|
|
2622
|
+
return out;
|
|
2623
|
+
}
|
|
2624
|
+
function polylineBounds(points, pad = 0) {
|
|
2625
|
+
if (!points.length) return null;
|
|
2626
|
+
let minX = Infinity;
|
|
2627
|
+
let minY = Infinity;
|
|
2628
|
+
let maxX = -Infinity;
|
|
2629
|
+
let maxY = -Infinity;
|
|
2630
|
+
for (const [x, y] of points) {
|
|
2631
|
+
minX = Math.min(minX, x);
|
|
2632
|
+
minY = Math.min(minY, y);
|
|
2633
|
+
maxX = Math.max(maxX, x);
|
|
2634
|
+
maxY = Math.max(maxY, y);
|
|
2635
|
+
}
|
|
2636
|
+
return { x: minX - pad, y: minY - pad, width: maxX - minX + 2 * pad, height: maxY - minY + 2 * pad };
|
|
2637
|
+
}
|
|
2638
|
+
function simplifyPolyline(points, tolerance) {
|
|
2639
|
+
const n = points.length;
|
|
2640
|
+
if (n < 3) return points.slice();
|
|
2641
|
+
const keep = new Array(n).fill(false);
|
|
2642
|
+
keep[0] = keep[n - 1] = true;
|
|
2643
|
+
const stack = [[0, n - 1]];
|
|
2644
|
+
while (stack.length) {
|
|
2645
|
+
const [a, b] = stack.pop();
|
|
2646
|
+
const [ax, ay] = points[a];
|
|
2647
|
+
const dx = points[b][0] - ax;
|
|
2648
|
+
const dy = points[b][1] - ay;
|
|
2649
|
+
const len2 = Math.hypot(dx, dy);
|
|
2650
|
+
let far = -1;
|
|
2651
|
+
let farD = 0;
|
|
2652
|
+
for (let i = a + 1; i < b; i++) {
|
|
2653
|
+
const [px, py] = points[i];
|
|
2654
|
+
const d = len2 < 1e-12 ? Math.hypot(px - ax, py - ay) : Math.abs((px - ax) * dy - (py - ay) * dx) / len2;
|
|
2655
|
+
if (d > farD) {
|
|
2656
|
+
farD = d;
|
|
2657
|
+
far = i;
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
if (far >= 0 && farD > tolerance) {
|
|
2661
|
+
keep[far] = true;
|
|
2662
|
+
stack.push([a, far], [far, b]);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
return points.filter((_, i) => keep[i]);
|
|
2421
2666
|
}
|
|
2422
2667
|
|
|
2423
|
-
// src/vector/
|
|
2424
|
-
var
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
offset: { amount: 5, join: "miter", miterLimit: 4, copies: 1, copyOffset: 0 },
|
|
2432
|
-
merge: { mode: "add" },
|
|
2433
|
-
repeater: {
|
|
2434
|
-
copies: 3,
|
|
2435
|
-
offset: 0,
|
|
2436
|
-
position: { x: 100, y: 0 },
|
|
2437
|
-
anchor: { x: 0, y: 0 },
|
|
2438
|
-
rotation: 0,
|
|
2439
|
-
scale: { x: 100, y: 100 },
|
|
2440
|
-
startOpacity: 100,
|
|
2441
|
-
endOpacity: 100,
|
|
2442
|
-
composite: "below"
|
|
2443
|
-
},
|
|
2444
|
-
envelope: { style: "arc", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", rows: 2, columns: 2, mesh: null }
|
|
2668
|
+
// src/vector/filters.ts
|
|
2669
|
+
var VECTOR_FILTER_DEFAULTS = {
|
|
2670
|
+
dropShadow: { color: "#000000", opacity: 0.25, offsetX: 0, offsetY: 4, blur: 4, spread: 0 },
|
|
2671
|
+
innerShadow: { color: "#000000", opacity: 0.25, offsetX: 0, offsetY: 4, blur: 4, spread: 0 },
|
|
2672
|
+
outerGlow: { color: "#ffffbe", opacity: 0.75, blur: 10, spread: 0 },
|
|
2673
|
+
innerGlow: { color: "#ffffbe", opacity: 0.75, blur: 10, spread: 0 },
|
|
2674
|
+
layerBlur: { radius: 4 },
|
|
2675
|
+
feather: { radius: 8 }
|
|
2445
2676
|
};
|
|
2446
|
-
var
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
offset: "Offset Paths",
|
|
2454
|
-
merge: "Merge Paths",
|
|
2455
|
-
repeater: "Repeater",
|
|
2456
|
-
envelope: "Envelope"
|
|
2677
|
+
var VECTOR_FILTER_LABELS = {
|
|
2678
|
+
dropShadow: "Drop Shadow",
|
|
2679
|
+
innerShadow: "Inner Shadow",
|
|
2680
|
+
outerGlow: "Outer Glow",
|
|
2681
|
+
innerGlow: "Inner Glow",
|
|
2682
|
+
layerBlur: "Layer Blur",
|
|
2683
|
+
feather: "Feather"
|
|
2457
2684
|
};
|
|
2458
|
-
var
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
],
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
}
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2685
|
+
var SHADOW_SPECS = [
|
|
2686
|
+
{ key: "color", label: "Color", kind: "color" },
|
|
2687
|
+
{ key: "opacity", label: "Opacity", kind: "number", min: 0, max: 1, step: 0.01, slider: true },
|
|
2688
|
+
{ key: "offsetX", label: "X", kind: "number", min: -1e3, max: 1e3, step: 1 },
|
|
2689
|
+
{ key: "offsetY", label: "Y", kind: "number", min: -1e3, max: 1e3, step: 1 },
|
|
2690
|
+
{ key: "blur", label: "Blur", kind: "number", min: 0, max: 500, step: 1 },
|
|
2691
|
+
{ key: "spread", label: "Spread", kind: "number", min: 0, max: 500, step: 1 }
|
|
2692
|
+
];
|
|
2693
|
+
var GLOW_SPECS = SHADOW_SPECS.filter((s) => s.key !== "offsetX" && s.key !== "offsetY");
|
|
2694
|
+
var VECTOR_FILTER_PARAM_SPECS = {
|
|
2695
|
+
dropShadow: SHADOW_SPECS,
|
|
2696
|
+
innerShadow: SHADOW_SPECS.map((s) => s.key === "spread" ? { ...s, label: "Choke" } : s),
|
|
2697
|
+
outerGlow: GLOW_SPECS,
|
|
2698
|
+
innerGlow: GLOW_SPECS.map((s) => s.key === "spread" ? { ...s, label: "Choke" } : s),
|
|
2699
|
+
layerBlur: [{ key: "radius", label: "Radius", kind: "number", min: 0, max: 500, step: 1, slider: true }],
|
|
2700
|
+
feather: [{ key: "radius", label: "Radius", kind: "number", min: 0, max: 500, step: 1, slider: true }]
|
|
2701
|
+
};
|
|
2702
|
+
function isVectorFilterType(value) {
|
|
2703
|
+
return typeof value === "string" && VECTOR_FILTER_TYPES.includes(value);
|
|
2704
|
+
}
|
|
2705
|
+
function normalizeVectorFilterParams(type, params, base) {
|
|
2706
|
+
if (!isVectorFilterType(type)) return null;
|
|
2707
|
+
const out = { ...VECTOR_FILTER_DEFAULTS[type], ..._nullishCoalesce(base, () => ( {})) };
|
|
2708
|
+
for (const spec of VECTOR_FILTER_PARAM_SPECS[type]) {
|
|
2709
|
+
const v2 = _optionalChain([params, 'optionalAccess', _43 => _43[spec.key]]);
|
|
2710
|
+
if (v2 === void 0) continue;
|
|
2711
|
+
if (spec.kind === "number" && typeof v2 === "number" && Number.isFinite(v2)) out[spec.key] = Math.min(_nullishCoalesce(spec.max, () => ( Infinity)), Math.max(_nullishCoalesce(spec.min, () => ( -Infinity)), v2));
|
|
2712
|
+
else if (spec.kind === "color" && typeof v2 === "string" && v2.trim()) out[spec.key] = v2.trim();
|
|
2713
|
+
}
|
|
2714
|
+
return out;
|
|
2715
|
+
}
|
|
2716
|
+
function vectorFilterParamKeys(type) {
|
|
2717
|
+
return VECTOR_FILTER_PARAM_SPECS[type].map((s) => s.key);
|
|
2718
|
+
}
|
|
2719
|
+
function createVectorFilter(type, id, params) {
|
|
2720
|
+
const p = normalizeVectorFilterParams(type, params);
|
|
2721
|
+
return p ? { id, type, params: p } : null;
|
|
2722
|
+
}
|
|
2723
|
+
function sanitizeVectorFilters(value) {
|
|
2724
|
+
if (!Array.isArray(value)) return [];
|
|
2725
|
+
const out = [];
|
|
2726
|
+
const used = /* @__PURE__ */ new Set();
|
|
2727
|
+
for (const raw of value) {
|
|
2728
|
+
if (!raw || typeof raw !== "object") continue;
|
|
2729
|
+
const r = raw;
|
|
2730
|
+
if (!isVectorFilterType(r.type)) continue;
|
|
2731
|
+
let id = typeof r.id === "string" && r.id && !used.has(r.id) ? r.id : "";
|
|
2732
|
+
for (let k = out.length + 1; !id; k++) if (!used.has(`filter${k}`)) id = `filter${k}`;
|
|
2733
|
+
used.add(id);
|
|
2734
|
+
const filter = createVectorFilter(r.type, id, _nullishCoalesce(r.params, () => ( {})));
|
|
2735
|
+
out.push(r.enabled === false ? { ...filter, enabled: false } : filter);
|
|
2736
|
+
}
|
|
2737
|
+
return out;
|
|
2738
|
+
}
|
|
2739
|
+
function activeVectorFilters(node) {
|
|
2740
|
+
return (_nullishCoalesce(node.filters, () => ( []))).filter((f) => {
|
|
2741
|
+
if (f.enabled === false || !isVectorFilterType(f.type)) return false;
|
|
2742
|
+
if (f.type === "layerBlur" || f.type === "feather") return f.params.radius > 0;
|
|
2743
|
+
return f.params.opacity > 0;
|
|
2744
|
+
});
|
|
2745
|
+
}
|
|
2746
|
+
function vectorFilterReach(filters) {
|
|
2747
|
+
let outer = 0;
|
|
2748
|
+
let blur = 0;
|
|
2749
|
+
for (const f of filters) {
|
|
2750
|
+
switch (f.type) {
|
|
2751
|
+
case "dropShadow":
|
|
2752
|
+
case "innerShadow":
|
|
2753
|
+
outer = Math.max(outer, Math.max(Math.abs(f.params.offsetX), Math.abs(f.params.offsetY)) + f.params.blur * 1.5 + f.params.spread);
|
|
2754
|
+
break;
|
|
2755
|
+
case "outerGlow":
|
|
2756
|
+
case "innerGlow":
|
|
2757
|
+
outer = Math.max(outer, f.params.blur * 1.5 + f.params.spread);
|
|
2758
|
+
break;
|
|
2759
|
+
case "layerBlur":
|
|
2760
|
+
blur += f.params.radius * 1.5;
|
|
2761
|
+
break;
|
|
2762
|
+
}
|
|
2763
|
+
}
|
|
2764
|
+
return outer + blur;
|
|
2765
|
+
}
|
|
2766
|
+
var round = (n) => Math.round(n * 1e3) / 1e3;
|
|
2767
|
+
var fe = (tag, attrs, children) => ({ tag, attrs, ...children ? { children } : {} });
|
|
2768
|
+
function vectorFilterSvg(filters, id, bounds) {
|
|
2769
|
+
const active = filters.filter((f) => activeVectorFilters({ filters: [f] }).length);
|
|
2770
|
+
if (!active.length || !bounds) return null;
|
|
2771
|
+
const primitives = [];
|
|
2772
|
+
let body = "SourceGraphic";
|
|
2773
|
+
let n = 0;
|
|
2774
|
+
const name = (part) => `${part}${n}`;
|
|
2775
|
+
for (const f of active) {
|
|
2776
|
+
if (f.type !== "innerShadow" && f.type !== "innerGlow") continue;
|
|
2777
|
+
n++;
|
|
2778
|
+
const p = f.params;
|
|
2779
|
+
primitives.push(fe("feComponentTransfer", { in: "SourceAlpha", result: name("inv") }, [fe("feFuncA", { type: "table", tableValues: "1 0" })]));
|
|
2780
|
+
let last = name("inv");
|
|
2781
|
+
if (f.type === "innerShadow" && (f.params.offsetX || f.params.offsetY)) {
|
|
2782
|
+
primitives.push(fe("feOffset", { in: last, dx: round(f.params.offsetX), dy: round(f.params.offsetY), result: name("off") }));
|
|
2783
|
+
last = name("off");
|
|
2784
|
+
}
|
|
2785
|
+
if (p.spread > 0) {
|
|
2786
|
+
primitives.push(fe("feMorphology", { in: last, operator: "dilate", radius: round(p.spread), result: name("grow") }));
|
|
2787
|
+
last = name("grow");
|
|
2788
|
+
}
|
|
2789
|
+
if (p.blur > 0) {
|
|
2790
|
+
primitives.push(fe("feGaussianBlur", { in: last, stdDeviation: round(p.blur / 2), result: name("blur") }));
|
|
2791
|
+
last = name("blur");
|
|
2792
|
+
}
|
|
2793
|
+
primitives.push(fe("feFlood", { "flood-color": p.color, "flood-opacity": round(p.opacity), result: name("color") }));
|
|
2794
|
+
primitives.push(fe("feComposite", { in: name("color"), in2: last, operator: "in", result: name("tint") }));
|
|
2795
|
+
primitives.push(fe("feComposite", { in: name("tint"), in2: "SourceAlpha", operator: "in", result: name("inner") }));
|
|
2796
|
+
primitives.push(fe("feComposite", { in: name("inner"), in2: body, operator: "over", result: name("body") }));
|
|
2797
|
+
body = name("body");
|
|
2798
|
+
}
|
|
2799
|
+
for (const f of active) {
|
|
2800
|
+
if (f.type !== "feather") continue;
|
|
2801
|
+
n++;
|
|
2802
|
+
const r = f.params.radius;
|
|
2803
|
+
primitives.push(fe("feMorphology", { in: "SourceAlpha", operator: "erode", radius: round(r / 2), result: name("core") }));
|
|
2804
|
+
primitives.push(fe("feGaussianBlur", { in: name("core"), stdDeviation: round(r / 4), result: name("fade") }));
|
|
2805
|
+
primitives.push(fe("feComposite", { in: body, in2: name("fade"), operator: "in", result: name("body") }));
|
|
2806
|
+
body = name("body");
|
|
2807
|
+
}
|
|
2808
|
+
const under = [];
|
|
2809
|
+
for (const f of active) {
|
|
2810
|
+
if (f.type !== "dropShadow" && f.type !== "outerGlow") continue;
|
|
2811
|
+
n++;
|
|
2812
|
+
const p = f.params;
|
|
2813
|
+
let last = "SourceAlpha";
|
|
2814
|
+
if (p.spread > 0) {
|
|
2815
|
+
primitives.push(fe("feMorphology", { in: last, operator: "dilate", radius: round(p.spread), result: name("grow") }));
|
|
2816
|
+
last = name("grow");
|
|
2817
|
+
}
|
|
2818
|
+
if (p.blur > 0) {
|
|
2819
|
+
primitives.push(fe("feGaussianBlur", { in: last, stdDeviation: round(p.blur / 2), result: name("blur") }));
|
|
2820
|
+
last = name("blur");
|
|
2821
|
+
}
|
|
2822
|
+
if (f.type === "dropShadow" && (f.params.offsetX || f.params.offsetY)) {
|
|
2823
|
+
primitives.push(fe("feOffset", { in: last, dx: round(f.params.offsetX), dy: round(f.params.offsetY), result: name("off") }));
|
|
2824
|
+
last = name("off");
|
|
2825
|
+
}
|
|
2826
|
+
primitives.push(fe("feFlood", { "flood-color": p.color, "flood-opacity": round(p.opacity), result: name("color") }));
|
|
2827
|
+
primitives.push(fe("feComposite", { in: name("color"), in2: last, operator: "in", result: name("shadow") }));
|
|
2828
|
+
under.push(name("shadow"));
|
|
2829
|
+
}
|
|
2830
|
+
if (under.length) {
|
|
2831
|
+
n++;
|
|
2832
|
+
primitives.push(fe("feMerge", { result: name("merged") }, [...under, body].map((i) => fe("feMergeNode", { in: i }))));
|
|
2833
|
+
body = name("merged");
|
|
2834
|
+
}
|
|
2835
|
+
for (const f of active) {
|
|
2836
|
+
if (f.type !== "layerBlur") continue;
|
|
2837
|
+
n++;
|
|
2838
|
+
primitives.push(fe("feGaussianBlur", { in: body, stdDeviation: round(f.params.radius / 2), result: name("body") }));
|
|
2839
|
+
body = name("body");
|
|
2840
|
+
}
|
|
2841
|
+
const lastResult = _optionalChain([primitives, 'access', _44 => _44[primitives.length - 1], 'optionalAccess', _45 => _45.attrs, 'access', _46 => _46.result]);
|
|
2842
|
+
if (lastResult !== body) primitives.push(fe("feMerge", {}, [fe("feMergeNode", { in: body })]));
|
|
2843
|
+
const pad = vectorFilterReach(active) + 2;
|
|
2844
|
+
return {
|
|
2845
|
+
id,
|
|
2846
|
+
x: round(bounds.x - pad),
|
|
2847
|
+
y: round(bounds.y - pad),
|
|
2848
|
+
width: round(bounds.width + 2 * pad),
|
|
2849
|
+
height: round(bounds.height + 2 * pad),
|
|
2850
|
+
primitives
|
|
2851
|
+
};
|
|
2852
|
+
}
|
|
2853
|
+
var escapeAttr = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
2854
|
+
function primitiveMarkup(p) {
|
|
2855
|
+
const attrs = Object.entries(p.attrs).map(([k, v2]) => ` ${k}="${escapeAttr(String(v2))}"`).join("");
|
|
2856
|
+
return _optionalChain([p, 'access', _47 => _47.children, 'optionalAccess', _48 => _48.length]) ? `<${p.tag}${attrs}>${p.children.map(primitiveMarkup).join("")}</${p.tag}>` : `<${p.tag}${attrs}/>`;
|
|
2857
|
+
}
|
|
2858
|
+
function vectorFilterMarkup(filter, extra = "") {
|
|
2859
|
+
return `<filter id="${escapeAttr(filter.id)}" filterUnits="userSpaceOnUse" x="${filter.x}" y="${filter.y}" width="${filter.width}" height="${filter.height}" color-interpolation-filters="sRGB"${extra}>${filter.primitives.map(primitiveMarkup).join("")}</filter>`;
|
|
2860
|
+
}
|
|
2861
|
+
var VECTOR_FILTER_MENU = VECTOR_FILTER_TYPES.map((type) => ({ type, label: VECTOR_FILTER_LABELS[type] }));
|
|
2862
|
+
|
|
2863
|
+
// src/vector/mask.ts
|
|
2864
|
+
function isVectorMaskType(value) {
|
|
2865
|
+
return typeof value === "string" && VECTOR_MASK_TYPES.includes(value);
|
|
2866
|
+
}
|
|
2867
|
+
function sanitizeVectorMask(value) {
|
|
2868
|
+
if (!value || typeof value !== "object") return null;
|
|
2869
|
+
const r = value;
|
|
2870
|
+
if (!isVectorMaskType(r.type)) return null;
|
|
2871
|
+
return r.invert === true ? { type: r.type, invert: true } : { type: r.type };
|
|
2872
|
+
}
|
|
2873
|
+
function isVectorMaskGroup(node) {
|
|
2874
|
+
return _optionalChain([node, 'optionalAccess', _49 => _49.type]) === "group" && !!node.mask && isVectorMaskType(node.mask.type) && !node.blend && !node.liveBoolean && node.children.length > 0;
|
|
2875
|
+
}
|
|
2876
|
+
function isVectorMaskActive(node) {
|
|
2877
|
+
return isVectorMaskGroup(node) && node.children[0].visible !== false;
|
|
2878
|
+
}
|
|
2879
|
+
function vectorMaskSource(node) {
|
|
2880
|
+
return isVectorMaskGroup(node) ? node.children[0] : null;
|
|
2881
|
+
}
|
|
2882
|
+
function vectorMaskContents(group) {
|
|
2883
|
+
return isVectorMaskGroup(group) ? group.children.slice(1) : group.children;
|
|
2884
|
+
}
|
|
2885
|
+
function vectorMaskOwner(nodes, id) {
|
|
2886
|
+
for (const n of nodes) {
|
|
2887
|
+
if (n.type !== "group") continue;
|
|
2888
|
+
if (isVectorMaskGroup(n) && n.children[0].id === id) return n;
|
|
2889
|
+
const inner = vectorMaskOwner(n.children, id);
|
|
2890
|
+
if (inner) return inner;
|
|
2891
|
+
}
|
|
2892
|
+
return null;
|
|
2893
|
+
}
|
|
2894
|
+
function vectorMaskSummary(node) {
|
|
2895
|
+
if (!isVectorMaskGroup(node)) return null;
|
|
2896
|
+
return {
|
|
2897
|
+
type: node.mask.type,
|
|
2898
|
+
invert: !!node.mask.invert,
|
|
2899
|
+
maskId: node.children[0].id,
|
|
2900
|
+
contents: node.children.slice(1).map((c) => c.id),
|
|
2901
|
+
enabled: node.children[0].visible !== false
|
|
2902
|
+
};
|
|
2903
|
+
}
|
|
2904
|
+
var place = (path, m) => _chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m) ? path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, m);
|
|
2905
|
+
function vectorMaskRegionShapes(node, type, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX, self = true) {
|
|
2906
|
+
if (!self && node.visible === false) return [];
|
|
2907
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
2908
|
+
if (isVectorMaskActive(node) || node.type === "group" && _optionalChain([node, 'access', _50 => _50.effects, 'optionalAccess', _51 => _51.length])) {
|
|
2909
|
+
return vectorAppearanceShapes(node).flatMap((s) => regionOfPath(s.path, s.source, type, m));
|
|
2910
|
+
}
|
|
2911
|
+
const drawn = expandVectorAppearance(node);
|
|
2912
|
+
if (drawn.type === "group") {
|
|
2913
|
+
const inner = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(drawn), parent);
|
|
2914
|
+
return drawn.children.flatMap((c) => vectorMaskRegionShapes(c, type, inner, false));
|
|
2915
|
+
}
|
|
2916
|
+
return regionOfPath(subpathsToBezier(drawn.subpaths), drawn, type, m);
|
|
2917
|
+
}
|
|
2918
|
+
function regionOfPath(path, style, type, m) {
|
|
2919
|
+
if (!path.length) return [];
|
|
2920
|
+
const fillRule = _nullishCoalesce(style.fillRule, () => ( "nonzero"));
|
|
2921
|
+
if (type === "clip") return [{ path: place(path, m), fillRule }];
|
|
2922
|
+
const out = [];
|
|
2923
|
+
let filled = false;
|
|
2924
|
+
for (const l of vectorPaintLayerNodes(style)) {
|
|
2925
|
+
if (!l.drawn) continue;
|
|
2926
|
+
if (l.kind === "fill") {
|
|
2927
|
+
if (!filled) out.push({ path: place(path, m), fillRule });
|
|
2928
|
+
filled = true;
|
|
2929
|
+
} else if ((_nullishCoalesce(l.node.strokeWidth, () => ( 1))) > 0) {
|
|
2930
|
+
const area = vectorStrokeOutlinePath(path, l.node);
|
|
2931
|
+
if (area.length) out.push({ path: place(area, m), fillRule: "nonzero" });
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
return out;
|
|
2935
|
+
}
|
|
2936
|
+
var regionCache = /* @__PURE__ */ new WeakMap();
|
|
2937
|
+
function vectorMaskRegion(group) {
|
|
2938
|
+
let hit = regionCache.get(group);
|
|
2939
|
+
if (!hit) {
|
|
2940
|
+
hit = vectorMaskRegionShapes(group.children[0], group.mask.type);
|
|
2941
|
+
regionCache.set(group, hit);
|
|
2942
|
+
}
|
|
2943
|
+
return hit;
|
|
2944
|
+
}
|
|
2945
|
+
var unionCache = /* @__PURE__ */ new WeakMap();
|
|
2946
|
+
function vectorMaskRegionPath(group) {
|
|
2947
|
+
let hit = unionCache.get(group);
|
|
2948
|
+
if (!hit) {
|
|
2949
|
+
const shapes = vectorMaskRegion(group);
|
|
2950
|
+
hit = !shapes.length ? [] : shapes.length === 1 && shapes[0].fillRule === "nonzero" ? shapes[0].path : _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "union", shapes.map((s) => ({ path: s.path, fillRule: s.fillRule }))).path;
|
|
2951
|
+
unionCache.set(group, hit);
|
|
2952
|
+
}
|
|
2953
|
+
return hit;
|
|
2954
|
+
}
|
|
2955
|
+
function inRegion(group, p, tolerance) {
|
|
2956
|
+
const pt2 = [p.x, p.y];
|
|
2957
|
+
for (const s of vectorMaskRegion(group)) {
|
|
2958
|
+
if (_chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, s.path, pt2, s.fillRule)) return true;
|
|
2959
|
+
if (tolerance > 0 && _chunkXGD3FSNCcjs.distanceToBezierPath.call(void 0, s.path, pt2) <= tolerance) return true;
|
|
2960
|
+
}
|
|
2961
|
+
return false;
|
|
2962
|
+
}
|
|
2963
|
+
function vectorMaskContains(group, p, tolerance = 0) {
|
|
2964
|
+
if (!isVectorMaskActive(group)) return true;
|
|
2965
|
+
if (group.mask.type !== "clip") {
|
|
2966
|
+
const source = group.children[0];
|
|
2967
|
+
const hit = hitTestVectorNode(source.visible === false ? { ...source, visible: true } : source, p, group.mask.invert ? 0 : tolerance);
|
|
2968
|
+
return group.mask.invert ? !hit || tolerance > 0 && hitNearEdge(group, p, tolerance) : hit;
|
|
2969
|
+
}
|
|
2970
|
+
if (!group.mask.invert) return inRegion(group, p, tolerance);
|
|
2971
|
+
return !inRegion(group, p, 0) || hitNearEdge(group, p, tolerance);
|
|
2972
|
+
}
|
|
2973
|
+
function hitNearEdge(group, p, tolerance) {
|
|
2974
|
+
if (tolerance <= 0) return false;
|
|
2975
|
+
return vectorMaskRegion(group).some((s) => _chunkXGD3FSNCcjs.distanceToBezierPath.call(void 0, s.path, [p.x, p.y]) <= tolerance);
|
|
2976
|
+
}
|
|
2977
|
+
function clipOpen(path, region, invert2) {
|
|
2978
|
+
const out = [];
|
|
2979
|
+
for (const sp of bezierToSubpaths(path)) {
|
|
2980
|
+
const pieces = eraseFromOutline(sp, region, { keep: invert2 ? "outside" : "inside" });
|
|
2981
|
+
if (pieces === null) {
|
|
2982
|
+
const a = sp.anchors[0];
|
|
2983
|
+
const inside = !!a && _chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, region, [a.x, a.y], "nonzero");
|
|
2984
|
+
if (inside !== invert2) out.push(...subpathsToBezier([sp]));
|
|
2985
|
+
} else out.push(...subpathsToBezier(pieces));
|
|
2986
|
+
}
|
|
2987
|
+
return out;
|
|
2988
|
+
}
|
|
2989
|
+
function clipShapePath(path, fillRule, region, invert2) {
|
|
2990
|
+
const subpaths = bezierToSubpaths(path);
|
|
2991
|
+
const closed = subpaths.filter((sp) => sp.closed);
|
|
2992
|
+
const open = subpaths.filter((sp) => !sp.closed);
|
|
2993
|
+
const out = [];
|
|
2994
|
+
if (closed.length) {
|
|
2995
|
+
const operands = [{ path: subpathsToBezier(closed), fillRule }, { path: region, fillRule: "nonzero" }];
|
|
2996
|
+
out.push(...region.length ? _chunkXGD3FSNCcjs.pathBoolean.call(void 0, invert2 ? "difference" : "intersection", operands).path : invert2 ? operands[0].path : []);
|
|
2997
|
+
}
|
|
2998
|
+
if (open.length) out.push(...region.length ? clipOpen(subpathsToBezier(open), region, invert2) : invert2 ? subpathsToBezier(open) : []);
|
|
2999
|
+
return out;
|
|
3000
|
+
}
|
|
3001
|
+
function vectorMaskedShapes(group) {
|
|
3002
|
+
const contents = group.children.flatMap((c, i) => i === 0 ? [] : vectorChildAppearanceShapes(c, i));
|
|
3003
|
+
const shapes = applyVectorEffects(contents, group.effects);
|
|
3004
|
+
if (!isVectorMaskActive(group)) return shapes;
|
|
3005
|
+
const region = vectorMaskRegionPath(group);
|
|
3006
|
+
const invert2 = !!group.mask.invert;
|
|
3007
|
+
const out = [];
|
|
3008
|
+
for (const s of shapes) {
|
|
3009
|
+
const path = clipShapePath(s.path, _nullishCoalesce(s.source.fillRule, () => ( "nonzero")), region, invert2);
|
|
3010
|
+
if (path.length) out.push({ ...s, path, source: s.source.fillRule === "evenodd" ? { ...s.source, fillRule: "nonzero" } : s.source });
|
|
3011
|
+
}
|
|
3012
|
+
return out;
|
|
3013
|
+
}
|
|
3014
|
+
function vectorMaskedGeometry(node) {
|
|
3015
|
+
if (node.type !== "group") return node;
|
|
3016
|
+
if (isVectorMaskActive(node)) {
|
|
3017
|
+
return {
|
|
3018
|
+
id: node.id,
|
|
3019
|
+
type: "group",
|
|
3020
|
+
...node.transform ? { transform: node.transform } : {},
|
|
3021
|
+
...node.opacity !== void 0 ? { opacity: node.opacity } : {},
|
|
3022
|
+
...node.visible === false ? { visible: false } : {},
|
|
3023
|
+
...node.locked ? { locked: true } : {},
|
|
3024
|
+
children: vectorAppearanceNodes(node)
|
|
3025
|
+
};
|
|
3026
|
+
}
|
|
3027
|
+
let changed = false;
|
|
3028
|
+
const children = node.children.map((c) => {
|
|
3029
|
+
const next = vectorMaskedGeometry(c);
|
|
3030
|
+
if (next !== c) changed = true;
|
|
3031
|
+
return next;
|
|
3032
|
+
});
|
|
3033
|
+
return changed ? { ...node, children } : node;
|
|
3034
|
+
}
|
|
3035
|
+
function vectorMaskedLocalBounds(group) {
|
|
3036
|
+
const b = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, vectorAppearanceShapes(group).flatMap((s) => s.path));
|
|
3037
|
+
return b ? { x: b.minX, y: b.minY, width: b.maxX - b.minX, height: b.maxY - b.minY } : null;
|
|
3038
|
+
}
|
|
3039
|
+
function paintReach(node) {
|
|
3040
|
+
const own = vectorFilterReach(activeVectorFilters(node));
|
|
3041
|
+
if (node.type === "path") return own + vectorStrokeStackReach(node);
|
|
3042
|
+
return own + Math.max(0, ...node.children.map(paintReach));
|
|
3043
|
+
}
|
|
3044
|
+
function vectorMaskContentBounds(group) {
|
|
3045
|
+
const contents = group.children.slice(1);
|
|
3046
|
+
const b = unionBounds(contents.map((c) => vectorNodeBounds(c, _chunkDWGZUSEScjs.IDENTITY_MATRIX)));
|
|
3047
|
+
if (!b) return null;
|
|
3048
|
+
const pad = Math.max(0, ...contents.map(paintReach)) + Math.max(b.width, b.height) * 0.05 + 4;
|
|
3049
|
+
return { x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad };
|
|
3050
|
+
}
|
|
3051
|
+
var fe2 = (tag, attrs) => ({ tag, attrs });
|
|
3052
|
+
var LUMA = "-0.2125 -0.7154 -0.0721 0 1";
|
|
3053
|
+
function invertFilter(type, id, bounds) {
|
|
3054
|
+
const primitives = type === "alpha" ? [fe2("feColorMatrix", { in: "SourceGraphic", type: "matrix", values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1" })] : [
|
|
3055
|
+
// Over black first, so a transparent area reads as dark (hidden) before inverting.
|
|
3056
|
+
fe2("feFlood", { "flood-color": "#000000", result: "black" }),
|
|
3057
|
+
fe2("feComposite", { in: "SourceGraphic", in2: "black", operator: "over", result: "flat" }),
|
|
3058
|
+
fe2("feColorMatrix", { in: "flat", type: "matrix", values: `${LUMA} ${LUMA} ${LUMA} 0 0 0 0 1` })
|
|
3059
|
+
];
|
|
3060
|
+
const r = (n) => Math.round(n * 1e3) / 1e3;
|
|
3061
|
+
return { id, x: r(bounds.x), y: r(bounds.y), width: r(bounds.width), height: r(bounds.height), primitives };
|
|
3062
|
+
}
|
|
3063
|
+
var rectPath = (b) => [
|
|
3064
|
+
{ type: "M", x: b.x, y: b.y },
|
|
3065
|
+
{ type: "L", x: b.x + b.width, y: b.y },
|
|
3066
|
+
{ type: "L", x: b.x + b.width, y: b.y + b.height },
|
|
3067
|
+
{ type: "L", x: b.x, y: b.y + b.height },
|
|
3068
|
+
{ type: "Z" }
|
|
3069
|
+
];
|
|
3070
|
+
function vectorMaskRenderData(group, id, filterId, precision = 3) {
|
|
3071
|
+
if (!isVectorMaskActive(group) || group.children.length < 2) return null;
|
|
3072
|
+
const invert2 = !!group.mask.invert;
|
|
3073
|
+
const bounds = vectorMaskContentBounds(group);
|
|
3074
|
+
if (group.mask.type === "clip") {
|
|
3075
|
+
const shapes = vectorMaskRegion(group);
|
|
3076
|
+
if (!invert2) return { type: "clip", invert: invert2, id, clip: shapes.map((s) => ({ d: _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, s.path, { precision }), clipRule: s.fillRule })) };
|
|
3077
|
+
const box = _nullishCoalesce(bounds, () => ( { x: 0, y: 0, width: 0, height: 0 }));
|
|
3078
|
+
const region = vectorMaskRegionPath(group);
|
|
3079
|
+
return { type: "clip", invert: invert2, id, clip: [{ d: _chunkXGD3FSNCcjs.bezierPathToSvg.call(void 0, [...rectPath(box), ...region], { precision }), clipRule: "evenodd" }] };
|
|
3080
|
+
}
|
|
3081
|
+
if (!bounds) return null;
|
|
3082
|
+
if (!invert2) return { type: group.mask.type, invert: invert2, id, bounds };
|
|
3083
|
+
const filter = invertFilter(group.mask.type, filterId, bounds);
|
|
3084
|
+
return { type: group.mask.type, invert: invert2, id, bounds, filter: `url(#${filterId})`, invertFilter: filter };
|
|
3085
|
+
}
|
|
3086
|
+
|
|
3087
|
+
// src/vector/warp.ts
|
|
3088
|
+
function polylineAt(pts) {
|
|
3089
|
+
const acc = [0];
|
|
3090
|
+
for (let i = 1; i < pts.length; i++) acc.push(acc[i - 1] + Math.hypot(pts[i].x - pts[i - 1].x, pts[i].y - pts[i - 1].y));
|
|
3091
|
+
const total = acc[acc.length - 1];
|
|
3092
|
+
return (u) => {
|
|
3093
|
+
if (!(total > 0)) return pts[0];
|
|
3094
|
+
const L = Math.min(1, Math.max(0, u)) * total;
|
|
3095
|
+
let i = 1;
|
|
3096
|
+
while (i < acc.length - 1 && acc[i] < L) i++;
|
|
3097
|
+
const seg = acc[i] - acc[i - 1];
|
|
3098
|
+
return _chunkDWGZUSEScjs.lerpVec2.call(void 0, pts[i - 1], pts[i], seg > 0 ? (L - acc[i - 1]) / seg : 0);
|
|
3099
|
+
};
|
|
3100
|
+
}
|
|
3101
|
+
function sampleSubpath(sp, per = 24) {
|
|
3102
|
+
const n = sp.anchors.length;
|
|
3103
|
+
const out = [];
|
|
3104
|
+
for (let i = 0; i < n; i++) {
|
|
3105
|
+
const a = sp.anchors[i];
|
|
3106
|
+
const b = sp.anchors[(i + 1) % n];
|
|
3107
|
+
const c = [{ x: a.x, y: a.y }, _nullishCoalesce(a.out, () => ( a)), _nullishCoalesce(b.in, () => ( b)), { x: b.x, y: b.y }];
|
|
3108
|
+
for (let k = 0; k < per; k++) {
|
|
3109
|
+
const t = k / per;
|
|
3110
|
+
const ab = _chunkDWGZUSEScjs.lerpVec2.call(void 0, c[0], c[1], t);
|
|
3111
|
+
const bc = _chunkDWGZUSEScjs.lerpVec2.call(void 0, c[1], c[2], t);
|
|
3112
|
+
const cd = _chunkDWGZUSEScjs.lerpVec2.call(void 0, c[2], c[3], t);
|
|
3113
|
+
out.push(_chunkDWGZUSEScjs.lerpVec2.call(void 0, _chunkDWGZUSEScjs.lerpVec2.call(void 0, ab, bc, t), _chunkDWGZUSEScjs.lerpVec2.call(void 0, bc, cd, t), t));
|
|
3114
|
+
}
|
|
3115
|
+
}
|
|
3116
|
+
return out;
|
|
3117
|
+
}
|
|
3118
|
+
function vectorMeshFromOutline(sp, columns = 4, rows = 4) {
|
|
3119
|
+
if (!sp.closed || sp.anchors.length < 2) return null;
|
|
3120
|
+
let ring = sampleSubpath(sp);
|
|
3121
|
+
const xs = ring.map((p) => p.x);
|
|
3122
|
+
const ys = ring.map((p) => p.y);
|
|
3123
|
+
const box = { x0: Math.min(...xs), y0: Math.min(...ys), x1: Math.max(...xs), y1: Math.max(...ys) };
|
|
3124
|
+
if (!(box.x1 - box.x0 > 1e-9 && box.y1 - box.y0 > 1e-9)) return null;
|
|
3125
|
+
const nearest = (c2) => {
|
|
3126
|
+
let best = 0;
|
|
3127
|
+
for (let i = 1; i < ring.length; i++) if (Math.hypot(ring[i].x - c2.x, ring[i].y - c2.y) < Math.hypot(ring[best].x - c2.x, ring[best].y - c2.y)) best = i;
|
|
3128
|
+
return best;
|
|
3129
|
+
};
|
|
3130
|
+
const cornersOf = () => [
|
|
3131
|
+
{ x: box.x0, y: box.y0 },
|
|
3132
|
+
{ x: box.x1, y: box.y0 },
|
|
3133
|
+
{ x: box.x1, y: box.y1 },
|
|
3134
|
+
{ x: box.x0, y: box.y1 }
|
|
3135
|
+
].map(nearest);
|
|
3136
|
+
let c = cornersOf();
|
|
3137
|
+
const n = ring.length;
|
|
3138
|
+
const fwd = (from, to) => (to - from + n) % n;
|
|
3139
|
+
if (!(fwd(c[0], c[1]) < fwd(c[0], c[2]) && fwd(c[0], c[2]) < fwd(c[0], c[3]))) {
|
|
3140
|
+
ring = ring.slice().reverse();
|
|
3141
|
+
c = cornersOf();
|
|
3142
|
+
if (!(fwd(c[0], c[1]) < fwd(c[0], c[2]) && fwd(c[0], c[2]) < fwd(c[0], c[3]))) return null;
|
|
3143
|
+
}
|
|
3144
|
+
if (new Set(c).size < 4) return null;
|
|
3145
|
+
const walk = (from, to) => {
|
|
3146
|
+
const out = [];
|
|
3147
|
+
for (let i = from; ; i = (i + 1) % n) {
|
|
3148
|
+
out.push(ring[i]);
|
|
3149
|
+
if (i === to) break;
|
|
3150
|
+
}
|
|
3151
|
+
return out;
|
|
3152
|
+
};
|
|
3153
|
+
const top = polylineAt(walk(c[0], c[1]));
|
|
3154
|
+
const right = polylineAt(walk(c[1], c[2]));
|
|
3155
|
+
const bottomLR = polylineAt(walk(c[2], c[3]).reverse());
|
|
3156
|
+
const leftTB = polylineAt(walk(c[3], c[0]).reverse());
|
|
3157
|
+
const p00 = top(0);
|
|
3158
|
+
const p10 = top(1);
|
|
3159
|
+
const p01 = bottomLR(0);
|
|
3160
|
+
const p11 = bottomLR(1);
|
|
3161
|
+
const coons = (s, t) => {
|
|
3162
|
+
const T = top(s);
|
|
3163
|
+
const B = bottomLR(s);
|
|
3164
|
+
const L = leftTB(t);
|
|
3165
|
+
const R = right(t);
|
|
3166
|
+
return {
|
|
3167
|
+
x: (1 - t) * T.x + t * B.x + (1 - s) * L.x + s * R.x - ((1 - s) * (1 - t) * p00.x + s * (1 - t) * p10.x + (1 - s) * t * p01.x + s * t * p11.x),
|
|
3168
|
+
y: (1 - t) * T.y + t * B.y + (1 - s) * L.y + s * R.y - ((1 - s) * (1 - t) * p00.y + s * (1 - t) * p10.y + (1 - s) * t * p01.y + s * t * p11.y)
|
|
3169
|
+
};
|
|
3170
|
+
};
|
|
3171
|
+
return _chunkDWGZUSEScjs.fitWarpMesh.call(void 0, coons, _chunkDWGZUSEScjs.evenKnots.call(void 0, _chunkDWGZUSEScjs.clampMeshCount.call(void 0, columns)), _chunkDWGZUSEScjs.evenKnots.call(void 0, _chunkDWGZUSEScjs.clampMeshCount.call(void 0, rows)));
|
|
3172
|
+
}
|
|
3173
|
+
function vectorMeshOutline(m) {
|
|
3174
|
+
const nx = _chunkDWGZUSEScjs.warpMeshColumns.call(void 0, m);
|
|
3175
|
+
const ny = _chunkDWGZUSEScjs.warpMeshRows.call(void 0, m);
|
|
3176
|
+
const pt2 = (i, j) => m.points[j * nx + i];
|
|
3177
|
+
const runs = [];
|
|
3178
|
+
for (let i = 0; i + 3 < nx; i += 3) runs.push([pt2(i, 0), pt2(i + 1, 0), pt2(i + 2, 0), pt2(i + 3, 0)]);
|
|
3179
|
+
for (let j = 0; j + 3 < ny; j += 3) runs.push([pt2(nx - 1, j), pt2(nx - 1, j + 1), pt2(nx - 1, j + 2), pt2(nx - 1, j + 3)]);
|
|
3180
|
+
for (let i = nx - 1; i - 3 >= 0; i -= 3) runs.push([pt2(i, ny - 1), pt2(i - 1, ny - 1), pt2(i - 2, ny - 1), pt2(i - 3, ny - 1)]);
|
|
3181
|
+
for (let j = ny - 1; j - 3 >= 0; j -= 3) runs.push([pt2(0, j), pt2(0, j - 1), pt2(0, j - 2), pt2(0, j - 3)]);
|
|
3182
|
+
const anchors = runs.map((r, k) => {
|
|
3183
|
+
const prev = runs[(k + runs.length - 1) % runs.length];
|
|
3184
|
+
return { x: r[0].x, y: r[0].y, in: { ...prev[2] }, out: { ...r[1] } };
|
|
3185
|
+
});
|
|
3186
|
+
return { closed: true, anchors };
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
// src/vector/appearance.ts
|
|
3190
|
+
var VECTOR_EFFECT_DEFAULTS = {
|
|
3191
|
+
trim: { start: 0, end: 50, offset: 0, mode: "simultaneous" },
|
|
3192
|
+
roundCorners: { radius: 10 },
|
|
3193
|
+
puckerBloat: { amount: 30 },
|
|
3194
|
+
twist: { angle: 45, center: { x: 0, y: 0 } },
|
|
3195
|
+
zigzag: { size: 5, ridges: 4, smooth: false },
|
|
3196
|
+
wiggle: { size: 5, detail: 6, smooth: true, speed: 2, correlation: 50, phase: 0, seed: 1, time: 0 },
|
|
3197
|
+
offset: { amount: 5, join: "miter", miterLimit: 4, copies: 1, copyOffset: 0 },
|
|
3198
|
+
merge: { mode: "add" },
|
|
3199
|
+
repeater: {
|
|
3200
|
+
copies: 3,
|
|
3201
|
+
offset: 0,
|
|
3202
|
+
position: { x: 100, y: 0 },
|
|
3203
|
+
anchor: { x: 0, y: 0 },
|
|
3204
|
+
rotation: 0,
|
|
3205
|
+
scale: { x: 100, y: 100 },
|
|
3206
|
+
startOpacity: 100,
|
|
3207
|
+
endOpacity: 100,
|
|
3208
|
+
composite: "below"
|
|
3209
|
+
},
|
|
3210
|
+
envelope: { style: "arc", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", rows: 2, columns: 2, mesh: null }
|
|
3211
|
+
};
|
|
3212
|
+
var VECTOR_EFFECT_LABELS = {
|
|
3213
|
+
trim: "Trim Paths",
|
|
3214
|
+
roundCorners: "Round Corners",
|
|
3215
|
+
puckerBloat: "Pucker & Bloat",
|
|
3216
|
+
twist: "Twist",
|
|
3217
|
+
zigzag: "Zig Zag",
|
|
3218
|
+
wiggle: "Wiggle Paths",
|
|
3219
|
+
offset: "Offset Paths",
|
|
3220
|
+
merge: "Merge Paths",
|
|
3221
|
+
repeater: "Repeater",
|
|
3222
|
+
envelope: "Envelope"
|
|
3223
|
+
};
|
|
3224
|
+
var VECTOR_EFFECT_PARAM_SPECS = {
|
|
3225
|
+
trim: [
|
|
3226
|
+
{ key: "start", label: "Start %", kind: "number", min: 0, max: 100, step: 1, slider: true },
|
|
3227
|
+
{ key: "end", label: "End %", kind: "number", min: 0, max: 100, step: 1, slider: true },
|
|
3228
|
+
{ key: "offset", label: "Offset \xB0", kind: "number", min: -360, max: 360, step: 1, slider: true },
|
|
3229
|
+
{
|
|
3230
|
+
key: "mode",
|
|
3231
|
+
label: "Paths",
|
|
3232
|
+
kind: "select",
|
|
3233
|
+
options: [
|
|
3234
|
+
{ value: "simultaneous", label: "Simultaneously" },
|
|
3235
|
+
{ value: "individual", label: "Individually" }
|
|
3236
|
+
]
|
|
3237
|
+
}
|
|
3238
|
+
],
|
|
3239
|
+
roundCorners: [{ key: "radius", label: "Radius", kind: "number", min: 0, max: 200, step: 1, slider: true }],
|
|
3240
|
+
puckerBloat: [{ key: "amount", label: "Amount %", kind: "number", min: -100, max: 100, step: 1, slider: true }],
|
|
3241
|
+
twist: [
|
|
3242
|
+
{ key: "angle", label: "Angle \xB0", kind: "number", min: -720, max: 720, step: 1, slider: true },
|
|
3243
|
+
{ key: "center", label: "Centre", kind: "vec2", step: 1 }
|
|
3244
|
+
],
|
|
3245
|
+
zigzag: [
|
|
3246
|
+
{ key: "size", label: "Size", kind: "number", min: 0, max: 100, step: 0.5, slider: true },
|
|
3247
|
+
{ key: "ridges", label: "Ridges", kind: "number", min: 0, max: 50, step: 1, slider: true },
|
|
3248
|
+
{ key: "smooth", label: "Smooth", kind: "boolean" }
|
|
3249
|
+
],
|
|
3250
|
+
wiggle: [
|
|
3251
|
+
{ key: "size", label: "Size", kind: "number", min: 0, max: 100, step: 0.5, slider: true },
|
|
3252
|
+
{ key: "detail", label: "Detail", kind: "number", min: 0, max: 50, step: 1, slider: true },
|
|
3253
|
+
{ key: "smooth", label: "Smooth", kind: "boolean" },
|
|
3254
|
+
{ key: "correlation", label: "Correlation %", kind: "number", min: 0, max: 100, step: 1, slider: true },
|
|
3255
|
+
{ key: "speed", label: "Speed", kind: "number", min: 0, step: 0.1 },
|
|
3256
|
+
{ key: "phase", label: "Phase \xB0", kind: "number", step: 1 },
|
|
3257
|
+
{ key: "time", label: "Time (s)", kind: "number", min: 0, max: 10, step: 0.05, slider: true },
|
|
3258
|
+
{ key: "seed", label: "Seed", kind: "number", step: 1 }
|
|
3259
|
+
],
|
|
3260
|
+
offset: [
|
|
3261
|
+
{ key: "amount", label: "Amount", kind: "number", min: -100, max: 100, step: 0.5, slider: true },
|
|
3262
|
+
{
|
|
3263
|
+
key: "join",
|
|
3264
|
+
label: "Join",
|
|
3265
|
+
kind: "select",
|
|
3266
|
+
options: [
|
|
3267
|
+
{ value: "miter", label: "Miter" },
|
|
3268
|
+
{ value: "round", label: "Round" },
|
|
3269
|
+
{ value: "bevel", label: "Bevel" }
|
|
3270
|
+
]
|
|
3271
|
+
},
|
|
3272
|
+
{ key: "miterLimit", label: "Miter limit", kind: "number", min: 1, step: 0.5 },
|
|
3273
|
+
{ key: "copies", label: "Copies", kind: "number", min: 1, max: 20, step: 1 },
|
|
3274
|
+
{ key: "copyOffset", label: "Copy offset", kind: "number", step: 0.5 }
|
|
3275
|
+
],
|
|
3276
|
+
merge: [
|
|
3277
|
+
{
|
|
3278
|
+
key: "mode",
|
|
3279
|
+
label: "Mode",
|
|
3280
|
+
kind: "select",
|
|
3281
|
+
options: [
|
|
3282
|
+
{ value: "merge", label: "Merge" },
|
|
3283
|
+
{ value: "add", label: "Add" },
|
|
3284
|
+
{ value: "subtract", label: "Subtract" },
|
|
3285
|
+
{ value: "intersect", label: "Intersect" },
|
|
3286
|
+
{ value: "exclude", label: "Exclude" }
|
|
2521
3287
|
]
|
|
2522
3288
|
}
|
|
2523
3289
|
],
|
|
@@ -2604,7 +3370,7 @@ function normalizeVectorEffectParams(type, params, base) {
|
|
|
2604
3370
|
if (!defaults) return null;
|
|
2605
3371
|
const out = { ...defaults, ..._nullishCoalesce(base, () => ( {})) };
|
|
2606
3372
|
for (const spec of VECTOR_EFFECT_PARAM_SPECS[type]) {
|
|
2607
|
-
const v2 = _optionalChain([params, 'optionalAccess',
|
|
3373
|
+
const v2 = _optionalChain([params, 'optionalAccess', _52 => _52[spec.key]]);
|
|
2608
3374
|
if (v2 === void 0) continue;
|
|
2609
3375
|
if (spec.kind === "number" && typeof v2 === "number" && Number.isFinite(v2)) out[spec.key] = Math.min(_nullishCoalesce(spec.max, () => ( Infinity)), Math.max(_nullishCoalesce(spec.min, () => ( -Infinity)), v2));
|
|
2610
3376
|
else if (spec.kind === "boolean" && typeof v2 === "boolean") out[spec.key] = v2;
|
|
@@ -2615,7 +3381,7 @@ function normalizeVectorEffectParams(type, params, base) {
|
|
|
2615
3381
|
const o = out;
|
|
2616
3382
|
o.rows = Math.round(o.rows);
|
|
2617
3383
|
o.columns = Math.round(o.columns);
|
|
2618
|
-
const given = _optionalChain([params, 'optionalAccess',
|
|
3384
|
+
const given = _optionalChain([params, 'optionalAccess', _53 => _53.mesh]);
|
|
2619
3385
|
let mesh = given !== void 0 ? _chunkDWGZUSEScjs.isValidWarpMesh.call(void 0, given) ? cloneMesh(given) : null : o.mesh;
|
|
2620
3386
|
if (o.style !== "mesh") mesh = null;
|
|
2621
3387
|
if (mesh && given !== void 0) {
|
|
@@ -2632,10 +3398,10 @@ function createVectorEffect(type, id, params) {
|
|
|
2632
3398
|
}
|
|
2633
3399
|
var isEnabled = (e) => e.enabled !== false && !!VECTOR_EFFECT_DEFAULTS[e.type];
|
|
2634
3400
|
function activeVectorEffects(node) {
|
|
2635
|
-
return _nullishCoalesce(_optionalChain([node, 'access',
|
|
3401
|
+
return _nullishCoalesce(_optionalChain([node, 'access', _54 => _54.effects, 'optionalAccess', _55 => _55.filter, 'call', _56 => _56(isEnabled)]), () => ( []));
|
|
2636
3402
|
}
|
|
2637
3403
|
function hasOwnVectorAppearance(node) {
|
|
2638
|
-
return node.type === "group" && !!node.liveBoolean || !!_optionalChain([node, 'access',
|
|
3404
|
+
return node.type === "group" && !!node.liveBoolean || !!_optionalChain([node, 'access', _57 => _57.effects, 'optionalAccess', _58 => _58.some, 'call', _59 => _59(isEnabled)]);
|
|
2639
3405
|
}
|
|
2640
3406
|
var liveCache = /* @__PURE__ */ new WeakMap();
|
|
2641
3407
|
function hasVectorAppearance(node) {
|
|
@@ -2647,7 +3413,7 @@ function hasVectorAppearance(node) {
|
|
|
2647
3413
|
return v2;
|
|
2648
3414
|
}
|
|
2649
3415
|
function isVectorLiveBoolean(node) {
|
|
2650
|
-
return _optionalChain([node, 'optionalAccess',
|
|
3416
|
+
return _optionalChain([node, 'optionalAccess', _60 => _60.type]) === "group" && !!node.liveBoolean;
|
|
2651
3417
|
}
|
|
2652
3418
|
function vectorOperandOperation(group, child) {
|
|
2653
3419
|
return _nullishCoalesce(_nullishCoalesce(child.booleanOperation, () => ( group.liveBoolean)), () => ( "union"));
|
|
@@ -2764,7 +3530,7 @@ var compareOrder = (a, b) => {
|
|
|
2764
3530
|
for (let i = 0; i < n; i++) if (a[i] !== b[i]) return a[i] - b[i];
|
|
2765
3531
|
return a.length - b.length;
|
|
2766
3532
|
};
|
|
2767
|
-
var add3 = (a, b) => ({ x: a.x + (_nullishCoalesce(_optionalChain([b, 'optionalAccess',
|
|
3533
|
+
var add3 = (a, b) => ({ x: a.x + (_nullishCoalesce(_optionalChain([b, 'optionalAccess', _61 => _61.x]), () => ( 0))), y: a.y + (_nullishCoalesce(_optionalChain([b, 'optionalAccess', _62 => _62.y]), () => ( 0))) });
|
|
2768
3534
|
var mapPaths = (shapes, fn) => {
|
|
2769
3535
|
const out = fn(shapes.map((s) => s.path));
|
|
2770
3536
|
return shapes.map((s, i) => ({ ...s, path: _nullishCoalesce(out[i], () => ( [])) }));
|
|
@@ -2829,7 +3595,7 @@ function applyVectorEffects(shapes, effects) {
|
|
|
2829
3595
|
}
|
|
2830
3596
|
return list;
|
|
2831
3597
|
}
|
|
2832
|
-
function
|
|
3598
|
+
function vectorChildAppearanceShapes(child, index) {
|
|
2833
3599
|
if (child.visible === false) return [];
|
|
2834
3600
|
const m = child.transform;
|
|
2835
3601
|
const k = _nullishCoalesce(child.opacity, () => ( 1));
|
|
@@ -2844,7 +3610,7 @@ function liveBooleanShapes(group) {
|
|
|
2844
3610
|
const operands = [];
|
|
2845
3611
|
let source = null;
|
|
2846
3612
|
group.children.forEach((child, i) => {
|
|
2847
|
-
const shapes =
|
|
3613
|
+
const shapes = vectorChildAppearanceShapes(child, i);
|
|
2848
3614
|
if (!shapes.length) return;
|
|
2849
3615
|
source ??= shapes[0].source;
|
|
2850
3616
|
const path = shapes.length === 1 ? shapes[0].path : _chunkXGD3FSNCcjs.pathBoolean.call(void 0, "union", shapes.map((s) => ({ path: s.path, fillRule: _nullishCoalesce(s.source.fillRule, () => ( "nonzero")) }))).path;
|
|
@@ -2858,7 +3624,8 @@ var shapeCache = /* @__PURE__ */ new WeakMap();
|
|
|
2858
3624
|
function baseShapes(node) {
|
|
2859
3625
|
if (node.type === "path") return [{ source: node, path: subpathsToBezier(node.subpaths), opacity: 1, order: [] }];
|
|
2860
3626
|
if (node.liveBoolean) return liveBooleanShapes(node);
|
|
2861
|
-
return node.children.flatMap((c, i) =>
|
|
3627
|
+
if (isVectorMaskGroup(node)) return node.children.flatMap((c, i) => i === 0 ? [] : vectorChildAppearanceShapes(c, i));
|
|
3628
|
+
return node.children.flatMap((c, i) => vectorChildAppearanceShapes(c, i));
|
|
2862
3629
|
}
|
|
2863
3630
|
function vectorEffectInputPaths(node, effectId) {
|
|
2864
3631
|
const list = _nullishCoalesce(node.effects, () => ( []));
|
|
@@ -2871,10 +3638,10 @@ function vectorEffectInputBounds(node, effectId) {
|
|
|
2871
3638
|
return paths ? pathsBounds(paths) : null;
|
|
2872
3639
|
}
|
|
2873
3640
|
function vectorNodeEnvelope(node) {
|
|
2874
|
-
return _nullishCoalesce(_optionalChain([node, 'optionalAccess',
|
|
3641
|
+
return _nullishCoalesce(_optionalChain([node, 'optionalAccess', _63 => _63.effects, 'optionalAccess', _64 => _64.find, 'call', _65 => _65((e) => e.type === "envelope" && e.enabled !== false)]), () => ( null));
|
|
2875
3642
|
}
|
|
2876
3643
|
function vectorEnvelopeFrame(node, effectId) {
|
|
2877
|
-
const e = effectId ? _optionalChain([node, 'access',
|
|
3644
|
+
const e = effectId ? _optionalChain([node, 'access', _66 => _66.effects, 'optionalAccess', _67 => _67.find, 'call', _68 => _68((x) => x.id === effectId)]) : vectorNodeEnvelope(node);
|
|
2878
3645
|
if (!e || e.type !== "envelope") return null;
|
|
2879
3646
|
const bounds = vectorEffectInputBounds(node, e.id);
|
|
2880
3647
|
if (!bounds || !(bounds.width > 0 && bounds.height > 0)) return null;
|
|
@@ -2883,7 +3650,7 @@ function vectorEnvelopeFrame(node, effectId) {
|
|
|
2883
3650
|
function vectorAppearanceShapes(node) {
|
|
2884
3651
|
const hit = shapeCache.get(node);
|
|
2885
3652
|
if (hit) return hit;
|
|
2886
|
-
const out = applyVectorEffects(baseShapes(node), node.effects).sort((a, b) => compareOrder(a.order, b.order));
|
|
3653
|
+
const out = (isVectorMaskGroup(node) ? vectorMaskedShapes(node) : applyVectorEffects(baseShapes(node), node.effects)).sort((a, b) => compareOrder(a.order, b.order));
|
|
2887
3654
|
shapeCache.set(node, out);
|
|
2888
3655
|
return out;
|
|
2889
3656
|
}
|
|
@@ -2924,7 +3691,7 @@ function placement(node) {
|
|
|
2924
3691
|
...node.blendStep ? { blendStep: true } : {},
|
|
2925
3692
|
...node.booleanOperation ? { booleanOperation: node.booleanOperation } : {},
|
|
2926
3693
|
...node.blendMode ? { blendMode: node.blendMode } : {},
|
|
2927
|
-
..._optionalChain([node, 'access',
|
|
3694
|
+
..._optionalChain([node, 'access', _69 => _69.filters, 'optionalAccess', _70 => _70.length]) ? { filters: node.filters } : {}
|
|
2928
3695
|
};
|
|
2929
3696
|
}
|
|
2930
3697
|
function vectorAppearanceNodes(node) {
|
|
@@ -2939,6 +3706,11 @@ function expandVectorAppearance(node) {
|
|
|
2939
3706
|
if (!hasOwnVectorAppearance(node)) {
|
|
2940
3707
|
const group = node;
|
|
2941
3708
|
out = { ...group, children: group.children.map(expandVectorAppearance) };
|
|
3709
|
+
} else if (isVectorMaskGroup(node)) {
|
|
3710
|
+
const { effects, ...group } = node;
|
|
3711
|
+
const [mask, ...contents] = node.children;
|
|
3712
|
+
const wrapper = { id: `${node.id}~content`, type: "group", effects, children: contents };
|
|
3713
|
+
out = { ...group, children: [expandVectorAppearance(mask), ...contents.length ? [expandVectorAppearance(wrapper)] : []] };
|
|
2942
3714
|
} else {
|
|
2943
3715
|
const shapes = vectorAppearanceShapes(node);
|
|
2944
3716
|
if (node.type === "path" && shapes.length === 1) {
|
|
@@ -3010,10 +3782,10 @@ function vectorEnteredGroups(nodes, ids) {
|
|
|
3010
3782
|
const want = new Set(ids);
|
|
3011
3783
|
const visit = (list, live) => {
|
|
3012
3784
|
for (const n of list) {
|
|
3013
|
-
const own = n.type === "group" && hasOwnVectorAppearance(n);
|
|
3785
|
+
const own = n.type === "group" && (hasOwnVectorAppearance(n) || isVectorMaskGroup(n));
|
|
3014
3786
|
if (want.has(n.id)) {
|
|
3015
3787
|
for (const id of live) out.add(id);
|
|
3016
|
-
if (own) out.add(n.id);
|
|
3788
|
+
if (own && hasOwnVectorAppearance(n)) out.add(n.id);
|
|
3017
3789
|
}
|
|
3018
3790
|
if (n.type === "group") visit(n.children, own ? [...live, n.id] : live);
|
|
3019
3791
|
}
|
|
@@ -3200,6 +3972,11 @@ function vectorPathWorldBezier(node, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX,
|
|
|
3200
3972
|
return _chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m) ? path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, path, m);
|
|
3201
3973
|
}
|
|
3202
3974
|
function vectorNodeBounds(node, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
3975
|
+
if (isVectorMaskActive(node)) {
|
|
3976
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
3977
|
+
const b2 = _chunkXGD3FSNCcjs.bezierPathBounds.call(void 0, vectorAppearanceShapes(node).flatMap((s) => _chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m) ? s.path : _chunkXGD3FSNCcjs.transformBezierPath.call(void 0, s.path, m)));
|
|
3978
|
+
return b2 ? { x: b2.minX, y: b2.minY, width: b2.maxX - b2.minX, height: b2.maxY - b2.minY } : null;
|
|
3979
|
+
}
|
|
3203
3980
|
node = expandVectorAppearance(node);
|
|
3204
3981
|
if (node.type === "group") {
|
|
3205
3982
|
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
@@ -3232,7 +4009,15 @@ function boundsFromPoints(a, b) {
|
|
|
3232
4009
|
}
|
|
3233
4010
|
function hitTestVectorNode(node, p, tolerance = 0, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX, options = {}) {
|
|
3234
4011
|
if (node.visible === false) return false;
|
|
3235
|
-
if (
|
|
4012
|
+
if (isVectorMaskGroup(node)) {
|
|
4013
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
4014
|
+
const entered = !!_optionalChain([options, 'access', _71 => _71.entered, 'optionalAccess', _72 => _72.has, 'call', _73 => _73(node.id)]);
|
|
4015
|
+
if (!entered && isVectorMaskActive(node) && !vectorMaskContains(node, _chunkDWGZUSEScjs.applyMatrix.call(void 0, _chunkDWGZUSEScjs.invertMatrix.call(void 0, m), p), tolerance)) return false;
|
|
4016
|
+
const shown = !entered && hasOwnVectorAppearance(node) ? expandVectorAppearance(node).children : node.children;
|
|
4017
|
+
for (let i = shown.length - 1; i >= 1; i--) if (hitTestVectorNode(shown[i], p, tolerance, m, options)) return true;
|
|
4018
|
+
return entered && hitTestVectorMaskSource(node, p, tolerance, m, options);
|
|
4019
|
+
}
|
|
4020
|
+
if (!(node.type === "group" && (!hasOwnVectorAppearance(node) || _optionalChain([options, 'access', _74 => _74.entered, 'optionalAccess', _75 => _75.has, 'call', _76 => _76(node.id)])))) node = expandVectorAppearance(node);
|
|
3236
4021
|
if (node.type === "group") {
|
|
3237
4022
|
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
3238
4023
|
return node.children.some((c) => hitTestVectorNode(c, p, tolerance, m, options));
|
|
@@ -3241,6 +4026,18 @@ function hitTestVectorNode(node, p, tolerance = 0, parent = _chunkDWGZUSEScjs.ID
|
|
|
3241
4026
|
if (path.length === 0) return false;
|
|
3242
4027
|
return hitTestVectorPaintStack(node, path, p, tolerance);
|
|
3243
4028
|
}
|
|
4029
|
+
function hitTestVectorMaskSource(group, p, tolerance, m, options) {
|
|
4030
|
+
const source = group.children[0];
|
|
4031
|
+
if (source.visible === false) return false;
|
|
4032
|
+
if (_optionalChain([group, 'access', _77 => _77.mask, 'optionalAccess', _78 => _78.type]) !== "clip") return hitTestVectorNode(source, p, tolerance, m, options);
|
|
4033
|
+
const paths = collectPathNodes(source).filter((n) => n.visible !== false);
|
|
4034
|
+
const pt2 = [p.x, p.y];
|
|
4035
|
+
return paths.some((n) => {
|
|
4036
|
+
const world = vectorParentMatrix([source], n.id);
|
|
4037
|
+
const path = vectorPathWorldBezier(n, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, _nullishCoalesce(world, () => ( _chunkDWGZUSEScjs.IDENTITY_MATRIX)), m));
|
|
4038
|
+
return _chunkXGD3FSNCcjs.pointInBezierPath.call(void 0, path, pt2, _nullishCoalesce(n.fillRule, () => ( "nonzero"))) || _chunkXGD3FSNCcjs.distanceToBezierPath.call(void 0, path, pt2) <= tolerance;
|
|
4039
|
+
});
|
|
4040
|
+
}
|
|
3244
4041
|
function vectorStrokeOutline(node, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
3245
4042
|
if (!hasPaint(node.stroke) || !((_nullishCoalesce(node.strokeWidth, () => ( 1))) > 0)) return [];
|
|
3246
4043
|
return vectorStrokeOutlinePath(vectorPathWorldBezier(node, parent), node);
|
|
@@ -3279,22 +4076,22 @@ function mapAnchor(a, m) {
|
|
|
3279
4076
|
}
|
|
3280
4077
|
function bakeIntoGeometry(node, m) {
|
|
3281
4078
|
if (_chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m)) return node;
|
|
3282
|
-
if (_optionalChain([node, 'access',
|
|
4079
|
+
if (_optionalChain([node, 'access', _79 => _79.effects, 'optionalAccess', _80 => _80.length])) node = { ...node, effects: transformVectorEffects(node.effects, m, node) };
|
|
3283
4080
|
if (node.type === "group") {
|
|
3284
4081
|
const group = node;
|
|
3285
4082
|
const children = group.children.map((c) => transformVectorNode(c, m));
|
|
3286
|
-
const spine = _optionalChain([group, 'access',
|
|
4083
|
+
const spine = _optionalChain([group, 'access', _81 => _81.blend, 'optionalAccess', _82 => _82.spine]);
|
|
3287
4084
|
if (!spine) return { ...group, children };
|
|
3288
4085
|
const moved = { closed: spine.closed, anchors: spine.anchors.map((a) => mapAnchor(a, m)) };
|
|
3289
4086
|
return { ...group, children, blend: { ...group.blend, spine: moved } };
|
|
3290
4087
|
}
|
|
3291
4088
|
const path = node;
|
|
3292
4089
|
const flips = m[0] * m[3] - m[1] * m[2] < 0;
|
|
3293
|
-
const mirrored = flips && _optionalChain([path, 'access',
|
|
4090
|
+
const mirrored = flips && _optionalChain([path, 'access', _83 => _83.strokeWidthProfile, 'optionalAccess', _84 => _84.length]);
|
|
3294
4091
|
const layer = (l) => ({
|
|
3295
4092
|
...l,
|
|
3296
4093
|
...isVectorGradient(l.paint) ? { paint: transformVectorPaint(l.paint, m) } : {},
|
|
3297
|
-
...flips && _optionalChain([l, 'access',
|
|
4094
|
+
...flips && _optionalChain([l, 'access', _85 => _85.strokeWidthProfile, 'optionalAccess', _86 => _86.length]) ? { strokeWidthProfile: mirrorWidthProfile(l.strokeWidthProfile) } : {}
|
|
3298
4095
|
});
|
|
3299
4096
|
return {
|
|
3300
4097
|
...path,
|
|
@@ -3498,14 +4295,14 @@ function roundSubpaths(subpaths, precision = 3) {
|
|
|
3498
4295
|
|
|
3499
4296
|
// src/vector/pathEffects.ts
|
|
3500
4297
|
var EPS3 = 1e-9;
|
|
3501
|
-
var
|
|
4298
|
+
var degenerate2 = (s) => s.every((p) => Math.abs(p[0] - s[0][0]) < EPS3 && Math.abs(p[1] - s[0][1]) < EPS3);
|
|
3502
4299
|
function raise(seg) {
|
|
3503
4300
|
if (seg.length !== 3) return seg.map((p) => [p[0], p[1]]);
|
|
3504
4301
|
const [p0, p1, p2] = seg;
|
|
3505
4302
|
return [p0, [p0[0] + 2 / 3 * (p1[0] - p0[0]), p0[1] + 2 / 3 * (p1[1] - p0[1])], [p2[0] + 2 / 3 * (p1[0] - p2[0]), p2[1] + 2 / 3 * (p1[1] - p2[1])], p2];
|
|
3506
4303
|
}
|
|
3507
4304
|
function subsOf(path) {
|
|
3508
|
-
return _chunkXGD3FSNCcjs.pathToContours.call(void 0, path).map((c) => ({ segs: _chunkXGD3FSNCcjs.closeContour.call(void 0, c).filter((s) => !
|
|
4305
|
+
return _chunkXGD3FSNCcjs.pathToContours.call(void 0, path).map((c) => ({ segs: _chunkXGD3FSNCcjs.closeContour.call(void 0, c).filter((s) => !degenerate2(s)).map(raise), closed: c.closed })).filter((s) => s.segs.length > 0);
|
|
3509
4306
|
}
|
|
3510
4307
|
var subsToPath = (subs) => _chunkXGD3FSNCcjs.contoursToPath.call(void 0, subs.map((s) => ({ segments: s.segs, closed: s.closed })));
|
|
3511
4308
|
var unit2 = (x, y) => {
|
|
@@ -3557,9 +4354,9 @@ var Measured = class {
|
|
|
3557
4354
|
*/
|
|
3558
4355
|
append(sa, sb, out) {
|
|
3559
4356
|
for (const piece of _chunkXGD3FSNCcjs.trimSegments.call(void 0, this.segs, sa, sb, this.lens)) {
|
|
3560
|
-
if (
|
|
3561
|
-
const last = _optionalChain([out, 'access',
|
|
3562
|
-
const end = _optionalChain([last, 'optionalAccess',
|
|
4357
|
+
if (degenerate2(piece)) continue;
|
|
4358
|
+
const last = _optionalChain([out, 'access', _87 => _87[out.length - 1], 'optionalAccess', _88 => _88.segs]);
|
|
4359
|
+
const end = _optionalChain([last, 'optionalAccess', _89 => _89[last.length - 1], 'optionalAccess', _90 => _90.at, 'call', _91 => _91(-1)]);
|
|
3563
4360
|
if (!end || Math.hypot(end[0] - piece[0][0], end[1] - piece[0][1]) > 1e-6) out.push({ segs: [piece], closed: false });
|
|
3564
4361
|
else last.push(piece);
|
|
3565
4362
|
}
|
|
@@ -3853,9 +4650,9 @@ function vectorRepeaterCopies(r, pivot) {
|
|
|
3853
4650
|
for (let i = 0; i < n; i++) {
|
|
3854
4651
|
const k = i + offset;
|
|
3855
4652
|
let m = _chunkDWGZUSEScjs.translateMatrix.call(void 0, -pivot.x, -pivot.y);
|
|
3856
|
-
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.scaleMatrix.call(void 0, Math.pow((_nullishCoalesce(_optionalChain([r, 'access',
|
|
4653
|
+
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.scaleMatrix.call(void 0, Math.pow((_nullishCoalesce(_optionalChain([r, 'access', _92 => _92.scale, 'optionalAccess', _93 => _93.x]), () => ( 100))) / 100, k), Math.pow((_nullishCoalesce(_optionalChain([r, 'access', _94 => _94.scale, 'optionalAccess', _95 => _95.y]), () => ( 100))) / 100, k)));
|
|
3857
4654
|
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.rotateMatrix.call(void 0, (_nullishCoalesce(r.rotation, () => ( 0))) * k));
|
|
3858
|
-
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.translateMatrix.call(void 0, pivot.x + (_nullishCoalesce(_optionalChain([r, 'access',
|
|
4655
|
+
m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, m, _chunkDWGZUSEScjs.translateMatrix.call(void 0, pivot.x + (_nullishCoalesce(_optionalChain([r, 'access', _96 => _96.position, 'optionalAccess', _97 => _97.x]), () => ( 0))) * k, pivot.y + (_nullishCoalesce(_optionalChain([r, 'access', _98 => _98.position, 'optionalAccess', _99 => _99.y]), () => ( 0))) * k));
|
|
3859
4656
|
const t = n > 1 ? i / (n - 1) : 0;
|
|
3860
4657
|
const partial = i + 1 === n && fract > 0 ? fract : 1;
|
|
3861
4658
|
out.push({ index: i, matrix: m, opacity: Math.min(1, Math.max(0, (so + (eo - so) * t) * partial)) });
|
|
@@ -4329,14 +5126,14 @@ function lerpStops(a, b, t) {
|
|
|
4329
5126
|
function lerpGradient(a, b, t) {
|
|
4330
5127
|
if (a.type !== b.type) return null;
|
|
4331
5128
|
const { stops, resampled } = lerpStops(a, b, t);
|
|
4332
|
-
const
|
|
5129
|
+
const near2 = t < 0.5 ? a : b;
|
|
4333
5130
|
const out = { type: a.type, stops };
|
|
4334
5131
|
if (!resampled) {
|
|
4335
5132
|
if (a.interpolation && a.interpolation !== "srgb") out.interpolation = a.interpolation;
|
|
4336
5133
|
if (a.smoothness) out.smoothness = a.smoothness;
|
|
4337
5134
|
}
|
|
4338
|
-
if (
|
|
4339
|
-
if (
|
|
5135
|
+
if (near2.spread && near2.spread !== "pad") out.spread = near2.spread;
|
|
5136
|
+
if (near2.strokeMode && near2.strokeMode !== "within") out.strokeMode = near2.strokeMode;
|
|
4340
5137
|
const ea = hasExplicitGradientGeometry(a);
|
|
4341
5138
|
const eb = hasExplicitGradientGeometry(b);
|
|
4342
5139
|
if (!ea && !eb) {
|
|
@@ -4354,7 +5151,7 @@ function lerpGradient(a, b, t) {
|
|
|
4354
5151
|
const pa = vectorGradientPoints(a);
|
|
4355
5152
|
const pb = vectorGradientPoints(b);
|
|
4356
5153
|
if (pa.units !== pb.units) {
|
|
4357
|
-
const src = explicitVectorGradient(
|
|
5154
|
+
const src = explicitVectorGradient(near2);
|
|
4358
5155
|
return { ...src, stops: out.stops, ...out.interpolation ? { interpolation: out.interpolation } : {}, ...out.smoothness ? { smoothness: out.smoothness } : {} };
|
|
4359
5156
|
}
|
|
4360
5157
|
out.start = lerpPoint(pa.start, pb.start, t);
|
|
@@ -4388,7 +5185,7 @@ function interpolateVectorPaint(a, b, t) {
|
|
|
4388
5185
|
return t < 0.5 ? a : b;
|
|
4389
5186
|
}
|
|
4390
5187
|
function interpolateWidthProfiles(a, b, t) {
|
|
4391
|
-
if (!_optionalChain([a, 'optionalAccess',
|
|
5188
|
+
if (!_optionalChain([a, 'optionalAccess', _100 => _100.length]) && !_optionalChain([b, 'optionalAccess', _101 => _101.length])) return null;
|
|
4392
5189
|
const at2 = [..._nullishCoalesce(a, () => ( [])), ..._nullishCoalesce(b, () => ( [])), { t: 0 }, { t: 1 }].map((p) => p.t).sort((x, y) => x - y);
|
|
4393
5190
|
const ts = at2.filter((v2, i) => i === 0 || v2 - at2[i - 1] > 1e-6);
|
|
4394
5191
|
return ts.map((pos) => {
|
|
@@ -4398,7 +5195,7 @@ function interpolateWidthProfiles(a, b, t) {
|
|
|
4398
5195
|
});
|
|
4399
5196
|
}
|
|
4400
5197
|
function lerpDashes(a, b, t) {
|
|
4401
|
-
const dashed = (d) => !!_optionalChain([d, 'optionalAccess',
|
|
5198
|
+
const dashed = (d) => !!_optionalChain([d, 'optionalAccess', _102 => _102.length]) && d.some((v2) => v2 > 0);
|
|
4402
5199
|
if (!dashed(a) && !dashed(b)) return t < 0.5 ? a : b;
|
|
4403
5200
|
const even = (p) => p.length % 2 ? [...p, ...p] : p;
|
|
4404
5201
|
const solid = (p) => {
|
|
@@ -4414,18 +5211,18 @@ function lerpDashes(a, b, t) {
|
|
|
4414
5211
|
}
|
|
4415
5212
|
var SWITCHED_KEYS = ["strokeLinecap", "strokeLinejoin", "fillRule", "strokeAlign", "startArrow", "endArrow", "arrowAlign"];
|
|
4416
5213
|
function interpolateVectorStyle(a, b, t) {
|
|
4417
|
-
const
|
|
5214
|
+
const near2 = t < 0.5 ? a : b;
|
|
4418
5215
|
const out = {};
|
|
4419
5216
|
const fill = interpolateVectorPaint(a.fill, b.fill, t);
|
|
4420
5217
|
if (fill !== void 0) out.fill = fill;
|
|
4421
5218
|
const stroke = interpolateVectorPaint(a.stroke, b.stroke, t);
|
|
4422
5219
|
if (stroke !== void 0) out.stroke = stroke;
|
|
4423
5220
|
if (a.strokeWidth !== void 0 || b.strokeWidth !== void 0) out.strokeWidth = lerpN(_nullishCoalesce(a.strokeWidth, () => ( 1)), _nullishCoalesce(b.strokeWidth, () => ( 1)), t);
|
|
4424
|
-
for (const key of SWITCHED_KEYS) if (
|
|
5221
|
+
for (const key of SWITCHED_KEYS) if (near2[key] !== void 0 && near2[key] !== null) out[key] = near2[key];
|
|
4425
5222
|
for (const key of ["startArrowScale", "endArrowScale"])
|
|
4426
5223
|
if (a[key] !== void 0 || b[key] !== void 0) out[key] = lerpN(_nullishCoalesce(a[key], () => ( 1)), _nullishCoalesce(b[key], () => ( 1)), t);
|
|
4427
5224
|
const dash = lerpDashes(a.strokeDasharray, b.strokeDasharray, t);
|
|
4428
|
-
if (_optionalChain([dash, 'optionalAccess',
|
|
5225
|
+
if (_optionalChain([dash, 'optionalAccess', _103 => _103.length])) out.strokeDasharray = dash;
|
|
4429
5226
|
const profile = interpolateWidthProfiles(a.strokeWidthProfile, b.strokeWidthProfile, t);
|
|
4430
5227
|
if (profile) out.strokeWidthProfile = profile;
|
|
4431
5228
|
return out;
|
|
@@ -4436,7 +5233,7 @@ function reversedStyle(s) {
|
|
|
4436
5233
|
out.endArrow = s.startArrow;
|
|
4437
5234
|
out.startArrowScale = s.endArrowScale;
|
|
4438
5235
|
out.endArrowScale = s.startArrowScale;
|
|
4439
|
-
if (_optionalChain([s, 'access',
|
|
5236
|
+
if (_optionalChain([s, 'access', _104 => _104.strokeWidthProfile, 'optionalAccess', _105 => _105.length])) out.strokeWidthProfile = reverseWidthProfile(s.strokeWidthProfile);
|
|
4440
5237
|
for (const k of ["startArrow", "endArrow", "startArrowScale", "endArrowScale"]) if (out[k] === void 0) delete out[k];
|
|
4441
5238
|
return out;
|
|
4442
5239
|
}
|
|
@@ -4483,286 +5280,91 @@ function preparePathMorph(a, b, options, ma = nodeMatrix(a), mb = nodeMatrix(b))
|
|
|
4483
5280
|
const opacity = lerpN(_nullishCoalesce(a.opacity, () => ( 1)), _nullishCoalesce(b.opacity, () => ( 1)), t);
|
|
4484
5281
|
if (opacity < 1) node.opacity = opacity;
|
|
4485
5282
|
if (rigid && !_chunkDWGZUSEScjs.isIdentityMatrix.call(void 0, m)) node.transform = m;
|
|
4486
|
-
return node;
|
|
4487
|
-
};
|
|
4488
|
-
}
|
|
4489
|
-
function flattenPaths(node, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
4490
|
-
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
4491
|
-
if (node.type === "path") return [{ path: node, m, opacity: 1 }];
|
|
4492
|
-
const o = _nullishCoalesce(node.opacity, () => ( 1));
|
|
4493
|
-
return node.children.filter((c) => c.visible !== false).flatMap((c) => flattenPaths(c, m)).map((e) => ({ ...e, opacity: e.opacity * o }));
|
|
4494
|
-
}
|
|
4495
|
-
var placedBounds = (path, m) => boundsOfPoints(contoursOf(path, m).flatMap((c) => c.pts));
|
|
4496
|
-
function collapsedPath(path, m, from, to) {
|
|
4497
|
-
const own = placedBounds(path, m);
|
|
4498
|
-
const c = own ? [own.x + own.width / 2, own.y + own.height / 2] : [0, 0];
|
|
4499
|
-
const fx = from && from.width > 0 ? (c[0] - from.x) / from.width : 0.5;
|
|
4500
|
-
const fy = from && from.height > 0 ? (c[1] - from.y) / from.height : 0.5;
|
|
4501
|
-
const p = to ? { x: to.x + to.width * fx, y: to.y + to.height * fy } : { x: c[0], y: c[1] };
|
|
4502
|
-
const subpaths = path.subpaths.map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map(() => ({ x: p.x, y: p.y })) }));
|
|
4503
|
-
const { transform: _t, ...rest } = path;
|
|
4504
|
-
return { ...rest, subpaths };
|
|
4505
|
-
}
|
|
4506
|
-
function createVectorMorph(a, b, options = {}) {
|
|
4507
|
-
if (a.type === "path" && b.type === "path") {
|
|
4508
|
-
const at2 = preparePathMorph(a, b, options);
|
|
4509
|
-
return { at: at2 };
|
|
4510
|
-
}
|
|
4511
|
-
const pa = flattenPaths(a);
|
|
4512
|
-
const pb = flattenPaths(b);
|
|
4513
|
-
const ba = unionBounds(pa.map((e) => placedBounds(e.path, e.m)));
|
|
4514
|
-
const bb = unionBounds(pb.map((e) => placedBounds(e.path, e.m)));
|
|
4515
|
-
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
4516
|
-
const parts = [];
|
|
4517
|
-
const opacities = [];
|
|
4518
|
-
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
4519
|
-
const x = pa[i];
|
|
4520
|
-
const y = pb[i];
|
|
4521
|
-
const sub5 = { ...options, id: `${id}-${i}`, starts: void 0 };
|
|
4522
|
-
if (x && y) {
|
|
4523
|
-
parts.push(preparePathMorph(x.path, y.path, sub5, x.m, y.m));
|
|
4524
|
-
opacities.push([x.opacity, y.opacity]);
|
|
4525
|
-
} else if (x) {
|
|
4526
|
-
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub5, x.m, _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
4527
|
-
opacities.push([x.opacity, x.opacity]);
|
|
4528
|
-
} else if (y) {
|
|
4529
|
-
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub5, _chunkDWGZUSEScjs.IDENTITY_MATRIX, y.m));
|
|
4530
|
-
opacities.push([y.opacity, y.opacity]);
|
|
4531
|
-
}
|
|
4532
|
-
}
|
|
4533
|
-
return {
|
|
4534
|
-
at: (t) => {
|
|
4535
|
-
const children = parts.map((p, i) => {
|
|
4536
|
-
const n = p(t);
|
|
4537
|
-
const o = lerpN(opacities[i][0], opacities[i][1], t) * (_nullishCoalesce(n.opacity, () => ( 1)));
|
|
4538
|
-
if (o < 1) n.opacity = o;
|
|
4539
|
-
else delete n.opacity;
|
|
4540
|
-
return n;
|
|
4541
|
-
});
|
|
4542
|
-
const group = { id, type: "group", children };
|
|
4543
|
-
return group;
|
|
4544
|
-
}
|
|
4545
|
-
};
|
|
4546
|
-
}
|
|
4547
|
-
function interpolateVectorPaths(a, b, t, options = {}) {
|
|
4548
|
-
return createVectorMorph(a, b, options).at(t);
|
|
4549
|
-
}
|
|
4550
|
-
var keyframeMorphs = /* @__PURE__ */ new WeakMap();
|
|
4551
|
-
function evaluateVectorPathKeyframes(keyframes, time, options = {}) {
|
|
4552
|
-
const keys = keyframes.filter((k) => Number.isFinite(k.time)).sort((x, y) => x.time - y.time);
|
|
4553
|
-
if (!keys.length) return null;
|
|
4554
|
-
if (!(time > keys[0].time)) return keys[0].value;
|
|
4555
|
-
const last = keys[keys.length - 1];
|
|
4556
|
-
if (time >= last.time) return last.value;
|
|
4557
|
-
let i = 0;
|
|
4558
|
-
while (i + 1 < keys.length && keys[i + 1].time <= time) i++;
|
|
4559
|
-
const a = keys[i];
|
|
4560
|
-
const b = keys[i + 1];
|
|
4561
|
-
if (time === a.time) return a.value;
|
|
4562
|
-
if (a.easing === "hold") return a.value;
|
|
4563
|
-
const span = b.time - a.time;
|
|
4564
|
-
const u = Math.min(1, Math.max(0, _chunk2FHLHZALcjs.evaluateEasing.call(void 0, a.easing, (time - a.time) / span, span)));
|
|
4565
|
-
let inner = keyframeMorphs.get(a.value);
|
|
4566
|
-
if (!inner) keyframeMorphs.set(a.value, inner = /* @__PURE__ */ new WeakMap());
|
|
4567
|
-
let morph = inner.get(b.value);
|
|
4568
|
-
if (!morph) inner.set(b.value, morph = createVectorMorph(a.value, b.value, options));
|
|
4569
|
-
return morph.at(u);
|
|
4570
|
-
}
|
|
4571
|
-
|
|
4572
|
-
// src/vector/filters.ts
|
|
4573
|
-
var VECTOR_FILTER_DEFAULTS = {
|
|
4574
|
-
dropShadow: { color: "#000000", opacity: 0.25, offsetX: 0, offsetY: 4, blur: 4, spread: 0 },
|
|
4575
|
-
innerShadow: { color: "#000000", opacity: 0.25, offsetX: 0, offsetY: 4, blur: 4, spread: 0 },
|
|
4576
|
-
outerGlow: { color: "#ffffbe", opacity: 0.75, blur: 10, spread: 0 },
|
|
4577
|
-
innerGlow: { color: "#ffffbe", opacity: 0.75, blur: 10, spread: 0 },
|
|
4578
|
-
layerBlur: { radius: 4 },
|
|
4579
|
-
feather: { radius: 8 }
|
|
4580
|
-
};
|
|
4581
|
-
var VECTOR_FILTER_LABELS = {
|
|
4582
|
-
dropShadow: "Drop Shadow",
|
|
4583
|
-
innerShadow: "Inner Shadow",
|
|
4584
|
-
outerGlow: "Outer Glow",
|
|
4585
|
-
innerGlow: "Inner Glow",
|
|
4586
|
-
layerBlur: "Layer Blur",
|
|
4587
|
-
feather: "Feather"
|
|
4588
|
-
};
|
|
4589
|
-
var SHADOW_SPECS = [
|
|
4590
|
-
{ key: "color", label: "Color", kind: "color" },
|
|
4591
|
-
{ key: "opacity", label: "Opacity", kind: "number", min: 0, max: 1, step: 0.01, slider: true },
|
|
4592
|
-
{ key: "offsetX", label: "X", kind: "number", min: -1e3, max: 1e3, step: 1 },
|
|
4593
|
-
{ key: "offsetY", label: "Y", kind: "number", min: -1e3, max: 1e3, step: 1 },
|
|
4594
|
-
{ key: "blur", label: "Blur", kind: "number", min: 0, max: 500, step: 1 },
|
|
4595
|
-
{ key: "spread", label: "Spread", kind: "number", min: 0, max: 500, step: 1 }
|
|
4596
|
-
];
|
|
4597
|
-
var GLOW_SPECS = SHADOW_SPECS.filter((s) => s.key !== "offsetX" && s.key !== "offsetY");
|
|
4598
|
-
var VECTOR_FILTER_PARAM_SPECS = {
|
|
4599
|
-
dropShadow: SHADOW_SPECS,
|
|
4600
|
-
innerShadow: SHADOW_SPECS.map((s) => s.key === "spread" ? { ...s, label: "Choke" } : s),
|
|
4601
|
-
outerGlow: GLOW_SPECS,
|
|
4602
|
-
innerGlow: GLOW_SPECS.map((s) => s.key === "spread" ? { ...s, label: "Choke" } : s),
|
|
4603
|
-
layerBlur: [{ key: "radius", label: "Radius", kind: "number", min: 0, max: 500, step: 1, slider: true }],
|
|
4604
|
-
feather: [{ key: "radius", label: "Radius", kind: "number", min: 0, max: 500, step: 1, slider: true }]
|
|
4605
|
-
};
|
|
4606
|
-
function isVectorFilterType(value) {
|
|
4607
|
-
return typeof value === "string" && VECTOR_FILTER_TYPES.includes(value);
|
|
4608
|
-
}
|
|
4609
|
-
function normalizeVectorFilterParams(type, params, base) {
|
|
4610
|
-
if (!isVectorFilterType(type)) return null;
|
|
4611
|
-
const out = { ...VECTOR_FILTER_DEFAULTS[type], ..._nullishCoalesce(base, () => ( {})) };
|
|
4612
|
-
for (const spec of VECTOR_FILTER_PARAM_SPECS[type]) {
|
|
4613
|
-
const v2 = _optionalChain([params, 'optionalAccess', _92 => _92[spec.key]]);
|
|
4614
|
-
if (v2 === void 0) continue;
|
|
4615
|
-
if (spec.kind === "number" && typeof v2 === "number" && Number.isFinite(v2)) out[spec.key] = Math.min(_nullishCoalesce(spec.max, () => ( Infinity)), Math.max(_nullishCoalesce(spec.min, () => ( -Infinity)), v2));
|
|
4616
|
-
else if (spec.kind === "color" && typeof v2 === "string" && v2.trim()) out[spec.key] = v2.trim();
|
|
4617
|
-
}
|
|
4618
|
-
return out;
|
|
4619
|
-
}
|
|
4620
|
-
function vectorFilterParamKeys(type) {
|
|
4621
|
-
return VECTOR_FILTER_PARAM_SPECS[type].map((s) => s.key);
|
|
4622
|
-
}
|
|
4623
|
-
function createVectorFilter(type, id, params) {
|
|
4624
|
-
const p = normalizeVectorFilterParams(type, params);
|
|
4625
|
-
return p ? { id, type, params: p } : null;
|
|
4626
|
-
}
|
|
4627
|
-
function sanitizeVectorFilters(value) {
|
|
4628
|
-
if (!Array.isArray(value)) return [];
|
|
4629
|
-
const out = [];
|
|
4630
|
-
const used = /* @__PURE__ */ new Set();
|
|
4631
|
-
for (const raw of value) {
|
|
4632
|
-
if (!raw || typeof raw !== "object") continue;
|
|
4633
|
-
const r = raw;
|
|
4634
|
-
if (!isVectorFilterType(r.type)) continue;
|
|
4635
|
-
let id = typeof r.id === "string" && r.id && !used.has(r.id) ? r.id : "";
|
|
4636
|
-
for (let k = out.length + 1; !id; k++) if (!used.has(`filter${k}`)) id = `filter${k}`;
|
|
4637
|
-
used.add(id);
|
|
4638
|
-
const filter = createVectorFilter(r.type, id, _nullishCoalesce(r.params, () => ( {})));
|
|
4639
|
-
out.push(r.enabled === false ? { ...filter, enabled: false } : filter);
|
|
4640
|
-
}
|
|
4641
|
-
return out;
|
|
4642
|
-
}
|
|
4643
|
-
function activeVectorFilters(node) {
|
|
4644
|
-
return (_nullishCoalesce(node.filters, () => ( []))).filter((f) => {
|
|
4645
|
-
if (f.enabled === false || !isVectorFilterType(f.type)) return false;
|
|
4646
|
-
if (f.type === "layerBlur" || f.type === "feather") return f.params.radius > 0;
|
|
4647
|
-
return f.params.opacity > 0;
|
|
4648
|
-
});
|
|
5283
|
+
return node;
|
|
5284
|
+
};
|
|
4649
5285
|
}
|
|
4650
|
-
function
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
case "dropShadow":
|
|
4656
|
-
case "innerShadow":
|
|
4657
|
-
outer = Math.max(outer, Math.max(Math.abs(f.params.offsetX), Math.abs(f.params.offsetY)) + f.params.blur * 1.5 + f.params.spread);
|
|
4658
|
-
break;
|
|
4659
|
-
case "outerGlow":
|
|
4660
|
-
case "innerGlow":
|
|
4661
|
-
outer = Math.max(outer, f.params.blur * 1.5 + f.params.spread);
|
|
4662
|
-
break;
|
|
4663
|
-
case "layerBlur":
|
|
4664
|
-
blur += f.params.radius * 1.5;
|
|
4665
|
-
break;
|
|
4666
|
-
}
|
|
4667
|
-
}
|
|
4668
|
-
return outer + blur;
|
|
5286
|
+
function flattenPaths(node, parent = _chunkDWGZUSEScjs.IDENTITY_MATRIX) {
|
|
5287
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, nodeMatrix(node), parent);
|
|
5288
|
+
if (node.type === "path") return [{ path: node, m, opacity: 1 }];
|
|
5289
|
+
const o = _nullishCoalesce(node.opacity, () => ( 1));
|
|
5290
|
+
return node.children.filter((c) => c.visible !== false).flatMap((c) => flattenPaths(c, m)).map((e) => ({ ...e, opacity: e.opacity * o }));
|
|
4669
5291
|
}
|
|
4670
|
-
var
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
const
|
|
4674
|
-
|
|
4675
|
-
const
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
const
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
if (f.type === "innerShadow" && (f.params.offsetX || f.params.offsetY)) {
|
|
4686
|
-
primitives.push(fe("feOffset", { in: last, dx: round(f.params.offsetX), dy: round(f.params.offsetY), result: name("off") }));
|
|
4687
|
-
last = name("off");
|
|
4688
|
-
}
|
|
4689
|
-
if (p.spread > 0) {
|
|
4690
|
-
primitives.push(fe("feMorphology", { in: last, operator: "dilate", radius: round(p.spread), result: name("grow") }));
|
|
4691
|
-
last = name("grow");
|
|
4692
|
-
}
|
|
4693
|
-
if (p.blur > 0) {
|
|
4694
|
-
primitives.push(fe("feGaussianBlur", { in: last, stdDeviation: round(p.blur / 2), result: name("blur") }));
|
|
4695
|
-
last = name("blur");
|
|
4696
|
-
}
|
|
4697
|
-
primitives.push(fe("feFlood", { "flood-color": p.color, "flood-opacity": round(p.opacity), result: name("color") }));
|
|
4698
|
-
primitives.push(fe("feComposite", { in: name("color"), in2: last, operator: "in", result: name("tint") }));
|
|
4699
|
-
primitives.push(fe("feComposite", { in: name("tint"), in2: "SourceAlpha", operator: "in", result: name("inner") }));
|
|
4700
|
-
primitives.push(fe("feComposite", { in: name("inner"), in2: body, operator: "over", result: name("body") }));
|
|
4701
|
-
body = name("body");
|
|
4702
|
-
}
|
|
4703
|
-
for (const f of active) {
|
|
4704
|
-
if (f.type !== "feather") continue;
|
|
4705
|
-
n++;
|
|
4706
|
-
const r = f.params.radius;
|
|
4707
|
-
primitives.push(fe("feMorphology", { in: "SourceAlpha", operator: "erode", radius: round(r / 2), result: name("core") }));
|
|
4708
|
-
primitives.push(fe("feGaussianBlur", { in: name("core"), stdDeviation: round(r / 4), result: name("fade") }));
|
|
4709
|
-
primitives.push(fe("feComposite", { in: body, in2: name("fade"), operator: "in", result: name("body") }));
|
|
4710
|
-
body = name("body");
|
|
5292
|
+
var placedBounds = (path, m) => boundsOfPoints(contoursOf(path, m).flatMap((c) => c.pts));
|
|
5293
|
+
function collapsedPath(path, m, from, to) {
|
|
5294
|
+
const own = placedBounds(path, m);
|
|
5295
|
+
const c = own ? [own.x + own.width / 2, own.y + own.height / 2] : [0, 0];
|
|
5296
|
+
const fx = from && from.width > 0 ? (c[0] - from.x) / from.width : 0.5;
|
|
5297
|
+
const fy = from && from.height > 0 ? (c[1] - from.y) / from.height : 0.5;
|
|
5298
|
+
const p = to ? { x: to.x + to.width * fx, y: to.y + to.height * fy } : { x: c[0], y: c[1] };
|
|
5299
|
+
const subpaths = path.subpaths.map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map(() => ({ x: p.x, y: p.y })) }));
|
|
5300
|
+
const { transform: _t, ...rest } = path;
|
|
5301
|
+
return { ...rest, subpaths };
|
|
5302
|
+
}
|
|
5303
|
+
function createVectorMorph(a, b, options = {}) {
|
|
5304
|
+
if (a.type === "path" && b.type === "path") {
|
|
5305
|
+
const at2 = preparePathMorph(a, b, options);
|
|
5306
|
+
return { at: at2 };
|
|
4711
5307
|
}
|
|
4712
|
-
const
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
5308
|
+
const pa = flattenPaths(a);
|
|
5309
|
+
const pb = flattenPaths(b);
|
|
5310
|
+
const ba = unionBounds(pa.map((e) => placedBounds(e.path, e.m)));
|
|
5311
|
+
const bb = unionBounds(pb.map((e) => placedBounds(e.path, e.m)));
|
|
5312
|
+
const id = _nullishCoalesce(options.id, () => ( a.id));
|
|
5313
|
+
const parts = [];
|
|
5314
|
+
const opacities = [];
|
|
5315
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
5316
|
+
const x = pa[i];
|
|
5317
|
+
const y = pb[i];
|
|
5318
|
+
const sub5 = { ...options, id: `${id}-${i}`, starts: void 0 };
|
|
5319
|
+
if (x && y) {
|
|
5320
|
+
parts.push(preparePathMorph(x.path, y.path, sub5, x.m, y.m));
|
|
5321
|
+
opacities.push([x.opacity, y.opacity]);
|
|
5322
|
+
} else if (x) {
|
|
5323
|
+
parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub5, x.m, _chunkDWGZUSEScjs.IDENTITY_MATRIX));
|
|
5324
|
+
opacities.push([x.opacity, x.opacity]);
|
|
5325
|
+
} else if (y) {
|
|
5326
|
+
parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub5, _chunkDWGZUSEScjs.IDENTITY_MATRIX, y.m));
|
|
5327
|
+
opacities.push([y.opacity, y.opacity]);
|
|
4729
5328
|
}
|
|
4730
|
-
primitives.push(fe("feFlood", { "flood-color": p.color, "flood-opacity": round(p.opacity), result: name("color") }));
|
|
4731
|
-
primitives.push(fe("feComposite", { in: name("color"), in2: last, operator: "in", result: name("shadow") }));
|
|
4732
|
-
under.push(name("shadow"));
|
|
4733
|
-
}
|
|
4734
|
-
if (under.length) {
|
|
4735
|
-
n++;
|
|
4736
|
-
primitives.push(fe("feMerge", { result: name("merged") }, [...under, body].map((i) => fe("feMergeNode", { in: i }))));
|
|
4737
|
-
body = name("merged");
|
|
4738
|
-
}
|
|
4739
|
-
for (const f of active) {
|
|
4740
|
-
if (f.type !== "layerBlur") continue;
|
|
4741
|
-
n++;
|
|
4742
|
-
primitives.push(fe("feGaussianBlur", { in: body, stdDeviation: round(f.params.radius / 2), result: name("body") }));
|
|
4743
|
-
body = name("body");
|
|
4744
5329
|
}
|
|
4745
|
-
const lastResult = _optionalChain([primitives, 'access', _93 => _93[primitives.length - 1], 'optionalAccess', _94 => _94.attrs, 'access', _95 => _95.result]);
|
|
4746
|
-
if (lastResult !== body) primitives.push(fe("feMerge", {}, [fe("feMergeNode", { in: body })]));
|
|
4747
|
-
const pad = vectorFilterReach(active) + 2;
|
|
4748
5330
|
return {
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
5331
|
+
at: (t) => {
|
|
5332
|
+
const children = parts.map((p, i) => {
|
|
5333
|
+
const n = p(t);
|
|
5334
|
+
const o = lerpN(opacities[i][0], opacities[i][1], t) * (_nullishCoalesce(n.opacity, () => ( 1)));
|
|
5335
|
+
if (o < 1) n.opacity = o;
|
|
5336
|
+
else delete n.opacity;
|
|
5337
|
+
return n;
|
|
5338
|
+
});
|
|
5339
|
+
const group = { id, type: "group", children };
|
|
5340
|
+
return group;
|
|
5341
|
+
}
|
|
4755
5342
|
};
|
|
4756
5343
|
}
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
const attrs = Object.entries(p.attrs).map(([k, v2]) => ` ${k}="${escapeAttr(String(v2))}"`).join("");
|
|
4760
|
-
return _optionalChain([p, 'access', _96 => _96.children, 'optionalAccess', _97 => _97.length]) ? `<${p.tag}${attrs}>${p.children.map(primitiveMarkup).join("")}</${p.tag}>` : `<${p.tag}${attrs}/>`;
|
|
5344
|
+
function interpolateVectorPaths(a, b, t, options = {}) {
|
|
5345
|
+
return createVectorMorph(a, b, options).at(t);
|
|
4761
5346
|
}
|
|
4762
|
-
|
|
4763
|
-
|
|
5347
|
+
var keyframeMorphs = /* @__PURE__ */ new WeakMap();
|
|
5348
|
+
function evaluateVectorPathKeyframes(keyframes, time, options = {}) {
|
|
5349
|
+
const keys = keyframes.filter((k) => Number.isFinite(k.time)).sort((x, y) => x.time - y.time);
|
|
5350
|
+
if (!keys.length) return null;
|
|
5351
|
+
if (!(time > keys[0].time)) return keys[0].value;
|
|
5352
|
+
const last = keys[keys.length - 1];
|
|
5353
|
+
if (time >= last.time) return last.value;
|
|
5354
|
+
let i = 0;
|
|
5355
|
+
while (i + 1 < keys.length && keys[i + 1].time <= time) i++;
|
|
5356
|
+
const a = keys[i];
|
|
5357
|
+
const b = keys[i + 1];
|
|
5358
|
+
if (time === a.time) return a.value;
|
|
5359
|
+
if (a.easing === "hold") return a.value;
|
|
5360
|
+
const span = b.time - a.time;
|
|
5361
|
+
const u = Math.min(1, Math.max(0, _chunk2FHLHZALcjs.evaluateEasing.call(void 0, a.easing, (time - a.time) / span, span)));
|
|
5362
|
+
let inner = keyframeMorphs.get(a.value);
|
|
5363
|
+
if (!inner) keyframeMorphs.set(a.value, inner = /* @__PURE__ */ new WeakMap());
|
|
5364
|
+
let morph = inner.get(b.value);
|
|
5365
|
+
if (!morph) inner.set(b.value, morph = createVectorMorph(a.value, b.value, options));
|
|
5366
|
+
return morph.at(u);
|
|
4764
5367
|
}
|
|
4765
|
-
var VECTOR_FILTER_MENU = VECTOR_FILTER_TYPES.map((type) => ({ type, label: VECTOR_FILTER_LABELS[type] }));
|
|
4766
5368
|
|
|
4767
5369
|
// src/vector/gradientStroke.ts
|
|
4768
5370
|
var SHARP = 1.25;
|
|
@@ -4939,7 +5541,7 @@ function applyVectorCornersAttribute(subpaths, value) {
|
|
|
4939
5541
|
for (const item of value.trim().split(/\s+/)) {
|
|
4940
5542
|
const m = /^(\d+)\.(\d+):([\d.eE+-]+)(?::([a-z]+))?$/.exec(item);
|
|
4941
5543
|
if (!m) continue;
|
|
4942
|
-
const a = _optionalChain([subpaths, 'access',
|
|
5544
|
+
const a = _optionalChain([subpaths, 'access', _106 => _106[+m[1]], 'optionalAccess', _107 => _107.anchors, 'access', _108 => _108[+m[2]]]);
|
|
4943
5545
|
const radius = parseFloat(m[3]);
|
|
4944
5546
|
if (!a || !(radius > 0)) continue;
|
|
4945
5547
|
const kind = VECTOR_CORNER_KINDS.includes(m[4]) ? m[4] : void 0;
|
|
@@ -4961,7 +5563,7 @@ function vectorPaintToSvg(paint, gradientId, options = {}) {
|
|
|
4961
5563
|
const precision = _nullishCoalesce(options.precision, () => ( 3));
|
|
4962
5564
|
const key = `${gradientId}|${role}|${precision}`;
|
|
4963
5565
|
const owner = _nullishCoalesce(options.node, () => ( paint));
|
|
4964
|
-
const cached = _optionalChain([paintCache, 'access',
|
|
5566
|
+
const cached = _optionalChain([paintCache, 'access', _109 => _109.get, 'call', _110 => _110(owner), 'optionalAccess', _111 => _111.get, 'call', _112 => _112(key)]);
|
|
4965
5567
|
if (cached && (!options.node || (role === "fill" ? options.node.fill : options.node.stroke) === paint)) return { value: `url(#${gradientId})`, defs: cached };
|
|
4966
5568
|
const node = options.node;
|
|
4967
5569
|
const bounds = node ? vectorPathLocalBounds(node) : null;
|
|
@@ -5015,7 +5617,7 @@ function vectorNodeLocalPaintBounds(node) {
|
|
|
5015
5617
|
}
|
|
5016
5618
|
var filterCache = /* @__PURE__ */ new WeakMap();
|
|
5017
5619
|
function vectorNodeFilterSvg(node, id) {
|
|
5018
|
-
if (!_optionalChain([node, 'access',
|
|
5620
|
+
if (!_optionalChain([node, 'access', _113 => _113.filters, 'optionalAccess', _114 => _114.length])) return null;
|
|
5019
5621
|
const hit = filterCache.get(node);
|
|
5020
5622
|
if (hit && hit.id === id) return hit.filter;
|
|
5021
5623
|
const active = activeVectorFilters(node);
|
|
@@ -5095,7 +5697,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
5095
5697
|
if (node.booleanOperation) out2 += ` data-vector-boolean-operation="${node.booleanOperation}"`;
|
|
5096
5698
|
const blend = vectorBlendModeCss(node.blendMode);
|
|
5097
5699
|
if (blend) out2 += ` style="mix-blend-mode:${blend}"`;
|
|
5098
|
-
if (_optionalChain([node, 'access',
|
|
5700
|
+
if (_optionalChain([node, 'access', _115 => _115.filters, 'optionalAccess', _116 => _116.length])) {
|
|
5099
5701
|
const filter = vectorNodeFilterSvg(node, `${prefix}filter-${node.id}`);
|
|
5100
5702
|
const data = ` data-vector-filters="${escapeAttr2(JSON.stringify(node.filters))}"`;
|
|
5101
5703
|
if (filter) {
|
|
@@ -5142,7 +5744,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
5142
5744
|
let out2 = ` stroke="${escapeAttr2(strokeValue)}" stroke-width="${num2(width)}"`;
|
|
5143
5745
|
if (node.strokeLinecap && node.strokeLinecap !== "butt") out2 += ` stroke-linecap="${node.strokeLinecap}"`;
|
|
5144
5746
|
if (node.strokeLinejoin && node.strokeLinejoin !== "miter") out2 += ` stroke-linejoin="${node.strokeLinejoin}"`;
|
|
5145
|
-
if (_optionalChain([node, 'access',
|
|
5747
|
+
if (_optionalChain([node, 'access', _117 => _117.strokeDasharray, 'optionalAccess', _118 => _118.length])) out2 += ` stroke-dasharray="${node.strokeDasharray.map(num2).join(" ")}"`;
|
|
5146
5748
|
return out2;
|
|
5147
5749
|
};
|
|
5148
5750
|
const liveCorners = (node) => {
|
|
@@ -5185,7 +5787,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
5185
5787
|
};
|
|
5186
5788
|
const emit2 = (node, depth) => {
|
|
5187
5789
|
if (node.visible === false && !options.includeHidden) return;
|
|
5188
|
-
const wrappers = _nullishCoalesce(_optionalChain([options, 'access',
|
|
5790
|
+
const wrappers = _nullishCoalesce(_optionalChain([options, 'access', _119 => _119.wrap, 'optionalAccess', _120 => _120[node.id]]), () => ( []));
|
|
5189
5791
|
wrappers.forEach((w2, i) => {
|
|
5190
5792
|
let attrs = w2.id !== void 0 ? ` id="${escapeAttr2(w2.id)}"` : "";
|
|
5191
5793
|
if (w2.transform) attrs += ` transform="${escapeAttr2(w2.transform)}"`;
|
|
@@ -5199,11 +5801,49 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
5199
5801
|
emitNode(node, depth + wrappers.length);
|
|
5200
5802
|
for (let i = wrappers.length - 1; i >= 0; i--) lines.push(`${indent(depth + i)}</g>`);
|
|
5201
5803
|
};
|
|
5804
|
+
const capture = (fn) => {
|
|
5805
|
+
const at2 = lines.length;
|
|
5806
|
+
fn();
|
|
5807
|
+
return lines.splice(at2).map((l) => l.trim()).join("");
|
|
5808
|
+
};
|
|
5809
|
+
const emitMaskGroup = (node, depth) => {
|
|
5810
|
+
const [source, ...contents] = node.children;
|
|
5811
|
+
const body = _optionalChain([node, 'access', _121 => _121.effects, 'optionalAccess', _122 => _122.length]) && contents.length ? [{ id: `${node.id}~content`, type: "group", effects: node.effects, children: contents }] : contents;
|
|
5812
|
+
const settings = { type: node.mask.type, ...node.mask.invert ? { invert: true } : {} };
|
|
5813
|
+
lines.push(`${indent(depth)}<g${common(node)} data-vector-mask="${escapeAttr2(JSON.stringify(settings))}">`);
|
|
5814
|
+
const mask = vectorMaskRenderData(node, `${prefix}mask-${node.id}`, `${prefix}mask-filter-${node.id}`, precision);
|
|
5815
|
+
let ref = "";
|
|
5816
|
+
if (mask && mask.type !== "clip") {
|
|
5817
|
+
const b = mask.bounds;
|
|
5818
|
+
const box = `x="${num2(b.x)}" y="${num2(b.y)}" width="${num2(b.width)}" height="${num2(b.height)}"`;
|
|
5819
|
+
if (mask.invertFilter) defs.push(vectorFilterMarkup(mask.invertFilter));
|
|
5820
|
+
const inner = capture(() => emitNode(source, depth + 1));
|
|
5821
|
+
const drawn = mask.filter ? `<g data-vector-part="mask-invert" filter="${escapeAttr2(mask.filter)}">${inner}</g>` : inner;
|
|
5822
|
+
defs.push(`<mask id="${escapeAttr2(mask.id)}" data-vector-part="mask-source" maskUnits="userSpaceOnUse" ${box}${mask.type === "alpha" ? ' mask-type="alpha"' : ""}>${drawn}</mask>`);
|
|
5823
|
+
ref = ` mask="url(#${escapeAttr2(mask.id)})"`;
|
|
5824
|
+
} else {
|
|
5825
|
+
lines.push(`${indent(depth + 1)}<g data-vector-part="mask-source" display="none">`);
|
|
5826
|
+
emitNode(source, depth + 2);
|
|
5827
|
+
lines.push(`${indent(depth + 1)}</g>`);
|
|
5828
|
+
if (_optionalChain([mask, 'optionalAccess', _123 => _123.clip])) {
|
|
5829
|
+
defs.push(`<clipPath id="${escapeAttr2(mask.id)}">${mask.clip.map((c) => `<path d="${c.d}" clip-rule="${c.clipRule}"/>`).join("")}</clipPath>`);
|
|
5830
|
+
ref = ` clip-path="url(#${escapeAttr2(mask.id)})"`;
|
|
5831
|
+
}
|
|
5832
|
+
}
|
|
5833
|
+
lines.push(`${indent(depth + 1)}<g data-vector-part="masked"${ref}>`);
|
|
5834
|
+
for (const child of body) emit2(child, depth + 2);
|
|
5835
|
+
lines.push(`${indent(depth + 1)}</g>`);
|
|
5836
|
+
lines.push(`${indent(depth)}</g>`);
|
|
5837
|
+
};
|
|
5202
5838
|
const emitNode = (node, depth) => {
|
|
5839
|
+
if (isVectorMaskGroup(node)) {
|
|
5840
|
+
emitMaskGroup(node, depth);
|
|
5841
|
+
return;
|
|
5842
|
+
}
|
|
5203
5843
|
if (hasOwnVectorAppearance(node)) {
|
|
5204
5844
|
const live2 = {
|
|
5205
5845
|
kind: node.type,
|
|
5206
|
-
..._optionalChain([node, 'access',
|
|
5846
|
+
..._optionalChain([node, 'access', _124 => _124.effects, 'optionalAccess', _125 => _125.length]) ? { effects: node.effects } : {},
|
|
5207
5847
|
...node.type === "group" && node.liveBoolean ? { liveBoolean: node.liveBoolean } : {}
|
|
5208
5848
|
};
|
|
5209
5849
|
lines.push(`${indent(depth)}<g${common(node)} data-vector-live="${escapeAttr2(JSON.stringify(live2))}">`);
|
|
@@ -5253,7 +5893,7 @@ function vectorDocumentToSvg(doc, options = {}) {
|
|
|
5253
5893
|
data += ` data-vector-width-profile="${widthProfileToAttribute(profile)}"`;
|
|
5254
5894
|
if (node.strokeLinecap && node.strokeLinecap !== "butt") data += ` data-vector-stroke-linecap="${node.strokeLinecap}"`;
|
|
5255
5895
|
if (node.strokeLinejoin && node.strokeLinejoin !== "miter") data += ` data-vector-stroke-linejoin="${node.strokeLinejoin}"`;
|
|
5256
|
-
if (_optionalChain([node, 'access',
|
|
5896
|
+
if (_optionalChain([node, 'access', _126 => _126.strokeDasharray, 'optionalAccess', _127 => _127.length])) data += ` data-vector-stroke-dasharray="${node.strokeDasharray.map(num2).join(" ")}"`;
|
|
5257
5897
|
}
|
|
5258
5898
|
lines.push(`${indent(depth)}<g${common(node)}${data}>`);
|
|
5259
5899
|
lines.push(`${indent(depth + 1)}<path data-vector-part="fill" d="${d}"${fillAttrs}${live}/>`);
|
|
@@ -5402,6 +6042,26 @@ function collectGradients(el, raw) {
|
|
|
5402
6042
|
if (PAINT_SERVERS.has(el.name) && el.attrs.id) raw.set(el.attrs.id, el);
|
|
5403
6043
|
for (const c of el.children) collectGradients(c, raw);
|
|
5404
6044
|
}
|
|
6045
|
+
function collectMasks(el, raw) {
|
|
6046
|
+
if ((el.name === "clipPath" || el.name === "mask") && el.attrs.id) raw.set(el.attrs.id, el);
|
|
6047
|
+
for (const c of el.children) collectMasks(c, raw);
|
|
6048
|
+
}
|
|
6049
|
+
function attrOrStyle(el, name) {
|
|
6050
|
+
for (const decl of (_nullishCoalesce(el.attrs.style, () => ( ""))).split(";")) {
|
|
6051
|
+
const i = decl.indexOf(":");
|
|
6052
|
+
if (i >= 0 && decl.slice(0, i).trim() === name) return decl.slice(i + 1).replace(/!important/, "").trim();
|
|
6053
|
+
}
|
|
6054
|
+
return el.attrs[name];
|
|
6055
|
+
}
|
|
6056
|
+
function urlId(value) {
|
|
6057
|
+
return _nullishCoalesce(_optionalChain([/^url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/, 'access', _128 => _128.exec, 'call', _129 => _129((_nullishCoalesce(value, () => ( ""))).trim()), 'optionalAccess', _130 => _130[1]]), () => ( null));
|
|
6058
|
+
}
|
|
6059
|
+
function clipRulesAsFillRules(el) {
|
|
6060
|
+
const attrs = { ...el.attrs };
|
|
6061
|
+
const rule = attrOrStyle(el, "clip-rule");
|
|
6062
|
+
if (rule) attrs["fill-rule"] = rule;
|
|
6063
|
+
return { ...el, attrs, children: el.children.map(clipRulesAsFillRules) };
|
|
6064
|
+
}
|
|
5405
6065
|
function collectFilters(el, raw) {
|
|
5406
6066
|
if (el.name === "filter" && el.attrs.id) raw.set(el.attrs.id, el);
|
|
5407
6067
|
for (const c of el.children) collectFilters(c, raw);
|
|
@@ -5459,9 +6119,9 @@ function resolveGradient(id, raw) {
|
|
|
5459
6119
|
for (let el = first; el && !chain.includes(el) && chain.length < 32; ) {
|
|
5460
6120
|
chain.push(el);
|
|
5461
6121
|
const href = _nullishCoalesce(el.attrs.href, () => ( el.attrs["xlink:href"]));
|
|
5462
|
-
el = _optionalChain([href, 'optionalAccess',
|
|
6122
|
+
el = _optionalChain([href, 'optionalAccess', _131 => _131.startsWith, 'call', _132 => _132("#")]) ? raw.get(href.slice(1)) : void 0;
|
|
5463
6123
|
}
|
|
5464
|
-
const attr = (name) => _optionalChain([chain, 'access',
|
|
6124
|
+
const attr = (name) => _optionalChain([chain, 'access', _133 => _133.find, 'call', _134 => _134((el) => el.attrs[name] !== void 0), 'optionalAccess', _135 => _135.attrs, 'access', _136 => _136[name]]);
|
|
5465
6125
|
const stops = _nullishCoalesce(chain.map(readStops).find((s) => s.length), () => ( []));
|
|
5466
6126
|
if (!stops.length) return null;
|
|
5467
6127
|
const user = attr("gradientUnits") === "userSpaceOnUse";
|
|
@@ -5540,6 +6200,9 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5540
6200
|
collectGradients(root, rawGradients);
|
|
5541
6201
|
const rawFilters = /* @__PURE__ */ new Map();
|
|
5542
6202
|
collectFilters(root, rawFilters);
|
|
6203
|
+
const rawMasks = /* @__PURE__ */ new Map();
|
|
6204
|
+
collectMasks(root, rawMasks);
|
|
6205
|
+
const resolving = /* @__PURE__ */ new Set();
|
|
5543
6206
|
const filtersOf = (value) => {
|
|
5544
6207
|
const url = /^url\(\s*['"]?#([^'")\s]+)['"]?\s*\)/.exec((_nullishCoalesce(value, () => ( ""))).trim());
|
|
5545
6208
|
const el = url ? rawFilters.get(url[1]) : void 0;
|
|
@@ -5628,7 +6291,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5628
6291
|
const stackedPath = (g, _style, m, meta) => {
|
|
5629
6292
|
const fillEl = g.children.find((c) => c.name === "path" && c.attrs["data-vector-part"] === "fill");
|
|
5630
6293
|
const subpaths = fillEl ? shapeOf(fillEl) : null;
|
|
5631
|
-
if (!_optionalChain([subpaths, 'optionalAccess',
|
|
6294
|
+
if (!_optionalChain([subpaths, 'optionalAccess', _137 => _137.length])) return null;
|
|
5632
6295
|
const parse = (v2) => {
|
|
5633
6296
|
try {
|
|
5634
6297
|
return v2 ? JSON.parse(v2) : [];
|
|
@@ -5647,7 +6310,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5647
6310
|
const key = (n) => JSON.stringify([n.subpaths, _nullishCoalesce(n.transform, () => ( null)), _nullishCoalesce(n.opacity, () => ( 1)), n.visible !== false, _nullishCoalesce(n.filters, () => ( null)), _nullishCoalesce(n.blendMode, () => ( "normal")), _nullishCoalesce(n.fillRule, () => ( "nonzero")), _nullishCoalesce(n.booleanOperation, () => ( null))]);
|
|
5648
6311
|
for (const n of nodes2) {
|
|
5649
6312
|
const prev = out[out.length - 1];
|
|
5650
|
-
if (_optionalChain([prev, 'optionalAccess',
|
|
6313
|
+
if (_optionalChain([prev, 'optionalAccess', _138 => _138.type]) === "path" && n.type === "path" && key(prev) === key(n)) {
|
|
5651
6314
|
const fills = vectorFills(n);
|
|
5652
6315
|
const strokesBefore = vectorStrokes(prev);
|
|
5653
6316
|
if (!(fills.length && strokesBefore.length)) {
|
|
@@ -5665,7 +6328,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5665
6328
|
const part = (name) => g.children.find((c) => c.name === "path" && c.attrs["data-vector-part"] === name);
|
|
5666
6329
|
const fillEl = part("fill");
|
|
5667
6330
|
const subpaths = fillEl ? shapeOf(fillEl) : null;
|
|
5668
|
-
if (!fillEl || !_optionalChain([subpaths, 'optionalAccess',
|
|
6331
|
+
if (!fillEl || !_optionalChain([subpaths, 'optionalAccess', _139 => _139.length])) return null;
|
|
5669
6332
|
const a = g.attrs;
|
|
5670
6333
|
const fs = readStyle(fillEl, style);
|
|
5671
6334
|
const strokeEl = part("stroke");
|
|
@@ -5702,7 +6365,7 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5702
6365
|
...profile.length ? { strokeWidthProfile: profile } : {},
|
|
5703
6366
|
...keptCap ? { strokeLinecap: keptCap } : {},
|
|
5704
6367
|
...keptJoin ? { strokeLinejoin: keptJoin } : {},
|
|
5705
|
-
..._optionalChain([keptDash, 'optionalAccess',
|
|
6368
|
+
..._optionalChain([keptDash, 'optionalAccess', _140 => _140.length]) ? { strokeDasharray: keptDash } : {}
|
|
5706
6369
|
};
|
|
5707
6370
|
return placed(node, m);
|
|
5708
6371
|
};
|
|
@@ -5738,68 +6401,148 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
5738
6401
|
const out = [];
|
|
5739
6402
|
for (const child of el.children) {
|
|
5740
6403
|
if (SKIP.has(child.name)) continue;
|
|
5741
|
-
const
|
|
5742
|
-
|
|
5743
|
-
const opacity = child.attrs.opacity !== void 0 ? parseFloat(child.attrs.opacity) : void 0;
|
|
5744
|
-
const hidden = child.attrs.display === "none" || child.attrs.visibility === "hidden";
|
|
5745
|
-
const blendMode = vectorBlendModeFromCss(s.mixBlendMode);
|
|
5746
|
-
const filters = filtersOf(s.filter);
|
|
5747
|
-
const meta = {
|
|
5748
|
-
...child.attrs["inkscape:label"] || child.attrs["data-name"] ? { name: _nullishCoalesce(child.attrs["inkscape:label"], () => ( child.attrs["data-name"])) } : {},
|
|
5749
|
-
...opacity !== void 0 && Number.isFinite(opacity) && opacity < 1 ? { opacity } : {},
|
|
5750
|
-
...hidden ? { visible: false } : {},
|
|
5751
|
-
...blendMode && blendMode !== "normal" ? { blendMode } : {},
|
|
5752
|
-
...filters.length ? { filters } : {}
|
|
5753
|
-
};
|
|
5754
|
-
if (child.attrs["data-vector-blend-step"] !== void 0) continue;
|
|
5755
|
-
const operation = child.attrs["data-vector-boolean-operation"];
|
|
5756
|
-
if (BOOLEAN_OPERATIONS.includes(operation)) meta.booleanOperation = operation;
|
|
5757
|
-
if (child.name === "g" && child.attrs["data-vector-live"] !== void 0) {
|
|
5758
|
-
const node2 = liveNode(child, s, m, meta);
|
|
5759
|
-
if (node2) out.push(node2);
|
|
5760
|
-
continue;
|
|
5761
|
-
}
|
|
5762
|
-
if (child.name === "g" && child.attrs["data-vector-path"] !== void 0 && child.attrs["data-vector-fills"] !== void 0) {
|
|
5763
|
-
const node2 = stackedPath(child, s, m, meta);
|
|
5764
|
-
if (node2) out.push(node2);
|
|
5765
|
-
continue;
|
|
5766
|
-
}
|
|
5767
|
-
if (child.name === "g" && child.attrs["data-vector-path"] !== void 0) {
|
|
5768
|
-
const node2 = mergedPath(child, s, m, meta);
|
|
5769
|
-
if (node2) out.push(node2);
|
|
5770
|
-
continue;
|
|
5771
|
-
}
|
|
5772
|
-
if (child.name === "g" || child.name === "svg" || child.name === "a" || child.name === "switch") {
|
|
5773
|
-
const children = visit(child, s, m);
|
|
5774
|
-
if (!children.length) continue;
|
|
5775
|
-
const group = { id: idFor(child), type: "group", ...meta, children };
|
|
5776
|
-
const blend = child.name === "g" ? blendFromAttribute(child.attrs["data-vector-blend"], m) : null;
|
|
5777
|
-
if (blend) group.blend = blend;
|
|
5778
|
-
out.push(group);
|
|
5779
|
-
continue;
|
|
5780
|
-
}
|
|
5781
|
-
const subpaths = shapeOf(child);
|
|
5782
|
-
if (!subpaths || !subpaths.length) continue;
|
|
5783
|
-
const node = placed(
|
|
5784
|
-
withOpacities(
|
|
5785
|
-
{
|
|
5786
|
-
id: idFor(child),
|
|
5787
|
-
type: "path",
|
|
5788
|
-
...meta,
|
|
5789
|
-
subpaths,
|
|
5790
|
-
fill: child.name === "line" ? null : paint(s.fill),
|
|
5791
|
-
stroke: paint(s.stroke),
|
|
5792
|
-
...strokeStyle(s)
|
|
5793
|
-
},
|
|
5794
|
-
s
|
|
5795
|
-
),
|
|
5796
|
-
m
|
|
5797
|
-
);
|
|
5798
|
-
out.push(node);
|
|
6404
|
+
const nodes2 = visitOne(child, style, matrix);
|
|
6405
|
+
out.push(...nodes2.length ? masked(child, nodes2, _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parseSvgTransform(child.attrs.transform), matrix)) : nodes2);
|
|
5799
6406
|
}
|
|
5800
6407
|
return options.mergeStackedShapes ? mergeStacked(out) : out;
|
|
5801
6408
|
};
|
|
5802
|
-
|
|
6409
|
+
let rootStyle = { fill: "#000", stroke: "none", strokeWidth: "" };
|
|
6410
|
+
const bboxMatrix = (nodes2) => {
|
|
6411
|
+
const b = unionBounds(nodes2.map((n) => vectorNodeBounds(n)));
|
|
6412
|
+
return b && b.width > 0 && b.height > 0 ? [b.width, 0, 0, b.height, b.x, b.y] : null;
|
|
6413
|
+
};
|
|
6414
|
+
const maskNode = (el, m, nodes2, units) => {
|
|
6415
|
+
const id = el.attrs.id;
|
|
6416
|
+
if (!id || resolving.has(id)) return null;
|
|
6417
|
+
let space = m;
|
|
6418
|
+
if (units === "objectBoundingBox") {
|
|
6419
|
+
const box = bboxMatrix(nodes2);
|
|
6420
|
+
if (!box) return null;
|
|
6421
|
+
space = box;
|
|
6422
|
+
}
|
|
6423
|
+
resolving.add(id);
|
|
6424
|
+
const isClip = el.name === "clipPath";
|
|
6425
|
+
const content = isClip ? clipRulesAsFillRules(el) : el;
|
|
6426
|
+
const inner = visit(content, readStyle(content, rootStyle), _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parseSvgTransform(el.attrs.transform), space));
|
|
6427
|
+
resolving.delete(id);
|
|
6428
|
+
const strip2 = (n) => n.type === "path" ? withVectorStrokes(withVectorFills({ ...n, fill: null, stroke: null }, []), []) : { ...n, children: n.children.map(strip2) };
|
|
6429
|
+
const list = isClip ? inner.map(strip2) : inner;
|
|
6430
|
+
if (!list.length) return null;
|
|
6431
|
+
return list.length === 1 ? list[0] : { id: idFor({ name: "g", attrs: {}, children: [] }), type: "group", name: isClip ? "Clip" : "Mask", children: list };
|
|
6432
|
+
};
|
|
6433
|
+
const masked = (el, nodes2, m) => {
|
|
6434
|
+
let out = nodes2;
|
|
6435
|
+
const clipEl = rawMasks.get(_nullishCoalesce(urlId(attrOrStyle(el, "clip-path")), () => ( "")));
|
|
6436
|
+
if (_optionalChain([clipEl, 'optionalAccess', _141 => _141.name]) === "clipPath") {
|
|
6437
|
+
const source = maskNode(clipEl, m, out, clipEl.attrs.clipPathUnits);
|
|
6438
|
+
if (source) out = [{ id: idFor({ name: "g", attrs: {}, children: [] }), type: "group", name: "Clip Group", mask: { type: "clip" }, children: [source, ...out] }];
|
|
6439
|
+
}
|
|
6440
|
+
const maskEl = rawMasks.get(_nullishCoalesce(urlId(attrOrStyle(el, "mask")), () => ( "")));
|
|
6441
|
+
if (_optionalChain([maskEl, 'optionalAccess', _142 => _142.name]) === "mask") {
|
|
6442
|
+
const source = maskNode(maskEl, m, out, maskEl.attrs.maskContentUnits);
|
|
6443
|
+
const type = attrOrStyle(maskEl, "mask-type") === "alpha" ? "alpha" : "luminance";
|
|
6444
|
+
if (source) out = [{ id: idFor({ name: "g", attrs: {}, children: [] }), type: "group", name: "Opacity Mask", mask: { type }, children: [source, ...out] }];
|
|
6445
|
+
}
|
|
6446
|
+
return out;
|
|
6447
|
+
};
|
|
6448
|
+
const maskGroup = (g, style, m, meta) => {
|
|
6449
|
+
let raw = null;
|
|
6450
|
+
try {
|
|
6451
|
+
raw = JSON.parse(g.attrs["data-vector-mask"]);
|
|
6452
|
+
} catch (e8) {
|
|
6453
|
+
raw = null;
|
|
6454
|
+
}
|
|
6455
|
+
const mask = sanitizeVectorMask(raw);
|
|
6456
|
+
const part = (name) => g.children.find((c) => c.name === "g" && c.attrs["data-vector-part"] === name);
|
|
6457
|
+
const maskedEl = part("masked");
|
|
6458
|
+
if (!mask || !maskedEl) return null;
|
|
6459
|
+
const id = idFor(g);
|
|
6460
|
+
let sourceEl = part("mask-source");
|
|
6461
|
+
if (!sourceEl) {
|
|
6462
|
+
const el = rawMasks.get(_nullishCoalesce(urlId(maskedEl.attrs.mask), () => ( "")));
|
|
6463
|
+
const invert2 = _optionalChain([el, 'optionalAccess', _143 => _143.children, 'access', _144 => _144.find, 'call', _145 => _145((c) => c.name === "g" && c.attrs["data-vector-part"] === "mask-invert")]);
|
|
6464
|
+
sourceEl = _nullishCoalesce(invert2, () => ( el));
|
|
6465
|
+
}
|
|
6466
|
+
const source = sourceEl ? visit(sourceEl, style, m)[0] : void 0;
|
|
6467
|
+
let contents = visit(maskedEl, style, m);
|
|
6468
|
+
let effects;
|
|
6469
|
+
const wrapper = contents.length === 1 && contents[0].type === "group" && contents[0].id === `${id}~content` ? contents[0] : null;
|
|
6470
|
+
if (_optionalChain([wrapper, 'optionalAccess', _146 => _146.type]) === "group") {
|
|
6471
|
+
effects = _nullishCoalesce(wrapper.effects, () => ( void 0));
|
|
6472
|
+
contents = wrapper.children;
|
|
6473
|
+
}
|
|
6474
|
+
if (!source) return contents.length ? { id, type: "group", ...meta, children: contents } : null;
|
|
6475
|
+
return { id, type: "group", ...meta, mask, ..._optionalChain([effects, 'optionalAccess', _147 => _147.length]) ? { effects } : {}, children: [source, ...contents] };
|
|
6476
|
+
};
|
|
6477
|
+
const visitOne = (child, style, matrix) => {
|
|
6478
|
+
const out = [];
|
|
6479
|
+
const m = _chunkDWGZUSEScjs.multiplyMatrices.call(void 0, parseSvgTransform(child.attrs.transform), matrix);
|
|
6480
|
+
const s = readStyle(child, style);
|
|
6481
|
+
const opacity = child.attrs.opacity !== void 0 ? parseFloat(child.attrs.opacity) : void 0;
|
|
6482
|
+
const hidden = child.attrs.display === "none" || child.attrs.visibility === "hidden";
|
|
6483
|
+
const blendMode = vectorBlendModeFromCss(s.mixBlendMode);
|
|
6484
|
+
const filters = filtersOf(s.filter);
|
|
6485
|
+
const meta = {
|
|
6486
|
+
...child.attrs["inkscape:label"] || child.attrs["data-name"] ? { name: _nullishCoalesce(child.attrs["inkscape:label"], () => ( child.attrs["data-name"])) } : {},
|
|
6487
|
+
...opacity !== void 0 && Number.isFinite(opacity) && opacity < 1 ? { opacity } : {},
|
|
6488
|
+
...hidden ? { visible: false } : {},
|
|
6489
|
+
...blendMode && blendMode !== "normal" ? { blendMode } : {},
|
|
6490
|
+
...filters.length ? { filters } : {}
|
|
6491
|
+
};
|
|
6492
|
+
if (child.attrs["data-vector-blend-step"] !== void 0) return out;
|
|
6493
|
+
const operation = child.attrs["data-vector-boolean-operation"];
|
|
6494
|
+
if (BOOLEAN_OPERATIONS.includes(operation)) meta.booleanOperation = operation;
|
|
6495
|
+
if (child.name === "g" && child.attrs["data-vector-mask"] !== void 0) {
|
|
6496
|
+
const node2 = maskGroup(child, s, m, meta);
|
|
6497
|
+
if (node2) out.push(node2);
|
|
6498
|
+
return out;
|
|
6499
|
+
}
|
|
6500
|
+
if (child.name === "g" && child.attrs["data-vector-live"] !== void 0) {
|
|
6501
|
+
const node2 = liveNode(child, s, m, meta);
|
|
6502
|
+
if (node2) out.push(node2);
|
|
6503
|
+
return out;
|
|
6504
|
+
}
|
|
6505
|
+
if (child.name === "g" && child.attrs["data-vector-path"] !== void 0 && child.attrs["data-vector-fills"] !== void 0) {
|
|
6506
|
+
const node2 = stackedPath(child, s, m, meta);
|
|
6507
|
+
if (node2) out.push(node2);
|
|
6508
|
+
return out;
|
|
6509
|
+
}
|
|
6510
|
+
if (child.name === "g" && child.attrs["data-vector-path"] !== void 0) {
|
|
6511
|
+
const node2 = mergedPath(child, s, m, meta);
|
|
6512
|
+
if (node2) out.push(node2);
|
|
6513
|
+
return out;
|
|
6514
|
+
}
|
|
6515
|
+
if (child.name === "g" || child.name === "svg" || child.name === "a" || child.name === "switch") {
|
|
6516
|
+
const children = visit(child, s, m);
|
|
6517
|
+
if (!children.length) return out;
|
|
6518
|
+
const group = { id: idFor(child), type: "group", ...meta, children };
|
|
6519
|
+
const blend = child.name === "g" ? blendFromAttribute(child.attrs["data-vector-blend"], m) : null;
|
|
6520
|
+
if (blend) group.blend = blend;
|
|
6521
|
+
out.push(group);
|
|
6522
|
+
return out;
|
|
6523
|
+
}
|
|
6524
|
+
const subpaths = shapeOf(child);
|
|
6525
|
+
if (!subpaths || !subpaths.length) return out;
|
|
6526
|
+
const node = placed(
|
|
6527
|
+
withOpacities(
|
|
6528
|
+
{
|
|
6529
|
+
id: idFor(child),
|
|
6530
|
+
type: "path",
|
|
6531
|
+
...meta,
|
|
6532
|
+
subpaths,
|
|
6533
|
+
fill: child.name === "line" ? null : paint(s.fill),
|
|
6534
|
+
stroke: paint(s.stroke),
|
|
6535
|
+
...strokeStyle(s)
|
|
6536
|
+
},
|
|
6537
|
+
s
|
|
6538
|
+
),
|
|
6539
|
+
m
|
|
6540
|
+
);
|
|
6541
|
+
out.push(node);
|
|
6542
|
+
return out;
|
|
6543
|
+
};
|
|
6544
|
+
rootStyle = readStyle(root, rootStyle);
|
|
6545
|
+
const nodes = visit(root, rootStyle, rootMatrix);
|
|
5803
6546
|
return { width, height, nodes };
|
|
5804
6547
|
}
|
|
5805
6548
|
|
|
@@ -6076,5 +6819,31 @@ function parseVectorSvg(svg, options = {}) {
|
|
|
6076
6819
|
|
|
6077
6820
|
|
|
6078
6821
|
|
|
6079
|
-
exports.VECTOR_CORNER_KINDS = VECTOR_CORNER_KINDS; exports.VECTOR_GRADIENT_TYPES = VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_SPREADS = VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_INTERPOLATIONS = VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_STROKE_GRADIENT_MODES = VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_ARROWHEADS = VECTOR_ARROWHEADS; exports.VECTOR_BLEND_MODES = VECTOR_BLEND_MODES; exports.VECTOR_BLEND_SPACINGS = VECTOR_BLEND_SPACINGS; exports.VECTOR_TOOLS = VECTOR_TOOLS; exports.VECTOR_TRANSFORM_HANDLES = VECTOR_TRANSFORM_HANDLES; exports.VECTOR_PATHFINDER_OPERATIONS = VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_EFFECT_TYPES = VECTOR_EFFECT_TYPES; exports.VECTOR_MERGE_MODES = VECTOR_MERGE_MODES; exports.VECTOR_FILTER_TYPES = VECTOR_FILTER_TYPES; exports.isVectorGradient = isVectorGradient; exports.parseVectorColor = parseVectorColor; exports.VECTOR_GRADIENT_MIN_STOPS = VECTOR_GRADIENT_MIN_STOPS; exports.gradientMidpointRemap = gradientMidpointRemap; exports.sortedVectorGradientStops = sortedVectorGradientStops; exports.vectorGradientNeedsExpansion = vectorGradientNeedsExpansion; exports.vectorGradientRamp = vectorGradientRamp; exports.sampleVectorGradient = sampleVectorGradient; exports.expandVectorGradientStops = expandVectorGradientStops; exports.samplePlainStops = samplePlainStops; exports.reverseVectorGradient = reverseVectorGradient; exports.insertVectorGradientStop = insertVectorGradientStop; exports.moveVectorGradientStop = moveVectorGradientStop; exports.removeVectorGradientStop = removeVectorGradientStop; exports.vectorGradientMidpointPosition = vectorGradientMidpointPosition; exports.vectorGradientMidpointFromPosition = vectorGradientMidpointFromPosition; exports.spanVectorGradientStops = spanVectorGradientStops; exports.hasExplicitGradientGeometry = hasExplicitGradientGeometry; exports.vectorGradientPoints = vectorGradientPoints; exports.vectorBoxMatrix = vectorBoxMatrix; exports.vectorGradientUnitsMatrix = vectorGradientUnitsMatrix; exports.vectorGradientMatrix = vectorGradientMatrix; exports.vectorGradientFocalParam = vectorGradientFocalParam; exports.vectorGradientParam = vectorGradientParam; exports.applyVectorGradientSpread = applyVectorGradientSpread; exports.vectorGradientTAt = vectorGradientTAt; exports.sampleVectorGradientAt = sampleVectorGradientAt; exports.vectorGradientAspect = vectorGradientAspect; exports.explicitVectorGradient = explicitVectorGradient; exports.pinVectorGradient = pinVectorGradient; exports.transformVectorGradient = transformVectorGradient; exports.mapVectorGradient = mapVectorGradient; exports.mapVectorPaint = mapVectorPaint; exports.transformVectorPaint = transformVectorPaint; exports.isCentredVectorGradient = isCentredVectorGradient; exports.vectorGradientHandles = vectorGradientHandles; exports.moveVectorGradientHandle = moveVectorGradientHandle; exports.setVectorGradientVector = setVectorGradientVector; exports.VECTOR_GRADIENT_MAX_PERIODS = VECTOR_GRADIENT_MAX_PERIODS; exports.periodicVectorGradientStops = periodicVectorGradientStops; exports.expandVectorGradientSpread = expandVectorGradientSpread; exports.vectorGradientArea = vectorGradientArea; exports.patternAttrs = patternAttrs; exports.vectorGradientSvgDefs = vectorGradientSvgDefs; exports.sampleVectorPaintDefAt = sampleVectorPaintDefAt; exports.sanitizeVectorGradient = sanitizeVectorGradient; exports.convertVectorGradient = convertVectorGradient; exports.defaultVectorGradient = defaultVectorGradient; exports.applyVectorGradientPatch = applyVectorGradientPatch; exports.vectorCornerAt = vectorCornerAt; exports.vectorCorners = vectorCorners; exports.cornerSetback = cornerSetback; exports.fitCornerRadius = fitCornerRadius; exports.cornerBisectorPoint = cornerBisectorPoint; exports.cornerRadiusChange = cornerRadiusChange; exports.hasVectorCorners = hasVectorCorners; exports.expandVectorCornersOf = expandVectorCornersOf; exports.expandVectorCorners = expandVectorCorners; exports.setAnchorCorner = setAnchorCorner; exports.nextVectorCornerKind = nextVectorCornerKind; exports.setSubpathCorners = setSubpathCorners; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = VECTOR_WIDTH_SAME_T; exports.VECTOR_WIDTH_PRESETS = VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = VECTOR_WIDTH_PRESET_IDS; exports.sanitizeWidthProfile = sanitizeWidthProfile; exports.isUniformWidthProfile = isUniformWidthProfile; exports.widthProfileAt = widthProfileAt; exports.widthProfileMaxScale = widthProfileMaxScale; exports.widthProfilePreset = widthProfilePreset; exports.widthProfilePresetId = widthProfilePresetId; exports.reverseWidthProfile = reverseWidthProfile; exports.mirrorWidthProfile = mirrorWidthProfile; exports.insertWidthPoint = insertWidthPoint; exports.setWidthPoint = setWidthPoint; exports.removeWidthPoints = removeWidthPoints; exports.taperWaveFactor = taperWaveFactor; exports.generateWidthProfile = generateWidthProfile; exports.VECTOR_PRESSURE_NOMINAL = VECTOR_PRESSURE_NOMINAL; exports.pressureWidthProfile = pressureWidthProfile; exports.dashIntervals = dashIntervals; exports.variableStrokeRings = variableStrokeRings; exports.variableStrokeOutline = variableStrokeOutline; exports.nearestStrokePosition = nearestStrokePosition; exports.strokePositionPoint = strokePositionPoint; exports.isClosedBezierShape = isClosedBezierShape; exports.effectiveStrokeAlign = effectiveStrokeAlign; exports.strokeWidthProfileOf = strokeWidthProfileOf; exports.hasStrokeExtras = hasStrokeExtras; exports.vectorStrokeLineArea = vectorStrokeLineArea; exports.arrowheadWeight = arrowheadWeight; exports.arrowheadInset = arrowheadInset; exports.arrowheadPath = arrowheadPath; exports.vectorStrokeParts = vectorStrokeParts; exports.vectorStrokeOutlinePath = vectorStrokeOutlinePath; exports.hitTestVectorStroke = hitTestVectorStroke; exports.vectorStrokeReach = vectorStrokeReach; exports.VECTOR_STROKE_SETTING_KEYS = VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_BLEND_MODE_LABELS = VECTOR_BLEND_MODE_LABELS; exports.isVectorBlendMode = isVectorBlendMode; exports.vectorBlendModeCss = vectorBlendModeCss; exports.vectorBlendModeFromCss = vectorBlendModeFromCss; exports.isPlainVectorPaintLayer = isPlainVectorPaintLayer; exports.isDrawnVectorPaintLayer = isDrawnVectorPaintLayer; exports.vectorFills = vectorFills; exports.vectorStrokeSettings = vectorStrokeSettings; exports.vectorStrokes = vectorStrokes; exports.hasVectorPaintStacks = hasVectorPaintStacks; exports.withVectorFills = withVectorFills; exports.withVectorStrokes = withVectorStrokes; exports.normalizeVectorPaintStacks = normalizeVectorPaintStacks; exports.sanitizeVectorFills = sanitizeVectorFills; exports.sanitizeVectorStrokeSettings = sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = sanitizeVectorStrokes; exports.vectorPaintLayerNodes = vectorPaintLayerNodes; exports.needsVectorPaintLayers = needsVectorPaintLayers; exports.vectorStrokeStackReach = vectorStrokeStackReach; exports.hitTestVectorPaintLayer = hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = hitTestVectorPaintStack; exports.vectorStacksHaveGradient = vectorStacksHaveGradient; exports.newVectorStrokeLayer = newVectorStrokeLayer; exports.vectorTargetPaint = vectorTargetPaint; exports.withVectorTargetPaint = withVectorTargetPaint; exports.effectPathLength = effectPathLength; exports.effectPathVertexCount = effectPathVertexCount; exports.trimIntervals = trimIntervals; exports.trimPaths = trimPaths; exports.trimPathsIndividually = trimPathsIndividually; exports.puckerBloatPaths = puckerBloatPaths; exports.roundCornerPaths = roundCornerPaths; exports.offsetPaths = offsetPaths; exports.twistPaths = twistPaths; exports.zigzagPaths = zigzagPaths; exports.wigglePaths = wigglePaths; exports.mergePaths = mergePaths; exports.vectorRepeaterCopies = vectorRepeaterCopies; exports.repeatPaths = repeatPaths; exports.pathsCenter = pathsCenter; exports.mapVectorPoints = mapVectorPoints; exports.mapVectorSubpaths = mapVectorSubpaths; exports.mapBezierPath = mapBezierPath; exports.vectorMeshFromOutline = vectorMeshFromOutline; exports.vectorMeshOutline = vectorMeshOutline; exports.VECTOR_EFFECT_DEFAULTS = VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_PARAM_SPECS = VECTOR_EFFECT_PARAM_SPECS; exports.vectorEnvelopeMesh = vectorEnvelopeMesh; exports.vectorEnvelopeMap = vectorEnvelopeMap; exports.normalizeVectorEffectParams = normalizeVectorEffectParams; exports.createVectorEffect = createVectorEffect; exports.activeVectorEffects = activeVectorEffects; exports.hasOwnVectorAppearance = hasOwnVectorAppearance; exports.hasVectorAppearance = hasVectorAppearance; exports.isVectorLiveBoolean = isVectorLiveBoolean; exports.vectorOperandOperation = vectorOperandOperation; exports.vectorLiveBooleanSteps = vectorLiveBooleanSteps; exports.clearVectorLiveBooleanCache = clearVectorLiveBooleanCache; exports.foldVectorBooleanOperands = foldVectorBooleanOperands; exports.applyVectorEffects = applyVectorEffects; exports.vectorEffectInputPaths = vectorEffectInputPaths; exports.vectorEffectInputBounds = vectorEffectInputBounds; exports.vectorNodeEnvelope = vectorNodeEnvelope; exports.vectorEnvelopeFrame = vectorEnvelopeFrame; exports.vectorAppearanceShapes = vectorAppearanceShapes; exports.vectorAppearanceOutline = vectorAppearanceOutline; exports.vectorAppearanceNodes = vectorAppearanceNodes; exports.expandVectorAppearance = expandVectorAppearance; exports.expandVectorAppearances = expandVectorAppearances; exports.sanitizeVectorEffects = sanitizeVectorEffects; exports.transformVectorEffects = transformVectorEffects; exports.vectorEnteredGroups = vectorEnteredGroups; exports.cloneAnchor = cloneAnchor; exports.cloneSubpath = cloneSubpath; exports.cloneVectorNode = cloneVectorNode; exports.cloneVectorDocument = cloneVectorDocument; exports.hasPaint = hasPaint; exports.subpathSegmentCount = subpathSegmentCount; exports.subpathSegment = subpathSegment; exports.subpathsToBezier = subpathsToBezier; exports.vectorNodeToBezier = vectorNodeToBezier; exports.vectorPathData = vectorPathData; exports.inferAnchorType = inferAnchorType; exports.bezierToSubpaths = bezierToSubpaths; exports.walkVectorNodes = walkVectorNodes; exports.findVectorNode = findVectorNode; exports.locateVectorNode = locateVectorNode; exports.collectPathNodes = collectPathNodes; exports.nodeMatrix = nodeMatrix; exports.vectorPathWorldBezier = vectorPathWorldBezier; exports.vectorNodeBounds = vectorNodeBounds; exports.unionBounds = unionBounds; exports.boundsIntersect = boundsIntersect; exports.boundsFromPoints = boundsFromPoints; exports.hitTestVectorNode = hitTestVectorNode; exports.vectorStrokeOutline = vectorStrokeOutline; exports.hitTestVectorNodes = hitTestVectorNodes; exports.nearestSegment = nearestSegment; exports.transformVectorNode = transformVectorNode; exports.vectorNodeRotation = vectorNodeRotation; exports.vectorWorldMatrix = vectorWorldMatrix; exports.vectorParentMatrix = vectorParentMatrix; exports.translateAnchor = translateAnchor; exports.moveAnchorHandle = moveAnchorHandle; exports.convertAnchor = convertAnchor; exports.insertAnchor = insertAnchor; exports.removeAnchors = removeAnchors; exports.reverseSubpath = reverseSubpath; exports.KAPPA = KAPPA2; exports.rectSubpath = rectSubpath; exports.ellipseSubpath = ellipseSubpath; exports.polygonSubpath = polygonSubpath; exports.starSubpath = starSubpath; exports.lineSubpath = lineSubpath; exports.roundSubpaths = roundSubpaths; exports.subpathToMorphContour = subpathToMorphContour; exports.morphContourToSubpath = morphContourToSubpath; exports.refineMorphContour = refineMorphContour; exports.reverseMorphContour = reverseMorphContour; exports.turnMorphContour = turnMorphContour; exports.correspondMorphContours = correspondMorphContours; exports.morphPathsCross = morphPathsCross; exports.interpolateMorphContours = interpolateMorphContours; exports.interpolateRigidMatrix = interpolateRigidMatrix; exports.interpolateVectorColor = interpolateVectorColor; exports.resampleGradientStops = resampleGradientStops; exports.interpolateVectorPaint = interpolateVectorPaint; exports.interpolateWidthProfiles = interpolateWidthProfiles; exports.interpolateVectorStyle = interpolateVectorStyle; exports.createVectorMorph = createVectorMorph; exports.interpolateVectorPaths = interpolateVectorPaths; exports.evaluateVectorPathKeyframes = evaluateVectorPathKeyframes; exports.VECTOR_FILTER_DEFAULTS = VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_PARAM_SPECS = VECTOR_FILTER_PARAM_SPECS; exports.isVectorFilterType = isVectorFilterType; exports.normalizeVectorFilterParams = normalizeVectorFilterParams; exports.vectorFilterParamKeys = vectorFilterParamKeys; exports.createVectorFilter = createVectorFilter; exports.sanitizeVectorFilters = sanitizeVectorFilters; exports.activeVectorFilters = activeVectorFilters; exports.vectorFilterReach = vectorFilterReach; exports.vectorFilterSvg = vectorFilterSvg; exports.vectorFilterMarkup = vectorFilterMarkup; exports.VECTOR_FILTER_MENU = VECTOR_FILTER_MENU; exports.vectorStrokeGradientDefs = vectorStrokeGradientDefs; exports.vectorCornersAttribute = vectorCornersAttribute; exports.applyVectorCornersAttribute = applyVectorCornersAttribute; exports.vectorPathLocalBounds = vectorPathLocalBounds; exports.vectorPaintToSvg = vectorPaintToSvg; exports.vectorStrokeSvgParts = vectorStrokeSvgParts; exports.vectorNodeLocalPaintBounds = vectorNodeLocalPaintBounds; exports.vectorNodeFilterSvg = vectorNodeFilterSvg; exports.widthProfileToAttribute = widthProfileToAttribute; exports.widthProfileFromAttribute = widthProfileFromAttribute; exports.vectorDocumentToSvg = vectorDocumentToSvg; exports.parseSvgTransform = parseSvgTransform; exports.parseVectorSvg = parseVectorSvg;
|
|
6080
|
-
|
|
6822
|
+
|
|
6823
|
+
|
|
6824
|
+
|
|
6825
|
+
|
|
6826
|
+
|
|
6827
|
+
|
|
6828
|
+
|
|
6829
|
+
|
|
6830
|
+
|
|
6831
|
+
|
|
6832
|
+
|
|
6833
|
+
|
|
6834
|
+
|
|
6835
|
+
|
|
6836
|
+
|
|
6837
|
+
|
|
6838
|
+
|
|
6839
|
+
|
|
6840
|
+
|
|
6841
|
+
|
|
6842
|
+
|
|
6843
|
+
|
|
6844
|
+
|
|
6845
|
+
|
|
6846
|
+
|
|
6847
|
+
|
|
6848
|
+
exports.VECTOR_CORNER_KINDS = VECTOR_CORNER_KINDS; exports.VECTOR_GRADIENT_TYPES = VECTOR_GRADIENT_TYPES; exports.VECTOR_GRADIENT_SPREADS = VECTOR_GRADIENT_SPREADS; exports.VECTOR_GRADIENT_INTERPOLATIONS = VECTOR_GRADIENT_INTERPOLATIONS; exports.VECTOR_STROKE_GRADIENT_MODES = VECTOR_STROKE_GRADIENT_MODES; exports.VECTOR_ARROWHEADS = VECTOR_ARROWHEADS; exports.VECTOR_BLEND_MODES = VECTOR_BLEND_MODES; exports.VECTOR_BLEND_SPACINGS = VECTOR_BLEND_SPACINGS; exports.VECTOR_MASK_TYPES = VECTOR_MASK_TYPES; exports.VECTOR_TOOLS = VECTOR_TOOLS; exports.VECTOR_TRANSFORM_HANDLES = VECTOR_TRANSFORM_HANDLES; exports.VECTOR_PATHFINDER_OPERATIONS = VECTOR_PATHFINDER_OPERATIONS; exports.VECTOR_EFFECT_TYPES = VECTOR_EFFECT_TYPES; exports.VECTOR_MERGE_MODES = VECTOR_MERGE_MODES; exports.VECTOR_FILTER_TYPES = VECTOR_FILTER_TYPES; exports.isVectorGradient = isVectorGradient; exports.parseVectorColor = parseVectorColor; exports.VECTOR_GRADIENT_MIN_STOPS = VECTOR_GRADIENT_MIN_STOPS; exports.gradientMidpointRemap = gradientMidpointRemap; exports.sortedVectorGradientStops = sortedVectorGradientStops; exports.vectorGradientNeedsExpansion = vectorGradientNeedsExpansion; exports.vectorGradientRamp = vectorGradientRamp; exports.sampleVectorGradient = sampleVectorGradient; exports.expandVectorGradientStops = expandVectorGradientStops; exports.samplePlainStops = samplePlainStops; exports.reverseVectorGradient = reverseVectorGradient; exports.insertVectorGradientStop = insertVectorGradientStop; exports.moveVectorGradientStop = moveVectorGradientStop; exports.removeVectorGradientStop = removeVectorGradientStop; exports.vectorGradientMidpointPosition = vectorGradientMidpointPosition; exports.vectorGradientMidpointFromPosition = vectorGradientMidpointFromPosition; exports.spanVectorGradientStops = spanVectorGradientStops; exports.hasExplicitGradientGeometry = hasExplicitGradientGeometry; exports.vectorGradientPoints = vectorGradientPoints; exports.vectorBoxMatrix = vectorBoxMatrix; exports.vectorGradientUnitsMatrix = vectorGradientUnitsMatrix; exports.vectorGradientMatrix = vectorGradientMatrix; exports.vectorGradientFocalParam = vectorGradientFocalParam; exports.vectorGradientParam = vectorGradientParam; exports.applyVectorGradientSpread = applyVectorGradientSpread; exports.vectorGradientTAt = vectorGradientTAt; exports.sampleVectorGradientAt = sampleVectorGradientAt; exports.vectorGradientAspect = vectorGradientAspect; exports.explicitVectorGradient = explicitVectorGradient; exports.pinVectorGradient = pinVectorGradient; exports.transformVectorGradient = transformVectorGradient; exports.mapVectorGradient = mapVectorGradient; exports.mapVectorPaint = mapVectorPaint; exports.transformVectorPaint = transformVectorPaint; exports.isCentredVectorGradient = isCentredVectorGradient; exports.vectorGradientHandles = vectorGradientHandles; exports.moveVectorGradientHandle = moveVectorGradientHandle; exports.setVectorGradientVector = setVectorGradientVector; exports.VECTOR_GRADIENT_MAX_PERIODS = VECTOR_GRADIENT_MAX_PERIODS; exports.periodicVectorGradientStops = periodicVectorGradientStops; exports.expandVectorGradientSpread = expandVectorGradientSpread; exports.vectorGradientArea = vectorGradientArea; exports.patternAttrs = patternAttrs; exports.vectorGradientSvgDefs = vectorGradientSvgDefs; exports.sampleVectorPaintDefAt = sampleVectorPaintDefAt; exports.sanitizeVectorGradient = sanitizeVectorGradient; exports.convertVectorGradient = convertVectorGradient; exports.defaultVectorGradient = defaultVectorGradient; exports.applyVectorGradientPatch = applyVectorGradientPatch; exports.vectorCornerAt = vectorCornerAt; exports.vectorCorners = vectorCorners; exports.cornerSetback = cornerSetback; exports.fitCornerRadius = fitCornerRadius; exports.cornerBisectorPoint = cornerBisectorPoint; exports.cornerRadiusChange = cornerRadiusChange; exports.hasVectorCorners = hasVectorCorners; exports.expandVectorCornersOf = expandVectorCornersOf; exports.expandVectorCorners = expandVectorCorners; exports.setAnchorCorner = setAnchorCorner; exports.nextVectorCornerKind = nextVectorCornerKind; exports.setSubpathCorners = setSubpathCorners; exports.VECTOR_WIDTH_PROFILE_MAX_POINTS = VECTOR_WIDTH_PROFILE_MAX_POINTS; exports.VECTOR_WIDTH_PROFILE_MAX_SCALE = VECTOR_WIDTH_PROFILE_MAX_SCALE; exports.VECTOR_WIDTH_SAME_T = VECTOR_WIDTH_SAME_T; exports.VECTOR_WIDTH_PRESETS = VECTOR_WIDTH_PRESETS; exports.VECTOR_WIDTH_PRESET_IDS = VECTOR_WIDTH_PRESET_IDS; exports.sanitizeWidthProfile = sanitizeWidthProfile; exports.isUniformWidthProfile = isUniformWidthProfile; exports.widthProfileAt = widthProfileAt; exports.widthProfileMaxScale = widthProfileMaxScale; exports.widthProfilePreset = widthProfilePreset; exports.widthProfilePresetId = widthProfilePresetId; exports.reverseWidthProfile = reverseWidthProfile; exports.mirrorWidthProfile = mirrorWidthProfile; exports.insertWidthPoint = insertWidthPoint; exports.setWidthPoint = setWidthPoint; exports.removeWidthPoints = removeWidthPoints; exports.taperWaveFactor = taperWaveFactor; exports.generateWidthProfile = generateWidthProfile; exports.VECTOR_PRESSURE_NOMINAL = VECTOR_PRESSURE_NOMINAL; exports.pressureWidthProfile = pressureWidthProfile; exports.dashIntervals = dashIntervals; exports.variableStrokeRings = variableStrokeRings; exports.variableStrokeOutline = variableStrokeOutline; exports.nearestStrokePosition = nearestStrokePosition; exports.strokePositionPoint = strokePositionPoint; exports.isClosedBezierShape = isClosedBezierShape; exports.effectiveStrokeAlign = effectiveStrokeAlign; exports.strokeWidthProfileOf = strokeWidthProfileOf; exports.hasStrokeExtras = hasStrokeExtras; exports.vectorStrokeLineArea = vectorStrokeLineArea; exports.arrowheadWeight = arrowheadWeight; exports.arrowheadInset = arrowheadInset; exports.arrowheadPath = arrowheadPath; exports.vectorStrokeParts = vectorStrokeParts; exports.vectorStrokeOutlinePath = vectorStrokeOutlinePath; exports.hitTestVectorStroke = hitTestVectorStroke; exports.vectorStrokeReach = vectorStrokeReach; exports.VECTOR_STROKE_SETTING_KEYS = VECTOR_STROKE_SETTING_KEYS; exports.VECTOR_BLEND_MODE_LABELS = VECTOR_BLEND_MODE_LABELS; exports.isVectorBlendMode = isVectorBlendMode; exports.vectorBlendModeCss = vectorBlendModeCss; exports.vectorBlendModeFromCss = vectorBlendModeFromCss; exports.isPlainVectorPaintLayer = isPlainVectorPaintLayer; exports.isDrawnVectorPaintLayer = isDrawnVectorPaintLayer; exports.vectorFills = vectorFills; exports.vectorStrokeSettings = vectorStrokeSettings; exports.vectorStrokes = vectorStrokes; exports.hasVectorPaintStacks = hasVectorPaintStacks; exports.withVectorFills = withVectorFills; exports.withVectorStrokes = withVectorStrokes; exports.normalizeVectorPaintStacks = normalizeVectorPaintStacks; exports.sanitizeVectorFills = sanitizeVectorFills; exports.sanitizeVectorStrokeSettings = sanitizeVectorStrokeSettings; exports.sanitizeVectorStrokes = sanitizeVectorStrokes; exports.vectorPaintLayerNodes = vectorPaintLayerNodes; exports.needsVectorPaintLayers = needsVectorPaintLayers; exports.vectorStrokeStackReach = vectorStrokeStackReach; exports.hitTestVectorPaintLayer = hitTestVectorPaintLayer; exports.hitTestVectorPaintStack = hitTestVectorPaintStack; exports.vectorStacksHaveGradient = vectorStacksHaveGradient; exports.newVectorStrokeLayer = newVectorStrokeLayer; exports.vectorTargetPaint = vectorTargetPaint; exports.withVectorTargetPaint = withVectorTargetPaint; exports.effectPathLength = effectPathLength; exports.effectPathVertexCount = effectPathVertexCount; exports.trimIntervals = trimIntervals; exports.trimPaths = trimPaths; exports.trimPathsIndividually = trimPathsIndividually; exports.puckerBloatPaths = puckerBloatPaths; exports.roundCornerPaths = roundCornerPaths; exports.offsetPaths = offsetPaths; exports.twistPaths = twistPaths; exports.zigzagPaths = zigzagPaths; exports.wigglePaths = wigglePaths; exports.mergePaths = mergePaths; exports.vectorRepeaterCopies = vectorRepeaterCopies; exports.repeatPaths = repeatPaths; exports.pathsCenter = pathsCenter; exports.mapVectorPoints = mapVectorPoints; exports.mapVectorSubpaths = mapVectorSubpaths; exports.mapBezierPath = mapBezierPath; exports.splitIntoFaces = splitIntoFaces; exports.knifePath = knifePath; exports.eraserRegion = eraserRegion; exports.eraseFromFill = eraseFromFill; exports.eraseFromOutline = eraseFromOutline; exports.polylineBounds = polylineBounds; exports.simplifyPolyline = simplifyPolyline; exports.VECTOR_FILTER_DEFAULTS = VECTOR_FILTER_DEFAULTS; exports.VECTOR_FILTER_LABELS = VECTOR_FILTER_LABELS; exports.VECTOR_FILTER_PARAM_SPECS = VECTOR_FILTER_PARAM_SPECS; exports.isVectorFilterType = isVectorFilterType; exports.normalizeVectorFilterParams = normalizeVectorFilterParams; exports.vectorFilterParamKeys = vectorFilterParamKeys; exports.createVectorFilter = createVectorFilter; exports.sanitizeVectorFilters = sanitizeVectorFilters; exports.activeVectorFilters = activeVectorFilters; exports.vectorFilterReach = vectorFilterReach; exports.vectorFilterSvg = vectorFilterSvg; exports.vectorFilterMarkup = vectorFilterMarkup; exports.VECTOR_FILTER_MENU = VECTOR_FILTER_MENU; exports.isVectorMaskType = isVectorMaskType; exports.sanitizeVectorMask = sanitizeVectorMask; exports.isVectorMaskGroup = isVectorMaskGroup; exports.isVectorMaskActive = isVectorMaskActive; exports.vectorMaskSource = vectorMaskSource; exports.vectorMaskContents = vectorMaskContents; exports.vectorMaskOwner = vectorMaskOwner; exports.vectorMaskSummary = vectorMaskSummary; exports.vectorMaskRegionShapes = vectorMaskRegionShapes; exports.vectorMaskRegion = vectorMaskRegion; exports.vectorMaskRegionPath = vectorMaskRegionPath; exports.vectorMaskContains = vectorMaskContains; exports.vectorMaskedShapes = vectorMaskedShapes; exports.vectorMaskedGeometry = vectorMaskedGeometry; exports.vectorMaskedLocalBounds = vectorMaskedLocalBounds; exports.vectorMaskContentBounds = vectorMaskContentBounds; exports.vectorMaskRenderData = vectorMaskRenderData; exports.vectorMeshFromOutline = vectorMeshFromOutline; exports.vectorMeshOutline = vectorMeshOutline; exports.VECTOR_EFFECT_DEFAULTS = VECTOR_EFFECT_DEFAULTS; exports.VECTOR_EFFECT_LABELS = VECTOR_EFFECT_LABELS; exports.VECTOR_EFFECT_PARAM_SPECS = VECTOR_EFFECT_PARAM_SPECS; exports.vectorEnvelopeMesh = vectorEnvelopeMesh; exports.vectorEnvelopeMap = vectorEnvelopeMap; exports.normalizeVectorEffectParams = normalizeVectorEffectParams; exports.createVectorEffect = createVectorEffect; exports.activeVectorEffects = activeVectorEffects; exports.hasOwnVectorAppearance = hasOwnVectorAppearance; exports.hasVectorAppearance = hasVectorAppearance; exports.isVectorLiveBoolean = isVectorLiveBoolean; exports.vectorOperandOperation = vectorOperandOperation; exports.vectorLiveBooleanSteps = vectorLiveBooleanSteps; exports.clearVectorLiveBooleanCache = clearVectorLiveBooleanCache; exports.foldVectorBooleanOperands = foldVectorBooleanOperands; exports.applyVectorEffects = applyVectorEffects; exports.vectorChildAppearanceShapes = vectorChildAppearanceShapes; exports.vectorEffectInputPaths = vectorEffectInputPaths; exports.vectorEffectInputBounds = vectorEffectInputBounds; exports.vectorNodeEnvelope = vectorNodeEnvelope; exports.vectorEnvelopeFrame = vectorEnvelopeFrame; exports.vectorAppearanceShapes = vectorAppearanceShapes; exports.vectorAppearanceOutline = vectorAppearanceOutline; exports.vectorAppearanceNodes = vectorAppearanceNodes; exports.expandVectorAppearance = expandVectorAppearance; exports.expandVectorAppearances = expandVectorAppearances; exports.sanitizeVectorEffects = sanitizeVectorEffects; exports.transformVectorEffects = transformVectorEffects; exports.vectorEnteredGroups = vectorEnteredGroups; exports.cloneAnchor = cloneAnchor; exports.cloneSubpath = cloneSubpath; exports.cloneVectorNode = cloneVectorNode; exports.cloneVectorDocument = cloneVectorDocument; exports.hasPaint = hasPaint; exports.subpathSegmentCount = subpathSegmentCount; exports.subpathSegment = subpathSegment; exports.subpathsToBezier = subpathsToBezier; exports.vectorNodeToBezier = vectorNodeToBezier; exports.vectorPathData = vectorPathData; exports.inferAnchorType = inferAnchorType; exports.bezierToSubpaths = bezierToSubpaths; exports.walkVectorNodes = walkVectorNodes; exports.findVectorNode = findVectorNode; exports.locateVectorNode = locateVectorNode; exports.collectPathNodes = collectPathNodes; exports.nodeMatrix = nodeMatrix; exports.vectorPathWorldBezier = vectorPathWorldBezier; exports.vectorNodeBounds = vectorNodeBounds; exports.unionBounds = unionBounds; exports.boundsIntersect = boundsIntersect; exports.boundsFromPoints = boundsFromPoints; exports.hitTestVectorNode = hitTestVectorNode; exports.vectorStrokeOutline = vectorStrokeOutline; exports.hitTestVectorNodes = hitTestVectorNodes; exports.nearestSegment = nearestSegment; exports.transformVectorNode = transformVectorNode; exports.vectorNodeRotation = vectorNodeRotation; exports.vectorWorldMatrix = vectorWorldMatrix; exports.vectorParentMatrix = vectorParentMatrix; exports.translateAnchor = translateAnchor; exports.moveAnchorHandle = moveAnchorHandle; exports.convertAnchor = convertAnchor; exports.insertAnchor = insertAnchor; exports.removeAnchors = removeAnchors; exports.reverseSubpath = reverseSubpath; exports.KAPPA = KAPPA2; exports.rectSubpath = rectSubpath; exports.ellipseSubpath = ellipseSubpath; exports.polygonSubpath = polygonSubpath; exports.starSubpath = starSubpath; exports.lineSubpath = lineSubpath; exports.roundSubpaths = roundSubpaths; exports.subpathToMorphContour = subpathToMorphContour; exports.morphContourToSubpath = morphContourToSubpath; exports.refineMorphContour = refineMorphContour; exports.reverseMorphContour = reverseMorphContour; exports.turnMorphContour = turnMorphContour; exports.correspondMorphContours = correspondMorphContours; exports.morphPathsCross = morphPathsCross; exports.interpolateMorphContours = interpolateMorphContours; exports.interpolateRigidMatrix = interpolateRigidMatrix; exports.interpolateVectorColor = interpolateVectorColor; exports.resampleGradientStops = resampleGradientStops; exports.interpolateVectorPaint = interpolateVectorPaint; exports.interpolateWidthProfiles = interpolateWidthProfiles; exports.interpolateVectorStyle = interpolateVectorStyle; exports.createVectorMorph = createVectorMorph; exports.interpolateVectorPaths = interpolateVectorPaths; exports.evaluateVectorPathKeyframes = evaluateVectorPathKeyframes; exports.vectorStrokeGradientDefs = vectorStrokeGradientDefs; exports.vectorCornersAttribute = vectorCornersAttribute; exports.applyVectorCornersAttribute = applyVectorCornersAttribute; exports.vectorPathLocalBounds = vectorPathLocalBounds; exports.vectorPaintToSvg = vectorPaintToSvg; exports.vectorStrokeSvgParts = vectorStrokeSvgParts; exports.vectorNodeLocalPaintBounds = vectorNodeLocalPaintBounds; exports.vectorNodeFilterSvg = vectorNodeFilterSvg; exports.widthProfileToAttribute = widthProfileToAttribute; exports.widthProfileFromAttribute = widthProfileFromAttribute; exports.vectorDocumentToSvg = vectorDocumentToSvg; exports.parseSvgTransform = parseSvgTransform; exports.parseVectorSvg = parseVectorSvg;
|
|
6849
|
+
//# sourceMappingURL=chunk-UTEVPQTS.cjs.map
|