@pixerate/editor 0.133.0 → 0.135.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 (77) hide show
  1. package/dist/animation-editor/index.cjs +55 -55
  2. package/dist/animation-editor/index.d.cts +4 -4
  3. package/dist/animation-editor/index.d.ts +4 -4
  4. package/dist/animation-editor/index.js +2 -2
  5. package/dist/{bezier-DL2wPsFf.d.cts → bezier-J8i4uqSH.d.cts} +1 -1
  6. package/dist/{bezier-BAGdL89w.d.ts → bezier-lNEOp0Jx.d.ts} +1 -1
  7. package/dist/canvas/index.d.cts +7 -7
  8. package/dist/canvas/index.d.ts +7 -7
  9. package/dist/{chunk-VGZSIXX3.js → chunk-7RJ6P7MI.js} +2 -2
  10. package/dist/{chunk-AOCFL7L7.js → chunk-ESIWZMMK.js} +2 -2
  11. package/dist/{chunk-FOBB6AIO.js → chunk-HHTCDFZC.js} +97 -5
  12. package/dist/chunk-HHTCDFZC.js.map +1 -0
  13. package/dist/{chunk-6CTZAGZ2.js → chunk-ILYFOJUN.js} +56 -1
  14. package/dist/chunk-ILYFOJUN.js.map +1 -0
  15. package/dist/{chunk-2QKUD3E2.cjs → chunk-T6TV6HY6.cjs} +36 -36
  16. package/dist/{chunk-2QKUD3E2.cjs.map → chunk-T6TV6HY6.cjs.map} +1 -1
  17. package/dist/{chunk-65GNHOD4.cjs → chunk-YAFS2QFZ.cjs} +82 -82
  18. package/dist/{chunk-65GNHOD4.cjs.map → chunk-YAFS2QFZ.cjs.map} +1 -1
  19. package/dist/{chunk-NVTHUPJ6.cjs → chunk-YT3JL7YM.cjs} +71 -16
  20. package/dist/chunk-YT3JL7YM.cjs.map +1 -0
  21. package/dist/{chunk-F7GGEAO2.cjs → chunk-Z2H7KECK.cjs} +151 -59
  22. package/dist/chunk-Z2H7KECK.cjs.map +1 -0
  23. package/dist/effects/index.d.cts +4 -4
  24. package/dist/effects/index.d.ts +4 -4
  25. package/dist/{export-BICOEM9d.d.cts → export-AZSwX087.d.cts} +13 -5
  26. package/dist/{export-XnuX8FZ2.d.ts → export-BDkyDNM8.d.ts} +13 -5
  27. package/dist/{export-zB4HITwP.d.ts → export-DMeG6E06.d.ts} +1 -1
  28. package/dist/{export-CeFplzAW.d.cts → export-KzubBKo7.d.cts} +1 -1
  29. package/dist/{helpers-cssRNUzH.d.ts → helpers-Coa4e2j_.d.ts} +12 -0
  30. package/dist/{helpers-BuKdqUlM.d.cts → helpers-DHl28yLO.d.cts} +12 -0
  31. package/dist/image-editor/index.cjs +739 -647
  32. package/dist/image-editor/index.cjs.map +1 -1
  33. package/dist/image-editor/index.d.cts +26 -11
  34. package/dist/image-editor/index.d.ts +26 -11
  35. package/dist/image-editor/index.js +104 -12
  36. package/dist/image-editor/index.js.map +1 -1
  37. package/dist/{opentype-C3iyIFRx.d.cts → opentype-BWR7Qv8W.d.cts} +1 -1
  38. package/dist/{opentype-DG5Lkwul.d.ts → opentype-Dfcx6wFx.d.ts} +1 -1
  39. package/dist/paint/index.cjs +10 -2
  40. package/dist/paint/index.cjs.map +1 -1
  41. package/dist/paint/index.d.cts +2 -2
  42. package/dist/paint/index.d.ts +2 -2
  43. package/dist/paint/index.js +9 -1
  44. package/dist/paint-editor/index.cjs +7 -7
  45. package/dist/paint-editor/index.d.cts +7 -7
  46. package/dist/paint-editor/index.d.ts +7 -7
  47. package/dist/paint-editor/index.js +2 -2
  48. package/dist/{pathfinder-DKLt4UDG.d.ts → pathfinder-Celbi3e6.d.ts} +1 -1
  49. package/dist/{pathfinder-8vXik95z.d.cts → pathfinder-D8KQ6blQ.d.cts} +1 -1
  50. package/dist/{pool-C69pkWRz.d.ts → pool-8JZGWHvR.d.ts} +1 -1
  51. package/dist/{pool-VAWcYUbs.d.cts → pool-BfuxBKTd.d.cts} +1 -1
  52. package/dist/{rand-BaqEOs1Y.d.ts → rand-BszBST4s.d.ts} +31 -1
  53. package/dist/{rand-DdpFzCo6.d.cts → rand-DOH_aMvm.d.cts} +31 -1
  54. package/dist/{svg-CEYpvsgH.d.ts → svg-CxxqG3_W.d.ts} +2 -2
  55. package/dist/{svg-BThlZmja.d.cts → svg-pwXWq6s2.d.cts} +2 -2
  56. package/dist/{tools-CRnZJXXr.d.cts → tools-3EBjR91b.d.cts} +1 -1
  57. package/dist/{tools-CVGqEpO8.d.ts → tools-y1M6O3UT.d.ts} +1 -1
  58. package/dist/vector/index.cjs +1292 -1035
  59. package/dist/vector/index.cjs.map +1 -1
  60. package/dist/vector/index.d.cts +183 -91
  61. package/dist/vector/index.d.ts +183 -91
  62. package/dist/vector/index.js +267 -10
  63. package/dist/vector/index.js.map +1 -1
  64. package/dist/video-editor/index.d.cts +4 -4
  65. package/dist/video-editor/index.d.ts +4 -4
  66. package/dist/{warp-mKylbLiF.d.ts → warp-C1gwu2G_.d.ts} +1 -1
  67. package/dist/{warp-ChcFDdlT.d.cts → warp-Ceqdz7kj.d.cts} +1 -1
  68. package/package.json +1 -1
  69. package/skills/pixerate-image-editor/SKILL.md +4 -4
  70. package/skills/pixerate-vector/SKILL.md +18 -54
  71. package/skills/pixerate-vector/references/pitfalls.md +62 -0
  72. package/dist/chunk-6CTZAGZ2.js.map +0 -1
  73. package/dist/chunk-F7GGEAO2.cjs.map +0 -1
  74. package/dist/chunk-FOBB6AIO.js.map +0 -1
  75. package/dist/chunk-NVTHUPJ6.cjs.map +0 -1
  76. /package/dist/{chunk-VGZSIXX3.js.map → chunk-7RJ6P7MI.js.map} +0 -0
  77. /package/dist/{chunk-AOCFL7L7.js.map → chunk-ESIWZMMK.js.map} +0 -0
@@ -363,7 +363,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
363
363
 
364
364
 
365
365
 
366
- var _chunk65GNHOD4cjs = require('../chunk-65GNHOD4.cjs');
366
+ var _chunkYAFS2QFZcjs = require('../chunk-YAFS2QFZ.cjs');
367
367
 
368
368
 
369
369
  var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
@@ -471,7 +471,11 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
471
471
 
472
472
 
473
473
 
474
- var _chunkNVTHUPJ6cjs = require('../chunk-NVTHUPJ6.cjs');
474
+
475
+
476
+
477
+
478
+ var _chunkYT3JL7YMcjs = require('../chunk-YT3JL7YM.cjs');
475
479
 
476
480
 
477
481
 
@@ -806,7 +810,7 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
806
810
 
807
811
 
808
812
 
809
- var _chunkF7GGEAO2cjs = require('../chunk-F7GGEAO2.cjs');
813
+ var _chunkZ2H7KECKcjs = require('../chunk-Z2H7KECK.cjs');
810
814
  require('../chunk-BJTCSLF6.cjs');
811
815
  require('../chunk-IZ4WRXZA.cjs');
812
816
 
