@pixerate/editor 0.250.0 → 0.252.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/dist/agent/index.cjs +40 -41
  2. package/dist/agent/index.js +9 -10
  3. package/dist/animation/index.cjs +6 -7
  4. package/dist/animation/index.js +5 -6
  5. package/dist/animation-editor/index.cjs +70 -70
  6. package/dist/animation-editor/index.js +12 -12
  7. package/dist/brushes/index.cjs +2087 -0
  8. package/dist/brushes/index.d.cts +17 -0
  9. package/dist/brushes/index.d.ts +17 -0
  10. package/dist/brushes/index.js +2087 -0
  11. package/dist/brushes/library.d.cts +104 -0
  12. package/dist/brushes/library.d.ts +104 -0
  13. package/dist/brushes/migrate.d.cts +17 -0
  14. package/dist/brushes/migrate.d.ts +17 -0
  15. package/dist/brushes/normalize.d.cts +15 -0
  16. package/dist/brushes/normalize.d.ts +15 -0
  17. package/dist/brushes/presets.d.cts +12 -0
  18. package/dist/brushes/presets.d.ts +12 -0
  19. package/dist/brushes/profiles.d.cts +85 -0
  20. package/dist/brushes/profiles.d.ts +85 -0
  21. package/dist/brushes/resolve.d.cts +56 -0
  22. package/dist/brushes/resolve.d.ts +56 -0
  23. package/dist/brushes/schema.d.cts +29 -0
  24. package/dist/brushes/schema.d.ts +29 -0
  25. package/dist/brushes/tools.d.cts +37 -0
  26. package/dist/brushes/tools.d.ts +37 -0
  27. package/dist/brushes/types.d.cts +323 -0
  28. package/dist/brushes/types.d.ts +323 -0
  29. package/dist/{brushstrokeRender-2FHFLSEG.js → brushstrokeRender-5PYSKZIJ.js} +8 -8
  30. package/dist/{brushstrokeRender-QGRXOKDA.cjs → brushstrokeRender-7FLLSQEC.cjs} +14 -14
  31. package/dist/canvas/index.cjs +57 -58
  32. package/dist/canvas/index.js +31 -32
  33. package/dist/chart/index.cjs +159 -160
  34. package/dist/chart/index.js +9 -10
  35. package/dist/{chunk-NOHJP5TK.js → chunk-2ZJ4DT3M.js} +1 -1
  36. package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
  37. package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  38. package/dist/{chunk-SMSGP2HQ.js → chunk-5JNA6LLY.js} +1 -1
  39. package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
  40. package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
  41. package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
  42. package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
  43. package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
  44. package/dist/{chunk-NTRAVM2I.js → chunk-7P6VF3FG.js} +2 -2
  45. package/dist/chunk-APX63ILU.js +173 -0
  46. package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
  47. package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
  48. package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
  49. package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
  50. package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
  51. package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
  52. package/dist/{chunk-KDLBJ6QR.js → chunk-GYMMNCFT.js} +3 -3
  53. package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
  54. package/dist/chunk-HS6QDWDF.cjs +1029 -0
  55. package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
  56. package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
  57. package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
  58. package/dist/{chunk-M2VKFE5L.cjs → chunk-JFHBXNR2.cjs} +88 -88
  59. package/dist/{chunk-WPUXGDH4.cjs → chunk-JPEHXIB5.cjs} +10 -10
  60. package/dist/chunk-JSDND7DF.cjs +173 -0
  61. package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
  62. package/dist/{chunk-YW43M56C.cjs → chunk-LFMKWGFL.cjs} +1 -1
  63. package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
  64. package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
  65. package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
  66. package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
  67. package/dist/chunk-MTKY6K3Q.js +1029 -0
  68. package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
  69. package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
  70. package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
  71. package/dist/chunk-PXDIAYB6.cjs +594 -0
  72. package/dist/{chunk-3TWOCSCY.js → chunk-QC3OXRE4.js} +9 -9
  73. package/dist/{chunk-YM6ZBTXG.cjs → chunk-QLSGTCYT.cjs} +23 -23
  74. package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
  75. package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
  76. package/dist/{chunk-ATK6ABN3.cjs → chunk-SABJMH6M.cjs} +145 -12
  77. package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
  78. package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
  79. package/dist/{chunk-X7WRL5ZZ.cjs → chunk-TLOGFIIV.cjs} +37 -37
  80. package/dist/chunk-TXFWZ5ZJ.js +594 -0
  81. package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
  82. package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
  83. package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
  84. package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
  85. package/dist/{chunk-U4NUOKBT.js → chunk-WZOGDKCQ.js} +134 -1
  86. package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
  87. package/dist/color/index.cjs +4 -6
  88. package/dist/color/index.js +7 -9
  89. package/dist/export/index.cjs +7 -8
  90. package/dist/export/index.js +6 -7
  91. package/dist/extensions/index.cjs +10 -11
  92. package/dist/extensions/index.js +9 -10
  93. package/dist/gradient/index.cjs +33 -34
  94. package/dist/gradient/index.js +4 -5
  95. package/dist/image-editor/index.cjs +845 -844
  96. package/dist/image-editor/index.js +39 -38
  97. package/dist/index.cjs +16 -17
  98. package/dist/index.js +10 -11
  99. package/dist/paint/index.cjs +6 -4
  100. package/dist/paint/index.js +21 -19
  101. package/dist/paint-editor/brushes.d.cts +1 -2
  102. package/dist/paint-editor/brushes.d.ts +1 -2
  103. package/dist/paint-editor/index.cjs +2193 -694
  104. package/dist/paint-editor/index.js +1575 -76
  105. package/dist/paint-editor/mark-settings.d.cts +104 -0
  106. package/dist/paint-editor/mark-settings.d.ts +104 -0
  107. package/dist/paint-editor/procedural.d.cts +2 -75
  108. package/dist/paint-editor/procedural.d.ts +2 -75
  109. package/dist/paint-editor/stickers.d.cts +1 -22
  110. package/dist/paint-editor/stickers.d.ts +1 -22
  111. package/dist/raster/index.cjs +2 -2
  112. package/dist/raster/index.js +9 -9
  113. package/dist/stickers/index.cjs +10 -10
  114. package/dist/stickers/index.js +9 -9
  115. package/dist/tokens/index.cjs +3 -4
  116. package/dist/tokens/index.js +2 -3
  117. package/dist/tools/skill-evals.d.cts +8 -1
  118. package/dist/tools/skill-evals.d.ts +8 -1
  119. package/dist/typography/index.cjs +7 -8
  120. package/dist/typography/index.js +2 -3
  121. package/dist/vector/index.cjs +974 -974
  122. package/dist/vector/index.js +12 -12
  123. package/dist/video-editor/index.cjs +6 -7
  124. package/dist/video-editor/index.js +5 -6
  125. package/package.json +11 -1
  126. package/skills/README.md +2 -0
  127. package/skills/pixerate-brushes/SKILL.md +104 -0
  128. package/skills/pixerate-brushes-design/SKILL.md +88 -0
  129. package/skills/pixerate-brushes-design/evals/canvas-chalk.json +15 -0
  130. package/skills/pixerate-brushes-design/evals/pink-highlighter.json +15 -0
  131. package/skills/pixerate-brushes-design/evals/port-to-vector.json +17 -0
  132. package/dist/chunk-4JNWA3VT.cjs +0 -302
  133. package/dist/chunk-7AHBW2CQ.cjs +0 -200
  134. package/dist/chunk-F67XMVDI.js +0 -200
  135. package/dist/chunk-GT77U7QG.cjs +0 -2637
  136. package/dist/chunk-OTEPAQJX.js +0 -2637
  137. package/dist/chunk-WKH5ZAUA.js +0 -302
