@pixerate/editor 0.146.0 → 0.148.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 (132) hide show
  1. package/README.md +3 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -1
  3. package/dist/agent/index.cjs +36 -34
  4. package/dist/agent/index.js +7 -5
  5. package/dist/animation/index.cjs +5 -3
  6. package/dist/animation/index.js +4 -2
  7. package/dist/animation-editor/index.cjs +62 -60
  8. package/dist/animation-editor/index.js +6 -4
  9. package/dist/canvas/index.cjs +36 -34
  10. package/dist/canvas/index.js +19 -17
  11. package/dist/chart/index.cjs +88 -86
  12. package/dist/chart/index.js +7 -5
  13. package/dist/{chunk-WBJ6BG4R.js → chunk-2AQL4JHM.js} +6 -6
  14. package/dist/{chunk-HLMF3E53.cjs → chunk-2WDZI6QD.cjs} +15 -15
  15. package/dist/{chunk-ZNHB5RG6.js → chunk-37RLSNQ3.js} +2 -2
  16. package/dist/{chunk-5WOY52O6.cjs → chunk-4YQKRHMI.cjs} +8 -8
  17. package/dist/chunk-6ONMQ6WF.js +113 -0
  18. package/dist/{chunk-L434J57V.cjs → chunk-6QTON3VW.cjs} +16 -16
  19. package/dist/chunk-AA34BA7G.js +1913 -0
  20. package/dist/{chunk-QX25HWFL.js → chunk-AY65VQSU.js} +1 -1
  21. package/dist/{chunk-ONZJD2OD.cjs → chunk-BROJYMWU.cjs} +57 -153
  22. package/dist/{chunk-YM75DN54.js → chunk-DSZCDNTM.js} +1 -1
  23. package/dist/{chunk-PUR6BZFA.cjs → chunk-DVLMW3GB.cjs} +53 -53
  24. package/dist/{chunk-ALUWD3FG.js → chunk-EIUTJPEL.js} +1 -1
  25. package/dist/{chunk-X65C4DWV.js → chunk-EQ4SF4X4.js} +1 -1
  26. package/dist/{chunk-77SG47WT.js → chunk-FLOGD3QB.js} +1 -1
  27. package/dist/{chunk-AJSW5GMP.js → chunk-HVQVHUTV.js} +19 -115
  28. package/dist/{chunk-UR37VCIR.cjs → chunk-I4AHLP7F.cjs} +16 -35
  29. package/dist/chunk-IPJ3TEYR.cjs +113 -0
  30. package/dist/chunk-KY3FYKP3.js +52 -0
  31. package/dist/chunk-LEUZ4FRC.cjs +52 -0
  32. package/dist/{chunk-H6FX45CP.cjs → chunk-LIXLD433.cjs} +37 -37
  33. package/dist/{chunk-6GAYGQDC.js → chunk-O5ML2I6O.js} +3 -3
  34. package/dist/{chunk-KI2VBONS.js → chunk-OET45HIR.js} +2 -2
  35. package/dist/{chunk-XNZWATSB.cjs → chunk-QCEQIRJQ.cjs} +85 -85
  36. package/dist/{chunk-HRI3ZMDM.cjs → chunk-RHXW4TA5.cjs} +3 -3
  37. package/dist/{chunk-UUTTJK77.cjs → chunk-SUF6WRXR.cjs} +2 -2
  38. package/dist/{chunk-RN767PO6.js → chunk-SUVZJ2CP.js} +15 -34
  39. package/dist/{chunk-FLUTRPLY.cjs → chunk-TLMRGLQQ.cjs} +16 -16
  40. package/dist/{chunk-DAS7M4RY.js → chunk-UILRJQFD.js} +2 -2
  41. package/dist/chunk-UKCJ43YL.cjs +1913 -0
  42. package/dist/{chunk-XQ33O5BC.cjs → chunk-X35BV5YT.cjs} +44 -44
  43. package/dist/{chunk-6HMEHNWW.cjs → chunk-XTU6QO2W.cjs} +26 -26
  44. package/dist/{chunk-VM6JYWXQ.js → chunk-ZQUANEK4.js} +2 -2
  45. package/dist/cms/index.cjs +5 -3
  46. package/dist/cms/index.js +18 -16
  47. package/dist/color/contrast.d.cts +14 -0
  48. package/dist/color/contrast.d.ts +14 -0
  49. package/dist/color/convert.d.cts +30 -0
  50. package/dist/color/convert.d.ts +30 -0
  51. package/dist/color/dual.d.cts +98 -0
  52. package/dist/color/dual.d.ts +98 -0
  53. package/dist/color/format.d.cts +12 -0
  54. package/dist/color/format.d.ts +12 -0
  55. package/dist/color/gamut.d.cts +12 -0
  56. package/dist/color/gamut.d.ts +12 -0
  57. package/dist/color/harmony.d.cts +22 -0
  58. package/dist/color/harmony.d.ts +22 -0
  59. package/dist/color/index.cjs +115 -0
  60. package/dist/color/index.d.cts +18 -0
  61. package/dist/color/index.d.ts +18 -0
  62. package/dist/color/index.js +115 -0
  63. package/dist/color/mix.d.cts +11 -0
  64. package/dist/color/mix.d.ts +11 -0
  65. package/dist/color/named.d.cts +5 -0
  66. package/dist/color/named.d.ts +5 -0
  67. package/dist/color/parse.d.cts +11 -0
  68. package/dist/color/parse.d.ts +11 -0
  69. package/dist/color/picker.d.cts +52 -0
  70. package/dist/color/picker.d.ts +52 -0
  71. package/dist/color/recent.d.cts +8 -0
  72. package/dist/color/recent.d.ts +8 -0
  73. package/dist/color/tools.d.cts +15 -0
  74. package/dist/color/tools.d.ts +15 -0
  75. package/dist/color/types.d.cts +41 -0
  76. package/dist/color/types.d.ts +41 -0
  77. package/dist/color/vision.d.cts +36 -0
  78. package/dist/color/vision.d.ts +36 -0
  79. package/dist/effects/authoring-session.d.cts +25 -0
  80. package/dist/effects/authoring-session.d.ts +25 -0
  81. package/dist/effects/authoring-tools.d.cts +31 -0
  82. package/dist/effects/authoring-tools.d.ts +31 -0
  83. package/dist/effects/authoring.d.cts +152 -0
  84. package/dist/effects/authoring.d.ts +152 -0
  85. package/dist/effects/conformance.d.cts +2 -0
  86. package/dist/effects/conformance.d.ts +2 -0
  87. package/dist/effects/fake.d.cts +2 -0
  88. package/dist/effects/fake.d.ts +2 -0
  89. package/dist/effects/index.cjs +1216 -9
  90. package/dist/effects/index.d.cts +3 -0
  91. package/dist/effects/index.d.ts +3 -0
  92. package/dist/effects/index.js +1210 -3
  93. package/dist/effects/types.d.cts +9 -2
  94. package/dist/effects/types.d.ts +9 -2
  95. package/dist/effects/ui.d.cts +8 -0
  96. package/dist/effects/ui.d.ts +8 -0
  97. package/dist/export/index.cjs +6 -4
  98. package/dist/export/index.js +5 -3
  99. package/dist/extensions/index.cjs +10 -8
  100. package/dist/extensions/index.js +9 -7
  101. package/dist/gradient/controller.d.cts +109 -0
  102. package/dist/gradient/controller.d.ts +109 -0
  103. package/dist/gradient/editor.d.cts +38 -0
  104. package/dist/gradient/editor.d.ts +38 -0
  105. package/dist/gradient/index.cjs +1549 -0
  106. package/dist/gradient/index.d.cts +5 -0
  107. package/dist/gradient/index.d.ts +5 -0
  108. package/dist/gradient/index.js +1549 -0
  109. package/dist/gradient/model.d.cts +94 -0
  110. package/dist/gradient/model.d.ts +94 -0
  111. package/dist/gradient/tools.d.cts +11 -0
  112. package/dist/gradient/tools.d.ts +11 -0
  113. package/dist/gradient/types.d.cts +44 -0
  114. package/dist/gradient/types.d.ts +44 -0
  115. package/dist/image-editor/index.cjs +649 -647
  116. package/dist/image-editor/index.js +6 -4
  117. package/dist/index.cjs +19 -17
  118. package/dist/index.js +16 -14
  119. package/dist/paint-editor/color.d.cts +3 -13
  120. package/dist/paint-editor/color.d.ts +3 -13
  121. package/dist/paint-editor/index.cjs +23 -68
  122. package/dist/paint-editor/index.js +15 -60
  123. package/dist/vector/index.cjs +950 -948
  124. package/dist/vector/index.js +5 -3
  125. package/dist/video-editor/index.cjs +5 -3
  126. package/dist/video-editor/index.js +4 -2
  127. package/package.json +21 -1
  128. package/skills/README.md +2 -0
  129. package/skills/pixerate-color/SKILL.md +69 -0
  130. package/skills/pixerate-effect-authoring/SKILL.md +80 -0
  131. package/dist/chunk-45VRG4RB.js +0 -65
  132. package/dist/chunk-5FXOR7F2.cjs +0 -65
