@pixerate/editor 0.262.1 → 0.263.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 (68) hide show
  1. package/dist/animation-editor/index.cjs +60 -60
  2. package/dist/animation-editor/index.js +4 -4
  3. package/dist/brushes/index.cjs +52 -52
  4. package/dist/brushes/index.js +4 -4
  5. package/dist/{brushstrokeRender-N6UPZSQS.cjs → brushstrokeRender-2GBME4XD.cjs} +13 -13
  6. package/dist/{brushstrokeRender-25Q5BEY6.js → brushstrokeRender-S5DABANG.js} +3 -3
  7. package/dist/canvas/index.cjs +15 -14
  8. package/dist/canvas/index.js +3 -2
  9. package/dist/canvas/stickers.d.cts +5 -1
  10. package/dist/canvas/stickers.d.ts +5 -1
  11. package/dist/{chunk-6NZL24W4.js → chunk-34HIZXFX.js} +1 -1
  12. package/dist/{chunk-UVZ7RQOE.cjs → chunk-4E6BGHWN.cjs} +1 -1
  13. package/dist/{chunk-J5UQHWVL.js → chunk-6JL2D5SG.js} +27 -15
  14. package/dist/{chunk-QAR2N7HZ.js → chunk-6XX7E7O2.js} +1 -1
  15. package/dist/{chunk-3TQW5MPW.cjs → chunk-73QFSPDG.cjs} +23 -23
  16. package/dist/{chunk-APX63ILU.js → chunk-ACFSFUQH.js} +31 -0
  17. package/dist/{chunk-X2EXYY4J.js → chunk-CNLO6E2K.js} +2 -2
  18. package/dist/{chunk-F7CPSRLN.js → chunk-DOZ6F2K2.js} +12 -4
  19. package/dist/{chunk-CQVTGBQI.js → chunk-JGI4PZWO.js} +1 -1
  20. package/dist/{chunk-EHALWBBD.js → chunk-LG6MEEV7.js} +1 -1
  21. package/dist/{chunk-7AUQ2UJ3.cjs → chunk-LWHUU6A6.cjs} +10 -10
  22. package/dist/{chunk-JSDND7DF.cjs → chunk-OTN6VB5S.cjs} +32 -1
  23. package/dist/{chunk-5IW65VQ6.js → chunk-P5343XZO.js} +1 -1
  24. package/dist/{chunk-AVTPZO4Z.cjs → chunk-PE6YJMQT.cjs} +37 -25
  25. package/dist/{chunk-D4TE5JNW.js → chunk-QW7LKWKE.js} +1 -1
  26. package/dist/{chunk-YLUIFXSL.cjs → chunk-TIHW7CUY.cjs} +35 -35
  27. package/dist/{chunk-PYTJBVW5.cjs → chunk-TILEUVRO.cjs} +31 -31
  28. package/dist/{chunk-RVGP2XLF.cjs → chunk-XORJ7UZO.cjs} +21 -13
  29. package/dist/{chunk-43NT242D.cjs → chunk-XQW6R7VW.cjs} +86 -86
  30. package/dist/{chunk-TZOX7KWV.cjs → chunk-ZBACQHW3.cjs} +8 -8
  31. package/dist/image-editor/index.cjs +789 -788
  32. package/dist/image-editor/index.js +7 -6
  33. package/dist/image-editor/stickers.d.cts +7 -2
  34. package/dist/image-editor/stickers.d.ts +7 -2
  35. package/dist/paint-editor/controller.d.cts +7 -2
  36. package/dist/paint-editor/controller.d.ts +7 -2
  37. package/dist/paint-editor/index.cjs +574 -521
  38. package/dist/paint-editor/index.js +97 -44
  39. package/dist/paint-editor/sticker-art.d.cts +20 -10
  40. package/dist/paint-editor/sticker-art.d.ts +20 -10
  41. package/dist/paint-editor/stickers.d.cts +8 -1
  42. package/dist/paint-editor/stickers.d.ts +8 -1
  43. package/dist/paint-editor/stroke.d.cts +2 -0
  44. package/dist/paint-editor/stroke.d.ts +2 -0
  45. package/dist/stickers/browser.d.cts +10 -3
  46. package/dist/stickers/browser.d.ts +10 -3
  47. package/dist/stickers/combine.d.cts +2 -0
  48. package/dist/stickers/combine.d.ts +2 -0
  49. package/dist/stickers/conformance.d.cts +1 -1
  50. package/dist/stickers/conformance.d.ts +1 -1
  51. package/dist/stickers/errors.d.cts +1 -1
  52. package/dist/stickers/errors.d.ts +1 -1
  53. package/dist/stickers/fake.d.cts +4 -2
  54. package/dist/stickers/fake.d.ts +4 -2
  55. package/dist/stickers/helpers.d.cts +16 -2
  56. package/dist/stickers/helpers.d.ts +16 -2
  57. package/dist/stickers/index.cjs +116 -29
  58. package/dist/stickers/index.js +106 -19
  59. package/dist/stickers/tools.d.cts +9 -2
  60. package/dist/stickers/tools.d.ts +9 -2
  61. package/dist/stickers/types.d.cts +32 -5
  62. package/dist/stickers/types.d.ts +32 -5
  63. package/dist/vector/index.cjs +972 -971
  64. package/dist/vector/index.js +7 -6
  65. package/dist/vector/stickers.d.cts +7 -2
  66. package/dist/vector/stickers.d.ts +7 -2
  67. package/package.json +1 -1
  68. package/skills/pixerate-stickers/SKILL.md +20 -9