@@ -924,7 +928,7 @@ function quickMaskPixels(mask, style = {}) {
924
928
 
925
929
  // src/image-editor/layers/render.ts
926
930
  function isQuarterTurn(rotate) {
927
- return _chunk65GNHOD4cjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
931
+ return _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
928
932
  }
929
933
  function isIntegerRect(r) {
930
934
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -932,7 +936,7 @@ function isIntegerRect(r) {
932
936
  function baseProjection(region, transform, baseW, baseH) {
933
937
  return {
934
938
  region,
935
- angle: _chunk65GNHOD4cjs.normalizeAngle.call(void 0, transform.rotate),
939
+ angle: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate),
936
940
  flipH: transform.flipH,
937
941
  flipV: transform.flipV,
938
942
  scale: 1,
@@ -941,14 +945,14 @@ function baseProjection(region, transform, baseW, baseH) {
941
945
  };
942
946
  }
943
947
  function projectQuarterTurn(src, srcRect, region, transform) {
944
- const rotated = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
948
+ const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
945
949
  const w = Math.max(1, Math.round(rotated.width));
946
950
  const h = Math.max(1, Math.round(rotated.height));
947
951
  const out = new Uint8ClampedArray(w * h * 4);
948
952
  const p = baseProjection(region, transform, w, h);
949
- const o = _chunk65GNHOD4cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
950
- const ox = _chunk65GNHOD4cjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
951
- const oy = _chunk65GNHOD4cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
953
+ const o = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
954
+ const ox = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
955
+ const oy = _chunkYAFS2QFZcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
952
956
  const ux = Math.round(ox.x - o.x);
953
957
  const vx = Math.round(ox.y - o.y);
954
958
  const uy = Math.round(oy.x - o.x);
@@ -977,23 +981,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
977
981
  const d = img.data;
978
982
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
979
983
  }
980
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunk65GNHOD4cjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
984
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkYAFS2QFZcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
981
985
  }
982
986
  function needsLegacyBase(input) {
983
987
  const { stack, region, canvas, transform } = input;
984
- if (!_chunk65GNHOD4cjs.isLegacyShape.call(void 0, stack)) return false;
988
+ if (!_chunkYAFS2QFZcjs.isLegacyShape.call(void 0, stack)) return false;
985
989
  const bg = stack.layers[0];
986
990
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
987
991
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
988
992
  if (stack.outputOpacity < 1) return true;
989
- const blur = _chunk65GNHOD4cjs.blurFilter.call(void 0, bg);
993
+ const blur = _chunkYAFS2QFZcjs.blurFilter.call(void 0, bg);
990
994
  if (blur && blur.enabled && blur.radius > 0) {
991
995
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
992
- const angle = _chunk65GNHOD4cjs.normalizeAngle.call(void 0, transform.rotate);
996
+ const angle = _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate);
993
997
  if (!full || angle === 90 || angle === 270) return true;
994
998
  }
995
999
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
996
- if (_chunk65GNHOD4cjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1000
+ if (_chunkYAFS2QFZcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
997
1001
  return false;
998
1002
  }
999
1003
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -1025,7 +1029,7 @@ function coveringRect(region) {
1025
1029
  const y = Math.floor(region.y);
1026
1030
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1027
1031
  }
1028
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)()) {
1032
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()) {
1029
1033
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1030
1034
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1031
1035
  }
@@ -1159,8 +1163,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1159
1163
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1160
1164
  * trust dirty rectangles; exports use `exportCompositor`.
1161
1165
  */
1162
- __init8() {this.compositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)()}
1163
- __init9() {this.exportCompositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1166
+ __init8() {this.compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()}
1167
+ __init9() {this.exportCompositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1164
1168
  /** How the host resolves layer pixels (set by the controller). */
1165
1169
 
1166
1170
  /**
@@ -1237,9 +1241,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1237
1241
  return;
1238
1242
  }
1239
1243
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1240
- const projection = _chunk65GNHOD4cjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1244
+ const projection = _chunkYAFS2QFZcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1241
1245
  const { region } = projection;
1242
- const rotated = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1246
+ const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1243
1247
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1244
1248
  let overlay = annotations;
1245
1249
  if (route === "legacy") {
@@ -1249,8 +1253,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1249
1253
  `${naturalWidth}x${naturalHeight}`,
1250
1254
  `${region.x},${region.y},${region.width},${region.height}`,
1251
1255
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1252
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1253
- _chunk65GNHOD4cjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1256
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1257
+ _chunkYAFS2QFZcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1254
1258
  `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1255
1259
  `d${this.displayKey}`
1256
1260
  ].join("|");
@@ -1284,7 +1288,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1284
1288
  }
1285
1289
  if (overlay.length > 0 || options.draftAnnotation) {
1286
1290
  ctx.save();
1287
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1291
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1288
1292
  ctx.beginPath();
1289
1293
  ctx.rect(region.x, region.y, region.width, region.height);
1290
1294
  ctx.clip();
@@ -1307,7 +1311,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1307
1311
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1308
1312
  ctx.save();
1309
1313
  try {
1310
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1314
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1311
1315
  ctx.beginPath();
1312
1316
  ctx.rect(region.x, region.y, region.width, region.height);
1313
1317
  ctx.clip();
@@ -1322,7 +1326,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1322
1326
  const b = options.brushCursor;
1323
1327
  ctx.save();
1324
1328
  try {
1325
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1329
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1326
1330
  const px2 = 1 / (projection.scale || 1);
1327
1331
  ctx.beginPath();
1328
1332
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1337,7 +1341,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1337
1341
  ctx.restore();
1338
1342
  }
1339
1343
  if (options.cloneSourceMarker) {
1340
- const m = _chunk65GNHOD4cjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1344
+ const m = _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1341
1345
  ctx.save();
1342
1346
  try {
1343
1347
  const r = 7;
@@ -1361,7 +1365,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1361
1365
  const t = options.textEdit;
1362
1366
  ctx.save();
1363
1367
  try {
1364
- const scr = (p) => _chunk65GNHOD4cjs.projectImagePoint.call(void 0, p, projection);
1368
+ const scr = (p) => _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, p, projection);
1365
1369
  const poly = (pts) => {
1366
1370
  ctx.beginPath();
1367
1371
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1400,7 +1404,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1400
1404
  const t = options.freeTransform;
1401
1405
  ctx.save();
1402
1406
  try {
1403
- const scr = (p) => _chunk65GNHOD4cjs.projectImagePoint.call(void 0, p, projection);
1407
+ const scr = (p) => _chunkYAFS2QFZcjs.projectImagePoint.call(void 0, p, projection);
1404
1408
  ctx.beginPath();
1405
1409
  if (t.warp) {
1406
1410
  for (const c of t.warp.curves) {
@@ -1458,7 +1462,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1458
1462
  }
1459
1463
  if (isActivelyCropping) {
1460
1464
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1461
- this.drawCropOverlay(ctx, _chunk65GNHOD4cjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1465
+ this.drawCropOverlay(ctx, _chunkYAFS2QFZcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1462
1466
  }
1463
1467
  }
1464
1468
  /**
@@ -1467,7 +1471,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1467
1471
  */
1468
1472
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1469
1473
  const { adjustments, depthMask } = state;
1470
- const rotated = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1474
+ const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1471
1475
  const baseW = Math.max(1, Math.round(rotated.width));
1472
1476
  const baseH = Math.max(1, Math.round(rotated.height));
1473
1477
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1475,7 +1479,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1475
1479
  if (!baseCtx) return baseCanvas;
1476
1480
  const projection = getBaseProjection(region, transform, baseW, baseH);
1477
1481
  baseCtx.save();
1478
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1482
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1479
1483
  baseCtx.drawImage(
1480
1484
  img,
1481
1485
  region.x,
@@ -1490,8 +1494,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1490
1494
  baseCtx.restore();
1491
1495
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1492
1496
  if (imageData) {
1493
- const layerMasks = _chunk65GNHOD4cjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1494
- _chunk65GNHOD4cjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1497
+ const layerMasks = _chunkYAFS2QFZcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1498
+ _chunkYAFS2QFZcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1495
1499
  if (depthMask.enabled && depthMask.maskSource) {
1496
1500
  try {
1497
1501
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1502,7 +1506,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1502
1506
  const maskCtx = maskCanvas.getContext("2d");
1503
1507
  if (maskCtx) {
1504
1508
  maskCtx.save();
1505
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1509
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1506
1510
  maskCtx.drawImage(
1507
1511
  maskImg,
1508
1512
  region.x * sx,
@@ -1517,7 +1521,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1517
1521
  maskCtx.restore();
1518
1522
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1519
1523
  if (maskData) {
1520
- _chunk65GNHOD4cjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1524
+ _chunkYAFS2QFZcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1521
1525
  }
1522
1526
  }
1523
1527
  } catch (e8) {
@@ -1536,7 +1540,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1536
1540
  else if (this.baseRoute === "layers") route = "layers";
1537
1541
  else {
1538
1542
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1539
- const shaped = this.baseRoute === "legacy" && _chunk65GNHOD4cjs.isLegacyShape.call(void 0, stack);
1543
+ const shaped = this.baseRoute === "legacy" && _chunkYAFS2QFZcjs.isLegacyShape.call(void 0, stack);
1540
1544
  route = shaped || needsLegacyBase({
1541
1545
  stack,
1542
1546
  region,
@@ -1671,17 +1675,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1671
1675
  if (!comp) return null;
1672
1676
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1673
1677
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1674
- const rotated = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1678
+ const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1675
1679
  const baseW = Math.max(1, Math.round(rotated.width));
1676
1680
  const baseH = Math.max(1, Math.round(rotated.height));
1677
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunk65GNHOD4cjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1681
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1678
1682
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1679
1683
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1680
1684
  const ctx = canvas.getContext("2d");
1681
1685
  if (!ctx) return null;
1682
1686
  ctx.clearRect(0, 0, baseW, baseH);
1683
1687
  ctx.save();
1684
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1688
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1685
1689
  ctx.beginPath();
1686
1690
  ctx.rect(region.x, region.y, region.width, region.height);
1687
1691
  ctx.clip();
@@ -1953,7 +1957,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1953
1957
  ctx.strokeStyle = "#3b82f6";
1954
1958
  ctx.lineWidth = 1.5;
1955
1959
  ctx.setLineDash([4, 4]);
1956
- const bounds = _chunk65GNHOD4cjs.getAnnotationBounds.call(void 0, ann);
1960
+ const bounds = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
1957
1961
  const pad = 4;
1958
1962
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1959
1963
  ctx.fillStyle = "#ffffff";
@@ -1974,7 +1978,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1974
1978
  }
1975
1979
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1976
1980
  getAnnotationBounds(ann) {
1977
- return _chunk65GNHOD4cjs.getAnnotationBounds.call(void 0, ann);
1981
+ return _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
1978
1982
  }
1979
1983
  /**
1980
1984
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2056,8 +2060,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2056
2060
  }
2057
2061
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2058
2062
  const { crop, transform, annotations } = state;
2059
- const region = crop ? _chunk65GNHOD4cjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2060
- const rotated = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2063
+ const region = crop ? _chunkYAFS2QFZcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2064
+ const rotated = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2061
2065
  const baseW = Math.max(1, Math.round(rotated.width));
2062
2066
  const baseH = Math.max(1, Math.round(rotated.height));
2063
2067
  const exportW = options.width || baseW;
@@ -2086,7 +2090,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2086
2090
  const bctx = baseCanvas.getContext("2d");
2087
2091
  if (bctx) {
2088
2092
  bctx.save();
2089
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2093
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2090
2094
  bctx.beginPath();
2091
2095
  bctx.rect(region.x, region.y, region.width, region.height);
2092
2096
  bctx.clip();
@@ -2099,7 +2103,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2099
2103
  if (options.includeAnnotations !== false && overlay.length > 0) {
2100
2104
  ctx.save();
2101
2105
  ctx.scale(exportW / baseW, exportH / baseH);
2102
- _chunk65GNHOD4cjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2106
+ _chunkYAFS2QFZcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2103
2107
  for (const ann of overlay) {
2104
2108
  await this.drawAnnotation(ctx, ann);
2105
2109
  }
@@ -2189,7 +2193,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2189
2193
  case "rect":
2190
2194
  case "image":
2191
2195
  case "text": {
2192
- const b = _chunk65GNHOD4cjs.getAnnotationBounds.call(void 0, ann);
2196
+ const b = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, ann);
2193
2197
  ctx.fillRect(b.x, b.y, b.width, b.height);
2194
2198
  break;
2195
2199
  }
@@ -2209,7 +2213,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2209
2213
  function getBaseProjection(region, transform, baseW, baseH) {
2210
2214
  return {
2211
2215
  region,
2212
- angle: _chunk65GNHOD4cjs.normalizeAngle.call(void 0, transform.rotate),
2216
+ angle: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, transform.rotate),
2213
2217
  flipH: transform.flipH,
2214
2218
  flipV: transform.flipV,
2215
2219
  scale: 1,
@@ -2313,8 +2317,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2313
2317
  }
2314
2318
  function toMask(width, height, coverage) {
2315
2319
  const out = new Uint8Array(coverage.length);
2316
- for (let i = 0; i < out.length; i++) out[i] = _chunk65GNHOD4cjs.coverageToByte.call(void 0, coverage[i]);
2317
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, width, height, out);
2320
+ for (let i = 0; i < out.length; i++) out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, coverage[i]);
2321
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, out);
2318
2322
  }
2319
2323
  function polygonSelection(width, height, points, options = {}) {
2320
2324
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2441,7 +2445,7 @@ function magicWand(pixels, seed, options = {}) {
2441
2445
  const { width: w, height: h } = pixels;
2442
2446
  const sx = Math.floor(seed.x);
2443
2447
  const sy = Math.floor(seed.y);
2444
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, w, h);
2448
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h);
2445
2449
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2446
2450
  const marks = new Uint8Array(n);
2447
2451
  let bx0 = w;
@@ -2489,9 +2493,9 @@ function magicWand(pixels, seed, options = {}) {
2489
2493
  }
2490
2494
  }
2491
2495
  }
2492
- if (bx1 < 0) return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, w, h);
2493
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, w, h, marks);
2494
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0,
2496
+ if (bx1 < 0) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h);
2497
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, marks);
2498
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0,
2495
2499
  w,
2496
2500
  h,
2497
2501
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2513,7 +2517,7 @@ function colorRange(pixels, samples, options = {}) {
2513
2517
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2514
2518
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2515
2519
  const out = new Uint8Array(n);
2516
- if (!parsed.length) return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, w, h, out);
2520
+ if (!parsed.length) return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, out);
2517
2521
  for (let i = 0; i < n; i++) {
2518
2522
  const p = i * 4;
2519
2523
  if (data[p + 3] <= 0) continue;
@@ -2529,9 +2533,9 @@ function colorRange(pixels, samples, options = {}) {
2529
2533
  }
2530
2534
  if (k > best) best = k;
2531
2535
  }
2532
- out[i] = _chunk65GNHOD4cjs.coverageToByte.call(void 0, best);
2536
+ out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, best);
2533
2537
  }
2534
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, w, h, out);
2538
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, w, h, out);
2535
2539
  }
2536
2540
  var TONE_RANGE_PRESETS = {
2537
2541
  shadows: [0, 65],
@@ -2549,9 +2553,9 @@ function toneRange(pixels, range, falloff = 20) {
2549
2553
  if (d[p + 3] <= 0) continue;
2550
2554
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2551
2555
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2552
- out[i] = _chunk65GNHOD4cjs.coverageToByte.call(void 0, 1 - outside / ramp);
2556
+ out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2553
2557
  }
2554
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2558
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2555
2559
  }
2556
2560
  function hueRange(pixels, center) {
2557
2561
  const n = checkPixels(pixels);
@@ -2574,9 +2578,9 @@ function hueRange(pixels, center) {
2574
2578
  hue *= 60;
2575
2579
  let dh = ((hue - center) % 360 + 360) % 360;
2576
2580
  dh = Math.min(dh, 360 - dh);
2577
- out[i] = _chunk65GNHOD4cjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2581
+ out[i] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2578
2582
  }
2579
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2583
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2580
2584
  }
2581
2585
 
2582
2586
  // src/image-editor/selection/refine.ts
@@ -2710,9 +2714,9 @@ function edgeWidth(guide, w, h, r) {
2710
2714
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2711
2715
  }
2712
2716
  }
2713
- const gm = _chunk65GNHOD4cjs.greyMorphology.call(void 0, g, w, h, r, true);
2714
- const hi = _chunk65GNHOD4cjs.greyMorphology.call(void 0, y, w, h, r, true);
2715
- const lo = _chunk65GNHOD4cjs.greyMorphology.call(void 0, y, w, h, r, false);
2717
+ const gm = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, g, w, h, r, true);
2718
+ const hi = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, y, w, h, r, true);
2719
+ const lo = _chunkYAFS2QFZcjs.greyMorphology.call(void 0, y, w, h, r, false);
2716
2720
  const out = new Float32Array(n);
2717
2721
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2718
2722
  return out;
@@ -2736,7 +2740,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2736
2740
  }
2737
2741
  }
2738
2742
  if (any) {
2739
- const dist = _chunk65GNHOD4cjs.distanceTransform.call(void 0, boundary, w, h);
2743
+ const dist = _chunkYAFS2QFZcjs.distanceTransform.call(void 0, boundary, w, h);
2740
2744
  const r = gfRadius(p);
2741
2745
  const q = guidedFilterColor(guide, m, w, h, r);
2742
2746
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2762,7 +2766,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2762
2766
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2763
2767
  }
2764
2768
  const amount = shiftAmount(p);
2765
- if (Math.abs(amount) >= 1e-4) a = _chunk65GNHOD4cjs.shiftCoverage.call(void 0, a, w, h, amount);
2769
+ if (Math.abs(amount) >= 1e-4) a = _chunkYAFS2QFZcjs.shiftCoverage.call(void 0, a, w, h, amount);
2766
2770
  return a;
2767
2771
  }
2768
2772
  function guidePlanes(pixels, win) {
@@ -2806,9 +2810,9 @@ function refineSelection(pixels, mask, params = {}) {
2806
2810
  const out = new Uint8Array(mask.width * mask.height);
2807
2811
  for (let y = 0; y < wh; y++) {
2808
2812
  const dst = (y0 + y) * mask.width + x0;
2809
- for (let x = 0; x < ww; x++) out[dst + x] = _chunk65GNHOD4cjs.coverageToByte.call(void 0, refined[y * ww + x]);
2813
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkYAFS2QFZcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2810
2814
  }
2811
- return _chunk65GNHOD4cjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2815
+ return _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2812
2816
  }
2813
2817
 
2814
2818
  // src/image-editor/effects.ts
@@ -2978,7 +2982,7 @@ var ImageEffectsEngine = (_class4 = class {
2978
2982
  // src/image-editor/free-transform.ts
2979
2983
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2980
2984
  var fail = (message) => {
2981
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(message);
2985
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(message);
2982
2986
  };
2983
2987
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2984
2988
  function previewStep(scale) {
@@ -3087,7 +3091,7 @@ var FreeTransformSession = (_class5 = class {
3087
3091
  } else {
3088
3092
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3089
3093
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3090
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, layers, id).layer;
3094
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, layers, id).layer;
3091
3095
  this.layerId = layer.id;
3092
3096
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3093
3097
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3098,20 +3102,20 @@ var FreeTransformSession = (_class5 = class {
3098
3102
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
3099
3103
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3100
3104
  if (content !== "selection-copy") {
3101
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3102
- if (!maskAlone) _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3105
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3106
+ if (!maskAlone) _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3103
3107
  }
3104
3108
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3105
3109
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3106
3110
  if (layer.type === "smart" && !maskAlone) {
3107
3111
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3108
- if (!_chunk65GNHOD4cjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3112
+ if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3109
3113
  this.smart = layer;
3110
3114
  this.smartObject = true;
3111
- this.startGeometry = _chunk65GNHOD4cjs.placementGeometry.call(void 0, layer);
3115
+ this.startGeometry = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
3112
3116
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3113
3117
  this.startInterp = this.interp;
3114
- this.box = _chunk65GNHOD4cjs.contentsBox.call(void 0, layer.contents);
3118
+ this.box = _chunkYAFS2QFZcjs.contentsBox.call(void 0, layer.contents);
3115
3119
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3116
3120
  this.geometryValue = this.startGeometry;
3117
3121
  this.shown = this.startLayers;
@@ -3119,8 +3123,8 @@ var FreeTransformSession = (_class5 = class {
3119
3123
  }
3120
3124
  if (layer.type === "type" && !maskAlone) {
3121
3125
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3122
- const frame = _chunk65GNHOD4cjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3123
- const m = _chunk65GNHOD4cjs.textMatrix.call(void 0, layer);
3126
+ const frame = _chunkYAFS2QFZcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3127
+ const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
3124
3128
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3125
3129
  this.typeTarget = layer;
3126
3130
  this.typeLayer = true;
@@ -3139,7 +3143,7 @@ var FreeTransformSession = (_class5 = class {
3139
3143
  }
3140
3144
  if (layer.type === "shape" && !maskAlone) {
3141
3145
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3142
- const g = _chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, layer);
3146
+ const g = _chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer);
3143
3147
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3144
3148
  const w = Math.max(g.width, 1);
3145
3149
  const h = Math.max(g.height, 1);
@@ -3187,7 +3191,7 @@ var FreeTransformSession = (_class5 = class {
3187
3191
  if (box) {
3188
3192
  const copy = {
3189
3193
  type: "pixel",
3190
- id: _chunk65GNHOD4cjs.newLayerId.call(void 0, ),
3194
+ id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
3191
3195
  name: `${layer.name || "Layer"} copy`,
3192
3196
  visible: true,
3193
3197
  opacity: 1,
@@ -3211,7 +3215,7 @@ var FreeTransformSession = (_class5 = class {
3211
3215
  if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
3212
3216
  this.box = box;
3213
3217
  this.moves = moves;
3214
- this.startGeometry = _chunk65GNHOD4cjs.identityTransform.call(void 0, box);
3218
+ this.startGeometry = _chunkYAFS2QFZcjs.identityTransform.call(void 0, box);
3215
3219
  this.startInterp = this.interp;
3216
3220
  this.geometryValue = this.startGeometry;
3217
3221
  this.shown = this.startLayers;
@@ -3289,8 +3293,8 @@ var FreeTransformSession = (_class5 = class {
3289
3293
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3290
3294
  };
3291
3295
  if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
3292
- if (!_chunk65GNHOD4cjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3293
- if (this.typeTarget && (_chunk65GNHOD4cjs.hasWarp.call(void 0, next) || !_chunk65GNHOD4cjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3296
+ if (!_chunkYAFS2QFZcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3297
+ if (this.typeTarget && (_chunkYAFS2QFZcjs.hasWarp.call(void 0, next) || !_chunkYAFS2QFZcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3294
3298
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
3295
3299
  }
3296
3300
  this.geometryValue = next;
@@ -3302,10 +3306,10 @@ var FreeTransformSession = (_class5 = class {
3302
3306
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3303
3307
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3304
3308
  const g = this.geometryValue;
3305
- const identity = _chunk65GNHOD4cjs.isIdentityTransform.call(void 0, g);
3306
- const warp = _chunk65GNHOD4cjs.hasWarp.call(void 0, g);
3307
- const h = warp ? null : _chunk65GNHOD4cjs.geometryHomography.call(void 0, g);
3308
- const f = warp ? _chunk65GNHOD4cjs.transformMap.call(void 0, g) : null;
3309
+ const identity = _chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, g);
3310
+ const warp = _chunkYAFS2QFZcjs.hasWarp.call(void 0, g);
3311
+ const h = warp ? null : _chunkYAFS2QFZcjs.geometryHomography.call(void 0, g);
3312
+ const f = warp ? _chunkYAFS2QFZcjs.transformMap.call(void 0, g) : null;
3309
3313
  const step = final ? 1 : previewStep(preview.scale);
3310
3314
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3311
3315
  let layers = this.startLayers;
@@ -3349,7 +3353,7 @@ var FreeTransformSession = (_class5 = class {
3349
3353
  if (part.what === "selection") {
3350
3354
  const { width, height } = this.host.canvas();
3351
3355
  const data = new Uint8Array(_chunkJ5BA3BQ6cjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3352
- const next = _chunk65GNHOD4cjs.createSelectionMask.call(void 0, width, height, data);
3356
+ const next = _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, data);
3353
3357
  selection = next.bounds ? next : null;
3354
3358
  } else if (part.what === "pixels") {
3355
3359
  layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3371,14 +3375,14 @@ var FreeTransformSession = (_class5 = class {
3371
3375
  resampleShape(final, preview, warpMap, h) {
3372
3376
  const layer = this.shape;
3373
3377
  let components = layer.components;
3374
- if (!_chunk65GNHOD4cjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3378
+ if (!_chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3375
3379
  const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
3376
3380
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
3377
- components = _chunk65GNHOD4cjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3381
+ components = _chunkYAFS2QFZcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3378
3382
  }
3379
3383
  const moved = { ...layer, components };
3380
3384
  delete moved.annotation;
3381
- const surface = _chunk65GNHOD4cjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3385
+ const surface = _chunkYAFS2QFZcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3382
3386
  return _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3383
3387
  }
3384
3388
  /**
@@ -3388,13 +3392,13 @@ var FreeTransformSession = (_class5 = class {
3388
3392
  resampleType() {
3389
3393
  const layer = this.typeTarget;
3390
3394
  const g = this.geometryValue;
3391
- if (_chunk65GNHOD4cjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3392
- const m = _chunk65GNHOD4cjs.matrixFromCorners.call(void 0, g.box, g.corners);
3395
+ if (_chunkYAFS2QFZcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3396
+ const m = _chunkYAFS2QFZcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3393
3397
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
3394
3398
  const next = { ...layer, transform: m };
3395
3399
  delete next.annotation;
3396
- let layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunk65GNHOD4cjs.rerenderText.call(void 0, next, this.host.textEnv()));
3397
- const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkF7GGEAO2cjs.invertMatrix.call(void 0, _chunk65GNHOD4cjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3400
+ let layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkYAFS2QFZcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3401
+ const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkZ2H7KECKcjs.invertMatrix.call(void 0, _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3398
3402
  for (const part of this.parts) {
3399
3403
  if (part.what !== "mask") continue;
3400
3404
  const surface = _chunk24ATT2PEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3410,12 +3414,12 @@ var FreeTransformSession = (_class5 = class {
3410
3414
  const canvas = this.host.canvas();
3411
3415
  try {
3412
3416
  if (final) {
3413
- const res = _chunk65GNHOD4cjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3417
+ const res = _chunkYAFS2QFZcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3414
3418
  this.smartMasksMoved = res.masksMoved;
3415
3419
  return res.layers;
3416
3420
  }
3417
3421
  const step = previewStep(preview.scale);
3418
- const surface = _chunk65GNHOD4cjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3422
+ const surface = _chunkYAFS2QFZcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3419
3423
  return _chunk24ATT2PEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3420
3424
  } catch (e) {
3421
3425
  if (e instanceof _chunk24ATT2PEcjs.TransformTooLargeError) fail(e.message);
@@ -3425,10 +3429,10 @@ var FreeTransformSession = (_class5 = class {
3425
3429
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3426
3430
  isChanged() {
3427
3431
  const g = this.geometryValue;
3428
- if (!this.smart && !this.typeTarget) return !_chunk65GNHOD4cjs.isIdentityTransform.call(void 0, g);
3432
+ if (!this.smart && !this.typeTarget) return !_chunkYAFS2QFZcjs.isIdentityTransform.call(void 0, g);
3429
3433
  const a = this.startGeometry;
3430
3434
  const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
3431
- const warp = (w, box) => w && _chunk65GNHOD4cjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3435
+ const warp = (w, box) => w && _chunkYAFS2QFZcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3432
3436
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3433
3437
  }
3434
3438
  render(preview) {
@@ -3688,7 +3692,7 @@ function convertSurfaceColors(surface, t) {
3688
3692
  }
3689
3693
 
3690
3694
  // src/image-editor/controller.ts
3691
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION;
3695
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION;
3692
3696
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
3693
3697
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3694
3698
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3744,7 +3748,7 @@ var PaintStrokeSession = (_class6 = class {
3744
3748
  this.stroke = null;
3745
3749
  this.retouch = stroke;
3746
3750
  if (this.base.channels === 1) {
3747
- const view = _chunkNVTHUPJ6cjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3751
+ const view = _chunkYT3JL7YMcjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3748
3752
  this.mixer = stroke.create(view.target);
3749
3753
  this.flushView = view.flush;
3750
3754
  } else this.mixer = stroke.create(this.mixerPixels());
@@ -3791,7 +3795,7 @@ var PaintStrokeSession = (_class6 = class {
3791
3795
  retouchDeepTile(key, tx, ty, paint, options) {
3792
3796
  const r = this.retouch;
3793
3797
  const read = this.readWork(key);
3794
- const out = _chunkNVTHUPJ6cjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3798
+ const out = _chunkYT3JL7YMcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3795
3799
  this.work.set(key, out);
3796
3800
  const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
3797
3801
  this.liveDeep.set(key, d);
@@ -3801,7 +3805,7 @@ var PaintStrokeSession = (_class6 = class {
3801
3805
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
3802
3806
  compositeTile(src, tx, ty, options = {}, paint) {
3803
3807
  const r = this.retouch;
3804
- if (r && r.kind === "coverage") return _chunkNVTHUPJ6cjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3808
+ if (r && r.kind === "coverage") return _chunkYT3JL7YMcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3805
3809
  return _chunk6GFRKLLScjs.applyStrokeToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, this.apply, options);
3806
3810
  }
3807
3811
  /** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
@@ -3882,7 +3886,7 @@ var PaintStrokeSession = (_class6 = class {
3882
3886
  for (const t of _chunkJ5BA3BQ6cjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3883
3887
  const key = _chunkJ5BA3BQ6cjs.tileKey.call(void 0, t.tx, t.ty);
3884
3888
  const cur = regions.get(key);
3885
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunk65GNHOD4cjs.unionRect.call(void 0, cur.r, r) : r });
3889
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkYAFS2QFZcjs.unionRect.call(void 0, cur.r, r) : r });
3886
3890
  }
3887
3891
  }
3888
3892
  for (const [key, { tx, ty, r }] of regions) {
@@ -3899,7 +3903,7 @@ var PaintStrokeSession = (_class6 = class {
3899
3903
  const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
3900
3904
  this.touched.add(key);
3901
3905
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
3902
- const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkNVTHUPJ6cjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunk6GFRKLLScjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3906
+ const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkYT3JL7YMcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunk6GFRKLLScjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3903
3907
  this.liveDeep.set(key, d);
3904
3908
  this.live.set(key, { data: _chunkJ5BA3BQ6cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
3905
3909
  continue;
@@ -3914,7 +3918,7 @@ var PaintStrokeSession = (_class6 = class {
3914
3918
  }
3915
3919
  /** Finishes the stroke (one undo step) and returns what changed. */
3916
3920
  end() {
3917
- if (this.closed) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("This stroke has already ended.");
3921
+ if (this.closed) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("This stroke has already ended.");
3918
3922
  const last = _nullishCoalesce(this.last, () => ( void 0));
3919
3923
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3920
3924
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -4050,20 +4054,20 @@ function sameTile(a, b) {
4050
4054
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4051
4055
  return true;
4052
4056
  }
4053
- var DEFAULT_ADJUSTMENTS = _chunk65GNHOD4cjs.DEFAULT_ADJUSTMENTS_VALUES;
4057
+ var DEFAULT_ADJUSTMENTS = _chunkYAFS2QFZcjs.DEFAULT_ADJUSTMENTS_VALUES;
4054
4058
  function normalizeStoredAdjustments(stored) {
4055
4059
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4056
4060
  const out = {
4057
4061
  ...DEFAULT_ADJUSTMENTS,
4058
4062
  ...stored,
4059
- process: _chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, stored.process)
4063
+ process: _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, stored.process)
4060
4064
  };
4061
- const layers = _chunk65GNHOD4cjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4065
+ const layers = _chunkYAFS2QFZcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4062
4066
  if (layers.length) out.layers = layers;
4063
4067
  else delete out.layers;
4064
4068
  return out;
4065
4069
  }
4066
- var isLayered = (data) => Boolean(data && data.version === _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4070
+ var isLayered = (data) => Boolean(data && data.version === _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4067
4071
  function migrateSerializedImageEditorState(data) {
4068
4072
  if (isLayered(data)) {
4069
4073
  const out = {
@@ -4095,10 +4099,10 @@ function migrateSerializedImageEditorState(data) {
4095
4099
  function migrateToLayeredState(data, size) {
4096
4100
  const clean = migrateSerializedImageEditorState(data);
4097
4101
  if (isLayered(clean)) return clean;
4098
- const stack = _chunk65GNHOD4cjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4099
- const { layers, assets } = _chunk65GNHOD4cjs.serializeLayers.call(void 0, stack.layers);
4102
+ const stack = _chunkYAFS2QFZcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4103
+ const { layers, assets } = _chunkYAFS2QFZcjs.serializeLayers.call(void 0, stack.layers);
4100
4104
  const out = {
4101
- version: _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION,
4105
+ version: _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION,
4102
4106
  width: Math.round(size.width),
4103
4107
  height: Math.round(size.height),
4104
4108
  layers,
@@ -4112,8 +4116,8 @@ function migrateToLayeredState(data, size) {
4112
4116
  if (clean.selection) out.selection = clean.selection;
4113
4117
  return out;
4114
4118
  }
4115
- var DEFAULT_TRANSFORM = _chunk65GNHOD4cjs.DEFAULT_TRANSFORM_VALUES;
4116
- var DEFAULT_DEPTH_MASK = _chunk65GNHOD4cjs.DEFAULT_DEPTH_MASK_VALUES;
4119
+ var DEFAULT_TRANSFORM = _chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES;
4120
+ var DEFAULT_DEPTH_MASK = _chunkYAFS2QFZcjs.DEFAULT_DEPTH_MASK_VALUES;
4117
4121
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4118
4122
  var ImageEditorController = (_class7 = class {
4119
4123
 
@@ -4136,7 +4140,7 @@ var ImageEditorController = (_class7 = class {
4136
4140
  __init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4137
4141
  __init63() {this.viewKey = []}
4138
4142
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4139
- __init64() {this.compositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)()}
4143
+ __init64() {this.compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)()}
4140
4144
  /** The effects provider slot (see `setEffectsProvider`). */
4141
4145
  __init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
4142
4146
  /** Renders provider effects: effect smart filter results and effect layers. */
@@ -4180,7 +4184,7 @@ var ImageEditorController = (_class7 = class {
4180
4184
  activeLayerId: null,
4181
4185
  activeTarget: "pixels",
4182
4186
  outputOpacity: 1,
4183
- paint: { brush: { ..._chunk6GFRKLLScjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunk6GFRKLLScjs.DEFAULT_MIXER }, mixerLoad: _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkNVTHUPJ6cjs.DEFAULT_RETOUCH }, cloneSource: null },
4187
+ paint: { brush: { ..._chunk6GFRKLLScjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunk6GFRKLLScjs.DEFAULT_MIXER }, mixerLoad: _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkYT3JL7YMcjs.DEFAULT_RETOUCH }, cloneSource: null, cloneTransform: { ..._chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM } },
4184
4188
  fit: _nullishCoalesce(options.fit, () => ( "margin"))
4185
4189
  };
4186
4190
  if (options.image instanceof Object && "width" in options.image) {
@@ -4194,7 +4198,7 @@ var ImageEditorController = (_class7 = class {
4194
4198
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4195
4199
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
4196
4200
  try {
4197
- this.state.selection = normalizeSelection(_chunk65GNHOD4cjs.deserializeSelection.call(void 0, options.initialState.selection));
4201
+ this.state.selection = normalizeSelection(_chunkYAFS2QFZcjs.deserializeSelection.call(void 0, options.initialState.selection));
4198
4202
  } catch (e15) {
4199
4203
  }
4200
4204
  }
@@ -4306,10 +4310,10 @@ var ImageEditorController = (_class7 = class {
4306
4310
  if (l.type === "group") {
4307
4311
  const children = walk(l.children);
4308
4312
  if (children !== l.children) next2 = { ...l, children };
4309
- } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunk65GNHOD4cjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4313
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkYAFS2QFZcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4310
4314
  try {
4311
- const r = _chunk65GNHOD4cjs.rerender.call(void 0, l, canvas);
4312
- if (all || !_chunk65GNHOD4cjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4315
+ const r = _chunkYAFS2QFZcjs.rerender.call(void 0, l, canvas);
4316
+ if (all || !_chunkYAFS2QFZcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4313
4317
  } catch (e17) {
4314
4318
  }
4315
4319
  }
@@ -4365,19 +4369,19 @@ var ImageEditorController = (_class7 = class {
4365
4369
  const d = await this.describeEffect(effect, "filter");
4366
4370
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4367
4371
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4368
- if (!found) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4372
+ if (!found) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4369
4373
  let layers = this.state.layers;
4370
4374
  let id = layerId;
4371
4375
  let converted = false;
4372
4376
  if (found.layer.type !== "smart") {
4373
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4374
- const res2 = _chunk65GNHOD4cjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4377
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4378
+ const res2 = _chunkYAFS2QFZcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4375
4379
  layers = res2.layers;
4376
4380
  id = res2.layer.id;
4377
4381
  converted = true;
4378
4382
  }
4379
- const filter = _chunk65GNHOD4cjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4380
- const res = _chunk65GNHOD4cjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4383
+ const filter = _chunkYAFS2QFZcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4384
+ const res = _chunkYAFS2QFZcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4381
4385
  this.commitLayers(res.layers);
4382
4386
  return { layerId: id, filter: res.filter, converted };
4383
4387
  }
@@ -4388,9 +4392,9 @@ var ImageEditorController = (_class7 = class {
4388
4392
  * false, during a drag).
4389
4393
  */
4390
4394
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
4391
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4395
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4392
4396
  const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
4393
- if (!was || was.kind !== "effect") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4397
+ if (!was || was.kind !== "effect") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4394
4398
  const update = {};
4395
4399
  if (changes.values) {
4396
4400
  const d = await this.describeEffect(was.effect);
@@ -4399,15 +4403,15 @@ var ImageEditorController = (_class7 = class {
4399
4403
  for (const [k, v] of Object.entries(changes.values)) {
4400
4404
  if (v !== null) given[k] = v;
4401
4405
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4402
- else throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4406
+ else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4403
4407
  }
4404
4408
  update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4405
4409
  }
4406
4410
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
4407
- let res = _chunk65GNHOD4cjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4408
- if (changes.index !== void 0) res = { ...res, layers: _chunk65GNHOD4cjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4411
+ let res = _chunkYAFS2QFZcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4412
+ if (changes.index !== void 0) res = { ...res, layers: _chunkYAFS2QFZcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4409
4413
  this.commitLayers(res.layers, void 0, commitToHistory);
4410
- return _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4414
+ return _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4411
4415
  }
4412
4416
  /**
4413
4417
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -4419,12 +4423,12 @@ var ImageEditorController = (_class7 = class {
4419
4423
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4420
4424
  const { width, height } = this.naturalSize;
4421
4425
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
4422
- const blend = _chunk65GNHOD4cjs.parseBlend.call(void 0, options.blend);
4423
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("opacity must be from 0 to 1.");
4426
+ const blend = _chunkYAFS2QFZcjs.parseBlend.call(void 0, options.blend);
4427
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
4424
4428
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4425
4429
  const layer = {
4426
4430
  type: "pixel",
4427
- id: options.id && !ids.has(options.id) ? options.id : _chunk65GNHOD4cjs.newLayerId.call(void 0, ),
4431
+ id: options.id && !ids.has(options.id) ? options.id : _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
4428
4432
  name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
4429
4433
  visible: true,
4430
4434
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
@@ -4433,7 +4437,7 @@ var ImageEditorController = (_class7 = class {
4433
4437
  offset: { x: 0, y: 0 },
4434
4438
  generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
4435
4439
  };
4436
- const next = _chunk65GNHOD4cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4440
+ const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4437
4441
  this.commitLayers(next, () => {
4438
4442
  this.state.activeLayerId = layer.id;
4439
4443
  this.state.activeTarget = "pixels";
@@ -4448,8 +4452,8 @@ var ImageEditorController = (_class7 = class {
4448
4452
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
4449
4453
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4450
4454
  const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
4451
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4452
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4455
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4456
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4453
4457
  const g = layer.generator;
4454
4458
  const d = await this.describeEffect(g.effect);
4455
4459
  const base = { ...g.values };
@@ -4457,7 +4461,7 @@ var ImageEditorController = (_class7 = class {
4457
4461
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
4458
4462
  if (v !== null) given[k] = v;
4459
4463
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4460
- else throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4464
+ else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4461
4465
  }
4462
4466
  const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4463
4467
  const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
@@ -4472,7 +4476,7 @@ var ImageEditorController = (_class7 = class {
4472
4476
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
4473
4477
  rasterizeEffectLayer(layerId) {
4474
4478
  const found = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, layerId);
4475
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4479
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4476
4480
  this.commitLayers(
4477
4481
  _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
4478
4482
  const { generator: _g, ...rest } = l;
@@ -4500,7 +4504,7 @@ var ImageEditorController = (_class7 = class {
4500
4504
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
4501
4505
  this.viewKey = key;
4502
4506
  const { width, height } = this.naturalSize;
4503
- const view = _chunk65GNHOD4cjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4507
+ const view = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4504
4508
  s.adjustments = view.adjustments;
4505
4509
  s.depthMask = view.depthMask;
4506
4510
  s.annotations = view.annotations;
@@ -4654,7 +4658,7 @@ var ImageEditorController = (_class7 = class {
4654
4658
  applyCropPreset(ratio) {
4655
4659
  this.recordHistory();
4656
4660
  const { width, height } = this.state.imageDimensions;
4657
- if (ratio && _chunk65GNHOD4cjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4661
+ if (ratio && _chunkYAFS2QFZcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4658
4662
  ratio = 1 / ratio;
4659
4663
  }
4660
4664
  if (!ratio) {
@@ -4736,7 +4740,7 @@ var ImageEditorController = (_class7 = class {
4736
4740
  */
4737
4741
  getLayerPixels(id) {
4738
4742
  const layer = this.getLayer(id);
4739
- if (!layer || !_chunk65GNHOD4cjs.hasSurface.call(void 0, layer)) return null;
4743
+ if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4740
4744
  const surface = this.surfaceOf(layer);
4741
4745
  const b = _chunkJ5BA3BQ6cjs.contentBounds.call(void 0, surface);
4742
4746
  if (!b) return null;
@@ -4749,7 +4753,7 @@ var ImageEditorController = (_class7 = class {
4749
4753
  */
4750
4754
  getLayerBounds(id) {
4751
4755
  const layer = this.getLayer(id);
4752
- if (!layer || !_chunk65GNHOD4cjs.hasSurface.call(void 0, layer)) return null;
4756
+ if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4753
4757
  const surface = this.surfaceOf(layer);
4754
4758
  let b = this.boundsCache.get(surface);
4755
4759
  if (b === void 0) {
@@ -4764,9 +4768,9 @@ var ImageEditorController = (_class7 = class {
4764
4768
  */
4765
4769
  getLayerDataURL(id) {
4766
4770
  const layer = this.getLayer(id);
4767
- if (!layer || !_chunk65GNHOD4cjs.hasSurface.call(void 0, layer)) return null;
4771
+ if (!layer || !_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return null;
4768
4772
  const surface = this.surfaceOf(layer);
4769
- const enc = _chunk65GNHOD4cjs.encodeSurface.call(void 0, surface);
4773
+ const enc = _chunkYAFS2QFZcjs.encodeSurface.call(void 0, surface);
4770
4774
  return enc ? enc.url : null;
4771
4775
  }
4772
4776
  /**
@@ -4908,19 +4912,19 @@ var ImageEditorController = (_class7 = class {
4908
4912
  if (init.pixels) {
4909
4913
  const px2 = init.pixels;
4910
4914
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4911
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4915
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4912
4916
  }
4913
4917
  surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, px2, 4);
4914
4918
  } else if (init.color !== void 0) {
4915
4919
  const c = parseColor(init.color);
4916
4920
  surface = _chunkJ5BA3BQ6cjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkJ5BA3BQ6cjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4917
4921
  }
4918
- const blend = _chunk65GNHOD4cjs.parseBlend.call(void 0, init.blend);
4919
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("opacity must be from 0 to 1.");
4922
+ const blend = _chunkYAFS2QFZcjs.parseBlend.call(void 0, init.blend);
4923
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
4920
4924
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4921
4925
  const layer = {
4922
4926
  type: "pixel",
4923
- id: init.id && !ids.has(init.id) ? init.id : _chunk65GNHOD4cjs.newLayerId.call(void 0, ),
4927
+ id: init.id && !ids.has(init.id) ? init.id : _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
4924
4928
  name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
4925
4929
  visible: _nullishCoalesce(init.visible, () => ( true)),
4926
4930
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4929,7 +4933,7 @@ var ImageEditorController = (_class7 = class {
4929
4933
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4930
4934
  };
4931
4935
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4932
- const next = _chunk65GNHOD4cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4936
+ const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4933
4937
  this.commitLayers(next, () => {
4934
4938
  this.state.activeLayerId = layer.id;
4935
4939
  this.state.activeTarget = "pixels";
@@ -4969,12 +4973,12 @@ var ImageEditorController = (_class7 = class {
4969
4973
  try {
4970
4974
  img = await this.renderer.imageCache.get(src);
4971
4975
  } catch (e22) {
4972
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4976
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4973
4977
  }
4974
4978
  const w = img.naturalWidth || img.width;
4975
4979
  const h = img.naturalHeight || img.height;
4976
4980
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4977
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4981
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4978
4982
  ctx.drawImage(img, 0, 0, w, h);
4979
4983
  const data = ctx.getImageData(0, 0, w, h);
4980
4984
  return { width: w, height: h, data: data.data };
@@ -4987,7 +4991,7 @@ var ImageEditorController = (_class7 = class {
4987
4991
  }
4988
4992
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
4989
4993
  duplicateLayer(id, name) {
4990
- const res = _chunk65GNHOD4cjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4994
+ const res = _chunkYAFS2QFZcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4991
4995
  this.commitLayers(res.layers, () => {
4992
4996
  this.state.activeLayerId = res.id;
4993
4997
  });
@@ -4995,16 +4999,16 @@ var ImageEditorController = (_class7 = class {
4995
4999
  }
4996
5000
  /** Deletes a layer (refused when locked), as one undo step. */
4997
5001
  removeLayer(id) {
4998
- const next = _chunk65GNHOD4cjs.removeLayer.call(void 0, this.state.layers, id);
5002
+ const next = _chunkYAFS2QFZcjs.removeLayer.call(void 0, this.state.layers, id);
4999
5003
  this.commitLayers(next, () => {
5000
- if (this.state.selectedAnnotationId && !_chunk24ATT2PEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunk65GNHOD4cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5004
+ if (this.state.selectedAnnotationId && !_chunk24ATT2PEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5001
5005
  this.state.selectedAnnotationId = null;
5002
5006
  }
5003
5007
  });
5004
5008
  }
5005
5009
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
5006
5010
  moveLayer(id, placement) {
5007
- const next = _chunk65GNHOD4cjs.moveLayer.call(void 0, this.state.layers, id, placement);
5011
+ const next = _chunkYAFS2QFZcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5008
5012
  const loc = _chunk24ATT2PEcjs.findLayer.call(void 0, next, id);
5009
5013
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
5010
5014
  this.commitLayers(next);
@@ -5015,23 +5019,23 @@ var ImageEditorController = (_class7 = class {
5015
5019
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
5016
5020
  */
5017
5021
  setLayerProperties(id, props, commitToHistory = true) {
5018
- const next = _chunk65GNHOD4cjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5022
+ const next = _chunkYAFS2QFZcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5019
5023
  this.commitLayers(next, void 0, commitToHistory);
5020
5024
  return _chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer;
5021
5025
  }
5022
5026
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
5023
5027
  addGroup(init = {}) {
5024
- const blend = init.blend === void 0 ? "pass-through" : _chunk65GNHOD4cjs.parseBlend.call(void 0, init.blend, true);
5028
+ const blend = init.blend === void 0 ? "pass-through" : _chunkYAFS2QFZcjs.parseBlend.call(void 0, init.blend, true);
5025
5029
  const group = {
5026
5030
  type: "group",
5027
- id: _chunk65GNHOD4cjs.newLayerId.call(void 0, "group"),
5031
+ id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, "group"),
5028
5032
  name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
5029
5033
  visible: true,
5030
5034
  opacity: 1,
5031
5035
  blend,
5032
5036
  children: []
5033
5037
  };
5034
- const next = _chunk65GNHOD4cjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5038
+ const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5035
5039
  this.commitLayers(next, () => {
5036
5040
  this.state.activeLayerId = group.id;
5037
5041
  this.state.activeTarget = "pixels";
@@ -5040,7 +5044,7 @@ var ImageEditorController = (_class7 = class {
5040
5044
  }
5041
5045
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
5042
5046
  groupLayers(ids, name) {
5043
- const res = _chunk65GNHOD4cjs.groupLayers.call(void 0, this.state.layers, ids, name);
5047
+ const res = _chunkYAFS2QFZcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5044
5048
  this.commitLayers(res.layers, () => {
5045
5049
  this.state.activeLayerId = res.id;
5046
5050
  });
@@ -5048,7 +5052,7 @@ var ImageEditorController = (_class7 = class {
5048
5052
  }
5049
5053
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
5050
5054
  ungroupLayer(id) {
5051
- const res = _chunk65GNHOD4cjs.ungroupLayer.call(void 0, this.state.layers, id);
5055
+ const res = _chunkYAFS2QFZcjs.ungroupLayer.call(void 0, this.state.layers, id);
5052
5056
  this.commitLayers(res.layers);
5053
5057
  return res.ids;
5054
5058
  }
@@ -5057,38 +5061,38 @@ var ImageEditorController = (_class7 = class {
5057
5061
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
5058
5062
  */
5059
5063
  offsetLayer(id, move, commitToHistory = true) {
5060
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5064
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5061
5065
  if (layer.type === "smart") {
5062
5066
  const tl = layer.placement.corners[0];
5063
5067
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
5064
5068
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
5065
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("x and y must be numbers.");
5066
- this.commitLayers(_chunk65GNHOD4cjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5069
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5070
+ this.commitLayers(_chunkYAFS2QFZcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5067
5071
  const moved = _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, id).layer;
5068
5072
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
5069
5073
  }
5070
5074
  if (layer.type === "shape") {
5071
- const g = _nullishCoalesce(_chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5075
+ const g = _nullishCoalesce(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5072
5076
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
5073
5077
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
5074
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("x and y must be numbers.");
5075
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5076
- let moved = _chunk65GNHOD4cjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5078
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5079
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5080
+ let moved = _chunkYAFS2QFZcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5077
5081
  const mask = layer.mask;
5078
5082
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
5079
5083
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
5080
- const b = _nullishCoalesce(_chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5084
+ const b = _nullishCoalesce(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5081
5085
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
5082
5086
  }
5083
5087
  if (layer.type === "type") {
5084
5088
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
5085
5089
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
5086
5090
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
5087
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("x and y must be numbers.");
5088
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5091
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers.");
5092
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5089
5093
  const mx = Math.round(dx);
5090
5094
  const my = Math.round(dy);
5091
- let moved = { ..._chunk65GNHOD4cjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
5095
+ let moved = { ..._chunkYAFS2QFZcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, layer.surface, mx, my) };
5092
5096
  const mask = layer.mask;
5093
5097
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, mx, my) } };
5094
5098
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -5098,7 +5102,7 @@ var ImageEditorController = (_class7 = class {
5098
5102
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5099
5103
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
5100
5104
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
5101
- const next = _chunk65GNHOD4cjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5105
+ const next = _chunkYAFS2QFZcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5102
5106
  this.commitLayers(next, void 0, commitToHistory);
5103
5107
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
5104
5108
  }
@@ -5108,11 +5112,11 @@ var ImageEditorController = (_class7 = class {
5108
5112
  * target when the layer is active.
5109
5113
  */
5110
5114
  addLayerMask(id, from = "reveal-all", props = {}) {
5111
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5115
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5112
5116
  let mask;
5113
5117
  if (from === "selection") {
5114
5118
  const sel = this.state.selection;
5115
- if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5119
+ if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5116
5120
  mask = this.maskFromSelection(sel, props);
5117
5121
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
5118
5122
  mask = { ...mask, surface: _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -5121,7 +5125,7 @@ var ImageEditorController = (_class7 = class {
5121
5125
  const v = from === "reveal-all" ? 255 : 0;
5122
5126
  mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5123
5127
  }
5124
- const next = _chunk65GNHOD4cjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5128
+ const next = _chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5125
5129
  this.commitLayers(next, () => {
5126
5130
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
5127
5131
  });
@@ -5129,18 +5133,18 @@ var ImageEditorController = (_class7 = class {
5129
5133
  }
5130
5134
  /** Removes a layer's mask (one undo step). */
5131
5135
  removeLayerMask(id) {
5132
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5133
- if (!layer.mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5134
- this.commitLayers(_chunk65GNHOD4cjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5136
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5137
+ if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5138
+ this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5135
5139
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
5136
5140
  });
5137
5141
  }
5138
5142
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
5139
5143
  setLayerMaskProps(id, props, commitToHistory = true) {
5140
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5141
- if (!layer.mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5144
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5145
+ if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5142
5146
  const mask = withMaskProps(layer.mask, props);
5143
- this.commitLayers(_chunk65GNHOD4cjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5147
+ this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5144
5148
  return mask;
5145
5149
  }
5146
5150
  /**
@@ -5148,11 +5152,11 @@ var ImageEditorController = (_class7 = class {
5148
5152
  * the depth map) and removes the mask, as one undo step.
5149
5153
  */
5150
5154
  async applyLayerMask(id) {
5151
- const loc = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id);
5155
+ const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5152
5156
  const layer = loc.layer;
5153
- if (layer.type !== "pixel") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5154
- if (!layer.mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5155
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5157
+ if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5158
+ if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5159
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5156
5160
  const { width, height } = this.naturalSize;
5157
5161
  await this.renderer.prepareLayerAssets([layer], width, height);
5158
5162
  const sources = this.renderer.compositorSources(width, height);
@@ -5185,13 +5189,13 @@ var ImageEditorController = (_class7 = class {
5185
5189
  */
5186
5190
  layerViaCopy(options = {}) {
5187
5191
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
5188
- if (!id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5189
- const loc = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id);
5192
+ if (!id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5193
+ const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5190
5194
  const layer = loc.layer;
5191
- if (layer.type !== "pixel") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5195
+ if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5192
5196
  const sel = this.state.selection;
5193
- if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5194
- if (options.cut) _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5197
+ if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5198
+ if (options.cut) _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5195
5199
  const surface = this.surfaceOf(layer);
5196
5200
  const sb = sel.bounds;
5197
5201
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -5207,7 +5211,7 @@ var ImageEditorController = (_class7 = class {
5207
5211
  }
5208
5212
  const copy = {
5209
5213
  type: "pixel",
5210
- id: _chunk65GNHOD4cjs.newLayerId.call(void 0, ),
5214
+ id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
5211
5215
  name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
5212
5216
  visible: true,
5213
5217
  opacity: 1,
@@ -5280,7 +5284,7 @@ var ImageEditorController = (_class7 = class {
5280
5284
  * Refused while another transform is open.
5281
5285
  */
5282
5286
  beginFreeTransform(init = {}) {
5283
- if (this.getFreeTransform()) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5287
+ if (this.getFreeTransform()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5284
5288
  const session = new FreeTransformSession(this.transformHost(), init);
5285
5289
  this.openTransform = session;
5286
5290
  this.notify();
@@ -5294,26 +5298,26 @@ var ImageEditorController = (_class7 = class {
5294
5298
  */
5295
5299
  transformLayer(spec) {
5296
5300
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
5297
- if (given > 1) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give only one of matrix, corners and params.");
5298
- if (!given && spec.warp === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5301
+ if (given > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5302
+ if (!given && spec.warp === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5299
5303
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
5300
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5304
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5301
5305
  }
5302
5306
  if (spec.matrix) {
5303
5307
  const [a, b, c, d] = spec.matrix;
5304
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5308
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5305
5309
  }
5306
5310
  const session = this.beginFreeTransform(spec);
5307
5311
  try {
5308
5312
  const g = session.startGeometry;
5309
- const corners = spec.matrix ? g.corners.map((p) => _chunkF7GGEAO2cjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunk65GNHOD4cjs.applyParams.call(void 0, g, spec.params) : g.corners;
5313
+ const corners = spec.matrix ? g.corners.map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkYAFS2QFZcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5310
5314
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
5311
5315
  if (spec.warp) {
5312
5316
  if ("style" in spec.warp) {
5313
- if (!_chunkF7GGEAO2cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkF7GGEAO2cjs.WARP_STYLES.join(", ")}.`);
5314
- warp = _chunk65GNHOD4cjs.presetWarp.call(void 0, session.box, spec.warp);
5317
+ if (!_chunkZ2H7KECKcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
5318
+ warp = _chunkYAFS2QFZcjs.presetWarp.call(void 0, session.box, spec.warp);
5315
5319
  } else {
5316
- if (!_chunk65GNHOD4cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5320
+ if (!_chunkYAFS2QFZcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5317
5321
  warp = spec.warp;
5318
5322
  }
5319
5323
  }
@@ -5326,10 +5330,10 @@ var ImageEditorController = (_class7 = class {
5326
5330
  }
5327
5331
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
5328
5332
  flipLayer(axis, init = {}) {
5329
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5333
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5330
5334
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5331
5335
  try {
5332
- session.update({ corners: _chunk65GNHOD4cjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5336
+ session.update({ corners: _chunkYAFS2QFZcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5333
5337
  return session.commit();
5334
5338
  } catch (e) {
5335
5339
  session.cancel();
@@ -5341,16 +5345,16 @@ var ImageEditorController = (_class7 = class {
5341
5345
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
5342
5346
  */
5343
5347
  rotateLayer90(turn, init = {}) {
5344
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5348
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5345
5349
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5346
5350
  try {
5347
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunk65GNHOD4cjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5351
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkYAFS2QFZcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5348
5352
  const cx = b.x + b.width / 2;
5349
5353
  const cy = b.y + b.height / 2;
5350
5354
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
5351
5355
  const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
5352
5356
  const m = turn === 90 ? [0, 1, -1, 0, cx + cy + ox, cy - cx + oy] : turn === -90 ? [0, -1, 1, 0, cx - cy + ox, cy + cx + oy] : [-1, 0, 0, -1, 2 * cx, 2 * cy];
5353
- session.update({ corners: session.startGeometry.corners.map((p) => _chunkF7GGEAO2cjs.applyMatrix.call(void 0, m, p)) }, false);
5357
+ session.update({ corners: session.startGeometry.corners.map((p) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, p)) }, false);
5354
5358
  return session.commit();
5355
5359
  } catch (e) {
5356
5360
  session.cancel();
@@ -5359,20 +5363,20 @@ var ImageEditorController = (_class7 = class {
5359
5363
  }
5360
5364
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
5361
5365
  addLayerFilter(id, filter) {
5362
- const f = _chunk65GNHOD4cjs.normalizeFilter.call(void 0, filter);
5363
- const next = _chunk65GNHOD4cjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5366
+ const f = _chunkYAFS2QFZcjs.normalizeFilter.call(void 0, filter);
5367
+ const next = _chunkYAFS2QFZcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5364
5368
  this.commitLayers(next);
5365
5369
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5366
5370
  }
5367
5371
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
5368
5372
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
5369
- const next = _chunk65GNHOD4cjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5373
+ const next = _chunkYAFS2QFZcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5370
5374
  this.commitLayers(next, void 0, commitToHistory);
5371
5375
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5372
5376
  }
5373
5377
  /** Removes one filter (one undo step). Returns the remaining filters. */
5374
5378
  removeLayerFilter(id, filterId) {
5375
- const next = _chunk65GNHOD4cjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5379
+ const next = _chunkYAFS2QFZcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5376
5380
  this.commitLayers(next);
5377
5381
  return _nullishCoalesce(_chunk24ATT2PEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5378
5382
  }
@@ -5388,8 +5392,8 @@ var ImageEditorController = (_class7 = class {
5388
5392
  */
5389
5393
  convertToSmartObject(ids, options = {}) {
5390
5394
  const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
5391
- if (!list.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5392
- const res = _chunk65GNHOD4cjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5395
+ if (!list.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5396
+ const res = _chunkYAFS2QFZcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5393
5397
  this.commitLayers(res.layers, () => {
5394
5398
  this.state.activeLayerId = res.layer.id;
5395
5399
  this.state.activeTarget = "pixels";
@@ -5398,7 +5402,7 @@ var ImageEditorController = (_class7 = class {
5398
5402
  }
5399
5403
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
5400
5404
  rasterizeSmartObject(id) {
5401
- const res = _chunk65GNHOD4cjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5405
+ const res = _chunkYAFS2QFZcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5402
5406
  this.commitLayers(res.layers, () => {
5403
5407
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
5404
5408
  });
@@ -5406,10 +5410,10 @@ var ImageEditorController = (_class7 = class {
5406
5410
  }
5407
5411
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
5408
5412
  getSmartObject(id) {
5409
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5413
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5410
5414
  const c = layer.contents;
5411
- const g = _chunk65GNHOD4cjs.placementGeometry.call(void 0, layer);
5412
- const readout = _chunk65GNHOD4cjs.describeTransform.call(void 0, g);
5415
+ const g = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
5416
+ const readout = _chunkYAFS2QFZcjs.describeTransform.call(void 0, g);
5413
5417
  const stack = layer.smartFilters;
5414
5418
  return {
5415
5419
  layerId: layer.id,
@@ -5419,10 +5423,10 @@ var ImageEditorController = (_class7 = class {
5419
5423
  kind: c.kind,
5420
5424
  width: c.width,
5421
5425
  height: c.height,
5422
- decoded: _chunk65GNHOD4cjs.isContentsDecoded.call(void 0, c),
5426
+ decoded: _chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c),
5423
5427
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
5424
5428
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
5425
- instances: _chunk65GNHOD4cjs.instancesOf.call(void 0, this.state.layers, c.id),
5429
+ instances: _chunkYAFS2QFZcjs.instancesOf.call(void 0, this.state.layers, c.id),
5426
5430
  layerCount: c.document ? _chunk24ATT2PEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
5427
5431
  },
5428
5432
  placement: {
@@ -5434,8 +5438,8 @@ var ImageEditorController = (_class7 = class {
5434
5438
  scaleY: readout.scaleY,
5435
5439
  rotate: readout.rotate,
5436
5440
  skewX: readout.skewX,
5437
- center: _chunk65GNHOD4cjs.anchorPoint.call(void 0, g, "center"),
5438
- bounds: _chunk65GNHOD4cjs.transformedBox.call(void 0, g)
5441
+ center: _chunkYAFS2QFZcjs.anchorPoint.call(void 0, g, "center"),
5442
+ bounds: _chunkYAFS2QFZcjs.transformedBox.call(void 0, g)
5439
5443
  },
5440
5444
  smartFilters: {
5441
5445
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
@@ -5452,7 +5456,7 @@ var ImageEditorController = (_class7 = class {
5452
5456
  * change. Returns the new placement summary.
5453
5457
  */
5454
5458
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
5455
- const res = _chunk65GNHOD4cjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5459
+ const res = _chunkYAFS2QFZcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5456
5460
  this.commitLayers(res.layers, void 0, commitToHistory);
5457
5461
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
5458
5462
  }
@@ -5465,23 +5469,23 @@ var ImageEditorController = (_class7 = class {
5465
5469
  * nothing is relative to the current transform.
5466
5470
  */
5467
5471
  setSmartObjectTransform(id, spec) {
5468
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5469
- const g = _chunk65GNHOD4cjs.placementGeometry.call(void 0, layer);
5472
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5473
+ const g = _chunkYAFS2QFZcjs.placementGeometry.call(void 0, layer);
5470
5474
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
5471
5475
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
5472
- if (ways > 1) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5476
+ if (ways > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5473
5477
  let corners = g.corners;
5474
5478
  if (spec.corners) corners = spec.corners;
5475
5479
  else if (spec.matrix) {
5476
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5480
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5477
5481
  const [a, b, c, d] = spec.matrix;
5478
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5479
- corners = _chunk65GNHOD4cjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5482
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5483
+ corners = _chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5480
5484
  } else if (numeric.length) {
5481
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5482
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`${k} must be a finite number.`);
5483
- const now = _chunk65GNHOD4cjs.describeTransform.call(void 0, g);
5484
- const centre = _chunk65GNHOD4cjs.anchorPoint.call(void 0, g, "center");
5485
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5486
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${k} must be a finite number.`);
5487
+ const now = _chunkYAFS2QFZcjs.describeTransform.call(void 0, g);
5488
+ const centre = _chunkYAFS2QFZcjs.anchorPoint.call(void 0, g, "center");
5485
5489
  const params = {
5486
5490
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
5487
5491
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -5489,20 +5493,20 @@ var ImageEditorController = (_class7 = class {
5489
5493
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
5490
5494
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
5491
5495
  };
5492
- const m = _chunk65GNHOD4cjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5496
+ const m = _chunkYAFS2QFZcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5493
5497
  const cx = g.box.width / 2;
5494
5498
  const cy = g.box.height / 2;
5495
5499
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
5496
- corners = _chunk65GNHOD4cjs.cornersFromMatrix.call(void 0, g.box, _chunkF7GGEAO2cjs.multiplyMatrices.call(void 0, m, _chunkF7GGEAO2cjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5500
+ corners = _chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, g.box, _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, m, _chunkZ2H7KECKcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5497
5501
  }
5498
5502
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
5499
5503
  if (spec.warp === null) warp = null;
5500
5504
  else if (spec.warp) {
5501
5505
  if ("style" in spec.warp) {
5502
- if (!_chunkF7GGEAO2cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkF7GGEAO2cjs.WARP_STYLES.join(", ")}.`);
5503
- warp = _chunk65GNHOD4cjs.presetWarp.call(void 0, g.box, spec.warp);
5506
+ if (!_chunkZ2H7KECKcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
5507
+ warp = _chunkYAFS2QFZcjs.presetWarp.call(void 0, g.box, spec.warp);
5504
5508
  } else {
5505
- if (!_chunk65GNHOD4cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5509
+ if (!_chunkYAFS2QFZcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5506
5510
  warp = spec.warp;
5507
5511
  }
5508
5512
  }
@@ -5516,16 +5520,16 @@ var ImageEditorController = (_class7 = class {
5516
5520
  * the layers that changed.
5517
5521
  */
5518
5522
  replaceSmartObjectContents(id, source) {
5519
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5523
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5520
5524
  let contents;
5521
5525
  if ("contents" in source) contents = source.contents;
5522
- else if ("pixels" in source) contents = _chunk65GNHOD4cjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5526
+ else if ("pixels" in source) contents = _chunkYAFS2QFZcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5523
5527
  else {
5524
- const psd = _chunk65GNHOD4cjs.importPsd.call(void 0, source.psd, { newId: () => _chunk65GNHOD4cjs.newLayerId.call(void 0, ) });
5525
- contents = _chunk65GNHOD4cjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5528
+ const psd = _chunkYAFS2QFZcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkYAFS2QFZcjs.newLayerId.call(void 0, ) });
5529
+ contents = _chunkYAFS2QFZcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5526
5530
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
5527
5531
  }
5528
- const res = _chunk65GNHOD4cjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5532
+ const res = _chunkYAFS2QFZcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5529
5533
  this.commitLayers(res.layers);
5530
5534
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5531
5535
  }
@@ -5540,16 +5544,16 @@ var ImageEditorController = (_class7 = class {
5540
5544
  * and bytes.
5541
5545
  */
5542
5546
  exportSmartObjectContents(id) {
5543
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5547
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5544
5548
  const c = layer.contents;
5545
5549
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5546
5550
  if (c.file) {
5547
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunk65GNHOD4cjs.BROWSER_IMAGE_TYPES };
5551
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES };
5548
5552
  const ext = c.file.type.toLowerCase();
5549
5553
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5550
5554
  }
5551
- if (!_chunk65GNHOD4cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5552
- const f = _chunk65GNHOD4cjs.smartContentsFile.call(void 0, c);
5555
+ if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5556
+ const f = _chunkYAFS2QFZcjs.smartContentsFile.call(void 0, c);
5553
5557
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5554
5558
  }
5555
5559
  /**
@@ -5558,7 +5562,7 @@ var ImageEditorController = (_class7 = class {
5558
5562
  * undo step. Returns the copy's id.
5559
5563
  */
5560
5564
  copySmartObject(id, linked = false, name) {
5561
- const res = _chunk65GNHOD4cjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5565
+ const res = _chunkYAFS2QFZcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5562
5566
  this.commitLayers(res.layers, () => {
5563
5567
  this.state.activeLayerId = res.layer.id;
5564
5568
  this.state.activeTarget = "pixels";
@@ -5567,31 +5571,31 @@ var ImageEditorController = (_class7 = class {
5567
5571
  }
5568
5572
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5569
5573
  addSmartFilter(id, filter, index) {
5570
- const res = _chunk65GNHOD4cjs.addSmartFilter.call(void 0, this.state.layers, id, _chunk65GNHOD4cjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5574
+ const res = _chunkYAFS2QFZcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkYAFS2QFZcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5571
5575
  this.commitLayers(res.layers);
5572
5576
  return res.filter;
5573
5577
  }
5574
5578
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5575
5579
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5576
- const res = _chunk65GNHOD4cjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5580
+ const res = _chunkYAFS2QFZcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5577
5581
  this.commitLayers(res.layers, void 0, commitToHistory);
5578
5582
  return res.filter;
5579
5583
  }
5580
5584
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5581
5585
  removeSmartFilter(id, filterId) {
5582
- const res = _chunk65GNHOD4cjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5586
+ const res = _chunkYAFS2QFZcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5583
5587
  this.commitLayers(res.layers);
5584
5588
  return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
5585
5589
  }
5586
5590
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5587
5591
  moveSmartFilter(id, filterId, index) {
5588
- const res = _chunk65GNHOD4cjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5592
+ const res = _chunkYAFS2QFZcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5589
5593
  this.commitLayers(res.layers);
5590
5594
  return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
5591
5595
  }
5592
5596
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5593
5597
  setSmartFiltersEnabled(id, enabled) {
5594
- const res = _chunk65GNHOD4cjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5598
+ const res = _chunkYAFS2QFZcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5595
5599
  this.commitLayers(res.layers);
5596
5600
  return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
5597
5601
  }
@@ -5601,21 +5605,21 @@ var ImageEditorController = (_class7 = class {
5601
5605
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5602
5606
  */
5603
5607
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5604
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5608
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5605
5609
  let mask;
5606
5610
  if (from === "none") mask = null;
5607
5611
  else if (from === "keep") {
5608
- if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5612
+ if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5609
5613
  mask = withMaskProps(layer.smartFilters.mask, props);
5610
5614
  } else if (from === "selection") {
5611
5615
  const sel = this.state.selection;
5612
- if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5616
+ if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5613
5617
  mask = this.maskFromSelection(sel, props);
5614
5618
  } else {
5615
5619
  const v = from === "reveal-all" ? 255 : 0;
5616
5620
  mask = withMaskProps({ surface: _chunkJ5BA3BQ6cjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5617
5621
  }
5618
- const res = _chunk65GNHOD4cjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5622
+ const res = _chunkYAFS2QFZcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5619
5623
  this.commitLayers(res.layers, () => {
5620
5624
  if (this.state.activeLayerId !== id) return;
5621
5625
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5631,14 +5635,14 @@ var ImageEditorController = (_class7 = class {
5631
5635
  async prepareSmartObjects() {
5632
5636
  const pending = /* @__PURE__ */ new Map();
5633
5637
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers)) {
5634
- if (l.type === "smart" && !_chunk65GNHOD4cjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunk65GNHOD4cjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5638
+ if (l.type === "smart" && !_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5635
5639
  }
5636
5640
  const left = [];
5637
5641
  for (const [cid, c] of pending) {
5638
5642
  try {
5639
- const url = `data:${_chunk65GNHOD4cjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5643
+ const url = `data:${_chunkYAFS2QFZcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkDCLJNVZScjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5640
5644
  const px2 = await this.decodeImage(url);
5641
- const decoded = { ...c, kind: "raster", raster: _chunk65GNHOD4cjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5645
+ const decoded = { ...c, kind: "raster", raster: _chunkYAFS2QFZcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5642
5646
  const swap = (layers) => {
5643
5647
  let out = layers;
5644
5648
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -5666,10 +5670,10 @@ var ImageEditorController = (_class7 = class {
5666
5670
  * Contents can nest. Returns the contents' size and layer ids.
5667
5671
  */
5668
5672
  editSmartObjectContents(id) {
5669
- if (this.getFreeTransform()) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5670
- const layer = _chunk65GNHOD4cjs.requireSmartObject.call(void 0, this.state.layers, id);
5673
+ if (this.getFreeTransform()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5674
+ const layer = _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, this.state.layers, id);
5671
5675
  const c = layer.contents;
5672
- if (!_chunk65GNHOD4cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5676
+ if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5673
5677
  const saved = {
5674
5678
  state: { ...this.state },
5675
5679
  undo: this.undoStack,
@@ -5680,7 +5684,7 @@ var ImageEditorController = (_class7 = class {
5680
5684
  samplePixelsOverride: this.samplePixelsOverride,
5681
5685
  psdResolution: this.psdResolution
5682
5686
  };
5683
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunk65GNHOD4cjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5687
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5684
5688
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5685
5689
  const s = this.state;
5686
5690
  this.state = {
@@ -5688,7 +5692,7 @@ var ImageEditorController = (_class7 = class {
5688
5692
  sourceUrl: null,
5689
5693
  imageDimensions: { width: c.width, height: c.height },
5690
5694
  crop: null,
5691
- transform: { ..._chunk65GNHOD4cjs.DEFAULT_TRANSFORM_VALUES },
5695
+ transform: { ..._chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES },
5692
5696
  layers,
5693
5697
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5694
5698
  activeTarget: "pixels",
@@ -5721,7 +5725,7 @@ var ImageEditorController = (_class7 = class {
5721
5725
  */
5722
5726
  closeSmartObjectContents(save = true) {
5723
5727
  const top = this.contentsStack.pop();
5724
- if (!top) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5728
+ if (!top) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5725
5729
  if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
5726
5730
  this.openTransform = null;
5727
5731
  const edited = this.state;
@@ -5735,10 +5739,10 @@ var ImageEditorController = (_class7 = class {
5735
5739
  const plain3 = _optionalChain([only, 'optionalAccess', _211 => _211.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _212 => _212.filters, 'optionalAccess', _213 => _213.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5736
5740
  if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
5737
5741
  const px2 = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5738
- next = _chunk65GNHOD4cjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5742
+ next = _chunkYAFS2QFZcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5739
5743
  } else {
5740
5744
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5741
- next = _chunk65GNHOD4cjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5745
+ next = _chunkYAFS2QFZcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5742
5746
  }
5743
5747
  }
5744
5748
  const saved = top.saved;
@@ -5757,7 +5761,7 @@ var ImageEditorController = (_class7 = class {
5757
5761
  this.notify();
5758
5762
  return { layerId: top.layerId, changed: false, layerIds: [] };
5759
5763
  }
5760
- const res = _chunk65GNHOD4cjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5764
+ const res = _chunkYAFS2QFZcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5761
5765
  this.commitLayers(res.layers);
5762
5766
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5763
5767
  }
@@ -5772,35 +5776,35 @@ var ImageEditorController = (_class7 = class {
5772
5776
  // --- Layer effects ---
5773
5777
  /** A layer's effects (an empty, enabled list when it has none). */
5774
5778
  getLayerEffects(id) {
5775
- return _chunk65GNHOD4cjs.layerEffectsOf.call(void 0, _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer);
5779
+ return _chunkYAFS2QFZcjs.layerEffectsOf.call(void 0, _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5776
5780
  }
5777
5781
  /**
5778
5782
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5779
5783
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5780
5784
  */
5781
5785
  addLayerEffect(id, kind, params = {}, index) {
5782
- const res = _chunk65GNHOD4cjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5786
+ const res = _chunkYAFS2QFZcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5783
5787
  this.commitLayers(res.layers);
5784
5788
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5785
5789
  }
5786
5790
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5787
5791
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5788
- this.commitLayers(_chunk65GNHOD4cjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5792
+ this.commitLayers(_chunkYAFS2QFZcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5789
5793
  return this.getLayerEffects(id);
5790
5794
  }
5791
5795
  /** Removes one effect (one undo step). Returns the remaining effects. */
5792
5796
  removeLayerEffect(id, effectId) {
5793
- this.commitLayers(_chunk65GNHOD4cjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5797
+ this.commitLayers(_chunkYAFS2QFZcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5794
5798
  return this.getLayerEffects(id);
5795
5799
  }
5796
5800
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5797
5801
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5798
- this.commitLayers(_chunk65GNHOD4cjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5802
+ this.commitLayers(_chunkYAFS2QFZcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5799
5803
  return this.getLayerEffects(id);
5800
5804
  }
5801
5805
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5802
5806
  setLayerEffects(id, effects, commitToHistory = true) {
5803
- this.commitLayers(_chunk65GNHOD4cjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5807
+ this.commitLayers(_chunkYAFS2QFZcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5804
5808
  return this.getLayerEffects(id);
5805
5809
  }
5806
5810
  __init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5826,8 +5830,8 @@ var ImageEditorController = (_class7 = class {
5826
5830
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5827
5831
  setGlobalLight(light, commitToHistory = true) {
5828
5832
  const next = { ...this.getGlobalLight(), ...light };
5829
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5830
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5833
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5834
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5831
5835
  if (commitToHistory) this.recordHistory();
5832
5836
  if (next.angle === _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5833
5837
  else this.state.globalLight = next;
@@ -5838,16 +5842,16 @@ var ImageEditorController = (_class7 = class {
5838
5842
  async compositeToSurface(layers, rect) {
5839
5843
  const { width, height } = this.naturalSize;
5840
5844
  if (_chunk24ATT2PEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5841
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5845
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5842
5846
  }
5843
5847
  await this.renderer.prepareLayerAssets(layers, width, height);
5844
5848
  const sources = this.renderer.compositorSources(width, height);
5845
5849
  const depth = this.bitDepth;
5846
5850
  if (depth !== 8) {
5847
- const samples = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunk65GNHOD4cjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5851
+ const samples = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5848
5852
  return _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5849
5853
  }
5850
- const data = new (0, _chunk65GNHOD4cjs.LayerCompositor)().composite(layers, rect, sources);
5854
+ const data = new (0, _chunkYAFS2QFZcjs.LayerCompositor)().composite(layers, rect, sources);
5851
5855
  return _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5852
5856
  }
5853
5857
  /**
@@ -5860,22 +5864,22 @@ var ImageEditorController = (_class7 = class {
5860
5864
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5861
5865
  const depth = this.bitDepth;
5862
5866
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkJ5BA3BQ6cjs.to16From8.call(void 0, this.compositePixels(r).data) };
5863
- const data = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunk65GNHOD4cjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5867
+ const data = _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5864
5868
  return { width: r.width, height: r.height, depth, data };
5865
5869
  }
5866
5870
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5867
5871
  paintBounds(layer) {
5868
5872
  const { width, height } = this.naturalSize;
5869
5873
  const canvas = { x: 0, y: 0, width, height };
5870
- if (_chunk65GNHOD4cjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5874
+ if (_chunkYAFS2QFZcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5871
5875
  if (layer.type === "annotation") {
5872
- const b = _chunk65GNHOD4cjs.getAnnotationBounds.call(void 0, layer.annotation);
5876
+ const b = _chunkYAFS2QFZcjs.getAnnotationBounds.call(void 0, layer.annotation);
5873
5877
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5874
5878
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5875
5879
  }
5876
5880
  if (layer.type === "group") {
5877
5881
  let r = null;
5878
- for (const c of layer.children) r = _chunk65GNHOD4cjs.unionRect.call(void 0, r, this.paintBounds(c));
5882
+ for (const c of layer.children) r = _chunkYAFS2QFZcjs.unionRect.call(void 0, r, this.paintBounds(c));
5879
5883
  return _nullishCoalesce(r, () => ( canvas));
5880
5884
  }
5881
5885
  return canvas;
@@ -5886,16 +5890,16 @@ var ImageEditorController = (_class7 = class {
5886
5890
  * Returns the merged id.
5887
5891
  */
5888
5892
  async mergeDown(id) {
5889
- const loc = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id);
5893
+ const loc = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id);
5890
5894
  const upper = loc.layer;
5891
5895
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5892
5896
  const lower = siblings[loc.index - 1];
5893
- if (!lower) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5894
- if (lower.type !== "pixel") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5895
- if (!upper.visible) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5896
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5897
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5898
- let rect = _nullishCoalesce(_chunk65GNHOD4cjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5897
+ if (!lower) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5898
+ if (lower.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5899
+ if (!upper.visible) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5900
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5901
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5902
+ let rect = _nullishCoalesce(_chunkYAFS2QFZcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5899
5903
  const reach = Math.max(_chunk24ATT2PEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunk24ATT2PEcjs.effectsMargin.call(void 0, upper.effects));
5900
5904
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5901
5905
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -5921,12 +5925,12 @@ var ImageEditorController = (_class7 = class {
5921
5925
  */
5922
5926
  async mergeVisible() {
5923
5927
  const visible = this.state.layers.filter((l) => l.visible);
5924
- if (!visible.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("No layer is visible.");
5928
+ if (!visible.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("No layer is visible.");
5925
5929
  const { width, height } = this.naturalSize;
5926
5930
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5927
5931
  const merged = {
5928
5932
  type: "pixel",
5929
- id: _chunk65GNHOD4cjs.newLayerId.call(void 0, ),
5933
+ id: _chunkYAFS2QFZcjs.newLayerId.call(void 0, ),
5930
5934
  name: "Merged",
5931
5935
  visible: true,
5932
5936
  opacity: 1,
@@ -5950,8 +5954,8 @@ var ImageEditorController = (_class7 = class {
5950
5954
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5951
5955
  const bg = {
5952
5956
  type: "pixel",
5953
- id: _chunk65GNHOD4cjs.BACKGROUND_LAYER_ID,
5954
- name: _chunk65GNHOD4cjs.BACKGROUND_LAYER_NAME,
5957
+ id: _chunkYAFS2QFZcjs.BACKGROUND_LAYER_ID,
5958
+ name: _chunkYAFS2QFZcjs.BACKGROUND_LAYER_NAME,
5955
5959
  visible: true,
5956
5960
  opacity: 1,
5957
5961
  blend: "normal",
@@ -5978,7 +5982,7 @@ var ImageEditorController = (_class7 = class {
5978
5982
  const k = Math.min(1, side / Math.max(width, height));
5979
5983
  const tw = Math.max(1, Math.round(width * k));
5980
5984
  const th = Math.max(1, Math.round(height * k));
5981
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunk65GNHOD4cjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5985
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkYAFS2QFZcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5982
5986
  if (!surface) return null;
5983
5987
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5984
5988
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -6020,7 +6024,7 @@ var ImageEditorController = (_class7 = class {
6020
6024
  /** Brush settings, colours and tool options of the paint tools (view state, no undo). */
6021
6025
  setPaintOptions(options) {
6022
6026
  const cur = this.state.paint;
6023
- const retouch = options.retouch ? _chunkNVTHUPJ6cjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6027
+ const retouch = options.retouch ? _chunkYT3JL7YMcjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6024
6028
  const cloneSource = cur.cloneSource && retouch.aligned !== cur.retouch.aligned ? { ...cur.cloneSource, offset: null } : cur.cloneSource;
6025
6029
  let source = cur.paint;
6026
6030
  let foreground = options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground;
@@ -6038,7 +6042,8 @@ var ImageEditorController = (_class7 = class {
6038
6042
  mixer: options.mixer ? _chunk6GFRKLLScjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
6039
6043
  mixerLoad: cur.mixerLoad,
6040
6044
  retouch,
6041
- cloneSource
6045
+ cloneSource,
6046
+ cloneTransform: cur.cloneTransform
6042
6047
  };
6043
6048
  this.state.paint = next;
6044
6049
  this.notify();
@@ -6073,12 +6078,30 @@ var ImageEditorController = (_class7 = class {
6073
6078
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
6074
6079
  */
6075
6080
  setCloneSource(point) {
6076
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6081
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6077
6082
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
6078
6083
  this.state.paint = { ...this.state.paint, cloneSource: source };
6079
6084
  this.notify();
6080
6085
  return source;
6081
6086
  }
6087
+ /**
6088
+ * The Clone Source panel's transform for the Clone Stamp and Healing Brush: `scaleX` / `scaleY`
6089
+ * (factors, 0.01..10 in size; negative flips) and `rotate` (degrees, clockwise), merged into the
6090
+ * current one; `null` resets it. View state, no undo. Returns the transform.
6091
+ */
6092
+ setCloneTransform(t) {
6093
+ const cur = this.state.paint.cloneTransform;
6094
+ const next = t ? { ...cur, ...t } : { ..._chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM };
6095
+ for (const k of ["scaleX", "scaleY"]) {
6096
+ const v = next[k];
6097
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6098
+ }
6099
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("rotate must be a number of degrees.");
6100
+ next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
6101
+ this.state.paint = { ...this.state.paint, cloneTransform: next };
6102
+ this.notify();
6103
+ return next;
6104
+ }
6082
6105
  /** D: black foreground, white background. */
6083
6106
  resetPaintColors() {
6084
6107
  this.setPaintOptions({ foreground: "#000000", background: "#ffffff" });
@@ -6091,27 +6114,27 @@ var ImageEditorController = (_class7 = class {
6091
6114
  /** Resolves and validates what a stroke, fill or clear paints into. */
6092
6115
  paintTarget(layerId, channel, action) {
6093
6116
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
6094
- if (!id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6095
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
6117
+ if (!id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6118
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6096
6119
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
6097
6120
  if (ch === "mask") {
6098
- if (!layer.mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6099
- if (layer.mask.source) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6100
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "all", action);
6121
+ if (!layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6122
+ if (layer.mask.source) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6123
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", action);
6101
6124
  } else if (ch === "filter-mask") {
6102
6125
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
6103
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6126
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6104
6127
  }
6105
- if (!_chunk65GNHOD4cjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6106
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "all", action);
6128
+ if (!_chunkYAFS2QFZcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6129
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", action);
6107
6130
  } else {
6108
- if (layer.type === "smart") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6109
- if (layer.type === "shape") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6110
- if (layer.type === "type") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6111
- if (layer.type !== "pixel") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6112
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", action);
6131
+ if (layer.type === "smart") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6132
+ if (layer.type === "shape") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6133
+ if (layer.type === "type") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6134
+ if (layer.type !== "pixel") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6135
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6113
6136
  }
6114
- if (!layer.visible) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6137
+ if (!layer.visible) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6115
6138
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6116
6139
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
6117
6140
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
@@ -6120,7 +6143,7 @@ var ImageEditorController = (_class7 = class {
6120
6143
  /** The layer with its pixels (or mask) replaced by `surface`. */
6121
6144
  withSurface(layer, channel, surface) {
6122
6145
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
6123
- if (channel === "filter-mask") return _chunk65GNHOD4cjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6146
+ if (channel === "filter-mask") return _chunkYAFS2QFZcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6124
6147
  const next = { ...layer, surface };
6125
6148
  delete next.source;
6126
6149
  return next;
@@ -6133,10 +6156,10 @@ var ImageEditorController = (_class7 = class {
6133
6156
  */
6134
6157
  beginStroke(init = {}) {
6135
6158
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
6136
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6159
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6137
6160
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
6138
6161
  if (tool === "mixer" && target.channel !== "pixels") {
6139
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6162
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6140
6163
  }
6141
6164
  const brush = _chunk6GFRKLLScjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6142
6165
  let strokePaint = null;
@@ -6168,11 +6191,11 @@ var ImageEditorController = (_class7 = class {
6168
6191
  }
6169
6192
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
6170
6193
  retouchStroke(tool, init, brush, target, apply) {
6171
- const settings = _chunkNVTHUPJ6cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6194
+ const settings = _chunkYT3JL7YMcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6172
6195
  const mask = target.channel !== "pixels";
6173
- if (tool === "sponge" && mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6174
- if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkNVTHUPJ6cjs.RetouchDabStroke)(brush, pixels, _chunkNVTHUPJ6cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6175
- if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkNVTHUPJ6cjs.RetouchDabStroke)(brush, pixels, _chunkNVTHUPJ6cjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6196
+ if (tool === "sponge" && mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6197
+ if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkYT3JL7YMcjs.RetouchDabStroke)(brush, pixels, _chunkYT3JL7YMcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6198
+ if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkYT3JL7YMcjs.RetouchDabStroke)(brush, pixels, _chunkYT3JL7YMcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6176
6199
  const retouchApply = {
6177
6200
  opacity: tool === "clone" || tool === "heal" || tool === "history" ? brush.opacity : tool === "blur" || tool === "sharpen" ? brush.opacity * settings.strength : 1,
6178
6201
  blend: tool === "clone" && !mask ? brush.blend : "normal",
@@ -6182,7 +6205,7 @@ var ImageEditorController = (_class7 = class {
6182
6205
  };
6183
6206
  const coverage = new (0, _chunk6GFRKLLScjs.StrokeCoverage)(brush);
6184
6207
  if (tool === "dodge" || tool === "burn") {
6185
- const paint2 = { kind: "tone", tone: _chunkNVTHUPJ6cjs.toneOf.call(void 0, tool, settings) };
6208
+ const paint2 = { kind: "tone", tone: _chunkYT3JL7YMcjs.toneOf.call(void 0, tool, settings) };
6186
6209
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6187
6210
  }, paint: () => paint2 };
6188
6211
  }
@@ -6190,11 +6213,11 @@ var ImageEditorController = (_class7 = class {
6190
6213
  const n = target.surface.channels;
6191
6214
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6192
6215
  const m = 6;
6193
- const filtered = new (0, _chunkNVTHUPJ6cjs.TilePixelSource)(
6216
+ const filtered = new (0, _chunkYT3JL7YMcjs.TilePixelSource)(
6194
6217
  (tx, ty) => {
6195
6218
  const r = { x: tx * _chunkJ5BA3BQ6cjs.TILE - m, y: ty * _chunkJ5BA3BQ6cjs.TILE - m, width: _chunkJ5BA3BQ6cjs.TILE + 2 * m, height: _chunkJ5BA3BQ6cjs.TILE + 2 * m };
6196
6219
  const d = workRegionOf(target.surface, r, depth);
6197
- _chunkNVTHUPJ6cjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6220
+ _chunkYT3JL7YMcjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6198
6221
  const out = new Float32Array(_chunkJ5BA3BQ6cjs.TILE * _chunkJ5BA3BQ6cjs.TILE * n);
6199
6222
  for (let y = 0; y < _chunkJ5BA3BQ6cjs.TILE; y++) out.set(d.subarray(((y + m) * r.width + m) * n, ((y + m) * r.width + m + _chunkJ5BA3BQ6cjs.TILE) * n), y * _chunkJ5BA3BQ6cjs.TILE * n);
6200
6223
  return out;
@@ -6209,21 +6232,21 @@ var ImageEditorController = (_class7 = class {
6209
6232
  if (tool === "history") {
6210
6233
  const steps = settings.historySteps;
6211
6234
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
6212
- if (!entry) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
6235
+ if (!entry) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
6213
6236
  const then = _optionalChain([_chunk24ATT2PEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
6214
- if (!then) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6237
+ if (!then) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6215
6238
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
6216
- if (!surface) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6239
+ if (!surface) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6217
6240
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
6218
6241
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6219
- const source2 = depth ? new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6242
+ const source2 = depth ? new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6220
6243
  const paint2 = { kind: "source", source: source2, dx: 0, dy: 0 };
6221
6244
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6222
6245
  }, paint: () => paint2 };
6223
6246
  }
6224
6247
  const sample = mask ? "current" : settings.sample;
6225
6248
  const deep = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6226
- const own = deep ? new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6249
+ const own = deep ? new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6227
6250
  const source = sample === "current" ? own : this.compositeSource(sample === "all" ? null : target.id, deep);
6228
6251
  const pad = (r, m) => ({ x: r.x - m, y: r.y - m, width: r.width + 2 * m, height: r.height + 2 * m });
6229
6252
  const covered = (cov, r) => {
@@ -6244,24 +6267,26 @@ var ImageEditorController = (_class7 = class {
6244
6267
  paint: () => trail,
6245
6268
  finalPaint: (cov) => {
6246
6269
  if (!cov.bounds) return null;
6247
- const win = _chunkNVTHUPJ6cjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6270
+ const win = _chunkYT3JL7YMcjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6248
6271
  if (win.width <= 0 || win.height <= 0) return null;
6249
- const img = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, win);
6272
+ const img = _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, win);
6250
6273
  const hole = covered(cov, win);
6251
- const healed = _chunkNVTHUPJ6cjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6274
+ const healed = _chunkYT3JL7YMcjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6252
6275
  patch = off ? { x: off[0], y: off[1] } : null;
6253
6276
  });
6254
- return { kind: "source", source: new (0, _chunkNVTHUPJ6cjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6277
+ return { kind: "source", source: new (0, _chunkYT3JL7YMcjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6255
6278
  },
6256
6279
  result: () => ({ spotHeal: { offset: patch } })
6257
6280
  };
6258
6281
  }
6259
6282
  if (init.source) this.setCloneSource(init.source);
6260
6283
  const cs = this.state.paint.cloneSource;
6261
- if (!cs) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6284
+ if (!cs) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6262
6285
  let offset = { x: 0, y: 0 };
6263
6286
  let first = { x: 0, y: 0 };
6264
- const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
6287
+ const xf = this.state.paint.cloneTransform;
6288
+ const transformed = _chunkYT3JL7YMcjs.isIdentityCloneTransform.call(void 0, xf) ? null : new (0, _chunkYT3JL7YMcjs.TransformedPixelSource)(source, (x, y) => _chunkYT3JL7YMcjs.cloneSamplePoint.call(void 0, xf, cs, { x: cs.x - offset.x, y: cs.y - offset.y }, x, y));
6289
+ const paint = () => transformed ? { kind: "source", source: transformed, dx: 0, dy: 0 } : { kind: "source", source, dx: offset.x, dy: offset.y };
6265
6290
  return {
6266
6291
  kind: "coverage",
6267
6292
  coverage,
@@ -6275,16 +6300,16 @@ var ImageEditorController = (_class7 = class {
6275
6300
  finalPaint: tool === "heal" ? (cov) => {
6276
6301
  if (!cov.bounds) return null;
6277
6302
  const g = pad(cov.bounds, 2);
6278
- const src = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6279
- const dst = _chunkNVTHUPJ6cjs.readSourceRegion.call(void 0, source, g);
6280
- return { kind: "source", source: new (0, _chunkNVTHUPJ6cjs.RegionPixelSource)(g, _chunkNVTHUPJ6cjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6303
+ const src = transformed ? _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, transformed, g) : _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6304
+ const dst = _chunkYT3JL7YMcjs.readSourceRegion.call(void 0, source, g);
6305
+ return { kind: "source", source: new (0, _chunkYT3JL7YMcjs.RegionPixelSource)(g, _chunkYT3JL7YMcjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6281
6306
  } : void 0,
6282
6307
  result: () => ({ clone: { offset: { ...offset }, source: { x: first.x + offset.x, y: first.y + offset.y }, aligned: settings.aligned } })
6283
6308
  };
6284
6309
  }
6285
6310
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
6286
6311
  surfaceSource(surface, offset) {
6287
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6312
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkJ5BA3BQ6cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6288
6313
  }
6289
6314
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
6290
6315
  compositeSource(throughId, depth = null) {
@@ -6292,8 +6317,8 @@ var ImageEditorController = (_class7 = class {
6292
6317
  const layers = throughId ? layersThrough(stack, throughId) : stack;
6293
6318
  const sources = this.compositorSources();
6294
6319
  if (depth) {
6295
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => {
6296
- const w = _chunk65GNHOD4cjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
6320
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => {
6321
+ const w = _chunkYAFS2QFZcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkJ5BA3BQ6cjs.TILE, y: ty * _chunkJ5BA3BQ6cjs.TILE, width: _chunkJ5BA3BQ6cjs.TILE, height: _chunkJ5BA3BQ6cjs.TILE }, sources, depth);
6297
6322
  for (let i = 0; i < w.length; i += 4) {
6298
6323
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkJ5BA3BQ6cjs.srgbEncode.call(void 0, w[i + c]);
6299
6324
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -6301,8 +6326,8 @@ var ImageEditorController = (_class7 = class {
6301
6326
  return w;
6302
6327
  }, 4);
6303
6328
  }
6304
- const compositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)();
6305
- return new (0, _chunkNVTHUPJ6cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6329
+ const compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)();
6330
+ return new (0, _chunkYT3JL7YMcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6306
6331
  }
6307
6332
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
6308
6333
  mixerStroke(init, brush) {
@@ -6351,9 +6376,9 @@ var ImageEditorController = (_class7 = class {
6351
6376
  * document bounds and the number of dabs.
6352
6377
  */
6353
6378
  paintStroke(init) {
6354
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("points must hold at least one { x, y } point.");
6379
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6355
6380
  for (const p of init.points) {
6356
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6381
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6357
6382
  }
6358
6383
  const session = this.beginStroke(init);
6359
6384
  session.push(init.points);
@@ -6379,8 +6404,8 @@ var ImageEditorController = (_class7 = class {
6379
6404
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
6380
6405
  const { width, height } = this.naturalSize;
6381
6406
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
6382
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("opacity must be from 0 to 1.");
6383
- const blend = _nullishCoalesce(_chunk65GNHOD4cjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6407
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be from 0 to 1.");
6408
+ const blend = _nullishCoalesce(_chunkYAFS2QFZcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6384
6409
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
6385
6410
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
6386
6411
  const coverage = new (0, _chunk6GFRKLLScjs.CoverageMap)();
@@ -6416,7 +6441,7 @@ var ImageEditorController = (_class7 = class {
6416
6441
  // --- Adjustments ---
6417
6442
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
6418
6443
  developLayer() {
6419
- return _chunk65GNHOD4cjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6444
+ return _chunkYAFS2QFZcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6420
6445
  }
6421
6446
  /**
6422
6447
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -6442,7 +6467,7 @@ var ImageEditorController = (_class7 = class {
6442
6467
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
6443
6468
  }
6444
6469
  if ("layers" in partial) {
6445
- layers = this.replaceAdjustmentNodes(layers, _chunk65GNHOD4cjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6470
+ layers = this.replaceAdjustmentNodes(layers, _chunkYAFS2QFZcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6446
6471
  }
6447
6472
  this.state.layers = layers;
6448
6473
  this.notify();
@@ -6450,7 +6475,7 @@ var ImageEditorController = (_class7 = class {
6450
6475
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
6451
6476
  get isProcessOutdated() {
6452
6477
  this.syncViews();
6453
- return _chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunk65GNHOD4cjs.LATEST_PROCESS_VERSION;
6478
+ return _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION;
6454
6479
  }
6455
6480
  /**
6456
6481
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -6458,7 +6483,7 @@ var ImageEditorController = (_class7 = class {
6458
6483
  */
6459
6484
  upgradeProcess() {
6460
6485
  if (!this.isProcessOutdated) return false;
6461
- this.setAdjustments({ process: _chunk65GNHOD4cjs.LATEST_PROCESS_VERSION });
6486
+ this.setAdjustments({ process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION });
6462
6487
  return true;
6463
6488
  }
6464
6489
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -6469,7 +6494,7 @@ var ImageEditorController = (_class7 = class {
6469
6494
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0,
6470
6495
  this.state.layers,
6471
6496
  target.id,
6472
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunk65GNHOD4cjs.LATEST_PROCESS_VERSION }), 0)
6497
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION }), 0)
6473
6498
  );
6474
6499
  }
6475
6500
  delete this.state.legacyOutputBlur;
@@ -6533,7 +6558,7 @@ var ImageEditorController = (_class7 = class {
6533
6558
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
6534
6559
  for (const l of next) {
6535
6560
  if (existing.has(l.id)) continue;
6536
- out = this.placeLayer(out, _chunk65GNHOD4cjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6561
+ out = this.placeLayer(out, _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6537
6562
  }
6538
6563
  const order = next.map((l) => l.id);
6539
6564
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -6548,7 +6573,7 @@ var ImageEditorController = (_class7 = class {
6548
6573
  addAdjustmentLayer(init, index) {
6549
6574
  const spec = typeof init === "string" ? { kind: init } : init;
6550
6575
  const ids = new Set(_chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
6551
- const layer = _chunk65GNHOD4cjs.createAdjustmentLayer.call(void 0, spec.kind, {
6576
+ const layer = _chunkYAFS2QFZcjs.createAdjustmentLayer.call(void 0, spec.kind, {
6552
6577
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
6553
6578
  name: spec.name,
6554
6579
  params: spec.params,
@@ -6557,10 +6582,10 @@ var ImageEditorController = (_class7 = class {
6557
6582
  blend: spec.blend,
6558
6583
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
6559
6584
  });
6560
- while (ids.has(layer.id)) layer.id = _chunk65GNHOD4cjs.newLayerId.call(void 0, "adj");
6585
+ while (ids.has(layer.id)) layer.id = _chunkYAFS2QFZcjs.newLayerId.call(void 0, "adj");
6561
6586
  const { width, height } = this.naturalSize;
6562
6587
  this.recordHistory();
6563
- const node = _chunk65GNHOD4cjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6588
+ const node = _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6564
6589
  const positioned = Boolean(spec.aboveId || spec.parentId);
6565
6590
  this.state.layers = this.placeLayer(this.state.layers, node, {
6566
6591
  aboveId: spec.aboveId,
@@ -6580,7 +6605,7 @@ var ImageEditorController = (_class7 = class {
6580
6605
  if (!loc || loc.layer.type !== "adjustment") return false;
6581
6606
  const { width, height } = this.naturalSize;
6582
6607
  const node = loc.layer;
6583
- const merged = _chunk65GNHOD4cjs.normalizeAdjustmentLayer.call(void 0, {
6608
+ const merged = _chunkYAFS2QFZcjs.normalizeAdjustmentLayer.call(void 0, {
6584
6609
  id: node.id,
6585
6610
  kind: node.kind,
6586
6611
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6600,7 +6625,7 @@ var ImageEditorController = (_class7 = class {
6600
6625
  params: merged.params
6601
6626
  };
6602
6627
  if (update.mask !== void 0) {
6603
- const mask = update.mask ? _chunk65GNHOD4cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6628
+ const mask = update.mask ? _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6604
6629
  if (mask) next.mask = mask;
6605
6630
  else delete next.mask;
6606
6631
  }
@@ -6687,8 +6712,8 @@ var ImageEditorController = (_class7 = class {
6687
6712
  const { width, height } = this.naturalSize;
6688
6713
  let next = null;
6689
6714
  if (mask) {
6690
- const sized = mask.width === width && mask.height === height ? mask : _chunk65GNHOD4cjs.resizeSelection.call(void 0, mask, width, height);
6691
- next = _chunk65GNHOD4cjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6715
+ const sized = mask.width === width && mask.height === height ? mask : _chunkYAFS2QFZcjs.resizeSelection.call(void 0, mask, width, height);
6716
+ next = _chunkYAFS2QFZcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6692
6717
  } else if (mode !== "replace") {
6693
6718
  return false;
6694
6719
  }
@@ -6702,7 +6727,7 @@ var ImageEditorController = (_class7 = class {
6702
6727
  /** Select › All. */
6703
6728
  selectAll() {
6704
6729
  const { width, height } = this.naturalSize;
6705
- return this.setSelection(_chunk65GNHOD4cjs.fullSelection.call(void 0, width, height));
6730
+ return this.setSelection(_chunkYAFS2QFZcjs.fullSelection.call(void 0, width, height));
6706
6731
  }
6707
6732
  /** Select › Deselect. */
6708
6733
  deselect() {
@@ -6711,11 +6736,11 @@ var ImageEditorController = (_class7 = class {
6711
6736
  /** Select › Inverse (with nothing selected, selects everything). */
6712
6737
  invertSelection() {
6713
6738
  const { width, height } = this.naturalSize;
6714
- const current = _nullishCoalesce(this.state.selection, () => ( _chunk65GNHOD4cjs.createSelectionMask.call(void 0, width, height)));
6715
- return this.setSelection(_chunk65GNHOD4cjs.invertSelection.call(void 0, current));
6739
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height)));
6740
+ return this.setSelection(_chunkYAFS2QFZcjs.invertSelection.call(void 0, current));
6716
6741
  }
6717
6742
  shapeCommand(mask, options) {
6718
- const shaped = options.feather && options.feather > 0 ? _chunk65GNHOD4cjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6743
+ const shaped = options.feather && options.feather > 0 ? _chunkYAFS2QFZcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6719
6744
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6720
6745
  }
6721
6746
  /** Rectangular marquee in natural image pixels. */
@@ -6769,11 +6794,11 @@ var ImageEditorController = (_class7 = class {
6769
6794
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6770
6795
  return null;
6771
6796
  }
6772
- const legacy = _chunk65GNHOD4cjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6797
+ const legacy = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6773
6798
  if (options.sample === "active-layer") {
6774
6799
  const layer = this.getActiveLayer();
6775
6800
  if (!layer || layer.type !== "pixel") {
6776
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6801
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6777
6802
  }
6778
6803
  const surface = layer.source === "document" && options.pixels ? _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6779
6804
  return { width, height, data: _chunkJ5BA3BQ6cjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6782,7 +6807,7 @@ var ImageEditorController = (_class7 = class {
6782
6807
  this.syncViews();
6783
6808
  if (legacy && !options.pixels) {
6784
6809
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6785
- _chunk65GNHOD4cjs.applyAdjustments.call(void 0, copy, _chunk65GNHOD4cjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6810
+ _chunkYAFS2QFZcjs.applyAdjustments.call(void 0, copy, _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6786
6811
  return copy;
6787
6812
  }
6788
6813
  const pixels = options.pixels;
@@ -6794,7 +6819,7 @@ var ImageEditorController = (_class7 = class {
6794
6819
  };
6795
6820
  const stack = withoutAnnotations(this.state.layers);
6796
6821
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6797
- const data = new (0, _chunk65GNHOD4cjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6822
+ const data = new (0, _chunkYAFS2QFZcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6798
6823
  return { width, height, data };
6799
6824
  }
6800
6825
  async requirePixels(options) {
@@ -6821,7 +6846,7 @@ var ImageEditorController = (_class7 = class {
6821
6846
  modifySelection(op, radius) {
6822
6847
  const sel = this.state.selection;
6823
6848
  if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
6824
- return this.setSelection(_chunk65GNHOD4cjs.modifySelection.call(void 0, sel, op, radius));
6849
+ return this.setSelection(_chunkYAFS2QFZcjs.modifySelection.call(void 0, sel, op, radius));
6825
6850
  }
6826
6851
  /**
6827
6852
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6852,7 +6877,7 @@ var ImageEditorController = (_class7 = class {
6852
6877
  } else {
6853
6878
  pixels = source;
6854
6879
  }
6855
- this.setSelection(_chunk65GNHOD4cjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6880
+ this.setSelection(_chunkYAFS2QFZcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6856
6881
  return this.getSelection();
6857
6882
  }
6858
6883
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6864,7 +6889,7 @@ var ImageEditorController = (_class7 = class {
6864
6889
  // --- Layer masks ---
6865
6890
  maskFromSelection(sel, props = {}) {
6866
6891
  const { width, height } = this.naturalSize;
6867
- const sized = sel.width === width && sel.height === height ? sel : _chunk65GNHOD4cjs.resizeSelection.call(void 0, sel, width, height);
6892
+ const sized = sel.width === width && sel.height === height ? sel : _chunkYAFS2QFZcjs.resizeSelection.call(void 0, sel, width, height);
6868
6893
  const mask = { surface: _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6869
6894
  return withMaskProps(mask, props);
6870
6895
  }
@@ -6910,7 +6935,7 @@ var ImageEditorController = (_class7 = class {
6910
6935
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6911
6936
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6912
6937
  const data = _chunkJ5BA3BQ6cjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6913
- const sel = _chunk65GNHOD4cjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6938
+ const sel = _chunkYAFS2QFZcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6914
6939
  return this.setSelection(sel, mode);
6915
6940
  }
6916
6941
  // --- Histogram ---
@@ -6940,9 +6965,9 @@ var ImageEditorController = (_class7 = class {
6940
6965
  merged.depthRange = [...merged.depthRange];
6941
6966
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6942
6967
  const next = { ...l };
6943
- if (_chunk65GNHOD4cjs.isDefaultDepthMask.call(void 0, merged)) {
6968
+ if (_chunkYAFS2QFZcjs.isDefaultDepthMask.call(void 0, merged)) {
6944
6969
  if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
6945
- } else next.mask = _chunk65GNHOD4cjs.depthRasterMask.call(void 0, merged);
6970
+ } else next.mask = _chunkYAFS2QFZcjs.depthRasterMask.call(void 0, merged);
6946
6971
  return next;
6947
6972
  });
6948
6973
  }
@@ -6963,7 +6988,7 @@ var ImageEditorController = (_class7 = class {
6963
6988
  // --- Annotations & Layers ---
6964
6989
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
6965
6990
  annotationLayer(id) {
6966
- return _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunk65GNHOD4cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
6991
+ return _chunk24ATT2PEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
6967
6992
  }
6968
6993
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
6969
6994
  annotationEnv() {
@@ -6979,7 +7004,7 @@ var ImageEditorController = (_class7 = class {
6979
7004
  this.recordHistory();
6980
7005
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
6981
7006
  const fullAnnotation = { ...annotation, id };
6982
- const layer = _chunk65GNHOD4cjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7007
+ const layer = _chunkYAFS2QFZcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6983
7008
  const loc = placement.aboveId ? _chunk24ATT2PEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
6984
7009
  this.state.layers = loc ? _chunk24ATT2PEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunk24ATT2PEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
6985
7010
  this.state.selectedAnnotationId = id;
@@ -6991,17 +7016,17 @@ var ImageEditorController = (_class7 = class {
6991
7016
  this.recordHistory();
6992
7017
  }
6993
7018
  const layer = this.annotationLayer(id);
6994
- const current = layer ? _chunk65GNHOD4cjs.annotationOfLayer.call(void 0, layer) : null;
7019
+ const current = layer ? _chunkYAFS2QFZcjs.annotationOfLayer.call(void 0, layer) : null;
6995
7020
  if (layer && current) {
6996
7021
  const annotation = { ...current, ...partial, id };
6997
- const name = layer.name === _chunk65GNHOD4cjs.annotationLayerName.call(void 0, current) ? _chunk65GNHOD4cjs.annotationLayerName.call(void 0, annotation) : layer.name;
7022
+ const name = layer.name === _chunkYAFS2QFZcjs.annotationLayerName.call(void 0, current) ? _chunkYAFS2QFZcjs.annotationLayerName.call(void 0, annotation) : layer.name;
6998
7023
  this.state.layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
6999
7024
  }
7000
7025
  this.notify();
7001
7026
  }
7002
7027
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
7003
7028
  layerForAnnotation(layer, annotation, name) {
7004
- const fresh = _chunk65GNHOD4cjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7029
+ const fresh = _chunkYAFS2QFZcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7005
7030
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
7006
7031
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
7007
7032
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -7088,7 +7113,10 @@ var ImageEditorController = (_class7 = class {
7088
7113
  if (s.activeTool !== "clone" && s.activeTool !== "heal") return null;
7089
7114
  const cs = s.paint.cloneSource;
7090
7115
  if (!cs) return null;
7091
- if (cursor && cs.offset && s.paint.retouch.aligned) return { x: cursor.x + cs.offset.x, y: cursor.y + cs.offset.y };
7116
+ if (cursor && cs.offset && s.paint.retouch.aligned) {
7117
+ const [x, y] = _chunkYT3JL7YMcjs.cloneSamplePoint.call(void 0, s.paint.cloneTransform, cs, { x: cs.x - cs.offset.x, y: cs.y - cs.offset.y }, cursor.x, cursor.y);
7118
+ return { x, y };
7119
+ }
7092
7120
  return { x: cs.x, y: cs.y };
7093
7121
  }
7094
7122
  async render(targetCanvas, options) {
@@ -7285,8 +7313,8 @@ var ImageEditorController = (_class7 = class {
7285
7313
  return;
7286
7314
  }
7287
7315
  const target = this.developLayer();
7288
- if (!target) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("There is no pixel layer to mask.");
7289
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, target, "all", "mask it");
7316
+ if (!target) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("There is no pixel layer to mask.");
7317
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7290
7318
  const { width, height } = this.naturalSize;
7291
7319
  let px2 = await this.decodeImage(newDataUrl);
7292
7320
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -7294,14 +7322,14 @@ var ImageEditorController = (_class7 = class {
7294
7322
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
7295
7323
  let surface = _chunkJ5BA3BQ6cjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
7296
7324
  if (target.offset.x || target.offset.y) surface = _chunkJ5BA3BQ6cjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
7297
- this.commitLayers(_chunk65GNHOD4cjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7325
+ this.commitLayers(_chunkYAFS2QFZcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7298
7326
  return target.id;
7299
7327
  }
7300
7328
  // --- Type layers ---
7301
7329
 
7302
7330
  /** The shaper that lays out and draws type layers (`null` when there is none here). */
7303
7331
  getTextShaper() {
7304
- if (this.textShaperValue === void 0) this.textShaperValue = _chunkF7GGEAO2cjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7332
+ if (this.textShaperValue === void 0) this.textShaperValue = _chunkZ2H7KECKcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7305
7333
  return this.textShaperValue;
7306
7334
  }
7307
7335
  /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
@@ -7318,7 +7346,7 @@ var ImageEditorController = (_class7 = class {
7318
7346
  return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
7319
7347
  }
7320
7348
  typeInfo(id) {
7321
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7349
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7322
7350
  const ranges = (runs) => {
7323
7351
  let at = 0;
7324
7352
  return runs.map((r) => {
@@ -7331,7 +7359,7 @@ var ImageEditorController = (_class7 = class {
7331
7359
  let lines = [];
7332
7360
  let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
7333
7361
  if (shaper) {
7334
- const layout = _chunkF7GGEAO2cjs.layoutText.call(void 0, layer, shaper);
7362
+ const layout = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper);
7335
7363
  const r = (n) => Math.round(n * 1e3) / 1e3;
7336
7364
  lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
7337
7365
  if (layer.rendering === "stored") missing = layout.missingFonts;
@@ -7361,25 +7389,25 @@ var ImageEditorController = (_class7 = class {
7361
7389
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
7362
7390
  */
7363
7391
  addTextLayer(init) {
7364
- const text = _chunk65GNHOD4cjs.normalizeText.call(void 0, init.text);
7365
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("x and y must be numbers (document pixels).");
7366
- const style = _chunk65GNHOD4cjs.patchTextStyle.call(void 0, { ..._chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7367
- const paragraph = _chunk65GNHOD4cjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7392
+ const text = _chunkYAFS2QFZcjs.normalizeText.call(void 0, init.text);
7393
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("x and y must be numbers (document pixels).");
7394
+ const style = _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, { ..._chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7395
+ const paragraph = _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7368
7396
  let frame = { kind: "point" };
7369
7397
  if (init.box) {
7370
7398
  const { width, height } = init.box;
7371
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7399
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7372
7400
  frame = { kind: "box", width, height };
7373
7401
  }
7374
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("rotation must be a number of degrees.");
7375
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("opacity must be between 0 and 1.");
7376
- if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7402
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("rotation must be a number of degrees.");
7403
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be between 0 and 1.");
7404
+ if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7377
7405
  const t = [1, 0, 0, 1, init.x, init.y];
7378
- const transform = init.rotation ? _chunkF7GGEAO2cjs.multiplyMatrices.call(void 0, t, _chunkF7GGEAO2cjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7379
- const layer = _chunk65GNHOD4cjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunk65GNHOD4cjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7406
+ const transform = init.rotation ? _chunkZ2H7KECKcjs.multiplyMatrices.call(void 0, t, _chunkZ2H7KECKcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7407
+ const layer = _chunkYAFS2QFZcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkYAFS2QFZcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7380
7408
  if (init.opacity !== void 0) layer.opacity = init.opacity;
7381
7409
  if (init.blend !== void 0) layer.blend = init.blend;
7382
- const next = _chunk65GNHOD4cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7410
+ const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7383
7411
  this.commitLayers(next, () => {
7384
7412
  this.state.activeLayerId = layer.id;
7385
7413
  this.state.activeTarget = "pixels";
@@ -7391,28 +7419,28 @@ var ImageEditorController = (_class7 = class {
7391
7419
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
7392
7420
  */
7393
7421
  setText(id, text, range = {}, commitToHistory = true) {
7394
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7395
- const insert = _chunk65GNHOD4cjs.normalizeText.call(void 0, text);
7396
- const [start, end] = _chunk65GNHOD4cjs.textRange.call(void 0, layer.text, range.start, range.end);
7397
- const { layers } = _chunk65GNHOD4cjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunk65GNHOD4cjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7422
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7423
+ const insert = _chunkYAFS2QFZcjs.normalizeText.call(void 0, text);
7424
+ const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7425
+ const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkYAFS2QFZcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7398
7426
  this.commitLayers(layers, void 0, commitToHistory);
7399
7427
  return this.typeInfo(id);
7400
7428
  }
7401
7429
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
7402
7430
  setTextStyle(id, style, range = {}, commitToHistory = true) {
7403
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7404
- const [start, end] = _chunk65GNHOD4cjs.textRange.call(void 0, layer.text, range.start, range.end);
7405
- if (!Object.keys(style).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one style field to set.");
7406
- _chunk65GNHOD4cjs.patchTextStyle.call(void 0, _chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE, style);
7407
- const { layers } = _chunk65GNHOD4cjs.updateTypeLayer.call(void 0,
7431
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7432
+ const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7433
+ if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one style field to set.");
7434
+ _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE, style);
7435
+ const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7408
7436
  this.state.layers,
7409
7437
  id,
7410
7438
  (l) => {
7411
7439
  if (start === end) {
7412
- if (l.text.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7413
- return { runs: [{ length: 0, style: _chunk65GNHOD4cjs.patchTextStyle.call(void 0, _chunkF7GGEAO2cjs.styleAt.call(void 0, l.runs, 0, _chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE), style) }] };
7440
+ if (l.text.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7441
+ return { runs: [{ length: 0, style: _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, _chunkZ2H7KECKcjs.styleAt.call(void 0, l.runs, 0, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE), style) }] };
7414
7442
  }
7415
- return { runs: _chunkF7GGEAO2cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunk65GNHOD4cjs.patchTextStyle.call(void 0, s, style)) };
7443
+ return { runs: _chunkZ2H7KECKcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkYAFS2QFZcjs.patchTextStyle.call(void 0, s, style)) };
7416
7444
  },
7417
7445
  this.textEnv(),
7418
7446
  "restyle its text"
@@ -7422,11 +7450,11 @@ var ImageEditorController = (_class7 = class {
7422
7450
  }
7423
7451
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
7424
7452
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
7425
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7426
- const [start, end] = _chunk65GNHOD4cjs.textRange.call(void 0, layer.text, range.start, range.end);
7427
- if (!Object.keys(style).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one paragraph field to set.");
7428
- _chunk65GNHOD4cjs.patchParagraphStyle.call(void 0, {}, style);
7429
- const { layers } = _chunk65GNHOD4cjs.updateTypeLayer.call(void 0,
7453
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7454
+ const [start, end] = _chunkYAFS2QFZcjs.textRange.call(void 0, layer.text, range.start, range.end);
7455
+ if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one paragraph field to set.");
7456
+ _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, {}, style);
7457
+ const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7430
7458
  this.state.layers,
7431
7459
  id,
7432
7460
  (l) => {
@@ -7435,7 +7463,7 @@ var ImageEditorController = (_class7 = class {
7435
7463
  const a = at;
7436
7464
  at += p.length;
7437
7465
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
7438
- return touches || !l.text.length ? { length: p.length, style: _chunk65GNHOD4cjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7466
+ return touches || !l.text.length ? { length: p.length, style: _chunkYAFS2QFZcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7439
7467
  });
7440
7468
  return { paragraphs };
7441
7469
  },
@@ -7451,21 +7479,21 @@ var ImageEditorController = (_class7 = class {
7451
7479
  * paragraph. Also resizes a box. One undo step.
7452
7480
  */
7453
7481
  setTextFrame(id, frame, commitToHistory = true) {
7454
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7455
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("width and height must be at least 1 pixel.");
7456
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("kind must be point or box.");
7482
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7483
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("width and height must be at least 1 pixel.");
7484
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("kind must be point or box.");
7457
7485
  const shaper = this.getTextShaper();
7458
- const { layers } = _chunk65GNHOD4cjs.updateTypeLayer.call(void 0,
7486
+ const { layers } = _chunkYAFS2QFZcjs.updateTypeLayer.call(void 0,
7459
7487
  this.state.layers,
7460
7488
  id,
7461
7489
  (l) => {
7462
7490
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
7463
- if (!shaper) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7464
- const lines = _chunkF7GGEAO2cjs.layoutText.call(void 0, l, shaper).lines;
7491
+ if (!shaper) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7492
+ const lines = _chunkZ2H7KECKcjs.layoutText.call(void 0, l, shaper).lines;
7465
7493
  const first = lines[0];
7466
7494
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
7467
7495
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
7468
- const m = _chunk65GNHOD4cjs.textMatrix.call(void 0, l);
7496
+ const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, l);
7469
7497
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
7470
7498
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
7471
7499
  return { frame: nextFrame, transform: shifted };
@@ -7482,21 +7510,21 @@ var ImageEditorController = (_class7 = class {
7482
7510
  * `warnings` says when other colours were dropped. One undo step.
7483
7511
  */
7484
7512
  convertTextToShape(id) {
7485
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7486
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7513
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7514
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7487
7515
  const shaper = this.getTextShaper();
7488
- if (!shaper) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7489
- const parts = _chunk65GNHOD4cjs.textOutlines.call(void 0, layer, shaper);
7490
- const subpaths = parts.flatMap((p) => _chunkF7GGEAO2cjs.bezierToSubpaths.call(void 0, p.path));
7491
- if (!subpaths.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7516
+ if (!shaper) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7517
+ const parts = _chunkYAFS2QFZcjs.textOutlines.call(void 0, layer, shaper);
7518
+ const subpaths = parts.flatMap((p) => _chunkZ2H7KECKcjs.bezierToSubpaths.call(void 0, p.path));
7519
+ if (!subpaths.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7492
7520
  const warnings = [];
7493
7521
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
7494
7522
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
7495
- const missing = _chunkF7GGEAO2cjs.layoutText.call(void 0, layer, shaper).missingFonts;
7523
+ const missing = _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper).missingFonts;
7496
7524
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
7497
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE));
7525
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE));
7498
7526
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
7499
- const shape = _chunk65GNHOD4cjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7527
+ const shape = _chunkYAFS2QFZcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7500
7528
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
7501
7529
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
7502
7530
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -7504,23 +7532,23 @@ var ImageEditorController = (_class7 = class {
7504
7532
  }
7505
7533
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
7506
7534
  getTextLayout(id) {
7507
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7535
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7508
7536
  const shaper = this.getTextShaper();
7509
- return shaper ? _chunkF7GGEAO2cjs.layoutText.call(void 0, layer, shaper) : null;
7537
+ return shaper ? _chunkZ2H7KECKcjs.layoutText.call(void 0, layer, shaper) : null;
7510
7538
  }
7511
7539
  /** The text index nearest a document point (for clicks on a type layer). */
7512
7540
  textIndexAt(id, point) {
7513
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7541
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7514
7542
  const layout = this.getTextLayout(id);
7515
- return layout ? _chunkF7GGEAO2cjs.textIndexAt.call(void 0, layout, _chunk65GNHOD4cjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7543
+ return layout ? _chunkZ2H7KECKcjs.textIndexAt.call(void 0, layout, _chunkYAFS2QFZcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7516
7544
  }
7517
7545
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
7518
7546
  textCaret(id, index) {
7519
- const layer = _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7547
+ const layer = _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7520
7548
  const layout = this.getTextLayout(id);
7521
7549
  if (!layout) return null;
7522
- const c = _chunkF7GGEAO2cjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7523
- const m = _chunk65GNHOD4cjs.textMatrix.call(void 0, layer);
7550
+ const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7551
+ const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
7524
7552
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
7525
7553
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
7526
7554
  }
@@ -7531,14 +7559,14 @@ var ImageEditorController = (_class7 = class {
7531
7559
  }
7532
7560
  /** One component from tool or UI input (validated). */
7533
7561
  componentFrom(spec, path) {
7534
- const op = _chunk65GNHOD4cjs.requireOperation.call(void 0, spec.op, `${path}op`);
7535
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7536
- if (spec.shape !== void 0) return _chunk65GNHOD4cjs.liveComponent.call(void 0, _chunk65GNHOD4cjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7537
- if (spec.subpaths !== void 0) return { op, subpaths: _chunk65GNHOD4cjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7538
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7562
+ const op = _chunkYAFS2QFZcjs.requireOperation.call(void 0, spec.op, `${path}op`);
7563
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7564
+ if (spec.shape !== void 0) return _chunkYAFS2QFZcjs.liveComponent.call(void 0, _chunkYAFS2QFZcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7565
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkYAFS2QFZcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7566
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7539
7567
  }
7540
7568
  shapeInfo(id) {
7541
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7569
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7542
7570
  const r = (n) => Math.round(n * 1e3) / 1e3;
7543
7571
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
7544
7572
  const info = {
@@ -7548,13 +7576,13 @@ var ImageEditorController = (_class7 = class {
7548
7576
  index,
7549
7577
  op: c.op,
7550
7578
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
7551
- subpaths: _chunkF7GGEAO2cjs.roundSubpaths.call(void 0, c.subpaths),
7552
- bounds: box(_chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7579
+ subpaths: _chunkZ2H7KECKcjs.roundSubpaths.call(void 0, c.subpaths),
7580
+ bounds: box(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7553
7581
  })),
7554
7582
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
7555
7583
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
7556
7584
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
7557
- geometryBounds: box(_chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, layer)),
7585
+ geometryBounds: box(_chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer)),
7558
7586
  bounds: this.getLayerBounds(id)
7559
7587
  };
7560
7588
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -7571,17 +7599,17 @@ var ImageEditorController = (_class7 = class {
7571
7599
  */
7572
7600
  addShapeLayer(init) {
7573
7601
  const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
7574
- if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7602
+ if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7575
7603
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
7576
- const stroke = init.stroke ? _chunk65GNHOD4cjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7604
+ const stroke = init.stroke ? _chunkYAFS2QFZcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7577
7605
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
7578
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunk65GNHOD4cjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunk65GNHOD4cjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7579
- if (!fill && !stroke) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7580
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7581
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("opacity must be between 0 and 1.");
7582
- if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7583
- const layer = _chunk65GNHOD4cjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7584
- const next = _chunk65GNHOD4cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7606
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7607
+ if (!fill && !stroke) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7608
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7609
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("opacity must be between 0 and 1.");
7610
+ if (init.blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7611
+ const layer = _chunkYAFS2QFZcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7612
+ const next = _chunkYAFS2QFZcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7585
7613
  this.commitLayers(next, () => {
7586
7614
  this.state.activeLayerId = layer.id;
7587
7615
  this.state.activeTarget = "pixels";
@@ -7594,18 +7622,18 @@ var ImageEditorController = (_class7 = class {
7594
7622
  * only those settings of the current stroke. Returns the shape.
7595
7623
  */
7596
7624
  setShapeStyle(id, changes, commitToHistory = true) {
7597
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7598
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunk65GNHOD4cjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7599
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunk65GNHOD4cjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7600
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7625
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7626
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkYAFS2QFZcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7627
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkYAFS2QFZcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7628
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7601
7629
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7602
- const { layers } = _chunk65GNHOD4cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7630
+ const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7603
7631
  this.commitLayers(layers, void 0, commitToHistory);
7604
7632
  return this.shapeInfo(id);
7605
7633
  }
7606
7634
  componentIndex(layer, index) {
7607
7635
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7608
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7636
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7609
7637
  }
7610
7638
  return index;
7611
7639
  }
@@ -7615,36 +7643,36 @@ var ImageEditorController = (_class7 = class {
7615
7643
  * the live shape) or its operation. Returns the shape.
7616
7644
  */
7617
7645
  setShapeComponent(id, index, change, commitToHistory = true) {
7618
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7646
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7619
7647
  const i = this.componentIndex(layer, index);
7620
7648
  const current = layer.components[i];
7621
7649
  let shape = change.shape;
7622
7650
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7623
7651
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7624
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunk65GNHOD4cjs.requireOperation.call(void 0, change.op) };
7652
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkYAFS2QFZcjs.requireOperation.call(void 0, change.op) };
7625
7653
  const components = layer.components.map((c, k) => k === i ? next : c);
7626
- const { layers } = _chunk65GNHOD4cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7654
+ const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7627
7655
  this.commitLayers(layers, void 0, commitToHistory);
7628
7656
  return this.shapeInfo(id);
7629
7657
  }
7630
7658
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7631
7659
  addShapeComponent(id, spec, index) {
7632
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7660
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7633
7661
  const c = this.componentFrom(spec, "");
7634
7662
  const at = index === void 0 ? layer.components.length : index;
7635
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7663
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7636
7664
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7637
- const { layers } = _chunk65GNHOD4cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7665
+ const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7638
7666
  this.commitLayers(layers);
7639
7667
  return this.shapeInfo(id);
7640
7668
  }
7641
7669
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7642
7670
  removeShapeComponent(id, index) {
7643
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7671
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7644
7672
  const i = this.componentIndex(layer, index);
7645
- if (layer.components.length === 1) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7673
+ if (layer.components.length === 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7646
7674
  const components = layer.components.filter((_, k) => k !== i);
7647
- const { layers } = _chunk65GNHOD4cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7675
+ const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7648
7676
  this.commitLayers(layers);
7649
7677
  return this.shapeInfo(id);
7650
7678
  }
@@ -7653,10 +7681,10 @@ var ImageEditorController = (_class7 = class {
7653
7681
  * shapes become paths), as one undo step. Returns the shape.
7654
7682
  */
7655
7683
  mergeShapeComponents(id) {
7656
- const layer = _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7657
- if (layer.components.length < 2) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7658
- const components = _chunk65GNHOD4cjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7659
- const { layers } = _chunk65GNHOD4cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7684
+ const layer = _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7685
+ if (layer.components.length < 2) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7686
+ const components = _chunkYAFS2QFZcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7687
+ const { layers } = _chunkYAFS2QFZcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7660
7688
  this.commitLayers(layers);
7661
7689
  return this.shapeInfo(id);
7662
7690
  }
@@ -7666,8 +7694,8 @@ var ImageEditorController = (_class7 = class {
7666
7694
  * step. Returns the layer id.
7667
7695
  */
7668
7696
  async rasterizeLayer(id) {
7669
- const layer = _chunk65GNHOD4cjs.requireLayer.call(void 0, this.state.layers, id).layer;
7670
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7697
+ const layer = _chunkYAFS2QFZcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7698
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7671
7699
  const { width, height } = this.naturalSize;
7672
7700
  const canvas = { x: 0, y: 0, width, height };
7673
7701
  let next;
@@ -7683,8 +7711,8 @@ var ImageEditorController = (_class7 = class {
7683
7711
  if (layer.locks) next.locks = layer.locks;
7684
7712
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7685
7713
  } else if (layer.type === "pixel") {
7686
- if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7687
- _chunk65GNHOD4cjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7714
+ if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7715
+ _chunkYAFS2QFZcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7688
7716
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7689
7717
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7690
7718
  delete content.mask;
@@ -7701,10 +7729,10 @@ var ImageEditorController = (_class7 = class {
7701
7729
  } else if (layer.type === "smart") {
7702
7730
  return this.rasterizeSmartObject(id);
7703
7731
  } else if (layer.type === "shape" || layer.type === "type") {
7704
- next = layer.type === "shape" ? _chunk65GNHOD4cjs.shapeAsPixelLayer.call(void 0, layer) : _chunk65GNHOD4cjs.typeAsPixelLayer.call(void 0, layer);
7732
+ next = layer.type === "shape" ? _chunkYAFS2QFZcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkYAFS2QFZcjs.typeAsPixelLayer.call(void 0, layer);
7705
7733
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
7706
7734
  } else {
7707
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7735
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
7708
7736
  }
7709
7737
  this.commitLayers(_chunk24ATT2PEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7710
7738
  return id;
@@ -7729,7 +7757,7 @@ var ImageEditorController = (_class7 = class {
7729
7757
  setColorMode(mode, options = {}) {
7730
7758
  let next;
7731
7759
  if (mode === "rgb") {
7732
- if (options.profile !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7760
+ if (options.profile !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7733
7761
  next = null;
7734
7762
  } else if (mode === "lab") next = { mode: "lab" };
7735
7763
  else if (mode === "cmyk") {
@@ -7737,14 +7765,14 @@ var ImageEditorController = (_class7 = class {
7737
7765
  try {
7738
7766
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7739
7767
  } catch (e) {
7740
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7768
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7741
7769
  }
7742
7770
  const cs = resolveProfile(doc).colorSpace;
7743
- if (cs !== "cmyk") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7771
+ if (cs !== "cmyk") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7744
7772
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7745
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7773
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7746
7774
  next = { mode: "cmyk", profile: doc, intent };
7747
- } else throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7775
+ } else throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7748
7776
  this.recordHistory();
7749
7777
  if (next) this.state.colorMode = next;
7750
7778
  else delete this.state.colorMode;
@@ -7757,10 +7785,10 @@ var ImageEditorController = (_class7 = class {
7757
7785
  try {
7758
7786
  doc = documentProfile(profile);
7759
7787
  } catch (e) {
7760
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7788
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7761
7789
  }
7762
7790
  const cs = resolveProfile(doc).colorSpace;
7763
- if (cs !== "rgb") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7791
+ if (cs !== "rgb") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7764
7792
  return doc;
7765
7793
  }
7766
7794
  /**
@@ -7786,7 +7814,7 @@ var ImageEditorController = (_class7 = class {
7786
7814
  convertToProfile(profile, options = {}) {
7787
7815
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7788
7816
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7789
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7817
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7790
7818
  const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7791
7819
  const converted = [];
7792
7820
  const unconverted = [];
@@ -7816,11 +7844,11 @@ var ImageEditorController = (_class7 = class {
7816
7844
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
7817
7845
  else if (l.type === "shape") {
7818
7846
  const s = next2;
7819
- next2 = _chunk65GNHOD4cjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7847
+ next2 = _chunkYAFS2QFZcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7820
7848
  } else if (l.type === "type") {
7821
7849
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
7822
7850
  try {
7823
- next2 = _chunk65GNHOD4cjs.rerenderText.call(void 0, recoloured, textEnv);
7851
+ next2 = _chunkYAFS2QFZcjs.rerenderText.call(void 0, recoloured, textEnv);
7824
7852
  } catch (e27) {
7825
7853
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
7826
7854
  }
@@ -7850,12 +7878,12 @@ var ImageEditorController = (_class7 = class {
7850
7878
  try {
7851
7879
  doc = documentProfile(setup.profile);
7852
7880
  } catch (e) {
7853
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7881
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7854
7882
  }
7855
7883
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7856
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7884
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7857
7885
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7858
- if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7886
+ if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7859
7887
  this.state.proofSetup = next;
7860
7888
  this.notify();
7861
7889
  return next;
@@ -7872,14 +7900,14 @@ var ImageEditorController = (_class7 = class {
7872
7900
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7873
7901
  dst = resolveProfile(documentProfile(to));
7874
7902
  } catch (e) {
7875
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7903
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7876
7904
  }
7877
- if (src.colorSpace !== "rgb") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7905
+ if (src.colorSpace !== "rgb") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7878
7906
  const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7879
7907
  const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7880
7908
  return colors.map((input) => {
7881
7909
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7882
- if (!m) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7910
+ if (!m) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7883
7911
  const n = parseInt(m[1], 16);
7884
7912
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7885
7913
  const out = new Float32Array(16);
@@ -7905,7 +7933,7 @@ var ImageEditorController = (_class7 = class {
7905
7933
  * the ids of the layers whose pixels changed.
7906
7934
  */
7907
7935
  setBitDepth(depth) {
7908
- if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7936
+ if (!_chunkJ5BA3BQ6cjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7909
7937
  const changed = [];
7910
7938
  const withMask = (l) => {
7911
7939
  const m = l.mask;
@@ -7954,7 +7982,7 @@ var ImageEditorController = (_class7 = class {
7954
7982
  * Throws `PsdError` for files that cannot be read at all.
7955
7983
  */
7956
7984
  loadPsd(bytes) {
7957
- const result = _chunk65GNHOD4cjs.importPsd.call(void 0, bytes, { newId: () => _chunk65GNHOD4cjs.newLayerId.call(void 0, ) });
7985
+ const result = _chunkYAFS2QFZcjs.importPsd.call(void 0, bytes, { newId: () => _chunkYAFS2QFZcjs.newLayerId.call(void 0, ) });
7958
7986
  this.abandonContents();
7959
7987
  this.recordHistory();
7960
7988
  const s = this.state;
@@ -7964,7 +7992,7 @@ var ImageEditorController = (_class7 = class {
7964
7992
  if (!this.samplePixelsOverride) this.samplePixels = null;
7965
7993
  s.layers = this.checkPsdFonts(result);
7966
7994
  s.crop = null;
7967
- s.transform = { ..._chunk65GNHOD4cjs.DEFAULT_TRANSFORM_VALUES };
7995
+ s.transform = { ..._chunkYAFS2QFZcjs.DEFAULT_TRANSFORM_VALUES };
7968
7996
  s.outputOpacity = 1;
7969
7997
  delete s.legacyOutputBlur;
7970
7998
  s.selection = null;
@@ -8015,7 +8043,7 @@ var ImageEditorController = (_class7 = class {
8015
8043
  let layers = result.layers;
8016
8044
  const missing = /* @__PURE__ */ new Map();
8017
8045
  for (const l of types) {
8018
- const fonts = shaper ? _chunkF7GGEAO2cjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8046
+ const fonts = shaper ? _chunkZ2H7KECKcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8019
8047
  if (!fonts.length) continue;
8020
8048
  layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
8021
8049
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
@@ -8043,7 +8071,7 @@ var ImageEditorController = (_class7 = class {
8043
8071
  const canRasterize = this.renderer.canRasterize();
8044
8072
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
8045
8073
  const sources = this.renderer.compositorSources(width, height);
8046
- const compositor = new (0, _chunk65GNHOD4cjs.LayerCompositor)();
8074
+ const compositor = new (0, _chunkYAFS2QFZcjs.LayerCompositor)();
8047
8075
  const bakeMask = (layer) => {
8048
8076
  const mask = layer.mask;
8049
8077
  if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
@@ -8125,7 +8153,7 @@ var ImageEditorController = (_class7 = class {
8125
8153
  out.surface = this.surfaceOf(layer);
8126
8154
  delete out.source;
8127
8155
  }
8128
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunk65GNHOD4cjs.isActiveFilter)]), () => ( []));
8156
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkYAFS2QFZcjs.isActiveFilter)]), () => ( []));
8129
8157
  if (active.length) {
8130
8158
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
8131
8159
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -8158,8 +8186,8 @@ var ImageEditorController = (_class7 = class {
8158
8186
  const color = this.psdColorOptions(warnings);
8159
8187
  if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
8160
8188
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
8161
- const mergedDeep = depth === 8 ? void 0 : _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunk65GNHOD4cjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8162
- const result = _chunk65GNHOD4cjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8189
+ const mergedDeep = depth === 8 ? void 0 : _chunk24ATT2PEcjs.workingToSamples.call(void 0, _chunkYAFS2QFZcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8190
+ const result = _chunkYAFS2QFZcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8163
8191
  warnings.push(...result.warnings);
8164
8192
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
8165
8193
  }
@@ -8175,13 +8203,13 @@ var ImageEditorController = (_class7 = class {
8175
8203
  if (!this.samplePixelsOverride) this.samplePixels = null;
8176
8204
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
8177
8205
  this.state.selection = normalizeSelection(
8178
- _chunk65GNHOD4cjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8206
+ _chunkYAFS2QFZcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8179
8207
  );
8180
8208
  }
8181
8209
  let layers = this.state.layers;
8182
8210
  if (sx !== 1 || sy !== 1) {
8183
8211
  if (this.state.crop) {
8184
- this.state.crop = _chunk65GNHOD4cjs.clampCropToImage.call(void 0,
8212
+ this.state.crop = _chunkYAFS2QFZcjs.clampCropToImage.call(void 0,
8185
8213
  {
8186
8214
  x: Math.round(this.state.crop.x * sx),
8187
8215
  y: Math.round(this.state.crop.y * sy),
@@ -8200,17 +8228,17 @@ var ImageEditorController = (_class7 = class {
8200
8228
  } else if (l.type === "shape") {
8201
8229
  const a = l.annotation;
8202
8230
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
8203
- const fromAnnotation = scaled ? _chunk65GNHOD4cjs.shapeFromAnnotation.call(void 0, scaled) : null;
8231
+ const fromAnnotation = scaled ? _chunkYAFS2QFZcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8204
8232
  const m = [sx, 0, 0, sy, 0, 0];
8205
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunk65GNHOD4cjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8233
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkYAFS2QFZcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8206
8234
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
8207
8235
  if (scaled && fromAnnotation) moved.annotation = scaled;
8208
8236
  else delete moved.annotation;
8209
- layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => _chunk65GNHOD4cjs.rerenderShape.call(void 0, moved, env));
8237
+ layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkYAFS2QFZcjs.rerenderShape.call(void 0, moved, env));
8210
8238
  }
8211
8239
  }
8212
8240
  }
8213
- const bg = _chunk65GNHOD4cjs.developTarget.call(void 0, layers, null);
8241
+ const bg = _chunkYAFS2QFZcjs.developTarget.call(void 0, layers, null);
8214
8242
  if (bg && bg.source !== "document") layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
8215
8243
  if (clearAnnotations) {
8216
8244
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunk24ATT2PEcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -8231,7 +8259,7 @@ var ImageEditorController = (_class7 = class {
8231
8259
  let out;
8232
8260
  try {
8233
8261
  out = this.serializeState();
8234
- if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunk65GNHOD4cjs.serializeSelection.call(void 0, this.state.selection);
8262
+ if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkYAFS2QFZcjs.serializeSelection.call(void 0, this.state.selection);
8235
8263
  } finally {
8236
8264
  if (root) {
8237
8265
  this.state = current;
@@ -8239,8 +8267,8 @@ var ImageEditorController = (_class7 = class {
8239
8267
  this.viewKey = [];
8240
8268
  }
8241
8269
  }
8242
- if (!options || out.version !== _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8243
- return _chunk65GNHOD4cjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8270
+ if (!options || out.version !== _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8271
+ return _chunkYAFS2QFZcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8244
8272
  }
8245
8273
  /**
8246
8274
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -8248,12 +8276,12 @@ var ImageEditorController = (_class7 = class {
8248
8276
  * out and listed in `lastLoadProblems`.
8249
8277
  */
8250
8278
  async loadJSONAsync(data, options = {}) {
8251
- if (data.version !== _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8279
+ if (data.version !== _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8252
8280
  this.loadJSON(data);
8253
8281
  return;
8254
8282
  }
8255
8283
  const problems = [];
8256
- const assets = await _chunk65GNHOD4cjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8284
+ const assets = await _chunkYAFS2QFZcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8257
8285
  this.loadJSON({ ...data, assets });
8258
8286
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
8259
8287
  }
@@ -8265,7 +8293,7 @@ var ImageEditorController = (_class7 = class {
8265
8293
  let selection = null;
8266
8294
  if (data.selection) {
8267
8295
  try {
8268
- selection = normalizeSelection(_chunk65GNHOD4cjs.deserializeSelection.call(void 0, data.selection));
8296
+ selection = normalizeSelection(_chunkYAFS2QFZcjs.deserializeSelection.call(void 0, data.selection));
8269
8297
  } catch (e28) {
8270
8298
  selection = null;
8271
8299
  }
@@ -8283,8 +8311,8 @@ var ImageEditorController = (_class7 = class {
8283
8311
  if (isLayered(data)) {
8284
8312
  const problems = [];
8285
8313
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
8286
- const storedPatterns = _chunk65GNHOD4cjs.deserializePatterns.call(void 0, data.patterns, []);
8287
- s.layers = _chunk65GNHOD4cjs.deserializeLayers.call(void 0, data.layers, {
8314
+ const storedPatterns = _chunkYAFS2QFZcjs.deserializePatterns.call(void 0, data.patterns, []);
8315
+ s.layers = _chunkYAFS2QFZcjs.deserializeLayers.call(void 0, data.layers, {
8288
8316
  assets: _nullishCoalesce(data.assets, () => ( {})),
8289
8317
  problems,
8290
8318
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -8302,7 +8330,7 @@ var ImageEditorController = (_class7 = class {
8302
8330
  const light = data.globalLight;
8303
8331
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
8304
8332
  else delete s.globalLight;
8305
- const patterns = _chunk65GNHOD4cjs.deserializePatterns.call(void 0, data.patterns, problems);
8333
+ const patterns = _chunkYAFS2QFZcjs.deserializePatterns.call(void 0, data.patterns, problems);
8306
8334
  if (patterns.length) s.patterns = patterns;
8307
8335
  else delete s.patterns;
8308
8336
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -8318,7 +8346,7 @@ var ImageEditorController = (_class7 = class {
8318
8346
  }
8319
8347
  } else {
8320
8348
  const { width, height } = this.naturalSize;
8321
- const stack = _chunk65GNHOD4cjs.layersFromLegacy.call(void 0, data, width, height);
8349
+ const stack = _chunkYAFS2QFZcjs.layersFromLegacy.call(void 0, data, width, height);
8322
8350
  s.layers = stack.layers;
8323
8351
  s.outputOpacity = stack.outputOpacity;
8324
8352
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -8339,7 +8367,7 @@ var ImageEditorController = (_class7 = class {
8339
8367
  }
8340
8368
  serializeState() {
8341
8369
  const { width, height } = this.naturalSize;
8342
- const view = _chunk65GNHOD4cjs.legacyView.call(void 0, this.stack(), width, height, null);
8370
+ const view = _chunkYAFS2QFZcjs.legacyView.call(void 0, this.stack(), width, height, null);
8343
8371
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
8344
8372
  return {
8345
8373
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -8354,9 +8382,9 @@ var ImageEditorController = (_class7 = class {
8354
8382
  annotations: JSON.parse(JSON.stringify(view.annotations))
8355
8383
  };
8356
8384
  }
8357
- const { layers, assets, smartContents } = _chunk65GNHOD4cjs.serializeLayers.call(void 0, this.state.layers);
8385
+ const { layers, assets, smartContents } = _chunkYAFS2QFZcjs.serializeLayers.call(void 0, this.state.layers);
8358
8386
  const out = {
8359
- version: _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION,
8387
+ version: _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION,
8360
8388
  width,
8361
8389
  height,
8362
8390
  layers,
@@ -8368,7 +8396,7 @@ var ImageEditorController = (_class7 = class {
8368
8396
  };
8369
8397
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
8370
8398
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
8371
- if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunk65GNHOD4cjs.serializePatterns.call(void 0, this.state.patterns);
8399
+ if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkYAFS2QFZcjs.serializePatterns.call(void 0, this.state.patterns);
8372
8400
  if (smartContents) out.smartContents = smartContents;
8373
8401
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
8374
8402
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -8380,7 +8408,7 @@ function serializeAdjustments(adjustments) {
8380
8408
  const out = { ...adjustments };
8381
8409
  if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
8382
8410
  else delete out.layers;
8383
- if (_chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, out.process) === _chunk65GNHOD4cjs.LEGACY_PROCESS_VERSION) {
8411
+ if (_chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkYAFS2QFZcjs.LEGACY_PROCESS_VERSION) {
8384
8412
  delete out.process;
8385
8413
  if (!out.tint) delete out.tint;
8386
8414
  }
@@ -8391,7 +8419,7 @@ function withDevelop(layer, partial) {
8391
8419
  let i = filters.findIndex((f) => f.kind === "develop");
8392
8420
  if (i === -1) {
8393
8421
  filters.unshift({
8394
- id: layer.source === "document" ? _chunk65GNHOD4cjs.DEVELOP_FILTER_ID : _chunk65GNHOD4cjs.newLayerId.call(void 0, "flt"),
8422
+ id: layer.source === "document" ? _chunkYAFS2QFZcjs.DEVELOP_FILTER_ID : _chunkYAFS2QFZcjs.newLayerId.call(void 0, "flt"),
8395
8423
  kind: "develop",
8396
8424
  enabled: true,
8397
8425
  brightness: 0,
@@ -8400,7 +8428,7 @@ function withDevelop(layer, partial) {
8400
8428
  exposure: 0,
8401
8429
  temperature: 0,
8402
8430
  tint: 0,
8403
- process: _chunk65GNHOD4cjs.LATEST_PROCESS_VERSION
8431
+ process: _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION
8404
8432
  });
8405
8433
  i = 0;
8406
8434
  }
@@ -8409,7 +8437,7 @@ function withDevelop(layer, partial) {
8409
8437
  const v = partial[k];
8410
8438
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
8411
8439
  }
8412
- if ("process" in partial) next.process = _chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, partial.process);
8440
+ if ("process" in partial) next.process = _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, partial.process);
8413
8441
  filters[i] = next;
8414
8442
  return { ...layer, filters };
8415
8443
  }
@@ -8418,7 +8446,7 @@ function withBlur(layer, radius) {
8418
8446
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
8419
8447
  if (radius > 0) {
8420
8448
  filters.push({
8421
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunk65GNHOD4cjs.BLUR_FILTER_ID : _chunk65GNHOD4cjs.newLayerId.call(void 0, "flt")))),
8449
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkYAFS2QFZcjs.BLUR_FILTER_ID : _chunkYAFS2QFZcjs.newLayerId.call(void 0, "flt")))),
8422
8450
  kind: "blur",
8423
8451
  enabled: true,
8424
8452
  radius
@@ -8442,7 +8470,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8442
8470
  if (!update.mask) delete next.mask;
8443
8471
  else {
8444
8472
  const current = node.mask && !node.mask.source ? node.mask : null;
8445
- const memo = current ? _chunk65GNHOD4cjs.legacyMaskOf.call(void 0, current, width, height) : null;
8473
+ const memo = current ? _chunkYAFS2QFZcjs.legacyMaskOf.call(void 0, current, width, height) : null;
8446
8474
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
8447
8475
  next.mask = withMaskProps(current, {
8448
8476
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -8450,7 +8478,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8450
8478
  enabled: update.mask.enabled !== false
8451
8479
  });
8452
8480
  } else {
8453
- const m = _chunk65GNHOD4cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8481
+ const m = _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8454
8482
  if (m) next.mask = m;
8455
8483
  else delete next.mask;
8456
8484
  }
@@ -8489,7 +8517,7 @@ function resizeLegacyMasks(layers, from, to) {
8489
8517
  for (const l of _chunk24ATT2PEcjs.flattenLayers.call(void 0, layers)) {
8490
8518
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
8491
8519
  const old = l.mask;
8492
- const mask = _chunk65GNHOD4cjs.rasterMaskFromLegacy.call(void 0, _chunk65GNHOD4cjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8520
+ const mask = _chunkYAFS2QFZcjs.rasterMaskFromLegacy.call(void 0, _chunkYAFS2QFZcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8493
8521
  if (!mask) continue;
8494
8522
  out = _chunk24ATT2PEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
8495
8523
  }
@@ -8585,12 +8613,12 @@ function withoutAnnotations(layers) {
8585
8613
  function parseColor(value) {
8586
8614
  if (Array.isArray(value)) {
8587
8615
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
8588
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8616
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8589
8617
  }
8590
8618
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
8591
8619
  }
8592
8620
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
8593
- if (!m) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8621
+ if (!m) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8594
8622
  let hex = m[1];
8595
8623
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
8596
8624
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8600,7 +8628,7 @@ function readImagePaint(raw) {
8600
8628
  try {
8601
8629
  return _chunk6GFRKLLScjs.parsePaintSource.call(void 0, raw);
8602
8630
  } catch (e) {
8603
- if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(e.message);
8631
+ if (e instanceof _chunk6GFRKLLScjs.PaintSourceError) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(e.message);
8604
8632
  throw e;
8605
8633
  }
8606
8634
  }
@@ -8748,7 +8776,7 @@ function loadImageEditorDocument(input) {
8748
8776
  // Optional: only present when something was selected when saving.
8749
8777
  selection: {
8750
8778
  parse: (value) => {
8751
- const mask = _chunk65GNHOD4cjs.deserializeSelection.call(void 0, value);
8779
+ const mask = _chunkYAFS2QFZcjs.deserializeSelection.call(void 0, value);
8752
8780
  const v = value;
8753
8781
  return { width: mask.width, height: mask.height, rle: v.rle };
8754
8782
  },
@@ -8836,7 +8864,7 @@ function loadLayeredDocument(doc) {
8836
8864
  },
8837
8865
  selection: {
8838
8866
  parse: (value) => {
8839
- const mask = _chunk65GNHOD4cjs.deserializeSelection.call(void 0, value);
8867
+ const mask = _chunkYAFS2QFZcjs.deserializeSelection.call(void 0, value);
8840
8868
  const v = value;
8841
8869
  return { width: mask.width, height: mask.height, rle: v.rle };
8842
8870
  },
@@ -9230,14 +9258,14 @@ function describeSelection(mask) {
9230
9258
  // src/image-editor/selection-tools.ts
9231
9259
  var modeSchema = {
9232
9260
  type: "string",
9233
- enum: [..._chunk65GNHOD4cjs.SELECTION_MODES],
9261
+ enum: [..._chunkYAFS2QFZcjs.SELECTION_MODES],
9234
9262
  description: "How the result combines with the current selection (default replace)."
9235
9263
  };
9236
9264
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
9237
9265
  function summary(controller) {
9238
9266
  const sel = controller.getSelection();
9239
9267
  const { width, height } = controller.getState().imageDimensions;
9240
- const area = _chunk65GNHOD4cjs.selectionArea.call(void 0, sel);
9268
+ const area = _chunkYAFS2QFZcjs.selectionArea.call(void 0, sel);
9241
9269
  return {
9242
9270
  empty: !sel,
9243
9271
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
@@ -9283,7 +9311,7 @@ function createImageSelectionTools(controller) {
9283
9311
  },
9284
9312
  annotations: writeAnnotations("Select a region", true),
9285
9313
  handler: ({ shape, x, y, width, height, mode, feather }) => {
9286
- const opts = { mode: _chunk65GNHOD4cjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9314
+ const opts = { mode: _chunkYAFS2QFZcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9287
9315
  switch (shape) {
9288
9316
  case "all":
9289
9317
  controller.selectAll();
@@ -9336,7 +9364,7 @@ function createImageSelectionTools(controller) {
9336
9364
  annotations: writeAnnotations("Select by colour", true),
9337
9365
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
9338
9366
  const common = {
9339
- mode: _chunk65GNHOD4cjs.parseSelectionMode.call(void 0, mode),
9367
+ mode: _chunkYAFS2QFZcjs.parseSelectionMode.call(void 0, mode),
9340
9368
  sampleMerged: sampleMerged === true,
9341
9369
  sample: _nullishCoalesce(sample, () => ( "composite"))
9342
9370
  };
@@ -9357,7 +9385,7 @@ function createImageSelectionTools(controller) {
9357
9385
  inputSchema: {
9358
9386
  type: "object",
9359
9387
  properties: {
9360
- op: { type: "string", enum: [..._chunk65GNHOD4cjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9388
+ op: { type: "string", enum: [..._chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9361
9389
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
9362
9390
  },
9363
9391
  required: ["op", "radius"],
@@ -9365,7 +9393,7 @@ function createImageSelectionTools(controller) {
9365
9393
  },
9366
9394
  annotations: writeAnnotations("Modify the selection"),
9367
9395
  handler: ({ op, radius }) => {
9368
- if (!_chunk65GNHOD4cjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9396
+ if (!_chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9369
9397
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
9370
9398
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
9371
9399
  return summary(controller);
@@ -9409,7 +9437,7 @@ function createImageSelectionTools(controller) {
9409
9437
  type: "object",
9410
9438
  properties: {
9411
9439
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
9412
- kind: { type: "string", enum: _chunk65GNHOD4cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9440
+ kind: { type: "string", enum: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9413
9441
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
9414
9442
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
9415
9443
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -9429,11 +9457,11 @@ function createImageSelectionTools(controller) {
9429
9457
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
9430
9458
  controller.applySelectionAsLayerMask(layerId, props);
9431
9459
  id = layerId;
9432
- } else if (_chunk65GNHOD4cjs.isAdjustmentKind.call(void 0, kind)) {
9460
+ } else if (_chunkYAFS2QFZcjs.isAdjustmentKind.call(void 0, kind)) {
9433
9461
  id = controller.addAdjustmentLayer({
9434
9462
  kind,
9435
9463
  params,
9436
- mask: _chunk65GNHOD4cjs.layerMaskFromSelection.call(void 0, sel, props)
9464
+ mask: _chunkYAFS2QFZcjs.layerMaskFromSelection.call(void 0, sel, props)
9437
9465
  });
9438
9466
  } else {
9439
9467
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -9570,11 +9598,11 @@ function createImageEditTools(controller) {
9570
9598
  const geometry2 = () => {
9571
9599
  const s = controller.getState();
9572
9600
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
9573
- const out = _chunk65GNHOD4cjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9601
+ const out = _chunkYAFS2QFZcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9574
9602
  return {
9575
9603
  image: { ...s.imageDimensions },
9576
9604
  crop: s.crop ? { ...s.crop } : null,
9577
- rotation: _chunk65GNHOD4cjs.normalizeAngle.call(void 0, s.transform.rotate),
9605
+ rotation: _chunkYAFS2QFZcjs.normalizeAngle.call(void 0, s.transform.rotate),
9578
9606
  flipH: s.transform.flipH,
9579
9607
  flipV: s.transform.flipV,
9580
9608
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9809,7 +9837,7 @@ function describeLayer(layer, activeId, boundsOf) {
9809
9837
  const out = {
9810
9838
  id: layer.id,
9811
9839
  type: layer.type,
9812
- name: layer.name || (layer.type === "adjustment" ? _chunk65GNHOD4cjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9840
+ name: layer.name || (layer.type === "adjustment" ? _chunkYAFS2QFZcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9813
9841
  visible: layer.visible,
9814
9842
  opacity: round3(layer.opacity),
9815
9843
  blend: layer.blend,
@@ -9898,8 +9926,8 @@ function createImageLayerTools(controller) {
9898
9926
  };
9899
9927
  };
9900
9928
  const exists = (id, what = "layerId") => {
9901
- if (typeof id !== "string" || !id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9902
- _chunk65GNHOD4cjs.requireLayer.call(void 0, controller.getLayers(), id);
9929
+ if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9930
+ _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id);
9903
9931
  return id;
9904
9932
  };
9905
9933
  const listLayers = {
@@ -9935,7 +9963,7 @@ function createImageLayerTools(controller) {
9935
9963
  handler: ({ layerId, target }) => {
9936
9964
  const id = exists(layerId);
9937
9965
  const layer = controller.getLayer(id);
9938
- if (target === "mask" && !layer.mask) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9966
+ if (target === "mask" && !layer.mask) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9939
9967
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
9940
9968
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
9941
9969
  }
@@ -9960,7 +9988,7 @@ function createImageLayerTools(controller) {
9960
9988
  },
9961
9989
  annotations: { title: "Add a pixel layer", ...WRITE2 },
9962
9990
  handler: async (args) => {
9963
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give color or image, not both.");
9991
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give color or image, not both.");
9964
9992
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
9965
9993
  const init = {
9966
9994
  name: args.name,
@@ -10050,7 +10078,7 @@ function createImageLayerTools(controller) {
10050
10078
  const id = exists(args.layerId);
10051
10079
  const props = {};
10052
10080
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
10053
- if (!Object.keys(props).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one property to change.");
10081
+ if (!Object.keys(props).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one property to change.");
10054
10082
  controller.setLayerProperties(id, props);
10055
10083
  return { layer: describe(id) };
10056
10084
  }
@@ -10144,8 +10172,8 @@ function createImageLayerTools(controller) {
10144
10172
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
10145
10173
  handler: ({ layerId, x, y, dx, dy }) => {
10146
10174
  const id = exists(layerId);
10147
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give x and y, or dx and dy.");
10148
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10175
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give x and y, or dx and dy.");
10176
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10149
10177
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
10150
10178
  }
10151
10179
  };
@@ -10217,7 +10245,7 @@ function createImageLayerTools(controller) {
10217
10245
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
10218
10246
  handler: ({ layerId, density, feather, enabled, linked }) => {
10219
10247
  const id = exists(layerId);
10220
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give density, feather, enabled or linked.");
10248
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give density, feather, enabled or linked.");
10221
10249
  const mask = controller.setLayerMaskProps(id, {
10222
10250
  density,
10223
10251
  feather,
@@ -10300,7 +10328,7 @@ function createImageLayerTools(controller) {
10300
10328
  handler: (args) => {
10301
10329
  const id = exists(args.layerId);
10302
10330
  const changes = filterValues(args);
10303
- if (!Object.keys(changes).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one value to change.");
10331
+ if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one value to change.");
10304
10332
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
10305
10333
  }
10306
10334
  };
@@ -10564,8 +10592,8 @@ function describeLayerEffects(effects) {
10564
10592
  }
10565
10593
  function createImageEffectTools(controller) {
10566
10594
  const layerArg = (id) => {
10567
- if (typeof id !== "string" || !id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10568
- _chunk65GNHOD4cjs.requireLayer.call(void 0, controller.getLayers(), id);
10595
+ if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10596
+ _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id);
10569
10597
  return id;
10570
10598
  };
10571
10599
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -10596,7 +10624,7 @@ function createImageEffectTools(controller) {
10596
10624
  annotations: { title: "Add a layer effect", ...WRITE3 },
10597
10625
  handler: ({ layerId, kind, settings, index }) => {
10598
10626
  const id = layerArg(layerId);
10599
- if (!_chunk24ATT2PEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`kind must be one of ${_chunk24ATT2PEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10627
+ if (!_chunk24ATT2PEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`kind must be one of ${_chunk24ATT2PEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10600
10628
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
10601
10629
  return result(id, { effectId: effect.id });
10602
10630
  }
@@ -10616,7 +10644,7 @@ function createImageEffectTools(controller) {
10616
10644
  handler: ({ layerId, effectId, settings }) => {
10617
10645
  const id = layerArg(layerId);
10618
10646
  const changes = _nullishCoalesce(settings, () => ( {}));
10619
- if (!Object.keys(changes).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one setting to change.");
10647
+ if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one setting to change.");
10620
10648
  controller.updateLayerEffect(id, effectId, changes);
10621
10649
  return result(id);
10622
10650
  }
@@ -10668,7 +10696,7 @@ function createImageEffectTools(controller) {
10668
10696
  },
10669
10697
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10670
10698
  handler: ({ angle, altitude }) => {
10671
- if (angle === void 0 && altitude === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give angle, altitude or both.");
10699
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give angle, altitude or both.");
10672
10700
  const next = {};
10673
10701
  if (angle !== void 0) next.angle = angle;
10674
10702
  if (altitude !== void 0) next.altitude = altitude;
@@ -10719,6 +10747,30 @@ var RETOUCH_OPTION_CONTROLS = [
10719
10747
  { id: "strength", label: "Strength", section: "layer", min: 0, max: 1, step: 0.01, default: 0.5, decimals: 0, track: plain2, displayScale: 100, unit: "%", tools: ["smudge", "blur", "sharpen"] },
10720
10748
  { id: "historySteps", label: "Steps back", section: "layer", min: 0, max: 50, step: 1, default: 0, decimals: 0, track: plain2, unit: "", tools: ["history"] }
10721
10749
  ];
10750
+ var CLONE_TRANSFORM_CONTROLS = [
10751
+ { id: "width", label: "Source W", section: "layer", min: 1, max: 400, step: 1, default: 100, decimals: 0, track: plain2, unit: "%" },
10752
+ { id: "height", label: "Source H", section: "layer", min: 1, max: 400, step: 1, default: 100, decimals: 0, track: plain2, unit: "%" },
10753
+ { id: "angle", label: "Source angle", section: "layer", min: -180, max: 180, step: 1, default: 0, decimals: 0, track: plain2, unit: "\xB0" }
10754
+ ];
10755
+ function cloneTransformView(controller) {
10756
+ const t = controller.getState().paint.cloneTransform;
10757
+ return {
10758
+ width: Math.round(Math.abs(t.scaleX) * 100),
10759
+ height: Math.round(Math.abs(t.scaleY) * 100),
10760
+ angle: t.rotate,
10761
+ flipH: t.scaleX < 0,
10762
+ flipV: t.scaleY < 0,
10763
+ identity: t.scaleX === 1 && t.scaleY === 1 && t.rotate === 0
10764
+ };
10765
+ }
10766
+ function setCloneTransformValue(controller, id, value) {
10767
+ const t = controller.getState().paint.cloneTransform;
10768
+ if (id === "width") controller.setCloneTransform({ scaleX: Math.sign(t.scaleX) * (_nullishCoalesce(value, () => ( 100))) / 100 });
10769
+ else if (id === "height") controller.setCloneTransform({ scaleY: Math.sign(t.scaleY) * (_nullishCoalesce(value, () => ( 100))) / 100 });
10770
+ else if (id === "angle") controller.setCloneTransform({ rotate: _nullishCoalesce(value, () => ( 0)) });
10771
+ else if (id === "flipH") controller.setCloneTransform({ scaleX: -t.scaleX });
10772
+ else controller.setCloneTransform({ scaleY: -t.scaleY });
10773
+ }
10722
10774
  var RETOUCH_CHOICES = [
10723
10775
  {
10724
10776
  id: "sample",
@@ -10857,7 +10909,7 @@ var PaintGesture = (_class8 = class {
10857
10909
  if (layer.type !== "pixel" && layer.type !== "shape" && layer.type !== "smart") throw new Error(`Only pixel, shape and smart object layers move; "${layer.name}" is a ${layer.type} layer.`);
10858
10910
  if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
10859
10911
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
10860
- const b = _chunk65GNHOD4cjs.shapeGeometryBounds.call(void 0, layer);
10912
+ const b = _chunkYAFS2QFZcjs.shapeGeometryBounds.call(void 0, layer);
10861
10913
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
10862
10914
  })();
10863
10915
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -11015,9 +11067,9 @@ function createImagePaintTools(controller) {
11015
11067
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
11016
11068
  handler: (args) => {
11017
11069
  const tool = args.tool;
11018
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11019
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11020
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give color or paint, not both.");
11070
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11071
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11072
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give color or paint, not both.");
11021
11073
  const result = controller.paintStroke({
11022
11074
  tool,
11023
11075
  points: args.points,
@@ -11148,7 +11200,7 @@ function profileArg(v) {
11148
11200
  try {
11149
11201
  return _chunkDCLJNVZScjs.base64ToBytes.call(void 0, s.slice(4));
11150
11202
  } catch (e30) {
11151
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("The icc: value is not valid base64.");
11203
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("The icc: value is not valid base64.");
11152
11204
  }
11153
11205
  }
11154
11206
  return s;
@@ -11213,10 +11265,10 @@ function createImageColorTools(controller) {
11213
11265
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11214
11266
  handler: (args) => {
11215
11267
  if (args.off === true) {
11216
- if (args.profile !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give either off true or a profile, not both.");
11268
+ if (args.profile !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give either off true or a profile, not both.");
11217
11269
  return controller.setProofSetup(null);
11218
11270
  }
11219
- if (args.profile === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11271
+ if (args.profile === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11220
11272
  const s = controller.setProofSetup({
11221
11273
  profile: profileArg(args.profile),
11222
11274
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -11268,7 +11320,7 @@ function createImageColorTools(controller) {
11268
11320
  },
11269
11321
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11270
11322
  handler: (args) => {
11271
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11323
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11272
11324
  return controller.setColorMode(args.mode, {
11273
11325
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
11274
11326
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -11322,7 +11374,7 @@ var TARGET2 = {
11322
11374
  };
11323
11375
  var SAMPLE = {
11324
11376
  type: "string",
11325
- enum: [..._chunkNVTHUPJ6cjs.RETOUCH_SAMPLES],
11377
+ enum: [..._chunkYT3JL7YMcjs.RETOUCH_SAMPLES],
11326
11378
  description: "What is sampled: current (default: the target layer), current-below (the composite of this layer and everything under it), or all (the composite of every layer). Sample current-below or all to retouch onto an empty layer above the image."
11327
11379
  };
11328
11380
  function readTarget2(args) {
@@ -11333,7 +11385,7 @@ function checkSource(controller, source) {
11333
11385
  const p = source;
11334
11386
  const { width, height } = controller.getState().imageDimensions;
11335
11387
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
11336
- throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11388
+ throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11337
11389
  }
11338
11390
  return p;
11339
11391
  }
@@ -11401,7 +11453,7 @@ function createImageRetouchTools(controller) {
11401
11453
  type: "object",
11402
11454
  properties: {
11403
11455
  points: POINTS,
11404
- type: { type: "string", enum: [..._chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11456
+ type: { type: "string", enum: [..._chunkYT3JL7YMcjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11405
11457
  sample: SAMPLE,
11406
11458
  brush: BRUSH2,
11407
11459
  ...TARGET2
@@ -11434,7 +11486,7 @@ function createImageRetouchTools(controller) {
11434
11486
  type: "object",
11435
11487
  properties: {
11436
11488
  points: POINTS,
11437
- range: { type: "string", enum: [..._chunkNVTHUPJ6cjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11489
+ range: { type: "string", enum: [..._chunkYT3JL7YMcjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11438
11490
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Strength 0..1 (default the current option, 0.5). Overlapping dabs in one stroke never go past it; another stroke builds on it." },
11439
11491
  protectTones: { type: "boolean", description: "Change luma only, keeping hue and saturation (default true)." },
11440
11492
  brush: BRUSH2,
@@ -11526,12 +11578,12 @@ function createImageRetouchTools(controller) {
11526
11578
  const getOptions = {
11527
11579
  name: "get_retouch_options",
11528
11580
  title: "Get retouch options",
11529
- description: "Reads the retouching tools' options (aligned, sample, spotType, range, exposure, protectTones, spongeMode, vibrance, strength, historySteps) and the clone source ({x, y, offset} or null; offset is the aligned offset the last clone or heal stroke fixed: an aligned stroke samples at the brush plus offset, which the editors show as a crosshair). Call it before clone_stamp or heal_brush without a source to see where they will sample.",
11581
+ description: "Reads the retouching tools' options (aligned, sample, spotType, range, exposure, protectTones, spongeMode, vibrance, strength, historySteps), the Clone Source transform ({scaleX, scaleY, rotate}) and the clone source ({x, y, offset} or null; offset is the aligned offset the last clone or heal stroke fixed: an aligned stroke samples at the brush plus offset, which the editors show as a crosshair). Call it before clone_stamp or heal_brush without a source to see where they will sample.",
11530
11582
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
11531
11583
  annotations: { title: "Get retouch options", ...READ6 },
11532
11584
  handler: () => {
11533
- const { retouch, cloneSource } = controller.getState().paint;
11534
- return { options: { ...retouch }, cloneSource: cloneSource ? { ...cloneSource } : null };
11585
+ const { retouch, cloneSource, cloneTransform } = controller.getState().paint;
11586
+ return { options: { ...retouch }, cloneSource: cloneSource ? { ...cloneSource } : null, cloneTransform: { ...cloneTransform } };
11535
11587
  }
11536
11588
  };
11537
11589
  const setOptions = {
@@ -11543,8 +11595,8 @@ function createImageRetouchTools(controller) {
11543
11595
  properties: {
11544
11596
  aligned: { type: "boolean", description: "Clone / heal: keep the offset from stroke to stroke (default true)." },
11545
11597
  sample: SAMPLE,
11546
- spotType: { type: "string", enum: [..._chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11547
- range: { type: "string", enum: [..._chunkNVTHUPJ6cjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11598
+ spotType: { type: "string", enum: [..._chunkYT3JL7YMcjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11599
+ range: { type: "string", enum: [..._chunkYT3JL7YMcjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11548
11600
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Dodge / burn strength 0..1 (default 0.5)." },
11549
11601
  protectTones: { type: "boolean", description: "Dodge / burn: keep hue and saturation (default true)." },
11550
11602
  spongeMode: { type: "string", enum: ["desaturate", "saturate"], description: "Sponge: desaturate (default) or saturate." },
@@ -11573,14 +11625,47 @@ function createImageRetouchTools(controller) {
11573
11625
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
11574
11626
  handler: (args) => {
11575
11627
  if (args.clear === true) {
11576
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give either clear true or x and y, not both.");
11628
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give either clear true or x and y, not both.");
11577
11629
  return controller.setCloneSource(null);
11578
11630
  }
11579
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11631
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11580
11632
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
11581
11633
  }
11582
11634
  };
11583
- return [cloneStamp, healBrush, spotHeal, smudge, dodge, burn, spongeTool, blurTool, sharpenTool, historyBrush, getOptions, setOptions, setSource];
11635
+ const setTransform = {
11636
+ name: "set_clone_transform",
11637
+ title: "Transform the clone source",
11638
+ description: "Photoshop's Clone Source panel: the Clone Stamp and Healing Brush lay the source scaled by `scaleX` / `scaleY` (percent, default 100; negative or the flip flags mirror it) and rotated by `rotate` degrees clockwise about the stroke's start. Merged into the current transform; reset true goes back to 100 %, 0\xB0. Use it to clone a reflection, a smaller copy or a tilted patch. View state, not an undo step. Returns the transform ({scaleX, scaleY, rotate} as factors and degrees).",
11639
+ inputSchema: {
11640
+ type: "object",
11641
+ properties: {
11642
+ scaleX: { type: "number", description: "Width in percent of the source (1..1000; negative flips horizontally)." },
11643
+ scaleY: { type: "number", description: "Height in percent of the source (1..1000; negative flips vertically)." },
11644
+ rotate: { type: "number", description: "Rotation in degrees, clockwise (-180..180)." },
11645
+ flipHorizontal: { type: "boolean", description: "Mirror the source left to right (negates the width scale; default false)." },
11646
+ flipVertical: { type: "boolean", description: "Mirror the source top to bottom (negates the height scale; default false)." },
11647
+ reset: { type: "boolean", description: "Back to 100 %, no flip, 0\xB0 (default false); other arguments are not allowed with it." }
11648
+ },
11649
+ additionalProperties: false
11650
+ },
11651
+ annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
11652
+ handler: (args) => {
11653
+ if (args.reset === true) {
11654
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give either reset true or transform values, not both.");
11655
+ return controller.setCloneTransform(null);
11656
+ }
11657
+ const cur = controller.getState().paint.cloneTransform;
11658
+ const next = {};
11659
+ if (args.scaleX !== void 0) next.scaleX = args.scaleX / 100;
11660
+ if (args.scaleY !== void 0) next.scaleY = args.scaleY / 100;
11661
+ if (args.rotate !== void 0) next.rotate = args.rotate;
11662
+ if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
11663
+ if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
11664
+ if (!Object.keys(next).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11665
+ return controller.setCloneTransform(next);
11666
+ }
11667
+ };
11668
+ return [cloneStamp, healBrush, spotHeal, smudge, dodge, burn, spongeTool, blurTool, sharpenTool, historyBrush, getOptions, setOptions, setSource, setTransform];
11584
11669
  }
11585
11670
  function pick(args, keys) {
11586
11671
  const out = {};
@@ -11597,11 +11682,11 @@ var DATA = {
11597
11682
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
11598
11683
  };
11599
11684
  function psdBytesFromBase64(data) {
11600
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunk65GNHOD4cjs.PsdError)("data is required: the PSD file as base64.");
11685
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkYAFS2QFZcjs.PsdError)("data is required: the PSD file as base64.");
11601
11686
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
11602
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunk65GNHOD4cjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11687
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkYAFS2QFZcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11603
11688
  const bytes = _chunkDCLJNVZScjs.base64ToBytes.call(void 0, body);
11604
- if (bytes.length < 26) throw new (0, _chunk65GNHOD4cjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11689
+ if (bytes.length < 26) throw new (0, _chunkYAFS2QFZcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11605
11690
  return bytes;
11606
11691
  }
11607
11692
  function createImagePsdTools(controller) {
@@ -11612,7 +11697,7 @@ function createImagePsdTools(controller) {
11612
11697
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
11613
11698
  annotations: { title: "Inspect a PSD", ...READ7 },
11614
11699
  handler: ({ data }) => {
11615
- const res = _chunk65GNHOD4cjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11700
+ const res = _chunkYAFS2QFZcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11616
11701
  return {
11617
11702
  width: res.width,
11618
11703
  height: res.height,
@@ -11699,7 +11784,7 @@ var GEOMETRY = {
11699
11784
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
11700
11785
  reference: {
11701
11786
  description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
11702
- anyOf: [{ type: "string", enum: _chunk65GNHOD4cjs.TRANSFORM_ANCHORS }, POINT]
11787
+ anyOf: [{ type: "string", enum: _chunkYAFS2QFZcjs.TRANSFORM_ANCHORS }, POINT]
11703
11788
  },
11704
11789
  matrix: {
11705
11790
  type: "array",
@@ -11720,14 +11805,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11720
11805
  function geometryFrom(args) {
11721
11806
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11722
11807
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11723
- if (ways === 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11724
- if (ways > 1) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11808
+ if (ways === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11809
+ if (ways > 1) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11725
11810
  if (args.matrix !== void 0) return { matrix: args.matrix };
11726
11811
  if (args.corners !== void 0) return { corners: args.corners };
11727
11812
  const params = {};
11728
11813
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11729
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11730
- if (typeof params.reference === "string" && !_chunk65GNHOD4cjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunk65GNHOD4cjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11814
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11815
+ if (typeof params.reference === "string" && !_chunkYAFS2QFZcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkYAFS2QFZcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11731
11816
  return { params };
11732
11817
  }
11733
11818
  function targetFrom(args) {
@@ -11776,15 +11861,15 @@ function createImageTransformTools(controller) {
11776
11861
  moved: [...s.moves],
11777
11862
  frame: { ...s.box },
11778
11863
  corners: s.startGeometry.corners.map(roundPoint),
11779
- center: roundPoint(_chunk65GNHOD4cjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11864
+ center: roundPoint(_chunkYAFS2QFZcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11780
11865
  };
11781
11866
  if (s.smartObject) out.smartObject = true;
11782
11867
  s.cancel();
11783
11868
  if (args.meshColumns !== void 0) {
11784
11869
  const cols = args.meshColumns;
11785
11870
  const rows = _nullishCoalesce(args.meshRows, () => ( cols));
11786
- const mesh = _chunkF7GGEAO2cjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11787
- out.mesh = { columns: cols, rows, pointsPerRow: _chunkF7GGEAO2cjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkF7GGEAO2cjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11871
+ const mesh = _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11872
+ out.mesh = { columns: cols, rows, pointsPerRow: _chunkZ2H7KECKcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkZ2H7KECKcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11788
11873
  }
11789
11874
  return out;
11790
11875
  }
@@ -11809,7 +11894,7 @@ function createImageTransformTools(controller) {
11809
11894
  type: "object",
11810
11895
  properties: {
11811
11896
  ...TARGET3,
11812
- style: { type: "string", enum: _chunkF7GGEAO2cjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11897
+ style: { type: "string", enum: _chunkZ2H7KECKcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11813
11898
  bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
11814
11899
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
11815
11900
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
@@ -11831,11 +11916,11 @@ function createImageTransformTools(controller) {
11831
11916
  annotations: { title: "Warp a layer", ...WRITE6 },
11832
11917
  handler: (args) => {
11833
11918
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
11834
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11835
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give a preset style or a mesh.");
11919
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11920
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give a preset style or a mesh.");
11836
11921
  let warp;
11837
11922
  if (hasPreset) {
11838
- if (args.style === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkF7GGEAO2cjs.WARP_STYLES.join(", ")}.`);
11923
+ if (args.style === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkZ2H7KECKcjs.WARP_STYLES.join(", ")}.`);
11839
11924
  warp = {
11840
11925
  style: args.style,
11841
11926
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -11846,7 +11931,7 @@ function createImageTransformTools(controller) {
11846
11931
  } else {
11847
11932
  const m = args.mesh;
11848
11933
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11849
- if (m.points.length !== want) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11934
+ if (m.points.length !== want) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
11850
11935
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11851
11936
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11852
11937
  }
@@ -11941,13 +12026,13 @@ function settingsFrom(args) {
11941
12026
  return out;
11942
12027
  }
11943
12028
  function imageArg(image) {
11944
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12029
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11945
12030
  return image.trim();
11946
12031
  }
11947
12032
  function createImageSmartObjectTools(controller) {
11948
12033
  const smartId = (id) => {
11949
- if (typeof id !== "string" || !id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11950
- _chunk65GNHOD4cjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12034
+ if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12035
+ _chunkYAFS2QFZcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11951
12036
  return id;
11952
12037
  };
11953
12038
  const info = (id) => {
@@ -11984,7 +12069,7 @@ function createImageSmartObjectTools(controller) {
11984
12069
  },
11985
12070
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
11986
12071
  handler: ({ layerIds, name }) => {
11987
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunk65GNHOD4cjs.requireLayer.call(void 0, controller.getLayers(), id2);
12072
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkYAFS2QFZcjs.requireLayer.call(void 0, controller.getLayers(), id2);
11988
12073
  const id = controller.convertToSmartObject(layerIds, { name });
11989
12074
  return { layer: layerSummary(id), smartObject: info(id) };
11990
12075
  }
@@ -12021,7 +12106,7 @@ function createImageSmartObjectTools(controller) {
12021
12106
  {
12022
12107
  type: "object",
12023
12108
  properties: {
12024
- style: { type: "string", enum: _chunkF7GGEAO2cjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12109
+ style: { type: "string", enum: _chunkZ2H7KECKcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12025
12110
  bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
12026
12111
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
12027
12112
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
@@ -12057,12 +12142,12 @@ function createImageSmartObjectTools(controller) {
12057
12142
  else if (w) {
12058
12143
  const m = w;
12059
12144
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12060
- if (m.points.length !== want) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12145
+ if (m.points.length !== want) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12061
12146
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12062
12147
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12063
12148
  }
12064
12149
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
12065
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12150
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12066
12151
  const res = controller.setSmartObjectTransform(id, {
12067
12152
  corners: args.corners,
12068
12153
  matrix: args.matrix,
@@ -12187,7 +12272,7 @@ function createImageSmartObjectTools(controller) {
12187
12272
  handler: (args) => {
12188
12273
  const id = smartId(args.layerId);
12189
12274
  const changes = settingsFrom(args);
12190
- if (!Object.keys(changes).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give at least one value to change.");
12275
+ if (!Object.keys(changes).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give at least one value to change.");
12191
12276
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
12192
12277
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
12193
12278
  }
@@ -12508,8 +12593,8 @@ function geometry(args) {
12508
12593
  }
12509
12594
  function createImageShapeTools(controller) {
12510
12595
  const shapeId = (id) => {
12511
- if (typeof id !== "string" || !id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12512
- _chunk65GNHOD4cjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12596
+ if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12597
+ _chunkYAFS2QFZcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12513
12598
  return id;
12514
12599
  };
12515
12600
  const layerSummary = (id) => {
@@ -12584,7 +12669,7 @@ function createImageShapeTools(controller) {
12584
12669
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
12585
12670
  handler: ({ layerId, fill, stroke, fillRule }) => {
12586
12671
  const id = shapeId(layerId);
12587
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12672
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12588
12673
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
12589
12674
  }
12590
12675
  };
@@ -12633,7 +12718,7 @@ function createImageShapeTools(controller) {
12633
12718
  handler: ({ layerId, componentIndex, ...rest }) => {
12634
12719
  const id = shapeId(layerId);
12635
12720
  const change = geometry(rest);
12636
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("Give shape, subpaths or op to change.");
12721
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("Give shape, subpaths or op to change.");
12637
12722
  return controller.setShapeComponent(id, componentIndex, change);
12638
12723
  }
12639
12724
  };
@@ -12707,8 +12792,8 @@ function pick2(args, keys) {
12707
12792
  }
12708
12793
  function createImageTypeTools(controller) {
12709
12794
  const typeId = (id) => {
12710
- if (typeof id !== "string" || !id) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12711
- _chunk65GNHOD4cjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12795
+ if (typeof id !== "string" || !id) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12796
+ _chunkYAFS2QFZcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12712
12797
  return id;
12713
12798
  };
12714
12799
  const layerSummary = (id) => {
@@ -12788,7 +12873,7 @@ function createImageTypeTools(controller) {
12788
12873
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12789
12874
  handler: (args) => {
12790
12875
  const style = pick2(args, Object.keys(STYLE));
12791
- if (!Object.keys(style).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12876
+ if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12792
12877
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
12793
12878
  }
12794
12879
  };
@@ -12800,7 +12885,7 @@ function createImageTypeTools(controller) {
12800
12885
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
12801
12886
  handler: (args) => {
12802
12887
  const style = pick2(args, Object.keys(PARAGRAPH));
12803
- if (!Object.keys(style).length) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12888
+ if (!Object.keys(style).length) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12804
12889
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
12805
12890
  }
12806
12891
  };
@@ -12822,7 +12907,7 @@ function createImageTypeTools(controller) {
12822
12907
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
12823
12908
  handler: ({ layerId, kind, width, height }) => {
12824
12909
  const id = typeId(layerId);
12825
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunk65GNHOD4cjs.LayerOperationError)("kind box needs width and height in pixels.");
12910
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkYAFS2QFZcjs.LayerOperationError)("kind box needs width and height in pixels.");
12826
12911
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
12827
12912
  }
12828
12913
  };
@@ -12844,7 +12929,7 @@ function createImageTypeTools(controller) {
12844
12929
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
12845
12930
  function adjustmentsSummary(adjustments) {
12846
12931
  return {
12847
- process: _chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, adjustments.process),
12932
+ process: _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12848
12933
  values: readAdjustmentControls(adjustments),
12849
12934
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
12850
12935
  };
@@ -12887,7 +12972,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12887
12972
  default: def,
12888
12973
  ...requiresProcess ? { requiresProcess } : {}
12889
12974
  })),
12890
- layerKinds: _chunk65GNHOD4cjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12975
+ layerKinds: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12891
12976
  kind,
12892
12977
  label,
12893
12978
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -12973,7 +13058,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12973
13058
  const result = { applied, clamped };
12974
13059
  if (typeof label === "string" && label) result.label = label;
12975
13060
  const notes = [];
12976
- if ("tint" in applied && _chunk65GNHOD4cjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13061
+ if ("tint" in applied && _chunkYAFS2QFZcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12977
13062
  notes.push("Tint has no effect on process 1 edits.");
12978
13063
  }
12979
13064
  if (notes.length) result.notes = notes;
@@ -12983,11 +13068,11 @@ function createImageEditorToolProvider(controller, options = {}) {
12983
13068
  const addLayer = {
12984
13069
  name: "add_adjustment_layer",
12985
13070
  title: "Add an adjustment layer",
12986
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunk65GNHOD4cjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13071
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12987
13072
  inputSchema: {
12988
13073
  type: "object",
12989
13074
  properties: {
12990
- kind: { type: "string", enum: _chunk65GNHOD4cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13075
+ kind: { type: "string", enum: _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12991
13076
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
12992
13077
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
12993
13078
  blend: { type: "string", enum: _chunkJ5BA3BQ6cjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -13006,7 +13091,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13006
13091
  openWorldHint: false
13007
13092
  },
13008
13093
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
13009
- if (!_chunk65GNHOD4cjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13094
+ if (!_chunkYAFS2QFZcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13010
13095
  if (blend !== void 0 && !_chunkJ5BA3BQ6cjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
13011
13096
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
13012
13097
  for (const ref of [aboveId, parentId]) {
@@ -13100,7 +13185,7 @@ function boxToCurvePoint(x, y, width, height) {
13100
13185
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
13101
13186
  }
13102
13187
  function curveSvgPath(points, width, height, samples = 64) {
13103
- const lut = _chunk65GNHOD4cjs.curveLutFromLevels.call(void 0, points);
13188
+ const lut = _chunkYAFS2QFZcjs.curveLutFromLevels.call(void 0, points);
13104
13189
  const n = lut.length - 1;
13105
13190
  let d = "";
13106
13191
  for (let i = 0; i <= samples; i++) {
@@ -13610,7 +13695,7 @@ var TextEditSession = (_class11 = class {
13610
13695
  else {
13611
13696
  const layout = this.layout();
13612
13697
  if (layout && layout.lines.length) {
13613
- const c = _chunkF7GGEAO2cjs.caretAt.call(void 0, layout, f);
13698
+ const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, f);
13614
13699
  const line = layout.lines[c.line];
13615
13700
  if (to === "home") f = line.start;
13616
13701
  else if (to === "end") {
@@ -13705,7 +13790,7 @@ var TextEditSession = (_class11 = class {
13705
13790
  styleHere() {
13706
13791
  const layer = this.layer;
13707
13792
  const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
13708
- return _chunkF7GGEAO2cjs.styleAt.call(void 0, layer.runs, at, _chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE);
13793
+ return _chunkZ2H7KECKcjs.styleAt.call(void 0, layer.runs, at, _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE);
13709
13794
  }
13710
13795
  info() {
13711
13796
  return this.controller.getTextLayer(this.layerId);
@@ -13714,8 +13799,8 @@ var TextEditSession = (_class11 = class {
13714
13799
  overlay() {
13715
13800
  const layer = this.layer;
13716
13801
  const layout = this.layout();
13717
- const m = _chunk65GNHOD4cjs.textMatrix.call(void 0, layer);
13718
- const at = (x, y) => _chunkF7GGEAO2cjs.applyMatrix.call(void 0, m, { x, y });
13802
+ const m = _chunkYAFS2QFZcjs.textMatrix.call(void 0, layer);
13803
+ const at = (x, y) => _chunkZ2H7KECKcjs.applyMatrix.call(void 0, m, { x, y });
13719
13804
  let frame = null;
13720
13805
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
13721
13806
  else if (layout) {
@@ -13735,7 +13820,7 @@ var TextEditSession = (_class11 = class {
13735
13820
  selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
13736
13821
  }
13737
13822
  }
13738
- const c = _chunkF7GGEAO2cjs.caretAt.call(void 0, layout, this.focus);
13823
+ const c = _chunkZ2H7KECKcjs.caretAt.call(void 0, layout, this.focus);
13739
13824
  return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
13740
13825
  }
13741
13826
  /** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
@@ -13750,7 +13835,7 @@ var TextEditSession = (_class11 = class {
13750
13835
  }
13751
13836
  if (this.layer.name === "Text" && this.changed) {
13752
13837
  try {
13753
- this.controller.setLayerProperties(this.layerId, { name: _chunk65GNHOD4cjs.typeLayerName.call(void 0, this.text) }, false);
13838
+ this.controller.setLayerProperties(this.layerId, { name: _chunkYAFS2QFZcjs.typeLayerName.call(void 0, this.text) }, false);
13754
13839
  } catch (e32) {
13755
13840
  }
13756
13841
  }
@@ -13761,8 +13846,8 @@ function typeLayerAt(controller, p, slop = 4) {
13761
13846
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13762
13847
  for (const l of layers) {
13763
13848
  if (!l.visible) continue;
13764
- const inv = invert(_chunk65GNHOD4cjs.textMatrix.call(void 0, l));
13765
- const q = _chunkF7GGEAO2cjs.applyMatrix.call(void 0, inv, p);
13849
+ const inv = invert(_chunkYAFS2QFZcjs.textMatrix.call(void 0, l));
13850
+ const q = _chunkZ2H7KECKcjs.applyMatrix.call(void 0, inv, p);
13766
13851
  let b = null;
13767
13852
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
13768
13853
  else {
@@ -13872,7 +13957,7 @@ function layerPanelRows(layers, activeId) {
13872
13957
  }
13873
13958
  function layerLabel(layer) {
13874
13959
  if (layer.name) return layer.name;
13875
- if (layer.type === "adjustment") return _chunk65GNHOD4cjs.adjustmentKindLabel.call(void 0, layer.kind);
13960
+ if (layer.type === "adjustment") return _chunkYAFS2QFZcjs.adjustmentKindLabel.call(void 0, layer.kind);
13876
13961
  return layer.type === "group" ? "Group" : "Layer";
13877
13962
  }
13878
13963
  function layerBadge(layer) {
@@ -14344,7 +14429,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
14344
14429
  ];
14345
14430
  var WARP_STYLE_OPTIONS = [
14346
14431
  { id: "custom", label: "Custom" },
14347
- ..._chunkF7GGEAO2cjs.WARP_STYLES.map((id) => ({ id, label: _chunkF7GGEAO2cjs.WARP_STYLE_LABELS[id] }))
14432
+ ..._chunkZ2H7KECKcjs.WARP_STYLES.map((id) => ({ id, label: _chunkZ2H7KECKcjs.WARP_STYLE_LABELS[id] }))
14348
14433
  ];
14349
14434
  var WARP_GRID_OPTIONS = [
14350
14435
  { id: "1x1", label: "Default", columns: 1, rows: 1 },
@@ -14480,7 +14565,7 @@ var FreeTransformTool = (_class13 = class {
14480
14565
  setMode(mode) {
14481
14566
  this.modeValue = mode;
14482
14567
  const s = this.session;
14483
- if (mode === "warp" && s && !this.mesh) this.mesh = _chunkF7GGEAO2cjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14568
+ if (mode === "warp" && s && !this.mesh) this.mesh = _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14484
14569
  this.changed();
14485
14570
  }
14486
14571
  /** The Warp options bar's settings. */
@@ -14502,13 +14587,13 @@ var FreeTransformTool = (_class13 = class {
14502
14587
  this.modeValue = "warp";
14503
14588
  const next = { ...this.warpSettings, ...changes };
14504
14589
  this.warpSettings = next;
14505
- let mesh = _nullishCoalesce(this.mesh, () => ( _chunkF7GGEAO2cjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14590
+ let mesh = _nullishCoalesce(this.mesh, () => ( _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14506
14591
  if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
14507
14592
  const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
14508
- mesh = _nullishCoalesce(_chunkF7GGEAO2cjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkF7GGEAO2cjs.identityWarpMesh.call(void 0, s.box)));
14509
- mesh = _chunkF7GGEAO2cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14593
+ mesh = _nullishCoalesce(_chunkZ2H7KECKcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkZ2H7KECKcjs.identityWarpMesh.call(void 0, s.box)));
14594
+ mesh = _chunkZ2H7KECKcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14510
14595
  }
14511
- if ("columns" in changes || "rows" in changes) mesh = _chunkF7GGEAO2cjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14596
+ if ("columns" in changes || "rows" in changes) mesh = _chunkZ2H7KECKcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14512
14597
  this.mesh = mesh;
14513
14598
  this.changed();
14514
14599
  this.preview();
@@ -14555,11 +14640,11 @@ var FreeTransformTool = (_class13 = class {
14555
14640
  const m = this.mesh;
14556
14641
  const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
14557
14642
  const pts = m.points.map(at);
14558
- const edit = _chunkF7GGEAO2cjs.warpMeshEditPoints.call(void 0, m);
14643
+ const edit = _chunkZ2H7KECKcjs.warpMeshEditPoints.call(void 0, m);
14559
14644
  out.handles = [];
14560
- out.outline = _chunkF7GGEAO2cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14645
+ out.outline = _chunkZ2H7KECKcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14561
14646
  out.warp = {
14562
- curves: _chunkF7GGEAO2cjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14647
+ curves: _chunkZ2H7KECKcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14563
14648
  anchors: edit.anchors.map((i) => pts[i]),
14564
14649
  handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
14565
14650
  };
@@ -14583,7 +14668,7 @@ var FreeTransformTool = (_class13 = class {
14583
14668
  if (!o) return null;
14584
14669
  if (this.modeValue === "warp" && this.mesh) {
14585
14670
  const h = this.homography();
14586
- const edit = _chunkF7GGEAO2cjs.warpMeshEditPoints.call(void 0, this.mesh);
14671
+ const edit = _chunkZ2H7KECKcjs.warpMeshEditPoints.call(void 0, this.mesh);
14587
14672
  let best2 = -1;
14588
14673
  let bestD2 = tolerance;
14589
14674
  for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
@@ -14628,7 +14713,7 @@ var FreeTransformTool = (_class13 = class {
14628
14713
  if (this.modeValue === "warp" && this.mesh && handle === "inside") {
14629
14714
  const q = this.toFrame(p, this.corners);
14630
14715
  if (q) {
14631
- const r = _chunkF7GGEAO2cjs.warpMeshParamAt.call(void 0, this.mesh, q);
14716
+ const r = _chunkZ2H7KECKcjs.warpMeshParamAt.call(void 0, this.mesh, q);
14632
14717
  st = { s: r.s, t: r.t };
14633
14718
  }
14634
14719
  }
@@ -14661,8 +14746,8 @@ var FreeTransformTool = (_class13 = class {
14661
14746
  if (!a || !b) return;
14662
14747
  const delta = { x: b.x - a.x, y: b.y - a.y };
14663
14748
  const i = meshIndex(d.handle);
14664
- if (i >= 0) this.mesh = _chunkF7GGEAO2cjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14665
- else if (d.handle === "inside" && d.st) this.mesh = _chunkF7GGEAO2cjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14749
+ if (i >= 0) this.mesh = _chunkZ2H7KECKcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14750
+ else if (d.handle === "inside" && d.st) this.mesh = _chunkZ2H7KECKcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14666
14751
  else return;
14667
14752
  this.warpSettings = { ...this.warpSettings, style: "custom" };
14668
14753
  this.changed();
@@ -14786,7 +14871,7 @@ var FreeTransformTool = (_class13 = class {
14786
14871
  bar() {
14787
14872
  const s = this.session;
14788
14873
  if (!s || !this.corners) return null;
14789
- const read = _chunk65GNHOD4cjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14874
+ const read = _chunkYAFS2QFZcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14790
14875
  return {
14791
14876
  affine: read.affine,
14792
14877
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -14811,7 +14896,7 @@ var FreeTransformTool = (_class13 = class {
14811
14896
  this.changed();
14812
14897
  return;
14813
14898
  }
14814
- const m = _chunk65GNHOD4cjs.matrixFromParams.call(void 0, s.box, {
14899
+ const m = _chunkYAFS2QFZcjs.matrixFromParams.call(void 0, s.box, {
14815
14900
  scaleX: next.scaleX,
14816
14901
  scaleY: next.scaleY,
14817
14902
  rotate: next.rotate,
@@ -14821,7 +14906,7 @@ var FreeTransformTool = (_class13 = class {
14821
14906
  dx: next.x - this.refBox.x,
14822
14907
  dy: next.y - this.refBox.y
14823
14908
  });
14824
- this.setCorners(_chunk65GNHOD4cjs.cornersFromMatrix.call(void 0, s.box, m));
14909
+ this.setCorners(_chunkYAFS2QFZcjs.cornersFromMatrix.call(void 0, s.box, m));
14825
14910
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
14826
14911
  this.changed();
14827
14912
  }
@@ -15914,5 +15999,12 @@ function createImageEffectsToolProvider(controller, options = {}) {
15914
15999
 
15915
16000
 
15916
16001
 
15917
- exports.ADJUSTMENT_KEYS = _chunk65GNHOD4cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunk65GNHOD4cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunk65GNHOD4cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunk65GNHOD4cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunk65GNHOD4cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunk65GNHOD4cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunk65GNHOD4cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunk65GNHOD4cjs.D50; exports.D65 = _chunk65GNHOD4cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkF7GGEAO2cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunk65GNHOD4cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkNVTHUPJ6cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkF7GGEAO2cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunk65GNHOD4cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunk24ATT2PEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunk65GNHOD4cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunk65GNHOD4cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunk65GNHOD4cjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunk65GNHOD4cjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunk24ATT2PEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunk65GNHOD4cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunk65GNHOD4cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunk24ATT2PEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunk65GNHOD4cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunk65GNHOD4cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunk65GNHOD4cjs.LUMA_709; exports.LayerCompositor = _chunk65GNHOD4cjs.LayerCompositor; exports.LayerEffectError = _chunk24ATT2PEcjs.LayerEffectError; exports.LayerOperationError = _chunk65GNHOD4cjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunk24ATT2PEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunk65GNHOD4cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunk24ATT2PEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunk65GNHOD4cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunk65GNHOD4cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunk65GNHOD4cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunk65GNHOD4cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunk65GNHOD4cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunk24ATT2PEcjs.PatternPlacement; exports.PatternTile = _chunk24ATT2PEcjs.PatternTile; exports.PsdError = _chunk65GNHOD4cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkNVTHUPJ6cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkNVTHUPJ6cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkNVTHUPJ6cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunk65GNHOD4cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunk65GNHOD4cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunk65GNHOD4cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunk65GNHOD4cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunk65GNHOD4cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkNVTHUPJ6cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunk65GNHOD4cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunk65GNHOD4cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunk65GNHOD4cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunk65GNHOD4cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunk65GNHOD4cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunk65GNHOD4cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkNVTHUPJ6cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunk65GNHOD4cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkNVTHUPJ6cjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunk24ATT2PEcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunk65GNHOD4cjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkF7GGEAO2cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkF7GGEAO2cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunk65GNHOD4cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunk65GNHOD4cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunk65GNHOD4cjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunk65GNHOD4cjs.activeSmartFilters; exports.addLayerEffect = _chunk65GNHOD4cjs.addLayerEffect; exports.addLayerFilter = _chunk65GNHOD4cjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunk65GNHOD4cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunk65GNHOD4cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunk65GNHOD4cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunk65GNHOD4cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunk65GNHOD4cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunk65GNHOD4cjs.anchorPoint; exports.annotationBlend = _chunk65GNHOD4cjs.annotationBlend; exports.annotationLayerFor = _chunk65GNHOD4cjs.annotationLayerFor; exports.annotationLayerName = _chunk65GNHOD4cjs.annotationLayerName; exports.annotationOfLayer = _chunk65GNHOD4cjs.annotationOfLayer; exports.annotationOfShape = _chunk65GNHOD4cjs.annotationOfShape; exports.annotationOfType = _chunk65GNHOD4cjs.annotationOfType; exports.applyAdjustmentLayers = _chunk65GNHOD4cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunk65GNHOD4cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunk65GNHOD4cjs.applyAdjustments; exports.applyBoxBlur = _chunk65GNHOD4cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunk65GNHOD4cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunk65GNHOD4cjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunk65GNHOD4cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunk65GNHOD4cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunk65GNHOD4cjs.applyLegacyFloat; exports.applyMatrix3 = _chunk65GNHOD4cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunk65GNHOD4cjs.applyParams; exports.applyProcess2Adjustments = _chunk65GNHOD4cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunk65GNHOD4cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkNVTHUPJ6cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunk65GNHOD4cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkNVTHUPJ6cjs.applyToneToDeepTile; exports.backgroundLayer = _chunk65GNHOD4cjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkNVTHUPJ6cjs.bestOffset; exports.blackWhiteGray = _chunk65GNHOD4cjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunk24ATT2PEcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunk65GNHOD4cjs.blurFilter; exports.borderCoverage = _chunk65GNHOD4cjs.borderCoverage; exports.boxBlurPixels = _chunkNVTHUPJ6cjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunk65GNHOD4cjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunk65GNHOD4cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunk65GNHOD4cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunk65GNHOD4cjs.buildToneLut; exports.builtinPattern = _chunk24ATT2PEcjs.builtinPattern; exports.builtinPatternIds = _chunk24ATT2PEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunk65GNHOD4cjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunk65GNHOD4cjs.canvasToImagePoint; exports.caretAt = _chunkF7GGEAO2cjs.caretAt; exports.changedTiles = _chunk24ATT2PEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunk65GNHOD4cjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunk65GNHOD4cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunk65GNHOD4cjs.combineSelections; exports.compileAdjustmentLayer = _chunk65GNHOD4cjs.compileAdjustmentLayer; exports.componentPath = _chunk65GNHOD4cjs.componentPath; exports.compositeDeep = _chunk65GNHOD4cjs.compositeDeep; exports.compositeSurfaceOver = _chunk24ATT2PEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunk65GNHOD4cjs.computeSelectionBounds; exports.contentAwareFill = _chunkNVTHUPJ6cjs.contentAwareFill; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunk65GNHOD4cjs.contentsBox; exports.contentsSurface = _chunk65GNHOD4cjs.contentsSurface; exports.contractCoverage = _chunk65GNHOD4cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunk65GNHOD4cjs.convertToSmartObject; exports.copySmartObject = _chunk65GNHOD4cjs.copySmartObject; exports.cornersFromMatrix = _chunk65GNHOD4cjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunk65GNHOD4cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunk65GNHOD4cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkF7GGEAO2cjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkF7GGEAO2cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkF7GGEAO2cjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunk65GNHOD4cjs.createSelectionMask; exports.createShapeLayer = _chunk65GNHOD4cjs.createShapeLayer; exports.createTypeLayer = _chunk65GNHOD4cjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkF7GGEAO2cjs.cssFont; exports.cssFontFamily = _chunkF7GGEAO2cjs.cssFontFamily; exports.curveLut = _chunk24ATT2PEcjs.curveLut; exports.curveLutFromLevels = _chunk65GNHOD4cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunk65GNHOD4cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunk65GNHOD4cjs.decodeLayerChannel; exports.decodeLayerMask = _chunk65GNHOD4cjs.decodeLayerMask; exports.decodeMergedImage = _chunk65GNHOD4cjs.decodeMergedImage; exports.decodePlanes = _chunk65GNHOD4cjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunk65GNHOD4cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunk65GNHOD4cjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunk65GNHOD4cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunk24ATT2PEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunk24ATT2PEcjs.defaultLayerEffect; exports.defaultShapeName = _chunk65GNHOD4cjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunk65GNHOD4cjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunk65GNHOD4cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunk65GNHOD4cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunk65GNHOD4cjs.deserializeEffects; exports.deserializeLayer = _chunk65GNHOD4cjs.deserializeLayer; exports.deserializeLayers = _chunk65GNHOD4cjs.deserializeLayers; exports.deserializePatterns = _chunk65GNHOD4cjs.deserializePatterns; exports.deserializeSelection = _chunk65GNHOD4cjs.deserializeSelection; exports.developFilter = _chunk65GNHOD4cjs.developFilter; exports.developFromAdjustments = _chunk65GNHOD4cjs.developFromAdjustments; exports.developTarget = _chunk65GNHOD4cjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkNVTHUPJ6cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunk65GNHOD4cjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunk65GNHOD4cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkNVTHUPJ6cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkNVTHUPJ6cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkF7GGEAO2cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunk65GNHOD4cjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunk24ATT2PEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunk24ATT2PEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunk24ATT2PEcjs.effectsFingerprint; exports.effectsMargin = _chunk24ATT2PEcjs.effectsMargin; exports.effectsScale = _chunk24ATT2PEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunk65GNHOD4cjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunk65GNHOD4cjs.encodeRle; exports.encodeSelectionRle = _chunk65GNHOD4cjs.encodeSelectionRle; exports.encodeSurface = _chunk65GNHOD4cjs.encodeSurface; exports.evalWarpMesh = _chunkF7GGEAO2cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunk65GNHOD4cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunk65GNHOD4cjs.expandCoverage; exports.exportPsd = _chunk65GNHOD4cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunk65GNHOD4cjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunk65GNHOD4cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunk24ATT2PEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkF7GGEAO2cjs.fitParagraphRuns; exports.fitRuns = _chunkF7GGEAO2cjs.fitRuns; exports.flattenLayers = _chunk24ATT2PEcjs.flattenLayers; exports.flattenPath = _chunk65GNHOD4cjs.flattenPath; exports.flipCorners = _chunk65GNHOD4cjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkF7GGEAO2cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunk65GNHOD4cjs.fullSelection; exports.gaussianBlur = _chunk24ATT2PEcjs.gaussianBlur; exports.geometryHomography = _chunk65GNHOD4cjs.geometryHomography; exports.getAnnotationBounds = _chunk65GNHOD4cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunk65GNHOD4cjs.getCropCursor; exports.getRotatedSize = _chunk65GNHOD4cjs.getRotatedSize; exports.getViewportMetrics = _chunk65GNHOD4cjs.getViewportMetrics; exports.getViewportProjection = _chunk65GNHOD4cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunk65GNHOD4cjs.greyMorphology; exports.groupLayers = _chunk65GNHOD4cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunk24ATT2PEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunk65GNHOD4cjs.hasResampledLegacyMask; exports.hasSurface = _chunk65GNHOD4cjs.hasSurface; exports.hasWarp = _chunk65GNHOD4cjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunk65GNHOD4cjs.hashMaskContent; exports.hashNoise = _chunk24ATT2PEcjs.hashNoise; exports.healPixels = _chunkNVTHUPJ6cjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunk65GNHOD4cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunk65GNHOD4cjs.hitTestAnnotation; exports.hitTestCrop = _chunk65GNHOD4cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunk65GNHOD4cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunk65GNHOD4cjs.hueRangeTables; exports.hueRangeWeight = _chunk65GNHOD4cjs.hueRangeWeight; exports.hueSaturation = _chunk65GNHOD4cjs.hueSaturation; exports.identityCurve = _chunk65GNHOD4cjs.identityCurve; exports.identityLevels = _chunk65GNHOD4cjs.identityLevels; exports.identityTransform = _chunk65GNHOD4cjs.identityTransform; exports.identityWarpMesh = _chunkF7GGEAO2cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunk65GNHOD4cjs.imageToCanvasPoint; exports.importPsd = _chunk65GNHOD4cjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunk24ATT2PEcjs.insertLayer; exports.instancesOf = _chunk65GNHOD4cjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunk65GNHOD4cjs.invertMatrix3; exports.invertSelection = _chunk65GNHOD4cjs.invertSelection; exports.isActiveFilter = _chunk65GNHOD4cjs.isActiveFilter; exports.isAdjustmentKind = _chunk65GNHOD4cjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunk65GNHOD4cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunk65GNHOD4cjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityTransform = _chunk65GNHOD4cjs.isIdentityTransform; exports.isInterpolation = _chunk24ATT2PEcjs.isInterpolation; exports.isLayerEffectKind = _chunk24ATT2PEcjs.isLayerEffectKind; exports.isLayerLocked = _chunk24ATT2PEcjs.isLayerLocked; exports.isLegacyShape = _chunk65GNHOD4cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunk65GNHOD4cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunk65GNHOD4cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunk65GNHOD4cjs.isSelectionEmpty; exports.isSelectionMode = _chunk65GNHOD4cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunk65GNHOD4cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunk65GNHOD4cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunk65GNHOD4cjs.isTransformAnchor; exports.isValidWarp = _chunk65GNHOD4cjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunk65GNHOD4cjs.kelvinToTemperature; exports.keysWeight = _chunk24ATT2PEcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunk24ATT2PEcjs.layerEffectFields; exports.layerEffectLabel = _chunk24ATT2PEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunk65GNHOD4cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunk65GNHOD4cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunk65GNHOD4cjs.layerMaskFromSelection; exports.layerMaskKey = _chunk65GNHOD4cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunk65GNHOD4cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunk65GNHOD4cjs.layerTree; exports.layerTypeLabel = _chunk65GNHOD4cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunk65GNHOD4cjs.layersFromLegacy; exports.layoutText = _chunkF7GGEAO2cjs.layoutText; exports.legacyAdjustmentLayer = _chunk65GNHOD4cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunk65GNHOD4cjs.legacyMaskOf; exports.legacyView = _chunk65GNHOD4cjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunk65GNHOD4cjs.levelsValue; exports.linearSrgbToXy = _chunk65GNHOD4cjs.linearSrgbToXy; exports.linearToSrgb = _chunk65GNHOD4cjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunk65GNHOD4cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunk65GNHOD4cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkNVTHUPJ6cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunk65GNHOD4cjs.mapCropHandle; exports.mapLayer = _chunk24ATT2PEcjs.mapLayer; exports.mapSubpaths = _chunk65GNHOD4cjs.mapSubpaths; exports.maskBounds = _chunkNVTHUPJ6cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunk65GNHOD4cjs.matrixFromCorners; exports.matrixFromParams = _chunk65GNHOD4cjs.matrixFromParams; exports.membraneFill = _chunkNVTHUPJ6cjs.membraneFill; exports.mergeLayerEffect = _chunk24ATT2PEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunk65GNHOD4cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunk65GNHOD4cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunk65GNHOD4cjs.moveLayer; exports.moveSmartFilter = _chunk65GNHOD4cjs.moveSmartFilter; exports.mulMatrix3 = _chunk65GNHOD4cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunk65GNHOD4cjs.neutralHueRange; exports.newContentsId = _chunk65GNHOD4cjs.newContentsId; exports.newEffectId = _chunk24ATT2PEcjs.newEffectId; exports.newLayerId = _chunk65GNHOD4cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunk65GNHOD4cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunk65GNHOD4cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunk65GNHOD4cjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunk65GNHOD4cjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunk24ATT2PEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunk65GNHOD4cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunk65GNHOD4cjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunk65GNHOD4cjs.normalizePlacement; exports.normalizeProcessVersion = _chunk65GNHOD4cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkNVTHUPJ6cjs.normalizeRetouch; exports.normalizeShapePaint = _chunk65GNHOD4cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunk65GNHOD4cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunk65GNHOD4cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunk65GNHOD4cjs.normalizeSubpaths; exports.normalizeText = _chunk65GNHOD4cjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunk65GNHOD4cjs.offsetLayer; exports.offsetShape = _chunk65GNHOD4cjs.offsetShape; exports.offsetSmartObject = _chunk65GNHOD4cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunkF7GGEAO2cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunk65GNHOD4cjs.parseAdjustmentBlock; exports.parseBlend = _chunk65GNHOD4cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunk24ATT2PEcjs.parseEffectColor; exports.parseLfx2 = _chunk65GNHOD4cjs.parseLfx2; exports.parseLrfx = _chunk65GNHOD4cjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunk65GNHOD4cjs.parsePatternBlock; exports.parseSelectionMode = _chunk65GNHOD4cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunk65GNHOD4cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunk65GNHOD4cjs.patchParagraphStyle; exports.patchTextStyle = _chunk65GNHOD4cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkNVTHUPJ6cjs.perDabStrength; exports.photoFilterMatrix = _chunk65GNHOD4cjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunk65GNHOD4cjs.pixelLayerBounds; exports.pixelLayers = _chunk65GNHOD4cjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunk65GNHOD4cjs.placeContents; exports.placeLayer = _chunk65GNHOD4cjs.placeLayer; exports.placementAt = _chunk65GNHOD4cjs.placementAt; exports.placementBounds = _chunk65GNHOD4cjs.placementBounds; exports.placementGeometry = _chunk65GNHOD4cjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunk65GNHOD4cjs.posterizeValue; exports.presetWarp = _chunk65GNHOD4cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunk65GNHOD4cjs.projectImagePoint; exports.projectImageRect = _chunk65GNHOD4cjs.projectImageRect; exports.projectMaskCoverage = _chunk65GNHOD4cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunk65GNHOD4cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunk65GNHOD4cjs.psdToLayers; exports.pullWarpMesh = _chunkF7GGEAO2cjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunk65GNHOD4cjs.rangeLightness; exports.rasterContents = _chunk65GNHOD4cjs.rasterContents; exports.rasterMaskFromLegacy = _chunk65GNHOD4cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunk65GNHOD4cjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunk65GNHOD4cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunk65GNHOD4cjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkNVTHUPJ6cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunk24ATT2PEcjs.reduceSurface; exports.referencePoint = _chunk65GNHOD4cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunk65GNHOD4cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunk65GNHOD4cjs.removeLayer; exports.removeLayerEffect = _chunk65GNHOD4cjs.removeLayerEffect; exports.removeLayerFilter = _chunk65GNHOD4cjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunk65GNHOD4cjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunk24ATT2PEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunk65GNHOD4cjs.renderShape; exports.renderShapeRect = _chunk65GNHOD4cjs.renderShapeRect; exports.renderSmartObject = _chunk65GNHOD4cjs.renderSmartObject; exports.renderText = _chunk65GNHOD4cjs.renderText; exports.replaceContents = _chunk65GNHOD4cjs.replaceContents; exports.replaceTextRange = _chunk65GNHOD4cjs.replaceTextRange; exports.requireLayer = _chunk65GNHOD4cjs.requireLayer; exports.requireOperation = _chunk65GNHOD4cjs.requireOperation; exports.requireShapeLayer = _chunk65GNHOD4cjs.requireShapeLayer; exports.requireSmartObject = _chunk65GNHOD4cjs.requireSmartObject; exports.requireTypeLayer = _chunk65GNHOD4cjs.requireTypeLayer; exports.requireUnlocked = _chunk65GNHOD4cjs.requireUnlocked; exports.rerender = _chunk65GNHOD4cjs.rerender; exports.rerenderShape = _chunk65GNHOD4cjs.rerenderShape; exports.rerenderText = _chunk65GNHOD4cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunk65GNHOD4cjs.resizeSelection; exports.resizeWarpMesh = _chunkF7GGEAO2cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunk65GNHOD4cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkF7GGEAO2cjs.restyleRange; exports.retouchFilter = _chunkNVTHUPJ6cjs.retouchFilter; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunk65GNHOD4cjs.rgbToGray; exports.rgbToHsl = _chunk65GNHOD4cjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkNVTHUPJ6cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunk65GNHOD4cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunk65GNHOD4cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunk65GNHOD4cjs.sampleLut; exports.sampleToneLut = _chunk65GNHOD4cjs.sampleToneLut; exports.saturationOf = _chunkNVTHUPJ6cjs.saturationOf; exports.scaleLayerEffect = _chunk24ATT2PEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkNVTHUPJ6cjs.seamlessClone; exports.selectionArea = _chunk65GNHOD4cjs.selectionArea; exports.selectionFromCoverage = _chunk65GNHOD4cjs.selectionFromCoverage; exports.selectionFromPixels = _chunk65GNHOD4cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunk65GNHOD4cjs.selectionToCoverage; exports.selectionToPixels = _chunk65GNHOD4cjs.selectionToPixels; exports.selectionValueAt = _chunk65GNHOD4cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunk65GNHOD4cjs.serializeContents; exports.serializeEffects = _chunk65GNHOD4cjs.serializeEffects; exports.serializeLayer = _chunk65GNHOD4cjs.serializeLayer; exports.serializeLayers = _chunk65GNHOD4cjs.serializeLayers; exports.serializeLayersExternal = _chunk65GNHOD4cjs.serializeLayersExternal; exports.serializePatterns = _chunk65GNHOD4cjs.serializePatterns; exports.serializeSelection = _chunk65GNHOD4cjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunk65GNHOD4cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunk65GNHOD4cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunk65GNHOD4cjs.setLayerMask; exports.setLayerProperties = _chunk65GNHOD4cjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunk65GNHOD4cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunk65GNHOD4cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunk65GNHOD4cjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunk65GNHOD4cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunk65GNHOD4cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunk65GNHOD4cjs.shapeGeometryBounds; exports.shapeLayers = _chunk65GNHOD4cjs.shapeLayers; exports.shapeOutline = _chunk65GNHOD4cjs.shapeOutline; exports.shapeRenderClip = _chunk65GNHOD4cjs.shapeRenderClip; exports.shiftCoverage = _chunk65GNHOD4cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunk65GNHOD4cjs.smartObjectLayers; exports.smoothCoverage = _chunk65GNHOD4cjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkNVTHUPJ6cjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkNVTHUPJ6cjs.solveMembrane; exports.spliceRuns = _chunkF7GGEAO2cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkNVTHUPJ6cjs.sponge; exports.spongeEffect = _chunkNVTHUPJ6cjs.spongeEffect; exports.spotHealPixels = _chunkNVTHUPJ6cjs.spotHealPixels; exports.spotHealWindow = _chunkNVTHUPJ6cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunk65GNHOD4cjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkF7GGEAO2cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunk65GNHOD4cjs.tempTintToXy; exports.temperatureToKelvin = _chunk65GNHOD4cjs.temperatureToKelvin; exports.textIndexAt = _chunkF7GGEAO2cjs.textIndexAt; exports.textMatrix = _chunk65GNHOD4cjs.textMatrix; exports.textOutlines = _chunk65GNHOD4cjs.textOutlines; exports.textRange = _chunk65GNHOD4cjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunk65GNHOD4cjs.toTextSpace; exports.toneCurve = _chunk65GNHOD4cjs.toneCurve; exports.toneLuts = _chunk65GNHOD4cjs.toneLuts; exports.toneOf = _chunkNVTHUPJ6cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunk65GNHOD4cjs.transformHomography; exports.transformMap = _chunk65GNHOD4cjs.transformMap; exports.transformShapeComponents = _chunk65GNHOD4cjs.transformShapeComponents; exports.transformSurface = _chunk24ATT2PEcjs.transformSurface; exports.transformTypeLayer = _chunk65GNHOD4cjs.transformTypeLayer; exports.transformedBounds = _chunk24ATT2PEcjs.transformedBounds; exports.transformedBox = _chunk65GNHOD4cjs.transformedBox; exports.transformedPoint = _chunk65GNHOD4cjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunk65GNHOD4cjs.typeAsPixelLayer; exports.typeFrame = _chunk65GNHOD4cjs.typeFrame; exports.typeFromAnnotation = _chunk65GNHOD4cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunk65GNHOD4cjs.typeLayerName; exports.ungroupLayer = _chunk65GNHOD4cjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunk65GNHOD4cjs.unionRect; exports.unprojectCanvasPoint = _chunk65GNHOD4cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunk65GNHOD4cjs.updateLayerEffect; exports.updateLayerFilter = _chunk65GNHOD4cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunk65GNHOD4cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunk65GNHOD4cjs.updateShapeLayer; exports.updateSmartFilter = _chunk65GNHOD4cjs.updateSmartFilter; exports.updateTypeLayer = _chunk65GNHOD4cjs.updateTypeLayer; exports.uvToXy = _chunk65GNHOD4cjs.uvToXy; exports.validateEffectGradient = _chunk24ATT2PEcjs.validateEffectGradient; exports.validateLayerEffect = _chunk24ATT2PEcjs.validateLayerEffect; exports.validateLayerEffects = _chunk24ATT2PEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunk65GNHOD4cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunk65GNHOD4cjs.vibranceLinear; exports.vibrancePixel = _chunk65GNHOD4cjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkF7GGEAO2cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkF7GGEAO2cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkF7GGEAO2cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkF7GGEAO2cjs.warpPresetMesh; exports.warpSurface = _chunk24ATT2PEcjs.warpSurface; exports.wbMatrix = _chunk65GNHOD4cjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunk65GNHOD4cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunk65GNHOD4cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunk65GNHOD4cjs.withFilterMaskSurface; exports.withNewIds = _chunk65GNHOD4cjs.withNewIds; exports.writeAdjustmentBlock = _chunk65GNHOD4cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunk65GNHOD4cjs.writeLfx2; exports.writePatternBlock = _chunk65GNHOD4cjs.writePatternBlock; exports.writePsd = _chunk65GNHOD4cjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunk65GNHOD4cjs.xyToTempTint; exports.xyToUv = _chunk65GNHOD4cjs.xyToUv;
16002
+
16003
+
16004
+
16005
+
16006
+
16007
+
16008
+
16009
+ exports.ADJUSTMENT_KEYS = _chunkYAFS2QFZcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkYAFS2QFZcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkYAFS2QFZcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkYAFS2QFZcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkYAFS2QFZcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkYAFS2QFZcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkJ5BA3BQ6cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkJ5BA3BQ6cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkYAFS2QFZcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkFHPVDTI2cjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkZ6OUCS2Kcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk6GFRKLLScjs.CoverageMap; exports.D50 = _chunkYAFS2QFZcjs.D50; exports.D65 = _chunkYAFS2QFZcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkZ2H7KECKcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk6GFRKLLScjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk6GFRKLLScjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkFHPVDTI2cjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunk24ATT2PEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkYAFS2QFZcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk6GFRKLLScjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk6GFRKLLScjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYT3JL7YMcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk6GFRKLLScjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkZ2H7KECKcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkFHPVDTI2cjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkFHPVDTI2cjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkYAFS2QFZcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunk24ATT2PEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkFHPVDTI2cjs.DRY_EPS; exports.DabWalker = _chunk6GFRKLLScjs.DabWalker; exports.EMPTY_DISTANCE = _chunkYAFS2QFZcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk6GFRKLLScjs.EMPTY_MIXER_LOAD; exports.EX = _chunkFHPVDTI2cjs.EX; exports.EY = _chunkFHPVDTI2cjs.EY; exports.FLAG_ALIVE = _chunkFHPVDTI2cjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkFHPVDTI2cjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkFHPVDTI2cjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkFHPVDTI2cjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkFHPVDTI2cjs.FLAG_TOP; exports.FLAG_WET = _chunkFHPVDTI2cjs.FLAG_WET; exports.FLAT = _chunkFHPVDTI2cjs.FLAT; exports.FREE_INTERVAL = _chunkFHPVDTI2cjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkYAFS2QFZcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkFHPVDTI2cjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkYAFS2QFZcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYT3JL7YMcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkYAFS2QFZcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunk24ATT2PEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkYAFS2QFZcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkYAFS2QFZcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunk24ATT2PEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkYAFS2QFZcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkYAFS2QFZcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkYAFS2QFZcjs.LUMA_709; exports.LayerCompositor = _chunkYAFS2QFZcjs.LayerCompositor; exports.LayerEffectError = _chunk24ATT2PEcjs.LayerEffectError; exports.LayerOperationError = _chunkYAFS2QFZcjs.LayerOperationError; exports.MAX_BATCH = _chunkFHPVDTI2cjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk6GFRKLLScjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunk24ATT2PEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkYAFS2QFZcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkFHPVDTI2cjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunk24ATT2PEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkFHPVDTI2cjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkFHPVDTI2cjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkYAFS2QFZcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkYAFS2QFZcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk6GFRKLLScjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk6GFRKLLScjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk6GFRKLLScjs.MIXING_MODELS; exports.MixerStroke = _chunk6GFRKLLScjs.MixerStroke; exports.OPP = _chunkFHPVDTI2cjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkJ5BA3BQ6cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk6GFRKLLScjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk6GFRKLLScjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk6GFRKLLScjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk6GFRKLLScjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk6GFRKLLScjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkFHPVDTI2cjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkYAFS2QFZcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkFHPVDTI2cjs.PARAM; exports.PARAM_FLOATS = _chunkFHPVDTI2cjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkYAFS2QFZcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkJ5BA3BQ6cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkFHPVDTI2cjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkJ5BA3BQ6cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkFHPVDTI2cjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkJ5BA3BQ6cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkFHPVDTI2cjs.PLANE; exports.PLANE_BYTES = _chunkFHPVDTI2cjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkYAFS2QFZcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkFHPVDTI2cjs.P_D0; exports.P_EDGE = _chunkFHPVDTI2cjs.P_EDGE; exports.P_FX = _chunkFHPVDTI2cjs.P_FX; exports.P_FY = _chunkFHPVDTI2cjs.P_FY; exports.P_H = _chunkFHPVDTI2cjs.P_H; exports.P_P0 = _chunkFHPVDTI2cjs.P_P0; exports.P_RHO = _chunkFHPVDTI2cjs.P_RHO; exports.P_SW = _chunkFHPVDTI2cjs.P_SW; exports.P_UX = _chunkFHPVDTI2cjs.P_UX; exports.P_UY = _chunkFHPVDTI2cjs.P_UY; exports.PaintExchange = _chunk6GFRKLLScjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk6GFRKLLScjs.PaintGradientSampler; exports.PaintSourceError = _chunk6GFRKLLScjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunk24ATT2PEcjs.PatternPlacement; exports.PatternTile = _chunk24ATT2PEcjs.PatternTile; exports.PsdError = _chunkYAFS2QFZcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYT3JL7YMcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYT3JL7YMcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYT3JL7YMcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkYAFS2QFZcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkYAFS2QFZcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkFHPVDTI2cjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkJ5BA3BQ6cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkYAFS2QFZcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkYAFS2QFZcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkFHPVDTI2cjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkFHPVDTI2cjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkFHPVDTI2cjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkYAFS2QFZcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYT3JL7YMcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkFHPVDTI2cjs.SRGB_TO_LINEAR; exports.STRIP = _chunkFHPVDTI2cjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkYAFS2QFZcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk6GFRKLLScjs.SmudgeTip; exports.StrokeCoverage = _chunk6GFRKLLScjs.StrokeCoverage; exports.SurfaceDraft = _chunkJ5BA3BQ6cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkYAFS2QFZcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkYAFS2QFZcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkYAFS2QFZcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkJ5BA3BQ6cjs.TILE; exports.TILE_SHIFT = _chunkJ5BA3BQ6cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkYAFS2QFZcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk6GFRKLLScjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkYAFS2QFZcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYT3JL7YMcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkYAFS2QFZcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk6GFRKLLScjs.TileMedium; exports.TilePixelSource = _chunkYT3JL7YMcjs.TilePixelSource; exports.TiledSurface = _chunkJ5BA3BQ6cjs.TiledSurface; exports.TransformTooLargeError = _chunk24ATT2PEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYT3JL7YMcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkFHPVDTI2cjs.U_MAX; exports.VIBRANCE_GREY = _chunkYAFS2QFZcjs.VIBRANCE_GREY; exports.W9 = _chunkFHPVDTI2cjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkZ2H7KECKcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkZ2H7KECKcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkFHPVDTI2cjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkFHPVDTI2cjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkFHPVDTI2cjs.WET_TILE; exports.WGSL_HALO = _chunkFHPVDTI2cjs.WGSL_HALO; exports.WGSL_SHADE = _chunkFHPVDTI2cjs.WGSL_SHADE; exports.WGSL_STEP = _chunkFHPVDTI2cjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkFHPVDTI2cjs.WetGpuEngine; exports.WetMedium = _chunkFHPVDTI2cjs.WetMedium; exports.WetWorkerPool = _chunkFHPVDTI2cjs.WetWorkerPool; exports.WetWorld = _chunkFHPVDTI2cjs.WetWorld; exports.WetWorldError = _chunkFHPVDTI2cjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkYAFS2QFZcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkYAFS2QFZcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkYAFS2QFZcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkYAFS2QFZcjs.activeSmartFilters; exports.addLayerEffect = _chunkYAFS2QFZcjs.addLayerEffect; exports.addLayerFilter = _chunkYAFS2QFZcjs.addLayerFilter; exports.addPaintGradientStop = _chunk6GFRKLLScjs.addPaintGradientStop; exports.addSmartFilter = _chunkYAFS2QFZcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkYAFS2QFZcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkYAFS2QFZcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkYAFS2QFZcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkYAFS2QFZcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkYAFS2QFZcjs.anchorPoint; exports.annotationBlend = _chunkYAFS2QFZcjs.annotationBlend; exports.annotationLayerFor = _chunkYAFS2QFZcjs.annotationLayerFor; exports.annotationLayerName = _chunkYAFS2QFZcjs.annotationLayerName; exports.annotationOfLayer = _chunkYAFS2QFZcjs.annotationOfLayer; exports.annotationOfShape = _chunkYAFS2QFZcjs.annotationOfShape; exports.annotationOfType = _chunkYAFS2QFZcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkYAFS2QFZcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkYAFS2QFZcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkYAFS2QFZcjs.applyAdjustments; exports.applyBoxBlur = _chunkYAFS2QFZcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkYAFS2QFZcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkYAFS2QFZcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkYAFS2QFZcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkYAFS2QFZcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkYAFS2QFZcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkYAFS2QFZcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkYAFS2QFZcjs.applyParams; exports.applyProcess2Adjustments = _chunkYAFS2QFZcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkYAFS2QFZcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYT3JL7YMcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkYAFS2QFZcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk6GFRKLLScjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk6GFRKLLScjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYT3JL7YMcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkYAFS2QFZcjs.backgroundLayer; exports.base64ToBytes = _chunkDCLJNVZScjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkYT3JL7YMcjs.bestOffset; exports.blackWhiteGray = _chunkYAFS2QFZcjs.blackWhiteGray; exports.blendChannel = _chunkJ5BA3BQ6cjs.blendChannel; exports.blendImageData = _chunkJ5BA3BQ6cjs.blendImageData; exports.blendLum = _chunkJ5BA3BQ6cjs.blendLum; exports.blendPixel = _chunkJ5BA3BQ6cjs.blendPixel; exports.blendRadius = _chunk6GFRKLLScjs.blendRadius; exports.blendRgb = _chunkJ5BA3BQ6cjs.blendRgb; exports.blendTile = _chunk24ATT2PEcjs.blendTile; exports.blenderDab = _chunk6GFRKLLScjs.blenderDab; exports.blurFilter = _chunkYAFS2QFZcjs.blurFilter; exports.borderCoverage = _chunkYAFS2QFZcjs.borderCoverage; exports.boxBlurPixels = _chunkYT3JL7YMcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkYAFS2QFZcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkYAFS2QFZcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkZ6OUCS2Kcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkZ6OUCS2Kcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkZ6OUCS2Kcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkZ6OUCS2Kcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkZ6OUCS2Kcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkYAFS2QFZcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkYAFS2QFZcjs.buildToneLut; exports.builtinPattern = _chunk24ATT2PEcjs.builtinPattern; exports.builtinPatternIds = _chunk24ATT2PEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkDCLJNVZScjs.bytesToBase64; exports.calculateCropDrag = _chunkYAFS2QFZcjs.calculateCropDrag; exports.canShareMemory = _chunkFHPVDTI2cjs.canShareMemory; exports.canvasCompositeOperation = _chunkJ5BA3BQ6cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkYAFS2QFZcjs.canvasToImagePoint; exports.caretAt = _chunkZ2H7KECKcjs.caretAt; exports.changedTiles = _chunk24ATT2PEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkYAFS2QFZcjs.clampCropToImage; exports.cleanMixer = _chunk6GFRKLLScjs.cleanMixer; exports.cloneSamplePoint = _chunkYT3JL7YMcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkJ5BA3BQ6cjs.collectTiles; exports.colorBalanceChannel = _chunkYAFS2QFZcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkYAFS2QFZcjs.combineSelections; exports.compileAdjustmentLayer = _chunkYAFS2QFZcjs.compileAdjustmentLayer; exports.componentPath = _chunkYAFS2QFZcjs.componentPath; exports.compositeDeep = _chunkYAFS2QFZcjs.compositeDeep; exports.compositeSurfaceOver = _chunk24ATT2PEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkYAFS2QFZcjs.computeSelectionBounds; exports.contentAwareFill = _chunkYT3JL7YMcjs.contentAwareFill; exports.contentBounds = _chunkJ5BA3BQ6cjs.contentBounds; exports.contentsBox = _chunkYAFS2QFZcjs.contentsBox; exports.contentsSurface = _chunkYAFS2QFZcjs.contentsSurface; exports.contractCoverage = _chunkYAFS2QFZcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkJ5BA3BQ6cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkYAFS2QFZcjs.convertToSmartObject; exports.copySmartObject = _chunkYAFS2QFZcjs.copySmartObject; exports.cornersFromMatrix = _chunkYAFS2QFZcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk6GFRKLLScjs.coverageTileCoord; exports.coverageToByte = _chunkYAFS2QFZcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkYAFS2QFZcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk6GFRKLLScjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkZ2H7KECKcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkZ2H7KECKcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkZ2H7KECKcjs.createOutlineTextShaper; exports.createPigment = _chunkJ5BA3BQ6cjs.createPigment; exports.createPigmentTools = _chunkFHPVDTI2cjs.createPigmentTools; exports.createSelectionMask = _chunkYAFS2QFZcjs.createSelectionMask; exports.createShapeLayer = _chunkYAFS2QFZcjs.createShapeLayer; exports.createTypeLayer = _chunkYAFS2QFZcjs.createTypeLayer; exports.createWetGpuEngine = _chunkFHPVDTI2cjs.createWetGpuEngine; exports.cssFont = _chunkZ2H7KECKcjs.cssFont; exports.cssFontFamily = _chunkZ2H7KECKcjs.cssFontFamily; exports.curveLut = _chunk24ATT2PEcjs.curveLut; exports.curveLutFromLevels = _chunkYAFS2QFZcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk6GFRKLLScjs.dabCoverage; exports.dabRect = _chunk6GFRKLLScjs.dabRect; exports.decodeDeepSurface = _chunkYAFS2QFZcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkYAFS2QFZcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkYAFS2QFZcjs.decodeLayerMask; exports.decodeMergedImage = _chunkYAFS2QFZcjs.decodeMergedImage; exports.decodePlanes = _chunkYAFS2QFZcjs.decodePlanes; exports.decodePng = _chunkDCLJNVZScjs.decodePng; exports.decodePngDataUrl = _chunkYAFS2QFZcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkYAFS2QFZcjs.decodeSelectionRle; exports.deepBytes = _chunkJ5BA3BQ6cjs.deepBytes; exports.deepTile = _chunkJ5BA3BQ6cjs.deepTile; exports.defaultAdjustmentParams = _chunkYAFS2QFZcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunk24ATT2PEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunk24ATT2PEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkYAFS2QFZcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkYAFS2QFZcjs.depthMaskAlpha; exports.depthOf = _chunkJ5BA3BQ6cjs.depthOf; exports.depthRasterMask = _chunkYAFS2QFZcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkYAFS2QFZcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkYAFS2QFZcjs.deserializeEffects; exports.deserializeLayer = _chunkYAFS2QFZcjs.deserializeLayer; exports.deserializeLayers = _chunkYAFS2QFZcjs.deserializeLayers; exports.deserializePatterns = _chunkYAFS2QFZcjs.deserializePatterns; exports.deserializeSelection = _chunkYAFS2QFZcjs.deserializeSelection; exports.developFilter = _chunkYAFS2QFZcjs.developFilter; exports.developFromAdjustments = _chunkYAFS2QFZcjs.developFromAdjustments; exports.developTarget = _chunkYAFS2QFZcjs.developTarget; exports.dexp = _chunkFHPVDTI2cjs.dexp; exports.dilateMask = _chunkYT3JL7YMcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkYAFS2QFZcjs.distanceTransform; exports.dlog = _chunkFHPVDTI2cjs.dlog; exports.documentContents = _chunkYAFS2QFZcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYT3JL7YMcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYT3JL7YMcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkFHPVDTI2cjs.dpow; exports.dragWarpMeshPoint = _chunkZ2H7KECKcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkFHPVDTI2cjs.dsincos; exports.duplicateLayer = _chunkYAFS2QFZcjs.duplicateLayer; exports.edgeBits = _chunkFHPVDTI2cjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunk24ATT2PEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunk24ATT2PEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunk24ATT2PEcjs.effectsFingerprint; exports.effectsMargin = _chunk24ATT2PEcjs.effectsMargin; exports.effectsScale = _chunk24ATT2PEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkJ5BA3BQ6cjs.emptySurface; exports.encodeDeepSurface = _chunkYAFS2QFZcjs.encodeDeepSurface; exports.encodePng = _chunkDCLJNVZScjs.encodePng; exports.encodeRle = _chunkYAFS2QFZcjs.encodeRle; exports.encodeSelectionRle = _chunkYAFS2QFZcjs.encodeSelectionRle; exports.encodeSurface = _chunkYAFS2QFZcjs.encodeSurface; exports.evalWarpMesh = _chunkZ2H7KECKcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkYAFS2QFZcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk6GFRKLLScjs.exchangeRates; exports.expNeg = _chunkFHPVDTI2cjs.expNeg; exports.expandCoverage = _chunkYAFS2QFZcjs.expandCoverage; exports.exportPsd = _chunkYAFS2QFZcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkYAFS2QFZcjs.featherCoverage; exports.fillRect = _chunkJ5BA3BQ6cjs.fillRect; exports.filmPixel = _chunkFHPVDTI2cjs.filmPixel; exports.filmReflectance = _chunkFHPVDTI2cjs.filmReflectance; exports.filterMaskCoverage = _chunkYAFS2QFZcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunk24ATT2PEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkFHPVDTI2cjs.findWebGpu; exports.finishTile = _chunkJ5BA3BQ6cjs.finishTile; exports.fitParagraphRuns = _chunkZ2H7KECKcjs.fitParagraphRuns; exports.fitRuns = _chunkZ2H7KECKcjs.fitRuns; exports.flattenLayers = _chunk24ATT2PEcjs.flattenLayers; exports.flattenPath = _chunkYAFS2QFZcjs.flattenPath; exports.flipCorners = _chunkYAFS2QFZcjs.flipCorners; exports.flowField = _chunkFHPVDTI2cjs.flowField; exports.fontOf = _chunkZ2H7KECKcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkYAFS2QFZcjs.fullSelection; exports.gaussianBlur = _chunk24ATT2PEcjs.gaussianBlur; exports.geometryHomography = _chunkYAFS2QFZcjs.geometryHomography; exports.getAnnotationBounds = _chunkYAFS2QFZcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkYAFS2QFZcjs.getCropCursor; exports.getRotatedSize = _chunkYAFS2QFZcjs.getRotatedSize; exports.getViewportMetrics = _chunkYAFS2QFZcjs.getViewportMetrics; exports.getViewportProjection = _chunkYAFS2QFZcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk6GFRKLLScjs.gradientDabColor; exports.greyMorphology = _chunkYAFS2QFZcjs.greyMorphology; exports.groupLayers = _chunkYAFS2QFZcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunk24ATT2PEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkYAFS2QFZcjs.hasResampledLegacyMask; exports.hasSurface = _chunkYAFS2QFZcjs.hasSurface; exports.hasWarp = _chunkYAFS2QFZcjs.hasWarp; exports.hash2 = _chunk6GFRKLLScjs.hash2; exports.hashMaskContent = _chunkYAFS2QFZcjs.hashMaskContent; exports.hashNoise = _chunk24ATT2PEcjs.hashNoise; exports.healPixels = _chunkYT3JL7YMcjs.healPixels; exports.hexToPaintRgb = _chunk6GFRKLLScjs.hexToPaintRgb; exports.hexToRgb = _chunkYAFS2QFZcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkYAFS2QFZcjs.hitTestAnnotation; exports.hitTestCrop = _chunkYAFS2QFZcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkYAFS2QFZcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkYAFS2QFZcjs.hueRangeTables; exports.hueRangeWeight = _chunkYAFS2QFZcjs.hueRangeWeight; exports.hueSaturation = _chunkYAFS2QFZcjs.hueSaturation; exports.identityCurve = _chunkYAFS2QFZcjs.identityCurve; exports.identityLevels = _chunkYAFS2QFZcjs.identityLevels; exports.identityTransform = _chunkYAFS2QFZcjs.identityTransform; exports.identityWarpMesh = _chunkZ2H7KECKcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkYAFS2QFZcjs.imageToCanvasPoint; exports.importPsd = _chunkYAFS2QFZcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunk24ATT2PEcjs.insertLayer; exports.instancesOf = _chunkYAFS2QFZcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkYAFS2QFZcjs.invertMatrix3; exports.invertSelection = _chunkYAFS2QFZcjs.invertSelection; exports.isActiveFilter = _chunkYAFS2QFZcjs.isActiveFilter; exports.isAdjustmentKind = _chunkYAFS2QFZcjs.isAdjustmentKind; exports.isBitDepth = _chunkJ5BA3BQ6cjs.isBitDepth; exports.isBlendMode = _chunkJ5BA3BQ6cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkZ6OUCS2Kcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkYAFS2QFZcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkYAFS2QFZcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk6GFRKLLScjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYT3JL7YMcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkYAFS2QFZcjs.isIdentityTransform; exports.isInterpolation = _chunk24ATT2PEcjs.isInterpolation; exports.isLayerEffectKind = _chunk24ATT2PEcjs.isLayerEffectKind; exports.isLayerLocked = _chunk24ATT2PEcjs.isLayerLocked; exports.isLegacyShape = _chunkYAFS2QFZcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkJ5BA3BQ6cjs.isPainterlyBlendMode; exports.isPng = _chunkDCLJNVZScjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkYAFS2QFZcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkYAFS2QFZcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkYAFS2QFZcjs.isSelectionEmpty; exports.isSelectionMode = _chunkYAFS2QFZcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkJ5BA3BQ6cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkYAFS2QFZcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkYAFS2QFZcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkYAFS2QFZcjs.isTransformAnchor; exports.isValidWarp = _chunkYAFS2QFZcjs.isValidWarp; exports.keepDeepSamples = _chunkJ5BA3BQ6cjs.keepDeepSamples; exports.kelvinToTemperature = _chunkYAFS2QFZcjs.kelvinToTemperature; exports.keysWeight = _chunk24ATT2PEcjs.keysWeight; exports.latticeViscosity = _chunkFHPVDTI2cjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunk24ATT2PEcjs.layerEffectFields; exports.layerEffectLabel = _chunk24ATT2PEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkYAFS2QFZcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkYAFS2QFZcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkYAFS2QFZcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkYAFS2QFZcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkYAFS2QFZcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkYAFS2QFZcjs.layerTree; exports.layerTypeLabel = _chunkYAFS2QFZcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkYAFS2QFZcjs.layersFromLegacy; exports.layoutText = _chunkZ2H7KECKcjs.layoutText; exports.legacyAdjustmentLayer = _chunkYAFS2QFZcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkYAFS2QFZcjs.legacyMaskOf; exports.legacyView = _chunkYAFS2QFZcjs.legacyView; exports.lerpPigment = _chunkJ5BA3BQ6cjs.lerpPigment; exports.lerpPigmentInto = _chunkJ5BA3BQ6cjs.lerpPigmentInto; exports.levelsValue = _chunkYAFS2QFZcjs.levelsValue; exports.linearSrgbToXy = _chunkYAFS2QFZcjs.linearSrgbToXy; exports.linearToSrgb = _chunkYAFS2QFZcjs.linearToSrgb; exports.linearToSrgb8 = _chunkFHPVDTI2cjs.linearToSrgb8; exports.liveComponent = _chunkYAFS2QFZcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkYAFS2QFZcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk6GFRKLLScjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkFHPVDTI2cjs.loadWetKernel; exports.luma = _chunkYT3JL7YMcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkYAFS2QFZcjs.mapCropHandle; exports.mapLayer = _chunk24ATT2PEcjs.mapLayer; exports.mapSubpaths = _chunkYAFS2QFZcjs.mapSubpaths; exports.maskBounds = _chunkYT3JL7YMcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkYAFS2QFZcjs.matrixFromCorners; exports.matrixFromParams = _chunkYAFS2QFZcjs.matrixFromParams; exports.membraneFill = _chunkYT3JL7YMcjs.membraneFill; exports.mergeLayerEffect = _chunk24ATT2PEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkYAFS2QFZcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk6GFRKLLScjs.mix32; exports.mixPigment8 = _chunkJ5BA3BQ6cjs.mixPigment8; exports.mixPigmentRgb = _chunkJ5BA3BQ6cjs.mixPigmentRgb; exports.mixPigments = _chunkJ5BA3BQ6cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk6GFRKLLScjs.mixerRates; exports.modifySelection = _chunkYAFS2QFZcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkYAFS2QFZcjs.moveLayer; exports.moveSmartFilter = _chunkYAFS2QFZcjs.moveSmartFilter; exports.mulMatrix3 = _chunkYAFS2QFZcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkYAFS2QFZcjs.neutralHueRange; exports.newContentsId = _chunkYAFS2QFZcjs.newContentsId; exports.newEffectId = _chunk24ATT2PEcjs.newEffectId; exports.newLayerId = _chunkYAFS2QFZcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkYAFS2QFZcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkYAFS2QFZcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkYAFS2QFZcjs.normalizeAngle; exports.normalizeBlendMode = _chunkJ5BA3BQ6cjs.normalizeBlendMode; exports.normalizeBlender = _chunk6GFRKLLScjs.normalizeBlender; exports.normalizeBrush = _chunk6GFRKLLScjs.normalizeBrush; exports.normalizeFilter = _chunkYAFS2QFZcjs.normalizeFilter; exports.normalizeFlow = _chunkFHPVDTI2cjs.normalizeFlow; exports.normalizeHexColor = _chunk6GFRKLLScjs.normalizeHexColor; exports.normalizeLayerEffects = _chunk24ATT2PEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkYAFS2QFZcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkYAFS2QFZcjs.normalizeLiveShape; exports.normalizeMixer = _chunk6GFRKLLScjs.normalizeMixer; exports.normalizePlacement = _chunkYAFS2QFZcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkYAFS2QFZcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYT3JL7YMcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkYAFS2QFZcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkYAFS2QFZcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkYAFS2QFZcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk6GFRKLLScjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkYAFS2QFZcjs.normalizeSubpaths; exports.normalizeText = _chunkYAFS2QFZcjs.normalizeText; exports.normalizeTilt = _chunkFHPVDTI2cjs.normalizeTilt; exports.normalizeWetParams = _chunkFHPVDTI2cjs.normalizeWetParams; exports.offsetLayer = _chunkYAFS2QFZcjs.offsetLayer; exports.offsetShape = _chunkYAFS2QFZcjs.offsetShape; exports.offsetSmartObject = _chunkYAFS2QFZcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkJ5BA3BQ6cjs.packRgba; exports.packWetParams = _chunkFHPVDTI2cjs.packWetParams; exports.paintGradientMappingFor = _chunk6GFRKLLScjs.paintGradientMappingFor; exports.paintPathStroke = _chunkZ6OUCS2Kcjs.paintPathStroke; exports.paintSourceColor = _chunk6GFRKLLScjs.paintSourceColor; exports.paintSourceCss = _chunk6GFRKLLScjs.paintSourceCss; exports.paragraphRanges = _chunkZ2H7KECKcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkYAFS2QFZcjs.parseAdjustmentBlock; exports.parseBlend = _chunkYAFS2QFZcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkDCLJNVZScjs.parseDataUrl; exports.parseEffectColor = _chunk24ATT2PEcjs.parseEffectColor; exports.parseLfx2 = _chunkYAFS2QFZcjs.parseLfx2; exports.parseLrfx = _chunkYAFS2QFZcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk6GFRKLLScjs.parsePaintSource; exports.parsePatternBlock = _chunkYAFS2QFZcjs.parsePatternBlock; exports.parseSelectionMode = _chunkYAFS2QFZcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkYAFS2QFZcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkYAFS2QFZcjs.patchParagraphStyle; exports.patchTextStyle = _chunkYAFS2QFZcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkZ6OUCS2Kcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkZ6OUCS2Kcjs.pathStrokeDabs; exports.perDabStrength = _chunkYT3JL7YMcjs.perDabStrength; exports.photoFilterMatrix = _chunkYAFS2QFZcjs.photoFilterMatrix; exports.pigment8 = _chunkJ5BA3BQ6cjs.pigment8; exports.pigmentColor = _chunkFHPVDTI2cjs.pigmentColor; exports.pigmentOf = _chunkFHPVDTI2cjs.pigmentOf; exports.pixelLayerBounds = _chunkYAFS2QFZcjs.pixelLayerBounds; exports.pixelLayers = _chunkYAFS2QFZcjs.pixelLayers; exports.pixelPigment = _chunkFHPVDTI2cjs.pixelPigment; exports.placeContents = _chunkYAFS2QFZcjs.placeContents; exports.placeLayer = _chunkYAFS2QFZcjs.placeLayer; exports.placementAt = _chunkYAFS2QFZcjs.placementAt; exports.placementBounds = _chunkYAFS2QFZcjs.placementBounds; exports.placementGeometry = _chunkYAFS2QFZcjs.placementGeometry; exports.pngDataUrl = _chunkDCLJNVZScjs.pngDataUrl; exports.pointerPressure = _chunkFHPVDTI2cjs.pointerPressure; exports.pointerStrokeSample = _chunkFHPVDTI2cjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkFHPVDTI2cjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkYAFS2QFZcjs.posterizeValue; exports.presetWarp = _chunkYAFS2QFZcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkYAFS2QFZcjs.projectImagePoint; exports.projectImageRect = _chunkYAFS2QFZcjs.projectImageRect; exports.projectMaskCoverage = _chunkYAFS2QFZcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkJ5BA3BQ6cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkYAFS2QFZcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkYAFS2QFZcjs.psdToLayers; exports.pullWarpMesh = _chunkZ2H7KECKcjs.pullWarpMesh; exports.put255 = _chunk6GFRKLLScjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk6GFRKLLScjs.rand01; exports.rangeLightness = _chunkYAFS2QFZcjs.rangeLightness; exports.rasterContents = _chunkYAFS2QFZcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkYAFS2QFZcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkYAFS2QFZcjs.rasterizeCoverage; exports.rasterizeDab = _chunk6GFRKLLScjs.rasterizeDab; exports.rasterizeSmartObject = _chunkYAFS2QFZcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkJ5BA3BQ6cjs.readDeepRegion; exports.readPaintSource = _chunk6GFRKLLScjs.readPaintSource; exports.readPixel = _chunkJ5BA3BQ6cjs.readPixel; exports.readPsd = _chunkYAFS2QFZcjs.readPsd; exports.readRegion = _chunkJ5BA3BQ6cjs.readRegion; exports.readSourceRegion = _chunkYT3JL7YMcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunk24ATT2PEcjs.reduceSurface; exports.referencePoint = _chunkYAFS2QFZcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkJ5BA3BQ6cjs.reflectanceToRgb; exports.removeAlpha = _chunkYAFS2QFZcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkYAFS2QFZcjs.removeLayer; exports.removeLayerEffect = _chunkYAFS2QFZcjs.removeLayerEffect; exports.removeLayerFilter = _chunkYAFS2QFZcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk6GFRKLLScjs.removePaintGradientStop; exports.removeSmartFilter = _chunkYAFS2QFZcjs.removeSmartFilter; exports.renderBrushstroke = _chunkZ6OUCS2Kcjs.renderBrushstroke; exports.renderLayerEffects = _chunk24ATT2PEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkYAFS2QFZcjs.renderShape; exports.renderShapeRect = _chunkYAFS2QFZcjs.renderShapeRect; exports.renderSmartObject = _chunkYAFS2QFZcjs.renderSmartObject; exports.renderText = _chunkYAFS2QFZcjs.renderText; exports.replaceContents = _chunkYAFS2QFZcjs.replaceContents; exports.replaceTextRange = _chunkYAFS2QFZcjs.replaceTextRange; exports.requireLayer = _chunkYAFS2QFZcjs.requireLayer; exports.requireOperation = _chunkYAFS2QFZcjs.requireOperation; exports.requireShapeLayer = _chunkYAFS2QFZcjs.requireShapeLayer; exports.requireSmartObject = _chunkYAFS2QFZcjs.requireSmartObject; exports.requireTypeLayer = _chunkYAFS2QFZcjs.requireTypeLayer; exports.requireUnlocked = _chunkYAFS2QFZcjs.requireUnlocked; exports.rerender = _chunkYAFS2QFZcjs.rerender; exports.rerenderShape = _chunkYAFS2QFZcjs.rerenderShape; exports.rerenderText = _chunkYAFS2QFZcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkYAFS2QFZcjs.resizeSelection; exports.resizeWarpMesh = _chunkZ2H7KECKcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkYAFS2QFZcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk6GFRKLLScjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkZ2H7KECKcjs.restyleRange; exports.retouchFilter = _chunkYT3JL7YMcjs.retouchFilter; exports.reversePaintGradient = _chunk6GFRKLLScjs.reversePaintGradient; exports.rgbToGray = _chunkYAFS2QFZcjs.rgbToGray; exports.rgbToHsl = _chunkYAFS2QFZcjs.rgbToHsl; exports.rgbToReflectance = _chunkJ5BA3BQ6cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYT3JL7YMcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkYAFS2QFZcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkYAFS2QFZcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkYAFS2QFZcjs.sampleLut; exports.sampleToneLut = _chunkYAFS2QFZcjs.sampleToneLut; exports.saturationOf = _chunkYT3JL7YMcjs.saturationOf; exports.scaleLayerEffect = _chunk24ATT2PEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk6GFRKLLScjs.scalePaintGradient; exports.seamlessClone = _chunkYT3JL7YMcjs.seamlessClone; exports.selectionArea = _chunkYAFS2QFZcjs.selectionArea; exports.selectionFromCoverage = _chunkYAFS2QFZcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkYAFS2QFZcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkYAFS2QFZcjs.selectionToCoverage; exports.selectionToPixels = _chunkYAFS2QFZcjs.selectionToPixels; exports.selectionValueAt = _chunkYAFS2QFZcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkYAFS2QFZcjs.serializeContents; exports.serializeEffects = _chunkYAFS2QFZcjs.serializeEffects; exports.serializeLayer = _chunkYAFS2QFZcjs.serializeLayer; exports.serializeLayers = _chunkYAFS2QFZcjs.serializeLayers; exports.serializeLayersExternal = _chunkYAFS2QFZcjs.serializeLayersExternal; exports.serializePatterns = _chunkYAFS2QFZcjs.serializePatterns; exports.serializeSelection = _chunkYAFS2QFZcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkYAFS2QFZcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkYAFS2QFZcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkYAFS2QFZcjs.setLayerMask; exports.setLayerProperties = _chunkYAFS2QFZcjs.setLayerProperties; exports.setLum = _chunkJ5BA3BQ6cjs.setLum; exports.setPigmentColor = _chunkJ5BA3BQ6cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkYAFS2QFZcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkYAFS2QFZcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkYAFS2QFZcjs.setSmartPlacement; exports.shadeTile = _chunkFHPVDTI2cjs.shadeTile; exports.shapeAsPixelLayer = _chunkYAFS2QFZcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkYAFS2QFZcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkYAFS2QFZcjs.shapeGeometryBounds; exports.shapeLayers = _chunkYAFS2QFZcjs.shapeLayers; exports.shapeOutline = _chunkYAFS2QFZcjs.shapeOutline; exports.shapeRenderClip = _chunkYAFS2QFZcjs.shapeRenderClip; exports.shiftCoverage = _chunkYAFS2QFZcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkYAFS2QFZcjs.smartObjectLayers; exports.smoothCoverage = _chunkYAFS2QFZcjs.smoothCoverage; exports.smoothPoints = _chunk6GFRKLLScjs.smoothPoints; exports.smudgeEffect = _chunkYT3JL7YMcjs.smudgeEffect; exports.solidPaint = _chunk6GFRKLLScjs.solidPaint; exports.solidSurface = _chunkJ5BA3BQ6cjs.solidSurface; exports.solveMembrane = _chunkYT3JL7YMcjs.solveMembrane; exports.spliceRuns = _chunkZ2H7KECKcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYT3JL7YMcjs.sponge; exports.spongeEffect = _chunkYT3JL7YMcjs.spongeEffect; exports.spotHealPixels = _chunkYT3JL7YMcjs.spotHealPixels; exports.spotHealWindow = _chunkYT3JL7YMcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkFHPVDTI2cjs.srgbByteToLinear; exports.srgbDecode = _chunkJ5BA3BQ6cjs.srgbDecode; exports.srgbEncode = _chunkJ5BA3BQ6cjs.srgbEncode; exports.srgbToLinear = _chunkYAFS2QFZcjs.srgbToLinear; exports.standardBlendMode = _chunkJ5BA3BQ6cjs.standardBlendMode; exports.stepSlotTs = _chunkFHPVDTI2cjs.stepSlotTs; exports.styleAt = _chunkZ2H7KECKcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkJ5BA3BQ6cjs.surfaceBytes; exports.surfaceDepth = _chunkJ5BA3BQ6cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkJ5BA3BQ6cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkJ5BA3BQ6cjs.surfaceFromPixels; exports.surfacesEqual = _chunkJ5BA3BQ6cjs.surfacesEqual; exports.tempTintToXy = _chunkYAFS2QFZcjs.tempTintToXy; exports.temperatureToKelvin = _chunkYAFS2QFZcjs.temperatureToKelvin; exports.textIndexAt = _chunkZ2H7KECKcjs.textIndexAt; exports.textMatrix = _chunkYAFS2QFZcjs.textMatrix; exports.textOutlines = _chunkYAFS2QFZcjs.textOutlines; exports.textRange = _chunkYAFS2QFZcjs.textRange; exports.tileCoord = _chunkJ5BA3BQ6cjs.tileCoord; exports.tileKey = _chunkJ5BA3BQ6cjs.tileKey; exports.tileRect = _chunkJ5BA3BQ6cjs.tileRect; exports.tileSamples = _chunkJ5BA3BQ6cjs.tileSamples; exports.tileSamples16 = _chunkJ5BA3BQ6cjs.tileSamples16; exports.tileSamples32 = _chunkJ5BA3BQ6cjs.tileSamples32; exports.tilesInRect = _chunkJ5BA3BQ6cjs.tilesInRect; exports.tipFalloff = _chunk6GFRKLLScjs.tipFalloff; exports.tipReach = _chunk6GFRKLLScjs.tipReach; exports.tipShape = _chunk6GFRKLLScjs.tipShape; exports.to16From32 = _chunkJ5BA3BQ6cjs.to16From32; exports.to16From8 = _chunkJ5BA3BQ6cjs.to16From8; exports.to32From16 = _chunkJ5BA3BQ6cjs.to32From16; exports.to32From8 = _chunkJ5BA3BQ6cjs.to32From8; exports.to8From16 = _chunkJ5BA3BQ6cjs.to8From16; exports.to8From32 = _chunkJ5BA3BQ6cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkYAFS2QFZcjs.toTextSpace; exports.toneCurve = _chunkYAFS2QFZcjs.toneCurve; exports.toneLuts = _chunkYAFS2QFZcjs.toneLuts; exports.toneOf = _chunkYT3JL7YMcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkYAFS2QFZcjs.transformHomography; exports.transformMap = _chunkYAFS2QFZcjs.transformMap; exports.transformShapeComponents = _chunkYAFS2QFZcjs.transformShapeComponents; exports.transformSurface = _chunk24ATT2PEcjs.transformSurface; exports.transformTypeLayer = _chunkYAFS2QFZcjs.transformTypeLayer; exports.transformedBounds = _chunk24ATT2PEcjs.transformedBounds; exports.transformedBox = _chunkYAFS2QFZcjs.transformedBox; exports.transformedPoint = _chunkYAFS2QFZcjs.transformedPoint; exports.translateSurface = _chunkJ5BA3BQ6cjs.translateSurface; exports.typeAsPixelLayer = _chunkYAFS2QFZcjs.typeAsPixelLayer; exports.typeFrame = _chunkYAFS2QFZcjs.typeFrame; exports.typeFromAnnotation = _chunkYAFS2QFZcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkYAFS2QFZcjs.typeLayerName; exports.ungroupLayer = _chunkYAFS2QFZcjs.ungroupLayer; exports.uniformTile = _chunkJ5BA3BQ6cjs.uniformTile; exports.unionRect = _chunkYAFS2QFZcjs.unionRect; exports.unprojectCanvasPoint = _chunkYAFS2QFZcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkYAFS2QFZcjs.updateLayerEffect; exports.updateLayerFilter = _chunkYAFS2QFZcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkYAFS2QFZcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk6GFRKLLScjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkYAFS2QFZcjs.updateShapeLayer; exports.updateSmartFilter = _chunkYAFS2QFZcjs.updateSmartFilter; exports.updateTypeLayer = _chunkYAFS2QFZcjs.updateTypeLayer; exports.uvToXy = _chunkYAFS2QFZcjs.uvToXy; exports.validateEffectGradient = _chunk24ATT2PEcjs.validateEffectGradient; exports.validateLayerEffect = _chunk24ATT2PEcjs.validateLayerEffect; exports.validateLayerEffects = _chunk24ATT2PEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkYAFS2QFZcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkYAFS2QFZcjs.vibranceLinear; exports.vibrancePixel = _chunkYAFS2QFZcjs.vibrancePixel; exports.walkDabs = _chunk6GFRKLLScjs.walkDabs; exports.warpMeshEditPoints = _chunkZ2H7KECKcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkZ2H7KECKcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkZ2H7KECKcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkZ2H7KECKcjs.warpPresetMesh; exports.warpSurface = _chunk24ATT2PEcjs.warpSurface; exports.wbMatrix = _chunkYAFS2QFZcjs.wbMatrix; exports.wetGpuSupport = _chunkFHPVDTI2cjs.wetGpuSupport; exports.wetSimdSupported = _chunkFHPVDTI2cjs.wetSimdSupported; exports.wetSupport = _chunkFHPVDTI2cjs.wetSupport; exports.whiteBalanceFromSample = _chunkYAFS2QFZcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkYAFS2QFZcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkYAFS2QFZcjs.withFilterMaskSurface; exports.withNewIds = _chunkYAFS2QFZcjs.withNewIds; exports.writeAdjustmentBlock = _chunkYAFS2QFZcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkJ5BA3BQ6cjs.writeDeepRegion; exports.writeLfx2 = _chunkYAFS2QFZcjs.writeLfx2; exports.writePatternBlock = _chunkYAFS2QFZcjs.writePatternBlock; exports.writePsd = _chunkYAFS2QFZcjs.writePsd; exports.writeRegion = _chunkJ5BA3BQ6cjs.writeRegion; exports.xyToTempTint = _chunkYAFS2QFZcjs.xyToTempTint; exports.xyToUv = _chunkYAFS2QFZcjs.xyToUv;
15918
16010
  //# sourceMappingURL=index.cjs.map