@@ -53,7 +53,7 @@ var _chunkQT26RHKKcjs = require('./chunk-QT26RHKK.cjs');
53
53
 
54
54
 
55
55
 
56
- var _chunkONZJD2ODcjs = require('./chunk-ONZJD2OD.cjs');
56
+ var _chunkBROJYMWUcjs = require('./chunk-BROJYMWU.cjs');
57
57
 
58
58
 
59
59
 
@@ -89,7 +89,7 @@ var _chunkONZJD2ODcjs = require('./chunk-ONZJD2OD.cjs');
89
89
 
90
90
 
91
91
 
92
- var _chunkHRI3ZMDMcjs = require('./chunk-HRI3ZMDM.cjs');
92
+ var _chunkRHXW4TA5cjs = require('./chunk-RHXW4TA5.cjs');
93
93
 
94
94
 
95
95
 
@@ -3262,7 +3262,7 @@ function mapAnchor(a, f) {
3262
3262
  return out;
3263
3263
  }
3264
3264
  function mapSubpaths(subpaths, f) {
3265
- return _chunkHRI3ZMDMcjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
3265
+ return _chunkRHXW4TA5cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
3266
3266
  }
3267
3267
  function liveShapeSubpaths(live) {
3268
3268
  let out;
@@ -3270,19 +3270,19 @@ function liveShapeSubpaths(live) {
3270
3270
  case "rect": {
3271
3271
  const x = Math.min(live.x, live.x + live.width);
3272
3272
  const y = Math.min(live.y, live.y + live.height);
3273
- const sp = _chunkHRI3ZMDMcjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
3273
+ const sp = _chunkRHXW4TA5cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
3274
3274
  const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
3275
- out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkHRI3ZMDMcjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
3275
+ out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkRHXW4TA5cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
3276
3276
  break;
3277
3277
  }
3278
3278
  case "ellipse":
3279
- out = [_chunkHRI3ZMDMcjs.ellipseSubpath.call(void 0, normBox(live))];
3279
+ out = [_chunkRHXW4TA5cjs.ellipseSubpath.call(void 0, normBox(live))];
3280
3280
  break;
3281
3281
  case "polygon":
3282
- out = [_chunkHRI3ZMDMcjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
3282
+ out = [_chunkRHXW4TA5cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
3283
3283
  break;
3284
3284
  case "star":
3285
- out = [_chunkHRI3ZMDMcjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
3285
+ out = [_chunkRHXW4TA5cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
3286
3286
  break;
3287
3287
  case "line": {
3288
3288
  const a = { x: live.x1, y: live.y1 };
@@ -3305,7 +3305,7 @@ function liveShapeSubpaths(live) {
3305
3305
  }
3306
3306
  }
3307
3307
  const m = live.transform;
3308
- return m && !_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, p)) : out;
3308
+ return m && !_chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, p)) : out;
3309
3309
  }
3310
3310
  function normBox(b) {
3311
3311
  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) };