@@ -108,7 +108,7 @@ var _chunkBROJYMWUcjs = require('./chunk-BROJYMWU.cjs');
108
108
 
109
109
 
110
110
 
111
- var _chunk7AUQ2UJ3cjs = require('./chunk-7AUQ2UJ3.cjs');
111
+ var _chunkLWHUU6A6cjs = require('./chunk-LWHUU6A6.cjs');
112
112
 
113
113
 
114
114
 
@@ -2336,7 +2336,7 @@ function mapAnchor(a, f) {
2336
2336
  return out;
2337
2337
  }
2338
2338
  function mapSubpaths(subpaths, f) {
2339
- return _chunk7AUQ2UJ3cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2339
+ return _chunkLWHUU6A6cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2340
2340
  }
2341
2341
  function liveShapeSubpaths(live) {
2342
2342
  let out;
@@ -2344,19 +2344,19 @@ function liveShapeSubpaths(live) {
2344
2344
  case "rect": {
2345
2345
  const x = Math.min(live.x, live.x + live.width);
2346
2346
  const y = Math.min(live.y, live.y + live.height);
2347
- const sp = _chunk7AUQ2UJ3cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2347
+ const sp = _chunkLWHUU6A6cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2348
2348
  const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
2349
- out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunk7AUQ2UJ3cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2349
+ out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkLWHUU6A6cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2350
2350
  break;
2351
2351
  }
2352
2352
  case "ellipse":
2353
- out = [_chunk7AUQ2UJ3cjs.ellipseSubpath.call(void 0, normBox(live))];
2353
+ out = [_chunkLWHUU6A6cjs.ellipseSubpath.call(void 0, normBox(live))];
2354
2354
  break;
2355
2355
  case "polygon":
2356
- out = [_chunk7AUQ2UJ3cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2356
+ out = [_chunkLWHUU6A6cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2357
2357
  break;
2358
2358
  case "star":
2359
- out = [_chunk7AUQ2UJ3cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2359
+ out = [_chunkLWHUU6A6cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2360
2360
  break;
2361
2361
  case "line": {
2362
2362
  const a = { x: live.x1, y: live.y1 };
@@ -2379,7 +2379,7 @@ function liveShapeSubpaths(live) {
2379
2379
  }
2380
2380
  }
2381
2381
  const m = live.transform;
2382
- return m && !_chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, p)) : out;
2382
+ return m && !_chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, p)) : out;
2383
2383
  }
2384
2384
  function normBox(b) {
2385
2385
  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) };