@@ -106,7 +106,7 @@ var _chunkBROJYMWUcjs = require('./chunk-BROJYMWU.cjs');
106
106
 
107
107
 
108
108
 
109
- var _chunkWPUXGDH4cjs = require('./chunk-WPUXGDH4.cjs');
109
+ var _chunkJPEHXIB5cjs = require('./chunk-JPEHXIB5.cjs');
110
110
 
111
111
 
112
112
 
@@ -122,11 +122,11 @@ var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
122
122
 
123
123
 
124
124
 
125
+ var _chunkW5M3J7PVcjs = require('./chunk-W5M3J7PV.cjs');
125
126
 
126
127
 
127
128
 
128
129
 
129
- var _chunk2VX55NFMcjs = require('./chunk-2VX55NFM.cjs');
130
130
 
131
131
 
132
132
 
@@ -134,7 +134,7 @@ var _chunk2VX55NFMcjs = require('./chunk-2VX55NFM.cjs');
134
134
 
135
135
 
136
136
 
137
- var _chunkW5M3J7PVcjs = require('./chunk-W5M3J7PV.cjs');
137
+ var _chunk2VX55NFMcjs = require('./chunk-2VX55NFM.cjs');
138
138
 
139
139
 
140
140
 
@@ -2328,7 +2328,7 @@ function mapAnchor(a, f) {
2328
2328
  return out;
2329
2329
  }
2330
2330
  function mapSubpaths(subpaths, f) {
2331
- return _chunkWPUXGDH4cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2331
+ return _chunkJPEHXIB5cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2332
2332
  }