@@ -3317,7 +3317,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
3317
3317
  function componentPath(c) {
3318
3318
  let p = pathCache.get(c.subpaths);
3319
3319
  if (!p) {
3320
- p = _chunkHRI3ZMDMcjs.subpathsToBezier.call(void 0, c.subpaths);
3320
+ p = _chunkRHXW4TA5cjs.subpathsToBezier.call(void 0, c.subpaths);
3321
3321
  pathCache.set(c.subpaths, p);
3322
3322
  }
3323
3323
  return p;
@@ -3640,7 +3640,7 @@ function matrixArg(v, path) {
3640
3640
  if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail2(`${path} must be six numbers [a, b, c, d, e, f].`);
3641
3641
  const m = v;
3642
3642
  if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail2(`${path} is singular.`);
3643
- return _chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
3643
+ return _chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
3644
3644
  }
3645
3645
  function normalizeLiveShape(v, path = "shape") {
3646
3646
  if (!v || typeof v !== "object") return fail2(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
@@ -3701,7 +3701,7 @@ function normalizeSubpaths(v, path = "subpaths") {
3701
3701
  if (typeof v === "string") {
3702
3702
  let subs;
3703
3703
  try {
3704
- subs = _chunkHRI3ZMDMcjs.bezierToSubpaths.call(void 0, v);
3704
+ subs = _chunkRHXW4TA5cjs.bezierToSubpaths.call(void 0, v);
3705
3705
  } catch (e5) {
3706
3706
  return fail2(`${path}: could not read the SVG path data.`);
3707
3707
  }
@@ -3787,15 +3787,15 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
3787
3787
  function transformShapeComponents(components, f, affine) {
3788
3788
  return components.map((c) => {
3789
3789
  if (affine && c.live) {
3790
- const live = { ...c.live, transform: _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkHRI3ZMDMcjs.IDENTITY_MATRIX)), affine) };
3791
- if (_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
3790
+ const live = { ...c.live, transform: _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkRHXW4TA5cjs.IDENTITY_MATRIX)), affine) };
3791
+ if (_chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
3792
3792
  return { op: c.op, subpaths: liveShapeSubpaths(live), live };
3793
3793
  }
3794
3794
  return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
3795
3795
  });
3796
3796
  }
3797
3797
  function offsetShape(layer, dx, dy, env) {
3798
- const m = _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, dx, dy);
3798
+ const m = _chunkRHXW4TA5cjs.translateMatrix.call(void 0, dx, dy);
3799
3799
  const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
3800
3800
  delete next.annotation;
3801
3801
  return rerenderShape(next, env);
@@ -3803,7 +3803,7 @@ function offsetShape(layer, dx, dy, env) {
3803
3803
  function mergeShapeComponents(components, fillRule = "nonzero") {
3804
3804
  if (components.length < 2) return [...components];
3805
3805
  const path = shapeOutline(components, fillRule);
3806
- const subpaths = _chunkHRI3ZMDMcjs.bezierToSubpaths.call(void 0, path);
3806
+ const subpaths = _chunkRHXW4TA5cjs.bezierToSubpaths.call(void 0, path);
3807
3807
  if (!subpaths.length) fail2("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
3808
3808
  return [{ op: "combine", subpaths }];
3809
3809
  }
@@ -3820,7 +3820,7 @@ function annotationPaint(color, opacity) {
3820
3820
  function shapeFromAnnotation(a) {
3821
3821
  const opacity = _nullishCoalesce(a.opacity, () => ( 1));
3822
3822
  const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
3823
- const rotation = a.rotation ? _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
3823
+ const rotation = a.rotation ? _chunkRHXW4TA5cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
3824
3824
  const t = rotation ? { transform: rotation } : {};
3825
3825
  const live = (l) => liveComponent(l);
3826
3826
  switch (a.type) {
@@ -3863,7 +3863,7 @@ function shapeFromAnnotation(a) {
3863
3863
  case "pen": {
3864
3864
  const paint = annotationPaint(a.strokeColor, opacity);
3865
3865
  if (!paint) return null;
3866
- const pts = rotation ? a.points.map((p) => _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, rotation, p)) : a.points;
3866
+ const pts = rotation ? a.points.map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
3867
3867
  const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
3868
3868
  return {
3869
3869
  components: [{ op: "combine", subpaths }],
@@ -3896,7 +3896,7 @@ var fail3 = (message) => {
3896
3896
  };
3897
3897
  var TEXT_RENDER_MARGIN = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH;
3898
3898
  function textMatrix(layer) {
3899
- return _nullishCoalesce(layer.transform, () => ( _chunkHRI3ZMDMcjs.IDENTITY_MATRIX));
3899
+ return _nullishCoalesce(layer.transform, () => ( _chunkRHXW4TA5cjs.IDENTITY_MATRIX));
3900
3900
  }
3901
3901
  function rectCorners(r) {
3902
3902
  return [
@@ -3907,7 +3907,7 @@ function rectCorners(r) {
3907
3907
  ];
3908
3908
  }
3909
3909
  function docRect(r, m) {
3910
- const pts = rectCorners(r).map((p) => _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, p));
3910
+ const pts = rectCorners(r).map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, p));
3911
3911
  const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
3912
3912
  const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
3913
3913
  const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
@@ -3940,14 +3940,14 @@ function inkBounds(layout) {
3940
3940
  }
3941
3941
  function textOutlines(layer, shaper) {
3942
3942
  if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
3943
- const layout = _chunkHRI3ZMDMcjs.layoutText.call(void 0, layer, shaper);
3943
+ const layout = _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper);
3944
3944
  const m = textMatrix(layer);
3945
3945
  const out = [];
3946
3946
  for (const l of layout.lines) {
3947
3947
  for (const f of l.fragments) {
3948
- let path = _chunkHRI3ZMDMcjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3949
- for (const r of _chunkHRI3ZMDMcjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkHRI3ZMDMcjs.textRectPath.call(void 0, r)];
3950
- out.push({ fragment: f, path: _chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3948
+ let path = _chunkRHXW4TA5cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3949
+ for (const r of _chunkRHXW4TA5cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkRHXW4TA5cjs.textRectPath.call(void 0, r)];
3950
+ out.push({ fragment: f, path: _chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3951
3951
  }
3952
3952
  }
3953
3953
  return out;
@@ -4003,7 +4003,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4003
4003
  const canvas = env.createCanvas(region.width, region.height);
4004
4004
  const ctx = canvas.getContext("2d");
4005
4005
  if (!ctx || typeof ctx.getImageData !== "function") return null;
4006
- const layout = _chunkHRI3ZMDMcjs.layoutText.call(void 0, layer, shaper);
4006
+ const layout = _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper);
4007
4007
  const m = textMatrix(layer);
4008
4008
  ctx.setTransform(1, 0, 0, 1, 0, 0);
4009
4009
  ctx.clearRect(0, 0, region.width, region.height);
@@ -4015,8 +4015,8 @@ function renderOnCanvas(layer, shaper, region, env) {
4015
4015
  ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
4016
4016
  const s = layer.text.slice(f.start, f.end);
4017
4017
  if (!f.spaced) shaper.draw(ctx, s, f.font, f.x, f.y);
4018
- else for (let k = 0; k < s.length; k++) if (!_chunkHRI3ZMDMcjs.isTextSpace.call(void 0, s[k])) shaper.draw(ctx, s[k], f.font, f.x + f.carets[k], f.y);
4019
- for (const d of _chunkHRI3ZMDMcjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4018
+ else for (let k = 0; k < s.length; k++) if (!_chunkRHXW4TA5cjs.isTextSpace.call(void 0, s[k])) shaper.draw(ctx, s[k], f.font, f.x + f.carets[k], f.y);
4019
+ for (const d of _chunkRHXW4TA5cjs.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 = _chunkHRI3ZMDMcjs.layoutText.call(void 0, layer, shaper);
4030
+ const layout = _chunkRHXW4TA5cjs.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;
@@ -4127,7 +4127,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
4127
4127
  continue;
4128
4128
  }
4129
4129
  const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
4130
- if (k === "autoLeading" && value === _chunkHRI3ZMDMcjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4130
+ if (k === "autoLeading" && value === _chunkRHXW4TA5cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4131
4131
  else o[k] = value;
4132
4132
  } else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
4133
4133
  }
@@ -4164,14 +4164,14 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
4164
4164
  opacity: 1,
4165
4165
  blend: "normal",
4166
4166
  text: text3,
4167
- runs: _chunkHRI3ZMDMcjs.fitRuns.call(void 0, init.runs, text3.length, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE),
4168
- paragraphs: _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4167
+ runs: _chunkRHXW4TA5cjs.fitRuns.call(void 0, init.runs, text3.length, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE),
4168
+ paragraphs: _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4169
4169
  frame: init.frame,
4170
4170
  surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4),
4171
4171
  offset: { x: 0, y: 0 }
4172
4172
  };
4173
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _61 => _61.runs, 'access', _62 => _62[0], 'optionalAccess', _63 => _63.style]), () => ( _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE)) }];
4174
- if (init.transform && !_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4173
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _61 => _61.runs, 'access', _62 => _62[0], 'optionalAccess', _63 => _63.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE)) }];
4174
+ if (init.transform && !_chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4175
4175
  if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
4176
4176
  return rerenderText(layer, env);
4177
4177
  }
@@ -4181,24 +4181,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
4181
4181
  const patch = change(current);
4182
4182
  const next = { ...current, ...patch };
4183
4183
  if (!("annotation" in patch)) delete next.annotation;
4184
- if ("text" in patch || "runs" in patch) next.runs = _chunkHRI3ZMDMcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _64 => _64.runs, 'access', _65 => _65[0], 'optionalAccess', _66 => _66.style]), () => ( _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE)));
4185
- if (!next.runs.length) next.runs = [{ length: 0, style: _chunkHRI3ZMDMcjs.styleAt.call(void 0, current.runs, 0, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE) }];
4186
- if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4184
+ if ("text" in patch || "runs" in patch) next.runs = _chunkRHXW4TA5cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _64 => _64.runs, 'access', _65 => _65[0], 'optionalAccess', _66 => _66.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE)));
4185
+ if (!next.runs.length) next.runs = [{ length: 0, style: _chunkRHXW4TA5cjs.styleAt.call(void 0, current.runs, 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE) }];
4186
+ if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4187
4187
  const rendered = rerenderText(next, env);