@@ -2391,7 +2391,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
2391
2391
  function componentPath(c) {
2392
2392
  let p = pathCache.get(c.subpaths);
2393
2393
  if (!p) {
2394
- p = _chunk7AUQ2UJ3cjs.subpathsToBezier.call(void 0, c.subpaths);
2394
+ p = _chunkLWHUU6A6cjs.subpathsToBezier.call(void 0, c.subpaths);
2395
2395
  pathCache.set(c.subpaths, p);
2396
2396
  }
2397
2397
  return p;
@@ -2718,7 +2718,7 @@ function matrixArg(v, path) {
2718
2718
  if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail(`${path} must be six numbers [a, b, c, d, e, f].`);
2719
2719
  const m = v;
2720
2720
  if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail(`${path} is singular.`);
2721
- return _chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2721
+ return _chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2722
2722
  }
2723
2723
  function normalizeLiveShape(v, path = "shape") {
2724
2724
  if (!v || typeof v !== "object") return fail(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
@@ -2779,7 +2779,7 @@ function normalizeSubpaths(v, path = "subpaths") {
2779
2779
  if (typeof v === "string") {
2780
2780
  let subs;
2781
2781
  try {
2782
- subs = _chunk7AUQ2UJ3cjs.bezierToSubpaths.call(void 0, v);
2782
+ subs = _chunkLWHUU6A6cjs.bezierToSubpaths.call(void 0, v);
2783
2783
  } catch (e5) {
2784
2784
  return fail(`${path}: could not read the SVG path data.`);
2785
2785
  }
@@ -2865,15 +2865,15 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
2865
2865
  function transformShapeComponents(components, f, affine) {
2866
2866
  return components.map((c) => {
2867
2867
  if (affine && c.live) {
2868
- const live = { ...c.live, transform: _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunk7AUQ2UJ3cjs.IDENTITY_MATRIX)), affine) };
2869
- if (_chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2868
+ const live = { ...c.live, transform: _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkLWHUU6A6cjs.IDENTITY_MATRIX)), affine) };
2869
+ if (_chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2870
2870
  return { op: c.op, subpaths: liveShapeSubpaths(live), live };
2871
2871
  }
2872
2872
  return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
2873
2873
  });
2874
2874
  }
2875
2875
  function offsetShape(layer, dx, dy, env) {
2876
- const m = _chunk7AUQ2UJ3cjs.translateMatrix.call(void 0, dx, dy);
2876
+ const m = _chunkLWHUU6A6cjs.translateMatrix.call(void 0, dx, dy);
2877
2877
  const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
2878
2878
  delete next.annotation;
2879
2879
  return rerenderShape(next, env);
@@ -2881,7 +2881,7 @@ function offsetShape(layer, dx, dy, env) {
2881
2881
  function mergeShapeComponents(components, fillRule = "nonzero") {
2882
2882
  if (components.length < 2) return [...components];
2883
2883
  const path = shapeOutline(components, fillRule);
2884
- const subpaths = _chunk7AUQ2UJ3cjs.bezierToSubpaths.call(void 0, path);
2884
+ const subpaths = _chunkLWHUU6A6cjs.bezierToSubpaths.call(void 0, path);
2885
2885
  if (!subpaths.length) fail("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
2886
2886
  return [{ op: "combine", subpaths }];
2887
2887
  }
@@ -2898,7 +2898,7 @@ function annotationPaint(color, opacity) {
2898
2898
  function shapeFromAnnotation(a) {
2899
2899
  const opacity = _nullishCoalesce(a.opacity, () => ( 1));
2900
2900
  const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
2901
- const rotation = a.rotation ? _chunk7AUQ2UJ3cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2901
+ const rotation = a.rotation ? _chunkLWHUU6A6cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2902
2902
  const t = rotation ? { transform: rotation } : {};
2903
2903
  const live = (l) => liveComponent(l);
2904
2904
  switch (a.type) {
@@ -2941,7 +2941,7 @@ function shapeFromAnnotation(a) {
2941
2941
  case "pen": {
2942
2942
  const paint = annotationPaint(a.strokeColor, opacity);
2943
2943
  if (!paint) return null;
2944
- const pts = rotation ? a.points.map((p) => _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2944
+ const pts = rotation ? a.points.map((p) => _chunkLWHUU6A6cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2945
2945
  const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
2946
2946
  return {
2947
2947
  components: [{ op: "combine", subpaths }],
@@ -2974,7 +2974,7 @@ var JOIN_SIGMA = 2;
2974
2974
  function vectorMaskSegments(components) {
2975
2975
  const out = [];
2976
2976
  components.forEach((c, ci) => c.subpaths.forEach((sp, si) => {
2977
- for (let k = 0; k < _chunk7AUQ2UJ3cjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2977
+ for (let k = 0; k < _chunkLWHUU6A6cjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2978
2978
  }));
2979
2979
  return out;
2980
2980
  }
@@ -2982,7 +2982,7 @@ function validVectorMaskEdges(edges, components) {
2982
2982
  if (!_optionalChain([edges, 'optionalAccess', _34 => _34.length])) return [];
2983
2983
  return edges.filter((e) => {
2984
2984
  const sp = _optionalChain([components, 'access', _35 => _35[e.component], 'optionalAccess', _36 => _36.subpaths, 'access', _37 => _37[e.subpath]]);
2985
- return Boolean(sp) && e.segment >= 0 && e.segment < _chunk7AUQ2UJ3cjs.subpathSegmentCount.call(void 0, sp);
2985
+ return Boolean(sp) && e.segment >= 0 && e.segment < _chunkLWHUU6A6cjs.subpathSegmentCount.call(void 0, sp);
2986
2986
  });
2987
2987
  }
2988
2988
  function reach(e) {
@@ -3005,8 +3005,8 @@ function hybridVectorMaskCoverage(vm, hard, width, height, guide) {
3005
3005
  const seedClass = [];
3006
3006
  vm.components.forEach(
3007
3007
  (c, ci) => c.subpaths.forEach((sp, si) => {
3008
- for (let k = 0; k < _chunk7AUQ2UJ3cjs.subpathSegmentCount.call(void 0, sp); k++) {
3009
- const seg = _chunk7AUQ2UJ3cjs.subpathSegment.call(void 0, sp, k);
3008
+ for (let k = 0; k < _chunkLWHUU6A6cjs.subpathSegmentCount.call(void 0, sp); k++) {
3009
+ const seg = _chunkLWHUU6A6cjs.subpathSegment.call(void 0, sp, k);
3010
3010
  let len = 0;
3011
3011
  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]);
3012
3012
  const steps = Math.max(2, Math.ceil(len * 2));
@@ -3906,7 +3906,7 @@ var fail3 = (message) => {
3906
3906
  };
3907
3907
  var TEXT_RENDER_MARGIN = _chunkPVJMTLPJcjs.MAX_EFFECT_REACH;
3908
3908
  function textMatrix(layer) {
3909
- return _nullishCoalesce(layer.transform, () => ( _chunk7AUQ2UJ3cjs.IDENTITY_MATRIX));
3909
+ return _nullishCoalesce(layer.transform, () => ( _chunkLWHUU6A6cjs.IDENTITY_MATRIX));
3910
3910
  }
3911
3911
  function rectCorners(r) {
3912
3912
  return [
@@ -3917,7 +3917,7 @@ function rectCorners(r) {
3917
3917
  ];
3918
3918
  }
3919
3919
  function docRect(r, m) {
3920
- const pts = rectCorners(r).map((p) => _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, p));
3920
+ const pts = rectCorners(r).map((p) => _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, p));
3921
3921
  const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
3922
3922
  const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
3923
3923
  const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
@@ -3937,7 +3937,7 @@ function inkBounds(layout) {
3937
3937
  for (const f of l.fragments) {
3938
3938
  const pad = f.style.fontSize * (l.matrix ? 1 : 0.5);
3939
3939
  const w = f.carets[f.carets.length - 1];
3940
- const r = _chunk7AUQ2UJ3cjs.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) });
3940
+ const r = _chunkLWHUU6A6cjs.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) });
3941
3941
  if (!b) b = r;
3942
3942
  else {
3943
3943
  const x0 = Math.min(b.x, r.x);
@@ -3950,14 +3950,14 @@ function inkBounds(layout) {
3950
3950
  }
3951
3951
  function textOutlines(layer, shaper) {
3952
3952
  if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
3953
- const layout = _chunk7AUQ2UJ3cjs.layoutText.call(void 0, layer, shaper);
3953
+ const layout = _chunkLWHUU6A6cjs.layoutText.call(void 0, layer, shaper);
3954
3954
  const m = textMatrix(layer);
3955
3955
  const out = [];
3956
3956
  for (const l of layout.lines) {
3957
3957
  for (const f of l.fragments) {
3958
- let path = _chunk7AUQ2UJ3cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3959
- for (const r of _chunk7AUQ2UJ3cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunk7AUQ2UJ3cjs.textRectPath.call(void 0, r)];
3960
- out.push({ fragment: f, path: _chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3958
+ let path = _chunkLWHUU6A6cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3959
+ for (const r of _chunkLWHUU6A6cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkLWHUU6A6cjs.textRectPath.call(void 0, r)];
3960
+ out.push({ fragment: f, path: _chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3961
3961
  }
3962
3962
  }
3963
3963
  return out;
@@ -4013,7 +4013,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4013
4013
  const canvas = env.createCanvas(region.width, region.height);
4014
4014
  const ctx = canvas.getContext("2d");
4015
4015
  if (!ctx || typeof ctx.getImageData !== "function") return null;
4016
- const layout = _chunk7AUQ2UJ3cjs.layoutText.call(void 0, layer, shaper);
4016
+ const layout = _chunkLWHUU6A6cjs.layoutText.call(void 0, layer, shaper);
4017
4017
  const m = textMatrix(layer);
4018
4018
  ctx.setTransform(1, 0, 0, 1, 0, 0);
4019
4019
  ctx.clearRect(0, 0, region.width, region.height);
@@ -4023,8 +4023,8 @@ function renderOnCanvas(layer, shaper, region, env) {
4023
4023
  const [r, g, b] = rgbOf(f.style.color);
4024
4024
  ctx.fillStyle = `rgb(${r}, ${g}, ${b})`;
4025
4025
  ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
4026
- _chunk7AUQ2UJ3cjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4027
- for (const d of _chunk7AUQ2UJ3cjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4026
+ _chunkLWHUU6A6cjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4027
+ for (const d of _chunkLWHUU6A6cjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4028
4028
  }
4029
4029
  }
4030
4030
  ctx.globalAlpha = 1;
@@ -4035,7 +4035,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4035
4035
  function renderText(layer, env) {
4036
4036
  const shaper = env.shaper;
4037
4037
  if (!shaper || !shaper.outline && !shaper.draw) return null;
4038
- const layout = _chunk7AUQ2UJ3cjs.layoutText.call(void 0, layer, shaper);
4038
+ const layout = _chunkLWHUU6A6cjs.layoutText.call(void 0, layer, shaper);
4039
4039
  const ink = inkBounds(layout);
4040
4040
  const clip = { x: -TEXT_RENDER_MARGIN, y: -TEXT_RENDER_MARGIN, width: env.width + 2 * TEXT_RENDER_MARGIN, height: env.height + 2 * TEXT_RENDER_MARGIN };
4041
4041
  const region = ink ? intersect2(docRect(ink, textMatrix(layer)), clip) : null;
@@ -4136,7 +4136,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
4136
4136
  continue;
4137
4137
  }
4138
4138
  const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
4139
- if (k === "autoLeading" && value === _chunk7AUQ2UJ3cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4139
+ if (k === "autoLeading" && value === _chunkLWHUU6A6cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4140
4140
  else o[k] = value;
4141
4141
  } else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
4142
4142
  }
@@ -4177,15 +4177,15 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
4177
4177
  opacity: 1,
4178
4178
  blend: "normal",
4179
4179
  text: text3,
4180
- runs: _chunk7AUQ2UJ3cjs.fitRuns.call(void 0, init.runs, text3.length, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE),
4181
- paragraphs: _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4180
+ runs: _chunkLWHUU6A6cjs.fitRuns.call(void 0, init.runs, text3.length, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE),
4181
+ paragraphs: _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4182
4182
  frame: init.frame,
4183
4183
  ...init.orientation === "vertical" ? { orientation: "vertical" } : {},
4184
4184
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
4185
4185
  offset: { x: 0, y: 0 }
4186
4186
  };
4187
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE)) }];
4188
- if (init.transform && !_chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4187
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE)) }];
4188
+ if (init.transform && !_chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4189
4189
  if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
4190
4190
  return rerenderText(layer, env);
4191
4191
  }
@@ -4196,24 +4196,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
4196
4196
  const next = { ...current, ...patch };
4197
4197
  if (!("annotation" in patch)) delete next.annotation;
4198
4198
  if (next.orientation !== "vertical") delete next.orientation;
4199
- if ("text" in patch || "runs" in patch) next.runs = _chunk7AUQ2UJ3cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE)));
4200
- if (!next.runs.length) next.runs = [{ length: 0, style: _chunk7AUQ2UJ3cjs.styleAt.call(void 0, current.runs, 0, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE) }];
4201
- if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4199
+ if ("text" in patch || "runs" in patch) next.runs = _chunkLWHUU6A6cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE)));
4200
+ if (!next.runs.length) next.runs = [{ length: 0, style: _chunkLWHUU6A6cjs.styleAt.call(void 0, current.runs, 0, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE) }];
4201
+ if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4202
4202
  const rendered = rerenderText(next, env);
4203
4203
  return { layers: _chunkPVJMTLPJcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4204
4204
  }
4205
4205
  function replaceTextRange(layer, start, end, insert) {
4206
4206
  const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
4207
- const style = _chunk7AUQ2UJ3cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE);
4208
- const runs = _chunk7AUQ2UJ3cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4209
- const pstyle = _chunk7AUQ2UJ3cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4210
- const paragraphs = _chunk7AUQ2UJ3cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4211
- return { text: text3, runs, paragraphs: _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4207
+ const style = _chunkLWHUU6A6cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE);
4208
+ const runs = _chunkLWHUU6A6cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4209
+ const pstyle = _chunkLWHUU6A6cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4210
+ const paragraphs = _chunkLWHUU6A6cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4211
+ return { text: text3, runs, paragraphs: _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4212
4212
  }
4213
4213
  function transformTypeLayer(layer, m) {
4214
- const t = _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4214
+ const t = _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4215
4215
  const next = { ...layer };
4216
- if (_chunk7AUQ2UJ3cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4216
+ if (_chunkLWHUU6A6cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4217
4217
  else next.transform = t;
4218
4218
  delete next.annotation;
4219
4219
  return next;
@@ -4221,7 +4221,7 @@ function transformTypeLayer(layer, m) {
4221
4221
  function typeFrame(layer, shaper) {
4222
4222
  if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
4223
4223
  if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
4224
- const b = _chunk7AUQ2UJ3cjs.layoutText.call(void 0, layer, shaper).bounds;
4224
+ const b = _chunkLWHUU6A6cjs.layoutText.call(void 0, layer, shaper).bounds;
4225
4225
  return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
4226
4226
  }
4227
4227
  function typeAsPixelLayer(layer) {
@@ -4229,7 +4229,7 @@ function typeAsPixelLayer(layer) {
4229
4229
  return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
4230
4230
  }
4231
4231
  function toTextSpace(layer, p) {
4232
- return _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, _chunk7AUQ2UJ3cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4232
+ return _chunkLWHUU6A6cjs.applyMatrix.call(void 0, _chunkLWHUU6A6cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4233
4233
  }
4234
4234
  function typeFromAnnotation(a) {
4235
4235
  if (a.type !== "text") return null;
@@ -4243,7 +4243,7 @@ function typeFromAnnotation(a) {
4243
4243
  if (op !== 1) style.opacity = op;
4244
4244
  const text3 = t.text.replace(/\r?\n|\r/g, " ");
4245
4245
  const translate = [1, 0, 0, 1, t.x, t.y];
4246
- const transform = t.rotation ? _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, translate, _chunk7AUQ2UJ3cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4246
+ const transform = t.rotation ? _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, translate, _chunkLWHUU6A6cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4247
4247
  return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
4248
4248
  }
4249
4249
  function annotationOfType(layer) {
@@ -4883,7 +4883,7 @@ function identityTransform(box2) {
4883
4883
  }
4884
4884
  function cornersFromMatrix(box2, m) {
4885
4885
  const q2 = _chunkQT26RHKKcjs.boxQuad.call(void 0, box2);
4886
- return [_chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[0]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[1]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[2]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[3])];
4886
+ return [_chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[0]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[1]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[2]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[3])];
4887
4887
  }
4888
4888
  function matrixFromCorners(box2, corners, eps = 1e-6) {
4889
4889
  const [tl, tr, br, bl] = corners;
@@ -4900,7 +4900,7 @@ function transformHomography(geometry) {
4900
4900
  function hasWarp(geometry) {
4901
4901
  const w = geometry.warp;
4902
4902
  if (!w) return false;
4903
- const id = _chunk7AUQ2UJ3cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4903
+ const id = _chunkLWHUU6A6cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4904
4904
  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;
4905
4905
  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);
4906
4906
  }
@@ -4915,7 +4915,7 @@ function transformMap(geometry) {
4915
4915
  const { box: box2 } = geometry;
4916
4916
  const warp = hasWarp(geometry) ? geometry.warp : null;
4917
4917
  if (!warp) return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p);
4918
- return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunk7AUQ2UJ3cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4918
+ return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkLWHUU6A6cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4919
4919
  }
4920
4920
  function transformedPoint(geometry, fx, fy) {
4921
4921
  const f = transformMap(geometry);
@@ -4959,8 +4959,8 @@ function matrixFromParams(box2, params) {
4959
4959
  const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
4960
4960
  const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
4961
4961
  const ref = referencePoint(box2, params.reference);
4962
- const linear = _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunk7AUQ2UJ3cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4963
- return _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, _chunk7AUQ2UJ3cjs.matrixAbout.call(void 0, linear, ref), _chunk7AUQ2UJ3cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4962
+ const linear = _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkLWHUU6A6cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4963
+ return _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, _chunkLWHUU6A6cjs.matrixAbout.call(void 0, linear, ref), _chunkLWHUU6A6cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4964
4964
  }
4965
4965
  function describeTransform(geometry, reference = "center") {
4966
4966
  const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
@@ -4977,7 +4977,7 @@ function describeTransform(geometry, reference = "center") {
4977
4977
  const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
4978
4978
  const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
4979
4979
  const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
4980
- const at = _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, ref);
4980
+ const at = _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, ref);
4981
4981
  const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
4982
4982
  return {
4983
4983
  affine: true,
@@ -4995,24 +4995,24 @@ function applyParams(geometry, params) {
4995
4995
  const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
4996
4996
  const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
4997
4997
  const c = geometry.corners;
4998
- return [_chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, c[0]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, c[1]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, c[2]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, c[3])];
4998
+ return [_chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, c[0]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, c[1]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, c[2]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, c[3])];
4999
4999
  }
5000
5000
  function flipCorners(geometry, axis) {
5001
5001
  const c = anchorPoint(geometry, "center");
5002
5002
  const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
5003
5003
  const q2 = geometry.corners;
5004
- return [_chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[0]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[1]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[2]), _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, m, q2[3])];
5004
+ return [_chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[0]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[1]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[2]), _chunkLWHUU6A6cjs.applyMatrix.call(void 0, m, q2[3])];
5005
5005
  }
5006
5006
  function boxPointOf(geometry, p) {
5007
5007
  const m = matrixFromCorners(geometry.box, geometry.corners);
5008
- if (m) return _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, _chunk7AUQ2UJ3cjs.invertMatrix.call(void 0, m), p);
5008
+ if (m) return _chunkLWHUU6A6cjs.applyMatrix.call(void 0, _chunkLWHUU6A6cjs.invertMatrix.call(void 0, m), p);
5009
5009
  return null;
5010
5010
  }
5011
5011
  function presetWarp(box2, preset) {
5012
- return _chunk7AUQ2UJ3cjs.warpPresetMesh.call(void 0, preset, box2);
5012
+ return _chunkLWHUU6A6cjs.warpPresetMesh.call(void 0, preset, box2);
5013
5013
  }
5014
5014
  function isValidWarp(mesh) {
5015
- return _chunk7AUQ2UJ3cjs.isValidWarpMesh.call(void 0, mesh);
5015
+ return _chunkLWHUU6A6cjs.isValidWarpMesh.call(void 0, mesh);
5016
5016
  }
5017
5017
  function geometryHomography(geometry) {
5018
5018
  const m = matrixFromCorners(geometry.box, geometry.corners);
@@ -5291,7 +5291,7 @@ function normalizePlacement(raw, contents) {
5291
5291
  }
5292
5292
  const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
5293
5293
  if (raw.warp) {
5294
- if (!_chunk7AUQ2UJ3cjs.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.");
5294
+ if (!_chunkLWHUU6A6cjs.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.");
5295
5295
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
5296
5296
  }
5297
5297
  if (raw.interpolation !== void 0) {
@@ -5395,7 +5395,7 @@ function translateLayer(layer, dx, dy) {
5395
5395
  case "shape": {
5396
5396
  const next = {
5397
5397
  ...layer,
5398
- components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunk7AUQ2UJ3cjs.translateMatrix.call(void 0, dx, dy)),
5398
+ components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkLWHUU6A6cjs.translateMatrix.call(void 0, dx, dy)),
5399
5399
  surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy),
5400
5400
  mask: moveMask(layer.mask)
5401
5401
  };
@@ -5404,7 +5404,7 @@ function translateLayer(layer, dx, dy) {
5404
5404
  return next;
5405
5405
  }
5406
5406
  case "type": {
5407
- const next = { ...transformTypeLayer(layer, _chunk7AUQ2UJ3cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5407
+ const next = { ...transformTypeLayer(layer, _chunkLWHUU6A6cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5408
5408
  if (!next.mask) delete next.mask;
5409
5409
  return next;
5410
5410
  }
@@ -5590,7 +5590,7 @@ function refitPlacement(layer, contents) {
5590
5590
  });
5591
5591
  const out = { corners: pts };
5592
5592
  if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
5593
- if (layer.placement.warp) out.warp = _chunk7AUQ2UJ3cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5593
+ if (layer.placement.warp) out.warp = _chunkLWHUU6A6cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5594
5594
  return out;
5595
5595
  }
5596
5596
  function normalizeSmartFilter(raw, id = newLayerId("flt")) {
@@ -5967,7 +5967,7 @@ function readType(r, base, ctx) {
5967
5967
  const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
5968
5968
  const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
5969
5969
  length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _166 => _166.length]), 0, 1e9, 0))),
5970
- style: patchTextStyle(_chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5970
+ style: patchTextStyle(_chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5971
5971
  }));
5972
5972
  const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
5973
5973
  length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _168 => _168.length]), 0, 1e9, 0))),
@@ -5980,13 +5980,13 @@ function readType(r, base, ctx) {
5980
5980
  ...base,
5981
5981
  type: "type",
5982
5982
  text: text3,
5983
- runs: _chunk7AUQ2UJ3cjs.fitRuns.call(void 0, runs, text3.length, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE),
5984
- paragraphs: _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5983
+ runs: _chunkLWHUU6A6cjs.fitRuns.call(void 0, runs, text3.length, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE),
5984
+ paragraphs: _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5985
5985
  frame,
5986
5986
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
5987
5987
  offset: { x: 0, y: 0 }
5988
5988
  };
5989
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE)) }];
5989
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE)) }];
5990
5990
  if (m) layer.transform = m;