2333
2333
  function liveShapeSubpaths(live) {
2334
2334
  let out;
@@ -2336,19 +2336,19 @@ function liveShapeSubpaths(live) {
2336
2336
  case "rect": {
2337
2337
  const x = Math.min(live.x, live.x + live.width);
2338
2338
  const y = Math.min(live.y, live.y + live.height);
2339
- const sp = _chunkWPUXGDH4cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2339
+ const sp = _chunkJPEHXIB5cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2340
2340
  const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
2341
- out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkWPUXGDH4cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2341
+ out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkJPEHXIB5cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2342
2342
  break;
2343
2343
  }
2344
2344
  case "ellipse":
2345
- out = [_chunkWPUXGDH4cjs.ellipseSubpath.call(void 0, normBox(live))];
2345
+ out = [_chunkJPEHXIB5cjs.ellipseSubpath.call(void 0, normBox(live))];
2346
2346
  break;
2347
2347
  case "polygon":
2348
- out = [_chunkWPUXGDH4cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2348
+ out = [_chunkJPEHXIB5cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2349
2349
  break;
2350
2350
  case "star":
2351
- out = [_chunkWPUXGDH4cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2351
+ out = [_chunkJPEHXIB5cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2352
2352
  break;
2353
2353
  case "line": {
2354
2354
  const a = { x: live.x1, y: live.y1 };
@@ -2371,7 +2371,7 @@ function liveShapeSubpaths(live) {
2371
2371
  }
2372
2372
  }
2373
2373
  const m = live.transform;
2374
- return m && !_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, p)) : out;
2374
+ return m && !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, p)) : out;
2375
2375
  }
2376
2376
  function normBox(b) {
2377
2377
  return { x: Math.min(b.x, b.x + b.width), y: Math.min(b.y, b.y + b.height), width: Math.abs(b.width), height: Math.abs(b.height) };
@@ -2383,7 +2383,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
2383
2383
  function componentPath(c) {
2384
2384
  let p = pathCache.get(c.subpaths);
2385
2385
  if (!p) {
2386
- p = _chunkWPUXGDH4cjs.subpathsToBezier.call(void 0, c.subpaths);
2386
+ p = _chunkJPEHXIB5cjs.subpathsToBezier.call(void 0, c.subpaths);
2387
2387
  pathCache.set(c.subpaths, p);
2388
2388
  }
2389
2389
  return p;
@@ -2710,7 +2710,7 @@ function matrixArg(v, path) {
2710
2710
  if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail(`${path} must be six numbers [a, b, c, d, e, f].`);
2711
2711
  const m = v;
2712
2712
  if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail(`${path} is singular.`);
2713
- return _chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2713
+ return _chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2714
2714
  }
2715
2715
  function normalizeLiveShape(v, path = "shape") {
2716
2716
  if (!v || typeof v !== "object") return fail(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
@@ -2771,7 +2771,7 @@ function normalizeSubpaths(v, path = "subpaths") {
2771
2771
  if (typeof v === "string") {
2772
2772
  let subs;
2773
2773
  try {
2774
- subs = _chunkWPUXGDH4cjs.bezierToSubpaths.call(void 0, v);
2774
+ subs = _chunkJPEHXIB5cjs.bezierToSubpaths.call(void 0, v);
2775
2775
  } catch (e5) {
2776
2776
  return fail(`${path}: could not read the SVG path data.`);
2777
2777
  }
@@ -2857,15 +2857,15 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
2857
2857
  function transformShapeComponents(components, f, affine) {
2858
2858
  return components.map((c) => {
2859
2859
  if (affine && c.live) {
2860
- const live = { ...c.live, transform: _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkWPUXGDH4cjs.IDENTITY_MATRIX)), affine) };
2861
- if (_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2860
+ const live = { ...c.live, transform: _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkJPEHXIB5cjs.IDENTITY_MATRIX)), affine) };
2861
+ if (_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2862
2862
  return { op: c.op, subpaths: liveShapeSubpaths(live), live };
2863
2863
  }
2864
2864
  return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
2865
2865
  });
2866
2866
  }
2867
2867
  function offsetShape(layer, dx, dy, env) {
2868
- const m = _chunkWPUXGDH4cjs.translateMatrix.call(void 0, dx, dy);
2868
+ const m = _chunkJPEHXIB5cjs.translateMatrix.call(void 0, dx, dy);
2869
2869
  const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
2870
2870
  delete next.annotation;
2871
2871
  return rerenderShape(next, env);
@@ -2873,7 +2873,7 @@ function offsetShape(layer, dx, dy, env) {
2873
2873
  function mergeShapeComponents(components, fillRule = "nonzero") {
2874
2874
  if (components.length < 2) return [...components];
2875
2875
  const path = shapeOutline(components, fillRule);
2876
- const subpaths = _chunkWPUXGDH4cjs.bezierToSubpaths.call(void 0, path);
2876
+ const subpaths = _chunkJPEHXIB5cjs.bezierToSubpaths.call(void 0, path);
2877
2877
  if (!subpaths.length) fail("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
2878
2878
  return [{ op: "combine", subpaths }];
2879
2879
  }
@@ -2890,7 +2890,7 @@ function annotationPaint(color, opacity) {
2890
2890
  function shapeFromAnnotation(a) {
2891
2891
  const opacity = _nullishCoalesce(a.opacity, () => ( 1));
2892
2892
  const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
2893
- const rotation = a.rotation ? _chunkWPUXGDH4cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2893
+ const rotation = a.rotation ? _chunkJPEHXIB5cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2894
2894
  const t = rotation ? { transform: rotation } : {};
2895
2895
  const live = (l) => liveComponent(l);
2896
2896
  switch (a.type) {
@@ -2933,7 +2933,7 @@ function shapeFromAnnotation(a) {
2933
2933
  case "pen": {
2934
2934
  const paint = annotationPaint(a.strokeColor, opacity);
2935
2935
  if (!paint) return null;
2936
- const pts = rotation ? a.points.map((p) => _chunkWPUXGDH4cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2936
+ const pts = rotation ? a.points.map((p) => _chunkJPEHXIB5cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2937
2937
  const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
2938
2938
  return {
2939
2939
  components: [{ op: "combine", subpaths }],
@@ -2966,7 +2966,7 @@ var JOIN_SIGMA = 2;
2966
2966
  function vectorMaskSegments(components) {
2967
2967
  const out = [];
2968
2968
  components.forEach((c, ci) => c.subpaths.forEach((sp, si) => {
2969
- for (let k = 0; k < _chunkWPUXGDH4cjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2969
+ for (let k = 0; k < _chunkJPEHXIB5cjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2970
2970
  }));
2971
2971
  return out;
2972
2972
  }
@@ -2974,7 +2974,7 @@ function validVectorMaskEdges(edges, components) {
2974
2974
  if (!_optionalChain([edges, 'optionalAccess', _34 => _34.length])) return [];
2975
2975
  return edges.filter((e) => {
2976
2976
  const sp = _optionalChain([components, 'access', _35 => _35[e.component], 'optionalAccess', _36 => _36.subpaths, 'access', _37 => _37[e.subpath]]);
2977
- return Boolean(sp) && e.segment >= 0 && e.segment < _chunkWPUXGDH4cjs.subpathSegmentCount.call(void 0, sp);
2977
+ return Boolean(sp) && e.segment >= 0 && e.segment < _chunkJPEHXIB5cjs.subpathSegmentCount.call(void 0, sp);
2978
2978
  });
2979
2979
  }
2980
2980
  function reach(e) {
@@ -2997,8 +2997,8 @@ function hybridVectorMaskCoverage(vm, hard, width, height, guide) {
2997
2997
  const seedClass = [];
2998
2998
  vm.components.forEach(
2999
2999
  (c, ci) => c.subpaths.forEach((sp, si) => {
3000
- for (let k = 0; k < _chunkWPUXGDH4cjs.subpathSegmentCount.call(void 0, sp); k++) {
3001
- const seg = _chunkWPUXGDH4cjs.subpathSegment.call(void 0, sp, k);
3000
+ for (let k = 0; k < _chunkJPEHXIB5cjs.subpathSegmentCount.call(void 0, sp); k++) {
3001
+ const seg = _chunkJPEHXIB5cjs.subpathSegment.call(void 0, sp, k);
3002
3002
  let len = 0;
3003
3003
  for (let i = 1; i < seg.length; i++) len += Math.hypot(seg[i][0] - seg[i - 1][0], seg[i][1] - seg[i - 1][1]);
3004
3004
  const steps = Math.max(2, Math.ceil(len * 2));
@@ -3898,7 +3898,7 @@ var fail3 = (message) => {
3898
3898
  };
3899
3899
  var TEXT_RENDER_MARGIN = _chunkDPYAO5U6cjs.MAX_EFFECT_REACH;
3900
3900
  function textMatrix(layer) {
3901
- return _nullishCoalesce(layer.transform, () => ( _chunkWPUXGDH4cjs.IDENTITY_MATRIX));
3901
+ return _nullishCoalesce(layer.transform, () => ( _chunkJPEHXIB5cjs.IDENTITY_MATRIX));
3902
3902
  }
3903
3903
  function rectCorners(r) {
3904
3904
  return [
@@ -3909,7 +3909,7 @@ function rectCorners(r) {
3909
3909
  ];
3910
3910
  }
3911
3911
  function docRect(r, m) {
3912
- const pts = rectCorners(r).map((p) => _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, p));
3912
+ const pts = rectCorners(r).map((p) => _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, p));
3913
3913
  const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
3914
3914
  const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
3915
3915
  const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
@@ -3929,7 +3929,7 @@ function inkBounds(layout) {
3929
3929
  for (const f of l.fragments) {
3930
3930
  const pad = f.style.fontSize * (l.matrix ? 1 : 0.5);
3931
3931
  const w = f.carets[f.carets.length - 1];
3932
- const r = _chunkWPUXGDH4cjs.transformTextRect.call(void 0, l.matrix, { x: f.x - pad, y: l.baseline - l.ascent - pad + Math.min(0, f.y - l.baseline), width: w + 2 * pad, height: l.ascent + l.descent + 2 * pad + Math.abs(f.y - l.baseline) });
3932
+ const r = _chunkJPEHXIB5cjs.transformTextRect.call(void 0, l.matrix, { x: f.x - pad, y: l.baseline - l.ascent - pad + Math.min(0, f.y - l.baseline), width: w + 2 * pad, height: l.ascent + l.descent + 2 * pad + Math.abs(f.y - l.baseline) });
3933
3933
  if (!b) b = r;
3934
3934
  else {
3935
3935
  const x0 = Math.min(b.x, r.x);
@@ -3942,14 +3942,14 @@ function inkBounds(layout) {
3942
3942
  }
3943
3943
  function textOutlines(layer, shaper) {
3944
3944
  if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
3945
- const layout = _chunkWPUXGDH4cjs.layoutText.call(void 0, layer, shaper);
3945
+ const layout = _chunkJPEHXIB5cjs.layoutText.call(void 0, layer, shaper);
3946
3946
  const m = textMatrix(layer);
3947
3947
  const out = [];
3948
3948
  for (const l of layout.lines) {
3949
3949
  for (const f of l.fragments) {
3950
- let path = _chunkWPUXGDH4cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3951
- for (const r of _chunkWPUXGDH4cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkWPUXGDH4cjs.textRectPath.call(void 0, r)];
3952
- out.push({ fragment: f, path: _chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3950
+ let path = _chunkJPEHXIB5cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3951
+ for (const r of _chunkJPEHXIB5cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkJPEHXIB5cjs.textRectPath.call(void 0, r)];
3952
+ out.push({ fragment: f, path: _chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3953
3953
  }
3954
3954
  }
3955
3955
  return out;
@@ -4005,7 +4005,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4005
4005
  const canvas = env.createCanvas(region.width, region.height);
4006
4006
  const ctx = canvas.getContext("2d");
4007
4007
  if (!ctx || typeof ctx.getImageData !== "function") return null;
4008
- const layout = _chunkWPUXGDH4cjs.layoutText.call(void 0, layer, shaper);
4008
+ const layout = _chunkJPEHXIB5cjs.layoutText.call(void 0, layer, shaper);
4009
4009
  const m = textMatrix(layer);
4010
4010
  ctx.setTransform(1, 0, 0, 1, 0, 0);
4011
4011
  ctx.clearRect(0, 0, region.width, region.height);
@@ -4015,8 +4015,8 @@ function renderOnCanvas(layer, shaper, region, env) {
4015
4015
  const [r, g, b] = rgbOf(f.style.color);
4016
4016
  ctx.fillStyle = `rgb(${r}, ${g}, ${b})`;
4017
4017
  ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
4018
- _chunkWPUXGDH4cjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4019
- for (const d of _chunkWPUXGDH4cjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4018
+ _chunkJPEHXIB5cjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4019
+ for (const d of _chunkJPEHXIB5cjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4020
4020
  }
4021
4021
  }
4022
4022
  ctx.globalAlpha = 1;
@@ -4027,7 +4027,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4027
4027
  function renderText(layer, env) {
4028
4028
  const shaper = env.shaper;
4029
4029
  if (!shaper || !shaper.outline && !shaper.draw) return null;
4030
- const layout = _chunkWPUXGDH4cjs.layoutText.call(void 0, layer, shaper);
4030
+ const layout = _chunkJPEHXIB5cjs.layoutText.call(void 0, layer, shaper);
4031
4031
  const ink = inkBounds(layout);
4032
4032
  const clip = { x: -TEXT_RENDER_MARGIN, y: -TEXT_RENDER_MARGIN, width: env.width + 2 * TEXT_RENDER_MARGIN, height: env.height + 2 * TEXT_RENDER_MARGIN };
4033
4033
  const region = ink ? intersect2(docRect(ink, textMatrix(layer)), clip) : null;
@@ -4128,7 +4128,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
4128
4128
  continue;
4129
4129
  }
4130
4130
  const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
4131
- if (k === "autoLeading" && value === _chunkWPUXGDH4cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4131
+ if (k === "autoLeading" && value === _chunkJPEHXIB5cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4132
4132
  else o[k] = value;
4133
4133
  } else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
4134
4134
  }
@@ -4169,15 +4169,15 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
4169
4169
  opacity: 1,
4170
4170
  blend: "normal",
4171
4171
  text: text3,
4172
- runs: _chunkWPUXGDH4cjs.fitRuns.call(void 0, init.runs, text3.length, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE),
4173
- paragraphs: _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4172
+ runs: _chunkJPEHXIB5cjs.fitRuns.call(void 0, init.runs, text3.length, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE),
4173
+ paragraphs: _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4174
4174
  frame: init.frame,
4175
4175
  ...init.orientation === "vertical" ? { orientation: "vertical" } : {},
4176
4176
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
4177
4177
  offset: { x: 0, y: 0 }
4178
4178
  };
4179
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE)) }];
4180
- if (init.transform && !_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4179
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE)) }];
4180
+ if (init.transform && !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4181
4181
  if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
4182
4182
  return rerenderText(layer, env);
4183
4183
  }
@@ -4188,24 +4188,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
4188
4188
  const next = { ...current, ...patch };
4189
4189
  if (!("annotation" in patch)) delete next.annotation;
4190
4190
  if (next.orientation !== "vertical") delete next.orientation;
4191
- if ("text" in patch || "runs" in patch) next.runs = _chunkWPUXGDH4cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE)));
4192
- if (!next.runs.length) next.runs = [{ length: 0, style: _chunkWPUXGDH4cjs.styleAt.call(void 0, current.runs, 0, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE) }];
4193
- if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4191
+ if ("text" in patch || "runs" in patch) next.runs = _chunkJPEHXIB5cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE)));
4192
+ if (!next.runs.length) next.runs = [{ length: 0, style: _chunkJPEHXIB5cjs.styleAt.call(void 0, current.runs, 0, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE) }];
4193
+ if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4194
4194
  const rendered = rerenderText(next, env);
4195
4195
  return { layers: _chunkDPYAO5U6cjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4196
4196
  }
4197
4197
  function replaceTextRange(layer, start, end, insert) {
4198
4198
  const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
4199
- const style = _chunkWPUXGDH4cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE);
4200
- const runs = _chunkWPUXGDH4cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4201
- const pstyle = _chunkWPUXGDH4cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4202
- const paragraphs = _chunkWPUXGDH4cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4203
- return { text: text3, runs, paragraphs: _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4199
+ const style = _chunkJPEHXIB5cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE);
4200
+ const runs = _chunkJPEHXIB5cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4201
+ const pstyle = _chunkJPEHXIB5cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4202
+ const paragraphs = _chunkJPEHXIB5cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4203
+ return { text: text3, runs, paragraphs: _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4204
4204
  }
4205
4205
  function transformTypeLayer(layer, m) {
4206
- const t = _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4206
+ const t = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4207
4207
  const next = { ...layer };
4208
- if (_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4208
+ if (_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4209
4209
  else next.transform = t;
4210
4210
  delete next.annotation;
4211
4211
  return next;
@@ -4213,7 +4213,7 @@ function transformTypeLayer(layer, m) {
4213
4213
  function typeFrame(layer, shaper) {
4214
4214
  if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
4215
4215
  if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
4216
- const b = _chunkWPUXGDH4cjs.layoutText.call(void 0, layer, shaper).bounds;
4216
+ const b = _chunkJPEHXIB5cjs.layoutText.call(void 0, layer, shaper).bounds;
4217
4217
  return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
4218
4218
  }
4219
4219
  function typeAsPixelLayer(layer) {
@@ -4221,7 +4221,7 @@ function typeAsPixelLayer(layer) {
4221
4221
  return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
4222
4222
  }
4223
4223
  function toTextSpace(layer, p) {
4224
- return _chunkWPUXGDH4cjs.applyMatrix.call(void 0, _chunkWPUXGDH4cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4224
+ return _chunkJPEHXIB5cjs.applyMatrix.call(void 0, _chunkJPEHXIB5cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4225
4225
  }
4226
4226
  function typeFromAnnotation(a) {
4227
4227
  if (a.type !== "text") return null;
@@ -4235,7 +4235,7 @@ function typeFromAnnotation(a) {
4235
4235
  if (op !== 1) style.opacity = op;
4236
4236
  const text3 = t.text.replace(/\r?\n|\r/g, " ");
4237
4237
  const translate = [1, 0, 0, 1, t.x, t.y];
4238
- const transform = t.rotation ? _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, translate, _chunkWPUXGDH4cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4238
+ const transform = t.rotation ? _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, translate, _chunkJPEHXIB5cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4239
4239
  return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
4240
4240
  }
4241
4241
  function annotationOfType(layer) {
@@ -4569,7 +4569,7 @@ function identityTransform(box2) {
4569
4569
  }
4570
4570
  function cornersFromMatrix(box2, m) {
4571
4571
  const q2 = _chunkQT26RHKKcjs.boxQuad.call(void 0, box2);
4572
- return [_chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[0]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[1]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[2]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[3])];
4572
+ return [_chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[0]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[1]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[2]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[3])];
4573
4573
  }
4574
4574
  function matrixFromCorners(box2, corners, eps = 1e-6) {
4575
4575
  const [tl, tr, br, bl] = corners;
@@ -4586,7 +4586,7 @@ function transformHomography(geometry) {
4586
4586
  function hasWarp(geometry) {
4587
4587
  const w = geometry.warp;
4588
4588
  if (!w) return false;
4589
- const id = _chunkWPUXGDH4cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4589
+ const id = _chunkJPEHXIB5cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4590
4590
  if (id.points.length !== w.points.length || id.us.some((u, i) => Math.abs(u - w.us[i]) > 1e-12) || id.vs.some((v, i) => Math.abs(v - w.vs[i]) > 1e-12)) return true;
4591
4591
  return w.points.some((p, i) => Math.abs(p.x - id.points[i].x) > 1e-6 || Math.abs(p.y - id.points[i].y) > 1e-6);
4592
4592
  }
@@ -4601,7 +4601,7 @@ function transformMap(geometry) {
4601
4601
  const { box: box2 } = geometry;
4602
4602
  const warp = hasWarp(geometry) ? geometry.warp : null;
4603
4603
  if (!warp) return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p);
4604
- return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkWPUXGDH4cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4604
+ return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkJPEHXIB5cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4605
4605
  }
4606
4606
  function transformedPoint(geometry, fx, fy) {
4607
4607
  const f = transformMap(geometry);
@@ -4645,8 +4645,8 @@ function matrixFromParams(box2, params) {
4645
4645
  const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
4646
4646
  const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
4647
4647
  const ref = referencePoint(box2, params.reference);
4648
- const linear = _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkWPUXGDH4cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4649
- return _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, _chunkWPUXGDH4cjs.matrixAbout.call(void 0, linear, ref), _chunkWPUXGDH4cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4648
+ const linear = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkJPEHXIB5cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4649
+ return _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.matrixAbout.call(void 0, linear, ref), _chunkJPEHXIB5cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4650
4650
  }
4651
4651
  function describeTransform(geometry, reference = "center") {
4652
4652
  const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
@@ -4663,7 +4663,7 @@ function describeTransform(geometry, reference = "center") {
4663
4663
  const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
4664
4664
  const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
4665
4665
  const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
4666
- const at = _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, ref);
4666
+ const at = _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, ref);
4667
4667
  const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
4668
4668
  return {
4669
4669
  affine: true,
@@ -4681,24 +4681,24 @@ function applyParams(geometry, params) {
4681
4681
  const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
4682
4682
  const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
4683
4683
  const c = geometry.corners;
4684
- return [_chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, c[0]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, c[1]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, c[2]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, c[3])];
4684
+ return [_chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, c[0]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, c[1]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, c[2]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, c[3])];
4685
4685
  }
4686
4686
  function flipCorners(geometry, axis) {
4687
4687
  const c = anchorPoint(geometry, "center");
4688
4688
  const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
4689
4689
  const q2 = geometry.corners;
4690
- return [_chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[0]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[1]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[2]), _chunkWPUXGDH4cjs.applyMatrix.call(void 0, m, q2[3])];
4690
+ return [_chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[0]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[1]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[2]), _chunkJPEHXIB5cjs.applyMatrix.call(void 0, m, q2[3])];
4691
4691
  }
4692
4692
  function boxPointOf(geometry, p) {
4693
4693
  const m = matrixFromCorners(geometry.box, geometry.corners);
4694
- if (m) return _chunkWPUXGDH4cjs.applyMatrix.call(void 0, _chunkWPUXGDH4cjs.invertMatrix.call(void 0, m), p);
4694
+ if (m) return _chunkJPEHXIB5cjs.applyMatrix.call(void 0, _chunkJPEHXIB5cjs.invertMatrix.call(void 0, m), p);
4695
4695
  return null;
4696
4696
  }
4697
4697
  function presetWarp(box2, preset) {
4698
- return _chunkWPUXGDH4cjs.warpPresetMesh.call(void 0, preset, box2);
4698
+ return _chunkJPEHXIB5cjs.warpPresetMesh.call(void 0, preset, box2);
4699
4699
  }
4700
4700
  function isValidWarp(mesh) {
4701
- return _chunkWPUXGDH4cjs.isValidWarpMesh.call(void 0, mesh);
4701
+ return _chunkJPEHXIB5cjs.isValidWarpMesh.call(void 0, mesh);
4702
4702
  }
4703
4703
  function geometryHomography(geometry) {
4704
4704
  const m = matrixFromCorners(geometry.box, geometry.corners);
@@ -4977,7 +4977,7 @@ function normalizePlacement(raw, contents) {
4977
4977
  }
4978
4978
  const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
4979
4979
  if (raw.warp) {
4980
- if (!_chunkWPUXGDH4cjs.isValidWarpMesh.call(void 0, raw.warp)) fail4("warp must be a mesh with us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels.");
4980
+ if (!_chunkJPEHXIB5cjs.isValidWarpMesh.call(void 0, raw.warp)) fail4("warp must be a mesh with us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels.");
4981
4981
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
4982
4982
  }
4983
4983
  if (raw.interpolation !== void 0) {
@@ -5081,7 +5081,7 @@ function translateLayer(layer, dx, dy) {
5081
5081
  case "shape": {
5082
5082
  const next = {
5083
5083
  ...layer,
5084
- components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkWPUXGDH4cjs.translateMatrix.call(void 0, dx, dy)),
5084
+ components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkJPEHXIB5cjs.translateMatrix.call(void 0, dx, dy)),
5085
5085
  surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy),
5086
5086
  mask: moveMask(layer.mask)
5087
5087
  };
@@ -5090,7 +5090,7 @@ function translateLayer(layer, dx, dy) {
5090
5090
  return next;
5091
5091
  }
5092
5092
  case "type": {
5093
- const next = { ...transformTypeLayer(layer, _chunkWPUXGDH4cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5093
+ const next = { ...transformTypeLayer(layer, _chunkJPEHXIB5cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5094
5094
  if (!next.mask) delete next.mask;
5095
5095
  return next;
5096
5096
  }
@@ -5276,7 +5276,7 @@ function refitPlacement(layer, contents) {
5276
5276
  });
5277
5277
  const out = { corners: pts };
5278
5278
  if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
5279
- if (layer.placement.warp) out.warp = _chunkWPUXGDH4cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5279
+ if (layer.placement.warp) out.warp = _chunkJPEHXIB5cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5280
5280
  return out;
5281
5281
  }
5282
5282
  function normalizeSmartFilter(raw, id = newLayerId("flt")) {
@@ -5653,7 +5653,7 @@ function readType(r, base, ctx) {
5653
5653
  const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
5654
5654
  const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
5655
5655
  length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _166 => _166.length]), 0, 1e9, 0))),
5656
- style: patchTextStyle(_chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5656
+ style: patchTextStyle(_chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5657
5657
  }));
5658
5658
  const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
5659
5659
  length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _168 => _168.length]), 0, 1e9, 0))),
@@ -5666,13 +5666,13 @@ function readType(r, base, ctx) {
5666
5666
  ...base,
5667
5667
  type: "type",
5668
5668
  text: text3,
5669
- runs: _chunkWPUXGDH4cjs.fitRuns.call(void 0, runs, text3.length, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE),
5670
- paragraphs: _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5669
+ runs: _chunkJPEHXIB5cjs.fitRuns.call(void 0, runs, text3.length, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE),
5670
+ paragraphs: _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5671
5671
  frame,
5672
5672
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
5673
5673
  offset: { x: 0, y: 0 }
5674
5674
  };
5675
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE)) }];
5675
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE)) }];
5676
5676
  if (m) layer.transform = m;
5677
5677
  if (r.orientation === "vertical") layer.orientation = "vertical";
5678
5678
  if (r.antiAlias === false) layer.antiAlias = false;
@@ -6142,7 +6142,7 @@ function readSmartObject(r, base, ctx) {
6142
6142
  let placement;
6143
6143
  try {
6144
6144
  const raw = { corners: p.corners };
6145
- if (p.warp && _chunkWPUXGDH4cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6145
+ if (p.warp && _chunkJPEHXIB5cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6146
6146
  if (_chunkDPYAO5U6cjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6147
6147
  placement = normalizePlacement(raw, contents);
6148
6148
  } catch (e) {
@@ -7313,7 +7313,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
7313
7313
  const fr = (p) => ({ x: p.x / w, y: p.y / h });
7314
7314
  const subpaths = [];
7315
7315
  components.forEach((c, ci) => {
7316
- _chunkWPUXGDH4cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7316
+ _chunkJPEHXIB5cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7317
7317
  if (!sp.anchors.length) return;
7318
7318
  subpaths.push({
7319
7319
  closed: sp.closed,
@@ -8139,7 +8139,7 @@ function merged(levels) {
8139
8139
  function charStyle(d, fonts, notes, vertical = false) {
8140
8140
  const n = (k) => eNum(eGet(d, k));
8141
8141
  const flag = (k) => eBool(eGet(d, k));
8142
- const s = { ..._chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE };
8142
+ const s = { ..._chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE };
8143
8143
  const fi = n("Font");
8144
8144
  const ps = fi !== void 0 ? fonts[fi] : void 0;
8145
8145
  if (ps) {
@@ -8224,7 +8224,7 @@ function typeFromTySh(data, notes) {
8224
8224
  }
8225
8225
  const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
8226
8226
  const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
8227
- let runs = [{ length: text3.length, style: { ..._chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE } }];
8227
+ let runs = [{ length: text3.length, style: { ..._chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE } }];
8228
8228
  let paragraphs = [{ length: text3.length, style: {} }];
8229
8229
  let frame = { kind: "point" };
8230
8230
  let transform = t.transform;
@@ -8280,14 +8280,14 @@ function typeFromTySh(data, notes) {
8280
8280
  const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
8281
8281
  if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
8282
8282
  frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
8283
- transform = _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8283
+ transform = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8284
8284
  }
8285
8285
  }
8286
8286
  }
8287
8287
  return {
8288
8288
  text: text3,
8289
- runs: _chunkWPUXGDH4cjs.fitRuns.call(void 0, runs, text3.length, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE),
8290
- paragraphs: _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8289
+ runs: _chunkJPEHXIB5cjs.fitRuns.call(void 0, runs, text3.length, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE),
8290
+ paragraphs: _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8291
8291
  frame,
8292
8292
  orientation: vertical ? "vertical" : "horizontal",
8293
8293
  transform,
@@ -8363,7 +8363,7 @@ function buildEngineData(layer, template) {
8363
8363
  fonts.push(ps);
8364
8364
  return fonts.length - 1;
8365
8365
  };
8366
- const runs = _chunkWPUXGDH4cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE);
8366
+ const runs = _chunkJPEHXIB5cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE);
8367
8367
  const vertical = layer.orientation === "vertical";
8368
8368
  const sruns = [];
8369
8369
  const slens = [];
@@ -8372,10 +8372,10 @@ function buildEngineData(layer, template) {
8372
8372
  slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
8373
8373
  });
8374
8374
  if (!runs.length) {
8375
- sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE)))]])]]));
8375
+ sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE)))]])]]));
8376
8376
  slens.push(E.int(1));