4188
4188
  return { layers: _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4189
4189
  }
4190
4190
  function replaceTextRange(layer, start, end, insert) {
4191
4191
  const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
4192
- const style = _chunkHRI3ZMDMcjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE);
4193
- const runs = _chunkHRI3ZMDMcjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4194
- const pstyle = _chunkHRI3ZMDMcjs.styleAt.call(void 0, layer.paragraphs, start, {});
4195
- const paragraphs = _chunkHRI3ZMDMcjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4196
- return { text: text3, runs, paragraphs: _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4192
+ const style = _chunkRHXW4TA5cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE);
4193
+ const runs = _chunkRHXW4TA5cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4194
+ const pstyle = _chunkRHXW4TA5cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4195
+ const paragraphs = _chunkRHXW4TA5cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4196
+ return { text: text3, runs, paragraphs: _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4197
4197
  }
4198
4198
  function transformTypeLayer(layer, m) {
4199
- const t = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4199
+ const t = _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4200
4200
  const next = { ...layer };
4201
- if (_chunkHRI3ZMDMcjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4201
+ if (_chunkRHXW4TA5cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4202
4202
  else next.transform = t;
4203
4203
  delete next.annotation;
4204
4204
  return next;
@@ -4206,7 +4206,7 @@ function transformTypeLayer(layer, m) {
4206
4206
  function typeFrame(layer, shaper) {
4207
4207
  if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
4208
4208
  if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
4209
- const b = _chunkHRI3ZMDMcjs.layoutText.call(void 0, layer, shaper).bounds;
4209
+ const b = _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper).bounds;
4210
4210
  return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
4211
4211
  }
4212
4212
  function typeAsPixelLayer(layer) {
@@ -4214,7 +4214,7 @@ function typeAsPixelLayer(layer) {
4214
4214
  return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
4215
4215
  }
4216
4216
  function toTextSpace(layer, p) {
4217
- return _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4217
+ return _chunkRHXW4TA5cjs.applyMatrix.call(void 0, _chunkRHXW4TA5cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4218
4218
  }
4219
4219
  function typeFromAnnotation(a) {
4220
4220
  if (a.type !== "text") return null;
@@ -4228,7 +4228,7 @@ function typeFromAnnotation(a) {
4228
4228
  if (op !== 1) style.opacity = op;
4229
4229
  const text3 = t.text.replace(/\r?\n|\r/g, " ");
4230
4230
  const translate = [1, 0, 0, 1, t.x, t.y];
4231
- const transform = t.rotation ? _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, translate, _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4231
+ const transform = t.rotation ? _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, translate, _chunkRHXW4TA5cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4232
4232
  return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
4233
4233
  }
4234
4234
  function annotationOfType(layer) {
@@ -4562,7 +4562,7 @@ function identityTransform(box2) {
4562
4562
  }
4563
4563
  function cornersFromMatrix(box2, m) {
4564
4564
  const q2 = _chunkQT26RHKKcjs.boxQuad.call(void 0, box2);
4565
- return [_chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[0]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[1]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[2]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[3])];
4565
+ return [_chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[0]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[1]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[2]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[3])];
4566
4566
  }
4567
4567
  function matrixFromCorners(box2, corners, eps = 1e-6) {
4568
4568
  const [tl, tr, br, bl] = corners;
@@ -4579,7 +4579,7 @@ function transformHomography(geometry) {
4579
4579
  function hasWarp(geometry) {
4580
4580
  const w = geometry.warp;
4581
4581
  if (!w) return false;
4582
- const id = _chunkHRI3ZMDMcjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4582
+ const id = _chunkRHXW4TA5cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4583
4583
  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;
4584
4584
  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);
4585
4585
  }
@@ -4594,7 +4594,7 @@ function transformMap(geometry) {
4594
4594
  const { box: box2 } = geometry;
4595
4595
  const warp = hasWarp(geometry) ? geometry.warp : null;
4596
4596
  if (!warp) return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p);
4597
- return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkHRI3ZMDMcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4597
+ return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkRHXW4TA5cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4598
4598
  }
4599
4599
  function transformedPoint(geometry, fx, fy) {
4600
4600
  const f = transformMap(geometry);
@@ -4638,8 +4638,8 @@ function matrixFromParams(box2, params) {
4638
4638
  const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
4639
4639
  const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
4640
4640
  const ref = referencePoint(box2, params.reference);
4641
- const linear = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkHRI3ZMDMcjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4642
- return _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, _chunkHRI3ZMDMcjs.matrixAbout.call(void 0, linear, ref), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4641
+ const linear = _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkRHXW4TA5cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4642
+ return _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, _chunkRHXW4TA5cjs.matrixAbout.call(void 0, linear, ref), _chunkRHXW4TA5cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4643
4643
  }
4644
4644
  function describeTransform(geometry, reference = "center") {
4645
4645
  const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
@@ -4656,7 +4656,7 @@ function describeTransform(geometry, reference = "center") {
4656
4656
  const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
4657
4657
  const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
4658
4658
  const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
4659
- const at = _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, ref);
4659
+ const at = _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, ref);
4660
4660
  const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
4661
4661
  return {
4662
4662
  affine: true,
@@ -4674,24 +4674,24 @@ function applyParams(geometry, params) {
4674
4674
  const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
4675
4675
  const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
4676
4676
  const c = geometry.corners;
4677
- return [_chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, c[0]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, c[1]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, c[2]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, c[3])];
4677
+ return [_chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, c[0]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, c[1]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, c[2]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, c[3])];
4678
4678
  }
4679
4679
  function flipCorners(geometry, axis) {
4680
4680
  const c = anchorPoint(geometry, "center");
4681
4681
  const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
4682
4682
  const q2 = geometry.corners;
4683
- return [_chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[0]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[1]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[2]), _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, m, q2[3])];
4683
+ return [_chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[0]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[1]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[2]), _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, q2[3])];
4684
4684
  }
4685
4685
  function boxPointOf(geometry, p) {
4686
4686
  const m = matrixFromCorners(geometry.box, geometry.corners);
4687
- if (m) return _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, m), p);
4687
+ if (m) return _chunkRHXW4TA5cjs.applyMatrix.call(void 0, _chunkRHXW4TA5cjs.invertMatrix.call(void 0, m), p);
4688
4688
  return null;