5991
5991
  if (r.orientation === "vertical") layer.orientation = "vertical";
5992
5992
  if (r.antiAlias === false) layer.antiAlias = false;
@@ -6456,7 +6456,7 @@ function readSmartObject(r, base, ctx) {
6456
6456
  let placement;
6457
6457
  try {
6458
6458
  const raw = { corners: p.corners };
6459
- if (p.warp && _chunk7AUQ2UJ3cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6459
+ if (p.warp && _chunkLWHUU6A6cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6460
6460
  if (_chunkPVJMTLPJcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6461
6461
  placement = normalizePlacement(raw, contents);
6462
6462
  } catch (e) {
@@ -7627,7 +7627,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
7627
7627
  const fr = (p) => ({ x: p.x / w, y: p.y / h });
7628
7628
  const subpaths = [];
7629
7629
  components.forEach((c, ci) => {
7630
- _chunk7AUQ2UJ3cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7630
+ _chunkLWHUU6A6cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7631
7631
  if (!sp.anchors.length) return;
7632
7632
  subpaths.push({
7633
7633
  closed: sp.closed,
@@ -8453,7 +8453,7 @@ function merged(levels) {
8453
8453
  function charStyle(d, fonts, notes, vertical = false) {
8454
8454
  const n = (k) => eNum(eGet(d, k));
8455
8455
  const flag = (k) => eBool(eGet(d, k));
8456
- const s = { ..._chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE };
8456
+ const s = { ..._chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE };
8457
8457
  const fi = n("Font");
8458
8458
  const ps = fi !== void 0 ? fonts[fi] : void 0;
8459
8459
  if (ps) {
@@ -8538,7 +8538,7 @@ function typeFromTySh(data, notes) {
8538
8538
  }
8539
8539
  const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
8540
8540
  const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
8541
- let runs = [{ length: text3.length, style: { ..._chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE } }];
8541
+ let runs = [{ length: text3.length, style: { ..._chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE } }];
8542
8542
  let paragraphs = [{ length: text3.length, style: {} }];
8543
8543
  let frame = { kind: "point" };
8544
8544
  let transform = t.transform;
@@ -8594,14 +8594,14 @@ function typeFromTySh(data, notes) {
8594
8594
  const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
8595
8595
  if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
8596
8596
  frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
8597
- transform = _chunk7AUQ2UJ3cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8597
+ transform = _chunkLWHUU6A6cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8598
8598
  }
8599
8599
  }
8600
8600
  }
8601
8601
  return {
8602
8602
  text: text3,
8603
- runs: _chunk7AUQ2UJ3cjs.fitRuns.call(void 0, runs, text3.length, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE),
8604
- paragraphs: _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8603
+ runs: _chunkLWHUU6A6cjs.fitRuns.call(void 0, runs, text3.length, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE),
8604
+ paragraphs: _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8605
8605
  frame,
8606
8606
  orientation: vertical ? "vertical" : "horizontal",
8607
8607
  transform,
@@ -8677,7 +8677,7 @@ function buildEngineData(layer, template) {
8677
8677
  fonts.push(ps);
8678
8678
  return fonts.length - 1;
8679
8679
  };
8680
- const runs = _chunk7AUQ2UJ3cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE);
8680
+ const runs = _chunkLWHUU6A6cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE);
8681
8681
  const vertical = layer.orientation === "vertical";
8682
8682
  const sruns = [];
8683
8683
  const slens = [];
@@ -8686,10 +8686,10 @@ function buildEngineData(layer, template) {
8686
8686
  slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
8687
8687
  });
8688
8688
  if (!runs.length) {
8689
- sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE)))]])]]));
8689
+ sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE)))]])]]));
8690
8690
  slens.push(E.int(1));