8377
8377
  }
8378
- const paras = _chunkWPUXGDH4cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8378
+ const paras = _chunkJPEHXIB5cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8379
8379
  const pruns = [];
8380
8380
  const plens = [];
8381
8381
  paras.forEach((p, i) => {
@@ -8431,7 +8431,7 @@ function buildEngineData(layer, template) {
8431
8431
  eSet(e, key, rd);
8432
8432
  }
8433
8433
  eSet(rd, "FontSet", fontSet);
8434
- if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _248 => _248[0], 'optionalAccess', _249 => _249.style]), () => ( _chunkWPUXGDH4cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8434
+ if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _248 => _248[0], 'optionalAccess', _249 => _249.style]), () => ( _chunkJPEHXIB5cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8435
8435
  if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
8436
8436
  if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
8437
8437
  if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
@@ -8442,13 +8442,13 @@ function inkBounds2(layer) {
8442
8442
  if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
8443
8443
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
8444
8444
  if (!b) return [0, 0, 0, 0];
8445
- const inv = _chunkWPUXGDH4cjs.invertMatrix.call(void 0, textMatrix(layer));
8445
+ const inv = _chunkJPEHXIB5cjs.invertMatrix.call(void 0, textMatrix(layer));
8446
8446
  const pts = [
8447
8447
  { x: b.x, y: b.y },
8448
8448
  { x: b.x + b.width, y: b.y },
8449
8449
  { x: b.x + b.width, y: b.y + b.height },
8450
8450
  { x: b.x, y: b.y + b.height }
8451
- ].map((p) => _chunkWPUXGDH4cjs.applyMatrix.call(void 0, inv, p));
8451
+ ].map((p) => _chunkJPEHXIB5cjs.applyMatrix.call(void 0, inv, p));
8452
8452
  return [Math.min(...pts.map((p) => p.x)), Math.min(...pts.map((p) => p.y)), Math.max(...pts.map((p) => p.x)), Math.max(...pts.map((p) => p.y))];
8453
8453
  }