4689
4689
  }
4690
4690
  function presetWarp(box2, preset) {
4691
- return _chunkHRI3ZMDMcjs.warpPresetMesh.call(void 0, preset, box2);
4691
+ return _chunkRHXW4TA5cjs.warpPresetMesh.call(void 0, preset, box2);
4692
4692
  }
4693
4693
  function isValidWarp(mesh) {
4694
- return _chunkHRI3ZMDMcjs.isValidWarpMesh.call(void 0, mesh);
4694
+ return _chunkRHXW4TA5cjs.isValidWarpMesh.call(void 0, mesh);
4695
4695
  }
4696
4696
  function geometryHomography(geometry) {
4697
4697
  const m = matrixFromCorners(geometry.box, geometry.corners);
@@ -4957,7 +4957,7 @@ function normalizePlacement(raw, contents) {
4957
4957
  }
4958
4958
  const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
4959
4959
  if (raw.warp) {
4960
- if (!_chunkHRI3ZMDMcjs.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.");
4960
+ if (!_chunkRHXW4TA5cjs.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.");
4961
4961
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
4962
4962
  }
4963
4963
  if (raw.interpolation !== void 0) {
@@ -5060,7 +5060,7 @@ function translateLayer(layer, dx, dy) {
5060
5060
  case "shape": {
5061
5061
  const next = {
5062
5062
  ...layer,
5063
- components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, dx, dy)),
5063
+ components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkRHXW4TA5cjs.translateMatrix.call(void 0, dx, dy)),
5064
5064
  surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, dx, dy),
5065
5065
  mask: moveMask(layer.mask)
5066
5066
  };
@@ -5069,7 +5069,7 @@ function translateLayer(layer, dx, dy) {
5069
5069
  return next;
5070
5070
  }
5071
5071
  case "type": {
5072
- const next = { ...transformTypeLayer(layer, _chunkHRI3ZMDMcjs.translateMatrix.call(void 0, dx, dy)), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5072
+ const next = { ...transformTypeLayer(layer, _chunkRHXW4TA5cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5073
5073
  if (!next.mask) delete next.mask;
5074
5074
  return next;
5075
5075
  }
@@ -5255,7 +5255,7 @@ function refitPlacement(layer, contents) {
5255
5255
  });
5256
5256
  const out = { corners: pts };
5257
5257
  if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
5258
- if (layer.placement.warp) out.warp = _chunkHRI3ZMDMcjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5258
+ if (layer.placement.warp) out.warp = _chunkRHXW4TA5cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5259
5259
  return out;
5260
5260
  }
5261
5261
  function normalizeSmartFilter(raw, id = newLayerId("flt")) {
@@ -5569,7 +5569,7 @@ function readType(r, base, ctx) {
5569
5569
  const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
5570
5570
  const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
5571
5571
  length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _139 => _139.length]), 0, 1e9, 0))),