8691
8691
  }
8692
- const paras = _chunk7AUQ2UJ3cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8692
+ const paras = _chunkLWHUU6A6cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8693
8693
  const pruns = [];
8694
8694
  const plens = [];
8695
8695
  paras.forEach((p, i) => {
@@ -8745,7 +8745,7 @@ function buildEngineData(layer, template) {
8745
8745
  eSet(e, key, rd);
8746
8746
  }
8747
8747
  eSet(rd, "FontSet", fontSet);
8748
- 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]), () => ( _chunk7AUQ2UJ3cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8748
+ 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]), () => ( _chunkLWHUU6A6cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8749
8749
  if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
8750
8750
  if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
8751
8751
  if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
@@ -8756,13 +8756,13 @@ function inkBounds2(layer) {
8756
8756
  if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
8757
8757
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
8758
8758
  if (!b) return [0, 0, 0, 0];
8759
- const inv = _chunk7AUQ2UJ3cjs.invertMatrix.call(void 0, textMatrix(layer));
8759
+ const inv = _chunkLWHUU6A6cjs.invertMatrix.call(void 0, textMatrix(layer));
8760
8760
  const pts = [
8761
8761
  { x: b.x, y: b.y },
8762
8762
  { x: b.x + b.width, y: b.y },
8763
8763
  { x: b.x + b.width, y: b.y + b.height },
8764
8764
  { x: b.x, y: b.y + b.height }
8765
- ].map((p) => _chunk7AUQ2UJ3cjs.applyMatrix.call(void 0, inv, p));
8765
+ ].map((p) => _chunkLWHUU6A6cjs.applyMatrix.call(void 0, inv, p));
8766
8766
  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))];