8454
8454
  function tyShForLayer(layer) {
@@ -8729,7 +8729,7 @@ function filterMaskItem(placed, mask, area) {
8729
8729
  var warpStyleOf = (name) => {
8730
8730
  if (!name.startsWith("warp")) return null;
8731
8731
  const s = _optionalChain([name, 'access', _263 => _263[4], 'optionalAccess', _264 => _264.toLowerCase, 'call', _265 => _265()]) + name.slice(5);
8732
- return _chunkWPUXGDH4cjs.WARP_STYLES.includes(s) ? s : null;
8732
+ return _chunkJPEHXIB5cjs.WARP_STYLES.includes(s) ? s : null;
8733
8733
  };
8734
8734
  function warpFromDescriptor(w, contents) {
8735
8735
  const full = { x: 0, y: 0, width: contents.width, height: contents.height };
@@ -8759,7 +8759,7 @@ function warpFromDescriptor(w, contents) {
8759
8759
  } else {
8760
8760
  const style = warpStyleOf(styleName);
8761
8761
  if (!style) return void 0;
8762
- mesh = _chunkWPUXGDH4cjs.warpPresetMesh.call(void 0,
8762
+ mesh = _chunkJPEHXIB5cjs.warpPresetMesh.call(void 0,
8763
8763
  {
8764
8764
  style,
8765
8765
  bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
@@ -8774,7 +8774,7 @@ function warpFromDescriptor(w, contents) {
8774
8774
  const same = Math.abs(bounds.x) < 1e-6 && Math.abs(bounds.y) < 1e-6 && Math.abs(bounds.width - contents.width) < 1e-6 && Math.abs(bounds.height - contents.height) < 1e-6;
8775
8775
  if (!same) {
8776
8776
  const m = mesh;
8777
- mesh = _chunkWPUXGDH4cjs.fitWarpMesh.call(void 0, (s, t) => _chunkWPUXGDH4cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8777
+ mesh = _chunkJPEHXIB5cjs.fitWarpMesh.call(void 0, (s, t) => _chunkJPEHXIB5cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8778
8778
  }
8779
8779
  return { mesh, frame };
8780
8780
  }
@@ -10366,7 +10366,7 @@ function importSmart(ctx, rec, name, notes, props) {
10366
10366
  if (placement && (size.width !== contents.width || size.height !== contents.height)) {
10367
10367
  const kx = contents.width / size.width;
10368
10368
  const ky = contents.height / size.height;
10369
- if (placement.warp) placement = { ...placement, warp: _chunkWPUXGDH4cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10369
+ if (placement.warp) placement = { ...placement, warp: _chunkJPEHXIB5cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10370
10370
  }
10371
10371
  }
10372
10372
  if (!contents || !placement) {