5572
- style: patchTextStyle(_chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _140 => _140.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5572
+ style: patchTextStyle(_chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _140 => _140.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5573
5573
  }));
5574
5574
  const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
5575
5575
  length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _141 => _141.length]), 0, 1e9, 0))),
@@ -5582,13 +5582,13 @@ function readType(r, base, ctx) {
5582
5582
  ...base,
5583
5583
  type: "type",
5584
5584
  text: text3,
5585
- runs: _chunkHRI3ZMDMcjs.fitRuns.call(void 0, runs, text3.length, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE),
5586
- paragraphs: _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5585
+ runs: _chunkRHXW4TA5cjs.fitRuns.call(void 0, runs, text3.length, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE),
5586
+ paragraphs: _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5587
5587
  frame,
5588
5588
  surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4),
5589
5589
  offset: { x: 0, y: 0 }
5590
5590
  };
5591
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _145 => _145[0], 'optionalAccess', _146 => _146.style]), () => ( _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE)) }];
5591
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _145 => _145[0], 'optionalAccess', _146 => _146.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE)) }];
5592
5592
  if (m) layer.transform = m;
5593
5593
  if (r.antiAlias === false) layer.antiAlias = false;
5594
5594
  if (typeof r.fillOpacity === "number" && r.fillOpacity !== 1) layer.fillOpacity = num2(r.fillOpacity, 0, 1, 1);