8767
8767
  }
8768
8768
  function tyShForLayer(layer) {
@@ -9043,7 +9043,7 @@ function filterMaskItem(placed, mask, area) {
9043
9043
  var warpStyleOf = (name) => {
9044
9044
  if (!name.startsWith("warp")) return null;
9045
9045
  const s = _optionalChain([name, 'access', _263 => _263[4], 'optionalAccess', _264 => _264.toLowerCase, 'call', _265 => _265()]) + name.slice(5);
9046
- return _chunk7AUQ2UJ3cjs.WARP_STYLES.includes(s) ? s : null;
9046
+ return _chunkLWHUU6A6cjs.WARP_STYLES.includes(s) ? s : null;
9047
9047
  };
9048
9048
  function warpFromDescriptor(w, contents) {
9049
9049
  const full = { x: 0, y: 0, width: contents.width, height: contents.height };
@@ -9073,7 +9073,7 @@ function warpFromDescriptor(w, contents) {
9073
9073
  } else {
9074
9074
  const style = warpStyleOf(styleName);
9075
9075
  if (!style) return void 0;
9076
- mesh = _chunk7AUQ2UJ3cjs.warpPresetMesh.call(void 0,
9076
+ mesh = _chunkLWHUU6A6cjs.warpPresetMesh.call(void 0,
9077
9077
  {
9078
9078
  style,
9079
9079
  bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
@@ -9088,7 +9088,7 @@ function warpFromDescriptor(w, contents) {
9088
9088
  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;
9089
9089
  if (!same) {
9090
9090
  const m = mesh;
9091
- mesh = _chunk7AUQ2UJ3cjs.fitWarpMesh.call(void 0, (s, t) => _chunk7AUQ2UJ3cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
9091
+ mesh = _chunkLWHUU6A6cjs.fitWarpMesh.call(void 0, (s, t) => _chunkLWHUU6A6cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
9092
9092
  }
9093
9093
  return { mesh, frame };
9094
9094
  }
@@ -10680,7 +10680,7 @@ function importSmart(ctx, rec, name, notes, props) {
10680
10680
  if (placement && (size.width !== contents.width || size.height !== contents.height)) {
10681
10681
  const kx = contents.width / size.width;
10682
10682
  const ky = contents.height / size.height;
10683
- if (placement.warp) placement = { ...placement, warp: _chunk7AUQ2UJ3cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10683
+ if (placement.warp) placement = { ...placement, warp: _chunkLWHUU6A6cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10684
10684
  }
10685
10685
  }
10686
10686
  if (!contents || !placement) {