@@ -6041,7 +6041,7 @@ function readSmartObject(r, base, ctx) {
6041
6041
  let placement;
6042
6042
  try {
6043
6043
  const raw = { corners: p.corners };
6044
- if (p.warp && _chunkHRI3ZMDMcjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6044
+ if (p.warp && _chunkRHXW4TA5cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6045
6045
  if (_chunkHGTDMKNEcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6046
6046
  placement = normalizePlacement(raw, contents);
6047
6047
  } catch (e) {
@@ -7024,7 +7024,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
7024
7024
  const fr = (p) => ({ x: p.x / w, y: p.y / h });
7025
7025
  const subpaths = [];
7026
7026
  components.forEach((c, ci) => {
7027
- _chunkHRI3ZMDMcjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7027
+ _chunkRHXW4TA5cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7028
7028
  if (!sp.anchors.length) return;
7029
7029
  subpaths.push({
7030
7030
  closed: sp.closed,
@@ -7746,7 +7746,7 @@ function merged(levels) {
7746
7746
  function charStyle(d, fonts, notes) {
7747
7747
  const n = (k) => eNum(eGet(d, k));
7748
7748
  const flag = (k) => eBool(eGet(d, k));
7749
- const s = { ..._chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE };
7749
+ const s = { ..._chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE };
7750
7750
  const fi = n("Font");
7751
7751
  const ps = fi !== void 0 ? fonts[fi] : void 0;
7752
7752
  if (ps) {
@@ -7829,7 +7829,7 @@ function typeFromTySh(data, notes) {
7829
7829
  }
7830
7830
  const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
7831
7831
  const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
7832
- let runs = [{ length: text3.length, style: { ..._chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE } }];
7832
+ let runs = [{ length: text3.length, style: { ..._chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE } }];
7833
7833
  let paragraphs = [{ length: text3.length, style: {} }];
7834
7834
  let frame = { kind: "point" };
7835
7835
  let transform = t.transform;
@@ -7885,14 +7885,14 @@ function typeFromTySh(data, notes) {
7885
7885
  const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
7886
7886
  if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
7887
7887
  frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
7888
- transform = _chunkHRI3ZMDMcjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
7888
+ transform = _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
7889
7889
  }
7890
7890
  }
7891
7891
  }
7892
7892
  return {
7893
7893
  text: text3,
7894
- runs: _chunkHRI3ZMDMcjs.fitRuns.call(void 0, runs, text3.length, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE),
7895
- paragraphs: _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, paragraphs, text3),
7894
+ runs: _chunkRHXW4TA5cjs.fitRuns.call(void 0, runs, text3.length, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE),
7895
+ paragraphs: _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
7896
7896
  frame,
7897
7897
  transform,
7898
7898
  antiAlias,
@@ -7966,7 +7966,7 @@ function buildEngineData(layer, template) {
7966
7966
  fonts.push(ps);
7967
7967
  return fonts.length - 1;
7968
7968
  };
7969
- const runs = _chunkHRI3ZMDMcjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE);
7969
+ const runs = _chunkRHXW4TA5cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE);
7970
7970
  const sruns = [];
7971
7971
  const slens = [];
7972
7972
  runs.forEach((r, i) => {
@@ -7974,10 +7974,10 @@ function buildEngineData(layer, template) {
7974
7974
  slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
7975
7975
  });
7976
7976
  if (!runs.length) {
7977
- sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE)))]])]]));
7977
+ sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE)))]])]]));
7978
7978
  slens.push(E.int(1));
7979
7979
  }
7980
- const paras = _chunkHRI3ZMDMcjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
7980
+ const paras = _chunkRHXW4TA5cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
7981
7981
  const pruns = [];
7982
7982
  const plens = [];
7983
7983
  paras.forEach((p, i) => {
@@ -8033,7 +8033,7 @@ function buildEngineData(layer, template) {
8033
8033
  eSet(e, key, rd);
8034
8034
  }
8035
8035
  eSet(rd, "FontSet", fontSet);
8036
- if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _211 => _211[0], 'optionalAccess', _212 => _212.style]), () => ( _chunkHRI3ZMDMcjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8036
+ if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _211 => _211[0], 'optionalAccess', _212 => _212.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8037
8037
  if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
8038
8038
  if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
8039
8039
  if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
@@ -8044,13 +8044,13 @@ function inkBounds2(layer) {
8044
8044
  if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
8045
8045
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
8046
8046
  if (!b) return [0, 0, 0, 0];
8047
- const inv = _chunkHRI3ZMDMcjs.invertMatrix.call(void 0, textMatrix(layer));
8047
+ const inv = _chunkRHXW4TA5cjs.invertMatrix.call(void 0, textMatrix(layer));
8048
8048
  const pts = [
8049
8049
  { x: b.x, y: b.y },
8050
8050
  { x: b.x + b.width, y: b.y },
8051
8051
  { x: b.x + b.width, y: b.y + b.height },
8052
8052
  { x: b.x, y: b.y + b.height }
8053
- ].map((p) => _chunkHRI3ZMDMcjs.applyMatrix.call(void 0, inv, p));
8053
+ ].map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, inv, p));
8054
8054
  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))];
8055
8055
  }
8056
8056
  function tyShForLayer(layer) {
@@ -8517,7 +8517,7 @@ function filterMaskItem(placed, mask, area) {
8517
8517
  var warpStyleOf = (name) => {
8518
8518
  if (!name.startsWith("warp")) return null;
8519
8519
  const s = _optionalChain([name, 'access', _226 => _226[4], 'optionalAccess', _227 => _227.toLowerCase, 'call', _228 => _228()]) + name.slice(5);
8520
- return _chunkHRI3ZMDMcjs.WARP_STYLES.includes(s) ? s : null;
8520
+ return _chunkRHXW4TA5cjs.WARP_STYLES.includes(s) ? s : null;
8521
8521
  };
8522
8522
  function warpFromDescriptor(w, contents) {
8523
8523
  const full = { x: 0, y: 0, width: contents.width, height: contents.height };
@@ -8547,7 +8547,7 @@ function warpFromDescriptor(w, contents) {
8547
8547
  } else {
8548
8548
  const style = warpStyleOf(styleName);
8549
8549
  if (!style) return void 0;
8550
- mesh = _chunkHRI3ZMDMcjs.warpPresetMesh.call(void 0,
8550
+ mesh = _chunkRHXW4TA5cjs.warpPresetMesh.call(void 0,
8551
8551
  {
8552
8552
  style,
8553
8553
  bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
@@ -8562,7 +8562,7 @@ function warpFromDescriptor(w, contents) {
8562
8562
  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;
8563
8563
  if (!same) {
8564
8564
  const m = mesh;
8565
- mesh = _chunkHRI3ZMDMcjs.fitWarpMesh.call(void 0, (s, t) => _chunkHRI3ZMDMcjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8565
+ mesh = _chunkRHXW4TA5cjs.fitWarpMesh.call(void 0, (s, t) => _chunkRHXW4TA5cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8566
8566
  }
8567
8567
  return { mesh, frame };
8568
8568
  }
@@ -10138,7 +10138,7 @@ function importSmart(ctx, rec, name, notes, props) {
10138
10138
  if (placement && (size.width !== contents.width || size.height !== contents.height)) {
10139
10139
  const kx = contents.width / size.width;
10140
10140
  const ky = contents.height / size.height;
10141
- if (placement.warp) placement = { ...placement, warp: _chunkHRI3ZMDMcjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10141
+ if (placement.warp) placement = { ...placement, warp: _chunkRHXW4TA5cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10142
10142
  }
10143
10143
  }
10144
10144
  if (!contents || !placement) {
@@ -10264,7 +10264,7 @@ function psdToLayers(file, options = {}) {
10264
10264
  let src = null;
10265
10265
  if (icc) {
10266
10266
  try {
10267
- const p = _chunkONZJD2ODcjs.parseProfile.call(void 0, icc);
10267
+ const p = _chunkBROJYMWUcjs.parseProfile.call(void 0, icc);
10268
10268
  if (p.colorSpace === "cmyk") {
10269
10269
  src = p;
10270
10270
  cmykProfile = { name: p.description || "Embedded CMYK profile", icc: icc.slice() };
@@ -10274,10 +10274,10 @@ function psdToLayers(file, options = {}) {
10274
10274
  }
10275
10275
  }
10276
10276
  if (!src) {
10277
- src = _chunkONZJD2ODcjs.builtinProfile.call(void 0, "coated-cmyk");
10277
+ src = _chunkBROJYMWUcjs.builtinProfile.call(void 0, "coated-cmyk");
10278
10278
  cmykProfile = { builtin: "coated-cmyk", name: src.description };
10279
10279
  }
10280
- const t = _chunkONZJD2ODcjs.Transform.create(src, _chunkONZJD2ODcjs.srgbProfile.call(void 0, ), { intent: "relative", bpc: true });
10280
+ const t = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.srgbProfile.call(void 0, ), { intent: "relative", bpc: true });
10281
10281
  ctx.cmykToRgb = (ink, out) => t.convert8(ink, 4, out, 4, false);
10282
10282
  if (header.depth === 16) ctx.cmykToRgb16 = (ink, out) => t.convert16(ink, 4, out, 4, false);
10283
10283
  }
@@ -51,7 +51,7 @@ var _chunkLRRCMRSLcjs = require('./chunk-LRRCMRSL.cjs');
51
51
 
52
52
 
53
53
 
54
- var _chunk5FXOR7F2cjs = require('./chunk-5FXOR7F2.cjs');
54
+ var _chunkLEUZ4FRCcjs = require('./chunk-LEUZ4FRC.cjs');
55
55
 
56
56
 
57
57
 
@@ -192,7 +192,7 @@ var toGamma = (c) => {
192
192
  function intoSpace(space, [r, g, b]) {
193
193
  if (space === "linear") return [toLinear(r), toLinear(g), toLinear(b)];
194
194
  if (space === "oklab") {
195
- const c = _chunk5FXOR7F2cjs.rgbToOklab.call(void 0, r, g, b);
195
+ const c = _chunkLEUZ4FRCcjs.rgbToOklab.call(void 0, r, g, b);
196
196
  return [c.l, c.a, c.b];
197
197
  }
198
198
  return [r, g, b];
@@ -200,7 +200,7 @@ function intoSpace(space, [r, g, b]) {
200
200
  function outOfSpace(space, [x, y, z]) {
201
201
  if (space === "linear") return [toGamma(x), toGamma(y), toGamma(z)];
202
202
  if (space === "oklab") {
203
- const c = _chunk5FXOR7F2cjs.oklabToRgb.call(void 0, { l: x, a: y, b: z, alpha: 1 });
203
+ const c = _chunkLEUZ4FRCcjs.oklabToRgb.call(void 0, { l: x, a: y, b: z, alpha: 1 });
204
204
  return [c.r, c.g, c.b];
205
205
  }
206
206
  return [clamp(x, 0, 1), clamp(y, 0, 1), clamp(z, 0, 1)];
@@ -4,7 +4,7 @@
4
4
  var _chunkDWJJI6RTcjs = require('./chunk-DWJJI6RT.cjs');
5
5
 
6
6
 
7
- var _chunk5FXOR7F2cjs = require('./chunk-5FXOR7F2.cjs');
7
+ var _chunkLEUZ4FRCcjs = require('./chunk-LEUZ4FRC.cjs');
8
8
 
9
9
  // src/animation/keyframes.ts
10
10
  var ANIMATION_TIME_EPSILON = 1e-6;
@@ -46,7 +46,7 @@ function interpolateAnimationValue(from, to, t, type = "number") {
46
46
  if (t <= 0) return from;
47
47
  if (t >= 1) return to;
48
48
  if (type === "color" || typeof from === "string" && typeof to === "string") {
49
- const mixed = _chunk5FXOR7F2cjs.mixColorsOklab.call(void 0, from, to, t);
49
+ const mixed = _chunkLEUZ4FRCcjs.mixColorsOklab.call(void 0, from, to, t);
50
50
  if (mixed !== null) return mixed;
51
51
  }
52
52
  return from;